@mcp-b/react-components 0.63.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/dist/{AgentActivity-DptCj8XQ.d.ts → AgentActivity-Cngwkalq.d.ts} +2 -9
  2. package/dist/{AgentChatQueue-DG2rGyCI.d.ts → AgentChatQueue-C1TDnVAn.d.ts} +1 -1
  3. package/dist/{AppTopBar-DwzydmXu.d.ts → AppTopBar-CM57rJID.d.ts} +7 -3
  4. package/dist/ChatGptSignInScreen-CmbBe09G.js +298 -0
  5. package/dist/{CodeBlock-BTkag9ms.d.ts → CodeBlock-BDupVceI.d.ts} +1 -1
  6. package/dist/CodeBlock-dt0L8md0.js +892 -0
  7. package/dist/{EmployeeChrome--PWdtg4B.d.ts → EmployeeChrome-kegSASjC.d.ts} +6 -5
  8. package/dist/{ExecutionBoard-DvPGdn4F.d.ts → ExecutionBoard-DBj1Aiva.d.ts} +8 -1
  9. package/dist/ExecutionResult-CXnGcmM4.js +671 -0
  10. package/dist/FileTree-CjfzpN6X.js +968 -0
  11. package/dist/{IconButton-FWsa9562.d.ts → IconButton-DXtGMkMI.d.ts} +7 -5
  12. package/dist/ManagerOffice-T79utm-P.js +2469 -0
  13. package/dist/{Menu-FA4P6KrA.d.ts → Menu-DajfQr3T.d.ts} +4 -2
  14. package/dist/{Message-BUedRDN1.d.ts → Message-BLyl6kWe.d.ts} +2 -2
  15. package/dist/{PromptInput-Dbe6WgWA.d.ts → PromptInput-DEwFMj6f.d.ts} +5 -8
  16. package/dist/{ResponsiveSidebarShell-DSAMNDdg.d.ts → ResponsiveSidebarShell-RwvmlMHS.d.ts} +23 -13
  17. package/dist/SetupChecklist-DwscX3Bw.js +230 -0
  18. package/dist/{Tabs-BYs-RgJ7.d.ts → Tabs-tyvVX3nc.d.ts} +29 -10
  19. package/dist/{ThinkChatActivity-zZaSsbC-.d.ts → ThinkChatActivity-C7xnO0Fx.d.ts} +1 -1
  20. package/dist/{ThinkChatActivitySummary-8MO1VjAJ.d.ts → ThinkChatActivitySummary-Dh4Av7x_.d.ts} +1 -1
  21. package/dist/{ThinkExecutionRun-DJ2TFDmZ.d.ts → ThinkExecutionRun-QzZVWX75.d.ts} +11 -3
  22. package/dist/ThinkSchedule-D4Ulsa0-.d.ts +53 -0
  23. package/dist/{ThinkThreadPicker-BmIZmpae.d.ts → ThinkThreadPicker-O-i2KloZ.d.ts} +1 -1
  24. package/dist/{Workspace-42LA9Zrb.d.ts → Workspace-B9nuTfIi.d.ts} +1 -1
  25. package/dist/{WorkspaceAutomation-yDZorXla.d.ts → WorkspaceAutomation-C0fghGLi.d.ts} +3 -3
  26. package/dist/WorkspaceBrowser-oBJv-Dac.js +985 -0
  27. package/dist/{WorkspaceConcept-BjrgGE1w.d.ts → WorkspaceConcept-D46cYerS.d.ts} +1 -1
  28. package/dist/{WorkspaceFile-nK2n0i4S.d.ts → WorkspaceFile-BJC6vlp_.d.ts} +15 -4
  29. package/dist/WorkspaceFileCommands-SNIjRgtU.d.ts +145 -0
  30. package/dist/WorkspaceFileTransfer-BRD22nW-.d.ts +159 -0
  31. package/dist/WorkspaceLink-DDkj-Tq5.js +407 -0
  32. package/dist/{WorkspaceMessageResponse-BZ-_I18b.js → WorkspaceMessageResponse-CXGOQgpo.js} +111 -24
  33. package/dist/{agent-tool-runs-DsOp_X2y.js → agent-tool-runs-BXKdcxl8.js} +55 -28
  34. package/dist/app-bar-outlet-BEIGl9iF.js +35 -0
  35. package/{LICENSE → dist/assets/desktop/LICENSE.fluent.txt} +1 -1
  36. package/dist/assets/desktop/LICENSE.mac-icons.txt +7 -0
  37. package/dist/assets/desktop/README.md +43 -0
  38. package/dist/assets/desktop/automations.svg +19 -0
  39. package/dist/assets/desktop/document.svg +24 -0
  40. package/dist/assets/desktop/folder.png +0 -0
  41. package/dist/assets/desktop/mail.svg +31 -0
  42. package/dist/assets/desktop/settings.svg +9 -0
  43. package/dist/assets/desktop/trash-full.svg +23 -0
  44. package/dist/assets/desktop/trash.svg +19 -0
  45. package/dist/attachment-preview-DeRqFjdz.js +68 -0
  46. package/dist/attempt-CySQHJsF.js +21 -0
  47. package/dist/command-search-1fjmCBBo.js +34 -0
  48. package/dist/components/agents-sdk/AIProviderDialog.js +757 -224
  49. package/dist/components/agents-sdk/AgentActivity.d.ts +2 -2
  50. package/dist/components/agents-sdk/AgentActivity.js +78 -31
  51. package/dist/components/agents-sdk/AgentChat.d.ts +3 -3
  52. package/dist/components/agents-sdk/AgentChat.js +1113 -386
  53. package/dist/components/agents-sdk/AgentChatQueue.d.ts +1 -1
  54. package/dist/components/agents-sdk/AgentChatQueue.js +290 -173
  55. package/dist/components/agents-sdk/AgentComputer.d.ts +270 -0
  56. package/dist/components/agents-sdk/AgentComputer.js +8045 -0
  57. package/dist/components/agents-sdk/AgentEvent.js +164 -21
  58. package/dist/components/agents-sdk/AgentScreenSwitcher.d.ts +46 -0
  59. package/dist/components/agents-sdk/AgentScreenSwitcher.js +409 -0
  60. package/dist/components/agents-sdk/AgentToolRunsContext.js +139 -41
  61. package/dist/components/agents-sdk/BrowserLiveScreen.js +860 -551
  62. package/dist/components/agents-sdk/BrowserLiveView.d.ts +1 -1
  63. package/dist/components/agents-sdk/BrowserLiveView.js +244 -88
  64. package/dist/components/agents-sdk/BrowserReplay.js +298 -133
  65. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +57 -1
  66. package/dist/components/agents-sdk/BrowserRunPanel.js +979 -129
  67. package/dist/components/agents-sdk/DiscordConnectionDialog.js +104 -57
  68. package/dist/components/agents-sdk/EmployeeApp.d.ts +1 -1
  69. package/dist/components/agents-sdk/EmployeeApp.js +108 -46
  70. package/dist/components/agents-sdk/EmployeeChat.d.ts +1 -1
  71. package/dist/components/agents-sdk/EmployeeChat.js +500 -99
  72. package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
  73. package/dist/components/agents-sdk/EmployeeChrome.js +1375 -557
  74. package/dist/components/agents-sdk/EmployeeSchedules.d.ts +3 -3
  75. package/dist/components/agents-sdk/EmployeeSchedules.js +281 -64
  76. package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +2 -2
  77. package/dist/components/agents-sdk/EmployeeStartScreen.js +185 -52
  78. package/dist/components/agents-sdk/ExecutionBoard.d.ts +1 -1
  79. package/dist/components/agents-sdk/ExecutionBoard.js +1661 -462
  80. package/dist/components/agents-sdk/ManagerAccountActions.js +142 -35
  81. package/dist/components/agents-sdk/ManagerOffice.d.ts +15 -8
  82. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  83. package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
  84. package/dist/components/agents-sdk/ManagerOfficeScreens.js +551 -185
  85. package/dist/components/agents-sdk/McpConnectionRequest.js +332 -117
  86. package/dist/components/agents-sdk/McpConnectorForm.js +320 -100
  87. package/dist/components/agents-sdk/McpPluginCatalog.js +697 -249
  88. package/dist/components/agents-sdk/McpServerIcon.js +57 -14
  89. package/dist/components/agents-sdk/McpServerPicker.d.ts +1 -1
  90. package/dist/components/agents-sdk/McpServerPicker.js +542 -158
  91. package/dist/components/agents-sdk/ModelSelector.js +1151 -253
  92. package/dist/components/agents-sdk/PromptInputApproval.js +115 -27
  93. package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
  94. package/dist/components/agents-sdk/PromptInputCommands.js +33 -46
  95. package/dist/components/agents-sdk/SlackConnectionDialog.js +38 -14
  96. package/dist/components/agents-sdk/SubagentRunIndicator.js +118 -25
  97. package/dist/components/agents-sdk/SubagentRunLanes.js +291 -107
  98. package/dist/components/agents-sdk/SubagentRunPanel.js +357 -129
  99. package/dist/components/agents-sdk/SubagentRunSelector.js +123 -26
  100. package/dist/components/agents-sdk/ThinkChat.d.ts +2 -2
  101. package/dist/components/agents-sdk/ThinkChat.js +321 -132
  102. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  103. package/dist/components/agents-sdk/ThinkChatActivity.js +306 -100
  104. package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
  105. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +15 -9
  106. package/dist/components/agents-sdk/ThinkChatToolPanels.js +1386 -404
  107. package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +5 -3
  108. package/dist/components/agents-sdk/ThinkExecutionDetail.js +219 -45
  109. package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +2 -2
  110. package/dist/components/agents-sdk/ThinkExecutionRun.js +19 -11
  111. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +5 -3
  112. package/dist/components/agents-sdk/ThinkExecutionStatus.js +224 -37
  113. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +8 -5
  114. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +505 -124
  115. package/dist/components/agents-sdk/ThinkFullApp.js +147 -44
  116. package/dist/components/agents-sdk/ThinkPendingApproval.js +381 -75
  117. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +71 -26
  118. package/dist/components/agents-sdk/ThinkSchedule.d.ts +2 -2
  119. package/dist/components/agents-sdk/ThinkSchedule.js +124 -1
  120. package/dist/components/agents-sdk/ThinkScheduleActions.d.ts +3 -3
  121. package/dist/components/agents-sdk/ThinkScheduleActions.js +363 -132
  122. package/dist/components/agents-sdk/ThinkScheduleBrowser.d.ts +1 -1
  123. package/dist/components/agents-sdk/ThinkScheduleBrowser.js +249 -116
  124. package/dist/components/agents-sdk/ThinkScheduleDetail.d.ts +2 -2
  125. package/dist/components/agents-sdk/ThinkScheduleDetail.js +311 -90
  126. package/dist/components/agents-sdk/ThinkScheduleForm.d.ts +6 -2
  127. package/dist/components/agents-sdk/ThinkScheduleForm.js +1318 -475
  128. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +1 -1
  129. package/dist/components/agents-sdk/ThinkThreadPicker.js +434 -214
  130. package/dist/components/agents-sdk/TypeSafeConnectionDialog.js +30 -13
  131. package/dist/components/agents-sdk/WorkbenchBack.js +66 -20
  132. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  133. package/dist/components/agents-sdk/Workspace.js +491 -166
  134. package/dist/components/agents-sdk/WorkspaceAutomation.d.ts +1 -1
  135. package/dist/components/agents-sdk/WorkspaceAutomation.js +1492 -415
  136. package/dist/components/agents-sdk/WorkspaceAutomationTable.d.ts +1 -1
  137. package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1316 -525
  138. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +72 -2
  139. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -94
  140. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +1 -1
  141. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +1 -1
  142. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +619 -178
  143. package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +45 -0
  144. package/dist/components/agents-sdk/WorkspaceDesktop.js +240 -0
  145. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +52 -1
  146. package/dist/components/agents-sdk/WorkspaceExplorer.js +267 -85
  147. package/dist/components/agents-sdk/WorkspaceFile.d.ts +2 -2
  148. package/dist/components/agents-sdk/WorkspaceFile.js +30 -9
  149. package/dist/components/agents-sdk/WorkspaceFileCommands.d.ts +2 -0
  150. package/dist/components/agents-sdk/WorkspaceFileCommands.js +890 -0
  151. package/dist/components/agents-sdk/WorkspaceFileDetails.d.ts +29 -0
  152. package/dist/components/agents-sdk/WorkspaceFileDetails.js +271 -0
  153. package/dist/components/agents-sdk/WorkspaceFileTransfer.d.ts +2 -0
  154. package/dist/components/agents-sdk/WorkspaceFileTransfer.js +505 -0
  155. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +18 -3
  156. package/dist/components/agents-sdk/WorkspaceFileView.js +866 -1
  157. package/dist/components/agents-sdk/WorkspaceHeader.js +71 -26
  158. package/dist/components/agents-sdk/WorkspaceLink.js +2 -2
  159. package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -2
  160. package/dist/components/agents-sdk/WorkspaceLive.js +126 -73
  161. package/dist/components/agents-sdk/WorkspaceLocalFolder.d.ts +63 -0
  162. package/dist/components/agents-sdk/WorkspaceLocalFolder.js +455 -0
  163. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +1 -1
  164. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  165. package/dist/components/agents-sdk/WorkspaceMountManager.js +118 -58
  166. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +90 -54
  167. package/dist/components/agents-sdk/WorkspacePerson.d.ts +2 -2
  168. package/dist/components/agents-sdk/WorkspacePerson.js +172 -41
  169. package/dist/components/agents-sdk/WorkspaceProject.d.ts +2 -2
  170. package/dist/components/agents-sdk/WorkspaceProject.js +175 -41
  171. package/dist/components/ai-sdk/Activity.js +768 -192
  172. package/dist/components/ai-sdk/AgentAttention.js +286 -58
  173. package/dist/components/ai-sdk/AgentChatMessageEditor.js +193 -68
  174. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +1 -1
  175. package/dist/components/ai-sdk/AgentChatStartScreen.js +368 -80
  176. package/dist/components/ai-sdk/AgentChatTurnError.js +75 -25
  177. package/dist/components/ai-sdk/AgentMessageParts.js +0 -1
  178. package/dist/components/ai-sdk/Approval.js +574 -172
  179. package/dist/components/ai-sdk/Artifact.d.ts +1 -1
  180. package/dist/components/ai-sdk/Artifact.js +535 -128
  181. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  182. package/dist/components/ai-sdk/ChainOfThought.js +404 -80
  183. package/dist/components/ai-sdk/Checkpoint.js +229 -45
  184. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  185. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  186. package/dist/components/ai-sdk/ComposerLink.js +216 -48
  187. package/dist/components/ai-sdk/ConnectedAppCards.js +229 -52
  188. package/dist/components/ai-sdk/Context.js +737 -178
  189. package/dist/components/ai-sdk/Conversation.d.ts +1 -1
  190. package/dist/components/ai-sdk/Conversation.js +305 -68
  191. package/dist/components/ai-sdk/ExpansionState.js +74 -15
  192. package/dist/components/ai-sdk/Goal.js +435 -116
  193. package/dist/components/ai-sdk/InlineCitation.js +313 -76
  194. package/dist/components/ai-sdk/MediaPreviewCard.js +451 -135
  195. package/dist/components/ai-sdk/Message.d.ts +1 -1
  196. package/dist/components/ai-sdk/Message.js +1010 -195
  197. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  198. package/dist/components/ai-sdk/MessageScroller.js +264 -46
  199. package/dist/components/ai-sdk/MessageScrollerVirtual.js +6 -6
  200. package/dist/components/ai-sdk/Plan.js +639 -128
  201. package/dist/components/ai-sdk/PromptInput.d.ts +1 -1
  202. package/dist/components/ai-sdk/PromptInput.js +2735 -794
  203. package/dist/components/ai-sdk/PromptInputComposerEditor.d.ts +1 -3
  204. package/dist/components/ai-sdk/PromptInputComposerEditor.js +188 -83
  205. package/dist/components/ai-sdk/Queue.js +792 -154
  206. package/dist/components/ai-sdk/Reasoning.js +268 -69
  207. package/dist/components/ai-sdk/Sources.js +226 -63
  208. package/dist/components/ai-sdk/Task.js +294 -71
  209. package/dist/components/ai-sdk/ToolApproval.js +126 -26
  210. package/dist/components/ai-sdk/ToolInvocation.js +112 -22
  211. package/dist/components/extension/ChatGptSignInScreen.js +1 -82
  212. package/dist/components/extension/CodexModelSelector.d.ts +1 -1
  213. package/dist/components/extension/CodexModelSelector.js +467 -146
  214. package/dist/components/extension/ConversationTabPicker.d.ts +1 -1
  215. package/dist/components/extension/ConversationTabPicker.js +254 -76
  216. package/dist/components/extension/FirstRunSetup.d.ts +61 -35
  217. package/dist/components/extension/FirstRunSetup.js +3834 -1012
  218. package/dist/components/foundations/Accordion.js +186 -41
  219. package/dist/components/foundations/AlertDialog.js +425 -97
  220. package/dist/components/foundations/AppIcon.d.ts +13 -13
  221. package/dist/components/foundations/AppIcon.js +183 -34
  222. package/dist/components/foundations/Autocomplete.js +408 -89
  223. package/dist/components/foundations/Avatar.d.ts +100 -2
  224. package/dist/components/foundations/Avatar.js +204 -44
  225. package/dist/components/foundations/Button.js +64 -13
  226. package/dist/components/foundations/Card.js +357 -63
  227. package/dist/components/foundations/Checkbox.js +82 -17
  228. package/dist/components/foundations/CheckboxGroup.js +266 -58
  229. package/dist/components/foundations/Collapsible.d.ts +2 -1
  230. package/dist/components/foundations/Collapsible.js +129 -26
  231. package/dist/components/foundations/Combobox.js +408 -89
  232. package/dist/components/foundations/ContextMenu.d.ts +2 -2
  233. package/dist/components/foundations/ContextMenu.js +591 -117
  234. package/dist/components/foundations/DescriptionList.js +159 -28
  235. package/dist/components/foundations/Dialog.js +373 -89
  236. package/dist/components/foundations/EmptyState.js +86 -23
  237. package/dist/components/foundations/Favicon.d.ts +17 -0
  238. package/dist/components/foundations/Favicon.js +62 -0
  239. package/dist/components/foundations/Field.js +525 -108
  240. package/dist/components/foundations/Fieldset.js +115 -23
  241. package/dist/components/foundations/Form.js +38 -9
  242. package/dist/components/foundations/FormattedDate.d.ts +19 -5
  243. package/dist/components/foundations/FormattedDate.js +82 -12
  244. package/dist/components/foundations/IconButton.d.ts +1 -1
  245. package/dist/components/foundations/IconButton.js +114 -17
  246. package/dist/components/foundations/Input.js +38 -9
  247. package/dist/components/foundations/Kbd.js +55 -10
  248. package/dist/components/foundations/Label.js +56 -12
  249. package/dist/components/foundations/LinkButton.js +67 -15
  250. package/dist/components/foundations/Marker.js +138 -29
  251. package/dist/components/foundations/Menu.d.ts +1 -1
  252. package/dist/components/foundations/Menu.js +634 -136
  253. package/dist/components/foundations/Menubar.d.ts +2 -2
  254. package/dist/components/foundations/Menubar.js +685 -130
  255. package/dist/components/foundations/Meter.js +186 -41
  256. package/dist/components/foundations/NavigationMenu.js +426 -95
  257. package/dist/components/foundations/NumberField.js +223 -49
  258. package/dist/components/foundations/Popover.js +398 -88
  259. package/dist/components/foundations/PreviewCard.js +234 -53
  260. package/dist/components/foundations/Progress.js +117 -25
  261. package/dist/components/foundations/RadioGroup.d.ts +13 -5
  262. package/dist/components/foundations/RadioGroup.js +132 -25
  263. package/dist/components/foundations/ScrollArea.js +230 -51
  264. package/dist/components/foundations/SearchField.d.ts +8 -3
  265. package/dist/components/foundations/SearchField.js +129 -28
  266. package/dist/components/foundations/Select.js +648 -145
  267. package/dist/components/foundations/Separator.js +61 -12
  268. package/dist/components/foundations/Slider.js +260 -57
  269. package/dist/components/foundations/Stepper.d.ts +1 -1
  270. package/dist/components/foundations/Stepper.js +561 -127
  271. package/dist/components/foundations/Switch.js +82 -18
  272. package/dist/components/foundations/Tabs.d.ts +2 -2
  273. package/dist/components/foundations/Tabs.js +282 -53
  274. package/dist/components/foundations/Textarea.js +43 -9
  275. package/dist/components/foundations/ThemeProvider.js +138 -52
  276. package/dist/components/foundations/Toast.d.ts +10 -2
  277. package/dist/components/foundations/Toast.js +322 -75
  278. package/dist/components/foundations/Toggle.d.ts +5 -2
  279. package/dist/components/foundations/Toggle.js +51 -10
  280. package/dist/components/foundations/ToggleGroup.d.ts +3 -3
  281. package/dist/components/foundations/ToggleGroup.js +215 -59
  282. package/dist/components/foundations/Toolbar.js +249 -61
  283. package/dist/components/foundations/Tooltip.d.ts +3 -3
  284. package/dist/components/foundations/Tooltip.js +311 -55
  285. package/dist/components/foundations/TransitionSurface.js +43 -9
  286. package/dist/components/foundations/icons.d.ts +2 -2
  287. package/dist/components/foundations/icons.js +2 -2
  288. package/dist/components/general-purpose/AccountSignInDialog.js +99 -17
  289. package/dist/components/general-purpose/ActionGuide.js +290 -64
  290. package/dist/components/general-purpose/AppFrame.js +72 -14
  291. package/dist/components/general-purpose/AppTopBar.d.ts +1 -1
  292. package/dist/components/general-purpose/AppTopBar.js +349 -60
  293. package/dist/components/general-purpose/BrandLoading.js +37 -9
  294. package/dist/components/general-purpose/CommandPalette.d.ts +47 -0
  295. package/dist/components/general-purpose/CommandPalette.js +271 -0
  296. package/dist/components/general-purpose/Commit.d.ts +1 -1
  297. package/dist/components/general-purpose/Commit.js +937 -167
  298. package/dist/components/general-purpose/EnvironmentVariables.d.ts +1 -1
  299. package/dist/components/general-purpose/EnvironmentVariables.js +600 -114
  300. package/dist/components/general-purpose/FileTree.d.ts +20 -7
  301. package/dist/components/general-purpose/FileTree.js +1 -1
  302. package/dist/components/general-purpose/ListDetail.d.ts +84 -0
  303. package/dist/components/general-purpose/ListDetail.js +423 -0
  304. package/dist/components/general-purpose/NotificationPrompt.js +20 -11
  305. package/dist/components/general-purpose/PricingBillingToggle.js +33 -6
  306. package/dist/components/general-purpose/PricingConfirmationDialog.js +126 -42
  307. package/dist/components/general-purpose/PricingFAQ.js +53 -12
  308. package/dist/components/general-purpose/PricingPage.js +376 -139
  309. package/dist/components/general-purpose/PricingPlanCard.js +209 -84
  310. package/dist/components/general-purpose/PricingUsageCalculator.js +231 -81
  311. package/dist/components/general-purpose/ResizableSidePanel.js +316 -117
  312. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -1
  313. package/dist/components/general-purpose/ResponsiveSidebarShell.js +840 -342
  314. package/dist/components/general-purpose/ScreenStack.d.ts +54 -0
  315. package/dist/components/general-purpose/ScreenStack.js +427 -0
  316. package/dist/components/general-purpose/SettingsFormDialog.js +235 -77
  317. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  318. package/dist/components/general-purpose/StatusScreen.js +82 -24
  319. package/dist/components/general-purpose/SwipeActions.d.ts +54 -0
  320. package/dist/components/general-purpose/SwipeActions.js +357 -0
  321. package/dist/components/general-purpose/Terminal.d.ts +22 -48
  322. package/dist/components/general-purpose/Terminal.js +320 -174
  323. package/dist/components/general-purpose/TestResults.js +975 -196
  324. package/dist/components/general-purpose/ThemeModeControl.d.ts +3 -1
  325. package/dist/components/general-purpose/ThemeModeControl.js +66 -23
  326. package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -0
  327. package/dist/components/general-purpose/WallpaperPicker.js +180 -0
  328. package/dist/components/general-purpose/WebPreview.d.ts +5 -7
  329. package/dist/components/general-purpose/WebPreview.js +770 -203
  330. package/dist/components/nanites/AgentConnection.js +323 -84
  331. package/dist/components/nanites/AgentToolDetail.js +233 -53
  332. package/dist/components/nanites/GithubMotionMark.js +37 -9
  333. package/dist/components/nanites/NaniteScene.js +535 -323
  334. package/dist/connected-app-drafts-Bocdg3Z-.js +637 -0
  335. package/dist/container-width-C43ccJ84.js +17 -0
  336. package/dist/context-Ddsp8HgD.js +43 -0
  337. package/dist/{copy-button-B09hHWd1.d.ts → copy-button-C2HRdomn.d.ts} +1 -1
  338. package/dist/copy-button-DWBVJR6D.js +118 -0
  339. package/dist/{format-CWaZEp5o.js → format-DL7f2rqp.js} +5 -1
  340. package/dist/{icons-CReP3qYl.d.ts → icons-B3n7zvU7.d.ts} +10 -2
  341. package/dist/icons-nLTnB9kd.js +470 -0
  342. package/dist/{merge-refs-DAh6reu8.js → merge-refs-DTX97mLp.js} +17 -1
  343. package/dist/motion-CGM3i6lX.js +319 -0
  344. package/dist/motion-preferences-6qsDIDvH.js +13 -0
  345. package/dist/{navigation-link-kqMa81v5.js → navigation-link-DMmtdqsM.js} +32 -8
  346. package/dist/progress-ring-BO649JA9.js +79 -0
  347. package/dist/provider-logos-Ceu7iYFx.js +362 -0
  348. package/dist/scheduled-table-source-gGpVJ1TN.js +92 -0
  349. package/dist/styles/accessibility.css +26 -0
  350. package/dist/styles/accordion.css +0 -2
  351. package/dist/styles/activity.css +20 -12
  352. package/dist/styles/agent-attention.css +31 -10
  353. package/dist/styles/agent-chat.css +7 -6
  354. package/dist/styles/agent-computer-motion-reduction.css +118 -0
  355. package/dist/styles/agent-computer-motion.css +127 -0
  356. package/dist/styles/agent-computer-phone.css +942 -0
  357. package/dist/styles/agent-computer.css +1764 -0
  358. package/dist/styles/agent-connection.css +5 -5
  359. package/dist/styles/agent-screen-switcher.css +313 -0
  360. package/dist/styles/app-icon.css +34 -30
  361. package/dist/styles/app-top-bar.css +33 -18
  362. package/dist/styles/approval.css +3 -3
  363. package/dist/styles/artifact.css +1 -1
  364. package/dist/styles/attachment-preview.css +2 -4
  365. package/dist/styles/avatar.css +12 -14
  366. package/dist/styles/base-ui-motion.css +84 -18
  367. package/dist/styles/base-ui-motion.test.tsx +305 -0
  368. package/dist/styles/base.css +16 -12
  369. package/dist/styles/brand.test.ts +7 -20
  370. package/dist/styles/browser-control-overlay.css +1 -1
  371. package/dist/styles/browser-live-screen.css +2 -2
  372. package/dist/styles/browser-live-view.css +1 -1
  373. package/dist/styles/browser-replay.css +0 -8
  374. package/dist/styles/browser-run-panel.css +275 -37
  375. package/dist/styles/button.css +52 -9
  376. package/dist/styles/card.css +6 -5
  377. package/dist/styles/chain-of-thought.css +0 -10
  378. package/dist/styles/checkpoint.css +2 -2
  379. package/dist/styles/codex-model-selector.css +2 -2
  380. package/dist/styles/color-contrast.test.ts +18 -1
  381. package/dist/styles/command-palette.css +110 -0
  382. package/dist/styles/composer-link.css +11 -7
  383. package/dist/styles/composition-motion.css +3 -14
  384. package/dist/styles/context.css +2 -2
  385. package/dist/styles/conversation-tab-picker.css +7 -0
  386. package/dist/styles/conversation.css +8 -2
  387. package/dist/styles/dialog.css +2 -2
  388. package/dist/styles/employee-app.css +8 -2
  389. package/dist/styles/employee-chrome.css +4 -4
  390. package/dist/styles/execution-board.css +206 -114
  391. package/dist/styles/execution-result.css +2 -2
  392. package/dist/styles/field.css +187 -4
  393. package/dist/styles/file-tree.css +218 -40
  394. package/dist/styles/first-run-setup.css +914 -187
  395. package/dist/styles/github-motion-mark.css +0 -8
  396. package/dist/styles/index.css +145 -133
  397. package/dist/styles/inline-citation.css +5 -4
  398. package/dist/styles/list-detail.css +57 -0
  399. package/dist/styles/manager-office.css +6 -8
  400. package/dist/styles/manager-work.css +4 -2
  401. package/dist/styles/mcp-plugin-catalog.css +2 -2
  402. package/dist/styles/mcp-server-picker.css +3 -6
  403. package/dist/styles/media-preview-card.css +2 -2
  404. package/dist/styles/menu.css +0 -9
  405. package/dist/styles/menubar.css +18 -6
  406. package/dist/styles/message-scroller.css +47 -9
  407. package/dist/styles/message.css +3 -3
  408. package/dist/styles/model-selector.css +1 -1
  409. package/dist/styles/motion-reduction.css +39 -6
  410. package/dist/styles/pricing-page.css +1 -1
  411. package/dist/styles/prompt-input.css +29 -29
  412. package/dist/styles/queue.css +1 -1
  413. package/dist/styles/recipes.css +212 -28
  414. package/dist/styles/responsive-sidebar-shell-motion.test.ts +81 -1
  415. package/dist/styles/responsive-sidebar-shell.css +40 -43
  416. package/dist/styles/screen-stack.css +123 -0
  417. package/dist/styles/search-field.css +80 -3
  418. package/dist/styles/stepper.css +0 -10
  419. package/dist/styles/streamdown.css +2 -2
  420. package/dist/styles/subagent-run.css +9 -5
  421. package/dist/styles/swipe-actions.css +158 -0
  422. package/dist/styles/tabs.css +80 -23
  423. package/dist/styles/task.css +7 -1
  424. package/dist/styles/terminal.css +66 -78
  425. package/dist/styles/test-results.css +1 -19
  426. package/dist/styles/textarea.css +2 -1
  427. package/dist/styles/theme-mode-control.css +154 -26
  428. package/dist/styles/think-chat-tool-panels.css +1 -1
  429. package/dist/styles/think-execution-workbench.css +0 -9
  430. package/dist/styles/think-full-app.css +7 -1
  431. package/dist/styles/think-schedule.css +81 -54
  432. package/dist/styles/think-thread-picker.css +28 -37
  433. package/dist/styles/toast.css +11 -0
  434. package/dist/styles/toggle-group.css +0 -10
  435. package/dist/styles/toggle.css +13 -0
  436. package/dist/styles/tooltip.css +12 -0
  437. package/dist/styles/transition-surface.css +1 -0
  438. package/dist/styles/wallpaper-picker.css +224 -0
  439. package/dist/styles/web-preview.css +47 -18
  440. package/dist/styles/workspace-automation.css +116 -17
  441. package/dist/styles/workspace-concepts.css +1 -1
  442. package/dist/styles/workspace-desktop.css +124 -0
  443. package/dist/styles/workspace-entity-card.css +3 -1
  444. package/dist/styles/workspace-explorer.css +499 -5
  445. package/dist/utils/brand-marks.d.ts +13 -0
  446. package/dist/utils/brand-marks.js +14 -0
  447. package/dist/utils/desktop-artwork.d.ts +17 -0
  448. package/dist/utils/desktop-artwork.js +18 -0
  449. package/dist/utils/favicon.d.ts +6 -2
  450. package/dist/utils/favicon.js +16 -4
  451. package/dist/utils/structured-code.d.ts +1 -1
  452. package/dist/workspace-assets-DdtnBDU3.js +213 -0
  453. package/dist/{workspace-concept-panel-C_oYhPSx.d.ts → workspace-concept-panel-BDTBISNO.d.ts} +2 -2
  454. package/dist/workspace-concept-panel-VkjvFCY_.js +140 -0
  455. package/dist/workspace-delete-BOY6CMBf.js +183 -0
  456. package/dist/workspace-drag-B6hMXUNt.js +304 -0
  457. package/dist/workspace-entity-card-9YcsNiqU.js +178 -0
  458. package/dist/workspace-media-preview-B4iB5Tvi.js +1295 -0
  459. package/dist/{workspace-path-L_KmjRjq.js → workspace-path-TZggP-u4.js} +14 -1
  460. package/dist/{workspace-person-BVkYb3dv.js → workspace-person-ZwPqu5TX.js} +67 -21
  461. package/dist/workspace-quick-look-9V-UFpjj.js +1562 -0
  462. package/package.json +9 -3
  463. package/dist/Avatar-t1YRzdwB.d.ts +0 -101
  464. package/dist/CodeBlock-DYQdZUH6.js +0 -318
  465. package/dist/ExecutionResult-2fBkpIGN.js +0 -279
  466. package/dist/FileTree-CDLOD643.js +0 -323
  467. package/dist/ManagerOffice-CvVSHnOM.js +0 -1129
  468. package/dist/SetupChecklist-B-iEta9v.js +0 -78
  469. package/dist/ThinkSchedule-DPoOYWTQ.d.ts +0 -34
  470. package/dist/WorkspaceFileView-DwIkehSM.js +0 -783
  471. package/dist/WorkspaceLink-BeFAXpbI.js +0 -225
  472. package/dist/app-bar-outlet-CNfNzY4Y.js +0 -6
  473. package/dist/attachment-preview-1CXJvrmb.js +0 -25
  474. package/dist/chatgpt-sign-in-button-D8AT6x4c.js +0 -32
  475. package/dist/connected-app-drafts-DtA2fBK5.js +0 -283
  476. package/dist/copy-button-DbR932tF.js +0 -45
  477. package/dist/icons-GoybMAB2.js +0 -141
  478. package/dist/progress-ring-L2bbF0ji.js +0 -40
  479. package/dist/provider-logos-DWYY8wNz.js +0 -99
  480. package/dist/scheduled-table-source-NZR1vFc_.js +0 -38
  481. package/dist/workspace-assets-F3r6XltC.js +0 -107
  482. package/dist/workspace-concept-panel-D8oEvR0n.js +0 -66
  483. package/dist/workspace-delete-CQvv1eDE.js +0 -81
  484. package/dist/workspace-entity-card-B1aV-jBj.js +0 -61
@@ -1,33 +1,51 @@
1
1
  import { composerTriggerMatch, parseComposerLinks, replaceComposerTrigger } from "../../utils/composer-link.js";
2
2
  import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
3
- import { $ as SquareIcon, C as FileIcon, F as MicrophoneIcon, L as MonitorIcon, W as PlusIcon, Z as SpinnerIcon, a as ArrowUpIcon, ct as WrenchIcon, d as CheckIcon, et as StopIcon, f as ChevronDownIcon, lt as XIcon, st as WarningIcon, w as FolderIcon, z as PaperclipIcon } from "../../icons-GoybMAB2.js";
4
- import { a as formatErrorMessage, i as formatClock, n as clamp } from "../../format-CWaZEp5o.js";
3
+ import { H as MicrophoneIcon, K as PaperclipIcon, O as FileIcon, W as MonitorIcon, Z as PlusIcon, gt as XIcon, ht as WrenchIcon, it as SpinnerIcon, k as FolderIcon, m as ChevronDownIcon, mt as WarningIcon, o as ArrowUpIcon, ot as SquareIcon, p as CheckIcon, st as StopIcon } from "../../icons-nLTnB9kd.js";
4
+ import { t as attempt } from "../../attempt-CySQHJsF.js";
5
+ import { a as formatErrorMessage, i as formatClock, n as clamp } from "../../format-DL7f2rqp.js";
5
6
  import { Button } from "../foundations/Button.js";
6
7
  import { Tooltip } from "../foundations/Tooltip.js";
7
8
  import { IconButton } from "../foundations/IconButton.js";
8
- import { t as AttachmentPreview } from "../../attachment-preview-1CXJvrmb.js";
9
- import { n as mergeRefs } from "../../merge-refs-DAh6reu8.js";
9
+ import { t as AttachmentPreview } from "../../attachment-preview-DeRqFjdz.js";
10
+ import { n as mergeRefs } from "../../merge-refs-DTX97mLp.js";
10
11
  import { ComposerLink } from "./ComposerLink.js";
11
12
  import { Autocomplete } from "../foundations/Autocomplete.js";
12
13
  import { Kbd } from "../foundations/Kbd.js";
13
14
  import { Menu } from "../foundations/Menu.js";
14
15
  import { PreviewCard } from "../foundations/PreviewCard.js";
15
16
  import { Tabs } from "../foundations/Tabs.js";
17
+ import { n as groupCommands, t as commandMatchesQuery } from "../../command-search-1fjmCBBo.js";
16
18
  import { PromptInputComposerEditor } from "./PromptInputComposerEditor.js";
19
+ import { i as workspaceDropFiles, n as readWorkspaceDrop } from "../../workspace-drag-B6hMXUNt.js";
20
+ import { c } from "react/compiler-runtime";
17
21
  import * as React from "react";
18
22
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
23
  //#region src/components/ai-sdk/PromptInput.tsx
20
24
  const PromptInputTextContext = React.createContext(null);
21
25
  const PromptInputAttachmentsContext = React.createContext(null);
22
26
  const PromptInputSubmissionContext = React.createContext(null);
27
+ /**
28
+ * Tells the composer a dictation is recording, so its stylesheet hides the
29
+ * controls the recording replaces by an attribute rather than a `:has()`
30
+ * that every keystroke anywhere on the page would re-test.
31
+ */
32
+ const PromptInputRecordingContext = React.createContext(null);
23
33
  function usePromptInputController() {
34
+ const $ = c(3);
24
35
  const textInput = React.useContext(PromptInputTextContext);
25
36
  const attachments = usePromptInputAttachments();
26
37
  if (!textInput) throw new Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");
27
- return React.useMemo(() => ({
28
- textInput,
29
- attachments
30
- }), [textInput, attachments]);
38
+ let t0;
39
+ if ($[0] !== attachments || $[1] !== textInput) {
40
+ t0 = {
41
+ textInput,
42
+ attachments
43
+ };
44
+ $[0] = attachments;
45
+ $[1] = textInput;
46
+ $[2] = t0;
47
+ } else t0 = $[2];
48
+ return t0;
31
49
  }
32
50
  function usePromptInputAttachments() {
33
51
  const attachments = React.useContext(PromptInputAttachmentsContext);
@@ -39,137 +57,254 @@ function usePromptInputAttachments() {
39
57
  * mounted when switching between a welcome view and a conversation, and compose
40
58
  * PromptInput forms, starters, attachments, and dictation beneath it.
41
59
  */
42
- function PromptInputProvider({ initialInput = "", value, onValueChange, accept, multiple, maxFiles, maxFileSize, onError, children }) {
60
+ function PromptInputProvider(t0) {
61
+ const $ = c(45);
62
+ const { initialInput: t1, value, onValueChange, accept, multiple, maxFiles, maxFileSize, onError, children } = t0;
63
+ const initialInput = t1 === void 0 ? "" : t1;
43
64
  const [uncontrolledInput, setUncontrolledInput] = React.useState(initialInput);
44
- const [files, setFiles] = React.useState([]);
65
+ let t2;
66
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
67
+ t2 = [];
68
+ $[0] = t2;
69
+ } else t2 = $[0];
70
+ const [files, setFiles] = React.useState(t2);
45
71
  const filesRef = React.useRef(files);
46
72
  const fileInputRef = React.useRef(null);
47
73
  const text = value ?? uncontrolledInput;
48
74
  const textRevision = React.useRef(0);
49
75
  const serializing = React.useRef(false);
50
- React.useLayoutEffect(() => {
51
- textRevision.current += 1;
52
- }, [text]);
53
- const setInput = React.useCallback((next) => {
54
- textRevision.current += 1;
55
- if (value === void 0) setUncontrolledInput(next);
56
- onValueChange?.(next);
57
- }, [onValueChange, value]);
58
- React.useEffect(() => () => revokeFileUrls(filesRef.current), []);
59
- const add = React.useCallback((incomingFiles) => {
60
- const incoming = Array.from(incomingFiles);
61
- const patterns = accept?.toLowerCase().split(",").map((part) => part.trim()).filter(Boolean);
62
- const accepted = incoming.filter((file) => !patterns?.length || patterns.some((pattern) => pattern.startsWith(".") ? file.name.toLowerCase().endsWith(pattern) : pattern.endsWith("/*") ? file.type.toLowerCase().startsWith(pattern.slice(0, -1)) : file.type.toLowerCase() === pattern));
63
- if (incoming.length && accepted.length === 0) {
64
- onError?.({
65
- code: "accept",
66
- message: "No files match the accepted types."
76
+ let t3;
77
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
78
+ t3 = () => {
79
+ textRevision.current = textRevision.current + 1;
80
+ };
81
+ $[1] = t3;
82
+ } else t3 = $[1];
83
+ let t4;
84
+ if ($[2] !== text) {
85
+ t4 = [text];
86
+ $[2] = text;
87
+ $[3] = t4;
88
+ } else t4 = $[3];
89
+ React.useLayoutEffect(t3, t4);
90
+ let t5;
91
+ if ($[4] !== onValueChange || $[5] !== value) {
92
+ t5 = (next) => {
93
+ textRevision.current = textRevision.current + 1;
94
+ if (value === void 0) setUncontrolledInput(next);
95
+ onValueChange?.(next);
96
+ };
97
+ $[4] = onValueChange;
98
+ $[5] = value;
99
+ $[6] = t5;
100
+ } else t5 = $[6];
101
+ const setInput = t5;
102
+ let t6;
103
+ let t7;
104
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
105
+ t6 = () => () => revokeFileUrls(filesRef.current);
106
+ t7 = [];
107
+ $[7] = t6;
108
+ $[8] = t7;
109
+ } else {
110
+ t6 = $[7];
111
+ t7 = $[8];
112
+ }
113
+ React.useEffect(t6, t7);
114
+ let t8;
115
+ if ($[9] !== accept || $[10] !== maxFileSize || $[11] !== maxFiles || $[12] !== onError) {
116
+ t8 = (incomingFiles) => {
117
+ const incoming = Array.from(incomingFiles);
118
+ const patterns = accept?.toLowerCase().split(",").map(_temp).filter(Boolean);
119
+ const accepted = incoming.filter((file) => !patterns?.length || patterns.some((pattern) => pattern.startsWith(".") ? file.name.toLowerCase().endsWith(pattern) : pattern.endsWith("/*") ? file.type.toLowerCase().startsWith(pattern.slice(0, -1)) : file.type.toLowerCase() === pattern));
120
+ if (incoming.length && accepted.length === 0) {
121
+ onError?.({
122
+ code: "accept",
123
+ message: "No files match the accepted types."
124
+ });
125
+ return;
126
+ }
127
+ const sized = accepted.filter((file_0) => maxFileSize === void 0 || file_0.size <= maxFileSize);
128
+ if (accepted.length && sized.length === 0) {
129
+ onError?.({
130
+ code: "max_file_size",
131
+ message: "All files exceed the maximum size."
132
+ });
133
+ return;
134
+ }
135
+ const capacity = maxFiles === void 0 ? sized.length : Math.max(0, maxFiles - filesRef.current.length);
136
+ const capped = sized.slice(0, capacity);
137
+ if (sized.length > capacity) onError?.({
138
+ code: "max_files",
139
+ message: "Too many files. Some were not added."
67
140
  });
68
- return;
69
- }
70
- const sized = accepted.filter((file) => maxFileSize === void 0 || file.size <= maxFileSize);
71
- if (accepted.length && sized.length === 0) {
72
- onError?.({
73
- code: "max_file_size",
74
- message: "All files exceed the maximum size."
141
+ if (!capped.length) return;
142
+ const next_0 = [...filesRef.current, ...capped.map(fileToPart)];
143
+ filesRef.current = next_0;
144
+ setFiles(next_0);
145
+ };
146
+ $[9] = accept;
147
+ $[10] = maxFileSize;
148
+ $[11] = maxFiles;
149
+ $[12] = onError;
150
+ $[13] = t8;
151
+ } else t8 = $[13];
152
+ const add = t8;
153
+ let t9;
154
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
155
+ t9 = (id) => {
156
+ const found = filesRef.current.find((file_1) => file_1.id === id);
157
+ if (found) revokeFileObjectUrl(found);
158
+ const next_1 = filesRef.current.filter((file_2) => file_2.id !== id);
159
+ filesRef.current = next_1;
160
+ setFiles(next_1);
161
+ };
162
+ $[14] = t9;
163
+ } else t9 = $[14];
164
+ const remove = t9;
165
+ let t10;
166
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
167
+ t10 = () => {
168
+ revokeFileUrls(filesRef.current);
169
+ filesRef.current = [];
170
+ setFiles([]);
171
+ };
172
+ $[15] = t10;
173
+ } else t10 = $[15];
174
+ const clear = t10;
175
+ let t11;
176
+ if ($[16] !== setInput || $[17] !== text) {
177
+ t11 = async (onSubmit, event) => {
178
+ if (serializing.current || !text.trim() && filesRef.current.length === 0) return;
179
+ serializing.current = true;
180
+ const revision = textRevision.current;
181
+ const snapshot = filesRef.current;
182
+ const accepted_0 = await attempt(async () => {
183
+ const submittedFiles = await Promise.all(snapshot.map(resolveSubmittedFile));
184
+ return { submission: onSubmit?.({
185
+ text: text.trim(),
186
+ files: submittedFiles
187
+ }, event) };
75
188
  });
76
- return;
77
- }
78
- const capacity = maxFiles === void 0 ? sized.length : Math.max(0, maxFiles - filesRef.current.length);
79
- const capped = sized.slice(0, capacity);
80
- if (sized.length > capacity) onError?.({
81
- code: "max_files",
82
- message: "Too many files. Some were not added."
83
- });
84
- if (!capped.length) return;
85
- const next = [...filesRef.current, ...capped.map(fileToPart)];
86
- filesRef.current = next;
87
- setFiles(next);
88
- }, [
89
- accept,
90
- maxFileSize,
91
- maxFiles,
92
- onError
93
- ]);
94
- const remove = React.useCallback((id) => {
95
- const found = filesRef.current.find((file) => file.id === id);
96
- if (found) revokeFileObjectUrl(found);
97
- const next = filesRef.current.filter((file) => file.id !== id);
98
- filesRef.current = next;
99
- setFiles(next);
100
- }, []);
101
- const clear = React.useCallback(() => {
102
- revokeFileUrls(filesRef.current);
103
- filesRef.current = [];
104
- setFiles([]);
105
- }, []);
106
- const submitDraft = React.useCallback(async (onSubmit, event) => {
107
- if (serializing.current || !text.trim() && filesRef.current.length === 0) return;
108
- serializing.current = true;
109
- const revision = textRevision.current;
110
- const snapshot = filesRef.current;
111
- let submission;
112
- try {
113
- const submittedFiles = await Promise.all(snapshot.map(resolveSubmittedFile));
114
- submission = onSubmit?.({
115
- text: text.trim(),
116
- files: submittedFiles
117
- }, event);
118
- if (textRevision.current === revision) setInput("");
119
- const submittedIds = new Set(snapshot.map((file) => file.id));
120
- const remaining = filesRef.current.filter((file) => !submittedIds.has(file.id));
121
- revokeFileUrls(filesRef.current.filter((file) => submittedIds.has(file.id)));
122
- filesRef.current = remaining;
123
- setFiles(remaining);
124
- } catch {
125
- return;
126
- } finally {
189
+ if (accepted_0.ok) {
190
+ if (textRevision.current === revision) setInput("");
191
+ const submittedIds = new Set(snapshot.map(_temp2));
192
+ const remaining = filesRef.current.filter((file_4) => !submittedIds.has(file_4.id));
193
+ revokeFileUrls(filesRef.current.filter((file_5) => submittedIds.has(file_5.id)));
194
+ filesRef.current = remaining;
195
+ setFiles(remaining);
196
+ }
127
197
  serializing.current = false;
128
- }
129
- try {
130
- await submission;
131
- } catch {}
132
- }, [text, setInput]);
133
- const attachments = React.useMemo(() => ({
134
- add,
135
- remove,
136
- clear,
137
- files,
138
- fileInputRef,
139
- openFileDialog: () => fileInputRef.current?.click()
140
- }), [
141
- add,
142
- remove,
143
- clear,
144
- files
145
- ]);
146
- const textInput = React.useMemo(() => ({
147
- value: text,
148
- setInput,
149
- clear: () => setInput("")
150
- }), [text, setInput]);
151
- return /* @__PURE__ */ jsx(PromptInputTextContext.Provider, {
152
- value: textInput,
153
- children: /* @__PURE__ */ jsx(PromptInputAttachmentsContext.Provider, {
198
+ if (accepted_0.ok) await attempt(() => accepted_0.value.submission);
199
+ };
200
+ $[16] = setInput;
201
+ $[17] = text;
202
+ $[18] = t11;
203
+ } else t11 = $[18];
204
+ const submitDraft = t11;
205
+ let t12;
206
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
207
+ t12 = () => fileInputRef.current?.click();
208
+ $[19] = t12;
209
+ } else t12 = $[19];
210
+ let t13;
211
+ if ($[20] !== add || $[21] !== files) {
212
+ t13 = {
213
+ add,
214
+ remove,
215
+ clear,
216
+ files,
217
+ fileInputRef,
218
+ openFileDialog: t12
219
+ };
220
+ $[20] = add;
221
+ $[21] = files;
222
+ $[22] = t13;
223
+ } else t13 = $[22];
224
+ const attachments = t13;
225
+ let t14;
226
+ if ($[23] !== setInput) {
227
+ t14 = () => setInput("");
228
+ $[23] = setInput;
229
+ $[24] = t14;
230
+ } else t14 = $[24];
231
+ let t15;
232
+ if ($[25] !== setInput || $[26] !== t14 || $[27] !== text) {
233
+ t15 = {
234
+ value: text,
235
+ setInput,
236
+ clear: t14
237
+ };
238
+ $[25] = setInput;
239
+ $[26] = t14;
240
+ $[27] = text;
241
+ $[28] = t15;
242
+ } else t15 = $[28];
243
+ const textInput = t15;
244
+ let t16;
245
+ if ($[29] !== add) {
246
+ t16 = (event_0) => {
247
+ if (event_0.currentTarget.files?.length) add(event_0.currentTarget.files);
248
+ event_0.currentTarget.value = "";
249
+ };
250
+ $[29] = add;
251
+ $[30] = t16;
252
+ } else t16 = $[30];
253
+ let t17;
254
+ if ($[31] !== accept || $[32] !== multiple || $[33] !== t16) {
255
+ t17 = /* @__PURE__ */ jsx("input", {
256
+ ref: fileInputRef,
257
+ accept,
258
+ "aria-label": "Upload files",
259
+ hidden: true,
260
+ multiple,
261
+ onChange: t16,
262
+ tabIndex: -1,
263
+ type: "file"
264
+ });
265
+ $[31] = accept;
266
+ $[32] = multiple;
267
+ $[33] = t16;
268
+ $[34] = t17;
269
+ } else t17 = $[34];
270
+ let t18;
271
+ if ($[35] !== children || $[36] !== submitDraft || $[37] !== t17) {
272
+ t18 = /* @__PURE__ */ jsxs(PromptInputSubmissionContext.Provider, {
273
+ value: submitDraft,
274
+ children: [t17, children]
275
+ });
276
+ $[35] = children;
277
+ $[36] = submitDraft;
278
+ $[37] = t17;
279
+ $[38] = t18;
280
+ } else t18 = $[38];
281
+ let t19;
282
+ if ($[39] !== attachments || $[40] !== t18) {
283
+ t19 = /* @__PURE__ */ jsx(PromptInputAttachmentsContext.Provider, {
154
284
  value: attachments,
155
- children: /* @__PURE__ */ jsxs(PromptInputSubmissionContext.Provider, {
156
- value: submitDraft,
157
- children: [/* @__PURE__ */ jsx("input", {
158
- ref: fileInputRef,
159
- accept,
160
- "aria-label": "Upload files",
161
- className: "prompt-input__file-input",
162
- multiple,
163
- onChange: (event) => {
164
- if (event.currentTarget.files?.length) add(event.currentTarget.files);
165
- event.currentTarget.value = "";
166
- },
167
- tabIndex: -1,
168
- type: "file"
169
- }), children]
170
- })
171
- })
172
- });
285
+ children: t18
286
+ });
287
+ $[39] = attachments;
288
+ $[40] = t18;
289
+ $[41] = t19;
290
+ } else t19 = $[41];
291
+ let t20;
292
+ if ($[42] !== t19 || $[43] !== textInput) {
293
+ t20 = /* @__PURE__ */ jsx(PromptInputTextContext.Provider, {
294
+ value: textInput,
295
+ children: t19
296
+ });
297
+ $[42] = t19;
298
+ $[43] = textInput;
299
+ $[44] = t20;
300
+ } else t20 = $[44];
301
+ return t20;
302
+ }
303
+ function _temp2(file_3) {
304
+ return file_3.id;
305
+ }
306
+ function _temp(part) {
307
+ return part.trim();
173
308
  }
174
309
  /**
175
310
  * Chat-style composer form. Wraps a textarea and footer controls, with
@@ -204,65 +339,218 @@ function PromptInputProvider({ initialInput = "", value, onValueChange, accept,
204
339
  *
205
340
  * @see {@link https://elements.ai-sdk.dev/components/prompt-input | AI Elements Prompt Input}
206
341
  */
207
- function PromptInput({ className, globalDrop, onSubmit, children, ref, ...props }) {
342
+ function PromptInput(t0) {
343
+ const $ = c(28);
344
+ let children;
345
+ let className;
346
+ let globalDrop;
347
+ let onSubmit;
348
+ let props;
349
+ let ref;
350
+ if ($[0] !== t0) {
351
+ ({className, globalDrop, onSubmit, children, ref, ...props} = t0);
352
+ $[0] = t0;
353
+ $[1] = children;
354
+ $[2] = className;
355
+ $[3] = globalDrop;
356
+ $[4] = onSubmit;
357
+ $[5] = props;
358
+ $[6] = ref;
359
+ } else {
360
+ children = $[1];
361
+ className = $[2];
362
+ globalDrop = $[3];
363
+ onSubmit = $[4];
364
+ props = $[5];
365
+ ref = $[6];
366
+ }
208
367
  const attachments = usePromptInputAttachments();
209
368
  const submitDraft = React.useContext(PromptInputSubmissionContext);
210
369
  if (!submitDraft) throw new Error("PromptInput requires PromptInputProvider.");
211
370
  const formRef = React.useRef(null);
212
371
  const addDroppedFiles = React.useEffectEvent(attachments.add);
213
- React.useEffect(() => {
214
- const target = globalDrop ? document : formRef.current;
215
- if (!target) return;
216
- const onDragOver = (event) => {
217
- const dragEvent = event;
218
- if (dragEvent.dataTransfer?.types.includes("Files")) dragEvent.preventDefault();
372
+ let t1;
373
+ if ($[7] !== addDroppedFiles || $[8] !== globalDrop) {
374
+ t1 = () => {
375
+ const target = globalDrop ? document : formRef.current;
376
+ if (!target) return;
377
+ const takes = _temp4;
378
+ const onDragOver = (event) => {
379
+ if (takes(event)) event.preventDefault();
380
+ };
381
+ const onDrop = (event_0) => {
382
+ const dragEvent_0 = event_0;
383
+ if (dragEvent_0.defaultPrevented || !takes(dragEvent_0)) return;
384
+ dragEvent_0.preventDefault();
385
+ const dataTransfer = dragEvent_0.dataTransfer;
386
+ if (dataTransfer.types.includes("application/x-sigvelo-workspace")) readWorkspaceDrop(dataTransfer).then(async (drop) => {
387
+ if (drop?.kind !== "workspace") return;
388
+ const files = await workspaceDropFiles(drop);
389
+ if (files.length) addDroppedFiles(files);
390
+ });
391
+ else if (dataTransfer.files.length) addDroppedFiles(dataTransfer.files);
392
+ };
393
+ target.addEventListener("dragover", onDragOver);
394
+ target.addEventListener("drop", onDrop);
395
+ return () => {
396
+ target.removeEventListener("dragover", onDragOver);
397
+ target.removeEventListener("drop", onDrop);
398
+ };
219
399
  };
220
- const onDrop = (event) => {
221
- const dragEvent = event;
222
- if (dragEvent.dataTransfer?.types.includes("Files")) dragEvent.preventDefault();
223
- if (dragEvent.dataTransfer?.files?.length) addDroppedFiles(dragEvent.dataTransfer.files);
400
+ $[7] = addDroppedFiles;
401
+ $[8] = globalDrop;
402
+ $[9] = t1;
403
+ } else t1 = $[9];
404
+ let t2;
405
+ if ($[10] !== globalDrop) {
406
+ t2 = [globalDrop];
407
+ $[10] = globalDrop;
408
+ $[11] = t2;
409
+ } else t2 = $[11];
410
+ React.useEffect(t1, t2);
411
+ let t3;
412
+ if ($[12] !== onSubmit || $[13] !== submitDraft) {
413
+ t3 = (event_1) => {
414
+ event_1.preventDefault();
415
+ return submitDraft(onSubmit, event_1);
224
416
  };
225
- target.addEventListener("dragover", onDragOver);
226
- target.addEventListener("drop", onDrop);
227
- return () => {
228
- target.removeEventListener("dragover", onDragOver);
229
- target.removeEventListener("drop", onDrop);
230
- };
231
- }, [globalDrop]);
232
- const handleSubmit = React.useCallback((event) => {
233
- event.preventDefault();
234
- return submitDraft(onSubmit, event);
235
- }, [submitDraft, onSubmit]);
236
- return /* @__PURE__ */ jsx("form", {
237
- ref: mergeRefs(formRef, ref),
238
- className: cx("prompt-input", className),
239
- onSubmit: handleSubmit,
240
- ...props,
241
- children
242
- });
417
+ $[12] = onSubmit;
418
+ $[13] = submitDraft;
419
+ $[14] = t3;
420
+ } else t3 = $[14];
421
+ const handleSubmit = t3;
422
+ const [recording, setRecording] = React.useState(false);
423
+ let t4;
424
+ if ($[15] !== ref) {
425
+ t4 = mergeRefs(formRef, ref);
426
+ $[15] = ref;
427
+ $[16] = t4;
428
+ } else t4 = $[16];
429
+ let t5;
430
+ if ($[17] !== className) {
431
+ t5 = cx("prompt-input", className);
432
+ $[17] = className;
433
+ $[18] = t5;
434
+ } else t5 = $[18];
435
+ const t6 = recording || void 0;
436
+ let t7;
437
+ if ($[19] !== children) {
438
+ t7 = /* @__PURE__ */ jsx(PromptInputRecordingContext, {
439
+ value: setRecording,
440
+ children
441
+ });
442
+ $[19] = children;
443
+ $[20] = t7;
444
+ } else t7 = $[20];
445
+ let t8;
446
+ if ($[21] !== handleSubmit || $[22] !== props || $[23] !== t4 || $[24] !== t5 || $[25] !== t6 || $[26] !== t7) {
447
+ t8 = /* @__PURE__ */ jsx("form", {
448
+ ref: t4,
449
+ className: t5,
450
+ "data-recording": t6,
451
+ onSubmit: handleSubmit,
452
+ ...props,
453
+ children: t7
454
+ });
455
+ $[21] = handleSubmit;
456
+ $[22] = props;
457
+ $[23] = t4;
458
+ $[24] = t5;
459
+ $[25] = t6;
460
+ $[26] = t7;
461
+ $[27] = t8;
462
+ } else t8 = $[27];
463
+ return t8;
464
+ }
465
+ function _temp4(dragEvent) {
466
+ return dragEvent.dataTransfer?.types.some(_temp3) ?? false;
467
+ }
468
+ function _temp3(type) {
469
+ return type === "Files" || type === "application/x-sigvelo-workspace";
243
470
  }
244
- function PromptInputHeader({ className, children, ref, ...props }) {
245
- return /* @__PURE__ */ jsx("div", {
246
- ref,
247
- className: cx("prompt-input__header", className),
248
- ...props,
249
- children
250
- });
471
+ function PromptInputHeader(t0) {
472
+ const $ = c(12);
473
+ let children;
474
+ let className;
475
+ let props;
476
+ let ref;
477
+ if ($[0] !== t0) {
478
+ ({className, children, ref, ...props} = t0);
479
+ $[0] = t0;
480
+ $[1] = children;
481
+ $[2] = className;
482
+ $[3] = props;
483
+ $[4] = ref;
484
+ } else {
485
+ children = $[1];
486
+ className = $[2];
487
+ props = $[3];
488
+ ref = $[4];
489
+ }
490
+ let t1;
491
+ if ($[5] !== className) {
492
+ t1 = cx("prompt-input__header", className);
493
+ $[5] = className;
494
+ $[6] = t1;
495
+ } else t1 = $[6];
496
+ let t2;
497
+ if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
498
+ t2 = /* @__PURE__ */ jsx("div", {
499
+ ref,
500
+ className: t1,
501
+ ...props,
502
+ children
503
+ });
504
+ $[7] = children;
505
+ $[8] = props;
506
+ $[9] = ref;
507
+ $[10] = t1;
508
+ $[11] = t2;
509
+ } else t2 = $[11];
510
+ return t2;
251
511
  }
252
512
  /**
253
513
  * One pending attachment chip: image files show a thumbnail, everything else
254
514
  * a file icon and name. The corner button removes it from the pending list.
255
515
  */
256
- function PromptInputAttachment({ file, className, ref, ...props }) {
516
+ function PromptInputAttachment(t0) {
517
+ const $ = c(28);
518
+ let className;
519
+ let file;
520
+ let props;
521
+ let ref;
522
+ if ($[0] !== t0) {
523
+ ({file, className, ref, ...props} = t0);
524
+ $[0] = t0;
525
+ $[1] = className;
526
+ $[2] = file;
527
+ $[3] = props;
528
+ $[4] = ref;
529
+ } else {
530
+ className = $[1];
531
+ file = $[2];
532
+ props = $[3];
533
+ ref = $[4];
534
+ }
257
535
  const attachments = usePromptInputAttachments();
258
- const isImage = file.mediaType.startsWith("image/");
536
+ let t1;
537
+ if ($[5] !== file.mediaType) {
538
+ t1 = file.mediaType.startsWith("image/");
539
+ $[5] = file.mediaType;
540
+ $[6] = t1;
541
+ } else t1 = $[6];
542
+ const isImage = t1;
259
543
  const name = file.filename ?? "attachment";
260
- return /* @__PURE__ */ jsxs("div", {
261
- ref,
262
- className: cx("prompt-input__attachment", className),
263
- "data-image": isImage || void 0,
264
- ...props,
265
- children: [isImage ? /* @__PURE__ */ jsx(AttachmentPreview, {
544
+ let t2;
545
+ if ($[7] !== className) {
546
+ t2 = cx("prompt-input__attachment", className);
547
+ $[7] = className;
548
+ $[8] = t2;
549
+ } else t2 = $[8];
550
+ const t3 = isImage || void 0;
551
+ let t4;
552
+ if ($[9] !== file.filename || $[10] !== file.url || $[11] !== isImage || $[12] !== name) {
553
+ t4 = isImage ? /* @__PURE__ */ jsx(AttachmentPreview, {
266
554
  url: file.url,
267
555
  filename: file.filename,
268
556
  children: /* @__PURE__ */ jsx(Button, {
@@ -280,270 +568,860 @@ function PromptInputAttachment({ file, className, ref, ...props }) {
280
568
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FileIcon, { className: "prompt-input__attachment-icon" }), /* @__PURE__ */ jsx("span", {
281
569
  className: "prompt-input__attachment-name sigvelo-truncate",
282
570
  children: name
283
- })] }), /* @__PURE__ */ jsx(IconButton, {
571
+ })] });
572
+ $[9] = file.filename;
573
+ $[10] = file.url;
574
+ $[11] = isImage;
575
+ $[12] = name;
576
+ $[13] = t4;
577
+ } else t4 = $[13];
578
+ const t5 = `Remove ${name}`;
579
+ let t6;
580
+ if ($[14] !== attachments || $[15] !== file.id) {
581
+ t6 = () => attachments.remove(file.id);
582
+ $[14] = attachments;
583
+ $[15] = file.id;
584
+ $[16] = t6;
585
+ } else t6 = $[16];
586
+ let t7;
587
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
588
+ t7 = /* @__PURE__ */ jsx(XIcon, {});
589
+ $[17] = t7;
590
+ } else t7 = $[17];
591
+ let t8;
592
+ if ($[18] !== t5 || $[19] !== t6) {
593
+ t8 = /* @__PURE__ */ jsx(IconButton, {
284
594
  className: "prompt-input__attachment-remove",
285
595
  color: "neutral",
286
- label: `Remove ${name}`,
596
+ label: t5,
287
597
  size: "xs",
288
598
  variant: "ghost",
289
- onClick: () => attachments.remove(file.id),
290
- children: /* @__PURE__ */ jsx(XIcon, {})
291
- })]
292
- });
599
+ onClick: t6,
600
+ children: t7
601
+ });
602
+ $[18] = t5;
603
+ $[19] = t6;
604
+ $[20] = t8;
605
+ } else t8 = $[20];
606
+ let t9;
607
+ if ($[21] !== props || $[22] !== ref || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t8) {
608
+ t9 = /* @__PURE__ */ jsxs("div", {
609
+ ref,
610
+ className: t2,
611
+ "data-image": t3,
612
+ ...props,
613
+ children: [t4, t8]
614
+ });
615
+ $[21] = props;
616
+ $[22] = ref;
617
+ $[23] = t2;
618
+ $[24] = t3;
619
+ $[25] = t4;
620
+ $[26] = t8;
621
+ $[27] = t9;
622
+ } else t9 = $[27];
623
+ return t9;
293
624
  }
294
625
  /**
295
626
  * The pending-attachment chip row. Renders nothing while the list is empty,
296
627
  * so it can sit in the composer unconditionally — files added via the file
297
628
  * dialog, paste, or drop appear here until submit sends and clears them.
298
629
  */
299
- function PromptInputAttachments({ className, children, ref, ...props }) {
630
+ function PromptInputAttachments(t0) {
631
+ const $ = c(17);
632
+ let children;
633
+ let className;
634
+ let props;
635
+ let ref;
636
+ if ($[0] !== t0) {
637
+ ({className, children, ref, ...props} = t0);
638
+ $[0] = t0;
639
+ $[1] = children;
640
+ $[2] = className;
641
+ $[3] = props;
642
+ $[4] = ref;
643
+ } else {
644
+ children = $[1];
645
+ className = $[2];
646
+ props = $[3];
647
+ ref = $[4];
648
+ }
300
649
  const attachments = usePromptInputAttachments();
301
650
  if (attachments.files.length === 0) return null;
302
- return /* @__PURE__ */ jsx("div", {
303
- ref,
304
- className: cx("prompt-input__attachments", className),
305
- ...props,
306
- children: attachments.files.map((file) => /* @__PURE__ */ jsx(React.Fragment, { children: children ? children(file) : /* @__PURE__ */ jsx(PromptInputAttachment, { file }) }, file.id))
307
- });
651
+ let t1;
652
+ if ($[5] !== className) {
653
+ t1 = cx("prompt-input__attachments", className);
654
+ $[5] = className;
655
+ $[6] = t1;
656
+ } else t1 = $[6];
657
+ let t2;
658
+ if ($[7] !== attachments.files || $[8] !== children) {
659
+ let t3;
660
+ if ($[10] !== children) {
661
+ t3 = (file) => /* @__PURE__ */ jsx(React.Fragment, { children: children ? children(file) : /* @__PURE__ */ jsx(PromptInputAttachment, { file }) }, file.id);
662
+ $[10] = children;
663
+ $[11] = t3;
664
+ } else t3 = $[11];
665
+ t2 = attachments.files.map(t3);
666
+ $[7] = attachments.files;
667
+ $[8] = children;
668
+ $[9] = t2;
669
+ } else t2 = $[9];
670
+ let t3;
671
+ if ($[12] !== props || $[13] !== ref || $[14] !== t1 || $[15] !== t2) {
672
+ t3 = /* @__PURE__ */ jsx("div", {
673
+ ref,
674
+ className: t1,
675
+ ...props,
676
+ children: t2
677
+ });
678
+ $[12] = props;
679
+ $[13] = ref;
680
+ $[14] = t1;
681
+ $[15] = t2;
682
+ $[16] = t3;
683
+ } else t3 = $[16];
684
+ return t3;
308
685
  }
309
- function PromptInputBody({ className, children, ref, ...props }) {
310
- return /* @__PURE__ */ jsx("div", {
311
- ref,
312
- className: cx("prompt-input__body", className),
313
- ...props,
314
- children
315
- });
686
+ function PromptInputBody(t0) {
687
+ const $ = c(12);
688
+ let children;
689
+ let className;
690
+ let props;
691
+ let ref;
692
+ if ($[0] !== t0) {
693
+ ({className, children, ref, ...props} = t0);
694
+ $[0] = t0;
695
+ $[1] = children;
696
+ $[2] = className;
697
+ $[3] = props;
698
+ $[4] = ref;
699
+ } else {
700
+ children = $[1];
701
+ className = $[2];
702
+ props = $[3];
703
+ ref = $[4];
704
+ }
705
+ let t1;
706
+ if ($[5] !== className) {
707
+ t1 = cx("prompt-input__body", className);
708
+ $[5] = className;
709
+ $[6] = t1;
710
+ } else t1 = $[6];
711
+ let t2;
712
+ if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
713
+ t2 = /* @__PURE__ */ jsx("div", {
714
+ ref,
715
+ className: t1,
716
+ ...props,
717
+ children
718
+ });
719
+ $[7] = children;
720
+ $[8] = props;
721
+ $[9] = ref;
722
+ $[10] = t1;
723
+ $[11] = t2;
724
+ } else t2 = $[11];
725
+ return t2;
316
726
  }
317
- function PromptInputFooter({ className, children, ref, ...props }) {
318
- return /* @__PURE__ */ jsx("div", {
319
- ref,
320
- className: cx("prompt-input__footer", className),
321
- ...props,
322
- children
323
- });
727
+ function PromptInputFooter(t0) {
728
+ const $ = c(12);
729
+ let children;
730
+ let className;
731
+ let props;
732
+ let ref;
733
+ if ($[0] !== t0) {
734
+ ({className, children, ref, ...props} = t0);
735
+ $[0] = t0;
736
+ $[1] = children;
737
+ $[2] = className;
738
+ $[3] = props;
739
+ $[4] = ref;
740
+ } else {
741
+ children = $[1];
742
+ className = $[2];
743
+ props = $[3];
744
+ ref = $[4];
745
+ }
746
+ let t1;
747
+ if ($[5] !== className) {
748
+ t1 = cx("prompt-input__footer", className);
749
+ $[5] = className;
750
+ $[6] = t1;
751
+ } else t1 = $[6];
752
+ let t2;
753
+ if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
754
+ t2 = /* @__PURE__ */ jsx("div", {
755
+ ref,
756
+ className: t1,
757
+ ...props,
758
+ children
759
+ });
760
+ $[7] = children;
761
+ $[8] = props;
762
+ $[9] = ref;
763
+ $[10] = t1;
764
+ $[11] = t2;
765
+ } else t2 = $[11];
766
+ return t2;
324
767
  }
325
768
  /** Trailing composer controls; expands for dictation without displacing the input. */
326
- function PromptInputFooterEnd({ className, ref, ...props }) {
327
- return /* @__PURE__ */ jsx("div", {
328
- ref,
329
- className: cx("prompt-input__footer-end", className),
330
- ...props
331
- });
769
+ function PromptInputFooterEnd(t0) {
770
+ const $ = c(10);
771
+ let className;
772
+ let props;
773
+ let ref;
774
+ if ($[0] !== t0) {
775
+ ({className, ref, ...props} = t0);
776
+ $[0] = t0;
777
+ $[1] = className;
778
+ $[2] = props;
779
+ $[3] = ref;
780
+ } else {
781
+ className = $[1];
782
+ props = $[2];
783
+ ref = $[3];
784
+ }
785
+ let t1;
786
+ if ($[4] !== className) {
787
+ t1 = cx("prompt-input__footer-end", className);
788
+ $[4] = className;
789
+ $[5] = t1;
790
+ } else t1 = $[5];
791
+ let t2;
792
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
793
+ t2 = /* @__PURE__ */ jsx("div", {
794
+ ref,
795
+ className: t1,
796
+ ...props
797
+ });
798
+ $[6] = props;
799
+ $[7] = ref;
800
+ $[8] = t1;
801
+ $[9] = t2;
802
+ } else t2 = $[9];
803
+ return t2;
332
804
  }
333
805
  /** Supporting controls or queued work tucked behind a PromptInput edge. */
334
- function PromptInputTray({ side, className, ref, ...props }) {
335
- return /* @__PURE__ */ jsx("div", {
336
- ref,
337
- "data-slot": "prompt-input-tray",
338
- "data-side": side,
339
- className: cx("prompt-input__tray", className),
340
- ...props
341
- });
806
+ function PromptInputTray(t0) {
807
+ const $ = c(12);
808
+ let className;
809
+ let props;
810
+ let ref;
811
+ let side;
812
+ if ($[0] !== t0) {
813
+ ({side, className, ref, ...props} = t0);
814
+ $[0] = t0;
815
+ $[1] = className;
816
+ $[2] = props;
817
+ $[3] = ref;
818
+ $[4] = side;
819
+ } else {
820
+ className = $[1];
821
+ props = $[2];
822
+ ref = $[3];
823
+ side = $[4];
824
+ }
825
+ let t1;
826
+ if ($[5] !== className) {
827
+ t1 = cx("prompt-input__tray", className);
828
+ $[5] = className;
829
+ $[6] = t1;
830
+ } else t1 = $[6];
831
+ let t2;
832
+ if ($[7] !== props || $[8] !== ref || $[9] !== side || $[10] !== t1) {
833
+ t2 = /* @__PURE__ */ jsx("div", {
834
+ ref,
835
+ "data-slot": "prompt-input-tray",
836
+ "data-side": side,
837
+ className: t1,
838
+ ...props
839
+ });
840
+ $[7] = props;
841
+ $[8] = ref;
842
+ $[9] = side;
843
+ $[10] = t1;
844
+ $[11] = t2;
845
+ } else t2 = $[11];
846
+ return t2;
342
847
  }
343
- function PromptInputTools({ className, children, ref, ...props }) {
344
- return /* @__PURE__ */ jsx("div", {
345
- ref,
346
- className: cx("prompt-input__tools", className),
347
- ...props,
348
- children
349
- });
848
+ function PromptInputTools(t0) {
849
+ const $ = c(12);
850
+ let children;
851
+ let className;
852
+ let props;
853
+ let ref;
854
+ if ($[0] !== t0) {
855
+ ({className, children, ref, ...props} = t0);
856
+ $[0] = t0;
857
+ $[1] = children;
858
+ $[2] = className;
859
+ $[3] = props;
860
+ $[4] = ref;
861
+ } else {
862
+ children = $[1];
863
+ className = $[2];
864
+ props = $[3];
865
+ ref = $[4];
866
+ }
867
+ let t1;
868
+ if ($[5] !== className) {
869
+ t1 = cx("prompt-input__tools", className);
870
+ $[5] = className;
871
+ $[6] = t1;
872
+ } else t1 = $[6];
873
+ let t2;
874
+ if ($[7] !== children || $[8] !== props || $[9] !== ref || $[10] !== t1) {
875
+ t2 = /* @__PURE__ */ jsx("div", {
876
+ ref,
877
+ className: t1,
878
+ ...props,
879
+ children
880
+ });
881
+ $[7] = children;
882
+ $[8] = props;
883
+ $[9] = ref;
884
+ $[10] = t1;
885
+ $[11] = t2;
886
+ } else t2 = $[11];
887
+ return t2;
350
888
  }
351
- const MIN_TEXTAREA_HEIGHT_PX = 24;
352
- const MAX_TEXTAREA_HEIGHT_PX = 240;
353
- function PromptInputTextarea({ className, placeholder = "How can I help?", rows = 1, minHeight = MIN_TEXTAREA_HEIGHT_PX, maxHeight = MAX_TEXTAREA_HEIGHT_PX, onChange, onCompositionEnd, onCompositionStart, onKeyDown, onInput, onPaste, ref, ...props }) {
889
+ function PromptInputTextarea(t0) {
890
+ const $ = c(39);
891
+ let className;
892
+ let onChange;
893
+ let onCompositionEnd;
894
+ let onCompositionStart;
895
+ let onKeyDown;
896
+ let onPaste;
897
+ let props;
898
+ let ref;
899
+ let t1;
900
+ let t2;
901
+ if ($[0] !== t0) {
902
+ ({className, placeholder: t1, rows: t2, onChange, onCompositionEnd, onCompositionStart, onKeyDown, onPaste, ref, ...props} = t0);
903
+ $[0] = t0;
904
+ $[1] = className;
905
+ $[2] = onChange;
906
+ $[3] = onCompositionEnd;
907
+ $[4] = onCompositionStart;
908
+ $[5] = onKeyDown;
909
+ $[6] = onPaste;
910
+ $[7] = props;
911
+ $[8] = ref;
912
+ $[9] = t1;
913
+ $[10] = t2;
914
+ } else {
915
+ className = $[1];
916
+ onChange = $[2];
917
+ onCompositionEnd = $[3];
918
+ onCompositionStart = $[4];
919
+ onKeyDown = $[5];
920
+ onPaste = $[6];
921
+ props = $[7];
922
+ ref = $[8];
923
+ t1 = $[9];
924
+ t2 = $[10];
925
+ }
926
+ const placeholder = t1 === void 0 ? "How can I help?" : t1;
927
+ const rows = t2 === void 0 ? 1 : t2;
354
928
  const controller = usePromptInputController();
355
929
  const attachments = usePromptInputAttachments();
356
930
  const innerRef = React.useRef(null);
357
931
  const isComposingRef = React.useRef(false);
358
- React.useImperativeHandle(ref, () => innerRef.current, []);
359
- const resize = React.useCallback(() => {
360
- const el = innerRef.current;
361
- if (!el) return;
362
- el.style.height = "auto";
363
- const next = clamp(el.scrollHeight, minHeight, maxHeight);
364
- el.style.height = `${next}px`;
365
- el.style.overflowY = el.scrollHeight > maxHeight ? "auto" : "hidden";
366
- }, [maxHeight, minHeight]);
367
- React.useLayoutEffect(() => {
368
- resize();
369
- }, [resize, controller.textInput.value]);
370
- return /* @__PURE__ */ jsx("textarea", {
371
- ref: innerRef,
372
- "data-prompt-input-textarea": "true",
373
- className: cx("prompt-input__textarea", className),
374
- "aria-label": "Message",
375
- name: "message",
376
- placeholder,
377
- rows,
378
- onCompositionEnd: (event) => {
932
+ let t3;
933
+ let t4;
934
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
935
+ t3 = () => innerRef.current;
936
+ t4 = [];
937
+ $[11] = t3;
938
+ $[12] = t4;
939
+ } else {
940
+ t3 = $[11];
941
+ t4 = $[12];
942
+ }
943
+ React.useImperativeHandle(ref, t3, t4);
944
+ let t5;
945
+ if ($[13] !== className) {
946
+ t5 = cx("prompt-input__textarea", className);
947
+ $[13] = className;
948
+ $[14] = t5;
949
+ } else t5 = $[14];
950
+ let t6;
951
+ if ($[15] !== onCompositionEnd) {
952
+ t6 = (event) => {
379
953
  isComposingRef.current = false;
380
954
  onCompositionEnd?.(event);
381
- },
382
- onCompositionStart: (event) => {
955
+ };
956
+ $[15] = onCompositionEnd;
957
+ $[16] = t6;
958
+ } else t6 = $[16];
959
+ let t7;
960
+ if ($[17] !== onCompositionStart) {
961
+ t7 = (event_0) => {
383
962
  isComposingRef.current = true;
384
- onCompositionStart?.(event);
385
- },
386
- onKeyDown: (event) => {
387
- onKeyDown?.(event);
388
- if (event.defaultPrevented) return;
389
- if (event.key === "Enter" && !event.shiftKey && !isComposingRef.current && !event.nativeEvent.isComposing && event.nativeEvent.keyCode !== 229) {
390
- event.preventDefault();
391
- event.currentTarget.form?.requestSubmit();
963
+ onCompositionStart?.(event_0);
964
+ };
965
+ $[17] = onCompositionStart;
966
+ $[18] = t7;
967
+ } else t7 = $[18];
968
+ let t8;
969
+ if ($[19] !== attachments || $[20] !== onKeyDown) {
970
+ t8 = (event_1) => {
971
+ onKeyDown?.(event_1);
972
+ if (event_1.defaultPrevented) return;
973
+ if (event_1.key === "Enter" && !event_1.shiftKey && !isComposingRef.current && !event_1.nativeEvent.isComposing && event_1.nativeEvent.keyCode !== 229) {
974
+ event_1.preventDefault();
975
+ event_1.currentTarget.form?.requestSubmit();
392
976
  }
393
- if (event.key === "Backspace" && event.currentTarget.value === "" && attachments.files.length > 0) {
394
- event.preventDefault();
977
+ if (event_1.key === "Backspace" && event_1.currentTarget.value === "" && attachments.files.length > 0) {
978
+ event_1.preventDefault();
395
979
  const last = attachments.files.at(-1);
396
980
  if (last) attachments.remove(last.id);
397
981
  }
398
- },
399
- onInput: (event) => {
400
- onInput?.(event);
401
- resize();
402
- },
403
- onPaste: (event) => {
404
- onPaste?.(event);
405
- if (event.defaultPrevented) return;
406
- if (event.clipboardData.files.length) attachments.add(event.clipboardData.files);
407
- },
408
- style: {
409
- minHeight,
410
- maxHeight,
411
- ...props.style
412
- },
413
- ...props,
414
- value: controller.textInput.value,
415
- onChange: (event) => {
416
- controller.textInput.setInput(event.currentTarget.value);
417
- onChange?.(event);
418
- }
419
- });
982
+ };
983
+ $[19] = attachments;
984
+ $[20] = onKeyDown;
985
+ $[21] = t8;
986
+ } else t8 = $[21];
987
+ let t9;
988
+ if ($[22] !== attachments || $[23] !== onPaste) {
989
+ t9 = (event_2) => {
990
+ onPaste?.(event_2);
991
+ if (event_2.defaultPrevented) return;
992
+ if (event_2.clipboardData.files.length) attachments.add(event_2.clipboardData.files);
993
+ };
994
+ $[22] = attachments;
995
+ $[23] = onPaste;
996
+ $[24] = t9;
997
+ } else t9 = $[24];
998
+ let t10;
999
+ if ($[25] !== controller.textInput || $[26] !== onChange) {
1000
+ t10 = (event_3) => {
1001
+ controller.textInput.setInput(event_3.currentTarget.value);
1002
+ onChange?.(event_3);
1003
+ };
1004
+ $[25] = controller.textInput;
1005
+ $[26] = onChange;
1006
+ $[27] = t10;
1007
+ } else t10 = $[27];
1008
+ let t11;
1009
+ if ($[28] !== controller.textInput.value || $[29] !== placeholder || $[30] !== props || $[31] !== rows || $[32] !== t10 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 || $[37] !== t9) {
1010
+ t11 = /* @__PURE__ */ jsx("textarea", {
1011
+ ref: innerRef,
1012
+ "data-prompt-input-textarea": "true",
1013
+ className: t5,
1014
+ "aria-label": "Message",
1015
+ name: "message",
1016
+ placeholder,
1017
+ rows,
1018
+ onCompositionEnd: t6,
1019
+ onCompositionStart: t7,
1020
+ onKeyDown: t8,
1021
+ onPaste: t9,
1022
+ ...props,
1023
+ value: controller.textInput.value,
1024
+ onChange: t10
1025
+ });
1026
+ $[28] = controller.textInput.value;
1027
+ $[29] = placeholder;
1028
+ $[30] = props;
1029
+ $[31] = rows;
1030
+ $[32] = t10;
1031
+ $[33] = t5;
1032
+ $[34] = t6;
1033
+ $[35] = t7;
1034
+ $[36] = t8;
1035
+ $[37] = t9;
1036
+ $[38] = t11;
1037
+ } else t11 = $[38];
1038
+ return t11;
420
1039
  }
421
- function PromptInputButton({ className, tooltip, variant = "ghost", color = "neutral", size, iconOnly, children, "aria-label": ariaLabel, ref, ...props }) {
1040
+ function PromptInputButton(t0) {
1041
+ const $ = c(41);
1042
+ let ariaLabel;
1043
+ let children;
1044
+ let className;
1045
+ let iconOnly;
1046
+ let props;
1047
+ let ref;
1048
+ let size;
1049
+ let t1;
1050
+ let t2;
1051
+ let tooltip;
1052
+ if ($[0] !== t0) {
1053
+ ({className, tooltip, variant: t1, color: t2, size, iconOnly, children, "aria-label": ariaLabel, ref, ...props} = t0);
1054
+ $[0] = t0;
1055
+ $[1] = ariaLabel;
1056
+ $[2] = children;
1057
+ $[3] = className;
1058
+ $[4] = iconOnly;
1059
+ $[5] = props;
1060
+ $[6] = ref;
1061
+ $[7] = size;
1062
+ $[8] = t1;
1063
+ $[9] = t2;
1064
+ $[10] = tooltip;
1065
+ } else {
1066
+ ariaLabel = $[1];
1067
+ children = $[2];
1068
+ className = $[3];
1069
+ iconOnly = $[4];
1070
+ props = $[5];
1071
+ ref = $[6];
1072
+ size = $[7];
1073
+ t1 = $[8];
1074
+ t2 = $[9];
1075
+ tooltip = $[10];
1076
+ }
1077
+ const variant = t1 === void 0 ? "ghost" : t1;
1078
+ const color = t2 === void 0 ? "neutral" : t2;
422
1079
  const childCount = React.Children.count(children);
423
1080
  const resolvedSize = size ?? "xs";
424
1081
  const resolvedIconOnly = iconOnly ?? childCount <= 1;
425
- const tooltipConfig = typeof tooltip === "string" ? { content: tooltip } : tooltip;
1082
+ let t3;
1083
+ if ($[11] !== tooltip) {
1084
+ t3 = typeof tooltip === "string" ? { content: tooltip } : tooltip;
1085
+ $[11] = tooltip;
1086
+ $[12] = t3;
1087
+ } else t3 = $[12];
1088
+ const tooltipConfig = t3;
426
1089
  const fallbackLabel = ariaLabel ?? (typeof tooltipConfig?.content === "string" ? tooltipConfig.content : void 0);
427
1090
  const hasResponsiveLabel = Boolean(tooltipConfig && React.Children.count(children) > 1);
428
- const button = /* @__PURE__ */ jsx(Button, {
429
- ref,
430
- type: "button",
431
- variant,
432
- color,
433
- size: resolvedSize,
434
- iconOnly: resolvedIconOnly,
435
- className: cx("prompt-input__button", className),
436
- "aria-label": fallbackLabel,
437
- "data-responsive-label": hasResponsiveLabel || void 0,
438
- ...props,
439
- children
440
- });
1091
+ let t4;
1092
+ if ($[13] !== className) {
1093
+ t4 = cx("prompt-input__button", className);
1094
+ $[13] = className;
1095
+ $[14] = t4;
1096
+ } else t4 = $[14];
1097
+ const t5 = hasResponsiveLabel || void 0;
1098
+ let t6;
1099
+ if ($[15] !== children || $[16] !== color || $[17] !== fallbackLabel || $[18] !== props || $[19] !== ref || $[20] !== resolvedIconOnly || $[21] !== resolvedSize || $[22] !== t4 || $[23] !== t5 || $[24] !== variant) {
1100
+ t6 = /* @__PURE__ */ jsx(Button, {
1101
+ ref,
1102
+ type: "button",
1103
+ variant,
1104
+ color,
1105
+ size: resolvedSize,
1106
+ iconOnly: resolvedIconOnly,
1107
+ className: t4,
1108
+ "aria-label": fallbackLabel,
1109
+ "data-responsive-label": t5,
1110
+ ...props,
1111
+ children
1112
+ });
1113
+ $[15] = children;
1114
+ $[16] = color;
1115
+ $[17] = fallbackLabel;
1116
+ $[18] = props;
1117
+ $[19] = ref;
1118
+ $[20] = resolvedIconOnly;
1119
+ $[21] = resolvedSize;
1120
+ $[22] = t4;
1121
+ $[23] = t5;
1122
+ $[24] = variant;
1123
+ $[25] = t6;
1124
+ } else t6 = $[25];
1125
+ const button = t6;
441
1126
  if (!tooltipConfig) return button;
442
- return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: button }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
443
- side: tooltipConfig.side,
444
- sideOffset: 6,
445
- children: /* @__PURE__ */ jsxs(Tooltip.Popup, { children: [/* @__PURE__ */ jsx("span", {
1127
+ let t7;
1128
+ if ($[26] !== button) {
1129
+ t7 = /* @__PURE__ */ jsx(Tooltip.Trigger, { render: button });
1130
+ $[26] = button;
1131
+ $[27] = t7;
1132
+ } else t7 = $[27];
1133
+ let t8;
1134
+ if ($[28] !== tooltipConfig.content) {
1135
+ t8 = /* @__PURE__ */ jsx("span", {
446
1136
  className: "prompt-input__tooltip-content",
447
1137
  children: tooltipConfig.content
448
- }), tooltipConfig.shortcut ? /* @__PURE__ */ jsx(Kbd, {
1138
+ });
1139
+ $[28] = tooltipConfig.content;
1140
+ $[29] = t8;
1141
+ } else t8 = $[29];
1142
+ let t9;
1143
+ if ($[30] !== tooltipConfig.shortcut) {
1144
+ t9 = tooltipConfig.shortcut ? /* @__PURE__ */ jsx(Kbd, {
449
1145
  className: "prompt-input__tooltip-shortcut",
450
1146
  children: tooltipConfig.shortcut
451
- }) : null] })
452
- }) })] });
1147
+ }) : null;
1148
+ $[30] = tooltipConfig.shortcut;
1149
+ $[31] = t9;
1150
+ } else t9 = $[31];
1151
+ let t10;
1152
+ if ($[32] !== t8 || $[33] !== t9) {
1153
+ t10 = /* @__PURE__ */ jsxs(Tooltip.Popup, { children: [t8, t9] });
1154
+ $[32] = t8;
1155
+ $[33] = t9;
1156
+ $[34] = t10;
1157
+ } else t10 = $[34];
1158
+ let t11;
1159
+ if ($[35] !== t10 || $[36] !== tooltipConfig.side) {
1160
+ t11 = /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
1161
+ side: tooltipConfig.side,
1162
+ sideOffset: 6,
1163
+ children: t10
1164
+ }) });
1165
+ $[35] = t10;
1166
+ $[36] = tooltipConfig.side;
1167
+ $[37] = t11;
1168
+ } else t11 = $[37];
1169
+ let t12;
1170
+ if ($[38] !== t11 || $[39] !== t7) {
1171
+ t12 = /* @__PURE__ */ jsxs(Tooltip.Root, { children: [t7, t11] });
1172
+ $[38] = t11;
1173
+ $[39] = t7;
1174
+ $[40] = t12;
1175
+ } else t12 = $[40];
1176
+ return t12;
453
1177
  }
454
1178
  /**
455
1179
  * Voice-dictation control for PromptInput. Final upstream transcripts are
456
1180
  * appended to the composer while interim text remains ephemeral.
457
1181
  */
458
1182
  const DICTATION_METER_GAIN = 12;
459
- function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ...props }) {
1183
+ function PromptInputDictation(t0) {
1184
+ const $ = c(68);
1185
+ let beforeStart;
1186
+ let className;
1187
+ let disabled;
1188
+ let props;
1189
+ let ref;
1190
+ let voice;
1191
+ if ($[0] !== t0) {
1192
+ ({voice, beforeStart, className, disabled, ref, ...props} = t0);
1193
+ $[0] = t0;
1194
+ $[1] = beforeStart;
1195
+ $[2] = className;
1196
+ $[3] = disabled;
1197
+ $[4] = props;
1198
+ $[5] = ref;
1199
+ $[6] = voice;
1200
+ } else {
1201
+ beforeStart = $[1];
1202
+ className = $[2];
1203
+ disabled = $[3];
1204
+ props = $[4];
1205
+ ref = $[5];
1206
+ voice = $[6];
1207
+ }
460
1208
  const controller = usePromptInputController();
461
1209
  const attachments = usePromptInputAttachments();
462
1210
  const buttonRef = React.useRef(null);
463
1211
  const committedTranscriptRef = React.useRef("");
464
1212
  const submitAfterStopRef = React.useRef(false);
465
- const recordingStartedAtRef = React.useRef(null);
466
1213
  const [elapsedSeconds, setElapsedSeconds] = React.useState(0);
467
1214
  const [isStarting, setIsStarting] = React.useState(false);
468
1215
  const [startError, setStartError] = React.useState(null);
469
- React.useImperativeHandle(ref, () => buttonRef.current, []);
470
- React.useEffect(() => {
471
- const transcript = voice.transcript;
472
- if (!transcript) {
473
- committedTranscriptRef.current = "";
474
- return;
475
- }
476
- const previous = committedTranscriptRef.current;
477
- const addition = transcript.startsWith(previous) ? transcript.slice(previous.length).trim() : transcript.trim();
478
- committedTranscriptRef.current = transcript;
479
- if (!addition) return;
480
- controller.textInput.setInput(appendDictationTranscript(controller.textInput.value, addition));
481
- voice.clear();
482
- }, [
483
- controller,
484
- voice.clear,
485
- voice.transcript
486
- ]);
487
- React.useEffect(() => {
488
- if (!voice.isListening) {
489
- recordingStartedAtRef.current = null;
490
- setElapsedSeconds(0);
491
- if (submitAfterStopRef.current) {
492
- submitAfterStopRef.current = false;
493
- window.requestAnimationFrame(() => buttonRef.current?.form?.requestSubmit());
1216
+ let t1;
1217
+ let t2;
1218
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1219
+ t1 = () => buttonRef.current;
1220
+ t2 = [];
1221
+ $[7] = t1;
1222
+ $[8] = t2;
1223
+ } else {
1224
+ t1 = $[7];
1225
+ t2 = $[8];
1226
+ }
1227
+ React.useImperativeHandle(ref, t1, t2);
1228
+ const { transcript, clear: clearTranscript, isListening } = voice;
1229
+ let t3;
1230
+ let t4;
1231
+ if ($[9] !== clearTranscript || $[10] !== controller || $[11] !== transcript) {
1232
+ t3 = () => {
1233
+ if (!transcript) {
1234
+ committedTranscriptRef.current = "";
1235
+ return;
1236
+ }
1237
+ const previous = committedTranscriptRef.current;
1238
+ const addition = transcript.startsWith(previous) ? transcript.slice(previous.length).trim() : transcript.trim();
1239
+ committedTranscriptRef.current = transcript;
1240
+ if (!addition) return;
1241
+ controller.textInput.setInput(appendDictationTranscript(controller.textInput.value, addition));
1242
+ clearTranscript();
1243
+ };
1244
+ t4 = [
1245
+ controller,
1246
+ clearTranscript,
1247
+ transcript
1248
+ ];
1249
+ $[9] = clearTranscript;
1250
+ $[10] = controller;
1251
+ $[11] = transcript;
1252
+ $[12] = t3;
1253
+ $[13] = t4;
1254
+ } else {
1255
+ t3 = $[12];
1256
+ t4 = $[13];
1257
+ }
1258
+ React.useEffect(t3, t4);
1259
+ let t5;
1260
+ let t6;
1261
+ if ($[14] !== isListening) {
1262
+ t5 = () => {
1263
+ if (!isListening) {
1264
+ if (submitAfterStopRef.current) {
1265
+ submitAfterStopRef.current = false;
1266
+ window.requestAnimationFrame(() => buttonRef.current?.form?.requestSubmit());
1267
+ }
1268
+ return;
494
1269
  }
495
- return;
496
- }
497
- recordingStartedAtRef.current ??= Date.now();
498
- const updateElapsed = () => {
499
- setElapsedSeconds(Math.floor((Date.now() - (recordingStartedAtRef.current ?? Date.now())) / 1e3));
1270
+ const startedAt = Date.now();
1271
+ const timer = window.setInterval(() => setElapsedSeconds(Math.floor((Date.now() - startedAt) / 1e3)), 250);
1272
+ return () => {
1273
+ window.clearInterval(timer);
1274
+ setElapsedSeconds(0);
1275
+ };
500
1276
  };
501
- updateElapsed();
502
- const timer = window.setInterval(updateElapsed, 250);
503
- return () => window.clearInterval(timer);
504
- }, [voice.isListening]);
1277
+ t6 = [isListening];
1278
+ $[14] = isListening;
1279
+ $[15] = t5;
1280
+ $[16] = t6;
1281
+ } else {
1282
+ t5 = $[15];
1283
+ t6 = $[16];
1284
+ }
1285
+ React.useEffect(t5, t6);
505
1286
  const error = startError ?? voice.error;
506
1287
  const listening = voice.isListening;
1288
+ const setRecording = React.useContext(PromptInputRecordingContext);
1289
+ let t7;
1290
+ let t8;
1291
+ if ($[17] !== listening || $[18] !== setRecording) {
1292
+ t7 = () => {
1293
+ if (!setRecording || !listening) return;
1294
+ setRecording(true);
1295
+ return () => setRecording(false);
1296
+ };
1297
+ t8 = [setRecording, listening];
1298
+ $[17] = listening;
1299
+ $[18] = setRecording;
1300
+ $[19] = t7;
1301
+ $[20] = t8;
1302
+ } else {
1303
+ t7 = $[19];
1304
+ t8 = $[20];
1305
+ }
1306
+ React.useLayoutEffect(t7, t8);
507
1307
  const label = listening ? "Stop dictation" : error ? "Retry dictation" : "Start dictation";
508
1308
  const status = error ? `Dictation failed: ${error}` : listening ? voice.interimTranscript ? "Listening. Speech detected." : "Listening for speech." : isStarting ? "Starting dictation." : "";
509
- const level = clamp(voice.audioLevel * DICTATION_METER_GAIN, 0, 1);
510
- const elapsed = formatClock(elapsedSeconds);
511
- return /* @__PURE__ */ jsxs(Fragment, { children: [
512
- /* @__PURE__ */ jsx(PromptInputButton, {
1309
+ const t9 = voice.audioLevel * DICTATION_METER_GAIN;
1310
+ let t10;
1311
+ if ($[21] !== t9) {
1312
+ t10 = clamp(t9, 0, 1);
1313
+ $[21] = t9;
1314
+ $[22] = t10;
1315
+ } else t10 = $[22];
1316
+ const level = t10;
1317
+ let t11;
1318
+ if ($[23] !== elapsedSeconds) {
1319
+ t11 = formatClock(elapsedSeconds);
1320
+ $[23] = elapsedSeconds;
1321
+ $[24] = t11;
1322
+ } else t11 = $[24];
1323
+ const elapsed = t11;
1324
+ let t12;
1325
+ if ($[25] !== className) {
1326
+ t12 = cx("prompt-input__dictation", className);
1327
+ $[25] = className;
1328
+ $[26] = t12;
1329
+ } else t12 = $[26];
1330
+ let t13;
1331
+ if ($[27] !== label) {
1332
+ t13 = {
1333
+ content: label,
1334
+ side: "top"
1335
+ };
1336
+ $[27] = label;
1337
+ $[28] = t13;
1338
+ } else t13 = $[28];
1339
+ const t14 = listening || void 0;
1340
+ const t15 = error ? "true" : void 0;
1341
+ const t16 = listening ? "true" : void 0;
1342
+ const t17 = isStarting ? "true" : void 0;
1343
+ const t18 = disabled || isStarting || listening;
1344
+ const t19 = listening ? -1 : void 0;
1345
+ let t20;
1346
+ if ($[29] !== beforeStart || $[30] !== listening || $[31] !== voice) {
1347
+ t20 = () => {
1348
+ setStartError(null);
1349
+ if (listening) {
1350
+ voice.stop();
1351
+ return;
1352
+ }
1353
+ setIsStarting(true);
1354
+ Promise.resolve().then(() => beforeStart?.(voice)).then(() => voice.start()).catch((reason) => {
1355
+ setStartError(formatErrorMessage(reason));
1356
+ }).finally(() => setIsStarting(false));
1357
+ };
1358
+ $[29] = beforeStart;
1359
+ $[30] = listening;
1360
+ $[31] = voice;
1361
+ $[32] = t20;
1362
+ } else t20 = $[32];
1363
+ let t21;
1364
+ if ($[33] !== level) {
1365
+ t21 = { "--prompt-input-dictation-level": level };
1366
+ $[33] = level;
1367
+ $[34] = t21;
1368
+ } else t21 = $[34];
1369
+ const t22 = t21;
1370
+ let t23;
1371
+ if ($[35] !== isStarting || $[36] !== listening) {
1372
+ t23 = isStarting ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : listening ? /* @__PURE__ */ jsx(StopIcon, {}) : /* @__PURE__ */ jsx(MicrophoneIcon, {});
1373
+ $[35] = isStarting;
1374
+ $[36] = listening;
1375
+ $[37] = t23;
1376
+ } else t23 = $[37];
1377
+ let t24;
1378
+ if ($[38] !== t22 || $[39] !== t23) {
1379
+ t24 = /* @__PURE__ */ jsx("span", {
1380
+ className: "prompt-input__dictation-icon",
1381
+ style: t22,
1382
+ "aria-hidden": "true",
1383
+ children: t23
1384
+ });
1385
+ $[38] = t22;
1386
+ $[39] = t23;
1387
+ $[40] = t24;
1388
+ } else t24 = $[40];
1389
+ let t25;
1390
+ if ($[41] !== label || $[42] !== listening || $[43] !== props || $[44] !== t12 || $[45] !== t13 || $[46] !== t14 || $[47] !== t15 || $[48] !== t16 || $[49] !== t17 || $[50] !== t18 || $[51] !== t19 || $[52] !== t20 || $[53] !== t24) {
1391
+ t25 = /* @__PURE__ */ jsx(PromptInputButton, {
513
1392
  ref: buttonRef,
514
- className: cx("prompt-input__dictation", className),
515
- tooltip: {
516
- content: label,
517
- side: "top"
518
- },
1393
+ className: t12,
1394
+ tooltip: t13,
519
1395
  "aria-label": label,
520
- "aria-hidden": listening || void 0,
1396
+ "aria-hidden": t14,
521
1397
  "aria-pressed": listening,
522
- "data-error": error ? "true" : void 0,
523
- "data-listening": listening ? "true" : void 0,
524
- "data-starting": isStarting ? "true" : void 0,
525
- disabled: disabled || isStarting || listening,
526
- tabIndex: listening ? -1 : void 0,
527
- onClick: () => {
528
- setStartError(null);
529
- if (listening) {
530
- voice.stop();
531
- return;
532
- }
533
- setIsStarting(true);
534
- Promise.resolve().then(() => beforeStart?.(voice)).then(() => voice.start()).catch((reason) => {
535
- setStartError(formatErrorMessage(reason));
536
- }).finally(() => setIsStarting(false));
537
- },
1398
+ "data-error": t15,
1399
+ "data-listening": t16,
1400
+ "data-starting": t17,
1401
+ disabled: t18,
1402
+ tabIndex: t19,
1403
+ onClick: t20,
538
1404
  ...props,
539
- children: /* @__PURE__ */ jsx("span", {
540
- className: "prompt-input__dictation-icon",
541
- style: { "--prompt-input-dictation-level": level },
542
- "aria-hidden": "true",
543
- children: isStarting ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : listening ? /* @__PURE__ */ jsx(StopIcon, {}) : /* @__PURE__ */ jsx(MicrophoneIcon, {})
544
- })
545
- }),
546
- listening ? /* @__PURE__ */ jsxs("div", {
1405
+ children: t24
1406
+ });
1407
+ $[41] = label;
1408
+ $[42] = listening;
1409
+ $[43] = props;
1410
+ $[44] = t12;
1411
+ $[45] = t13;
1412
+ $[46] = t14;
1413
+ $[47] = t15;
1414
+ $[48] = t16;
1415
+ $[49] = t17;
1416
+ $[50] = t18;
1417
+ $[51] = t19;
1418
+ $[52] = t20;
1419
+ $[53] = t24;
1420
+ $[54] = t25;
1421
+ } else t25 = $[54];
1422
+ let t26;
1423
+ if ($[55] !== attachments || $[56] !== elapsed || $[57] !== elapsedSeconds || $[58] !== level || $[59] !== listening || $[60] !== voice) {
1424
+ t26 = listening ? /* @__PURE__ */ jsxs("div", {
547
1425
  className: "prompt-input__recording",
548
1426
  role: "group",
549
1427
  "aria-label": "Voice recording controls",
@@ -588,167 +1466,467 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
588
1466
  children: /* @__PURE__ */ jsx(ArrowUpIcon, { size: 18 })
589
1467
  })
590
1468
  ]
591
- }) : null,
592
- /* @__PURE__ */ jsx("span", {
1469
+ }) : null;
1470
+ $[55] = attachments;
1471
+ $[56] = elapsed;
1472
+ $[57] = elapsedSeconds;
1473
+ $[58] = level;
1474
+ $[59] = listening;
1475
+ $[60] = voice;
1476
+ $[61] = t26;
1477
+ } else t26 = $[61];
1478
+ let t27;
1479
+ if ($[62] !== status) {
1480
+ t27 = /* @__PURE__ */ jsx("span", {
593
1481
  className: "prompt-input__dictation-status sigvelo-visually-hidden",
594
1482
  role: "status",
595
1483
  "aria-live": "polite",
596
1484
  "aria-atomic": "true",
597
1485
  children: status
598
- })
599
- ] });
1486
+ });
1487
+ $[62] = status;
1488
+ $[63] = t27;
1489
+ } else t27 = $[63];
1490
+ let t28;
1491
+ if ($[64] !== t25 || $[65] !== t26 || $[66] !== t27) {
1492
+ t28 = /* @__PURE__ */ jsxs(Fragment, { children: [
1493
+ t25,
1494
+ t26,
1495
+ t27
1496
+ ] });
1497
+ $[64] = t25;
1498
+ $[65] = t26;
1499
+ $[66] = t27;
1500
+ $[67] = t28;
1501
+ } else t28 = $[67];
1502
+ return t28;
600
1503
  }
601
1504
  /**
602
1505
  * Scrolling canvas waveform adapted from ElevenLabs UI's Waveform component.
603
1506
  * Cloudflare Voice already owns the microphone stream, so this renderer
604
1507
  * consumes its upstream `audioLevel` instead of requesting a second stream.
605
1508
  */
606
- function PromptInputRecordingWaveform({ active, level }) {
1509
+ function PromptInputRecordingWaveform(t0) {
1510
+ const $ = c(8);
1511
+ const { active, level } = t0;
607
1512
  const canvasRef = React.useRef(null);
608
1513
  const containerRef = React.useRef(null);
609
- const historyRef = React.useRef([]);
1514
+ let t1;
1515
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1516
+ t1 = [];
1517
+ $[0] = t1;
1518
+ } else t1 = $[0];
1519
+ const historyRef = React.useRef(t1);
610
1520
  const levelRef = React.useRef(level);
611
- React.useEffect(() => {
612
- levelRef.current = level;
613
- }, [level]);
614
- React.useEffect(() => {
615
- const canvas = canvasRef.current;
616
- const container = containerRef.current;
617
- if (!canvas || !container) return;
618
- const resize = () => {
619
- const rect = container.getBoundingClientRect();
620
- const dpr = window.devicePixelRatio || 1;
621
- canvas.width = Math.max(1, Math.round(rect.width * dpr));
622
- canvas.height = Math.max(1, Math.round(rect.height * dpr));
623
- canvas.style.width = `${rect.width}px`;
624
- canvas.style.height = `${rect.height}px`;
625
- canvas.getContext("2d")?.setTransform(dpr, 0, 0, dpr, 0, 0);
1521
+ let t2;
1522
+ let t3;
1523
+ if ($[1] !== level) {
1524
+ t2 = () => {
1525
+ levelRef.current = level;
626
1526
  };
627
- const observer = new ResizeObserver(resize);
628
- observer.observe(container);
629
- resize();
630
- const barWidth = 2;
631
- const step = 4;
632
- let animationFrame = 0;
633
- let lastUpdate = 0;
634
- let smoothedLevel = levelRef.current;
635
- const draw = (time) => {
636
- const context = canvas.getContext("2d");
637
- const rect = canvas.getBoundingClientRect();
638
- if (!context || rect.width === 0 || rect.height === 0) {
1527
+ t3 = [level];
1528
+ $[1] = level;
1529
+ $[2] = t2;
1530
+ $[3] = t3;
1531
+ } else {
1532
+ t2 = $[2];
1533
+ t3 = $[3];
1534
+ }
1535
+ React.useEffect(t2, t3);
1536
+ let t4;
1537
+ let t5;
1538
+ if ($[4] !== active) {
1539
+ t4 = () => {
1540
+ const canvas = canvasRef.current;
1541
+ const container = containerRef.current;
1542
+ if (!canvas || !container) return;
1543
+ const resize = () => {
1544
+ const rect = container.getBoundingClientRect();
1545
+ const dpr = window.devicePixelRatio || 1;
1546
+ canvas.width = Math.max(1, Math.round(rect.width * dpr));
1547
+ canvas.height = Math.max(1, Math.round(rect.height * dpr));
1548
+ canvas.style.width = `${rect.width}px`;
1549
+ canvas.style.height = `${rect.height}px`;
1550
+ canvas.getContext("2d")?.setTransform(dpr, 0, 0, dpr, 0, 0);
1551
+ };
1552
+ const observer = new ResizeObserver(resize);
1553
+ observer.observe(container);
1554
+ resize();
1555
+ let animationFrame = 0;
1556
+ let lastUpdate = 0;
1557
+ let smoothedLevel = levelRef.current;
1558
+ const draw = (time) => {
1559
+ const context = canvas.getContext("2d");
1560
+ const rect_0 = canvas.getBoundingClientRect();
1561
+ if (!context || rect_0.width === 0 || rect_0.height === 0) {
1562
+ animationFrame = window.requestAnimationFrame(draw);
1563
+ return;
1564
+ }
1565
+ const barCount = Math.max(1, Math.floor(rect_0.width / 4));
1566
+ if (active && time - lastUpdate >= 50) {
1567
+ smoothedLevel = smoothedLevel + (levelRef.current - smoothedLevel) * .45;
1568
+ historyRef.current.push(clamp(smoothedLevel, .08, 1));
1569
+ if (historyRef.current.length > barCount) historyRef.current.shift();
1570
+ lastUpdate = time;
1571
+ }
1572
+ context.clearRect(0, 0, rect_0.width, rect_0.height);
1573
+ context.fillStyle = getComputedStyle(canvas).color;
1574
+ const centerY = rect_0.height / 2;
1575
+ for (let index = 0; index < barCount; index = index + 1) {
1576
+ const historyIndex = historyRef.current.length - barCount + index;
1577
+ const value = historyIndex >= 0 ? historyRef.current[historyIndex] ?? .08 : .08;
1578
+ const barHeight = Math.max(2, value * rect_0.height * .9);
1579
+ const x = index * 4;
1580
+ context.globalAlpha = .45 + value * .55;
1581
+ context.beginPath();
1582
+ context.roundRect(x, centerY - barHeight / 2, 2, barHeight, 1);
1583
+ context.fill();
1584
+ }
1585
+ context.globalAlpha = 1;
639
1586
  animationFrame = window.requestAnimationFrame(draw);
640
- return;
641
- }
642
- const barCount = Math.max(1, Math.floor(rect.width / step));
643
- if (active && time - lastUpdate >= 50) {
644
- smoothedLevel += (levelRef.current - smoothedLevel) * .45;
645
- historyRef.current.push(clamp(smoothedLevel, .08, 1));
646
- if (historyRef.current.length > barCount) historyRef.current.shift();
647
- lastUpdate = time;
648
- }
649
- context.clearRect(0, 0, rect.width, rect.height);
650
- context.fillStyle = getComputedStyle(canvas).color;
651
- const centerY = rect.height / 2;
652
- for (let index = 0; index < barCount; index += 1) {
653
- const historyIndex = historyRef.current.length - barCount + index;
654
- const value = historyIndex >= 0 ? historyRef.current[historyIndex] ?? .08 : .08;
655
- const barHeight = Math.max(2, value * rect.height * .9);
656
- const x = index * step;
657
- context.globalAlpha = .45 + value * .55;
658
- context.beginPath();
659
- context.roundRect(x, centerY - barHeight / 2, barWidth, barHeight, 1);
660
- context.fill();
661
- }
662
- context.globalAlpha = 1;
1587
+ };
663
1588
  animationFrame = window.requestAnimationFrame(draw);
1589
+ return () => {
1590
+ observer.disconnect();
1591
+ window.cancelAnimationFrame(animationFrame);
1592
+ };
664
1593
  };
665
- animationFrame = window.requestAnimationFrame(draw);
666
- return () => {
667
- observer.disconnect();
668
- window.cancelAnimationFrame(animationFrame);
669
- };
670
- }, [active]);
671
- return /* @__PURE__ */ jsx("div", {
672
- ref: containerRef,
673
- className: "prompt-input__recording-waveform",
674
- "aria-hidden": "true",
675
- children: /* @__PURE__ */ jsx("canvas", { ref: canvasRef })
676
- });
1594
+ t5 = [active];
1595
+ $[4] = active;
1596
+ $[5] = t4;
1597
+ $[6] = t5;
1598
+ } else {
1599
+ t4 = $[5];
1600
+ t5 = $[6];
1601
+ }
1602
+ React.useEffect(t4, t5);
1603
+ let t6;
1604
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1605
+ t6 = /* @__PURE__ */ jsx("div", {
1606
+ ref: containerRef,
1607
+ className: "prompt-input__recording-waveform",
1608
+ "aria-hidden": "true",
1609
+ children: /* @__PURE__ */ jsx("canvas", { ref: canvasRef })
1610
+ });
1611
+ $[7] = t6;
1612
+ } else t6 = $[7];
1613
+ return t6;
677
1614
  }
678
1615
  function appendDictationTranscript(current, transcript) {
679
1616
  if (!current) return transcript;
680
1617
  return `${current}${/\s$/u.test(current) ? "" : " "}${transcript}`;
681
1618
  }
682
1619
  function PromptInputActionMenu(props) {
683
- return /* @__PURE__ */ jsx(Menu.Root, { ...props });
1620
+ const $ = c(2);
1621
+ let t0;
1622
+ if ($[0] !== props) {
1623
+ t0 = /* @__PURE__ */ jsx(Menu.Root, { ...props });
1624
+ $[0] = props;
1625
+ $[1] = t0;
1626
+ } else t0 = $[1];
1627
+ return t0;
684
1628
  }
685
- function PromptInputActionMenuTrigger({ className, children, ...props }) {
686
- return /* @__PURE__ */ jsx(Menu.Trigger, {
687
- unstyled: true,
688
- render: /* @__PURE__ */ jsx(PromptInputButton, {
689
- className: cx("prompt-input__action-menu-trigger", className),
690
- "aria-label": children == null ? "Add context" : void 0,
691
- ...props,
692
- children: children ?? /* @__PURE__ */ jsx(PlusIcon, {})
693
- })
694
- });
1629
+ function PromptInputActionMenuTrigger(t0) {
1630
+ const $ = c(13);
1631
+ let children;
1632
+ let className;
1633
+ let props;
1634
+ if ($[0] !== t0) {
1635
+ ({className, children, ...props} = t0);
1636
+ $[0] = t0;
1637
+ $[1] = children;
1638
+ $[2] = className;
1639
+ $[3] = props;
1640
+ } else {
1641
+ children = $[1];
1642
+ className = $[2];
1643
+ props = $[3];
1644
+ }
1645
+ let t1;
1646
+ if ($[4] !== className) {
1647
+ t1 = cx("prompt-input__action-menu-trigger", className);
1648
+ $[4] = className;
1649
+ $[5] = t1;
1650
+ } else t1 = $[5];
1651
+ const t2 = children == null ? "Add context" : void 0;
1652
+ let t3;
1653
+ if ($[6] !== children) {
1654
+ t3 = children ?? /* @__PURE__ */ jsx(PlusIcon, {});
1655
+ $[6] = children;
1656
+ $[7] = t3;
1657
+ } else t3 = $[7];
1658
+ let t4;
1659
+ if ($[8] !== props || $[9] !== t1 || $[10] !== t2 || $[11] !== t3) {
1660
+ t4 = /* @__PURE__ */ jsx(Menu.Trigger, {
1661
+ unstyled: true,
1662
+ render: /* @__PURE__ */ jsx(PromptInputButton, {
1663
+ className: t1,
1664
+ "aria-label": t2,
1665
+ ...props,
1666
+ children: t3
1667
+ })
1668
+ });
1669
+ $[8] = props;
1670
+ $[9] = t1;
1671
+ $[10] = t2;
1672
+ $[11] = t3;
1673
+ $[12] = t4;
1674
+ } else t4 = $[12];
1675
+ return t4;
695
1676
  }
696
- function PromptInputActionMenuContent({ anchor, positionMethod, side, sideOffset = 4, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, children, tabIndex = 0, ...props }) {
697
- return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
698
- anchor,
699
- positionMethod,
700
- side,
701
- sideOffset,
702
- align,
703
- alignOffset,
704
- collisionBoundary,
705
- collisionPadding,
706
- sticky,
707
- arrowPadding,
708
- disableAnchorTracking,
709
- collisionAvoidance,
710
- children: /* @__PURE__ */ jsx(Menu.Popup, {
1677
+ function PromptInputActionMenuContent(t0) {
1678
+ const $ = c(38);
1679
+ let align;
1680
+ let alignOffset;
1681
+ let anchor;
1682
+ let arrowPadding;
1683
+ let children;
1684
+ let className;
1685
+ let collisionAvoidance;
1686
+ let collisionBoundary;
1687
+ let collisionPadding;
1688
+ let disableAnchorTracking;
1689
+ let positionMethod;
1690
+ let props;
1691
+ let side;
1692
+ let sticky;
1693
+ let t1;
1694
+ let t2;
1695
+ if ($[0] !== t0) {
1696
+ ({anchor, positionMethod, side, sideOffset: t1, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, children, tabIndex: t2, ...props} = t0);
1697
+ $[0] = t0;
1698
+ $[1] = align;
1699
+ $[2] = alignOffset;
1700
+ $[3] = anchor;
1701
+ $[4] = arrowPadding;
1702
+ $[5] = children;
1703
+ $[6] = className;
1704
+ $[7] = collisionAvoidance;
1705
+ $[8] = collisionBoundary;
1706
+ $[9] = collisionPadding;
1707
+ $[10] = disableAnchorTracking;
1708
+ $[11] = positionMethod;
1709
+ $[12] = props;
1710
+ $[13] = side;
1711
+ $[14] = sticky;
1712
+ $[15] = t1;
1713
+ $[16] = t2;
1714
+ } else {
1715
+ align = $[1];
1716
+ alignOffset = $[2];
1717
+ anchor = $[3];
1718
+ arrowPadding = $[4];
1719
+ children = $[5];
1720
+ className = $[6];
1721
+ collisionAvoidance = $[7];
1722
+ collisionBoundary = $[8];
1723
+ collisionPadding = $[9];
1724
+ disableAnchorTracking = $[10];
1725
+ positionMethod = $[11];
1726
+ props = $[12];
1727
+ side = $[13];
1728
+ sticky = $[14];
1729
+ t1 = $[15];
1730
+ t2 = $[16];
1731
+ }
1732
+ const sideOffset = t1 === void 0 ? 4 : t1;
1733
+ const tabIndex = t2 === void 0 ? 0 : t2;
1734
+ let t3;
1735
+ if ($[17] !== className) {
1736
+ t3 = mergeBaseClassName("prompt-input__action-menu", className);
1737
+ $[17] = className;
1738
+ $[18] = t3;
1739
+ } else t3 = $[18];
1740
+ let t4;
1741
+ if ($[19] !== children || $[20] !== props || $[21] !== t3 || $[22] !== tabIndex) {
1742
+ t4 = /* @__PURE__ */ jsx(Menu.Popup, {
711
1743
  tabIndex,
712
- className: mergeBaseClassName("prompt-input__action-menu", className),
1744
+ className: t3,
713
1745
  ...props,
714
1746
  children
715
- })
716
- }) });
1747
+ });
1748
+ $[19] = children;
1749
+ $[20] = props;
1750
+ $[21] = t3;
1751
+ $[22] = tabIndex;
1752
+ $[23] = t4;
1753
+ } else t4 = $[23];
1754
+ let t5;
1755
+ if ($[24] !== align || $[25] !== alignOffset || $[26] !== anchor || $[27] !== arrowPadding || $[28] !== collisionAvoidance || $[29] !== collisionBoundary || $[30] !== collisionPadding || $[31] !== disableAnchorTracking || $[32] !== positionMethod || $[33] !== side || $[34] !== sideOffset || $[35] !== sticky || $[36] !== t4) {
1756
+ t5 = /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
1757
+ anchor,
1758
+ positionMethod,
1759
+ side,
1760
+ sideOffset,
1761
+ align,
1762
+ alignOffset,
1763
+ collisionBoundary,
1764
+ collisionPadding,
1765
+ sticky,
1766
+ arrowPadding,
1767
+ disableAnchorTracking,
1768
+ collisionAvoidance,
1769
+ children: t4
1770
+ }) });
1771
+ $[24] = align;
1772
+ $[25] = alignOffset;
1773
+ $[26] = anchor;
1774
+ $[27] = arrowPadding;
1775
+ $[28] = collisionAvoidance;
1776
+ $[29] = collisionBoundary;
1777
+ $[30] = collisionPadding;
1778
+ $[31] = disableAnchorTracking;
1779
+ $[32] = positionMethod;
1780
+ $[33] = side;
1781
+ $[34] = sideOffset;
1782
+ $[35] = sticky;
1783
+ $[36] = t4;
1784
+ $[37] = t5;
1785
+ } else t5 = $[37];
1786
+ return t5;
717
1787
  }
718
- function PromptInputActionMenuItem({ className, ...props }) {
719
- return /* @__PURE__ */ jsx(Menu.Item, {
720
- className: mergeBaseClassName("prompt-input__action-menu-item", className),
721
- ...props
722
- });
1788
+ function PromptInputActionMenuItem(t0) {
1789
+ const $ = c(8);
1790
+ let className;
1791
+ let props;
1792
+ if ($[0] !== t0) {
1793
+ ({className, ...props} = t0);
1794
+ $[0] = t0;
1795
+ $[1] = className;
1796
+ $[2] = props;
1797
+ } else {
1798
+ className = $[1];
1799
+ props = $[2];
1800
+ }
1801
+ let t1;
1802
+ if ($[3] !== className) {
1803
+ t1 = mergeBaseClassName("prompt-input__action-menu-item", className);
1804
+ $[3] = className;
1805
+ $[4] = t1;
1806
+ } else t1 = $[4];
1807
+ let t2;
1808
+ if ($[5] !== props || $[6] !== t1) {
1809
+ t2 = /* @__PURE__ */ jsx(Menu.Item, {
1810
+ className: t1,
1811
+ ...props
1812
+ });
1813
+ $[5] = props;
1814
+ $[6] = t1;
1815
+ $[7] = t2;
1816
+ } else t2 = $[7];
1817
+ return t2;
723
1818
  }
724
- function PromptInputActionAddAttachments({ label = "Files and folders", onClick, children, ...props }) {
1819
+ function PromptInputActionAddAttachments(t0) {
1820
+ const $ = c(15);
1821
+ let children;
1822
+ let onClick;
1823
+ let props;
1824
+ let t1;
1825
+ if ($[0] !== t0) {
1826
+ ({label: t1, onClick, children, ...props} = t0);
1827
+ $[0] = t0;
1828
+ $[1] = children;
1829
+ $[2] = onClick;
1830
+ $[3] = props;
1831
+ $[4] = t1;
1832
+ } else {
1833
+ children = $[1];
1834
+ onClick = $[2];
1835
+ props = $[3];
1836
+ t1 = $[4];
1837
+ }
1838
+ const label = t1 === void 0 ? "Files and folders" : t1;
725
1839
  const attachments = usePromptInputAttachments();
726
- return /* @__PURE__ */ jsx(PromptInputActionMenuItem, {
727
- ...props,
728
- onClick: (event) => {
1840
+ let t2;
1841
+ if ($[5] !== attachments || $[6] !== onClick) {
1842
+ t2 = (event) => {
729
1843
  onClick?.(event);
730
1844
  if (!event.defaultPrevented) attachments.openFileDialog();
731
- },
732
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PaperclipIcon, { className: "prompt-input__action-menu-icon" }), label] })
733
- });
1845
+ };
1846
+ $[5] = attachments;
1847
+ $[6] = onClick;
1848
+ $[7] = t2;
1849
+ } else t2 = $[7];
1850
+ let t3;
1851
+ if ($[8] !== children || $[9] !== label) {
1852
+ t3 = children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PaperclipIcon, { className: "prompt-input__action-menu-icon" }), label] });
1853
+ $[8] = children;
1854
+ $[9] = label;
1855
+ $[10] = t3;
1856
+ } else t3 = $[10];
1857
+ let t4;
1858
+ if ($[11] !== props || $[12] !== t2 || $[13] !== t3) {
1859
+ t4 = /* @__PURE__ */ jsx(PromptInputActionMenuItem, {
1860
+ ...props,
1861
+ onClick: t2,
1862
+ children: t3
1863
+ });
1864
+ $[11] = props;
1865
+ $[12] = t2;
1866
+ $[13] = t3;
1867
+ $[14] = t4;
1868
+ } else t4 = $[14];
1869
+ return t4;
734
1870
  }
735
- function PromptInputActionAddScreenshot({ label = "Take screenshot", onClick, children, ...props }) {
1871
+ function PromptInputActionAddScreenshot(t0) {
1872
+ const $ = c(15);
1873
+ let children;
1874
+ let onClick;
1875
+ let props;
1876
+ let t1;
1877
+ if ($[0] !== t0) {
1878
+ ({label: t1, onClick, children, ...props} = t0);
1879
+ $[0] = t0;
1880
+ $[1] = children;
1881
+ $[2] = onClick;
1882
+ $[3] = props;
1883
+ $[4] = t1;
1884
+ } else {
1885
+ children = $[1];
1886
+ onClick = $[2];
1887
+ props = $[3];
1888
+ t1 = $[4];
1889
+ }
1890
+ const label = t1 === void 0 ? "Take screenshot" : t1;
736
1891
  const attachments = usePromptInputAttachments();
737
- return /* @__PURE__ */ jsx(PromptInputActionMenuItem, {
738
- ...props,
739
- onClick: async (event) => {
1892
+ let t2;
1893
+ if ($[5] !== attachments || $[6] !== onClick) {
1894
+ t2 = async (event) => {
740
1895
  onClick?.(event);
741
1896
  if (event.defaultPrevented) return;
742
1897
  try {
743
1898
  const screenshot = await captureScreenshot();
744
1899
  if (screenshot) attachments.add([screenshot]);
745
- } catch (error) {
1900
+ } catch (t3) {
1901
+ const error = t3;
746
1902
  if (error instanceof DOMException && (error.name === "NotAllowedError" || error.name === "AbortError")) return;
747
1903
  throw error;
748
1904
  }
749
- },
750
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MonitorIcon, { className: "prompt-input__action-menu-icon" }), label] })
751
- });
1905
+ };
1906
+ $[5] = attachments;
1907
+ $[6] = onClick;
1908
+ $[7] = t2;
1909
+ } else t2 = $[7];
1910
+ let t3;
1911
+ if ($[8] !== children || $[9] !== label) {
1912
+ t3 = children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MonitorIcon, { className: "prompt-input__action-menu-icon" }), label] });
1913
+ $[8] = children;
1914
+ $[9] = label;
1915
+ $[10] = t3;
1916
+ } else t3 = $[10];
1917
+ let t4;
1918
+ if ($[11] !== props || $[12] !== t2 || $[13] !== t3) {
1919
+ t4 = /* @__PURE__ */ jsx(PromptInputActionMenuItem, {
1920
+ ...props,
1921
+ onClick: t2,
1922
+ children: t3
1923
+ });
1924
+ $[11] = props;
1925
+ $[12] = t2;
1926
+ $[13] = t3;
1927
+ $[14] = t4;
1928
+ } else t4 = $[14];
1929
+ return t4;
752
1930
  }
753
1931
  const PERMISSION_MODES = [{
754
1932
  value: "ask",
@@ -764,88 +1942,278 @@ const PERMISSION_MODES = [{
764
1942
  * time, or bypass. Purely a picker: the auto-approve behavior lives with
765
1943
  * the application that owns the approvals. Shared chat parts never grant bypass.
766
1944
  */
767
- function PromptInputPermissionSelector({ value, onValueChange, question = "How should agent actions be approved?" }) {
768
- const selected = PERMISSION_MODES.find((mode) => mode.value === value) ?? PERMISSION_MODES[0];
769
- const trigger = /* @__PURE__ */ jsx(Menu.Trigger, {
770
- unstyled: true,
771
- render: /* @__PURE__ */ jsxs(PromptInputButton, {
772
- size: "xs",
773
- className: "prompt-input__permissions-trigger",
774
- "data-mode": value,
775
- "aria-label": selected.label,
776
- children: [
777
- /* @__PURE__ */ jsx("span", {
778
- className: "prompt-input__permissions-icon",
779
- children: value === "bypass" ? /* @__PURE__ */ jsx(WarningIcon, { size: 14 }) : /* @__PURE__ */ jsx(WrenchIcon, { size: 14 })
780
- }),
781
- /* @__PURE__ */ jsx("span", {
782
- className: "prompt-input__permissions-current",
783
- children: PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsx("span", {
784
- className: "prompt-input__permissions-current-option",
785
- "data-active": mode.value === value || void 0,
786
- children: mode.label
787
- }, mode.value))
788
- }),
789
- /* @__PURE__ */ jsx(ChevronDownIcon, {
790
- className: "prompt-input__permissions-chevron",
791
- size: 12
792
- })
793
- ]
794
- })
795
- });
796
- return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: trigger }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
797
- side: "top",
798
- sideOffset: 6,
799
- children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: selected.label })
800
- }) })] }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsx(Menu.Popup, {
801
- className: "prompt-input__permissions-menu",
802
- children: /* @__PURE__ */ jsxs(Menu.RadioGroup, {
803
- value,
804
- onValueChange: (mode) => onValueChange(mode),
805
- children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: question }), PERMISSION_MODES.map((mode) => /* @__PURE__ */ jsxs(Menu.RadioItem, {
806
- value: mode.value,
807
- closeOnClick: true,
808
- className: "prompt-input__permissions-option",
809
- children: [/* @__PURE__ */ jsxs("span", {
810
- className: "prompt-input__permissions-option-text",
811
- children: [/* @__PURE__ */ jsx("span", {
812
- className: "prompt-input__permissions-option-label",
813
- children: mode.label
814
- }), /* @__PURE__ */ jsx("span", {
815
- className: "prompt-input__permissions-option-description",
816
- children: mode.description
817
- })]
818
- }), /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { className: "prompt-input__permissions-check" })]
819
- }, mode.value))]
820
- })
821
- }) }) })] });
1945
+ function PromptInputPermissionSelector(t0) {
1946
+ const $ = c(33);
1947
+ const { value, onValueChange, question: t1 } = t0;
1948
+ const question = t1 === void 0 ? "How should agent actions be approved?" : t1;
1949
+ let t2;
1950
+ if ($[0] !== value) {
1951
+ t2 = PERMISSION_MODES.find((mode) => mode.value === value) ?? PERMISSION_MODES[0];
1952
+ $[0] = value;
1953
+ $[1] = t2;
1954
+ } else t2 = $[1];
1955
+ const selected = t2;
1956
+ const t3 = selected.label;
1957
+ let t4;
1958
+ if ($[2] !== value) {
1959
+ t4 = /* @__PURE__ */ jsx("span", {
1960
+ className: "prompt-input__permissions-icon",
1961
+ children: value === "bypass" ? /* @__PURE__ */ jsx(WarningIcon, { size: 14 }) : /* @__PURE__ */ jsx(WrenchIcon, { size: 14 })
1962
+ });
1963
+ $[2] = value;
1964
+ $[3] = t4;
1965
+ } else t4 = $[3];
1966
+ let t5;
1967
+ if ($[4] !== value) {
1968
+ t5 = PERMISSION_MODES.map((mode_0) => /* @__PURE__ */ jsx("span", {
1969
+ className: "prompt-input__permissions-current-option",
1970
+ "data-active": mode_0.value === value || void 0,
1971
+ children: mode_0.label
1972
+ }, mode_0.value));
1973
+ $[4] = value;
1974
+ $[5] = t5;
1975
+ } else t5 = $[5];
1976
+ let t6;
1977
+ if ($[6] !== t5) {
1978
+ t6 = /* @__PURE__ */ jsx("span", {
1979
+ className: "prompt-input__permissions-current",
1980
+ children: t5
1981
+ });
1982
+ $[6] = t5;
1983
+ $[7] = t6;
1984
+ } else t6 = $[7];
1985
+ let t7;
1986
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1987
+ t7 = /* @__PURE__ */ jsx(ChevronDownIcon, {
1988
+ className: "prompt-input__permissions-chevron",
1989
+ size: 12
1990
+ });
1991
+ $[8] = t7;
1992
+ } else t7 = $[8];
1993
+ let t8;
1994
+ if ($[9] !== selected.label || $[10] !== t4 || $[11] !== t6 || $[12] !== value) {
1995
+ t8 = /* @__PURE__ */ jsx(Menu.Trigger, {
1996
+ unstyled: true,
1997
+ render: /* @__PURE__ */ jsxs(PromptInputButton, {
1998
+ size: "xs",
1999
+ className: "prompt-input__permissions-trigger",
2000
+ "data-mode": value,
2001
+ "aria-label": t3,
2002
+ children: [
2003
+ t4,
2004
+ t6,
2005
+ t7
2006
+ ]
2007
+ })
2008
+ });
2009
+ $[9] = selected.label;
2010
+ $[10] = t4;
2011
+ $[11] = t6;
2012
+ $[12] = value;
2013
+ $[13] = t8;
2014
+ } else t8 = $[13];
2015
+ const trigger = t8;
2016
+ let t9;
2017
+ if ($[14] !== trigger) {
2018
+ t9 = /* @__PURE__ */ jsx(Tooltip.Trigger, { render: trigger });
2019
+ $[14] = trigger;
2020
+ $[15] = t9;
2021
+ } else t9 = $[15];
2022
+ let t10;
2023
+ if ($[16] !== selected.label) {
2024
+ t10 = /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
2025
+ side: "top",
2026
+ sideOffset: 6,
2027
+ children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: selected.label })
2028
+ }) });
2029
+ $[16] = selected.label;
2030
+ $[17] = t10;
2031
+ } else t10 = $[17];
2032
+ let t11;
2033
+ if ($[18] !== t10 || $[19] !== t9) {
2034
+ t11 = /* @__PURE__ */ jsxs(Tooltip.Root, { children: [t9, t10] });
2035
+ $[18] = t10;
2036
+ $[19] = t9;
2037
+ $[20] = t11;
2038
+ } else t11 = $[20];
2039
+ let t12;
2040
+ if ($[21] !== onValueChange) {
2041
+ t12 = (mode_1) => onValueChange(mode_1);
2042
+ $[21] = onValueChange;
2043
+ $[22] = t12;
2044
+ } else t12 = $[22];
2045
+ let t13;
2046
+ if ($[23] !== question) {
2047
+ t13 = /* @__PURE__ */ jsx(Menu.GroupLabel, { children: question });
2048
+ $[23] = question;
2049
+ $[24] = t13;
2050
+ } else t13 = $[24];
2051
+ let t14;
2052
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
2053
+ t14 = PERMISSION_MODES.map(_temp5);
2054
+ $[25] = t14;
2055
+ } else t14 = $[25];
2056
+ let t15;
2057
+ if ($[26] !== t12 || $[27] !== t13 || $[28] !== value) {
2058
+ t15 = /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsx(Menu.Popup, {
2059
+ className: "prompt-input__permissions-menu",
2060
+ children: /* @__PURE__ */ jsxs(Menu.RadioGroup, {
2061
+ value,
2062
+ onValueChange: t12,
2063
+ children: [t13, t14]
2064
+ })
2065
+ }) }) });
2066
+ $[26] = t12;
2067
+ $[27] = t13;
2068
+ $[28] = value;
2069
+ $[29] = t15;
2070
+ } else t15 = $[29];
2071
+ let t16;
2072
+ if ($[30] !== t11 || $[31] !== t15) {
2073
+ t16 = /* @__PURE__ */ jsxs(Menu.Root, { children: [t11, t15] });
2074
+ $[30] = t11;
2075
+ $[31] = t15;
2076
+ $[32] = t16;
2077
+ } else t16 = $[32];
2078
+ return t16;
822
2079
  }
823
- function PromptInputSubmit({ className, status = "ready", onStop, variant = "normal", color = "primary", size = "xs", onClick, children, label, hasContent = false, ref, ...props }) {
2080
+ function _temp5(mode_2) {
2081
+ return /* @__PURE__ */ jsxs(Menu.RadioItem, {
2082
+ value: mode_2.value,
2083
+ closeOnClick: true,
2084
+ className: "prompt-input__permissions-option",
2085
+ children: [/* @__PURE__ */ jsxs("span", {
2086
+ className: "prompt-input__permissions-option-text",
2087
+ children: [/* @__PURE__ */ jsx("span", {
2088
+ className: "prompt-input__permissions-option-label",
2089
+ children: mode_2.label
2090
+ }), /* @__PURE__ */ jsx("span", {
2091
+ className: "prompt-input__permissions-option-description",
2092
+ children: mode_2.description
2093
+ })]
2094
+ }), /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { className: "prompt-input__permissions-check" })]
2095
+ }, mode_2.value);
2096
+ }
2097
+ function PromptInputSubmit(t0) {
2098
+ const $ = c(39);
2099
+ let children;
2100
+ let className;
2101
+ let label;
2102
+ let onClick;
2103
+ let onStop;
2104
+ let props;
2105
+ let ref;
2106
+ let t1;
2107
+ let t2;
2108
+ let t3;
2109
+ let t4;
2110
+ let t5;
2111
+ if ($[0] !== t0) {
2112
+ ({className, status: t1, onStop, variant: t2, color: t3, size: t4, onClick, children, label, hasContent: t5, ref, ...props} = t0);
2113
+ $[0] = t0;
2114
+ $[1] = children;
2115
+ $[2] = className;
2116
+ $[3] = label;
2117
+ $[4] = onClick;
2118
+ $[5] = onStop;
2119
+ $[6] = props;
2120
+ $[7] = ref;
2121
+ $[8] = t1;
2122
+ $[9] = t2;
2123
+ $[10] = t3;
2124
+ $[11] = t4;
2125
+ $[12] = t5;
2126
+ } else {
2127
+ children = $[1];
2128
+ className = $[2];
2129
+ label = $[3];
2130
+ onClick = $[4];
2131
+ onStop = $[5];
2132
+ props = $[6];
2133
+ ref = $[7];
2134
+ t1 = $[8];
2135
+ t2 = $[9];
2136
+ t3 = $[10];
2137
+ t4 = $[11];
2138
+ t5 = $[12];
2139
+ }
2140
+ const status = t1 === void 0 ? "ready" : t1;
2141
+ const variant = t2 === void 0 ? "normal" : t2;
2142
+ const color = t3 === void 0 ? "primary" : t3;
2143
+ const size = t4 === void 0 ? "xs" : t4;
2144
+ const hasContent = t5 === void 0 ? false : t5;
824
2145
  const isBusy = status === "submitted" || status === "streaming";
825
2146
  const isQueueing = isBusy && hasContent;
826
2147
  const isStopping = isBusy && !isQueueing;
827
- const resolvedLabel = label ?? (isQueueing ? "Queue message" : defaultSubmitLabel(status));
828
- return /* @__PURE__ */ jsx(Button, {
829
- ref,
830
- type: isStopping ? "button" : "submit",
831
- variant,
832
- color,
833
- size,
834
- iconOnly: true,
835
- className: cx("prompt-input__submit", className),
836
- "data-status": status,
837
- "aria-label": resolvedLabel,
838
- onClick: (event) => {
2148
+ let t6;
2149
+ if ($[13] !== isQueueing || $[14] !== label || $[15] !== status) {
2150
+ t6 = label ?? (isQueueing ? "Queue message" : defaultSubmitLabel(status));
2151
+ $[13] = isQueueing;
2152
+ $[14] = label;
2153
+ $[15] = status;
2154
+ $[16] = t6;
2155
+ } else t6 = $[16];
2156
+ const resolvedLabel = t6;
2157
+ const t7 = isStopping ? "button" : "submit";
2158
+ let t8;
2159
+ if ($[17] !== className) {
2160
+ t8 = cx("prompt-input__submit", className);
2161
+ $[17] = className;
2162
+ $[18] = t8;
2163
+ } else t8 = $[18];
2164
+ let t9;
2165
+ if ($[19] !== isStopping || $[20] !== onClick || $[21] !== onStop) {
2166
+ t9 = (event) => {
839
2167
  onClick?.(event);
840
2168
  if (event.defaultPrevented) return;
841
2169
  if (isStopping) {
842
2170
  event.preventDefault();
843
2171
  onStop?.();
844
2172
  }
845
- },
846
- ...props,
847
- children: children ?? (isQueueing ? /* @__PURE__ */ jsx(ArrowUpIcon, {}) : defaultSubmitIcon(status))
848
- });
2173
+ };
2174
+ $[19] = isStopping;
2175
+ $[20] = onClick;
2176
+ $[21] = onStop;
2177
+ $[22] = t9;
2178
+ } else t9 = $[22];
2179
+ let t10;
2180
+ if ($[23] !== children || $[24] !== isQueueing || $[25] !== status) {
2181
+ t10 = children ?? (isQueueing ? /* @__PURE__ */ jsx(ArrowUpIcon, {}) : defaultSubmitIcon(status));
2182
+ $[23] = children;
2183
+ $[24] = isQueueing;
2184
+ $[25] = status;
2185
+ $[26] = t10;
2186
+ } else t10 = $[26];
2187
+ let t11;
2188
+ if ($[27] !== color || $[28] !== props || $[29] !== ref || $[30] !== resolvedLabel || $[31] !== size || $[32] !== status || $[33] !== t10 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9 || $[37] !== variant) {
2189
+ t11 = /* @__PURE__ */ jsx(Button, {
2190
+ ref,
2191
+ type: t7,
2192
+ variant,
2193
+ color,
2194
+ size,
2195
+ iconOnly: true,
2196
+ className: t8,
2197
+ "data-status": status,
2198
+ "aria-label": resolvedLabel,
2199
+ onClick: t9,
2200
+ ...props,
2201
+ children: t10
2202
+ });
2203
+ $[27] = color;
2204
+ $[28] = props;
2205
+ $[29] = ref;
2206
+ $[30] = resolvedLabel;
2207
+ $[31] = size;
2208
+ $[32] = status;
2209
+ $[33] = t10;
2210
+ $[34] = t7;
2211
+ $[35] = t8;
2212
+ $[36] = t9;
2213
+ $[37] = variant;
2214
+ $[38] = t11;
2215
+ } else t11 = $[38];
2216
+ return t11;
849
2217
  }
850
2218
  const PromptInputHoverCardContext = React.createContext(null);
851
2219
  function preservePromptInputEventCancellation(handler, cancellation) {
@@ -855,102 +2223,423 @@ function preservePromptInputEventCancellation(handler, cancellation) {
855
2223
  if (event.defaultPrevented) event.preventBaseUIHandler?.();
856
2224
  };
857
2225
  }
858
- function PromptInputHoverCard({ openDelay = 0, closeDelay = 0, className, children, ref, ...props }) {
2226
+ function PromptInputHoverCard(t0) {
2227
+ const $ = c(25);
2228
+ let children;
2229
+ let className;
2230
+ let props;
2231
+ let ref;
2232
+ let t1;
2233
+ let t2;
2234
+ if ($[0] !== t0) {
2235
+ ({openDelay: t1, closeDelay: t2, className, children, ref, ...props} = t0);
2236
+ $[0] = t0;
2237
+ $[1] = children;
2238
+ $[2] = className;
2239
+ $[3] = props;
2240
+ $[4] = ref;
2241
+ $[5] = t1;
2242
+ $[6] = t2;
2243
+ } else {
2244
+ children = $[1];
2245
+ className = $[2];
2246
+ props = $[3];
2247
+ ref = $[4];
2248
+ t1 = $[5];
2249
+ t2 = $[6];
2250
+ }
2251
+ const openDelay = t1 === void 0 ? 0 : t1;
2252
+ const closeDelay = t2 === void 0 ? 0 : t2;
859
2253
  const portalContainer = React.useRef(null);
860
2254
  const cancelNextOpen = React.useRef(false);
861
2255
  const cancelNextClose = React.useRef(false);
862
- const value = React.useMemo(() => ({
863
- cancelNextClose,
864
- cancelNextOpen,
865
- closeDelay,
866
- openDelay,
867
- portalContainer
868
- }), [closeDelay, openDelay]);
869
- return /* @__PURE__ */ jsx(PromptInputHoverCardContext.Provider, {
870
- value,
871
- children: /* @__PURE__ */ jsx("div", {
872
- ref: mergeRefs(ref, portalContainer),
873
- className: cx("prompt-input__hover-card", className),
2256
+ let t3;
2257
+ if ($[7] !== closeDelay || $[8] !== openDelay) {
2258
+ t3 = {
2259
+ cancelNextClose,
2260
+ cancelNextOpen,
2261
+ closeDelay,
2262
+ openDelay,
2263
+ portalContainer
2264
+ };
2265
+ $[7] = closeDelay;
2266
+ $[8] = openDelay;
2267
+ $[9] = t3;
2268
+ } else t3 = $[9];
2269
+ const value = t3;
2270
+ let t4;
2271
+ if ($[10] !== ref) {
2272
+ t4 = mergeRefs(ref, portalContainer);
2273
+ $[10] = ref;
2274
+ $[11] = t4;
2275
+ } else t4 = $[11];
2276
+ let t5;
2277
+ if ($[12] !== className) {
2278
+ t5 = cx("prompt-input__hover-card", className);
2279
+ $[12] = className;
2280
+ $[13] = t5;
2281
+ } else t5 = $[13];
2282
+ let t6;
2283
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
2284
+ t6 = (open, eventDetails) => {
2285
+ const isTriggerInteraction = eventDetails.reason === "trigger-focus" || eventDetails.reason === "trigger-hover";
2286
+ const cancellation = open ? cancelNextOpen : cancelNextClose;
2287
+ if (isTriggerInteraction && cancellation.current) {
2288
+ cancellation.current = false;
2289
+ eventDetails.cancel();
2290
+ }
2291
+ };
2292
+ $[14] = t6;
2293
+ } else t6 = $[14];
2294
+ let t7;
2295
+ if ($[15] !== children) {
2296
+ t7 = /* @__PURE__ */ jsx(PreviewCard.Root, {
2297
+ onOpenChange: t6,
2298
+ children
2299
+ });
2300
+ $[15] = children;
2301
+ $[16] = t7;
2302
+ } else t7 = $[16];
2303
+ let t8;
2304
+ if ($[17] !== props || $[18] !== t4 || $[19] !== t5 || $[20] !== t7) {
2305
+ t8 = /* @__PURE__ */ jsx("div", {
2306
+ ref: t4,
2307
+ className: t5,
874
2308
  ...props,
875
- children: /* @__PURE__ */ jsx(PreviewCard.Root, {
876
- onOpenChange: (open, eventDetails) => {
877
- const isTriggerInteraction = eventDetails.reason === "trigger-focus" || eventDetails.reason === "trigger-hover";
878
- const cancellation = open ? cancelNextOpen : cancelNextClose;
879
- if (isTriggerInteraction && cancellation.current) {
880
- cancellation.current = false;
881
- eventDetails.cancel();
882
- }
883
- },
884
- children
885
- })
886
- })
887
- });
2309
+ children: t7
2310
+ });
2311
+ $[17] = props;
2312
+ $[18] = t4;
2313
+ $[19] = t5;
2314
+ $[20] = t7;
2315
+ $[21] = t8;
2316
+ } else t8 = $[21];
2317
+ let t9;
2318
+ if ($[22] !== t8 || $[23] !== value) {
2319
+ t9 = /* @__PURE__ */ jsx(PromptInputHoverCardContext.Provider, {
2320
+ value,
2321
+ children: t8
2322
+ });
2323
+ $[22] = t8;
2324
+ $[23] = value;
2325
+ $[24] = t9;
2326
+ } else t9 = $[24];
2327
+ return t9;
888
2328
  }
889
- function PromptInputHoverCardTrigger({ className, ref, onFocus, onBlur, onMouseEnter, onMouseLeave, ...props }) {
2329
+ function PromptInputHoverCardTrigger(t0) {
2330
+ const $ = c(44);
2331
+ let className;
2332
+ let onBlur;
2333
+ let onFocus;
2334
+ let onMouseEnter;
2335
+ let onMouseLeave;
2336
+ let props;
2337
+ let ref;
2338
+ if ($[0] !== t0) {
2339
+ ({className, ref, onFocus, onBlur, onMouseEnter, onMouseLeave, ...props} = t0);
2340
+ $[0] = t0;
2341
+ $[1] = className;
2342
+ $[2] = onBlur;
2343
+ $[3] = onFocus;
2344
+ $[4] = onMouseEnter;
2345
+ $[5] = onMouseLeave;
2346
+ $[6] = props;
2347
+ $[7] = ref;
2348
+ } else {
2349
+ className = $[1];
2350
+ onBlur = $[2];
2351
+ onFocus = $[3];
2352
+ onMouseEnter = $[4];
2353
+ onMouseLeave = $[5];
2354
+ props = $[6];
2355
+ ref = $[7];
2356
+ }
890
2357
  const context = React.useContext(PromptInputHoverCardContext);
891
- if (!context) return /* @__PURE__ */ jsx("span", {
892
- ref,
893
- className: cx("prompt-input__hover-card-trigger", className),
894
- onFocus,
895
- onBlur,
896
- onMouseEnter,
897
- onMouseLeave,
898
- ...props
899
- });
900
- return /* @__PURE__ */ jsx(PreviewCard.Trigger, {
901
- render: /* @__PURE__ */ jsx("span", { ref }),
902
- delay: context.openDelay,
903
- closeDelay: context.closeDelay,
904
- className: cx("prompt-input__hover-card-trigger", className),
905
- onFocus: preservePromptInputEventCancellation(onFocus, context.cancelNextOpen),
906
- onBlur: preservePromptInputEventCancellation(onBlur, context.cancelNextClose),
907
- onMouseEnter: preservePromptInputEventCancellation(onMouseEnter, context.cancelNextOpen),
908
- onMouseLeave: preservePromptInputEventCancellation(onMouseLeave, context.cancelNextClose),
909
- ...props
910
- });
2358
+ if (!context) {
2359
+ let t1;
2360
+ if ($[8] !== className) {
2361
+ t1 = cx("prompt-input__hover-card-trigger", className);
2362
+ $[8] = className;
2363
+ $[9] = t1;
2364
+ } else t1 = $[9];
2365
+ let t2;
2366
+ if ($[10] !== onBlur || $[11] !== onFocus || $[12] !== onMouseEnter || $[13] !== onMouseLeave || $[14] !== props || $[15] !== ref || $[16] !== t1) {
2367
+ t2 = /* @__PURE__ */ jsx("span", {
2368
+ ref,
2369
+ className: t1,
2370
+ onFocus,
2371
+ onBlur,
2372
+ onMouseEnter,
2373
+ onMouseLeave,
2374
+ ...props
2375
+ });
2376
+ $[10] = onBlur;
2377
+ $[11] = onFocus;
2378
+ $[12] = onMouseEnter;
2379
+ $[13] = onMouseLeave;
2380
+ $[14] = props;
2381
+ $[15] = ref;
2382
+ $[16] = t1;
2383
+ $[17] = t2;
2384
+ } else t2 = $[17];
2385
+ return t2;
2386
+ }
2387
+ let t1;
2388
+ if ($[18] !== ref) {
2389
+ t1 = /* @__PURE__ */ jsx("span", { ref });
2390
+ $[18] = ref;
2391
+ $[19] = t1;
2392
+ } else t1 = $[19];
2393
+ const t2 = context.openDelay;
2394
+ const t3 = context.closeDelay;
2395
+ let t4;
2396
+ if ($[20] !== className) {
2397
+ t4 = cx("prompt-input__hover-card-trigger", className);
2398
+ $[20] = className;
2399
+ $[21] = t4;
2400
+ } else t4 = $[21];
2401
+ let t5;
2402
+ if ($[22] !== context.cancelNextOpen || $[23] !== onFocus) {
2403
+ t5 = preservePromptInputEventCancellation(onFocus, context.cancelNextOpen);
2404
+ $[22] = context.cancelNextOpen;
2405
+ $[23] = onFocus;
2406
+ $[24] = t5;
2407
+ } else t5 = $[24];
2408
+ let t6;
2409
+ if ($[25] !== context.cancelNextClose || $[26] !== onBlur) {
2410
+ t6 = preservePromptInputEventCancellation(onBlur, context.cancelNextClose);
2411
+ $[25] = context.cancelNextClose;
2412
+ $[26] = onBlur;
2413
+ $[27] = t6;
2414
+ } else t6 = $[27];
2415
+ let t7;
2416
+ if ($[28] !== context.cancelNextOpen || $[29] !== onMouseEnter) {
2417
+ t7 = preservePromptInputEventCancellation(onMouseEnter, context.cancelNextOpen);
2418
+ $[28] = context.cancelNextOpen;
2419
+ $[29] = onMouseEnter;
2420
+ $[30] = t7;
2421
+ } else t7 = $[30];
2422
+ let t8;
2423
+ if ($[31] !== context.cancelNextClose || $[32] !== onMouseLeave) {
2424
+ t8 = preservePromptInputEventCancellation(onMouseLeave, context.cancelNextClose);
2425
+ $[31] = context.cancelNextClose;
2426
+ $[32] = onMouseLeave;
2427
+ $[33] = t8;
2428
+ } else t8 = $[33];
2429
+ let t9;
2430
+ if ($[34] !== context.closeDelay || $[35] !== context.openDelay || $[36] !== props || $[37] !== t1 || $[38] !== t4 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8) {
2431
+ t9 = /* @__PURE__ */ jsx(PreviewCard.Trigger, {
2432
+ render: t1,
2433
+ delay: t2,
2434
+ closeDelay: t3,
2435
+ className: t4,
2436
+ onFocus: t5,
2437
+ onBlur: t6,
2438
+ onMouseEnter: t7,
2439
+ onMouseLeave: t8,
2440
+ ...props
2441
+ });
2442
+ $[34] = context.closeDelay;
2443
+ $[35] = context.openDelay;
2444
+ $[36] = props;
2445
+ $[37] = t1;
2446
+ $[38] = t4;
2447
+ $[39] = t5;
2448
+ $[40] = t6;
2449
+ $[41] = t7;
2450
+ $[42] = t8;
2451
+ $[43] = t9;
2452
+ } else t9 = $[43];
2453
+ return t9;
911
2454
  }
912
- function PromptInputHoverCardContent({ className, ref, onMouseEnter, onMouseLeave, ...props }) {
2455
+ function PromptInputHoverCardContent(t0) {
2456
+ const $ = c(23);
2457
+ let className;
2458
+ let onMouseEnter;
2459
+ let onMouseLeave;
2460
+ let props;
2461
+ let ref;
2462
+ if ($[0] !== t0) {
2463
+ ({className, ref, onMouseEnter, onMouseLeave, ...props} = t0);
2464
+ $[0] = t0;
2465
+ $[1] = className;
2466
+ $[2] = onMouseEnter;
2467
+ $[3] = onMouseLeave;
2468
+ $[4] = props;
2469
+ $[5] = ref;
2470
+ } else {
2471
+ className = $[1];
2472
+ onMouseEnter = $[2];
2473
+ onMouseLeave = $[3];
2474
+ props = $[4];
2475
+ ref = $[5];
2476
+ }
913
2477
  const context = React.useContext(PromptInputHoverCardContext);
914
2478
  if (!context) return null;
915
- return /* @__PURE__ */ jsx(PreviewCard.Portal, {
916
- container: context.portalContainer,
917
- children: /* @__PURE__ */ jsx(PreviewCard.Positioner, {
2479
+ const t1 = context.portalContainer;
2480
+ let t2;
2481
+ if ($[6] !== className) {
2482
+ t2 = cx("prompt-input__hover-card-content", className);
2483
+ $[6] = className;
2484
+ $[7] = t2;
2485
+ } else t2 = $[7];
2486
+ let t3;
2487
+ if ($[8] !== context.cancelNextOpen || $[9] !== onMouseEnter) {
2488
+ t3 = preservePromptInputEventCancellation(onMouseEnter, context.cancelNextOpen);
2489
+ $[8] = context.cancelNextOpen;
2490
+ $[9] = onMouseEnter;
2491
+ $[10] = t3;
2492
+ } else t3 = $[10];
2493
+ let t4;
2494
+ if ($[11] !== context.cancelNextClose || $[12] !== onMouseLeave) {
2495
+ t4 = preservePromptInputEventCancellation(onMouseLeave, context.cancelNextClose);
2496
+ $[11] = context.cancelNextClose;
2497
+ $[12] = onMouseLeave;
2498
+ $[13] = t4;
2499
+ } else t4 = $[13];
2500
+ let t5;
2501
+ if ($[14] !== props || $[15] !== ref || $[16] !== t2 || $[17] !== t3 || $[18] !== t4) {
2502
+ t5 = /* @__PURE__ */ jsx(PreviewCard.Positioner, {
918
2503
  align: "start",
919
2504
  side: "bottom",
920
2505
  sideOffset: 6,
921
2506
  children: /* @__PURE__ */ jsx(PreviewCard.Popup, {
922
2507
  ref,
923
- className: cx("prompt-input__hover-card-content", className),
924
- onMouseEnter: preservePromptInputEventCancellation(onMouseEnter, context.cancelNextOpen),
925
- onMouseLeave: preservePromptInputEventCancellation(onMouseLeave, context.cancelNextClose),
2508
+ className: t2,
2509
+ onMouseEnter: t3,
2510
+ onMouseLeave: t4,
926
2511
  ...props
927
2512
  })
928
- })
929
- });
2513
+ });
2514
+ $[14] = props;
2515
+ $[15] = ref;
2516
+ $[16] = t2;
2517
+ $[17] = t3;
2518
+ $[18] = t4;
2519
+ $[19] = t5;
2520
+ } else t5 = $[19];
2521
+ let t6;
2522
+ if ($[20] !== context.portalContainer || $[21] !== t5) {
2523
+ t6 = /* @__PURE__ */ jsx(PreviewCard.Portal, {
2524
+ container: t1,
2525
+ children: t5
2526
+ });
2527
+ $[20] = context.portalContainer;
2528
+ $[21] = t5;
2529
+ $[22] = t6;
2530
+ } else t6 = $[22];
2531
+ return t6;
930
2532
  }
931
2533
  const PromptInputTabsList = Tabs.List;
932
2534
  const PromptInputTab = Tabs.Tab;
933
2535
  const PromptInputTabBody = Tabs.Panel;
934
- function PromptInputTabLabel({ className, ref, ...props }) {
935
- return /* @__PURE__ */ jsx("h3", {
936
- ref,
937
- className: cx("prompt-input__tab-label", className),
938
- ...props
939
- });
2536
+ function PromptInputTabLabel(t0) {
2537
+ const $ = c(10);
2538
+ let className;
2539
+ let props;
2540
+ let ref;
2541
+ if ($[0] !== t0) {
2542
+ ({className, ref, ...props} = t0);
2543
+ $[0] = t0;
2544
+ $[1] = className;
2545
+ $[2] = props;
2546
+ $[3] = ref;
2547
+ } else {
2548
+ className = $[1];
2549
+ props = $[2];
2550
+ ref = $[3];
2551
+ }
2552
+ let t1;
2553
+ if ($[4] !== className) {
2554
+ t1 = cx("prompt-input__tab-label", className);
2555
+ $[4] = className;
2556
+ $[5] = t1;
2557
+ } else t1 = $[5];
2558
+ let t2;
2559
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
2560
+ t2 = /* @__PURE__ */ jsx("h3", {
2561
+ ref,
2562
+ className: t1,
2563
+ ...props
2564
+ });
2565
+ $[6] = props;
2566
+ $[7] = ref;
2567
+ $[8] = t1;
2568
+ $[9] = t2;
2569
+ } else t2 = $[9];
2570
+ return t2;
940
2571
  }
941
- function PromptInputTabItem({ className, href, icon, children, ref, ...props }) {
942
- if (href) return /* @__PURE__ */ jsx(ComposerLink, {
943
- href,
944
- icon,
945
- className: cx("prompt-input__tab-item", className),
946
- children
947
- });
948
- return /* @__PURE__ */ jsxs("div", {
949
- ref,
950
- className: cx("prompt-input__tab-item", className),
951
- ...props,
952
- children: [icon, children]
953
- });
2572
+ function PromptInputTabItem(t0) {
2573
+ const $ = c(22);
2574
+ let children;
2575
+ let className;
2576
+ let href;
2577
+ let icon;
2578
+ let props;
2579
+ let ref;
2580
+ if ($[0] !== t0) {
2581
+ ({className, href, icon, children, ref, ...props} = t0);
2582
+ $[0] = t0;
2583
+ $[1] = children;
2584
+ $[2] = className;
2585
+ $[3] = href;
2586
+ $[4] = icon;
2587
+ $[5] = props;
2588
+ $[6] = ref;
2589
+ } else {
2590
+ children = $[1];
2591
+ className = $[2];
2592
+ href = $[3];
2593
+ icon = $[4];
2594
+ props = $[5];
2595
+ ref = $[6];
2596
+ }
2597
+ if (href) {
2598
+ let t1;
2599
+ if ($[7] !== className) {
2600
+ t1 = cx("prompt-input__tab-item", className);
2601
+ $[7] = className;
2602
+ $[8] = t1;
2603
+ } else t1 = $[8];
2604
+ let t2;
2605
+ if ($[9] !== children || $[10] !== href || $[11] !== icon || $[12] !== t1) {
2606
+ t2 = /* @__PURE__ */ jsx(ComposerLink, {
2607
+ href,
2608
+ icon,
2609
+ className: t1,
2610
+ children
2611
+ });
2612
+ $[9] = children;
2613
+ $[10] = href;
2614
+ $[11] = icon;
2615
+ $[12] = t1;
2616
+ $[13] = t2;
2617
+ } else t2 = $[13];
2618
+ return t2;
2619
+ }
2620
+ const t1 = ref;
2621
+ let t2;
2622
+ if ($[14] !== className) {
2623
+ t2 = cx("prompt-input__tab-item", className);
2624
+ $[14] = className;
2625
+ $[15] = t2;
2626
+ } else t2 = $[15];
2627
+ let t3;
2628
+ if ($[16] !== children || $[17] !== icon || $[18] !== props || $[19] !== t1 || $[20] !== t2) {
2629
+ t3 = /* @__PURE__ */ jsxs("div", {
2630
+ ref: t1,
2631
+ className: t2,
2632
+ ...props,
2633
+ children: [icon, children]
2634
+ });
2635
+ $[16] = children;
2636
+ $[17] = icon;
2637
+ $[18] = props;
2638
+ $[19] = t1;
2639
+ $[20] = t2;
2640
+ $[21] = t3;
2641
+ } else t3 = $[21];
2642
+ return t3;
954
2643
  }
955
2644
  function composerLinksToReferences(text) {
956
2645
  return parseComposerLinks(text).map((link) => ({
@@ -966,89 +2655,220 @@ function composerLinksToReferences(text) {
966
2655
  * Shared-draft composer field with slash-command and mention discovery.
967
2656
  * Selection inserts a special href into the draft — not a chip button.
968
2657
  */
969
- function PromptInputCommandComposer({ commands, mentionCommands, onCommandSelect, emptyMessage = "No commands found.", mentionEmptyMessage = "No MCP servers found.", onKeyDown, ref, placeholder, disabled, className, minHeight, maxHeight, "aria-label": ariaLabel }) {
2658
+ function PromptInputCommandComposer(t0) {
2659
+ const $ = c(57);
2660
+ const { commands, mentionCommands, onCommandSelect, emptyMessage: t1, mentionEmptyMessage: t2, onKeyDown, ref, placeholder, disabled, className, "aria-label": ariaLabel } = t0;
2661
+ const emptyMessage = t1 === void 0 ? "No commands found." : t1;
2662
+ const mentionEmptyMessage = t2 === void 0 ? "No MCP servers found." : t2;
970
2663
  const { attachments, textInput } = usePromptInputController();
971
2664
  const { value, setInput: onValueChange } = textInput;
972
2665
  const inputRef = React.useRef(null);
973
2666
  const highlightedCommandRef = React.useRef(void 0);
974
2667
  const [dismissedValue, setDismissedValue] = React.useState(null);
975
- React.useImperativeHandle(ref, () => inputRef.current, []);
976
- const match = composerTriggerMatch(value);
977
- const trigger = match?.trigger;
978
- const sourceCommands = trigger === "@" ? mentionCommands ?? [] : commands;
979
- const normalizedQuery = (match?.query.trim() ?? "").toLocaleLowerCase();
980
- const filtered = sourceCommands.filter((command) => {
981
- if (!normalizedQuery) return true;
982
- return [
983
- command.label,
984
- command.value,
985
- command.description,
986
- ...command.keywords ?? []
987
- ].filter((term) => Boolean(term)).some((term) => term.toLocaleLowerCase().includes(normalizedQuery));
988
- });
989
- const hasTriggeredCatalog = trigger === "/" ? commands.length > 0 && (match?.triggerIndex === 0 || filtered.length > 0) : trigger === "@" && mentionCommands !== void 0;
990
- const open = Boolean(match && hasTriggeredCatalog) && dismissedValue !== value;
991
- const groups = Array.from(new Set(filtered.map((command) => command.group ?? ""))).map((label) => ({
992
- label,
993
- items: filtered.filter((command) => (command.group ?? "") === label)
994
- }));
995
- const selectCommand = (command) => {
996
- const nextTrigger = trigger ?? "/";
997
- onValueChange(replaceComposerTrigger(value, command, nextTrigger));
998
- setDismissedValue(null);
999
- onCommandSelect?.(command, nextTrigger);
1000
- };
1001
- return /* @__PURE__ */ jsxs(Autocomplete.Root, {
1002
- items: groups,
1003
- filteredItems: groups,
1004
- filter: null,
1005
- value,
1006
- open,
1007
- autoHighlight: true,
1008
- itemToStringValue: (command) => command.value,
1009
- onItemHighlighted: (command) => {
1010
- highlightedCommandRef.current = command;
1011
- },
1012
- onValueChange: (next, { reason }) => {
2668
+ let t3;
2669
+ let t4;
2670
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2671
+ t3 = () => inputRef.current;
2672
+ t4 = [];
2673
+ $[0] = t3;
2674
+ $[1] = t4;
2675
+ } else {
2676
+ t3 = $[0];
2677
+ t4 = $[1];
2678
+ }
2679
+ React.useImperativeHandle(ref, t3, t4);
2680
+ let filtered;
2681
+ let open;
2682
+ let t5;
2683
+ let trigger;
2684
+ if ($[2] !== commands || $[3] !== dismissedValue || $[4] !== mentionCommands || $[5] !== value) {
2685
+ const match = composerTriggerMatch(value);
2686
+ trigger = match?.trigger;
2687
+ const sourceCommands = trigger === "@" ? mentionCommands ?? [] : commands;
2688
+ const query = match?.query.trim() ?? "";
2689
+ filtered = sourceCommands.filter((command) => commandMatchesQuery(command, query));
2690
+ const hasTriggeredCatalog = trigger === "/" ? commands.length > 0 && (match?.triggerIndex === 0 || filtered.length > 0) : trigger === "@" && mentionCommands !== void 0;
2691
+ open = Boolean(match && hasTriggeredCatalog) && dismissedValue !== value;
2692
+ t5 = groupCommands(filtered, "");
2693
+ $[2] = commands;
2694
+ $[3] = dismissedValue;
2695
+ $[4] = mentionCommands;
2696
+ $[5] = value;
2697
+ $[6] = filtered;
2698
+ $[7] = open;
2699
+ $[8] = t5;
2700
+ $[9] = trigger;
2701
+ } else {
2702
+ filtered = $[6];
2703
+ open = $[7];
2704
+ t5 = $[8];
2705
+ trigger = $[9];
2706
+ }
2707
+ const groups = t5;
2708
+ let t6;
2709
+ if ($[10] !== onCommandSelect || $[11] !== onValueChange || $[12] !== trigger || $[13] !== value) {
2710
+ t6 = (command_0) => {
2711
+ const nextTrigger = trigger ?? "/";
2712
+ onValueChange(replaceComposerTrigger(value, command_0, nextTrigger));
2713
+ setDismissedValue(null);
2714
+ onCommandSelect?.(command_0, nextTrigger);
2715
+ };
2716
+ $[10] = onCommandSelect;
2717
+ $[11] = onValueChange;
2718
+ $[12] = trigger;
2719
+ $[13] = value;
2720
+ $[14] = t6;
2721
+ } else t6 = $[14];
2722
+ const selectCommand = t6;
2723
+ let t7;
2724
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
2725
+ t7 = (command_2) => {
2726
+ highlightedCommandRef.current = command_2;
2727
+ };
2728
+ $[15] = t7;
2729
+ } else t7 = $[15];
2730
+ let t8;
2731
+ if ($[16] !== onValueChange) {
2732
+ t8 = (next, t9) => {
2733
+ const { reason } = t9;
1013
2734
  if (reason !== "input-change") return;
1014
2735
  setDismissedValue(null);
1015
2736
  onValueChange(next);
1016
- },
1017
- onOpenChange: (nextOpen) => {
2737
+ };
2738
+ $[16] = onValueChange;
2739
+ $[17] = t8;
2740
+ } else t8 = $[17];
2741
+ let t9;
2742
+ if ($[18] !== value) {
2743
+ t9 = (nextOpen) => {
1018
2744
  if (!nextOpen) setDismissedValue(value);
1019
- },
1020
- children: [/* @__PURE__ */ jsx(Autocomplete.Input, { render: /* @__PURE__ */ jsx(PromptInputComposerEditor, {
2745
+ };
2746
+ $[18] = value;
2747
+ $[19] = t9;
2748
+ } else t9 = $[19];
2749
+ let t10;
2750
+ if ($[20] !== onValueChange) {
2751
+ t10 = (next_0) => {
2752
+ setDismissedValue(null);
2753
+ onValueChange(next_0);
2754
+ };
2755
+ $[20] = onValueChange;
2756
+ $[21] = t10;
2757
+ } else t10 = $[21];
2758
+ let t11;
2759
+ if ($[22] !== filtered || $[23] !== onKeyDown || $[24] !== open || $[25] !== selectCommand) {
2760
+ t11 = (event) => {
2761
+ onKeyDown?.(event);
2762
+ if (event.defaultPrevented || event.key === "Home" || event.key === "End" || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) {
2763
+ event.preventBaseUIHandler();
2764
+ return;
2765
+ }
2766
+ if (event.key !== "Enter" || event.shiftKey || !open) return;
2767
+ const highlightedCommand = highlightedCommandRef.current;
2768
+ if (highlightedCommand && !highlightedCommand.disabled && filtered.includes(highlightedCommand)) return;
2769
+ const command_3 = filtered.find(_temp7);
2770
+ if (!command_3) return;
2771
+ event.preventDefault();
2772
+ selectCommand(command_3);
2773
+ };
2774
+ $[22] = filtered;
2775
+ $[23] = onKeyDown;
2776
+ $[24] = open;
2777
+ $[25] = selectCommand;
2778
+ $[26] = t11;
2779
+ } else t11 = $[26];
2780
+ let t12;
2781
+ if ($[27] !== attachments) {
2782
+ t12 = (event_0) => {
2783
+ if (event_0.clipboardData.files.length) attachments.add(event_0.clipboardData.files);
2784
+ };
2785
+ $[27] = attachments;
2786
+ $[28] = t12;
2787
+ } else t12 = $[28];
2788
+ let t13;
2789
+ if ($[29] !== ariaLabel || $[30] !== className || $[31] !== disabled || $[32] !== placeholder || $[33] !== t10 || $[34] !== t11 || $[35] !== t12 || $[36] !== value) {
2790
+ t13 = /* @__PURE__ */ jsx(Autocomplete.Input, { render: /* @__PURE__ */ jsx(PromptInputComposerEditor, {
1021
2791
  ref: inputRef,
1022
2792
  draft: value,
1023
- onDraftChange: (next) => {
1024
- setDismissedValue(null);
1025
- onValueChange(next);
1026
- },
1027
- onKeyDown: (event) => {
1028
- onKeyDown?.(event);
1029
- if (event.defaultPrevented || event.key === "Home" || event.key === "End" || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) {
1030
- event.preventBaseUIHandler();
1031
- return;
1032
- }
1033
- if (event.key !== "Enter" || event.shiftKey || !open) return;
1034
- const highlightedCommand = highlightedCommandRef.current;
1035
- if (highlightedCommand && !highlightedCommand.disabled && filtered.includes(highlightedCommand)) return;
1036
- const command = filtered.find((candidate) => !candidate.disabled);
1037
- if (!command) return;
1038
- event.preventDefault();
1039
- selectCommand(command);
1040
- },
1041
- onPaste: (event) => {
1042
- if (event.clipboardData.files.length) attachments.add(event.clipboardData.files);
1043
- },
2793
+ onDraftChange: t10,
2794
+ onKeyDown: t11,
2795
+ onPaste: t12,
1044
2796
  placeholder,
1045
2797
  disabled,
1046
2798
  className,
1047
- minHeight,
1048
- maxHeight,
1049
2799
  "aria-label": ariaLabel
1050
- }) }), /* @__PURE__ */ jsx(Autocomplete.Portal, { children: /* @__PURE__ */ jsx(Autocomplete.Positioner, {
1051
- anchor: () => inputRef.current?.closest(".prompt-input__body") ?? null,
2800
+ }) });
2801
+ $[29] = ariaLabel;
2802
+ $[30] = className;
2803
+ $[31] = disabled;
2804
+ $[32] = placeholder;
2805
+ $[33] = t10;
2806
+ $[34] = t11;
2807
+ $[35] = t12;
2808
+ $[36] = value;
2809
+ $[37] = t13;
2810
+ } else t13 = $[37];
2811
+ let t14;
2812
+ if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
2813
+ t14 = () => inputRef.current?.closest(".prompt-input__body") ?? null;
2814
+ $[38] = t14;
2815
+ } else t14 = $[38];
2816
+ let t15;
2817
+ if ($[39] !== selectCommand) {
2818
+ t15 = (group) => /* @__PURE__ */ jsxs(Autocomplete.Group, {
2819
+ items: group.items,
2820
+ children: [group.label ? /* @__PURE__ */ jsx(Autocomplete.GroupLabel, { children: group.label }) : null, /* @__PURE__ */ jsx(Autocomplete.Collection, { children: (command_4) => /* @__PURE__ */ jsxs(Autocomplete.Item, {
2821
+ value: command_4,
2822
+ disabled: command_4.disabled,
2823
+ className: "prompt-input__command-item",
2824
+ onClick: () => selectCommand(command_4),
2825
+ children: [command_4.icon ? /* @__PURE__ */ jsx("span", {
2826
+ className: "prompt-input__command-icon",
2827
+ children: command_4.icon
2828
+ }) : null, /* @__PURE__ */ jsxs("span", {
2829
+ className: "prompt-input__command-copy",
2830
+ children: [
2831
+ /* @__PURE__ */ jsx("span", {
2832
+ className: "prompt-input__command-label",
2833
+ children: command_4.label
2834
+ }),
2835
+ command_4.description ? /* @__PURE__ */ jsx("span", {
2836
+ className: "prompt-input__command-description sigvelo-truncate",
2837
+ children: command_4.description
2838
+ }) : null,
2839
+ command_4.meta ? /* @__PURE__ */ jsx("span", {
2840
+ className: "prompt-input__command-meta",
2841
+ children: command_4.meta
2842
+ }) : null
2843
+ ]
2844
+ })]
2845
+ }, command_4.id) })]
2846
+ }, group.label || "ungrouped");
2847
+ $[39] = selectCommand;
2848
+ $[40] = t15;
2849
+ } else t15 = $[40];
2850
+ let t16;
2851
+ if ($[41] !== t15 || $[42] !== trigger) {
2852
+ t16 = /* @__PURE__ */ jsx(Autocomplete.List, {
2853
+ className: "prompt-input__command-list",
2854
+ "data-command-trigger": trigger,
2855
+ children: t15
2856
+ });
2857
+ $[41] = t15;
2858
+ $[42] = trigger;
2859
+ $[43] = t16;
2860
+ } else t16 = $[43];
2861
+ const t17 = trigger === "@" ? mentionEmptyMessage : emptyMessage;
2862
+ let t18;
2863
+ if ($[44] !== t17) {
2864
+ t18 = /* @__PURE__ */ jsx(Autocomplete.Empty, { children: t17 });
2865
+ $[44] = t17;
2866
+ $[45] = t18;
2867
+ } else t18 = $[45];
2868
+ let t19;
2869
+ if ($[46] !== t16 || $[47] !== t18) {
2870
+ t19 = /* @__PURE__ */ jsx(Autocomplete.Portal, { children: /* @__PURE__ */ jsx(Autocomplete.Positioner, {
2871
+ anchor: t14,
1052
2872
  side: "top",
1053
2873
  sideOffset: 8,
1054
2874
  align: "start",
@@ -1056,106 +2876,227 @@ function PromptInputCommandComposer({ commands, mentionCommands, onCommandSelect
1056
2876
  children: /* @__PURE__ */ jsxs(Autocomplete.Popup, {
1057
2877
  className: "prompt-input__command-popup",
1058
2878
  "data-recipe": "composer-command-surface",
1059
- children: [/* @__PURE__ */ jsx(Autocomplete.List, {
1060
- className: "prompt-input__command-list",
1061
- "data-command-trigger": trigger,
1062
- children: (group) => /* @__PURE__ */ jsxs(Autocomplete.Group, {
1063
- items: group.items,
1064
- children: [group.label ? /* @__PURE__ */ jsx(Autocomplete.GroupLabel, { children: group.label }) : null, /* @__PURE__ */ jsx(Autocomplete.Collection, { children: (command) => /* @__PURE__ */ jsxs(Autocomplete.Item, {
1065
- value: command,
1066
- disabled: command.disabled,
1067
- className: "prompt-input__command-item",
1068
- onClick: () => selectCommand(command),
1069
- children: [command.icon ? /* @__PURE__ */ jsx("span", {
1070
- className: "prompt-input__command-icon",
1071
- children: command.icon
1072
- }) : null, /* @__PURE__ */ jsxs("span", {
1073
- className: "prompt-input__command-copy",
1074
- children: [
1075
- /* @__PURE__ */ jsx("span", {
1076
- className: "prompt-input__command-label",
1077
- children: command.label
1078
- }),
1079
- command.description ? /* @__PURE__ */ jsx("span", {
1080
- className: "prompt-input__command-description sigvelo-truncate",
1081
- children: command.description
1082
- }) : null,
1083
- command.meta ? /* @__PURE__ */ jsx("span", {
1084
- className: "prompt-input__command-meta",
1085
- children: command.meta
1086
- }) : null
1087
- ]
1088
- })]
1089
- }, command.id) })]
1090
- }, group.label || "ungrouped")
1091
- }), /* @__PURE__ */ jsx(Autocomplete.Empty, { children: trigger === "@" ? mentionEmptyMessage : emptyMessage })]
2879
+ children: [t16, t18]
1092
2880
  })
1093
- }) })]
1094
- });
2881
+ }) });
2882
+ $[46] = t16;
2883
+ $[47] = t18;
2884
+ $[48] = t19;
2885
+ } else t19 = $[48];
2886
+ let t20;
2887
+ if ($[49] !== groups || $[50] !== open || $[51] !== t13 || $[52] !== t19 || $[53] !== t8 || $[54] !== t9 || $[55] !== value) {
2888
+ t20 = /* @__PURE__ */ jsxs(Autocomplete.Root, {
2889
+ items: groups,
2890
+ filteredItems: groups,
2891
+ filter: null,
2892
+ value,
2893
+ open,
2894
+ autoHighlight: true,
2895
+ itemToStringValue: _temp6,
2896
+ onItemHighlighted: t7,
2897
+ onValueChange: t8,
2898
+ onOpenChange: t9,
2899
+ children: [t13, t19]
2900
+ });
2901
+ $[49] = groups;
2902
+ $[50] = open;
2903
+ $[51] = t13;
2904
+ $[52] = t19;
2905
+ $[53] = t8;
2906
+ $[54] = t9;
2907
+ $[55] = value;
2908
+ $[56] = t20;
2909
+ } else t20 = $[56];
2910
+ return t20;
2911
+ }
2912
+ function _temp7(candidate) {
2913
+ return !candidate.disabled;
2914
+ }
2915
+ function _temp6(command_1) {
2916
+ return command_1.value;
1095
2917
  }
1096
2918
  /** Controlled composer-footer picker for a host-owned folder or working context. */
1097
- function PromptInputContextSelector({ items, value, onValueChange, categoryLabel = "Folder", unavailableLabel = "Folder unavailable", action }) {
1098
- const selected = items.find((item) => item.value === value);
2919
+ function PromptInputContextSelector(t0) {
2920
+ const $ = c(42);
2921
+ const { items, value, onValueChange, categoryLabel: t1, unavailableLabel: t2, action } = t0;
2922
+ const categoryLabel = t1 === void 0 ? "Folder" : t1;
2923
+ const unavailableLabel = t2 === void 0 ? "Folder unavailable" : t2;
2924
+ let t3;
2925
+ if ($[0] !== items || $[1] !== value) {
2926
+ let t4;
2927
+ if ($[3] !== value) {
2928
+ t4 = (item) => item.value === value;
2929
+ $[3] = value;
2930
+ $[4] = t4;
2931
+ } else t4 = $[4];
2932
+ t3 = items.find(t4);
2933
+ $[0] = items;
2934
+ $[1] = value;
2935
+ $[2] = t3;
2936
+ } else t3 = $[2];
2937
+ const selected = t3;
1099
2938
  const displayLabel = selected?.label ?? unavailableLabel;
1100
2939
  const fullLabel = selected?.description ? `${displayLabel} — ${selected.description}` : displayLabel;
1101
- const trigger = /* @__PURE__ */ jsx(Menu.Trigger, {
1102
- unstyled: true,
1103
- render: /* @__PURE__ */ jsxs(PromptInputButton, {
1104
- size: "xs",
1105
- className: "prompt-input__context-trigger",
1106
- "aria-label": `${categoryLabel}: ${fullLabel}`,
1107
- "data-unavailable": !selected || selected.unavailable || void 0,
1108
- children: [
1109
- /* @__PURE__ */ jsx(FolderIcon, { size: 14 }),
1110
- categoryLabel ? /* @__PURE__ */ jsx("span", {
1111
- className: "prompt-input__context-category sigvelo-truncate",
1112
- children: categoryLabel
1113
- }) : null,
1114
- /* @__PURE__ */ jsx("span", {
1115
- className: "prompt-input__context-value sigvelo-truncate",
1116
- children: displayLabel
1117
- }),
1118
- /* @__PURE__ */ jsx(ChevronDownIcon, {
1119
- className: "prompt-input__context-chevron",
1120
- size: 12
1121
- })
1122
- ]
1123
- })
1124
- });
1125
- return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: trigger }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
1126
- side: "top",
1127
- sideOffset: 6,
1128
- children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: fullLabel })
1129
- }) })] }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsxs(Menu.Popup, {
1130
- className: "prompt-input__context-menu",
1131
- children: [/* @__PURE__ */ jsxs(Menu.RadioGroup, {
1132
- value,
1133
- onValueChange: (next) => onValueChange(String(next)),
1134
- children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: categoryLabel }), items.map((item) => /* @__PURE__ */ jsxs(Menu.RadioItem, {
1135
- value: item.value,
1136
- disabled: item.unavailable,
1137
- closeOnClick: true,
1138
- className: "prompt-input__context-option",
2940
+ const t4 = `${categoryLabel}: ${fullLabel}`;
2941
+ const t5 = !selected || selected.unavailable || void 0;
2942
+ let t6;
2943
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
2944
+ t6 = /* @__PURE__ */ jsx(FolderIcon, { size: 14 });
2945
+ $[5] = t6;
2946
+ } else t6 = $[5];
2947
+ let t7;
2948
+ if ($[6] !== categoryLabel) {
2949
+ t7 = categoryLabel ? /* @__PURE__ */ jsx("span", {
2950
+ className: "prompt-input__context-category sigvelo-truncate",
2951
+ children: categoryLabel
2952
+ }) : null;
2953
+ $[6] = categoryLabel;
2954
+ $[7] = t7;
2955
+ } else t7 = $[7];
2956
+ let t8;
2957
+ if ($[8] !== displayLabel) {
2958
+ t8 = /* @__PURE__ */ jsx("span", {
2959
+ className: "prompt-input__context-value sigvelo-truncate",
2960
+ children: displayLabel
2961
+ });
2962
+ $[8] = displayLabel;
2963
+ $[9] = t8;
2964
+ } else t8 = $[9];
2965
+ let t9;
2966
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
2967
+ t9 = /* @__PURE__ */ jsx(ChevronDownIcon, {
2968
+ className: "prompt-input__context-chevron",
2969
+ size: 12
2970
+ });
2971
+ $[10] = t9;
2972
+ } else t9 = $[10];
2973
+ let t10;
2974
+ if ($[11] !== t4 || $[12] !== t5 || $[13] !== t7 || $[14] !== t8) {
2975
+ t10 = /* @__PURE__ */ jsx(Menu.Trigger, {
2976
+ unstyled: true,
2977
+ render: /* @__PURE__ */ jsxs(PromptInputButton, {
2978
+ size: "xs",
2979
+ className: "prompt-input__context-trigger",
2980
+ "aria-label": t4,
2981
+ "data-unavailable": t5,
1139
2982
  children: [
1140
- /* @__PURE__ */ jsx(FolderIcon, { size: 14 }),
1141
- /* @__PURE__ */ jsxs("span", {
1142
- className: "prompt-input__context-option-copy",
1143
- children: [/* @__PURE__ */ jsx("span", { children: item.label }), item.description ? /* @__PURE__ */ jsx("span", {
1144
- className: "prompt-input__context-description",
1145
- children: item.description
1146
- }) : null]
1147
- }),
1148
- /* @__PURE__ */ jsx(Menu.RadioItemIndicator, {
1149
- className: "prompt-input__context-check",
1150
- children: /* @__PURE__ */ jsx(CheckIcon, { size: 14 })
1151
- })
2983
+ t6,
2984
+ t7,
2985
+ t8,
2986
+ t9
1152
2987
  ]
1153
- }, item.value))]
1154
- }), action ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsx(Menu.Item, {
2988
+ })
2989
+ });
2990
+ $[11] = t4;
2991
+ $[12] = t5;
2992
+ $[13] = t7;
2993
+ $[14] = t8;
2994
+ $[15] = t10;
2995
+ } else t10 = $[15];
2996
+ const trigger = t10;
2997
+ let t11;
2998
+ if ($[16] !== trigger) {
2999
+ t11 = /* @__PURE__ */ jsx(Tooltip.Trigger, { render: trigger });
3000
+ $[16] = trigger;
3001
+ $[17] = t11;
3002
+ } else t11 = $[17];
3003
+ let t12;
3004
+ if ($[18] !== fullLabel) {
3005
+ t12 = /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
3006
+ side: "top",
3007
+ sideOffset: 6,
3008
+ children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: fullLabel })
3009
+ }) });
3010
+ $[18] = fullLabel;
3011
+ $[19] = t12;
3012
+ } else t12 = $[19];
3013
+ let t13;
3014
+ if ($[20] !== t11 || $[21] !== t12) {
3015
+ t13 = /* @__PURE__ */ jsxs(Tooltip.Root, { children: [t11, t12] });
3016
+ $[20] = t11;
3017
+ $[21] = t12;
3018
+ $[22] = t13;
3019
+ } else t13 = $[22];
3020
+ let t14;
3021
+ if ($[23] !== onValueChange) {
3022
+ t14 = (next) => onValueChange(String(next));
3023
+ $[23] = onValueChange;
3024
+ $[24] = t14;
3025
+ } else t14 = $[24];
3026
+ let t15;
3027
+ if ($[25] !== categoryLabel) {
3028
+ t15 = /* @__PURE__ */ jsx(Menu.GroupLabel, { children: categoryLabel });
3029
+ $[25] = categoryLabel;
3030
+ $[26] = t15;
3031
+ } else t15 = $[26];
3032
+ let t16;
3033
+ if ($[27] !== items) {
3034
+ t16 = items.map(_temp8);
3035
+ $[27] = items;
3036
+ $[28] = t16;
3037
+ } else t16 = $[28];
3038
+ let t17;
3039
+ if ($[29] !== t14 || $[30] !== t15 || $[31] !== t16 || $[32] !== value) {
3040
+ t17 = /* @__PURE__ */ jsxs(Menu.RadioGroup, {
3041
+ value,
3042
+ onValueChange: t14,
3043
+ children: [t15, t16]
3044
+ });
3045
+ $[29] = t14;
3046
+ $[30] = t15;
3047
+ $[31] = t16;
3048
+ $[32] = value;
3049
+ $[33] = t17;
3050
+ } else t17 = $[33];
3051
+ let t18;
3052
+ if ($[34] !== action) {
3053
+ t18 = action ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsx(Menu.Item, {
1155
3054
  onClick: action.onSelect,
1156
3055
  children: action.label
1157
- })] }) : null]
1158
- }) }) })] });
3056
+ })] }) : null;
3057
+ $[34] = action;
3058
+ $[35] = t18;
3059
+ } else t18 = $[35];
3060
+ let t19;
3061
+ if ($[36] !== t17 || $[37] !== t18) {
3062
+ t19 = /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsxs(Menu.Popup, {
3063
+ className: "prompt-input__context-menu",
3064
+ children: [t17, t18]
3065
+ }) }) });
3066
+ $[36] = t17;
3067
+ $[37] = t18;
3068
+ $[38] = t19;
3069
+ } else t19 = $[38];
3070
+ let t20;
3071
+ if ($[39] !== t13 || $[40] !== t19) {
3072
+ t20 = /* @__PURE__ */ jsxs(Menu.Root, { children: [t13, t19] });
3073
+ $[39] = t13;
3074
+ $[40] = t19;
3075
+ $[41] = t20;
3076
+ } else t20 = $[41];
3077
+ return t20;
3078
+ }
3079
+ function _temp8(item_0) {
3080
+ return /* @__PURE__ */ jsxs(Menu.RadioItem, {
3081
+ value: item_0.value,
3082
+ disabled: item_0.unavailable,
3083
+ closeOnClick: true,
3084
+ className: "prompt-input__context-option",
3085
+ children: [
3086
+ /* @__PURE__ */ jsx(FolderIcon, { size: 14 }),
3087
+ /* @__PURE__ */ jsxs("span", {
3088
+ className: "prompt-input__context-option-copy",
3089
+ children: [/* @__PURE__ */ jsx("span", { children: item_0.label }), item_0.description ? /* @__PURE__ */ jsx("span", {
3090
+ className: "prompt-input__context-description",
3091
+ children: item_0.description
3092
+ }) : null]
3093
+ }),
3094
+ /* @__PURE__ */ jsx(Menu.RadioItemIndicator, {
3095
+ className: "prompt-input__context-check",
3096
+ children: /* @__PURE__ */ jsx(CheckIcon, { size: 14 })
3097
+ })
3098
+ ]
3099
+ }, item_0.value);
1159
3100
  }
1160
3101
  function defaultSubmitIcon(status) {
1161
3102
  switch (status) {