@burdenoff/fe-libs 2026.1014.5 → 2026.1015.1

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