@opengeni/react 6.40.0 → 6.41.1-canary.45704649926001

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 (1197) hide show
  1. package/dist/app/app-state.js +34 -34
  2. package/dist/app/components/Composer.js +45 -45
  3. package/dist/app/components/add-card-dialog.js +3 -3
  4. package/dist/app/components/add-card.js +2 -2
  5. package/dist/app/components/agent/agent-capability-picker.js +10 -10
  6. package/dist/app/components/agents/agent-can-use.js +51 -50
  7. package/dist/app/components/agents/agent-cost.js +2 -2
  8. package/dist/app/components/agents/agent-form-page.js +153 -152
  9. package/dist/app/components/agents/agent-form-page.js.map +1 -1
  10. package/dist/app/components/agents/agent-page.js +134 -133
  11. package/dist/app/components/agents/agent-setup-sections.js +81 -80
  12. package/dist/app/components/agents/agent-skills.js +15 -15
  13. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  14. package/dist/app/components/agents/agent-trigger-dialog.js +35 -35
  15. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  16. package/dist/app/components/agents/agent-trigger-repositories.js +16 -16
  17. package/dist/app/components/agents/agents-page.js +99 -98
  18. package/dist/app/components/agents/agents-page.js.map +1 -1
  19. package/dist/app/components/agents/composer-agent-chip.js +60 -59
  20. package/dist/app/components/agents/session-agent-chip.js +55 -54
  21. package/dist/app/components/artifacts/app-package.js +13 -13
  22. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  23. package/dist/app/components/artifacts/artifact-library.js +30 -30
  24. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  25. package/dist/app/components/artifacts/artifact-viewer.js +64 -63
  26. package/dist/app/components/artifacts/artifact-viewer.js.map +1 -1
  27. package/dist/app/components/artifacts/chat-interactive-block.js +30 -28
  28. package/dist/app/components/artifacts/chat-interactive-block.js.map +1 -1
  29. package/dist/app/components/artifacts/copy-artifact-link.js +3 -3
  30. package/dist/app/components/artifacts/file-reach-dialog.js +13 -13
  31. package/dist/app/components/artifacts/inline-chat-image.js +52 -51
  32. package/dist/app/components/artifacts/ready-made-apps.js +13 -13
  33. package/dist/app/components/artifacts/retained-file-preview.js +57 -56
  34. package/dist/app/components/artifacts/retained-text-preview.js +7 -7
  35. package/dist/app/components/artifacts/site-actions.js +11 -11
  36. package/dist/app/components/artifacts/site-audience.js +8 -8
  37. package/dist/app/components/artifacts/site-conversations.js +34 -34
  38. package/dist/app/components/artifacts/site-data.js +30 -30
  39. package/dist/app/components/artifacts/site-public-link.js +1 -1
  40. package/dist/app/components/artifacts/site-publishing-page.js +72 -72
  41. package/dist/app/components/artifacts/site-publishing.js +55 -55
  42. package/dist/app/components/artifacts/site-settings.js +71 -71
  43. package/dist/app/components/artifacts/site-version-menu.js +9 -9
  44. package/dist/app/components/billing-class-mark.js +7 -7
  45. package/dist/app/components/capabilities/capability-detail-sheet.js +18 -18
  46. package/dist/app/components/capabilities/capability-logo-source.js +31 -30
  47. package/dist/app/components/capabilities/capability-logo.js +1 -1
  48. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  49. package/dist/app/components/capabilities/connection-ownership-selector.js +4 -4
  50. package/dist/app/components/capabilities/connector-tool-permissions.js +7 -7
  51. package/dist/app/components/capabilities/detail-dialog.js +3 -3
  52. package/dist/app/components/capabilities/native-connect-setup.js +36 -35
  53. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +7 -7
  54. package/dist/app/components/capabilities/perform-capability-action.js +3 -3
  55. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +35 -34
  56. package/dist/app/components/capabilities/session-capability-card.js +142 -141
  57. package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
  58. package/dist/app/components/capabilities/session-chrome-card.js +49 -49
  59. package/dist/app/components/capabilities/session-connect-inputs-card.js +38 -37
  60. package/dist/app/components/capabilities/session-custom-mcp-card.js +43 -42
  61. package/dist/app/components/capabilities/session-github-card.js +49 -48
  62. package/dist/app/components/capabilities/session-machine-card.js +50 -50
  63. package/dist/app/components/capabilities/session-personal-github-card.js +35 -34
  64. package/dist/app/components/capabilities/session-plugin-card.js +23 -22
  65. package/dist/app/components/capabilities/use-capabilities-catalog.js +4 -4
  66. package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
  67. package/dist/app/components/command-menu/chat-status.js +25 -25
  68. package/dist/app/components/command-menu/chat-switcher.js +90 -89
  69. package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
  70. package/dist/app/components/command-menu/command-menu.js +118 -117
  71. package/dist/app/components/command-menu/command-menu.js.map +1 -1
  72. package/dist/app/components/command-menu/shortcut-sheet.js +26 -26
  73. package/dist/app/components/composer-capabilities-menu-body.js +7 -7
  74. package/dist/app/components/composer-mobile-plus-panel.js +32 -32
  75. package/dist/app/components/composer-mobile-plus.js +5 -5
  76. package/dist/app/components/credit-amount-picker.js +2 -2
  77. package/dist/app/components/credit-required-gate.js +6 -6
  78. package/dist/app/components/credit-required-prompt.js +27 -27
  79. package/dist/app/components/credits/checkout-credits-celebration.js +4 -4
  80. package/dist/app/components/credits/checkout-return.js +4 -4
  81. package/dist/app/components/credits/coupon-redeem.js +1 -1
  82. package/dist/app/components/credits/credit-refusal-notice.js +8 -8
  83. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  84. package/dist/app/components/cross-slot-deep-link-recovery.js +2 -2
  85. package/dist/app/components/desktop/app-shots.js +10 -10
  86. package/dist/app/components/desktop/app-update.js +3 -3
  87. package/dist/app/components/desktop/computer-use.js +4 -4
  88. package/dist/app/components/desktop/this-computer.js +8 -8
  89. package/dist/app/components/feedback.js +11 -11
  90. package/dist/app/components/follow-up-repository-menu-body.js +12 -12
  91. package/dist/app/components/follow-up-repository-picker.js +1 -1
  92. package/dist/app/components/github-app-connect-launcher.js +2 -2
  93. package/dist/app/components/in-app-help-link.js +3 -3
  94. package/dist/app/components/knowledge/agent-learning-settings.js +5 -5
  95. package/dist/app/components/machines/connect-machine-dialog.js +25 -25
  96. package/dist/app/components/manual-repository-editor.js +1 -1
  97. package/dist/app/components/markdown.js +18 -17
  98. package/dist/app/components/model-identity.js +3 -3
  99. package/dist/app/components/models/models-ui.js +17 -17
  100. package/dist/app/components/models/provider-mark.js +3 -3
  101. package/dist/app/components/models/subscription-usage.js +5 -5
  102. package/dist/app/components/my-things.js +19 -19
  103. package/dist/app/components/own-where-it-works.js +12 -12
  104. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  105. package/dist/app/components/pickers.js +12 -12
  106. package/dist/app/components/rail/channel-create-dialog.js +6 -6
  107. package/dist/app/components/rail/project-glyph.js +54 -53
  108. package/dist/app/components/rail/project-profile.js +76 -75
  109. package/dist/app/components/rail/rail-context.js +2 -2
  110. package/dist/app/components/rail/rail-sections.js +155 -154
  111. package/dist/app/components/rail/session-header.js +125 -124
  112. package/dist/app/components/rail/session-list.js +153 -152
  113. package/dist/app/components/rail/session-row-content.js +6 -6
  114. package/dist/app/components/rail/session-row-hover-details.js +36 -36
  115. package/dist/app/components/rail/session-shell.js +194 -193
  116. package/dist/app/components/rail/site-session-group-heading.js +37 -37
  117. package/dist/app/components/repository-picker.js +12 -12
  118. package/dist/app/components/secrets/session-secrets-panel.js +3 -3
  119. package/dist/app/components/session/agent-configuration-panel.js +53 -53
  120. package/dist/app/components/session/artifact-session-page.js +8 -8
  121. package/dist/app/components/session/banners.js +22 -21
  122. package/dist/app/components/session/chat-avatar.js +54 -53
  123. package/dist/app/components/session/console-new-conversation.js +105 -104
  124. package/dist/app/components/session/descendant-requests.js +101 -100
  125. package/dist/app/components/session/descendant-requests.js.map +1 -1
  126. package/dist/app/components/session/editable-artifacts-workspace.js +62 -60
  127. package/dist/app/components/session/editable-artifacts-workspace.js.map +1 -1
  128. package/dist/app/components/session/failed-session-banner.js +28 -28
  129. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  130. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  131. package/dist/app/components/session/human-input.js +88 -87
  132. package/dist/app/components/session/inspector.js +136 -135
  133. package/dist/app/components/session/inspector.js.map +1 -1
  134. package/dist/app/components/session/linked-panel.js +3 -3
  135. package/dist/app/components/session/message-actions.js +11 -11
  136. package/dist/app/components/session/model-recovery-notice.js +4 -4
  137. package/dist/app/components/session/new-session-settings-menu.js +32 -32
  138. package/dist/app/components/session/new-session-setup-strip.js +58 -57
  139. package/dist/app/components/session/own-account-wait-notice.js +8 -8
  140. package/dist/app/components/session/pinned-account-wait-notice.js +8 -8
  141. package/dist/app/components/session/pull-request-panel.js +26 -25
  142. package/dist/app/components/session/sandbox-recovery-actions.js +5 -5
  143. package/dist/app/components/session/sandbox-switcher.js +22 -22
  144. package/dist/app/components/session/sandbox-workspace.js +118 -117
  145. package/dist/app/components/session/search-markdown-highlight.js +19 -18
  146. package/dist/app/components/session/search-results-view.js +20 -19
  147. package/dist/app/components/session/session-admin-access.js +12 -12
  148. package/dist/app/components/session/session-admission-notice.js +11 -11
  149. package/dist/app/components/session/session-avatar-picker.js +61 -60
  150. package/dist/app/components/session/session-avatar.js +56 -55
  151. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  152. package/dist/app/components/session/session-profile-dialog.js +72 -71
  153. package/dist/app/components/session/session-profile-editor.js +73 -72
  154. package/dist/app/components/session/session-retention.js +8 -8
  155. package/dist/app/components/session/session-search-dialog.js +26 -25
  156. package/dist/app/components/session/session-search-dialog.js.map +1 -1
  157. package/dist/app/components/session/session-skill-reviews.js +5 -5
  158. package/dist/app/components/session/session-tenancy-control.js +25 -25
  159. package/dist/app/components/session/session-unattended-setting.js +4 -4
  160. package/dist/app/components/session/session-usage-limit-section.js +13 -13
  161. package/dist/app/components/session/share-chat-dialog.js +12 -12
  162. package/dist/app/components/session/subagents.js +22 -22
  163. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  164. package/dist/app/components/session/subscription-account-menu.js +7 -7
  165. package/dist/app/components/session-connectors-menu-body.js +11 -11
  166. package/dist/app/components/settings/row-select.js +6 -6
  167. package/dist/app/components/transcription-settings.js +10 -10
  168. package/dist/app/components/ui/destructive-confirm.js +11 -11
  169. package/dist/app/components/usage/usage-entry.js +8 -8
  170. package/dist/app/components/window-bar.js +25 -25
  171. package/dist/app/components/workspace-composer-plus.js +46 -45
  172. package/dist/app/components/workspace-reach.d.ts +2 -0
  173. package/dist/app/components/workspace-reach.js +6 -6
  174. package/dist/app/embed/session-app.js +406 -405
  175. package/dist/app/lib/actions/actions-provider.js +18 -18
  176. package/dist/app/lib/agent-capabilities.js +4 -4
  177. package/dist/app/lib/app-connect-card.js +16 -16
  178. package/dist/app/lib/app-shared-key-dialog.js +9 -9
  179. package/dist/app/lib/app-surfaces.js +1 -1
  180. package/dist/app/lib/app-sync-opt-in.js +7 -7
  181. package/dist/app/lib/codex-usage-query.js +3 -3
  182. package/dist/app/lib/composer-agent.js +2 -2
  183. package/dist/app/lib/composer-connectors.js +35 -34
  184. package/dist/app/lib/composer-send-blocking.js +2 -2
  185. package/dist/app/lib/console-site.js +9 -9
  186. package/dist/app/lib/console-text.js +2 -2
  187. package/dist/app/lib/events.js +32 -31
  188. package/dist/app/lib/failed-session-copy.js +5 -5
  189. package/dist/app/lib/feedback-capture.js +2 -2
  190. package/dist/app/lib/model-access-onboarding.js +4 -4
  191. package/dist/app/lib/move-chat-to-machine.js +5 -5
  192. package/dist/app/lib/personal-resource-attachments.js +1 -1
  193. package/dist/app/lib/session-branch-cache.js +18 -18
  194. package/dist/app/lib/session-create.js +5 -5
  195. package/dist/app/lib/session-group-pagination.js +18 -18
  196. package/dist/app/lib/session-hover-facts.js +25 -25
  197. package/dist/app/lib/session-list-dirty-scopes.js +19 -19
  198. package/dist/app/lib/session-model.js +2 -2
  199. package/dist/app/lib/session-rail.js +15 -15
  200. package/dist/app/lib/session-rename.js +3 -3
  201. package/dist/app/lib/sessions-group.js +23 -23
  202. package/dist/app/lib/site-tool-consent-dialog.js +24 -24
  203. package/dist/app/lib/site-tool-consent.js +1 -1
  204. package/dist/app/lib/turn-failure-analytics.js +6 -6
  205. package/dist/app/lib/use-artifact-catalog.js +2 -2
  206. package/dist/app/lib/use-duplicate-site.js +4 -4
  207. package/dist/app/lib/use-follow-up-repositories.js +9 -9
  208. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  209. package/dist/app/lib/use-workspace-integrations.js +2 -2
  210. package/dist/app/lib/use-workspace-machines.js +10 -10
  211. package/dist/app/lib/use-workspace-model-catalog.js +6 -6
  212. package/dist/app/lib/use-workspace-rigs.js +6 -6
  213. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  214. package/dist/app/lib/workspace-scope-context.js +4 -4
  215. package/dist/app/routes/app-page-view.js +52 -50
  216. package/dist/app/routes/app-page-view.js.map +1 -1
  217. package/dist/app/routes/app-page.js +2 -2
  218. package/dist/app/routes/artifacts.js +170 -168
  219. package/dist/app/routes/artifacts.js.map +1 -1
  220. package/dist/app/routes/retained-artifact.js +110 -109
  221. package/dist/app/routes/retained-artifact.js.map +1 -1
  222. package/dist/app/routes/session-unavailable.js +6 -6
  223. package/dist/app/routes/session.js +249 -248
  224. package/dist/app/routes/sessions-index-hydration.js +6 -6
  225. package/dist/app/routes/sessions-index.js +204 -203
  226. package/dist/app/routes/site-view.js +210 -209
  227. package/dist/app/routes/site-view.js.map +1 -1
  228. package/dist/artifacts-document.js +4 -4
  229. package/dist/artifacts-presentation.js +9 -9
  230. package/dist/artifacts-spreadsheet.js +4 -4
  231. package/dist/artifacts.js +53 -51
  232. package/dist/automation-model.js +6 -6
  233. package/dist/automations.js +64 -64
  234. package/dist/browser-viewer-TRPZI6NT.js +23 -0
  235. package/dist/chat-interactive-block-Y4BS4JCM.js +24 -0
  236. package/dist/chunk-22E2YJHT.js +469 -0
  237. package/dist/chunk-2T6TN2YL.js +538 -0
  238. package/dist/chunk-2WNN26NW.js +175 -0
  239. package/dist/chunk-3432A6XB.js +88 -0
  240. package/dist/chunk-35U7NSOR.js +366 -0
  241. package/dist/chunk-3EPR76WS.js +773 -0
  242. package/dist/chunk-3FXXEU5D.js +144 -0
  243. package/dist/chunk-3MXOPOEU.js +650 -0
  244. package/dist/chunk-3PKDU4JI.js +340 -0
  245. package/dist/chunk-3PMO2BIV.js +12 -0
  246. package/dist/chunk-3XWHJNFY.js +48 -0
  247. package/dist/chunk-45WD2PKE.js +401 -0
  248. package/dist/chunk-4H2OWNRA.js +598 -0
  249. package/dist/chunk-4HVGOTMU.js +263 -0
  250. package/dist/chunk-4JER2ZMV.js +818 -0
  251. package/dist/chunk-4LVZ2VOQ.js +214 -0
  252. package/dist/chunk-4OGDD2EM.js +2434 -0
  253. package/dist/chunk-4PQC6WMF.js +54 -0
  254. package/dist/chunk-4UVSWAT3.js +794 -0
  255. package/dist/chunk-53A47RBX.js +214 -0
  256. package/dist/chunk-552KKENW.js +114 -0
  257. package/dist/chunk-55F7L6M3.js +177 -0
  258. package/dist/chunk-5AHIKB3O.js +449 -0
  259. package/dist/chunk-5KQD6MLJ.js +3996 -0
  260. package/dist/chunk-5KQD6MLJ.js.map +1 -0
  261. package/dist/chunk-5N4L5WTE.js +199 -0
  262. package/dist/chunk-5OUJCVZI.js +79 -0
  263. package/dist/chunk-5OYXQ7MH.js +65 -0
  264. package/dist/chunk-5RGF74K5.js +371 -0
  265. package/dist/chunk-5RGF74K5.js.map +1 -0
  266. package/dist/chunk-5TAVVMFX.js +225 -0
  267. package/dist/chunk-5Y3LYRNH.js +269 -0
  268. package/dist/chunk-5ZJKKE4T.js +386 -0
  269. package/dist/chunk-62DPSQRZ.js +57 -0
  270. package/dist/chunk-64KMWTJ6.js +608 -0
  271. package/dist/chunk-6F34IWSA.js +47 -0
  272. package/dist/chunk-6F34IWSA.js.map +1 -0
  273. package/dist/chunk-6MZBNUS7.js +73 -0
  274. package/dist/chunk-6YCE4ZC4.js +250 -0
  275. package/dist/chunk-6YROWWMX.js +175 -0
  276. package/dist/chunk-73RZ72VU.js +1236 -0
  277. package/dist/chunk-74KV436L.js +84 -0
  278. package/dist/chunk-7HKGLPV5.js +83 -0
  279. package/dist/chunk-7JSWODT6.js +466 -0
  280. package/dist/chunk-7K3PKWER.js +428 -0
  281. package/dist/chunk-7MPWC42V.js +1356 -0
  282. package/dist/chunk-7REO6FRN.js +141 -0
  283. package/dist/chunk-7V3OL7JC.js +850 -0
  284. package/dist/chunk-7V3OL7JC.js.map +1 -0
  285. package/dist/chunk-7YMWRNRQ.js +145 -0
  286. package/dist/chunk-A6H3KJ7G.js +131 -0
  287. package/dist/chunk-AGQIE6YU.js +1769 -0
  288. package/dist/chunk-AHQM4I5V.js +373 -0
  289. package/dist/chunk-AMTRO7XF.js +172 -0
  290. package/dist/chunk-AO4LTCG7.js +91 -0
  291. package/dist/chunk-APJ22OZV.js +2580 -0
  292. package/dist/chunk-APWL37KW.js +407 -0
  293. package/dist/chunk-AQEJOBQ2.js +15 -0
  294. package/dist/chunk-ARKNT6BX.js +234 -0
  295. package/dist/chunk-B2IHDMAR.js +211 -0
  296. package/dist/chunk-BCKIV26W.js +112 -0
  297. package/dist/chunk-BE26JUSD.js +259 -0
  298. package/dist/chunk-BOVCD6KD.js +171 -0
  299. package/dist/chunk-BQWV66A6.js +129 -0
  300. package/dist/chunk-BSQJXGGP.js +441 -0
  301. package/dist/chunk-BZY3MEVZ.js +3183 -0
  302. package/dist/chunk-C3D3OOEY.js +335 -0
  303. package/dist/chunk-CDHYO3DP.js +82 -0
  304. package/dist/chunk-CDV5JGVI.js +79 -0
  305. package/dist/chunk-CNW45M7G.js +207 -0
  306. package/dist/chunk-CUVQ37HB.js +150 -0
  307. package/dist/chunk-D32T3IIC.js +532 -0
  308. package/dist/chunk-D32VVOBJ.js +738 -0
  309. package/dist/chunk-D32VVOBJ.js.map +1 -0
  310. package/dist/chunk-D65BSM64.js +371 -0
  311. package/dist/chunk-D7435DWV.js +570 -0
  312. package/dist/chunk-DFH3M7B3.js +72 -0
  313. package/dist/chunk-DGWBQ76M.js +162 -0
  314. package/dist/chunk-DHJDTGSJ.js +372 -0
  315. package/dist/chunk-DKEFTNCD.js +400 -0
  316. package/dist/chunk-DNAF6MT4.js +107 -0
  317. package/dist/chunk-DSJ7K5IF.js +380 -0
  318. package/dist/chunk-DSJ7K5IF.js.map +1 -0
  319. package/dist/chunk-E35XY7DS.js +27 -0
  320. package/dist/chunk-E5T5WIIP.js +396 -0
  321. package/dist/chunk-EL6ECD34.js +166 -0
  322. package/dist/chunk-ELR6ITRC.js +467 -0
  323. package/dist/chunk-EPE3V2VE.js +851 -0
  324. package/dist/chunk-EYGQHHVW.js +584 -0
  325. package/dist/chunk-EYQEJHYP.js +307 -0
  326. package/dist/chunk-EZTH2XMH.js +276 -0
  327. package/dist/chunk-F3QVHVFS.js +287 -0
  328. package/dist/chunk-F5VWPREQ.js +1187 -0
  329. package/dist/chunk-FM7AQUBL.js +113 -0
  330. package/dist/chunk-FP6BUXJM.js +100 -0
  331. package/dist/chunk-FVU52L3I.js +249 -0
  332. package/dist/chunk-FZKNXNNO.js +218 -0
  333. package/dist/chunk-G3IXJWRY.js +236 -0
  334. package/dist/chunk-G6EI2O3N.js +333 -0
  335. package/dist/chunk-G7KHMA3E.js +256 -0
  336. package/dist/chunk-G7KHMA3E.js.map +1 -0
  337. package/dist/chunk-GB5T6YMZ.js +401 -0
  338. package/dist/chunk-GBLD6FOG.js +157 -0
  339. package/dist/chunk-GJBFFXCY.js +137 -0
  340. package/dist/chunk-GJDP2K2S.js +66 -0
  341. package/dist/chunk-GP26XTDX.js +187 -0
  342. package/dist/chunk-GTE6WP4N.js +606 -0
  343. package/dist/chunk-GWG3OAV7.js +108 -0
  344. package/dist/chunk-GXMHTMM6.js +931 -0
  345. package/dist/chunk-GYRN5O2E.js +107 -0
  346. package/dist/chunk-GZX7W2WW.js +65 -0
  347. package/dist/chunk-H3QI2G2B.js +403 -0
  348. package/dist/chunk-H7D4DVWY.js +849 -0
  349. package/dist/chunk-HCDGBBBJ.js +191 -0
  350. package/dist/chunk-HDSH6MIJ.js +3851 -0
  351. package/dist/chunk-HOEUPZ6O.js +89 -0
  352. package/dist/chunk-HPQRWTQB.js +772 -0
  353. package/dist/chunk-HUKGLWAY.js +174 -0
  354. package/dist/chunk-HUTQJY3F.js +23 -0
  355. package/dist/chunk-HWOYJOKK.js +266 -0
  356. package/dist/chunk-HZR3WGUP.js +96 -0
  357. package/dist/chunk-I7YUDPDR.js +138 -0
  358. package/dist/chunk-IDII52M4.js +27 -0
  359. package/dist/chunk-IDPWEUM7.js +103 -0
  360. package/dist/chunk-IEWQFGEC.js +192 -0
  361. package/dist/chunk-IKWGPFT5.js +300 -0
  362. package/dist/chunk-IKWGPFT5.js.map +1 -0
  363. package/dist/chunk-IMTACEXF.js +351 -0
  364. package/dist/chunk-IVWT6M6N.js +114 -0
  365. package/dist/chunk-JE2YXAVR.js +485 -0
  366. package/dist/chunk-JE2YXAVR.js.map +1 -0
  367. package/dist/chunk-JEUPIHIP.js +111 -0
  368. package/dist/chunk-JF4WX3GQ.js +168 -0
  369. package/dist/chunk-JJPYXUKC.js +2591 -0
  370. package/dist/chunk-JNHWTYDD.js +43 -0
  371. package/dist/chunk-JP7AOJWD.js +46 -0
  372. package/dist/chunk-JTWT2WQA.js +297 -0
  373. package/dist/chunk-JW3WIHWO.js +117 -0
  374. package/dist/chunk-JW7RJMEZ.js +134 -0
  375. package/dist/chunk-K76PXR3O.js +2317 -0
  376. package/dist/chunk-KCNIQN6V.js +107 -0
  377. package/dist/chunk-KH6KHYST.js +231 -0
  378. package/dist/chunk-KK4SEN7N.js +247 -0
  379. package/dist/chunk-KOKRGAAI.js +383 -0
  380. package/dist/chunk-KQFNTGAF.js +187 -0
  381. package/dist/chunk-KRLNC6TH.js +50 -0
  382. package/dist/chunk-KYDLVMKA.js +99 -0
  383. package/dist/chunk-KZQDP2JM.js +155 -0
  384. package/dist/chunk-L2EZ2HOX.js +132 -0
  385. package/dist/chunk-L2UAFR2D.js +33 -0
  386. package/dist/chunk-L4R7ORMD.js +4596 -0
  387. package/dist/chunk-LCLWN64E.js +227 -0
  388. package/dist/chunk-LFQI2C46.js +175 -0
  389. package/dist/chunk-LLYX4F5A.js +1628 -0
  390. package/dist/chunk-LQX5QCDS.js +215 -0
  391. package/dist/chunk-LRMHASG2.js +196 -0
  392. package/dist/chunk-LVUSG56I.js +5930 -0
  393. package/dist/chunk-LVUSG56I.js.map +1 -0
  394. package/dist/chunk-M5FX5KH5.js +629 -0
  395. package/dist/chunk-MLOTUQJJ.js +201 -0
  396. package/dist/chunk-MPUKGKXZ.js +209 -0
  397. package/dist/chunk-MS6LW4VU.js +283 -0
  398. package/dist/chunk-MWN7LDYV.js +4601 -0
  399. package/dist/chunk-MWN7LDYV.js.map +1 -0
  400. package/dist/chunk-MXPW4F74.js +278 -0
  401. package/dist/chunk-MZ7GJX5S.js +158 -0
  402. package/dist/chunk-N5OUIUYD.js +1260 -0
  403. package/dist/chunk-N6FNORC7.js +412 -0
  404. package/dist/chunk-NALVKY4U.js +113 -0
  405. package/dist/chunk-NJ77ZL5T.js +5222 -0
  406. package/dist/chunk-NM2DNJDJ.js +270 -0
  407. package/dist/chunk-NNKRRF7E.js +110 -0
  408. package/dist/chunk-NP5UFWU4.js +318 -0
  409. package/dist/chunk-NV3AEIFO.js +118 -0
  410. package/dist/chunk-O6JDF7KH.js +828 -0
  411. package/dist/chunk-OERZH3J4.js +251 -0
  412. package/dist/chunk-OKHWTWWU.js +1152 -0
  413. package/dist/chunk-OLAIUVGT.js +274 -0
  414. package/dist/chunk-OO36IUMS.js +270 -0
  415. package/dist/chunk-OVDK7K2Z.js +57 -0
  416. package/dist/chunk-OX5ZCHZQ.js +63 -0
  417. package/dist/chunk-P6LLCGPO.js +515 -0
  418. package/dist/chunk-PA2CUHTD.js +505 -0
  419. package/dist/chunk-PB4CQIRA.js +4979 -0
  420. package/dist/chunk-PBV2P632.js +566 -0
  421. package/dist/chunk-PCSRHFRF.js +75 -0
  422. package/dist/chunk-PEPWW5BC.js +436 -0
  423. package/dist/chunk-PMBZMVKE.js +33 -0
  424. package/dist/chunk-PP32RE26.js +34 -0
  425. package/dist/chunk-PTXAPI3Q.js +73 -0
  426. package/dist/chunk-PULNNF7G.js +56 -0
  427. package/dist/chunk-Q6KNROUT.js +158 -0
  428. package/dist/chunk-QEGP3HSW.js +184 -0
  429. package/dist/chunk-QEGP3HSW.js.map +1 -0
  430. package/dist/chunk-QGJIFIKN.js +1032 -0
  431. package/dist/chunk-QKKKORGL.js +41 -0
  432. package/dist/chunk-QKUMMG6P.js +85 -0
  433. package/dist/chunk-QNOWKKZ4.js +40 -0
  434. package/dist/chunk-QSWD3AHE.js +84 -0
  435. package/dist/chunk-QZ4U2VL5.js +391 -0
  436. package/dist/chunk-QZJNCLHV.js +271 -0
  437. package/dist/chunk-R6CFPY3F.js +278 -0
  438. package/dist/chunk-R6QRUYUH.js +406 -0
  439. package/dist/chunk-RE3GAQI5.js +2984 -0
  440. package/dist/chunk-RFHUVPFA.js +1184 -0
  441. package/dist/chunk-RH45HT5T.js +3690 -0
  442. package/dist/chunk-RJNQTZ5O.js +439 -0
  443. package/dist/chunk-RN24AP7Q.js +247 -0
  444. package/dist/chunk-RN24AP7Q.js.map +1 -0
  445. package/dist/chunk-S2BJTAAB.js +37 -0
  446. package/dist/chunk-S56PWXIX.js +138 -0
  447. package/dist/chunk-S6BDABIC.js +1390 -0
  448. package/dist/chunk-S6BDABIC.js.map +1 -0
  449. package/dist/chunk-S6FFDIHD.js +640 -0
  450. package/dist/chunk-S6MAMIK2.js +56 -0
  451. package/dist/chunk-SERTO6H6.js +311 -0
  452. package/dist/chunk-STOOH7EI.js +200 -0
  453. package/dist/chunk-SWSTEUXX.js +121 -0
  454. package/dist/chunk-SWZN7NNZ.js +1029 -0
  455. package/dist/chunk-SYDF57KS.js +178 -0
  456. package/dist/chunk-T275CUVD.js +29 -0
  457. package/dist/chunk-T4OT7QWP.js +378 -0
  458. package/dist/chunk-TCSRY2NP.js +2582 -0
  459. package/dist/chunk-TCX5OA2X.js +1177 -0
  460. package/dist/chunk-TDW5CSO5.js +3158 -0
  461. package/dist/chunk-TGG3ODCS.js +99 -0
  462. package/dist/chunk-TILSTYUC.js +505 -0
  463. package/dist/chunk-TJ5DYWXU.js +1333 -0
  464. package/dist/chunk-TNRI4ZE6.js +391 -0
  465. package/dist/chunk-TPIFVUMF.js +188 -0
  466. package/dist/chunk-TSW6OF22.js +162 -0
  467. package/dist/chunk-TTSTBHGR.js +1095 -0
  468. package/dist/chunk-U3JYAWMR.js +170 -0
  469. package/dist/chunk-U7ODSHA5.js +124 -0
  470. package/dist/chunk-UEGEPRNP.js +48 -0
  471. package/dist/chunk-UGIA2YEJ.js +83 -0
  472. package/dist/chunk-UHLKKDNF.js +432 -0
  473. package/dist/chunk-ULVXKIPX.js +26 -0
  474. package/dist/chunk-UN37ZY6R.js +10074 -0
  475. package/dist/chunk-UN37ZY6R.js.map +1 -0
  476. package/dist/chunk-USUDKZ5G.js +98 -0
  477. package/dist/chunk-UVO6I2F6.js +85 -0
  478. package/dist/chunk-V6NVG4K2.js +357 -0
  479. package/dist/chunk-VCMQFD3G.js +1185 -0
  480. package/dist/chunk-VKPBDNIO.js +246 -0
  481. package/dist/chunk-VLDKWGHD.js +61 -0
  482. package/dist/chunk-VM2NA2EL.js +905 -0
  483. package/dist/chunk-VMZTCVEL.js +114 -0
  484. package/dist/chunk-VQH5AXZY.js +269 -0
  485. package/dist/chunk-VTBTW6N4.js +114 -0
  486. package/dist/chunk-VV7PLDX4.js +230 -0
  487. package/dist/chunk-VYGGLH5H.js +50 -0
  488. package/dist/chunk-VYQHHTQ4.js +133 -0
  489. package/dist/chunk-VYSGRD2W.js +292 -0
  490. package/dist/chunk-W4W63LTP.js +1309 -0
  491. package/dist/chunk-WFC2JA6D.js +2335 -0
  492. package/dist/chunk-WFC2JA6D.js.map +1 -0
  493. package/dist/chunk-WHTRR66J.js +197 -0
  494. package/dist/chunk-WICIQFHJ.js +42 -0
  495. package/dist/chunk-WJYYMCCC.js +283 -0
  496. package/dist/chunk-WSJOWQJE.js +399 -0
  497. package/dist/chunk-WY333GHH.js +108 -0
  498. package/dist/chunk-WY333GHH.js.map +1 -0
  499. package/dist/chunk-WYDUXZ2R.js +353 -0
  500. package/dist/chunk-X62CN4YR.js +3321 -0
  501. package/dist/chunk-XFQHKMO6.js +1024 -0
  502. package/dist/chunk-XGJ7XZHS.js +527 -0
  503. package/dist/chunk-XJFJNOEV.js +723 -0
  504. package/dist/chunk-XKJLHMXZ.js +234 -0
  505. package/dist/chunk-XLFPJVQS.js +103 -0
  506. package/dist/chunk-XM4ZLZFW.js +129 -0
  507. package/dist/chunk-Y2GAWEJD.js +1021 -0
  508. package/dist/chunk-Y3A74SVK.js +296 -0
  509. package/dist/chunk-YANEVGI3.js +92 -0
  510. package/dist/chunk-YHHSO5QR.js +128 -0
  511. package/dist/chunk-YOSOCHCB.js +52 -0
  512. package/dist/chunk-YP4SNX4P.js +220 -0
  513. package/dist/chunk-YQH6AMIH.js +176 -0
  514. package/dist/chunk-YRWL2IAE.js +165 -0
  515. package/dist/chunk-YTWRQ3WK.js +251 -0
  516. package/dist/chunk-YV5GGSLK.js +20 -0
  517. package/dist/chunk-YXUDK37V.js +126 -0
  518. package/dist/chunk-YYM5TSCR.js +75 -0
  519. package/dist/chunk-ZG2CKFQF.js +202 -0
  520. package/dist/chunk-ZGJXO2HH.js +93 -0
  521. package/dist/chunk-ZGV76PZ4.js +3070 -0
  522. package/dist/chunk-ZOBUR2VC.js +229 -0
  523. package/dist/components/artifacts/artifact-chrome.d.ts +4 -0
  524. package/dist/components/artifacts/artifact-sandbox.d.ts +13 -0
  525. package/dist/components/artifacts/inline-html-document.d.ts +10 -1
  526. package/dist/components/artifacts/published-html-artifact-frame.d.ts +17 -0
  527. package/dist/components/preview-loading.d.ts +3 -1
  528. package/dist/composer.js +37 -37
  529. package/dist/computer-viewer-S6AL3XDT.js +21 -0
  530. package/dist/connect.js +38 -37
  531. package/dist/connection-step-up-XGPZKQEL.js +149 -0
  532. package/dist/connection-step-up-XGPZKQEL.js.map +1 -0
  533. package/dist/desktop-dictation.js +23 -23
  534. package/dist/desktop.js +2 -2
  535. package/dist/editor.js +2 -2
  536. package/dist/embedded-new-voice-T3BXRYJX.js +25 -0
  537. package/dist/embedded-voice-ZJXMF3RP.js +25 -0
  538. package/dist/fleet-decision-row-AUCMLBCV.js +361 -0
  539. package/dist/in-chat-connect-model.js +5 -5
  540. package/dist/index.js +296 -295
  541. package/dist/interaction.js +9 -9
  542. package/dist/latest-question-D5BKKEP6.js +1 -1
  543. package/dist/machine-request-model.js +1 -1
  544. package/dist/machines.js +8 -8
  545. package/dist/meetings/meeting-detail-page.d.ts +14 -0
  546. package/dist/meetings/meeting-notes.d.ts +6 -2
  547. package/dist/meetings/meeting-transcript.d.ts +3 -1
  548. package/dist/meetings-recorder.js +1 -1
  549. package/dist/meetings.js +367 -260
  550. package/dist/meetings.js.map +1 -1
  551. package/dist/messages/en.d.ts +6 -2
  552. package/dist/messages.js +1 -1
  553. package/dist/model-policy-picker-menu-TO57YUQ6.js +23 -0
  554. package/dist/native-previews.js +1 -1
  555. package/dist/payment-page-card-DFGDAMTG.js +227 -0
  556. package/dist/platform-activity-row-ZMBEJGXN.js +156 -0
  557. package/dist/queue-surface-implementation-KDK5CYH6.js +933 -0
  558. package/dist/realtime.js +17 -17
  559. package/dist/recorder-host-3HLYRL4H.js +80 -0
  560. package/dist/recordings.js +3 -3
  561. package/dist/sandbox-files-UOZ4OJZU.js +29 -0
  562. package/dist/session-app.js +406 -405
  563. package/dist/session-connect-cards-VZIYLH45.js +28 -0
  564. package/dist/session-list-model.js +2 -2
  565. package/dist/session-realtime-2ZGJWVZP.js +30 -0
  566. package/dist/session-realtime.js +2 -2
  567. package/dist/session-ui.js +98 -97
  568. package/dist/session.js +40 -40
  569. package/dist/sites.js +3 -3
  570. package/dist/skills.js +32 -32
  571. package/dist/terminal.js +2 -2
  572. package/dist/testing/meetings-fixture.d.ts +8 -0
  573. package/dist/testing/meetings-fixture.js +22 -1
  574. package/dist/testing/meetings-fixture.js.map +1 -1
  575. package/dist/this-computer.js +3 -3
  576. package/dist/timeline-annotation-markers-KBTFWLME.js +157 -0
  577. package/dist/timeline-annotation-selection-VI4YSDR5.js +208 -0
  578. package/dist/timeline-annotations-dialog-4PLWNLRB.js +283 -0
  579. package/dist/timeline-model.js +37 -37
  580. package/dist/ui/access-list.js +24 -24
  581. package/dist/ui/cadence-picker.js +7 -7
  582. package/dist/ui/capability-page.js +10 -10
  583. package/dist/ui/choice-cards.js +3 -3
  584. package/dist/ui/confirm-dialog.js +4 -4
  585. package/dist/ui/copy-field.js +3 -3
  586. package/dist/ui/detail-page.js +6 -6
  587. package/dist/ui/detail-sheet.js +6 -6
  588. package/dist/ui/dialog.js +2 -2
  589. package/dist/ui/diff-view.js +3 -3
  590. package/dist/ui/disclosure.js +7 -7
  591. package/dist/ui/email-chips-input.js +3 -3
  592. package/dist/ui/field.js +2 -2
  593. package/dist/ui/flush-form-page.js +8 -8
  594. package/dist/ui/form-dialog.js +7 -7
  595. package/dist/ui/list-row.js +7 -7
  596. package/dist/ui/load-failure.js +3 -3
  597. package/dist/ui/relative-time.js +3 -3
  598. package/dist/ui/revision-history.js +16 -16
  599. package/dist/ui/role-select.js +13 -13
  600. package/dist/ui/select-menu.js +5 -5
  601. package/dist/ui/settings-nav.js +6 -6
  602. package/dist/ui/sheet.js +2 -2
  603. package/dist/ui/usage-meter.js +4 -4
  604. package/dist/usage.js +3 -3
  605. package/dist/workbench.js +11 -11
  606. package/package.json +6 -5
  607. package/src/app/components/session/sandbox-recovery-actions.test.tsx +26 -0
  608. package/src/app/components/session/sandbox-recovery-actions.tsx +2 -1
  609. package/src/app/components/workspace-reach.tsx +2 -0
  610. package/src/components/artifacts/artifact-chrome.tsx +6 -0
  611. package/src/components/artifacts/artifact-sandbox.tsx +119 -20
  612. package/src/components/artifacts/chat-interactive-block.tsx +1 -0
  613. package/src/components/artifacts/inline-html-document.ts +13 -3
  614. package/src/components/artifacts/published-html-artifact-frame.tsx +60 -4
  615. package/src/components/preview-loading.tsx +2 -2
  616. package/src/meetings/meeting-detail-page.tsx +232 -112
  617. package/src/meetings/meeting-notes.tsx +48 -24
  618. package/src/meetings/meeting-transcript.tsx +75 -57
  619. package/src/meetings/meetings-pages.test.tsx +181 -2
  620. package/src/messages/en.ts +6 -2
  621. package/src/testing/meetings-fixture.ts +35 -1
  622. package/styles/compiled.css +8 -0
  623. package/styles/index.css +7 -0
  624. package/dist/browser-viewer-KFMM5S2B.js +0 -23
  625. package/dist/chat-interactive-block-5DJ72HU7.js +0 -22
  626. package/dist/chunk-2B3RQRNQ.js +0 -584
  627. package/dist/chunk-2DA7DTHO.js +0 -83
  628. package/dist/chunk-2GXAXCS2.js +0 -401
  629. package/dist/chunk-2JTZMHQK.js +0 -57
  630. package/dist/chunk-2LRJ32SO.js +0 -114
  631. package/dist/chunk-2VK7FJNR.js +0 -307
  632. package/dist/chunk-2YJS75C3.js +0 -269
  633. package/dist/chunk-2YNEUYWM.js +0 -231
  634. package/dist/chunk-2ZR75AUO.js +0 -225
  635. package/dist/chunk-32LD46VC.js +0 -72
  636. package/dist/chunk-3FVVZW7J.js +0 -84
  637. package/dist/chunk-4327UGUS.js +0 -79
  638. package/dist/chunk-45TILHFZ.js +0 -249
  639. package/dist/chunk-4AUSS7CX.js +0 -318
  640. package/dist/chunk-4ECOHGUL.js +0 -818
  641. package/dist/chunk-4FKE42TW.js +0 -1333
  642. package/dist/chunk-4K5UVYZQ.js +0 -113
  643. package/dist/chunk-4UZE7ZT4.js +0 -54
  644. package/dist/chunk-4XQH4XPP.js +0 -400
  645. package/dist/chunk-4Z7BPBS7.js +0 -34
  646. package/dist/chunk-56KVDNOS.js +0 -98
  647. package/dist/chunk-56NHT2TZ.js +0 -56
  648. package/dist/chunk-57QWSJLX.js +0 -114
  649. package/dist/chunk-5AGRFQSH.js +0 -432
  650. package/dist/chunk-5JMX5FRF.js +0 -1309
  651. package/dist/chunk-5UTHPGFF.js +0 -93
  652. package/dist/chunk-5VPQVMJI.js +0 -84
  653. package/dist/chunk-5WJCOFIU.js +0 -207
  654. package/dist/chunk-62T2ZPD5.js +0 -266
  655. package/dist/chunk-63AVTSUI.js +0 -383
  656. package/dist/chunk-6CDBX3XG.js +0 -33
  657. package/dist/chunk-6D3D2JWY.js +0 -278
  658. package/dist/chunk-6GUG7FXP.js +0 -380
  659. package/dist/chunk-6GUG7FXP.js.map +0 -1
  660. package/dist/chunk-6JGMBTXP.js +0 -114
  661. package/dist/chunk-6LYBRPUG.js +0 -931
  662. package/dist/chunk-6PHBW7SS.js +0 -287
  663. package/dist/chunk-6S2XVKNI.js +0 -91
  664. package/dist/chunk-6TWS6AXT.js +0 -1021
  665. package/dist/chunk-6VEIDSF4.js +0 -73
  666. package/dist/chunk-76NGRVCY.js +0 -340
  667. package/dist/chunk-7FFZLLCH.js +0 -391
  668. package/dist/chunk-7RRDXPNC.js +0 -111
  669. package/dist/chunk-7TLYFHMT.js +0 -851
  670. package/dist/chunk-7V2CQLTN.js +0 -20
  671. package/dist/chunk-7VDWXFTL.js +0 -772
  672. package/dist/chunk-A2OMNLDF.js +0 -150
  673. package/dist/chunk-A3QEJ2IZ.js +0 -229
  674. package/dist/chunk-A6Q6EUBR.js +0 -209
  675. package/dist/chunk-AJSRYRJS.js +0 -138
  676. package/dist/chunk-APNPWJCK.js +0 -66
  677. package/dist/chunk-ARNQH2XE.js +0 -178
  678. package/dist/chunk-B6AH43UQ.js +0 -2434
  679. package/dist/chunk-BIXGAYDJ.js +0 -276
  680. package/dist/chunk-BJ3WRO2K.js +0 -441
  681. package/dist/chunk-BO3D22BS.js +0 -12
  682. package/dist/chunk-BR62BHVY.js +0 -357
  683. package/dist/chunk-BTMSR4OA.js +0 -214
  684. package/dist/chunk-BVZYHORS.js +0 -40
  685. package/dist/chunk-BWBBS6HJ.js +0 -42
  686. package/dist/chunk-C22UPHA2.js +0 -274
  687. package/dist/chunk-C2EERTYX.js +0 -353
  688. package/dist/chunk-C2F6SKOS.js +0 -270
  689. package/dist/chunk-C625ODRG.js +0 -92
  690. package/dist/chunk-CAF3HFJH.js +0 -184
  691. package/dist/chunk-CAF3HFJH.js.map +0 -1
  692. package/dist/chunk-CC4JBFWY.js +0 -85
  693. package/dist/chunk-CDB66JAO.js +0 -283
  694. package/dist/chunk-CG2HT7TI.js +0 -269
  695. package/dist/chunk-CNNOPEAK.js +0 -570
  696. package/dist/chunk-CRBHMSAP.js +0 -469
  697. package/dist/chunk-CSK2WOOX.js +0 -83
  698. package/dist/chunk-CTBPPPLR.js +0 -2580
  699. package/dist/chunk-CTOLX2EW.js +0 -2317
  700. package/dist/chunk-CVDY7P3E.js +0 -246
  701. package/dist/chunk-CX3Z7W5Y.js +0 -107
  702. package/dist/chunk-D5K2BS5Q.js +0 -259
  703. package/dist/chunk-DA7XLT5F.js +0 -366
  704. package/dist/chunk-DAKKJ3XM.js +0 -298
  705. package/dist/chunk-DAKKJ3XM.js.map +0 -1
  706. package/dist/chunk-DC6KFW2R.js +0 -333
  707. package/dist/chunk-DIHPR5KJ.js +0 -15
  708. package/dist/chunk-DLMYANZX.js +0 -3851
  709. package/dist/chunk-DRAG2LZP.js +0 -171
  710. package/dist/chunk-E2SGFW2B.js +0 -3321
  711. package/dist/chunk-EAXZSBWV.js +0 -412
  712. package/dist/chunk-EFKWOXBP.js +0 -428
  713. package/dist/chunk-EGD5RPRX.js +0 -401
  714. package/dist/chunk-ELC2ZPHI.js +0 -1177
  715. package/dist/chunk-EZ5ZBOGQ.js +0 -1032
  716. package/dist/chunk-F2JKNL73.js +0 -187
  717. package/dist/chunk-F3LIUDXN.js +0 -738
  718. package/dist/chunk-F3LIUDXN.js.map +0 -1
  719. package/dist/chunk-FAB5SXNO.js +0 -640
  720. package/dist/chunk-FQ33JHJN.js +0 -63
  721. package/dist/chunk-FX343J2L.js +0 -132
  722. package/dist/chunk-FXFOKD7A.js +0 -449
  723. package/dist/chunk-FY42DW2R.js +0 -515
  724. package/dist/chunk-G4E5WKY7.js +0 -65
  725. package/dist/chunk-GFTV3RR6.js +0 -187
  726. package/dist/chunk-GGBMQNAB.js +0 -33
  727. package/dist/chunk-GGU7KV4G.js +0 -124
  728. package/dist/chunk-GIHE7U3Y.js +0 -174
  729. package/dist/chunk-GRGK3JJI.js +0 -10074
  730. package/dist/chunk-GRGK3JJI.js.map +0 -1
  731. package/dist/chunk-GT3FJVU6.js +0 -4596
  732. package/dist/chunk-GTGPKGWC.js +0 -65
  733. package/dist/chunk-GY6DSWBM.js +0 -82
  734. package/dist/chunk-H3EP6GNA.js +0 -538
  735. package/dist/chunk-HD2MCYQF.js +0 -234
  736. package/dist/chunk-HE4VN5D3.js +0 -4979
  737. package/dist/chunk-HFROJDFQ.js +0 -118
  738. package/dist/chunk-HHFFPE67.js +0 -220
  739. package/dist/chunk-HJ2CDFZX.js +0 -117
  740. package/dist/chunk-HJ2J2XQI.js +0 -88
  741. package/dist/chunk-HLLZPULI.js +0 -172
  742. package/dist/chunk-HPYQ5MES.js +0 -103
  743. package/dist/chunk-HRLJNDDC.js +0 -197
  744. package/dist/chunk-HVGM5IME.js +0 -170
  745. package/dist/chunk-HZE6V7GW.js +0 -214
  746. package/dist/chunk-I5DW76GB.js +0 -200
  747. package/dist/chunk-I7MZOZGC.js +0 -121
  748. package/dist/chunk-IB2EX6GX.js +0 -292
  749. package/dist/chunk-IEDDIJ6B.js +0 -4601
  750. package/dist/chunk-IEDDIJ6B.js.map +0 -1
  751. package/dist/chunk-IGFZFLI2.js +0 -1390
  752. package/dist/chunk-IGFZFLI2.js.map +0 -1
  753. package/dist/chunk-IIMRBCA4.js +0 -271
  754. package/dist/chunk-IIWNSYFA.js +0 -129
  755. package/dist/chunk-IN2ZJR2A.js +0 -96
  756. package/dist/chunk-IUPIJWFK.js +0 -905
  757. package/dist/chunk-IZA2KBYK.js +0 -57
  758. package/dist/chunk-IZZINUFM.js +0 -527
  759. package/dist/chunk-JFEAJRG6.js +0 -1029
  760. package/dist/chunk-JG7MEMJP.js +0 -1184
  761. package/dist/chunk-JIZWFW5A.js +0 -107
  762. package/dist/chunk-JJKUERR4.js +0 -131
  763. package/dist/chunk-JL4PMUDG.js +0 -192
  764. package/dist/chunk-JTWK3VE7.js +0 -202
  765. package/dist/chunk-JV2TJLUW.js +0 -144
  766. package/dist/chunk-KBDWMUYA.js +0 -175
  767. package/dist/chunk-KF65UG2L.js +0 -1628
  768. package/dist/chunk-KFYLTQGK.js +0 -133
  769. package/dist/chunk-KJI2DVSO.js +0 -26
  770. package/dist/chunk-KLYBSXHE.js +0 -3183
  771. package/dist/chunk-KPD6TBO4.js +0 -89
  772. package/dist/chunk-KTGKGHEA.js +0 -75
  773. package/dist/chunk-KUYQTNVT.js +0 -794
  774. package/dist/chunk-KZE7M52Y.js +0 -598
  775. package/dist/chunk-KZYZ3JHS.js +0 -112
  776. package/dist/chunk-L6WVCO6D.js +0 -61
  777. package/dist/chunk-L7T7M2P3.js +0 -5222
  778. package/dist/chunk-LKF6IPFC.js +0 -247
  779. package/dist/chunk-LLU7VKCZ.js +0 -188
  780. package/dist/chunk-LWEJGMVO.js +0 -50
  781. package/dist/chunk-LX5IEXDF.js +0 -505
  782. package/dist/chunk-LYEALWBN.js +0 -251
  783. package/dist/chunk-M722GGD3.js +0 -566
  784. package/dist/chunk-MCPKUVMQ.js +0 -99
  785. package/dist/chunk-MDGNCUAC.js +0 -145
  786. package/dist/chunk-MFLU3466.js +0 -99
  787. package/dist/chunk-MITT6IZG.js +0 -134
  788. package/dist/chunk-MN4LJYKQ.js +0 -608
  789. package/dist/chunk-MNCBL5AX.js +0 -449
  790. package/dist/chunk-MNCBL5AX.js.map +0 -1
  791. package/dist/chunk-MO3XJQN2.js +0 -629
  792. package/dist/chunk-MPP6BEAN.js +0 -158
  793. package/dist/chunk-MQRUZ2LW.js +0 -335
  794. package/dist/chunk-MRJFF5KY.js +0 -351
  795. package/dist/chunk-MUB44LD3.js +0 -75
  796. package/dist/chunk-MYDFABO6.js +0 -296
  797. package/dist/chunk-NJVHMK5R.js +0 -3158
  798. package/dist/chunk-NO6VQNWH.js +0 -396
  799. package/dist/chunk-NUF43R2F.js +0 -278
  800. package/dist/chunk-NUM3QV66.js +0 -107
  801. package/dist/chunk-NW4RPGET.js +0 -48
  802. package/dist/chunk-NZBZLY7H.js +0 -165
  803. package/dist/chunk-O664PL2U.js +0 -47
  804. package/dist/chunk-O664PL2U.js.map +0 -1
  805. package/dist/chunk-OCS3KIYC.js +0 -378
  806. package/dist/chunk-OKI45WHM.js +0 -311
  807. package/dist/chunk-ONF5M5GP.js +0 -283
  808. package/dist/chunk-OPCPBLHA.js +0 -79
  809. package/dist/chunk-OROXCA6L.js +0 -251
  810. package/dist/chunk-OTMJS3FV.js +0 -56
  811. package/dist/chunk-OXM267RC.js +0 -128
  812. package/dist/chunk-P5FLGDXW.js +0 -723
  813. package/dist/chunk-PC3FWPOP.js +0 -828
  814. package/dist/chunk-PPQJIVGM.js +0 -175
  815. package/dist/chunk-PQOVMZI2.js +0 -372
  816. package/dist/chunk-PVGD2RAV.js +0 -5926
  817. package/dist/chunk-PVGD2RAV.js.map +0 -1
  818. package/dist/chunk-PYU7CLEG.js +0 -215
  819. package/dist/chunk-Q2N5UR7Q.js +0 -505
  820. package/dist/chunk-Q4GB2QU3.js +0 -199
  821. package/dist/chunk-Q4RJKXQM.js +0 -606
  822. package/dist/chunk-Q4ZNRQKH.js +0 -196
  823. package/dist/chunk-Q7QXSQ46.js +0 -1185
  824. package/dist/chunk-QAVSUXLA.js +0 -773
  825. package/dist/chunk-QBJDMSFA.js +0 -27
  826. package/dist/chunk-QCB3WNCA.js +0 -176
  827. package/dist/chunk-QIOIJ7K5.js +0 -162
  828. package/dist/chunk-QR72J6WR.js +0 -650
  829. package/dist/chunk-QUTMVW4P.js +0 -141
  830. package/dist/chunk-QUXQYYZO.js +0 -73
  831. package/dist/chunk-RDHK2NYW.js +0 -129
  832. package/dist/chunk-RFBYAUZH.js +0 -311
  833. package/dist/chunk-RFBYAUZH.js.map +0 -1
  834. package/dist/chunk-RGCCRYTY.js +0 -46
  835. package/dist/chunk-RSTS3RWN.js +0 -211
  836. package/dist/chunk-RY7YRYVT.js +0 -126
  837. package/dist/chunk-S4LRL5BA.js +0 -439
  838. package/dist/chunk-S62CVC5C.js +0 -850
  839. package/dist/chunk-S62CVC5C.js.map +0 -1
  840. package/dist/chunk-SHVW3C3Y.js +0 -50
  841. package/dist/chunk-SL4CLUHR.js +0 -48
  842. package/dist/chunk-SOPKVWZJ.js +0 -1187
  843. package/dist/chunk-ST3H53IJ.js +0 -201
  844. package/dist/chunk-SYYFA7W7.js +0 -23
  845. package/dist/chunk-TBUWK3RP.js +0 -399
  846. package/dist/chunk-TC42NAIJ.js +0 -177
  847. package/dist/chunk-TJBTP6LH.js +0 -297
  848. package/dist/chunk-TQQALBLU.js +0 -391
  849. package/dist/chunk-TW56PZBB.js +0 -407
  850. package/dist/chunk-U6XRXK2T.js +0 -1356
  851. package/dist/chunk-U735UBHS.js +0 -2431
  852. package/dist/chunk-U735UBHS.js.map +0 -1
  853. package/dist/chunk-UAKG7GLE.js +0 -155
  854. package/dist/chunk-UB4GKFCI.js +0 -1095
  855. package/dist/chunk-UEAAF27Y.js +0 -108
  856. package/dist/chunk-UITWSZH3.js +0 -162
  857. package/dist/chunk-UQ67SEGH.js +0 -234
  858. package/dist/chunk-URSNCM57.js +0 -37
  859. package/dist/chunk-V77BSX2F.js +0 -1152
  860. package/dist/chunk-VATOL3OZ.js +0 -110
  861. package/dist/chunk-VEJG6GQQ.js +0 -103
  862. package/dist/chunk-VFQZPHZR.js +0 -436
  863. package/dist/chunk-VFZJV26C.js +0 -41
  864. package/dist/chunk-VJZPVP6C.js +0 -230
  865. package/dist/chunk-VQL7FHIF.js +0 -27
  866. package/dist/chunk-VSS6LRAK.js +0 -263
  867. package/dist/chunk-VSSXDLO3.js +0 -467
  868. package/dist/chunk-VVCKB62D.js +0 -1024
  869. package/dist/chunk-VVJDYTD4.js +0 -168
  870. package/dist/chunk-VVXOG3ZC.js +0 -52
  871. package/dist/chunk-W2EX346X.js +0 -85
  872. package/dist/chunk-W3R4C7Z2.js +0 -166
  873. package/dist/chunk-W43FINJV.js +0 -218
  874. package/dist/chunk-W6PJWSZ6.js +0 -1769
  875. package/dist/chunk-WCP32H3P.js +0 -2984
  876. package/dist/chunk-WKELNNIG.js +0 -3690
  877. package/dist/chunk-WRFXCMRW.js +0 -2591
  878. package/dist/chunk-WRLEHV4A.js +0 -386
  879. package/dist/chunk-WTNQHM6Q.js +0 -43
  880. package/dist/chunk-WTZ6OJUY.js +0 -3070
  881. package/dist/chunk-WVFMFQRZ.js +0 -256
  882. package/dist/chunk-WVFMFQRZ.js.map +0 -1
  883. package/dist/chunk-WYIC3CXE.js +0 -157
  884. package/dist/chunk-WZABXFUL.js +0 -246
  885. package/dist/chunk-WZABXFUL.js.map +0 -1
  886. package/dist/chunk-X3GBTLKD.js +0 -175
  887. package/dist/chunk-XBOLFS6I.js +0 -532
  888. package/dist/chunk-XF4UH54P.js +0 -250
  889. package/dist/chunk-XHPBQTJP.js +0 -1260
  890. package/dist/chunk-XQ4TJITR.js +0 -270
  891. package/dist/chunk-XRFMGLCE.js +0 -466
  892. package/dist/chunk-XV2F7PGS.js +0 -236
  893. package/dist/chunk-Y2EQTW5Q.js +0 -100
  894. package/dist/chunk-YAOXCAQD.js +0 -371
  895. package/dist/chunk-YCDB3HPS.js +0 -137
  896. package/dist/chunk-YCONEOZQ.js +0 -191
  897. package/dist/chunk-YG243U6J.js +0 -158
  898. package/dist/chunk-YGQANOSV.js +0 -113
  899. package/dist/chunk-YKRWKRNX.js +0 -138
  900. package/dist/chunk-YKT5NYYJ.js +0 -3996
  901. package/dist/chunk-YKT5NYYJ.js.map +0 -1
  902. package/dist/chunk-YLWABUFE.js +0 -406
  903. package/dist/chunk-YOKIE7NG.js +0 -227
  904. package/dist/chunk-YRCDL3GO.js +0 -2582
  905. package/dist/chunk-YVBAYE7Y.js +0 -1236
  906. package/dist/chunk-YYKPRX4P.js +0 -29
  907. package/dist/chunk-Z4MW635R.js +0 -849
  908. package/dist/chunk-Z7IPPKG6.js +0 -403
  909. package/dist/chunk-ZFGXQ54H.js +0 -114
  910. package/dist/chunk-ZGBXHHCL.js +0 -373
  911. package/dist/computer-viewer-AVH5J4TC.js +0 -21
  912. package/dist/connection-step-up-T2B25VP7.js +0 -148
  913. package/dist/connection-step-up-T2B25VP7.js.map +0 -1
  914. package/dist/embedded-new-voice-M6PBWMQZ.js +0 -25
  915. package/dist/embedded-voice-7USALJKI.js +0 -25
  916. package/dist/fleet-decision-row-XY6OZPHA.js +0 -361
  917. package/dist/model-policy-picker-menu-S5RTVLMQ.js +0 -23
  918. package/dist/payment-page-card-XSY5NO7D.js +0 -227
  919. package/dist/platform-activity-row-77WER5O3.js +0 -156
  920. package/dist/queue-surface-implementation-SDV7I32L.js +0 -933
  921. package/dist/recorder-host-7GNQG6BB.js +0 -80
  922. package/dist/sandbox-files-JOH2Q57T.js +0 -29
  923. package/dist/session-connect-cards-HZIR4ZWT.js +0 -28
  924. package/dist/session-realtime-OPCPTIAP.js +0 -30
  925. package/dist/timeline-annotation-markers-WXCRA4BY.js +0 -157
  926. package/dist/timeline-annotation-selection-YBZQNCNX.js +0 -208
  927. package/dist/timeline-annotations-dialog-4WVXTKFW.js +0 -283
  928. /package/dist/{browser-viewer-KFMM5S2B.js.map → browser-viewer-TRPZI6NT.js.map} +0 -0
  929. /package/dist/{chat-interactive-block-5DJ72HU7.js.map → chat-interactive-block-Y4BS4JCM.js.map} +0 -0
  930. /package/dist/{chunk-CRBHMSAP.js.map → chunk-22E2YJHT.js.map} +0 -0
  931. /package/dist/{chunk-H3EP6GNA.js.map → chunk-2T6TN2YL.js.map} +0 -0
  932. /package/dist/{chunk-KBDWMUYA.js.map → chunk-2WNN26NW.js.map} +0 -0
  933. /package/dist/{chunk-HJ2J2XQI.js.map → chunk-3432A6XB.js.map} +0 -0
  934. /package/dist/{chunk-DA7XLT5F.js.map → chunk-35U7NSOR.js.map} +0 -0
  935. /package/dist/{chunk-QAVSUXLA.js.map → chunk-3EPR76WS.js.map} +0 -0
  936. /package/dist/{chunk-JV2TJLUW.js.map → chunk-3FXXEU5D.js.map} +0 -0
  937. /package/dist/{chunk-QR72J6WR.js.map → chunk-3MXOPOEU.js.map} +0 -0
  938. /package/dist/{chunk-76NGRVCY.js.map → chunk-3PKDU4JI.js.map} +0 -0
  939. /package/dist/{chunk-BO3D22BS.js.map → chunk-3PMO2BIV.js.map} +0 -0
  940. /package/dist/{chunk-SL4CLUHR.js.map → chunk-3XWHJNFY.js.map} +0 -0
  941. /package/dist/{chunk-EGD5RPRX.js.map → chunk-45WD2PKE.js.map} +0 -0
  942. /package/dist/{chunk-KZE7M52Y.js.map → chunk-4H2OWNRA.js.map} +0 -0
  943. /package/dist/{chunk-VSS6LRAK.js.map → chunk-4HVGOTMU.js.map} +0 -0
  944. /package/dist/{chunk-4ECOHGUL.js.map → chunk-4JER2ZMV.js.map} +0 -0
  945. /package/dist/{chunk-HZE6V7GW.js.map → chunk-4LVZ2VOQ.js.map} +0 -0
  946. /package/dist/{chunk-B6AH43UQ.js.map → chunk-4OGDD2EM.js.map} +0 -0
  947. /package/dist/{chunk-4UZE7ZT4.js.map → chunk-4PQC6WMF.js.map} +0 -0
  948. /package/dist/{chunk-KUYQTNVT.js.map → chunk-4UVSWAT3.js.map} +0 -0
  949. /package/dist/{chunk-BTMSR4OA.js.map → chunk-53A47RBX.js.map} +0 -0
  950. /package/dist/{chunk-57QWSJLX.js.map → chunk-552KKENW.js.map} +0 -0
  951. /package/dist/{chunk-TC42NAIJ.js.map → chunk-55F7L6M3.js.map} +0 -0
  952. /package/dist/{chunk-FXFOKD7A.js.map → chunk-5AHIKB3O.js.map} +0 -0
  953. /package/dist/{chunk-Q4GB2QU3.js.map → chunk-5N4L5WTE.js.map} +0 -0
  954. /package/dist/{chunk-4327UGUS.js.map → chunk-5OUJCVZI.js.map} +0 -0
  955. /package/dist/{chunk-GTGPKGWC.js.map → chunk-5OYXQ7MH.js.map} +0 -0
  956. /package/dist/{chunk-2ZR75AUO.js.map → chunk-5TAVVMFX.js.map} +0 -0
  957. /package/dist/{chunk-2YJS75C3.js.map → chunk-5Y3LYRNH.js.map} +0 -0
  958. /package/dist/{chunk-WRLEHV4A.js.map → chunk-5ZJKKE4T.js.map} +0 -0
  959. /package/dist/{chunk-2JTZMHQK.js.map → chunk-62DPSQRZ.js.map} +0 -0
  960. /package/dist/{chunk-MN4LJYKQ.js.map → chunk-64KMWTJ6.js.map} +0 -0
  961. /package/dist/{chunk-QUXQYYZO.js.map → chunk-6MZBNUS7.js.map} +0 -0
  962. /package/dist/{chunk-XF4UH54P.js.map → chunk-6YCE4ZC4.js.map} +0 -0
  963. /package/dist/{chunk-X3GBTLKD.js.map → chunk-6YROWWMX.js.map} +0 -0
  964. /package/dist/{chunk-YVBAYE7Y.js.map → chunk-73RZ72VU.js.map} +0 -0
  965. /package/dist/{chunk-5VPQVMJI.js.map → chunk-74KV436L.js.map} +0 -0
  966. /package/dist/{chunk-CSK2WOOX.js.map → chunk-7HKGLPV5.js.map} +0 -0
  967. /package/dist/{chunk-XRFMGLCE.js.map → chunk-7JSWODT6.js.map} +0 -0
  968. /package/dist/{chunk-EFKWOXBP.js.map → chunk-7K3PKWER.js.map} +0 -0
  969. /package/dist/{chunk-U6XRXK2T.js.map → chunk-7MPWC42V.js.map} +0 -0
  970. /package/dist/{chunk-QUTMVW4P.js.map → chunk-7REO6FRN.js.map} +0 -0
  971. /package/dist/{chunk-MDGNCUAC.js.map → chunk-7YMWRNRQ.js.map} +0 -0
  972. /package/dist/{chunk-JJKUERR4.js.map → chunk-A6H3KJ7G.js.map} +0 -0
  973. /package/dist/{chunk-W6PJWSZ6.js.map → chunk-AGQIE6YU.js.map} +0 -0
  974. /package/dist/{chunk-ZGBXHHCL.js.map → chunk-AHQM4I5V.js.map} +0 -0
  975. /package/dist/{chunk-HLLZPULI.js.map → chunk-AMTRO7XF.js.map} +0 -0
  976. /package/dist/{chunk-6S2XVKNI.js.map → chunk-AO4LTCG7.js.map} +0 -0
  977. /package/dist/{chunk-CTBPPPLR.js.map → chunk-APJ22OZV.js.map} +0 -0
  978. /package/dist/{chunk-TW56PZBB.js.map → chunk-APWL37KW.js.map} +0 -0
  979. /package/dist/{chunk-DIHPR5KJ.js.map → chunk-AQEJOBQ2.js.map} +0 -0
  980. /package/dist/{chunk-HD2MCYQF.js.map → chunk-ARKNT6BX.js.map} +0 -0
  981. /package/dist/{chunk-RSTS3RWN.js.map → chunk-B2IHDMAR.js.map} +0 -0
  982. /package/dist/{chunk-KZYZ3JHS.js.map → chunk-BCKIV26W.js.map} +0 -0
  983. /package/dist/{chunk-D5K2BS5Q.js.map → chunk-BE26JUSD.js.map} +0 -0
  984. /package/dist/{chunk-DRAG2LZP.js.map → chunk-BOVCD6KD.js.map} +0 -0
  985. /package/dist/{chunk-IIWNSYFA.js.map → chunk-BQWV66A6.js.map} +0 -0
  986. /package/dist/{chunk-BJ3WRO2K.js.map → chunk-BSQJXGGP.js.map} +0 -0
  987. /package/dist/{chunk-KLYBSXHE.js.map → chunk-BZY3MEVZ.js.map} +0 -0
  988. /package/dist/{chunk-MQRUZ2LW.js.map → chunk-C3D3OOEY.js.map} +0 -0
  989. /package/dist/{chunk-GY6DSWBM.js.map → chunk-CDHYO3DP.js.map} +0 -0
  990. /package/dist/{chunk-OPCPBLHA.js.map → chunk-CDV5JGVI.js.map} +0 -0
  991. /package/dist/{chunk-5WJCOFIU.js.map → chunk-CNW45M7G.js.map} +0 -0
  992. /package/dist/{chunk-A2OMNLDF.js.map → chunk-CUVQ37HB.js.map} +0 -0
  993. /package/dist/{chunk-XBOLFS6I.js.map → chunk-D32T3IIC.js.map} +0 -0
  994. /package/dist/{chunk-YAOXCAQD.js.map → chunk-D65BSM64.js.map} +0 -0
  995. /package/dist/{chunk-CNNOPEAK.js.map → chunk-D7435DWV.js.map} +0 -0
  996. /package/dist/{chunk-32LD46VC.js.map → chunk-DFH3M7B3.js.map} +0 -0
  997. /package/dist/{chunk-QIOIJ7K5.js.map → chunk-DGWBQ76M.js.map} +0 -0
  998. /package/dist/{chunk-PQOVMZI2.js.map → chunk-DHJDTGSJ.js.map} +0 -0
  999. /package/dist/{chunk-4XQH4XPP.js.map → chunk-DKEFTNCD.js.map} +0 -0
  1000. /package/dist/{chunk-JIZWFW5A.js.map → chunk-DNAF6MT4.js.map} +0 -0
  1001. /package/dist/{chunk-QBJDMSFA.js.map → chunk-E35XY7DS.js.map} +0 -0
  1002. /package/dist/{chunk-NO6VQNWH.js.map → chunk-E5T5WIIP.js.map} +0 -0
  1003. /package/dist/{chunk-W3R4C7Z2.js.map → chunk-EL6ECD34.js.map} +0 -0
  1004. /package/dist/{chunk-VSSXDLO3.js.map → chunk-ELR6ITRC.js.map} +0 -0
  1005. /package/dist/{chunk-7TLYFHMT.js.map → chunk-EPE3V2VE.js.map} +0 -0
  1006. /package/dist/{chunk-2B3RQRNQ.js.map → chunk-EYGQHHVW.js.map} +0 -0
  1007. /package/dist/{chunk-2VK7FJNR.js.map → chunk-EYQEJHYP.js.map} +0 -0
  1008. /package/dist/{chunk-BIXGAYDJ.js.map → chunk-EZTH2XMH.js.map} +0 -0
  1009. /package/dist/{chunk-6PHBW7SS.js.map → chunk-F3QVHVFS.js.map} +0 -0
  1010. /package/dist/{chunk-SOPKVWZJ.js.map → chunk-F5VWPREQ.js.map} +0 -0
  1011. /package/dist/{chunk-YGQANOSV.js.map → chunk-FM7AQUBL.js.map} +0 -0
  1012. /package/dist/{chunk-Y2EQTW5Q.js.map → chunk-FP6BUXJM.js.map} +0 -0
  1013. /package/dist/{chunk-45TILHFZ.js.map → chunk-FVU52L3I.js.map} +0 -0
  1014. /package/dist/{chunk-W43FINJV.js.map → chunk-FZKNXNNO.js.map} +0 -0
  1015. /package/dist/{chunk-XV2F7PGS.js.map → chunk-G3IXJWRY.js.map} +0 -0
  1016. /package/dist/{chunk-DC6KFW2R.js.map → chunk-G6EI2O3N.js.map} +0 -0
  1017. /package/dist/{chunk-2GXAXCS2.js.map → chunk-GB5T6YMZ.js.map} +0 -0
  1018. /package/dist/{chunk-WYIC3CXE.js.map → chunk-GBLD6FOG.js.map} +0 -0
  1019. /package/dist/{chunk-YCDB3HPS.js.map → chunk-GJBFFXCY.js.map} +0 -0
  1020. /package/dist/{chunk-APNPWJCK.js.map → chunk-GJDP2K2S.js.map} +0 -0
  1021. /package/dist/{chunk-GFTV3RR6.js.map → chunk-GP26XTDX.js.map} +0 -0
  1022. /package/dist/{chunk-Q4RJKXQM.js.map → chunk-GTE6WP4N.js.map} +0 -0
  1023. /package/dist/{chunk-UEAAF27Y.js.map → chunk-GWG3OAV7.js.map} +0 -0
  1024. /package/dist/{chunk-6LYBRPUG.js.map → chunk-GXMHTMM6.js.map} +0 -0
  1025. /package/dist/{chunk-NUM3QV66.js.map → chunk-GYRN5O2E.js.map} +0 -0
  1026. /package/dist/{chunk-G4E5WKY7.js.map → chunk-GZX7W2WW.js.map} +0 -0
  1027. /package/dist/{chunk-Z7IPPKG6.js.map → chunk-H3QI2G2B.js.map} +0 -0
  1028. /package/dist/{chunk-Z4MW635R.js.map → chunk-H7D4DVWY.js.map} +0 -0
  1029. /package/dist/{chunk-YCONEOZQ.js.map → chunk-HCDGBBBJ.js.map} +0 -0
  1030. /package/dist/{chunk-DLMYANZX.js.map → chunk-HDSH6MIJ.js.map} +0 -0
  1031. /package/dist/{chunk-KPD6TBO4.js.map → chunk-HOEUPZ6O.js.map} +0 -0
  1032. /package/dist/{chunk-7VDWXFTL.js.map → chunk-HPQRWTQB.js.map} +0 -0
  1033. /package/dist/{chunk-GIHE7U3Y.js.map → chunk-HUKGLWAY.js.map} +0 -0
  1034. /package/dist/{chunk-SYYFA7W7.js.map → chunk-HUTQJY3F.js.map} +0 -0
  1035. /package/dist/{chunk-62T2ZPD5.js.map → chunk-HWOYJOKK.js.map} +0 -0
  1036. /package/dist/{chunk-IN2ZJR2A.js.map → chunk-HZR3WGUP.js.map} +0 -0
  1037. /package/dist/{chunk-YKRWKRNX.js.map → chunk-I7YUDPDR.js.map} +0 -0
  1038. /package/dist/{chunk-VQL7FHIF.js.map → chunk-IDII52M4.js.map} +0 -0
  1039. /package/dist/{chunk-HPYQ5MES.js.map → chunk-IDPWEUM7.js.map} +0 -0
  1040. /package/dist/{chunk-JL4PMUDG.js.map → chunk-IEWQFGEC.js.map} +0 -0
  1041. /package/dist/{chunk-MRJFF5KY.js.map → chunk-IMTACEXF.js.map} +0 -0
  1042. /package/dist/{chunk-2LRJ32SO.js.map → chunk-IVWT6M6N.js.map} +0 -0
  1043. /package/dist/{chunk-7RRDXPNC.js.map → chunk-JEUPIHIP.js.map} +0 -0
  1044. /package/dist/{chunk-VVJDYTD4.js.map → chunk-JF4WX3GQ.js.map} +0 -0
  1045. /package/dist/{chunk-WRFXCMRW.js.map → chunk-JJPYXUKC.js.map} +0 -0
  1046. /package/dist/{chunk-WTNQHM6Q.js.map → chunk-JNHWTYDD.js.map} +0 -0
  1047. /package/dist/{chunk-RGCCRYTY.js.map → chunk-JP7AOJWD.js.map} +0 -0
  1048. /package/dist/{chunk-TJBTP6LH.js.map → chunk-JTWT2WQA.js.map} +0 -0
  1049. /package/dist/{chunk-HJ2CDFZX.js.map → chunk-JW3WIHWO.js.map} +0 -0
  1050. /package/dist/{chunk-MITT6IZG.js.map → chunk-JW7RJMEZ.js.map} +0 -0
  1051. /package/dist/{chunk-CTOLX2EW.js.map → chunk-K76PXR3O.js.map} +0 -0
  1052. /package/dist/{chunk-CX3Z7W5Y.js.map → chunk-KCNIQN6V.js.map} +0 -0
  1053. /package/dist/{chunk-2YNEUYWM.js.map → chunk-KH6KHYST.js.map} +0 -0
  1054. /package/dist/{chunk-LKF6IPFC.js.map → chunk-KK4SEN7N.js.map} +0 -0
  1055. /package/dist/{chunk-63AVTSUI.js.map → chunk-KOKRGAAI.js.map} +0 -0
  1056. /package/dist/{chunk-F2JKNL73.js.map → chunk-KQFNTGAF.js.map} +0 -0
  1057. /package/dist/{chunk-SHVW3C3Y.js.map → chunk-KRLNC6TH.js.map} +0 -0
  1058. /package/dist/{chunk-MFLU3466.js.map → chunk-KYDLVMKA.js.map} +0 -0
  1059. /package/dist/{chunk-UAKG7GLE.js.map → chunk-KZQDP2JM.js.map} +0 -0
  1060. /package/dist/{chunk-FX343J2L.js.map → chunk-L2EZ2HOX.js.map} +0 -0
  1061. /package/dist/{chunk-GGBMQNAB.js.map → chunk-L2UAFR2D.js.map} +0 -0
  1062. /package/dist/{chunk-GT3FJVU6.js.map → chunk-L4R7ORMD.js.map} +0 -0
  1063. /package/dist/{chunk-YOKIE7NG.js.map → chunk-LCLWN64E.js.map} +0 -0
  1064. /package/dist/{chunk-PPQJIVGM.js.map → chunk-LFQI2C46.js.map} +0 -0
  1065. /package/dist/{chunk-KF65UG2L.js.map → chunk-LLYX4F5A.js.map} +0 -0
  1066. /package/dist/{chunk-PYU7CLEG.js.map → chunk-LQX5QCDS.js.map} +0 -0
  1067. /package/dist/{chunk-Q4ZNRQKH.js.map → chunk-LRMHASG2.js.map} +0 -0
  1068. /package/dist/{chunk-MO3XJQN2.js.map → chunk-M5FX5KH5.js.map} +0 -0
  1069. /package/dist/{chunk-ST3H53IJ.js.map → chunk-MLOTUQJJ.js.map} +0 -0
  1070. /package/dist/{chunk-A6Q6EUBR.js.map → chunk-MPUKGKXZ.js.map} +0 -0
  1071. /package/dist/{chunk-ONF5M5GP.js.map → chunk-MS6LW4VU.js.map} +0 -0
  1072. /package/dist/{chunk-NUF43R2F.js.map → chunk-MXPW4F74.js.map} +0 -0
  1073. /package/dist/{chunk-MPP6BEAN.js.map → chunk-MZ7GJX5S.js.map} +0 -0
  1074. /package/dist/{chunk-XHPBQTJP.js.map → chunk-N5OUIUYD.js.map} +0 -0
  1075. /package/dist/{chunk-EAXZSBWV.js.map → chunk-N6FNORC7.js.map} +0 -0
  1076. /package/dist/{chunk-4K5UVYZQ.js.map → chunk-NALVKY4U.js.map} +0 -0
  1077. /package/dist/{chunk-L7T7M2P3.js.map → chunk-NJ77ZL5T.js.map} +0 -0
  1078. /package/dist/{chunk-XQ4TJITR.js.map → chunk-NM2DNJDJ.js.map} +0 -0
  1079. /package/dist/{chunk-VATOL3OZ.js.map → chunk-NNKRRF7E.js.map} +0 -0
  1080. /package/dist/{chunk-4AUSS7CX.js.map → chunk-NP5UFWU4.js.map} +0 -0
  1081. /package/dist/{chunk-HFROJDFQ.js.map → chunk-NV3AEIFO.js.map} +0 -0
  1082. /package/dist/{chunk-PC3FWPOP.js.map → chunk-O6JDF7KH.js.map} +0 -0
  1083. /package/dist/{chunk-OROXCA6L.js.map → chunk-OERZH3J4.js.map} +0 -0
  1084. /package/dist/{chunk-V77BSX2F.js.map → chunk-OKHWTWWU.js.map} +0 -0
  1085. /package/dist/{chunk-C22UPHA2.js.map → chunk-OLAIUVGT.js.map} +0 -0
  1086. /package/dist/{chunk-C2F6SKOS.js.map → chunk-OO36IUMS.js.map} +0 -0
  1087. /package/dist/{chunk-IZA2KBYK.js.map → chunk-OVDK7K2Z.js.map} +0 -0
  1088. /package/dist/{chunk-FQ33JHJN.js.map → chunk-OX5ZCHZQ.js.map} +0 -0
  1089. /package/dist/{chunk-FY42DW2R.js.map → chunk-P6LLCGPO.js.map} +0 -0
  1090. /package/dist/{chunk-LX5IEXDF.js.map → chunk-PA2CUHTD.js.map} +0 -0
  1091. /package/dist/{chunk-HE4VN5D3.js.map → chunk-PB4CQIRA.js.map} +0 -0
  1092. /package/dist/{chunk-M722GGD3.js.map → chunk-PBV2P632.js.map} +0 -0
  1093. /package/dist/{chunk-KTGKGHEA.js.map → chunk-PCSRHFRF.js.map} +0 -0
  1094. /package/dist/{chunk-VFQZPHZR.js.map → chunk-PEPWW5BC.js.map} +0 -0
  1095. /package/dist/{chunk-6CDBX3XG.js.map → chunk-PMBZMVKE.js.map} +0 -0
  1096. /package/dist/{chunk-4Z7BPBS7.js.map → chunk-PP32RE26.js.map} +0 -0
  1097. /package/dist/{chunk-6VEIDSF4.js.map → chunk-PTXAPI3Q.js.map} +0 -0
  1098. /package/dist/{chunk-OTMJS3FV.js.map → chunk-PULNNF7G.js.map} +0 -0
  1099. /package/dist/{chunk-YG243U6J.js.map → chunk-Q6KNROUT.js.map} +0 -0
  1100. /package/dist/{chunk-EZ5ZBOGQ.js.map → chunk-QGJIFIKN.js.map} +0 -0
  1101. /package/dist/{chunk-VFZJV26C.js.map → chunk-QKKKORGL.js.map} +0 -0
  1102. /package/dist/{chunk-W2EX346X.js.map → chunk-QKUMMG6P.js.map} +0 -0
  1103. /package/dist/{chunk-BVZYHORS.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1104. /package/dist/{chunk-3FVVZW7J.js.map → chunk-QSWD3AHE.js.map} +0 -0
  1105. /package/dist/{chunk-7FFZLLCH.js.map → chunk-QZ4U2VL5.js.map} +0 -0
  1106. /package/dist/{chunk-IIMRBCA4.js.map → chunk-QZJNCLHV.js.map} +0 -0
  1107. /package/dist/{chunk-6D3D2JWY.js.map → chunk-R6CFPY3F.js.map} +0 -0
  1108. /package/dist/{chunk-YLWABUFE.js.map → chunk-R6QRUYUH.js.map} +0 -0
  1109. /package/dist/{chunk-WCP32H3P.js.map → chunk-RE3GAQI5.js.map} +0 -0
  1110. /package/dist/{chunk-JG7MEMJP.js.map → chunk-RFHUVPFA.js.map} +0 -0
  1111. /package/dist/{chunk-WKELNNIG.js.map → chunk-RH45HT5T.js.map} +0 -0
  1112. /package/dist/{chunk-S4LRL5BA.js.map → chunk-RJNQTZ5O.js.map} +0 -0
  1113. /package/dist/{chunk-URSNCM57.js.map → chunk-S2BJTAAB.js.map} +0 -0
  1114. /package/dist/{chunk-AJSRYRJS.js.map → chunk-S56PWXIX.js.map} +0 -0
  1115. /package/dist/{chunk-FAB5SXNO.js.map → chunk-S6FFDIHD.js.map} +0 -0
  1116. /package/dist/{chunk-56NHT2TZ.js.map → chunk-S6MAMIK2.js.map} +0 -0
  1117. /package/dist/{chunk-OKI45WHM.js.map → chunk-SERTO6H6.js.map} +0 -0
  1118. /package/dist/{chunk-I5DW76GB.js.map → chunk-STOOH7EI.js.map} +0 -0
  1119. /package/dist/{chunk-I7MZOZGC.js.map → chunk-SWSTEUXX.js.map} +0 -0
  1120. /package/dist/{chunk-JFEAJRG6.js.map → chunk-SWZN7NNZ.js.map} +0 -0
  1121. /package/dist/{chunk-ARNQH2XE.js.map → chunk-SYDF57KS.js.map} +0 -0
  1122. /package/dist/{chunk-YYKPRX4P.js.map → chunk-T275CUVD.js.map} +0 -0
  1123. /package/dist/{chunk-OCS3KIYC.js.map → chunk-T4OT7QWP.js.map} +0 -0
  1124. /package/dist/{chunk-YRCDL3GO.js.map → chunk-TCSRY2NP.js.map} +0 -0
  1125. /package/dist/{chunk-ELC2ZPHI.js.map → chunk-TCX5OA2X.js.map} +0 -0
  1126. /package/dist/{chunk-NJVHMK5R.js.map → chunk-TDW5CSO5.js.map} +0 -0
  1127. /package/dist/{chunk-MCPKUVMQ.js.map → chunk-TGG3ODCS.js.map} +0 -0
  1128. /package/dist/{chunk-Q2N5UR7Q.js.map → chunk-TILSTYUC.js.map} +0 -0
  1129. /package/dist/{chunk-4FKE42TW.js.map → chunk-TJ5DYWXU.js.map} +0 -0
  1130. /package/dist/{chunk-TQQALBLU.js.map → chunk-TNRI4ZE6.js.map} +0 -0
  1131. /package/dist/{chunk-LLU7VKCZ.js.map → chunk-TPIFVUMF.js.map} +0 -0
  1132. /package/dist/{chunk-UITWSZH3.js.map → chunk-TSW6OF22.js.map} +0 -0
  1133. /package/dist/{chunk-UB4GKFCI.js.map → chunk-TTSTBHGR.js.map} +0 -0
  1134. /package/dist/{chunk-HVGM5IME.js.map → chunk-U3JYAWMR.js.map} +0 -0
  1135. /package/dist/{chunk-GGU7KV4G.js.map → chunk-U7ODSHA5.js.map} +0 -0
  1136. /package/dist/{chunk-NW4RPGET.js.map → chunk-UEGEPRNP.js.map} +0 -0
  1137. /package/dist/{chunk-2DA7DTHO.js.map → chunk-UGIA2YEJ.js.map} +0 -0
  1138. /package/dist/{chunk-5AGRFQSH.js.map → chunk-UHLKKDNF.js.map} +0 -0
  1139. /package/dist/{chunk-KJI2DVSO.js.map → chunk-ULVXKIPX.js.map} +0 -0
  1140. /package/dist/{chunk-56KVDNOS.js.map → chunk-USUDKZ5G.js.map} +0 -0
  1141. /package/dist/{chunk-CC4JBFWY.js.map → chunk-UVO6I2F6.js.map} +0 -0
  1142. /package/dist/{chunk-BR62BHVY.js.map → chunk-V6NVG4K2.js.map} +0 -0
  1143. /package/dist/{chunk-Q7QXSQ46.js.map → chunk-VCMQFD3G.js.map} +0 -0
  1144. /package/dist/{chunk-CVDY7P3E.js.map → chunk-VKPBDNIO.js.map} +0 -0
  1145. /package/dist/{chunk-L6WVCO6D.js.map → chunk-VLDKWGHD.js.map} +0 -0
  1146. /package/dist/{chunk-IUPIJWFK.js.map → chunk-VM2NA2EL.js.map} +0 -0
  1147. /package/dist/{chunk-6JGMBTXP.js.map → chunk-VMZTCVEL.js.map} +0 -0
  1148. /package/dist/{chunk-CG2HT7TI.js.map → chunk-VQH5AXZY.js.map} +0 -0
  1149. /package/dist/{chunk-ZFGXQ54H.js.map → chunk-VTBTW6N4.js.map} +0 -0
  1150. /package/dist/{chunk-VJZPVP6C.js.map → chunk-VV7PLDX4.js.map} +0 -0
  1151. /package/dist/{chunk-LWEJGMVO.js.map → chunk-VYGGLH5H.js.map} +0 -0
  1152. /package/dist/{chunk-KFYLTQGK.js.map → chunk-VYQHHTQ4.js.map} +0 -0
  1153. /package/dist/{chunk-IB2EX6GX.js.map → chunk-VYSGRD2W.js.map} +0 -0
  1154. /package/dist/{chunk-5JMX5FRF.js.map → chunk-W4W63LTP.js.map} +0 -0
  1155. /package/dist/{chunk-HRLJNDDC.js.map → chunk-WHTRR66J.js.map} +0 -0
  1156. /package/dist/{chunk-BWBBS6HJ.js.map → chunk-WICIQFHJ.js.map} +0 -0
  1157. /package/dist/{chunk-CDB66JAO.js.map → chunk-WJYYMCCC.js.map} +0 -0
  1158. /package/dist/{chunk-TBUWK3RP.js.map → chunk-WSJOWQJE.js.map} +0 -0
  1159. /package/dist/{chunk-C2EERTYX.js.map → chunk-WYDUXZ2R.js.map} +0 -0
  1160. /package/dist/{chunk-E2SGFW2B.js.map → chunk-X62CN4YR.js.map} +0 -0
  1161. /package/dist/{chunk-VVCKB62D.js.map → chunk-XFQHKMO6.js.map} +0 -0
  1162. /package/dist/{chunk-IZZINUFM.js.map → chunk-XGJ7XZHS.js.map} +0 -0
  1163. /package/dist/{chunk-P5FLGDXW.js.map → chunk-XJFJNOEV.js.map} +0 -0
  1164. /package/dist/{chunk-UQ67SEGH.js.map → chunk-XKJLHMXZ.js.map} +0 -0
  1165. /package/dist/{chunk-VEJG6GQQ.js.map → chunk-XLFPJVQS.js.map} +0 -0
  1166. /package/dist/{chunk-RDHK2NYW.js.map → chunk-XM4ZLZFW.js.map} +0 -0
  1167. /package/dist/{chunk-6TWS6AXT.js.map → chunk-Y2GAWEJD.js.map} +0 -0
  1168. /package/dist/{chunk-MYDFABO6.js.map → chunk-Y3A74SVK.js.map} +0 -0
  1169. /package/dist/{chunk-C625ODRG.js.map → chunk-YANEVGI3.js.map} +0 -0
  1170. /package/dist/{chunk-OXM267RC.js.map → chunk-YHHSO5QR.js.map} +0 -0
  1171. /package/dist/{chunk-VVXOG3ZC.js.map → chunk-YOSOCHCB.js.map} +0 -0
  1172. /package/dist/{chunk-HHFFPE67.js.map → chunk-YP4SNX4P.js.map} +0 -0
  1173. /package/dist/{chunk-QCB3WNCA.js.map → chunk-YQH6AMIH.js.map} +0 -0
  1174. /package/dist/{chunk-NZBZLY7H.js.map → chunk-YRWL2IAE.js.map} +0 -0
  1175. /package/dist/{chunk-LYEALWBN.js.map → chunk-YTWRQ3WK.js.map} +0 -0
  1176. /package/dist/{chunk-7V2CQLTN.js.map → chunk-YV5GGSLK.js.map} +0 -0
  1177. /package/dist/{chunk-RY7YRYVT.js.map → chunk-YXUDK37V.js.map} +0 -0
  1178. /package/dist/{chunk-MUB44LD3.js.map → chunk-YYM5TSCR.js.map} +0 -0
  1179. /package/dist/{chunk-JTWK3VE7.js.map → chunk-ZG2CKFQF.js.map} +0 -0
  1180. /package/dist/{chunk-5UTHPGFF.js.map → chunk-ZGJXO2HH.js.map} +0 -0
  1181. /package/dist/{chunk-WTZ6OJUY.js.map → chunk-ZGV76PZ4.js.map} +0 -0
  1182. /package/dist/{chunk-A3QEJ2IZ.js.map → chunk-ZOBUR2VC.js.map} +0 -0
  1183. /package/dist/{computer-viewer-AVH5J4TC.js.map → computer-viewer-S6AL3XDT.js.map} +0 -0
  1184. /package/dist/{embedded-new-voice-M6PBWMQZ.js.map → embedded-new-voice-T3BXRYJX.js.map} +0 -0
  1185. /package/dist/{embedded-voice-7USALJKI.js.map → embedded-voice-ZJXMF3RP.js.map} +0 -0
  1186. /package/dist/{fleet-decision-row-XY6OZPHA.js.map → fleet-decision-row-AUCMLBCV.js.map} +0 -0
  1187. /package/dist/{model-policy-picker-menu-S5RTVLMQ.js.map → model-policy-picker-menu-TO57YUQ6.js.map} +0 -0
  1188. /package/dist/{payment-page-card-XSY5NO7D.js.map → payment-page-card-DFGDAMTG.js.map} +0 -0
  1189. /package/dist/{platform-activity-row-77WER5O3.js.map → platform-activity-row-ZMBEJGXN.js.map} +0 -0
  1190. /package/dist/{queue-surface-implementation-SDV7I32L.js.map → queue-surface-implementation-KDK5CYH6.js.map} +0 -0
  1191. /package/dist/{recorder-host-7GNQG6BB.js.map → recorder-host-3HLYRL4H.js.map} +0 -0
  1192. /package/dist/{sandbox-files-JOH2Q57T.js.map → sandbox-files-UOZ4OJZU.js.map} +0 -0
  1193. /package/dist/{session-connect-cards-HZIR4ZWT.js.map → session-connect-cards-VZIYLH45.js.map} +0 -0
  1194. /package/dist/{session-realtime-OPCPTIAP.js.map → session-realtime-2ZGJWVZP.js.map} +0 -0
  1195. /package/dist/{timeline-annotation-markers-WXCRA4BY.js.map → timeline-annotation-markers-KBTFWLME.js.map} +0 -0
  1196. /package/dist/{timeline-annotation-selection-YBZQNCNX.js.map → timeline-annotation-selection-VI4YSDR5.js.map} +0 -0
  1197. /package/dist/{timeline-annotations-dialog-4WVXTKFW.js.map → timeline-annotations-dialog-4PLWNLRB.js.map} +0 -0
@@ -0,0 +1,3690 @@
1
+ "use client";
2
+ import {
3
+ Tooltip,
4
+ TooltipContent,
5
+ TooltipProvider,
6
+ TooltipTrigger
7
+ } from "./chunk-SS4QT7SL.js";
8
+ import {
9
+ ConfirmDialog
10
+ } from "./chunk-VMZTCVEL.js";
11
+ import {
12
+ useLatestTaskRunner
13
+ } from "./chunk-2DDJ6YH6.js";
14
+ import {
15
+ ArtifactSubmissionProvider,
16
+ ArtifactSurface,
17
+ EditableArtifactDownloadButton,
18
+ EditableArtifactMessage,
19
+ artifactSubmissionSessionKey,
20
+ asEditableArtifactError,
21
+ editableArtifactAccessRevoked,
22
+ editableArtifactProjectionKey,
23
+ editableArtifactStatusLabel,
24
+ useArtifactSubmissions,
25
+ useEditableArtifactView
26
+ } from "./chunk-G6EI2O3N.js";
27
+ import {
28
+ cn
29
+ } from "./chunk-TXS65BB2.js";
30
+ import {
31
+ useOpenGeniText
32
+ } from "./chunk-LVUSG56I.js";
33
+
34
+ // src/components/artifacts/presentation-editor.tsx
35
+ import {
36
+ ChevronLeftIcon,
37
+ ChevronRightIcon,
38
+ ExpandIcon,
39
+ FilePlus2Icon,
40
+ MinusIcon,
41
+ PlusIcon,
42
+ Trash2Icon,
43
+ TypeIcon
44
+ } from "lucide-react";
45
+ import {
46
+ useCallback,
47
+ useEffect,
48
+ useId,
49
+ useLayoutEffect,
50
+ useMemo,
51
+ useRef,
52
+ useState
53
+ } from "react";
54
+ import { jsx, jsxs } from "react/jsx-runtime";
55
+ var MIN_ZOOM = 0.2;
56
+ var MAX_ZOOM = 4;
57
+ var RAIL_ITEM_HEIGHT = 116;
58
+ var RAIL_OVERSCAN = 3;
59
+ var DEFAULT_RAIL_HEIGHT = 640;
60
+ var MOBILE_RAIL_ITEM_HEIGHT = 44;
61
+ var MOBILE_RAIL_OVERSCAN = 3;
62
+ var DEFAULT_MOBILE_LIST_HEIGHT = 264;
63
+ var DEFAULT_VIEWPORT = { width: 960, height: 640 };
64
+ var SPATIAL_TILE = 256;
65
+ var MAX_SPATIAL_BUCKETS_PER_OBJECT = 1024;
66
+ var CANVAS_OVERSCAN_PX = 96;
67
+ var MAX_CANVAS_EDGE = 8192;
68
+ var MAX_CANVAS_PIXELS = 16e6;
69
+ var MAX_EDITOR_GEOMETRY = 1e6;
70
+ var MAX_TABLE_CELLS_PER_PAINT = 2e4;
71
+ var MAX_PROJECTION_SLIDES = 1e5;
72
+ var MAX_PROJECTION_ELEMENTS_PER_SLIDE = 1e5;
73
+ var MAX_PROJECTION_GROUP_DEPTH = 16;
74
+ var MAX_PROJECTION_TABLE_CELLS = 1e6;
75
+ var MAX_PROJECTION_TEXT = 1e6;
76
+ function PresentationEditor(props) {
77
+ return /* @__PURE__ */ jsx(PresentationEditorCore, { ...props });
78
+ }
79
+ function PresentationProjectionEditor({
80
+ projection,
81
+ commit,
82
+ onCommandError,
83
+ onSlideChange,
84
+ onSelectionChange,
85
+ readOnly = false,
86
+ ...props
87
+ }) {
88
+ const view = useMemo(() => presentationViewFromProjection(projection), [projection]);
89
+ return /* @__PURE__ */ jsx(
90
+ PresentationEditorCore,
91
+ {
92
+ ...props,
93
+ presentation: view.presentation,
94
+ revision: projection.revision,
95
+ readOnly: readOnly || !commit,
96
+ onCommit: commit ? (command) => commit({ ...command, revision: projection.revision }) : void 0,
97
+ onCommandError,
98
+ onSlideChange: (slide, index) => {
99
+ const projected = view.slideById.get(slide.id);
100
+ if (projected) onSlideChange?.(projected, index);
101
+ },
102
+ onSelectionChange: (object, slide) => {
103
+ const projectedSlide = view.slideById.get(slide.id);
104
+ if (!projectedSlide) return;
105
+ onSelectionChange?.(
106
+ object ? view.elementById.get(object.id) ?? null : null,
107
+ projectedSlide
108
+ );
109
+ }
110
+ }
111
+ );
112
+ }
113
+ function nextSlideIndexFromKey(key, activeIndex, length) {
114
+ if (length === 0) return null;
115
+ if (key === "ArrowDown") return Math.min(length - 1, activeIndex + 1);
116
+ if (key === "ArrowUp") return Math.max(0, activeIndex - 1);
117
+ if (key === "Home") return 0;
118
+ if (key === "End") return length - 1;
119
+ return null;
120
+ }
121
+ function PresentationEditorCore({
122
+ presentation,
123
+ revision,
124
+ activeSlideId: controlledSlideId,
125
+ defaultActiveSlideId,
126
+ selectedObjectId: controlledSelectionId,
127
+ defaultSelectedObjectId = null,
128
+ zoom: controlledZoom,
129
+ defaultZoom = 0.75,
130
+ readOnly = false,
131
+ authoringBlockedReason,
132
+ className,
133
+ onSlideChange,
134
+ onSelectionChange,
135
+ onCommit,
136
+ onCommandError,
137
+ onZoomChange
138
+ }) {
139
+ const t = useOpenGeniText();
140
+ const mutationsBlocked = readOnly || authoringBlockedReason !== void 0;
141
+ const authoringStatus = readOnly ? null : authoringBlockedReason === "pending_conflict" ? t("artifacts.presentationEditor.anEarlierChangeNeedsAttention") : authoringBlockedReason === "prior_writer" ? t("artifacts.presentationEditor.savingEarlierChanges") : null;
142
+ const slides = presentation.slides.items;
143
+ const firstSlideId = slides[0]?.id ?? null;
144
+ const [localSlideId, setLocalSlideId] = useState(
145
+ defaultActiveSlideId ?? controlledSlideId ?? firstSlideId
146
+ );
147
+ const requestedSlideId = controlledSlideId ?? localSlideId;
148
+ const activeSlide = slides.find((slide) => slide.id === requestedSlideId) ?? slides[0] ?? null;
149
+ const activeIndex = activeSlide ? slides.indexOf(activeSlide) : -1;
150
+ const [localSelectionId, setLocalSelectionId] = useState(defaultSelectedObjectId);
151
+ const selectedId = controlledSelectionId === void 0 ? localSelectionId : controlledSelectionId;
152
+ const [localZoom, setLocalZoom] = useState(() => clampZoom(defaultZoom));
153
+ const zoom = clampZoom(controlledZoom ?? localZoom);
154
+ const [fitMode, setFitMode] = useState(false);
155
+ const [viewportMeasured, setViewportMeasured] = useState(false);
156
+ const [modelEpoch, setModelEpoch] = useState(0);
157
+ const [pendingCommands, setPendingCommands] = useState(0);
158
+ const [commandFailure, setCommandFailure] = useState(null);
159
+ const [rail, setRail] = useState({
160
+ scrollTop: 0,
161
+ height: DEFAULT_RAIL_HEIGHT
162
+ });
163
+ const [mobileSelectorOpen, setMobileSelectorOpen] = useState(false);
164
+ const [mobileRail, setMobileRail] = useState({
165
+ scrollTop: 0,
166
+ height: DEFAULT_MOBILE_LIST_HEIGHT
167
+ });
168
+ const [viewport, setViewport] = useState({
169
+ scrollLeft: 0,
170
+ scrollTop: 0,
171
+ ...DEFAULT_VIEWPORT,
172
+ stageLeft: 0,
173
+ stageTop: 0
174
+ });
175
+ const [draftPosition, setDraftPosition] = useState(null);
176
+ const [textEdit, setTextEdit] = useState(null);
177
+ const [textDraft, setTextDraft] = useState("");
178
+ const [paintEpoch, setPaintEpoch] = useState(0);
179
+ const railRef = useRef(null);
180
+ const mobileSelectorTriggerRef = useRef(null);
181
+ const mobileSelectorPanelRef = useRef(null);
182
+ const mobileRailRef = useRef(null);
183
+ const viewportRef = useRef(null);
184
+ const stageRef = useRef(null);
185
+ const canvasRef = useRef(null);
186
+ const overlayRef = useRef(null);
187
+ const editorRef = useRef(null);
188
+ const dragRef = useRef(null);
189
+ const textEditRef = useRef(null);
190
+ const imageCacheRef = useRef(/* @__PURE__ */ new Map());
191
+ const mountedRef = useRef(true);
192
+ const commandScopeRef = useRef(0);
193
+ const commandVersionsRef = useRef(/* @__PURE__ */ new Map());
194
+ const pendingSlideIdRef = useRef(null);
195
+ const pendingObjectIdRef = useRef(null);
196
+ const mobileRailScrollOnOpenRef = useRef(0);
197
+ const domId = useId().replaceAll(":", "");
198
+ const selectionProxyId = `${domId}-presentation-selection`;
199
+ const instructionsId = `${domId}-presentation-instructions`;
200
+ const objects = useMemo(
201
+ () => activeSlide ? listSlideObjects(activeSlide) : [],
202
+ // revision is a deliberate host invalidation token; modelEpoch covers local commits.
203
+ // oxlint-disable-next-line react-hooks/exhaustive-deps
204
+ [activeSlide, modelEpoch, revision]
205
+ );
206
+ const objectById = useMemo(
207
+ () => new Map(objects.map((entry) => [entry.id, entry])),
208
+ [objects]
209
+ );
210
+ const objectIndexById = useMemo(
211
+ () => new Map(objects.map((entry, index) => [entry.id, index])),
212
+ [objects]
213
+ );
214
+ const selected = selectedId ? objectById.get(selectedId) ?? null : null;
215
+ const spatialIndex = useMemo(
216
+ () => buildSpatialIndex(objects, presentation.slideSize),
217
+ [objects, presentation.slideSize]
218
+ );
219
+ const effectiveSelectedPosition = selected && draftPosition?.objectId === selected.id ? draftPosition.position : selected ? copyPosition(selected.object.position) : null;
220
+ useEffect(() => {
221
+ const pendingSlideId = pendingSlideIdRef.current;
222
+ if (pendingSlideId && controlledSlideId === void 0 && slides.some((slide) => slide.id === pendingSlideId)) {
223
+ pendingSlideIdRef.current = null;
224
+ setLocalSlideId(pendingSlideId);
225
+ return;
226
+ }
227
+ if (activeSlide && requestedSlideId !== activeSlide.id && controlledSlideId === void 0 && pendingSlideId === null) {
228
+ setLocalSlideId(activeSlide.id);
229
+ }
230
+ }, [activeSlide, controlledSlideId, requestedSlideId, slides]);
231
+ useEffect(() => {
232
+ if (selectedId && !objectById.has(selectedId) && controlledSelectionId === void 0) {
233
+ setLocalSelectionId(null);
234
+ }
235
+ }, [controlledSelectionId, objectById, selectedId]);
236
+ useEffect(() => {
237
+ const pendingObjectId = pendingObjectIdRef.current;
238
+ if (pendingObjectId && controlledSelectionId === void 0 && objectById.has(pendingObjectId)) {
239
+ pendingObjectIdRef.current = null;
240
+ setLocalSelectionId(pendingObjectId);
241
+ }
242
+ }, [controlledSelectionId, objectById]);
243
+ useLayoutEffect(() => {
244
+ const element = railRef.current;
245
+ if (!element || typeof ResizeObserver === "undefined") return;
246
+ const measure = () => setRail((current) => ({
247
+ scrollTop: element.scrollTop,
248
+ height: element.clientHeight || current.height
249
+ }));
250
+ measure();
251
+ const observer = new ResizeObserver(measure);
252
+ observer.observe(element);
253
+ return () => observer.disconnect();
254
+ }, []);
255
+ useLayoutEffect(() => {
256
+ if (!mobileSelectorOpen) return;
257
+ const element = mobileRailRef.current;
258
+ if (!element) return;
259
+ element.scrollTop = mobileRailScrollOnOpenRef.current;
260
+ element.focus();
261
+ const measure = () => setMobileRail((current) => ({
262
+ scrollTop: element.scrollTop,
263
+ height: element.clientHeight || current.height
264
+ }));
265
+ measure();
266
+ if (typeof ResizeObserver === "undefined") return;
267
+ const observer = new ResizeObserver(measure);
268
+ observer.observe(element);
269
+ return () => observer.disconnect();
270
+ }, [mobileSelectorOpen]);
271
+ useEffect(() => {
272
+ if (!mobileSelectorOpen) return;
273
+ const onPointerDown = (event) => {
274
+ const target = event.target;
275
+ if (!(target instanceof Node)) return;
276
+ if (mobileSelectorTriggerRef.current?.contains(target)) return;
277
+ if (mobileSelectorPanelRef.current?.contains(target)) return;
278
+ setMobileSelectorOpen(false);
279
+ };
280
+ const onKeyDown = (event) => {
281
+ if (event.key !== "Escape") return;
282
+ event.preventDefault();
283
+ setMobileSelectorOpen(false);
284
+ mobileSelectorTriggerRef.current?.focus();
285
+ };
286
+ document.addEventListener("pointerdown", onPointerDown);
287
+ document.addEventListener("keydown", onKeyDown);
288
+ return () => {
289
+ document.removeEventListener("pointerdown", onPointerDown);
290
+ document.removeEventListener("keydown", onKeyDown);
291
+ };
292
+ }, [mobileSelectorOpen]);
293
+ useLayoutEffect(() => {
294
+ const element = viewportRef.current;
295
+ if (!element) return;
296
+ const measure = () => {
297
+ const stage = stageRef.current;
298
+ const measuredWidth = element.clientWidth;
299
+ const measuredHeight = element.clientHeight;
300
+ const next = {
301
+ scrollLeft: element.scrollLeft,
302
+ scrollTop: element.scrollTop,
303
+ width: measuredWidth || DEFAULT_VIEWPORT.width,
304
+ height: measuredHeight || DEFAULT_VIEWPORT.height,
305
+ stageLeft: stage?.offsetLeft ?? 0,
306
+ stageTop: stage?.offsetTop ?? 0
307
+ };
308
+ setViewport((current) => sameViewport(current, next) ? current : next);
309
+ if (measuredWidth > 0 && measuredHeight > 0) setViewportMeasured(true);
310
+ };
311
+ measure();
312
+ if (typeof ResizeObserver === "undefined") return;
313
+ const observer = new ResizeObserver(measure);
314
+ observer.observe(element);
315
+ if (stageRef.current) observer.observe(stageRef.current);
316
+ return () => observer.disconnect();
317
+ }, [activeSlide?.id, presentation.slideSize.height, presentation.slideSize.width, zoom]);
318
+ useLayoutEffect(() => {
319
+ const imageCache = imageCacheRef.current;
320
+ return () => disposeCanvasImageCache(imageCache);
321
+ }, [activeSlide]);
322
+ useEffect(() => {
323
+ const edit = textEditRef.current;
324
+ const currentEntry = edit ? objectById.get(edit.shape.id) : null;
325
+ if (edit && activeSlide?.id === edit.slideId && currentEntry?.kind === "shape" && !currentEntry.readOnly && currentEntry.object.geometry !== "line") {
326
+ const rebound = {
327
+ ...edit,
328
+ shape: currentEntry.object
329
+ };
330
+ textEditRef.current = rebound;
331
+ setTextEdit(rebound);
332
+ } else {
333
+ textEditRef.current = null;
334
+ setTextEdit(null);
335
+ }
336
+ }, [activeSlide?.id, objectById]);
337
+ useEffect(() => {
338
+ dragRef.current = null;
339
+ setDraftPosition(null);
340
+ commandScopeRef.current += 1;
341
+ commandVersionsRef.current.clear();
342
+ setPendingCommands(0);
343
+ setCommandFailure(null);
344
+ }, [activeSlide?.id, revision]);
345
+ useEffect(() => {
346
+ const edit = textEditRef.current;
347
+ if (edit && edit.shape.id !== selectedId) {
348
+ textEditRef.current = null;
349
+ setTextEdit(null);
350
+ }
351
+ const drag = dragRef.current;
352
+ if (drag && drag.object.id !== selectedId) {
353
+ dragRef.current = null;
354
+ setDraftPosition(null);
355
+ }
356
+ }, [selectedId]);
357
+ useEffect(() => {
358
+ if (!readOnly) return;
359
+ dragRef.current = null;
360
+ setDraftPosition(null);
361
+ textEditRef.current = null;
362
+ setTextEdit(null);
363
+ }, [readOnly]);
364
+ useEffect(() => {
365
+ mountedRef.current = true;
366
+ return () => {
367
+ mountedRef.current = false;
368
+ dragRef.current = null;
369
+ textEditRef.current = null;
370
+ };
371
+ }, []);
372
+ useEffect(() => {
373
+ const element = railRef.current;
374
+ if (!element || activeIndex < 0) return;
375
+ const top = activeIndex * RAIL_ITEM_HEIGHT;
376
+ const bottom = top + RAIL_ITEM_HEIGHT;
377
+ const height = element.clientHeight || rail.height;
378
+ if (top >= element.scrollTop && bottom <= element.scrollTop + height) return;
379
+ const nextTop = Math.max(0, top - height / 2);
380
+ element.scrollTop = nextTop;
381
+ setRail((current) => ({ ...current, scrollTop: nextTop }));
382
+ }, [activeIndex, rail.height]);
383
+ const visibleSlideRegion = useMemo(() => {
384
+ const slideWidth = presentation.slideSize.width;
385
+ const slideHeight = presentation.slideSize.height;
386
+ const stageWidth2 = slideWidth * zoom;
387
+ const stageHeight2 = slideHeight * zoom;
388
+ if (stageWidth2 <= viewport.width && stageHeight2 <= viewport.height) {
389
+ return { left: 0, top: 0, width: slideWidth, height: slideHeight };
390
+ }
391
+ const overscan = CANVAS_OVERSCAN_PX / zoom;
392
+ const visibleLeft = Math.max(0, (viewport.scrollLeft - viewport.stageLeft) / zoom);
393
+ const visibleTop = Math.max(0, (viewport.scrollTop - viewport.stageTop) / zoom);
394
+ const left = Math.max(0, visibleLeft - overscan);
395
+ const top = Math.max(0, visibleTop - overscan);
396
+ return {
397
+ left,
398
+ top,
399
+ width: Math.max(0, Math.min(slideWidth - left, viewport.width / zoom + overscan * 2)),
400
+ height: Math.max(0, Math.min(slideHeight - top, viewport.height / zoom + overscan * 2))
401
+ };
402
+ }, [presentation.slideSize.height, presentation.slideSize.width, viewport, zoom]);
403
+ const visibleObjectIndexes = useMemo(() => {
404
+ if (!activeSlide) return [];
405
+ if (visibleSlideRegion.left === 0 && visibleSlideRegion.top === 0 && visibleSlideRegion.width === presentation.slideSize.width && visibleSlideRegion.height === presentation.slideSize.height) {
406
+ return objects.map((_, index) => index);
407
+ }
408
+ const visible = querySpatialIndex(spatialIndex, visibleSlideRegion);
409
+ const selectedIndex = selectedId ? objectIndexById.get(selectedId) ?? -1 : -1;
410
+ if (selectedIndex >= 0 && !visible.includes(selectedIndex)) visible.push(selectedIndex);
411
+ const draftIndex = draftPosition ? objectIndexById.get(draftPosition.objectId) ?? -1 : -1;
412
+ if (draftIndex >= 0 && !visible.includes(draftIndex)) visible.push(draftIndex);
413
+ return visible.sort((a, b) => a - b);
414
+ }, [
415
+ activeSlide,
416
+ objects,
417
+ objectIndexById,
418
+ presentation.slideSize,
419
+ draftPosition,
420
+ selectedId,
421
+ spatialIndex,
422
+ visibleSlideRegion
423
+ ]);
424
+ useLayoutEffect(() => {
425
+ const canvas = canvasRef.current;
426
+ if (!canvas || !activeSlide) return;
427
+ paintSlideCanvas(t, {
428
+ canvas,
429
+ slide: activeSlide,
430
+ slideSize: presentation.slideSize,
431
+ zoom,
432
+ objects,
433
+ objectIndexes: visibleObjectIndexes,
434
+ renderRegion: visibleSlideRegion,
435
+ draftPosition,
436
+ imageCache: imageCacheRef.current,
437
+ requestRepaint: () => setPaintEpoch((value) => value + 1)
438
+ });
439
+ }, [
440
+ activeSlide,
441
+ draftPosition,
442
+ objects,
443
+ paintEpoch,
444
+ presentation.slideSize,
445
+ visibleObjectIndexes,
446
+ visibleSlideRegion,
447
+ zoom,
448
+ t
449
+ ]);
450
+ const selectObject = useCallback(
451
+ (entry) => {
452
+ textEditRef.current = null;
453
+ setTextEdit(null);
454
+ setDraftPosition(null);
455
+ if (controlledSelectionId === void 0) setLocalSelectionId(entry?.id ?? null);
456
+ if (activeSlide) onSelectionChange?.(entry?.object ?? null, activeSlide);
457
+ },
458
+ [activeSlide, controlledSelectionId, onSelectionChange]
459
+ );
460
+ const selectSlide = useCallback(
461
+ (slide, index) => {
462
+ if (controlledSlideId === void 0) setLocalSlideId(slide.id);
463
+ selectObject(null);
464
+ onSlideChange?.(slide, index);
465
+ },
466
+ [controlledSlideId, onSlideChange, selectObject]
467
+ );
468
+ const changeZoom = useCallback(
469
+ (next) => {
470
+ const clamped = clampZoom(next);
471
+ setFitMode(false);
472
+ if (clamped === zoom) return;
473
+ if (controlledZoom === void 0) setLocalZoom(clamped);
474
+ onZoomChange?.(clamped);
475
+ },
476
+ [controlledZoom, onZoomChange, zoom]
477
+ );
478
+ const applyFittedZoom = useCallback(() => {
479
+ const next = fittedPresentationZoom(viewport, presentation.slideSize);
480
+ if (next === zoom) return;
481
+ if (controlledZoom === void 0) setLocalZoom(next);
482
+ onZoomChange?.(next);
483
+ }, [controlledZoom, onZoomChange, presentation.slideSize, viewport, zoom]);
484
+ const fitSlide = useCallback(() => {
485
+ setFitMode(true);
486
+ applyFittedZoom();
487
+ }, [applyFittedZoom]);
488
+ useLayoutEffect(() => {
489
+ if (!viewportMeasured || controlledZoom !== void 0) return;
490
+ const fitted = fittedPresentationZoom(viewport, presentation.slideSize);
491
+ if (!fitMode && zoom <= fitted) return;
492
+ if (!fitMode) setFitMode(true);
493
+ applyFittedZoom();
494
+ }, [
495
+ applyFittedZoom,
496
+ controlledZoom,
497
+ fitMode,
498
+ presentation.slideSize,
499
+ viewport,
500
+ viewportMeasured,
501
+ zoom
502
+ ]);
503
+ const runCommit = useCallback(
504
+ (key, command, rollback, retry) => {
505
+ if (mutationsBlocked || !onCommit) return;
506
+ const version = (commandVersionsRef.current.get(key) ?? 0) + 1;
507
+ commandVersionsRef.current.set(key, version);
508
+ const scope = commandScopeRef.current;
509
+ setCommandFailure(null);
510
+ let result;
511
+ try {
512
+ result = onCommit(command);
513
+ } catch (cause) {
514
+ if (!mountedRef.current || commandScopeRef.current !== scope || commandVersionsRef.current.get(key) !== version) {
515
+ return;
516
+ }
517
+ rollback();
518
+ const error = asPresentationError(cause);
519
+ setCommandFailure({ message: error.message, retry });
520
+ onCommandError?.(error);
521
+ return;
522
+ }
523
+ if (!result || typeof result.then !== "function") return;
524
+ setPendingCommands((current) => current + 1);
525
+ void Promise.resolve(result).then(
526
+ () => {
527
+ if (!mountedRef.current || commandScopeRef.current !== scope) return;
528
+ setPendingCommands((current) => Math.max(0, current - 1));
529
+ },
530
+ (cause) => {
531
+ if (!mountedRef.current || commandScopeRef.current !== scope) return;
532
+ setPendingCommands((current) => Math.max(0, current - 1));
533
+ if (commandVersionsRef.current.get(key) !== version) return;
534
+ rollback();
535
+ const error = asPresentationError(cause);
536
+ setCommandFailure({ message: error.message, retry });
537
+ onCommandError?.(error);
538
+ }
539
+ );
540
+ },
541
+ [mutationsBlocked, onCommandError, onCommit]
542
+ );
543
+ const commitPosition = useCallback(
544
+ (entry, kind, next) => {
545
+ if (!activeSlide || mutationsBlocked || entry.readOnly) return;
546
+ const before = copyPosition(entry.object.position);
547
+ const after = normalizeEditorPosition(next);
548
+ if (samePosition(before, after)) return;
549
+ entry.object.position = after;
550
+ setModelEpoch((value) => value + 1);
551
+ const command = {
552
+ kind,
553
+ slideId: activeSlide.id,
554
+ objectId: entry.id,
555
+ before,
556
+ after
557
+ };
558
+ const submit = () => runCommit(
559
+ `position:${activeSlide.id}:${entry.id}`,
560
+ command,
561
+ () => {
562
+ entry.object.position = before;
563
+ setModelEpoch((value) => value + 1);
564
+ },
565
+ () => {
566
+ entry.object.position = after;
567
+ setModelEpoch((value) => value + 1);
568
+ submit();
569
+ }
570
+ );
571
+ submit();
572
+ },
573
+ [activeSlide, mutationsBlocked, runCommit]
574
+ );
575
+ const insertSlide = useCallback(() => {
576
+ if (mutationsBlocked) return;
577
+ const slideId = randomPresentationId();
578
+ const index = activeIndex < 0 ? slides.length : activeIndex + 1;
579
+ const command = { kind: "slide-insert", slideId, index };
580
+ const submit = () => {
581
+ pendingSlideIdRef.current = slideId;
582
+ runCommit(
583
+ `slide-insert:${slideId}`,
584
+ command,
585
+ () => {
586
+ if (pendingSlideIdRef.current === slideId) pendingSlideIdRef.current = null;
587
+ },
588
+ submit
589
+ );
590
+ };
591
+ submit();
592
+ }, [activeIndex, mutationsBlocked, runCommit, slides.length]);
593
+ const deleteSlide = useCallback(
594
+ (slideId) => {
595
+ const index = slides.findIndex((slide) => slide.id === slideId);
596
+ if (mutationsBlocked || index < 0) return;
597
+ const command = { kind: "slide-delete", slideId, index };
598
+ const submit = () => runCommit(`slide-delete:${slideId}`, command, () => void 0, submit);
599
+ submit();
600
+ },
601
+ [mutationsBlocked, runCommit, slides]
602
+ );
603
+ const insertTextBox = useCallback(() => {
604
+ if (mutationsBlocked || !activeSlide) return;
605
+ const objectId = randomPresentationId();
606
+ const position = nextTextBoxPosition(objects, presentation.slideSize);
607
+ const command = {
608
+ kind: "object-insert",
609
+ slideId: activeSlide.id,
610
+ objectId,
611
+ index: activeSlide.elements.length,
612
+ position
613
+ };
614
+ const submit = () => {
615
+ pendingObjectIdRef.current = objectId;
616
+ runCommit(
617
+ `object-insert:${activeSlide.id}:${objectId}`,
618
+ command,
619
+ () => {
620
+ if (pendingObjectIdRef.current === objectId) pendingObjectIdRef.current = null;
621
+ },
622
+ submit
623
+ );
624
+ };
625
+ submit();
626
+ }, [activeSlide, objects, presentation.slideSize, mutationsBlocked, runCommit]);
627
+ const deleteObject = useCallback(
628
+ (slideId, objectId) => {
629
+ const entry = activeSlide?.id === slideId ? objectById.get(objectId) : void 0;
630
+ if (mutationsBlocked || !entry || entry.readOnly) return;
631
+ const command = { kind: "object-delete", slideId, objectId };
632
+ const submit = () => runCommit(`object-delete:${slideId}:${objectId}`, command, () => void 0, submit);
633
+ submit();
634
+ },
635
+ [activeSlide, mutationsBlocked, objectById, runCommit]
636
+ );
637
+ const deleteTriggerRef = useRef(null);
638
+ const addSlideRef = useRef(null);
639
+ const [confirmingDelete, setConfirmingDelete] = useState(null);
640
+ const deleteTarget = selected && !selected.readOnly && activeSlide ? {
641
+ kind: "object",
642
+ slideId: activeSlide.id,
643
+ objectId: selected.id,
644
+ name: objectLabel(t, selected)
645
+ } : activeSlide ? { kind: "slide", slideId: activeSlide.id, index: activeIndex } : null;
646
+ const deleteEnabled = !mutationsBlocked && deleteTarget !== null;
647
+ const deleteKind = deleteTarget?.kind ?? "slide";
648
+ const deleteLabel = deleteKind === "object" ? t("artifacts.presentationEditor.deleteObject") : t("artifacts.presentationEditor.deleteSlide");
649
+ const confirmingTargetExists = confirmingDelete === null ? false : confirmingDelete.kind === "slide" ? slides.some((slide) => slide.id === confirmingDelete.slideId) : activeSlide?.id === confirmingDelete.slideId && objectById.has(confirmingDelete.objectId);
650
+ useEffect(() => {
651
+ if (confirmingDelete !== null && (mutationsBlocked || !confirmingTargetExists)) {
652
+ setConfirmingDelete(null);
653
+ }
654
+ }, [confirmingDelete, confirmingTargetExists, mutationsBlocked]);
655
+ const confirmDelete = useCallback(() => {
656
+ if (confirmingDelete?.kind === "object") {
657
+ deleteObject(confirmingDelete.slideId, confirmingDelete.objectId);
658
+ } else if (confirmingDelete?.kind === "slide") {
659
+ deleteSlide(confirmingDelete.slideId);
660
+ }
661
+ }, [confirmingDelete, deleteObject, deleteSlide]);
662
+ const startTextEdit = useCallback(
663
+ (entry) => {
664
+ if (mutationsBlocked || !entry || entry.readOnly || entry.kind !== "shape") return;
665
+ const shape = entry.object;
666
+ if (shape.geometry === "line") return;
667
+ const before = shape.text.toString();
668
+ if (!activeSlide) return;
669
+ const edit = { slideId: activeSlide.id, shape, before };
670
+ textEditRef.current = edit;
671
+ setTextEdit(edit);
672
+ setTextDraft(before);
673
+ },
674
+ [activeSlide, mutationsBlocked]
675
+ );
676
+ useEffect(() => {
677
+ if (!textEdit) return;
678
+ editorRef.current?.focus();
679
+ editorRef.current?.select();
680
+ }, [textEdit]);
681
+ const finishTextEdit = useCallback(
682
+ (cancel = false) => {
683
+ const edit = textEditRef.current;
684
+ if (!edit || !cancel && authoringBlockedReason !== void 0) return;
685
+ textEditRef.current = null;
686
+ setTextEdit(null);
687
+ const { shape, before, slideId } = edit;
688
+ if (!activeSlide || activeSlide.id !== slideId) return;
689
+ if (cancel || mutationsBlocked || before === textDraft) return;
690
+ shape.text.set(textDraft);
691
+ setModelEpoch((value) => value + 1);
692
+ const command = {
693
+ kind: "text",
694
+ slideId,
695
+ objectId: shape.id,
696
+ before,
697
+ after: textDraft
698
+ };
699
+ const submit = () => runCommit(
700
+ `text:${slideId}:${shape.id}`,
701
+ command,
702
+ () => {
703
+ shape.text.set(before);
704
+ setModelEpoch((value) => value + 1);
705
+ },
706
+ () => {
707
+ shape.text.set(textDraft);
708
+ setModelEpoch((value) => value + 1);
709
+ submit();
710
+ }
711
+ );
712
+ submit();
713
+ },
714
+ [activeSlide, authoringBlockedReason, mutationsBlocked, runCommit, textDraft]
715
+ );
716
+ const cycleObject = useCallback(
717
+ (direction) => {
718
+ if (objects.length === 0) return;
719
+ const current = selected ? objects.indexOf(selected) : direction === 1 ? -1 : 0;
720
+ const next = (current + direction + objects.length) % objects.length;
721
+ selectObject(objects[next] ?? null);
722
+ },
723
+ [objects, selectObject, selected]
724
+ );
725
+ const changeSlideBy = useCallback(
726
+ (amount) => {
727
+ if (activeIndex < 0) return;
728
+ const nextIndex = Math.max(0, Math.min(slides.length - 1, activeIndex + amount));
729
+ const next = slides[nextIndex];
730
+ if (next && next !== activeSlide) selectSlide(next, nextIndex);
731
+ },
732
+ [activeIndex, activeSlide, selectSlide, slides]
733
+ );
734
+ const toggleMobileSlideSelector = useCallback(() => {
735
+ setMobileSelectorOpen((open) => {
736
+ if (open) return false;
737
+ const index = Math.max(0, activeIndex);
738
+ const height = DEFAULT_MOBILE_LIST_HEIGHT;
739
+ const maxScroll = Math.max(0, slides.length * MOBILE_RAIL_ITEM_HEIGHT - height);
740
+ const scrollTop = Math.max(
741
+ 0,
742
+ Math.min(
743
+ maxScroll,
744
+ index * MOBILE_RAIL_ITEM_HEIGHT - height / 2 + MOBILE_RAIL_ITEM_HEIGHT / 2
745
+ )
746
+ );
747
+ mobileRailScrollOnOpenRef.current = scrollTop;
748
+ setMobileRail({ scrollTop, height });
749
+ return true;
750
+ });
751
+ }, [activeIndex, slides.length]);
752
+ const chooseMobileSlide = useCallback(
753
+ (slide, index) => {
754
+ if (slide !== activeSlide) selectSlide(slide, index);
755
+ setMobileSelectorOpen(false);
756
+ mobileSelectorTriggerRef.current?.focus();
757
+ },
758
+ [activeSlide, selectSlide]
759
+ );
760
+ const handleCanvasKeyDown = useCallback(
761
+ (event) => {
762
+ if (event.metaKey || event.ctrlKey) {
763
+ if (event.key === "+" || event.key === "=") {
764
+ event.preventDefault();
765
+ changeZoom(zoom * 1.15);
766
+ } else if (event.key === "-") {
767
+ event.preventDefault();
768
+ changeZoom(zoom / 1.15);
769
+ } else if (event.key === "0") {
770
+ event.preventDefault();
771
+ fitSlide();
772
+ }
773
+ return;
774
+ }
775
+ if (event.key === "]") {
776
+ event.preventDefault();
777
+ cycleObject(1);
778
+ return;
779
+ }
780
+ if (event.key === "[") {
781
+ event.preventDefault();
782
+ cycleObject(-1);
783
+ return;
784
+ }
785
+ if (event.key === "PageDown") {
786
+ event.preventDefault();
787
+ changeSlideBy(1);
788
+ return;
789
+ }
790
+ if (event.key === "PageUp") {
791
+ event.preventDefault();
792
+ changeSlideBy(-1);
793
+ return;
794
+ }
795
+ if (event.key === "Escape") {
796
+ event.preventDefault();
797
+ selectObject(null);
798
+ return;
799
+ }
800
+ if (event.key === "Enter" || event.key === "F2") {
801
+ if (selected?.kind === "shape") {
802
+ event.preventDefault();
803
+ startTextEdit(selected);
804
+ }
805
+ return;
806
+ }
807
+ if (!selected || !event.key.startsWith("Arrow")) return;
808
+ event.preventDefault();
809
+ if (mutationsBlocked || selected.readOnly) return;
810
+ const amount = event.shiftKey ? 10 : 1;
811
+ const dx = event.key === "ArrowLeft" ? -amount : event.key === "ArrowRight" ? amount : 0;
812
+ const dy = event.key === "ArrowUp" ? -amount : event.key === "ArrowDown" ? amount : 0;
813
+ const before = selected.object.position;
814
+ commitPosition(
815
+ selected,
816
+ event.altKey ? "resize" : "move",
817
+ event.altKey ? {
818
+ ...before,
819
+ width: Math.max(8, before.width + dx),
820
+ height: Math.max(8, before.height + dy)
821
+ } : { ...before, left: before.left + dx, top: before.top + dy }
822
+ );
823
+ },
824
+ [
825
+ changeSlideBy,
826
+ changeZoom,
827
+ commitPosition,
828
+ cycleObject,
829
+ fitSlide,
830
+ mutationsBlocked,
831
+ selectObject,
832
+ selected,
833
+ startTextEdit,
834
+ zoom
835
+ ]
836
+ );
837
+ const pointFromPointer = useCallback(
838
+ (event) => {
839
+ const rect = overlayRef.current?.getBoundingClientRect() ?? event.currentTarget.getBoundingClientRect();
840
+ const width = rect.width || presentation.slideSize.width * zoom;
841
+ const height = rect.height || presentation.slideSize.height * zoom;
842
+ return {
843
+ x: (event.clientX - rect.left) / Math.max(1, width) * presentation.slideSize.width,
844
+ y: (event.clientY - rect.top) / Math.max(1, height) * presentation.slideSize.height
845
+ };
846
+ },
847
+ [presentation.slideSize.height, presentation.slideSize.width, zoom]
848
+ );
849
+ const beginDrag = useCallback(
850
+ (event, entry, mode) => {
851
+ event.preventDefault();
852
+ event.stopPropagation();
853
+ selectObject(entry);
854
+ if (mutationsBlocked || entry.readOnly) return;
855
+ const start = pointFromPointer(event);
856
+ const before = copyPosition(entry.object.position);
857
+ dragRef.current = {
858
+ pointerId: event.pointerId,
859
+ mode,
860
+ object: entry.object,
861
+ rotation: objectRotation(entry),
862
+ start,
863
+ before
864
+ };
865
+ setDraftPosition({ objectId: entry.id, position: before });
866
+ overlayRef.current?.setPointerCapture?.(event.pointerId);
867
+ },
868
+ [pointFromPointer, mutationsBlocked, selectObject]
869
+ );
870
+ const handlePointerDown = useCallback(
871
+ (event) => {
872
+ if (event.button !== 0) return;
873
+ const point = pointFromPointer(event);
874
+ const hit = hitTest(spatialIndex, point.x, point.y);
875
+ if (!hit) {
876
+ selectObject(null);
877
+ return;
878
+ }
879
+ beginDrag(event, hit, "move");
880
+ },
881
+ [beginDrag, pointFromPointer, selectObject, spatialIndex]
882
+ );
883
+ const handlePointerMove = useCallback(
884
+ (event) => {
885
+ const drag = dragRef.current;
886
+ if (!drag || drag.pointerId !== event.pointerId || mutationsBlocked) return;
887
+ const point = pointFromPointer(event);
888
+ setDraftPosition({ objectId: drag.object.id, position: positionFromDrag(drag, point) });
889
+ },
890
+ [mutationsBlocked, pointFromPointer]
891
+ );
892
+ const finishDrag = useCallback(
893
+ (event, cancel = false) => {
894
+ const drag = dragRef.current;
895
+ if (!drag || drag.pointerId !== event.pointerId || !cancel && authoringBlockedReason !== void 0)
896
+ return;
897
+ dragRef.current = null;
898
+ const captureTarget = overlayRef.current;
899
+ if (captureTarget?.hasPointerCapture?.(event.pointerId)) {
900
+ captureTarget.releasePointerCapture(event.pointerId);
901
+ }
902
+ setDraftPosition(null);
903
+ if (cancel) return;
904
+ const entry = objectById.get(drag.object.id);
905
+ if (!entry) return;
906
+ const point = pointFromPointer(event);
907
+ commitPosition(entry, drag.mode, positionFromDrag(drag, point));
908
+ },
909
+ [authoringBlockedReason, commitPosition, objectById, pointFromPointer]
910
+ );
911
+ const handleLostPointerCapture = useCallback(
912
+ (event) => {
913
+ const drag = dragRef.current;
914
+ if (!drag || drag.pointerId !== event.pointerId || authoringBlockedReason !== void 0)
915
+ return;
916
+ dragRef.current = null;
917
+ setDraftPosition(null);
918
+ },
919
+ [authoringBlockedReason]
920
+ );
921
+ const railStart = Math.max(0, Math.floor(rail.scrollTop / RAIL_ITEM_HEIGHT) - RAIL_OVERSCAN);
922
+ const railEnd = Math.min(
923
+ slides.length,
924
+ Math.ceil((rail.scrollTop + rail.height) / RAIL_ITEM_HEIGHT) + RAIL_OVERSCAN
925
+ );
926
+ const mobileRailStart = Math.max(
927
+ 0,
928
+ Math.floor(mobileRail.scrollTop / MOBILE_RAIL_ITEM_HEIGHT) - MOBILE_RAIL_OVERSCAN
929
+ );
930
+ const mobileRailEnd = Math.min(
931
+ slides.length,
932
+ Math.ceil((mobileRail.scrollTop + mobileRail.height) / MOBILE_RAIL_ITEM_HEIGHT) + MOBILE_RAIL_OVERSCAN
933
+ );
934
+ const slideCountLabel = activeIndex >= 0 ? `${activeIndex + 1} / ${slides.length}` : `0 / ${slides.length}`;
935
+ const stageWidth = presentation.slideSize.width * zoom;
936
+ const stageHeight = presentation.slideSize.height * zoom;
937
+ return /* @__PURE__ */ jsxs(
938
+ "div",
939
+ {
940
+ className: cn("flex size-full min-w-0 flex-col bg-og-surface-1", className),
941
+ style: { minHeight: "22rem" },
942
+ "data-og-presentation-editor": true,
943
+ "data-og-painted-object-count": visibleObjectIndexes.length,
944
+ "data-og-command-state": commandFailure || authoringBlockedReason === "pending_conflict" ? "error" : pendingCommands > 0 || authoringBlockedReason === "prior_writer" ? "pending" : "idle",
945
+ "aria-busy": pendingCommands > 0 || authoringBlockedReason === "prior_writer" ? "true" : void 0,
946
+ children: [
947
+ /* @__PURE__ */ jsxs(
948
+ "div",
949
+ {
950
+ role: "toolbar",
951
+ "aria-label": t("artifacts.presentationEditor.presentationControls"),
952
+ className: "flex h-10 shrink-0 items-center border-b border-og-border bg-og-surface-2",
953
+ children: [
954
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-x-auto px-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: [
955
+ /* @__PURE__ */ jsx(
956
+ "button",
957
+ {
958
+ type: "button",
959
+ "aria-label": t("artifacts.presentationEditor.previousSlide"),
960
+ disabled: activeIndex <= 0,
961
+ onClick: () => changeSlideBy(-1),
962
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
963
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
964
+ }
965
+ ),
966
+ /* @__PURE__ */ jsx(
967
+ "button",
968
+ {
969
+ ref: mobileSelectorTriggerRef,
970
+ type: "button",
971
+ "aria-label": t("artifacts.presentationEditor.chooseSlide"),
972
+ "aria-haspopup": "listbox",
973
+ "aria-expanded": mobileSelectorOpen,
974
+ "aria-controls": mobileSelectorOpen ? `${domId}-mobile-slides` : void 0,
975
+ disabled: slides.length === 0,
976
+ "data-og-mobile-slide-selector": true,
977
+ onClick: toggleMobileSlideSelector,
978
+ className: "inline-flex min-h-11 min-w-16 shrink-0 items-center justify-center rounded-og-sm px-2 text-og-xs tabular-nums text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 sm:hidden",
979
+ children: /* @__PURE__ */ jsx("span", { children: slideCountLabel })
980
+ }
981
+ ),
982
+ /* @__PURE__ */ jsx("span", { className: "hidden min-w-16 shrink-0 text-center text-og-xs tabular-nums text-og-fg-muted sm:inline", children: slideCountLabel }),
983
+ /* @__PURE__ */ jsx(
984
+ "button",
985
+ {
986
+ type: "button",
987
+ "aria-label": t("artifacts.presentationEditor.nextSlide"),
988
+ disabled: activeIndex < 0 || activeIndex >= slides.length - 1,
989
+ onClick: () => changeSlideBy(1),
990
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
991
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
992
+ }
993
+ ),
994
+ /* @__PURE__ */ jsx(
995
+ "button",
996
+ {
997
+ type: "button",
998
+ ref: addSlideRef,
999
+ "aria-label": t("artifacts.presentationEditor.addSlide"),
1000
+ disabled: mutationsBlocked,
1001
+ onClick: insertSlide,
1002
+ className: "ml-0.5 grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
1003
+ children: /* @__PURE__ */ jsx(FilePlus2Icon, {})
1004
+ }
1005
+ ),
1006
+ /* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px shrink-0 bg-og-border" }),
1007
+ /* @__PURE__ */ jsx(
1008
+ "button",
1009
+ {
1010
+ type: "button",
1011
+ "aria-label": t("artifacts.presentationEditor.zoomOut"),
1012
+ onClick: () => changeZoom(zoom / 1.15),
1013
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg [&>svg]:size-3.5",
1014
+ children: /* @__PURE__ */ jsx(MinusIcon, {})
1015
+ }
1016
+ ),
1017
+ /* @__PURE__ */ jsxs("span", { className: "min-w-11 shrink-0 text-center text-og-xs tabular-nums text-og-fg-muted", children: [
1018
+ Math.round(zoom * 100),
1019
+ "%"
1020
+ ] }),
1021
+ /* @__PURE__ */ jsx(
1022
+ "button",
1023
+ {
1024
+ type: "button",
1025
+ "aria-label": t("artifacts.presentationEditor.zoomIn"),
1026
+ onClick: () => changeZoom(zoom * 1.15),
1027
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg [&>svg]:size-3.5",
1028
+ children: /* @__PURE__ */ jsx(PlusIcon, {})
1029
+ }
1030
+ ),
1031
+ /* @__PURE__ */ jsx(
1032
+ "button",
1033
+ {
1034
+ type: "button",
1035
+ "aria-label": t("artifacts.presentationEditor.fitSlide"),
1036
+ onClick: fitSlide,
1037
+ className: "ml-0.5 grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg [&>svg]:size-3.5",
1038
+ children: /* @__PURE__ */ jsx(ExpandIcon, {})
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px shrink-0 bg-og-border" }),
1042
+ /* @__PURE__ */ jsx(
1043
+ "button",
1044
+ {
1045
+ type: "button",
1046
+ "aria-label": t("artifacts.presentationEditor.addTextBox"),
1047
+ disabled: mutationsBlocked || !activeSlide,
1048
+ onClick: insertTextBox,
1049
+ className: "grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted hover:bg-og-surface-3 hover:text-og-fg disabled:opacity-35 [&>svg]:size-3.5",
1050
+ children: /* @__PURE__ */ jsx(TypeIcon, {})
1051
+ }
1052
+ ),
1053
+ /* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px shrink-0 bg-og-border" }),
1054
+ /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
1055
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1056
+ "button",
1057
+ {
1058
+ ref: deleteTriggerRef,
1059
+ type: "button",
1060
+ "data-og-presentation-delete": deleteKind,
1061
+ disabled: !deleteEnabled,
1062
+ onClick: () => setConfirmingDelete(deleteTarget),
1063
+ className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-og-sm px-2 text-og-xs text-og-fg-muted hover:bg-og-surface-3 hover:text-og-status-failed disabled:opacity-35 [&>svg]:size-3.5",
1064
+ children: [
1065
+ /* @__PURE__ */ jsx(Trash2Icon, { "aria-hidden": true }),
1066
+ /* @__PURE__ */ jsx("span", { children: deleteLabel })
1067
+ ]
1068
+ }
1069
+ ) }),
1070
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: deleteKind === "object" ? t("artifacts.presentationEditor.deleteObjectHint") : t("artifacts.presentationEditor.deleteSlideHint") })
1071
+ ] }) })
1072
+ ] }),
1073
+ /* @__PURE__ */ jsx(
1074
+ "span",
1075
+ {
1076
+ className: "hidden max-w-44 shrink-0 truncate border-l border-og-border px-2 text-og-xs text-og-fg-subtle sm:block",
1077
+ title: commandFailure ? t("artifacts.presentationEditor.changeNotSaved") : authoringStatus ? authoringStatus : pendingCommands > 0 ? t("artifacts.presentationEditor.saving") : mutationsBlocked ? t("artifacts.presentationEditor.viewOnly") : selected ? `${objectLabel(t, selected)}${selected.readOnly ? " \xB7 View only" : ""}` : t("artifacts.presentationEditor.selectAnObjectToEdit"),
1078
+ children: commandFailure ? t("artifacts.presentationEditor.changeNotSaved") : authoringStatus ? authoringStatus : pendingCommands > 0 ? t("artifacts.presentationEditor.saving") : mutationsBlocked ? t("artifacts.presentationEditor.viewOnly") : selected ? `${objectLabel(t, selected)}${selected.readOnly ? " \xB7 View only" : ""}` : t("artifacts.presentationEditor.selectAnObjectToEdit")
1079
+ }
1080
+ )
1081
+ ]
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: commandFailure?.message ?? authoringStatus ?? (pendingCommands > 0 ? t("artifacts.presentationEditor.savingPresentationChanges") : "") }),
1085
+ /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 min-w-0 flex-1", children: [
1086
+ /* @__PURE__ */ jsx(
1087
+ "div",
1088
+ {
1089
+ ref: railRef,
1090
+ role: "listbox",
1091
+ tabIndex: 0,
1092
+ "aria-label": t("artifacts.presentationEditor.slides"),
1093
+ "aria-orientation": "vertical",
1094
+ "aria-activedescendant": activeSlide && activeIndex >= railStart && activeIndex < railEnd ? `${domId}-slide-${safeDomId(activeSlide.id)}` : void 0,
1095
+ className: "relative hidden w-40 shrink-0 overflow-y-auto border-r border-og-border bg-og-surface-2/70 outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent sm:block",
1096
+ "data-og-slide-rail": true,
1097
+ "data-og-window-start": railStart,
1098
+ "data-og-window-end": railEnd,
1099
+ onScroll: (event) => {
1100
+ const scrollTop = event.currentTarget.scrollTop;
1101
+ const height = event.currentTarget.clientHeight;
1102
+ setRail((current) => ({
1103
+ scrollTop,
1104
+ height: height || current.height
1105
+ }));
1106
+ },
1107
+ onKeyDown: (event) => {
1108
+ const nextIndex = nextSlideIndexFromKey(event.key, activeIndex, slides.length);
1109
+ if (nextIndex === null) return;
1110
+ event.preventDefault();
1111
+ const next = slides[nextIndex];
1112
+ if (next && next !== activeSlide) selectSlide(next, nextIndex);
1113
+ },
1114
+ children: /* @__PURE__ */ jsx("div", { className: "relative w-full", style: { height: slides.length * RAIL_ITEM_HEIGHT }, children: slides.slice(railStart, railEnd).map((slide, offset) => {
1115
+ const index = railStart + offset;
1116
+ const active = slide === activeSlide;
1117
+ return /* @__PURE__ */ jsxs(
1118
+ "button",
1119
+ {
1120
+ id: `${domId}-slide-${safeDomId(slide.id)}`,
1121
+ type: "button",
1122
+ role: "option",
1123
+ tabIndex: -1,
1124
+ "aria-selected": active,
1125
+ "aria-label": t("artifacts.presentationEditor.slideIndexValue", {
1126
+ index: index + 1,
1127
+ value: slide.title ? `: ${slide.title}` : ""
1128
+ }),
1129
+ onClick: () => selectSlide(slide, index),
1130
+ className: cn(
1131
+ "absolute left-0 flex w-full items-start gap-2 px-2 py-2 text-left transition-colors",
1132
+ active ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3/70"
1133
+ ),
1134
+ style: { top: index * RAIL_ITEM_HEIGHT, height: 116 },
1135
+ "data-og-slide-index": index,
1136
+ children: [
1137
+ /* @__PURE__ */ jsx("span", { className: "w-5 shrink-0 pt-0.5 text-right text-og-xs tabular-nums text-og-fg-subtle", children: index + 1 }),
1138
+ /* @__PURE__ */ jsx(
1139
+ "span",
1140
+ {
1141
+ className: cn(
1142
+ "block min-w-0 flex-1 overflow-hidden border bg-white shadow-og-sm",
1143
+ active ? "border-og-accent" : "border-og-border"
1144
+ ),
1145
+ style: { aspectRatio: "16 / 9", borderRadius: 3 },
1146
+ children: /* @__PURE__ */ jsx(
1147
+ SlideThumbnail,
1148
+ {
1149
+ slide,
1150
+ width: presentation.slideSize.width,
1151
+ height: presentation.slideSize.height,
1152
+ paintRevision: `${String(revision ?? "")}:${modelEpoch}`
1153
+ }
1154
+ )
1155
+ }
1156
+ )
1157
+ ]
1158
+ },
1159
+ slide.id
1160
+ );
1161
+ }) })
1162
+ }
1163
+ ),
1164
+ mobileSelectorOpen ? /* @__PURE__ */ jsx(
1165
+ "div",
1166
+ {
1167
+ ref: mobileSelectorPanelRef,
1168
+ className: "absolute left-2 top-2 z-40 max-w-56 overflow-hidden rounded-og-md border border-og-border bg-og-surface-1 shadow-og-md sm:hidden",
1169
+ style: { width: "calc(100% - 1rem)" },
1170
+ children: /* @__PURE__ */ jsx(
1171
+ "div",
1172
+ {
1173
+ ref: mobileRailRef,
1174
+ id: `${domId}-mobile-slides`,
1175
+ role: "listbox",
1176
+ tabIndex: 0,
1177
+ "aria-label": t("artifacts.presentationEditor.slides"),
1178
+ "aria-orientation": "vertical",
1179
+ "aria-activedescendant": activeSlide && activeIndex >= mobileRailStart && activeIndex < mobileRailEnd ? `${domId}-mobile-slide-${safeDomId(activeSlide.id)}` : void 0,
1180
+ className: "max-h-72 overflow-y-auto outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
1181
+ "data-og-mobile-slide-list": true,
1182
+ "data-og-window-start": mobileRailStart,
1183
+ "data-og-window-end": mobileRailEnd,
1184
+ onScroll: (event) => {
1185
+ const scrollTop = event.currentTarget.scrollTop;
1186
+ const height = event.currentTarget.clientHeight;
1187
+ setMobileRail((current) => ({
1188
+ scrollTop,
1189
+ height: height || current.height
1190
+ }));
1191
+ },
1192
+ onKeyDown: (event) => {
1193
+ if (event.key === "Escape") {
1194
+ event.preventDefault();
1195
+ setMobileSelectorOpen(false);
1196
+ mobileSelectorTriggerRef.current?.focus();
1197
+ return;
1198
+ }
1199
+ const nextIndex = nextSlideIndexFromKey(event.key, activeIndex, slides.length);
1200
+ if (nextIndex === null) return;
1201
+ event.preventDefault();
1202
+ const next = slides[nextIndex];
1203
+ if (!next) return;
1204
+ if (next !== activeSlide) selectSlide(next, nextIndex);
1205
+ const list = event.currentTarget;
1206
+ const top = nextIndex * MOBILE_RAIL_ITEM_HEIGHT;
1207
+ const bottom = top + MOBILE_RAIL_ITEM_HEIGHT;
1208
+ if (top < list.scrollTop) list.scrollTop = top;
1209
+ else if (bottom > list.scrollTop + list.clientHeight) {
1210
+ list.scrollTop = bottom - list.clientHeight;
1211
+ }
1212
+ },
1213
+ children: /* @__PURE__ */ jsx(
1214
+ "div",
1215
+ {
1216
+ className: "relative w-full",
1217
+ style: { height: slides.length * MOBILE_RAIL_ITEM_HEIGHT },
1218
+ children: slides.slice(mobileRailStart, mobileRailEnd).map((slide, offset) => {
1219
+ const index = mobileRailStart + offset;
1220
+ const active = slide === activeSlide;
1221
+ return /* @__PURE__ */ jsxs(
1222
+ "button",
1223
+ {
1224
+ id: `${domId}-mobile-slide-${safeDomId(slide.id)}`,
1225
+ type: "button",
1226
+ role: "option",
1227
+ tabIndex: -1,
1228
+ "aria-selected": active,
1229
+ "aria-label": t("artifacts.presentationEditor.slideIndexValue", {
1230
+ index: index + 1,
1231
+ value: slide.title ? `: ${slide.title}` : ""
1232
+ }),
1233
+ onClick: () => chooseMobileSlide(slide, index),
1234
+ className: cn(
1235
+ "absolute left-0 flex min-h-11 w-full items-center gap-2 px-2 text-left",
1236
+ active ? "bg-og-surface-3 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3/70"
1237
+ ),
1238
+ style: {
1239
+ top: index * MOBILE_RAIL_ITEM_HEIGHT,
1240
+ height: MOBILE_RAIL_ITEM_HEIGHT
1241
+ },
1242
+ "data-og-mobile-slide-index": index,
1243
+ children: [
1244
+ /* @__PURE__ */ jsx("span", { className: "w-7 shrink-0 text-right text-og-xs tabular-nums text-og-fg-subtle", children: index + 1 }),
1245
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-og-sm", children: slide.title || t("artifacts.presentationEditor.slideIndex", { index: index + 1 }) })
1246
+ ]
1247
+ },
1248
+ slide.id
1249
+ );
1250
+ })
1251
+ }
1252
+ )
1253
+ }
1254
+ )
1255
+ }
1256
+ ) : null,
1257
+ /* @__PURE__ */ jsxs(
1258
+ "div",
1259
+ {
1260
+ ref: viewportRef,
1261
+ className: "relative min-h-0 min-w-0 flex-1 overflow-auto bg-og-surface-3/60 p-6",
1262
+ onScroll: (event) => {
1263
+ const element = event.currentTarget;
1264
+ const width = element.clientWidth || viewport.width;
1265
+ const height = element.clientHeight || viewport.height;
1266
+ const next = {
1267
+ scrollLeft: element.scrollLeft,
1268
+ scrollTop: element.scrollTop,
1269
+ width,
1270
+ height,
1271
+ stageLeft: stageRef.current?.offsetLeft ?? 0,
1272
+ stageTop: stageRef.current?.offsetTop ?? 0
1273
+ };
1274
+ setViewport((current) => sameViewport(current, next) ? current : next);
1275
+ if (element.clientWidth > 0 && element.clientHeight > 0) setViewportMeasured(true);
1276
+ },
1277
+ "data-og-presentation-viewport": true,
1278
+ children: [
1279
+ commandFailure ? /* @__PURE__ */ jsxs(
1280
+ "div",
1281
+ {
1282
+ role: "alert",
1283
+ className: "absolute left-2 top-2 z-30 flex w-fit items-center gap-2 rounded-og-sm border border-og-status-failed/30 bg-og-surface-1/95 px-2 py-1 text-og-xs text-og-status-failed shadow-og-sm",
1284
+ style: { maxWidth: "calc(100% - 1rem)" },
1285
+ children: [
1286
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: commandFailure.message }),
1287
+ /* @__PURE__ */ jsx(
1288
+ "button",
1289
+ {
1290
+ type: "button",
1291
+ disabled: mutationsBlocked,
1292
+ onClick: () => {
1293
+ if (!mutationsBlocked) commandFailure.retry();
1294
+ },
1295
+ className: "shrink-0 rounded-og-xs px-1.5 py-0.5 font-medium outline-hidden hover:bg-og-surface-3 focus-visible:ring-2 focus-visible:ring-og-accent",
1296
+ children: t("artifacts.presentationEditor.retry")
1297
+ }
1298
+ )
1299
+ ]
1300
+ }
1301
+ ) : null,
1302
+ activeSlide ? /* @__PURE__ */ jsxs(
1303
+ "div",
1304
+ {
1305
+ ref: stageRef,
1306
+ className: "relative mx-auto shrink-0 overflow-hidden shadow-og-lg",
1307
+ style: { width: stageWidth, height: stageHeight, backgroundColor: "#fff" },
1308
+ "data-og-presentation-stage": true,
1309
+ "data-og-theme": "light",
1310
+ children: [
1311
+ /* @__PURE__ */ jsx(
1312
+ "canvas",
1313
+ {
1314
+ ref: canvasRef,
1315
+ "aria-hidden": true,
1316
+ className: "absolute inset-0 size-full",
1317
+ style: { width: stageWidth, height: stageHeight }
1318
+ }
1319
+ ),
1320
+ /* @__PURE__ */ jsx(
1321
+ "svg",
1322
+ {
1323
+ ref: overlayRef,
1324
+ role: "application",
1325
+ tabIndex: 0,
1326
+ "aria-label": t("artifacts.presentationEditor.slideActiveindexEditor", {
1327
+ activeIndex: activeIndex + 1
1328
+ }),
1329
+ "aria-describedby": selected ? `${instructionsId} ${selectionProxyId}` : instructionsId,
1330
+ "aria-readonly": mutationsBlocked || selected?.readOnly || void 0,
1331
+ viewBox: `0 0 ${presentation.slideSize.width} ${presentation.slideSize.height}`,
1332
+ className: "absolute inset-0 size-full touch-none outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
1333
+ onKeyDown: handleCanvasKeyDown,
1334
+ onPointerDown: handlePointerDown,
1335
+ onPointerMove: handlePointerMove,
1336
+ onPointerUp: (event) => finishDrag(event),
1337
+ onPointerCancel: (event) => finishDrag(event, true),
1338
+ onLostPointerCapture: handleLostPointerCapture,
1339
+ onDoubleClick: () => startTextEdit(selected),
1340
+ children: selected && effectiveSelectedPosition ? /* @__PURE__ */ jsxs(
1341
+ "g",
1342
+ {
1343
+ "data-og-presentation-object": selected.id,
1344
+ transform: selectionTransform(selected, effectiveSelectedPosition),
1345
+ children: [
1346
+ /* @__PURE__ */ jsx(
1347
+ "rect",
1348
+ {
1349
+ x: effectiveSelectedPosition.left,
1350
+ y: effectiveSelectedPosition.top,
1351
+ width: effectiveSelectedPosition.width,
1352
+ height: effectiveSelectedPosition.height,
1353
+ fill: "transparent",
1354
+ stroke: "var(--og-color-accent-deep)",
1355
+ strokeWidth: 2,
1356
+ vectorEffect: "non-scaling-stroke",
1357
+ pointerEvents: "none"
1358
+ }
1359
+ ),
1360
+ !mutationsBlocked && !selected.readOnly ? /* @__PURE__ */ jsx(
1361
+ "circle",
1362
+ {
1363
+ cx: effectiveSelectedPosition.left + effectiveSelectedPosition.width,
1364
+ cy: effectiveSelectedPosition.top + effectiveSelectedPosition.height,
1365
+ r: 6 / zoom,
1366
+ fill: "var(--og-color-accent-deep)",
1367
+ stroke: "white",
1368
+ strokeWidth: 1.5,
1369
+ vectorEffect: "non-scaling-stroke",
1370
+ className: "cursor-nwse-resize",
1371
+ onPointerDown: (event) => beginDrag(event, selected, "resize")
1372
+ }
1373
+ ) : null
1374
+ ]
1375
+ }
1376
+ ) : null
1377
+ }
1378
+ ),
1379
+ selected ? /* @__PURE__ */ jsx("span", { id: selectionProxyId, role: "status", "aria-live": "polite", className: "sr-only", children: accessibleObjectLabel(t, selected) }) : null,
1380
+ /* @__PURE__ */ jsx("span", { id: instructionsId, className: "sr-only", children: t("artifacts.presentationEditor.useBracketKeysToSelect") }),
1381
+ textEdit && selected?.id === textEdit.shape.id && effectiveSelectedPosition ? /* @__PURE__ */ jsx(
1382
+ "textarea",
1383
+ {
1384
+ ref: editorRef,
1385
+ "aria-label": t("artifacts.presentationEditor.editName", {
1386
+ name: textEdit.shape.name
1387
+ }),
1388
+ value: textDraft,
1389
+ readOnly: mutationsBlocked,
1390
+ maxLength: 1e6,
1391
+ onChange: (event) => {
1392
+ if (!mutationsBlocked) setTextDraft(event.currentTarget.value);
1393
+ },
1394
+ onInput: (event) => {
1395
+ if (!mutationsBlocked) setTextDraft(event.currentTarget.value);
1396
+ },
1397
+ onBlur: () => finishTextEdit(),
1398
+ onKeyDown: (event) => {
1399
+ if (event.key === "Escape") {
1400
+ event.preventDefault();
1401
+ finishTextEdit(true);
1402
+ } else if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
1403
+ event.preventDefault();
1404
+ finishTextEdit();
1405
+ }
1406
+ },
1407
+ className: "absolute resize-none overflow-hidden border-2 border-og-accent p-1 outline-hidden",
1408
+ style: {
1409
+ left: effectiveSelectedPosition.left * zoom,
1410
+ top: effectiveSelectedPosition.top * zoom,
1411
+ width: effectiveSelectedPosition.width * zoom,
1412
+ height: effectiveSelectedPosition.height * zoom,
1413
+ backgroundColor: "#fffffff2",
1414
+ color: resolveColor(textEdit.shape.text.style.color ?? "slate-950"),
1415
+ fontFamily: textEdit.shape.text.style.fontFamily ?? "Arial, sans-serif",
1416
+ fontSize: Math.max(8, (textEdit.shape.text.style.fontSize ?? 18) * zoom),
1417
+ fontWeight: textEdit.shape.text.style.bold ? 700 : 400,
1418
+ fontStyle: textEdit.shape.text.style.italic ? "italic" : "normal",
1419
+ textAlign: textEdit.shape.text.style.alignment ?? "left",
1420
+ transform: textEdit.shape.rotation === 0 ? void 0 : `rotate(${textEdit.shape.rotation}deg)`,
1421
+ transformOrigin: "center"
1422
+ }
1423
+ }
1424
+ ) : null
1425
+ ]
1426
+ }
1427
+ ) : /* @__PURE__ */ jsx("div", { className: "grid size-full min-h-72 place-items-center text-og-sm text-og-fg-muted", children: t("artifacts.presentationEditor.thisPresentationHasNoSlides") })
1428
+ ]
1429
+ }
1430
+ )
1431
+ ] }),
1432
+ /* @__PURE__ */ jsx(
1433
+ ConfirmDialog,
1434
+ {
1435
+ open: confirmingDelete !== null,
1436
+ onOpenChange: (open) => {
1437
+ if (!open) setConfirmingDelete(null);
1438
+ },
1439
+ title: confirmingDelete?.kind === "object" ? t("artifacts.presentationEditor.deleteObjectTitle", { name: confirmingDelete.name }) : t("artifacts.presentationEditor.deleteSlideTitle", {
1440
+ index: (confirmingDelete?.index ?? activeIndex) + 1
1441
+ }),
1442
+ description: confirmingDelete?.kind === "object" ? t("artifacts.presentationEditor.deleteObjectDescription") : t("artifacts.presentationEditor.deleteSlideDescription"),
1443
+ confirmLabel: confirmingDelete?.kind === "object" ? t("artifacts.presentationEditor.deleteObject") : t("artifacts.presentationEditor.deleteSlide"),
1444
+ restoreFocusRef: deleteTriggerRef,
1445
+ restoreFocusFallbackRef: addSlideRef,
1446
+ onConfirm: confirmDelete
1447
+ }
1448
+ )
1449
+ ]
1450
+ }
1451
+ );
1452
+ }
1453
+ function PresentationArtifactSurface({
1454
+ presentation,
1455
+ title: titleProp,
1456
+ showHeader,
1457
+ subtitle,
1458
+ actions,
1459
+ busy,
1460
+ className,
1461
+ ...editorProps
1462
+ }) {
1463
+ const t = useOpenGeniText();
1464
+ const title = titleProp === void 0 ? t("artifacts.presentationEditor.presentation") : titleProp;
1465
+ const count = presentation.slides.items.length;
1466
+ return /* @__PURE__ */ jsx(
1467
+ ArtifactSurface,
1468
+ {
1469
+ modality: "presentation",
1470
+ title,
1471
+ showHeader,
1472
+ subtitle: subtitle ?? t("counts.slides", { count }),
1473
+ actions,
1474
+ busy,
1475
+ className,
1476
+ children: /* @__PURE__ */ jsx(PresentationEditor, { ...editorProps, presentation })
1477
+ }
1478
+ );
1479
+ }
1480
+ function PresentationProjectionArtifactSurface({
1481
+ projection,
1482
+ title: titleProp,
1483
+ showHeader,
1484
+ subtitle,
1485
+ actions,
1486
+ busy,
1487
+ className,
1488
+ ...editorProps
1489
+ }) {
1490
+ const t = useOpenGeniText();
1491
+ const title = titleProp === void 0 ? t("artifacts.presentationEditor.presentation") : titleProp;
1492
+ const count = projection.slides.length;
1493
+ return /* @__PURE__ */ jsx(
1494
+ ArtifactSurface,
1495
+ {
1496
+ modality: "presentation",
1497
+ title,
1498
+ showHeader,
1499
+ subtitle: subtitle ?? t("counts.slides", { count }),
1500
+ actions,
1501
+ busy,
1502
+ className,
1503
+ children: /* @__PURE__ */ jsx(PresentationProjectionEditor, { ...editorProps, projection })
1504
+ }
1505
+ );
1506
+ }
1507
+ function SlideThumbnail({
1508
+ slide,
1509
+ width,
1510
+ height,
1511
+ paintRevision
1512
+ }) {
1513
+ const t = useOpenGeniText();
1514
+ const canvasRef = useRef(null);
1515
+ const imageCacheRef = useRef(/* @__PURE__ */ new Map());
1516
+ const [paintEpoch, setPaintEpoch] = useState(0);
1517
+ useLayoutEffect(() => {
1518
+ const imageCache = imageCacheRef.current;
1519
+ return () => disposeCanvasImageCache(imageCache);
1520
+ }, []);
1521
+ useLayoutEffect(() => {
1522
+ const canvas = canvasRef.current;
1523
+ const context = canvas?.getContext("2d");
1524
+ if (!canvas || !context) return;
1525
+ const displayWidth = 112;
1526
+ const scale = displayWidth / width;
1527
+ canvas.width = Math.max(1, Math.round(width * scale));
1528
+ canvas.height = Math.max(1, Math.round(height * scale));
1529
+ context.setTransform(scale, 0, 0, scale, 0, 0);
1530
+ context.fillStyle = resolveColor(slide.background.fill);
1531
+ context.fillRect(0, 0, width, height);
1532
+ const objects = listSlideObjects(slide);
1533
+ const usedImageSources = /* @__PURE__ */ new Set();
1534
+ for (const entry of objects) {
1535
+ drawObject(
1536
+ t,
1537
+ context,
1538
+ entry,
1539
+ entry.object.position,
1540
+ imageCacheRef.current,
1541
+ () => setPaintEpoch((value) => value + 1),
1542
+ { left: 0, top: 0, width, height },
1543
+ scale,
1544
+ usedImageSources
1545
+ );
1546
+ }
1547
+ disposeUnusedCanvasImages(imageCacheRef.current, usedImageSources);
1548
+ }, [height, paintEpoch, paintRevision, slide, width, t]);
1549
+ return /* @__PURE__ */ jsx("canvas", { ref: canvasRef, "aria-hidden": true, className: "block size-full" });
1550
+ }
1551
+ function presentationViewFromProjection(projection) {
1552
+ if (projection.slides.length > MAX_PROJECTION_SLIDES) {
1553
+ throw new Error(`Presentation projection exceeds ${MAX_PROJECTION_SLIDES} slides`);
1554
+ }
1555
+ const slideById = /* @__PURE__ */ new Map();
1556
+ const elementById = /* @__PURE__ */ new Map();
1557
+ const slideSize = {
1558
+ width: Math.min(MAX_EDITOR_GEOMETRY, Math.max(1, finite(projection.slideSize.width, 1))),
1559
+ height: Math.min(MAX_EDITOR_GEOMETRY, Math.max(1, finite(projection.slideSize.height, 1)))
1560
+ };
1561
+ const slides = projection.slides.map((slideProjection) => {
1562
+ if (slideProjection.elements.length > MAX_PROJECTION_ELEMENTS_PER_SLIDE) {
1563
+ throw new Error(
1564
+ `Slide ${slideProjection.id} exceeds ${MAX_PROJECTION_ELEMENTS_PER_SLIDE} projected objects`
1565
+ );
1566
+ }
1567
+ slideById.set(slideProjection.id, slideProjection);
1568
+ const elements = slideProjection.elements.map(
1569
+ (element) => presentationElementView(element, elementById, 0)
1570
+ );
1571
+ return {
1572
+ id: slideProjection.id,
1573
+ title: boundedProjectionText(slideProjection.title ?? ""),
1574
+ background: { fill: cloneProjectionFill(slideProjection.background ?? "white") },
1575
+ elements
1576
+ };
1577
+ });
1578
+ return {
1579
+ presentation: {
1580
+ slideSize,
1581
+ slides: { items: slides }
1582
+ },
1583
+ slideById,
1584
+ elementById
1585
+ };
1586
+ }
1587
+ function presentationElementView(element, byId, depth) {
1588
+ if (depth > MAX_PROJECTION_GROUP_DEPTH) {
1589
+ throw new Error(`Presentation group depth exceeds ${MAX_PROJECTION_GROUP_DEPTH}`);
1590
+ }
1591
+ byId.set(element.id, element);
1592
+ const position = normalizeEditorPosition(element.position);
1593
+ switch (element.kind) {
1594
+ case "shape": {
1595
+ const text = mutableProjectionText(element.text, element.textStyle);
1596
+ return {
1597
+ id: element.id,
1598
+ name: boundedProjectionText(element.name),
1599
+ __projectionReadOnly: element.readOnly ?? false,
1600
+ geometry: element.geometry,
1601
+ position,
1602
+ fill: cloneProjectionFill(
1603
+ element.fill ?? (element.geometry === "textbox" ? "none" : "white")
1604
+ ),
1605
+ line: cloneProjectionLine(element.line),
1606
+ rotation: finite(element.rotation ?? 0, 0),
1607
+ borderRadius: element.borderRadius,
1608
+ text
1609
+ };
1610
+ }
1611
+ case "chart":
1612
+ return {
1613
+ id: element.id,
1614
+ name: boundedProjectionText(element.name),
1615
+ __projectionReadOnly: element.readOnly ?? false,
1616
+ type: element.type,
1617
+ position,
1618
+ title: boundedProjectionText(element.title ?? ""),
1619
+ series: {
1620
+ items: element.series.map((series) => ({
1621
+ name: boundedProjectionText(series.name),
1622
+ categories: (series.categories ?? []).map(boundedProjectionText),
1623
+ values: series.values.map((value) => finite(value, 0)),
1624
+ xValues: (series.xValues ?? []).map((value) => finite(value, 0)),
1625
+ bubbleSizes: (series.bubbleSizes ?? []).map((value) => finite(value, 0)),
1626
+ fill: series.fill ? cloneProjectionFill(series.fill) : void 0,
1627
+ line: cloneProjectionLine(series.line)
1628
+ }))
1629
+ },
1630
+ xAxis: element.xAxis ? { ...element.xAxis } : void 0,
1631
+ yAxis: element.yAxis ? { ...element.yAxis } : void 0,
1632
+ dataLabels: element.dataLabels ? { ...element.dataLabels } : void 0
1633
+ };
1634
+ case "image": {
1635
+ const source = safeProjectionImageSource(element.source);
1636
+ return {
1637
+ id: element.id,
1638
+ name: boundedProjectionText(element.name),
1639
+ __projectionReadOnly: element.readOnly ?? false,
1640
+ position,
1641
+ alt: boundedProjectionText(element.alt ?? ""),
1642
+ prompt: element.prompt ? boundedProjectionText(element.prompt) : void 0,
1643
+ fit: element.fit ?? "contain",
1644
+ crop: element.crop ? { ...element.crop } : void 0,
1645
+ geometry: element.geometry ?? "rect",
1646
+ borderRadius: element.borderRadius,
1647
+ rotation: finite(element.rotation ?? 0, 0),
1648
+ flipHorizontal: element.flipHorizontal ?? false,
1649
+ flipVertical: element.flipVertical ?? false,
1650
+ sourceForSvg: () => source
1651
+ };
1652
+ }
1653
+ case "table": {
1654
+ const columns = element.rows[0]?.length ?? 0;
1655
+ if (columns <= 0 || element.rows.some((row) => row.length !== columns) || element.rows.length * columns > MAX_PROJECTION_TABLE_CELLS) {
1656
+ throw new Error(`Table ${element.id} has an invalid or oversized projected grid`);
1657
+ }
1658
+ return {
1659
+ id: element.id,
1660
+ name: boundedProjectionText(element.name),
1661
+ __projectionReadOnly: element.readOnly ?? false,
1662
+ position,
1663
+ rows: element.rows.map(
1664
+ (row) => row.map(
1665
+ (cell) => cell ? {
1666
+ text: mutableProjectionText(cell.text, cell.textStyle),
1667
+ fill: cloneProjectionFill(cell.fill ?? "white"),
1668
+ rowSpan: boundedSpan(cell.rowSpan),
1669
+ colSpan: boundedSpan(cell.colSpan)
1670
+ } : null
1671
+ )
1672
+ ),
1673
+ columnWidths: [...element.columnWidths ?? []],
1674
+ rowHeights: [...element.rowHeights ?? []],
1675
+ fill: cloneProjectionFill(element.fill ?? "white"),
1676
+ line: cloneProjectionLine(element.line),
1677
+ textStyle: { ...element.textStyle ?? {} }
1678
+ };
1679
+ }
1680
+ case "group":
1681
+ return {
1682
+ id: element.id,
1683
+ name: boundedProjectionText(element.name),
1684
+ __projectionReadOnly: element.readOnly ?? false,
1685
+ position,
1686
+ childOffset: {
1687
+ left: finite(element.childOffset.left, 0),
1688
+ top: finite(element.childOffset.top, 0)
1689
+ },
1690
+ childExtent: {
1691
+ width: Math.max(1, finite(element.childExtent.width, 1)),
1692
+ height: Math.max(1, finite(element.childExtent.height, 1))
1693
+ },
1694
+ rotation: finite(element.rotation ?? 0, 0),
1695
+ flipHorizontal: element.flipHorizontal ?? false,
1696
+ flipVertical: element.flipVertical ?? false,
1697
+ children: element.children.map((child) => presentationElementView(child, byId, depth + 1))
1698
+ };
1699
+ case "connector":
1700
+ return {
1701
+ id: element.id,
1702
+ name: boundedProjectionText(element.name),
1703
+ __projectionReadOnly: element.readOnly ?? false,
1704
+ geometry: "line",
1705
+ position,
1706
+ fill: "none",
1707
+ line: cloneProjectionLine(element.line),
1708
+ rotation: 0,
1709
+ text: mutableProjectionText("", void 0)
1710
+ };
1711
+ }
1712
+ }
1713
+ function mutableProjectionText(initial, style) {
1714
+ let value = boundedProjectionText(initial);
1715
+ return {
1716
+ style: { ...style ?? {} },
1717
+ set(next) {
1718
+ value = boundedProjectionText(next);
1719
+ },
1720
+ toString() {
1721
+ return value;
1722
+ }
1723
+ };
1724
+ }
1725
+ function cloneProjectionFill(fill) {
1726
+ return typeof fill === "string" ? fill : { ...fill };
1727
+ }
1728
+ function cloneProjectionLine(line) {
1729
+ return {
1730
+ style: line?.style ?? "solid",
1731
+ fill: line?.fill ? cloneProjectionFill(line.fill) : "slate-900",
1732
+ width: Math.max(0, finite(line?.width ?? 1, 1))
1733
+ };
1734
+ }
1735
+ function boundedProjectionText(value) {
1736
+ return value.slice(0, MAX_PROJECTION_TEXT);
1737
+ }
1738
+ function boundedSpan(value) {
1739
+ return Math.max(1, Math.min(1e4, Math.floor(finite(value ?? 1, 1))));
1740
+ }
1741
+ function safeProjectionImageSource(source) {
1742
+ if (!source || source.length > 64 * 1024 * 1024) return void 0;
1743
+ if (/^data:image\/(?:png|jpeg|gif|webp);base64,/i.test(source) || source.startsWith("blob:")) {
1744
+ return source;
1745
+ }
1746
+ try {
1747
+ const base = globalThis.location?.href;
1748
+ if (!base) return void 0;
1749
+ const url = new URL(source, base);
1750
+ return url.origin === globalThis.location.origin && /^https?:$/.test(url.protocol) ? url.href : void 0;
1751
+ } catch {
1752
+ return void 0;
1753
+ }
1754
+ }
1755
+ function asPresentationError(cause) {
1756
+ return cause instanceof Error ? cause : new Error("Presentation change failed");
1757
+ }
1758
+ function listSlideObjects(slide) {
1759
+ return slide.elements.map(displayObjectFromElement);
1760
+ }
1761
+ function displayObjectFromElement(object) {
1762
+ const readOnly = object.__projectionReadOnly === true;
1763
+ if ("geometry" in object && "text" in object)
1764
+ return { id: object.id, kind: "shape", object, readOnly };
1765
+ if ("series" in object) return { id: object.id, kind: "chart", object, readOnly };
1766
+ if ("sourceForSvg" in object) return { id: object.id, kind: "image", object, readOnly };
1767
+ if ("rows" in object) return { id: object.id, kind: "table", object, readOnly };
1768
+ return { id: object.id, kind: "group", object, readOnly };
1769
+ }
1770
+ function buildSpatialIndex(objects, slideSize) {
1771
+ const buckets = /* @__PURE__ */ new Map();
1772
+ const overflowObjects = [];
1773
+ const bounds = objects.map(objectBounds);
1774
+ const maxX = Math.max(0, Math.ceil(slideSize.width / SPATIAL_TILE) - 1);
1775
+ const maxY = Math.max(0, Math.ceil(slideSize.height / SPATIAL_TILE) - 1);
1776
+ for (const [index, entry] of objects.entries()) {
1777
+ const objectBound = bounds[index] ?? entry.object.position;
1778
+ if (!intersects(objectBound, { left: 0, top: 0, ...slideSize })) continue;
1779
+ const left = Math.max(0, Math.floor(objectBound.left / SPATIAL_TILE));
1780
+ const top = Math.max(0, Math.floor(objectBound.top / SPATIAL_TILE));
1781
+ const right = Math.min(maxX, Math.floor((objectBound.left + objectBound.width) / SPATIAL_TILE));
1782
+ const bottom = Math.min(
1783
+ maxY,
1784
+ Math.floor((objectBound.top + objectBound.height) / SPATIAL_TILE)
1785
+ );
1786
+ const bucketCount = (right - left + 1) * (bottom - top + 1);
1787
+ if (!Number.isSafeInteger(bucketCount) || bucketCount > MAX_SPATIAL_BUCKETS_PER_OBJECT) {
1788
+ overflowObjects.push(index);
1789
+ continue;
1790
+ }
1791
+ for (let y = top; y <= bottom; y += 1) {
1792
+ for (let x = left; x <= right; x += 1) {
1793
+ const key = `${x}:${y}`;
1794
+ const bucket = buckets.get(key);
1795
+ if (bucket) bucket.push(index);
1796
+ else buckets.set(key, [index]);
1797
+ }
1798
+ }
1799
+ }
1800
+ return { objects, bounds, buckets, overflowObjects };
1801
+ }
1802
+ function querySpatialIndex(index, viewport) {
1803
+ const seen = new Set(index.overflowObjects);
1804
+ const left = Math.floor(viewport.left / SPATIAL_TILE);
1805
+ const top = Math.floor(viewport.top / SPATIAL_TILE);
1806
+ const right = Math.floor((viewport.left + viewport.width) / SPATIAL_TILE);
1807
+ const bottom = Math.floor((viewport.top + viewport.height) / SPATIAL_TILE);
1808
+ for (let y = top; y <= bottom; y += 1) {
1809
+ for (let x = left; x <= right; x += 1) {
1810
+ for (const objectIndex of index.buckets.get(`${x}:${y}`) ?? []) {
1811
+ if (intersects(index.bounds[objectIndex], viewport)) seen.add(objectIndex);
1812
+ }
1813
+ }
1814
+ }
1815
+ return [...seen].filter((objectIndex) => {
1816
+ return !!index.objects[objectIndex] && intersects(index.bounds[objectIndex], viewport);
1817
+ }).sort((a, b) => a - b);
1818
+ }
1819
+ function paintSlideCanvas(t, options) {
1820
+ const { canvas, slide, slideSize, zoom } = options;
1821
+ const context = canvas.getContext("2d");
1822
+ if (!context) return;
1823
+ const cssWidth = slideSize.width * zoom;
1824
+ const cssHeight = slideSize.height * zoom;
1825
+ const ratio = Math.max(
1826
+ 1e-4,
1827
+ Math.min(
1828
+ 2,
1829
+ Math.max(1, globalThis.devicePixelRatio || 1),
1830
+ MAX_CANVAS_EDGE / Math.max(1, cssWidth),
1831
+ MAX_CANVAS_EDGE / Math.max(1, cssHeight),
1832
+ Math.sqrt(MAX_CANVAS_PIXELS / Math.max(1, cssWidth * cssHeight))
1833
+ )
1834
+ );
1835
+ const pixelWidth = Math.max(1, Math.round(slideSize.width * zoom * ratio));
1836
+ const pixelHeight = Math.max(1, Math.round(slideSize.height * zoom * ratio));
1837
+ if (canvas.width !== pixelWidth) canvas.width = pixelWidth;
1838
+ if (canvas.height !== pixelHeight) canvas.height = pixelHeight;
1839
+ context.setTransform(zoom * ratio, 0, 0, zoom * ratio, 0, 0);
1840
+ context.clearRect(0, 0, slideSize.width, slideSize.height);
1841
+ context.fillStyle = resolveColor(slide.background.fill);
1842
+ context.fillRect(0, 0, slideSize.width, slideSize.height);
1843
+ const usedImageSources = /* @__PURE__ */ new Set();
1844
+ for (const index of options.objectIndexes) {
1845
+ const entry = options.objects[index];
1846
+ if (!entry) continue;
1847
+ const position = entry.id === options.draftPosition?.objectId ? options.draftPosition.position : entry.object.position;
1848
+ drawObject(
1849
+ t,
1850
+ context,
1851
+ entry,
1852
+ position,
1853
+ options.imageCache,
1854
+ options.requestRepaint,
1855
+ options.renderRegion,
1856
+ zoom * ratio,
1857
+ usedImageSources
1858
+ );
1859
+ }
1860
+ disposeUnusedCanvasImages(options.imageCache, usedImageSources);
1861
+ }
1862
+ function drawObject(t, context, entry, position, imageCache, requestRepaint, renderRegion, pixelScale, usedImageSources) {
1863
+ switch (entry.kind) {
1864
+ case "shape":
1865
+ drawShape(t, context, entry.object, position);
1866
+ return;
1867
+ case "chart":
1868
+ drawChart(t, context, entry.object, position);
1869
+ return;
1870
+ case "image": {
1871
+ const source = drawImage(
1872
+ t,
1873
+ context,
1874
+ entry.object,
1875
+ position,
1876
+ imageCache,
1877
+ requestRepaint
1878
+ );
1879
+ if (source) usedImageSources.add(source);
1880
+ return;
1881
+ }
1882
+ case "table":
1883
+ drawTable(t, context, entry.object, position, renderRegion, pixelScale);
1884
+ return;
1885
+ case "group":
1886
+ drawGroup(
1887
+ t,
1888
+ context,
1889
+ entry.object,
1890
+ position,
1891
+ imageCache,
1892
+ requestRepaint,
1893
+ renderRegion,
1894
+ pixelScale,
1895
+ usedImageSources
1896
+ );
1897
+ }
1898
+ }
1899
+ function drawTable(t, context, table, position, renderRegion, pixelScale) {
1900
+ const rowCount = table.rows.length;
1901
+ const columnCount = table.rows[0]?.length ?? 0;
1902
+ if (rowCount === 0 || columnCount === 0 || !intersects(position, renderRegion)) return;
1903
+ const columnWidths = normalizeTableTracks(table.columnWidths, columnCount, position.width);
1904
+ const rowHeights = normalizeTableTracks(table.rowHeights, rowCount, position.height);
1905
+ const columnOffsets = cumulativeOffsets(columnWidths, position.left);
1906
+ const rowOffsets = cumulativeOffsets(rowHeights, position.top);
1907
+ const columnStart = visibleTrackStart(columnOffsets, renderRegion.left);
1908
+ const columnEnd = visibleTrackEnd(columnOffsets, renderRegion.left + renderRegion.width);
1909
+ const rowStart = visibleTrackStart(rowOffsets, renderRegion.top);
1910
+ const rowEnd = visibleTrackEnd(rowOffsets, renderRegion.top + renderRegion.height);
1911
+ const visibleCellCount = (rowEnd - rowStart) * (columnEnd - columnStart);
1912
+ if (visibleCellCount > MAX_TABLE_CELLS_PER_PAINT) {
1913
+ drawTableOverview(context, table, position, columnOffsets, rowOffsets, {
1914
+ columnStart,
1915
+ columnEnd,
1916
+ rowStart,
1917
+ rowEnd
1918
+ });
1919
+ return;
1920
+ }
1921
+ context.save();
1922
+ for (let rowIndex = rowStart; rowIndex < rowEnd; rowIndex += 1) {
1923
+ const row = table.rows[rowIndex];
1924
+ if (!row) continue;
1925
+ for (let columnIndex = columnStart; columnIndex < columnEnd; columnIndex += 1) {
1926
+ const cell = row[columnIndex];
1927
+ if (!cell) continue;
1928
+ const rightIndex = Math.min(columnCount, columnIndex + cell.colSpan);
1929
+ const bottomIndex = Math.min(rowCount, rowIndex + cell.rowSpan);
1930
+ const left = columnOffsets[columnIndex] ?? position.left;
1931
+ const top = rowOffsets[rowIndex] ?? position.top;
1932
+ const right = columnOffsets[rightIndex] ?? position.left + position.width;
1933
+ const bottom = rowOffsets[bottomIndex] ?? position.top + position.height;
1934
+ const width = Math.max(1, right - left);
1935
+ const height = Math.max(1, bottom - top);
1936
+ context.beginPath();
1937
+ context.rect(left, top, width, height);
1938
+ applyFillAndLine(context, cell.fill, table.line, false);
1939
+ if (width * pixelScale >= 8 && height * pixelScale >= 8) {
1940
+ drawText(t, context, cell.text.toString(), cell.text.style, {
1941
+ left: left + 4,
1942
+ top: top + 2,
1943
+ width: Math.max(1, width - 8),
1944
+ height: Math.max(1, height - 4)
1945
+ });
1946
+ }
1947
+ }
1948
+ }
1949
+ context.restore();
1950
+ }
1951
+ function visibleTrackStart(offsets, value) {
1952
+ return Math.max(0, Math.min(offsets.length - 2, lowerBound(offsets, value) - 1));
1953
+ }
1954
+ function visibleTrackEnd(offsets, value) {
1955
+ return Math.max(0, Math.min(offsets.length - 1, lowerBound(offsets, value) + 1));
1956
+ }
1957
+ function lowerBound(values, target) {
1958
+ let low = 0;
1959
+ let high = values.length;
1960
+ while (low < high) {
1961
+ const middle = low + Math.floor((high - low) / 2);
1962
+ if ((values[middle] ?? Number.POSITIVE_INFINITY) < target) low = middle + 1;
1963
+ else high = middle;
1964
+ }
1965
+ return low;
1966
+ }
1967
+ function drawTableOverview(context, table, position, columnOffsets, rowOffsets, visible) {
1968
+ context.save();
1969
+ context.beginPath();
1970
+ context.rect(position.left, position.top, position.width, position.height);
1971
+ applyFillAndLine(context, table.fill, table.line, false);
1972
+ const columnStep = Math.max(1, Math.ceil((visible.columnEnd - visible.columnStart) / 96));
1973
+ const rowStep = Math.max(1, Math.ceil((visible.rowEnd - visible.rowStart) / 96));
1974
+ context.beginPath();
1975
+ for (let index = visible.columnStart; index <= visible.columnEnd; index += columnStep) {
1976
+ const x = columnOffsets[index];
1977
+ if (x === void 0) continue;
1978
+ context.moveTo(x, position.top);
1979
+ context.lineTo(x, position.top + position.height);
1980
+ }
1981
+ for (let index = visible.rowStart; index <= visible.rowEnd; index += rowStep) {
1982
+ const y = rowOffsets[index];
1983
+ if (y === void 0) continue;
1984
+ context.moveTo(position.left, y);
1985
+ context.lineTo(position.left + position.width, y);
1986
+ }
1987
+ applyFillAndLine(context, "none", table.line, true);
1988
+ context.restore();
1989
+ }
1990
+ function normalizeTableTracks(values, count, total) {
1991
+ if (values.length !== count) return Array.from({ length: count }, () => total / count);
1992
+ const sum = values.reduce((value, next) => value + next, 0);
1993
+ if (!Number.isFinite(sum) || sum <= 0) {
1994
+ return Array.from({ length: count }, () => total / count);
1995
+ }
1996
+ return values.map((value) => value / sum * total);
1997
+ }
1998
+ function cumulativeOffsets(tracks, start) {
1999
+ const offsets = [start];
2000
+ for (const track of tracks) offsets.push((offsets.at(-1) ?? start) + track);
2001
+ return offsets;
2002
+ }
2003
+ function drawGroup(t, context, group, position, imageCache, requestRepaint, renderRegion, pixelScale, usedImageSources) {
2004
+ const scaleX = position.width / group.childExtent.width;
2005
+ const scaleY = position.height / group.childExtent.height;
2006
+ const translatedX = position.left - group.childOffset.left * scaleX;
2007
+ const translatedY = position.top - group.childOffset.top * scaleY;
2008
+ const centerX = position.left + position.width / 2;
2009
+ const centerY = position.top + position.height / 2;
2010
+ context.save();
2011
+ context.translate(centerX, centerY);
2012
+ context.rotate(group.rotation * Math.PI / 180);
2013
+ context.scale(group.flipHorizontal ? -1 : 1, group.flipVertical ? -1 : 1);
2014
+ context.translate(-centerX, -centerY);
2015
+ context.translate(translatedX, translatedY);
2016
+ context.scale(scaleX, scaleY);
2017
+ const childRenderRegion = inverseGroupRegion(group, position, renderRegion);
2018
+ for (const child of group.children) {
2019
+ const entry = displayObjectFromElement(child);
2020
+ if (!intersects(objectBounds(entry), childRenderRegion)) continue;
2021
+ drawObject(
2022
+ t,
2023
+ context,
2024
+ entry,
2025
+ child.position,
2026
+ imageCache,
2027
+ requestRepaint,
2028
+ childRenderRegion,
2029
+ pixelScale * Math.min(Math.abs(scaleX), Math.abs(scaleY)),
2030
+ usedImageSources
2031
+ );
2032
+ }
2033
+ context.restore();
2034
+ }
2035
+ function inverseGroupRegion(group, position, region) {
2036
+ const scaleX = position.width / group.childExtent.width;
2037
+ const scaleY = position.height / group.childExtent.height;
2038
+ const translatedX = position.left - group.childOffset.left * scaleX;
2039
+ const translatedY = position.top - group.childOffset.top * scaleY;
2040
+ const centerX = position.left + position.width / 2;
2041
+ const centerY = position.top + position.height / 2;
2042
+ const radians = -group.rotation * Math.PI / 180;
2043
+ const cos = Math.cos(radians);
2044
+ const sin = Math.sin(radians);
2045
+ const points = [
2046
+ [region.left, region.top],
2047
+ [region.left + region.width, region.top],
2048
+ [region.left, region.top + region.height],
2049
+ [region.left + region.width, region.top + region.height]
2050
+ ].map(([x = 0, y = 0]) => {
2051
+ const dx = x - centerX;
2052
+ const dy = y - centerY;
2053
+ const rotatedX = dx * cos - dy * sin;
2054
+ const rotatedY = dx * sin + dy * cos;
2055
+ const unflippedX = rotatedX * (group.flipHorizontal ? -1 : 1) + centerX;
2056
+ const unflippedY = rotatedY * (group.flipVertical ? -1 : 1) + centerY;
2057
+ return {
2058
+ x: (unflippedX - translatedX) / scaleX,
2059
+ y: (unflippedY - translatedY) / scaleY
2060
+ };
2061
+ });
2062
+ const xs = points.map((point) => point.x);
2063
+ const ys = points.map((point) => point.y);
2064
+ const left = Math.min(...xs);
2065
+ const right = Math.max(...xs);
2066
+ const top = Math.min(...ys);
2067
+ const bottom = Math.max(...ys);
2068
+ return { left, top, width: right - left, height: bottom - top };
2069
+ }
2070
+ function drawShape(t, context, shape, position) {
2071
+ context.save();
2072
+ context.translate(position.left + position.width / 2, position.top + position.height / 2);
2073
+ context.rotate(shape.rotation * Math.PI / 180);
2074
+ const x = -position.width / 2;
2075
+ const y = -position.height / 2;
2076
+ context.beginPath();
2077
+ switch (shape.geometry) {
2078
+ case "ellipse":
2079
+ context.ellipse(0, 0, position.width / 2, position.height / 2, 0, 0, Math.PI * 2);
2080
+ break;
2081
+ case "triangle":
2082
+ context.moveTo(0, y);
2083
+ context.lineTo(x + position.width, y + position.height);
2084
+ context.lineTo(x, y + position.height);
2085
+ context.closePath();
2086
+ break;
2087
+ case "rightArrow": {
2088
+ const body = position.width * 0.65;
2089
+ context.moveTo(x, y + position.height * 0.25);
2090
+ context.lineTo(x + body, y + position.height * 0.25);
2091
+ context.lineTo(x + body, y);
2092
+ context.lineTo(x + position.width, 0);
2093
+ context.lineTo(x + body, y + position.height);
2094
+ context.lineTo(x + body, y + position.height * 0.75);
2095
+ context.lineTo(x, y + position.height * 0.75);
2096
+ context.closePath();
2097
+ break;
2098
+ }
2099
+ case "line":
2100
+ context.moveTo(x, y);
2101
+ context.lineTo(x + position.width, y + position.height);
2102
+ break;
2103
+ case "roundRect":
2104
+ roundedRect(
2105
+ context,
2106
+ x,
2107
+ y,
2108
+ position.width,
2109
+ position.height,
2110
+ resolveRadius(shape.borderRadius, position)
2111
+ );
2112
+ break;
2113
+ default:
2114
+ context.rect(x, y, position.width, position.height);
2115
+ }
2116
+ applyFillAndLine(context, shape.fill, shape.line, shape.geometry === "line");
2117
+ const text = shape.text.toString();
2118
+ if (text)
2119
+ drawText(t, context, text, shape.text.style, {
2120
+ left: x,
2121
+ top: y,
2122
+ width: position.width,
2123
+ height: position.height
2124
+ });
2125
+ context.restore();
2126
+ }
2127
+ function drawChart(t, context, chart, position) {
2128
+ context.save();
2129
+ context.fillStyle = "#ffffff";
2130
+ context.strokeStyle = "#e2e8f0";
2131
+ context.lineWidth = 1;
2132
+ context.fillRect(position.left, position.top, position.width, position.height);
2133
+ context.strokeRect(position.left, position.top, position.width, position.height);
2134
+ if (chart.title) {
2135
+ drawText(
2136
+ t,
2137
+ context,
2138
+ chart.title,
2139
+ { fontSize: 18, bold: true, alignment: "center" },
2140
+ {
2141
+ left: position.left + 16,
2142
+ top: position.top + 8,
2143
+ width: Math.max(1, position.width - 32),
2144
+ height: 28
2145
+ }
2146
+ );
2147
+ }
2148
+ const plot = {
2149
+ left: position.left + 36,
2150
+ top: position.top + (chart.title ? 46 : 20),
2151
+ width: Math.max(1, position.width - 56),
2152
+ height: Math.max(1, position.height - (chart.title ? 72 : 48))
2153
+ };
2154
+ const values = chart.series.items.flatMap((series) => series.values).filter(Number.isFinite);
2155
+ const minValue = Math.min(0, chart.yAxis?.min ?? Math.min(...values, 0));
2156
+ const maxValue = Math.max(1, chart.yAxis?.max ?? Math.max(...values, 1));
2157
+ const valueRange = Math.max(Number.EPSILON, maxValue - minValue);
2158
+ const yForValue = (value) => plot.top + plot.height - (value - minValue) / valueRange * plot.height;
2159
+ const palette = ["#2563eb", "#0f766e", "#f59e0b", "#dc2626", "#7c3aed"];
2160
+ if (chart.type === "pie" || chart.type === "doughnut") {
2161
+ const series = chart.series.items[0];
2162
+ const slices = series?.values.map((value) => Math.max(0, value)) ?? [];
2163
+ const total = slices.reduce((sum, value) => sum + value, 0);
2164
+ let angle = -Math.PI / 2;
2165
+ const radius = Math.min(plot.width, plot.height) * 0.42;
2166
+ const cx = plot.left + plot.width / 2;
2167
+ const cy = plot.top + plot.height / 2;
2168
+ slices.forEach((value, index) => {
2169
+ const next = angle + (total > 0 ? value / total * Math.PI * 2 : 0);
2170
+ context.beginPath();
2171
+ context.moveTo(cx, cy);
2172
+ context.arc(cx, cy, radius, angle, next);
2173
+ context.closePath();
2174
+ context.fillStyle = palette[index % palette.length] ?? "#2563eb";
2175
+ context.fill();
2176
+ angle = next;
2177
+ });
2178
+ if (chart.type === "doughnut") {
2179
+ context.beginPath();
2180
+ context.arc(cx, cy, radius * 0.55, 0, Math.PI * 2);
2181
+ context.fillStyle = "#ffffff";
2182
+ context.fill();
2183
+ }
2184
+ } else if (chart.type === "line" || chart.type === "area") {
2185
+ drawChartAxes(context, chart, plot, yForValue(0));
2186
+ chart.series.items.forEach((series, seriesIndex) => {
2187
+ if (series.values.length === 0) return;
2188
+ const points = series.values.map((value, index) => ({
2189
+ x: plot.left + index / Math.max(1, series.values.length - 1) * plot.width,
2190
+ y: yForValue(value)
2191
+ }));
2192
+ const color = resolveColor(
2193
+ series.line?.fill ?? series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb"
2194
+ );
2195
+ if (chart.type === "area") {
2196
+ context.beginPath();
2197
+ context.moveTo(points[0]?.x ?? plot.left, yForValue(0));
2198
+ for (const point of points) context.lineTo(point.x, point.y);
2199
+ context.lineTo(points.at(-1)?.x ?? plot.left + plot.width, yForValue(0));
2200
+ context.closePath();
2201
+ context.globalAlpha = 0.22;
2202
+ context.fillStyle = color;
2203
+ context.fill();
2204
+ context.globalAlpha = 1;
2205
+ }
2206
+ context.beginPath();
2207
+ points.forEach((point, index) => {
2208
+ if (index === 0) context.moveTo(point.x, point.y);
2209
+ else context.lineTo(point.x, point.y);
2210
+ });
2211
+ context.strokeStyle = color;
2212
+ context.lineWidth = series.line?.width ?? 3;
2213
+ context.stroke();
2214
+ for (const point of points) {
2215
+ context.beginPath();
2216
+ context.arc(point.x, point.y, 3, 0, Math.PI * 2);
2217
+ context.fillStyle = color;
2218
+ context.fill();
2219
+ }
2220
+ });
2221
+ } else if (chart.type === "scatter" || chart.type === "bubble") {
2222
+ drawChartAxes(context, chart, plot, yForValue(0));
2223
+ const xValues = chart.series.items.flatMap(
2224
+ (series) => series.values.map((_value, index) => series.xValues[index] ?? index)
2225
+ );
2226
+ const minX = chart.xAxis?.min ?? Math.min(...xValues, 0);
2227
+ const maxX = chart.xAxis?.max ?? Math.max(...xValues, 1);
2228
+ const xRange = Math.max(Number.EPSILON, maxX - minX);
2229
+ chart.series.items.forEach((series, seriesIndex) => {
2230
+ context.fillStyle = resolveColor(
2231
+ series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb"
2232
+ );
2233
+ series.values.forEach((value, index) => {
2234
+ const xValue = series.xValues[index] ?? index;
2235
+ const x = plot.left + (xValue - minX) / xRange * plot.width;
2236
+ const radius = chart.type === "bubble" ? Math.max(3, Math.sqrt(Math.max(0, series.bubbleSizes[index] ?? 9))) : 4;
2237
+ context.beginPath();
2238
+ context.arc(x, yForValue(value), radius, 0, Math.PI * 2);
2239
+ context.fill();
2240
+ });
2241
+ });
2242
+ } else if (chart.type === "radar") {
2243
+ drawRadarChart(context, chart, plot, palette);
2244
+ } else {
2245
+ drawChartAxes(context, chart, plot, yForValue(0));
2246
+ const count = Math.max(1, ...chart.series.items.map((series) => series.values.length));
2247
+ const groupWidth = plot.width / count;
2248
+ const barWidth = groupWidth * 0.72 / Math.max(1, chart.series.items.length);
2249
+ const baseline = yForValue(0);
2250
+ chart.series.items.forEach((series, seriesIndex) => {
2251
+ series.values.forEach((value, valueIndex) => {
2252
+ const valueY = yForValue(value);
2253
+ const height = Math.abs(baseline - valueY);
2254
+ context.fillStyle = resolveColor(
2255
+ series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb"
2256
+ );
2257
+ const left = plot.left + valueIndex * groupWidth + groupWidth * 0.14 + seriesIndex * barWidth;
2258
+ context.fillRect(left, Math.min(baseline, valueY), Math.max(1, barWidth), height);
2259
+ if (chart.dataLabels?.showValue) {
2260
+ drawText(
2261
+ t,
2262
+ context,
2263
+ String(value),
2264
+ { fontSize: 11, alignment: "center" },
2265
+ {
2266
+ left,
2267
+ top: Math.max(plot.top, Math.min(baseline, valueY) - 14),
2268
+ width: Math.max(1, barWidth),
2269
+ height: 14
2270
+ }
2271
+ );
2272
+ }
2273
+ });
2274
+ });
2275
+ }
2276
+ context.restore();
2277
+ }
2278
+ function drawChartAxes(context, chart, plot, baseline) {
2279
+ context.save();
2280
+ context.strokeStyle = "#94a3b8";
2281
+ context.lineWidth = 1;
2282
+ if (chart.xAxis?.visible !== false) {
2283
+ context.beginPath();
2284
+ context.moveTo(plot.left, Math.max(plot.top, Math.min(plot.top + plot.height, baseline)));
2285
+ context.lineTo(
2286
+ plot.left + plot.width,
2287
+ Math.max(plot.top, Math.min(plot.top + plot.height, baseline))
2288
+ );
2289
+ context.stroke();
2290
+ }
2291
+ if (chart.yAxis?.visible !== false) {
2292
+ context.beginPath();
2293
+ context.moveTo(plot.left, plot.top);
2294
+ context.lineTo(plot.left, plot.top + plot.height);
2295
+ context.stroke();
2296
+ }
2297
+ context.restore();
2298
+ }
2299
+ function drawRadarChart(context, chart, plot, palette) {
2300
+ const count = Math.max(3, ...chart.series.items.map((series) => series.values.length));
2301
+ const maximum = Math.max(
2302
+ 1,
2303
+ ...chart.series.items.flatMap((series) => series.values.map((value) => Math.max(0, value)))
2304
+ );
2305
+ const centerX = plot.left + plot.width / 2;
2306
+ const centerY = plot.top + plot.height / 2;
2307
+ const radius = Math.min(plot.width, plot.height) * 0.42;
2308
+ const point = (index, value) => {
2309
+ const angle = -Math.PI / 2 + index / count * Math.PI * 2;
2310
+ const scaled = Math.max(0, value) / maximum * radius;
2311
+ return { x: centerX + Math.cos(angle) * scaled, y: centerY + Math.sin(angle) * scaled };
2312
+ };
2313
+ context.save();
2314
+ context.strokeStyle = "#cbd5e1";
2315
+ for (let ring = 1; ring <= 4; ring += 1) {
2316
+ context.beginPath();
2317
+ for (let index = 0; index < count; index += 1) {
2318
+ const next = point(index, maximum * ring / 4);
2319
+ if (index === 0) context.moveTo(next.x, next.y);
2320
+ else context.lineTo(next.x, next.y);
2321
+ }
2322
+ context.closePath();
2323
+ context.stroke();
2324
+ }
2325
+ chart.series.items.forEach((series, seriesIndex) => {
2326
+ const color = resolveColor(series.fill ?? palette[seriesIndex % palette.length] ?? "#2563eb");
2327
+ context.beginPath();
2328
+ for (let index = 0; index < count; index += 1) {
2329
+ const next = point(index, series.values[index] ?? 0);
2330
+ if (index === 0) context.moveTo(next.x, next.y);
2331
+ else context.lineTo(next.x, next.y);
2332
+ }
2333
+ context.closePath();
2334
+ context.globalAlpha = 0.18;
2335
+ context.fillStyle = color;
2336
+ context.fill();
2337
+ context.globalAlpha = 1;
2338
+ context.strokeStyle = color;
2339
+ context.lineWidth = series.line?.width ?? 2;
2340
+ context.stroke();
2341
+ });
2342
+ context.restore();
2343
+ }
2344
+ function drawImage(t, context, image, position, imageCache, requestRepaint) {
2345
+ context.save();
2346
+ applyImageTransform(context, image, position);
2347
+ imageClipPath(context, image, position);
2348
+ context.clip();
2349
+ context.fillStyle = "#f1f5f9";
2350
+ context.fillRect(position.left, position.top, position.width, position.height);
2351
+ const source = imageSourceForCanvas(image);
2352
+ if (source && typeof Image !== "undefined") {
2353
+ let cached = imageCache.get(source);
2354
+ if (!cached) {
2355
+ const element = new Image();
2356
+ cached = { image: element, ready: false };
2357
+ imageCache.set(source, cached);
2358
+ element.onload = () => {
2359
+ const current = imageCache.get(source);
2360
+ if (!current || current.image !== element) return;
2361
+ current.ready = true;
2362
+ requestRepaint();
2363
+ };
2364
+ element.onerror = () => {
2365
+ const current = imageCache.get(source);
2366
+ if (current?.image === element) current.ready = false;
2367
+ };
2368
+ element.src = source;
2369
+ }
2370
+ if (cached.ready && cached.image.naturalWidth > 0 && cached.image.naturalHeight > 0) {
2371
+ drawFittedImage(context, cached.image, image, position);
2372
+ context.restore();
2373
+ return source;
2374
+ }
2375
+ }
2376
+ context.strokeStyle = "#94a3b8";
2377
+ context.lineWidth = 1;
2378
+ context.setLineDash([8, 6]);
2379
+ imageClipPath(context, image, position);
2380
+ context.stroke();
2381
+ context.setLineDash([]);
2382
+ drawText(
2383
+ t,
2384
+ context,
2385
+ image.alt || image.prompt || t("artifacts.presentationEditor.image"),
2386
+ { fontSize: 14, color: "slate-600" },
2387
+ {
2388
+ left: position.left + 12,
2389
+ top: position.top + 12,
2390
+ width: Math.max(1, position.width - 24),
2391
+ height: Math.max(1, position.height - 24)
2392
+ }
2393
+ );
2394
+ context.restore();
2395
+ return source;
2396
+ }
2397
+ function imageSourceForCanvas(image) {
2398
+ try {
2399
+ return image.sourceForSvg();
2400
+ } catch {
2401
+ return void 0;
2402
+ }
2403
+ }
2404
+ function applyImageTransform(context, image, position) {
2405
+ const centerX = position.left + position.width / 2;
2406
+ const centerY = position.top + position.height / 2;
2407
+ context.translate(centerX, centerY);
2408
+ context.rotate(image.rotation * Math.PI / 180);
2409
+ context.scale(image.flipHorizontal ? -1 : 1, image.flipVertical ? -1 : 1);
2410
+ context.translate(-centerX, -centerY);
2411
+ }
2412
+ function imageClipPath(context, image, position) {
2413
+ context.beginPath();
2414
+ if (image.geometry === "ellipse") {
2415
+ context.ellipse(
2416
+ position.left + position.width / 2,
2417
+ position.top + position.height / 2,
2418
+ position.width / 2,
2419
+ position.height / 2,
2420
+ 0,
2421
+ 0,
2422
+ Math.PI * 2
2423
+ );
2424
+ } else if (image.geometry === "roundRect") {
2425
+ roundedRect(
2426
+ context,
2427
+ position.left,
2428
+ position.top,
2429
+ position.width,
2430
+ position.height,
2431
+ resolveRadius(image.borderRadius, position)
2432
+ );
2433
+ } else {
2434
+ context.rect(position.left, position.top, position.width, position.height);
2435
+ }
2436
+ context.closePath();
2437
+ }
2438
+ function drawFittedImage(context, source, image, position) {
2439
+ const crop = image.crop ?? { left: 0, top: 0, right: 0, bottom: 0 };
2440
+ const sourceX = source.naturalWidth * crop.left;
2441
+ const sourceY = source.naturalHeight * crop.top;
2442
+ const sourceWidth = source.naturalWidth * (1 - crop.left - crop.right);
2443
+ const sourceHeight = source.naturalHeight * (1 - crop.top - crop.bottom);
2444
+ if (sourceWidth <= 0 || sourceHeight <= 0) return;
2445
+ const scale = image.fit === "cover" ? Math.max(position.width / sourceWidth, position.height / sourceHeight) : Math.min(position.width / sourceWidth, position.height / sourceHeight);
2446
+ const width = sourceWidth * scale;
2447
+ const height = sourceHeight * scale;
2448
+ const left = position.left + (position.width - width) / 2;
2449
+ const top = position.top + (position.height - height) / 2;
2450
+ context.drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight, left, top, width, height);
2451
+ }
2452
+ function disposeCanvasImageCache(cache) {
2453
+ for (const entry of cache.values()) disposeCanvasImageEntry(entry);
2454
+ cache.clear();
2455
+ }
2456
+ function disposeUnusedCanvasImages(cache, usedSources) {
2457
+ for (const [source, entry] of cache) {
2458
+ if (usedSources.has(source)) continue;
2459
+ disposeCanvasImageEntry(entry);
2460
+ cache.delete(source);
2461
+ }
2462
+ }
2463
+ function disposeCanvasImageEntry(entry) {
2464
+ entry.image.onload = null;
2465
+ entry.image.onerror = null;
2466
+ entry.image.removeAttribute("src");
2467
+ }
2468
+ function drawText(t, context, text, style, position) {
2469
+ const fontSize = style.fontSize ?? 18;
2470
+ const fontStyle = style.italic ? "italic " : "";
2471
+ const fontWeight = style.bold ? "700 " : "400 ";
2472
+ context.font = `${fontStyle}${fontWeight}${fontSize}px ${style.fontFamily ?? t("artifacts.presentationEditor.arialSansSerif")}`;
2473
+ context.fillStyle = resolveColor(style.color ?? "slate-950");
2474
+ context.textAlign = style.alignment === "center" ? "center" : style.alignment === "right" ? "right" : "left";
2475
+ context.textBaseline = "top";
2476
+ const x = style.alignment === "center" ? position.left + position.width / 2 : style.alignment === "right" ? position.left + position.width : position.left;
2477
+ const lineHeight = fontSize * 1.2;
2478
+ const lines = wrapCanvasText(context, text, position.width);
2479
+ const totalHeight = lines.length * lineHeight;
2480
+ const top = style.verticalAlignment === "middle" ? position.top + (position.height - totalHeight) / 2 : style.verticalAlignment === "bottom" ? position.top + position.height - totalHeight : position.top;
2481
+ context.save();
2482
+ context.beginPath();
2483
+ context.rect(position.left, position.top, position.width, position.height);
2484
+ context.clip();
2485
+ lines.forEach((line, index) => context.fillText(line, x, top + index * lineHeight));
2486
+ context.restore();
2487
+ }
2488
+ function wrapCanvasText(context, text, width) {
2489
+ const result = [];
2490
+ for (const paragraph of text.split("\n")) {
2491
+ const words = paragraph.split(/\s+/).filter(Boolean);
2492
+ if (words.length === 0) {
2493
+ result.push("");
2494
+ continue;
2495
+ }
2496
+ let line = words[0] ?? "";
2497
+ for (let index = 1; index < words.length; index += 1) {
2498
+ const word = words[index] ?? "";
2499
+ const candidate = `${line} ${word}`;
2500
+ if (context.measureText(candidate).width <= width || line.length === 0) line = candidate;
2501
+ else {
2502
+ result.push(line);
2503
+ line = word;
2504
+ }
2505
+ }
2506
+ result.push(line);
2507
+ }
2508
+ return result;
2509
+ }
2510
+ function applyFillAndLine(context, fill, line, lineOnly) {
2511
+ if (!lineOnly && resolveColor(fill) !== "transparent") {
2512
+ context.fillStyle = resolveColor(fill);
2513
+ context.fill();
2514
+ }
2515
+ if (line.style !== "none" && resolveColor(line.fill ?? "slate-900") !== "transparent" && (line.width ?? 1) > 0) {
2516
+ context.strokeStyle = resolveColor(line.fill ?? "slate-900");
2517
+ context.lineWidth = line.width ?? 1;
2518
+ context.setLineDash(line.style === "dash" ? [8, 5] : line.style === "dot" ? [2, 4] : []);
2519
+ context.stroke();
2520
+ context.setLineDash([]);
2521
+ }
2522
+ }
2523
+ function roundedRect(context, x, y, width, height, radius) {
2524
+ const r = Math.min(Math.max(0, radius), width / 2, height / 2);
2525
+ context.moveTo(x + r, y);
2526
+ context.lineTo(x + width - r, y);
2527
+ context.quadraticCurveTo(x + width, y, x + width, y + r);
2528
+ context.lineTo(x + width, y + height - r);
2529
+ context.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
2530
+ context.lineTo(x + r, y + height);
2531
+ context.quadraticCurveTo(x, y + height, x, y + height - r);
2532
+ context.lineTo(x, y + r);
2533
+ context.quadraticCurveTo(x, y, x + r, y);
2534
+ context.closePath();
2535
+ }
2536
+ function hitTest(index, x, y) {
2537
+ const candidates = querySpatialIndex(index, { left: x, top: y, width: 0, height: 0 });
2538
+ for (let candidateIndex = candidates.length - 1; candidateIndex >= 0; candidateIndex -= 1) {
2539
+ const entry = index.objects[candidates[candidateIndex] ?? -1];
2540
+ if (entry && objectContainsPoint(entry, x, y)) return entry;
2541
+ }
2542
+ return null;
2543
+ }
2544
+ function objectContainsPoint(entry, x, y) {
2545
+ const position = entry.object.position;
2546
+ const rotation = objectRotation(entry);
2547
+ if (rotation === 0) {
2548
+ return x >= position.left && x <= position.left + position.width && y >= position.top && y <= position.top + position.height;
2549
+ }
2550
+ const centerX = position.left + position.width / 2;
2551
+ const centerY = position.top + position.height / 2;
2552
+ const radians = -rotation * Math.PI / 180;
2553
+ const dx = x - centerX;
2554
+ const dy = y - centerY;
2555
+ const localX = dx * Math.cos(radians) - dy * Math.sin(radians) + centerX;
2556
+ const localY = dx * Math.sin(radians) + dy * Math.cos(radians) + centerY;
2557
+ return localX >= position.left && localX <= position.left + position.width && localY >= position.top && localY <= position.top + position.height;
2558
+ }
2559
+ function objectBounds(entry) {
2560
+ const position = entry.object.position;
2561
+ const rotation = objectRotation(entry);
2562
+ if (rotation === 0) return position;
2563
+ const radians = rotation * Math.PI / 180;
2564
+ const width = Math.abs(position.width * Math.cos(radians)) + Math.abs(position.height * Math.sin(radians));
2565
+ const height = Math.abs(position.width * Math.sin(radians)) + Math.abs(position.height * Math.cos(radians));
2566
+ return {
2567
+ left: position.left + (position.width - width) / 2,
2568
+ top: position.top + (position.height - height) / 2,
2569
+ width,
2570
+ height
2571
+ };
2572
+ }
2573
+ function objectRotation(entry) {
2574
+ if (entry.kind === "shape") return finite(entry.object.rotation, 0);
2575
+ if (entry.kind === "image") return finite(entry.object.rotation, 0);
2576
+ if (entry.kind === "group") return finite(entry.object.rotation, 0);
2577
+ return 0;
2578
+ }
2579
+ function objectLabel(t, entry) {
2580
+ const object = entry.object;
2581
+ if (entry.kind === "shape") {
2582
+ const shape = object;
2583
+ return shape.text.toString().trim() || shape.name || t("artifacts.presentationEditor.shape");
2584
+ }
2585
+ if (entry.kind === "chart")
2586
+ return object.title || object.name || t("artifacts.presentationEditor.chart");
2587
+ if (entry.kind === "image")
2588
+ return object.alt || object.name || t("artifacts.presentationEditor.image");
2589
+ if (entry.kind === "table") return object.name || t("artifacts.presentationEditor.table");
2590
+ return object.name || t("artifacts.presentationEditor.group");
2591
+ }
2592
+ function accessibleObjectLabel(t, entry) {
2593
+ const position = entry.object.position;
2594
+ return `${objectLabel(t, entry)}. Position ${Math.round(position.left)}, ${Math.round(position.top)}. Size ${Math.round(position.width)} by ${Math.round(position.height)}.`;
2595
+ }
2596
+ function nextTextBoxPosition(objects, slideSize) {
2597
+ const width = slideSize.width * 0.6;
2598
+ const height = Math.max(48, slideSize.height * 0.16);
2599
+ const lefts = [0.2, 0.08, 0.32].map(
2600
+ (ratio) => Math.max(0, Math.min(slideSize.width - width, slideSize.width * ratio))
2601
+ );
2602
+ const tops = [0.2, 0.42, 0.64, 0.06].map(
2603
+ (ratio) => Math.max(0, Math.min(slideSize.height - height, slideSize.height * ratio))
2604
+ );
2605
+ const occupied = objects.map(objectBounds);
2606
+ let best = null;
2607
+ let bestOverlap = Number.POSITIVE_INFINITY;
2608
+ for (const left of lefts) {
2609
+ for (const top of tops) {
2610
+ const candidate = normalizeEditorPosition({ left, top, width, height });
2611
+ const overlap = occupied.reduce(
2612
+ (total, bounds) => total + intersectionArea(candidate, bounds),
2613
+ 0
2614
+ );
2615
+ if (overlap < bestOverlap) {
2616
+ best = candidate;
2617
+ bestOverlap = overlap;
2618
+ if (overlap === 0) return candidate;
2619
+ }
2620
+ }
2621
+ }
2622
+ return best ?? normalizeEditorPosition({ left: 0, top: 0, width, height });
2623
+ }
2624
+ function intersectionArea(a, b) {
2625
+ const width = Math.max(
2626
+ 0,
2627
+ Math.min(a.left + a.width, b.left + b.width) - Math.max(a.left, b.left)
2628
+ );
2629
+ const height = Math.max(0, Math.min(a.top + a.height, b.top + b.height) - Math.max(a.top, b.top));
2630
+ return width * height;
2631
+ }
2632
+ function normalizeEditorPosition(position) {
2633
+ return {
2634
+ left: clampGeometry(finite(position.left, 0)),
2635
+ top: clampGeometry(finite(position.top, 0)),
2636
+ width: Math.min(MAX_EDITOR_GEOMETRY, Math.max(8, finite(position.width, 8))),
2637
+ height: Math.min(MAX_EDITOR_GEOMETRY, Math.max(8, finite(position.height, 8)))
2638
+ };
2639
+ }
2640
+ function clampGeometry(value) {
2641
+ return Math.max(-MAX_EDITOR_GEOMETRY, Math.min(MAX_EDITOR_GEOMETRY, value));
2642
+ }
2643
+ function positionFromDrag(drag, point) {
2644
+ const dx = point.x - drag.start.x;
2645
+ const dy = point.y - drag.start.y;
2646
+ const radians = -drag.rotation * Math.PI / 180;
2647
+ const resizeDx = dx * Math.cos(radians) - dy * Math.sin(radians);
2648
+ const resizeDy = dx * Math.sin(radians) + dy * Math.cos(radians);
2649
+ return normalizeEditorPosition(
2650
+ drag.mode === "move" ? {
2651
+ ...drag.before,
2652
+ left: drag.before.left + dx,
2653
+ top: drag.before.top + dy
2654
+ } : {
2655
+ ...drag.before,
2656
+ width: Math.max(8, drag.before.width + resizeDx),
2657
+ height: Math.max(8, drag.before.height + resizeDy)
2658
+ }
2659
+ );
2660
+ }
2661
+ function selectionTransform(entry, position) {
2662
+ const rotation = objectRotation(entry);
2663
+ if (rotation === 0) return void 0;
2664
+ const centerX = position.left + position.width / 2;
2665
+ const centerY = position.top + position.height / 2;
2666
+ return `rotate(${rotation} ${centerX} ${centerY})`;
2667
+ }
2668
+ function copyPosition(position) {
2669
+ return {
2670
+ left: position.left,
2671
+ top: position.top,
2672
+ width: position.width,
2673
+ height: position.height
2674
+ };
2675
+ }
2676
+ function samePosition(a, b) {
2677
+ return a.left === b.left && a.top === b.top && a.width === b.width && a.height === b.height;
2678
+ }
2679
+ function sameViewport(a, b) {
2680
+ return a.scrollLeft === b.scrollLeft && a.scrollTop === b.scrollTop && a.width === b.width && a.height === b.height && a.stageLeft === b.stageLeft && a.stageTop === b.stageTop;
2681
+ }
2682
+ function intersects(a, b) {
2683
+ return !!a && a.left <= b.left + b.width && a.left + a.width >= b.left && a.top <= b.top + b.height && a.top + a.height >= b.top;
2684
+ }
2685
+ function clampZoom(value) {
2686
+ return Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, finite(value, 0.75)));
2687
+ }
2688
+ function fittedPresentationZoom(viewport, slideSize) {
2689
+ const horizontalRoom = Math.max(1, viewport.width - 48);
2690
+ const verticalRoom = Math.max(1, viewport.height - 48);
2691
+ return clampZoom(Math.min(horizontalRoom / slideSize.width, verticalRoom / slideSize.height));
2692
+ }
2693
+ function finite(value, fallback) {
2694
+ return Number.isFinite(value) ? value : fallback;
2695
+ }
2696
+ function safeDomId(value) {
2697
+ return value.replaceAll(/[^a-zA-Z0-9_-]/g, "-");
2698
+ }
2699
+ function randomPresentationId() {
2700
+ for (; ; ) {
2701
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
2702
+ if (bytes.some((byte) => byte !== 0)) {
2703
+ return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
2704
+ }
2705
+ }
2706
+ }
2707
+ function resolveRadius(value, position) {
2708
+ if (typeof value === "number") return value;
2709
+ const min = Math.min(position.width, position.height);
2710
+ const preset = value?.startsWith("rounded-") ? value.slice("rounded-".length) : void 0;
2711
+ if (preset === "full") return min / 2;
2712
+ if (preset === "2xl") return 16;
2713
+ if (preset === "xl") return 12;
2714
+ if (preset === "lg") return 8;
2715
+ return 6;
2716
+ }
2717
+ var COLORS = {
2718
+ none: "transparent",
2719
+ transparent: "transparent",
2720
+ white: "#ffffff",
2721
+ black: "#000000",
2722
+ "slate-50": "#f8fafc",
2723
+ "slate-100": "#f1f5f9",
2724
+ "slate-200": "#e2e8f0",
2725
+ "slate-300": "#cbd5e1",
2726
+ "slate-400": "#94a3b8",
2727
+ "slate-500": "#64748b",
2728
+ "slate-600": "#475569",
2729
+ "slate-700": "#334155",
2730
+ "slate-800": "#1e293b",
2731
+ "slate-900": "#0f172a",
2732
+ "slate-950": "#020617"
2733
+ };
2734
+ function resolveColor(fill) {
2735
+ const value = typeof fill === "string" ? fill : fill.color;
2736
+ return COLORS[value] ?? value;
2737
+ }
2738
+
2739
+ // src/components/artifacts/editable-presentation.tsx
2740
+ import {
2741
+ PRESENTATION_ARTIFACT_COMMAND_VERSION,
2742
+ PRESENTATION_ARTIFACT_QUERY_MAX_NODES,
2743
+ PRESENTATION_ARTIFACT_QUERY_MAX_SLIDES,
2744
+ PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
2745
+ PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
2746
+ } from "@opengeni/sdk/editable-artifacts";
2747
+ import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
2748
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2749
+ var EMU_PER_CSS_PIXEL = 9525;
2750
+ var PRESENTATION_CATALOG_PAGE = 128;
2751
+ var PRESENTATION_MAX_INTERACTIVE_SLIDES = 256;
2752
+ var PRESENTATION_MAX_INTERACTIVE_NODES = 16384;
2753
+ var PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES = 4 * 1024 * 1024;
2754
+ var PRESENTATION_MAX_CATALOG_PAGES = 32;
2755
+ var PRESENTATION_SCENE_CONCURRENCY = 4;
2756
+ var PRESENTATION_COMPOSITION_ATTEMPTS = 3;
2757
+ var DEFAULT_PRESENTATION_TEXT_STYLE = Object.freeze({
2758
+ fontFamily: "Arial",
2759
+ fontSizeCentipoints: 1800,
2760
+ color: 255,
2761
+ bold: false,
2762
+ italic: false,
2763
+ underline: false,
2764
+ language: null
2765
+ });
2766
+ function EditablePresentationArtifactSurface(props) {
2767
+ return /* @__PURE__ */ jsx2(ArtifactSubmissionProvider, { children: /* @__PURE__ */ jsx2(EditablePresentationArtifactSurfaceSession, { ...props }) }, artifactSubmissionSessionKey(props.session));
2768
+ }
2769
+ function EditablePresentationArtifactSurfaceSession({
2770
+ session,
2771
+ title: titleProp,
2772
+ showHeader,
2773
+ subtitle,
2774
+ readOnly = false,
2775
+ onCommit,
2776
+ onCommandError,
2777
+ download,
2778
+ actions: actionsProp,
2779
+ ...surfaceProps
2780
+ }) {
2781
+ const t = useOpenGeniText();
2782
+ const title = titleProp === void 0 ? t("artifacts.editablePresentation.presentation") : titleProp;
2783
+ const view = useEditableArtifactView(session);
2784
+ const submissions = useArtifactSubmissions();
2785
+ const invalidator = editableArtifactProjectionKey(view);
2786
+ const [retryEpoch, setRetryEpoch] = useState2(0);
2787
+ const [state, setState] = useState2({
2788
+ composed: null,
2789
+ loading: true,
2790
+ error: null
2791
+ });
2792
+ const loadGeneration = useRef2(0);
2793
+ const scheduleLoad = useLatestTaskRunner(session);
2794
+ const sceneNodes = useRef2(/* @__PURE__ */ new Map());
2795
+ useEffect2(() => {
2796
+ const generation = ++loadGeneration.current;
2797
+ let cancelled = false;
2798
+ setState((current) => ({ ...current, loading: true, error: null }));
2799
+ scheduleLoad(async () => {
2800
+ if (cancelled || generation !== loadGeneration.current) return;
2801
+ await composePresentationEditorProjection(t, session).then(
2802
+ (composed) => {
2803
+ if (cancelled || generation !== loadGeneration.current) return;
2804
+ sceneNodes.current = new Map(composed.sceneNodes);
2805
+ setState({ composed, loading: false, error: null });
2806
+ },
2807
+ (cause) => {
2808
+ if (cancelled || generation !== loadGeneration.current) return;
2809
+ setState({
2810
+ composed: null,
2811
+ loading: false,
2812
+ error: asEditableArtifactError(
2813
+ cause,
2814
+ t("artifacts.editablePresentation.couldNotOpenThisPresentation")
2815
+ )
2816
+ });
2817
+ }
2818
+ );
2819
+ });
2820
+ return () => {
2821
+ cancelled = true;
2822
+ };
2823
+ }, [invalidator, retryEpoch, scheduleLoad, session, t]);
2824
+ const refresh = useCallback2(() => setRetryEpoch((value) => value + 1), []);
2825
+ const writable = !readOnly && view.writable;
2826
+ const applyCommit = useCallback2(
2827
+ async (commit) => {
2828
+ const composed = state.composed;
2829
+ if (!composed) throw new Error("Presentation projection is not ready");
2830
+ if (!writable)
2831
+ throw new Error(t("artifacts.editablePresentation.thisPresentationIsReadOnly"));
2832
+ if (view.authoringBlockedReason)
2833
+ throw new Error(t("artifacts.editablePresentation.anEarlierChangeMustSettle"));
2834
+ if (commit.revision !== void 0 && String(commit.revision) !== String(composed.projection.revision)) {
2835
+ throw new Error(t("artifacts.editablePresentation.thePresentationChangedRetryThis"));
2836
+ }
2837
+ if (commit.kind === "slide-insert") {
2838
+ await session.createPresentationSlide({
2839
+ slideId: commit.slideId,
2840
+ index: commit.index
2841
+ });
2842
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2843
+ refresh();
2844
+ return;
2845
+ }
2846
+ if (commit.kind === "slide-delete") {
2847
+ await session.applyPresentationCommands({
2848
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2849
+ commands: [
2850
+ ...presentationNodeDeletionCommands(
2851
+ [...sceneNodes.current.values()],
2852
+ commit.slideId,
2853
+ null
2854
+ ),
2855
+ { kind: "slide.delete", id: commit.slideId }
2856
+ ]
2857
+ });
2858
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2859
+ refresh();
2860
+ return;
2861
+ }
2862
+ if (commit.kind === "object-insert") {
2863
+ await session.applyPresentationCommands({
2864
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2865
+ commands: [
2866
+ {
2867
+ kind: "node.insert",
2868
+ owner: { kind: "slide", id: commit.slideId },
2869
+ parentId: null,
2870
+ index: commit.index,
2871
+ node: {
2872
+ id: commit.objectId,
2873
+ name: "Text box",
2874
+ bounds: {
2875
+ x: canonicalCoordinate(commit.position.left),
2876
+ y: canonicalCoordinate(commit.position.top),
2877
+ width: Math.max(1, canonicalCoordinate(commit.position.width)),
2878
+ height: Math.max(1, canonicalCoordinate(commit.position.height))
2879
+ },
2880
+ transform: { rotation: 0, flipHorizontal: false, flipVertical: false },
2881
+ content: {
2882
+ kind: "shape",
2883
+ geometry: "text-box",
2884
+ fill: { kind: "none" },
2885
+ line: { fill: { kind: "none" }, width: 0, dash: "solid" },
2886
+ text: emptyPresentationText(),
2887
+ placeholder: null
2888
+ }
2889
+ }
2890
+ }
2891
+ ]
2892
+ });
2893
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2894
+ refresh();
2895
+ return;
2896
+ }
2897
+ if (commit.kind === "object-delete") {
2898
+ await session.applyPresentationCommands({
2899
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2900
+ commands: presentationNodeDeletionCommands(
2901
+ [...sceneNodes.current.values()],
2902
+ commit.slideId,
2903
+ commit.objectId
2904
+ )
2905
+ });
2906
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2907
+ refresh();
2908
+ return;
2909
+ }
2910
+ const key = sceneNodeKey(commit.slideId, commit.objectId);
2911
+ const node = sceneNodes.current.get(key);
2912
+ if (!node) throw new Error(t("artifacts.editablePresentation.theEditedPresentationObjectIs"));
2913
+ if (node.inherited || node.source.kind !== "slide" || node.source.id !== commit.slideId) {
2914
+ throw new Error(t("artifacts.editablePresentation.inheritedMasterAndLayoutObjects"));
2915
+ }
2916
+ let command;
2917
+ let nextNode;
2918
+ if (commit.kind === "text") {
2919
+ if (node.content.kind !== "shape" || node.content.text === null) {
2920
+ throw new Error(t("artifacts.editablePresentation.thisPresentationObjectDoesNot"));
2921
+ }
2922
+ if (flattenPresentationRichText(node.content.text) !== commit.before) {
2923
+ throw new Error(t("artifacts.editablePresentation.thePresentationTextChangedRetry"));
2924
+ }
2925
+ const text = replacePresentationRichText(node.content.text, commit.before, commit.after);
2926
+ const content = Object.freeze({ ...node.content, text });
2927
+ command = { kind: "node.content.set", id: node.id, content };
2928
+ nextNode = Object.freeze({ ...node, content });
2929
+ } else {
2930
+ const current = normalizeProjectedEditorPosition(projectPosition(node.bounds));
2931
+ if (!sameProjectedPosition(current, commit.before)) {
2932
+ throw new Error(t("artifacts.editablePresentation.thePresentationObjectChangedRetry"));
2933
+ }
2934
+ const bounds = commit.kind === "move" ? Object.freeze({
2935
+ ...node.bounds,
2936
+ x: canonicalCoordinate(commit.after.left),
2937
+ y: canonicalCoordinate(commit.after.top)
2938
+ }) : Object.freeze({
2939
+ ...node.bounds,
2940
+ width: Math.max(1, canonicalCoordinate(commit.after.width)),
2941
+ height: Math.max(1, canonicalCoordinate(commit.after.height))
2942
+ });
2943
+ command = { kind: "node.bounds.set", id: node.id, bounds };
2944
+ nextNode = Object.freeze({ ...node, bounds });
2945
+ }
2946
+ await session.applyPresentationCommands({
2947
+ version: PRESENTATION_ARTIFACT_COMMAND_VERSION,
2948
+ commands: [command]
2949
+ });
2950
+ sceneNodes.current.set(key, nextNode);
2951
+ notifyPresentationCommit(t, onCommit, onCommandError, commit);
2952
+ refresh();
2953
+ },
2954
+ [
2955
+ onCommandError,
2956
+ onCommit,
2957
+ refresh,
2958
+ session,
2959
+ state.composed,
2960
+ view.authoringBlockedReason,
2961
+ writable,
2962
+ t
2963
+ ]
2964
+ );
2965
+ const submitCommit = useCallback2(
2966
+ (commit) => submissions.run(() => applyCommit(commit)),
2967
+ [applyCommit, submissions]
2968
+ );
2969
+ const actions = download ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2970
+ actionsProp,
2971
+ /* @__PURE__ */ jsx2(
2972
+ EditableArtifactDownloadButton,
2973
+ {
2974
+ session,
2975
+ title,
2976
+ download,
2977
+ format: "pptx"
2978
+ }
2979
+ )
2980
+ ] }) : actionsProp;
2981
+ const projection = state.composed?.projection ?? null;
2982
+ const status = editableArtifactStatusLabel(t, view);
2983
+ const accessRevoked = editableArtifactAccessRevoked(view);
2984
+ return projection && !accessRevoked ? /* @__PURE__ */ jsx2(
2985
+ PresentationProjectionArtifactSurface,
2986
+ {
2987
+ ...surfaceProps,
2988
+ title,
2989
+ showHeader,
2990
+ actions,
2991
+ subtitle: subtitle ?? writable ? t("counts.slides", { count: projection.slides.length }) : t("artifacts.readOnlySubtitle", {
2992
+ subtitle: t("counts.slides", { count: projection.slides.length })
2993
+ }),
2994
+ projection,
2995
+ commit: writable ? submitCommit : void 0,
2996
+ readOnly: !writable,
2997
+ authoringBlockedReason: view.authoringBlockedReason,
2998
+ busy: state.loading,
2999
+ onCommandError
3000
+ }
3001
+ ) : /* @__PURE__ */ jsx2(
3002
+ ArtifactSurface,
3003
+ {
3004
+ modality: "presentation",
3005
+ title,
3006
+ showHeader,
3007
+ subtitle: subtitle ?? status,
3008
+ actions: accessRevoked ? actionsProp : actions,
3009
+ busy: !accessRevoked && !state.error,
3010
+ className: surfaceProps.className,
3011
+ children: /* @__PURE__ */ jsx2(
3012
+ EditableArtifactMessage,
3013
+ {
3014
+ title: accessRevoked ? t("artifacts.editablePresentation.accessChanged") : state.error ? t("artifacts.editablePresentation.couldNotOpenThisPresentation") : t("artifacts.editablePresentation.openingPresentation"),
3015
+ detail: accessRevoked ? status : state.error?.message ?? status,
3016
+ retry: !accessRevoked && state.error ? refresh : void 0
3017
+ }
3018
+ )
3019
+ }
3020
+ );
3021
+ }
3022
+ function presentationNodeDeletionCommands(nodes, slideId, rootId) {
3023
+ const owned = nodes.filter(
3024
+ (node) => !node.inherited && node.source.kind === "slide" && node.source.id === slideId
3025
+ );
3026
+ if (rootId !== null && !owned.some((node) => node.id === rootId)) {
3027
+ return [{ kind: "node.delete", id: rootId }];
3028
+ }
3029
+ let targets;
3030
+ if (rootId === null) {
3031
+ targets = new Set(owned.map((node) => node.id));
3032
+ } else {
3033
+ const children = /* @__PURE__ */ new Map();
3034
+ for (const node of owned) {
3035
+ if (node.parentId === null) continue;
3036
+ const siblings = children.get(node.parentId);
3037
+ if (siblings) siblings.push(node.id);
3038
+ else children.set(node.parentId, [node.id]);
3039
+ }
3040
+ targets = /* @__PURE__ */ new Set([rootId]);
3041
+ const stack = [rootId];
3042
+ while (stack.length > 0) {
3043
+ for (const child of children.get(stack.pop()) ?? []) {
3044
+ if (targets.has(child)) continue;
3045
+ targets.add(child);
3046
+ stack.push(child);
3047
+ }
3048
+ }
3049
+ }
3050
+ const commands = [];
3051
+ for (const node of owned) {
3052
+ if (targets.has(node.id) || node.content.kind !== "connector") continue;
3053
+ const { start, end } = node.content;
3054
+ const detachStart = start.nodeId !== null && targets.has(start.nodeId);
3055
+ const detachEnd = end.nodeId !== null && targets.has(end.nodeId);
3056
+ if (!detachStart && !detachEnd) continue;
3057
+ commands.push({
3058
+ kind: "node.content.set",
3059
+ id: node.id,
3060
+ content: {
3061
+ ...node.content,
3062
+ start: detachStart ? { ...start, nodeId: null } : start,
3063
+ end: detachEnd ? { ...end, nodeId: null } : end
3064
+ }
3065
+ });
3066
+ }
3067
+ const doomed = owned.filter((node) => targets.has(node.id));
3068
+ const referencedBy = (node) => {
3069
+ const referenced = /* @__PURE__ */ new Set();
3070
+ if (node.parentId !== null && targets.has(node.parentId)) referenced.add(node.parentId);
3071
+ if (node.content.kind === "connector") {
3072
+ for (const endpoint of [node.content.start.nodeId, node.content.end.nodeId]) {
3073
+ if (endpoint !== null && endpoint !== node.id && targets.has(endpoint)) {
3074
+ referenced.add(endpoint);
3075
+ }
3076
+ }
3077
+ }
3078
+ return referenced;
3079
+ };
3080
+ const references = new Map(doomed.map((node) => [node.id, referencedBy(node)]));
3081
+ const blockers = new Map(doomed.map((node) => [node.id, 0]));
3082
+ for (const referenced of references.values()) {
3083
+ for (const id of referenced) blockers.set(id, blockers.get(id) + 1);
3084
+ }
3085
+ const ready = doomed.filter((node) => blockers.get(node.id) === 0).map((node) => node.id);
3086
+ const deleted = /* @__PURE__ */ new Set();
3087
+ for (let index = 0; index < ready.length; index += 1) {
3088
+ const id = ready[index];
3089
+ deleted.add(id);
3090
+ commands.push({ kind: "node.delete", id });
3091
+ for (const referenced of references.get(id)) {
3092
+ const left = blockers.get(referenced) - 1;
3093
+ blockers.set(referenced, left);
3094
+ if (left === 0) ready.push(referenced);
3095
+ }
3096
+ }
3097
+ for (const node of doomed) {
3098
+ if (!deleted.has(node.id)) commands.push({ kind: "node.delete", id: node.id });
3099
+ }
3100
+ return commands;
3101
+ }
3102
+ async function composePresentationEditorProjection(t, session) {
3103
+ if (session.modality !== "presentation") {
3104
+ throw new Error("Expected a presentation artifact session");
3105
+ }
3106
+ let lastRevisionError = null;
3107
+ for (let attempt = 0; attempt < PRESENTATION_COMPOSITION_ATTEMPTS; attempt += 1) {
3108
+ try {
3109
+ return await composePresentationAttempt(session);
3110
+ } catch (cause) {
3111
+ const error = asEditableArtifactError(
3112
+ cause,
3113
+ t("artifacts.editablePresentation.couldNotProjectThisPresentation")
3114
+ );
3115
+ if (!isPresentationRevisionDrift(error) || attempt === PRESENTATION_COMPOSITION_ATTEMPTS - 1) {
3116
+ throw error;
3117
+ }
3118
+ lastRevisionError = error;
3119
+ }
3120
+ }
3121
+ throw lastRevisionError ?? new Error("Presentation changed while it was opening");
3122
+ }
3123
+ async function composePresentationAttempt(session) {
3124
+ const metadata = await session.queryPresentation({
3125
+ kind: "metadata",
3126
+ maxBytes: PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
3127
+ });
3128
+ if (metadata.kind !== "metadata") throw new Error("Presentation metadata response is malformed");
3129
+ if (metadata.slides > PRESENTATION_MAX_INTERACTIVE_SLIDES) {
3130
+ throw new Error(
3131
+ `Presentation exceeds the interactive limit of ${PRESENTATION_MAX_INTERACTIVE_SLIDES} slides`
3132
+ );
3133
+ }
3134
+ const catalog = await collectSlideCatalog(session, metadata.revision, metadata.slides);
3135
+ const scenes = [];
3136
+ for (let start = 0; start < catalog.length; start += PRESENTATION_SCENE_CONCURRENCY) {
3137
+ const batch = catalog.slice(start, start + PRESENTATION_SCENE_CONCURRENCY);
3138
+ const projected = await Promise.all(
3139
+ batch.map(
3140
+ (slide) => session.queryPresentationEditorSlide({
3141
+ kind: "editor-slide",
3142
+ slideId: slide.id,
3143
+ maxNodes: PRESENTATION_ARTIFACT_QUERY_MAX_NODES,
3144
+ maxTextBytes: PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
3145
+ maxBytes: PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
3146
+ })
3147
+ )
3148
+ );
3149
+ for (const scene of projected) {
3150
+ if (scene.revision !== metadata.revision) {
3151
+ throw new Error("Presentation projection revision drifted");
3152
+ }
3153
+ if (scene.truncated) {
3154
+ throw new Error(`Slide ${scene.slide.index + 1} exceeds the bounded editor projection`);
3155
+ }
3156
+ scenes.push(scene);
3157
+ }
3158
+ }
3159
+ const totalNodes = scenes.reduce((sum, scene) => sum + scene.nodes.length, 0);
3160
+ const totalText = scenes.reduce((sum, scene) => sum + scene.projectedTextBytes, 0);
3161
+ if (totalNodes > PRESENTATION_MAX_INTERACTIVE_NODES) {
3162
+ throw new Error(
3163
+ `Presentation exceeds the interactive limit of ${PRESENTATION_MAX_INTERACTIVE_NODES} scene nodes`
3164
+ );
3165
+ }
3166
+ if (totalText > PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES) {
3167
+ throw new Error(
3168
+ `Presentation exceeds the interactive limit of ${PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES} text bytes`
3169
+ );
3170
+ }
3171
+ if (scenes.length !== catalog.length) {
3172
+ throw new Error("Presentation slides changed while they were opening");
3173
+ }
3174
+ const sceneNodeMap = /* @__PURE__ */ new Map();
3175
+ const slides = scenes.map((scene, index) => {
3176
+ if (scene.slide.id !== catalog[index]?.id || scene.slide.index !== index) {
3177
+ throw new Error("Presentation slide catalog changed while it was opening");
3178
+ }
3179
+ for (const node of scene.nodes) {
3180
+ sceneNodeMap.set(sceneNodeKey(scene.slide.id, node.id), node);
3181
+ }
3182
+ return projectPresentationSlide(scene);
3183
+ });
3184
+ return Object.freeze({
3185
+ projection: Object.freeze({
3186
+ revision: metadata.revision.toString(),
3187
+ slideSize: Object.freeze({
3188
+ width: displayCoordinate(metadata.slideSize.width),
3189
+ height: displayCoordinate(metadata.slideSize.height)
3190
+ }),
3191
+ slides: Object.freeze(slides)
3192
+ }),
3193
+ sceneNodes: sceneNodeMap
3194
+ });
3195
+ }
3196
+ async function collectSlideCatalog(session, revision, expectedSlides) {
3197
+ const slides = [];
3198
+ let startSlide = 0;
3199
+ let projectedText = 0;
3200
+ for (let page = 0; page < PRESENTATION_MAX_CATALOG_PAGES; page += 1) {
3201
+ const response = await session.queryPresentationSlideCatalog({
3202
+ kind: "slide-catalog",
3203
+ startSlide,
3204
+ maxSlides: Math.min(
3205
+ PRESENTATION_CATALOG_PAGE,
3206
+ PRESENTATION_ARTIFACT_QUERY_MAX_SLIDES,
3207
+ Math.max(1, expectedSlides - slides.length)
3208
+ ),
3209
+ maxTextBytes: PRESENTATION_ARTIFACT_QUERY_MAX_TEXT_BYTES,
3210
+ maxBytes: PRESENTATION_ARTIFACT_QUERY_RESPONSE_MAX_BYTES
3211
+ });
3212
+ if (response.revision !== revision) {
3213
+ throw new Error("Presentation projection revision drifted");
3214
+ }
3215
+ if (response.startSlide !== startSlide) {
3216
+ throw new Error("Presentation slide catalog cursor is malformed");
3217
+ }
3218
+ if (response.slides.some((slide, offset) => slide.index !== startSlide + offset)) {
3219
+ throw new Error("Presentation slide catalog order is malformed");
3220
+ }
3221
+ slides.push(...response.slides);
3222
+ projectedText += response.projectedTextBytes;
3223
+ if (slides.length > PRESENTATION_MAX_INTERACTIVE_SLIDES || projectedText > PRESENTATION_MAX_INTERACTIVE_TEXT_BYTES) {
3224
+ throw new Error("Presentation slide catalog exceeds its interactive limit");
3225
+ }
3226
+ if (response.nextSlide === null) {
3227
+ if (response.truncated || slides.length !== expectedSlides) {
3228
+ throw new Error("Presentation slide catalog is incomplete");
3229
+ }
3230
+ return slides;
3231
+ }
3232
+ if (!response.truncated || response.nextSlide <= startSlide || response.nextSlide !== startSlide + response.slides.length || response.slides.length === 0) {
3233
+ throw new Error("Presentation slide catalog did not advance");
3234
+ }
3235
+ startSlide = response.nextSlide;
3236
+ }
3237
+ throw new Error(`Presentation catalog exceeds ${PRESENTATION_MAX_CATALOG_PAGES} pages`);
3238
+ }
3239
+ function projectPresentationSlide(scene) {
3240
+ const byId = new Map(scene.nodes.map((node) => [node.id, node]));
3241
+ if (byId.size !== scene.nodes.length)
3242
+ throw new Error("Presentation slide contains duplicate IDs");
3243
+ const children = /* @__PURE__ */ new Map();
3244
+ for (const node of scene.nodes) {
3245
+ const entries = children.get(node.parentId) ?? [];
3246
+ entries.push(node);
3247
+ children.set(node.parentId, entries);
3248
+ }
3249
+ for (const entries of children.values()) {
3250
+ entries.sort((left, right) => left.order - right.order || left.id.localeCompare(right.id));
3251
+ }
3252
+ const visited = /* @__PURE__ */ new Set();
3253
+ const stack = /* @__PURE__ */ new Set();
3254
+ const projectNode = (node) => {
3255
+ if (stack.has(node.id)) throw new Error("Presentation group hierarchy contains a cycle");
3256
+ if (visited.has(node.id)) throw new Error("Presentation node appears more than once");
3257
+ stack.add(node.id);
3258
+ visited.add(node.id);
3259
+ const directChildren = children.get(node.id) ?? [];
3260
+ let orderedChildren = directChildren;
3261
+ if (node.content.kind === "group") {
3262
+ const directIds = new Set(directChildren.map((child) => child.id));
3263
+ if (node.content.children.length !== directChildren.length || node.content.children.some((id) => !directIds.has(id))) {
3264
+ throw new Error(`Presentation group ${node.id} hierarchy is inconsistent`);
3265
+ }
3266
+ orderedChildren = node.content.children.map((id) => byId.get(id));
3267
+ } else if (directChildren.length > 0) {
3268
+ throw new Error(`Presentation non-group node ${node.id} contains children`);
3269
+ }
3270
+ const result = projectPresentationNode(node, orderedChildren.map(projectNode));
3271
+ stack.delete(node.id);
3272
+ return result;
3273
+ };
3274
+ const elements = (children.get(null) ?? []).map(projectNode);
3275
+ if (visited.size !== scene.nodes.length) {
3276
+ throw new Error("Presentation slide contains orphaned hierarchy nodes");
3277
+ }
3278
+ return Object.freeze({
3279
+ id: scene.slide.id,
3280
+ title: scene.slide.title,
3281
+ background: projectFill(scene.slide.background),
3282
+ elements: Object.freeze(elements),
3283
+ layout: scene.slide.layout ? Object.freeze({
3284
+ id: scene.slide.layout.id,
3285
+ name: scene.slide.layout.name,
3286
+ masterId: scene.slide.layout.masterId,
3287
+ background: projectFill(scene.slide.layout.background)
3288
+ }) : null,
3289
+ notes: scene.notes ? projectRichText(scene.notes) : null
3290
+ });
3291
+ }
3292
+ function projectPresentationNode(node, children) {
3293
+ const metadata = {
3294
+ nodeSource: { ...node.source },
3295
+ inherited: node.inherited,
3296
+ parentId: node.parentId,
3297
+ order: node.order,
3298
+ readOnly: node.inherited || node.source.kind !== "slide"
3299
+ };
3300
+ const position = projectPosition(node.bounds);
3301
+ const rotation = node.transform.rotation / 6e4;
3302
+ const content = node.content;
3303
+ if (content.kind === "shape") {
3304
+ const richText = content.text ? projectRichText(content.text) : void 0;
3305
+ const textStyle = richText ? firstTextStyle(richText) : void 0;
3306
+ return Object.freeze({
3307
+ ...metadata,
3308
+ kind: "shape",
3309
+ id: node.id,
3310
+ name: node.name,
3311
+ geometry: projectShapeGeometry(content.geometry),
3312
+ position,
3313
+ fill: projectFill(content.fill),
3314
+ line: projectLine(content.line),
3315
+ rotation,
3316
+ text: content.text ? flattenPresentationRichText(content.text) : "",
3317
+ ...richText ? { richText } : {},
3318
+ ...textStyle ? { textStyle } : {}
3319
+ });
3320
+ }
3321
+ if (content.kind === "group") {
3322
+ return Object.freeze({
3323
+ ...metadata,
3324
+ kind: "group",
3325
+ id: node.id,
3326
+ name: node.name,
3327
+ position,
3328
+ childOffset: Object.freeze({
3329
+ left: displayCoordinate(content.childOffsetX),
3330
+ top: displayCoordinate(content.childOffsetY)
3331
+ }),
3332
+ childExtent: Object.freeze({
3333
+ width: displayCoordinate(content.childExtentWidth),
3334
+ height: displayCoordinate(content.childExtentHeight)
3335
+ }),
3336
+ rotation,
3337
+ flipHorizontal: node.transform.flipHorizontal,
3338
+ flipVertical: node.transform.flipVertical,
3339
+ children: Object.freeze([...children])
3340
+ });
3341
+ }
3342
+ if (content.kind === "connector") {
3343
+ return Object.freeze({
3344
+ ...metadata,
3345
+ kind: "connector",
3346
+ id: node.id,
3347
+ name: node.name,
3348
+ connectorKind: content.connectorKind,
3349
+ position,
3350
+ start: Object.freeze({
3351
+ nodeId: content.start.nodeId,
3352
+ x: displayCoordinate(content.start.x),
3353
+ y: displayCoordinate(content.start.y)
3354
+ }),
3355
+ end: Object.freeze({
3356
+ nodeId: content.end.nodeId,
3357
+ x: displayCoordinate(content.end.x),
3358
+ y: displayCoordinate(content.end.y)
3359
+ }),
3360
+ line: projectLine(content.line)
3361
+ });
3362
+ }
3363
+ if (content.kind === "chart") {
3364
+ const titleRichText = projectRichText(content.title);
3365
+ return Object.freeze({
3366
+ ...metadata,
3367
+ kind: "chart",
3368
+ id: node.id,
3369
+ name: node.name,
3370
+ type: content.chartType,
3371
+ position,
3372
+ title: flattenPresentationRichText(content.title),
3373
+ titleRichText,
3374
+ hasLegend: content.hasLegend,
3375
+ series: Object.freeze(
3376
+ content.series.map((series) => ({
3377
+ name: series.name,
3378
+ categories: Object.freeze([...series.categories]),
3379
+ values: Object.freeze([...series.values]),
3380
+ xValues: Object.freeze([...series.xValues]),
3381
+ bubbleSizes: Object.freeze([...series.bubbleSizes])
3382
+ }))
3383
+ )
3384
+ });
3385
+ }
3386
+ if (content.kind === "table") {
3387
+ return Object.freeze({
3388
+ ...metadata,
3389
+ kind: "table",
3390
+ id: node.id,
3391
+ name: node.name,
3392
+ position,
3393
+ rows: Object.freeze(
3394
+ content.rows.map(
3395
+ (row) => Object.freeze(
3396
+ row.map(
3397
+ (cell) => cell ? Object.freeze({
3398
+ text: flattenPresentationRichText(cell.text),
3399
+ richText: projectRichText(cell.text),
3400
+ fill: projectFill(cell.fill),
3401
+ rowSpan: cell.rowSpan,
3402
+ colSpan: cell.columnSpan
3403
+ }) : null
3404
+ )
3405
+ )
3406
+ )
3407
+ ),
3408
+ columnWidths: Object.freeze(content.columnWidths.map(displayCoordinate)),
3409
+ rowHeights: Object.freeze(content.rowHeights.map(displayCoordinate)),
3410
+ line: projectLine(content.line)
3411
+ });
3412
+ }
3413
+ return Object.freeze({
3414
+ ...metadata,
3415
+ kind: "image",
3416
+ id: node.id,
3417
+ name: node.name,
3418
+ position,
3419
+ alt: content.altText,
3420
+ fit: content.fit,
3421
+ rotation,
3422
+ flipHorizontal: node.transform.flipHorizontal,
3423
+ flipVertical: node.transform.flipVertical,
3424
+ digest: bytesToHex(content.digest),
3425
+ contentType: content.contentType,
3426
+ intrinsicWidth: content.intrinsicWidth,
3427
+ intrinsicHeight: content.intrinsicHeight
3428
+ });
3429
+ }
3430
+ function projectRichText(text) {
3431
+ return Object.freeze({
3432
+ verticalAlignment: text.verticalAlignment,
3433
+ paragraphs: Object.freeze(
3434
+ text.paragraphs.map(
3435
+ (paragraph) => Object.freeze({
3436
+ alignment: paragraph.alignment,
3437
+ runs: Object.freeze(
3438
+ paragraph.runs.map(
3439
+ (run) => Object.freeze({
3440
+ text: run.text,
3441
+ style: projectTextStyle(run.style, paragraph.alignment, text.verticalAlignment),
3442
+ language: run.style.language
3443
+ })
3444
+ )
3445
+ )
3446
+ })
3447
+ )
3448
+ )
3449
+ });
3450
+ }
3451
+ function projectTextStyle(style, alignment, verticalAlignment) {
3452
+ return Object.freeze({
3453
+ fontFamily: style.fontFamily,
3454
+ fontSize: style.fontSizeCentipoints / 100,
3455
+ color: rgbaCss(style.color),
3456
+ bold: style.bold,
3457
+ italic: style.italic,
3458
+ underline: style.underline,
3459
+ ...alignment ? { alignment } : {},
3460
+ ...verticalAlignment ? { verticalAlignment } : {}
3461
+ });
3462
+ }
3463
+ function firstTextStyle(text) {
3464
+ return text.paragraphs[0]?.runs[0]?.style;
3465
+ }
3466
+ function projectFill(fill) {
3467
+ return fill.kind === "none" ? "none" : Object.freeze({ type: "solid", color: rgbaCss(fill.color) });
3468
+ }
3469
+ function projectLine(line) {
3470
+ return Object.freeze({
3471
+ style: line.dash,
3472
+ fill: projectFill(line.fill),
3473
+ width: displayCoordinate(line.width)
3474
+ });
3475
+ }
3476
+ function projectPosition(bounds) {
3477
+ return Object.freeze({
3478
+ left: displayCoordinate(bounds.x),
3479
+ top: displayCoordinate(bounds.y),
3480
+ width: displayCoordinate(bounds.width),
3481
+ height: displayCoordinate(bounds.height)
3482
+ });
3483
+ }
3484
+ function displayCoordinate(value) {
3485
+ return value / EMU_PER_CSS_PIXEL;
3486
+ }
3487
+ function normalizeProjectedEditorPosition(position) {
3488
+ const clamp = (value) => Math.max(-1e6, Math.min(1e6, value));
3489
+ return {
3490
+ left: clamp(position.left),
3491
+ top: clamp(position.top),
3492
+ width: Math.min(1e6, Math.max(8, position.width)),
3493
+ height: Math.min(1e6, Math.max(8, position.height))
3494
+ };
3495
+ }
3496
+ function canonicalCoordinate(value) {
3497
+ if (!Number.isFinite(value)) throw new Error("Presentation coordinate must be finite");
3498
+ const canonical = Math.round(value * EMU_PER_CSS_PIXEL);
3499
+ if (!Number.isSafeInteger(canonical)) throw new Error("Presentation coordinate is out of range");
3500
+ return canonical;
3501
+ }
3502
+ function sameProjectedPosition(left, right) {
3503
+ return canonicalCoordinate(left.left) === canonicalCoordinate(right.left) && canonicalCoordinate(left.top) === canonicalCoordinate(right.top) && canonicalCoordinate(left.width) === canonicalCoordinate(right.width) && canonicalCoordinate(left.height) === canonicalCoordinate(right.height);
3504
+ }
3505
+ function projectShapeGeometry(geometry) {
3506
+ return {
3507
+ "text-box": "textbox",
3508
+ rectangle: "rect",
3509
+ "rounded-rectangle": "roundRect",
3510
+ ellipse: "ellipse",
3511
+ triangle: "triangle",
3512
+ "right-arrow": "rightArrow",
3513
+ line: "line"
3514
+ }[geometry];
3515
+ }
3516
+ function emptyPresentationText() {
3517
+ return Object.freeze({
3518
+ verticalAlignment: "middle",
3519
+ paragraphs: Object.freeze([
3520
+ Object.freeze({
3521
+ alignment: "left",
3522
+ runs: Object.freeze([Object.freeze({ text: "", style: DEFAULT_PRESENTATION_TEXT_STYLE })])
3523
+ })
3524
+ ])
3525
+ });
3526
+ }
3527
+ function flattenPresentationRichText(text) {
3528
+ return text.paragraphs.map((paragraph) => paragraph.runs.map((run) => run.text).join("")).join("\n");
3529
+ }
3530
+ function replacePresentationRichText(richText, before, after) {
3531
+ const canonicalBefore = flattenPresentationRichText(richText);
3532
+ if (canonicalBefore !== before) throw new Error("Presentation rich text does not match its edit");
3533
+ if (before === after) return richText;
3534
+ const diff = textReplacementRange(before, after);
3535
+ const spans = presentationStyleSpans(richText);
3536
+ const paragraphStarts = presentationParagraphStarts(richText);
3537
+ const insertionStyle = styleAtOffset(spans, diff.start) ?? DEFAULT_PRESENTATION_TEXT_STYLE;
3538
+ const insertionAlignment = alignmentAtOffset(richText, paragraphStarts, diff.start);
3539
+ const paragraphs = [];
3540
+ let newOffset = 0;
3541
+ for (const paragraphText of after.split("\n")) {
3542
+ const alignment = alignmentForNewOffset(
3543
+ richText,
3544
+ paragraphStarts,
3545
+ diff,
3546
+ newOffset,
3547
+ insertionAlignment
3548
+ );
3549
+ const runs = [];
3550
+ let localOffset = 0;
3551
+ for (const character of paragraphText) {
3552
+ const offset = newOffset + localOffset;
3553
+ const oldOffset = oldOffsetForNewOffset(diff, offset);
3554
+ const style = oldOffset === null ? insertionStyle : styleAtOffset(spans, oldOffset) ?? insertionStyle;
3555
+ const previous = runs.at(-1);
3556
+ if (previous && samePresentationTextStyle(previous.style, style)) previous.text += character;
3557
+ else runs.push({ text: character, style });
3558
+ localOffset += character.length;
3559
+ }
3560
+ paragraphs.push(
3561
+ Object.freeze({
3562
+ alignment,
3563
+ runs: Object.freeze(
3564
+ runs.map(
3565
+ (run) => Object.freeze({ text: run.text, style: Object.freeze({ ...run.style }) })
3566
+ )
3567
+ )
3568
+ })
3569
+ );
3570
+ newOffset += paragraphText.length + 1;
3571
+ }
3572
+ return Object.freeze({
3573
+ verticalAlignment: richText.verticalAlignment,
3574
+ paragraphs: Object.freeze(paragraphs)
3575
+ });
3576
+ }
3577
+ function textReplacementRange(before, after) {
3578
+ let start = 0;
3579
+ while (start < before.length && start < after.length && before.charCodeAt(start) === after.charCodeAt(start)) {
3580
+ start += 1;
3581
+ }
3582
+ while (start > 0 && (splitsSurrogate(before, start) || splitsSurrogate(after, start))) start -= 1;
3583
+ let suffix = 0;
3584
+ while (suffix < before.length - start && suffix < after.length - start && before.charCodeAt(before.length - suffix - 1) === after.charCodeAt(after.length - suffix - 1)) {
3585
+ suffix += 1;
3586
+ }
3587
+ while (suffix > 0 && (splitsSurrogate(before, before.length - suffix) || splitsSurrogate(after, after.length - suffix))) {
3588
+ suffix -= 1;
3589
+ }
3590
+ const oldEnd = before.length - suffix;
3591
+ const newEnd = after.length - suffix;
3592
+ return { start, oldEnd, newEnd, delta: oldEnd - newEnd };
3593
+ }
3594
+ function oldOffsetForNewOffset(diff, offset) {
3595
+ if (offset < diff.start) return offset;
3596
+ if (offset >= diff.newEnd) return offset + diff.delta;
3597
+ return null;
3598
+ }
3599
+ function presentationStyleSpans(text) {
3600
+ const spans = [];
3601
+ let offset = 0;
3602
+ text.paragraphs.forEach((paragraph, paragraphIndex) => {
3603
+ for (const run of paragraph.runs) {
3604
+ spans.push({ start: offset, end: offset + run.text.length, style: run.style });
3605
+ offset += run.text.length;
3606
+ }
3607
+ if (paragraphIndex < text.paragraphs.length - 1) offset += 1;
3608
+ });
3609
+ return spans;
3610
+ }
3611
+ function presentationParagraphStarts(text) {
3612
+ const starts = [];
3613
+ let offset = 0;
3614
+ text.paragraphs.forEach((paragraph, index) => {
3615
+ starts.push(offset);
3616
+ offset += paragraph.runs.reduce((sum, run) => sum + run.text.length, 0);
3617
+ if (index < text.paragraphs.length - 1) offset += 1;
3618
+ });
3619
+ return starts;
3620
+ }
3621
+ function styleAtOffset(spans, offset) {
3622
+ const containing = spans.find((span) => offset >= span.start && offset < span.end);
3623
+ if (containing) return containing.style;
3624
+ const before = [...spans].reverse().find((span) => span.end <= offset);
3625
+ return before?.style ?? spans[0]?.style ?? null;
3626
+ }
3627
+ function alignmentAtOffset(text, starts, offset) {
3628
+ let index = 0;
3629
+ while (index + 1 < starts.length && (starts[index + 1] ?? Number.POSITIVE_INFINITY) <= offset) {
3630
+ index += 1;
3631
+ }
3632
+ return text.paragraphs[index]?.alignment ?? "left";
3633
+ }
3634
+ function alignmentForNewOffset(text, starts, diff, newOffset, fallback) {
3635
+ const oldOffset = oldOffsetForNewOffset(diff, newOffset);
3636
+ return oldOffset === null ? fallback : alignmentAtOffset(text, starts, oldOffset);
3637
+ }
3638
+ function samePresentationTextStyle(left, right) {
3639
+ return left.fontFamily === right.fontFamily && left.fontSizeCentipoints === right.fontSizeCentipoints && left.color === right.color && left.bold === right.bold && left.italic === right.italic && left.underline === right.underline && left.language === right.language;
3640
+ }
3641
+ function splitsSurrogate(value, index) {
3642
+ if (index <= 0 || index >= value.length) return false;
3643
+ const left = value.charCodeAt(index - 1);
3644
+ const right = value.charCodeAt(index);
3645
+ return left >= 55296 && left <= 56319 && right >= 56320 && right <= 57343;
3646
+ }
3647
+ function rgbaCss(value) {
3648
+ const hex = (value >>> 0).toString(16).padStart(8, "0");
3649
+ return hex.endsWith("ff") ? `#${hex.slice(0, 6)}` : `#${hex}`;
3650
+ }
3651
+ function bytesToHex(value) {
3652
+ return [...value].map((byte) => byte.toString(16).padStart(2, "0")).join("");
3653
+ }
3654
+ function sceneNodeKey(slideId, nodeId) {
3655
+ return `${slideId}:${nodeId}`;
3656
+ }
3657
+ function isPresentationRevisionDrift(error) {
3658
+ return error.message.includes("changed while") || error.message.includes("revision drifted");
3659
+ }
3660
+ function notifyPresentationCommit(t, observer, onError, commit) {
3661
+ try {
3662
+ const result = observer?.(commit);
3663
+ if (result && typeof result.then === "function") {
3664
+ void Promise.resolve(result).catch(
3665
+ (cause) => onError?.(
3666
+ asEditableArtifactError(
3667
+ cause,
3668
+ t("artifacts.editablePresentation.presentationCommitObserverFailed")
3669
+ )
3670
+ )
3671
+ );
3672
+ }
3673
+ } catch (cause) {
3674
+ onError?.(
3675
+ asEditableArtifactError(
3676
+ cause,
3677
+ t("artifacts.editablePresentation.presentationCommitObserverFailed")
3678
+ )
3679
+ );
3680
+ }
3681
+ }
3682
+
3683
+ export {
3684
+ PresentationEditor,
3685
+ PresentationProjectionEditor,
3686
+ PresentationArtifactSurface,
3687
+ PresentationProjectionArtifactSurface,
3688
+ EditablePresentationArtifactSurface
3689
+ };
3690
+ //# sourceMappingURL=chunk-RH45HT5T.js.map