@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
@@ -1,3183 +0,0 @@
1
- "use client";
2
- import {
3
- PierreFile
4
- } from "./chunk-YGQANOSV.js";
5
- import {
6
- useUnicodeFallbackFonts
7
- } from "./chunk-ACXGUCJX.js";
8
- import {
9
- CodeEditor
10
- } from "./chunk-WRLEHV4A.js";
11
- import {
12
- useThemeType
13
- } from "./chunk-B27E3V37.js";
14
- import {
15
- sandboxAcceptsLiveIo
16
- } from "./chunk-QV3DJVRZ.js";
17
- import {
18
- prefersReducedMotion
19
- } from "./chunk-OCN4S7WN.js";
20
- import {
21
- MENU_BUTTON_CLASS,
22
- MENU_SEPARATOR_CLASS,
23
- MENU_SURFACE_CLASS
24
- } from "./chunk-PNNTR6KP.js";
25
- import {
26
- ModalLayer
27
- } from "./chunk-NGTCSS53.js";
28
- import {
29
- usePortalContainer
30
- } from "./chunk-UD6AAZSC.js";
31
- import {
32
- usePortalTokenSource,
33
- usePortalTokenStyle
34
- } from "./chunk-XEA5BCMA.js";
35
- import {
36
- cn
37
- } from "./chunk-TXS65BB2.js";
38
- import {
39
- useOpenGeni
40
- } from "./chunk-BVUAHAQX.js";
41
- import {
42
- createOpenGeniText,
43
- useOpenGeniText
44
- } from "./chunk-PVGD2RAV.js";
45
-
46
- // src/components/sandbox-files.tsx
47
- import { FileCode2Icon, FileWarningIcon, LoaderCircleIcon } from "lucide-react";
48
- import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
49
- import { Group, Panel, Separator } from "react-resizable-panels";
50
-
51
- // src/hooks/use-sandbox-files.ts
52
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
53
- var englishText = createOpenGeniText();
54
- var CapturedFileUnavailableError = class extends Error {
55
- constructor(path, reason, t = englishText) {
56
- super(
57
- reason === "too-large" ? t("hooks.useSandboxFiles.pathExceedsTheCapturedPreview", { path }) : reason === "content-missing" ? t("hooks.useSandboxFiles.pathIsNoLongerAvailable", { path }) : t("hooks.useSandboxFiles.pathWasNotChangedIn", { path })
58
- );
59
- this.path = path;
60
- this.reason = reason;
61
- this.name = "CapturedFileUnavailableError";
62
- }
63
- code = "captured_file_unavailable";
64
- };
65
- var FileWriteConflictError = class extends Error {
66
- constructor(path, expectedContent, liveContent, t = englishText) {
67
- super(t("hooks.useSandboxFiles.pathChangedOnTheMachine", { path }));
68
- this.path = path;
69
- this.expectedContent = expectedContent;
70
- this.liveContent = liveContent;
71
- this.name = "FileWriteConflictError";
72
- }
73
- code = "file_write_conflict";
74
- };
75
- function normalizeRoot(root) {
76
- const slashNormalized = root.replaceAll("\\", "/").replace(/^\.\/+/, "");
77
- if (slashNormalized === "/") return "/";
78
- const normalized = slashNormalized.replace(/\/+$/, "");
79
- return normalized === "." ? "" : normalized;
80
- }
81
- function isAbsoluteTreePath(path) {
82
- return path.startsWith("/") || /^[A-Za-z]:\//u.test(path);
83
- }
84
- function joinTreeRoot(root, path) {
85
- if (!root || isAbsoluteTreePath(path)) return path;
86
- return root === "/" ? `/${path}` : `${root}/${path}`;
87
- }
88
- function qualifyStatusPath(root, path, treeRoot) {
89
- const normalized = normalizeRoot(root);
90
- const workspaceRelative = joinTreeRoot(normalized, path);
91
- return joinTreeRoot(normalizeRoot(treeRoot), workspaceRelative);
92
- }
93
- function summarizeStatuses(statuses) {
94
- const repositories = statuses.filter(({ status }) => status.isRepo);
95
- return {
96
- branch: repositories.length === 1 ? repositories[0]?.status.head ?? null : null,
97
- isRepo: repositories.length > 0,
98
- repoCount: repositories.length,
99
- ahead: repositories.reduce((sum, { status }) => sum + status.ahead, 0),
100
- behind: repositories.reduce((sum, { status }) => sum + status.behind, 0),
101
- dirtyCount: repositories.reduce((sum, { status }) => sum + status.files.length, 0)
102
- };
103
- }
104
- function parentOf(path) {
105
- const i = path.lastIndexOf("/");
106
- return i <= 0 ? "" : path.slice(0, i);
107
- }
108
- function parentWithinTree(path, rootPath) {
109
- const parent = parentOf(path);
110
- return parent === "" && normalizeRoot(rootPath) === "/" && path.startsWith("/") ? "/" : parent;
111
- }
112
- function leafOf(path) {
113
- const i = path.lastIndexOf("/");
114
- return i < 0 ? path : path.slice(i + 1);
115
- }
116
- function sortNodes(nodes) {
117
- return [...nodes].sort((a, b) => {
118
- if (a.kind !== b.kind) return a.kind === "dir" ? -1 : 1;
119
- return a.name.localeCompare(b.name, void 0, { sensitivity: "base" });
120
- });
121
- }
122
- function fsNodeToTree(node, captureComplete = false) {
123
- const kind = node.type === "dir" ? "dir" : "file";
124
- const mappedChildren = node.children && node.children.length > 0 ? node.children.map((child) => fsNodeToTree(child, captureComplete)) : captureComplete && kind === "dir" ? [] : void 0;
125
- return {
126
- path: node.path,
127
- name: node.name,
128
- kind,
129
- size: node.sizeBytes,
130
- ...kind === "dir" ? { children: mappedChildren } : {},
131
- // A collapsed residue dir from the capture index — carried through so the
132
- // tree can show an inline "contents on machine" row cold instead of nothing.
133
- ...kind === "dir" && node.truncated ? { truncated: true } : {}
134
- };
135
- }
136
- var GIT_STATUS_TO_TREE = {
137
- added: "added",
138
- modified: "modified",
139
- deleted: "deleted",
140
- renamed: "renamed",
141
- copied: "added",
142
- untracked: "untracked",
143
- typechange: "modified"
144
- };
145
- function replaceChildren(nodes, targetPath, children) {
146
- return nodes.map((node) => {
147
- if (node.path === targetPath) {
148
- return { ...node, children };
149
- }
150
- if (node.kind === "dir" && node.children && targetPath.startsWith(`${node.path}/`)) {
151
- return {
152
- ...node,
153
- children: replaceChildren(node.children, targetPath, children)
154
- };
155
- }
156
- return node;
157
- });
158
- }
159
- function findNodeByPath(nodes, path) {
160
- for (const node of nodes) {
161
- if (node.path === path) return node;
162
- if (node.kind === "dir" && node.children && path.startsWith(`${node.path}/`)) {
163
- const hit = findNodeByPath(node.children, path);
164
- if (hit) return hit;
165
- }
166
- }
167
- return void 0;
168
- }
169
- var FS_LIST_BATCH_REQUEST_LIMIT = 16;
170
- function initialDirectoryFrontier(rootPath, repoPaths) {
171
- const root = normalizeRoot(rootPath);
172
- const rootParts = root.split("/").filter(Boolean);
173
- const rootPrefix = root.startsWith("//") ? "//" : root.startsWith("/") ? "/" : "";
174
- const paths = /* @__PURE__ */ new Set();
175
- for (const repoPath of repoPaths) {
176
- const canonicalRepoPath = joinTreeRoot(root, normalizeRoot(repoPath));
177
- const parts = canonicalRepoPath.split("/").filter(Boolean);
178
- if (rootParts.some((part, index) => parts[index] !== part)) continue;
179
- for (let depth = rootParts.length + 1; depth <= parts.length; depth += 1) {
180
- const path = parts.slice(0, depth).join("/");
181
- paths.add(`${rootPrefix}${path}`);
182
- }
183
- }
184
- return [...paths].sort((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b)).slice(0, 8);
185
- }
186
- function parentIsLoaded(nodes, parent, rootPath = "") {
187
- if (parent === normalizeRoot(rootPath)) return true;
188
- const node = findNodeByPath(nodes, parent);
189
- return Boolean(node && node.kind === "dir" && node.children !== void 0);
190
- }
191
- function insertNode(nodes, parent, child, rootPath = "") {
192
- if (parent === normalizeRoot(rootPath)) {
193
- if (nodes.some((n) => n.path === child.path)) return nodes;
194
- return sortNodes([...nodes, child]);
195
- }
196
- return nodes.map((node) => {
197
- if (node.path === parent) {
198
- if (node.kind !== "dir" || node.children === void 0) return node;
199
- if (node.children.some((n) => n.path === child.path)) return node;
200
- return { ...node, children: sortNodes([...node.children, child]) };
201
- }
202
- if (node.kind === "dir" && node.children && parent.startsWith(`${node.path}/`)) {
203
- return { ...node, children: insertNode(node.children, parent, child, rootPath) };
204
- }
205
- return node;
206
- });
207
- }
208
- function removeNode(nodes, path, rootPath = "") {
209
- const parent = parentWithinTree(path, rootPath);
210
- if (parent === normalizeRoot(rootPath)) {
211
- if (!nodes.some((n) => n.path === path)) return nodes;
212
- return nodes.filter((n) => n.path !== path);
213
- }
214
- return nodes.map((node) => {
215
- if (node.path === parent) {
216
- if (node.kind !== "dir" || node.children === void 0) return node;
217
- return {
218
- ...node,
219
- children: node.children.filter((n) => n.path !== path)
220
- };
221
- }
222
- if (node.kind === "dir" && node.children && parent.startsWith(`${node.path}/`)) {
223
- return { ...node, children: removeNode(node.children, path, rootPath) };
224
- }
225
- return node;
226
- });
227
- }
228
- function sameNodeShallow(a, b) {
229
- return a.path === b.path && a.kind === b.kind && a.name === b.name && (a.size ?? null) === (b.size ?? null) && (a.status ?? void 0) === (b.status ?? void 0) && (a.truncated ?? false) === (b.truncated ?? false);
230
- }
231
- function mergeChildren(current, listed) {
232
- const byPath = new Map(current.map((n) => [n.path, n]));
233
- const merged = listed.map((next) => {
234
- const existing = byPath.get(next.path);
235
- if (!existing) return next;
236
- if (existing.kind === "dir" && next.kind === "dir" && existing.children !== void 0) {
237
- const candidate = { ...next, children: existing.children };
238
- return sameNodeShallow(existing, candidate) ? existing : candidate;
239
- }
240
- if (existing.children === next.children && sameNodeShallow(existing, next)) {
241
- return existing;
242
- }
243
- return next;
244
- });
245
- return sortNodes(merged);
246
- }
247
- function mergeRootChildren(nodes, listed) {
248
- return mergeChildren(nodes, listed);
249
- }
250
- function repathNode(node, fromPrefix, toPrefix) {
251
- const newPath = toPrefix + node.path.slice(fromPrefix.length);
252
- const next = { ...node, path: newPath, name: leafOf(newPath) };
253
- if (node.children) next.children = node.children.map((c) => repathNode(c, fromPrefix, toPrefix));
254
- return next;
255
- }
256
- function decodeBase64Bytes(value) {
257
- const binary = atob(value);
258
- const bytes = new Uint8Array(binary.length);
259
- for (let index = 0; index < binary.length; index += 1) {
260
- bytes[index] = binary.charCodeAt(index);
261
- }
262
- return bytes;
263
- }
264
- function decodeBase64Text(value) {
265
- return new TextDecoder().decode(decodeBase64Bytes(value));
266
- }
267
- function encodeBase64Bytes(bytes) {
268
- let binary = "";
269
- const chunkSize = 32768;
270
- for (let offset = 0; offset < bytes.length; offset += chunkSize) {
271
- binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));
272
- }
273
- return btoa(binary);
274
- }
275
- async function assertCapturedHash(bytes, expected) {
276
- if (!expected) throw new Error("Captured file is missing its integrity hash.");
277
- if (!globalThis.crypto?.subtle) {
278
- throw new Error("Captured file integrity verification is unavailable in this browser.");
279
- }
280
- const buffer = new ArrayBuffer(bytes.byteLength);
281
- new Uint8Array(buffer).set(bytes);
282
- const digest = new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256", buffer));
283
- const actual = [...digest].map((byte) => byte.toString(16).padStart(2, "0")).join("");
284
- if (actual !== expected) throw new Error("Captured file content failed its integrity check.");
285
- }
286
- function useSandboxFiles(sessionId, options = {}) {
287
- const t = useOpenGeniText();
288
- const { client, workspaceId } = useOpenGeni(options);
289
- const enabled = (options.enabled ?? true) && Boolean(sessionId);
290
- const active = options.active ?? true;
291
- const rootPath = options.rootPath ?? "";
292
- const routeEpoch = options.route?.epoch ?? null;
293
- const routeRoot = options.route?.root ?? null;
294
- const route = useMemo(
295
- () => routeEpoch !== null && routeRoot !== null ? { epoch: routeEpoch, root: routeRoot } : void 0,
296
- [routeEpoch, routeRoot]
297
- );
298
- const repoPathsKey = [
299
- ...new Set((options.repoPaths?.length ? options.repoPaths : [rootPath]).map(normalizeRoot))
300
- ].join("\0");
301
- const repoPaths = useMemo(() => repoPathsKey.split("\0"), [repoPathsKey]);
302
- const capture = options.capture ?? null;
303
- const isLive = sandboxAcceptsLiveIo(options.liveness);
304
- const acceptsEventReads = options.liveness === void 0 || isLive;
305
- const acceptsEventReadsRef = useRef(acceptsEventReads);
306
- acceptsEventReadsRef.current = acceptsEventReads;
307
- const hasLiveIoFence = options.liveness !== void 0;
308
- const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${rootPath}\0${repoPathsKey}\0${routeEpoch ?? ""}\0${routeRoot ?? ""}`;
309
- const [tree, setTree] = useState([]);
310
- const treeRef = useRef([]);
311
- const [loading, setLoading] = useState(false);
312
- const [expandingPaths, setExpandingPaths] = useState(/* @__PURE__ */ new Set());
313
- const [error, setError] = useState(null);
314
- const [gitSummary, setGitSummary] = useState(null);
315
- const [gitLoading, setGitLoading] = useState(false);
316
- const [contentRevision, setContentRevision] = useState(0);
317
- const [stateIdentity, setStateIdentity] = useState(identityKey);
318
- const [source, setSource] = useState(null);
319
- const sourceRef = useRef(null);
320
- const statusRef = useRef(/* @__PURE__ */ new Map());
321
- const refreshGenerationRef = useRef(0);
322
- const refreshAbortRef = useRef(null);
323
- const identityAbortRef = useRef(new AbortController());
324
- const eventReadAbortRef = useRef(new AbortController());
325
- const identityGenerationRef = useRef(0);
326
- const lastSeqRef = useRef(0);
327
- const pendingParentsRef = useRef(/* @__PURE__ */ new Set());
328
- const pendingGitRef = useRef(false);
329
- const eventReconcileInFlightRef = useRef(null);
330
- const eventReconcilePendingRef = useRef(false);
331
- const debounceRef = useRef(null);
332
- const ownRevisionsRef = useRef(/* @__PURE__ */ new Set());
333
- const onMutationErrorRef = useRef(options.onMutationError);
334
- onMutationErrorRef.current = options.onMutationError;
335
- treeRef.current = tree;
336
- const applyStatus = useCallback((nodes) => {
337
- const overlay = statusRef.current;
338
- const walk = (list) => {
339
- let changed = false;
340
- const out = list.map((node) => {
341
- const nextChildren = node.children ? walk(node.children) : node.children;
342
- const wantStatus = node.kind === "file" ? overlay.get(node.path) : void 0;
343
- const childrenChanged = nextChildren !== node.children;
344
- const statusChanged = (node.status ?? void 0) !== (wantStatus ?? void 0);
345
- if (!childrenChanged && !statusChanged) return node;
346
- changed = true;
347
- const next = {
348
- ...node,
349
- ...node.children ? { children: nextChildren } : {}
350
- };
351
- if (wantStatus) next.status = wantStatus;
352
- else delete next.status;
353
- return next;
354
- });
355
- return changed ? out : list;
356
- };
357
- return walk(nodes);
358
- }, []);
359
- const refresh = useCallback(async () => {
360
- if (!sessionId) return;
361
- refreshAbortRef.current?.abort();
362
- const refreshAbort = new AbortController();
363
- refreshAbortRef.current = refreshAbort;
364
- const generation = refreshGenerationRef.current += 1;
365
- setLoading(true);
366
- setGitLoading(true);
367
- setError(null);
368
- try {
369
- const frontierPaths = initialDirectoryFrontier(rootPath, repoPaths);
370
- const listRequests = [rootPath, ...frontierPaths].map((path) => ({
371
- path,
372
- depth: 1,
373
- ...route ? { route } : {}
374
- }));
375
- const listedBatch = await client.fsListBatch(
376
- workspaceId,
377
- sessionId,
378
- { requests: listRequests },
379
- { signal: refreshAbort.signal }
380
- );
381
- if (refreshGenerationRef.current !== generation) return;
382
- const listed = listedBatch.results[0];
383
- if (!listed) throw new Error("Workspace list batch did not return the root result.");
384
- const children = (listed.root.children ?? []).map((node) => fsNodeToTree(node));
385
- setTree((prev) => {
386
- let hydrated = prev.length === 0 ? children : mergeRootChildren(prev, children);
387
- for (const [index, path] of frontierPaths.entries()) {
388
- const prefetched = listedBatch.results[index + 1];
389
- if (!prefetched) continue;
390
- hydrated = replaceChildren(
391
- hydrated,
392
- path,
393
- (prefetched.root.children ?? []).map((node) => fsNodeToTree(node))
394
- );
395
- }
396
- return applyStatus(hydrated);
397
- });
398
- sourceRef.current = "live";
399
- setSource("live");
400
- setLoading(false);
401
- const statuses = repoPaths.length > 0 ? await client.gitReadBatch(
402
- workspaceId,
403
- sessionId,
404
- {
405
- requests: repoPaths.map((root) => ({
406
- status: { path: root }
407
- }))
408
- },
409
- { signal: refreshAbort.signal }
410
- ).then(
411
- (batch) => batch.results.map((result, index) => ({
412
- root: repoPaths[index] ?? "",
413
- status: result.status
414
- }))
415
- ).catch(() => null) : [];
416
- if (refreshGenerationRef.current !== generation) return;
417
- if (statuses) {
418
- const overlay = /* @__PURE__ */ new Map();
419
- for (const { root, status } of statuses) {
420
- for (const file of status.files) {
421
- const code = file.worktree ?? file.index;
422
- const mapped = code ? GIT_STATUS_TO_TREE[code] : void 0;
423
- if (mapped) overlay.set(qualifyStatusPath(root, file.path, rootPath), mapped);
424
- }
425
- }
426
- statusRef.current = overlay;
427
- setGitSummary(summarizeStatuses(statuses));
428
- } else {
429
- statusRef.current = /* @__PURE__ */ new Map();
430
- setGitSummary(null);
431
- }
432
- setGitLoading(false);
433
- setTree((prev) => applyStatus(prev));
434
- } catch (cause) {
435
- if (refreshGenerationRef.current !== generation) return;
436
- setError(cause instanceof Error ? cause : new Error(String(cause)));
437
- } finally {
438
- if (refreshGenerationRef.current === generation) setLoading(false);
439
- if (refreshGenerationRef.current === generation) setGitLoading(false);
440
- if (refreshAbortRef.current === refreshAbort) refreshAbortRef.current = null;
441
- }
442
- }, [client, workspaceId, sessionId, rootPath, repoPaths, route, applyStatus]);
443
- const seedFromCapture = useCallback(
444
- (manifest) => {
445
- const overlay = /* @__PURE__ */ new Map();
446
- for (const file of manifest.files) {
447
- if (file.deleted) continue;
448
- const mapped = GIT_STATUS_TO_TREE[file.status];
449
- if (mapped) overlay.set(file.path, mapped);
450
- }
451
- statusRef.current = overlay;
452
- const children = (manifest.treeIndex.children ?? []).map((node) => fsNodeToTree(node, true));
453
- setTree(
454
- (prev) => applyStatus(prev.length === 0 ? children : mergeRootChildren(prev, children))
455
- );
456
- sourceRef.current = "capture";
457
- setSource("capture");
458
- setGitSummary({
459
- branch: manifest.repos.length === 1 ? manifest.repos[0]?.head ?? null : null,
460
- isRepo: manifest.repos.length > 0,
461
- repoCount: manifest.repos.length,
462
- ahead: manifest.repos.reduce((sum, repo) => sum + repo.ahead, 0),
463
- behind: manifest.repos.reduce((sum, repo) => sum + repo.behind, 0),
464
- dirtyCount: manifest.files.length
465
- });
466
- setGitLoading(false);
467
- setError(null);
468
- },
469
- [applyStatus]
470
- );
471
- const expand = useCallback(
472
- async (path) => {
473
- if (!sessionId) return;
474
- if (source === "capture" && capture) return;
475
- const identityGeneration = identityGenerationRef.current;
476
- const identitySignal = identityAbortRef.current.signal;
477
- setExpandingPaths((prev) => {
478
- const next = new Set(prev);
479
- next.add(path);
480
- return next;
481
- });
482
- try {
483
- const listed = await client.fsList(
484
- workspaceId,
485
- sessionId,
486
- { path, depth: 1, ...route ? { route } : {} },
487
- { signal: identitySignal }
488
- );
489
- if (identityGenerationRef.current !== identityGeneration) return;
490
- const children = (listed.root.children ?? []).map((node) => fsNodeToTree(node));
491
- setTree((prev) => applyStatus(replaceChildren(prev, path, children)));
492
- } catch (cause) {
493
- if (identityGenerationRef.current !== identityGeneration) return;
494
- setError(cause instanceof Error ? cause : new Error(String(cause)));
495
- } finally {
496
- if (identityGenerationRef.current === identityGeneration) {
497
- setExpandingPaths((prev) => {
498
- if (!prev.has(path)) return prev;
499
- const next = new Set(prev);
500
- next.delete(path);
501
- return next;
502
- });
503
- }
504
- }
505
- },
506
- [client, workspaceId, sessionId, capture, source, route, applyStatus]
507
- );
508
- const readFile = useCallback(
509
- async (path, requestOptions = {}) => {
510
- if (!sessionId) throw new Error("no session");
511
- const identitySignal = identityAbortRef.current.signal;
512
- const signal = requestOptions.signal ? AbortSignal.any([identitySignal, requestOptions.signal]) : identitySignal;
513
- const captured = capture?.files.find((file) => file.path === path && !file.deleted);
514
- if (source === "capture" && capture) {
515
- if (!captured) {
516
- throw new CapturedFileUnavailableError(path, "not-captured", t);
517
- }
518
- for (let attempt = 0; attempt < 2; attempt += 1) {
519
- const result = await client.getWorkspaceCaptureFile(
520
- workspaceId,
521
- sessionId,
522
- path,
523
- capture.revision,
524
- { signal }
525
- );
526
- if (result.path !== path || result.revision !== capture.revision) {
527
- throw new Error(
528
- "Captured file identity did not match the requested workspace revision."
529
- );
530
- }
531
- if (result.hash !== captured.hash || result.sizeBytes !== captured.sizeBytes || result.isBinary !== captured.isBinary || result.tooLarge !== captured.tooLarge) {
532
- throw new Error("Captured file metadata did not match its manifest.");
533
- }
534
- if (result.tooLarge) {
535
- throw new CapturedFileUnavailableError(path, "too-large", t);
536
- }
537
- let bytes;
538
- let encoding;
539
- let content;
540
- if (result.content !== null && result.encoding !== null) {
541
- encoding = result.encoding;
542
- content = result.content;
543
- bytes = encoding === "base64" ? decodeBase64Bytes(content) : new TextEncoder().encode(content);
544
- } else if (result.contentUrl) {
545
- const response = await fetch(result.contentUrl.url, {
546
- credentials: "omit",
547
- cache: "no-store",
548
- referrerPolicy: "no-referrer",
549
- signal: AbortSignal.any([signal, AbortSignal.timeout(3e4)])
550
- }).catch(() => null);
551
- if (!response?.ok) {
552
- if (attempt === 0 && (response === null || response.status === 401 || response.status === 403)) {
553
- continue;
554
- }
555
- throw new Error("Captured file download failed.");
556
- }
557
- bytes = new Uint8Array(await response.arrayBuffer());
558
- encoding = result.isBinary ? "base64" : "utf8";
559
- content = result.isBinary ? encodeBase64Bytes(bytes) : new TextDecoder().decode(bytes);
560
- } else {
561
- throw new CapturedFileUnavailableError(path, "content-missing", t);
562
- }
563
- if (bytes.byteLength !== result.sizeBytes) {
564
- throw new Error("Captured file size did not match its manifest.");
565
- }
566
- await assertCapturedHash(bytes, result.hash);
567
- return {
568
- path,
569
- encoding,
570
- content,
571
- sizeBytes: result.sizeBytes,
572
- truncated: false,
573
- isBinary: result.isBinary,
574
- revision: result.revision
575
- };
576
- }
577
- throw new Error("Captured file download failed after refreshing its URL.");
578
- }
579
- return await client.fsRead(
580
- workspaceId,
581
- sessionId,
582
- { path, ...route ? { route } : {} },
583
- { signal }
584
- );
585
- },
586
- [client, workspaceId, sessionId, capture, source, route, t]
587
- );
588
- const reconcilePath = useCallback(
589
- async (path, requestSignal) => {
590
- if (!sessionId) return;
591
- const identityGeneration = identityGenerationRef.current;
592
- const identitySignal = identityAbortRef.current.signal;
593
- const signal = requestSignal ? AbortSignal.any([identitySignal, requestSignal]) : identitySignal;
594
- if (!parentIsLoaded(treeRef.current, path, rootPath)) return;
595
- try {
596
- const listed = await client.fsList(
597
- workspaceId,
598
- sessionId,
599
- { path, depth: 1, ...route ? { route } : {} },
600
- { signal }
601
- );
602
- if (identityGenerationRef.current !== identityGeneration) return;
603
- const children = (listed.root.children ?? []).map((node) => fsNodeToTree(node));
604
- if (path === normalizeRoot(rootPath)) {
605
- setTree((prev) => applyStatus(mergeRootChildren(prev, children)));
606
- } else
607
- setTree((prev) => {
608
- const existing = findNodeByPath(prev, path);
609
- const merged = existing?.children ? mergeChildren(existing.children, children) : children;
610
- return applyStatus(replaceChildren(prev, path, merged));
611
- });
612
- } catch {
613
- }
614
- },
615
- [client, workspaceId, sessionId, rootPath, route, applyStatus]
616
- );
617
- const reconcilePaths = useCallback(
618
- async (requestedPaths, requestSignal) => {
619
- if (!sessionId) return;
620
- const identityGeneration = identityGenerationRef.current;
621
- const identitySignal = identityAbortRef.current.signal;
622
- const signal = requestSignal ? AbortSignal.any([identitySignal, requestSignal]) : identitySignal;
623
- const paths = [...new Set(requestedPaths)].filter(
624
- (path) => parentIsLoaded(treeRef.current, path, rootPath)
625
- );
626
- for (let offset = 0; offset < paths.length; offset += FS_LIST_BATCH_REQUEST_LIMIT) {
627
- const chunk = paths.slice(offset, offset + FS_LIST_BATCH_REQUEST_LIMIT);
628
- try {
629
- const listed = await client.fsListBatch(
630
- workspaceId,
631
- sessionId,
632
- {
633
- requests: chunk.map((path) => ({
634
- path,
635
- depth: 1,
636
- ...route ? { route } : {}
637
- }))
638
- },
639
- { signal }
640
- );
641
- if (identityGenerationRef.current !== identityGeneration) return;
642
- setTree((previous) => {
643
- let next = previous;
644
- for (const [index, path] of chunk.entries()) {
645
- const result = listed.results[index];
646
- if (!result) continue;
647
- const children = (result.root.children ?? []).map((node) => fsNodeToTree(node));
648
- if (path === normalizeRoot(rootPath)) {
649
- next = mergeRootChildren(next, children);
650
- } else {
651
- const existing = findNodeByPath(next, path);
652
- const merged = existing?.children ? mergeChildren(existing.children, children) : children;
653
- next = replaceChildren(next, path, merged);
654
- }
655
- }
656
- return applyStatus(next);
657
- });
658
- } catch {
659
- }
660
- }
661
- },
662
- [client, workspaceId, sessionId, rootPath, route, applyStatus]
663
- );
664
- const runOptimistic = useCallback(
665
- async (opName, apply, op, reconcileParents) => {
666
- const identityGeneration = identityGenerationRef.current;
667
- const snapshot = treeRef.current;
668
- setError(null);
669
- setTree(applyStatus(apply(snapshot)));
670
- try {
671
- const res = await op();
672
- if (identityGenerationRef.current !== identityGeneration) return res;
673
- if (res && typeof res === "object" && "revision" in res) {
674
- const rev = res.revision;
675
- if (typeof rev === "number") ownRevisionsRef.current.add(rev);
676
- }
677
- for (const parent of reconcileParents) {
678
- if (identityGenerationRef.current !== identityGeneration) return res;
679
- await reconcilePath(parent);
680
- }
681
- return res;
682
- } catch (cause) {
683
- const err = cause instanceof Error ? cause : new Error(String(cause));
684
- if (identityGenerationRef.current !== identityGeneration) throw err;
685
- setTree(applyStatus(snapshot));
686
- if (err instanceof FileWriteConflictError) throw err;
687
- setError(err);
688
- onMutationErrorRef.current?.(err, opName);
689
- throw err;
690
- }
691
- },
692
- [applyStatus, reconcilePath]
693
- );
694
- const writeFile = useCallback(
695
- async (path, content, writeOptions = {}) => {
696
- if (!sessionId) throw new Error("no session");
697
- const identityGeneration = identityGenerationRef.current;
698
- const identitySignal = identityAbortRef.current.signal;
699
- const parent = parentWithinTree(path, rootPath);
700
- const exists = Boolean(findNodeByPath(tree, path));
701
- const node = {
702
- path,
703
- name: leafOf(path),
704
- kind: "file",
705
- size: content.length
706
- };
707
- return await runOptimistic(
708
- "write",
709
- (nodes) => exists ? nodes : insertNode(nodes, parent, node, rootPath),
710
- async () => {
711
- if (!writeOptions.force && writeOptions.expectedContent !== void 0) {
712
- const live = await client.fsRead(
713
- workspaceId,
714
- sessionId,
715
- { path, ...route ? { route } : {} },
716
- { signal: identitySignal }
717
- );
718
- if (identityGenerationRef.current !== identityGeneration) {
719
- throw new Error(t("hooks.useSandboxFiles.fileSaveCancelledBecauseThe"));
720
- }
721
- const liveContent = live.encoding === "base64" ? decodeBase64Text(live.content) : live.content;
722
- if (live.truncated || live.isBinary || liveContent !== writeOptions.expectedContent) {
723
- throw new FileWriteConflictError(path, writeOptions.expectedContent, liveContent, t);
724
- }
725
- }
726
- if (identityGenerationRef.current !== identityGeneration) {
727
- throw new Error(t("hooks.useSandboxFiles.fileSaveCancelledBecauseThe"));
728
- }
729
- return await client.fsWrite(workspaceId, sessionId, {
730
- path,
731
- content,
732
- overwrite: true,
733
- ...route ? { route } : {}
734
- });
735
- },
736
- exists ? [] : [parent]
737
- );
738
- },
739
- [client, workspaceId, sessionId, tree, rootPath, route, runOptimistic, t]
740
- );
741
- const createFile = useCallback(
742
- async (path) => {
743
- if (!sessionId) throw new Error("no session");
744
- const parent = parentWithinTree(path, rootPath);
745
- const node = {
746
- path,
747
- name: leafOf(path),
748
- kind: "file",
749
- size: 0
750
- };
751
- await runOptimistic(
752
- t("hooks.useSandboxFiles.createFile"),
753
- (nodes) => insertNode(nodes, parent, node, rootPath),
754
- () => client.fsWrite(workspaceId, sessionId, {
755
- path,
756
- content: "",
757
- overwrite: false,
758
- ...route ? { route } : {}
759
- }),
760
- [parent]
761
- );
762
- },
763
- [client, workspaceId, sessionId, rootPath, route, runOptimistic, t]
764
- );
765
- const createDir = useCallback(
766
- async (path) => {
767
- if (!sessionId) throw new Error("no session");
768
- const parent = parentWithinTree(path, rootPath);
769
- const node = {
770
- path,
771
- name: leafOf(path),
772
- kind: "dir",
773
- children: []
774
- };
775
- await runOptimistic(
776
- t("hooks.useSandboxFiles.createFolder"),
777
- (nodes) => insertNode(nodes, parent, node, rootPath),
778
- () => client.fsMkdir(workspaceId, sessionId, {
779
- path,
780
- recursive: true,
781
- ...route ? { route } : {}
782
- }),
783
- [parent]
784
- );
785
- },
786
- [client, workspaceId, sessionId, rootPath, route, runOptimistic, t]
787
- );
788
- const deleteEntry = useCallback(
789
- async (path, recursive = false) => {
790
- if (!sessionId) throw new Error("no session");
791
- await runOptimistic(
792
- "delete",
793
- (nodes) => removeNode(nodes, path, rootPath),
794
- () => client.fsDelete(workspaceId, sessionId, {
795
- path,
796
- recursive,
797
- ...route ? { route } : {}
798
- }),
799
- [parentWithinTree(path, rootPath)]
800
- );
801
- },
802
- [client, workspaceId, sessionId, rootPath, route, runOptimistic]
803
- );
804
- const moveEntry = useCallback(
805
- async (path, newPath, opts) => {
806
- if (!sessionId) throw new Error("no session");
807
- const from = parentWithinTree(path, rootPath);
808
- const to = parentWithinTree(newPath, rootPath);
809
- await runOptimistic(
810
- "move",
811
- (nodes) => {
812
- const moving = findNodeByPath(nodes, path);
813
- if (!moving) return nodes;
814
- const moved = repathNode(moving, path, newPath);
815
- return insertNode(removeNode(nodes, path, rootPath), to, moved, rootPath);
816
- },
817
- () => client.fsMove(workspaceId, sessionId, {
818
- path,
819
- newPath,
820
- overwrite: opts?.overwrite ?? false,
821
- ...route ? { route } : {}
822
- }),
823
- to === from ? [from] : [from, to]
824
- );
825
- },
826
- [client, workspaceId, sessionId, rootPath, route, runOptimistic]
827
- );
828
- const captureRef = useRef(capture);
829
- captureRef.current = capture;
830
- const captureRevision = capture?.revision ?? null;
831
- const previousIdentityRef = useRef(identityKey);
832
- useEffect(() => {
833
- refreshAbortRef.current?.abort();
834
- refreshAbortRef.current = null;
835
- refreshGenerationRef.current += 1;
836
- eventReadAbortRef.current.abort();
837
- eventReadAbortRef.current = new AbortController();
838
- const identityChanged = previousIdentityRef.current !== identityKey;
839
- previousIdentityRef.current = identityKey;
840
- if (identityChanged || !enabled) {
841
- if (identityChanged) eventReconcileInFlightRef.current = null;
842
- identityAbortRef.current.abort();
843
- identityAbortRef.current = new AbortController();
844
- identityGenerationRef.current += 1;
845
- lastSeqRef.current = 0;
846
- pendingParentsRef.current = /* @__PURE__ */ new Set();
847
- pendingGitRef.current = false;
848
- eventReconcilePendingRef.current = false;
849
- if (debounceRef.current) {
850
- clearTimeout(debounceRef.current);
851
- debounceRef.current = null;
852
- }
853
- ownRevisionsRef.current = /* @__PURE__ */ new Set();
854
- statusRef.current = /* @__PURE__ */ new Map();
855
- treeRef.current = [];
856
- setTree([]);
857
- setStateIdentity(identityKey);
858
- setExpandingPaths(/* @__PURE__ */ new Set());
859
- sourceRef.current = null;
860
- setSource(null);
861
- setLoading(false);
862
- setError(null);
863
- setGitSummary(null);
864
- setGitLoading(false);
865
- setContentRevision(0);
866
- }
867
- if (!enabled) {
868
- return;
869
- }
870
- const currentCapture = captureRevision !== null ? captureRef.current : null;
871
- if (currentCapture && (identityChanged || !isLive || sourceRef.current !== "live")) {
872
- seedFromCapture(currentCapture);
873
- }
874
- if (!active) {
875
- if (!active) {
876
- setLoading(false);
877
- setGitLoading(false);
878
- }
879
- return;
880
- }
881
- if (isLive || !hasLiveIoFence && !currentCapture) {
882
- void refresh();
883
- }
884
- return () => {
885
- refreshAbortRef.current?.abort();
886
- refreshAbortRef.current = null;
887
- refreshGenerationRef.current += 1;
888
- eventReadAbortRef.current.abort();
889
- eventReconcilePendingRef.current = false;
890
- };
891
- }, [
892
- enabled,
893
- active,
894
- isLive,
895
- hasLiveIoFence,
896
- captureRevision,
897
- identityKey,
898
- refresh,
899
- seedFromCapture
900
- ]);
901
- const refreshGitOverlay = useCallback(
902
- async (requestSignal) => {
903
- if (!sessionId) return;
904
- const identityGeneration = identityGenerationRef.current;
905
- const identitySignal = identityAbortRef.current.signal;
906
- const signal = requestSignal ? AbortSignal.any([identitySignal, requestSignal]) : identitySignal;
907
- setGitLoading(true);
908
- try {
909
- const batch = await client.gitReadBatch(
910
- workspaceId,
911
- sessionId,
912
- { requests: repoPaths.map((root) => ({ status: { path: root } })) },
913
- { signal }
914
- );
915
- const statuses = batch.results.map((result, index) => ({
916
- root: repoPaths[index] ?? "",
917
- status: result.status
918
- }));
919
- if (identityGenerationRef.current !== identityGeneration) return;
920
- const overlay = /* @__PURE__ */ new Map();
921
- for (const { root, status } of statuses) {
922
- for (const file of status.files) {
923
- const code = file.worktree ?? file.index;
924
- const mapped = code ? GIT_STATUS_TO_TREE[code] : void 0;
925
- if (mapped) overlay.set(qualifyStatusPath(root, file.path, rootPath), mapped);
926
- }
927
- }
928
- statusRef.current = overlay;
929
- setGitSummary(summarizeStatuses(statuses));
930
- setTree((prev) => applyStatus(prev));
931
- } catch {
932
- } finally {
933
- if (identityGenerationRef.current === identityGeneration) setGitLoading(false);
934
- }
935
- },
936
- [client, workspaceId, sessionId, repoPaths, rootPath, applyStatus]
937
- );
938
- const performEventReconcile = useCallback(async () => {
939
- const parents = pendingParentsRef.current;
940
- pendingParentsRef.current = /* @__PURE__ */ new Set();
941
- const wantGit = pendingGitRef.current;
942
- pendingGitRef.current = false;
943
- const signal = eventReadAbortRef.current.signal;
944
- const paths = [...parents];
945
- await reconcilePaths(paths, signal);
946
- if (wantGit) await refreshGitOverlay(signal);
947
- }, [reconcilePaths, refreshGitOverlay]);
948
- const performEventReconcileRef = useRef(performEventReconcile);
949
- performEventReconcileRef.current = performEventReconcile;
950
- const reconcilePendingEvents = useCallback(async () => {
951
- eventReconcilePendingRef.current = true;
952
- const existing = eventReconcileInFlightRef.current;
953
- if (existing) return await existing;
954
- const identityGeneration = identityGenerationRef.current;
955
- const run = (async () => {
956
- while (eventReconcilePendingRef.current && identityGenerationRef.current === identityGeneration) {
957
- eventReconcilePendingRef.current = false;
958
- await performEventReconcileRef.current();
959
- }
960
- })();
961
- eventReconcileInFlightRef.current = run;
962
- try {
963
- await run;
964
- } finally {
965
- if (eventReconcileInFlightRef.current === run) eventReconcileInFlightRef.current = null;
966
- }
967
- }, []);
968
- const events = options.events;
969
- useEffect(() => {
970
- if (!enabled || !events) return;
971
- if (!active || !acceptsEventReads) {
972
- for (const event of events) {
973
- if (event.sequence > lastSeqRef.current) lastSeqRef.current = event.sequence;
974
- }
975
- if (debounceRef.current) {
976
- clearTimeout(debounceRef.current);
977
- debounceRef.current = null;
978
- }
979
- pendingParentsRef.current = /* @__PURE__ */ new Set();
980
- pendingGitRef.current = false;
981
- eventReconcilePendingRef.current = false;
982
- return;
983
- }
984
- let sawNew = false;
985
- let contentChanged = false;
986
- for (const event of events) {
987
- if (event.sequence <= lastSeqRef.current) continue;
988
- if (event.type === "fs.changed") {
989
- sawNew = true;
990
- const payload = event.payload;
991
- if (!payload || typeof payload !== "object") continue;
992
- if (payload.source === "write") continue;
993
- if (typeof payload.revision === "number" && ownRevisionsRef.current.has(payload.revision))
994
- continue;
995
- contentChanged = true;
996
- for (const change of payload.changes ?? []) {
997
- pendingParentsRef.current.add(parentWithinTree(change.path, rootPath));
998
- if (change.oldPath) {
999
- pendingParentsRef.current.add(parentWithinTree(change.oldPath, rootPath));
1000
- }
1001
- }
1002
- } else if (event.type === "git.changed") {
1003
- sawNew = true;
1004
- const payload = event.payload;
1005
- if (payload && typeof payload === "object" && typeof payload.revision === "number" && ownRevisionsRef.current.has(payload.revision))
1006
- continue;
1007
- pendingGitRef.current = true;
1008
- }
1009
- }
1010
- for (const event of events)
1011
- if (event.sequence > lastSeqRef.current) lastSeqRef.current = event.sequence;
1012
- if (!sawNew) return;
1013
- if (contentChanged) setContentRevision((revision) => revision + 1);
1014
- if (debounceRef.current) clearTimeout(debounceRef.current);
1015
- const identityGeneration = identityGenerationRef.current;
1016
- debounceRef.current = setTimeout(() => {
1017
- debounceRef.current = null;
1018
- if (identityGenerationRef.current !== identityGeneration) return;
1019
- if (!acceptsEventReadsRef.current) {
1020
- pendingParentsRef.current = /* @__PURE__ */ new Set();
1021
- pendingGitRef.current = false;
1022
- return;
1023
- }
1024
- void reconcilePendingEvents();
1025
- }, 150);
1026
- }, [enabled, active, acceptsEventReads, events, rootPath, reconcilePendingEvents]);
1027
- useEffect(() => {
1028
- if (active && acceptsEventReads) return;
1029
- if (debounceRef.current) {
1030
- clearTimeout(debounceRef.current);
1031
- debounceRef.current = null;
1032
- }
1033
- pendingParentsRef.current = /* @__PURE__ */ new Set();
1034
- pendingGitRef.current = false;
1035
- eventReconcilePendingRef.current = false;
1036
- }, [active, acceptsEventReads]);
1037
- useEffect(
1038
- () => () => {
1039
- refreshAbortRef.current?.abort();
1040
- identityAbortRef.current.abort();
1041
- eventReadAbortRef.current.abort();
1042
- eventReconcilePendingRef.current = false;
1043
- identityGenerationRef.current += 1;
1044
- if (debounceRef.current) clearTimeout(debounceRef.current);
1045
- },
1046
- []
1047
- );
1048
- const identityMatches = enabled && stateIdentity === identityKey;
1049
- const capturedAt = identityMatches && source === "capture" ? capture?.capturedAt ?? null : null;
1050
- return useMemo(
1051
- () => ({
1052
- tree: identityMatches ? tree : NO_TREE,
1053
- expand,
1054
- expandingPaths: identityMatches ? expandingPaths : NO_PATHS,
1055
- readFile,
1056
- writeFile,
1057
- createFile,
1058
- createDir,
1059
- deleteEntry,
1060
- moveEntry,
1061
- refresh,
1062
- contentRevision: identityMatches ? contentRevision : 0,
1063
- source: identityMatches ? source : null,
1064
- capturedAt,
1065
- gitSummary: identityMatches ? gitSummary : null,
1066
- gitLoading: identityMatches && gitLoading,
1067
- loading: identityMatches && loading,
1068
- error: identityMatches ? error : null
1069
- }),
1070
- [
1071
- identityMatches,
1072
- tree,
1073
- expand,
1074
- expandingPaths,
1075
- readFile,
1076
- writeFile,
1077
- createFile,
1078
- createDir,
1079
- deleteEntry,
1080
- moveEntry,
1081
- refresh,
1082
- contentRevision,
1083
- source,
1084
- capturedAt,
1085
- gitSummary,
1086
- gitLoading,
1087
- loading,
1088
- error
1089
- ]
1090
- );
1091
- }
1092
- var NO_TREE = Object.freeze([]);
1093
- var NO_PATHS = /* @__PURE__ */ new Set();
1094
-
1095
- // src/file-node-visibility.ts
1096
- var TOOL_AND_CACHE_DIRS = /* @__PURE__ */ new Set([
1097
- ".bun",
1098
- ".cache",
1099
- ".git",
1100
- ".gradle",
1101
- ".mypy_cache",
1102
- ".npm",
1103
- ".pnpm-store",
1104
- ".pytest_cache",
1105
- ".ruff_cache",
1106
- ".tox",
1107
- ".turbo",
1108
- ".venv",
1109
- ".yarn",
1110
- "__pycache__",
1111
- "node_modules"
1112
- ]);
1113
- var KEPT_DOT_DIRS = /* @__PURE__ */ new Set([".agents", ".claude", ".github"]);
1114
- function isHiddenByDefault(node, context, rootIsRepository) {
1115
- if (node.kind !== "dir") return false;
1116
- if (TOOL_AND_CACHE_DIRS.has(node.name)) return true;
1117
- return context.depth === 0 && !rootIsRepository && node.name.startsWith(".") && !KEPT_DOT_DIRS.has(node.name);
1118
- }
1119
- function treeRootIsRepository(nodes) {
1120
- return nodes.some((node) => node.name === ".git");
1121
- }
1122
- function pathMayBeHiddenByDefault(path) {
1123
- const segments = path.split(/[/\\]/u);
1124
- return segments.slice(0, -1).some((segment) => TOOL_AND_CACHE_DIRS.has(segment));
1125
- }
1126
- function pathIsInsideDirectory(path, directory) {
1127
- if (!path.startsWith(directory) || path === directory) return false;
1128
- if (directory.endsWith("/") || directory.endsWith("\\")) return true;
1129
- const boundary = path[directory.length];
1130
- return boundary === "/" || boundary === "\\";
1131
- }
1132
- function visibleFileTree(nodes, predicate, parent = null, depth = 0) {
1133
- if (!predicate) return nodes;
1134
- const visible = [];
1135
- for (const node of nodes) {
1136
- if (!predicate(node, { depth, parent })) continue;
1137
- visible.push(
1138
- node.children === void 0 ? node : {
1139
- ...node,
1140
- children: visibleFileTree(node.children, predicate, node, depth + 1)
1141
- }
1142
- );
1143
- }
1144
- return visible;
1145
- }
1146
- function filePathVisibility(nodes, path, predicate, parent = null, depth = 0) {
1147
- if (!predicate) return "visible";
1148
- for (const node of nodes) {
1149
- if (node.path !== path && !pathIsInsideDirectory(path, node.path)) continue;
1150
- if (!predicate(node, { depth, parent })) return "hidden";
1151
- if (node.path === path) return "visible";
1152
- if (node.kind !== "dir" || node.children === void 0) return "unknown";
1153
- return filePathVisibility(node.children, path, predicate, node, depth + 1);
1154
- }
1155
- return "unknown";
1156
- }
1157
-
1158
- // src/components/file-browser.tsx
1159
- import {
1160
- ChevronRightIcon,
1161
- EyeIcon,
1162
- EyeOffIcon,
1163
- FileIcon,
1164
- FilePlusIcon,
1165
- FolderIcon,
1166
- FolderPlusIcon,
1167
- PencilIcon,
1168
- RefreshCwIcon,
1169
- TriangleAlertIcon,
1170
- Trash2Icon
1171
- } from "lucide-react";
1172
- import {
1173
- useCallback as useCallback2,
1174
- useEffect as useEffect2,
1175
- useId,
1176
- useLayoutEffect,
1177
- useMemo as useMemo2,
1178
- useRef as useRef2,
1179
- useState as useState2
1180
- } from "react";
1181
- import { AlertDialog } from "radix-ui";
1182
- import { VList } from "virtua";
1183
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1184
- var STATUS_TINT = {
1185
- added: "text-og-status-idle",
1186
- modified: "text-og-status-running",
1187
- deleted: "text-og-status-failed line-through",
1188
- renamed: "text-og-accent",
1189
- untracked: "text-og-fg-subtle"
1190
- };
1191
- var useBrowserLayoutEffect = typeof window === "undefined" ? useEffect2 : useLayoutEffect;
1192
- function parentOf2(path) {
1193
- const i = path.lastIndexOf("/");
1194
- return i <= 0 ? "" : path.slice(0, i);
1195
- }
1196
- function joinPath(parent, name) {
1197
- return parent ? `${parent}/${name}` : name;
1198
- }
1199
- function itemKey(item) {
1200
- switch (item.type) {
1201
- case "node":
1202
- return item.node.path;
1203
- case "create":
1204
- return `create:${item.parent}`;
1205
- case "skeleton":
1206
- return `skeleton:${item.path}`;
1207
- case "residue":
1208
- return `residue:${item.path}`;
1209
- }
1210
- }
1211
- function pathIsInsideDirectory2(path, directory) {
1212
- if (!path.startsWith(directory) || path === directory) return false;
1213
- if (directory.endsWith("/") || directory.endsWith("\\")) return true;
1214
- const boundary = path[directory.length];
1215
- return boundary === "/" || boundary === "\\";
1216
- }
1217
- function findNode(nodes, path) {
1218
- for (const node of nodes) {
1219
- if (node.path === path) return node;
1220
- if (node.kind === "dir" && node.children && pathIsInsideDirectory2(path, node.path)) {
1221
- const hit = findNode(node.children, path);
1222
- if (hit) return hit;
1223
- }
1224
- }
1225
- return void 0;
1226
- }
1227
- function traceRevealPath(nodes, targetPath) {
1228
- for (const node of nodes) {
1229
- if (node.path === targetPath) {
1230
- return {
1231
- directories: node.kind === "dir" ? [node.path] : [],
1232
- frontier: node.kind === "dir" && node.children === void 0 ? node.path : null
1233
- };
1234
- }
1235
- if (node.kind !== "dir" || !pathIsInsideDirectory2(targetPath, node.path)) continue;
1236
- if (node.children === void 0) {
1237
- return { directories: [node.path], frontier: node.path };
1238
- }
1239
- const child = traceRevealPath(node.children, targetPath);
1240
- return {
1241
- directories: [node.path, ...child.directories],
1242
- frontier: child.frontier
1243
- };
1244
- }
1245
- return { directories: [], frontier: null };
1246
- }
1247
- function FileBrowser({
1248
- result,
1249
- fallback,
1250
- onSelectFile,
1251
- selectedPath,
1252
- isNodeVisible,
1253
- showHidden = false,
1254
- onShowHiddenChange,
1255
- revealPath,
1256
- revealPathRequestId,
1257
- renderNode,
1258
- emptyState,
1259
- editable = true,
1260
- confirmDelete,
1261
- className
1262
- }) {
1263
- const t = useOpenGeniText();
1264
- const [expanded, setExpanded] = useState2(/* @__PURE__ */ new Set());
1265
- const [loadingPaths, setLoadingPaths] = useState2(/* @__PURE__ */ new Set());
1266
- const [active, setActive] = useState2(null);
1267
- const [draftCreate, setDraftCreate] = useState2(null);
1268
- const [draftRename, setDraftRename] = useState2(null);
1269
- const [dragOver, setDragOver] = useState2(null);
1270
- const [menu, setMenu] = useState2(null);
1271
- const [pendingDelete, setPendingDelete] = useState2(null);
1272
- const [busy, setBusy] = useState2(false);
1273
- const [coarsePointer, setCoarsePointer] = useState2(false);
1274
- const [revealRequest, setRevealRequest] = useState2(null);
1275
- const handledRevealRequestRef = useRef2(null);
1276
- const attemptedRevealPathsRef = useRef2(/* @__PURE__ */ new Set());
1277
- const treeId = useId();
1278
- const container = usePortalTokenSource();
1279
- const containerRef = container.currentRef;
1280
- const deleteReturnFocusRef = useRef2(null);
1281
- const vlistRef = useRef2(null);
1282
- const portalTokenStyle = usePortalTokenStyle(container.source);
1283
- const getTreeElement = useCallback2(
1284
- () => typeof document === "undefined" ? null : document.getElementById(treeId),
1285
- [treeId]
1286
- );
1287
- const visibleTree = useMemo2(
1288
- () => visibleFileTree(result.tree, isNodeVisible),
1289
- [isNodeVisible, result.tree]
1290
- );
1291
- useBrowserLayoutEffect(() => {
1292
- if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
1293
- const query = window.matchMedia("(pointer: coarse)");
1294
- const update = () => setCoarsePointer(query.matches);
1295
- update();
1296
- if (typeof query.addEventListener === "function") {
1297
- query.addEventListener("change", update);
1298
- return () => query.removeEventListener("change", update);
1299
- }
1300
- if (typeof query.addListener === "function") {
1301
- query.addListener(update);
1302
- return () => query.removeListener(update);
1303
- }
1304
- }, []);
1305
- const effectiveRevealRequestId = revealPath ? revealPathRequestId ?? revealPath : null;
1306
- useEffect2(() => {
1307
- if (!revealPath || effectiveRevealRequestId === null) {
1308
- setRevealRequest(null);
1309
- return;
1310
- }
1311
- const handled = handledRevealRequestRef.current;
1312
- if (handled?.path === revealPath && handled.requestId === effectiveRevealRequestId) return;
1313
- handledRevealRequestRef.current = {
1314
- path: revealPath,
1315
- requestId: effectiveRevealRequestId
1316
- };
1317
- attemptedRevealPathsRef.current = /* @__PURE__ */ new Set();
1318
- setActive(null);
1319
- setRevealRequest({ path: revealPath, requestId: effectiveRevealRequestId });
1320
- }, [effectiveRevealRequestId, revealPath]);
1321
- const visibleActive = active && findNode(visibleTree, active) ? active : null;
1322
- const cursor = visibleActive ?? (selectedPath && findNode(visibleTree, selectedPath) ? selectedPath : null);
1323
- useEffect2(() => {
1324
- if (active !== null && visibleActive === null) setActive(null);
1325
- }, [active, visibleActive]);
1326
- const expand = useCallback2(
1327
- async (path) => {
1328
- const node = findNode(visibleTree, path);
1329
- if (node && node.kind === "dir" && node.children === void 0) {
1330
- setLoadingPaths((prev) => new Set(prev).add(path));
1331
- try {
1332
- await result.expand(path);
1333
- } finally {
1334
- setLoadingPaths((prev) => {
1335
- const next = new Set(prev);
1336
- next.delete(path);
1337
- return next;
1338
- });
1339
- }
1340
- }
1341
- },
1342
- [result, visibleTree]
1343
- );
1344
- const open = useCallback2(
1345
- (path) => {
1346
- setExpanded((prev) => new Set(prev).add(path));
1347
- void expand(path);
1348
- },
1349
- [expand]
1350
- );
1351
- useEffect2(() => {
1352
- if (!revealRequest) return;
1353
- const trace = traceRevealPath(visibleTree, revealRequest.path);
1354
- if (trace.directories.length > 0) {
1355
- setExpanded((previous) => {
1356
- const next = new Set(previous);
1357
- let changed = false;
1358
- for (const path of trace.directories) {
1359
- if (next.has(path)) continue;
1360
- next.add(path);
1361
- changed = true;
1362
- }
1363
- return changed ? next : previous;
1364
- });
1365
- }
1366
- const frontier = trace.frontier;
1367
- if (!frontier || attemptedRevealPathsRef.current.has(frontier) || loadingPaths.has(frontier) || result.expandingPaths.has(frontier)) {
1368
- return;
1369
- }
1370
- attemptedRevealPathsRef.current.add(frontier);
1371
- void expand(frontier);
1372
- }, [expand, loadingPaths, result.expandingPaths, revealRequest, visibleTree]);
1373
- const toggle = useCallback2(
1374
- async (node) => {
1375
- if (node.kind !== "dir") return;
1376
- const isOpen = expanded.has(node.path);
1377
- setExpanded((prev) => {
1378
- const next = new Set(prev);
1379
- if (isOpen) next.delete(node.path);
1380
- else next.add(node.path);
1381
- return next;
1382
- });
1383
- if (!isOpen) await expand(node.path);
1384
- },
1385
- [expanded, expand]
1386
- );
1387
- const cold = result.source !== "live";
1388
- const renderItems = useMemo2(() => {
1389
- const items = [];
1390
- if (draftCreate && draftCreate.parent === "") {
1391
- items.push({ type: "create", parent: "", kind: draftCreate.kind, depth: 0 });
1392
- }
1393
- const walk = (nodes, depth) => {
1394
- for (const node of nodes) {
1395
- items.push({ type: "node", node, depth });
1396
- if (node.kind !== "dir" || !expanded.has(node.path)) continue;
1397
- if (draftCreate && draftCreate.parent === node.path) {
1398
- items.push({
1399
- type: "create",
1400
- parent: node.path,
1401
- kind: draftCreate.kind,
1402
- depth: depth + 1
1403
- });
1404
- }
1405
- const childless = node.children === void 0 || node.children.length === 0;
1406
- const isLoading = loadingPaths.has(node.path) || result.expandingPaths.has(node.path);
1407
- if (node.truncated && childless && cold && !isLoading) {
1408
- items.push({ type: "residue", path: node.path, depth: depth + 1 });
1409
- } else if (node.children && node.children.length > 0) {
1410
- walk(node.children, depth + 1);
1411
- } else if (isLoading && childless) {
1412
- items.push({ type: "skeleton", path: node.path, depth: depth + 1 });
1413
- }
1414
- }
1415
- };
1416
- walk(visibleTree, 0);
1417
- return items;
1418
- }, [visibleTree, expanded, draftCreate, loadingPaths, result.expandingPaths, cold]);
1419
- const unicodeFontPaths = useMemo2(
1420
- () => renderItems.flatMap((item) => item.type === "node" ? [item.node.path] : []),
1421
- [renderItems]
1422
- );
1423
- useUnicodeFallbackFonts(unicodeFontPaths);
1424
- const flatRows = useMemo2(
1425
- () => renderItems.flatMap(
1426
- (item) => item.type === "node" ? [{ node: item.node, depth: item.depth }] : []
1427
- ),
1428
- [renderItems]
1429
- );
1430
- const rowIndexByPath = useMemo2(
1431
- () => new Map(flatRows.map((row, index) => [row.node.path, index])),
1432
- [flatRows]
1433
- );
1434
- const treePositionByPath = useMemo2(() => {
1435
- const positions = /* @__PURE__ */ new Map();
1436
- const visit = (nodes) => {
1437
- nodes.forEach((node, index) => {
1438
- positions.set(node.path, { position: index + 1, setSize: nodes.length });
1439
- if (node.children) visit(node.children);
1440
- });
1441
- };
1442
- visit(visibleTree);
1443
- return positions;
1444
- }, [visibleTree]);
1445
- const cursorIndex = cursor ? rowIndexByPath.get(cursor) ?? -1 : -1;
1446
- const activeDescendantId = cursorIndex >= 0 ? `${treeId}-item-${cursorIndex}` : void 0;
1447
- const supportsMutation = editable && result.source === "live" && result.error === null && !result.loading;
1448
- const performDelete = useCallback2(
1449
- async (node) => {
1450
- if (!supportsMutation) return;
1451
- const recursive = node.kind === "dir";
1452
- setBusy(true);
1453
- try {
1454
- await result.deleteEntry(node.path, recursive);
1455
- } catch {
1456
- } finally {
1457
- setBusy(false);
1458
- }
1459
- },
1460
- [supportsMutation, result]
1461
- );
1462
- const runDelete = useCallback2(
1463
- async (node, returnFocus) => {
1464
- if (!supportsMutation) return;
1465
- setMenu(null);
1466
- if (!confirmDelete) {
1467
- deleteReturnFocusRef.current = returnFocus ?? (typeof document !== "undefined" && document.activeElement instanceof HTMLElement ? document.activeElement : null);
1468
- setPendingDelete(node);
1469
- return;
1470
- }
1471
- if (await confirmDelete(node)) await performDelete(node);
1472
- },
1473
- [supportsMutation, confirmDelete, performDelete]
1474
- );
1475
- const closePendingDelete = useCallback2(
1476
- (restoreTrigger) => {
1477
- const returnTarget = restoreTrigger ? deleteReturnFocusRef.current : getTreeElement();
1478
- deleteReturnFocusRef.current = null;
1479
- setPendingDelete(null);
1480
- if (typeof window !== "undefined") {
1481
- window.requestAnimationFrame(() => {
1482
- const target = returnTarget?.isConnected ? returnTarget : getTreeElement();
1483
- target?.focus();
1484
- });
1485
- }
1486
- },
1487
- [getTreeElement]
1488
- );
1489
- const commitCreate = useCallback2(
1490
- async (name) => {
1491
- const draft = draftCreate;
1492
- setDraftCreate(null);
1493
- if (!draft || !supportsMutation) return;
1494
- const trimmed = name.trim().replace(/\/+$/, "");
1495
- if (!trimmed) return;
1496
- const path = joinPath(draft.parent, trimmed);
1497
- setBusy(true);
1498
- try {
1499
- if (draft.kind === "dir") {
1500
- await result.createDir(path);
1501
- open(path);
1502
- } else {
1503
- await result.createFile(path);
1504
- setActive(path);
1505
- onSelectFile?.(path);
1506
- }
1507
- } catch {
1508
- } finally {
1509
- setBusy(false);
1510
- }
1511
- },
1512
- [draftCreate, supportsMutation, result, open, onSelectFile]
1513
- );
1514
- const commitRename = useCallback2(
1515
- async (name) => {
1516
- const draft = draftRename;
1517
- setDraftRename(null);
1518
- if (!draft || !supportsMutation) return;
1519
- const node = findNode(visibleTree, draft.path);
1520
- const trimmed = name.trim().replace(/\/+$/, "");
1521
- if (!node || !trimmed || trimmed === node.name) return;
1522
- const newPath = joinPath(parentOf2(draft.path), trimmed);
1523
- setBusy(true);
1524
- try {
1525
- await result.moveEntry(draft.path, newPath);
1526
- if (node.kind === "file" && (selectedPath === draft.path || active === draft.path)) {
1527
- setActive(newPath);
1528
- onSelectFile?.(newPath);
1529
- }
1530
- } catch {
1531
- } finally {
1532
- setBusy(false);
1533
- }
1534
- },
1535
- [draftRename, supportsMutation, result, selectedPath, active, onSelectFile, visibleTree]
1536
- );
1537
- const startCreate = useCallback2(
1538
- (kind) => {
1539
- if (!supportsMutation) return;
1540
- const anchor = cursor ? findNode(visibleTree, cursor) : void 0;
1541
- const parent = anchor ? anchor.kind === "dir" ? anchor.path : parentOf2(anchor.path) : "";
1542
- if (parent) open(parent);
1543
- setDraftRename(null);
1544
- setMenu(null);
1545
- setDraftCreate({ parent, kind });
1546
- },
1547
- [supportsMutation, cursor, open, visibleTree]
1548
- );
1549
- const startRename = useCallback2(
1550
- (node) => {
1551
- if (!supportsMutation) return;
1552
- setDraftCreate(null);
1553
- setMenu(null);
1554
- setDraftRename({ path: node.path });
1555
- },
1556
- [supportsMutation]
1557
- );
1558
- const onDropOnto = useCallback2(
1559
- async (targetDir, sourcePath) => {
1560
- setDragOver(null);
1561
- if (!supportsMutation || !sourcePath) return;
1562
- const src = findNode(visibleTree, sourcePath);
1563
- if (!src) return;
1564
- if (parentOf2(sourcePath) === targetDir) return;
1565
- if (targetDir === sourcePath || targetDir.startsWith(`${sourcePath}/`)) return;
1566
- const newPath = joinPath(targetDir, src.name);
1567
- if (newPath === sourcePath) return;
1568
- setBusy(true);
1569
- try {
1570
- await result.moveEntry(sourcePath, newPath);
1571
- if (src.kind === "file" && (selectedPath === sourcePath || active === sourcePath)) {
1572
- setActive(newPath);
1573
- onSelectFile?.(newPath);
1574
- }
1575
- } catch {
1576
- } finally {
1577
- setBusy(false);
1578
- }
1579
- },
1580
- [supportsMutation, result, selectedPath, active, onSelectFile, visibleTree]
1581
- );
1582
- const onKeyDown = useCallback2(
1583
- (e) => {
1584
- if (draftCreate || draftRename) return;
1585
- if (flatRows.length === 0) return;
1586
- const idx = flatRows.findIndex((r) => r.node.path === cursor);
1587
- const move = (next) => {
1588
- const clamped = Math.max(0, Math.min(flatRows.length - 1, next));
1589
- const row = flatRows[clamped];
1590
- if (row) setActive(row.node.path);
1591
- e.preventDefault();
1592
- };
1593
- const cur = idx >= 0 ? flatRows[idx] : void 0;
1594
- switch (e.key) {
1595
- case "ArrowDown":
1596
- move(idx < 0 ? 0 : idx + 1);
1597
- break;
1598
- case "ArrowUp":
1599
- move(idx < 0 ? 0 : idx - 1);
1600
- break;
1601
- case "Home":
1602
- move(0);
1603
- break;
1604
- case "End":
1605
- move(flatRows.length - 1);
1606
- break;
1607
- case "PageDown": {
1608
- const pageSize = Math.max(
1609
- 1,
1610
- Math.floor((containerRef.current?.clientHeight || 280) / (coarsePointer ? 44 : 28)) - 1
1611
- );
1612
- move((idx < 0 ? 0 : idx) + pageSize);
1613
- break;
1614
- }
1615
- case "PageUp": {
1616
- const pageSize = Math.max(
1617
- 1,
1618
- Math.floor((containerRef.current?.clientHeight || 280) / (coarsePointer ? 44 : 28)) - 1
1619
- );
1620
- move((idx < 0 ? 0 : idx) - pageSize);
1621
- break;
1622
- }
1623
- case "ArrowRight":
1624
- if (cur?.node.kind === "dir") {
1625
- if (!expanded.has(cur.node.path)) open(cur.node.path);
1626
- else move(idx + 1);
1627
- e.preventDefault();
1628
- }
1629
- break;
1630
- case "ArrowLeft":
1631
- if (cur) {
1632
- if (cur.node.kind === "dir" && expanded.has(cur.node.path)) {
1633
- setExpanded((prev) => {
1634
- const n = new Set(prev);
1635
- n.delete(cur.node.path);
1636
- return n;
1637
- });
1638
- } else {
1639
- const parent = parentOf2(cur.node.path);
1640
- if (parent) setActive(parent);
1641
- }
1642
- e.preventDefault();
1643
- }
1644
- break;
1645
- case "Enter":
1646
- if (cur) {
1647
- if (cur.node.kind === "dir") void toggle(cur.node);
1648
- else onSelectFile?.(cur.node.path);
1649
- e.preventDefault();
1650
- }
1651
- break;
1652
- case "ContextMenu":
1653
- case "F10":
1654
- if (cur && supportsMutation && (e.key === "ContextMenu" || e.shiftKey)) {
1655
- const rowIndex = rowIndexByPath.get(cur.node.path) ?? 0;
1656
- const row = document.getElementById(`${treeId}-item-${rowIndex}`);
1657
- const rect = row?.getBoundingClientRect();
1658
- setMenu({
1659
- node: cur.node,
1660
- x: rect ? rect.left + Math.min(32, rect.width / 2) : 8,
1661
- y: rect ? rect.bottom : 8
1662
- });
1663
- e.preventDefault();
1664
- } else if (e.key === "F10") {
1665
- break;
1666
- }
1667
- break;
1668
- case "F2":
1669
- if (cur) {
1670
- startRename(cur.node);
1671
- e.preventDefault();
1672
- }
1673
- break;
1674
- case "Delete":
1675
- case "Backspace":
1676
- if (cur && supportsMutation) {
1677
- void runDelete(cur.node);
1678
- e.preventDefault();
1679
- }
1680
- break;
1681
- }
1682
- },
1683
- [
1684
- draftCreate,
1685
- draftRename,
1686
- flatRows,
1687
- cursor,
1688
- expanded,
1689
- open,
1690
- toggle,
1691
- onSelectFile,
1692
- startRename,
1693
- runDelete,
1694
- supportsMutation,
1695
- coarsePointer,
1696
- containerRef,
1697
- rowIndexByPath,
1698
- treeId
1699
- ]
1700
- );
1701
- useEffect2(() => {
1702
- if (!menu) return;
1703
- const close = () => setMenu(null);
1704
- window.addEventListener("click", close);
1705
- window.addEventListener("scroll", close, true);
1706
- window.addEventListener("resize", close);
1707
- return () => {
1708
- window.removeEventListener("click", close);
1709
- window.removeEventListener("scroll", close, true);
1710
- window.removeEventListener("resize", close);
1711
- };
1712
- }, [menu]);
1713
- const showErrorEmpty = result.error && visibleTree.length === 0 && !draftCreate;
1714
- const showDegradedTree = result.error && visibleTree.length > 0;
1715
- const showEmpty = !result.loading && visibleTree.length === 0 && !draftCreate;
1716
- const showToolbar = supportsMutation || result.loading || onShowHiddenChange !== void 0;
1717
- const usesVirtualTree = !showErrorEmpty && !showEmpty && renderItems.length > 500;
1718
- const renderNodeRow = (node, depth) => {
1719
- const isOpen = expanded.has(node.path);
1720
- if (renderNode) {
1721
- return /* @__PURE__ */ jsx("div", { children: renderNode(node, depth, isOpen) });
1722
- }
1723
- const isDir = node.kind === "dir";
1724
- const isSelected = node.path === selectedPath || node.path === active;
1725
- const isCursor = node.path === cursor;
1726
- const isLoading = loadingPaths.has(node.path) || result.expandingPaths.has(node.path);
1727
- const isRenaming = draftRename?.path === node.path;
1728
- const isDropTarget = dragOver === (isDir ? node.path : parentOf2(node.path));
1729
- const dropDir = isDir ? node.path : parentOf2(node.path);
1730
- const treePosition = treePositionByPath.get(node.path);
1731
- return /* @__PURE__ */ jsx(
1732
- "div",
1733
- {
1734
- id: `${treeId}-item-${rowIndexByPath.get(node.path) ?? 0}`,
1735
- role: "treeitem",
1736
- "aria-level": depth + 1,
1737
- "aria-posinset": treePosition?.position,
1738
- "aria-setsize": treePosition?.setSize,
1739
- "aria-expanded": isDir ? isOpen : void 0,
1740
- "aria-selected": isCursor || void 0,
1741
- "aria-busy": isLoading || void 0,
1742
- onDragOver: supportsMutation ? (e) => {
1743
- e.preventDefault();
1744
- e.dataTransfer.dropEffect = "move";
1745
- setDragOver(dropDir);
1746
- } : void 0,
1747
- onDragLeave: supportsMutation ? (e) => {
1748
- e.stopPropagation();
1749
- setDragOver((cur) => cur === dropDir ? null : cur);
1750
- } : void 0,
1751
- onDrop: supportsMutation ? (e) => {
1752
- e.preventDefault();
1753
- e.stopPropagation();
1754
- const src = e.dataTransfer.getData("text/og-path");
1755
- void onDropOnto(dropDir, src);
1756
- } : void 0,
1757
- children: isRenaming ? /* @__PURE__ */ jsx(
1758
- InlineInput,
1759
- {
1760
- depth,
1761
- kind: node.kind,
1762
- initialValue: node.name,
1763
- onCommit: (name) => void commitRename(name),
1764
- onCancel: () => setDraftRename(null)
1765
- }
1766
- ) : /* @__PURE__ */ jsxs(
1767
- "button",
1768
- {
1769
- type: "button",
1770
- tabIndex: -1,
1771
- draggable: supportsMutation || void 0,
1772
- onDragStart: supportsMutation ? (e) => {
1773
- e.dataTransfer.setData("text/og-path", node.path);
1774
- e.dataTransfer.effectAllowed = "move";
1775
- } : void 0,
1776
- onClick: () => {
1777
- setActive(node.path);
1778
- if (isDir) void toggle(node);
1779
- else onSelectFile?.(node.path);
1780
- },
1781
- onDoubleClick: () => supportsMutation && startRename(node),
1782
- onContextMenu: (e) => {
1783
- if (!supportsMutation) return;
1784
- e.preventDefault();
1785
- setActive(node.path);
1786
- setMenu({ node, x: e.clientX, y: e.clientY });
1787
- },
1788
- className: cn(
1789
- "group relative flex min-h-7 w-full items-center gap-1 truncate rounded-og-sm px-1 py-0.5 text-left text-og-sm pointer-coarse:min-h-11",
1790
- "hover:bg-og-surface-2",
1791
- isSelected && "bg-og-surface-2",
1792
- isCursor && "outline outline-1 -outline-offset-1 outline-og-accent",
1793
- isDropTarget && "bg-og-accent-soft ring-1 ring-inset ring-og-accent",
1794
- // A thin progress shimmer on the expanding row — no per-node spinner.
1795
- isLoading && "after:pointer-events-none after:absolute after:inset-x-1 after:bottom-0 after:h-px after:animate-pulse after:rounded-full after:bg-og-accent-soft",
1796
- node.status ? STATUS_TINT[node.status] : void 0
1797
- ),
1798
- style: { paddingLeft: `${depth * 12 + 4}px` },
1799
- children: [
1800
- isDir ? /* @__PURE__ */ jsx(
1801
- ChevronRightIcon,
1802
- {
1803
- className: cn(
1804
- "size-3 shrink-0 transition-transform",
1805
- isOpen && "rotate-90",
1806
- isLoading && "text-og-accent"
1807
- )
1808
- }
1809
- ) : /* @__PURE__ */ jsx("span", { className: "inline-block w-3 shrink-0" }),
1810
- isDir ? /* @__PURE__ */ jsx(FolderIcon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(FileIcon, { className: "size-3.5 shrink-0" }),
1811
- /* @__PURE__ */ jsx("span", { className: "truncate", children: node.name }),
1812
- supportsMutation && /* @__PURE__ */ jsx(
1813
- "span",
1814
- {
1815
- role: "button",
1816
- tabIndex: -1,
1817
- "aria-label": t("fileBrowser.moreActions"),
1818
- onClick: (e) => {
1819
- e.preventDefault();
1820
- e.stopPropagation();
1821
- setActive(node.path);
1822
- const rect = e.currentTarget.getBoundingClientRect();
1823
- setMenu({ node, x: rect.right, y: rect.bottom });
1824
- },
1825
- className: "ml-auto hidden shrink-0 px-1 text-og-fg-subtle hover:text-og-fg group-hover:inline",
1826
- children: "\u22EF"
1827
- }
1828
- )
1829
- ]
1830
- }
1831
- )
1832
- }
1833
- );
1834
- };
1835
- const renderItem = (item) => {
1836
- switch (item.type) {
1837
- case "node":
1838
- return renderNodeRow(item.node, item.depth);
1839
- case "create":
1840
- return /* @__PURE__ */ jsx(
1841
- InlineInput,
1842
- {
1843
- depth: item.depth,
1844
- kind: item.kind,
1845
- initialValue: "",
1846
- onCommit: (name) => void commitCreate(name),
1847
- onCancel: () => setDraftCreate(null)
1848
- }
1849
- );
1850
- case "skeleton":
1851
- return /* @__PURE__ */ jsx(
1852
- "div",
1853
- {
1854
- role: "group",
1855
- "aria-hidden": true,
1856
- style: { paddingLeft: `${item.depth * 12 + 4}px` },
1857
- className: "space-y-1 py-1",
1858
- children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(
1859
- "div",
1860
- {
1861
- className: "h-2.5 animate-pulse rounded-og-sm bg-og-surface-2",
1862
- style: { width: `${70 - i * 12}%` }
1863
- },
1864
- i
1865
- ))
1866
- }
1867
- );
1868
- case "residue":
1869
- return /* @__PURE__ */ jsxs(
1870
- "div",
1871
- {
1872
- style: { paddingLeft: `${item.depth * 12 + 4}px` },
1873
- className: "flex items-center gap-1.5 py-0.5 pr-1 text-og-xs italic text-og-fg-subtle",
1874
- children: [
1875
- /* @__PURE__ */ jsx("span", { className: "inline-block w-3 shrink-0" }),
1876
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: t("fileBrowser.contentsOnMachineOpenWhen") })
1877
- ]
1878
- }
1879
- );
1880
- }
1881
- };
1882
- useEffect2(() => {
1883
- if (!cursor) return;
1884
- const index = renderItems.findIndex((it) => it.type === "node" && it.node.path === cursor);
1885
- if (index >= 0) vlistRef.current?.scrollToIndex(index);
1886
- }, [cursor, renderItems]);
1887
- useEffect2(() => {
1888
- if (!revealRequest) return;
1889
- const index = renderItems.findIndex(
1890
- (item) => item.type === "node" && item.node.path === revealRequest.path
1891
- );
1892
- if (index < 0) return;
1893
- if (usesVirtualTree) {
1894
- vlistRef.current?.scrollToIndex(index);
1895
- } else {
1896
- document.getElementById(`${treeId}-item-${index}`)?.scrollIntoView?.({ block: "nearest" });
1897
- }
1898
- setRevealRequest(
1899
- (current) => current?.path === revealRequest.path && current.requestId === revealRequest.requestId ? null : current
1900
- );
1901
- }, [renderItems, revealRequest, treeId, usesVirtualTree]);
1902
- return /* @__PURE__ */ jsxs("div", { className: cn("flex min-h-0 min-w-0 flex-col", className), children: [
1903
- showToolbar && /* @__PURE__ */ jsxs(
1904
- "div",
1905
- {
1906
- role: "toolbar",
1907
- "aria-label": t("fileBrowser.fileActions"),
1908
- className: "flex shrink-0 flex-wrap items-center gap-0.5 border-b border-og-border px-1 py-1",
1909
- children: [
1910
- supportsMutation ? /* @__PURE__ */ jsxs(Fragment, { children: [
1911
- /* @__PURE__ */ jsx(
1912
- ToolbarButton,
1913
- {
1914
- label: t("fileBrowser.newFile"),
1915
- onClick: () => startCreate("file"),
1916
- disabled: busy,
1917
- children: /* @__PURE__ */ jsx(FilePlusIcon, { className: "size-3.5" })
1918
- }
1919
- ),
1920
- /* @__PURE__ */ jsx(
1921
- ToolbarButton,
1922
- {
1923
- label: t("fileBrowser.newFolder"),
1924
- onClick: () => startCreate("dir"),
1925
- disabled: busy,
1926
- children: /* @__PURE__ */ jsx(FolderPlusIcon, { className: "size-3.5" })
1927
- }
1928
- ),
1929
- /* @__PURE__ */ jsx(
1930
- ToolbarButton,
1931
- {
1932
- label: t("fileBrowser.rename"),
1933
- onClick: () => {
1934
- const node = cursor ? findNode(visibleTree, cursor) : void 0;
1935
- if (node) startRename(node);
1936
- },
1937
- disabled: busy || !cursor,
1938
- children: /* @__PURE__ */ jsx(PencilIcon, { className: "size-3.5" })
1939
- }
1940
- ),
1941
- /* @__PURE__ */ jsx(
1942
- ToolbarButton,
1943
- {
1944
- label: t("fileBrowser.delete"),
1945
- onClick: (event) => {
1946
- const node = cursor ? findNode(visibleTree, cursor) : void 0;
1947
- if (node) void runDelete(node, event.currentTarget);
1948
- },
1949
- disabled: busy || !cursor,
1950
- children: /* @__PURE__ */ jsx(Trash2Icon, { className: "size-3.5" })
1951
- }
1952
- )
1953
- ] }) : null,
1954
- /* @__PURE__ */ jsx("span", { className: "ml-auto" }),
1955
- onShowHiddenChange ? /* @__PURE__ */ jsx(
1956
- ToolbarButton,
1957
- {
1958
- label: t("fileBrowser.showHiddenFiles"),
1959
- pressed: showHidden,
1960
- onClick: () => onShowHiddenChange(!showHidden),
1961
- children: showHidden ? /* @__PURE__ */ jsx(EyeIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx(EyeOffIcon, { className: "size-3.5" })
1962
- }
1963
- ) : null,
1964
- /* @__PURE__ */ jsx(
1965
- ToolbarButton,
1966
- {
1967
- label: t("fileBrowser.refresh"),
1968
- onClick: () => void result.refresh(),
1969
- disabled: busy || result.loading,
1970
- children: /* @__PURE__ */ jsx(RefreshCwIcon, { className: cn("size-3.5", result.loading && "animate-spin") })
1971
- }
1972
- )
1973
- ]
1974
- }
1975
- ),
1976
- showDegradedTree ? /* @__PURE__ */ jsxs(
1977
- "div",
1978
- {
1979
- role: "status",
1980
- "aria-live": "polite",
1981
- "data-opengeni-files-degraded": true,
1982
- className: "flex shrink-0 items-center gap-2 border-b border-og-status-running/30 bg-og-status-running/10 px-2 py-1.5 text-og-xs text-og-fg-muted",
1983
- children: [
1984
- /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-3.5 shrink-0 text-og-status-running", "aria-hidden": true }),
1985
- /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children: result.source === "capture" ? t("fileBrowser.liveFilesAreTemporarilyUnavailable") : t("fileBrowser.liveRefreshFailedShowingThe") }),
1986
- /* @__PURE__ */ jsxs(
1987
- "button",
1988
- {
1989
- type: "button",
1990
- onClick: () => void result.refresh(),
1991
- disabled: result.loading,
1992
- className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm border border-og-border bg-og-surface-1 px-2 font-medium text-og-fg transition-colors hover:border-og-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
1993
- children: [
1994
- /* @__PURE__ */ jsx(
1995
- RefreshCwIcon,
1996
- {
1997
- className: cn("size-3", result.loading && "animate-spin motion-reduce:animate-none"),
1998
- "aria-hidden": true
1999
- }
2000
- ),
2001
- t("fileBrowser.retry")
2002
- ]
2003
- }
2004
- )
2005
- ]
2006
- }
2007
- ) : null,
2008
- /* @__PURE__ */ jsx(
2009
- "div",
2010
- {
2011
- ref: container.ref,
2012
- onFocus: (event) => {
2013
- if (event.target.id === treeId && cursorIndex < 0) {
2014
- const first = flatRows[0];
2015
- if (first) setActive(first.node.path);
2016
- }
2017
- },
2018
- onKeyDown,
2019
- onDragOver: supportsMutation ? (e) => {
2020
- e.preventDefault();
2021
- e.dataTransfer.dropEffect = "move";
2022
- setDragOver("");
2023
- } : void 0,
2024
- onDrop: supportsMutation ? (e) => {
2025
- e.preventDefault();
2026
- const src = e.dataTransfer.getData("text/og-path");
2027
- void onDropOnto("", src);
2028
- } : void 0,
2029
- className: cn(
2030
- "flex min-h-0 min-w-0 flex-1 flex-col p-1",
2031
- dragOver === "" && "ring-1 ring-inset ring-og-accent"
2032
- ),
2033
- "data-opengeni-file-tree": true,
2034
- children: showErrorEmpty ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-2 p-2 text-og-sm text-og-fg-subtle", children: [
2035
- /* @__PURE__ */ jsx("div", { children: fallback ?? t("fileBrowser.couldNotLoadFilesMessage", {
2036
- message: result.error?.message ?? t("fileBrowser.refreshTheFileListTo")
2037
- }) }),
2038
- /* @__PURE__ */ jsxs(
2039
- "button",
2040
- {
2041
- type: "button",
2042
- onClick: () => void result.refresh(),
2043
- disabled: result.loading,
2044
- className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2 py-1 text-og-xs font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
2045
- children: [
2046
- /* @__PURE__ */ jsx(
2047
- RefreshCwIcon,
2048
- {
2049
- className: cn("size-3.5", result.loading && "animate-spin"),
2050
- "aria-hidden": true
2051
- }
2052
- ),
2053
- t("fileBrowser.retry")
2054
- ]
2055
- }
2056
- )
2057
- ] }) : showEmpty ? /* @__PURE__ */ jsx("div", { className: "p-2 text-og-sm text-og-fg-subtle", children: emptyState ?? t("fileBrowser.thisDirectoryIsEmpty") }) : !usesVirtualTree ? /* @__PURE__ */ jsx(
2058
- "div",
2059
- {
2060
- id: treeId,
2061
- role: "tree",
2062
- "aria-label": t("fileBrowser.workspaceFiles"),
2063
- "aria-activedescendant": activeDescendantId,
2064
- "aria-multiselectable": false,
2065
- tabIndex: 0,
2066
- className: "min-h-0 min-w-0 flex-1 overflow-auto outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
2067
- children: renderItems.map((item) => /* @__PURE__ */ jsx("div", { className: "min-w-0", children: renderItem(item) }, itemKey(item)))
2068
- }
2069
- ) : (
2070
- // Virtualized: only the rows in/near the viewport mount, so a 3k-node
2071
- // tree stays responsive. The flat item list already carries the
2072
- // expanded subtree + synthetic (create/skeleton/residue) rows.
2073
- /* @__PURE__ */ jsx(
2074
- VList,
2075
- {
2076
- ref: vlistRef,
2077
- id: treeId,
2078
- role: "tree",
2079
- "aria-label": t("fileBrowser.workspaceFiles"),
2080
- "aria-activedescendant": activeDescendantId,
2081
- "aria-multiselectable": false,
2082
- tabIndex: 0,
2083
- className: "min-h-0 flex-1 outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
2084
- itemSize: coarsePointer ? 44 : 28,
2085
- ssrCount: Math.min(32, renderItems.length),
2086
- children: renderItems.map((item) => /* @__PURE__ */ jsx("div", { className: "min-w-0", children: renderItem(item) }, itemKey(item)))
2087
- }
2088
- )
2089
- )
2090
- }
2091
- ),
2092
- menu && menu.node && /* @__PURE__ */ jsx(
2093
- ContextMenu,
2094
- {
2095
- node: menu.node,
2096
- x: menu.x,
2097
- y: menu.y,
2098
- onRename: () => menu.node && startRename(menu.node),
2099
- onDelete: () => menu.node && void runDelete(menu.node),
2100
- onNewFile: () => startCreate("file"),
2101
- onNewFolder: () => startCreate("dir"),
2102
- onClose: () => {
2103
- setMenu(null);
2104
- window.requestAnimationFrame(() => getTreeElement()?.focus());
2105
- }
2106
- }
2107
- ),
2108
- pendingDelete ? /* @__PURE__ */ jsx(
2109
- DeleteDialog,
2110
- {
2111
- node: pendingDelete,
2112
- busy,
2113
- portalTokenStyle,
2114
- onCancel: () => closePendingDelete(true),
2115
- onConfirm: () => {
2116
- const node = pendingDelete;
2117
- closePendingDelete(false);
2118
- void performDelete(node);
2119
- }
2120
- }
2121
- ) : null
2122
- ] });
2123
- }
2124
- function DeleteDialog({
2125
- node,
2126
- busy,
2127
- portalTokenStyle,
2128
- onCancel,
2129
- onConfirm
2130
- }) {
2131
- const t = useOpenGeniText();
2132
- const portalContainer = usePortalContainer();
2133
- const cancelRef = useRef2(null);
2134
- const [open, setOpen] = useState2(true);
2135
- const closeIntentRef = useRef2("cancel");
2136
- const settledRef = useRef2(false);
2137
- const settleTimerRef = useRef2(null);
2138
- const settle = () => {
2139
- if (settledRef.current) return;
2140
- settledRef.current = true;
2141
- if (closeIntentRef.current === "confirm") {
2142
- onConfirm();
2143
- } else {
2144
- onCancel();
2145
- }
2146
- };
2147
- const scheduleSettle = () => {
2148
- if (settleTimerRef.current !== null) return;
2149
- settleTimerRef.current = setTimeout(() => {
2150
- settleTimerRef.current = null;
2151
- settle();
2152
- }, 0);
2153
- };
2154
- useEffect2(
2155
- () => () => {
2156
- if (settleTimerRef.current !== null) clearTimeout(settleTimerRef.current);
2157
- },
2158
- []
2159
- );
2160
- return /* @__PURE__ */ jsx(
2161
- AlertDialog.Root,
2162
- {
2163
- open,
2164
- onOpenChange: (nextOpen) => {
2165
- if (!nextOpen && !busy) {
2166
- setOpen(false);
2167
- scheduleSettle();
2168
- }
2169
- },
2170
- children: /* @__PURE__ */ jsx(
2171
- AlertDialog.Portal,
2172
- {
2173
- container: portalContainer ?? (typeof document === "undefined" ? null : document.body),
2174
- children: /* @__PURE__ */ jsx(
2175
- ModalLayer,
2176
- {
2177
- overlay: AlertDialog.Overlay,
2178
- className: "og-root fixed inset-0 z-[100] bg-black/45 before:pointer-events-none before:absolute before:inset-0 before:backdrop-blur-[2px]",
2179
- children: /* @__PURE__ */ jsxs(
2180
- AlertDialog.Content,
2181
- {
2182
- className: "og-root fixed left-1/2 top-1/2 z-[101] max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-sm -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-og-lg border border-og-border-strong bg-og-surface-1 p-4 text-og-fg shadow-2xl outline-hidden",
2183
- style: portalTokenStyle,
2184
- onOpenAutoFocus: (event) => {
2185
- event.preventDefault();
2186
- cancelRef.current?.focus();
2187
- },
2188
- onCloseAutoFocus: (event) => {
2189
- event.preventDefault();
2190
- scheduleSettle();
2191
- },
2192
- onEscapeKeyDown: (event) => {
2193
- event.stopPropagation();
2194
- if (busy) {
2195
- event.preventDefault();
2196
- } else {
2197
- closeIntentRef.current = "cancel";
2198
- }
2199
- },
2200
- children: [
2201
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2202
- /* @__PURE__ */ jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-og-status-failed/12 text-og-status-failed", children: /* @__PURE__ */ jsx(Trash2Icon, { className: "size-4", "aria-hidden": true }) }),
2203
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2204
- /* @__PURE__ */ jsxs(AlertDialog.Title, { className: "text-og-sm font-semibold", children: [
2205
- t("fileBrowser.delete"),
2206
- " ",
2207
- node.kind === "dir" ? t("fileBrowser.folder") : t("fileBrowser.file"),
2208
- "?"
2209
- ] }),
2210
- /* @__PURE__ */ jsxs(AlertDialog.Description, { className: "mt-1 text-og-sm leading-relaxed text-og-fg-muted", children: [
2211
- /* @__PURE__ */ jsx("span", { className: "break-all font-og-mono text-og-fg", children: node.path }),
2212
- node.kind === "dir" ? " and everything inside it will be permanently removed." : " will be permanently removed."
2213
- ] })
2214
- ] })
2215
- ] }),
2216
- /* @__PURE__ */ jsxs("div", { className: "mt-4 flex justify-end gap-2", children: [
2217
- /* @__PURE__ */ jsx(AlertDialog.Cancel, { asChild: true, children: /* @__PURE__ */ jsx(
2218
- "button",
2219
- {
2220
- ref: cancelRef,
2221
- type: "button",
2222
- onClick: () => {
2223
- closeIntentRef.current = "cancel";
2224
- },
2225
- disabled: busy,
2226
- className: "min-h-9 rounded-og-md border border-og-border px-3 text-og-sm font-medium text-og-fg hover:bg-og-surface-2 disabled:opacity-50 pointer-coarse:min-h-11",
2227
- children: t("fileBrowser.cancel")
2228
- }
2229
- ) }),
2230
- /* @__PURE__ */ jsx(AlertDialog.Action, { asChild: true, children: /* @__PURE__ */ jsx(
2231
- "button",
2232
- {
2233
- type: "button",
2234
- onClick: () => {
2235
- closeIntentRef.current = "confirm";
2236
- },
2237
- disabled: busy,
2238
- className: "min-h-9 rounded-og-md bg-og-danger-fill px-3 text-og-sm font-semibold text-og-danger-fg shadow-sm hover:brightness-110 disabled:opacity-50 pointer-coarse:min-h-11",
2239
- children: t("fileBrowser.deletePermanently")
2240
- }
2241
- ) })
2242
- ] })
2243
- ]
2244
- }
2245
- )
2246
- }
2247
- )
2248
- }
2249
- )
2250
- }
2251
- );
2252
- }
2253
- function ToolbarButton({
2254
- label,
2255
- onClick,
2256
- disabled,
2257
- pressed,
2258
- children
2259
- }) {
2260
- return /* @__PURE__ */ jsx(
2261
- "button",
2262
- {
2263
- type: "button",
2264
- title: label,
2265
- "aria-label": label,
2266
- "aria-pressed": pressed,
2267
- onClick,
2268
- disabled,
2269
- className: cn(
2270
- "inline-flex size-7 items-center justify-center rounded-og-sm p-1 text-og-fg-muted max-[1023px]:size-11 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
2271
- "hover:bg-og-surface-2 hover:text-og-fg",
2272
- "aria-pressed:bg-og-surface-2 aria-pressed:text-og-fg",
2273
- "disabled:cursor-not-allowed disabled:opacity-40"
2274
- ),
2275
- children
2276
- }
2277
- );
2278
- }
2279
- function InlineInput({
2280
- depth,
2281
- kind,
2282
- initialValue,
2283
- onCommit,
2284
- onCancel
2285
- }) {
2286
- const t = useOpenGeniText();
2287
- const [value, setValue] = useState2(initialValue);
2288
- const ref = useRef2(null);
2289
- const doneRef = useRef2(false);
2290
- useEffect2(() => {
2291
- const el = ref.current;
2292
- if (!el) return;
2293
- el.focus();
2294
- const dot = initialValue.lastIndexOf(".");
2295
- if (initialValue && dot > 0) el.setSelectionRange(0, dot);
2296
- else el.select();
2297
- }, [initialValue]);
2298
- const finish = (commit) => {
2299
- if (doneRef.current) return;
2300
- doneRef.current = true;
2301
- if (commit) onCommit(value);
2302
- else onCancel();
2303
- };
2304
- return /* @__PURE__ */ jsxs(
2305
- "div",
2306
- {
2307
- className: "flex items-center gap-1 px-1 py-0.5",
2308
- style: { paddingLeft: `${depth * 12 + 4}px` },
2309
- children: [
2310
- /* @__PURE__ */ jsx("span", { className: "inline-block w-3 shrink-0" }),
2311
- kind === "dir" ? /* @__PURE__ */ jsx(FolderIcon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx(FileIcon, { className: "size-3.5 shrink-0" }),
2312
- /* @__PURE__ */ jsx(
2313
- "input",
2314
- {
2315
- ref,
2316
- value,
2317
- spellCheck: false,
2318
- autoComplete: "off",
2319
- "aria-label": kind === "dir" ? t("fileBrowser.folderName") : t("fileBrowser.fileName"),
2320
- onChange: (e) => setValue(e.target.value),
2321
- onBlur: () => finish(true),
2322
- onKeyDown: (e) => {
2323
- if (e.key === "Enter") {
2324
- e.preventDefault();
2325
- finish(true);
2326
- } else if (e.key === "Escape") {
2327
- e.preventDefault();
2328
- finish(false);
2329
- }
2330
- e.stopPropagation();
2331
- },
2332
- className: cn(
2333
- "min-w-0 flex-1 rounded-og-sm border bg-og-bg px-1 py-0 text-og-sm",
2334
- "border-og-accent text-og-fg",
2335
- "outline-hidden"
2336
- )
2337
- }
2338
- )
2339
- ]
2340
- }
2341
- );
2342
- }
2343
- function ContextMenu({
2344
- node,
2345
- x,
2346
- y,
2347
- onRename,
2348
- onDelete,
2349
- onNewFile,
2350
- onNewFolder,
2351
- onClose
2352
- }) {
2353
- const t = useOpenGeniText();
2354
- const isDir = node.kind === "dir";
2355
- const menuRef = useRef2(null);
2356
- const vw = typeof window !== "undefined" ? window.innerWidth : 9999;
2357
- const vh = typeof window !== "undefined" ? window.innerHeight : 9999;
2358
- const left = Math.max(4, Math.min(x, vw - 180));
2359
- const top = Math.max(4, Math.min(y, vh - 160));
2360
- useEffect2(() => {
2361
- menuRef.current?.querySelector('[role="menuitem"]')?.focus();
2362
- }, []);
2363
- const onKeyDown = (event) => {
2364
- const items = Array.from(
2365
- menuRef.current?.querySelectorAll('[role="menuitem"]') ?? []
2366
- );
2367
- if (items.length === 0) return;
2368
- const current = items.findIndex((item2) => item2 === document.activeElement);
2369
- let next = null;
2370
- if (event.key === "ArrowDown") next = (current + 1 + items.length) % items.length;
2371
- else if (event.key === "ArrowUp") next = (current - 1 + items.length) % items.length;
2372
- else if (event.key === "Home") next = 0;
2373
- else if (event.key === "End") next = items.length - 1;
2374
- else if (event.key === "Escape") {
2375
- event.preventDefault();
2376
- event.stopPropagation();
2377
- onClose();
2378
- return;
2379
- }
2380
- if (next === null) return;
2381
- event.preventDefault();
2382
- event.stopPropagation();
2383
- items[next]?.focus();
2384
- };
2385
- const item = (label, icon, onClick, danger) => /* @__PURE__ */ jsxs(
2386
- "button",
2387
- {
2388
- type: "button",
2389
- role: "menuitem",
2390
- onClick: (e) => {
2391
- e.stopPropagation();
2392
- onClick();
2393
- },
2394
- className: cn(
2395
- MENU_BUTTON_CLASS,
2396
- danger && "text-og-status-failed [&_svg]:text-og-status-failed!"
2397
- ),
2398
- children: [
2399
- icon,
2400
- label
2401
- ]
2402
- }
2403
- );
2404
- return /* @__PURE__ */ jsxs(
2405
- "div",
2406
- {
2407
- ref: menuRef,
2408
- role: "menu",
2409
- "aria-label": t("fileBrowser.actionsForName", { name: node.name }),
2410
- onKeyDown,
2411
- onClick: (e) => e.stopPropagation(),
2412
- style: { left, top },
2413
- className: cn(MENU_SURFACE_CLASS, "fixed z-50 min-w-[180px] overflow-hidden"),
2414
- children: [
2415
- isDir && /* @__PURE__ */ jsxs(Fragment, { children: [
2416
- item(t("fileBrowser.newFile"), /* @__PURE__ */ jsx(FilePlusIcon, {}), onNewFile),
2417
- item(t("fileBrowser.newFolder"), /* @__PURE__ */ jsx(FolderPlusIcon, {}), onNewFolder),
2418
- /* @__PURE__ */ jsx("div", { role: "separator", className: MENU_SEPARATOR_CLASS })
2419
- ] }),
2420
- item(t("fileBrowser.rename"), /* @__PURE__ */ jsx(PencilIcon, {}), onRename),
2421
- item("Delete", /* @__PURE__ */ jsx(Trash2Icon, {}), onDelete, true)
2422
- ]
2423
- }
2424
- );
2425
- }
2426
-
2427
- // src/components/sandbox-files.tsx
2428
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2429
- function SandboxFiles({
2430
- files,
2431
- git,
2432
- fileSystemAvailable = true,
2433
- usePierre = true,
2434
- editable = true,
2435
- onEditIntent,
2436
- initialSelectedPath,
2437
- onSelectedPathChange,
2438
- isNodeVisible,
2439
- hideToolFolders = true,
2440
- requestedPath,
2441
- requestedLine,
2442
- requestedPathRequestId,
2443
- requestedPathReady = true,
2444
- workspaceResting = false,
2445
- workspaceWaking = false,
2446
- liveWorkspaceReady = true,
2447
- workspaceError = null,
2448
- onWakeWorkspace,
2449
- themeType,
2450
- className
2451
- }) {
2452
- const t = useOpenGeniText();
2453
- const [selected, setSelected] = useState3(() => initialSelectedPath ?? null);
2454
- const [editMode, setEditMode] = useState3(false);
2455
- const [focusLine, setFocusLine] = useState3(null);
2456
- const [treeRevealRequest, setTreeRevealRequest] = useState3(null);
2457
- const [liveRequestedPath, setLiveRequestedPath] = useState3(null);
2458
- const [viewReloadRevision, setViewReloadRevision] = useState3(0);
2459
- const viewerScrollRef = useRef3(null);
2460
- const pendingRequestRef = useRef3(null);
2461
- const handledRequestRef = useRef3(null);
2462
- const requestKey = requestedPath ? requestedPathRequestId ?? requestedPath : null;
2463
- const [showHiddenChoice, setShowHiddenChoice] = useShowHiddenFiles();
2464
- const [revealHidden, setRevealHidden] = useState3(false);
2465
- const showHidden = !hideToolFolders || showHiddenChoice || revealHidden;
2466
- const setShowHidden = useCallback3(
2467
- (show) => {
2468
- setRevealHidden(false);
2469
- setShowHiddenChoice(show);
2470
- },
2471
- [setShowHiddenChoice]
2472
- );
2473
- const rootIsRepository = useMemo3(() => treeRootIsRepository(files.tree), [files.tree]);
2474
- const treeNodeVisible = useCallback3(
2475
- (node, context) => (isNodeVisible ? isNodeVisible(node, context) : true) && (showHidden || !isHiddenByDefault(node, context, rootIsRepository)),
2476
- [isNodeVisible, rootIsRepository, showHidden]
2477
- );
2478
- const visibleByDefault = useCallback3(
2479
- (node, context) => !isHiddenByDefault(node, context, rootIsRepository),
2480
- [rootIsRepository]
2481
- );
2482
- const onlyHiddenEntries = useMemo3(() => {
2483
- if (showHidden) return false;
2484
- const top = { depth: 0, parent: null };
2485
- return !files.tree.some((node) => treeNodeVisible(node, top)) && files.tree.some((node) => isNodeVisible ? isNodeVisible(node, top) : true);
2486
- }, [files.tree, isNodeVisible, showHidden, treeNodeVisible]);
2487
- useEffect3(() => {
2488
- if (!requestedPath || requestKey === null) {
2489
- pendingRequestRef.current = null;
2490
- handledRequestRef.current = null;
2491
- setTreeRevealRequest(null);
2492
- return;
2493
- }
2494
- if (handledRequestRef.current === requestKey) {
2495
- return;
2496
- }
2497
- if (!requestedPathReady) {
2498
- pendingRequestRef.current = requestKey;
2499
- setTreeRevealRequest(null);
2500
- return;
2501
- }
2502
- if ((isNodeVisible || hideToolFolders) && files.loading && files.tree.length === 0) return;
2503
- if (isNodeVisible && !files.loading && files.tree.length === 0) {
2504
- handledRequestRef.current = requestKey;
2505
- pendingRequestRef.current = null;
2506
- setTreeRevealRequest(null);
2507
- return;
2508
- }
2509
- if (filePathVisibility(files.tree, requestedPath, isNodeVisible) === "hidden") {
2510
- handledRequestRef.current = requestKey;
2511
- pendingRequestRef.current = null;
2512
- setTreeRevealRequest(null);
2513
- return;
2514
- }
2515
- if (!showHidden) {
2516
- const visibility = filePathVisibility(files.tree, requestedPath, visibleByDefault);
2517
- if (visibility === "hidden" || visibility === "unknown" && pathMayBeHiddenByDefault(requestedPath)) {
2518
- setRevealHidden(true);
2519
- }
2520
- }
2521
- handledRequestRef.current = requestKey;
2522
- pendingRequestRef.current = null;
2523
- setSelected(requestedPath);
2524
- onSelectedPathChange?.(requestedPath);
2525
- setEditMode(false);
2526
- setFocusLine(requestedLine != null && requestedLine > 0 ? requestedLine : null);
2527
- setTreeRevealRequest({ path: requestedPath, requestId: requestKey });
2528
- setViewReloadRevision((revision) => revision + 1);
2529
- }, [
2530
- files.loading,
2531
- files.tree,
2532
- hideToolFolders,
2533
- visibleByDefault,
2534
- isNodeVisible,
2535
- onSelectedPathChange,
2536
- requestKey,
2537
- requestedLine,
2538
- requestedPath,
2539
- requestedPathReady,
2540
- showHidden
2541
- ]);
2542
- const rootRef = useRef3(null);
2543
- const [wide, setWide] = useState3(false);
2544
- useEffect3(() => {
2545
- const el = rootRef.current;
2546
- if (!el) return;
2547
- const update = () => setWide(el.getBoundingClientRect().width >= 720);
2548
- update();
2549
- if (typeof ResizeObserver === "undefined") return;
2550
- const observer = new ResizeObserver(update);
2551
- observer.observe(el);
2552
- const surface = el.closest("[data-workspace-surface]");
2553
- const surfaceObserver = surface && typeof MutationObserver !== "undefined" ? new MutationObserver(update) : null;
2554
- surfaceObserver?.observe(surface, {
2555
- attributes: true,
2556
- attributeFilter: ["class", "style"]
2557
- });
2558
- return () => {
2559
- observer.disconnect();
2560
- surfaceObserver?.disconnect();
2561
- };
2562
- }, []);
2563
- const resolvedTheme = useThemeType(themeType);
2564
- const selectedVisibility = selected ? filePathVisibility(files.tree, selected, isNodeVisible) : "unknown";
2565
- const visibilityPending = Boolean(isNodeVisible && files.loading && files.tree.length === 0);
2566
- const viewPath = selectedVisibility === "hidden" || visibilityPending ? null : selected;
2567
- useEffect3(() => {
2568
- if (selected === null || selectedVisibility !== "hidden") return;
2569
- setSelected(null);
2570
- onSelectedPathChange?.(null);
2571
- setEditMode(false);
2572
- setFocusLine(null);
2573
- setTreeRevealRequest(null);
2574
- setLiveRequestedPath(null);
2575
- }, [onSelectedPathChange, selected, selectedVisibility]);
2576
- const fileView = useFileView(
2577
- viewPath,
2578
- files.readFile,
2579
- `${files.contentRevision ?? 0}:${viewReloadRevision}`
2580
- );
2581
- useEffect3(() => {
2582
- if (focusLine === null && viewReloadRevision > 0 && viewerScrollRef.current) {
2583
- viewerScrollRef.current.scrollTop = 0;
2584
- }
2585
- }, [focusLine, viewReloadRevision]);
2586
- const selectFile = useCallback3(
2587
- (path) => {
2588
- if (pendingRequestRef.current !== null) {
2589
- handledRequestRef.current = pendingRequestRef.current;
2590
- pendingRequestRef.current = null;
2591
- }
2592
- setSelected(path);
2593
- onSelectedPathChange?.(path);
2594
- setEditMode(false);
2595
- setFocusLine(null);
2596
- setTreeRevealRequest(null);
2597
- setLiveRequestedPath(null);
2598
- setViewReloadRevision(0);
2599
- },
2600
- [onSelectedPathChange]
2601
- );
2602
- const canEdit = editable && viewPath !== null && !fileView.loading && fileView.error === null && !fileView.isBinary && !fileView.truncated && fileView.content !== null;
2603
- const showEditor = canEdit && editMode;
2604
- const captureFileUnavailable = fileView.error instanceof CapturedFileUnavailableError ? fileView.error : null;
2605
- const waitingForSelectedFile = !workspaceError && liveRequestedPath === viewPath && (!liveWorkspaceReady || files.loading) && captureFileUnavailable !== null;
2606
- if (workspaceError && !liveWorkspaceReady && files.source !== "capture") {
2607
- return /* @__PURE__ */ jsxs2(
2608
- Notice,
2609
- {
2610
- className,
2611
- title: t("sandboxFiles.couldNotOpenLiveWorkspace"),
2612
- announce: "alert",
2613
- children: [
2614
- /* @__PURE__ */ jsx2("p", { children: workspaceError.message }),
2615
- onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.retryLiveWorkspace") }) : null
2616
- ]
2617
- }
2618
- );
2619
- }
2620
- if (workspaceResting || workspaceWaking) {
2621
- return /* @__PURE__ */ jsx2("div", { className: cn("h-full", className), "data-opengeni-workspace-resting": true, children: /* @__PURE__ */ jsxs2(
2622
- Notice,
2623
- {
2624
- icon: workspaceWaking ? /* @__PURE__ */ jsx2(
2625
- LoaderCircleIcon,
2626
- {
2627
- className: "size-5 animate-spin motion-reduce:animate-none",
2628
- "aria-hidden": true
2629
- }
2630
- ) : /* @__PURE__ */ jsx2(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
2631
- title: workspaceWaking ? t("sandboxFiles.wakingWorkspace") : t("sandboxFiles.workspaceIsResting"),
2632
- announce: "status",
2633
- children: [
2634
- /* @__PURE__ */ jsx2("p", { children: workspaceWaking ? t("sandboxFiles.connectingToTheLiveFile") : t("sandboxFiles.noCapturedRevisionIsAvailable") }),
2635
- !workspaceWaking && onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.openLiveWorkspace") }) : null
2636
- ]
2637
- }
2638
- ) });
2639
- }
2640
- if (!fileSystemAvailable) {
2641
- return /* @__PURE__ */ jsx2(
2642
- Notice,
2643
- {
2644
- className,
2645
- icon: /* @__PURE__ */ jsx2(FileWarningIcon, { className: "size-5", "aria-hidden": true }),
2646
- title: t("sandboxFiles.filesUnavailable"),
2647
- announce: "alert",
2648
- children: t("sandboxFiles.thisSandboxDoesNotExpose")
2649
- }
2650
- );
2651
- }
2652
- return /* @__PURE__ */ jsxs2("div", { ref: rootRef, className: cn("flex h-full min-h-0 min-w-0 flex-col", className), children: [
2653
- /* @__PURE__ */ jsx2(
2654
- GitHeader,
2655
- {
2656
- loading: Boolean(files.loading || files.gitLoading || files.source === null || git?.loading) && files.gitSummary === null,
2657
- git: files.gitSummary ?? {
2658
- branch: git?.branch ?? null,
2659
- isRepo: git?.isRepo ?? false,
2660
- repoCount: git?.repoCount ?? 0,
2661
- ahead: git?.ahead ?? 0,
2662
- behind: git?.behind ?? 0,
2663
- dirtyCount: git?.diff.length ?? 0
2664
- }
2665
- }
2666
- ),
2667
- /* @__PURE__ */ jsxs2(
2668
- Group,
2669
- {
2670
- orientation: wide ? "horizontal" : "vertical",
2671
- className: cn("min-h-0 flex-1", wide ? "flex-row" : "flex-col"),
2672
- children: [
2673
- /* @__PURE__ */ jsx2(
2674
- Panel,
2675
- {
2676
- id: "sandbox-files-tree",
2677
- defaultSize: wide ? "280px" : "40%",
2678
- minSize: wide ? "180px" : "120px",
2679
- maxSize: wide ? "60%" : "70%",
2680
- className: "flex min-h-0 min-w-0 flex-col",
2681
- children: /* @__PURE__ */ jsx2(
2682
- FileBrowser,
2683
- {
2684
- result: files,
2685
- isNodeVisible: treeNodeVisible,
2686
- showHidden,
2687
- ...hideToolFolders ? { onShowHiddenChange: setShowHidden } : {},
2688
- selectedPath: selected ?? void 0,
2689
- ...treeRevealRequest ? {
2690
- revealPath: treeRevealRequest.path,
2691
- revealPathRequestId: treeRevealRequest.requestId
2692
- } : {},
2693
- onSelectFile: selectFile,
2694
- editable,
2695
- emptyState: onlyHiddenEntries ? /* @__PURE__ */ jsxs2("span", { children: [
2696
- t("sandboxFiles.onlyHiddenFilesHere"),
2697
- " ",
2698
- /* @__PURE__ */ jsx2(
2699
- "button",
2700
- {
2701
- type: "button",
2702
- className: "font-medium text-og-fg underline underline-offset-2 hover:text-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
2703
- onClick: () => setShowHidden(true),
2704
- children: t("fileBrowser.showHiddenFiles")
2705
- }
2706
- )
2707
- ] }) : t("sandboxFiles.thisDirectoryIsEmpty"),
2708
- className: "min-w-0 flex-1"
2709
- }
2710
- )
2711
- }
2712
- ),
2713
- /* @__PURE__ */ jsx2(
2714
- Separator,
2715
- {
2716
- "aria-label": t("sandboxFiles.resizeFileTree"),
2717
- className: cn(
2718
- "group relative z-10 shrink-0 cursor-col-resize outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
2719
- "w-px bg-og-border after:absolute after:inset-y-0 after:left-1/2 after:w-3 after:-translate-x-1/2",
2720
- "hover:bg-og-accent focus-visible:bg-og-accent data-[separator-state=dragging]:bg-og-accent",
2721
- !wide && "h-px w-full cursor-row-resize after:inset-x-0 after:inset-y-auto after:top-1/2 after:h-3 after:w-full after:-translate-x-0 after:-translate-y-1/2"
2722
- )
2723
- }
2724
- ),
2725
- /* @__PURE__ */ jsxs2(
2726
- Panel,
2727
- {
2728
- id: "sandbox-files-viewer",
2729
- minSize: wide ? "240px" : "160px",
2730
- className: cn("flex min-h-0 min-w-0 flex-col", !wide && "border-t border-og-border"),
2731
- children: [
2732
- /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1", children: [
2733
- /* @__PURE__ */ jsx2(
2734
- "span",
2735
- {
2736
- "data-opengeni-selected-file": true,
2737
- className: "min-w-0 truncate font-og-mono text-og-xs text-og-fg-muted",
2738
- children: selected ? focusLine !== null ? `${selected}:${focusLine}` : selected : t("sandboxFiles.noFileSelected")
2739
- }
2740
- ),
2741
- canEdit && /* @__PURE__ */ jsx2(
2742
- Segmented,
2743
- {
2744
- options: [
2745
- { value: "view", label: t("sandboxFiles.view") },
2746
- { value: "edit", label: t("sandboxFiles.edit") }
2747
- ],
2748
- value: editMode ? "edit" : "view",
2749
- onChange: (v) => setEditMode(v === "edit")
2750
- }
2751
- )
2752
- ] }),
2753
- /* @__PURE__ */ jsx2(
2754
- "div",
2755
- {
2756
- ref: viewerScrollRef,
2757
- className: "min-h-0 flex-1 overflow-auto",
2758
- "data-opengeni-file-viewer-scroll": true,
2759
- children: viewPath ? showEditor && fileView.content !== null ? /* @__PURE__ */ jsx2(
2760
- CodeEditor,
2761
- {
2762
- path: viewPath,
2763
- initialContents: fileView.content,
2764
- themeType: resolvedTheme,
2765
- onSave: (contents, expectedContents) => files.writeFile(viewPath, contents, { expectedContent: expectedContents }),
2766
- onOverwrite: (contents) => files.writeFile(viewPath, contents, { force: true }),
2767
- onReload: () => setViewReloadRevision((revision) => revision + 1),
2768
- ...onEditIntent ? { onEditIntent } : {},
2769
- className: "h-full"
2770
- },
2771
- viewPath
2772
- ) : workspaceError && (liveRequestedPath === viewPath || requestedPath === viewPath) && !liveWorkspaceReady ? /* @__PURE__ */ jsxs2(Notice, { title: t("sandboxFiles.couldNotOpenLiveFile"), announce: "alert", children: [
2773
- /* @__PURE__ */ jsx2("p", { children: workspaceError.message }),
2774
- onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.retryLiveFile") }) : null
2775
- ] }) : waitingForSelectedFile ? /* @__PURE__ */ jsx2(
2776
- Notice,
2777
- {
2778
- icon: /* @__PURE__ */ jsx2(
2779
- LoaderCircleIcon,
2780
- {
2781
- className: "size-5 animate-spin motion-reduce:animate-none",
2782
- "aria-hidden": true
2783
- }
2784
- ),
2785
- title: t("sandboxFiles.wakingWorkspace"),
2786
- announce: "status",
2787
- children: t("sandboxFiles.openingViewpathWhenTheLive", { viewPath })
2788
- }
2789
- ) : captureFileUnavailable ? /* @__PURE__ */ jsxs2(
2790
- Notice,
2791
- {
2792
- icon: /* @__PURE__ */ jsx2(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
2793
- title: t("sandboxFiles.onMachine"),
2794
- children: [
2795
- /* @__PURE__ */ jsx2("p", { children: captureFileUnavailable.reason === "too-large" ? t("sandboxFiles.thisFileIsLargerThan") : captureFileUnavailable.reason === "content-missing" ? t("sandboxFiles.theCapturedCopyIsNo") : t("sandboxFiles.thisFileWasIndexedBut") }),
2796
- onWakeWorkspace ? /* @__PURE__ */ jsx2(
2797
- WakeButton,
2798
- {
2799
- onClick: () => {
2800
- setLiveRequestedPath(viewPath);
2801
- if (liveWorkspaceReady) void files.refresh();
2802
- else onWakeWorkspace();
2803
- },
2804
- children: liveWorkspaceReady ? t("sandboxFiles.retryLiveFile") : t("sandboxFiles.openLiveFile")
2805
- }
2806
- ) : null
2807
- ]
2808
- }
2809
- ) : fileView.error ? /* @__PURE__ */ jsx2(Notice, { announce: "alert", children: t("sandboxFiles.couldNotOpenViewpathMessage", {
2810
- viewPath,
2811
- message: fileView.error.message
2812
- }) }) : fileView.loading ? /* @__PURE__ */ jsx2(Notice, { announce: "status", children: t("sandboxFiles.loadingViewpath", { viewPath }) }) : fileView.imageUrl ? /* @__PURE__ */ jsx2(
2813
- RasterFilePreview,
2814
- {
2815
- src: fileView.imageUrl,
2816
- path: viewPath
2817
- },
2818
- fileView.imageUrl
2819
- ) : fileView.isBinary ? /* @__PURE__ */ jsxs2(Notice, { children: [
2820
- t("sandboxFiles.viewpathIsABinaryFile", { viewPath }),
2821
- fileView.sizeBytes ?? 0,
2822
- " ",
2823
- t("sandboxFiles.bytes")
2824
- ] }) : fileView.content !== null ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
2825
- fileView.truncated && /* @__PURE__ */ jsxs2("div", { className: "border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-status-running", children: [
2826
- t("sandboxFiles.largeFileShowingATruncated"),
2827
- fileView.sizeBytes ?? 0,
2828
- " ",
2829
- t("sandboxFiles.bytesLoadedEditingIsDisabled")
2830
- ] }),
2831
- usePierre && focusLine === null ? /* @__PURE__ */ jsx2(
2832
- PierreFile,
2833
- {
2834
- path: viewPath,
2835
- contents: fileView.content,
2836
- themeType: resolvedTheme,
2837
- fallback: /* @__PURE__ */ jsx2("pre", { className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg", children: fileView.content }),
2838
- className: "p-1"
2839
- },
2840
- `${viewPath}:${viewReloadRevision}`
2841
- ) : focusLine !== null ? /* @__PURE__ */ jsx2(
2842
- LineNumberedFile,
2843
- {
2844
- path: viewPath,
2845
- contents: fileView.content,
2846
- focusLine
2847
- }
2848
- ) : /* @__PURE__ */ jsx2("pre", { className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg", children: fileView.content })
2849
- ] }) : /* @__PURE__ */ jsx2(Notice, { announce: "status", children: t("sandboxFiles.loadingViewpath", { viewPath }) }) : (
2850
- // Nothing selected — the tree shows the whole workspace; pick a file.
2851
- requestedPath && !requestedPathReady ? workspaceError ? /* @__PURE__ */ jsxs2(Notice, { title: t("sandboxFiles.couldNotOpenLiveFile"), announce: "alert", children: [
2852
- /* @__PURE__ */ jsx2("p", { children: workspaceError.message }),
2853
- onWakeWorkspace ? /* @__PURE__ */ jsx2(WakeButton, { onClick: onWakeWorkspace, children: t("sandboxFiles.retryLiveFile") }) : null
2854
- ] }) : /* @__PURE__ */ jsx2(
2855
- Notice,
2856
- {
2857
- icon: /* @__PURE__ */ jsx2(
2858
- LoaderCircleIcon,
2859
- {
2860
- className: "size-5 animate-spin motion-reduce:animate-none",
2861
- "aria-hidden": true
2862
- }
2863
- ),
2864
- title: t("sandboxFiles.wakingSandbox"),
2865
- announce: "status",
2866
- children: t("sandboxFiles.openingRequestedpathWhenTheLive", { requestedPath })
2867
- }
2868
- ) : /* @__PURE__ */ jsx2(
2869
- Notice,
2870
- {
2871
- icon: /* @__PURE__ */ jsx2(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
2872
- title: t("sandboxFiles.chooseAFile"),
2873
- children: t("sandboxFiles.selectAFileInThe")
2874
- }
2875
- )
2876
- )
2877
- }
2878
- )
2879
- ]
2880
- }
2881
- )
2882
- ]
2883
- }
2884
- )
2885
- ] });
2886
- }
2887
- function WakeButton({ children, onClick }) {
2888
- return /* @__PURE__ */ jsx2(
2889
- "button",
2890
- {
2891
- type: "button",
2892
- onClick,
2893
- className: "mt-1 inline-flex min-h-11 items-center justify-center rounded-og-md border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-2 text-og-sm font-medium transition-colors hover:bg-og-primary-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent focus-visible:ring-offset-2 focus-visible:ring-offset-og-bg",
2894
- children
2895
- }
2896
- );
2897
- }
2898
- function LineNumberedFile({
2899
- path,
2900
- contents,
2901
- focusLine
2902
- }) {
2903
- const t = useOpenGeniText();
2904
- const lines = contents.split("\n");
2905
- const inRange = focusLine >= 1 && focusLine <= lines.length;
2906
- const targetRef = useRef3(null);
2907
- useEffect3(() => {
2908
- targetRef.current?.scrollIntoView({
2909
- block: "center",
2910
- behavior: prefersReducedMotion() ? "auto" : "smooth"
2911
- });
2912
- }, [path, focusLine, contents]);
2913
- return /* @__PURE__ */ jsxs2(
2914
- "div",
2915
- {
2916
- className: "h-full min-h-0 overflow-auto font-og-mono text-og-sm text-og-fg",
2917
- role: "region",
2918
- "aria-label": inRange ? t("sandboxFiles.pathAtLineFocusline", { path, focusLine }) : path,
2919
- children: [
2920
- !inRange ? /* @__PURE__ */ jsx2(
2921
- "p",
2922
- {
2923
- className: "border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted",
2924
- role: "status",
2925
- children: t("sandboxFiles.lineFocuslineIsPastThe", { focusLine })
2926
- }
2927
- ) : null,
2928
- /* @__PURE__ */ jsx2("div", { children: lines.map((text, index) => {
2929
- const lineNumber = index + 1;
2930
- const focused = inRange && lineNumber === focusLine;
2931
- return /* @__PURE__ */ jsxs2(
2932
- "div",
2933
- {
2934
- ref: focused ? targetRef : void 0,
2935
- "data-opengeni-file-line": lineNumber,
2936
- ...focused ? { "data-opengeni-focus-line": "" } : {},
2937
- "aria-current": focused ? "location" : void 0,
2938
- className: cn("flex gap-3 px-2 py-0.5 leading-6", focused && "bg-og-accent-soft"),
2939
- children: [
2940
- /* @__PURE__ */ jsx2("span", { className: "w-11 shrink-0 select-none text-right tabular-nums text-og-fg-subtle", children: lineNumber }),
2941
- /* @__PURE__ */ jsx2("pre", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: text || " " })
2942
- ]
2943
- },
2944
- lineNumber
2945
- );
2946
- }) })
2947
- ]
2948
- }
2949
- );
2950
- }
2951
- function GitHeader({ git, loading }) {
2952
- const t = useOpenGeniText();
2953
- if (loading) {
2954
- return /* @__PURE__ */ jsxs2(
2955
- "div",
2956
- {
2957
- className: "flex shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-sm text-og-fg-muted",
2958
- role: "status",
2959
- "aria-live": "polite",
2960
- children: [
2961
- /* @__PURE__ */ jsx2(
2962
- LoaderCircleIcon,
2963
- {
2964
- className: "size-3.5 shrink-0 animate-spin motion-reduce:animate-none",
2965
- "aria-hidden": true
2966
- }
2967
- ),
2968
- /* @__PURE__ */ jsx2("span", { children: t("sandboxFiles.loadingRepository") })
2969
- ]
2970
- }
2971
- );
2972
- }
2973
- const dirty = git.dirtyCount > 0;
2974
- return /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-sm", children: [
2975
- /* @__PURE__ */ jsx2(
2976
- "span",
2977
- {
2978
- "aria-hidden": "true",
2979
- className: cn(
2980
- "size-2 shrink-0 rounded-full",
2981
- dirty ? "bg-og-status-running" : "bg-og-status-idle"
2982
- )
2983
- }
2984
- ),
2985
- /* @__PURE__ */ jsx2("span", { className: "sr-only", children: dirty ? t("sandboxFiles.uncommittedChangesInDirtycountFiles", { dirtyCount: git.dirtyCount }) : t("sandboxFiles.noUncommittedChanges") }),
2986
- /* @__PURE__ */ jsx2("span", { className: "truncate font-og-mono text-og-fg", children: git.repoCount > 1 ? t("sandboxFiles.repocountRepositories", { repoCount: git.repoCount }) : git.branch ?? (git.isRepo ? t("sandboxFiles.detached") : t("sandboxFiles.noRepo")) }),
2987
- (git.ahead > 0 || git.behind > 0) && /* @__PURE__ */ jsxs2("span", { className: "flex shrink-0 items-center gap-1.5 text-og-xs text-og-fg-subtle", children: [
2988
- git.ahead > 0 && /* @__PURE__ */ jsxs2("span", { "data-contrast-audited": true, children: [
2989
- "\u2191",
2990
- git.ahead
2991
- ] }),
2992
- git.behind > 0 && /* @__PURE__ */ jsxs2("span", { "data-contrast-audited": true, children: [
2993
- "\u2193",
2994
- git.behind
2995
- ] })
2996
- ] }),
2997
- dirty && /* @__PURE__ */ jsx2(
2998
- "span",
2999
- {
3000
- "aria-hidden": "true",
3001
- "data-contrast-audited": true,
3002
- className: "ml-auto shrink-0 text-og-xs text-og-fg-subtle",
3003
- children: t("sandboxFiles.dirtycountChanged", { dirtyCount: git.dirtyCount })
3004
- }
3005
- )
3006
- ] });
3007
- }
3008
- function Segmented({
3009
- options,
3010
- value,
3011
- onChange
3012
- }) {
3013
- return /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center rounded-og-sm border border-og-border p-0.5", children: options.map((opt) => /* @__PURE__ */ jsx2(
3014
- "button",
3015
- {
3016
- type: "button",
3017
- onClick: () => onChange(opt.value),
3018
- className: cn(
3019
- "min-h-7 rounded-og-xs px-1.5 py-0.5 text-og-xs focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent max-[1023px]:min-h-11 max-[1023px]:min-w-11 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
3020
- opt.value === value ? "bg-og-accent-soft text-og-fg" : "text-og-fg-subtle hover:text-og-fg"
3021
- ),
3022
- children: opt.label
3023
- },
3024
- opt.value
3025
- )) });
3026
- }
3027
- function useFileView(path, readFile, reloadRevision = 0) {
3028
- const previousPathRef = useRef3(null);
3029
- const [state, setState] = useState3({
3030
- content: null,
3031
- isBinary: false,
3032
- truncated: false,
3033
- sizeBytes: null,
3034
- loading: false,
3035
- error: null
3036
- });
3037
- useEffect3(() => {
3038
- if (!path) {
3039
- previousPathRef.current = null;
3040
- setState({
3041
- content: null,
3042
- isBinary: false,
3043
- truncated: false,
3044
- sizeBytes: null,
3045
- loading: false,
3046
- error: null
3047
- });
3048
- return;
3049
- }
3050
- const pathChanged = previousPathRef.current !== path;
3051
- previousPathRef.current = path;
3052
- let cancelled = false;
3053
- const abort = new AbortController();
3054
- if (pathChanged) {
3055
- setState({
3056
- content: null,
3057
- isBinary: false,
3058
- truncated: false,
3059
- sizeBytes: null,
3060
- loading: true,
3061
- error: null
3062
- });
3063
- } else {
3064
- setState((previous) => ({ ...previous, error: null }));
3065
- }
3066
- void readFile(path, { signal: abort.signal }).then((res) => {
3067
- if (cancelled) return;
3068
- const content = res.isBinary ? null : res.encoding === "base64" ? decodeBase64Utf8(res.content) : res.content;
3069
- setState({
3070
- content,
3071
- imageUrl: !res.truncated && res.encoding === "base64" ? rasterImageUrl(path, res.content) : null,
3072
- isBinary: res.isBinary,
3073
- truncated: res.truncated,
3074
- sizeBytes: res.sizeBytes,
3075
- loading: false,
3076
- error: null
3077
- });
3078
- }).catch((cause) => {
3079
- if (cancelled) return;
3080
- const error = cause instanceof Error ? cause : new Error(String(cause));
3081
- setState(
3082
- (previous) => pathChanged ? {
3083
- content: null,
3084
- isBinary: false,
3085
- truncated: false,
3086
- sizeBytes: null,
3087
- loading: false,
3088
- error
3089
- } : { ...previous, loading: false, error }
3090
- );
3091
- });
3092
- return () => {
3093
- cancelled = true;
3094
- abort.abort();
3095
- };
3096
- }, [path, readFile, reloadRevision]);
3097
- return state;
3098
- }
3099
- function rasterImageUrl(path, content) {
3100
- const extension = path.split(".").pop()?.toLowerCase();
3101
- const mime = extension === "png" ? "image/png" : extension === "jpg" || extension === "jpeg" ? "image/jpeg" : extension === "gif" ? "image/gif" : extension === "webp" ? "image/webp" : null;
3102
- return mime ? `data:${mime};base64,${content}` : null;
3103
- }
3104
- function RasterFilePreview({ src, path }) {
3105
- const t = useOpenGeniText();
3106
- const [failed, setFailed] = useState3(false);
3107
- return failed ? /* @__PURE__ */ jsx2(Notice, { title: t("sandboxFiles.imagePreviewUnavailable"), announce: "alert", children: t("sandboxFiles.couldNotDecodePathAs", { path }) }) : /* @__PURE__ */ jsx2(
3108
- "img",
3109
- {
3110
- src,
3111
- alt: path,
3112
- onError: () => setFailed(true),
3113
- className: "max-w-full object-contain"
3114
- }
3115
- );
3116
- }
3117
- function decodeBase64Utf8(b64) {
3118
- try {
3119
- if (typeof atob === "function") {
3120
- const binary = atob(b64);
3121
- const bytes = new Uint8Array(binary.length);
3122
- for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
3123
- return new TextDecoder().decode(bytes);
3124
- }
3125
- } catch {
3126
- }
3127
- return b64;
3128
- }
3129
- function Notice({
3130
- children,
3131
- className,
3132
- icon,
3133
- title,
3134
- announce
3135
- }) {
3136
- return /* @__PURE__ */ jsx2(
3137
- "div",
3138
- {
3139
- role: announce,
3140
- "aria-atomic": announce ? "true" : void 0,
3141
- "aria-live": announce === "alert" ? "assertive" : announce === "status" ? "polite" : void 0,
3142
- className: cn(
3143
- "flex h-full items-center justify-center p-4 text-center text-og-sm text-og-fg-subtle",
3144
- className
3145
- ),
3146
- children: /* @__PURE__ */ jsxs2("div", { className: "flex max-w-sm flex-col items-center gap-2.5", children: [
3147
- icon ? /* @__PURE__ */ jsx2("span", { className: "grid size-10 place-items-center rounded-og-lg border border-og-border bg-og-surface-1 text-og-fg-muted shadow-sm", children: icon }) : null,
3148
- title ? /* @__PURE__ */ jsx2("p", { className: "font-medium text-og-fg", children: title }) : null,
3149
- /* @__PURE__ */ jsx2("div", { "data-contrast-audited": true, className: "leading-5", children })
3150
- ] })
3151
- }
3152
- );
3153
- }
3154
- var SHOW_HIDDEN_FILES_KEY = "og.files.show-hidden:v1";
3155
- function useShowHiddenFiles() {
3156
- const [show, setShow] = useState3(() => {
3157
- try {
3158
- return typeof window !== "undefined" && window.localStorage.getItem(SHOW_HIDDEN_FILES_KEY) === "1";
3159
- } catch {
3160
- return false;
3161
- }
3162
- });
3163
- const update = useCallback3((next) => {
3164
- setShow(next);
3165
- try {
3166
- if (next) window.localStorage.setItem(SHOW_HIDDEN_FILES_KEY, "1");
3167
- else window.localStorage.removeItem(SHOW_HIDDEN_FILES_KEY);
3168
- } catch {
3169
- }
3170
- }, []);
3171
- return [show, update];
3172
- }
3173
-
3174
- export {
3175
- visibleFileTree,
3176
- filePathVisibility,
3177
- CapturedFileUnavailableError,
3178
- FileWriteConflictError,
3179
- useSandboxFiles,
3180
- FileBrowser,
3181
- SandboxFiles
3182
- };
3183
- //# sourceMappingURL=chunk-KLYBSXHE.js.map