@burdenoff/fe-libs 2026.1014.5 → 2026.1015.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/shared/assistant/avatar/avatarPreferences.d.ts +61 -14
  2. package/dist/shared/assistant/avatar/avatarPreferences.js +54 -21
  3. package/dist/shared/assistant/avatar/live/LiveAvatarTabView.d.ts +33 -0
  4. package/dist/shared/assistant/avatar/live/LiveAvatarTabView.js +278 -0
  5. package/dist/shared/assistant/avatar/live/avatarSessionClient.d.ts +5 -0
  6. package/dist/shared/assistant/avatar/live/avatarSessionClient.js +25 -6
  7. package/dist/shared/assistant/avatar/live/avatarVoice.d.ts +43 -0
  8. package/dist/shared/assistant/avatar/live/avatarVoice.js +45 -0
  9. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +21 -1
  10. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +74 -24
  11. package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +47 -8
  12. package/dist/shared/assistant/avatar/live/liveAvatarController.js +244 -161
  13. package/dist/shared/assistant/avatar/live/liveAvatarStatus.d.ts +2 -2
  14. package/dist/shared/assistant/avatar/live/liveAvatarStatus.js +11 -4
  15. package/dist/shared/assistant/avatar/useAvatarCopy.d.ts +50 -21
  16. package/dist/shared/assistant/avatar/useAvatarCopy.js +93 -49
  17. package/dist/shared/assistant/i18nManifest.d.ts +23 -2
  18. package/dist/shared/assistant/i18nManifest.js +23 -2
  19. package/dist/shared/assistant/index.d.ts +6 -0
  20. package/dist/shared/assistant/speech/hostedVoiceCatalogue.d.ts +19 -0
  21. package/dist/shared/assistant/speech/hostedVoiceCatalogue.js +25 -18
  22. package/dist/shared/assistant/ui/AIAssistantPanel.js +134 -101
  23. package/dist/shared/assistant/ui/AssistantAvatarTabs.d.ts +10 -0
  24. package/dist/shared/assistant/ui/AssistantAvatarTabs.js +48 -0
  25. package/dist/shared/assistant/ui/AssistantChatArea.js +1261 -1202
  26. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +137 -5
  27. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +114 -55
  28. package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.d.ts +13 -0
  29. package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.js +70 -0
  30. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +18 -0
  31. package/dist/shared/assistant/ui/composer/AssistantComposer.js +121 -102
  32. package/dist/shared/assistant/ui/panelOverlays.d.ts +24 -3
  33. package/dist/shared/assistant/ui/panelOverlays.js +11 -10
  34. package/dist/shared/assistant/ui/useVoiceSession.d.ts +20 -5
  35. package/dist/shared/assistant/ui/useVoiceSession.js +11 -4
  36. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +8 -2
  37. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +172 -160
  38. package/dist/shared/assistant/ui/voice/voiceStartGate.d.ts +57 -0
  39. package/dist/shared/assistant/ui/voice/voiceStartGate.js +9 -0
  40. package/dist/shared/assistant/voice/voiceReply.d.ts +23 -0
  41. package/dist/shared/assistant/voice/voiceReply.js +13 -0
  42. package/dist/shared/assistant/voice/voiceSession.d.ts +10 -0
  43. package/dist/shared/assistant/voice/voiceSession.js +7 -0
  44. package/dist/shared-assistant.js +260 -254
  45. package/package.json +1 -1
@@ -7,348 +7,360 @@ import { useAssistantProduct as i } from "../product.js";
7
7
  import { useAssistantTr as a } from "../i18n.js";
8
8
  import { useAssistantNavigate as o } from "./AssistantMarkdownRenderer.js";
9
9
  import { isAssistantModeId as s } from "../modeIds.js";
10
- import { AUTO_READ_MODE as c, autoSuggestions as l, classifyAssistantIntent as u, escalationToUndo as d, isAutoRoutingOffered as f, resolveAutoRoute as p } from "../autoRouting.js";
11
- import { getHistoryStamp as m, setHistoryBusyProbe as h } from "../history/stampRegistry.js";
12
- import { beginApprovalInFlight as ee, endApprovalInFlight as te, getApprovalInFlight as g, markLiveTurn as ne, newestModelReplyId as _, resolveApprovablePendingWrite as v, resolveRetryableMessageId as y, subscribeApprovalInFlight as re } from "../liveTurns.js";
13
- import { isWriteModeAcknowledged as ie, writeModeSendRefusalReason as ae } from "../writeModeConsent.js";
14
- import { resolveActiveModeSandbox as oe, useAssistantStore as b } from "../store.js";
15
- import { abortAssistantTurn as se, approvePendingWrite as x, createAssistantSandbox as ce, createAssistantSession as le, extendAssistantSandboxTTL as ue, findExistingSandboxWithStatus as de, getAssistantArtifacts as fe, getAssistantMessages as pe, getAssistantSession as S, mintAssistantTurnStream as me, modeRequiresConfirmWrites as he, promptGatewayRequestBytes as ge, releaseSupersededAssistantSandboxes as _e, sendAssistantPromptAsync as ve, waitForAssistantServiceReady as ye, waitForSandboxRunning as be, writeApprovalModeOf as xe } from "../api.js";
16
- import { sanitize as Se } from "../progress.js";
17
- import { UiOfferSession as Ce, sandboxServesUiOffers as we, uiOfferHintKind as C, uiOfferInTime as Te } from "../uiActions/uiOffers.js";
18
- import { AssistantSendRefusal as Ee, classifyTurnFailure as De, turnConfirmsNoAction as Oe, turnOutcomeCopy as ke } from "../turnOutcome.js";
19
- import { assistantUsageLedger as Ae, hasPendingUsageReports as je, reportUsageWithRetry as Me, retryPendingUsageReports as Ne, usageSendRefusal as Pe } from "../usageReporting.js";
20
- import { withIncompleteTurnNotice as Fe } from "../streamBudget.js";
21
- import { chatTurns as Ie, isVoiceTurn as Le, voiceMarker as w, voiceSessionIdOf as T } from "../voice/turnVisibility.js";
22
- import { speechFeed as Re } from "../speech/speechFeed.js";
23
- import { isTurnSuperseded as ze, markTurnSuperseded as Be } from "../voice/supersededTurns.js";
24
- import { buildContinuedFromVoiceNote as Ve, buildVoiceTranscriptMarkdown as He, voiceTranscriptFilename as Ue } from "../voice/voiceTranscript.js";
25
- import { pollDelayMs as We } from "../voice/assistantPollSchedule.js";
26
- import { toCaptionText as Ge } from "../voice/captionText.js";
27
- import { resolveAssistantLanguage as Ke } from "../voice/languages.js";
28
- import { resolveLanguagePair as qe } from "../voice/languagePair.js";
29
- import { INITIAL_TRANSCRIPT_AUTO_OPEN as Je, isAwaitingOwnConversation as E, maySendSpokenTurn as Ye, planTranscriptAutoOpen as Xe, planVoiceSessionBinding as Ze, planVoiceSessionStart as Qe, planVoiceSpokenEntry as $e, voiceBindingAtStart as et, voiceBindingConversationId as tt } from "../voice/voiceReopen.js";
30
- import { countInlineImageCandidates as nt, countInlinedImageParts as rt, largestInlineCharsPerFile as it, resolveAssistantInlineLimits as at, toMessageAttachment as ot } from "../attachments.js";
31
- import { WRITE_PROPOSAL_VOICE_COPY as st, isVoiceProposalBound as ct, voiceProposalChip as lt, voiceProposalChipText as ut, voiceReadbacksDue as dt, voiceWaitingProposals as ft, writeProposalVoiceLine as pt, writeProposalVoiceReadback as mt } from "../writeProposalVoice.js";
32
- import { createAdminModeAccessGate as ht, resolveAssistantSendModeAfterAccess as gt } from "../adminModeSendGate.js";
33
- import { buildBoundedAttachmentTurn as _t } from "../attachmentTurn.js";
34
- import { attachmentUrlIsStale as vt, refreshStaleAttachmentUrls as yt } from "../attachmentCommit.js";
35
- import { VOICE_COMMIT_BUDGET_MS as bt, settleAndCommitSpokenTurn as xt } from "../voiceCommit.js";
36
- import { getOrganizationId as St, getWorkspaceId as D } from "../context.js";
37
- import { useAttachmentUrlResolver as Ct } from "../useAttachmentCommitter.js";
38
- import { isTurnInFlight as wt, planAbandonedTurn as Tt, planTurnAbort as Et } from "../turnState.js";
39
- import { backDoneCopy as Dt, chooseDestinationCopy as Ot, chooseLinkedCopy as kt, entityNounText as At, linkNotOpenableCopy as jt, navigationCommandCopy as Mt, navigationOutcomeCopy as Nt, offerExpiredCopy as Pt, offerKeptForUnsavedCopy as Ft, offerNotAvailableCopy as It, pickFromListCopy as Lt, recordChoiceCopy as Rt, recordKindsCopy as zt, themeCommandCopy as Bt } from "../localUiCommandCopy.js";
40
- import { appControlCopy as Vt } from "../appControls/copy.js";
41
- import { LANGUAGE_REPLY_DEADLINE_MS as Ht, languageConfirmationCopy as Ut, languageReplyStep as Wt } from "../appControls/languageReply.js";
42
- import { getAssistantDisplayContent as Gt } from "../displayContent.js";
43
- import { NO_FIRST_TEXT as Kt, buildAssistantProgress as qt, readAheadFor as Jt, snapshotReplyFloor as Yt, startSessionReadAhead as Xt, trackFirstText as Zt } from "../turnProgress.js";
44
- import { parseToolActivity as Qt } from "./AssistantToolActivity.js";
45
- import { countSpokenTurns as $t, spokenMessagesSinceContinueNote as en, spokenTurnText as tn } from "../spokenTurns.js";
46
- import { beginTurn as nn, describeTurn as O, detectTurnDevice as rn, markTurn as k, restartAttempt as an, turnClockMs as on } from "../turnTimeline.js";
47
- import { useAssistantSpeech as sn } from "./AssistantSpeechProvider.js";
48
- import { useVoiceSession as cn } from "./useVoiceSession.js";
49
- import { isMultimodalBodyRejection as ln, isRecoverableAssistantError as un } from "../transportErrors.js";
50
- import { createReadinessTracker as dn, planAfterTransportFailure as fn, planTrustedSandboxFailure as pn } from "../sandboxReadiness.js";
51
- import { writeProposalConfirmState as mn } from "./writeProposalPresentation.js";
52
- import { writeProposalUsesDialog as hn } from "./AssistantWriteProposalCard.js";
53
- import { AssistantWriteConfirmDialog as gn } from "./AssistantWriteConfirmDialog.js";
54
- import { useWriteProposalConfirm as _n } from "./useWriteProposalConfirm.js";
55
- import { AssistantWriteProposalSlot as vn } from "./AssistantWriteProposalSlot.js";
56
- import { readWriteProposalRefs as yn, writeProposalsEnabledFor as bn } from "../writeProposalDiscovery.js";
57
- import { planWriteReply as xn, promptWriteApproval as Sn } from "../writeReplySend.js";
58
- import { useWriteProposals as Cn } from "./useWriteProposals.js";
59
- import { AssistantSpokenTurnsNotice as wn } from "./AssistantSpokenTurnsNotice.js";
60
- import { AssistantHistoryArchivedNotice as Tn, AssistantHistoryDeletedNotice as En, AssistantHistoryLoadState as Dn, AssistantHistoryReadOnlyBanner as On, AssistantHistoryShowEarlier as kn } from "./AssistantHistoryNotices.js";
61
- import { VoiceTranscriptDrawer as An } from "./voice/VoiceTranscriptDrawer.js";
62
- import { downloadFile as jn } from "../exportConversation.js";
63
- import { conversationHasHistory as Mn, isOtherScopeHistoryConversation as Nn, isReadOnlyHistoryConversation as Pn, isReusableHistoryDraft as Fn } from "../history/historyList.js";
64
- import { useAssistantHistoryStatus as In } from "../history/historyStatus.js";
65
- import { assistantHistory as Ln } from "../history/historyEngine.js";
66
- import { AssistantEmptyState as Rn } from "./AssistantEmptyState.js";
67
- import { AssistantNothingToDeleteNotice as zn } from "./AssistantDeleteConversationDialog.js";
68
- import { assistantHistoryIsOn as Bn } from "./conversationDelete.js";
69
- import { useConversationDeleteDialog as Vn } from "./conversationDeleteDialog.js";
70
- import { useControlConfirmDialog as Hn } from "./controlConfirmDialog.js";
71
- import { useLeaveConfirmAsking as Un } from "./leaveConfirm.js";
72
- import { startFocusReturnAfterKeep as Wn } from "./leaveConfirmFocus.js";
73
- import { resolveConversationDeleteTarget as Gn } from "../conversationDeleteCommand.js";
74
- import { resumeContextFor as Kn } from "../history/historyResume.js";
75
- import { useHistoryRowControlsFor as qn } from "../history/useHistoryRowControls.js";
76
- import { liveCoverage as Jn } from "../liveDeltas.js";
77
- import { createLiveRender as Yn } from "../liveOverlay.js";
78
- import { AssistantMessageList as Xn } from "./AssistantMessageList.js";
79
- import { AssistantUiOfferLinks as Zn } from "./AssistantUiOfferLink.js";
80
- import { AssistantVoiceSession as Qn } from "./voice/AssistantVoiceSession.js";
81
- import { useAssistantApiAccess as $n } from "../useAssistantApiAccess.js";
82
- import { useConversationTurns as er } from "../useConversationTurns.js";
83
- import { openTurnStream as tr, turnStreamAvailable as nr } from "../turnStream.js";
84
- import { createSnapshotPoller as rr } from "../snapshotPoller.js";
85
- import { sendAssistantTurnTimings as ir, startTurnTimingReporting as ar } from "../turnTimingReporter.js";
86
- import { QuarantineSet as or, WarmCancelled as sr, claimPreopenedSession as cr, consumeWarm as lr, preopenKey as ur, preopenWanted as dr, prewarmTarget as fr, settleWarmBeforeSend as pr, startPreopen as mr, startWarm as hr, warmState as gr } from "../prewarm.js";
87
- import { navEntryIds as _r } from "../uiActions/resolveTarget.js";
88
- import { lookupNamedRecords as vr } from "../uiActions/recordNames.js";
89
- import { isAlreadyThere as yr, matchLocalUiCommand as br, mayBeNavigationFollowUp as xr, navDestinations as Sr, planThemeChange as Cr } from "../localUiCommands.js";
90
- import { offerAssentFor as wr } from "../localeCommands/assent.js";
91
- import { readControlSnapshot as Tr } from "../appControls/snapshot.js";
92
- import { runNavigation as Er } from "../uiActions/navigationOutcome.js";
93
- import { assistantBackStack as Dr, isBackRunnable as Or } from "../uiActions/backStack.js";
94
- import { buildNavigateAction as kr, destinationForPath as Ar, labelForPath as jr, newestAssistantOnSurface as Mr } from "../uiActions/navigateAction.js";
95
- import { buildNavigationContext as Nr, latestReplyOnSurface as Pr, rememberPresentedList as Fr } from "../uiActions/linkContext.js";
96
- import { buildUiCatalogue as Ir, markUiCatalogueSent as Lr, uiCatalogueSent as Rr, uiCatalogueSessionKey as zr } from "../uiActions/uiCatalogue.js";
97
- import { offerYesOnSurface as Br } from "../uiActions/offerYesOnSurface.js";
98
- import { parseNavIntent as Vr } from "../uiActions/navIntent.js";
99
- import { decideActOnResolve as Hr, n4LeaveGuard as Ur } from "../uiActions/actOnResolve.js";
100
- import { planAppControl as Wr } from "../appControls/plan.js";
101
- import { dispatchAssistantQuotaExhausted as Gr, notifyAiCreditsUpdated as Kr } from "../aiCredits.js";
102
- import { useAssistantAttachments as qr } from "../useAssistantAttachments.js";
103
- import { AssistantComposer as Jr } from "./composer/AssistantComposer.js";
104
- import { isProdRuntime as Yr } from "../env.js";
105
- import { AssistantApiCallsConsentDialog as Xr } from "./AssistantApiCallsConsentDialog.js";
106
- import { useVisibleNavItems as Zr } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
107
- import { useCallback as A, useEffect as j, useMemo as Qr, useRef as M, useState as $r, useSyncExternalStore as ei } from "react";
108
- import { jsx as N, jsxs as ti } from "react/jsx-runtime";
10
+ import { AUTO_READ_MODE as c, autoSuggestions as l, classifyAssistantIntent as u, escalationToUndo as d, isAutoRoutingOffered as f, resolveAutoRoute as ee } from "../autoRouting.js";
11
+ import { getHistoryStamp as p, setHistoryBusyProbe as m } from "../history/stampRegistry.js";
12
+ import { beginApprovalInFlight as te, endApprovalInFlight as ne, getApprovalInFlight as h, markLiveTurn as re, newestModelReplyId as ie, resolveApprovablePendingWrite as g, resolveRetryableMessageId as _, subscribeApprovalInFlight as ae } from "../liveTurns.js";
13
+ import { isWriteModeAcknowledged as oe, writeModeSendRefusalReason as se } from "../writeModeConsent.js";
14
+ import { resolveActiveModeSandbox as ce, useAssistantStore as v } from "../store.js";
15
+ import { abortAssistantTurn as le, approvePendingWrite as y, createAssistantSandbox as ue, createAssistantSession as de, extendAssistantSandboxTTL as fe, findExistingSandboxWithStatus as pe, getAssistantArtifacts as me, getAssistantMessages as he, getAssistantSession as b, mintAssistantTurnStream as ge, modeRequiresConfirmWrites as _e, promptGatewayRequestBytes as ve, releaseSupersededAssistantSandboxes as ye, sendAssistantPromptAsync as be, waitForAssistantServiceReady as xe, waitForSandboxRunning as Se, writeApprovalModeOf as Ce } from "../api.js";
16
+ import { sanitize as we } from "../progress.js";
17
+ import { UiOfferSession as Te, sandboxServesUiOffers as Ee, uiOfferHintKind as x, uiOfferInTime as De } from "../uiActions/uiOffers.js";
18
+ import { AssistantSendRefusal as Oe, classifyTurnFailure as ke, turnConfirmsNoAction as Ae, turnOutcomeCopy as je } from "../turnOutcome.js";
19
+ import { assistantUsageLedger as Me, hasPendingUsageReports as Ne, reportUsageWithRetry as Pe, retryPendingUsageReports as Fe, usageSendRefusal as Ie } from "../usageReporting.js";
20
+ import { withIncompleteTurnNotice as Le } from "../streamBudget.js";
21
+ import { chatTurns as Re, isVoiceTurn as ze, voiceMarker as S, voiceSessionIdOf as C } from "../voice/turnVisibility.js";
22
+ import { speechFeed as Be } from "../speech/speechFeed.js";
23
+ import { toVoiceReply as Ve } from "../voice/voiceReply.js";
24
+ import { isTurnSuperseded as He, markTurnSuperseded as Ue } from "../voice/supersededTurns.js";
25
+ import { buildContinuedFromVoiceNote as We, buildVoiceTranscriptMarkdown as Ge, voiceTranscriptFilename as Ke } from "../voice/voiceTranscript.js";
26
+ import { pollDelayMs as qe } from "../voice/assistantPollSchedule.js";
27
+ import { toCaptionText as Je } from "../voice/captionText.js";
28
+ import { resolveAssistantLanguage as Ye } from "../voice/languages.js";
29
+ import { resolveLanguagePair as Xe } from "../voice/languagePair.js";
30
+ import { INITIAL_TRANSCRIPT_AUTO_OPEN as w, isAwaitingOwnConversation as Ze, maySendSpokenTurn as Qe, planTranscriptAutoOpen as $e, planVoiceSessionBinding as et, planVoiceSessionStart as tt, planVoiceSpokenEntry as nt, voiceBindingAtStart as rt, voiceBindingConversationId as it } from "../voice/voiceReopen.js";
31
+ import { countInlineImageCandidates as at, countInlinedImageParts as ot, largestInlineCharsPerFile as st, resolveAssistantInlineLimits as ct, toMessageAttachment as lt } from "../attachments.js";
32
+ import { WRITE_PROPOSAL_VOICE_COPY as ut, isVoiceProposalBound as dt, voiceProposalChip as ft, voiceProposalChipText as pt, voiceReadbacksDue as mt, voiceWaitingProposals as ht, writeProposalVoiceLine as gt, writeProposalVoiceReadback as _t } from "../writeProposalVoice.js";
33
+ import { createAdminModeAccessGate as vt, resolveAssistantSendModeAfterAccess as yt } from "../adminModeSendGate.js";
34
+ import { buildBoundedAttachmentTurn as bt } from "../attachmentTurn.js";
35
+ import { useAvatarCopy as xt } from "../avatar/useAvatarCopy.js";
36
+ import { attachmentUrlIsStale as St, refreshStaleAttachmentUrls as Ct } from "../attachmentCommit.js";
37
+ import { VOICE_COMMIT_BUDGET_MS as wt, settleAndCommitSpokenTurn as Tt } from "../voiceCommit.js";
38
+ import { getOrganizationId as Et, getWorkspaceId as T } from "../context.js";
39
+ import { useAttachmentUrlResolver as Dt } from "../useAttachmentCommitter.js";
40
+ import { isTurnInFlight as Ot, planAbandonedTurn as kt, planTurnAbort as At } from "../turnState.js";
41
+ import { backDoneCopy as jt, chooseDestinationCopy as Mt, chooseLinkedCopy as Nt, entityNounText as Pt, linkNotOpenableCopy as Ft, navigationCommandCopy as It, navigationOutcomeCopy as Lt, offerExpiredCopy as Rt, offerKeptForUnsavedCopy as zt, offerNotAvailableCopy as Bt, pickFromListCopy as Vt, recordChoiceCopy as Ht, recordKindsCopy as Ut, themeCommandCopy as Wt } from "../localUiCommandCopy.js";
42
+ import { appControlCopy as Gt } from "../appControls/copy.js";
43
+ import { LANGUAGE_REPLY_DEADLINE_MS as Kt, languageConfirmationCopy as qt, languageReplyStep as Jt } from "../appControls/languageReply.js";
44
+ import { getAssistantDisplayContent as Yt } from "../displayContent.js";
45
+ import { NO_FIRST_TEXT as Xt, buildAssistantProgress as Zt, readAheadFor as Qt, snapshotReplyFloor as $t, startSessionReadAhead as en, trackFirstText as tn } from "../turnProgress.js";
46
+ import { parseToolActivity as nn } from "./AssistantToolActivity.js";
47
+ import { countSpokenTurns as rn, spokenMessagesSinceContinueNote as an, spokenTurnText as on } from "../spokenTurns.js";
48
+ import { beginTurn as sn, describeTurn as E, detectTurnDevice as cn, markTurn as D, restartAttempt as ln, turnClockMs as un } from "../turnTimeline.js";
49
+ import { useAssistantSpeech as dn } from "./AssistantSpeechProvider.js";
50
+ import { useLiveAvatarTab as fn, useLiveAvatarTabSeam as pn } from "./assistantLiveAvatarSeam.js";
51
+ import { useVoiceSession as mn } from "./useVoiceSession.js";
52
+ import { isMultimodalBodyRejection as hn, isRecoverableAssistantError as gn } from "../transportErrors.js";
53
+ import { createReadinessTracker as _n, planAfterTransportFailure as vn, planTrustedSandboxFailure as yn } from "../sandboxReadiness.js";
54
+ import { writeProposalConfirmState as bn } from "./writeProposalPresentation.js";
55
+ import { writeProposalUsesDialog as xn } from "./AssistantWriteProposalCard.js";
56
+ import { AssistantWriteConfirmDialog as Sn } from "./AssistantWriteConfirmDialog.js";
57
+ import { useWriteProposalConfirm as Cn } from "./useWriteProposalConfirm.js";
58
+ import { AssistantWriteProposalSlot as wn } from "./AssistantWriteProposalSlot.js";
59
+ import { readWriteProposalRefs as Tn, writeProposalsEnabledFor as En } from "../writeProposalDiscovery.js";
60
+ import { planWriteReply as Dn, promptWriteApproval as On } from "../writeReplySend.js";
61
+ import { useWriteProposals as kn } from "./useWriteProposals.js";
62
+ import { AssistantSpokenTurnsNotice as An } from "./AssistantSpokenTurnsNotice.js";
63
+ import { AssistantHistoryArchivedNotice as jn, AssistantHistoryDeletedNotice as Mn, AssistantHistoryLoadState as Nn, AssistantHistoryReadOnlyBanner as Pn, AssistantHistoryShowEarlier as Fn } from "./AssistantHistoryNotices.js";
64
+ import { VoiceTranscriptDrawer as In } from "./voice/VoiceTranscriptDrawer.js";
65
+ import { downloadFile as Ln } from "../exportConversation.js";
66
+ import { conversationHasHistory as Rn, isOtherScopeHistoryConversation as zn, isReadOnlyHistoryConversation as Bn, isReusableHistoryDraft as Vn } from "../history/historyList.js";
67
+ import { useAssistantHistoryStatus as Hn } from "../history/historyStatus.js";
68
+ import { assistantHistory as Un } from "../history/historyEngine.js";
69
+ import { AssistantEmptyState as Wn } from "./AssistantEmptyState.js";
70
+ import { AssistantNothingToDeleteNotice as Gn } from "./AssistantDeleteConversationDialog.js";
71
+ import { assistantHistoryIsOn as Kn } from "./conversationDelete.js";
72
+ import { useConversationDeleteDialog as qn } from "./conversationDeleteDialog.js";
73
+ import { useControlConfirmDialog as Jn } from "./controlConfirmDialog.js";
74
+ import { useLeaveConfirmAsking as Yn } from "./leaveConfirm.js";
75
+ import { startFocusReturnAfterKeep as Xn } from "./leaveConfirmFocus.js";
76
+ import { resolveConversationDeleteTarget as Zn } from "../conversationDeleteCommand.js";
77
+ import { resumeContextFor as Qn } from "../history/historyResume.js";
78
+ import { useHistoryRowControlsFor as $n } from "../history/useHistoryRowControls.js";
79
+ import { liveCoverage as er } from "../liveDeltas.js";
80
+ import { createLiveRender as tr } from "../liveOverlay.js";
81
+ import { AssistantMessageList as nr } from "./AssistantMessageList.js";
82
+ import { AssistantUiOfferLinks as rr } from "./AssistantUiOfferLink.js";
83
+ import { AssistantVoiceSession as ir } from "./voice/AssistantVoiceSession.js";
84
+ import { AssistantAvatarTab as ar } from "./avatar/AssistantAvatarTab.js";
85
+ import { voiceStartBlocker as or, voiceStartBlockerLasts as sr } from "./voice/voiceStartGate.js";
86
+ import { useAssistantApiAccess as cr } from "../useAssistantApiAccess.js";
87
+ import { useConversationTurns as lr } from "../useConversationTurns.js";
88
+ import { openTurnStream as ur, turnStreamAvailable as dr } from "../turnStream.js";
89
+ import { createSnapshotPoller as fr } from "../snapshotPoller.js";
90
+ import { sendAssistantTurnTimings as pr, startTurnTimingReporting as mr } from "../turnTimingReporter.js";
91
+ import { QuarantineSet as hr, WarmCancelled as gr, claimPreopenedSession as _r, consumeWarm as vr, preopenKey as yr, preopenWanted as br, prewarmTarget as xr, settleWarmBeforeSend as Sr, startPreopen as Cr, startWarm as wr, warmState as Tr } from "../prewarm.js";
92
+ import { navEntryIds as Er } from "../uiActions/resolveTarget.js";
93
+ import { lookupNamedRecords as Dr } from "../uiActions/recordNames.js";
94
+ import { isAlreadyThere as Or, matchLocalUiCommand as kr, mayBeNavigationFollowUp as Ar, navDestinations as jr, planThemeChange as Mr } from "../localUiCommands.js";
95
+ import { offerAssentFor as Nr } from "../localeCommands/assent.js";
96
+ import { readControlSnapshot as Pr } from "../appControls/snapshot.js";
97
+ import { runNavigation as Fr } from "../uiActions/navigationOutcome.js";
98
+ import { assistantBackStack as Ir, isBackRunnable as Lr } from "../uiActions/backStack.js";
99
+ import { buildNavigateAction as Rr, destinationForPath as zr, labelForPath as Br, newestAssistantOnSurface as Vr } from "../uiActions/navigateAction.js";
100
+ import { buildNavigationContext as Hr, latestReplyOnSurface as Ur, rememberPresentedList as Wr } from "../uiActions/linkContext.js";
101
+ import { buildUiCatalogue as Gr, markUiCatalogueSent as Kr, uiCatalogueSent as qr, uiCatalogueSessionKey as Jr } from "../uiActions/uiCatalogue.js";
102
+ import { offerYesOnSurface as Yr } from "../uiActions/offerYesOnSurface.js";
103
+ import { parseNavIntent as Xr } from "../uiActions/navIntent.js";
104
+ import { decideActOnResolve as Zr, n4LeaveGuard as Qr } from "../uiActions/actOnResolve.js";
105
+ import { planAppControl as $r } from "../appControls/plan.js";
106
+ import { dispatchAssistantQuotaExhausted as ei, notifyAiCreditsUpdated as ti } from "../aiCredits.js";
107
+ import { useAssistantAttachments as ni } from "../useAssistantAttachments.js";
108
+ import { AssistantComposer as ri } from "./composer/AssistantComposer.js";
109
+ import { isProdRuntime as ii } from "../env.js";
110
+ import { AssistantApiCallsConsentDialog as ai } from "./AssistantApiCallsConsentDialog.js";
111
+ import { useVisibleNavItems as oi } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
112
+ import { useCallback as O, useEffect as k, useLayoutEffect as si, useMemo as A, useRef as j, useState as M, useSyncExternalStore as ci } from "react";
113
+ import { jsx as N, jsxs as li } from "react/jsx-runtime";
109
114
  //#region src/shared/assistant/ui/AssistantChatArea.tsx
110
- var ni = 2500, ri = 600, ii = 2e4, ai = 1e4, oi = 1e4, si = 6e3;
115
+ var ui = 2500, di = 600, fi = 2e4, pi = 1e4, mi = 1e4, hi = {
116
+ committing: !1,
117
+ dictating: !1
118
+ }, gi = 6e3;
111
119
  function P() {
112
120
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
113
121
  }
114
- var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
115
- let F = a(), { product: I, modes: L, gatherPageContext: ui, buildPrompt: di, reportTurnTimings: fi, reportTokenUsage: pi, localUiCommands: mi } = i(), R = xe(i().writeApproval), hi = A((e, t) => {
116
- let n = b.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
117
- return ct({
122
+ var _i = ({ visible: _i = !0, writeAccess: vi = "unknown" }) => {
123
+ let F = a(), { product: I, modes: L, gatherPageContext: yi, buildPrompt: bi, reportTurnTimings: xi, reportTokenUsage: Si, localUiCommands: Ci } = i(), R = Ce(i().writeApproval), wi = O((e, t) => {
124
+ let n = v.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
125
+ return dt({
118
126
  mode: e,
119
127
  productWriteApproval: R,
120
128
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
121
129
  });
122
- }, [R]), { getAccessToken: z, getWorkspaceToken: gi, userId: B } = n(), { locale: V, isLocaleLoading: _i } = t(), vi = b((e) => e.voiceGraceMs), yi = b((e) => e.handsFreeInterrupt), bi = b((e) => e.handsFreeStreamNoticeAccepted), xi = b((e) => e.acceptHandsFreeStreamNotice), Si = b((e) => e.assistantLanguage), Ci = b((e) => e.replyLanguage), wi = Qr(() => qe(Si, Ci, V), [
123
- Si,
124
- Ci,
130
+ }, [R]), { getAccessToken: z, getWorkspaceToken: Ti, userId: B } = n(), { locale: V, isLocaleLoading: Ei } = t(), Di = v((e) => e.voiceGraceMs), Oi = v((e) => e.handsFreeInterrupt), ki = v((e) => e.handsFreeStreamNoticeAccepted), Ai = v((e) => e.acceptHandsFreeStreamNotice), ji = v((e) => e.assistantLanguage), Mi = v((e) => e.replyLanguage), Ni = A(() => Xe(ji, Mi, V), [
131
+ ji,
132
+ Mi,
125
133
  V
126
- ]), Ti = wi.reply.english, Ei = wi.replyIsExplicit, Di = wi.reply.code, { conversations: Oi, activeConversationId: H, mode: U, processingByConversationId: ki, setMode: Ai, setConversationMode: ji, setActiveConversation: Mi, createConversation: Ni, addMessage: W, updateMessage: Pi, patchMessage: Fi, mergeMessageMetadata: Ii, setConversationProcessing: Li, clearConversationProcessing: Ri, setBackendSessionId: zi, clearBackendSessionId: Bi, setSandbox: Vi, clearSandbox: Hi, acknowledgedWriteModes: Ui, acknowledgeWriteMode: Wi, autoRouting: Gi, setAutoRouting: Ki, routeConversation: qi } = b(), Ji = Oi.find((e) => e.id === H), Yi = er(Ji), Xi = Yi.all, Zi = H ? ki[H] : void 0, Qi = wt(Zi?.status), $i = Qi ? Zi?.messageId ?? null : null, ea = Zi?.status === "error" ? Zi.messageId : null, ta = b((e) => e.sandboxWriteCapabilities), { panel: G, entries: na, retiredSandboxes: ra } = Cn({
134
+ ]), Pi = Ni.reply.english, Fi = Ni.replyIsExplicit, Ii = Ni.reply.code, { conversations: Li, activeConversationId: H, mode: U, processingByConversationId: Ri, setMode: zi, setConversationMode: Bi, setActiveConversation: Vi, createConversation: Hi, addMessage: W, updateMessage: Ui, patchMessage: Wi, mergeMessageMetadata: Gi, setConversationProcessing: Ki, clearConversationProcessing: qi, setBackendSessionId: Ji, clearBackendSessionId: Yi, setSandbox: Xi, clearSandbox: Zi, acknowledgedWriteModes: Qi, acknowledgeWriteMode: $i, autoRouting: ea, setAutoRouting: ta, routeConversation: na } = v(), ra = Li.find((e) => e.id === H), ia = lr(ra), aa = ia.all, oa = H ? Ri[H] : void 0, sa = Ot(oa?.status), ca = sa ? oa?.messageId ?? null : null, la = oa?.status === "error" ? oa.messageId : null, ua = v((e) => e.sandboxWriteCapabilities), { panel: G, entries: da, retiredSandboxes: fa } = kn({
127
135
  tr: F,
128
136
  productWriteApproval: R
129
- }), ia = _n({
137
+ }), pa = Cn({
130
138
  approve: (e, t) => G.approve(e, t),
131
139
  decline: (e, t, n) => G.decline(e, t, n),
132
140
  presented: (e, t) => G.presented(e, t)
133
- }), aa = ia.dismiss, oa = M(null);
134
- j(() => {
135
- aa();
136
- let e = oa.current;
137
- oa.current = H, e && e !== H && G.withdraw(e, "conversation_closed"), H && G.openConversation(H);
141
+ }), ma = pa.dismiss, ha = j(null);
142
+ k(() => {
143
+ ma();
144
+ let e = ha.current;
145
+ ha.current = H, e && e !== H && G.withdraw(e, "conversation_closed"), H && G.openConversation(H);
138
146
  }, [
139
147
  H,
140
148
  G,
141
- aa
149
+ ma
142
150
  ]);
143
- let sa = Pn(Ji), ca = qn(Ji)?.archivedAt != null, la = In((e) => H !== null && H in e.loadingIds), ua = In((e) => H !== null && H in e.loadErrorIds), da = In((e) => e.remoteDelete), [fa, pa] = $r(() => In.getState().remoteDelete?.at ?? null), ma = da?.wasActive === !0 && da.at !== fa ? da.at : null;
144
- j(() => {
145
- if (ma === null) return;
146
- let e = window.setTimeout(() => pa(ma), oi);
151
+ let ga = Bn(ra), _a = $n(ra)?.archivedAt != null, va = Hn((e) => H !== null && H in e.loadingIds), ya = Hn((e) => H !== null && H in e.loadErrorIds), ba = Hn((e) => e.remoteDelete), [xa, Sa] = M(() => Hn.getState().remoteDelete?.at ?? null), Ca = ba?.wasActive === !0 && ba.at !== xa ? ba.at : null;
152
+ k(() => {
153
+ if (Ca === null) return;
154
+ let e = window.setTimeout(() => Sa(Ca), mi);
147
155
  return () => window.clearTimeout(e);
148
- }, [ma]);
149
- let { canUseApiCalls: ha, loading: ga } = $n(D(), B), _a = M(ht({
150
- loading: ga,
151
- canUseAdminModes: ha
152
- })).current, va = M(L);
153
- j(() => {
154
- va.current = L;
156
+ }, [Ca]);
157
+ let { canUseApiCalls: wa, loading: Ta } = cr(T(), B), Ea = j(vt({
158
+ loading: Ta,
159
+ canUseAdminModes: wa
160
+ })).current, Da = j(L);
161
+ k(() => {
162
+ Da.current = L;
155
163
  }, [L]);
156
- let ya = () => {
157
- let e = b.getState().activeConversationId;
158
- e && Ln.openConversation(e, { modes: va.current });
159
- }, ba = () => {
160
- let e = b.getState().activeConversationId;
161
- e && Ln.loadEarlier(e);
162
- }, xa = M(z);
163
- j(() => {
164
- xa.current = z;
164
+ let Oa = () => {
165
+ let e = v.getState().activeConversationId;
166
+ e && Un.openConversation(e, { modes: Da.current });
167
+ }, ka = () => {
168
+ let e = v.getState().activeConversationId;
169
+ e && Un.loadEarlier(e);
170
+ }, Aa = j(z);
171
+ k(() => {
172
+ Aa.current = z;
165
173
  }, [z]);
166
- let Sa = !!I && fi !== !1;
167
- j(() => {
168
- if (Sa) return ar({ send: (e) => ir(e, {
169
- workspaceId: D(),
174
+ let ja = !!I && xi !== !1;
175
+ k(() => {
176
+ if (ja) return mr({ send: (e) => pr(e, {
177
+ workspaceId: T(),
170
178
  authContext: {
171
- accessToken: xa.current(),
172
- organizationId: St()
179
+ accessToken: Aa.current(),
180
+ organizationId: Et()
173
181
  }
174
182
  }) });
175
- }, [Sa]), j(() => {
176
- _a.update({
177
- loading: ga,
178
- canUseAdminModes: ha
183
+ }, [ja]), k(() => {
184
+ Ea.update({
185
+ loading: Ta,
186
+ canUseAdminModes: wa
179
187
  });
180
188
  }, [
181
- _a,
182
- ga,
183
- ha
184
- ]), j(() => () => {
185
- _a.abandon();
186
- }, [_a]);
187
- let Ca = Qr(() => L.filter((e) => !e.requiresAdmin || ha), [L, ha]), wa = f(Ca), Ta = Gi && wa, Ea = M(wa);
188
- j(() => {
189
- Ea.current = wa;
190
- }, [wa]);
191
- let Da = M(null), Oa = M(!1), ka = it(L), [Aa, ja] = $r(null), [Ma, Na] = $r(null), Pa = Ma !== null && Ma === H, Fa = A((e) => {
192
- Na(e ? b.getState().activeConversationId : null);
189
+ Ea,
190
+ Ta,
191
+ wa
192
+ ]), k(() => () => {
193
+ Ea.abandon();
194
+ }, [Ea]);
195
+ let Ma = A(() => L.filter((e) => !e.requiresAdmin || wa), [L, wa]), Na = f(Ma), Pa = ea && Na, Fa = j(Na);
196
+ k(() => {
197
+ Fa.current = Na;
198
+ }, [Na]);
199
+ let Ia = j(null), La = j(!1), Ra = st(L), [za, Ba] = M(null), [Va, Ha] = M(null), Ua = Va !== null && Va === H, Wa = fn(), Ga = pn(), Ka = Wa.open && Ga !== null, qa = Wa.close, Ja = j(Ka);
200
+ si(() => {
201
+ Ja.current = Ka;
202
+ }, [Ka]);
203
+ let Ya = O((e) => {
204
+ e && Ja.current || Ha(e ? v.getState().activeConversationId : null);
193
205
  }, []);
194
- j(() => {
195
- Na((e) => e !== null && e !== H ? null : e);
206
+ k(() => {
207
+ Ha((e) => e !== null && e !== H ? null : e);
196
208
  }, [H]);
197
- let Ia = M(void 0), [La, Ra] = $r(!1), za = A((e) => {
198
- Ia.current = e, Ra(E(e));
199
- }, []), Ba = A(() => {
200
- let e = b.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
209
+ let Xa = j(void 0), [Za, Qa] = M(!1), $a = O((e) => {
210
+ Xa.current = e, Qa(Ze(e));
211
+ }, []), eo = O(() => {
212
+ let e = v.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
201
213
  return !t || !n ? null : {
202
214
  id: t,
203
- reusableDraft: Fn(n, m()),
215
+ reusableDraft: Vn(n, p()),
204
216
  liveProposals: G.liveFor(t).count,
205
- turnInFlight: wt(e.processingByConversationId[t]?.status)
217
+ turnInFlight: Ot(e.processingByConversationId[t]?.status)
206
218
  };
207
- }, [G]), Va = M({}), K = M(dn()), q = M(new or()), Ha = M(/* @__PURE__ */ new Set()), Ua = Qr(() => L.find((e) => e.id === U), [L, U]), Wa = b((e) => {
219
+ }, [G]), to = j({}), K = j(_n()), q = j(new hr()), no = j(/* @__PURE__ */ new Set()), ro = A(() => L.find((e) => e.id === U), [L, U]), io = v((e) => {
208
220
  let t = e.sandboxesByMode[U]?.sandboxId;
209
221
  return t ? e.sandboxWriteCapabilities[t] : void 0;
210
- }), Ga = Ua !== void 0 && ct({
222
+ }), ao = ro !== void 0 && dt({
211
223
  mode: U,
212
224
  productWriteApproval: R,
213
- capabilities: Wa
214
- }), Ka = U === "assistant" || Ua !== void 0 && !Ua.writeCapable && !he(U) || Ga;
215
- j(() => {
216
- if (U !== "assistant" && Ua?.writeCapable && !ie(Ui, U)) {
217
- Ai("assistant");
225
+ capabilities: io
226
+ }), oo = U === "assistant" || ro !== void 0 && !ro.writeCapable && !_e(U) || ao;
227
+ k(() => {
228
+ if (U !== "assistant" && ro?.writeCapable && !oe(Qi, U)) {
229
+ zi("assistant");
218
230
  return;
219
231
  }
220
- ga || (!Ua || Ua.requiresAdmin && !ha) && U !== "assistant" && Ai("assistant");
232
+ Ta || (!ro || ro.requiresAdmin && !wa) && U !== "assistant" && zi("assistant");
221
233
  }, [
222
234
  U,
223
- Ua,
224
- ha,
225
- ga,
226
- Ai,
227
- Ui
235
+ ro,
236
+ wa,
237
+ Ta,
238
+ zi,
239
+ Qi
228
240
  ]);
229
- let qa = A((e, t, n, r) => {
230
- Li(e, n, t, null, r);
231
- }, [Li]), Ja = A(async (e, t, n, r, i, a = null) => {
241
+ let so = O((e, t, n, r) => {
242
+ Ki(e, n, t, null, r);
243
+ }, [Ki]), co = O(async (e, t, n, r, i, a = null) => {
232
244
  let o = (e, t) => {
233
- r && qa(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
245
+ r && so(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
234
246
  }, c = (e) => {
235
- r && k(r.assistantMessageId, e);
247
+ r && D(r.assistantMessageId, e);
236
248
  }, l = () => {
237
249
  c("bootAdopted"), a?.beginBoot();
238
- }, u = () => a !== null && (a.signal.aborted || D() !== t), d = () => {
239
- if (u()) throw new sr("cancelled");
240
- }, f = b.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, m = !1, h = !1, ee = !1, te = !1, g = async (r) => {
241
- if (i && !q.current.has(r) && K.current.isFresh(r)) return p = !0, !0;
242
- h = !0;
250
+ }, u = () => a !== null && (a.signal.aborted || T() !== t), d = () => {
251
+ if (u()) throw new gr("cancelled");
252
+ }, f = v.getState().sandboxesByMode[e]?.sandboxId ?? null, ee = !1, p = !1, m = !1, te = !1, ne = !1, h = async (r) => {
253
+ if (i && !q.current.has(r) && K.current.isFresh(r)) return ee = !0, !0;
254
+ m = !0;
243
255
  let o = !1;
244
256
  try {
245
- await be(r, t, n, 3e5), await ye(r, t, e, n, 9e4, () => {
257
+ await Se(r, t, n, 3e5), await xe(r, t, e, n, 9e4, () => {
246
258
  o = !0, l();
247
259
  });
248
260
  } catch {
249
- if (u()) throw new sr("cancelled");
250
- return K.current.invalidate(r), q.current.add(r), a?.dead.push(r), te = !0, !1;
261
+ if (u()) throw new gr("cancelled");
262
+ return K.current.invalidate(r), q.current.add(r), a?.dead.push(r), ne = !0, !1;
251
263
  }
252
- return d(), K.current.markVerified(r), o && (ee = !0), !0;
264
+ return d(), K.current.markVerified(r), o && (te = !0), !0;
253
265
  };
254
- if (f && (Vi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await g(f) || (Vi(e, null, "provisioning"), f = null)), !f) {
266
+ if (f && (Xi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await h(f) || (Xi(e, null, "provisioning"), f = null)), !f) {
255
267
  o("provisioning", "lookingForEnvironment");
256
- let r = await de(t, I, e, Yr(), n, q.current, R);
268
+ let r = await pe(t, I, e, ii(), n, q.current, R);
257
269
  d();
258
270
  let i = r?.id ?? null;
259
271
  if (i) {
260
- Vi(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
272
+ Xi(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
261
273
  let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
262
- t && l(), await g(i) ? (f = i, t && (ee = !0)) : Vi(e, null, "provisioning");
274
+ t && l(), await h(i) ? (f = i, t && (te = !0)) : Xi(e, null, "provisioning");
263
275
  }
264
276
  }
265
277
  if (!f) {
266
- if (a && !a.mayCreate) throw new sr("no-create");
278
+ if (a && !a.mayCreate) throw new gr("no-create");
267
279
  if (c("provisionStarted"), e === "api-calls" && !z()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
268
- o("provisioning", "startingEnvironment"), Vi(e, null, "provisioning");
269
- let r = a ? [] : await _e(t, I, e, Yr(), n, q.current, R);
280
+ o("provisioning", "startingEnvironment"), Xi(e, null, "provisioning");
281
+ let r = a ? [] : await ye(t, I, e, ii(), n, q.current, R);
270
282
  if (r.length > 0) {
271
283
  let e = new Set(r);
272
284
  for (let e of r) K.current.invalidate(e), q.current.add(e);
273
- let t = b.getState().sandboxesByMode;
274
- for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) && Hi(n);
285
+ let t = v.getState().sandboxesByMode;
286
+ for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) && Zi(n);
275
287
  }
276
288
  c("createRequested");
277
289
  let i = a?.beginCreate();
278
290
  try {
279
- f = await ce(I, e, t, Yr(), ri, n, { writeApproval: R });
291
+ f = await ue(I, e, t, ii(), di, n, { writeApproval: R });
280
292
  } finally {
281
293
  i?.();
282
294
  }
283
- m = !0, d(), Vi(e, f, "provisioning"), await be(f, t, n, 3e5), d(), c("sandboxRunning"), await ye(f, t, e, n, 9e4), d(), c("serviceReady"), K.current.markVerified(f);
295
+ p = !0, d(), Xi(e, f, "provisioning"), await Se(f, t, n, 3e5), d(), c("sandboxRunning"), await xe(f, t, e, n, 9e4), d(), c("serviceReady"), K.current.markVerified(f);
284
296
  }
285
- return Vi(e, f, "running"), {
297
+ return Xi(e, f, "running"), {
286
298
  sandboxId: f,
287
- sandboxIsNew: m,
288
- sandboxProbed: h,
289
- sandboxAdopted: ee,
290
- deadSandboxProbe: te,
291
- trustedFromCache: p
299
+ sandboxIsNew: p,
300
+ sandboxProbed: m,
301
+ sandboxAdopted: te,
302
+ deadSandboxProbe: ne,
303
+ trustedFromCache: ee
292
304
  };
293
305
  }, [
294
- Hi,
306
+ Zi,
295
307
  z,
296
308
  I,
297
309
  R,
298
- Vi,
299
- qa
300
- ]), Ya = A(async function e(t, n, r, i, a, o = {}) {
301
- let s = await pr(i, r, (e) => qa(t, n, "provisioning", e), () => k(n, "prewarmJoined"));
310
+ Xi,
311
+ so
312
+ ]), lo = O(async function e(t, n, r, i, a, o = {}) {
313
+ let s = await Sr(i, r, (e) => so(t, n, "provisioning", e), () => D(n, "prewarmJoined"));
302
314
  for (let e of s.dead) K.current.invalidate(e), q.current.add(e);
303
- s.verified && !q.current.has(s.verified) && K.current.markVerified(s.verified), s.joined && O(n, { prewarm: s.joined });
304
- let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Ja(r, i, a, {
315
+ s.verified && !q.current.has(s.verified) && K.current.markVerified(s.verified), s.joined && E(n, { prewarm: s.joined });
316
+ let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: ee } = await co(r, i, a, {
305
317
  conversationId: t,
306
318
  assistantMessageId: n
307
- }, o.trustCache !== !1), m = lr(i, r, c);
308
- !s.waited && m && O(n, { prewarm: "hit" });
309
- let h = b.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, ee = !1, te = null;
310
- if (h) {
311
- let e = Xt(c, h, (e, t) => pe(e, i, t, r, a, { limit: 50 }));
319
+ }, o.trustCache !== !1), p = vr(i, r, c);
320
+ !s.waited && p && E(n, { prewarm: "hit" });
321
+ let m = v.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, te = !1, ne = null;
322
+ if (m) {
323
+ let e = en(c, m, (e, t) => he(e, i, t, r, a, { limit: 50 }));
312
324
  try {
313
- let t = await S(c, i, h, r, a);
325
+ let t = await b(c, i, m, r, a);
314
326
  if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
315
- te = e;
327
+ ne = e;
316
328
  } catch {
317
- Bi(t), h = null;
329
+ Yi(t), m = null;
318
330
  }
319
331
  }
320
- let g = !1;
321
- if (!h) {
322
- let e = cr(ur({
332
+ let h = !1;
333
+ if (!m) {
334
+ let e = _r(yr({
323
335
  workspaceId: i,
324
336
  mode: r,
325
337
  sandboxId: c,
326
338
  userId: B
327
339
  }), Date.now());
328
340
  if (e) {
329
- "pending" in e && qa(t, n, "connecting", "preparingSession");
341
+ "pending" in e && so(t, n, "connecting", "preparingSession");
330
342
  let o = "sessionId" in e ? e.sessionId : await e.pending;
331
343
  if (o && !q.current.has(c)) try {
332
- (await S(c, i, o, r, a)).mode === r && (h = o, g = !0, zi(t, h), ee = !0);
344
+ (await b(c, i, o, r, a)).mode === r && (m = o, h = !0, Ji(t, m), te = !0);
333
345
  } catch {}
334
346
  }
335
347
  }
336
- if (!h) {
337
- qa(t, n, "connecting", "preparingSession");
348
+ if (!m) {
349
+ so(t, n, "connecting", "preparingSession");
338
350
  let s;
339
351
  try {
340
- s = await le(c, i, r, a);
352
+ s = await de(c, i, r, a);
341
353
  } catch (s) {
342
- if (p) {
354
+ if (ee) {
343
355
  K.current.invalidate(c);
344
- let l = pn(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
345
- if (l === "check-network" && (l = await fn(() => de(i, I, r, Yr(), a, q.current, R))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
346
- p || O(n, { cacheProofFailed: !0 }), l === "replace" && (q.current.add(c), Bi(t), Hi(r), G.retireSandbox(c));
356
+ let l = yn(s, o.isAbandoned?.() ?? !1), ee = l === "check-network";
357
+ if (l === "check-network" && (l = await vn(() => pe(i, I, r, ii(), a, q.current, R))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
358
+ ee || E(n, { cacheProofFailed: !0 }), l === "replace" && (q.current.add(c), Yi(t), Zi(r), G.retireSandbox(c));
347
359
  let s = await e(t, n, r, i, a, {
348
360
  ...o,
349
361
  trustCache: !1
350
362
  });
351
- return p && (s.deadSandboxProbe || s.sandboxId !== c) && O(n, { cacheProofFailed: !0 }), {
363
+ return ee && (s.deadSandboxProbe || s.sandboxId !== c) && E(n, { cacheProofFailed: !0 }), {
352
364
  ...s,
353
365
  sandboxProbed: s.sandboxProbed || u,
354
366
  sandboxAdopted: s.sandboxAdopted || d,
@@ -358,81 +370,81 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
358
370
  }
359
371
  throw s;
360
372
  }
361
- h = s.sessionId, zi(t, h), ee = !0;
373
+ m = s.sessionId, Ji(t, m), te = !0;
362
374
  }
363
375
  return {
364
376
  sandboxId: c,
365
- sessionId: h,
366
- sessionIsNew: ee,
367
- readAhead: te,
377
+ sessionId: m,
378
+ sessionIsNew: te,
379
+ readAhead: ne,
368
380
  sandboxIsNew: l,
369
381
  sandboxProbed: u,
370
382
  sandboxAdopted: d,
371
383
  deadSandboxProbe: f,
372
- sessionPreopened: g
384
+ sessionPreopened: h
373
385
  };
374
386
  }, [
375
- Ja,
376
- Bi,
377
- Hi,
387
+ co,
388
+ Yi,
389
+ Zi,
378
390
  I,
379
391
  R,
380
- zi,
381
- qa,
392
+ Ji,
393
+ so,
382
394
  B,
383
395
  G
384
- ]), Xa = A((e, t = !1) => {
385
- let n = D();
396
+ ]), uo = O((e, t = !1) => {
397
+ let n = T();
386
398
  if (!n) return;
387
- let r = b.getState(), i = Date.now(), a = fr({
399
+ let r = v.getState(), i = Date.now(), a = xr({
388
400
  autoRouting: r.autoRouting,
389
- autoOffered: Ea.current,
401
+ autoOffered: Fa.current,
390
402
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
391
403
  selectedMode: r.mode,
392
404
  autoReadMode: c,
393
- modes: va.current,
405
+ modes: Da.current,
394
406
  acknowledgedWriteModes: r.acknowledgedWriteModes,
395
- adminAccess: _a.read(),
407
+ adminAccess: Ea.read(),
396
408
  dictated: e,
397
- voiceProposalBound: (e) => hi(e),
398
- turnInFlight: Object.values(r.processingByConversationId).some((e) => wt(e?.status)),
399
- ...gr(n),
409
+ voiceProposalBound: (e) => wi(e),
410
+ turnInFlight: Object.values(r.processingByConversationId).some((e) => Ot(e?.status)),
411
+ ...Tr(n),
400
412
  now: i
401
413
  });
402
414
  if (!a) return;
403
- let o = hr(n, a, i), s = {
415
+ let o = wr(n, a, i), s = {
404
416
  accessToken: z(),
405
- workspaceToken: gi(),
417
+ workspaceToken: Ti(),
406
418
  userId: B,
407
- organizationId: St()
419
+ organizationId: Et()
408
420
  };
409
- Ja(a.mode, n, s, null, !0, o).then((e) => {
421
+ co(a.mode, n, s, null, !0, o).then((e) => {
410
422
  if (o.finish({
411
423
  ok: !0,
412
424
  sandboxId: e.sandboxId,
413
425
  didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
414
426
  booted: e.sandboxIsNew || e.sandboxAdopted,
415
427
  dead: o.dead
416
- }), o.signal.aborted || D() !== n || q.current.has(e.sandboxId)) return;
417
- let r = b.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = m();
418
- dr({
428
+ }), o.signal.aborted || T() !== n || q.current.has(e.sandboxId)) return;
429
+ let r = v.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = p();
430
+ br({
419
431
  active: i ? {
420
432
  mode: i.mode,
421
433
  backendSessionId: i.backendSessionId,
422
- continuable: !Pn(i) && !Nn(i, c),
423
- hasHistory: Mn(i)
434
+ continuable: !Bn(i) && !zn(i, c),
435
+ hasHistory: Rn(i)
424
436
  } : void 0,
425
437
  mode: a.mode
426
- }) && mr(ur({
438
+ }) && Cr(yr({
427
439
  workspaceId: n,
428
440
  mode: a.mode,
429
441
  sandboxId: e.sandboxId,
430
442
  userId: B
431
- }), () => le(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
443
+ }), () => de(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
432
444
  }, (e) => {
433
- if (!(e instanceof sr) && !o.signal.aborted && D() === n) {
434
- let e = b.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
435
- e && (K.current.invalidate(e), q.current.add(e), o.dead.push(e), Hi(a.mode));
445
+ if (!(e instanceof gr) && !o.signal.aborted && T() === n) {
446
+ let e = v.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
447
+ e && (K.current.invalidate(e), q.current.add(e), o.dead.push(e), Zi(a.mode));
436
448
  }
437
449
  o.finish({
438
450
  ok: !1,
@@ -442,66 +454,66 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
442
454
  });
443
455
  });
444
456
  }, [
445
- Ja,
446
- _a,
447
- Hi,
457
+ co,
458
+ Ea,
459
+ Zi,
448
460
  z,
449
- gi,
461
+ Ti,
450
462
  B,
451
- hi
452
- ]), Za = A(() => Xa(!1), [Xa]), Qa = ei(re, g, g)?.reference ?? null, [$a, eo] = $r(0), to = M(/* @__PURE__ */ new Set()), no = M(null), ro = A(() => {
453
- let e = b.getState(), t = e.activeConversationId;
463
+ wi
464
+ ]), fo = O(() => uo(!1), [uo]), po = ci(ae, h, h)?.reference ?? null, [mo, ho] = M(0), go = j(/* @__PURE__ */ new Set()), _o = j(null), vo = O(() => {
465
+ let e = v.getState(), t = e.activeConversationId;
454
466
  if (!t) return null;
455
- let n = e.processingByConversationId[t], r = wt(n?.status) ? n?.messageId ?? null : null;
456
- if (!Et({
467
+ let n = e.processingByConversationId[t], r = Ot(n?.status) ? n?.messageId ?? null : null;
468
+ if (!At({
457
469
  interruptedTurnId: r,
458
470
  activeTurnId: r,
459
- alreadyRequested: r ? to.current.has(r) : !1
471
+ alreadyRequested: r ? go.current.has(r) : !1
460
472
  }).send || !r) return null;
461
- to.current.add(r);
462
- let i = oe(e), a = D(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
463
- return !i || !a || !o || se(i.sandboxId, a, o, i.mode, {
473
+ go.current.add(r);
474
+ let i = ce(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
475
+ return !i || !a || !o || le(i.sandboxId, a, o, i.mode, {
464
476
  accessToken: z(),
465
- workspaceToken: gi(),
477
+ workspaceToken: Ti(),
466
478
  userId: B,
467
- organizationId: St()
479
+ organizationId: Et()
468
480
  }), r;
469
481
  }, [
470
482
  B,
471
483
  z,
472
- gi
473
- ]), io = A(() => {
474
- let e = ro();
475
- return e && (Be(e), Re.abort(e)), e;
476
- }, [ro]), ao = A(() => {
477
- let e = b.getState().activeConversationId;
478
- io(), e && G.declineForReply(e, "corrected", "spoken");
479
- }, [io, G]), oo = A(async (e) => {
480
- let t = b.getState(), n = oe(t), r = D(), i = t.activeConversationId;
481
- if (!n || !r || !i || bn(t.sandboxWriteCapabilities[n.sandboxId])) return;
482
- let a = t.conversations.find((e) => e.id === i), o = a ? v(Ie(a.messages), {
484
+ Ti
485
+ ]), yo = O(() => {
486
+ let e = vo();
487
+ return e && (Ue(e), Be.abort(e)), e;
488
+ }, [vo]), bo = O(() => {
489
+ let e = v.getState().activeConversationId;
490
+ yo(), e && G.declineForReply(e, "corrected", "spoken");
491
+ }, [yo, G]), xo = O(async (e) => {
492
+ let t = v.getState(), n = ce(t), r = T(), i = t.activeConversationId;
493
+ if (!n || !r || !i || En(t.sandboxWriteCapabilities[n.sandboxId])) return;
494
+ let a = t.conversations.find((e) => e.id === i), o = a ? g(Re(a.messages), {
483
495
  sessionId: a.backendSessionId,
484
496
  sandboxId: n.sandboxId,
485
497
  nowMs: Date.now()
486
498
  }) : null;
487
499
  if (o?.reference !== e) {
488
- eo((e) => e + 1);
500
+ ho((e) => e + 1);
489
501
  return;
490
502
  }
491
503
  let s = {
492
504
  conversationId: i,
493
505
  reference: e
494
506
  };
495
- if (!ee(s)) return;
507
+ if (!te(s)) return;
496
508
  try {
497
- await x(n.sandboxId, r, e, n.mode, {
509
+ await y(n.sandboxId, r, e, n.mode, {
498
510
  accessToken: z(),
499
- workspaceToken: gi(),
511
+ workspaceToken: Ti(),
500
512
  userId: B,
501
- organizationId: St()
513
+ organizationId: Et()
502
514
  });
503
515
  } catch (e) {
504
- te(s), W(i, {
516
+ ne(s), W(i, {
505
517
  id: P(),
506
518
  role: "system",
507
519
  content: e instanceof Error ? e.message : "The change could not be approved.",
@@ -509,62 +521,62 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
509
521
  });
510
522
  return;
511
523
  }
512
- te(s), Ii(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
513
- let c = b.getState(), l = c.conversations.find((e) => e.id === i);
514
- c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || oe(c)?.sandboxId !== n.sandboxId || wt(c.processingByConversationId[i]?.status) || _(Ie(l.messages)) !== o.messageId || ns.current(F("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
524
+ ne(s), Gi(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
525
+ let c = v.getState(), l = c.conversations.find((e) => e.id === i);
526
+ c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || ce(c)?.sandboxId !== n.sandboxId || Ot(c.processingByConversationId[i]?.status) || ie(Re(l.messages)) !== o.messageId || gs.current(F("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
515
527
  approvalFollowUp: { approvedReplyId: o.messageId },
516
528
  targetConversationId: i
517
529
  });
518
530
  }, [
519
531
  B,
520
532
  W,
521
- Ii,
533
+ Gi,
522
534
  F
523
- ]), so = e(), { speakFinishedReply: co } = sn(), lo = o(), { items: uo, permissionsSettled: fo, simulating: po } = Zr(), J = M({
524
- theme: so,
525
- navigate: lo,
526
- navItems: uo,
527
- options: mi ?? {},
528
- navPermissionsSettled: fo,
529
- navSimulating: po
535
+ ]), So = e(), { speakFinishedReply: Co } = dn(), wo = o(), { items: To, permissionsSettled: Eo, simulating: Do } = oi(), J = j({
536
+ theme: So,
537
+ navigate: wo,
538
+ navItems: To,
539
+ options: Ci ?? {},
540
+ navPermissionsSettled: Eo,
541
+ navSimulating: Do
530
542
  });
531
- j(() => {
543
+ k(() => {
532
544
  J.current = {
533
- theme: so,
534
- navigate: lo,
535
- navItems: uo,
536
- options: mi ?? {},
537
- navPermissionsSettled: fo,
538
- navSimulating: po
545
+ theme: So,
546
+ navigate: wo,
547
+ navItems: To,
548
+ options: Ci ?? {},
549
+ navPermissionsSettled: Eo,
550
+ navSimulating: Do
539
551
  };
540
552
  }, [
541
- so,
542
- lo,
543
- uo,
544
- mi,
545
- fo,
546
- po
553
+ So,
554
+ wo,
555
+ To,
556
+ Ci,
557
+ Eo,
558
+ Do
547
559
  ]);
548
- let Y = M(!0);
549
- j(() => (Y.current = !0, () => {
560
+ let Y = j(!0);
561
+ k(() => (Y.current = !0, () => {
550
562
  Y.current = !1;
551
563
  }), []);
552
- let mo = M({
564
+ let Oo = j({
553
565
  tr: F,
554
566
  locale: V
555
- }), ho = M(null), [go, _o] = $r(null), vo = M(null), yo = A((e) => {
556
- vo.current !== null && (window.clearTimeout(vo.current), vo.current = null);
557
- let t = ho.current;
558
- t && (ho.current = null, window.clearTimeout(t.deadline), Y.current && _o(null), !(!e || !Y.current) && (vo.current = window.setTimeout(() => {
559
- if (vo.current = null, !Y.current) return;
560
- let e = b.getState();
567
+ }), ko = j(null), [Ao, jo] = M(null), Mo = j(null), No = O((e) => {
568
+ Mo.current !== null && (window.clearTimeout(Mo.current), Mo.current = null);
569
+ let t = ko.current;
570
+ t && (ko.current = null, window.clearTimeout(t.deadline), Y.current && jo(null), !(!e || !Y.current) && (Mo.current = window.setTimeout(() => {
571
+ if (Mo.current = null, !Y.current) return;
572
+ let e = v.getState();
561
573
  if (e.activeConversationId !== t.conversationId) return;
562
574
  let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
563
575
  if (!n) return;
564
- let r = mo.current, i = Gt(n, null, r.tr);
576
+ let r = Oo.current, i = Yt(n, null, r.tr);
565
577
  if (i.kind !== "output") return;
566
- let a = Ut(n, r.tr);
567
- Re.publish(n.id, {
578
+ let a = qt(n, r.tr);
579
+ Be.publish(n.id, {
568
580
  conversationId: t.conversationId,
569
581
  channel: n.metadata?.voice === !0 ? "voice" : "chat",
570
582
  voiceSessionId: n.metadata?.voiceSessionId,
@@ -573,47 +585,47 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
573
585
  final: !0
574
586
  });
575
587
  }, 0)));
576
- }, []), bo = A(() => yo(!0), [yo]);
577
- j(() => {
578
- mo.current = {
588
+ }, []), Po = O(() => No(!0), [No]);
589
+ k(() => {
590
+ Oo.current = {
579
591
  tr: F,
580
592
  locale: V
581
593
  };
582
- let e = ho.current;
594
+ let e = ko.current;
583
595
  if (!e) return;
584
- let t = Wt({
596
+ let t = Jt({
585
597
  wanted: e.wanted,
586
598
  locale: V,
587
- isLoading: _i(e.wanted),
588
- translatedNow: Vt(F, e.reply).translated
599
+ isLoading: Ei(e.wanted),
600
+ translatedNow: Gt(F, e.reply).translated
589
601
  });
590
602
  if (t === "write") {
591
- bo();
603
+ Po();
592
604
  return;
593
605
  }
594
606
  if (t === "grace") {
595
- let e = window.setTimeout(bo, 400);
607
+ let e = window.setTimeout(Po, 400);
596
608
  return () => window.clearTimeout(e);
597
609
  }
598
610
  }, [
599
611
  F,
600
612
  V,
601
- _i,
602
- go,
603
- bo
604
- ]), j(() => () => yo(!1), [yo]);
605
- let xo = M(null), [So, Co] = $r(!1), [X] = $r(() => new Ce()), [wo, To] = $r(0), Eo = A(() => To((e) => e + 1), []), Do = A(() => {
613
+ Ei,
614
+ Ao,
615
+ Po
616
+ ]), k(() => () => No(!1), [No]);
617
+ let Fo = j(null), [Io, Lo] = M(!1), [X] = M(() => new Te()), [Ro, zo] = M(0), Bo = O(() => zo((e) => e + 1), []), Vo = O(() => {
606
618
  let e = J.current;
607
619
  return {
608
- destinations: Sr(e.navItems),
620
+ destinations: jr(e.navItems),
609
621
  permissionsSettled: e.navPermissionsSettled,
610
622
  simulating: e.navSimulating
611
623
  };
612
- }, []), Oo = M(B);
613
- j(() => {
614
- Oo.current = B;
624
+ }, []), Ho = j(B);
625
+ k(() => {
626
+ Ho.current = B;
615
627
  }, [B]);
616
- let ko = A((e, t) => {
628
+ let Uo = O((e, t) => {
617
629
  let n = X.replyIdOf(e), r = n ? X.turnFor(n) : void 0, i = X.offer(e), a = {
618
630
  ok: !1,
619
631
  reason: "gone",
@@ -622,25 +634,25 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
622
634
  voiceSessionId: void 0
623
635
  };
624
636
  if (!n || !r || !i || i.used) return a;
625
- let o = r.conversationId, s = b.getState().conversations.find((e) => e.id === o);
637
+ let o = r.conversationId, s = v.getState().conversations.find((e) => e.id === o);
626
638
  if (!s) return a;
627
639
  let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = X.liveOffersFor(n, {
628
- registry: Do(),
629
- actorId: Oo.current,
640
+ registry: Vo(),
641
+ actorId: Ho.current,
630
642
  conversationId: o,
631
643
  perfNow: performance.now()
632
644
  }).find((t) => t.offer.offerId === e);
633
645
  if (!u) {
634
- let e = Te(i, performance.now());
646
+ let e = De(i, performance.now());
635
647
  return {
636
648
  ok: !1,
637
649
  reason: e ? "unavailable" : "expired",
638
- copy: e ? It(F, t || null) : Pt(F),
650
+ copy: e ? Bt(F, t || null) : Rt(F),
639
651
  conversationId: o,
640
652
  voiceSessionId: l
641
653
  };
642
654
  }
643
- return X.markUsed(e) ? (Eo(), {
655
+ return X.markUsed(e) ? (Bo(), {
644
656
  ok: !0,
645
657
  target: u.target,
646
658
  conversationId: o,
@@ -648,10 +660,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
648
660
  }) : a;
649
661
  }, [
650
662
  X,
651
- Do,
663
+ Vo,
652
664
  F,
653
- Eo
654
- ]), Ao = A((e, t, n, r, i) => {
665
+ Bo
666
+ ]), Wo = O((e, t, n, r, i) => {
655
667
  let a = P();
656
668
  W(e, {
657
669
  id: a,
@@ -661,20 +673,20 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
661
673
  metadata: {
662
674
  lang: n.translated ? V : "en",
663
675
  ...i ? { localAction: i } : {},
664
- ...w(t)
676
+ ...S(t)
665
677
  }
666
- }), i && Ln.recordCommittedEntries(e, [a], "NOTE", r);
667
- }, [W, V]), jo = A((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && X.release(e), [X]), Mo = M(null);
668
- j(() => () => {
669
- Mo.current?.(), Mo.current = null;
678
+ }), i && Un.recordCommittedEntries(e, [a], "NOTE", r);
679
+ }, [W, V]), Go = O((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && X.release(e), [X]), Ko = j(null);
680
+ k(() => () => {
681
+ Ko.current?.(), Ko.current = null;
670
682
  }, []);
671
- let No = A((e) => {
672
- Mo.current?.(), Mo.current = Y.current ? Wn(document, e) : null;
673
- }, []), Po = A((e, t, n, r = !1) => {
674
- if (xo.current !== null) return;
675
- let i = ko(e, n), a = D(), o = (e, t, n, r) => Ao(e, t, n, a, r);
683
+ let qo = O((e) => {
684
+ Ko.current?.(), Ko.current = Y.current ? Xn(document, e) : null;
685
+ }, []), Jo = O((e, t, n, r = !1) => {
686
+ if (Fo.current !== null) return;
687
+ let i = Uo(e, n), a = T(), o = (e, t, n, r) => Wo(e, t, n, a, r);
676
688
  if (!i.ok) {
677
- i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), Eo();
689
+ i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), Bo();
678
690
  return;
679
691
  }
680
692
  let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
@@ -682,7 +694,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
682
694
  offerId: e
683
695
  };
684
696
  if (r) {
685
- o(c, l, Mt(F, s.label, !0), kr({
697
+ o(c, l, It(F, s.label, !0), Rr({
686
698
  destinationId: s.id,
687
699
  path: s.path,
688
700
  alreadyHere: !0,
@@ -692,16 +704,16 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
692
704
  return;
693
705
  }
694
706
  let d = P();
695
- xo.current = d, Co(!0);
707
+ Fo.current = d, Lo(!0);
696
708
  let f = (t) => {
697
709
  try {
698
- if (jo(e, t) && (Eo(), t.status === "kept" && No(e)), t.status === "kept" || !b.getState().conversations.some((e) => e.id === c)) return;
710
+ if (Go(e, t) && (Bo(), t.status === "kept" && qo(e)), t.status === "kept" || !v.getState().conversations.some((e) => e.id === c)) return;
699
711
  let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
700
- o(c, l, Nt(F, t, {
712
+ o(c, l, Lt(F, t, {
701
713
  page: s.label,
702
- landed: n === null ? null : jr(Sr(J.current.navItems), n),
714
+ landed: n === null ? null : Br(jr(J.current.navItems), n),
703
715
  path: s.path
704
- }), kr({
716
+ }), Rr({
705
717
  destinationId: s.id,
706
718
  path: s.path,
707
719
  alreadyHere: !1,
@@ -710,10 +722,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
710
722
  offer: u
711
723
  }));
712
724
  } finally {
713
- xo.current === d && (xo.current = null, Y.current && Co(!1));
725
+ Fo.current === d && (Fo.current = null, Y.current && Lo(!1));
714
726
  }
715
727
  };
716
- Er(J.current.navigate, s.path, {
728
+ Fr(J.current.navigate, s.path, {
717
729
  readPath: () => window.location.pathname + window.location.search,
718
730
  now: () => Date.now(),
719
731
  schedule: (e, t) => {
@@ -724,20 +736,20 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
724
736
  surface: "offer"
725
737
  }).then(f, () => f({ status: "unconfirmed" }));
726
738
  }, [
727
- ko,
728
- Ao,
739
+ Uo,
740
+ Wo,
729
741
  F,
730
- Eo,
731
- jo,
732
- No
733
- ]), Fo = A((e, t) => Po(e, "tap", t || null), [Po]), Io = A((e) => {
742
+ Bo,
743
+ Go,
744
+ qo
745
+ ]), Yo = O((e, t) => Jo(e, "tap", t || null), [Jo]), Xo = O((e) => {
734
746
  let { replyId: t, conversationId: n } = e, r = X.turnFor(t);
735
747
  if (!r) return;
736
- let i = window.location.pathname + window.location.search, a = Sr(J.current.navItems), o = Hr({
748
+ let i = window.location.pathname + window.location.search, a = jr(J.current.navItems), o = Zr({
737
749
  intent: e.intent,
738
750
  live: X.liveOffersFor(t, {
739
- registry: Do(),
740
- actorId: Oo.current,
751
+ registry: Vo(),
752
+ actorId: Ho.current,
741
753
  conversationId: n,
742
754
  perfNow: performance.now()
743
755
  }),
@@ -747,52 +759,52 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
747
759
  atSend: e.atSend,
748
760
  now: {
749
761
  location: i,
750
- conversationId: b.getState().activeConversationId,
751
- workspaceId: D(),
752
- actorId: Oo.current ?? null
762
+ conversationId: v.getState().activeConversationId,
763
+ workspaceId: T(),
764
+ actorId: Ho.current ?? null
753
765
  },
754
766
  mounted: Y.current,
755
767
  visible: document.visibilityState === "visible",
756
- unsavedChanges: Ur(J.current.options),
768
+ unsavedChanges: Qr(J.current.options),
757
769
  alreadyThere: ({ target: e }) => {
758
770
  let t = a.find((t) => t.id === e.id);
759
- return t ? yr(t, i, a) : !1;
771
+ return t ? Or(t, i, a) : !1;
760
772
  }
761
773
  });
762
774
  if (o.act === "navigate" || o.act === "already-here") {
763
- Po(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
775
+ Jo(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
764
776
  return;
765
777
  }
766
778
  let [s] = o.unsaved ?? [], [c] = X.liveOffersFor(t, {
767
- registry: Do(),
768
- actorId: Oo.current,
779
+ registry: Vo(),
780
+ actorId: Ho.current,
769
781
  conversationId: n,
770
782
  perfNow: performance.now()
771
783
  });
772
- o.hold === "R5-unsaved" && s && c && Ao(n, e.voiceSessionId, Ft(F, s.label, c.target.label), D());
784
+ o.hold === "R5-unsaved" && s && c && Wo(n, e.voiceSessionId, zt(F, s.label, c.target.label), T());
773
785
  }, [
774
786
  X,
775
- Do,
787
+ Vo,
776
788
  G,
777
- Po,
778
- Ao,
789
+ Jo,
790
+ Wo,
779
791
  F
780
- ]), Lo = A((e) => {
781
- let t = b.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
782
- return n ? Or(Dr, window.location.pathname, Mr(n.messages, e)) : !1;
783
- }, []), Ro = A((e, t, n = !1) => {
784
- let { navItems: r, options: i } = J.current, a = Sr(r), o = null, s = {
792
+ ]), Zo = O((e) => {
793
+ let t = v.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
794
+ return n ? Lr(Ir, window.location.pathname, Vr(n.messages, e)) : !1;
795
+ }, []), Qo = O((e, t, n = !1) => {
796
+ let { navItems: r, options: i } = J.current, a = jr(r), o = null, s = {
785
797
  ...i,
786
- locale: t === void 0 ? V : wi.input.code,
798
+ locale: t === void 0 ? V : Ni.input.code,
787
799
  uiLocale: V,
788
- inputLocale: wi.input.code
800
+ inputLocale: Ni.input.code
789
801
  };
790
- if (xr(e, s)) {
791
- let e = b.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? Pr(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => X.offersFor(e.id).some((e) => e.offerId === t) } }) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && wt(c.status);
802
+ if (Ar(e, s)) {
803
+ let e = v.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? Ur(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => X.offersFor(e.id).some((e) => e.offerId === t) } }) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && Ot(c.status);
792
804
  if (n && s && !l) {
793
805
  let e = X.liveOffersFor(s.id, {
794
- registry: Do(),
795
- actorId: Oo.current,
806
+ registry: Vo(),
807
+ actorId: Ho.current,
796
808
  conversationId: n.id,
797
809
  perfNow: performance.now()
798
810
  }).flatMap(({ offer: e, target: t }) => {
@@ -802,34 +814,34 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
802
814
  target: n
803
815
  }] : [];
804
816
  });
805
- o = Nr({
817
+ o = Hr({
806
818
  reply: s,
807
- text: tn(s, c, F),
819
+ text: on(s, c, F),
808
820
  resolve: {
809
821
  destinations: a,
810
822
  entityRoutes: i.entityRoutes,
811
- visibleNavIds: _r(r),
812
- nounLabel: (e) => At(F, e)
823
+ visibleNavIds: Er(r),
824
+ nounLabel: (e) => Pt(F, e)
813
825
  },
814
826
  offers: e
815
827
  });
816
828
  }
817
829
  }
818
- return br(e, a, s, {
819
- backRunnable: Lo(t),
830
+ return kr(e, a, s, {
831
+ backRunnable: Zo(t),
820
832
  navigation: o,
821
833
  skipRecords: n,
822
- controls: Tr()
834
+ controls: Pr()
823
835
  });
824
836
  }, [
825
- Lo,
826
- wi,
837
+ Zo,
838
+ Ni,
827
839
  V,
828
840
  F,
829
841
  X,
830
- Do
831
- ]), zo = A((e, t) => {
832
- let n = Ro(e, t);
842
+ Vo
843
+ ]), $o = O((e, t) => {
844
+ let n = Qo(e, t);
833
845
  if (!n) return !1;
834
846
  let { theme: r, navigate: i } = J.current;
835
847
  switch (n.kind) {
@@ -841,53 +853,53 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
841
853
  case "link-not-openable":
842
854
  case "back": return i !== null;
843
855
  case "conversation-delete": return !1;
844
- case "app-control": return Wr(n.request, { voiceLive: t !== void 0 || Vs.current }) !== null;
856
+ case "app-control": return $r(n.request, { voiceLive: t !== void 0 || tc.current }) !== null;
845
857
  case "open-record": return !1;
846
858
  }
847
- }, [Ro]), Bo = M(zo);
848
- j(() => {
849
- Bo.current = zo;
850
- }, [zo]);
851
- let Vo = A((e, t) => {
859
+ }, [Qo]), es = j($o);
860
+ k(() => {
861
+ es.current = $o;
862
+ }, [$o]);
863
+ let ts = O((e, t) => {
852
864
  let n = {
853
865
  state: "none",
854
866
  accept: null
855
867
  }, { navigate: r, options: i, navItems: a } = J.current;
856
868
  if (!e || r === null || i.uiOffers !== !0) return n;
857
- let o = b.getState(), s = o.conversations.find((t) => t.id === e);
869
+ let o = v.getState(), s = o.conversations.find((t) => t.id === e);
858
870
  if (!s) return n;
859
871
  let c = o.processingByConversationId[s.id] ?? null, l = {
860
- registry: Do(),
861
- actorId: Oo.current,
872
+ registry: Vo(),
873
+ actorId: Ho.current,
862
874
  conversationId: s.id,
863
875
  perfNow: performance.now()
864
- }, { state: u, reply: d } = Br(X, {
876
+ }, { state: u, reply: d } = Yr(X, {
865
877
  ...l,
866
878
  messages: s.messages,
867
879
  voiceSessionId: t,
868
880
  processing: c,
869
- displayedText: (e) => tn(e, c, F),
881
+ displayedText: (e) => on(e, c, F),
870
882
  productWriteApproval: R,
871
- capabilitiesOf: (e) => b.getState().sandboxWriteCapabilities[e]
883
+ capabilitiesOf: (e) => v.getState().sandboxWriteCapabilities[e]
872
884
  });
873
885
  if (u !== "acceptable" || !d) return {
874
886
  state: u,
875
887
  accept: null
876
888
  };
877
- let [f] = X.liveOffersFor(d.id, l), p = f ? Sr(a).find((e) => e.id === f.target.id) : void 0;
878
- return !f || !p ? n : {
889
+ let [f] = X.liveOffersFor(d.id, l), ee = f ? jr(a).find((e) => e.id === f.target.id) : void 0;
890
+ return !f || !ee ? n : {
879
891
  state: u,
880
892
  accept: {
881
893
  offerId: f.offer.offerId,
882
- destination: p
894
+ destination: ee
883
895
  }
884
896
  };
885
897
  }, [
886
898
  X,
887
- Do,
899
+ Vo,
888
900
  R,
889
901
  F
890
- ]), Ho = A((e, t, n, r, i) => {
902
+ ]), ns = O((e, t, n, r, i) => {
891
903
  let a = F(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
892
904
  kind: "write-reply",
893
905
  line: n.key
@@ -899,7 +911,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
899
911
  timestamp: c,
900
912
  metadata: {
901
913
  localAction: s,
902
- ...w(i)
914
+ ...S(i)
903
915
  }
904
916
  });
905
917
  let u = P();
@@ -911,50 +923,50 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
911
923
  metadata: {
912
924
  lang: a === o ? "en" : V,
913
925
  localAction: s,
914
- ...w(i)
926
+ ...S(i)
915
927
  }
916
- }), Ln.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", D()), co(e, u);
928
+ }), Un.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", T()), Co(e, u);
917
929
  }, [
918
930
  W,
919
931
  V,
920
- co,
932
+ Co,
921
933
  F
922
- ]), Uo = Vn(), Wo = Hn(), Go = Uo?.request ?? null, Ko = M(() => void 0), [qo, Jo] = $r(null);
923
- j(() => {
924
- if (qo === null) return;
925
- let e = window.setTimeout(() => Jo(null), si);
934
+ ]), rs = qn(), is = Jn(), as = rs?.request ?? null, os = j(() => void 0), [ss, cs] = M(null);
935
+ k(() => {
936
+ if (ss === null) return;
937
+ let e = window.setTimeout(() => cs(null), gi);
926
938
  return () => window.clearTimeout(e);
927
- }, [qo]);
928
- let Yo = A(() => {
929
- let e = b.getState();
930
- return Ni(void 0, e.autoRouting && Ea.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
931
- }, [Ni]), Xo = A((e) => {
932
- if (!Go) return !1;
933
- let t = e !== void 0, n = b.getState(), r = Gn({
939
+ }, [ss]);
940
+ let ls = O(() => {
941
+ let e = v.getState();
942
+ return Hi(void 0, e.autoRouting && Fa.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
943
+ }, [Hi]), us = O((e) => {
944
+ if (!as) return !1;
945
+ let t = e !== void 0, n = v.getState(), r = Zn({
934
946
  spoken: t,
935
- bound: Ia.current,
947
+ bound: Xa.current,
936
948
  activeConversationId: n.activeConversationId,
937
949
  conversations: n.conversations,
938
- historyOn: Bn()
950
+ historyOn: Kn()
939
951
  });
940
- if (r && Go(r), t) {
952
+ if (r && as(r), t) {
941
953
  let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? F("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : F("deleteConversation.nothing", "There is no conversation to delete.");
942
- Ko.current({
954
+ os.current({
943
955
  id: `conversation-delete:${P()}`,
944
956
  text: t,
945
957
  lang: t === e ? "en" : V
946
958
  });
947
- } else r || Jo(Date.now());
959
+ } else r || cs(Date.now());
948
960
  return !0;
949
961
  }, [
950
- Go,
962
+ as,
951
963
  V,
952
964
  F
953
- ]), Zo = A((e, t, n, r = !1) => {
954
- if (e.kind === "conversation-delete") return Xo(n);
965
+ ]), ds = O((e, t, n, r = !1) => {
966
+ if (e.kind === "conversation-delete") return us(n);
955
967
  let { theme: i, navigate: a } = J.current, o = null, s = () => {
956
- let e = (r ? null : o ?? b.getState().activeConversationId) ?? Yo();
957
- return r && za(e), e;
968
+ let e = (r ? null : o ?? v.getState().activeConversationId) ?? ls();
969
+ return r && $a(e), e;
958
970
  }, c = (e, r) => {
959
971
  let i = P();
960
972
  return W(e, {
@@ -964,7 +976,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
964
976
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
965
977
  metadata: {
966
978
  localAction: r,
967
- ...w(n)
979
+ ...S(n)
968
980
  }
969
981
  }), i;
970
982
  }, l = (e, t, r, i, a, o) => {
@@ -977,25 +989,25 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
977
989
  metadata: {
978
990
  lang: r.translated ? V : "en",
979
991
  localAction: i,
980
- ...w(n)
992
+ ...S(n)
981
993
  }
982
- }), Ln.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && co(e, s), s;
994
+ }), Un.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && Co(e, s), s;
983
995
  }, u = (e, t, n) => {
984
- let r = s(), i = l(r, c(r, t), e, t, D(), !0);
996
+ let r = s(), i = l(r, c(r, t), e, t, T(), !0);
985
997
  return n?.(i), !0;
986
998
  }, d = (e) => {
987
- let t = s(), n = D(), r = window.location.pathname, i = c(t, kr({
999
+ let t = s(), n = T(), r = window.location.pathname, i = c(t, Rr({
988
1000
  destinationId: e.destinationId,
989
1001
  path: e.registryPath,
990
1002
  alreadyHere: !1,
991
1003
  via: e.via,
992
1004
  offer: e.offer
993
1005
  })), o = P();
994
- xo.current = o, Co(!0);
1006
+ Fo.current = o, Lo(!0);
995
1007
  let u = (a) => {
996
1008
  try {
997
- if (e.offer && jo(e.offer.offerId, a) && Eo(), a.status === "kept" || !b.getState().conversations.some((e) => e.id === t)) return;
998
- let o = Sr(J.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = kr({
1009
+ if (e.offer && Go(e.offer.offerId, a) && Bo(), a.status === "kept" || !v.getState().conversations.some((e) => e.id === t)) return;
1010
+ let o = jr(J.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = Rr({
999
1011
  destinationId: e.destinationId,
1000
1012
  path: e.registryPath,
1001
1013
  alreadyHere: !1,
@@ -1003,10 +1015,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1003
1015
  outcome: a,
1004
1016
  offer: e.offer
1005
1017
  });
1006
- Ii(t, i, { localAction: c });
1007
- let u = l(t, i, e.via === "back" && a.status === "arrived" ? Dt(F, e.pageLabel()) : Nt(F, a, {
1018
+ Gi(t, i, { localAction: c });
1019
+ let u = l(t, i, e.via === "back" && a.status === "arrived" ? jt(F, e.pageLabel()) : Lt(F, a, {
1008
1020
  page: e.pageLabel(),
1009
- landed: s === null ? null : jr(o, s),
1021
+ landed: s === null ? null : Br(o, s),
1010
1022
  path: e.target
1011
1023
  }), c, n, Y.current);
1012
1024
  a.status === "arrived" && e.onArrived?.({
@@ -1015,10 +1027,10 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1015
1027
  landedPath: a.landedPath
1016
1028
  });
1017
1029
  } finally {
1018
- xo.current === o && (xo.current = null, Y.current && Co(!1));
1030
+ Fo.current === o && (Fo.current = null, Y.current && Lo(!1));
1019
1031
  }
1020
1032
  };
1021
- return Er(a, e.target, {
1033
+ return Fr(a, e.target, {
1022
1034
  readPath: () => window.location.pathname + window.location.search,
1023
1035
  now: () => Date.now(),
1024
1036
  schedule: (e, t) => {
@@ -1026,7 +1038,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1026
1038
  },
1027
1039
  isShellLess: () => !Y.current
1028
1040
  }).then(u, () => u({ status: "unconfirmed" })), !0;
1029
- }, f = ({ replyId: e, fromPath: t, landedPath: n }) => Dr.push({
1041
+ }, f = ({ replyId: e, fromPath: t, landedPath: n }) => Ir.push({
1030
1042
  fromPath: t,
1031
1043
  toPath: n,
1032
1044
  replyMessageId: e,
@@ -1034,21 +1046,21 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1034
1046
  });
1035
1047
  if (e.kind === "theme") {
1036
1048
  if (!i) return !1;
1037
- let t = Cr(e.request, {
1049
+ let t = Mr(e.request, {
1038
1050
  mode: i.mode,
1039
1051
  resolvedTheme: i.resolvedTheme
1040
1052
  });
1041
1053
  if (!t.alreadyApplied) try {
1042
1054
  i.setMode(t.mode);
1043
1055
  } catch {}
1044
- return u(Bt(F, t, e.request.kind === "family"), {
1056
+ return u(Wt(F, t, e.request.kind === "family"), {
1045
1057
  kind: "theme",
1046
1058
  mode: t.mode,
1047
1059
  alreadyApplied: t.alreadyApplied
1048
1060
  });
1049
1061
  }
1050
1062
  if (e.kind === "app-control") {
1051
- let t = Wr(e.request, { voiceLive: n !== void 0 || Vs.current });
1063
+ let t = $r(e.request, { voiceLive: n !== void 0 || tc.current });
1052
1064
  if (!t) return !1;
1053
1065
  let r = (e) => ({
1054
1066
  kind: "app-control",
@@ -1056,34 +1068,34 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1056
1068
  outcome: e.outcome,
1057
1069
  ...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
1058
1070
  }), i = (t) => {
1059
- if (e.request.control === "language" && yo(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1060
- let n = s(), i = r(t), a = l(n, c(n, i), Vt((e, t) => t, t.reply), i, D(), !1);
1061
- return ho.current = {
1071
+ if (e.request.control === "language" && No(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1072
+ let n = s(), i = r(t), a = l(n, c(n, i), Gt((e, t) => t, t.reply), i, T(), !1);
1073
+ return ko.current = {
1062
1074
  wanted: e.request.code,
1063
1075
  reply: t.reply,
1064
1076
  conversationId: n,
1065
1077
  messageId: a,
1066
- deadline: window.setTimeout(bo, Ht)
1067
- }, _o(a), !0;
1078
+ deadline: window.setTimeout(Po, Kt)
1079
+ }, jo(a), !0;
1068
1080
  }
1069
- return u(Vt(F, t.reply), r(t));
1081
+ return u(Gt(F, t.reply), r(t));
1070
1082
  };
1071
1083
  if (t.kind === "reply") return i(t.run);
1072
1084
  if (t.kind === "run") {
1073
1085
  let e = t.run();
1074
1086
  return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
1075
1087
  }
1076
- let a = Wo;
1088
+ let a = is;
1077
1089
  if (!a) return !1;
1078
1090
  let o = null;
1079
- return u(Vt(F, t.ask.reply), r(t.ask), (e) => {
1080
- o = b.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
1091
+ return u(Gt(F, t.ask.reply), r(t.ask), (e) => {
1092
+ o = v.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
1081
1093
  }), a.request({
1082
1094
  prompt: t.prompt,
1083
1095
  onConfirm: () => {
1084
- let e = t.confirmed(), i = o, a = i !== null && b.getState().conversations.some((e) => e.id === i);
1096
+ let e = t.confirmed(), i = o, a = i !== null && v.getState().conversations.some((e) => e.id === i);
1085
1097
  if (!i || !a) return;
1086
- let s = Vt(F, e.reply);
1098
+ let s = Gt(F, e.reply);
1087
1099
  W(i, {
1088
1100
  id: P(),
1089
1101
  role: "assistant",
@@ -1092,30 +1104,30 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1092
1104
  metadata: {
1093
1105
  lang: s.translated ? V : "en",
1094
1106
  localAction: r(e),
1095
- ...w(n)
1107
+ ...S(n)
1096
1108
  }
1097
1109
  });
1098
1110
  }
1099
1111
  }), !0;
1100
1112
  }
1101
1113
  if (!a) return !1;
1102
- if (e.kind === "choose-destination") return u(Ot(F, e.candidates[0]?.label ?? e.query, e.candidates), {
1114
+ if (e.kind === "choose-destination") return u(Mt(F, e.candidates[0]?.label ?? e.query, e.candidates), {
1103
1115
  kind: "choose-destination",
1104
1116
  candidateIds: e.candidates.map((e) => e.id)
1105
- }, (t) => Fr(t, e.candidates));
1106
- if (e.kind === "choose-linked") return u(kt(F, e.candidates), {
1117
+ }, (t) => Wr(t, e.candidates));
1118
+ if (e.kind === "choose-linked") return u(Nt(F, e.candidates), {
1107
1119
  kind: "choose-destination",
1108
1120
  candidateIds: e.candidates.map((e) => e.id)
1109
- }, (t) => Fr(t, e.candidates));
1121
+ }, (t) => Wr(t, e.candidates));
1110
1122
  if (e.kind === "pick-from-list") {
1111
1123
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
1112
- return u(Lt(F), t ? {
1124
+ return u(Vt(F), t ? {
1113
1125
  kind: "choose-destination",
1114
1126
  candidateIds: t.map((e) => e.id)
1115
1127
  } : e.candidateIds.length > 0 ? {
1116
1128
  kind: "choose-destination",
1117
1129
  candidateIds: [...e.candidateIds]
1118
- } : kr({
1130
+ } : Rr({
1119
1131
  destinationId: "",
1120
1132
  path: "",
1121
1133
  alreadyHere: !1,
@@ -1124,9 +1136,9 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1124
1136
  status: "refused",
1125
1137
  reason: "not-routable"
1126
1138
  }
1127
- }), t ? (e) => Fr(e, t) : void 0);
1139
+ }), t ? (e) => Wr(e, t) : void 0);
1128
1140
  }
1129
- if (e.kind === "link-not-openable") return u(jt(F), kr({
1141
+ if (e.kind === "link-not-openable") return u(Ft(F), Rr({
1130
1142
  destinationId: "",
1131
1143
  path: "",
1132
1144
  alreadyHere: !1,
@@ -1139,7 +1151,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1139
1151
  if (e.kind === "open-record") {
1140
1152
  let r;
1141
1153
  try {
1142
- let { options: t, navItems: n } = J.current, i = t.entityRoutes ?? [], a = _r(n);
1154
+ let { options: t, navItems: n } = J.current, i = t.entityRoutes ?? [], a = Er(n);
1143
1155
  r = (t.records ?? []).flatMap((t) => {
1144
1156
  let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
1145
1157
  return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
@@ -1151,20 +1163,20 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1151
1163
  return !1;
1152
1164
  }
1153
1165
  if (r.length === 0) return !1;
1154
- let i = b.getState().activeConversationId, a = P();
1155
- xo.current = a, Co(!0);
1166
+ let i = v.getState().activeConversationId, a = P();
1167
+ Fo.current = a, Lo(!0);
1156
1168
  let s = () => {
1157
- xo.current === a && (xo.current = null, Y.current && Co(!1));
1169
+ Fo.current === a && (Fo.current = null, Y.current && Lo(!1));
1158
1170
  };
1159
1171
  return (async () => {
1160
1172
  let a = { kind: "none" }, c = !0;
1161
1173
  try {
1162
- a = await vr({
1174
+ a = await Dr({
1163
1175
  name: e.request.name,
1164
1176
  usable: r,
1165
- nounOf: (e) => At(F, e.noun),
1166
- timeoutMs: ni
1167
- }), c = b.getState().conversations.some((e) => e.id === i);
1177
+ nounOf: (e) => Pt(F, e.noun),
1178
+ timeoutMs: ui
1179
+ }), c = v.getState().conversations.some((e) => e.id === i);
1168
1180
  } catch {
1169
1181
  a = { kind: "none" };
1170
1182
  } finally {
@@ -1172,7 +1184,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1172
1184
  }
1173
1185
  if (!Y.current) return;
1174
1186
  if (a.kind === "none") {
1175
- ns.current(t, [], {
1187
+ gs.current(t, [], {
1176
1188
  fromPerson: !0,
1177
1189
  ...n === void 0 ? {} : { voiceSessionId: n },
1178
1190
  localRecordsChecked: !0
@@ -1193,16 +1205,16 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1193
1205
  return;
1194
1206
  }
1195
1207
  let l = a.candidates[0];
1196
- u(a.why === "kinds" ? zt(F, a.nouns, a.candidates) : Rt(F, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1208
+ u(a.why === "kinds" ? Ut(F, a.nouns, a.candidates) : Ht(F, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1197
1209
  kind: "choose-destination",
1198
1210
  candidateIds: a.candidates.map((e) => e.id)
1199
- }, (e) => Fr(e, a.candidates));
1211
+ }, (e) => Wr(e, a.candidates));
1200
1212
  })().catch(() => void 0), !0;
1201
1213
  }
1202
1214
  if (e.kind === "back") {
1203
- let e = Dr.top();
1215
+ let e = Ir.top();
1204
1216
  if (!e) return !1;
1205
- let t = Ar(Sr(J.current.navItems), e.fromPath);
1217
+ let t = zr(jr(J.current.navItems), e.fromPath);
1206
1218
  return d({
1207
1219
  target: e.fromPath,
1208
1220
  destinationId: t?.id ?? "",
@@ -1210,88 +1222,88 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1210
1222
  via: "back",
1211
1223
  pageLabel: () => t?.label ?? null,
1212
1224
  onArrived: () => {
1213
- Dr.top() === e && Dr.pop();
1225
+ Ir.top() === e && Ir.pop();
1214
1226
  }
1215
1227
  });
1216
1228
  }
1217
- let p, m = e.destination;
1229
+ let ee, p = e.destination;
1218
1230
  if (e.via === "offer") {
1219
- let t = ko(e.offerId, e.destination.label);
1220
- if (!t.ok) return u(t.copy ?? Pt(F), {
1231
+ let t = Uo(e.offerId, e.destination.label);
1232
+ if (!t.ok) return u(t.copy ?? Rt(F), {
1221
1233
  kind: "write-reply",
1222
1234
  line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
1223
1235
  });
1224
- p = {
1236
+ ee = {
1225
1237
  trigger: e.trigger,
1226
1238
  offerId: e.offerId
1227
- }, m = Sr(J.current.navItems).find((e) => e.id === t.target.id) ?? {
1239
+ }, p = jr(J.current.navItems).find((e) => e.id === t.target.id) ?? {
1228
1240
  id: t.target.id,
1229
1241
  label: t.target.label,
1230
1242
  path: t.target.path
1231
1243
  };
1232
1244
  }
1233
- return yr(m, window.location.pathname + window.location.search, Sr(J.current.navItems)) ? u(Mt(F, m.label, !0), kr({
1234
- destinationId: m.id,
1235
- path: m.path,
1245
+ return Or(p, window.location.pathname + window.location.search, jr(J.current.navItems)) ? u(It(F, p.label, !0), Rr({
1246
+ destinationId: p.id,
1247
+ path: p.path,
1236
1248
  alreadyHere: !0,
1237
1249
  via: e.via ?? "named",
1238
- offer: p
1250
+ offer: ee
1239
1251
  })) : d({
1240
- target: m.path,
1241
- destinationId: m.id,
1242
- registryPath: m.path,
1252
+ target: p.path,
1253
+ destinationId: p.id,
1254
+ registryPath: p.path,
1243
1255
  via: e.via ?? "named",
1244
- offer: p,
1245
- pageLabel: () => m.label,
1256
+ offer: ee,
1257
+ pageLabel: () => p.label,
1246
1258
  onArrived: f
1247
1259
  });
1248
1260
  }, [
1249
1261
  W,
1250
- za,
1251
- Wo,
1252
- Yo,
1253
- bo,
1262
+ $a,
1263
+ is,
1264
+ ls,
1265
+ Po,
1254
1266
  V,
1255
- Ii,
1256
- Xo,
1257
- yo,
1258
- co,
1267
+ Gi,
1268
+ us,
1269
+ No,
1270
+ Co,
1259
1271
  F,
1260
- ko,
1261
- jo,
1262
- Eo
1263
- ]), Qo = A(async (e) => {
1264
- Oa.current = !0;
1272
+ Uo,
1273
+ Go,
1274
+ Bo
1275
+ ]), fs = O(async (e) => {
1276
+ La.current = !0;
1265
1277
  try {
1266
1278
  await G.declineForReply(e.conversationId, e.reason, e.origin);
1267
1279
  } finally {
1268
- Oa.current = !1;
1280
+ La.current = !1;
1269
1281
  }
1270
1282
  if (e.commandText !== null) {
1271
- let t = Ro(e.commandText, e.options.voiceSessionId);
1272
- if (t && Zo(t, e.content, e.options.voiceSessionId)) return;
1283
+ let t = Qo(e.commandText, e.options.voiceSessionId);
1284
+ if (t && ds(t, e.content, e.options.voiceSessionId)) return;
1273
1285
  }
1274
- await ns.current(e.content, e.attachments, e.options);
1286
+ await gs.current(e.content, e.attachments, e.options);
1275
1287
  }, [
1276
- Ro,
1277
- Zo,
1288
+ Qo,
1289
+ ds,
1278
1290
  G
1279
- ]), Z = A(async (e, t = [], n = {}) => {
1280
- let r = n.voiceSessionId !== void 0, i = b.getState(), a = !1, o = Ia.current;
1281
- if (r && E(o)) {
1282
- let e = $e(o, i.activeConversationId, Ba());
1291
+ ]), Z = O(async (e, t = [], n = {}) => {
1292
+ let r = n.voiceSessionId !== void 0, i = v.getState(), a = !1, o = Xa.current;
1293
+ if (r && Ze(o)) {
1294
+ let e = nt(o, i.activeConversationId, eo());
1283
1295
  if (e.kind === "gone") return;
1284
1296
  let t = n.voiceEntry ?? e;
1285
- t.kind === "adopt" && za(t.conversationId), a = t.kind === "own", n = {
1297
+ t.kind === "adopt" && $a(t.conversationId), a = t.kind === "own", n = {
1286
1298
  ...n,
1287
1299
  voiceEntry: t
1288
1300
  };
1289
1301
  }
1290
1302
  let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? H;
1291
1303
  if (c) {
1292
- if (wt(i.processingByConversationId[c]?.status)) {
1304
+ if (Ot(i.processingByConversationId[c]?.status)) {
1293
1305
  let r = i.processingByConversationId[c]?.messageId ?? null;
1294
- r && n.correctsInFlightTurn === !0 && !to.current.has(r) && io(), r && to.current.has(r) && (no.current = {
1306
+ r && n.correctsInFlightTurn === !0 && !go.current.has(r) && yo(), r && go.current.has(r) && (_o.current = {
1295
1307
  conversationId: c,
1296
1308
  content: e,
1297
1309
  attachments: t,
@@ -1299,27 +1311,27 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1299
1311
  });
1300
1312
  return;
1301
1313
  }
1302
- if (Ha.current.has(c)) return;
1314
+ if (no.current.has(c)) return;
1303
1315
  }
1304
- if (Da.current || g() !== null || Oa.current || xo.current !== null) return;
1305
- let l = n.targetConversationId, f = m(), h = (e) => Pn(e) || Nn(e, f);
1316
+ if (Ia.current || h() !== null || La.current || Fo.current !== null) return;
1317
+ let l = n.targetConversationId, f = p(), m = (e) => Bn(e) || zn(e, f);
1306
1318
  if (l !== void 0) {
1307
1319
  let e = i.conversations.find((e) => e.id === l);
1308
- if (i.activeConversationId !== l || !e || e.mode !== i.mode || h(e)) return;
1320
+ if (i.activeConversationId !== l || !e || e.mode !== i.mode || m(e)) return;
1309
1321
  }
1310
1322
  if (n.fromPerson && n.writeReplyBound === void 0) {
1311
- let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o = Vo(r, n.voiceSessionId), c = xn({
1323
+ let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o = ts(r, n.voiceSessionId), c = Dn({
1312
1324
  text: e,
1313
- locale: i === "spoken" ? wi.input.code : V,
1325
+ locale: i === "spoken" ? Ni.input.code : V,
1314
1326
  origin: i,
1315
1327
  hasAttachments: t.length > 0,
1316
1328
  live: G.liveFor(r),
1317
- matchesLocalCommand: (e) => Ro(e, n.voiceSessionId) !== null,
1329
+ matchesLocalCommand: (e) => Qo(e, n.voiceSessionId) !== null,
1318
1330
  offer: o.state,
1319
- offerAssent: o.state !== "none" && wr({
1331
+ offerAssent: o.state !== "none" && Nr({
1320
1332
  text: e,
1321
1333
  uiLocale: V,
1322
- inputLocale: wi.input.code,
1334
+ inputLocale: Ni.input.code,
1323
1335
  commandLocales: J.current.options.commandLocales,
1324
1336
  manifest: J.current.options.commandManifest,
1325
1337
  leaveGuard: J.current.options.leaveGuard
@@ -1327,7 +1339,7 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1327
1339
  });
1328
1340
  if (c.kind === "accept_offer") {
1329
1341
  let t = o.accept;
1330
- if (t && Zo({
1342
+ if (t && ds({
1331
1343
  kind: "navigate",
1332
1344
  destination: t.destination,
1333
1345
  via: "offer",
@@ -1348,11 +1360,11 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1348
1360
  };
1349
1361
  }
1350
1362
  if (c.kind === "local_reply") {
1351
- r && Ho(r, e, c.line, c.values, n.voiceSessionId);
1363
+ r && ns(r, e, c.line, c.values, n.voiceSessionId);
1352
1364
  return;
1353
1365
  }
1354
1366
  let u = c.kind === "local" ? c.fallback : c.bound, d = c.declineAll;
1355
- if (d !== null && r) return Qo({
1367
+ if (d !== null && r) return fs({
1356
1368
  conversationId: r,
1357
1369
  reason: d,
1358
1370
  origin: i,
@@ -1369,694 +1381,691 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
1369
1381
  writeReplyBound: u
1370
1382
  };
1371
1383
  }
1372
- let ee = n.writeReplyBound?.promptText ?? e;
1384
+ let te = n.writeReplyBound?.promptText ?? e;
1373
1385
  if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
1374
- let t = Ro(e, n.voiceSessionId, n.localRecordsChecked === !0);
1375
- if (t && Zo(t, e, n.voiceSessionId, a)) return;
1386
+ let t = Qo(e, n.voiceSessionId, n.localRecordsChecked === !0);
1387
+ if (t && ds(t, e, n.voiceSessionId, a)) return;
1376
1388
  }
1377
- let te = s ? i.conversations.find((e) => e.id === s) : void 0, _ = h(te) ? void 0 : te, v = i.autoRouting && Ea.current && l === void 0 ? p({
1389
+ let ne = s ? i.conversations.find((e) => e.id === s) : void 0, ie = m(ne) ? void 0 : ne, g = i.autoRouting && Fa.current && l === void 0 ? ee({
1378
1390
  intent: n.autoIntent ?? u(e),
1379
1391
  dictated: r,
1380
- voiceProposalBound: r && hi("api-calls") && ie(i.acknowledgedWriteModes, "api-calls"),
1381
- conversation: _ ? {
1382
- mode: _.mode,
1383
- routedBy: _.routedBy,
1384
- hasHistory: Mn(_)
1392
+ voiceProposalBound: r && wi("api-calls") && oe(i.acknowledgedWriteModes, "api-calls"),
1393
+ conversation: ie ? {
1394
+ mode: ie.mode,
1395
+ routedBy: ie.routedBy,
1396
+ hasHistory: Rn(ie)
1385
1397
  } : null
1386
1398
  }) : null;
1387
- if (v && va.current.find((e) => e.id === v.mode)?.writeCapable && !ie(i.acknowledgedWriteModes, v.mode)) {
1388
- Da.current = {
1399
+ if (g && Da.current.find((e) => e.id === g.mode)?.writeCapable && !oe(i.acknowledgedWriteModes, g.mode)) {
1400
+ Ia.current = {
1389
1401
  content: e,
1390
1402
  attachments: t,
1391
1403
  options: n
1392
- }, ja(v.mode);
1404
+ }, Ba(g.mode);
1393
1405
  return;
1394
1406
  }
1395
- let y = v ? v.mode : i.mode, re, oe, x = l ?? (a ? null : H), ce = x ? b.getState().conversations.find((e) => e.id === x) : void 0, le = v?.action === "escalate" && _ ? {
1396
- mode: _.mode,
1397
- backendSessionId: _.backendSessionId ?? null
1407
+ let _ = g ? g.mode : i.mode, ae, ce, y = l ?? (a ? null : H), ue = y ? v.getState().conversations.find((e) => e.id === y) : void 0, de = g?.action === "escalate" && ie ? {
1408
+ mode: ie.mode,
1409
+ backendSessionId: ie.backendSessionId ?? null
1398
1410
  } : null;
1399
- if (v) v.action === "new" || !_ ? x = Ni(void 0, y, { routedBy: "auto" }) : (x = _.id, qi(x, y));
1411
+ if (g) g.action === "new" || !ie ? y = Hi(void 0, _, { routedBy: "auto" }) : (y = ie.id, na(y, _));
1400
1412
  else {
1401
1413
  let e = i.autoRouting ? { routedBy: "auto" } : void 0;
1402
- !x || h(ce) || ce && ce.mode !== y && Mn(ce) ? x = Ni(void 0, y, e) : ce && ce.mode !== y && (e ? qi(x, y) : ji(x, y));
1414
+ !y || m(ue) || ue && ue.mode !== _ && Rn(ue) ? y = Hi(void 0, _, e) : ue && ue.mode !== _ && (e ? na(y, _) : Bi(y, _));
1403
1415
  }
1404
- if (!x) return;
1405
- r && Ia.current !== void 0 && x !== i.activeConversationId && za(x), n.approvalFollowUp || (Va.current[x] = t);
1406
- let de = () => b.getState().conversations.some((e) => e.id === x), S = D(), _e = {
1416
+ if (!y) return;
1417
+ r && Xa.current !== void 0 && y !== i.activeConversationId && $a(y), n.approvalFollowUp || (to.current[y] = t);
1418
+ let pe = () => v.getState().conversations.some((e) => e.id === y), b = T(), ye = {
1407
1419
  accessToken: z(),
1408
- workspaceToken: gi(),
1420
+ workspaceToken: Ti(),
1409
1421
  userId: B,
1410
- organizationId: St()
1411
- }, ye = (e, t) => {
1412
- de() || !S || se(e, S, t, y, {
1422
+ organizationId: Et()
1423
+ }, xe = (e, t) => {
1424
+ pe() || !b || le(e, b, t, _, {
1413
1425
  accessToken: z(),
1414
- workspaceToken: gi(),
1426
+ workspaceToken: Ti(),
1415
1427
  userId: B,
1416
- organizationId: St()
1428
+ organizationId: Et()
1417
1429
  });
1418
- }, be = {
1430
+ }, Se = {
1419
1431
  id: P(),
1420
1432
  role: "user",
1421
1433
  content: e,
1422
1434
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1423
1435
  metadata: {
1424
- ...t.length ? { attachments: t.map(ot) } : {},
1436
+ ...t.length ? { attachments: t.map(lt) } : {},
1425
1437
  ...n.approvalFollowUp ? {
1426
1438
  approvalFollowUp: !0,
1427
1439
  approvedReplyId: n.approvalFollowUp.approvedReplyId
1428
1440
  } : {},
1429
- ...w(n.voiceSessionId)
1441
+ ...S(n.voiceSessionId)
1430
1442
  }
1431
1443
  };
1432
- W(x, be);
1433
- let xe = n.fromPerson === !0 && t.length === 0 && n.approvalFollowUp === void 0 && ee === e ? Vr(e, r ? wi.input.code : V) : null, Ce = {
1444
+ W(y, Se);
1445
+ let Ce = n.fromPerson === !0 && t.length === 0 && n.approvalFollowUp === void 0 && te === e ? Xr(e, r ? Ni.input.code : V) : null, Te = {
1434
1446
  location: window.location.pathname + window.location.search,
1435
- conversationId: b.getState().activeConversationId,
1436
- workspaceId: D(),
1447
+ conversationId: v.getState().activeConversationId,
1448
+ workspaceId: T(),
1437
1449
  actorId: B ?? null
1438
- }, C = P();
1439
- W(x, {
1440
- id: C,
1450
+ }, x = P();
1451
+ W(y, {
1452
+ id: x,
1441
1453
  role: "assistant",
1442
1454
  content: "",
1443
1455
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1444
1456
  metadata: {
1445
- lang: Di,
1446
- ...w(n.voiceSessionId)
1457
+ lang: Ii,
1458
+ ...S(n.voiceSessionId)
1447
1459
  }
1448
- }), nn(C, {
1460
+ }), sn(x, {
1449
1461
  channel: r ? "voice" : "chat",
1450
- mode: y,
1462
+ mode: _,
1451
1463
  product: I,
1452
- language: Di,
1453
- device: rn(),
1454
- routedByAuto: !!v
1455
- }, n.voiceTiming), k(C, "accepted"), Li(x, "provisioning", C, null), ne(C);
1456
- let Te = () => {
1457
- let e = Tt({
1458
- turnId: C,
1459
- abortRequested: to.current.has(C),
1460
- activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
1461
- conversationExists: de()
1464
+ language: Ii,
1465
+ device: cn(),
1466
+ routedByAuto: !!g
1467
+ }, n.voiceTiming), D(x, "accepted"), Ki(y, "provisioning", x, null), re(x);
1468
+ let De = () => {
1469
+ let e = kt({
1470
+ turnId: x,
1471
+ abortRequested: go.current.has(x),
1472
+ activeTurnId: v.getState().processingByConversationId[y]?.messageId ?? null,
1473
+ conversationExists: pe()
1462
1474
  });
1463
- return e.abandon && ze(), e;
1464
- }, Ie = (e, t, r, i, a = !1, o = Di) => {
1465
- Fi(x, C, { content: Se(e) }), Ii(x, C, {
1475
+ return e.abandon && Ve(), e;
1476
+ }, Re = (e, t, r, i, a = !1, o = Ii) => {
1477
+ Wi(y, x, { content: we(e) }), Gi(y, x, {
1466
1478
  lang: o,
1467
1479
  ...t?.length ? { artifacts: t } : {},
1468
- ...t?.length || r || i ? { mode: y } : {},
1480
+ ...t?.length || r || i ? { mode: _ } : {},
1469
1481
  ...r ? { sessionId: r } : {},
1470
1482
  ...i ? { sandboxId: i } : {},
1471
1483
  ...a ? { incomplete: !0 } : {},
1472
- ...w(n.voiceSessionId)
1484
+ ...S(n.voiceSessionId)
1473
1485
  });
1474
- }, Le = { session: null }, T = {
1486
+ }, ze = { session: null }, C = {
1475
1487
  stream: null,
1476
1488
  render: null
1477
- }, ze = () => {
1478
- T.render?.end();
1479
- }, Be = () => {
1480
- ze(), T.stream?.close(), T.stream = null, T.render = null;
1481
- }, Ve = !1, He = () => {
1482
- Ve && (Ve = !1, Re.abort(C));
1483
- }, Ue = async (i = 1) => {
1484
- k(C, "attemptStarted");
1489
+ }, Ve = () => {
1490
+ C.render?.end();
1491
+ }, He = () => {
1492
+ Ve(), C.stream?.close(), C.stream = null, C.render = null;
1493
+ }, Ue = !1, We = () => {
1494
+ Ue && (Ue = !1, Be.abort(x));
1495
+ }, Ge = async (i = 1) => {
1496
+ D(x, "attemptStarted");
1485
1497
  let a = null, o = null, s = !1;
1486
1498
  try {
1487
- let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: m, sessionPreopened: h } = await Ya(x, C, y, S, _e, { isAbandoned: () => Tt({
1488
- turnId: C,
1489
- abortRequested: to.current.has(C),
1490
- activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
1491
- conversationExists: de()
1499
+ let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: ee, deadSandboxProbe: p, sessionPreopened: m } = await lo(y, x, _, b, ye, { isAbandoned: () => kt({
1500
+ turnId: x,
1501
+ abortRequested: go.current.has(x),
1502
+ activeTurnId: v.getState().processingByConversationId[y]?.messageId ?? null,
1503
+ conversationExists: pe()
1492
1504
  }).abandon });
1493
- if (a = i, k(C, "runtimeReady"), O(C, {
1494
- runtime: d ? "cold" : p ? "adopted" : f ? "probed" : h ? "preopened" : l ? "new-session" : "warm",
1495
- deadSandboxProbe: m
1496
- }), O(C, { session: h ? "preopened" : l ? "created" : "reused" }), o = c, Le.session = {
1505
+ if (a = i, D(x, "runtimeReady"), E(x, {
1506
+ runtime: d ? "cold" : ee ? "adopted" : f ? "probed" : m ? "preopened" : l ? "new-session" : "warm",
1507
+ deadSandboxProbe: p
1508
+ }), E(x, { session: m ? "preopened" : l ? "created" : "reused" }), o = c, ze.session = {
1497
1509
  sandboxId: i,
1498
1510
  sessionId: c
1499
- }, ae(y, re, b.getState().acknowledgedWriteModes, {
1511
+ }, se(_, ae, v.getState().acknowledgedWriteModes, {
1500
1512
  dictated: r,
1501
- confirmsWrites: he(y),
1502
- proposalBound: hi(y, i)
1503
- }) === "voice-in-write-mode") throw new Ee("voice-in-write-mode", "Voice in a write mode");
1504
- let te = Kn({
1505
- conversation: b.getState().conversations.find((e) => e.id === x),
1513
+ confirmsWrites: _e(_),
1514
+ proposalBound: wi(_, i)
1515
+ }) === "voice-in-write-mode") throw new Oe("voice-in-write-mode", "Voice in a write mode");
1516
+ let ne = Qn({
1517
+ conversation: v.getState().conversations.find((e) => e.id === y),
1506
1518
  content: e,
1507
1519
  sessionIsNew: l,
1508
- sendingMode: y,
1509
- sendingModeConfig: re,
1510
- modes: va.current,
1511
- answerText: (e) => Qt(e).text
1520
+ sendingMode: _,
1521
+ sendingModeConfig: ae,
1522
+ modes: Da.current,
1523
+ answerText: (e) => nn(e).text
1512
1524
  });
1513
- if (Be(), nr()) {
1514
- let e = tr({
1515
- mint: () => me(i, S, c, y, _e),
1516
- mark: (e) => k(C, e)
1525
+ if (He(), dr()) {
1526
+ let e = ur({
1527
+ mint: () => ge(i, b, c, _, ye),
1528
+ mark: (e) => D(x, e)
1517
1529
  });
1518
- T.stream = e, T.render = Yn({
1530
+ C.stream = e, C.render = tr({
1519
1531
  stream: e,
1520
- conversationId: x,
1521
- messageId: C,
1522
- build: (e, t) => Se(qt(e, t, { accumulateNarration: oe.accumulatesNarration }).content),
1523
- onFirstDelta: () => k(C, "firstDelta"),
1524
- onFirstVisible: () => k(C, "firstOutput")
1532
+ conversationId: y,
1533
+ messageId: x,
1534
+ build: (e, t) => we(Zt(e, t, { accumulateNarration: ce.accumulatesNarration }).content),
1535
+ onFirstDelta: () => D(x, "firstDelta"),
1536
+ onFirstVisible: () => D(x, "firstOutput")
1525
1537
  });
1526
1538
  }
1527
- let g = await Yt(() => pe(i, S, c, y, _e, { limit: 50 }), l, Jt(u, i, c));
1528
- qa(x, C, "streaming", "thinking");
1529
- let ne = ui?.(), _ = Sn(b.getState().sandboxWriteCapabilities[i]), v = J.current, ie = zr(i, c), se = v.options.uiCatalogue ? Ir(Sr(v.navItems), {
1530
- permissionsSettled: v.navPermissionsSettled,
1531
- simulating: v.navSimulating,
1532
- sentBefore: Rr(ie)
1533
- }) : null, ce = {
1534
- conversationId: x,
1535
- writeReply: _ === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
1536
- ...se ? { uiCatalogue: se } : {}
1537
- }, { prompt: le, parts: De } = _t({
1538
- content: te ? `${te}${ee}` : ee,
1539
+ let h = await $t(() => he(i, b, c, _, ye, { limit: 50 }), l, Qt(u, i, c));
1540
+ so(y, x, "streaming", "thinking");
1541
+ let re = yi?.(), ie = On(v.getState().sandboxWriteCapabilities[i]), g = J.current, oe = Jr(i, c), le = g.options.uiCatalogue ? Gr(jr(g.navItems), {
1542
+ permissionsSettled: g.navPermissionsSettled,
1543
+ simulating: g.navSimulating,
1544
+ sentBefore: qr(oe)
1545
+ }) : null, ue = {
1546
+ conversationId: y,
1547
+ writeReply: ie === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
1548
+ ...le ? { uiCatalogue: le } : {}
1549
+ }, { prompt: de, parts: ke } = bt({
1550
+ content: ne ? `${ne}${te}` : te,
1539
1551
  attachments: t,
1540
- limits: at(re),
1541
- wrapPrompt: (e) => di?.(y, e, Ti, Ei, r, { writeApproval: _ }) ?? e,
1542
- requestBytes: (e, t) => ge({
1552
+ limits: ct(ae),
1553
+ wrapPrompt: (e) => bi?.(_, e, Pi, Fi, r, { writeApproval: ie }) ?? e,
1554
+ requestBytes: (e, t) => ve({
1543
1555
  sandboxId: i,
1544
- workspaceId: S,
1556
+ workspaceId: b,
1545
1557
  sessionId: c,
1546
- mode: y,
1558
+ mode: _,
1547
1559
  prompt: e,
1548
1560
  parts: t,
1549
- pageContext: ne,
1550
- authContext: _e,
1551
- ...ce
1561
+ pageContext: re,
1562
+ authContext: ye,
1563
+ ...ue
1552
1564
  })
1553
- }), Oe = rt(De), ke = Oe > 0;
1554
- s = nt(t) > Oe;
1555
- let je = Te();
1556
- if (je.abandon) {
1557
- je.clearProcessing && Ri(x);
1565
+ }), Ae = ot(ke), je = Ae > 0;
1566
+ s = at(t) > Ae;
1567
+ let Ne = De();
1568
+ if (Ne.abandon) {
1569
+ Ne.clearProcessing && qi(y);
1558
1570
  return;
1559
1571
  }
1560
1572
  try {
1561
- await ve(i, S, c, le, y, ne, _e, De?.length ? {
1562
- parts: De,
1563
- ...ce
1564
- } : ce);
1573
+ await be(i, b, c, de, _, re, ye, ke?.length ? {
1574
+ parts: ke,
1575
+ ...ue
1576
+ } : ue);
1565
1577
  } catch (e) {
1566
- if (!De || !ln(e)) throw e;
1567
- await ve(i, S, c, le, y, ne, _e, ce), s ||= ke;
1578
+ if (!ke || !hn(e)) throw e;
1579
+ await be(i, b, c, de, _, re, ye, ue), s ||= je;
1568
1580
  }
1569
- se && Lr(ie);
1570
- let Ne = b.getState().sandboxWriteCapabilities[i], Pe = v.options.uiOffers === !0 && we(Ne) ? B : null, w = !!Pe;
1571
- Pe && X.recordTurn({
1572
- replyId: C,
1573
- conversationId: x,
1581
+ le && Kr(oe);
1582
+ let Fe = v.getState().sandboxWriteCapabilities[i], Ie = g.options.uiOffers === !0 && Ee(Fe) ? B : null, S = !!Ie;
1583
+ Ie && X.recordTurn({
1584
+ replyId: x,
1585
+ conversationId: y,
1574
1586
  sandboxId: i,
1575
1587
  sessionId: c,
1576
- mode: y,
1577
- writeCapable: re?.writeCapable === !0,
1578
- actorId: Pe,
1579
- floorMs: g
1588
+ mode: _,
1589
+ writeCapable: ae?.writeCapable === !0,
1590
+ actorId: Ie,
1591
+ floorMs: h
1580
1592
  });
1581
- let He = w ? (e, t) => {
1582
- X.receive(C, e, t, performance.now()) && Eo();
1583
- } : void 0, Ue = (e) => Fi(x, C, { content: e }), Ge = (e) => s ? `${e}\n\n${F("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}` : e;
1584
- k(C, "promptSent");
1585
- let Ke = null, qe = !1, Je = Kt, E = qt([], g);
1586
- T.render?.arm(g);
1587
- let Ye = Date.now() + oe.streamBudgetMs, Xe = Date.now(), Ze = Date.now(), Qe = rr(() => pe(i, S, c, y, _e, {
1593
+ let We = S ? (e, t) => {
1594
+ X.receive(x, e, t, performance.now()) && Bo();
1595
+ } : void 0, Ge = (e) => Wi(y, x, { content: e }), Ke = (e) => s ? `${e}\n\n${F("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}` : e;
1596
+ D(x, "promptSent");
1597
+ let Je = null, Ye = !1, Xe = Xt, w = Zt([], h);
1598
+ C.render?.arm(h);
1599
+ let Ze = Date.now() + ce.streamBudgetMs, Qe = Date.now(), $e = Date.now(), et = fr(() => he(i, b, c, _, ye, {
1588
1600
  limit: 50,
1589
- sinceMs: g,
1601
+ sinceMs: h,
1590
1602
  surfaceTurnTerminal: !0,
1591
- surfaceUiOffers: He
1592
- })), $e = T.stream?.onIdle(() => Qe.startExtra());
1593
- for (; Date.now() < Ye;) {
1594
- ye(i, c);
1595
- let e = Te();
1603
+ surfaceUiOffers: We
1604
+ })), tt = C.stream?.onIdle(() => et.startExtra());
1605
+ for (; Date.now() < Ze;) {
1606
+ xe(i, c);
1607
+ let e = De();
1596
1608
  if (e.abandon) {
1597
- e.clearProcessing && Ri(x);
1609
+ e.clearProcessing && qi(y);
1598
1610
  return;
1599
1611
  }
1600
- let t = await Qe.next();
1601
- if (w && X.observeMessages(C, t) && Eo(), E = qt(t, g, { accumulateNarration: oe.accumulatesNarration }), Fi(x, C, { content: Se(E.content) }), E.hasRenderableOutput ? qe || (qe = !0, Ke !== null && k(C, "lastQuietPoll", Ke), k(C, "firstOutput")) : Ke = on(), oe.accumulatesNarration) E.hasText && k(C, "firstText");
1612
+ let t = await et.next();
1613
+ if (S && X.observeMessages(x, t) && Bo(), w = Zt(t, h, { accumulateNarration: ce.accumulatesNarration }), Wi(y, x, { content: we(w.content) }), w.hasRenderableOutput ? Ye || (Ye = !0, Je !== null && D(x, "lastQuietPoll", Je), D(x, "firstOutput")) : Je = un(), ce.accumulatesNarration) w.hasText && D(x, "firstText");
1602
1614
  else {
1603
- let e = Zt(Je, E, on());
1604
- Je = e.tracker, e.confirmedAt !== null && k(C, "firstText", e.confirmedAt);
1615
+ let e = tn(Xe, w, un());
1616
+ Xe = e.tracker, e.confirmedAt !== null && D(x, "firstText", e.confirmedAt);
1605
1617
  }
1606
- if (E.pendingWrite && !bn(b.getState().sandboxWriteCapabilities[i]) && Ii(x, C, { pendingWrite: E.pendingWrite }), E.done && (T.stream ? O(C, {
1607
- transport: T.stream.reachedOpen ? "sse" : "poll",
1608
- live: Jn(T.stream.live)
1609
- }) : O(C, {
1618
+ if (w.pendingWrite && !En(v.getState().sandboxWriteCapabilities[i]) && Gi(y, x, { pendingWrite: w.pendingWrite }), w.done && (C.stream ? E(x, {
1619
+ transport: C.stream.reachedOpen ? "sse" : "poll",
1620
+ live: er(C.stream.live)
1621
+ }) : E(x, {
1610
1622
  transport: "poll",
1611
1623
  live: "none"
1612
- }), ze()), E.done) {
1613
- k(C, "answerDone"), K.current.markVerified(i);
1624
+ }), Ve()), w.done) {
1625
+ D(x, "answerDone"), K.current.markVerified(i);
1614
1626
  break;
1615
1627
  }
1616
- if (T.render?.refresh(t), Date.now() - Xe > 3e4 && (await ue(i, S, 600, _e).catch(() => void 0), Xe = Date.now()), !Qe.hasPending()) {
1617
- let e = We(Date.now() - Ze);
1618
- T.stream ? await T.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
1628
+ if (C.render?.refresh(t), Date.now() - Qe > 3e4 && (await fe(i, b, 600, ye).catch(() => void 0), Qe = Date.now()), !et.hasPending()) {
1629
+ let e = qe(Date.now() - $e);
1630
+ C.stream ? await C.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
1619
1631
  }
1620
1632
  }
1621
- if ($e?.(), Be(), E.done && n.voiceSessionId !== void 0 && !Te().abandon) {
1622
- let e = Se(Ge(E.content));
1623
- e.trim() && (s && Ue(e), k(C, "speechQueued"), Ve = !0, Re.publish(C, {
1624
- conversationId: x,
1633
+ if (tt?.(), He(), w.done && n.voiceSessionId !== void 0 && !De().abandon) {
1634
+ let e = we(Ke(w.content));
1635
+ e.trim() && (s && Ge(e), D(x, "speechQueued"), Ue = !0, Be.publish(x, {
1636
+ conversationId: y,
1625
1637
  channel: "voice",
1626
1638
  voiceSessionId: n.voiceSessionId,
1627
1639
  text: e,
1628
- lang: Di,
1640
+ lang: Ii,
1629
1641
  final: !0
1630
1642
  }));
1631
1643
  }
1632
- let et = oe.producesArtifacts ? await fe(i, S, c, y, _e).then((e) => e).catch(() => []) : void 0;
1633
- E.usedTools !== void 0 && O(C, { usedTools: E.usedTools }), E.done || (O(C, { outcome: "timedOut" }), E = {
1634
- ...E,
1635
- content: Fe(E.content, y, F, re)
1636
- }), s && (E = {
1637
- ...E,
1638
- content: Ge(E.content)
1644
+ let nt = ce.producesArtifacts ? await me(i, b, c, _, ye).then((e) => e).catch(() => []) : void 0;
1645
+ w.usedTools !== void 0 && E(x, { usedTools: w.usedTools }), w.done || (E(x, { outcome: "timedOut" }), w = {
1646
+ ...w,
1647
+ content: Le(w.content, _, F, ae)
1648
+ }), s && (w = {
1649
+ ...w,
1650
+ content: Ke(w.content)
1639
1651
  });
1640
- let tt = !E.done;
1641
- Ie(E.content, et, c, i, tt), E.tokens && (Fi(x, C, { tokens: E.tokens }), (pi ? await Me({
1642
- workspaceId: S,
1652
+ let rt = !w.done;
1653
+ Re(w.content, nt, c, i, rt), w.tokens && (Wi(y, x, { tokens: w.tokens }), (Si ? await Pe({
1654
+ workspaceId: b,
1643
1655
  sessionId: c,
1644
- messageId: E.messageId,
1645
- model: E.model,
1646
- tokens: E.tokens
1647
- }, pi, { ledger: Ae("panel", I) }) : { ok: !0 }).ok && Kr(I)), E.done || ye(i, c);
1648
- let it = Te();
1656
+ messageId: w.messageId,
1657
+ model: w.model,
1658
+ tokens: w.tokens
1659
+ }, Si, { ledger: Me("panel", I) }) : { ok: !0 }).ok && ti(I)), w.done || xe(i, c);
1660
+ let it = De();
1649
1661
  if (it.abandon) {
1650
- it.clearProcessing && Ri(x);
1662
+ it.clearProcessing && qi(y);
1651
1663
  return;
1652
1664
  }
1653
- k(C, "complete"), O(C, { outcome: "answered" }), Li(x, "complete", C, null), Ln.recordCommittedEntries(x, [be.id, C], "TURN", S), Ve = !1, w && xe && E.done && Io({
1654
- replyId: C,
1655
- conversationId: x,
1665
+ D(x, "complete"), E(x, { outcome: "answered" }), Ki(y, "complete", x, null), Un.recordCommittedEntries(y, [Se.id, x], "TURN", b), Ue = !1, S && Ce && w.done && Xo({
1666
+ replyId: x,
1667
+ conversationId: y,
1656
1668
  voiceSessionId: n.voiceSessionId,
1657
- intent: xe,
1658
- atSend: Ce
1669
+ intent: Ce,
1670
+ atSend: Te
1659
1671
  });
1660
1672
  } catch (e) {
1661
- K.current.invalidate(a ?? b.getState().sandboxesByMode[y]?.sandboxId ?? null);
1662
- let t = Tt({
1663
- turnId: C,
1664
- abortRequested: to.current.has(C),
1665
- activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
1666
- conversationExists: de()
1673
+ K.current.invalidate(a ?? v.getState().sandboxesByMode[_]?.sandboxId ?? null);
1674
+ let t = kt({
1675
+ turnId: x,
1676
+ abortRequested: go.current.has(x),
1677
+ activeTurnId: v.getState().processingByConversationId[y]?.messageId ?? null,
1678
+ conversationExists: pe()
1667
1679
  });
1668
- if (ze(), a && o && ye(a, o), t.abandon) {
1669
- t.clearProcessing && Ri(x);
1680
+ if (Ve(), a && o && xe(a, o), t.abandon) {
1681
+ t.clearProcessing && qi(y);
1670
1682
  return;
1671
1683
  }
1672
- if (i === 1 && un(e)) {
1673
- let e = a ?? b.getState().sandboxesByMode[y]?.sandboxId ?? null;
1674
- return e && (q.current.add(e), K.current.invalidate(e)), Bi(x), Hi(y), Pi(x, C, ""), Ii(x, C, { pendingWrite: void 0 }), e && G.retireSandbox(e), Be(), He(), an(C), Ue(2);
1684
+ if (i === 1 && gn(e)) {
1685
+ let e = a ?? v.getState().sandboxesByMode[_]?.sandboxId ?? null;
1686
+ return e && (q.current.add(e), K.current.invalidate(e)), Yi(y), Zi(_), Ui(y, x, ""), Gi(y, x, { pendingWrite: void 0 }), e && G.retireSandbox(e), He(), We(), ln(x), Ge(2);
1675
1687
  }
1676
1688
  throw e;
1677
1689
  }
1678
- }, Ge = x;
1679
- Ha.current.add(Ge);
1690
+ }, Ke = y;
1691
+ no.current.add(Ke);
1680
1692
  try {
1681
- if (!S) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1693
+ if (!b) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1682
1694
  code: "UNAUTHENTICATED",
1683
1695
  authFailure: "WORKSPACE_CONTEXT_MISSING"
1684
1696
  } });
1685
- let e = await gt(y, () => va.current.find((e) => e.id === y), _a);
1686
- re = e.config, oe = e.capabilities;
1687
- let t = re, n = Te();
1697
+ let e = await yt(_, () => Da.current.find((e) => e.id === _), Ea);
1698
+ ae = e.config, ce = e.capabilities;
1699
+ let t = ae, n = De();
1688
1700
  if (n.abandon) {
1689
- n.clearProcessing && Ri(x);
1701
+ n.clearProcessing && qi(y);
1690
1702
  return;
1691
1703
  }
1692
- let i = ae(y, t, b.getState().acknowledgedWriteModes, {
1704
+ let i = se(_, t, v.getState().acknowledgedWriteModes, {
1693
1705
  dictated: r,
1694
- confirmsWrites: he(y),
1695
- proposalBound: hi(y)
1706
+ confirmsWrites: _e(_),
1707
+ proposalBound: wi(_)
1696
1708
  });
1697
- if (i) throw new Ee(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1698
- let a = Ae("panel", I);
1699
- if (pi && je(a, S)) {
1700
- let e = await Ne(a, S, pi);
1701
- if (!e.ok) throw Pe(e.kind);
1702
- let t = Te();
1709
+ if (i) throw new Oe(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1710
+ let a = Me("panel", I);
1711
+ if (Si && Ne(a, b)) {
1712
+ let e = await Fe(a, b, Si);
1713
+ if (!e.ok) throw Ie(e.kind);
1714
+ let t = De();
1703
1715
  if (t.abandon) {
1704
- t.clearProcessing && Ri(x);
1716
+ t.clearProcessing && qi(y);
1705
1717
  return;
1706
1718
  }
1707
1719
  }
1708
- k(C, "cleared"), await Ue();
1720
+ D(x, "cleared"), await Ge();
1709
1721
  } catch (e) {
1710
- if (K.current.invalidate(b.getState().sandboxesByMode[y]?.sandboxId ?? null), !de()) {
1711
- Ri(x);
1722
+ if (K.current.invalidate(v.getState().sandboxesByMode[_]?.sandboxId ?? null), !pe()) {
1723
+ qi(y);
1712
1724
  return;
1713
1725
  }
1714
- let t = Le.session?.sandboxId ?? null, r = De(e, { confirmsNoAction: Oe({
1715
- mode: y,
1716
- capabilities: t ? b.getState().sandboxWriteCapabilities[t] : null
1726
+ let t = ze.session?.sandboxId ?? null, r = ke(e, { confirmsNoAction: Ae({
1727
+ mode: _,
1728
+ capabilities: t ? v.getState().sandboxWriteCapabilities[t] : null
1717
1729
  }) });
1718
- O(C, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && Gr(I, "sandbox");
1719
- let i = ke(r, F, { locale: V });
1720
- Li(x, "error", C, i.headline), Fi(x, C, { content: i.text }), Ii(x, C, {
1730
+ E(x, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && ei(I, "sandbox");
1731
+ let i = je(r, F, { locale: V });
1732
+ Ki(y, "error", x, i.headline), Wi(y, x, { content: i.text }), Gi(y, x, {
1721
1733
  lang: i.translated ? V : "en",
1722
- ...w(n.voiceSessionId)
1734
+ ...S(n.voiceSessionId)
1723
1735
  });
1724
1736
  } finally {
1725
- Ha.current.delete(Ge), O(C, { outcome: "stopped" }), k(C, "complete"), He(), Be();
1726
- let e = b.getState(), t = d(le, y, e.conversations.find((e) => e.id === Ge), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1727
- t && (qi(Ge, t.mode), t.backendSessionId && zi(Ge, t.backendSessionId)), Le.session && de() && G.afterTurn({
1728
- ...Le.session,
1729
- conversationId: Ge
1730
- }, C);
1731
- let n = no.current;
1732
- no.current = null, n && n.conversationId === Ge && de() && ns.current(n.content, n.attachments, n.options);
1737
+ no.current.delete(Ke), E(x, { outcome: "stopped" }), D(x, "complete"), We(), He();
1738
+ let e = v.getState(), t = d(de, _, e.conversations.find((e) => e.id === Ke), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1739
+ t && (na(Ke, t.mode), t.backendSessionId && Ji(Ke, t.backendSessionId)), ze.session && pe() && G.afterTurn({
1740
+ ...ze.session,
1741
+ conversationId: Ke
1742
+ }, x);
1743
+ let n = _o.current;
1744
+ _o.current = null, n && n.conversationId === Ke && pe() && gs.current(n.content, n.attachments, n.options);
1733
1745
  }
1734
1746
  }, [
1735
1747
  H,
1736
1748
  W,
1737
- di,
1738
- Bi,
1749
+ bi,
1750
+ Yi,
1751
+ Zi,
1752
+ Li,
1739
1753
  Hi,
1740
- Oi,
1741
- Ni,
1742
- Ya,
1754
+ lo,
1743
1755
  G,
1744
- io,
1745
- Ho,
1746
- Qo,
1756
+ yo,
1757
+ ns,
1758
+ fs,
1747
1759
  V,
1760
+ Ni,
1748
1761
  wi,
1749
- hi,
1750
- ui,
1762
+ yi,
1751
1763
  z,
1752
- gi,
1753
- Fi,
1764
+ Ti,
1765
+ Wi,
1754
1766
  I,
1755
- _a,
1756
- pi,
1757
- Ei,
1767
+ Ea,
1768
+ Si,
1769
+ Fi,
1758
1770
  V,
1759
- Di,
1760
- Ti,
1771
+ Ii,
1772
+ Pi,
1773
+ na,
1774
+ ds,
1775
+ Qo,
1776
+ $a,
1777
+ eo,
1778
+ Ji,
1779
+ Bi,
1780
+ Ki,
1761
1781
  qi,
1762
- Zo,
1763
- Ro,
1764
- za,
1765
- Ba,
1766
- zi,
1767
- ji,
1768
- Li,
1769
- Ri,
1770
1782
  F,
1771
- qa,
1772
- Pi,
1783
+ so,
1784
+ Ui,
1773
1785
  B,
1774
1786
  X,
1775
- Eo,
1776
- Vo,
1777
- Io
1778
- ]), $o = A((e, t) => {
1787
+ Bo,
1788
+ ts,
1789
+ Xo
1790
+ ]), ps = O((e, t) => {
1779
1791
  Z(e, [], t ? { autoIntent: t } : {});
1780
- }, [Z]), es = Ct(), ts = A(() => {
1781
- let e = [...Yi.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
1792
+ }, [Z]), ms = Dt(), hs = O(() => {
1793
+ let e = [...ia.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
1782
1794
  if (!e || e.metadata?.approvalFollowUp) return;
1783
- let t = H ? Va.current[H] ?? [] : [];
1784
- if (t.some((e) => vt(e, Date.now()))) {
1795
+ let t = H ? to.current[H] ?? [] : [];
1796
+ if (t.some((e) => St(e, Date.now()))) {
1785
1797
  let n = H ?? void 0;
1786
- yt(t, es).then((t) => {
1798
+ Ct(t, ms).then((t) => {
1787
1799
  Z(e.content, t, n === void 0 ? void 0 : { targetConversationId: n });
1788
1800
  });
1789
1801
  return;
1790
1802
  }
1791
1803
  Z(e.content, t);
1792
1804
  }, [
1793
- Xi,
1805
+ aa,
1794
1806
  Z,
1795
1807
  H,
1796
- es
1797
- ]), ns = M(Z);
1798
- j(() => {
1799
- ns.current = Z;
1808
+ ms
1809
+ ]), gs = j(Z);
1810
+ k(() => {
1811
+ gs.current = Z;
1800
1812
  }, [Z]);
1801
- let rs = Qr(() => {
1802
- if (Qi) return null;
1803
- for (let e = Xi.length - 1; e >= 0; --e) {
1804
- let t = Xi[e];
1813
+ let _s = A(() => {
1814
+ if (sa) return null;
1815
+ for (let e = aa.length - 1; e >= 0; --e) {
1816
+ let t = aa[e];
1805
1817
  if (t?.role !== "assistant") continue;
1806
- if (t.id === go) return null;
1807
- if (!Le(t) || to.current.has(t.id) || ze(t.id)) continue;
1808
- let n = Gt(t, Zi, F);
1818
+ if (t.id === Ao) return null;
1819
+ if (!ze(t) || go.current.has(t.id) || He(t.id)) continue;
1820
+ let n = Yt(t, oa, F);
1809
1821
  if (n.kind !== "output") return null;
1810
- let r = Qt(n.text).text.trim();
1811
- return r ? {
1812
- id: t.id,
1813
- text: r
1814
- } : null;
1822
+ let r = nn(n.text).text.trim();
1823
+ return r ? Ve(t, r, oa) : null;
1815
1824
  }
1816
1825
  return null;
1817
1826
  }, [
1818
- Xi,
1819
- Qi,
1820
- Zi,
1821
- go,
1827
+ aa,
1828
+ sa,
1829
+ oa,
1830
+ Ao,
1822
1831
  F
1823
- ]), is = Qr(() => rs ? Ge(rs.text) : null, [rs]), as = Qr(() => Yi.chat.filter((e) => e.id !== go), [Yi.chat, go]), os = b((e) => oe(e)?.sandboxId ?? null), ss = v(as, {
1824
- sessionId: Ji?.backendSessionId,
1825
- sandboxId: os,
1832
+ ]), vs = A(() => _s ? Je(_s.text) : null, [_s]), ys = A(() => ia.chat.filter((e) => e.id !== Ao), [ia.chat, Ao]), bs = v((e) => ce(e)?.sandboxId ?? null), xs = g(ys, {
1833
+ sessionId: ra?.backendSessionId,
1834
+ sandboxId: bs,
1826
1835
  nowMs: Date.now()
1827
- }), cs = y(as), ls = (e) => {
1828
- if (yn(e.metadata).length > 0) return !0;
1836
+ }), Ss = _(ys), Cs = (e) => {
1837
+ if (Tn(e.metadata).length > 0) return !0;
1829
1838
  let t = e.metadata?.sandboxId;
1830
- return bn(t ? ta[t] : null);
1831
- }, us = (e) => {
1832
- let t = yn(e.metadata);
1833
- return t.length === 0 || !H ? null : /* @__PURE__ */ N(vn, {
1839
+ return En(t ? ua[t] : null);
1840
+ }, ws = (e) => {
1841
+ let t = Tn(e.metadata);
1842
+ return t.length === 0 || !H ? null : /* @__PURE__ */ N(wn, {
1834
1843
  refs: t,
1835
1844
  conversationId: H,
1836
1845
  panel: G,
1837
- entries: na,
1838
- capabilitiesOf: (e) => ta[e],
1839
- turnInFlight: Qi,
1846
+ entries: da,
1847
+ capabilitiesOf: (e) => ua[e],
1848
+ turnInFlight: sa,
1840
1849
  tr: F,
1841
- onReview: ia.review,
1842
- retiredSandboxes: ra
1850
+ onReview: pa.review,
1851
+ retiredSandboxes: fa
1843
1852
  });
1844
- }, ds = (e) => {
1853
+ }, Ts = (e) => {
1845
1854
  if (!H) return null;
1846
1855
  let t = X.liveOffersFor(e, {
1847
1856
  registry: {
1848
- destinations: Sr(uo),
1849
- permissionsSettled: fo,
1850
- simulating: po
1857
+ destinations: jr(To),
1858
+ permissionsSettled: Eo,
1859
+ simulating: Do
1851
1860
  },
1852
1861
  actorId: B,
1853
1862
  conversationId: H,
1854
1863
  perfNow: performance.now()
1855
1864
  }), n = t[0];
1856
- return n ? /* @__PURE__ */ N(Zn, {
1865
+ return n ? /* @__PURE__ */ N(rr, {
1857
1866
  offers: t.map(({ offer: e, target: t }) => ({
1858
1867
  offerId: e.offerId,
1859
1868
  label: t.label,
1860
1869
  path: t.path
1861
1870
  })),
1862
- hint: t.length === 1 && R === "proposal-v1" ? C(n.offer, X.turnFor(e)) : "link",
1863
- onOpen: Fo
1871
+ hint: t.length === 1 && R === "proposal-v1" ? x(n.offer, X.turnFor(e)) : "link",
1872
+ onOpen: Yo
1864
1873
  }, n.offer.offerId) : null;
1865
- }, fs = (e) => e.role === "assistant" ? ds(e.id) : null;
1866
- j(() => {
1874
+ }, Es = (e) => e.role === "assistant" ? Ts(e.id) : null;
1875
+ k(() => {
1867
1876
  let e = X.nextExpiryInMs(performance.now());
1868
1877
  if (e === null) return;
1869
- let t = window.setTimeout(Eo, e + 1);
1878
+ let t = window.setTimeout(Bo, e + 1);
1870
1879
  return () => window.clearTimeout(t);
1871
1880
  }, [
1872
1881
  X,
1873
- wo,
1874
- Eo
1882
+ Ro,
1883
+ Bo
1875
1884
  ]);
1876
- let ps = ia.dialog.view ? na[ia.dialog.view.proposalId] : void 0, ms = ss?.expiresAtMs ?? null;
1877
- j(() => {
1878
- if (ms === null) return;
1879
- let e = window.setTimeout(() => eo((e) => e + 1), Math.max(0, ms - Date.now()));
1885
+ let Ds = pa.dialog.view ? da[pa.dialog.view.proposalId] : void 0, Os = xs?.expiresAtMs ?? null;
1886
+ k(() => {
1887
+ if (Os === null) return;
1888
+ let e = window.setTimeout(() => ho((e) => e + 1), Math.max(0, Os - Date.now()));
1880
1889
  return () => window.clearTimeout(e);
1881
- }, [ms, $a]);
1882
- let Q = Qr(() => Yi.voice.filter((e) => e.id !== go && (e.role === "user" || e.role === "assistant")).map((e) => ({
1890
+ }, [Os, mo]);
1891
+ let Q = A(() => ia.voice.filter((e) => e.id !== Ao && (e.role === "user" || e.role === "assistant")).map((e) => ({
1883
1892
  id: e.id,
1884
1893
  role: e.role,
1885
- text: tn(e, Zi, F),
1886
- sessionId: T(e),
1894
+ text: on(e, oa, F),
1895
+ sessionId: C(e),
1887
1896
  timestamp: e.timestamp
1888
1897
  })).filter((e) => e.text.length > 0), [
1889
- Yi.voice,
1890
- Zi,
1891
- go,
1898
+ ia.voice,
1899
+ oa,
1900
+ Ao,
1892
1901
  F
1893
- ]), hs = A(() => {
1902
+ ]), ks = O(() => {
1894
1903
  if (Q.length === 0) return;
1895
1904
  let e = /* @__PURE__ */ new Date();
1896
- jn(He(Q, {
1905
+ Ln(Ge(Q, {
1897
1906
  title: F("voiceSession.transcript", "Voice conversation"),
1898
1907
  savedAt: F("voiceSession.savedAt", "Saved"),
1899
1908
  session: F("voiceSession.sessionLabel", "Session"),
1900
1909
  earlier: F("voiceSession.earlierLabel", "Earlier"),
1901
1910
  you: F("voiceSession.speakerYou", "You"),
1902
1911
  assistant: F("voiceSession.speakerAssistant", "Assistant")
1903
- }, e), Ue(I, e), "text/markdown");
1912
+ }, e), Ke(I, e), "text/markdown");
1904
1913
  }, [
1905
1914
  I,
1906
1915
  Q,
1907
1916
  F
1908
- ]), gs = qr({ perFileChars: ka }), _s = M(gs);
1909
- _s.current = gs;
1910
- let [vs, ys] = $r(null), bs = vs === null ? null : F("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: vs });
1911
- j(() => {
1912
- if (vs === null) return;
1913
- let e = window.setTimeout(() => ys(null), ai);
1917
+ ]), As = ni({ perFileChars: Ra }), js = j(As);
1918
+ js.current = As;
1919
+ let [Ms, Ns] = M(null), Ps = Ms === null ? null : F("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: Ms });
1920
+ k(() => {
1921
+ if (Ms === null) return;
1922
+ let e = window.setTimeout(() => Ns(null), pi);
1914
1923
  return () => window.clearTimeout(e);
1915
- }, [vs]);
1916
- let xs = M(/* @__PURE__ */ new Set()), Ss = M(() => !1), $ = cn({
1917
- onSubmit: A((e, t, n, r) => {
1918
- let i = Ia.current, a = tt(i), o = () => {
1919
- let e = b.getState();
1920
- return Ye({
1921
- sessionLive: Ss.current(t),
1924
+ }, [Ms]);
1925
+ let Fs = j(/* @__PURE__ */ new Set()), Is = j(() => !1), $ = mn({
1926
+ onSubmit: O((e, t, n, r) => {
1927
+ let i = Xa.current, a = it(i), o = () => {
1928
+ let e = v.getState();
1929
+ return Qe({
1930
+ sessionLive: Is.current(t),
1922
1931
  boundAtSubmit: i,
1923
1932
  activeConversationId: e.activeConversationId,
1924
1933
  boundConversationExists: e.conversations.some((e) => e.id === a)
1925
1934
  });
1926
1935
  }, s = () => {
1927
- let i = _s.current;
1928
- xt({
1936
+ let i = js.current;
1937
+ Tt({
1929
1938
  draft: i,
1930
1939
  maySend: o,
1931
- budgetMs: bt,
1940
+ budgetMs: wt,
1932
1941
  sendTurn: (i) => {
1933
1942
  let a = {
1934
1943
  ...n,
1935
- handedOver: on()
1944
+ handedOver: un()
1936
1945
  };
1937
- ns.current(e, i, {
1946
+ gs.current(e, i, {
1938
1947
  fromPerson: !0,
1939
1948
  voiceSessionId: t,
1940
1949
  voiceTiming: a,
1941
1950
  ...r.correction ? { correctsInFlightTurn: !0 } : {}
1942
1951
  });
1943
1952
  },
1944
- announceDropped: (e) => ys(e)
1953
+ announceDropped: (e) => Ns(e)
1945
1954
  });
1946
1955
  };
1947
- if (o() && Bo.current(e, t)) {
1948
- ns.current(e, [], {
1956
+ if (o() && es.current(e, t)) {
1957
+ gs.current(e, [], {
1949
1958
  fromPerson: !0,
1950
1959
  voiceSessionId: t,
1951
1960
  voiceTiming: {
1952
1961
  ...n,
1953
- handedOver: on()
1962
+ handedOver: un()
1954
1963
  }
1955
1964
  });
1956
1965
  return;
1957
1966
  }
1958
- if (!_s.current.isBusy) {
1967
+ if (!js.current.isBusy) {
1959
1968
  s();
1960
1969
  return;
1961
1970
  }
1962
- let c = Date.now(), l = xs.current, u = window.setInterval(() => {
1963
- let e = _s.current.isBusy;
1964
- _s.current.isCommitting || e && Date.now() - c < ii || (window.clearInterval(u), l.delete(u), s());
1971
+ let c = Date.now(), l = Fs.current, u = window.setInterval(() => {
1972
+ let e = js.current.isBusy;
1973
+ js.current.isCommitting || e && Date.now() - c < fi || (window.clearInterval(u), l.delete(u), s());
1965
1974
  }, 200);
1966
1975
  l.add(u);
1967
1976
  }, []),
1968
- latestReply: rs,
1969
- language: Ke(Si, V).tag,
1970
- graceMs: vi,
1971
- onSupersede: ao,
1972
- handsFreeStreamNoticeAccepted: bi,
1973
- onAcceptHandsFreeStreamNotice: xi,
1974
- handsFreeInterrupt: yi,
1975
- onBargeIn: io
1977
+ latestReply: _s,
1978
+ language: Ye(ji, V).tag,
1979
+ graceMs: Di,
1980
+ onSupersede: bo,
1981
+ handsFreeStreamNoticeAccepted: ki,
1982
+ onAcceptHandsFreeStreamNotice: Ai,
1983
+ handsFreeInterrupt: Oi,
1984
+ onBargeIn: yo
1976
1985
  });
1977
- Ss.current = $.isCurrentSession;
1978
- let Cs = La ? Q.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : Q, ws = $.answerLocally;
1979
- j(() => {
1980
- Ko.current = ws;
1981
- }, [ws]);
1982
- let Ts = $.active, Es = Qr(() => ft(Object.values(na), H, ra), [
1983
- na,
1986
+ Is.current = $.isCurrentSession;
1987
+ let Ls = Za ? Q.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : Q, Rs = $.answerLocally;
1988
+ k(() => {
1989
+ os.current = Rs;
1990
+ }, [Rs]);
1991
+ let zs = $.active, Bs = A(() => ht(Object.values(da), H, fa), [
1992
+ da,
1984
1993
  H,
1985
- ra
1986
- ]), [Ds, Os] = $r(null);
1987
- j(() => {
1988
- Ts || Os(null);
1989
- }, [Ts]);
1990
- let ks = ia.review, As = A(() => {
1991
- let e = Es[Es.length - 1];
1994
+ fa
1995
+ ]), [Vs, Hs] = M(null);
1996
+ k(() => {
1997
+ zs || Hs(null);
1998
+ }, [zs]);
1999
+ let Us = pa.review, Ws = O(() => {
2000
+ let e = Bs[Bs.length - 1];
1992
2001
  if (!e) return;
1993
2002
  let { view: t } = e;
1994
- if (hn(t) && mn(t, ta[e.session.sandboxId]).offerConfirm) {
1995
- ks(t);
2003
+ if (xn(t) && bn(t, ua[e.session.sandboxId]).offerConfirm) {
2004
+ Us(t);
1996
2005
  return;
1997
2006
  }
1998
- Os(t.proposalId);
2007
+ Hs(t.proposalId);
1999
2008
  }, [
2000
- Es,
2001
- ta,
2002
- ks
2003
- ]), js = Ts ? lt(Es) : null, Ms = Ds ? na[Ds] : void 0, Ns = Ts && Ms && Ms.session.conversationId === H ? {
2004
- content: /* @__PURE__ */ N(vn, {
2009
+ Bs,
2010
+ ua,
2011
+ Us
2012
+ ]), Gs = zs ? ft(Bs) : null, Ks = Vs ? da[Vs] : void 0, qs = zs && Ks && Ks.session.conversationId === H ? {
2013
+ content: /* @__PURE__ */ N(wn, {
2005
2014
  refs: [{
2006
- proposalId: Ms.view.proposalId,
2007
- sandboxId: Ms.session.sandboxId,
2008
- sessionId: Ms.session.sessionId
2015
+ proposalId: Ks.view.proposalId,
2016
+ sandboxId: Ks.session.sandboxId,
2017
+ sessionId: Ks.session.sessionId
2009
2018
  }],
2010
- conversationId: Ms.session.conversationId,
2019
+ conversationId: Ks.session.conversationId,
2011
2020
  panel: G,
2012
- entries: na,
2013
- capabilitiesOf: (e) => ta[e],
2014
- turnInFlight: Qi,
2021
+ entries: da,
2022
+ capabilitiesOf: (e) => ua[e],
2023
+ turnInFlight: sa,
2015
2024
  tr: F,
2016
- onReview: ks,
2017
- retiredSandboxes: ra
2025
+ onReview: Us,
2026
+ retiredSandboxes: fa
2018
2027
  }),
2019
- closeLabel: pt(F, st.trayClose),
2020
- onClose: () => Os(null)
2021
- } : null, Ps = ia.asking, Fs = Uo?.asking === !0, Is = Wo?.asking === !0, Ls = Un(), Rs = $.holdListening;
2022
- r("assistant.transcript", Qr(() => Ts ? null : { run: () => Pa ? { status: "already" } : (Fa(!0), { status: "done" }) }, [
2023
- Ts,
2024
- Pa,
2025
- Fa
2026
- ])), r("assistant.conversation.new", Qr(() => Ts ? null : { run: () => {
2027
- let e = b.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
2028
+ closeLabel: gt(F, ut.trayClose),
2029
+ onClose: () => Hs(null)
2030
+ } : null, Js = pa.asking, Ys = rs?.asking === !0, Xs = is?.asking === !0, Zs = Yn(), Qs = $.holdListening;
2031
+ r("assistant.transcript", A(() => zs ? null : { run: () => Ua ? { status: "already" } : (Ya(!0), { status: "done" }) }, [
2032
+ zs,
2033
+ Ua,
2034
+ Ya
2035
+ ])), r("assistant.conversation.new", A(() => zs ? null : { run: () => {
2036
+ let e = v.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
2028
2037
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
2029
- } }, [Ts])), j(() => {
2030
- Rs(Ts && (Ps || Fs || Is || Ls));
2038
+ } }, [zs])), k(() => {
2039
+ Qs(zs && (Js || Ys || Xs || Zs));
2031
2040
  }, [
2032
- Ts,
2033
- Ps,
2034
- Fs,
2035
- Is,
2036
- Ls,
2037
- Rs
2041
+ zs,
2042
+ Js,
2043
+ Ys,
2044
+ Xs,
2045
+ Zs,
2046
+ Qs
2038
2047
  ]);
2039
- let zs = M(null), Bs = $.announce;
2040
- j(() => {
2041
- if (!Ts) {
2042
- zs.current = null;
2048
+ let $s = j(null), ec = $.announce;
2049
+ k(() => {
2050
+ if (!zs) {
2051
+ $s.current = null;
2043
2052
  return;
2044
2053
  }
2045
- let e = zs.current;
2054
+ let e = $s.current;
2046
2055
  if (e === null) {
2047
- zs.current = new Set(Object.keys(na));
2056
+ $s.current = new Set(Object.keys(da));
2048
2057
  return;
2049
2058
  }
2050
- for (let { view: t, session: n } of dt(Es, e)) {
2059
+ for (let { view: t, session: n } of mt(Bs, e)) {
2051
2060
  e.add(t.proposalId);
2052
- let r = ta[n.sandboxId];
2053
- if (!ct({
2061
+ let r = ua[n.sandboxId];
2062
+ if (!dt({
2054
2063
  mode: "api-calls",
2055
2064
  productWriteApproval: R,
2056
2065
  capabilities: r
2057
2066
  })) continue;
2058
- let i = mt(t, mn(t, r).offerConfirm, F), a = t.proposalId;
2059
- Bs({
2067
+ let i = _t(t, bn(t, r).offerConfirm, F), a = t.proposalId;
2068
+ ec({
2060
2069
  id: `write-readback:${a}`,
2061
2070
  text: i.text,
2062
2071
  lang: i.translated ? V : "en",
@@ -2064,290 +2073,339 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
2064
2073
  });
2065
2074
  }
2066
2075
  }, [
2067
- Ts,
2068
- Es,
2069
- na,
2070
- ta,
2076
+ zs,
2077
+ Bs,
2078
+ da,
2079
+ ua,
2071
2080
  R,
2072
2081
  F,
2073
2082
  V,
2074
- Bs,
2083
+ ec,
2075
2084
  G
2076
2085
  ]);
2077
- let Vs = M(!1);
2078
- j(() => {
2079
- Vs.current = $.active;
2080
- }, [$.active]), j(() => h((e) => {
2081
- if (!Vs.current) return !1;
2082
- let t = Ia.current;
2083
- return typeof t == "string" ? t === e : b.getState().activeConversationId === e;
2086
+ let tc = j(!1);
2087
+ k(() => {
2088
+ tc.current = $.active;
2089
+ }, [$.active]), k(() => m((e) => {
2090
+ if (!tc.current) return !1;
2091
+ let t = Xa.current;
2092
+ return typeof t == "string" ? t === e : v.getState().activeConversationId === e;
2084
2093
  }), []);
2085
- let Hs = $.start, Us = A(() => {
2086
- let e = b.getState().activeConversationId, t = Qe(Ba());
2087
- za(et(t, e)), Xa(!0, t.kind === "own"), Hs();
2094
+ let nc = $.start, rc = O(() => {
2095
+ let e = v.getState().activeConversationId, t = tt(eo());
2096
+ $a(rt(t, e)), uo(!0, t.kind === "own"), nc();
2088
2097
  }, [
2089
- za,
2090
- Xa,
2091
- Ba,
2092
- Hs
2093
- ]), Ws = Qr(() => en(Ji?.messages ?? []), [Ji?.messages]), Gs = $t(Yi.voice, Zi, F), Ks = $t(Ws, Zi, F) > 0, qs = A(() => {
2094
- let e = b.getState().activeConversationId;
2098
+ $a,
2099
+ uo,
2100
+ eo,
2101
+ nc
2102
+ ]), ic = A(() => an(ra?.messages ?? []), [ra?.messages]), ac = rn(ia.voice, oa, F), oc = rn(ic, oa, F) > 0, sc = O(() => {
2103
+ let e = v.getState().activeConversationId;
2095
2104
  if (!e || Q.length === 0) return;
2096
- let t = new Set(Ws.map((e) => e.id)), n = P();
2105
+ let t = new Set(ic.map((e) => e.id)), n = P();
2097
2106
  W(e, {
2098
2107
  id: n,
2099
2108
  role: "system",
2100
- content: Ve(Q.filter((e) => t.has(e.id)), {
2109
+ content: We(Q.filter((e) => t.has(e.id)), {
2101
2110
  intro: F("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
2102
2111
  nothing: F("voiceSession.continuedNothing", "Continued from a voice conversation."),
2103
2112
  more: (e) => F("voiceSession.continuedMore", "…and {{count}} more", { count: e })
2104
2113
  }),
2105
2114
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2106
- metadata: { continuedVoiceTurns: Gs }
2107
- }), Ln.recordCommittedEntries(e, [n], "NOTE", D()), Fa(!1), $.end();
2115
+ metadata: { continuedVoiceTurns: ac }
2116
+ }), Un.recordCommittedEntries(e, [n], "NOTE", T()), Ya(!1), $.end(), qa();
2108
2117
  }, [
2109
2118
  Q,
2110
- Gs,
2111
- Ws,
2119
+ ac,
2120
+ ic,
2112
2121
  W,
2113
2122
  F,
2114
2123
  $,
2115
- Fa
2116
- ]), Js = M({
2124
+ Ya,
2125
+ qa
2126
+ ]), cc = j({
2117
2127
  conversationId: null,
2118
2128
  count: 0
2119
2129
  });
2120
- j(() => {
2121
- $.active && (Js.current = {
2130
+ k(() => {
2131
+ $.active && (cc.current = {
2122
2132
  conversationId: H,
2123
- count: Gs
2133
+ count: ac
2124
2134
  });
2125
2135
  }, [$.active]);
2126
- let Ys = A(() => {
2127
- let e = Js.current, t = Gs > (e.conversationId === H ? e.count : 0);
2128
- $.end(), t && Fa(!0);
2136
+ let lc = O(() => {
2137
+ let e = cc.current, t = ac > (e.conversationId === H ? e.count : 0);
2138
+ $.end(), t && Ya(!0);
2129
2139
  }, [
2130
2140
  H,
2131
- Gs,
2141
+ ac,
2132
2142
  $,
2133
- Fa
2143
+ Ya
2134
2144
  ]);
2135
- j(() => {
2136
- (!ci || !Ka) && $.active && $.end();
2145
+ k(() => {
2146
+ (!_i || !oo) && $.active && $.end();
2137
2147
  }, [
2138
- ci,
2139
- Ka,
2148
+ _i,
2149
+ oo,
2140
2150
  $
2141
- ]), j(() => {
2142
- let e = Ia.current, t = tt(e), n = b.getState(), r = Ze({
2151
+ ]);
2152
+ let [uc, dc] = M(hi), fc = or({
2153
+ available: $.available,
2154
+ allowedInMode: oo,
2155
+ readOnly: ga,
2156
+ busy: sa || po !== null || va || Io,
2157
+ committing: uc.committing,
2158
+ dictating: uc.dictating
2159
+ }), pc = xt(), mc = j(!1), hc = O(() => {
2160
+ mc.current = !0, rc();
2161
+ }, [rc]);
2162
+ k(() => {
2163
+ $.active || (mc.current = !1);
2164
+ }, [$.active]), k(() => {
2165
+ Ka || !mc.current || (mc.current = !1, $.active && lc());
2166
+ }, [
2167
+ Ka,
2168
+ $.active,
2169
+ lc
2170
+ ]), k(() => {
2171
+ Ka && Ya(!1);
2172
+ }, [Ka, Ya]);
2173
+ let gc = A(() => ({
2174
+ live: $.active,
2175
+ blocked: fc === null ? null : pc.voiceStartBlocked(fc),
2176
+ impossible: sr(fc),
2177
+ start: hc
2178
+ }), [
2179
+ $.active,
2180
+ fc,
2181
+ pc,
2182
+ hc
2183
+ ]), [_c, vc] = M("mini"), yc = _i && Wa.covered !== !0 && !($.active && _c !== "mini") && !(Ua && !$.active);
2184
+ k(() => {
2185
+ let e = Xa.current, t = it(e), n = v.getState(), r = et({
2143
2186
  sessionLive: $.active,
2144
2187
  bound: e,
2145
2188
  activeConversationId: n.activeConversationId,
2146
2189
  boundConversationExists: n.conversations.some((e) => e.id === t)
2147
2190
  });
2148
- za(r.bound), r.end && $.end();
2191
+ $a(r.bound), r.end && $.end();
2149
2192
  }, [
2150
2193
  $,
2151
2194
  H,
2152
- Oi,
2153
- za
2195
+ Li,
2196
+ $a
2154
2197
  ]);
2155
- let Xs = M(Je);
2156
- j(() => {
2157
- let e = Xe(Xs.current, {
2198
+ let bc = j(w);
2199
+ k(() => {
2200
+ let e = $e(bc.current, {
2158
2201
  activeConversationId: H,
2159
- chatTurnCount: as.length,
2202
+ chatTurnCount: ys.length,
2160
2203
  voiceTurnCount: Q.length,
2161
2204
  sessionLive: $.active,
2162
- sessionBoundTo: Ia.current,
2163
- turnInFlight: Qi
2205
+ sessionBoundTo: Xa.current,
2206
+ turnInFlight: sa
2164
2207
  });
2165
- Xs.current = e.state, e.open && Fa(!0);
2208
+ bc.current = e.state, e.open && Ya(!0);
2166
2209
  }, [
2167
2210
  H,
2168
- as.length,
2211
+ ys.length,
2169
2212
  Q.length,
2170
2213
  $.active,
2171
- Qi,
2172
- Fa
2173
- ]), j(() => {
2214
+ sa,
2215
+ Ya
2216
+ ]), k(() => {
2174
2217
  if (!$.active) {
2175
- _s.current.clear(), ys(null), no.current = null;
2176
- for (let e of xs.current) window.clearInterval(e);
2177
- xs.current.clear();
2218
+ js.current.clear(), Ns(null), _o.current = null;
2219
+ for (let e of Fs.current) window.clearInterval(e);
2220
+ Fs.current.clear();
2178
2221
  }
2179
- }, [$.active]), j(() => {
2180
- let e = xs.current;
2222
+ }, [$.active]), k(() => {
2223
+ let e = Fs.current;
2181
2224
  return () => {
2182
2225
  for (let t of e) window.clearInterval(t);
2183
2226
  e.clear();
2184
2227
  };
2185
- }, []), j(() => {
2186
- let e = b.getState().consumePendingPrompt();
2187
- return e && ns.current(e), b.subscribe((e, t) => {
2228
+ }, []), k(() => {
2229
+ let e = v.getState().consumePendingPrompt();
2230
+ return e && gs.current(e), v.subscribe((e, t) => {
2188
2231
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
2189
- let e = b.getState().consumePendingPrompt();
2190
- e && ns.current(e);
2232
+ let e = v.getState().consumePendingPrompt();
2233
+ e && gs.current(e);
2191
2234
  }
2192
2235
  });
2193
2236
  }, []);
2194
- let Zs = A((e) => {
2195
- let t = H ? b.getState().conversations.find((e) => e.id === H) : void 0;
2196
- if (t && t.mode !== e && G.withdraw(t.id, "mode_switched"), t && Mn(t)) {
2237
+ let xc = O((e) => {
2238
+ let t = H ? v.getState().conversations.find((e) => e.id === H) : void 0;
2239
+ if (t && t.mode !== e && G.withdraw(t.id, "mode_switched"), t && Rn(t)) {
2197
2240
  if (t.mode !== e) {
2198
- let t = m(), n = b.getState().conversations.find((n) => n.mode === e && Fn(n, t) && !b.getState().processingByConversationId[n.id]);
2199
- n ? Mi(n.id) : Ni(void 0, e);
2241
+ let t = p(), n = v.getState().conversations.find((n) => n.mode === e && Vn(n, t) && !v.getState().processingByConversationId[n.id]);
2242
+ n ? Vi(n.id) : Hi(void 0, e);
2200
2243
  }
2201
- } else H && ji(H, e);
2202
- let n = b.getState().activeConversationId;
2203
- n ? ji(n, e) : Ki(!1), Ai(e);
2244
+ } else H && Bi(H, e);
2245
+ let n = v.getState().activeConversationId;
2246
+ n ? Bi(n, e) : ta(!1), zi(e);
2204
2247
  }, [
2205
2248
  H,
2206
- Ni,
2207
- Mi,
2208
- Ki,
2209
- ji,
2210
- Ai,
2249
+ Hi,
2250
+ Vi,
2251
+ ta,
2252
+ Bi,
2253
+ zi,
2211
2254
  G
2212
- ]), Qs = A(() => {
2213
- let e = b.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
2255
+ ]), Sc = O(() => {
2256
+ let e = v.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
2214
2257
  if (!t) {
2215
- Ki(!0), Ai(c);
2258
+ ta(!0), zi(c);
2216
2259
  return;
2217
2260
  }
2218
2261
  if (t.routedBy === "auto") {
2219
- Ki(!0);
2262
+ ta(!0);
2220
2263
  return;
2221
2264
  }
2222
- if (!Mn(t)) {
2223
- qi(t.id, c);
2265
+ if (!Rn(t)) {
2266
+ na(t.id, c);
2224
2267
  return;
2225
2268
  }
2226
2269
  G.withdraw(t.id, "mode_switched");
2227
- let n = m(), r = e.conversations.find((t) => t.routedBy === "auto" && Fn(t, n) && !e.processingByConversationId[t.id]);
2228
- r ? (Mi(r.id), qi(r.id, c)) : Ni(void 0, c, { routedBy: "auto" });
2270
+ let n = p(), r = e.conversations.find((t) => t.routedBy === "auto" && Vn(t, n) && !e.processingByConversationId[t.id]);
2271
+ r ? (Vi(r.id), na(r.id, c)) : Hi(void 0, c, { routedBy: "auto" });
2229
2272
  }, [
2230
- Ni,
2231
- qi,
2232
- Mi,
2233
- Ki,
2234
- Ai,
2273
+ Hi,
2274
+ na,
2275
+ Vi,
2276
+ ta,
2277
+ zi,
2235
2278
  G
2236
- ]), $s = A((e) => {
2237
- if (L.find((t) => t.id === e)?.writeCapable && !ie(b.getState().acknowledgedWriteModes, e)) {
2238
- ja(e);
2279
+ ]), Cc = O((e) => {
2280
+ if (L.find((t) => t.id === e)?.writeCapable && !oe(v.getState().acknowledgedWriteModes, e)) {
2281
+ Ba(e);
2239
2282
  return;
2240
2283
  }
2241
- Zs(e);
2242
- }, [Zs, L]), ec = A(() => {
2243
- let e = Aa;
2244
- if (ja(null), !e) return;
2245
- let t = Da.current;
2246
- if (Da.current = null, t) {
2247
- Wi(e), Z(t.content, t.attachments, t.options);
2284
+ xc(e);
2285
+ }, [xc, L]), wc = O(() => {
2286
+ let e = za;
2287
+ if (Ba(null), !e) return;
2288
+ let t = Ia.current;
2289
+ if (Ia.current = null, t) {
2290
+ $i(e), Z(t.content, t.attachments, t.options);
2248
2291
  return;
2249
2292
  }
2250
- Wi(e), Zs(e);
2293
+ $i(e), xc(e);
2251
2294
  }, [
2252
- Aa,
2253
- Wi,
2254
- Zs,
2295
+ za,
2296
+ $i,
2297
+ xc,
2255
2298
  Z
2256
- ]), tc = Aa === null ? void 0 : L.find((e) => e.id === Aa) ?? { id: Aa }, nc = A(() => {
2257
- ja(null);
2258
- let e = Da.current;
2259
- Da.current = null, e && Z(e.content, e.attachments, {
2299
+ ]), Tc = za === null ? void 0 : L.find((e) => e.id === za) ?? { id: za }, Ec = O(() => {
2300
+ Ba(null);
2301
+ let e = Ia.current;
2302
+ Ia.current = null, e && Z(e.content, e.attachments, {
2260
2303
  ...e.options,
2261
2304
  autoIntent: "read"
2262
2305
  });
2263
2306
  }, [Z]);
2264
- return /* @__PURE__ */ ti("div", {
2307
+ return /* @__PURE__ */ li("div", {
2265
2308
  className: "relative flex flex-1 flex-col overflow-hidden",
2266
2309
  children: [
2267
- /* @__PURE__ */ ti("div", {
2310
+ /* @__PURE__ */ li("div", {
2268
2311
  className: "contents",
2269
- inert: $.active || void 0,
2312
+ inert: $.active || Ka || void 0,
2313
+ ...Wa.ids ? {
2314
+ role: "tabpanel",
2315
+ id: Wa.ids.chatPanel,
2316
+ "aria-labelledby": Wa.ids.chatTab
2317
+ } : {},
2270
2318
  children: [
2271
- ma === null ? null : /* @__PURE__ */ N(En, { onDismiss: () => pa(ma) }),
2272
- Q.length > 0 && !$.active ? /* @__PURE__ */ N(wn, {
2319
+ Ca === null ? null : /* @__PURE__ */ N(Mn, { onDismiss: () => Sa(Ca) }),
2320
+ Q.length > 0 && !$.active ? /* @__PURE__ */ N(An, {
2273
2321
  count: Q.length,
2274
- onOpenTranscript: () => Fa(!0)
2322
+ onOpenTranscript: () => Ya(!0)
2275
2323
  }) : null,
2276
- as.length === 0 && (la || ua) ? /* @__PURE__ */ N(Dn, {
2277
- state: la ? "loading" : "failed",
2278
- onRetry: ya
2279
- }) : as.length === 0 && Ji?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
2324
+ ys.length === 0 && (va || ya) ? /* @__PURE__ */ N(Nn, {
2325
+ state: va ? "loading" : "failed",
2326
+ onRetry: Oa
2327
+ }) : ys.length === 0 && ra?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
2280
2328
  className: "flex min-h-0 flex-1 flex-col",
2281
- children: /* @__PURE__ */ N(kn, {
2282
- onShowEarlier: ba,
2283
- disabled: la
2329
+ children: /* @__PURE__ */ N(Fn, {
2330
+ onShowEarlier: ka,
2331
+ disabled: va
2284
2332
  })
2285
- }) : as.length === 0 ? /* @__PURE__ */ N(Rn, {
2333
+ }) : ys.length === 0 ? /* @__PURE__ */ N(Wn, {
2286
2334
  mode: U,
2287
- onSuggestionClick: $o,
2288
- explainsAuto: Ta,
2289
- suggestions: Ta && U === "assistant" ? l(L.find((e) => e.id === "assistant")?.suggestions ?? [], L.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2290
- }) : /* @__PURE__ */ ti("div", {
2335
+ onSuggestionClick: ps,
2336
+ explainsAuto: Pa,
2337
+ suggestions: Pa && U === "assistant" ? l(L.find((e) => e.id === "assistant")?.suggestions ?? [], L.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2338
+ }) : /* @__PURE__ */ li("div", {
2291
2339
  className: "flex min-h-0 flex-1 flex-col",
2292
- children: [Ji?.sync?.hasOlder ? /* @__PURE__ */ N(kn, {
2293
- onShowEarlier: ba,
2294
- disabled: la
2295
- }) : null, /* @__PURE__ */ N(Xn, {
2296
- onApprovePendingWrite: oo,
2297
- approvingWriteRef: Qa,
2298
- approvableMessageId: ss?.messageId ?? null,
2299
- retryableMessageId: cs,
2300
- messages: as,
2301
- processing: Zi ?? null,
2302
- streamingMessageId: $i,
2303
- failedMessageId: ea,
2304
- onRetry: Qa === null ? ts : void 0,
2305
- renderWriteProposals: us,
2306
- hidesLegacyWriteCard: ls,
2307
- renderUiOffers: fs
2340
+ children: [ra?.sync?.hasOlder ? /* @__PURE__ */ N(Fn, {
2341
+ onShowEarlier: ka,
2342
+ disabled: va
2343
+ }) : null, /* @__PURE__ */ N(nr, {
2344
+ onApprovePendingWrite: xo,
2345
+ approvingWriteRef: po,
2346
+ approvableMessageId: xs?.messageId ?? null,
2347
+ retryableMessageId: Ss,
2348
+ messages: ys,
2349
+ processing: oa ?? null,
2350
+ streamingMessageId: ca,
2351
+ failedMessageId: la,
2352
+ onRetry: po === null ? hs : void 0,
2353
+ renderWriteProposals: ws,
2354
+ hidesLegacyWriteCard: Cs,
2355
+ renderUiOffers: Es
2308
2356
  })]
2309
2357
  }),
2310
- sa ? /* @__PURE__ */ N(On, { onStartNew: () => Ni() }) : null,
2311
- ca && H ? /* @__PURE__ */ N(Tn, { onUnarchive: () => Ln.updateConversation(H, { archived: !1 }) }) : null,
2312
- qo === null ? null : /* @__PURE__ */ N(zn, {
2358
+ ga ? /* @__PURE__ */ N(Pn, { onStartNew: () => Hi() }) : null,
2359
+ _a && H ? /* @__PURE__ */ N(jn, { onUnarchive: () => Un.updateConversation(H, { archived: !1 }) }) : null,
2360
+ ss === null ? null : /* @__PURE__ */ N(Gn, {
2313
2361
  tr: F,
2314
- onDismiss: () => Jo(null)
2362
+ onDismiss: () => cs(null)
2315
2363
  }),
2316
- as.length > 0 && (la || ua) ? /* @__PURE__ */ N(Dn, {
2317
- state: la ? "loading" : "failed",
2318
- onRetry: ya,
2364
+ ys.length > 0 && (va || ya) ? /* @__PURE__ */ N(Nn, {
2365
+ state: va ? "loading" : "failed",
2366
+ onRetry: Oa,
2319
2367
  compact: !0
2320
2368
  }) : null,
2321
- /* @__PURE__ */ N(Jr, {
2322
- onStartVoiceSession: $.available && Ka ? Us : void 0,
2369
+ /* @__PURE__ */ N(ri, {
2370
+ onStartVoiceSession: $.available && oo ? rc : void 0,
2323
2371
  onSend: (e, t) => void Z(e, t, { fromPerson: !0 }),
2324
- onDraftStart: Za,
2325
- disabled: Qi || Qa !== null || la || So,
2326
- readOnly: sa,
2372
+ onDraftStart: fo,
2373
+ disabled: sa || po !== null || va || Io,
2374
+ readOnly: ga,
2327
2375
  placeholder: U === "api-calls" ? F("chatArea.placeholderActions", "What would you like me to do?") : F("chatArea.placeholderGeneral", "Ask me anything…"),
2328
2376
  mode: U,
2329
- writeAccessDenied: li === "denied" && !!Ua?.writeCapable,
2330
- availableModes: Ca,
2331
- attachmentCharsPerFile: ka,
2332
- onModeChange: $s,
2333
- auto: wa ? {
2334
- active: Ta,
2335
- onSelect: Qs
2336
- } : void 0
2377
+ writeAccessDenied: vi === "denied" && !!ro?.writeCapable,
2378
+ availableModes: Ma,
2379
+ attachmentCharsPerFile: Ra,
2380
+ onModeChange: Cc,
2381
+ auto: Na ? {
2382
+ active: Pa,
2383
+ onSelect: Sc
2384
+ } : void 0,
2385
+ suspendDictation: Ka,
2386
+ onVoiceStateChange: Wa.ids ? dc : void 0
2337
2387
  })
2338
2388
  ]
2339
2389
  }),
2340
- Pa && !$.active ? /* @__PURE__ */ N(An, {
2390
+ Ua && !$.active ? /* @__PURE__ */ N(In, {
2341
2391
  turns: Q,
2342
- onClose: () => Fa(!1),
2343
- onSave: hs,
2344
- onContinueInChat: Ks ? qs : void 0,
2392
+ onClose: () => Ya(!1),
2393
+ onSave: ks,
2394
+ onContinueInChat: oc ? sc : void 0,
2345
2395
  closeOnEscape: !0,
2346
- onShowEarlier: Ji?.sync?.hasOlder ? ba : void 0,
2347
- showEarlierDisabled: la,
2348
- renderAfterTurn: ds
2396
+ onShowEarlier: ra?.sync?.hasOlder ? ka : void 0,
2397
+ showEarlierDisabled: va,
2398
+ renderAfterTurn: Ts
2399
+ }) : null,
2400
+ Ka && Ga && Wa.ids ? /* @__PURE__ */ N(ar, {
2401
+ tab: Ga,
2402
+ id: Wa.ids.avatarPanel,
2403
+ labelledBy: Wa.ids.avatarTab,
2404
+ leaveHintId: Wa.ids.leaveHint,
2405
+ shown: yc,
2406
+ voice: gc
2349
2407
  }) : null,
2350
- $.active && /* @__PURE__ */ N(Qn, {
2408
+ $.active && /* @__PURE__ */ N(ir, {
2351
2409
  session: $.session,
2352
2410
  notice: $.notice,
2353
2411
  privacyNotice: $.handsFree.privacyNotice,
@@ -2358,49 +2416,50 @@ var ci = ({ visible: ci = !0, writeAccess: li = "unknown" }) => {
2358
2416
  correcting: $.correcting,
2359
2417
  onLetMeFinish: $.letMeFinish,
2360
2418
  onImDone: $.imDone,
2361
- turns: Cs,
2419
+ turns: Ls,
2362
2420
  spokenChunks: $.spokenChunks,
2363
- attachments: gs.attachments,
2364
- onAttachFiles: gs.addFiles,
2365
- onRemoveAttachment: gs.remove,
2366
- onRetryAttachment: gs.retry,
2367
- canAttachMore: gs.canAddMore,
2368
- preparingAttachments: gs.preparingCount,
2369
- attachmentsLocked: gs.isCommitting,
2370
- attachmentNotice: bs,
2371
- onSaveTranscript: hs,
2372
- onContinueInChat: qs,
2421
+ attachments: As.attachments,
2422
+ onAttachFiles: As.addFiles,
2423
+ onRemoveAttachment: As.remove,
2424
+ onRetryAttachment: As.retry,
2425
+ canAttachMore: As.canAddMore,
2426
+ preparingAttachments: As.preparingCount,
2427
+ attachmentsLocked: As.isCommitting,
2428
+ attachmentNotice: Ps,
2429
+ onSaveTranscript: ks,
2430
+ onContinueInChat: sc,
2373
2431
  onInterrupt: () => {
2374
- $.interrupt(), io();
2432
+ $.interrupt(), yo();
2375
2433
  },
2376
- spoken: is,
2434
+ spoken: vs,
2377
2435
  onToggleMute: $.toggleMute,
2378
- onEnd: Ys,
2379
- proposalChip: js ? {
2380
- label: ut(js, F),
2381
- onOpen: As
2436
+ onEnd: lc,
2437
+ proposalChip: Gs ? {
2438
+ label: pt(Gs, F),
2439
+ onOpen: Ws
2382
2440
  } : null,
2383
- proposalTray: Ns,
2384
- renderAfterTurn: ds
2441
+ proposalTray: qs,
2442
+ renderAfterTurn: Ts,
2443
+ onViewChange: Wa.ids ? vc : void 0
2385
2444
  }),
2386
- /* @__PURE__ */ N(Xr, {
2387
- open: Aa !== null,
2388
- mode: tc,
2389
- currentMode: Ua ?? { id: U },
2390
- onConfirm: ec,
2391
- onCancel: nc
2445
+ /* @__PURE__ */ N(ai, {
2446
+ open: za !== null,
2447
+ mode: Tc,
2448
+ currentMode: ro ?? { id: U },
2449
+ onConfirm: wc,
2450
+ onCancel: Ec
2392
2451
  }),
2393
- /* @__PURE__ */ N(gn, {
2394
- ...ia.dialog,
2395
- view: ps?.view ?? ia.dialog.view,
2396
- serverNow: ps?.serverNow ?? NaN,
2397
- arrivedAt: ps?.arrivedAt ?? NaN,
2398
- capabilities: ps ? ta[ps.session.sandboxId] : null,
2399
- turnInFlight: Qi,
2452
+ /* @__PURE__ */ N(Sn, {
2453
+ ...pa.dialog,
2454
+ view: Ds?.view ?? pa.dialog.view,
2455
+ serverNow: Ds?.serverNow ?? NaN,
2456
+ arrivedAt: Ds?.arrivedAt ?? NaN,
2457
+ capabilities: Ds ? ua[Ds.session.sandboxId] : null,
2458
+ turnInFlight: sa,
2400
2459
  tr: F
2401
2460
  })
2402
2461
  ]
2403
2462
  });
2404
2463
  };
2405
2464
  //#endregion
2406
- export { ci as AssistantChatArea };
2465
+ export { _i as AssistantChatArea };