@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.
- package/dist/{AgentActivity-DptCj8XQ.d.ts → AgentActivity-Cngwkalq.d.ts} +2 -9
- package/dist/{AgentChatQueue-DG2rGyCI.d.ts → AgentChatQueue-C1TDnVAn.d.ts} +1 -1
- package/dist/{AppTopBar-DwzydmXu.d.ts → AppTopBar-CM57rJID.d.ts} +7 -3
- package/dist/ChatGptSignInScreen-CmbBe09G.js +298 -0
- package/dist/{CodeBlock-BTkag9ms.d.ts → CodeBlock-BDupVceI.d.ts} +1 -1
- package/dist/CodeBlock-dt0L8md0.js +892 -0
- package/dist/{EmployeeChrome--PWdtg4B.d.ts → EmployeeChrome-kegSASjC.d.ts} +6 -5
- package/dist/{ExecutionBoard-DvPGdn4F.d.ts → ExecutionBoard-DBj1Aiva.d.ts} +8 -1
- package/dist/ExecutionResult-CXnGcmM4.js +671 -0
- package/dist/FileTree-CjfzpN6X.js +968 -0
- package/dist/{IconButton-FWsa9562.d.ts → IconButton-DXtGMkMI.d.ts} +7 -5
- package/dist/ManagerOffice-T79utm-P.js +2469 -0
- package/dist/{Menu-FA4P6KrA.d.ts → Menu-DajfQr3T.d.ts} +4 -2
- package/dist/{Message-BUedRDN1.d.ts → Message-BLyl6kWe.d.ts} +2 -2
- package/dist/{PromptInput-Dbe6WgWA.d.ts → PromptInput-DEwFMj6f.d.ts} +5 -8
- package/dist/{ResponsiveSidebarShell-DSAMNDdg.d.ts → ResponsiveSidebarShell-RwvmlMHS.d.ts} +23 -13
- package/dist/SetupChecklist-DwscX3Bw.js +230 -0
- package/dist/{Tabs-BYs-RgJ7.d.ts → Tabs-tyvVX3nc.d.ts} +29 -10
- package/dist/{ThinkChatActivity-zZaSsbC-.d.ts → ThinkChatActivity-C7xnO0Fx.d.ts} +1 -1
- package/dist/{ThinkChatActivitySummary-8MO1VjAJ.d.ts → ThinkChatActivitySummary-Dh4Av7x_.d.ts} +1 -1
- package/dist/{ThinkExecutionRun-DJ2TFDmZ.d.ts → ThinkExecutionRun-QzZVWX75.d.ts} +11 -3
- package/dist/ThinkSchedule-D4Ulsa0-.d.ts +53 -0
- package/dist/{ThinkThreadPicker-BmIZmpae.d.ts → ThinkThreadPicker-O-i2KloZ.d.ts} +1 -1
- package/dist/{Workspace-42LA9Zrb.d.ts → Workspace-B9nuTfIi.d.ts} +1 -1
- package/dist/{WorkspaceAutomation-yDZorXla.d.ts → WorkspaceAutomation-C0fghGLi.d.ts} +3 -3
- package/dist/WorkspaceBrowser-oBJv-Dac.js +985 -0
- package/dist/{WorkspaceConcept-BjrgGE1w.d.ts → WorkspaceConcept-D46cYerS.d.ts} +1 -1
- package/dist/{WorkspaceFile-nK2n0i4S.d.ts → WorkspaceFile-BJC6vlp_.d.ts} +15 -4
- package/dist/WorkspaceFileCommands-SNIjRgtU.d.ts +145 -0
- package/dist/WorkspaceFileTransfer-BRD22nW-.d.ts +159 -0
- package/dist/WorkspaceLink-DDkj-Tq5.js +407 -0
- package/dist/{WorkspaceMessageResponse-BZ-_I18b.js → WorkspaceMessageResponse-CXGOQgpo.js} +111 -24
- package/dist/{agent-tool-runs-DsOp_X2y.js → agent-tool-runs-BXKdcxl8.js} +55 -28
- package/dist/app-bar-outlet-BEIGl9iF.js +35 -0
- package/{LICENSE → dist/assets/desktop/LICENSE.fluent.txt} +1 -1
- package/dist/assets/desktop/LICENSE.mac-icons.txt +7 -0
- package/dist/assets/desktop/README.md +43 -0
- package/dist/assets/desktop/automations.svg +19 -0
- package/dist/assets/desktop/document.svg +24 -0
- package/dist/assets/desktop/folder.png +0 -0
- package/dist/assets/desktop/mail.svg +31 -0
- package/dist/assets/desktop/settings.svg +9 -0
- package/dist/assets/desktop/trash-full.svg +23 -0
- package/dist/assets/desktop/trash.svg +19 -0
- package/dist/attachment-preview-DeRqFjdz.js +68 -0
- package/dist/attempt-CySQHJsF.js +21 -0
- package/dist/command-search-1fjmCBBo.js +34 -0
- package/dist/components/agents-sdk/AIProviderDialog.js +757 -224
- package/dist/components/agents-sdk/AgentActivity.d.ts +2 -2
- package/dist/components/agents-sdk/AgentActivity.js +78 -31
- package/dist/components/agents-sdk/AgentChat.d.ts +3 -3
- package/dist/components/agents-sdk/AgentChat.js +1113 -386
- package/dist/components/agents-sdk/AgentChatQueue.d.ts +1 -1
- package/dist/components/agents-sdk/AgentChatQueue.js +290 -173
- package/dist/components/agents-sdk/AgentComputer.d.ts +270 -0
- package/dist/components/agents-sdk/AgentComputer.js +8045 -0
- package/dist/components/agents-sdk/AgentEvent.js +164 -21
- package/dist/components/agents-sdk/AgentScreenSwitcher.d.ts +46 -0
- package/dist/components/agents-sdk/AgentScreenSwitcher.js +409 -0
- package/dist/components/agents-sdk/AgentToolRunsContext.js +139 -41
- package/dist/components/agents-sdk/BrowserLiveScreen.js +860 -551
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +244 -88
- package/dist/components/agents-sdk/BrowserReplay.js +298 -133
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +57 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +979 -129
- package/dist/components/agents-sdk/DiscordConnectionDialog.js +104 -57
- package/dist/components/agents-sdk/EmployeeApp.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeApp.js +108 -46
- package/dist/components/agents-sdk/EmployeeChat.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChat.js +500 -99
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChrome.js +1375 -557
- package/dist/components/agents-sdk/EmployeeSchedules.d.ts +3 -3
- package/dist/components/agents-sdk/EmployeeSchedules.js +281 -64
- package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +2 -2
- package/dist/components/agents-sdk/EmployeeStartScreen.js +185 -52
- package/dist/components/agents-sdk/ExecutionBoard.d.ts +1 -1
- package/dist/components/agents-sdk/ExecutionBoard.js +1661 -462
- package/dist/components/agents-sdk/ManagerAccountActions.js +142 -35
- package/dist/components/agents-sdk/ManagerOffice.d.ts +15 -8
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +551 -185
- package/dist/components/agents-sdk/McpConnectionRequest.js +332 -117
- package/dist/components/agents-sdk/McpConnectorForm.js +320 -100
- package/dist/components/agents-sdk/McpPluginCatalog.js +697 -249
- package/dist/components/agents-sdk/McpServerIcon.js +57 -14
- package/dist/components/agents-sdk/McpServerPicker.d.ts +1 -1
- package/dist/components/agents-sdk/McpServerPicker.js +542 -158
- package/dist/components/agents-sdk/ModelSelector.js +1151 -253
- package/dist/components/agents-sdk/PromptInputApproval.js +115 -27
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +33 -46
- package/dist/components/agents-sdk/SlackConnectionDialog.js +38 -14
- package/dist/components/agents-sdk/SubagentRunIndicator.js +118 -25
- package/dist/components/agents-sdk/SubagentRunLanes.js +291 -107
- package/dist/components/agents-sdk/SubagentRunPanel.js +357 -129
- package/dist/components/agents-sdk/SubagentRunSelector.js +123 -26
- package/dist/components/agents-sdk/ThinkChat.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkChat.js +321 -132
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +306 -100
- package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivitySummary.js +15 -9
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +1386 -404
- package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +5 -3
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +219 -45
- package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkExecutionRun.js +19 -11
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +5 -3
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +224 -37
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +8 -5
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +505 -124
- package/dist/components/agents-sdk/ThinkFullApp.js +147 -44
- package/dist/components/agents-sdk/ThinkPendingApproval.js +381 -75
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +71 -26
- package/dist/components/agents-sdk/ThinkSchedule.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkSchedule.js +124 -1
- package/dist/components/agents-sdk/ThinkScheduleActions.d.ts +3 -3
- package/dist/components/agents-sdk/ThinkScheduleActions.js +363 -132
- package/dist/components/agents-sdk/ThinkScheduleBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkScheduleBrowser.js +249 -116
- package/dist/components/agents-sdk/ThinkScheduleDetail.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkScheduleDetail.js +311 -90
- package/dist/components/agents-sdk/ThinkScheduleForm.d.ts +6 -2
- package/dist/components/agents-sdk/ThinkScheduleForm.js +1318 -475
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +434 -214
- package/dist/components/agents-sdk/TypeSafeConnectionDialog.js +30 -13
- package/dist/components/agents-sdk/WorkbenchBack.js +66 -20
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.js +491 -166
- package/dist/components/agents-sdk/WorkspaceAutomation.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceAutomation.js +1492 -415
- package/dist/components/agents-sdk/WorkspaceAutomationTable.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1316 -525
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +72 -2
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -94
- package/dist/components/agents-sdk/WorkspaceConcept.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +619 -178
- package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +45 -0
- package/dist/components/agents-sdk/WorkspaceDesktop.js +240 -0
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +52 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +267 -85
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceFile.js +30 -9
- package/dist/components/agents-sdk/WorkspaceFileCommands.d.ts +2 -0
- package/dist/components/agents-sdk/WorkspaceFileCommands.js +890 -0
- package/dist/components/agents-sdk/WorkspaceFileDetails.d.ts +29 -0
- package/dist/components/agents-sdk/WorkspaceFileDetails.js +271 -0
- package/dist/components/agents-sdk/WorkspaceFileTransfer.d.ts +2 -0
- package/dist/components/agents-sdk/WorkspaceFileTransfer.js +505 -0
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +18 -3
- package/dist/components/agents-sdk/WorkspaceFileView.js +866 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +71 -26
- package/dist/components/agents-sdk/WorkspaceLink.js +2 -2
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceLive.js +126 -73
- package/dist/components/agents-sdk/WorkspaceLocalFolder.d.ts +63 -0
- package/dist/components/agents-sdk/WorkspaceLocalFolder.js +455 -0
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +118 -58
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +90 -54
- package/dist/components/agents-sdk/WorkspacePerson.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspacePerson.js +172 -41
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceProject.js +175 -41
- package/dist/components/ai-sdk/Activity.js +768 -192
- package/dist/components/ai-sdk/AgentAttention.js +286 -58
- package/dist/components/ai-sdk/AgentChatMessageEditor.js +193 -68
- package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +368 -80
- package/dist/components/ai-sdk/AgentChatTurnError.js +75 -25
- package/dist/components/ai-sdk/AgentMessageParts.js +0 -1
- package/dist/components/ai-sdk/Approval.js +574 -172
- package/dist/components/ai-sdk/Artifact.d.ts +1 -1
- package/dist/components/ai-sdk/Artifact.js +535 -128
- package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +404 -80
- package/dist/components/ai-sdk/Checkpoint.js +229 -45
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +216 -48
- package/dist/components/ai-sdk/ConnectedAppCards.js +229 -52
- package/dist/components/ai-sdk/Context.js +737 -178
- package/dist/components/ai-sdk/Conversation.d.ts +1 -1
- package/dist/components/ai-sdk/Conversation.js +305 -68
- package/dist/components/ai-sdk/ExpansionState.js +74 -15
- package/dist/components/ai-sdk/Goal.js +435 -116
- package/dist/components/ai-sdk/InlineCitation.js +313 -76
- package/dist/components/ai-sdk/MediaPreviewCard.js +451 -135
- package/dist/components/ai-sdk/Message.d.ts +1 -1
- package/dist/components/ai-sdk/Message.js +1010 -195
- package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
- package/dist/components/ai-sdk/MessageScroller.js +264 -46
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +6 -6
- package/dist/components/ai-sdk/Plan.js +639 -128
- package/dist/components/ai-sdk/PromptInput.d.ts +1 -1
- package/dist/components/ai-sdk/PromptInput.js +2735 -794
- package/dist/components/ai-sdk/PromptInputComposerEditor.d.ts +1 -3
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +188 -83
- package/dist/components/ai-sdk/Queue.js +792 -154
- package/dist/components/ai-sdk/Reasoning.js +268 -69
- package/dist/components/ai-sdk/Sources.js +226 -63
- package/dist/components/ai-sdk/Task.js +294 -71
- package/dist/components/ai-sdk/ToolApproval.js +126 -26
- package/dist/components/ai-sdk/ToolInvocation.js +112 -22
- package/dist/components/extension/ChatGptSignInScreen.js +1 -82
- package/dist/components/extension/CodexModelSelector.d.ts +1 -1
- package/dist/components/extension/CodexModelSelector.js +467 -146
- package/dist/components/extension/ConversationTabPicker.d.ts +1 -1
- package/dist/components/extension/ConversationTabPicker.js +254 -76
- package/dist/components/extension/FirstRunSetup.d.ts +61 -35
- package/dist/components/extension/FirstRunSetup.js +3834 -1012
- package/dist/components/foundations/Accordion.js +186 -41
- package/dist/components/foundations/AlertDialog.js +425 -97
- package/dist/components/foundations/AppIcon.d.ts +13 -13
- package/dist/components/foundations/AppIcon.js +183 -34
- package/dist/components/foundations/Autocomplete.js +408 -89
- package/dist/components/foundations/Avatar.d.ts +100 -2
- package/dist/components/foundations/Avatar.js +204 -44
- package/dist/components/foundations/Button.js +64 -13
- package/dist/components/foundations/Card.js +357 -63
- package/dist/components/foundations/Checkbox.js +82 -17
- package/dist/components/foundations/CheckboxGroup.js +266 -58
- package/dist/components/foundations/Collapsible.d.ts +2 -1
- package/dist/components/foundations/Collapsible.js +129 -26
- package/dist/components/foundations/Combobox.js +408 -89
- package/dist/components/foundations/ContextMenu.d.ts +2 -2
- package/dist/components/foundations/ContextMenu.js +591 -117
- package/dist/components/foundations/DescriptionList.js +159 -28
- package/dist/components/foundations/Dialog.js +373 -89
- package/dist/components/foundations/EmptyState.js +86 -23
- package/dist/components/foundations/Favicon.d.ts +17 -0
- package/dist/components/foundations/Favicon.js +62 -0
- package/dist/components/foundations/Field.js +525 -108
- package/dist/components/foundations/Fieldset.js +115 -23
- package/dist/components/foundations/Form.js +38 -9
- package/dist/components/foundations/FormattedDate.d.ts +19 -5
- package/dist/components/foundations/FormattedDate.js +82 -12
- package/dist/components/foundations/IconButton.d.ts +1 -1
- package/dist/components/foundations/IconButton.js +114 -17
- package/dist/components/foundations/Input.js +38 -9
- package/dist/components/foundations/Kbd.js +55 -10
- package/dist/components/foundations/Label.js +56 -12
- package/dist/components/foundations/LinkButton.js +67 -15
- package/dist/components/foundations/Marker.js +138 -29
- package/dist/components/foundations/Menu.d.ts +1 -1
- package/dist/components/foundations/Menu.js +634 -136
- package/dist/components/foundations/Menubar.d.ts +2 -2
- package/dist/components/foundations/Menubar.js +685 -130
- package/dist/components/foundations/Meter.js +186 -41
- package/dist/components/foundations/NavigationMenu.js +426 -95
- package/dist/components/foundations/NumberField.js +223 -49
- package/dist/components/foundations/Popover.js +398 -88
- package/dist/components/foundations/PreviewCard.js +234 -53
- package/dist/components/foundations/Progress.js +117 -25
- package/dist/components/foundations/RadioGroup.d.ts +13 -5
- package/dist/components/foundations/RadioGroup.js +132 -25
- package/dist/components/foundations/ScrollArea.js +230 -51
- package/dist/components/foundations/SearchField.d.ts +8 -3
- package/dist/components/foundations/SearchField.js +129 -28
- package/dist/components/foundations/Select.js +648 -145
- package/dist/components/foundations/Separator.js +61 -12
- package/dist/components/foundations/Slider.js +260 -57
- package/dist/components/foundations/Stepper.d.ts +1 -1
- package/dist/components/foundations/Stepper.js +561 -127
- package/dist/components/foundations/Switch.js +82 -18
- package/dist/components/foundations/Tabs.d.ts +2 -2
- package/dist/components/foundations/Tabs.js +282 -53
- package/dist/components/foundations/Textarea.js +43 -9
- package/dist/components/foundations/ThemeProvider.js +138 -52
- package/dist/components/foundations/Toast.d.ts +10 -2
- package/dist/components/foundations/Toast.js +322 -75
- package/dist/components/foundations/Toggle.d.ts +5 -2
- package/dist/components/foundations/Toggle.js +51 -10
- package/dist/components/foundations/ToggleGroup.d.ts +3 -3
- package/dist/components/foundations/ToggleGroup.js +215 -59
- package/dist/components/foundations/Toolbar.js +249 -61
- package/dist/components/foundations/Tooltip.d.ts +3 -3
- package/dist/components/foundations/Tooltip.js +311 -55
- package/dist/components/foundations/TransitionSurface.js +43 -9
- package/dist/components/foundations/icons.d.ts +2 -2
- package/dist/components/foundations/icons.js +2 -2
- package/dist/components/general-purpose/AccountSignInDialog.js +99 -17
- package/dist/components/general-purpose/ActionGuide.js +290 -64
- package/dist/components/general-purpose/AppFrame.js +72 -14
- package/dist/components/general-purpose/AppTopBar.d.ts +1 -1
- package/dist/components/general-purpose/AppTopBar.js +349 -60
- package/dist/components/general-purpose/BrandLoading.js +37 -9
- package/dist/components/general-purpose/CommandPalette.d.ts +47 -0
- package/dist/components/general-purpose/CommandPalette.js +271 -0
- package/dist/components/general-purpose/Commit.d.ts +1 -1
- package/dist/components/general-purpose/Commit.js +937 -167
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +1 -1
- package/dist/components/general-purpose/EnvironmentVariables.js +600 -114
- package/dist/components/general-purpose/FileTree.d.ts +20 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/ListDetail.d.ts +84 -0
- package/dist/components/general-purpose/ListDetail.js +423 -0
- package/dist/components/general-purpose/NotificationPrompt.js +20 -11
- package/dist/components/general-purpose/PricingBillingToggle.js +33 -6
- package/dist/components/general-purpose/PricingConfirmationDialog.js +126 -42
- package/dist/components/general-purpose/PricingFAQ.js +53 -12
- package/dist/components/general-purpose/PricingPage.js +376 -139
- package/dist/components/general-purpose/PricingPlanCard.js +209 -84
- package/dist/components/general-purpose/PricingUsageCalculator.js +231 -81
- package/dist/components/general-purpose/ResizableSidePanel.js +316 -117
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +840 -342
- package/dist/components/general-purpose/ScreenStack.d.ts +54 -0
- package/dist/components/general-purpose/ScreenStack.js +427 -0
- package/dist/components/general-purpose/SettingsFormDialog.js +235 -77
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/StatusScreen.js +82 -24
- package/dist/components/general-purpose/SwipeActions.d.ts +54 -0
- package/dist/components/general-purpose/SwipeActions.js +357 -0
- package/dist/components/general-purpose/Terminal.d.ts +22 -48
- package/dist/components/general-purpose/Terminal.js +320 -174
- package/dist/components/general-purpose/TestResults.js +975 -196
- package/dist/components/general-purpose/ThemeModeControl.d.ts +3 -1
- package/dist/components/general-purpose/ThemeModeControl.js +66 -23
- package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -0
- package/dist/components/general-purpose/WallpaperPicker.js +180 -0
- package/dist/components/general-purpose/WebPreview.d.ts +5 -7
- package/dist/components/general-purpose/WebPreview.js +770 -203
- package/dist/components/nanites/AgentConnection.js +323 -84
- package/dist/components/nanites/AgentToolDetail.js +233 -53
- package/dist/components/nanites/GithubMotionMark.js +37 -9
- package/dist/components/nanites/NaniteScene.js +535 -323
- package/dist/connected-app-drafts-Bocdg3Z-.js +637 -0
- package/dist/container-width-C43ccJ84.js +17 -0
- package/dist/context-Ddsp8HgD.js +43 -0
- package/dist/{copy-button-B09hHWd1.d.ts → copy-button-C2HRdomn.d.ts} +1 -1
- package/dist/copy-button-DWBVJR6D.js +118 -0
- package/dist/{format-CWaZEp5o.js → format-DL7f2rqp.js} +5 -1
- package/dist/{icons-CReP3qYl.d.ts → icons-B3n7zvU7.d.ts} +10 -2
- package/dist/icons-nLTnB9kd.js +470 -0
- package/dist/{merge-refs-DAh6reu8.js → merge-refs-DTX97mLp.js} +17 -1
- package/dist/motion-CGM3i6lX.js +319 -0
- package/dist/motion-preferences-6qsDIDvH.js +13 -0
- package/dist/{navigation-link-kqMa81v5.js → navigation-link-DMmtdqsM.js} +32 -8
- package/dist/progress-ring-BO649JA9.js +79 -0
- package/dist/provider-logos-Ceu7iYFx.js +362 -0
- package/dist/scheduled-table-source-gGpVJ1TN.js +92 -0
- package/dist/styles/accessibility.css +26 -0
- package/dist/styles/accordion.css +0 -2
- package/dist/styles/activity.css +20 -12
- package/dist/styles/agent-attention.css +31 -10
- package/dist/styles/agent-chat.css +7 -6
- package/dist/styles/agent-computer-motion-reduction.css +118 -0
- package/dist/styles/agent-computer-motion.css +127 -0
- package/dist/styles/agent-computer-phone.css +942 -0
- package/dist/styles/agent-computer.css +1764 -0
- package/dist/styles/agent-connection.css +5 -5
- package/dist/styles/agent-screen-switcher.css +313 -0
- package/dist/styles/app-icon.css +34 -30
- package/dist/styles/app-top-bar.css +33 -18
- package/dist/styles/approval.css +3 -3
- package/dist/styles/artifact.css +1 -1
- package/dist/styles/attachment-preview.css +2 -4
- package/dist/styles/avatar.css +12 -14
- package/dist/styles/base-ui-motion.css +84 -18
- package/dist/styles/base-ui-motion.test.tsx +305 -0
- package/dist/styles/base.css +16 -12
- package/dist/styles/brand.test.ts +7 -20
- package/dist/styles/browser-control-overlay.css +1 -1
- package/dist/styles/browser-live-screen.css +2 -2
- package/dist/styles/browser-live-view.css +1 -1
- package/dist/styles/browser-replay.css +0 -8
- package/dist/styles/browser-run-panel.css +275 -37
- package/dist/styles/button.css +52 -9
- package/dist/styles/card.css +6 -5
- package/dist/styles/chain-of-thought.css +0 -10
- package/dist/styles/checkpoint.css +2 -2
- package/dist/styles/codex-model-selector.css +2 -2
- package/dist/styles/color-contrast.test.ts +18 -1
- package/dist/styles/command-palette.css +110 -0
- package/dist/styles/composer-link.css +11 -7
- package/dist/styles/composition-motion.css +3 -14
- package/dist/styles/context.css +2 -2
- package/dist/styles/conversation-tab-picker.css +7 -0
- package/dist/styles/conversation.css +8 -2
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/employee-app.css +8 -2
- package/dist/styles/employee-chrome.css +4 -4
- package/dist/styles/execution-board.css +206 -114
- package/dist/styles/execution-result.css +2 -2
- package/dist/styles/field.css +187 -4
- package/dist/styles/file-tree.css +218 -40
- package/dist/styles/first-run-setup.css +914 -187
- package/dist/styles/github-motion-mark.css +0 -8
- package/dist/styles/index.css +145 -133
- package/dist/styles/inline-citation.css +5 -4
- package/dist/styles/list-detail.css +57 -0
- package/dist/styles/manager-office.css +6 -8
- package/dist/styles/manager-work.css +4 -2
- package/dist/styles/mcp-plugin-catalog.css +2 -2
- package/dist/styles/mcp-server-picker.css +3 -6
- package/dist/styles/media-preview-card.css +2 -2
- package/dist/styles/menu.css +0 -9
- package/dist/styles/menubar.css +18 -6
- package/dist/styles/message-scroller.css +47 -9
- package/dist/styles/message.css +3 -3
- package/dist/styles/model-selector.css +1 -1
- package/dist/styles/motion-reduction.css +39 -6
- package/dist/styles/pricing-page.css +1 -1
- package/dist/styles/prompt-input.css +29 -29
- package/dist/styles/queue.css +1 -1
- package/dist/styles/recipes.css +212 -28
- package/dist/styles/responsive-sidebar-shell-motion.test.ts +81 -1
- package/dist/styles/responsive-sidebar-shell.css +40 -43
- package/dist/styles/screen-stack.css +123 -0
- package/dist/styles/search-field.css +80 -3
- package/dist/styles/stepper.css +0 -10
- package/dist/styles/streamdown.css +2 -2
- package/dist/styles/subagent-run.css +9 -5
- package/dist/styles/swipe-actions.css +158 -0
- package/dist/styles/tabs.css +80 -23
- package/dist/styles/task.css +7 -1
- package/dist/styles/terminal.css +66 -78
- package/dist/styles/test-results.css +1 -19
- package/dist/styles/textarea.css +2 -1
- package/dist/styles/theme-mode-control.css +154 -26
- package/dist/styles/think-chat-tool-panels.css +1 -1
- package/dist/styles/think-execution-workbench.css +0 -9
- package/dist/styles/think-full-app.css +7 -1
- package/dist/styles/think-schedule.css +81 -54
- package/dist/styles/think-thread-picker.css +28 -37
- package/dist/styles/toast.css +11 -0
- package/dist/styles/toggle-group.css +0 -10
- package/dist/styles/toggle.css +13 -0
- package/dist/styles/tooltip.css +12 -0
- package/dist/styles/transition-surface.css +1 -0
- package/dist/styles/wallpaper-picker.css +224 -0
- package/dist/styles/web-preview.css +47 -18
- package/dist/styles/workspace-automation.css +116 -17
- package/dist/styles/workspace-concepts.css +1 -1
- package/dist/styles/workspace-desktop.css +124 -0
- package/dist/styles/workspace-entity-card.css +3 -1
- package/dist/styles/workspace-explorer.css +499 -5
- package/dist/utils/brand-marks.d.ts +13 -0
- package/dist/utils/brand-marks.js +14 -0
- package/dist/utils/desktop-artwork.d.ts +17 -0
- package/dist/utils/desktop-artwork.js +18 -0
- package/dist/utils/favicon.d.ts +6 -2
- package/dist/utils/favicon.js +16 -4
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/workspace-assets-DdtnBDU3.js +213 -0
- package/dist/{workspace-concept-panel-C_oYhPSx.d.ts → workspace-concept-panel-BDTBISNO.d.ts} +2 -2
- package/dist/workspace-concept-panel-VkjvFCY_.js +140 -0
- package/dist/workspace-delete-BOY6CMBf.js +183 -0
- package/dist/workspace-drag-B6hMXUNt.js +304 -0
- package/dist/workspace-entity-card-9YcsNiqU.js +178 -0
- package/dist/workspace-media-preview-B4iB5Tvi.js +1295 -0
- package/dist/{workspace-path-L_KmjRjq.js → workspace-path-TZggP-u4.js} +14 -1
- package/dist/{workspace-person-BVkYb3dv.js → workspace-person-ZwPqu5TX.js} +67 -21
- package/dist/workspace-quick-look-9V-UFpjj.js +1562 -0
- package/package.json +9 -3
- package/dist/Avatar-t1YRzdwB.d.ts +0 -101
- package/dist/CodeBlock-DYQdZUH6.js +0 -318
- package/dist/ExecutionResult-2fBkpIGN.js +0 -279
- package/dist/FileTree-CDLOD643.js +0 -323
- package/dist/ManagerOffice-CvVSHnOM.js +0 -1129
- package/dist/SetupChecklist-B-iEta9v.js +0 -78
- package/dist/ThinkSchedule-DPoOYWTQ.d.ts +0 -34
- package/dist/WorkspaceFileView-DwIkehSM.js +0 -783
- package/dist/WorkspaceLink-BeFAXpbI.js +0 -225
- package/dist/app-bar-outlet-CNfNzY4Y.js +0 -6
- package/dist/attachment-preview-1CXJvrmb.js +0 -25
- package/dist/chatgpt-sign-in-button-D8AT6x4c.js +0 -32
- package/dist/connected-app-drafts-DtA2fBK5.js +0 -283
- package/dist/copy-button-DbR932tF.js +0 -45
- package/dist/icons-GoybMAB2.js +0 -141
- package/dist/progress-ring-L2bbF0ji.js +0 -40
- package/dist/provider-logos-DWYY8wNz.js +0 -99
- package/dist/scheduled-table-source-NZR1vFc_.js +0 -38
- package/dist/workspace-assets-F3r6XltC.js +0 -107
- package/dist/workspace-concept-panel-D8oEvR0n.js +0 -66
- package/dist/workspace-delete-CQvv1eDE.js +0 -81
- 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 {
|
|
4
|
-
import {
|
|
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-
|
|
9
|
-
import { n as mergeRefs } from "../../merge-refs-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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(
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
})] })
|
|
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:
|
|
596
|
+
label: t5,
|
|
287
597
|
size: "xs",
|
|
288
598
|
variant: "ghost",
|
|
289
|
-
onClick:
|
|
290
|
-
children:
|
|
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(
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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(
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
-
|
|
352
|
-
const
|
|
353
|
-
|
|
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
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
"
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
-
|
|
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?.(
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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 (
|
|
394
|
-
|
|
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
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
-
})
|
|
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(
|
|
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
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
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
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
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
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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:
|
|
515
|
-
tooltip:
|
|
516
|
-
content: label,
|
|
517
|
-
side: "top"
|
|
518
|
-
},
|
|
1393
|
+
className: t12,
|
|
1394
|
+
tooltip: t13,
|
|
519
1395
|
"aria-label": label,
|
|
520
|
-
"aria-hidden":
|
|
1396
|
+
"aria-hidden": t14,
|
|
521
1397
|
"aria-pressed": listening,
|
|
522
|
-
"data-error":
|
|
523
|
-
"data-listening":
|
|
524
|
-
"data-starting":
|
|
525
|
-
disabled:
|
|
526
|
-
tabIndex:
|
|
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:
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
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
|
-
|
|
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
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
-
|
|
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(
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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(
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
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:
|
|
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(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
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(
|
|
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
|
-
|
|
727
|
-
|
|
728
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
738
|
-
|
|
739
|
-
|
|
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 (
|
|
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
|
-
|
|
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(
|
|
768
|
-
const
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
})
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
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
|
|
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
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
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
|
-
|
|
847
|
-
|
|
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(
|
|
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
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
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:
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
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(
|
|
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)
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
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(
|
|
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
|
-
|
|
916
|
-
|
|
917
|
-
|
|
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:
|
|
924
|
-
onMouseEnter:
|
|
925
|
-
onMouseLeave:
|
|
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(
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
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(
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
className
|
|
951
|
-
|
|
952
|
-
|
|
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(
|
|
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
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
1024
|
-
|
|
1025
|
-
|
|
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
|
-
}) })
|
|
1051
|
-
|
|
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: [
|
|
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(
|
|
1098
|
-
const
|
|
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
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
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
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
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
|
-
}
|
|
1154
|
-
})
|
|
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) {
|