@burdenoff/fe-libs 2026.1117.3 → 2026.1117.4

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 (30) hide show
  1. package/dist/shared/assistant/i18nManifest.d.ts +21 -1
  2. package/dist/shared/assistant/i18nManifest.js +22 -2
  3. package/dist/shared/assistant/index.d.ts +8 -0
  4. package/dist/shared/assistant/ui/AIAssistantPanel.js +195 -194
  5. package/dist/shared/assistant/ui/AssistantChatArea.js +1339 -1332
  6. package/dist/shared/assistant/ui/compact/AssistantLanguagePill.d.ts +12 -0
  7. package/dist/shared/assistant/ui/compact/AssistantLanguagePill.js +13 -14
  8. package/dist/shared/assistant/ui/compact/AssistantWindowHeader.d.ts +8 -2
  9. package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +45 -39
  10. package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.d.ts +44 -0
  11. package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.js +110 -0
  12. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.d.ts +29 -0
  13. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.js +84 -0
  14. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.d.ts +15 -0
  15. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.js +64 -0
  16. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.d.ts +12 -0
  17. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.js +31 -0
  18. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.d.ts +9 -0
  19. package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.js +37 -0
  20. package/dist/shared/assistant/ui/compact/windowTitle.d.ts +15 -0
  21. package/dist/shared/assistant/ui/compact/windowTitle.js +13 -0
  22. package/dist/shared/assistant/ui/compact/windowWelcome.d.ts +136 -0
  23. package/dist/shared/assistant/ui/compact/windowWelcome.js +119 -0
  24. package/dist/shared/assistant/ui/compact/windowWelcomeHooks.d.ts +49 -0
  25. package/dist/shared/assistant/ui/compact/windowWelcomeHooks.js +70 -0
  26. package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts +3 -1
  27. package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +27 -26
  28. package/dist/shared-assistant.js +29 -21
  29. package/package.json +2 -1
  30. package/src/shared/tokens/tokens.css +523 -0
@@ -20,320 +20,321 @@ import { planWriteReply as se, promptWriteApproval as ce } from "../writeReplySe
20
20
  import { isAssistantModeId as y } from "../modeIds.js";
21
21
  import { AUTO_READ_MODE as b, autoSuggestions as le, classifyAssistantIntent as ue, escalationToUndo as de, isAutoRoutingOffered as fe, resolveAutoRoute as pe } from "../autoRouting.js";
22
22
  import { AssistantEmptyState as me } from "./AssistantEmptyState.js";
23
- import { AssistantSpokenTurnsNotice as he } from "./AssistantSpokenTurnsNotice.js";
24
- import { AssistantHistoryArchivedNotice as x, AssistantHistoryDeletedNotice as ge, AssistantHistoryLoadState as _e, AssistantHistoryPinLimitBanner as ve, AssistantHistoryReadOnlyBanner as S, AssistantHistoryShowEarlier as ye } from "./AssistantHistoryNotices.js";
25
- import { useAssistantPageChatManaged as be } from "./assistantPageBar.js";
26
- import { AssistantNothingToDeleteNotice as xe } from "./AssistantDeleteConversationDialog.js";
27
- import { useConversationDeleteDialog as Se } from "./conversationDeleteDialog.js";
28
- import { assistantHistoryIsOn as Ce } from "./conversationDelete.js";
29
- import { VoiceTranscriptDrawer as we } from "./voice/VoiceTranscriptDrawer.js";
30
- import { AssistantComposer as Te } from "./composer/AssistantComposer.js";
31
- import { assistantModeOptionName as Ee } from "./composer/AssistantModeMenu.js";
32
- import { draftIsUnsent as De } from "./compact/compactChrome.js";
33
- import { AssistantWaitingChangeRow as Oe } from "./compact/AssistantWaitingChangeRow.js";
34
- import { voiceStartedCueShows as ke } from "../voice/voiceStartedCue.js";
35
- import { countWaitingChanges as Ae, focusFirstWaitingCard as je } from "./compact/waitingChange.js";
36
- import { planModeSwitch as Me } from "./composer/modeSwitchPlan.js";
37
- import { AssistantAiDisclaimer as Ne } from "./AssistantAiDisclaimer.js";
38
- import { AssistantCompactFooter as Pe } from "./composer/AssistantCompactFooter.js";
39
- import { AiCreditBalance as Fe } from "./AiCreditBalance.js";
40
- import { AssistantVoiceSession as Ie } from "./voice/AssistantVoiceSession.js";
41
- import { AssistantAvatarTab as Le } from "./avatar/AssistantAvatarTab.js";
42
- import { AssistantCompactAvatar as Re } from "./avatar/AssistantCompactAvatar.js";
43
- import { AssistantViewSwitch as ze } from "./compact/AssistantViewSwitch.js";
44
- import { AssistantViewSwitchDock as Be } from "./compact/AssistantViewSwitchDock.js";
45
- import { useAssistantPageLayout as Ve } from "./assistantPageLayout.js";
46
- import { assistantPageStartShows as He, setAssistantPageStartSlot as Ue, useAssistantPageStartOffered as We } from "./assistantPageStart.js";
47
- import { useLiveAvatarTab as Ge, useLiveAvatarTabSeam as Ke } from "./assistantLiveAvatarSeam.js";
48
- import { useAvatarCopy as C } from "../avatar/useAvatarCopy.js";
49
- import { voiceStartBlocker as qe, voiceStartBlockerLasts as Je } from "./voice/voiceStartGate.js";
50
- import { avatarAskBlocker as Ye, avatarAskWrites as Xe, avatarTabAskLine as Ze } from "./avatar/avatarAskGate.js";
51
- import { createAvatarTabDraft as Qe } from "./avatar/avatarTabDraft.js";
52
- import { parseToolActivity as $e } from "./AssistantToolActivity.js";
53
- import { useVoiceSession as et } from "./useVoiceSession.js";
54
- import { useAssistantApiAccess as tt } from "../useAssistantApiAccess.js";
55
- import { useAssistantAttachments as nt } from "../useAssistantAttachments.js";
56
- import { useAttachmentUrlResolver as rt } from "../useAttachmentCommitter.js";
57
- import { VOICE_COMMIT_BUDGET_MS as it, settleAndCommitSpokenTurn as at } from "../voiceCommit.js";
58
- import { attachmentUrlIsStale as ot, refreshStaleAttachmentUrls as st } from "../attachmentCommit.js";
59
- import { useConversationTurns as ct } from "../useConversationTurns.js";
60
- import { resolveActiveModeSandbox as lt, useAssistantStore as w } from "../store.js";
61
- import { abortAssistantTurn as ut, approvePendingWrite as dt, createAssistantSandbox as ft, createAssistantSession as pt, findExistingSandboxWithStatus as mt, getAssistantArtifacts as ht, getAssistantMessages as gt, getAssistantSession as _t, mintAssistantTurnStream as vt, modeRequiresConfirmWrites as yt, postClientToolResult as bt, promptGatewayRequestBytes as xt, releaseSupersededAssistantSandboxes as St, sendAssistantPromptAsync as Ct, waitForAssistantServiceReady as wt, waitForSandboxRunning as Tt, writeApprovalModeOf as Et } from "../api.js";
62
- import { createClientToolRunner as Dt, offerClientTools as Ot } from "../../agent-tools/adapters/assistant.js";
63
- import { sanitize as kt } from "../progress.js";
64
- import { createSandboxBusyGate as At, gateDoneOnSandboxBusy as jt } from "../sandboxBusy.js";
65
- import { speechFeed as Mt } from "../speech/speechFeed.js";
66
- import { requestReplyOnAvatar as Nt } from "../speech/replySpeechRequests.js";
67
- import { isTurnSuperseded as Pt, markTurnSuperseded as Ft } from "../voice/supersededTurns.js";
68
- import { NO_FIRST_TEXT as It, buildAssistantProgress as Lt, readAheadFor as Rt, rememberSessionFloor as zt, snapshotReplyFloor as Bt, startSessionReadAhead as Vt, takeRememberedSessionFloor as Ht, trackFirstText as Ut } from "../turnProgress.js";
69
- import { getOrganizationId as Wt, getWorkspaceId as T } from "../context.js";
70
- import { dispatchAssistantQuotaExhausted as Gt, notifyAiCreditsUpdated as Kt } from "../aiCredits.js";
71
- import { AssistantSendRefusal as qt, classifyTurnFailure as Jt, turnConfirmsNoAction as Yt, turnOutcomeCopy as Xt } from "../turnOutcome.js";
72
- import { QuarantineSet as Zt, WarmCancelled as Qt, claimPreopenedSession as $t, consumeWarm as en, preopenKey as tn, preopenWanted as nn, prewarmTarget as rn, settleWarmBeforeSend as an, startPreopen as on, startWarm as sn, warmState as cn, withWarmProofs as ln } from "../prewarm.js";
73
- import { beginTurn as un, describeTurn as dn, detectTurnDevice as fn, markTurn as E, restartAttempt as pn, turnClockMs as mn } from "../turnTimeline.js";
74
- import { sendAssistantTurnTimings as hn, startTurnTimingReporting as gn } from "../turnTimingReporter.js";
75
- import { countInlineImageCandidates as _n, countInlinedImageParts as vn, largestInlineCharsPerFile as yn, resolveAssistantInlineLimits as bn, toMessageAttachment as xn } from "../attachments.js";
76
- import { buildBoundedAttachmentTurn as Sn } from "../attachmentTurn.js";
77
- import { assistantUsageLedger as Cn, hasPendingUsageReports as wn, reportUsageInBackground as Tn, retryPendingUsageReports as En, settleInFlightUsageReports as Dn, usageSendRefusal as On } from "../usageReporting.js";
78
- import { isMultimodalBodyRejection as kn, isRecoverableAssistantError as An } from "../transportErrors.js";
79
- import { isTurnInFlight as jn, planAbandonedTurn as Mn, planTurnAbort as Nn } from "../turnState.js";
80
- import { useAssistantTr as Pn } from "../i18n.js";
81
- import { isProdRuntime as Fn } from "../env.js";
82
- import { useAssistantProduct as In } from "../product.js";
83
- import { pollDelayMs as Ln } from "../voice/assistantPollSchedule.js";
84
- import { holdAssistantActivity as Rn } from "../keepAlive.js";
85
- import { StaleSessionRestart as zn, isStaleSessionRefusal as Bn } from "../staleSession.js";
86
- import { noteAssistantTurnSent as Vn } from "../signInWarm.js";
87
- import { keepAssistantSandboxAlive as Hn } from "../useAssistantHeartbeat.js";
88
- import { liveCoverage as Un } from "../liveDeltas.js";
89
- import { phraseSpeechEnabled as Wn } from "../voice/phraseSpeechConfig.js";
90
- import { createLivePhraseSpeech as Gn } from "../voice/livePhraseSpeech.js";
91
- import { createLiveRender as Kn } from "../liveOverlay.js";
92
- import { createSnapshotPoller as qn } from "../snapshotPoller.js";
93
- import { openTurnStream as Jn, turnStreamAvailable as Yn } from "../turnStream.js";
94
- import { withIncompleteTurnNotice as Xn } from "../streamBudget.js";
95
- import { isWriteModeAcknowledged as Zn, writeModeSendRefusalReason as Qn } from "../writeModeConsent.js";
96
- import { createAdminModeAccessGate as $n, resolveAssistantSendModeAfterAccess as er } from "../adminModeSendGate.js";
97
- import { getAssistantDisplayContent as tr } from "../displayContent.js";
98
- import { countSpokenTurns as nr, spokenMessagesSinceContinueNote as rr, spokenTurnText as ir } from "../spokenTurns.js";
99
- import { toCaptionText as ar } from "../voice/captionText.js";
100
- import { buildContinuedFromVoiceNote as or, buildVoiceTranscriptMarkdown as sr, voiceTranscriptFilename as cr } from "../voice/voiceTranscript.js";
101
- import { downloadFile as lr } from "../exportConversation.js";
102
- import { chatTurns as ur, isVoiceTurn as dr, voiceMarker as fr, voiceSessionIdOf as pr } from "../voice/turnVisibility.js";
103
- import { VoiceChatEnded as mr, VoiceTurnTag as hr } from "./voice/VoiceTurnMarks.js";
104
- import { revealSpokenMarkdown as gr } from "../voice/revealSpoken.js";
105
- import { isAwaitingOwnConversation as _r, maySendSpokenTurn as vr, planTranscriptAutoOpen as yr, planVoiceSessionBinding as br, planVoiceSessionStart as xr, planVoiceSpokenEntry as Sr, voiceBindingAtStart as Cr, voiceBindingConversationId as wr } from "../voice/voiceReopen.js";
106
- import { transcriptAutoOpenSlot as Tr } from "./transcriptAutoOpenSlot.js";
107
- import { toVoiceReply as Er } from "../voice/voiceReply.js";
108
- import { beginApprovalInFlight as Dr, endApprovalInFlight as Or, getApprovalInFlight as kr, markLiveTurn as Ar, newestModelReplyId as jr, resolveApprovablePendingWrite as Mr, resolveRetryableMessageId as Nr, subscribeApprovalInFlight as Pr } from "../liveTurns.js";
109
- import { createReadinessTracker as Fr, planAfterTransportFailure as Ir, planTrustedSandboxFailure as Lr } from "../sandboxReadiness.js";
110
- import { couldBeLocalUiCommand as Rr, isAlreadyThere as zr, matchLocalUiCommand as Br, mayBeNavigationFollowUp as Vr, navDestinations as Hr, planThemeChange as Ur } from "../localUiCommands.js";
111
- import { backDoneCopy as Wr, chooseDestinationCopy as Gr, chooseLinkedCopy as Kr, entityNounText as qr, linkNotOpenableCopy as Jr, navigationCommandCopy as Yr, navigationOutcomeCopy as Xr, offerExpiredCopy as Zr, offerKeptForUnsavedCopy as Qr, offerNotAvailableCopy as $r, pickFromListCopy as ei, recordChoiceCopy as ti, recordKindsCopy as ni, themeCommandCopy as ri } from "../localUiCommandCopy.js";
112
- import { offerAssentFor as ii } from "../localeCommands/assent.js";
113
- import { appControlCopy as ai } from "../appControls/copy.js";
114
- import { LANGUAGE_REPLY_DEADLINE_MS as oi, languageConfirmationCopy as si, languageReplyStep as ci } from "../appControls/languageReply.js";
115
- import { planAppControl as li } from "../appControls/plan.js";
116
- import { readControlSnapshot as ui } from "../appControls/snapshot.js";
117
- import { subscribeAssistantControls as di } from "../appControls/registry.js";
118
- import { useAssistantControl as fi } from "../appControls/useAssistantControl.js";
119
- import { useControlConfirmDialog as pi } from "./controlConfirmDialog.js";
120
- import { useLeaveConfirmAsking as mi } from "./leaveConfirm.js";
121
- import { startFocusReturnAfterKeep as hi } from "./leaveConfirmFocus.js";
122
- import { buildNavigationContext as gi, latestReplyOnSurface as _i, rememberPresentedList as vi } from "../uiActions/linkContext.js";
123
- import { lookupNamedRecords as yi } from "../uiActions/recordNames.js";
124
- import { navEntryIds as bi } from "../uiActions/resolveTarget.js";
125
- import { buildUiCatalogue as xi, markUiCatalogueSent as Si, uiCatalogueSent as Ci, uiCatalogueSessionKey as wi } from "../uiActions/uiCatalogue.js";
126
- import { offerYesOnSurface as Ti } from "../uiActions/offerYesOnSurface.js";
127
- import { UiOfferSession as Ei, sandboxServesUiOffers as Di, uiOfferHintKind as Oi, uiOfferInTime as ki } from "../uiActions/uiOffers.js";
128
- import { parseNavIntent as Ai } from "../uiActions/navIntent.js";
129
- import { decideActOnResolve as ji, n4LeaveGuard as Mi } from "../uiActions/actOnResolve.js";
130
- import { AssistantUiOfferLinks as Ni } from "./AssistantUiOfferLink.js";
131
- import { assistantBackStack as Pi, isBackRunnable as Fi } from "../uiActions/backStack.js";
132
- import { subscribeDraftPathname as Ii } from "../uiActions/draftPathname.js";
133
- import { buildNavigateAction as Li, destinationForPath as Ri, labelForPath as zi, newestAssistantOnSurface as Bi } from "../uiActions/navigateAction.js";
134
- import { runNavigation as Vi } from "../uiActions/navigationOutcome.js";
135
- import { assistantHistory as Hi } from "../history/historyEngine.js";
136
- import { conversationHasHistory as Ui, isOtherScopeHistoryConversation as Wi, isReadOnlyHistoryConversation as Gi, isReusableHistoryDraft as Ki } from "../history/historyList.js";
137
- import { resumeContextFor as qi } from "../history/historyResume.js";
138
- import { useAssistantHistoryStatus as Ji } from "../history/historyStatus.js";
139
- import { useHistoryRowControlsFor as Yi } from "../history/useHistoryRowControls.js";
140
- import { getHistoryStamp as Xi, setHistoryBusyProbe as Zi } from "../history/stampRegistry.js";
141
- import { resolveConversationDeleteTarget as Qi } from "../conversationDeleteCommand.js";
142
- import { useAssistantNavigate as $i } from "./AssistantMarkdownRenderer.js";
143
- import { useAssistantSpeech as ea } from "./AssistantSpeechProvider.js";
144
- import { useAssistantStopTurnLabel as ta } from "../../providers/shell/useAssistantShellLabels.js";
145
- import { useThemeOrNull as na } from "../../providers/shell/ThemeProvider.js";
146
- import { useVisibleNavItems as ra } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
147
- import { useAskAboutStore as ia } from "../askAbout/askAboutStore.js";
148
- import { readMessageFocus as aa, withFocusNote as oa } from "../askAbout/focus.js";
149
- import { useCallback as D, useEffect as O, useLayoutEffect as sa, useMemo as k, useRef as A, useState as j, useSyncExternalStore as ca } from "react";
150
- import { Fragment as la, jsx as M, jsxs as ua } from "react/jsx-runtime";
23
+ import { AssistantWindowWelcome as he } from "./compact/AssistantWindowWelcome.js";
24
+ import { AssistantSpokenTurnsNotice as x } from "./AssistantSpokenTurnsNotice.js";
25
+ import { AssistantHistoryArchivedNotice as ge, AssistantHistoryDeletedNotice as _e, AssistantHistoryLoadState as ve, AssistantHistoryPinLimitBanner as S, AssistantHistoryReadOnlyBanner as ye, AssistantHistoryShowEarlier as be } from "./AssistantHistoryNotices.js";
26
+ import { useAssistantPageChatManaged as xe } from "./assistantPageBar.js";
27
+ import { AssistantNothingToDeleteNotice as Se } from "./AssistantDeleteConversationDialog.js";
28
+ import { useConversationDeleteDialog as Ce } from "./conversationDeleteDialog.js";
29
+ import { assistantHistoryIsOn as we } from "./conversationDelete.js";
30
+ import { VoiceTranscriptDrawer as Te } from "./voice/VoiceTranscriptDrawer.js";
31
+ import { AssistantComposer as Ee } from "./composer/AssistantComposer.js";
32
+ import { assistantModeOptionName as De } from "./composer/AssistantModeMenu.js";
33
+ import { draftIsUnsent as Oe } from "./compact/compactChrome.js";
34
+ import { AssistantWaitingChangeRow as ke } from "./compact/AssistantWaitingChangeRow.js";
35
+ import { voiceStartedCueShows as Ae } from "../voice/voiceStartedCue.js";
36
+ import { countWaitingChanges as je, focusFirstWaitingCard as Me } from "./compact/waitingChange.js";
37
+ import { planModeSwitch as Ne } from "./composer/modeSwitchPlan.js";
38
+ import { AssistantAiDisclaimer as Pe } from "./AssistantAiDisclaimer.js";
39
+ import { AssistantCompactFooter as Fe } from "./composer/AssistantCompactFooter.js";
40
+ import { AiCreditBalance as Ie } from "./AiCreditBalance.js";
41
+ import { AssistantVoiceSession as Le } from "./voice/AssistantVoiceSession.js";
42
+ import { AssistantAvatarTab as Re } from "./avatar/AssistantAvatarTab.js";
43
+ import { AssistantCompactAvatar as ze } from "./avatar/AssistantCompactAvatar.js";
44
+ import { AssistantViewSwitch as Be } from "./compact/AssistantViewSwitch.js";
45
+ import { AssistantViewSwitchDock as Ve } from "./compact/AssistantViewSwitchDock.js";
46
+ import { useAssistantPageLayout as He } from "./assistantPageLayout.js";
47
+ import { assistantPageStartShows as Ue, setAssistantPageStartSlot as We, useAssistantPageStartOffered as Ge } from "./assistantPageStart.js";
48
+ import { useLiveAvatarTab as Ke, useLiveAvatarTabSeam as C } from "./assistantLiveAvatarSeam.js";
49
+ import { useAvatarCopy as qe } from "../avatar/useAvatarCopy.js";
50
+ import { voiceStartBlocker as Je, voiceStartBlockerLasts as Ye } from "./voice/voiceStartGate.js";
51
+ import { avatarAskBlocker as Xe, avatarAskWrites as Ze, avatarTabAskLine as Qe } from "./avatar/avatarAskGate.js";
52
+ import { createAvatarTabDraft as $e } from "./avatar/avatarTabDraft.js";
53
+ import { parseToolActivity as et } from "./AssistantToolActivity.js";
54
+ import { useVoiceSession as tt } from "./useVoiceSession.js";
55
+ import { useAssistantApiAccess as nt } from "../useAssistantApiAccess.js";
56
+ import { useAssistantAttachments as rt } from "../useAssistantAttachments.js";
57
+ import { useAttachmentUrlResolver as it } from "../useAttachmentCommitter.js";
58
+ import { VOICE_COMMIT_BUDGET_MS as at, settleAndCommitSpokenTurn as ot } from "../voiceCommit.js";
59
+ import { attachmentUrlIsStale as st, refreshStaleAttachmentUrls as ct } from "../attachmentCommit.js";
60
+ import { useConversationTurns as lt } from "../useConversationTurns.js";
61
+ import { resolveActiveModeSandbox as ut, useAssistantStore as w } from "../store.js";
62
+ import { abortAssistantTurn as dt, approvePendingWrite as ft, createAssistantSandbox as pt, createAssistantSession as mt, findExistingSandboxWithStatus as ht, getAssistantArtifacts as gt, getAssistantMessages as _t, getAssistantSession as vt, mintAssistantTurnStream as yt, modeRequiresConfirmWrites as bt, postClientToolResult as xt, promptGatewayRequestBytes as St, releaseSupersededAssistantSandboxes as Ct, sendAssistantPromptAsync as wt, waitForAssistantServiceReady as Tt, waitForSandboxRunning as Et, writeApprovalModeOf as Dt } from "../api.js";
63
+ import { createClientToolRunner as Ot, offerClientTools as kt } from "../../agent-tools/adapters/assistant.js";
64
+ import { sanitize as At } from "../progress.js";
65
+ import { createSandboxBusyGate as jt, gateDoneOnSandboxBusy as Mt } from "../sandboxBusy.js";
66
+ import { speechFeed as Nt } from "../speech/speechFeed.js";
67
+ import { requestReplyOnAvatar as Pt } from "../speech/replySpeechRequests.js";
68
+ import { isTurnSuperseded as Ft, markTurnSuperseded as It } from "../voice/supersededTurns.js";
69
+ import { NO_FIRST_TEXT as Lt, buildAssistantProgress as Rt, readAheadFor as zt, rememberSessionFloor as Bt, snapshotReplyFloor as Vt, startSessionReadAhead as Ht, takeRememberedSessionFloor as Ut, trackFirstText as Wt } from "../turnProgress.js";
70
+ import { getOrganizationId as Gt, getWorkspaceId as T } from "../context.js";
71
+ import { dispatchAssistantQuotaExhausted as Kt, notifyAiCreditsUpdated as qt } from "../aiCredits.js";
72
+ import { AssistantSendRefusal as Jt, classifyTurnFailure as Yt, turnConfirmsNoAction as Xt, turnOutcomeCopy as Zt } from "../turnOutcome.js";
73
+ import { QuarantineSet as Qt, WarmCancelled as $t, claimPreopenedSession as en, consumeWarm as tn, preopenKey as nn, preopenWanted as rn, prewarmTarget as an, settleWarmBeforeSend as on, startPreopen as sn, startWarm as cn, warmState as ln, withWarmProofs as un } from "../prewarm.js";
74
+ import { beginTurn as dn, describeTurn as fn, detectTurnDevice as pn, markTurn as E, restartAttempt as mn, turnClockMs as hn } from "../turnTimeline.js";
75
+ import { sendAssistantTurnTimings as gn, startTurnTimingReporting as _n } from "../turnTimingReporter.js";
76
+ import { countInlineImageCandidates as vn, countInlinedImageParts as yn, largestInlineCharsPerFile as bn, resolveAssistantInlineLimits as xn, toMessageAttachment as Sn } from "../attachments.js";
77
+ import { buildBoundedAttachmentTurn as Cn } from "../attachmentTurn.js";
78
+ import { assistantUsageLedger as wn, hasPendingUsageReports as Tn, reportUsageInBackground as En, retryPendingUsageReports as Dn, settleInFlightUsageReports as On, usageSendRefusal as kn } from "../usageReporting.js";
79
+ import { isMultimodalBodyRejection as An, isRecoverableAssistantError as jn } from "../transportErrors.js";
80
+ import { isTurnInFlight as Mn, planAbandonedTurn as Nn, planTurnAbort as Pn } from "../turnState.js";
81
+ import { useAssistantTr as Fn } from "../i18n.js";
82
+ import { isProdRuntime as In } from "../env.js";
83
+ import { useAssistantProduct as Ln } from "../product.js";
84
+ import { pollDelayMs as Rn } from "../voice/assistantPollSchedule.js";
85
+ import { holdAssistantActivity as zn } from "../keepAlive.js";
86
+ import { StaleSessionRestart as Bn, isStaleSessionRefusal as Vn } from "../staleSession.js";
87
+ import { noteAssistantTurnSent as Hn } from "../signInWarm.js";
88
+ import { keepAssistantSandboxAlive as Un } from "../useAssistantHeartbeat.js";
89
+ import { liveCoverage as Wn } from "../liveDeltas.js";
90
+ import { phraseSpeechEnabled as Gn } from "../voice/phraseSpeechConfig.js";
91
+ import { createLivePhraseSpeech as Kn } from "../voice/livePhraseSpeech.js";
92
+ import { createLiveRender as qn } from "../liveOverlay.js";
93
+ import { createSnapshotPoller as Jn } from "../snapshotPoller.js";
94
+ import { openTurnStream as Yn, turnStreamAvailable as Xn } from "../turnStream.js";
95
+ import { withIncompleteTurnNotice as Zn } from "../streamBudget.js";
96
+ import { isWriteModeAcknowledged as Qn, writeModeSendRefusalReason as $n } from "../writeModeConsent.js";
97
+ import { createAdminModeAccessGate as er, resolveAssistantSendModeAfterAccess as tr } from "../adminModeSendGate.js";
98
+ import { getAssistantDisplayContent as nr } from "../displayContent.js";
99
+ import { countSpokenTurns as rr, spokenMessagesSinceContinueNote as ir, spokenTurnText as ar } from "../spokenTurns.js";
100
+ import { toCaptionText as or } from "../voice/captionText.js";
101
+ import { buildContinuedFromVoiceNote as sr, buildVoiceTranscriptMarkdown as cr, voiceTranscriptFilename as lr } from "../voice/voiceTranscript.js";
102
+ import { downloadFile as ur } from "../exportConversation.js";
103
+ import { chatTurns as dr, isVoiceTurn as fr, voiceMarker as pr, voiceSessionIdOf as mr } from "../voice/turnVisibility.js";
104
+ import { VoiceChatEnded as hr, VoiceTurnTag as gr } from "./voice/VoiceTurnMarks.js";
105
+ import { revealSpokenMarkdown as _r } from "../voice/revealSpoken.js";
106
+ import { isAwaitingOwnConversation as vr, maySendSpokenTurn as yr, planTranscriptAutoOpen as br, planVoiceSessionBinding as xr, planVoiceSessionStart as Sr, planVoiceSpokenEntry as Cr, voiceBindingAtStart as wr, voiceBindingConversationId as Tr } from "../voice/voiceReopen.js";
107
+ import { transcriptAutoOpenSlot as Er } from "./transcriptAutoOpenSlot.js";
108
+ import { toVoiceReply as Dr } from "../voice/voiceReply.js";
109
+ import { beginApprovalInFlight as Or, endApprovalInFlight as kr, getApprovalInFlight as Ar, markLiveTurn as jr, newestModelReplyId as Mr, resolveApprovablePendingWrite as Nr, resolveRetryableMessageId as Pr, subscribeApprovalInFlight as Fr } from "../liveTurns.js";
110
+ import { createReadinessTracker as Ir, planAfterTransportFailure as Lr, planTrustedSandboxFailure as Rr } from "../sandboxReadiness.js";
111
+ import { couldBeLocalUiCommand as zr, isAlreadyThere as Br, matchLocalUiCommand as Vr, mayBeNavigationFollowUp as Hr, navDestinations as Ur, planThemeChange as Wr } from "../localUiCommands.js";
112
+ import { backDoneCopy as Gr, chooseDestinationCopy as Kr, chooseLinkedCopy as qr, entityNounText as Jr, linkNotOpenableCopy as Yr, navigationCommandCopy as Xr, navigationOutcomeCopy as Zr, offerExpiredCopy as Qr, offerKeptForUnsavedCopy as $r, offerNotAvailableCopy as ei, pickFromListCopy as ti, recordChoiceCopy as ni, recordKindsCopy as ri, themeCommandCopy as ii } from "../localUiCommandCopy.js";
113
+ import { offerAssentFor as ai } from "../localeCommands/assent.js";
114
+ import { appControlCopy as oi } from "../appControls/copy.js";
115
+ import { LANGUAGE_REPLY_DEADLINE_MS as si, languageConfirmationCopy as ci, languageReplyStep as li } from "../appControls/languageReply.js";
116
+ import { planAppControl as ui } from "../appControls/plan.js";
117
+ import { readControlSnapshot as di } from "../appControls/snapshot.js";
118
+ import { subscribeAssistantControls as fi } from "../appControls/registry.js";
119
+ import { useAssistantControl as pi } from "../appControls/useAssistantControl.js";
120
+ import { useControlConfirmDialog as mi } from "./controlConfirmDialog.js";
121
+ import { useLeaveConfirmAsking as hi } from "./leaveConfirm.js";
122
+ import { startFocusReturnAfterKeep as gi } from "./leaveConfirmFocus.js";
123
+ import { buildNavigationContext as _i, latestReplyOnSurface as vi, rememberPresentedList as yi } from "../uiActions/linkContext.js";
124
+ import { lookupNamedRecords as bi } from "../uiActions/recordNames.js";
125
+ import { navEntryIds as xi } from "../uiActions/resolveTarget.js";
126
+ import { buildUiCatalogue as Si, markUiCatalogueSent as Ci, uiCatalogueSent as wi, uiCatalogueSessionKey as Ti } from "../uiActions/uiCatalogue.js";
127
+ import { offerYesOnSurface as Ei } from "../uiActions/offerYesOnSurface.js";
128
+ import { UiOfferSession as Di, sandboxServesUiOffers as Oi, uiOfferHintKind as ki, uiOfferInTime as Ai } from "../uiActions/uiOffers.js";
129
+ import { parseNavIntent as ji } from "../uiActions/navIntent.js";
130
+ import { decideActOnResolve as Mi, n4LeaveGuard as Ni } from "../uiActions/actOnResolve.js";
131
+ import { AssistantUiOfferLinks as Pi } from "./AssistantUiOfferLink.js";
132
+ import { assistantBackStack as Fi, isBackRunnable as Ii } from "../uiActions/backStack.js";
133
+ import { subscribeDraftPathname as Li } from "../uiActions/draftPathname.js";
134
+ import { buildNavigateAction as Ri, destinationForPath as zi, labelForPath as Bi, newestAssistantOnSurface as Vi } from "../uiActions/navigateAction.js";
135
+ import { runNavigation as Hi } from "../uiActions/navigationOutcome.js";
136
+ import { assistantHistory as Ui } from "../history/historyEngine.js";
137
+ import { conversationHasHistory as Wi, isOtherScopeHistoryConversation as Gi, isReadOnlyHistoryConversation as Ki, isReusableHistoryDraft as qi } from "../history/historyList.js";
138
+ import { resumeContextFor as Ji } from "../history/historyResume.js";
139
+ import { useAssistantHistoryStatus as Yi } from "../history/historyStatus.js";
140
+ import { useHistoryRowControlsFor as Xi } from "../history/useHistoryRowControls.js";
141
+ import { getHistoryStamp as Zi, setHistoryBusyProbe as Qi } from "../history/stampRegistry.js";
142
+ import { resolveConversationDeleteTarget as $i } from "../conversationDeleteCommand.js";
143
+ import { useAssistantNavigate as ea } from "./AssistantMarkdownRenderer.js";
144
+ import { useAssistantSpeech as ta } from "./AssistantSpeechProvider.js";
145
+ import { useAssistantStopTurnLabel as na } from "../../providers/shell/useAssistantShellLabels.js";
146
+ import { useThemeOrNull as ra } from "../../providers/shell/ThemeProvider.js";
147
+ import { useVisibleNavItems as ia } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
148
+ import { useAskAboutStore as aa } from "../askAbout/askAboutStore.js";
149
+ import { readMessageFocus as oa, withFocusNote as sa } from "../askAbout/focus.js";
150
+ import { useCallback as D, useEffect as O, useLayoutEffect as ca, useMemo as k, useRef as A, useState as j, useSyncExternalStore as la } from "react";
151
+ import { Fragment as ua, jsx as M, jsxs as da } from "react/jsx-runtime";
151
152
  // src/shared/assistant/ui/AssistantChatArea.tsx
152
- var da = 2500, fa = 300, pa = 2e4, ma = 1e4, ha = 1e4, ga = !1, _a = {
153
+ var fa = 2500, pa = 300, ma = 2e4, ha = 1e4, ga = 1e4, _a = !1, va = {
153
154
  committing: !1,
154
155
  dictating: !1
155
- }, va = 6e3;
156
+ }, ya = 6e3;
156
157
  function N() {
157
158
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
158
159
  }
159
- var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ visible: Sa = !0, writeAccess: Ca = "unknown", presentation: wa = "classic", inputRef: Ta, onDraftDirtyChange: Ea, surface: Da, onWindowVoiceChange: Oa, onOpenFull: ka, onContinuedInChat: Aa }) => {
160
- let P = Pn(), ja = ta(), F = wa === "compact", I = Ve(), Ma = We(), Na = D((e) => Ue("above", e), []), Pa = D((e) => Ue("below", e), []), Fa = F && Da === "window", { product: L, modes: R, gatherPageContext: Ia, buildPrompt: La, reportTurnTimings: Ra, reportTokenUsage: za, localUiCommands: Ba } = In(), z = Et(In().writeApproval), Va = D((e, t) => {
160
+ var ba = () => () => {}, xa = () => "off", Sa = { overflowY: "auto" }, Ca = ({ visible: Ca = !0, writeAccess: wa = "unknown", presentation: Ta = "classic", inputRef: Ea, onDraftDirtyChange: Da, surface: Oa, onWindowVoiceChange: ka, onOpenFull: Aa, onContinuedInChat: ja }) => {
161
+ let P = Fn(), Ma = na(), F = Ta === "compact", I = He(), Na = Ge(), Pa = D((e) => We("above", e), []), Fa = D((e) => We("below", e), []), Ia = F && Oa === "window", { product: L, modes: R, gatherPageContext: La, buildPrompt: Ra, reportTurnTimings: za, reportTokenUsage: Ba, localUiCommands: Va } = Ln(), z = Dt(Ln().writeApproval), Ha = D((e, t) => {
161
162
  let n = w.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
162
163
  return g({
163
164
  mode: e,
164
165
  productWriteApproval: z,
165
166
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
166
167
  });
167
- }, [z]), { getAccessToken: Ha, getWorkspaceToken: Ua, userId: B } = r(), { locale: V, isLocaleLoading: Wa } = n(), Ga = w((e) => e.voiceGraceMs), Ka = w((e) => e.handsFreeInterrupt), qa = w((e) => e.handsFreeStreamNoticeAccepted), Ja = w((e) => e.acceptHandsFreeStreamNotice), Ya = w((e) => e.assistantLanguage), Xa = w((e) => e.replyLanguage), Za = k(() => s(Ya, Xa, V), [
168
- Ya,
168
+ }, [z]), { getAccessToken: Ua, getWorkspaceToken: Wa, userId: B } = r(), { locale: V, isLocaleLoading: Ga } = n(), Ka = w((e) => e.voiceGraceMs), qa = w((e) => e.handsFreeInterrupt), Ja = w((e) => e.handsFreeStreamNoticeAccepted), Ya = w((e) => e.acceptHandsFreeStreamNotice), Xa = w((e) => e.assistantLanguage), Za = w((e) => e.replyLanguage), Qa = k(() => s(Xa, Za, V), [
169
169
  Xa,
170
+ Za,
170
171
  V
171
- ]), Qa = Za.reply.english, $a = Za.replyIsExplicit, eo = Za.reply.code, { conversations: to, activeConversationId: H, mode: U, processingByConversationId: no, setMode: ro, setConversationMode: io, setActiveConversation: ao, createConversation: oo, addMessage: W, updateMessage: so, patchMessage: co, mergeMessageMetadata: lo, setConversationProcessing: uo, clearConversationProcessing: fo, setBackendSessionId: po, clearBackendSessionId: mo, setSandbox: ho, clearSandbox: go, acknowledgedWriteModes: _o, acknowledgeWriteMode: vo, autoRouting: yo, setAutoRouting: bo, routeConversation: xo } = w(), G = to.find((e) => e.id === H), So = ct(G), Co = So.all, wo = H ? no[H] : void 0, To = jn(wo?.status), Eo = To ? wo?.messageId ?? null : null, Do = wo?.status === "error" ? wo.messageId : null, Oo = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: ko, retiredSandboxes: Ao } = ee({
172
+ ]), $a = Qa.reply.english, eo = Qa.replyIsExplicit, to = Qa.reply.code, { conversations: no, activeConversationId: H, mode: U, processingByConversationId: ro, setMode: io, setConversationMode: ao, setActiveConversation: oo, createConversation: so, addMessage: W, updateMessage: co, patchMessage: lo, mergeMessageMetadata: uo, setConversationProcessing: fo, clearConversationProcessing: po, setBackendSessionId: mo, clearBackendSessionId: ho, setSandbox: go, clearSandbox: _o, acknowledgedWriteModes: vo, acknowledgeWriteMode: yo, autoRouting: bo, setAutoRouting: xo, routeConversation: So } = w(), G = no.find((e) => e.id === H), Co = lt(G), wo = Co.all, To = H ? ro[H] : void 0, Eo = Mn(To?.status), Do = Eo ? To?.messageId ?? null : null, Oo = To?.status === "error" ? To.messageId : null, ko = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: Ao, retiredSandboxes: jo } = ee({
172
173
  tr: P,
173
174
  productWriteApproval: z
174
- }), jo = p({
175
+ }), Mo = p({
175
176
  approve: (e, t) => K.approve(e, t),
176
177
  decline: (e, t, n) => K.decline(e, t, n),
177
178
  presented: (e, t) => K.presented(e, t)
178
- }), Mo = jo.dismiss, No = A(null);
179
+ }), No = Mo.dismiss, Po = A(null);
179
180
  O(() => {
180
- Mo();
181
- let e = No.current;
182
- No.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
181
+ No();
182
+ let e = Po.current;
183
+ Po.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
183
184
  }, [
184
185
  H,
185
186
  K,
186
- Mo
187
+ No
187
188
  ]);
188
- let Po = Gi(G), Fo = Yi(G)?.archivedAt != null, Io = Ji((e) => H !== null && H in e.loadingIds), Lo = Ji((e) => H !== null && H in e.loadErrorIds), Ro = Ji((e) => e.remoteDelete), [zo, Bo] = j(() => Ji.getState().remoteDelete?.at ?? null), Vo = Ro?.wasActive === !0 && Ro.at !== zo ? Ro.at : null;
189
+ let Fo = Ki(G), Io = Xi(G)?.archivedAt != null, Lo = Yi((e) => H !== null && H in e.loadingIds), Ro = Yi((e) => H !== null && H in e.loadErrorIds), zo = Yi((e) => e.remoteDelete), [Bo, Vo] = j(() => Yi.getState().remoteDelete?.at ?? null), Ho = zo?.wasActive === !0 && zo.at !== Bo ? zo.at : null;
189
190
  O(() => {
190
- if (Vo === null) return;
191
- let e = window.setTimeout(() => Bo(Vo), ha);
191
+ if (Ho === null) return;
192
+ let e = window.setTimeout(() => Vo(Ho), ga);
192
193
  return () => window.clearTimeout(e);
193
- }, [Vo]);
194
- let Ho = be(), Uo = Ji((e) => e.pinLimit), Wo = I && Ho && Uo !== void 0 && Uo.conversationId === H ? Uo : null, Go = T(), { canUseApiCalls: Ko, loading: qo } = tt(Go, B), Jo = A($n({
195
- loading: qo,
196
- canUseAdminModes: Ko
197
- })).current, Yo = A(R);
194
+ }, [Ho]);
195
+ let Uo = xe(), Wo = Yi((e) => e.pinLimit), Go = I && Uo && Wo !== void 0 && Wo.conversationId === H ? Wo : null, Ko = T(), { canUseApiCalls: qo, loading: Jo } = nt(Ko, B), Yo = A(er({
196
+ loading: Jo,
197
+ canUseAdminModes: qo
198
+ })).current, Xo = A(R);
198
199
  O(() => {
199
- Yo.current = R;
200
+ Xo.current = R;
200
201
  }, [R]);
201
- let Xo = () => {
202
+ let Zo = () => {
202
203
  let e = w.getState().activeConversationId;
203
- e && Hi.openConversation(e, { modes: Yo.current });
204
- }, Zo = () => {
204
+ e && Ui.openConversation(e, { modes: Xo.current });
205
+ }, Qo = () => {
205
206
  let e = w.getState().activeConversationId;
206
- e && Hi.loadEarlier(e);
207
- }, Qo = A(Ha);
207
+ e && Ui.loadEarlier(e);
208
+ }, $o = A(Ua);
208
209
  O(() => {
209
- Qo.current = Ha;
210
- }, [Ha]);
211
- let $o = !!L && Ra !== !1;
210
+ $o.current = Ua;
211
+ }, [Ua]);
212
+ let es = !!L && za !== !1;
212
213
  O(() => {
213
- if ($o) return gn({ send: (e) => hn(e, {
214
+ if (es) return _n({ send: (e) => gn(e, {
214
215
  workspaceId: T(),
215
216
  authContext: {
216
- accessToken: Qo.current(),
217
- organizationId: Wt()
217
+ accessToken: $o.current(),
218
+ organizationId: Gt()
218
219
  }
219
220
  }) });
220
- }, [$o]), O(() => {
221
- Jo.update({
222
- loading: qo,
223
- canUseAdminModes: Ko
221
+ }, [es]), O(() => {
222
+ Yo.update({
223
+ loading: Jo,
224
+ canUseAdminModes: qo
224
225
  });
225
226
  }, [
227
+ Yo,
226
228
  Jo,
227
- qo,
228
- Ko
229
+ qo
229
230
  ]), O(() => () => {
230
- Jo.abandon();
231
- }, [Jo]);
232
- let es = k(() => R.filter((e) => !e.requiresAdmin || Ko), [R, Ko]), ts = fe(es), ns = yo && ts, rs = A(ts);
231
+ Yo.abandon();
232
+ }, [Yo]);
233
+ let ts = k(() => R.filter((e) => !e.requiresAdmin || qo), [R, qo]), ns = fe(ts), rs = bo && ns, is = A(ns);
233
234
  O(() => {
234
- rs.current = ts;
235
- }, [ts]);
236
- let is = A(null), as = A(!1), [os, ss] = j(!1), cs = yn(R), [ls, us] = j(null), [ds, fs] = j(() => Tr.openFor());
235
+ is.current = ns;
236
+ }, [ns]);
237
+ let as = A(null), os = A(!1), [ss, cs] = j(!1), ls = bn(R), [us, ds] = j(null), [fs, ps] = j(() => Er.openFor());
237
238
  O(() => {
238
- Tr.setOpenFor(ds);
239
- }, [ds]);
240
- let ps = ds !== null && ds === H, q = Ge(), ms = Ke(), J = q.open && ms !== null, hs = q.close, gs = A(J);
241
- sa(() => {
242
- gs.current = J;
239
+ Er.setOpenFor(fs);
240
+ }, [fs]);
241
+ let ms = fs !== null && fs === H, q = Ke(), hs = C(), J = q.open && hs !== null, gs = q.close, _s = A(J);
242
+ ca(() => {
243
+ _s.current = J;
243
244
  }, [J]);
244
- let _s = D((e) => {
245
- e && gs.current || e && I || fs(e ? w.getState().activeConversationId : null);
245
+ let vs = D((e) => {
246
+ e && _s.current || e && I || ps(e ? w.getState().activeConversationId : null);
246
247
  }, [I]);
247
248
  O(() => {
248
- fs((e) => e !== null && e !== H ? null : e);
249
+ ps((e) => e !== null && e !== H ? null : e);
249
250
  }, [H]);
250
- let vs = A(void 0), [ys, bs] = j(!1), [xs, Ss] = j(!1), Cs = D((e) => {
251
- vs.current = e, bs(_r(e));
252
- }, []), ws = A(null), Ts = A(!1), Es = D(() => {
251
+ let ys = A(void 0), [bs, xs] = j(!1), [Ss, Cs] = j(!1), ws = D((e) => {
252
+ ys.current = e, xs(vr(e));
253
+ }, []), Ts = A(null), Es = A(!1), Ds = D(() => {
253
254
  let e = w.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
254
255
  return !t || !n ? null : {
255
256
  id: t,
256
- reusableDraft: Ki(n, Xi()),
257
+ reusableDraft: qi(n, Zi()),
257
258
  liveProposals: K.liveFor(t).count,
258
- turnInFlight: jn(e.processingByConversationId[t]?.status)
259
+ turnInFlight: Mn(e.processingByConversationId[t]?.status)
259
260
  };
260
- }, [K]), Ds = A({}), Os = A(ln(Fr())), ks = A(new Zt()), As = A(/* @__PURE__ */ new Set()), js = k(() => R.find((e) => e.id === U), [R, U]), Ms = w((e) => {
261
+ }, [K]), Os = A({}), ks = A(un(Ir())), As = A(new Qt()), js = A(/* @__PURE__ */ new Set()), Ms = k(() => R.find((e) => e.id === U), [R, U]), Ns = w((e) => {
261
262
  let t = e.sandboxesByMode[U]?.sandboxId;
262
263
  return t ? e.sandboxWriteCapabilities[t] : void 0;
263
- }), Ns = js !== void 0 && g({
264
+ }), Ps = Ms !== void 0 && g({
264
265
  mode: U,
265
266
  productWriteApproval: z,
266
- capabilities: Ms
267
- }), Ps = U === "assistant" || js !== void 0 && !js.writeCapable && !yt(U) || Ns;
267
+ capabilities: Ns
268
+ }), Fs = U === "assistant" || Ms !== void 0 && !Ms.writeCapable && !bt(U) || Ps;
268
269
  O(() => {
269
- let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || Ko)?.id ?? R[0]?.id ?? "assistant";
270
- U !== "assistant" && js?.writeCapable && !Zn(_o, U) ? ro(e) : qo || (!js || js.requiresAdmin && !Ko) && U !== e && ro(e);
270
+ let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || qo)?.id ?? R[0]?.id ?? "assistant";
271
+ U !== "assistant" && Ms?.writeCapable && !Qn(vo, U) ? io(e) : Jo || (!Ms || Ms.requiresAdmin && !qo) && U !== e && io(e);
271
272
  }, [
272
273
  U,
273
- js,
274
- Ko,
274
+ Ms,
275
275
  qo,
276
- ro,
277
- _o,
276
+ Jo,
277
+ io,
278
+ vo,
278
279
  R
279
280
  ]);
280
- let Fs = D((e, t, n, r) => {
281
- uo(e, n, t, null, r);
282
- }, [uo]), Is = D(async (e, t, n, r, i, a = null) => {
281
+ let Is = D((e, t, n, r) => {
282
+ fo(e, n, t, null, r);
283
+ }, [fo]), Ls = D(async (e, t, n, r, i, a = null) => {
283
284
  let o = (e, t) => {
284
- r && Fs(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
285
+ r && Is(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
285
286
  }, s = (e) => {
286
287
  r && E(r.assistantMessageId, e);
287
288
  }, c = () => {
288
289
  s("bootAdopted"), a?.beginBoot();
289
290
  }, l = () => a !== null && (a.signal.aborted || T() !== t), u = () => {
290
- if (l()) throw new Qt("cancelled");
291
+ if (l()) throw new $t("cancelled");
291
292
  }, d = w.getState().sandboxesByMode[e]?.sandboxId ?? null, f = !1, p = !1, ee = !1, m = !1, h = !1, g = async (r) => {
292
- if (i && !ks.current.has(r) && Os.current.isFresh(r)) return f = !0, !0;
293
+ if (i && !As.current.has(r) && ks.current.isFresh(r)) return f = !0, !0;
293
294
  ee = !0;
294
295
  let o = !1;
295
296
  try {
296
- await Tt(r, t, n, 3e5), await wt(r, t, e, n, 9e4, () => {
297
+ await Et(r, t, n, 3e5), await Tt(r, t, e, n, 9e4, () => {
297
298
  o = !0, c();
298
299
  });
299
300
  } catch {
300
- if (l()) throw new Qt("cancelled");
301
- return Os.current.invalidate(r), ks.current.add(r), a?.dead.push(r), h = !0, !1;
301
+ if (l()) throw new $t("cancelled");
302
+ return ks.current.invalidate(r), As.current.add(r), a?.dead.push(r), h = !0, !1;
302
303
  }
303
- return u(), Os.current.markVerified(r), o && (m = !0), !0;
304
+ return u(), ks.current.markVerified(r), o && (m = !0), !0;
304
305
  };
305
- if (d && (ho(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (ho(e, null, "provisioning"), d = null)), !d) {
306
+ if (d && (go(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (go(e, null, "provisioning"), d = null)), !d) {
306
307
  o("provisioning", "lookingForEnvironment");
307
- let r = await mt(t, L, e, Fn(), n, ks.current, z);
308
+ let r = await ht(t, L, e, In(), n, As.current, z);
308
309
  u();
309
310
  let i = r?.id ?? null;
310
311
  if (i) {
311
- ho(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
312
+ go(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
312
313
  let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
313
- t && c(), await g(i) ? (d = i, t && (m = !0)) : ho(e, null, "provisioning");
314
+ t && c(), await g(i) ? (d = i, t && (m = !0)) : go(e, null, "provisioning");
314
315
  }
315
316
  }
316
317
  if (!d) {
317
- if (a && !a.mayCreate) throw new Qt("no-create");
318
- if (s("provisionStarted"), e === "api-calls" && !Ha()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
319
- o("provisioning", "startingEnvironment"), ho(e, null, "provisioning");
320
- let r = a ? [] : await St(t, L, e, Fn(), n, ks.current, z);
318
+ if (a && !a.mayCreate) throw new $t("no-create");
319
+ if (s("provisionStarted"), e === "api-calls" && !Ua()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
320
+ o("provisioning", "startingEnvironment"), go(e, null, "provisioning");
321
+ let r = a ? [] : await Ct(t, L, e, In(), n, As.current, z);
321
322
  if (r.length > 0) {
322
323
  let e = new Set(r);
323
- for (let e of r) Os.current.invalidate(e), ks.current.add(e);
324
+ for (let e of r) ks.current.invalidate(e), As.current.add(e);
324
325
  let t = w.getState().sandboxesByMode;
325
- for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && go(n);
326
+ for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && _o(n);
326
327
  }
327
328
  s("createRequested");
328
329
  let i = a?.beginCreate();
329
330
  try {
330
- d = await ft(L, e, t, Fn(), fa, n, { writeApproval: z });
331
+ d = await pt(L, e, t, In(), pa, n, { writeApproval: z });
331
332
  } finally {
332
333
  i?.();
333
334
  }
334
- p = !0, u(), ho(e, d, "provisioning"), await Tt(d, t, n, 3e5), u(), s("sandboxRunning"), await wt(d, t, e, n, 9e4), u(), s("serviceReady"), Os.current.markVerified(d);
335
+ p = !0, u(), go(e, d, "provisioning"), await Et(d, t, n, 3e5), u(), s("sandboxRunning"), await Tt(d, t, e, n, 9e4), u(), s("serviceReady"), ks.current.markVerified(d);
335
336
  }
336
- return ho(e, d, "running"), {
337
+ return go(e, d, "running"), {
337
338
  sandboxId: d,
338
339
  sandboxIsNew: p,
339
340
  sandboxProbed: ee,
@@ -342,64 +343,64 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
342
343
  trustedFromCache: f
343
344
  };
344
345
  }, [
345
- go,
346
- Ha,
346
+ _o,
347
+ Ua,
347
348
  L,
348
349
  z,
349
- ho,
350
- Fs
351
- ]), Ls = D(async function e(t, n, r, i, a, o = {}) {
352
- let s = await an(i, r, (e) => Fs(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
353
- for (let e of s.dead) Os.current.invalidate(e), ks.current.add(e);
354
- s.verified && !ks.current.has(s.verified) && Os.current.markVerified(s.verified), s.joined && dn(n, { prewarm: s.joined });
355
- let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Is(r, i, a, {
350
+ go,
351
+ Is
352
+ ]), Rs = D(async function e(t, n, r, i, a, o = {}) {
353
+ let s = await on(i, r, (e) => Is(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
354
+ for (let e of s.dead) ks.current.invalidate(e), As.current.add(e);
355
+ s.verified && !As.current.has(s.verified) && ks.current.markVerified(s.verified), s.joined && fn(n, { prewarm: s.joined });
356
+ let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Ls(r, i, a, {
356
357
  conversationId: t,
357
358
  assistantMessageId: n
358
- }, o.trustCache !== !1), ee = en(i, r, c);
359
- !s.waited && ee && dn(n, { prewarm: "hit" });
359
+ }, o.trustCache !== !1), ee = tn(i, r, c);
360
+ !s.waited && ee && fn(n, { prewarm: "hit" });
360
361
  let m = w.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, h = !1, g = null, _ = null;
361
- if (m && o.verifySession !== !0 && w.getState().sandboxWriteCapabilities[c]?.promptRejectsUnknownSession === !0 && w.getState().conversations.find((e) => e.id === t)?.mode === r && (_ = Ht(c, m)), m && _ === null) {
362
- let e = Vt(c, m, (e, t) => gt(e, i, t, r, a, { limit: 50 }));
362
+ if (m && o.verifySession !== !0 && w.getState().sandboxWriteCapabilities[c]?.promptRejectsUnknownSession === !0 && w.getState().conversations.find((e) => e.id === t)?.mode === r && (_ = Ut(c, m)), m && _ === null) {
363
+ let e = Ht(c, m, (e, t) => _t(e, i, t, r, a, { limit: 50 }));
363
364
  try {
364
- let t = await _t(c, i, m, r, a);
365
+ let t = await vt(c, i, m, r, a);
365
366
  if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
366
367
  g = e;
367
368
  } catch {
368
- mo(t), m = null;
369
+ ho(t), m = null;
369
370
  }
370
371
  }
371
372
  let te = !1;
372
373
  if (!m) {
373
- let e = $t(tn({
374
+ let e = en(nn({
374
375
  workspaceId: i,
375
376
  mode: r,
376
377
  sandboxId: c,
377
378
  userId: B
378
379
  }), Date.now());
379
380
  if (e) {
380
- "pending" in e && Fs(t, n, "connecting", "preparingSession");
381
+ "pending" in e && Is(t, n, "connecting", "preparingSession");
381
382
  let o = "sessionId" in e ? e.sessionId : await e.pending;
382
- if (o && !ks.current.has(c)) try {
383
- (await _t(c, i, o, r, a)).mode === r && (m = o, te = !0, po(t, m), h = !0);
383
+ if (o && !As.current.has(c)) try {
384
+ (await vt(c, i, o, r, a)).mode === r && (m = o, te = !0, mo(t, m), h = !0);
384
385
  } catch {}
385
386
  }
386
387
  }
387
388
  if (!m) {
388
- Fs(t, n, "connecting", "preparingSession");
389
+ Is(t, n, "connecting", "preparingSession");
389
390
  let s;
390
391
  try {
391
- s = await pt(c, i, r, a);
392
+ s = await mt(c, i, r, a);
392
393
  } catch (s) {
393
394
  if (p) {
394
- Os.current.invalidate(c);
395
- let l = Lr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
396
- if (l === "check-network" && (l = await Ir(() => mt(i, L, r, Fn(), a, ks.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
397
- p || dn(n, { cacheProofFailed: !0 }), l === "replace" && (ks.current.add(c), mo(t), go(r), K.retireSandbox(c));
395
+ ks.current.invalidate(c);
396
+ let l = Rr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
397
+ if (l === "check-network" && (l = await Lr(() => ht(i, L, r, In(), a, As.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
398
+ p || fn(n, { cacheProofFailed: !0 }), l === "replace" && (As.current.add(c), ho(t), _o(r), K.retireSandbox(c));
398
399
  let s = await e(t, n, r, i, a, {
399
400
  ...o,
400
401
  trustCache: !1
401
402
  });
402
- return p && (s.deadSandboxProbe || s.sandboxId !== c) && dn(n, { cacheProofFailed: !0 }), {
403
+ return p && (s.deadSandboxProbe || s.sandboxId !== c) && fn(n, { cacheProofFailed: !0 }), {
403
404
  ...s,
404
405
  sandboxProbed: s.sandboxProbed || u,
405
406
  sandboxAdopted: s.sandboxAdopted || d,
@@ -409,7 +410,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
409
410
  }
410
411
  throw s;
411
412
  }
412
- m = s.sessionId, po(t, m), h = !0;
413
+ m = s.sessionId, mo(t, m), h = !0;
413
414
  }
414
415
  return {
415
416
  sandboxId: c,
@@ -424,67 +425,67 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
424
425
  knownFloor: _
425
426
  };
426
427
  }, [
427
- Is,
428
- mo,
429
- go,
428
+ Ls,
429
+ ho,
430
+ _o,
430
431
  L,
431
432
  z,
432
- po,
433
- Fs,
433
+ mo,
434
+ Is,
434
435
  B,
435
436
  K
436
- ]), Rs = D((e, t = !1) => {
437
+ ]), zs = D((e, t = !1) => {
437
438
  let n = T();
438
439
  if (!n) return;
439
- let r = w.getState(), i = Date.now(), a = rn({
440
+ let r = w.getState(), i = Date.now(), a = an({
440
441
  autoRouting: r.autoRouting,
441
- autoOffered: rs.current,
442
+ autoOffered: is.current,
442
443
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
443
444
  selectedMode: r.mode,
444
445
  autoReadMode: b,
445
- modes: Yo.current,
446
+ modes: Xo.current,
446
447
  acknowledgedWriteModes: r.acknowledgedWriteModes,
447
- adminAccess: Jo.read(),
448
+ adminAccess: Yo.read(),
448
449
  dictated: e,
449
- voiceProposalBound: (e) => Va(e),
450
- turnInFlight: Object.values(r.processingByConversationId).some((e) => jn(e?.status)),
451
- ...cn(n),
450
+ voiceProposalBound: (e) => Ha(e),
451
+ turnInFlight: Object.values(r.processingByConversationId).some((e) => Mn(e?.status)),
452
+ ...ln(n),
452
453
  now: i
453
454
  });
454
455
  if (!a) return;
455
- let o = sn(n, a, i), s = {
456
- accessToken: Ha(),
457
- workspaceToken: Ua(),
456
+ let o = cn(n, a, i), s = {
457
+ accessToken: Ua(),
458
+ workspaceToken: Wa(),
458
459
  userId: B,
459
- organizationId: Wt()
460
+ organizationId: Gt()
460
461
  };
461
- Is(a.mode, n, s, null, !0, o).then((e) => {
462
+ Ls(a.mode, n, s, null, !0, o).then((e) => {
462
463
  if (o.finish({
463
464
  ok: !0,
464
465
  sandboxId: e.sandboxId,
465
466
  didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
466
467
  booted: e.sandboxIsNew || e.sandboxAdopted,
467
468
  dead: o.dead
468
- }), o.signal.aborted || T() !== n || ks.current.has(e.sandboxId)) return;
469
- let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = Xi();
470
- nn({
469
+ }), o.signal.aborted || T() !== n || As.current.has(e.sandboxId)) return;
470
+ let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = Zi();
471
+ rn({
471
472
  active: i ? {
472
473
  mode: i.mode,
473
474
  backendSessionId: i.backendSessionId,
474
- continuable: !Gi(i) && !Wi(i, c),
475
- hasHistory: Ui(i)
475
+ continuable: !Ki(i) && !Gi(i, c),
476
+ hasHistory: Wi(i)
476
477
  } : void 0,
477
478
  mode: a.mode
478
- }) && on(tn({
479
+ }) && sn(nn({
479
480
  workspaceId: n,
480
481
  mode: a.mode,
481
482
  sandboxId: e.sandboxId,
482
483
  userId: B
483
- }), () => pt(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
484
+ }), () => mt(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
484
485
  }, (e) => {
485
- if (!(e instanceof Qt) && !o.signal.aborted && T() === n) {
486
+ if (!(e instanceof $t) && !o.signal.aborted && T() === n) {
486
487
  let e = w.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
487
- e && (Os.current.invalidate(e), ks.current.add(e), o.dead.push(e), go(a.mode));
488
+ e && (ks.current.invalidate(e), As.current.add(e), o.dead.push(e), _o(a.mode));
488
489
  }
489
490
  o.finish({
490
491
  ok: !1,
@@ -494,68 +495,68 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
494
495
  });
495
496
  });
496
497
  }, [
497
- Is,
498
- Jo,
499
- go,
500
- Ha,
498
+ Ls,
499
+ Yo,
500
+ _o,
501
501
  Ua,
502
+ Wa,
502
503
  B,
503
- Va
504
- ]), zs = A(!1), Bs = A(null), Vs = k(() => a(), []);
505
- O(() => () => Vs.cancel(), [Vs]);
506
- let Hs = ca(Pr, kr, kr)?.reference ?? null, [Us, Ws] = j(0), Gs = A(/* @__PURE__ */ new Set()), Ks = A(null), qs = D(() => {
504
+ Ha
505
+ ]), Bs = A(!1), Vs = A(null), Hs = k(() => a(), []);
506
+ O(() => () => Hs.cancel(), [Hs]);
507
+ let Us = la(Fr, Ar, Ar)?.reference ?? null, [Ws, Gs] = j(0), Ks = A(/* @__PURE__ */ new Set()), qs = A(null), Js = D(() => {
507
508
  let e = w.getState(), t = e.activeConversationId;
508
509
  if (!t) return null;
509
- let n = e.processingByConversationId[t], r = jn(n?.status) ? n?.messageId ?? null : null;
510
- if (!Nn({
510
+ let n = e.processingByConversationId[t], r = Mn(n?.status) ? n?.messageId ?? null : null;
511
+ if (!Pn({
511
512
  interruptedTurnId: r,
512
513
  activeTurnId: r,
513
- alreadyRequested: r ? Gs.current.has(r) : !1
514
+ alreadyRequested: r ? Ks.current.has(r) : !1
514
515
  }).send || !r) return null;
515
- Gs.current.add(r);
516
- let i = lt(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
517
- return i && a && o && ut(i.sandboxId, a, o, i.mode, {
518
- accessToken: Ha(),
519
- workspaceToken: Ua(),
516
+ Ks.current.add(r);
517
+ let i = ut(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
518
+ return i && a && o && dt(i.sandboxId, a, o, i.mode, {
519
+ accessToken: Ua(),
520
+ workspaceToken: Wa(),
520
521
  userId: B,
521
- organizationId: Wt()
522
+ organizationId: Gt()
522
523
  }), r;
523
524
  }, [
524
525
  B,
525
- Ha,
526
- Ua
527
- ]), Js = D(() => {
528
- let e = qs();
529
- return e && (Ft(e), Mt.abort(e)), e;
530
- }, [qs]), Ys = D(() => {
526
+ Ua,
527
+ Wa
528
+ ]), Ys = D(() => {
529
+ let e = Js();
530
+ return e && (It(e), Nt.abort(e)), e;
531
+ }, [Js]), Xs = D(() => {
531
532
  let e = w.getState().activeConversationId;
532
- Js(), e && K.declineForReply(e, "corrected", "spoken");
533
- }, [Js, K]), Xs = D(async (e) => {
534
- let t = w.getState(), n = lt(t), r = T(), i = t.activeConversationId;
533
+ Ys(), e && K.declineForReply(e, "corrected", "spoken");
534
+ }, [Ys, K]), Zs = D(async (e) => {
535
+ let t = w.getState(), n = ut(t), r = T(), i = t.activeConversationId;
535
536
  if (!n || !r || !i || oe(t.sandboxWriteCapabilities[n.sandboxId])) return;
536
- let a = t.conversations.find((e) => e.id === i), o = a ? Mr(ur(a.messages), {
537
+ let a = t.conversations.find((e) => e.id === i), o = a ? Nr(dr(a.messages), {
537
538
  sessionId: a.backendSessionId,
538
539
  sandboxId: n.sandboxId,
539
540
  nowMs: Date.now()
540
541
  }) : null;
541
542
  if (o?.reference !== e) {
542
- Ws((e) => e + 1);
543
+ Gs((e) => e + 1);
543
544
  return;
544
545
  }
545
546
  let s = {
546
547
  conversationId: i,
547
548
  reference: e
548
549
  };
549
- if (!Dr(s)) return;
550
+ if (!Or(s)) return;
550
551
  try {
551
- await dt(n.sandboxId, r, e, n.mode, {
552
- accessToken: Ha(),
553
- workspaceToken: Ua(),
552
+ await ft(n.sandboxId, r, e, n.mode, {
553
+ accessToken: Ua(),
554
+ workspaceToken: Wa(),
554
555
  userId: B,
555
- organizationId: Wt()
556
+ organizationId: Gt()
556
557
  });
557
558
  } catch (e) {
558
- Or(s), W(i, {
559
+ kr(s), W(i, {
559
560
  id: N(),
560
561
  role: "system",
561
562
  content: e instanceof Error ? e.message : "The change could not be approved.",
@@ -563,70 +564,70 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
563
564
  });
564
565
  return;
565
566
  }
566
- Or(s), lo(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
567
+ kr(s), uo(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
567
568
  let c = w.getState(), l = c.conversations.find((e) => e.id === i);
568
- c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && lt(c)?.sandboxId === n.sandboxId && !jn(c.processingByConversationId[i]?.status) && jr(ur(l.messages)) === o.messageId && tl.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
569
+ c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && ut(c)?.sandboxId === n.sandboxId && !Mn(c.processingByConversationId[i]?.status) && Mr(dr(l.messages)) === o.messageId && nl.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
569
570
  approvalFollowUp: { approvedReplyId: o.messageId },
570
571
  targetConversationId: i
571
572
  });
572
573
  }, [
573
574
  B,
574
575
  W,
575
- lo,
576
+ uo,
576
577
  P
577
- ]), Zs = na(), { speakFinishedReply: Qs, speakingMessageId: $s, stop: ec } = ea(), tc = A(null), nc = D((e, t) => {
578
- let n = tc.current;
578
+ ]), Qs = ra(), { speakFinishedReply: $s, speakingMessageId: ec, stop: tc } = ta(), nc = A(null), rc = D((e, t) => {
579
+ let n = nc.current;
579
580
  n?.token === e && n.exchange === null && (n.exchange = t);
580
- }, []), rc = D((e) => {
581
- let t = tc.current;
581
+ }, []), ic = D((e) => {
582
+ let t = nc.current;
582
583
  e !== void 0 && t?.token === e && (t.handled = !0);
583
- }, []), ic = D((e, t) => {
584
- nc(e, t), gs.current && Nt(t);
585
- }, [nc]), ac = $i(), { items: oc, permissionsSettled: sc, simulating: cc } = ra(), Y = A({
586
- theme: Zs,
587
- navigate: ac,
588
- navItems: oc,
589
- options: Ba ?? {},
590
- navPermissionsSettled: sc,
591
- navSimulating: cc
584
+ }, []), ac = D((e, t) => {
585
+ rc(e, t), _s.current && Pt(t);
586
+ }, [rc]), oc = ea(), { items: sc, permissionsSettled: cc, simulating: lc } = ia(), Y = A({
587
+ theme: Qs,
588
+ navigate: oc,
589
+ navItems: sc,
590
+ options: Va ?? {},
591
+ navPermissionsSettled: cc,
592
+ navSimulating: lc
592
593
  });
593
594
  O(() => {
594
595
  Y.current = {
595
- theme: Zs,
596
- navigate: ac,
597
- navItems: oc,
598
- options: Ba ?? {},
599
- navPermissionsSettled: sc,
600
- navSimulating: cc
596
+ theme: Qs,
597
+ navigate: oc,
598
+ navItems: sc,
599
+ options: Va ?? {},
600
+ navPermissionsSettled: cc,
601
+ navSimulating: lc
601
602
  };
602
603
  }, [
603
- Zs,
604
- ac,
604
+ Qs,
605
605
  oc,
606
- Ba,
607
606
  sc,
608
- cc
607
+ Va,
608
+ cc,
609
+ lc
609
610
  ]);
610
611
  let X = A(!0);
611
612
  O(() => (X.current = !0, () => {
612
613
  X.current = !1;
613
614
  }), []);
614
- let lc = A({
615
+ let uc = A({
615
616
  tr: P,
616
617
  locale: V
617
- }), uc = A(null), [dc, fc] = j(null), pc = A(null), mc = D((e) => {
618
- pc.current !== null && (window.clearTimeout(pc.current), pc.current = null);
619
- let t = uc.current;
620
- t && (uc.current = null, window.clearTimeout(t.deadline), X.current && fc(null), e && X.current && (pc.current = window.setTimeout(() => {
621
- if (pc.current = null, !X.current) return;
618
+ }), dc = A(null), [fc, pc] = j(null), mc = A(null), hc = D((e) => {
619
+ mc.current !== null && (window.clearTimeout(mc.current), mc.current = null);
620
+ let t = dc.current;
621
+ t && (dc.current = null, window.clearTimeout(t.deadline), X.current && pc(null), e && X.current && (mc.current = window.setTimeout(() => {
622
+ if (mc.current = null, !X.current) return;
622
623
  let e = w.getState();
623
624
  if (e.activeConversationId !== t.conversationId) return;
624
625
  let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
625
626
  if (!n) return;
626
- let r = lc.current, i = tr(n, null, r.tr);
627
+ let r = uc.current, i = nr(n, null, r.tr);
627
628
  if (i.kind !== "output") return;
628
- let a = si(n, r.tr);
629
- Mt.publish(n.id, {
629
+ let a = ci(n, r.tr);
630
+ Nt.publish(n.id, {
630
631
  conversationId: t.conversationId,
631
632
  channel: n.metadata?.voice === !0 ? "voice" : "chat",
632
633
  voiceSessionId: n.metadata?.voiceSessionId,
@@ -635,44 +636,44 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
635
636
  final: !0
636
637
  });
637
638
  }, 0)));
638
- }, []), hc = D(() => mc(!0), [mc]);
639
+ }, []), gc = D(() => hc(!0), [hc]);
639
640
  O(() => {
640
- lc.current = {
641
+ uc.current = {
641
642
  tr: P,
642
643
  locale: V
643
644
  };
644
- let e = uc.current;
645
+ let e = dc.current;
645
646
  if (!e) return;
646
- let t = ci({
647
+ let t = li({
647
648
  wanted: e.wanted,
648
649
  locale: V,
649
- isLoading: Wa(e.wanted),
650
- translatedNow: ai(P, e.reply).translated
650
+ isLoading: Ga(e.wanted),
651
+ translatedNow: oi(P, e.reply).translated
651
652
  });
652
- if (t === "write") hc();
653
+ if (t === "write") gc();
653
654
  else if (t === "grace") {
654
- let e = window.setTimeout(hc, 400);
655
+ let e = window.setTimeout(gc, 400);
655
656
  return () => window.clearTimeout(e);
656
657
  }
657
658
  }, [
658
659
  P,
659
660
  V,
660
- Wa,
661
- dc,
662
- hc
663
- ]), O(() => () => mc(!1), [mc]);
664
- let gc = A(null), [_c, vc] = j(!1), [yc, bc] = j(null), [Z] = j(() => new Ei()), [xc, Sc] = j(0), Cc = D(() => Sc((e) => e + 1), []), wc = D(() => {
661
+ Ga,
662
+ fc,
663
+ gc
664
+ ]), O(() => () => hc(!1), [hc]);
665
+ let _c = A(null), [vc, yc] = j(!1), [bc, xc] = j(null), [Z] = j(() => new Di()), [Sc, Cc] = j(0), wc = D(() => Cc((e) => e + 1), []), Tc = D(() => {
665
666
  let e = Y.current;
666
667
  return {
667
- destinations: Hr(e.navItems),
668
+ destinations: Ur(e.navItems),
668
669
  permissionsSettled: e.navPermissionsSettled,
669
670
  simulating: e.navSimulating
670
671
  };
671
- }, []), Tc = A(B);
672
+ }, []), Ec = A(B);
672
673
  O(() => {
673
- Tc.current = B;
674
+ Ec.current = B;
674
675
  }, [B]);
675
- let Ec = D((e, t) => {
676
+ let Dc = D((e, t) => {
676
677
  let n = Z.replyIdOf(e), r = n ? Z.turnFor(n) : void 0, i = Z.offer(e), a = {
677
678
  ok: !1,
678
679
  reason: "gone",
@@ -684,22 +685,22 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
684
685
  let o = r.conversationId, s = w.getState().conversations.find((e) => e.id === o);
685
686
  if (!s) return a;
686
687
  let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = Z.liveOffersFor(n, {
687
- registry: wc(),
688
- actorId: Tc.current,
688
+ registry: Tc(),
689
+ actorId: Ec.current,
689
690
  conversationId: o,
690
691
  perfNow: performance.now()
691
692
  }).find((t) => t.offer.offerId === e);
692
693
  if (!u) {
693
- let e = ki(i, performance.now());
694
+ let e = Ai(i, performance.now());
694
695
  return {
695
696
  ok: !1,
696
697
  reason: e ? "unavailable" : "expired",
697
- copy: e ? $r(P, t || null) : Zr(P),
698
+ copy: e ? ei(P, t || null) : Qr(P),
698
699
  conversationId: o,
699
700
  voiceSessionId: l
700
701
  };
701
702
  }
702
- return Z.markUsed(e) ? (Cc(), {
703
+ return Z.markUsed(e) ? (wc(), {
703
704
  ok: !0,
704
705
  target: u.target,
705
706
  conversationId: o,
@@ -707,10 +708,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
707
708
  }) : a;
708
709
  }, [
709
710
  Z,
710
- wc,
711
+ Tc,
711
712
  P,
712
- Cc
713
- ]), Dc = D((e, t, n, r, i) => {
713
+ wc
714
+ ]), Oc = D((e, t, n, r, i) => {
714
715
  let a = N();
715
716
  W(e, {
716
717
  id: a,
@@ -720,20 +721,20 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
720
721
  metadata: {
721
722
  lang: n.translated ? V : "en",
722
723
  ...i ? { localAction: i } : {},
723
- ...fr(t)
724
+ ...pr(t)
724
725
  }
725
- }), i && Hi.recordCommittedEntries(e, [a], "NOTE", r);
726
- }, [W, V]), Oc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), kc = A(null);
726
+ }), i && Ui.recordCommittedEntries(e, [a], "NOTE", r);
727
+ }, [W, V]), kc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Ac = A(null);
727
728
  O(() => () => {
728
- kc.current?.(), kc.current = null;
729
+ Ac.current?.(), Ac.current = null;
729
730
  }, []);
730
- let Ac = D((e) => {
731
- kc.current?.(), kc.current = X.current ? hi(document, e) : null;
732
- }, []), jc = D((e, t, n, r = !1) => {
733
- if (gc.current !== null) return;
734
- let i = Ec(e, n), a = T(), o = (e, t, n, r) => Dc(e, t, n, a, r);
731
+ let jc = D((e) => {
732
+ Ac.current?.(), Ac.current = X.current ? gi(document, e) : null;
733
+ }, []), Mc = D((e, t, n, r = !1) => {
734
+ if (_c.current !== null) return;
735
+ let i = Dc(e, n), a = T(), o = (e, t, n, r) => Oc(e, t, n, a, r);
735
736
  if (!i.ok) {
736
- i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), Cc();
737
+ i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), wc();
737
738
  return;
738
739
  }
739
740
  let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
@@ -741,7 +742,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
741
742
  offerId: e
742
743
  };
743
744
  if (r) {
744
- o(c, l, Yr(P, s.label, !0), Li({
745
+ o(c, l, Xr(P, s.label, !0), Ri({
745
746
  destinationId: s.id,
746
747
  path: s.path,
747
748
  alreadyHere: !0,
@@ -751,16 +752,16 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
751
752
  return;
752
753
  }
753
754
  let d = N();
754
- gc.current = d, vc(!0);
755
+ _c.current = d, yc(!0);
755
756
  let f = (t) => {
756
757
  try {
757
- if (Oc(e, t) && (Cc(), t.status === "kept" && Ac(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
758
+ if (kc(e, t) && (wc(), t.status === "kept" && jc(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
758
759
  let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
759
- o(c, l, Xr(P, t, {
760
+ o(c, l, Zr(P, t, {
760
761
  page: s.label,
761
- landed: n === null ? null : zi(Hr(Y.current.navItems), n),
762
+ landed: n === null ? null : Bi(Ur(Y.current.navItems), n),
762
763
  path: s.path
763
- }), Li({
764
+ }), Ri({
764
765
  destinationId: s.id,
765
766
  path: s.path,
766
767
  alreadyHere: !1,
@@ -769,10 +770,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
769
770
  offer: u
770
771
  }));
771
772
  } finally {
772
- gc.current === d && (gc.current = null, X.current && vc(!1));
773
+ _c.current === d && (_c.current = null, X.current && yc(!1));
773
774
  }
774
775
  };
775
- Vi(Y.current.navigate, s.path, {
776
+ Hi(Y.current.navigate, s.path, {
776
777
  readPath: () => window.location.pathname + window.location.search,
777
778
  now: () => Date.now(),
778
779
  schedule: (e, t) => {
@@ -783,20 +784,20 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
783
784
  surface: "offer"
784
785
  }).then(f, () => f({ status: "unconfirmed" }));
785
786
  }, [
786
- Ec,
787
787
  Dc,
788
- P,
789
- Cc,
790
788
  Oc,
791
- Ac
792
- ]), Mc = D((e, t) => jc(e, "tap", t || null), [jc]), Nc = D((e) => {
789
+ P,
790
+ wc,
791
+ kc,
792
+ jc
793
+ ]), Nc = D((e, t) => Mc(e, "tap", t || null), [Mc]), Pc = D((e) => {
793
794
  let { replyId: t, conversationId: n } = e, r = Z.turnFor(t);
794
795
  if (!r) return;
795
- let i = window.location.pathname + window.location.search, a = Hr(Y.current.navItems), o = ji({
796
+ let i = window.location.pathname + window.location.search, a = Ur(Y.current.navItems), o = Mi({
796
797
  intent: e.intent,
797
798
  live: Z.liveOffersFor(t, {
798
- registry: wc(),
799
- actorId: Tc.current,
799
+ registry: Tc(),
800
+ actorId: Ec.current,
800
801
  conversationId: n,
801
802
  perfNow: performance.now()
802
803
  }),
@@ -808,50 +809,50 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
808
809
  location: i,
809
810
  conversationId: w.getState().activeConversationId,
810
811
  workspaceId: T(),
811
- actorId: Tc.current ?? null
812
+ actorId: Ec.current ?? null
812
813
  },
813
814
  mounted: X.current,
814
815
  visible: document.visibilityState === "visible",
815
- unsavedChanges: Mi(Y.current.options),
816
+ unsavedChanges: Ni(Y.current.options),
816
817
  alreadyThere: ({ target: e }) => {
817
818
  let t = a.find((t) => t.id === e.id);
818
- return t ? zr(t, i, a) : !1;
819
+ return t ? Br(t, i, a) : !1;
819
820
  }
820
821
  });
821
822
  if (o.act === "navigate" || o.act === "already-here") {
822
- jc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
823
+ Mc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
823
824
  return;
824
825
  }
825
826
  let [s] = o.unsaved ?? [], [c] = Z.liveOffersFor(t, {
826
- registry: wc(),
827
- actorId: Tc.current,
827
+ registry: Tc(),
828
+ actorId: Ec.current,
828
829
  conversationId: n,
829
830
  perfNow: performance.now()
830
831
  });
831
- o.hold === "R5-unsaved" && s && c && Dc(n, e.voiceSessionId, Qr(P, s.label, c.target.label), T());
832
+ o.hold === "R5-unsaved" && s && c && Oc(n, e.voiceSessionId, $r(P, s.label, c.target.label), T());
832
833
  }, [
833
834
  Z,
834
- wc,
835
+ Tc,
835
836
  K,
836
- jc,
837
- Dc,
837
+ Mc,
838
+ Oc,
838
839
  P
839
- ]), Pc = D((e) => {
840
+ ]), Fc = D((e) => {
840
841
  let t = w.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
841
- return n ? Fi(Pi, window.location.pathname, Bi(n.messages, e)) : !1;
842
- }, []), Fc = Se(), Ic = pi(), Lc = Fc?.request ?? null, Rc = D((e, t, n = !1, r = !1) => {
843
- let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Hr(i), l = null, u = {
842
+ return n ? Ii(Fi, window.location.pathname, Vi(n.messages, e)) : !1;
843
+ }, []), Ic = Ce(), Lc = mi(), Rc = Ic?.request ?? null, zc = D((e, t, n = !1, r = !1) => {
844
+ let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Ur(i), l = null, u = {
844
845
  ...a,
845
- locale: t === void 0 ? V : Za.input.code,
846
+ locale: t === void 0 ? V : Qa.input.code,
846
847
  uiLocale: V,
847
- inputLocale: Za.input.code
848
+ inputLocale: Qa.input.code
848
849
  };
849
- if (r || Vr(e, u)) {
850
- let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? _i(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && jn(o.status);
850
+ if (r || Hr(e, u)) {
851
+ let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? vi(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && Mn(o.status);
851
852
  if (n && r && !s) {
852
853
  let e = Z.liveOffersFor(r.id, {
853
- registry: wc(),
854
- actorId: Tc.current,
854
+ registry: Tc(),
855
+ actorId: Ec.current,
855
856
  conversationId: n.id,
856
857
  perfNow: performance.now()
857
858
  }).flatMap(({ offer: e, target: t }) => {
@@ -861,14 +862,14 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
861
862
  target: n
862
863
  }] : [];
863
864
  });
864
- l = gi({
865
+ l = _i({
865
866
  reply: r,
866
- text: ir(r, o, P),
867
+ text: ar(r, o, P),
867
868
  resolve: {
868
869
  destinations: c,
869
870
  entityRoutes: a.entityRoutes,
870
- visibleNavIds: bi(i),
871
- nounLabel: (e) => qr(P, e)
871
+ visibleNavIds: xi(i),
872
+ nounLabel: (e) => Jr(P, e)
872
873
  },
873
874
  offers: e
874
875
  });
@@ -878,18 +879,18 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
878
879
  destinations: c,
879
880
  sentenceOptions: u,
880
881
  context: {
881
- backRunnable: Pc(t),
882
+ backRunnable: Fc(t),
882
883
  navigation: l,
883
884
  skipRecords: n,
884
- controls: ui(),
885
+ controls: di(),
885
886
  executors: {
886
887
  theme: o !== null,
887
888
  navigation: s !== null,
888
- conversationDelete: Lc !== null,
889
+ conversationDelete: Rc !== null,
889
890
  appControl: (e) => {
890
891
  try {
891
- let n = li(e, { voiceLive: t !== void 0 || Jl.current });
892
- return n !== null && (n.kind !== "confirm" || Ic !== null);
892
+ let n = ui(e, { voiceLive: t !== void 0 || Yl.current });
893
+ return n !== null && (n.kind !== "confirm" || Lc !== null);
893
894
  } catch {
894
895
  return !1;
895
896
  }
@@ -898,34 +899,34 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
898
899
  }
899
900
  };
900
901
  }, [
901
- Pc,
902
- Za,
902
+ Fc,
903
+ Qa,
903
904
  V,
904
905
  P,
905
906
  Z,
906
- wc,
907
- Lc,
908
- Ic
909
- ]), zc = D((e, t, n = !1) => {
910
- let { destinations: r, sentenceOptions: i, context: a } = Rc(e, t, n);
911
- return Br(e, r, i, a);
912
- }, [Rc]), Bc = D((e) => {
913
- if (Bs.current = e, Ea?.(De(e)), Vs.cancel(), !e.text.trim() && !e.hasAttachments) {
914
- zs.current = !1;
907
+ Tc,
908
+ Rc,
909
+ Lc
910
+ ]), Bc = D((e, t, n = !1) => {
911
+ let { destinations: r, sentenceOptions: i, context: a } = zc(e, t, n);
912
+ return Vr(e, r, i, a);
913
+ }, [zc]), Vc = D((e) => {
914
+ if (Vs.current = e, Da?.(Oe(e)), Hs.cancel(), !e.text.trim() && !e.hasAttachments) {
915
+ Bs.current = !1;
915
916
  return;
916
917
  }
917
- if (zs.current) return;
918
+ if (Bs.current) return;
918
919
  let t = () => {
919
- zs.current = !0, Rs(!1);
920
+ Bs.current = !0, zs(!1);
920
921
  };
921
- e.hasAttachments || e.dictated ? t() : Vs.schedule(() => {
922
- if (!zs.current) {
922
+ e.hasAttachments || e.dictated ? t() : Hs.schedule(() => {
923
+ if (!Bs.current) {
923
924
  try {
924
- let { destinations: t, sentenceOptions: n, context: r } = Rc(e.text, void 0, !1, !0);
925
- if (Rr(e.text, t, n, r)) return;
925
+ let { destinations: t, sentenceOptions: n, context: r } = zc(e.text, void 0, !1, !0);
926
+ if (zr(e.text, t, n, r)) return;
926
927
  } catch {
927
- if (!ga) {
928
- ga = !0;
928
+ if (!_a) {
929
+ _a = !0;
929
930
  try {
930
931
  i.getLogger("assistant").warn("Draft command classification failed; using standard warm-up.");
931
932
  } catch {}
@@ -935,36 +936,36 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
935
936
  }
936
937
  });
937
938
  }, [
938
- Vs,
939
- Ea,
940
- Rs,
941
- Rc
939
+ Hs,
940
+ Da,
941
+ zs,
942
+ zc
942
943
  ]);
943
944
  O(() => {
944
945
  let e = () => {
945
- Bs.current && Bc(Bs.current);
946
- }, t = di(e), n = Ii(window, e), r = Pi.subscribe(e);
946
+ Vs.current && Vc(Vs.current);
947
+ }, t = fi(e), n = Li(window, e), r = Fi.subscribe(e);
947
948
  return () => {
948
- t(), n(), r(), Vs.cancel();
949
+ t(), n(), r(), Hs.cancel();
949
950
  };
950
- }, [Vs, Bc]), O(() => {
951
- Bs.current && Bc(Bs.current);
951
+ }, [Hs, Vc]), O(() => {
952
+ Vs.current && Vc(Vs.current);
952
953
  }, [
953
- Bc,
954
- oc,
955
- Ba,
954
+ Vc,
956
955
  sc,
956
+ Va,
957
957
  cc,
958
- Zs,
959
- ac,
958
+ lc,
959
+ Qs,
960
+ oc,
960
961
  U,
961
- xc,
962
+ Sc,
962
963
  H,
963
964
  G?.messages,
964
- wo
965
+ To
965
966
  ]);
966
- let Vc = D((e, t) => {
967
- let n = zc(e, t);
967
+ let Hc = D((e, t) => {
968
+ let n = Bc(e, t);
968
969
  if (!n) return !1;
969
970
  let { theme: r, navigate: i } = Y.current;
970
971
  switch (n.kind) {
@@ -976,14 +977,14 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
976
977
  case "link-not-openable":
977
978
  case "back": return i !== null;
978
979
  case "conversation-delete": return !1;
979
- case "app-control": return li(n.request, { voiceLive: t !== void 0 || Jl.current }) !== null;
980
+ case "app-control": return ui(n.request, { voiceLive: t !== void 0 || Yl.current }) !== null;
980
981
  case "open-record": return !1;
981
982
  }
982
- }, [zc]), Hc = A(Vc);
983
+ }, [Bc]), Uc = A(Hc);
983
984
  O(() => {
984
- Hc.current = Vc;
985
- }, [Vc]);
986
- let Uc = D((e, t) => {
985
+ Uc.current = Hc;
986
+ }, [Hc]);
987
+ let Wc = D((e, t) => {
987
988
  let n = {
988
989
  state: "none",
989
990
  accept: null
@@ -992,16 +993,16 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
992
993
  let o = w.getState(), s = o.conversations.find((t) => t.id === e);
993
994
  if (!s) return n;
994
995
  let c = o.processingByConversationId[s.id] ?? null, l = {
995
- registry: wc(),
996
- actorId: Tc.current,
996
+ registry: Tc(),
997
+ actorId: Ec.current,
997
998
  conversationId: s.id,
998
999
  perfNow: performance.now()
999
- }, { state: u, reply: d } = Ti(Z, {
1000
+ }, { state: u, reply: d } = Ei(Z, {
1000
1001
  ...l,
1001
1002
  messages: s.messages,
1002
1003
  voiceSessionId: t,
1003
1004
  processing: c,
1004
- displayedText: (e) => ir(e, c, P),
1005
+ displayedText: (e) => ar(e, c, P),
1005
1006
  productWriteApproval: z,
1006
1007
  capabilitiesOf: (e) => w.getState().sandboxWriteCapabilities[e]
1007
1008
  });
@@ -1009,7 +1010,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1009
1010
  state: u,
1010
1011
  accept: null
1011
1012
  };
1012
- let [f] = Z.liveOffersFor(d.id, l), p = f ? Hr(a).find((e) => e.id === f.target.id) : void 0;
1013
+ let [f] = Z.liveOffersFor(d.id, l), p = f ? Ur(a).find((e) => e.id === f.target.id) : void 0;
1013
1014
  return !f || !p ? n : {
1014
1015
  state: u,
1015
1016
  accept: {
@@ -1019,10 +1020,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1019
1020
  };
1020
1021
  }, [
1021
1022
  Z,
1022
- wc,
1023
+ Tc,
1023
1024
  z,
1024
1025
  P
1025
- ]), Wc = D((e, t, n, r, i, a) => {
1026
+ ]), Gc = D((e, t, n, r, i, a) => {
1026
1027
  let o = P(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
1027
1028
  kind: "write-reply",
1028
1029
  line: n.key
@@ -1034,7 +1035,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1034
1035
  timestamp: l,
1035
1036
  metadata: {
1036
1037
  localAction: c,
1037
- ...fr(i)
1038
+ ...pr(i)
1038
1039
  }
1039
1040
  });
1040
1041
  let d = N();
@@ -1046,55 +1047,55 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1046
1047
  metadata: {
1047
1048
  lang: o === s ? "en" : V,
1048
1049
  localAction: c,
1049
- ...fr(i)
1050
+ ...pr(i)
1050
1051
  }
1051
- }), Hi.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && ic(a, {
1052
+ }), Ui.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && ac(a, {
1052
1053
  conversationId: e,
1053
1054
  questionId: u,
1054
1055
  replyId: d
1055
- }), Qs(e, d);
1056
+ }), $s(e, d);
1056
1057
  }, [
1057
1058
  W,
1058
1059
  V,
1059
- ic,
1060
- Qs,
1060
+ ac,
1061
+ $s,
1061
1062
  P
1062
- ]), Gc = A(() => void 0), [Kc, qc] = j(null);
1063
+ ]), Kc = A(() => void 0), [qc, Jc] = j(null);
1063
1064
  O(() => {
1064
- if (Kc === null) return;
1065
- let e = window.setTimeout(() => qc(null), va);
1065
+ if (qc === null) return;
1066
+ let e = window.setTimeout(() => Jc(null), ya);
1066
1067
  return () => window.clearTimeout(e);
1067
- }, [Kc]);
1068
- let Jc = D(() => {
1068
+ }, [qc]);
1069
+ let Yc = D(() => {
1069
1070
  let e = w.getState();
1070
- return oo(void 0, e.autoRouting && rs.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1071
- }, [oo]), Yc = D((e) => {
1072
- if (!Lc) return !1;
1073
- let t = e !== void 0, n = w.getState(), r = Qi({
1071
+ return so(void 0, e.autoRouting && is.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1072
+ }, [so]), Xc = D((e) => {
1073
+ if (!Rc) return !1;
1074
+ let t = e !== void 0, n = w.getState(), r = $i({
1074
1075
  spoken: t,
1075
- bound: vs.current,
1076
+ bound: ys.current,
1076
1077
  activeConversationId: n.activeConversationId,
1077
1078
  conversations: n.conversations,
1078
- historyOn: Ce()
1079
+ historyOn: we()
1079
1080
  });
1080
- if (r && Lc(r), t) {
1081
+ if (r && Rc(r), t) {
1081
1082
  let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? P("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : P("deleteConversation.nothing", "There is no conversation to delete.");
1082
- Gc.current({
1083
+ Kc.current({
1083
1084
  id: `conversation-delete:${N()}`,
1084
1085
  text: t,
1085
1086
  lang: t === e ? "en" : V
1086
1087
  });
1087
- } else r || qc(Date.now());
1088
+ } else r || Jc(Date.now());
1088
1089
  return !0;
1089
1090
  }, [
1090
- Lc,
1091
+ Rc,
1091
1092
  V,
1092
1093
  P
1093
- ]), Xc = D((e, t, n, r = !1, i) => {
1094
- if (e.kind === "conversation-delete") return Yc(n);
1094
+ ]), Zc = D((e, t, n, r = !1, i) => {
1095
+ if (e.kind === "conversation-delete") return Xc(n);
1095
1096
  let { theme: a, navigate: o } = Y.current, s = null, c = () => {
1096
- let e = (r ? null : s ?? w.getState().activeConversationId) ?? Jc();
1097
- return r && Cs(e), e;
1097
+ let e = (r ? null : s ?? w.getState().activeConversationId) ?? Yc();
1098
+ return r && ws(e), e;
1098
1099
  }, l = (e, r) => {
1099
1100
  let i = N();
1100
1101
  return W(e, {
@@ -1104,7 +1105,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1104
1105
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1105
1106
  metadata: {
1106
1107
  localAction: r,
1107
- ...fr(n)
1108
+ ...pr(n)
1108
1109
  }
1109
1110
  }), i;
1110
1111
  }, u = (e, t, r, a, o, s, c) => {
@@ -1117,35 +1118,35 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1117
1118
  metadata: {
1118
1119
  lang: r.translated ? V : "en",
1119
1120
  localAction: a,
1120
- ...fr(n)
1121
+ ...pr(n)
1121
1122
  }
1122
- }), Hi.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && ic(i, {
1123
+ }), Ui.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && ac(i, {
1123
1124
  conversationId: e,
1124
1125
  questionId: t,
1125
1126
  replyId: l
1126
- }), s && Qs(e, l), l;
1127
+ }), s && $s(e, l), l;
1127
1128
  }, d = (e, t, n) => {
1128
1129
  let r = c(), i = l(r, t), a = u(r, i, e, t, T(), !0);
1129
1130
  return n?.(a), !0;
1130
1131
  }, f = (e) => {
1131
- let t = c(), n = T(), r = window.location.pathname, a = Li({
1132
+ let t = c(), n = T(), r = window.location.pathname, a = Ri({
1132
1133
  destinationId: e.destinationId,
1133
1134
  path: e.registryPath,
1134
1135
  alreadyHere: !1,
1135
1136
  via: e.via,
1136
1137
  offer: e.offer
1137
1138
  }), s = l(t, a), d = i === void 0 ? void 0 : N();
1138
- i !== void 0 && d !== void 0 && (nc(i, {
1139
+ i !== void 0 && d !== void 0 && (rc(i, {
1139
1140
  conversationId: t,
1140
1141
  questionId: s,
1141
1142
  replyId: d
1142
- }), bc(d));
1143
+ }), xc(d));
1143
1144
  let f = N();
1144
- gc.current = f, vc(!0);
1145
+ _c.current = f, yc(!0);
1145
1146
  let p = (i) => {
1146
1147
  try {
1147
- if (e.offer && Oc(e.offer.offerId, i) && Cc(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
1148
- let a = Hr(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Li({
1148
+ if (e.offer && kc(e.offer.offerId, i) && wc(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
1149
+ let a = Ur(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Ri({
1149
1150
  destinationId: e.destinationId,
1150
1151
  path: e.registryPath,
1151
1152
  alreadyHere: !1,
@@ -1153,10 +1154,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1153
1154
  outcome: i,
1154
1155
  offer: e.offer
1155
1156
  });
1156
- lo(t, s, { localAction: c });
1157
- let l = e.via === "back" && i.status === "arrived" ? Wr(P, e.pageLabel()) : Xr(P, i, {
1157
+ uo(t, s, { localAction: c });
1158
+ let l = e.via === "back" && i.status === "arrived" ? Gr(P, e.pageLabel()) : Zr(P, i, {
1158
1159
  page: e.pageLabel(),
1159
- landed: o === null ? null : zi(a, o),
1160
+ landed: o === null ? null : Bi(a, o),
1160
1161
  path: e.target
1161
1162
  }), f = u(t, s, l, c, n, X.current, d);
1162
1163
  i.status === "arrived" && e.onArrived?.({
@@ -1165,10 +1166,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1165
1166
  landedPath: i.landedPath
1166
1167
  });
1167
1168
  } finally {
1168
- gc.current === f && (gc.current = null, X.current && vc(!1)), d !== void 0 && X.current && bc((e) => e === d ? null : e);
1169
+ _c.current === f && (_c.current = null, X.current && yc(!1)), d !== void 0 && X.current && xc((e) => e === d ? null : e);
1169
1170
  }
1170
1171
  };
1171
- return Vi(o, e.target, {
1172
+ return Hi(o, e.target, {
1172
1173
  readPath: () => window.location.pathname + window.location.search,
1173
1174
  now: () => Date.now(),
1174
1175
  schedule: (e, t) => {
@@ -1176,7 +1177,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1176
1177
  },
1177
1178
  isShellLess: () => !X.current
1178
1179
  }).then(p, () => p({ status: "unconfirmed" })), !0;
1179
- }, p = ({ replyId: e, fromPath: t, landedPath: n }) => Pi.push({
1180
+ }, p = ({ replyId: e, fromPath: t, landedPath: n }) => Fi.push({
1180
1181
  fromPath: t,
1181
1182
  toPath: n,
1182
1183
  replyMessageId: e,
@@ -1184,21 +1185,21 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1184
1185
  });
1185
1186
  if (e.kind === "theme") {
1186
1187
  if (!a) return !1;
1187
- let t = Ur(e.request, {
1188
+ let t = Wr(e.request, {
1188
1189
  mode: a.mode,
1189
1190
  resolvedTheme: a.resolvedTheme
1190
1191
  });
1191
1192
  if (!t.alreadyApplied) try {
1192
1193
  a.setMode(t.mode);
1193
1194
  } catch {}
1194
- return d(ri(P, t, e.request.kind === "family"), {
1195
+ return d(ii(P, t, e.request.kind === "family"), {
1195
1196
  kind: "theme",
1196
1197
  mode: t.mode,
1197
1198
  alreadyApplied: t.alreadyApplied
1198
1199
  });
1199
1200
  }
1200
1201
  if (e.kind === "app-control") {
1201
- let t = li(e.request, { voiceLive: n !== void 0 || Jl.current });
1202
+ let t = ui(e.request, { voiceLive: n !== void 0 || Yl.current });
1202
1203
  if (!t) return !1;
1203
1204
  let r = (e) => ({
1204
1205
  kind: "app-control",
@@ -1206,34 +1207,34 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1206
1207
  outcome: e.outcome,
1207
1208
  ...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
1208
1209
  }), i = (t) => {
1209
- if (e.request.control === "language" && mc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1210
- let n = c(), i = r(t), a = l(n, i), o = u(n, a, ai((e, t) => t, t.reply), i, T(), !1);
1211
- return uc.current = {
1210
+ if (e.request.control === "language" && hc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1211
+ let n = c(), i = r(t), a = l(n, i), o = u(n, a, oi((e, t) => t, t.reply), i, T(), !1);
1212
+ return dc.current = {
1212
1213
  wanted: e.request.code,
1213
1214
  reply: t.reply,
1214
1215
  conversationId: n,
1215
1216
  messageId: o,
1216
- deadline: window.setTimeout(hc, oi)
1217
- }, fc(o), !0;
1217
+ deadline: window.setTimeout(gc, si)
1218
+ }, pc(o), !0;
1218
1219
  }
1219
- return d(ai(P, t.reply), r(t));
1220
+ return d(oi(P, t.reply), r(t));
1220
1221
  };
1221
1222
  if (t.kind === "reply") return i(t.run);
1222
1223
  if (t.kind === "run") {
1223
1224
  let e = t.run();
1224
1225
  return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
1225
1226
  }
1226
- let a = Ic;
1227
+ let a = Lc;
1227
1228
  if (!a) return !1;
1228
1229
  let o = null;
1229
- return d(ai(P, t.ask.reply), r(t.ask), (e) => {
1230
+ return d(oi(P, t.ask.reply), r(t.ask), (e) => {
1230
1231
  o = w.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
1231
1232
  }), a.request({
1232
1233
  prompt: t.prompt,
1233
1234
  onConfirm: () => {
1234
1235
  let e = t.confirmed(), i = o, a = i !== null && w.getState().conversations.some((e) => e.id === i);
1235
1236
  if (!i || !a) return;
1236
- let s = ai(P, e.reply);
1237
+ let s = oi(P, e.reply);
1237
1238
  W(i, {
1238
1239
  id: N(),
1239
1240
  role: "assistant",
@@ -1242,30 +1243,30 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1242
1243
  metadata: {
1243
1244
  lang: s.translated ? V : "en",
1244
1245
  localAction: r(e),
1245
- ...fr(n)
1246
+ ...pr(n)
1246
1247
  }
1247
1248
  });
1248
1249
  }
1249
1250
  }), !0;
1250
1251
  }
1251
1252
  if (!o) return !1;
1252
- if (e.kind === "choose-destination") return d(Gr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
1253
+ if (e.kind === "choose-destination") return d(Kr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
1253
1254
  kind: "choose-destination",
1254
1255
  candidateIds: e.candidates.map((e) => e.id)
1255
- }, (t) => vi(t, e.candidates));
1256
- if (e.kind === "choose-linked") return d(Kr(P, e.candidates), {
1256
+ }, (t) => yi(t, e.candidates));
1257
+ if (e.kind === "choose-linked") return d(qr(P, e.candidates), {
1257
1258
  kind: "choose-destination",
1258
1259
  candidateIds: e.candidates.map((e) => e.id)
1259
- }, (t) => vi(t, e.candidates));
1260
+ }, (t) => yi(t, e.candidates));
1260
1261
  if (e.kind === "pick-from-list") {
1261
1262
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
1262
- return d(ei(P), t ? {
1263
+ return d(ti(P), t ? {
1263
1264
  kind: "choose-destination",
1264
1265
  candidateIds: t.map((e) => e.id)
1265
1266
  } : e.candidateIds.length > 0 ? {
1266
1267
  kind: "choose-destination",
1267
1268
  candidateIds: [...e.candidateIds]
1268
- } : Li({
1269
+ } : Ri({
1269
1270
  destinationId: "",
1270
1271
  path: "",
1271
1272
  alreadyHere: !1,
@@ -1274,9 +1275,9 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1274
1275
  status: "refused",
1275
1276
  reason: "not-routable"
1276
1277
  }
1277
- }), t ? (e) => vi(e, t) : void 0);
1278
+ }), t ? (e) => yi(e, t) : void 0);
1278
1279
  }
1279
- if (e.kind === "link-not-openable") return d(Jr(P), Li({
1280
+ if (e.kind === "link-not-openable") return d(Yr(P), Ri({
1280
1281
  destinationId: "",
1281
1282
  path: "",
1282
1283
  alreadyHere: !1,
@@ -1289,7 +1290,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1289
1290
  if (e.kind === "open-record") {
1290
1291
  let r;
1291
1292
  try {
1292
- let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = bi(n);
1293
+ let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = xi(n);
1293
1294
  r = (t.records ?? []).flatMap((t) => {
1294
1295
  let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
1295
1296
  return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
@@ -1302,18 +1303,18 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1302
1303
  }
1303
1304
  if (r.length === 0) return !1;
1304
1305
  let i = w.getState().activeConversationId, a = N();
1305
- gc.current = a, vc(!0);
1306
+ _c.current = a, yc(!0);
1306
1307
  let o = () => {
1307
- gc.current === a && (gc.current = null, X.current && vc(!1));
1308
+ _c.current === a && (_c.current = null, X.current && yc(!1));
1308
1309
  };
1309
1310
  return (async () => {
1310
1311
  let a = { kind: "none" }, c = !0;
1311
1312
  try {
1312
- a = await yi({
1313
+ a = await bi({
1313
1314
  name: e.request.name,
1314
1315
  usable: r,
1315
- nounOf: (e) => qr(P, e.noun),
1316
- timeoutMs: da
1316
+ nounOf: (e) => Jr(P, e.noun),
1317
+ timeoutMs: fa
1317
1318
  }), c = w.getState().conversations.some((e) => e.id === i);
1318
1319
  } catch {
1319
1320
  a = { kind: "none" };
@@ -1322,7 +1323,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1322
1323
  }
1323
1324
  if (!X.current) return;
1324
1325
  if (a.kind === "none") {
1325
- tl.current(t, [], {
1326
+ nl.current(t, [], {
1326
1327
  fromPerson: !0,
1327
1328
  ...n === void 0 ? {} : { voiceSessionId: n },
1328
1329
  localRecordsChecked: !0
@@ -1343,16 +1344,16 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1343
1344
  return;
1344
1345
  }
1345
1346
  let l = a.candidates[0];
1346
- d(a.why === "kinds" ? ni(P, a.nouns, a.candidates) : ti(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1347
+ d(a.why === "kinds" ? ri(P, a.nouns, a.candidates) : ni(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1347
1348
  kind: "choose-destination",
1348
1349
  candidateIds: a.candidates.map((e) => e.id)
1349
- }, (e) => vi(e, a.candidates));
1350
+ }, (e) => yi(e, a.candidates));
1350
1351
  })().catch(() => void 0), !0;
1351
1352
  }
1352
1353
  if (e.kind === "back") {
1353
- let e = Pi.top();
1354
+ let e = Fi.top();
1354
1355
  if (!e) return !1;
1355
- let t = Hr(Y.current.navItems), n = Ri(t, e.fromPath);
1356
+ let t = Ur(Y.current.navItems), n = zi(t, e.fromPath);
1356
1357
  return f({
1357
1358
  target: e.fromPath,
1358
1359
  destinationId: n?.id ?? "",
@@ -1360,27 +1361,27 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1360
1361
  via: "back",
1361
1362
  pageLabel: () => n?.label ?? null,
1362
1363
  onArrived: () => {
1363
- Pi.top() === e && Pi.pop();
1364
+ Fi.top() === e && Fi.pop();
1364
1365
  }
1365
1366
  });
1366
1367
  }
1367
1368
  let ee, m = e.destination;
1368
1369
  if (e.via === "offer") {
1369
- let t = Ec(e.offerId, e.destination.label);
1370
- if (!t.ok) return d(t.copy ?? Zr(P), {
1370
+ let t = Dc(e.offerId, e.destination.label);
1371
+ if (!t.ok) return d(t.copy ?? Qr(P), {
1371
1372
  kind: "write-reply",
1372
1373
  line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
1373
1374
  });
1374
1375
  ee = {
1375
1376
  trigger: e.trigger,
1376
1377
  offerId: e.offerId
1377
- }, m = Hr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1378
+ }, m = Ur(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1378
1379
  id: t.target.id,
1379
1380
  label: t.target.label,
1380
1381
  path: t.target.path
1381
1382
  };
1382
1383
  }
1383
- return zr(m, window.location.pathname + window.location.search, Hr(Y.current.navItems)) ? d(Yr(P, m.label, !0), Li({
1384
+ return Br(m, window.location.pathname + window.location.search, Ur(Y.current.navItems)) ? d(Xr(P, m.label, !0), Ri({
1384
1385
  destinationId: m.id,
1385
1386
  path: m.path,
1386
1387
  alreadyHere: !0,
@@ -1397,54 +1398,54 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1397
1398
  });
1398
1399
  }, [
1399
1400
  W,
1400
- Cs,
1401
- Ic,
1402
- Jc,
1403
- hc,
1404
- V,
1405
- lo,
1406
- nc,
1401
+ ws,
1402
+ Lc,
1407
1403
  Yc,
1408
- ic,
1409
- mc,
1410
- Qs,
1404
+ gc,
1405
+ V,
1406
+ uo,
1407
+ rc,
1408
+ Xc,
1409
+ ac,
1410
+ hc,
1411
+ $s,
1411
1412
  P,
1412
- Ec,
1413
- Oc,
1414
- Cc
1415
- ]), Zc = D(async (e) => {
1416
- as.current = !0, ss(!0);
1413
+ Dc,
1414
+ kc,
1415
+ wc
1416
+ ]), Qc = D(async (e) => {
1417
+ os.current = !0, cs(!0);
1417
1418
  try {
1418
1419
  await K.declineForReply(e.conversationId, e.reason, e.origin);
1419
1420
  } finally {
1420
- as.current = !1, X.current && ss(!1);
1421
+ os.current = !1, X.current && cs(!1);
1421
1422
  }
1422
1423
  if (e.commandText !== null) {
1423
- let t = zc(e.commandText, e.options.voiceSessionId);
1424
- if (t && Xc(t, e.content, e.options.voiceSessionId)) return;
1424
+ let t = Bc(e.commandText, e.options.voiceSessionId);
1425
+ if (t && Zc(t, e.content, e.options.voiceSessionId)) return;
1425
1426
  }
1426
- await tl.current(e.content, e.attachments, e.options);
1427
+ await nl.current(e.content, e.attachments, e.options);
1427
1428
  }, [
1428
- zc,
1429
- Xc,
1429
+ Bc,
1430
+ Zc,
1430
1431
  K
1431
1432
  ]), Q = D(async (n, r = [], i = {}) => {
1432
- let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = vs.current;
1433
- if (a && _r(c)) {
1434
- let e = Sr(c, o.activeConversationId, Es());
1433
+ let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = ys.current;
1434
+ if (a && vr(c)) {
1435
+ let e = Cr(c, o.activeConversationId, Ds());
1435
1436
  if (e.kind === "gone") return;
1436
1437
  let t = i.voiceEntry ?? e;
1437
- t.kind === "adopt" && Cs(t.conversationId), s = t.kind === "own", i = {
1438
+ t.kind === "adopt" && ws(t.conversationId), s = t.kind === "own", i = {
1438
1439
  ...i,
1439
1440
  voiceEntry: t
1440
1441
  };
1441
1442
  }
1442
1443
  let l = s ? null : o.activeConversationId, u = s ? null : o.activeConversationId ?? H;
1443
1444
  if (u) {
1444
- if (jn(o.processingByConversationId[u]?.status)) {
1445
+ if (Mn(o.processingByConversationId[u]?.status)) {
1445
1446
  if (i.avatarTabAsk !== void 0) return;
1446
1447
  let e = o.processingByConversationId[u]?.messageId ?? null;
1447
- e && i.correctsInFlightTurn === !0 && !Gs.current.has(e) && Js(), e && Gs.current.has(e) && (Ks.current = {
1448
+ e && i.correctsInFlightTurn === !0 && !Ks.current.has(e) && Ys(), e && Ks.current.has(e) && (qs.current = {
1448
1449
  conversationId: u,
1449
1450
  content: n,
1450
1451
  attachments: r,
@@ -1452,40 +1453,40 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1452
1453
  });
1453
1454
  return;
1454
1455
  }
1455
- if (As.current.has(u)) return;
1456
+ if (js.current.has(u)) return;
1456
1457
  }
1457
- if (is.current || kr() !== null || as.current || gc.current !== null) return;
1458
- let d = i.targetConversationId, f = Xi(), p = (e) => Gi(e) || Wi(e, f);
1458
+ if (as.current || Ar() !== null || os.current || _c.current !== null) return;
1459
+ let d = i.targetConversationId, f = Zi(), p = (e) => Ki(e) || Gi(e, f);
1459
1460
  if (d !== void 0) {
1460
1461
  let e = o.conversations.find((e) => e.id === d);
1461
1462
  if (o.activeConversationId !== d || !e || e.mode !== o.mode || p(e)) return;
1462
1463
  }
1463
1464
  if (i.avatarTabAsk !== void 0) {
1464
1465
  let e = l ? o.conversations.find((e) => e.id === l) : void 0, t = e && !p(e) ? e : void 0;
1465
- if (Xe({
1466
- auto: o.autoRouting && rs.current && d === void 0,
1466
+ if (Ze({
1467
+ auto: o.autoRouting && is.current && d === void 0,
1467
1468
  selectedMode: o.mode,
1468
1469
  conversation: t ? {
1469
1470
  mode: t.mode,
1470
1471
  routedBy: t.routedBy,
1471
- hasHistory: Ui(t)
1472
+ hasHistory: Wi(t)
1472
1473
  } : null,
1473
- modeWrites: (e) => Yo.current.find((t) => t.id === e)?.writeCapable === !0 || yt(e)
1474
+ modeWrites: (e) => Xo.current.find((t) => t.id === e)?.writeCapable === !0 || bt(e)
1474
1475
  }) !== null) return;
1475
1476
  }
1476
1477
  if (i.fromPerson && i.writeReplyBound === void 0) {
1477
- let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Uc(e, i.voiceSessionId), o = se({
1478
+ let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Wc(e, i.voiceSessionId), o = se({
1478
1479
  text: n,
1479
- locale: t === "spoken" ? Za.input.code : V,
1480
+ locale: t === "spoken" ? Qa.input.code : V,
1480
1481
  origin: t,
1481
1482
  hasAttachments: r.length > 0 || i.focus !== void 0,
1482
1483
  live: K.liveFor(e),
1483
- matchesLocalCommand: (e) => zc(e, i.voiceSessionId) !== null,
1484
+ matchesLocalCommand: (e) => Bc(e, i.voiceSessionId) !== null,
1484
1485
  offer: a.state,
1485
- offerAssent: a.state !== "none" && ii({
1486
+ offerAssent: a.state !== "none" && ai({
1486
1487
  text: n,
1487
1488
  uiLocale: V,
1488
- inputLocale: Za.input.code,
1489
+ inputLocale: Qa.input.code,
1489
1490
  commandLocales: Y.current.options.commandLocales,
1490
1491
  manifest: Y.current.options.commandManifest,
1491
1492
  leaveGuard: Y.current.options.leaveGuard
@@ -1493,14 +1494,14 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1493
1494
  });
1494
1495
  if (o.kind === "accept_offer") {
1495
1496
  let e = a.accept;
1496
- if (e && Xc({
1497
+ if (e && Zc({
1497
1498
  kind: "navigate",
1498
1499
  destination: e.destination,
1499
1500
  via: "offer",
1500
1501
  offerId: e.offerId,
1501
1502
  trigger: "yes"
1502
1503
  }, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1503
- rc(i.avatarTabAsk);
1504
+ ic(i.avatarTabAsk);
1504
1505
  return;
1505
1506
  }
1506
1507
  o = {
@@ -1517,11 +1518,11 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1517
1518
  };
1518
1519
  }
1519
1520
  if (o.kind === "local_reply") {
1520
- e && Wc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
1521
+ e && Gc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
1521
1522
  return;
1522
1523
  }
1523
1524
  let c = o.kind === "local" ? o.fallback : o.bound, u = o.declineAll;
1524
- if (u !== null && e) return i.avatarTabAsk === void 0 ? Zc({
1525
+ if (u !== null && e) return i.avatarTabAsk === void 0 ? Qc({
1525
1526
  conversationId: e,
1526
1527
  reason: u,
1527
1528
  origin: t,
@@ -1540,52 +1541,52 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1540
1541
  }
1541
1542
  let ee = i.writeReplyBound?.promptText ?? n;
1542
1543
  if (i.fromPerson && r.length === 0 && i.focus === void 0 && i.writeReplyBound?.localCommands !== !1) {
1543
- let e = zc(n, i.voiceSessionId, i.localRecordsChecked === !0);
1544
- if (e && Xc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1545
- rc(i.avatarTabAsk);
1544
+ let e = Bc(n, i.voiceSessionId, i.localRecordsChecked === !0);
1545
+ if (e && Zc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1546
+ ic(i.avatarTabAsk);
1546
1547
  return;
1547
1548
  }
1548
1549
  }
1549
- let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && rs.current && d === void 0 ? pe({
1550
+ let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && is.current && d === void 0 ? pe({
1550
1551
  intent: i.avatarTabAsk === void 0 ? i.autoIntent ?? ue(n) : "read",
1551
1552
  dictated: a,
1552
- voiceProposalBound: a && Va("api-calls") && Zn(o.acknowledgedWriteModes, "api-calls"),
1553
+ voiceProposalBound: a && Ha("api-calls") && Qn(o.acknowledgedWriteModes, "api-calls"),
1553
1554
  conversation: h ? {
1554
1555
  mode: h.mode,
1555
1556
  routedBy: h.routedBy,
1556
- hasHistory: Ui(h)
1557
+ hasHistory: Wi(h)
1557
1558
  } : null
1558
1559
  }) : null;
1559
- if (g && Yo.current.find((e) => e.id === g.mode)?.writeCapable && !Zn(o.acknowledgedWriteModes, g.mode)) {
1560
- is.current = {
1560
+ if (g && Xo.current.find((e) => e.id === g.mode)?.writeCapable && !Qn(o.acknowledgedWriteModes, g.mode)) {
1561
+ as.current = {
1561
1562
  content: n,
1562
1563
  attachments: r,
1563
1564
  options: i
1564
- }, us(g.mode);
1565
+ }, ds(g.mode);
1565
1566
  return;
1566
1567
  }
1567
1568
  let _ = g ? g.mode : o.mode, te, ne, v = d ?? (s ? null : H), re = v ? w.getState().conversations.find((e) => e.id === v) : void 0, ie = g?.action === "escalate" && h ? {
1568
1569
  mode: h.mode,
1569
1570
  backendSessionId: h.backendSessionId ?? null
1570
1571
  } : null;
1571
- if (g) g.action === "new" || !h ? v = oo(void 0, _, { routedBy: "auto" }) : (v = h.id, xo(v, _));
1572
+ if (g) g.action === "new" || !h ? v = so(void 0, _, { routedBy: "auto" }) : (v = h.id, So(v, _));
1572
1573
  else {
1573
1574
  let e = o.autoRouting ? { routedBy: "auto" } : void 0;
1574
- !v || p(re) || re && re.mode !== _ && Ui(re) ? v = oo(void 0, _, e) : re && re.mode !== _ && (e ? xo(v, _) : io(v, _));
1575
+ !v || p(re) || re && re.mode !== _ && Wi(re) ? v = so(void 0, _, e) : re && re.mode !== _ && (e ? So(v, _) : ao(v, _));
1575
1576
  }
1576
1577
  if (!v) return;
1577
- a && vs.current !== void 0 && v !== o.activeConversationId && Cs(v), i.approvalFollowUp || (Ds.current[v] = r);
1578
+ a && ys.current !== void 0 && v !== o.activeConversationId && ws(v), i.approvalFollowUp || (Os.current[v] = r);
1578
1579
  let ae = () => w.getState().conversations.some((e) => e.id === v), y = T(), b = {
1579
- accessToken: Ha(),
1580
- workspaceToken: Ua(),
1580
+ accessToken: Ua(),
1581
+ workspaceToken: Wa(),
1581
1582
  userId: B,
1582
- organizationId: Wt()
1583
+ organizationId: Gt()
1583
1584
  }, le = (e, t) => {
1584
- !ae() && y && ut(e, y, t, _, {
1585
- accessToken: Ha(),
1586
- workspaceToken: Ua(),
1585
+ !ae() && y && dt(e, y, t, _, {
1586
+ accessToken: Ua(),
1587
+ workspaceToken: Wa(),
1587
1588
  userId: B,
1588
- organizationId: Wt()
1589
+ organizationId: Gt()
1589
1590
  });
1590
1591
  }, fe = {
1591
1592
  id: N(),
@@ -1593,17 +1594,17 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1593
1594
  content: n,
1594
1595
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1595
1596
  metadata: {
1596
- ...r.length ? { attachments: r.map(xn) } : {},
1597
+ ...r.length ? { attachments: r.map(Sn) } : {},
1597
1598
  ...i.focus ? { askAbout: i.focus } : {},
1598
1599
  ...i.approvalFollowUp ? {
1599
1600
  approvalFollowUp: !0,
1600
1601
  approvedReplyId: i.approvalFollowUp.approvedReplyId
1601
1602
  } : {},
1602
- ...fr(i.voiceSessionId)
1603
+ ...pr(i.voiceSessionId)
1603
1604
  }
1604
1605
  };
1605
1606
  W(v, fe);
1606
- let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? Ai(n, a ? Za.input.code : V) : null, he = {
1607
+ let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? ji(n, a ? Qa.input.code : V) : null, he = {
1607
1608
  location: window.location.pathname + window.location.search,
1608
1609
  conversationId: w.getState().activeConversationId,
1609
1610
  workspaceId: T(),
@@ -1615,38 +1616,38 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1615
1616
  content: "",
1616
1617
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1617
1618
  metadata: {
1618
- lang: eo,
1619
- ...fr(i.voiceSessionId)
1619
+ lang: to,
1620
+ ...pr(i.voiceSessionId)
1620
1621
  }
1621
- }), un(x, {
1622
+ }), dn(x, {
1622
1623
  channel: a ? "voice" : "chat",
1623
1624
  mode: _,
1624
1625
  product: L,
1625
- language: eo,
1626
- device: fn(),
1626
+ language: to,
1627
+ device: pn(),
1627
1628
  routedByAuto: !!g
1628
- }, i.voiceTiming), E(x, "accepted"), uo(v, "provisioning", x, null), Ar(x), i.avatarTabAsk !== void 0 && ic(i.avatarTabAsk, {
1629
+ }, i.voiceTiming), E(x, "accepted"), fo(v, "provisioning", x, null), jr(x), i.avatarTabAsk !== void 0 && ac(i.avatarTabAsk, {
1629
1630
  conversationId: v,
1630
1631
  questionId: fe.id,
1631
1632
  replyId: x
1632
1633
  });
1633
1634
  let ge = () => {
1634
- let e = Mn({
1635
+ let e = Nn({
1635
1636
  turnId: x,
1636
- abortRequested: Gs.current.has(x),
1637
+ abortRequested: Ks.current.has(x),
1637
1638
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1638
1639
  conversationExists: ae()
1639
1640
  });
1640
1641
  return e.abandon && ye(), e;
1641
- }, _e = (e, t, n, r, a = !1, o = eo) => {
1642
- co(v, x, { content: kt(e) }), lo(v, x, {
1642
+ }, _e = (e, t, n, r, a = !1, o = to) => {
1643
+ lo(v, x, { content: At(e) }), uo(v, x, {
1643
1644
  lang: o,
1644
1645
  ...t?.length ? { artifacts: t } : {},
1645
1646
  ...t?.length || n || r ? { mode: _ } : {},
1646
1647
  ...n ? { sessionId: n } : {},
1647
1648
  ...r ? { sandboxId: r } : {},
1648
1649
  ...a ? { incomplete: !0 } : {},
1649
- ...fr(i.voiceSessionId)
1650
+ ...pr(i.voiceSessionId)
1650
1651
  });
1651
1652
  }, ve = { session: null }, S = {
1652
1653
  speech: null,
@@ -1657,94 +1658,94 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1657
1658
  }, be = () => {
1658
1659
  ye(), S.stream?.close(), S.stream = null, S.render = null;
1659
1660
  }, xe = !1, Se = (e = !1) => {
1660
- xe && (xe = !1, Mt.abort(x, e));
1661
+ xe && (xe = !1, Nt.abort(x, e));
1661
1662
  }, Ce = new e(), we = () => {}, Te = async (e = 1, o = !1) => {
1662
1663
  E(x, "attemptStarted");
1663
1664
  let s = null, c = null, l = !1;
1664
1665
  try {
1665
- let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await Ls(v, x, _, y, b, {
1666
- isAbandoned: () => Mn({
1666
+ let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await Rs(v, x, _, y, b, {
1667
+ isAbandoned: () => Nn({
1667
1668
  turnId: x,
1668
- abortRequested: Gs.current.has(x),
1669
+ abortRequested: Ks.current.has(x),
1669
1670
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1670
1671
  conversationExists: ae()
1671
1672
  }).abandon,
1672
1673
  ...o ? { verifySession: !0 } : {}
1673
1674
  });
1674
1675
  if (s = e, we(), we = t(e, () => {
1675
- Gs.current.add(x), Ft(x), Mt.abort(x);
1676
- }), E(x, "runtimeReady"), dn(x, {
1676
+ Ks.current.add(x), It(x), Nt.abort(x);
1677
+ }), E(x, "runtimeReady"), fn(x, {
1677
1678
  runtime: p ? "cold" : h ? "adopted" : m ? "probed" : re ? "preopened" : d ? "new-session" : "warm",
1678
1679
  deadSandboxProbe: g
1679
- }), dn(x, { session: re ? "preopened" : d ? "created" : "reused" }), c = u, ve.session = {
1680
+ }), fn(x, { session: re ? "preopened" : d ? "created" : "reused" }), c = u, ve.session = {
1680
1681
  sandboxId: e,
1681
1682
  sessionId: u
1682
1683
  }, F) {
1683
1684
  let e = ge();
1684
1685
  if (e.abandon) {
1685
- e.clearProcessing && fo(v);
1686
+ e.clearProcessing && po(v);
1686
1687
  return;
1687
1688
  }
1688
1689
  }
1689
- if (Qn(_, te, w.getState().acknowledgedWriteModes, {
1690
+ if ($n(_, te, w.getState().acknowledgedWriteModes, {
1690
1691
  dictated: a,
1691
- confirmsWrites: yt(_),
1692
- proposalBound: Va(_, e)
1693
- }) === "voice-in-write-mode") throw new qt("voice-in-write-mode", "Voice in a write mode");
1694
- let se = qi({
1692
+ confirmsWrites: bt(_),
1693
+ proposalBound: Ha(_, e)
1694
+ }) === "voice-in-write-mode") throw new Jt("voice-in-write-mode", "Voice in a write mode");
1695
+ let se = Ji({
1695
1696
  conversation: w.getState().conversations.find((e) => e.id === v),
1696
1697
  content: n,
1697
1698
  sessionIsNew: d,
1698
1699
  sendingMode: _,
1699
1700
  sendingModeConfig: te,
1700
- modes: Yo.current,
1701
- answerText: (e) => $e(e).text
1701
+ modes: Xo.current,
1702
+ answerText: (e) => et(e).text
1702
1703
  });
1703
- if (be(), Yn()) {
1704
- let t = Jn({
1705
- mint: () => vt(e, y, u, _, b),
1704
+ if (be(), Xn()) {
1705
+ let t = Yn({
1706
+ mint: () => yt(e, y, u, _, b),
1706
1707
  mark: (e) => E(x, e)
1707
1708
  });
1708
- S.stream = t, Wn() && i.voiceSessionId !== void 0 && !ne.accumulatesNarration && (S.speech = Gn({
1709
+ S.stream = t, Gn() && i.voiceSessionId !== void 0 && !ne.accumulatesNarration && (S.speech = Kn({
1709
1710
  append: (e, t) => {
1710
- ge().abandon || (E(x, "speechQueued"), xe = !0, Mt.append(x, {
1711
+ ge().abandon || (E(x, "speechQueued"), xe = !0, Nt.append(x, {
1711
1712
  conversationId: v,
1712
1713
  channel: "voice",
1713
1714
  voiceSessionId: i.voiceSessionId,
1714
1715
  text: t,
1715
- lang: eo,
1716
+ lang: to,
1716
1717
  final: !1
1717
1718
  }, e));
1718
1719
  },
1719
- retract: () => Mt.retract(x)
1720
- })), S.render = Kn({
1720
+ retract: () => Nt.retract(x)
1721
+ })), S.render = qn({
1721
1722
  onLiveState: (e, t) => S.speech?.invalidate(e, t),
1722
1723
  onRendered: (e, t, n) => S.speech?.update(e, t, n),
1723
1724
  stream: t,
1724
1725
  conversationId: v,
1725
1726
  messageId: x,
1726
- build: (e, t) => kt(Lt(e, t, { accumulateNarration: ne.accumulatesNarration }).content),
1727
+ build: (e, t) => At(Rt(e, t, { accumulateNarration: ne.accumulatesNarration }).content),
1727
1728
  onFirstDelta: () => E(x, "firstDelta"),
1728
1729
  onFirstVisible: () => E(x, "firstOutput")
1729
1730
  });
1730
1731
  }
1731
- let ue = ie ?? await Bt(() => gt(e, y, u, _, b, { limit: 50 }), d, Rt(f, e, u));
1732
- Fs(v, x, "streaming", "thinking");
1733
- let de = Ia?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = wi(e, u), Ee = Se.options.uiCatalogue ? xi(Hr(Se.navItems), {
1732
+ let ue = ie ?? await Vt(() => _t(e, y, u, _, b, { limit: 50 }), d, zt(f, e, u));
1733
+ Is(v, x, "streaming", "thinking");
1734
+ let de = La?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = Ti(e, u), Ee = Se.options.uiCatalogue ? Si(Ur(Se.navItems), {
1734
1735
  permissionsSettled: Se.navPermissionsSettled,
1735
1736
  simulating: Se.navSimulating,
1736
- sentBefore: Ci(Te)
1737
- }) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ? Ot({ writeCapable: te?.writeCapable === !0 || _ === "api-calls" }) : null, Oe = De?.manifest ?? [], ke = {
1737
+ sentBefore: wi(Te)
1738
+ }) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ? kt({ writeCapable: te?.writeCapable === !0 || _ === "api-calls" }) : null, Oe = De?.manifest ?? [], ke = {
1738
1739
  conversationId: v,
1739
1740
  writeReply: pe === "proposal-v1" ? i.writeReplyBound?.writeReply ?? null : null,
1740
1741
  ...Ee ? { uiCatalogue: Ee } : {},
1741
1742
  ...Oe.length > 0 ? { clientTools: Oe } : {}
1742
- }, { prompt: Ae, parts: je } = Sn({
1743
- content: oa(se ? `${se}${ee}` : ee, i.focus),
1743
+ }, { prompt: Ae, parts: je } = Cn({
1744
+ content: sa(se ? `${se}${ee}` : ee, i.focus),
1744
1745
  attachments: r,
1745
- limits: bn(te),
1746
- wrapPrompt: (e) => La?.(_, e, Qa, $a, a, { writeApproval: pe }) ?? e,
1747
- requestBytes: (t, n) => xt({
1746
+ limits: xn(te),
1747
+ wrapPrompt: (e) => Ra?.(_, e, $a, eo, a, { writeApproval: pe }) ?? e,
1748
+ requestBytes: (t, n) => St({
1748
1749
  sandboxId: e,
1749
1750
  workspaceId: y,
1750
1751
  sessionId: u,
@@ -1755,18 +1756,18 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1755
1756
  authContext: b,
1756
1757
  ...ke
1757
1758
  })
1758
- }), Me = vn(je), Ne = Me > 0;
1759
- l = _n(r) > Me;
1759
+ }), Me = yn(je), Ne = Me > 0;
1760
+ l = vn(r) > Me;
1760
1761
  let Pe = ge();
1761
1762
  if (Pe.abandon) {
1762
- Pe.clearProcessing && fo(v);
1763
+ Pe.clearProcessing && po(v);
1763
1764
  return;
1764
1765
  }
1765
1766
  let Fe = (t) => Ce.dispatch({
1766
1767
  prompt: Ae,
1767
1768
  isAbandoned: () => ge().abandon,
1768
- readMessages: (t) => gt(e, y, u, _, b, { sinceMs: t }),
1769
- send: () => Ct(e, y, u, Ae, _, de, b, t?.length ? {
1769
+ readMessages: (t) => _t(e, y, u, _, b, { sinceMs: t }),
1770
+ send: () => wt(e, y, u, Ae, _, de, b, t?.length ? {
1770
1771
  parts: t,
1771
1772
  ...ke
1772
1773
  } : ke)
@@ -1774,12 +1775,12 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1774
1775
  try {
1775
1776
  await Fe(je);
1776
1777
  } catch (e) {
1777
- if (ie !== null && !o && Bn(e)) throw new zn();
1778
- if (!Ce.canFailover() || !je || !kn(e)) throw e;
1778
+ if (ie !== null && !o && Vn(e)) throw new Bn();
1779
+ if (!Ce.canFailover() || !je || !An(e)) throw e;
1779
1780
  await Fe(void 0), l ||= Ne;
1780
1781
  }
1781
- Ee && Si(Te);
1782
- let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && Di(Ie) ? B : null, Re = !!Le;
1782
+ Ee && Ci(Te);
1783
+ let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && Oi(Ie) ? B : null, Re = !!Le;
1783
1784
  Le && Z.recordTurn({
1784
1785
  replyId: x,
1785
1786
  conversationId: v,
@@ -1790,97 +1791,97 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1790
1791
  actorId: Le,
1791
1792
  floorMs: ue
1792
1793
  });
1793
- let ze = De && Oe.length > 0 ? Dt({
1794
+ let ze = De && Oe.length > 0 ? Ot({
1794
1795
  tools: De.tools,
1795
- post: (t, n) => bt(e, y, u, t, n, _, b)
1796
+ post: (t, n) => xt(e, y, u, t, n, _, b)
1796
1797
  }) : null, Be = ze ? (e) => ze.receive(e) : void 0, Ve = Re ? (e, t) => {
1797
- Z.receive(x, e, t, performance.now()) && Cc();
1798
- } : void 0, He = (e) => co(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("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;
1798
+ Z.receive(x, e, t, performance.now()) && wc();
1799
+ } : void 0, He = (e) => lo(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("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;
1799
1800
  E(x, "promptSent");
1800
- let We = null, Ge = !1, Ke = It, C = Lt([], ue);
1801
+ let We = null, Ge = !1, Ke = Lt, C = Rt([], ue);
1801
1802
  S.render?.arm(ue);
1802
- let qe = Date.now() + ne.streamBudgetMs, Je = Date.now(), Ye = Date.now(), Xe, Ze = At(), Qe = (e) => {
1803
+ let qe = Date.now() + ne.streamBudgetMs, Je = Date.now(), Ye = Date.now(), Xe, Ze = jt(), Qe = (e) => {
1803
1804
  Xe = e;
1804
- }, et = qn(() => gt(e, y, u, _, b, {
1805
+ }, $e = Jn(() => _t(e, y, u, _, b, {
1805
1806
  limit: 50,
1806
1807
  sinceMs: ue,
1807
1808
  surfaceTurnTerminal: !0,
1808
1809
  surfaceUiOffers: Ve,
1809
1810
  surfaceClientToolRequests: Be,
1810
1811
  surfaceSessionBusy: Qe
1811
- })), tt = S.stream?.onIdle(() => et.startExtra());
1812
+ })), tt = S.stream?.onIdle(() => $e.startExtra());
1812
1813
  try {
1813
1814
  for (; Date.now() < qe;) {
1814
1815
  le(e, u);
1815
1816
  let t = ge();
1816
1817
  if (t.abandon) {
1817
- t.clearProcessing && fo(v);
1818
+ t.clearProcessing && po(v);
1818
1819
  return;
1819
1820
  }
1820
- let n = Date.now(), r = await et.next();
1821
- Re && Z.observeMessages(x, r) && Cc(), C = Lt(r, ue, { accumulateNarration: ne.accumulatesNarration });
1822
- let i = jt(Ze, C.done, Xe, Date.now());
1821
+ let n = Date.now(), r = await $e.next();
1822
+ Re && Z.observeMessages(x, r) && wc(), C = Rt(r, ue, { accumulateNarration: ne.accumulatesNarration });
1823
+ let i = Mt(Ze, C.done, Xe, Date.now());
1823
1824
  if (i !== C.done && (C = {
1824
1825
  ...C,
1825
1826
  done: i
1826
- }), co(v, x, { content: kt(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = mn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
1827
+ }), lo(v, x, { content: At(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = hn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
1827
1828
  else {
1828
- let e = Ut(Ke, C, mn());
1829
+ let e = Wt(Ke, C, hn());
1829
1830
  Ke = e.tracker, e.confirmedAt !== null && E(x, "firstText", e.confirmedAt);
1830
1831
  }
1831
- if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && lo(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? dn(x, {
1832
+ if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && uo(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? fn(x, {
1832
1833
  transport: S.stream.reachedOpen ? "sse" : "poll",
1833
- live: Un(S.stream.live)
1834
- }) : dn(x, {
1834
+ live: Wn(S.stream.live)
1835
+ }) : fn(x, {
1835
1836
  transport: "poll",
1836
1837
  live: "none"
1837
1838
  }), ye()), C.done) {
1838
- E(x, "answerDone"), Os.current.markVerified(e), ne.continuesInBackground || zt(e, u, r);
1839
+ E(x, "answerDone"), ks.current.markVerified(e), ne.continuesInBackground || Bt(e, u, r);
1839
1840
  break;
1840
1841
  }
1841
- if (S.render?.refresh(r), Date.now() - Je > 3e4 && (Hn(e, y, b), Je = Date.now()), !et.hasPending()) {
1842
- let e = Math.max(0, Ln(Date.now() - Ye) - (Date.now() - n));
1842
+ if (S.render?.refresh(r), Date.now() - Je > 3e4 && (Un(e, y, b), Je = Date.now()), !$e.hasPending()) {
1843
+ let e = Math.max(0, Rn(Date.now() - Ye) - (Date.now() - n));
1843
1844
  S.stream ? await S.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
1844
1845
  }
1845
1846
  }
1846
1847
  } finally {
1847
1848
  ze?.dispose();
1848
1849
  }
1849
- if (tt?.(), be(), C.done || (dn(x, { outcome: "timedOut" }), C = {
1850
+ if (tt?.(), be(), C.done || (fn(x, { outcome: "timedOut" }), C = {
1850
1851
  ...C,
1851
- content: Xn(C.content, _, P, te)
1852
+ content: Zn(C.content, _, P, te)
1852
1853
  }), (C.done || xe) && i.voiceSessionId !== void 0 && !ge().abandon) {
1853
- let e = kt(Ue(C.content));
1854
- (e.trim() || xe) && ((l || !C.done) && He(e), E(x, "speechQueued"), xe = !0, Mt.publish(x, {
1854
+ let e = At(Ue(C.content));
1855
+ (e.trim() || xe) && ((l || !C.done) && He(e), E(x, "speechQueued"), xe = !0, Nt.publish(x, {
1855
1856
  conversationId: v,
1856
1857
  channel: "voice",
1857
1858
  voiceSessionId: i.voiceSessionId,
1858
1859
  text: e,
1859
- lang: eo,
1860
+ lang: to,
1860
1861
  final: !0
1861
1862
  }));
1862
1863
  }
1863
- let nt = ne.producesArtifacts ? await ht(e, y, u, _, b).then((e) => e).catch(() => []) : void 0;
1864
- C.usedTools !== void 0 && dn(x, { usedTools: C.usedTools }), l && (C = {
1864
+ let nt = ne.producesArtifacts ? await gt(e, y, u, _, b).then((e) => e).catch(() => []) : void 0;
1865
+ C.usedTools !== void 0 && fn(x, { usedTools: C.usedTools }), l && (C = {
1865
1866
  ...C,
1866
1867
  content: Ue(C.content)
1867
1868
  });
1868
1869
  let rt = !C.done;
1869
- _e(C.content, nt, u, e, rt), C.tokens && (co(v, x, { tokens: C.tokens }), za && Tn({
1870
+ _e(C.content, nt, u, e, rt), C.tokens && (lo(v, x, { tokens: C.tokens }), Ba && En({
1870
1871
  workspaceId: y,
1871
1872
  sessionId: u,
1872
1873
  messageId: C.messageId,
1873
1874
  model: C.model,
1874
1875
  tokens: C.tokens
1875
- }, za, { ledger: Cn("panel", L) }).then((e) => {
1876
- e.ok && Kt(L);
1876
+ }, Ba, { ledger: wn("panel", L) }).then((e) => {
1877
+ e.ok && qt(L);
1877
1878
  })), C.done || le(e, u);
1878
1879
  let it = ge();
1879
1880
  if (it.abandon) {
1880
- it.clearProcessing && fo(v);
1881
+ it.clearProcessing && po(v);
1881
1882
  return;
1882
1883
  }
1883
- E(x, "complete"), dn(x, { outcome: "answered" }), uo(v, "complete", x, null), Hi.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Nc({
1884
+ E(x, "complete"), fn(x, { outcome: "answered" }), fo(v, "complete", x, null), Ui.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Pc({
1884
1885
  replyId: x,
1885
1886
  conversationId: v,
1886
1887
  voiceSessionId: i.voiceSessionId,
@@ -1888,140 +1889,140 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
1888
1889
  atSend: he
1889
1890
  });
1890
1891
  } catch (t) {
1891
- let n = t instanceof zn;
1892
- n || Os.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
1893
- let r = Mn({
1892
+ let n = t instanceof Bn;
1893
+ n || ks.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
1894
+ let r = Nn({
1894
1895
  turnId: x,
1895
- abortRequested: Gs.current.has(x),
1896
+ abortRequested: Ks.current.has(x),
1896
1897
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1897
1898
  conversationExists: ae()
1898
1899
  });
1899
1900
  if (ye(), s && c && le(s, c), r.abandon) {
1900
- r.clearProcessing && fo(v);
1901
+ r.clearProcessing && po(v);
1901
1902
  return;
1902
1903
  }
1903
- if (n) return we(), mo(v), be(), pn(x), Te(e, !0);
1904
- if (e === 1 && Ce.canFailover() && An(t)) {
1904
+ if (n) return we(), ho(v), be(), mn(x), Te(e, !0);
1905
+ if (e === 1 && Ce.canFailover() && jn(t)) {
1905
1906
  we();
1906
1907
  let e = s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null;
1907
- return e && (ks.current.add(e), Os.current.invalidate(e)), mo(v), go(_), so(v, x, ""), lo(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), pn(x), Te(2);
1908
+ return e && (As.current.add(e), ks.current.invalidate(e)), ho(v), _o(_), co(v, x, ""), uo(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), mn(x), Te(2);
1908
1909
  }
1909
1910
  throw t;
1910
1911
  }
1911
1912
  }, Ee = v;
1912
- As.current.add(Ee);
1913
- let De = Rn();
1914
- Vn();
1913
+ js.current.add(Ee);
1914
+ let De = zn();
1915
+ Hn();
1915
1916
  try {
1916
1917
  if (!y) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1917
1918
  code: "UNAUTHENTICATED",
1918
1919
  authFailure: "WORKSPACE_CONTEXT_MISSING"
1919
1920
  } });
1920
- let e = await er(_, () => Yo.current.find((e) => e.id === _), Jo);
1921
+ let e = await tr(_, () => Xo.current.find((e) => e.id === _), Yo);
1921
1922
  te = e.config, ne = e.capabilities;
1922
1923
  let t = te, n = ge();
1923
1924
  if (n.abandon) {
1924
- n.clearProcessing && fo(v);
1925
+ n.clearProcessing && po(v);
1925
1926
  return;
1926
1927
  }
1927
- let r = Qn(_, t, w.getState().acknowledgedWriteModes, {
1928
+ let r = $n(_, t, w.getState().acknowledgedWriteModes, {
1928
1929
  dictated: a,
1929
- confirmsWrites: yt(_),
1930
- proposalBound: Va(_)
1930
+ confirmsWrites: bt(_),
1931
+ proposalBound: Ha(_)
1931
1932
  });
1932
- if (r) throw new qt(r, r === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1933
- let i = Cn("panel", L);
1934
- if (za && await Dn(i, y), za && wn(i, y)) {
1935
- let e = await En(i, y, za);
1936
- if (!e.ok) throw On(e.kind);
1933
+ if (r) throw new Jt(r, r === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1934
+ let i = wn("panel", L);
1935
+ if (Ba && await On(i, y), Ba && Tn(i, y)) {
1936
+ let e = await Dn(i, y, Ba);
1937
+ if (!e.ok) throw kn(e.kind);
1937
1938
  let t = ge();
1938
1939
  if (t.abandon) {
1939
- t.clearProcessing && fo(v);
1940
+ t.clearProcessing && po(v);
1940
1941
  return;
1941
1942
  }
1942
1943
  }
1943
1944
  E(x, "cleared"), await Te();
1944
1945
  } catch (e) {
1945
- if (Os.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
1946
- fo(v);
1946
+ if (ks.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
1947
+ po(v);
1947
1948
  return;
1948
1949
  }
1949
- let t = ve.session?.sandboxId ?? null, n = Jt(e, { confirmsNoAction: Yt({
1950
+ let t = ve.session?.sandboxId ?? null, n = Yt(e, { confirmsNoAction: Xt({
1950
1951
  mode: _,
1951
1952
  capabilities: t ? w.getState().sandboxWriteCapabilities[t] : null
1952
1953
  }) });
1953
- dn(x, { outcome: n.kind === "temporary" ? "failed" : "refused" }), n.offersUpgrade && Gt(L, "sandbox");
1954
- let r = Xt(n, P, { locale: V });
1955
- uo(v, "error", x, r.headline), co(v, x, { content: r.text }), lo(v, x, {
1954
+ fn(x, { outcome: n.kind === "temporary" ? "failed" : "refused" }), n.offersUpgrade && Kt(L, "sandbox");
1955
+ let r = Zt(n, P, { locale: V });
1956
+ fo(v, "error", x, r.headline), lo(v, x, { content: r.text }), uo(v, x, {
1956
1957
  lang: r.translated ? V : "en",
1957
- ...fr(i.voiceSessionId)
1958
+ ...pr(i.voiceSessionId)
1958
1959
  });
1959
1960
  } finally {
1960
- we(), As.current.delete(Ee), dn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
1961
+ we(), js.current.delete(Ee), fn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
1961
1962
  let e = w.getState(), t = de(ie, _, e.conversations.find((e) => e.id === Ee), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1962
- t && (xo(Ee, t.mode), t.backendSessionId && po(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
1963
+ t && (So(Ee, t.mode), t.backendSessionId && mo(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
1963
1964
  ...ve.session,
1964
1965
  conversationId: Ee
1965
1966
  }, x);
1966
- let n = Ks.current;
1967
- Ks.current = null, n && n.conversationId === Ee && ae() && tl.current(n.content, n.attachments, n.options), De();
1967
+ let n = qs.current;
1968
+ qs.current = null, n && n.conversationId === Ee && ae() && nl.current(n.content, n.attachments, n.options), De();
1968
1969
  }
1969
1970
  }, [
1970
1971
  H,
1971
1972
  W,
1972
- La,
1973
- mo,
1974
- go,
1975
- to,
1976
- oo,
1977
- Ls,
1973
+ Ra,
1974
+ ho,
1975
+ _o,
1976
+ no,
1977
+ so,
1978
+ Rs,
1978
1979
  K,
1979
- Js,
1980
- Wc,
1981
- Zc,
1980
+ Ys,
1981
+ Gc,
1982
+ Qc,
1982
1983
  V,
1983
- Za,
1984
- Va,
1985
- Ia,
1984
+ Qa,
1986
1985
  Ha,
1986
+ La,
1987
1987
  Ua,
1988
- co,
1988
+ Wa,
1989
+ lo,
1989
1990
  L,
1990
- Jo,
1991
- za,
1992
- $a,
1993
- V,
1991
+ Yo,
1992
+ Ba,
1994
1993
  eo,
1995
- Qa,
1996
- xo,
1997
- Xc,
1998
- zc,
1999
- Cs,
2000
- Es,
2001
- po,
2002
- io,
2003
- uo,
1994
+ V,
1995
+ to,
1996
+ $a,
1997
+ So,
1998
+ Zc,
1999
+ Bc,
2000
+ ws,
2001
+ Ds,
2002
+ mo,
2003
+ ao,
2004
2004
  fo,
2005
+ po,
2005
2006
  P,
2006
- Fs,
2007
- so,
2007
+ Is,
2008
+ co,
2008
2009
  B,
2009
2010
  Z,
2010
- Cc,
2011
- Uc,
2012
- Nc,
2011
+ wc,
2012
+ Wc,
2013
+ Pc,
2014
+ ac,
2013
2015
  ic,
2014
- rc,
2015
2016
  F
2016
- ]), Qc = D((e, t) => {
2017
+ ]), $c = D((e, t) => {
2017
2018
  Q(e, [], t ? { autoIntent: t } : {});
2018
- }, [Q]), $c = rt(), el = D(() => {
2019
- let e = [...So.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
2019
+ }, [Q]), el = it(), tl = D(() => {
2020
+ let e = [...Co.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
2020
2021
  if (!e || e.metadata?.approvalFollowUp) return;
2021
- let t = H ? Ds.current[H] ?? [] : [], n = aa(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
2022
- if (t.some((e) => ot(e, Date.now()))) {
2022
+ let t = H ? Os.current[H] ?? [] : [], n = oa(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
2023
+ if (t.some((e) => st(e, Date.now()))) {
2023
2024
  let n = H ?? void 0;
2024
- st(t, $c).then((t) => {
2025
+ ct(t, el).then((t) => {
2025
2026
  Q(e.content, t, {
2026
2027
  ...n === void 0 ? {} : { targetConversationId: n },
2027
2028
  ...r
@@ -2029,274 +2030,274 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
2029
2030
  });
2030
2031
  } else Q(e.content, t, r);
2031
2032
  }, [
2032
- Co,
2033
+ wo,
2033
2034
  Q,
2034
2035
  H,
2035
- $c
2036
- ]), tl = A(Q);
2036
+ el
2037
+ ]), nl = A(Q);
2037
2038
  O(() => {
2038
- tl.current = Q;
2039
+ nl.current = Q;
2039
2040
  }, [Q]);
2040
- let nl = k(() => {
2041
- if (To) return null;
2042
- for (let e = Co.length - 1; e >= 0; --e) {
2043
- let t = Co[e];
2041
+ let rl = k(() => {
2042
+ if (Eo) return null;
2043
+ for (let e = wo.length - 1; e >= 0; --e) {
2044
+ let t = wo[e];
2044
2045
  if (t?.role !== "assistant") continue;
2045
- if (t.id === dc) return null;
2046
- if (!dr(t) || Gs.current.has(t.id) || Pt(t.id)) continue;
2047
- let n = tr(t, wo, P);
2046
+ if (t.id === fc) return null;
2047
+ if (!fr(t) || Ks.current.has(t.id) || Ft(t.id)) continue;
2048
+ let n = nr(t, To, P);
2048
2049
  if (n.kind !== "output") return null;
2049
- let r = $e(n.text).text.trim();
2050
- return r ? Er(t, r, wo) : null;
2050
+ let r = et(n.text).text.trim();
2051
+ return r ? Dr(t, r, To) : null;
2051
2052
  }
2052
2053
  return null;
2053
2054
  }, [
2054
- Co,
2055
- To,
2056
2055
  wo,
2057
- dc,
2056
+ Eo,
2057
+ To,
2058
+ fc,
2058
2059
  P
2059
- ]), rl = k(() => nl ? ar(nl.text) : null, [nl]), il = k(() => So.chat.filter((e) => e.id !== dc), [So.chat, dc]), al = k(() => I ? So.all.filter((e) => e.id !== dc) : il, [
2060
+ ]), il = k(() => rl ? or(rl.text) : null, [rl]), al = k(() => Co.chat.filter((e) => e.id !== fc), [Co.chat, fc]), ol = k(() => I ? Co.all.filter((e) => e.id !== fc) : al, [
2060
2061
  I,
2061
- So.all,
2062
- dc,
2063
- il
2064
- ]), [ol, sl] = j(null), cl = w((e) => lt(e)?.sandboxId ?? null), ll = Mr(il, {
2062
+ Co.all,
2063
+ fc,
2064
+ al
2065
+ ]), [sl, cl] = j(null), ll = w((e) => ut(e)?.sandboxId ?? null), ul = Nr(al, {
2065
2066
  sessionId: G?.backendSessionId,
2066
- sandboxId: cl,
2067
+ sandboxId: ll,
2067
2068
  nowMs: Date.now()
2068
- }), ul = Nr(il), dl = (e) => {
2069
+ }), dl = Pr(al), fl = (e) => {
2069
2070
  if (ae(e.metadata).length > 0) return !0;
2070
2071
  let t = e.metadata?.sandboxId;
2071
- return oe(t ? Oo[t] : null);
2072
- }, fl = (e) => {
2072
+ return oe(t ? ko[t] : null);
2073
+ }, pl = (e) => {
2073
2074
  let t = ae(e.metadata);
2074
2075
  return t.length === 0 || !H ? null : /* @__PURE__ */ M(d, {
2075
2076
  refs: t,
2076
2077
  conversationId: H,
2077
2078
  panel: K,
2078
- entries: ko,
2079
- capabilitiesOf: (e) => Oo[e],
2080
- turnInFlight: To,
2079
+ entries: Ao,
2080
+ capabilitiesOf: (e) => ko[e],
2081
+ turnInFlight: Eo,
2081
2082
  tr: P,
2082
- onReview: jo.review,
2083
- retiredSandboxes: Ao,
2083
+ onReview: Mo.review,
2084
+ retiredSandboxes: jo,
2084
2085
  onReapply: () => void Q(P("writeProposal.reapplyPrompt", "That change wasn't saved because it changed after you read it. Fetch the latest version and reapply only your change on top of it."))
2085
2086
  });
2086
- }, pl = (e) => {
2087
+ }, ml = (e) => {
2087
2088
  if (!H) return null;
2088
2089
  let t = Z.liveOffersFor(e, {
2089
2090
  registry: {
2090
- destinations: Hr(oc),
2091
- permissionsSettled: sc,
2092
- simulating: cc
2091
+ destinations: Ur(sc),
2092
+ permissionsSettled: cc,
2093
+ simulating: lc
2093
2094
  },
2094
2095
  actorId: B,
2095
2096
  conversationId: H,
2096
2097
  perfNow: performance.now()
2097
2098
  }), n = t[0];
2098
- return n ? /* @__PURE__ */ M(Ni, {
2099
+ return n ? /* @__PURE__ */ M(Pi, {
2099
2100
  offers: t.map(({ offer: e, target: t }) => ({
2100
2101
  offerId: e.offerId,
2101
2102
  label: t.label,
2102
2103
  path: t.path
2103
2104
  })),
2104
- hint: t.length === 1 && z === "proposal-v1" ? Oi(n.offer, Z.turnFor(e)) : "link",
2105
- onOpen: Mc
2105
+ hint: t.length === 1 && z === "proposal-v1" ? ki(n.offer, Z.turnFor(e)) : "link",
2106
+ onOpen: Nc
2106
2107
  }, n.offer.offerId) : null;
2107
- }, ml = (e) => e.role === "assistant" ? pl(e.id) : null;
2108
+ }, hl = (e) => e.role === "assistant" ? ml(e.id) : null;
2108
2109
  O(() => {
2109
2110
  let e = Z.nextExpiryInMs(performance.now());
2110
2111
  if (e === null) return;
2111
- let t = window.setTimeout(Cc, e + 1);
2112
+ let t = window.setTimeout(wc, e + 1);
2112
2113
  return () => window.clearTimeout(t);
2113
2114
  }, [
2114
2115
  Z,
2115
- xc,
2116
- Cc
2116
+ Sc,
2117
+ wc
2117
2118
  ]);
2118
- let hl = jo.dialog.view ? ko[jo.dialog.view.proposalId] : void 0, gl = ll?.expiresAtMs ?? null;
2119
+ let gl = Mo.dialog.view ? Ao[Mo.dialog.view.proposalId] : void 0, _l = ul?.expiresAtMs ?? null;
2119
2120
  O(() => {
2120
- if (gl === null) return;
2121
- let e = window.setTimeout(() => Ws((e) => e + 1), Math.max(0, gl - Date.now()));
2121
+ if (_l === null) return;
2122
+ let e = window.setTimeout(() => Gs((e) => e + 1), Math.max(0, _l - Date.now()));
2122
2123
  return () => window.clearTimeout(e);
2123
- }, [gl, Us]);
2124
- let _l = k(() => So.voice.filter((e) => e.id !== dc && (e.role === "user" || e.role === "assistant")).map((e) => ({
2124
+ }, [_l, Ws]);
2125
+ let vl = k(() => Co.voice.filter((e) => e.id !== fc && (e.role === "user" || e.role === "assistant")).map((e) => ({
2125
2126
  id: e.id,
2126
2127
  role: e.role,
2127
- text: ir(e, wo, P),
2128
- sessionId: pr(e),
2128
+ text: ar(e, To, P),
2129
+ sessionId: mr(e),
2129
2130
  timestamp: e.timestamp
2130
2131
  })).filter((e) => e.text.length > 0), [
2131
- So.voice,
2132
- wo,
2133
- dc,
2132
+ Co.voice,
2133
+ To,
2134
+ fc,
2134
2135
  P
2135
- ]), vl = D(() => {
2136
- if (_l.length === 0) return;
2136
+ ]), yl = D(() => {
2137
+ if (vl.length === 0) return;
2137
2138
  let e = /* @__PURE__ */ new Date();
2138
- lr(sr(_l, {
2139
+ ur(cr(vl, {
2139
2140
  title: P("voiceSession.transcript", "Voice conversation"),
2140
2141
  savedAt: P("voiceSession.savedAt", "Saved"),
2141
2142
  session: P("voiceSession.sessionLabel", "Session"),
2142
2143
  earlier: P("voiceSession.earlierLabel", "Earlier"),
2143
2144
  you: P("voiceSession.speakerYou", "You"),
2144
2145
  assistant: P("voiceSession.speakerAssistant", "Assistant")
2145
- }, e), cr(L, e), "text/markdown");
2146
+ }, e), lr(L, e), "text/markdown");
2146
2147
  }, [
2147
2148
  L,
2148
- _l,
2149
+ vl,
2149
2150
  P
2150
- ]), yl = nt({ perFileChars: cs }), bl = A(yl);
2151
- bl.current = yl;
2152
- let [xl, Sl] = j(null), Cl = xl === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: xl });
2151
+ ]), bl = rt({ perFileChars: ls }), xl = A(bl);
2152
+ xl.current = bl;
2153
+ let [Sl, Cl] = j(null), wl = Sl === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: Sl });
2153
2154
  O(() => {
2154
- if (xl === null) return;
2155
- let e = window.setTimeout(() => Sl(null), ma);
2155
+ if (Sl === null) return;
2156
+ let e = window.setTimeout(() => Cl(null), ha);
2156
2157
  return () => window.clearTimeout(e);
2157
- }, [xl]);
2158
- let wl = A(/* @__PURE__ */ new Set()), Tl = A(() => !1), El = D((e, t, n, r) => {
2159
- let i = vs.current, a = wr(i), o = () => {
2158
+ }, [Sl]);
2159
+ let Tl = A(/* @__PURE__ */ new Set()), El = A(() => !1), Dl = D((e, t, n, r) => {
2160
+ let i = ys.current, a = Tr(i), o = () => {
2160
2161
  let e = w.getState();
2161
- return vr({
2162
- sessionLive: Tl.current(t),
2162
+ return yr({
2163
+ sessionLive: El.current(t),
2163
2164
  boundAtSubmit: i,
2164
2165
  activeConversationId: e.activeConversationId,
2165
2166
  boundConversationExists: e.conversations.some((e) => e.id === a)
2166
2167
  });
2167
2168
  }, s = () => {
2168
- let i = bl.current;
2169
- at({
2169
+ let i = xl.current;
2170
+ ot({
2170
2171
  draft: i,
2171
2172
  maySend: o,
2172
- budgetMs: it,
2173
+ budgetMs: at,
2173
2174
  sendTurn: (i) => {
2174
2175
  let a = {
2175
2176
  ...n,
2176
- handedOver: mn()
2177
+ handedOver: hn()
2177
2178
  };
2178
- tl.current(e, i, {
2179
+ nl.current(e, i, {
2179
2180
  fromPerson: !0,
2180
2181
  voiceSessionId: t,
2181
2182
  voiceTiming: a,
2182
2183
  ...r.correction ? { correctsInFlightTurn: !0 } : {}
2183
2184
  });
2184
2185
  },
2185
- announceDropped: (e) => Sl(e)
2186
+ announceDropped: (e) => Cl(e)
2186
2187
  });
2187
2188
  };
2188
- if (o() && Hc.current(e, t)) {
2189
- tl.current(e, [], {
2189
+ if (o() && Uc.current(e, t)) {
2190
+ nl.current(e, [], {
2190
2191
  fromPerson: !0,
2191
2192
  voiceSessionId: t,
2192
2193
  voiceTiming: {
2193
2194
  ...n,
2194
- handedOver: mn()
2195
+ handedOver: hn()
2195
2196
  }
2196
2197
  });
2197
2198
  return;
2198
2199
  }
2199
- if (!bl.current.isBusy) {
2200
+ if (!xl.current.isBusy) {
2200
2201
  s();
2201
2202
  return;
2202
2203
  }
2203
- let c = Date.now(), l = wl.current, u = window.setInterval(() => {
2204
- let e = bl.current.isBusy;
2205
- bl.current.isCommitting || e && Date.now() - c < pa || (window.clearInterval(u), l.delete(u), s());
2204
+ let c = Date.now(), l = Tl.current, u = window.setInterval(() => {
2205
+ let e = xl.current.isBusy;
2206
+ xl.current.isCommitting || e && Date.now() - c < ma || (window.clearInterval(u), l.delete(u), s());
2206
2207
  }, 200);
2207
2208
  l.add(u);
2208
- }, []), Dl = A(() => void 0), $ = et({
2209
- onSubmit: El,
2210
- latestReply: nl,
2211
- language: o(Ya, V).tag,
2212
- graceMs: Ga,
2213
- onSupersede: Ys,
2214
- handsFreeStreamNoticeAccepted: qa,
2215
- onAcceptHandsFreeStreamNotice: Ja,
2216
- handsFreeInterrupt: Ka,
2209
+ }, []), Ol = A(() => void 0), $ = tt({
2210
+ onSubmit: Dl,
2211
+ latestReply: rl,
2212
+ language: o(Xa, V).tag,
2213
+ graceMs: Ka,
2214
+ onSupersede: Xs,
2215
+ handsFreeStreamNoticeAccepted: Ja,
2216
+ onAcceptHandsFreeStreamNotice: Ya,
2217
+ handsFreeInterrupt: qa,
2217
2218
  onBargeIn: () => {
2218
- Dl.current(), Js();
2219
+ Ol.current(), Ys();
2219
2220
  }
2220
2221
  });
2221
- Tl.current = $.isCurrentSession;
2222
- let Ol = ys ? _l.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : _l, kl = $.answerLocally;
2222
+ El.current = $.isCurrentSession;
2223
+ let kl = bs ? vl.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : vl, Al = $.answerLocally;
2223
2224
  O(() => {
2224
- Gc.current = kl;
2225
- }, [kl]);
2226
- let Al = $.active, jl = k(() => v(Object.values(ko), H, Ao), [
2227
- ko,
2225
+ Kc.current = Al;
2226
+ }, [Al]);
2227
+ let jl = $.active, Ml = k(() => v(Object.values(Ao), H, jo), [
2228
+ Ao,
2228
2229
  H,
2229
- Ao
2230
- ]), [Ml, Nl] = j(null);
2230
+ jo
2231
+ ]), [Nl, Pl] = j(null);
2231
2232
  O(() => {
2232
- Al || Nl(null);
2233
- }, [Al]);
2234
- let Pl = jo.review, Fl = D(() => {
2235
- let e = jl[jl.length - 1];
2233
+ jl || Pl(null);
2234
+ }, [jl]);
2235
+ let Fl = Mo.review, Il = D(() => {
2236
+ let e = Ml[Ml.length - 1];
2236
2237
  if (!e) return;
2237
2238
  let { view: t } = e;
2238
- f(t) && m(t, Oo[e.session.sandboxId]).offerConfirm ? Pl(t) : Nl(t.proposalId);
2239
+ f(t) && m(t, ko[e.session.sandboxId]).offerConfirm ? Fl(t) : Pl(t.proposalId);
2239
2240
  }, [
2240
- jl,
2241
- Oo,
2242
- Pl
2243
- ]), Il = Al ? _(jl) : null, Ll = Ml ? ko[Ml] : void 0, Rl = Al && Ll && Ll.session.conversationId === H ? {
2241
+ Ml,
2242
+ ko,
2243
+ Fl
2244
+ ]), Ll = jl ? _(Ml) : null, Rl = Nl ? Ao[Nl] : void 0, zl = jl && Rl && Rl.session.conversationId === H ? {
2244
2245
  content: /* @__PURE__ */ M(d, {
2245
2246
  refs: [{
2246
- proposalId: Ll.view.proposalId,
2247
- sandboxId: Ll.session.sandboxId,
2248
- sessionId: Ll.session.sessionId
2247
+ proposalId: Rl.view.proposalId,
2248
+ sandboxId: Rl.session.sandboxId,
2249
+ sessionId: Rl.session.sessionId
2249
2250
  }],
2250
- conversationId: Ll.session.conversationId,
2251
+ conversationId: Rl.session.conversationId,
2251
2252
  panel: K,
2252
- entries: ko,
2253
- capabilitiesOf: (e) => Oo[e],
2254
- turnInFlight: To,
2253
+ entries: Ao,
2254
+ capabilitiesOf: (e) => ko[e],
2255
+ turnInFlight: Eo,
2255
2256
  tr: P,
2256
- onReview: Pl,
2257
- retiredSandboxes: Ao
2257
+ onReview: Fl,
2258
+ retiredSandboxes: jo
2258
2259
  }),
2259
2260
  closeLabel: re(P, h.trayClose),
2260
- onClose: () => Nl(null)
2261
- } : null, zl = jo.asking, Bl = Fc?.asking === !0, Vl = Ic?.asking === !0, Hl = mi(), Ul = $.holdListening, Wl = k(() => Al || J ? null : { run: () => ps ? { status: "already" } : (_s(!0), { status: "done" }) }, [
2262
- Al,
2261
+ onClose: () => Pl(null)
2262
+ } : null, Bl = Mo.asking, Vl = Ic?.asking === !0, Hl = Lc?.asking === !0, Ul = hi(), Wl = $.holdListening, Gl = k(() => jl || J ? null : { run: () => ms ? { status: "already" } : (vs(!0), { status: "done" }) }, [
2263
+ jl,
2263
2264
  J,
2264
- ps,
2265
- _s
2265
+ ms,
2266
+ vs
2266
2267
  ]);
2267
- fi("assistant.transcript", Wl);
2268
- let Gl = k(() => Al ? null : { run: () => {
2268
+ pi("assistant.transcript", Gl);
2269
+ let Kl = k(() => jl ? null : { run: () => {
2269
2270
  let e = w.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
2270
2271
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
2271
- } }, [Al]);
2272
- fi("assistant.conversation.new", Gl), O(() => {
2273
- Ul(Al && (zl || Bl || Vl || Hl));
2272
+ } }, [jl]);
2273
+ pi("assistant.conversation.new", Kl), O(() => {
2274
+ Wl(jl && (Bl || Vl || Hl || Ul));
2274
2275
  }, [
2275
- Al,
2276
- zl,
2276
+ jl,
2277
2277
  Bl,
2278
2278
  Vl,
2279
2279
  Hl,
2280
- Ul
2280
+ Ul,
2281
+ Wl
2281
2282
  ]);
2282
- let Kl = A(null), ql = $.announce;
2283
+ let ql = A(null), Jl = $.announce;
2283
2284
  O(() => {
2284
- if (!Al) {
2285
- Kl.current = null;
2285
+ if (!jl) {
2286
+ ql.current = null;
2286
2287
  return;
2287
2288
  }
2288
- let e = Kl.current;
2289
- if (e === null) Kl.current = new Set(Object.keys(ko));
2290
- else for (let { view: t, session: n } of ne(jl, e)) {
2289
+ let e = ql.current;
2290
+ if (e === null) ql.current = new Set(Object.keys(Ao));
2291
+ else for (let { view: t, session: n } of ne(Ml, e)) {
2291
2292
  e.add(t.proposalId);
2292
- let r = Oo[n.sandboxId];
2293
+ let r = ko[n.sandboxId];
2293
2294
  if (!g({
2294
2295
  mode: "api-calls",
2295
2296
  productWriteApproval: z,
2296
2297
  capabilities: r
2297
2298
  })) continue;
2298
2299
  let i = ie(t, m(t, r).offerConfirm, P), a = t.proposalId;
2299
- ql({
2300
+ Jl({
2300
2301
  id: `write-readback:${a}`,
2301
2302
  text: i.text,
2302
2303
  lang: i.translated ? V : "en",
@@ -2304,570 +2305,576 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
2304
2305
  });
2305
2306
  }
2306
2307
  }, [
2307
- Al,
2308
2308
  jl,
2309
+ Ml,
2310
+ Ao,
2309
2311
  ko,
2310
- Oo,
2311
2312
  z,
2312
2313
  P,
2313
2314
  V,
2314
- ql,
2315
+ Jl,
2315
2316
  K
2316
2317
  ]);
2317
- let Jl = A(!1);
2318
+ let Yl = A(!1);
2318
2319
  O(() => {
2319
- Jl.current = $.active;
2320
- }, [$.active]), O(() => Zi((e) => {
2321
- if (!Jl.current) return !1;
2322
- let t = vs.current;
2320
+ Yl.current = $.active;
2321
+ }, [$.active]), O(() => Qi((e) => {
2322
+ if (!Yl.current) return !1;
2323
+ let t = ys.current;
2323
2324
  return typeof t == "string" ? t === e : w.getState().activeConversationId === e;
2324
2325
  }), []);
2325
- let Yl = $.start, Xl = D(() => {
2326
- let e = w.getState().activeConversationId, t = xr(Es());
2327
- Cs(Cr(t, e)), Rs(!0, t.kind === "own"), Yl();
2326
+ let Xl = $.start, Zl = D(() => {
2327
+ let e = w.getState().activeConversationId, t = Sr(Ds());
2328
+ ws(wr(t, e)), zs(!0, t.kind === "own"), Xl();
2328
2329
  }, [
2329
- Cs,
2330
- Rs,
2331
- Es,
2332
- Yl
2333
- ]), Zl = k(() => rr(G?.messages ?? []), [G?.messages]), Ql = nr(So.voice, wo, P), $l = nr(Zl, wo, P) > 0, eu = D(() => {
2330
+ ws,
2331
+ zs,
2332
+ Ds,
2333
+ Xl
2334
+ ]), Ql = k(() => ir(G?.messages ?? []), [G?.messages]), $l = rr(Co.voice, To, P), eu = rr(Ql, To, P) > 0, tu = D(() => {
2334
2335
  let e = w.getState().activeConversationId;
2335
- if (!e || _l.length === 0) return;
2336
- let t = new Set(Zl.map((e) => e.id)), n = N();
2336
+ if (!e || vl.length === 0) return;
2337
+ let t = new Set(Ql.map((e) => e.id)), n = N();
2337
2338
  W(e, {
2338
2339
  id: n,
2339
2340
  role: "system",
2340
- content: or(_l.filter((e) => t.has(e.id)), {
2341
+ content: sr(vl.filter((e) => t.has(e.id)), {
2341
2342
  intro: P("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
2342
2343
  nothing: P("voiceSession.continuedNothing", "Continued from a voice conversation."),
2343
2344
  more: (e) => P("voiceSession.continuedMore", "…and {{count}} more", { count: e })
2344
2345
  }),
2345
2346
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2346
- metadata: { continuedVoiceTurns: Ql }
2347
- }), Hi.recordCommittedEntries(e, [n], "NOTE", T()), _s(!1), $.end(), hs(), Aa?.();
2347
+ metadata: { continuedVoiceTurns: $l }
2348
+ }), Ui.recordCommittedEntries(e, [n], "NOTE", T()), vs(!1), $.end(), gs(), ja?.();
2348
2349
  }, [
2349
- _l,
2350
+ vl,
2351
+ $l,
2350
2352
  Ql,
2351
- Zl,
2352
2353
  W,
2353
2354
  P,
2354
2355
  $,
2355
- _s,
2356
- hs,
2357
- Aa
2358
- ]), tu = A({
2356
+ vs,
2357
+ gs,
2358
+ ja
2359
+ ]), nu = A({
2359
2360
  conversationId: null,
2360
2361
  count: 0
2361
2362
  });
2362
2363
  O(() => {
2363
- $.active && (tu.current = {
2364
+ $.active && (nu.current = {
2364
2365
  conversationId: H,
2365
- count: Ql
2366
+ count: $l
2366
2367
  });
2367
2368
  }, [$.active]);
2368
- let [nu, ru] = j({}), [iu, au] = j({}), ou = A(null), su = $.active;
2369
+ let [ru, iu] = j({}), [au, ou] = j({}), su = A(null), cu = $.active;
2369
2370
  O(() => {
2370
2371
  if (!I) return;
2371
- if (su) {
2372
- ou.current ??= {
2372
+ if (cu) {
2373
+ su.current ??= {
2373
2374
  startedAt: Date.now(),
2374
2375
  sessionId: null
2375
2376
  };
2376
2377
  return;
2377
2378
  }
2378
- let e = ou.current;
2379
- ou.current = null;
2379
+ let e = su.current;
2380
+ su.current = null;
2380
2381
  let t = e?.sessionId;
2381
2382
  if (e && t) {
2382
2383
  let n = Math.max(1, Math.round((Date.now() - e.startedAt) / 1e3));
2383
- au((e) => ({
2384
+ ou((e) => ({
2384
2385
  ...e,
2385
2386
  [t]: n
2386
2387
  }));
2387
2388
  }
2388
- }, [I, su]);
2389
- let cu = $.isCurrentSession;
2389
+ }, [I, cu]);
2390
+ let lu = $.isCurrentSession;
2390
2391
  O(() => {
2391
- let e = ou.current;
2392
+ let e = su.current;
2392
2393
  if (!I || !e || e.sessionId) return;
2393
- let t = _l.find((e) => e.sessionId !== void 0 && cu(e.sessionId));
2394
+ let t = vl.find((e) => e.sessionId !== void 0 && lu(e.sessionId));
2394
2395
  t?.sessionId && (e.sessionId = t.sessionId);
2395
2396
  }, [
2396
2397
  I,
2397
- _l,
2398
- cu
2398
+ vl,
2399
+ lu
2399
2400
  ]);
2400
- let lu = $.session.phase, uu = al[al.length - 1], du = I && $.active && (lu === "thinking" || lu === "speaking") && uu?.role === "assistant" && dr(uu) ? uu.id : null, fu = $.spokenChunks, pu = du !== null && $s === du && fu ? gr(uu?.content ?? "", fu.chunks.slice(0, fu.index + 1).join(" ").length) : null, [mu, hu] = j({});
2401
- du !== null && pu !== null && pu.length > (mu[du]?.length ?? 0) && hu({
2402
- ...mu,
2403
- [du]: pu
2401
+ let uu = $.session.phase, du = ol[ol.length - 1], fu = I && $.active && (uu === "thinking" || uu === "speaking") && du?.role === "assistant" && fr(du) ? du.id : null, pu = $.spokenChunks, mu = fu !== null && ec === fu && pu ? _r(du?.content ?? "", pu.chunks.slice(0, pu.index + 1).join(" ").length) : null, [hu, gu] = j({});
2402
+ fu !== null && mu !== null && mu.length > (hu[fu]?.length ?? 0) && gu({
2403
+ ...hu,
2404
+ [fu]: mu
2404
2405
  });
2405
- let gu = du === null ? null : mu[du] ?? "", _u = D(() => {
2406
- if (du === null || gu === null || !H) return;
2406
+ let _u = fu === null ? null : hu[fu] ?? "", vu = D(() => {
2407
+ if (fu === null || _u === null || !H) return;
2407
2408
  let e = w.getState();
2408
- if (gu === "") {
2409
- e.mergeMessageMetadata(H, du, { voiceNotSpoken: !0 });
2409
+ if (_u === "") {
2410
+ e.mergeMessageMetadata(H, fu, { voiceNotSpoken: !0 });
2410
2411
  return;
2411
2412
  }
2412
- if ($s !== du) return;
2413
- let t = gu;
2414
- ru((e) => ({
2413
+ if (ec !== fu) return;
2414
+ let t = _u;
2415
+ iu((e) => ({
2415
2416
  ...e,
2416
- [du]: t
2417
- })), e.mergeMessageMetadata(H, du, {
2417
+ [fu]: t
2418
+ })), e.mergeMessageMetadata(H, fu, {
2418
2419
  voiceInterrupted: !0,
2419
2420
  voiceSpokenText: t
2420
2421
  });
2421
2422
  }, [
2422
- du,
2423
- gu,
2423
+ fu,
2424
+ _u,
2424
2425
  H,
2425
- $s
2426
+ ec
2426
2427
  ]);
2427
2428
  O(() => {
2428
- Dl.current = _u;
2429
- }, [_u]);
2430
- let vu = (e, t, n) => {
2431
- if (!dr(e)) return;
2432
- let r = pr(e), i = n[t + 1], a = $.active && r !== void 0 && cu(r), o = (!i || !dr(i) || pr(i) !== r) && !a ? /* @__PURE__ */ M(mr, { seconds: r ? iu[r] : void 0 }) : null;
2433
- if (e.role === "user") return { below: /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(hr, { mark: "spoken" }), o] }) };
2429
+ Ol.current = vu;
2430
+ }, [vu]);
2431
+ let yu = (e, t, n) => {
2432
+ if (!fr(e)) return;
2433
+ let r = mr(e), i = n[t + 1], a = $.active && r !== void 0 && lu(r), o = (!i || !fr(i) || mr(i) !== r) && !a ? /* @__PURE__ */ M(hr, { seconds: r ? au[r] : void 0 }) : null;
2434
+ if (e.role === "user") return { below: /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(gr, { mark: "spoken" }), o] }) };
2434
2435
  if (e.role !== "assistant") return o ? { below: o } : void 0;
2435
- let s = nu[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
2436
+ let s = ru[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
2436
2437
  if (s !== void 0) return {
2437
2438
  content: s,
2438
- below: /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(hr, { mark: "interrupted" }), o] })
2439
+ below: /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(gr, { mark: "interrupted" }), o] })
2439
2440
  };
2440
- if (e.id === du && gu !== null) return { content: gu };
2441
- let c = a || r !== void 0 && iu[r] !== void 0;
2442
- return e.content.trim() !== "" && (c ? mu[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(hr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
2443
- }, yu = D(() => {
2444
- let e = tu.current, t = e.conversationId === H ? e.count : 0, n = Ql > t;
2445
- $.end(), n && _s(!0), _u();
2441
+ if (e.id === fu && _u !== null) return { content: _u };
2442
+ let c = a || r !== void 0 && au[r] !== void 0;
2443
+ return e.content.trim() !== "" && (c ? hu[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(gr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
2444
+ }, bu = D(() => {
2445
+ let e = nu.current, t = e.conversationId === H ? e.count : 0, n = $l > t;
2446
+ $.end(), n && vs(!0), vu();
2446
2447
  }, [
2447
2448
  H,
2448
- Ql,
2449
+ $l,
2449
2450
  $,
2450
- _s,
2451
- _u
2451
+ vs,
2452
+ vu
2452
2453
  ]);
2453
2454
  O(() => {
2454
- Sa && Ps || !$.active || $.end();
2455
+ Ca && Fs || !$.active || $.end();
2455
2456
  }, [
2456
- Sa,
2457
- Ps,
2457
+ Ca,
2458
+ Fs,
2458
2459
  $
2459
2460
  ]);
2460
- let [bu, xu] = j(_a), Su = qe({
2461
+ let [xu, Su] = j(va), Cu = Je({
2461
2462
  available: $.available,
2462
- allowedInMode: Ps,
2463
- readOnly: Po,
2464
- busy: To || Hs !== null || Io || _c,
2465
- committing: bu.committing,
2466
- dictating: bu.dictating
2467
- }), Cu = C();
2468
- sa(() => {
2469
- Oa?.({ live: $.active });
2470
- }, [Oa, $.active]);
2471
- let wu = A(!1), Tu = D(() => {
2472
- wu.current = !0, ka?.({ review: !0 });
2473
- }, [ka]);
2463
+ allowedInMode: Fs,
2464
+ readOnly: Fo,
2465
+ busy: Eo || Us !== null || Lo || vc,
2466
+ committing: xu.committing,
2467
+ dictating: xu.dictating
2468
+ }), wu = qe();
2469
+ ca(() => {
2470
+ ka?.({ live: $.active });
2471
+ }, [ka, $.active]);
2472
+ let Tu = A(!1), Eu = D(() => {
2473
+ Tu.current = !0, Aa?.({ review: !0 });
2474
+ }, [Aa]);
2474
2475
  O(() => {
2475
- !Fa && wu.current && (wu.current = !1, je(md.current));
2476
- }, [Fa]);
2477
- let Eu = $.active;
2476
+ !Ia && Tu.current && (Tu.current = !1, Me(hd.current));
2477
+ }, [Ia]);
2478
+ let Du = $.active;
2478
2479
  O(() => {
2479
- if (!Eu) Ts.current = !1, ws.current = null;
2480
- else if (ys) {
2481
- let e = vs.current;
2482
- _r(e) && (ws.current = e.openAtStart), Ts.current = !0;
2483
- } else Ts.current && (Ts.current = !1, F && ke({
2480
+ if (!Du) Es.current = !1, Ts.current = null;
2481
+ else if (bs) {
2482
+ let e = ys.current;
2483
+ vr(e) && (Ts.current = e.openAtStart), Es.current = !0;
2484
+ } else Es.current && (Es.current = !1, F && Ae({
2484
2485
  pending: "own",
2485
- openAtStart: ws.current
2486
- }, vs.current) && Ss(!0));
2486
+ openAtStart: Ts.current
2487
+ }, ys.current) && Cs(!0));
2487
2488
  }, [
2488
- ys,
2489
- Eu,
2489
+ bs,
2490
+ Du,
2490
2491
  F
2491
- ]), xs && !$.active && Ss(!1);
2492
- let [Du, Ou] = j(null);
2492
+ ]), Ss && !$.active && Cs(!1);
2493
+ let [Ou, ku] = j(null);
2493
2494
  O(() => {
2494
- Du !== null && (J && Du.conversationId === H || Ou(null));
2495
+ Ou !== null && (J && Ou.conversationId === H || ku(null));
2495
2496
  }, [
2496
2497
  J,
2497
2498
  H,
2498
- Du
2499
+ Ou
2499
2500
  ]);
2500
- let ku = Du !== null && $s === Du.replyId, Au = A(!1), ju = D(() => {
2501
- Au.current = !0, ku && ec(), Xl();
2501
+ let Au = Ou !== null && ec === Ou.replyId, ju = A(!1), Mu = D(() => {
2502
+ ju.current = !0, Au && tc(), Zl();
2502
2503
  }, [
2503
- Xl,
2504
- ku,
2505
- ec
2506
- ]), Mu = D(() => {
2507
- ku && ec(), Xl();
2504
+ Zl,
2505
+ Au,
2506
+ tc
2507
+ ]), Nu = D(() => {
2508
+ Au && tc(), Zl();
2508
2509
  }, [
2509
- Xl,
2510
- ku,
2511
- ec
2510
+ Zl,
2511
+ Au,
2512
+ tc
2512
2513
  ]);
2513
2514
  O(() => {
2514
- $.active || (Au.current = !1);
2515
+ $.active || (ju.current = !1);
2515
2516
  }, [$.active]), O(() => {
2516
- !J && Au.current && (Au.current = !1, $.active && yu());
2517
+ !J && ju.current && (ju.current = !1, $.active && bu());
2517
2518
  }, [
2518
2519
  J,
2519
2520
  $.active,
2520
- yu
2521
+ bu
2521
2522
  ]), O(() => {
2522
- J && _s(!1);
2523
- }, [J, _s]);
2524
- let Nu = k(() => ({
2523
+ J && vs(!1);
2524
+ }, [J, vs]);
2525
+ let Pu = k(() => ({
2525
2526
  live: $.active,
2526
- blocked: Su === null ? null : Cu.voiceStartBlocked(Su),
2527
- impossible: Je(Su),
2528
- start: F ? Mu : ju
2527
+ blocked: Cu === null ? null : wu.voiceStartBlocked(Cu),
2528
+ impossible: Ye(Cu),
2529
+ start: F ? Nu : Mu
2529
2530
  }), [
2530
2531
  $.active,
2531
- Su,
2532
2532
  Cu,
2533
+ wu,
2533
2534
  F,
2534
- Mu,
2535
- ju
2536
- ]), [Pu, Fu] = j("mini"), [Iu, Lu] = j(!1), Ru = Fa && $.active && (Iu || J);
2537
- Ru !== Iu && Lu(Ru);
2538
- let zu = F && !I && $.active && !J && (!Fa || Iu), Bu = Sa && q.covered !== !0 && !($.active && Pu !== "mini") && !(ps && !$.active) && !(zl || Bl || Vl || Hl), Vu = ms?.ask, Hu = ca(Vu?.subscribe ?? ya, Vu?.getSnapshot ?? ba, Vu?.getSnapshot ?? ba), Uu = Ye({
2535
+ Nu,
2536
+ Mu
2537
+ ]), [Fu, Iu] = j("mini"), [Lu, Ru] = j(!1), zu = Ia && $.active && (Lu || J);
2538
+ zu !== Lu && Ru(zu);
2539
+ let Bu = F && !I && $.active && !J && (!Ia || Lu), Vu = Ca && q.covered !== !0 && !($.active && Fu !== "mini") && !(ms && !$.active) && !(Bl || Vl || Hl || Ul), Hu = hs?.ask, Uu = la(Hu?.subscribe ?? ba, Hu?.getSnapshot ?? xa, Hu?.getSnapshot ?? xa), Wu = Xe({
2539
2540
  voiceLive: $.active,
2540
- readOnly: Po,
2541
- writes: Xe({
2542
- auto: ns,
2541
+ readOnly: Fo,
2542
+ writes: Ze({
2543
+ auto: rs,
2543
2544
  selectedMode: U,
2544
- conversation: G && !Po ? {
2545
+ conversation: G && !Fo ? {
2545
2546
  mode: G.mode,
2546
2547
  routedBy: G.routedBy,
2547
- hasHistory: Ui(G)
2548
+ hasHistory: Wi(G)
2548
2549
  } : null,
2549
- modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 || yt(e)
2550
+ modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 || bt(e)
2550
2551
  }),
2551
- avatar: Hu,
2552
- busy: To || Hs !== null || Io || _c || ls !== null || os,
2553
- committing: bu.committing
2554
- }), Wu = A(Uu);
2555
- sa(() => {
2556
- Wu.current = Uu;
2557
- }, [Uu]);
2558
- let Gu = D((e) => {
2552
+ avatar: Uu,
2553
+ busy: Eo || Us !== null || Lo || vc || us !== null || ss,
2554
+ committing: xu.committing
2555
+ }), Gu = A(Wu);
2556
+ ca(() => {
2557
+ Gu.current = Wu;
2558
+ }, [Wu]);
2559
+ let Ku = D((e) => {
2559
2560
  let t = e.trim();
2560
- if (t === "" || Wu.current !== null) return { accepted: !1 };
2561
- ku && ec();
2561
+ if (t === "" || Gu.current !== null) return { accepted: !1 };
2562
+ Au && tc();
2562
2563
  let n = {
2563
2564
  token: N(),
2564
2565
  exchange: null,
2565
2566
  handled: !1
2566
2567
  };
2567
- tc.current = n;
2568
+ nc.current = n;
2568
2569
  try {
2569
2570
  Q(t, [], {
2570
2571
  fromPerson: !0,
2571
2572
  avatarTabAsk: n.token,
2572
2573
  localRecordsChecked: !0,
2573
- ...ns ? { autoIntent: "read" } : {}
2574
+ ...rs ? { autoIntent: "read" } : {}
2574
2575
  });
2575
2576
  } finally {
2576
- tc.current = null;
2577
+ nc.current = null;
2577
2578
  }
2578
2579
  let r = n.exchange;
2579
2580
  return r === null ? n.handled ? {
2580
2581
  accepted: !0,
2581
2582
  recorded: !1
2582
- } : { accepted: !1 } : (Ou(r), {
2583
+ } : { accepted: !1 } : (ku(r), {
2583
2584
  accepted: !0,
2584
2585
  recorded: !0,
2585
2586
  ...r
2586
2587
  });
2587
2588
  }, [
2588
- ns,
2589
+ rs,
2589
2590
  Q,
2590
- ec,
2591
- ku
2592
- ]), [Ku] = j(() => Qe()), qu = k(() => ({
2593
- blocker: Uu,
2594
- line: Ze(Uu, Su),
2595
- send: Gu,
2596
- last: Du,
2597
- navigatingReplyId: yc,
2598
- draft: Ku
2591
+ tc,
2592
+ Au
2593
+ ]), [qu] = j(() => $e()), Ju = k(() => ({
2594
+ blocker: Wu,
2595
+ line: Qe(Wu, Cu),
2596
+ send: Ku,
2597
+ last: Ou,
2598
+ navigatingReplyId: bc,
2599
+ draft: qu
2599
2600
  }), [
2600
- Uu,
2601
- Su,
2602
- Gu,
2603
- Du,
2604
- yc,
2605
- Ku
2606
- ]), Ju = q.setReplyEscape, Yu = J && Bu && ku;
2601
+ Wu,
2602
+ Cu,
2603
+ Ku,
2604
+ Ou,
2605
+ bc,
2606
+ qu
2607
+ ]), Yu = q.setReplyEscape, Xu = J && Vu && Au;
2607
2608
  O(() => {
2608
- if (Ju && Yu) return Ju(ec), () => Ju(null);
2609
+ if (Yu && Xu) return Yu(tc), () => Yu(null);
2609
2610
  }, [
2610
- Ju,
2611
2611
  Yu,
2612
- ec
2612
+ Xu,
2613
+ tc
2613
2614
  ]), O(() => {
2614
- let e = vs.current, t = wr(e), n = w.getState(), r = br({
2615
+ let e = ys.current, t = Tr(e), n = w.getState(), r = xr({
2615
2616
  sessionLive: $.active,
2616
2617
  bound: e,
2617
2618
  activeConversationId: n.activeConversationId,
2618
2619
  boundConversationExists: n.conversations.some((e) => e.id === t)
2619
2620
  });
2620
- Cs(r.bound), r.end && $.end();
2621
+ ws(r.bound), r.end && $.end();
2621
2622
  }, [
2622
2623
  $,
2623
2624
  H,
2624
- to,
2625
- Cs
2625
+ no,
2626
+ ws
2626
2627
  ]), O(() => {
2627
- let e = yr(Tr.read(), {
2628
+ let e = br(Er.read(), {
2628
2629
  activeConversationId: H,
2629
- chatTurnCount: il.length,
2630
- voiceTurnCount: _l.length,
2630
+ chatTurnCount: al.length,
2631
+ voiceTurnCount: vl.length,
2631
2632
  sessionLive: $.active,
2632
- sessionBoundTo: vs.current,
2633
- turnInFlight: To
2633
+ sessionBoundTo: ys.current,
2634
+ turnInFlight: Eo
2634
2635
  });
2635
- Tr.write(e.state), e.open && _s(!0);
2636
+ Er.write(e.state), e.open && vs(!0);
2636
2637
  }, [
2637
2638
  H,
2638
- il.length,
2639
- _l.length,
2639
+ al.length,
2640
+ vl.length,
2640
2641
  $.active,
2641
- To,
2642
- _s
2642
+ Eo,
2643
+ vs
2643
2644
  ]), O(() => {
2644
2645
  if (!$.active) {
2645
- bl.current.clear(), Sl(null), Ks.current = null;
2646
- for (let e of wl.current) window.clearInterval(e);
2647
- wl.current.clear();
2646
+ xl.current.clear(), Cl(null), qs.current = null;
2647
+ for (let e of Tl.current) window.clearInterval(e);
2648
+ Tl.current.clear();
2648
2649
  }
2649
2650
  }, [$.active]), O(() => {
2650
- let e = wl.current;
2651
+ let e = Tl.current;
2651
2652
  return () => {
2652
2653
  for (let t of e) window.clearInterval(t);
2653
2654
  e.clear();
2654
2655
  };
2655
2656
  }, []), O(() => {
2656
2657
  let e = w.getState().consumePendingPrompt();
2657
- return e && tl.current(e), w.subscribe((e, t) => {
2658
+ return e && nl.current(e), w.subscribe((e, t) => {
2658
2659
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
2659
2660
  let e = w.getState().consumePendingPrompt();
2660
- e && tl.current(e);
2661
+ e && nl.current(e);
2661
2662
  }
2662
2663
  });
2663
2664
  }, []);
2664
- let Xu = D((e) => {
2665
+ let Zu = D((e) => {
2665
2666
  let t = H ? w.getState().conversations.find((e) => e.id === H) : void 0;
2666
- if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Ui(t)) {
2667
+ if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Wi(t)) {
2667
2668
  if (t.mode !== e) {
2668
- let t = Xi(), n = w.getState().conversations.find((n) => n.mode === e && Ki(n, t) && !w.getState().processingByConversationId[n.id]);
2669
- n ? ao(n.id) : oo(void 0, e);
2669
+ let t = Zi(), n = w.getState().conversations.find((n) => n.mode === e && qi(n, t) && !w.getState().processingByConversationId[n.id]);
2670
+ n ? oo(n.id) : so(void 0, e);
2670
2671
  }
2671
- } else H && io(H, e);
2672
+ } else H && ao(H, e);
2672
2673
  let n = w.getState().activeConversationId;
2673
- n ? io(n, e) : bo(!1), ro(e);
2674
+ n ? ao(n, e) : xo(!1), io(e);
2674
2675
  }, [
2675
2676
  H,
2677
+ so,
2676
2678
  oo,
2679
+ xo,
2677
2680
  ao,
2678
- bo,
2679
2681
  io,
2680
- ro,
2681
2682
  K
2682
- ]), Zu = D(() => {
2683
+ ]), Qu = D(() => {
2683
2684
  let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
2684
2685
  if (!t) {
2685
- bo(!0), ro(b);
2686
+ xo(!0), io(b);
2686
2687
  return;
2687
2688
  }
2688
2689
  if (t.routedBy === "auto") {
2689
- bo(!0);
2690
+ xo(!0);
2690
2691
  return;
2691
2692
  }
2692
- if (!Ui(t)) {
2693
- xo(t.id, b);
2693
+ if (!Wi(t)) {
2694
+ So(t.id, b);
2694
2695
  return;
2695
2696
  }
2696
2697
  K.withdraw(t.id, "mode_switched");
2697
- let n = Xi(), r = e.conversations.find((t) => t.routedBy === "auto" && Ki(t, n) && !e.processingByConversationId[t.id]);
2698
- r ? (ao(r.id), xo(r.id, b)) : oo(void 0, b, { routedBy: "auto" });
2698
+ let n = Zi(), r = e.conversations.find((t) => t.routedBy === "auto" && qi(t, n) && !e.processingByConversationId[t.id]);
2699
+ r ? (oo(r.id), So(r.id, b)) : so(void 0, b, { routedBy: "auto" });
2699
2700
  }, [
2701
+ so,
2702
+ So,
2700
2703
  oo,
2701
2704
  xo,
2702
- ao,
2703
- bo,
2704
- ro,
2705
+ io,
2705
2706
  K
2706
- ]), Qu = D((e) => {
2707
- R.find((t) => t.id === e)?.writeCapable && !Zn(w.getState().acknowledgedWriteModes, e) ? us(e) : Xu(e);
2708
- }, [Xu, R]), $u = D(() => {
2709
- let e = ls;
2710
- if (us(null), !e) return;
2711
- let t = is.current;
2712
- is.current = null, t ? (vo(e), Q(t.content, t.attachments, t.options)) : (vo(e), Xu(e));
2707
+ ]), $u = D((e) => {
2708
+ R.find((t) => t.id === e)?.writeCapable && !Qn(w.getState().acknowledgedWriteModes, e) ? ds(e) : Zu(e);
2709
+ }, [Zu, R]), ed = D(() => {
2710
+ let e = us;
2711
+ if (ds(null), !e) return;
2712
+ let t = as.current;
2713
+ as.current = null, t ? (yo(e), Q(t.content, t.attachments, t.options)) : (yo(e), Zu(e));
2713
2714
  }, [
2714
- ls,
2715
- vo,
2716
- Xu,
2715
+ us,
2716
+ yo,
2717
+ Zu,
2717
2718
  Q
2718
- ]), ed = ls === null ? void 0 : R.find((e) => e.id === ls) ?? { id: ls }, td = D(() => {
2719
- us(null);
2720
- let e = is.current;
2721
- is.current = null, e && Q(e.content, e.attachments, {
2719
+ ]), td = us === null ? void 0 : R.find((e) => e.id === us) ?? { id: us }, nd = D(() => {
2720
+ ds(null);
2721
+ let e = as.current;
2722
+ as.current = null, e && Q(e.content, e.attachments, {
2722
2723
  ...e.options,
2723
2724
  autoIntent: "read"
2724
2725
  });
2725
- }, [Q]), nd = D(() => Js(), [Js]), [rd, id] = j(null), ad = D(() => {
2726
- let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Bs.current;
2726
+ }, [Q]), rd = D(() => Ys(), [Ys]), [id, ad] = j(null), od = D(() => {
2727
+ let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Vs.current;
2727
2728
  return {
2728
2729
  state: e,
2729
2730
  conversation: t ? {
2730
2731
  mode: t.mode,
2731
- hasHistory: Ui(t),
2732
+ hasHistory: Wi(t),
2732
2733
  routedByAuto: t.routedBy === "auto"
2733
2734
  } : null,
2734
2735
  waitingCount: t ? K.liveFor(t.id).count : 0,
2735
2736
  hasDraft: n !== null && (n.text.trim() !== "" || n.hasAttachments)
2736
2737
  };
2737
- }, [K]), od = ns ? P("modeSelector.auto", "Auto") : void 0, sd = D((e) => {
2738
- if (ls !== null) return;
2739
- let { state: t, conversation: n, waitingCount: r, hasDraft: i } = ad(), a = R.find((t) => t.id === e), o = Me({
2738
+ }, [K]), sd = rs ? P("modeSelector.auto", "Auto") : void 0, cd = D((e) => {
2739
+ if (us !== null) return;
2740
+ let { state: t, conversation: n, waitingCount: r, hasDraft: i } = od(), a = R.find((t) => t.id === e), o = Ne({
2740
2741
  target: {
2741
2742
  kind: "mode",
2742
2743
  mode: e,
2743
- consentRequired: !!a?.writeCapable && !Zn(t.acknowledgedWriteModes, e)
2744
+ consentRequired: !!a?.writeCapable && !Qn(t.acknowledgedWriteModes, e)
2744
2745
  },
2745
2746
  conversation: n,
2746
2747
  waitingCount: r,
2747
2748
  hasDraft: i
2748
2749
  });
2749
- o.needsDialog ? id({
2750
+ o.needsDialog ? ad({
2750
2751
  open: !0,
2751
2752
  target: {
2752
2753
  kind: "mode",
2753
2754
  mode: e
2754
2755
  },
2755
2756
  plan: o,
2756
- targetName: Ee(P, a ?? { id: e }),
2757
- currentName: od
2758
- }) : Xu(e);
2757
+ targetName: De(P, a ?? { id: e }),
2758
+ currentName: sd
2759
+ }) : Zu(e);
2759
2760
  }, [
2761
+ sd,
2760
2762
  od,
2761
- ad,
2762
- ls,
2763
- Xu,
2763
+ us,
2764
+ Zu,
2764
2765
  R,
2765
2766
  P
2766
- ]), cd = D(() => {
2767
- if (ls !== null) return;
2768
- let { conversation: e, waitingCount: t, hasDraft: n } = ad(), r = Me({
2767
+ ]), ld = D(() => {
2768
+ if (us !== null) return;
2769
+ let { conversation: e, waitingCount: t, hasDraft: n } = od(), r = Ne({
2769
2770
  target: { kind: "auto" },
2770
2771
  conversation: e,
2771
2772
  waitingCount: t,
2772
2773
  hasDraft: n
2773
2774
  });
2774
- r.needsDialog ? id({
2775
+ r.needsDialog ? ad({
2775
2776
  open: !0,
2776
2777
  target: { kind: "auto" },
2777
2778
  plan: r,
2778
2779
  targetName: P("modeSelector.auto", "Auto")
2779
- }) : Zu();
2780
+ }) : Qu();
2780
2781
  }, [
2781
- Zu,
2782
- ad,
2783
- ls,
2782
+ Qu,
2783
+ od,
2784
+ us,
2784
2785
  P
2785
- ]), ld = D(() => {
2786
- let e = rd;
2787
- e?.open && (id({
2786
+ ]), ud = D(() => {
2787
+ let e = id;
2788
+ e?.open && (ad({
2788
2789
  ...e,
2789
2790
  open: !1
2790
- }), e.target.kind === "auto" ? Zu() : (e.plan.consent && vo(e.target.mode), Xu(e.target.mode)));
2791
+ }), e.target.kind === "auto" ? Qu() : (e.plan.consent && yo(e.target.mode), Zu(e.target.mode)));
2791
2792
  }, [
2792
- vo,
2793
- Zu,
2794
- rd,
2795
- Xu
2796
- ]), ud = D(() => {
2797
- id((e) => e && {
2793
+ yo,
2794
+ Qu,
2795
+ id,
2796
+ Zu
2797
+ ]), dd = D(() => {
2798
+ ad((e) => e && {
2798
2799
  ...e,
2799
2800
  open: !1
2800
2801
  });
2801
- }, []), dd = rd ? {
2802
- consent: rd.plan.consent,
2803
- withdrawnCount: rd.plan.withdrawnCount,
2804
- movesToNewConversation: rd.plan.movesToNewConversation,
2805
- draftKept: rd.plan.draftKept,
2806
- targetName: rd.targetName,
2807
- ...rd.currentName === void 0 ? {} : { currentName: rd.currentName }
2808
- } : void 0, fd = rd?.target.kind === "mode" ? rd.target.mode : null, pd = fd === null ? void 0 : R.find((e) => e.id === fd) ?? { id: fd }, md = A(null), hd = k(() => {
2802
+ }, []), fd = id ? {
2803
+ consent: id.plan.consent,
2804
+ withdrawnCount: id.plan.withdrawnCount,
2805
+ movesToNewConversation: id.plan.movesToNewConversation,
2806
+ draftKept: id.plan.draftKept,
2807
+ targetName: id.targetName,
2808
+ ...id.currentName === void 0 ? {} : { currentName: id.currentName }
2809
+ } : void 0, pd = id?.target.kind === "mode" ? id.target.mode : null, md = pd === null ? void 0 : R.find((e) => e.id === pd) ?? { id: pd }, hd = A(null), gd = k(() => {
2809
2810
  if (!F) return 0;
2810
- let e = new Set(al.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
2811
- return Ae(ko, H, Ao, e);
2811
+ let e = new Set(ol.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
2812
+ return je(Ao, H, jo, e);
2812
2813
  }, [
2813
2814
  F,
2814
- al,
2815
+ ol,
2815
2816
  H,
2816
- ko,
2817
- Ao
2818
- ]), gd = D(() => {
2819
- je(md.current);
2820
- }, []), _d = I && Ma && He({
2821
- empty: al.length === 0,
2822
- historyPending: Io || Lo,
2817
+ Ao,
2818
+ jo
2819
+ ]), _d = D(() => {
2820
+ Me(hd.current);
2821
+ }, []), vd = I && Na && Ue({
2822
+ empty: ol.length === 0,
2823
+ historyPending: Lo || Ro,
2823
2824
  hasOlder: G?.sync?.hasOlder === !0
2824
- }), vd = _d ? /* @__PURE__ */ M("div", {
2825
- ref: Na,
2825
+ }), yd = vd ? /* @__PURE__ */ M("div", {
2826
+ ref: Pa,
2826
2827
  className: "w-full shrink-0",
2827
2828
  "data-testid": "assistant-page-start-above"
2828
- }) : al.length === 0 && (Io || Lo) ? /* @__PURE__ */ M(_e, {
2829
- state: Io ? "loading" : "failed",
2830
- onRetry: Xo
2831
- }) : al.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
2829
+ }) : ol.length === 0 && (Lo || Ro) ? /* @__PURE__ */ M(ve, {
2830
+ state: Lo ? "loading" : "failed",
2831
+ onRetry: Zo
2832
+ }) : ol.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
2832
2833
  className: "flex min-h-0 flex-1 flex-col",
2833
- children: /* @__PURE__ */ M(ye, {
2834
- onShowEarlier: Zo,
2835
- disabled: Io
2834
+ children: /* @__PURE__ */ M(be, {
2835
+ onShowEarlier: Qo,
2836
+ disabled: Lo
2836
2837
  })
2837
- }) : al.length === 0 ? /* @__PURE__ */ M(me, {
2838
+ }) : ol.length === 0 && F && !I ? /* @__PURE__ */ M(he, {
2839
+ mode: U,
2840
+ auto: rs && U === "assistant",
2841
+ voiceOffered: $.available && Fs,
2842
+ avatarOffered: !!(q.ids && q.compact),
2843
+ onSuggestionClick: $c
2844
+ }) : ol.length === 0 ? /* @__PURE__ */ M(me, {
2838
2845
  mode: U,
2839
- onSuggestionClick: Qc,
2840
- explainsAuto: ns,
2841
- suggestions: ns && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2842
- }) : /* @__PURE__ */ ua("div", {
2846
+ onSuggestionClick: $c,
2847
+ explainsAuto: rs,
2848
+ suggestions: rs && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2849
+ }) : /* @__PURE__ */ da("div", {
2843
2850
  className: "flex min-h-0 flex-1 flex-col",
2844
- children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(ye, {
2845
- onShowEarlier: Zo,
2846
- disabled: Io
2851
+ children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(be, {
2852
+ onShowEarlier: Qo,
2853
+ disabled: Lo
2847
2854
  }) : null, /* @__PURE__ */ M(c, {
2848
- onApprovePendingWrite: Xs,
2849
- approvingWriteRef: Hs,
2850
- approvableMessageId: ll?.messageId ?? null,
2851
- retryableMessageId: ul,
2852
- messages: al,
2853
- decorate: I ? vu : void 0,
2854
- processing: wo ?? null,
2855
- streamingMessageId: Eo,
2856
- failedMessageId: Do,
2857
- onRetry: Hs === null ? el : void 0,
2858
- renderWriteProposals: fl,
2859
- hidesLegacyWriteCard: dl,
2860
- renderUiOffers: ml,
2861
- onStopTurn: F ? void 0 : nd,
2862
- stopTurnLabel: F ? void 0 : ja
2855
+ onApprovePendingWrite: Zs,
2856
+ approvingWriteRef: Us,
2857
+ approvableMessageId: ul?.messageId ?? null,
2858
+ retryableMessageId: dl,
2859
+ messages: ol,
2860
+ decorate: I ? yu : void 0,
2861
+ processing: To ?? null,
2862
+ streamingMessageId: Do,
2863
+ failedMessageId: Oo,
2864
+ onRetry: Us === null ? tl : void 0,
2865
+ renderWriteProposals: pl,
2866
+ hidesLegacyWriteCard: fl,
2867
+ renderUiOffers: hl,
2868
+ onStopTurn: F ? void 0 : rd,
2869
+ stopTurnLabel: F ? void 0 : Ma
2863
2870
  })]
2864
2871
  });
2865
- return /* @__PURE__ */ ua("div", {
2866
- ref: md,
2872
+ return /* @__PURE__ */ da("div", {
2873
+ ref: hd,
2867
2874
  className: "relative flex flex-1 flex-col overflow-hidden",
2868
- style: _d ? xa : void 0,
2875
+ style: vd ? Sa : void 0,
2869
2876
  children: [
2870
- /* @__PURE__ */ ua("div", {
2877
+ /* @__PURE__ */ da("div", {
2871
2878
  className: "contents",
2872
2879
  inert: $.active && !I || J || void 0,
2873
2880
  ...q.ids ? F ? { id: q.ids.chatPanel } : {
@@ -2876,129 +2883,129 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
2876
2883
  "aria-labelledby": q.ids.chatTab
2877
2884
  } : {},
2878
2885
  children: [
2879
- Vo === null ? Wo === null ? null : /* @__PURE__ */ M(ve, {
2880
- limit: Wo.limit,
2881
- onDismiss: () => Ji.getState().notePinLimit(void 0)
2882
- }) : /* @__PURE__ */ M(ge, { onDismiss: () => Bo(Vo) }),
2883
- _l.length > 0 && !$.active && !I ? /* @__PURE__ */ M(he, {
2884
- count: _l.length,
2885
- onOpenTranscript: () => _s(!0)
2886
+ Ho === null ? Go === null ? null : /* @__PURE__ */ M(S, {
2887
+ limit: Go.limit,
2888
+ onDismiss: () => Yi.getState().notePinLimit(void 0)
2889
+ }) : /* @__PURE__ */ M(_e, { onDismiss: () => Vo(Ho) }),
2890
+ vl.length > 0 && !$.active && !I ? /* @__PURE__ */ M(x, {
2891
+ count: vl.length,
2892
+ onOpenTranscript: () => vs(!0)
2886
2893
  }) : null,
2887
- vd,
2888
- Po ? /* @__PURE__ */ M(S, { onStartNew: () => oo() }) : null,
2889
- Fo && H ? /* @__PURE__ */ M(x, { onUnarchive: () => Hi.updateConversation(H, { archived: !1 }) }) : null,
2890
- Kc === null ? null : /* @__PURE__ */ M(xe, {
2894
+ yd,
2895
+ Fo ? /* @__PURE__ */ M(ye, { onStartNew: () => so() }) : null,
2896
+ Io && H ? /* @__PURE__ */ M(ge, { onUnarchive: () => Ui.updateConversation(H, { archived: !1 }) }) : null,
2897
+ qc === null ? null : /* @__PURE__ */ M(Se, {
2891
2898
  tr: P,
2892
- onDismiss: () => qc(null)
2899
+ onDismiss: () => Jc(null)
2893
2900
  }),
2894
- al.length > 0 && (Io || Lo) ? /* @__PURE__ */ M(_e, {
2895
- state: Io ? "loading" : "failed",
2896
- onRetry: Xo,
2901
+ ol.length > 0 && (Lo || Ro) ? /* @__PURE__ */ M(ve, {
2902
+ state: Lo ? "loading" : "failed",
2903
+ onRetry: Zo,
2897
2904
  compact: !0
2898
2905
  }) : null,
2899
- /* @__PURE__ */ M(Te, {
2900
- onStartVoiceSession: $.available && Ps ? Xl : void 0,
2906
+ /* @__PURE__ */ M(Ee, {
2907
+ onStartVoiceSession: $.available && Fs ? Zl : void 0,
2901
2908
  onSend: (e, t) => {
2902
- let n = ia.getState().actions.take();
2909
+ let n = aa.getState().actions.take();
2903
2910
  Q(e, t, {
2904
2911
  fromPerson: !0,
2905
2912
  ...n ? { focus: n } : {}
2906
2913
  });
2907
2914
  },
2908
- onDraftChange: Bc,
2909
- inputRef: F ? Ta : void 0,
2910
- viewSwitch: F && !I && q.ids && q.compact && !zu ? /* @__PURE__ */ M(ze, {
2915
+ onDraftChange: Vc,
2916
+ inputRef: F ? Ea : void 0,
2917
+ viewSwitch: F && !I && q.ids && q.compact && !Bu ? /* @__PURE__ */ M(Be, {
2911
2918
  selected: q.compact.view,
2912
2919
  onSelect: q.compact.selectView,
2913
2920
  ids: q.ids,
2914
2921
  instance: "chat"
2915
2922
  }) : void 0,
2916
- aboveCard: hd > 0 ? /* @__PURE__ */ M(Oe, {
2917
- count: hd,
2918
- onReview: Fa && ka ? Tu : gd,
2919
- opensFull: Fa && ka !== void 0
2923
+ aboveCard: gd > 0 ? /* @__PURE__ */ M(ke, {
2924
+ count: gd,
2925
+ onReview: Ia && Aa ? Eu : _d,
2926
+ opensFull: Ia && Aa !== void 0
2920
2927
  }) : void 0,
2921
- disabled: To || Hs !== null || Io || _c,
2922
- readOnly: Po,
2928
+ disabled: Eo || Us !== null || Lo || vc,
2929
+ readOnly: Fo,
2923
2930
  placeholder: U === "api-calls" ? P("chatArea.placeholderActions", "What would you like me to do?") : P("chatArea.placeholderGeneral", "Ask me anything…"),
2924
2931
  mode: U,
2925
- writeAccessDenied: Ca === "denied" && !!js?.writeCapable,
2926
- availableModes: es,
2927
- attachmentCharsPerFile: cs,
2928
- onModeChange: F ? sd : Qu,
2929
- auto: ts ? {
2930
- active: ns,
2931
- onSelect: F ? cd : Zu
2932
+ writeAccessDenied: wa === "denied" && !!Ms?.writeCapable,
2933
+ availableModes: ts,
2934
+ attachmentCharsPerFile: ls,
2935
+ onModeChange: F ? cd : $u,
2936
+ auto: ns ? {
2937
+ active: rs,
2938
+ onSelect: F ? ld : Qu
2932
2939
  } : void 0,
2933
- suspendDictation: J || F && !Sa,
2934
- entrance: I && _d,
2935
- onVoiceStateChange: q.ids || Fa ? xu : void 0,
2936
- modeReadOnly: Fa || void 0,
2940
+ suspendDictation: J || F && !Ca,
2941
+ entrance: I && vd,
2942
+ onVoiceStateChange: q.ids || Ia ? Su : void 0,
2943
+ modeReadOnly: Ia || void 0,
2937
2944
  voiceSessionActive: F ? $.active : void 0,
2938
2945
  concealed: I && $.active,
2939
- presentation: wa,
2940
- turnInFlight: To,
2941
- turnId: To ? wo?.messageId ?? null : null,
2942
- onStop: F ? nd : void 0,
2943
- modeDisabledReason: To ? "replying" : "busy"
2946
+ presentation: Ta,
2947
+ turnInFlight: Eo,
2948
+ turnId: Eo ? To?.messageId ?? null : null,
2949
+ onStop: F ? rd : void 0,
2950
+ modeDisabledReason: Eo ? "replying" : "busy"
2944
2951
  }),
2945
- I ? /* @__PURE__ */ ua(la, { children: [_d && !$.active ? /* @__PURE__ */ M("div", {
2946
- ref: Pa,
2952
+ I ? /* @__PURE__ */ da(ua, { children: [vd && !$.active ? /* @__PURE__ */ M("div", {
2953
+ ref: Fa,
2947
2954
  className: "w-full shrink-0",
2948
2955
  "data-testid": "assistant-page-start-below"
2949
2956
  }) : null, /* @__PURE__ */ M("div", {
2950
- ref: sl,
2957
+ ref: cl,
2951
2958
  className: "contents",
2952
2959
  "data-testid": "assistant-page-voice-slot"
2953
2960
  })] }) : null,
2954
- F ? /* @__PURE__ */ M(Pe, { children: /* @__PURE__ */ M(Fe, {
2961
+ F ? /* @__PURE__ */ M(Fe, { children: /* @__PURE__ */ M(Ie, {
2955
2962
  productKey: L,
2956
- enabled: !!za,
2963
+ enabled: !!Ba,
2957
2964
  testId: "assistant-ai-credit-balance"
2958
- }) }) : /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(Fe, {
2965
+ }) }) : /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(Ie, {
2959
2966
  productKey: L,
2960
- enabled: !!za,
2967
+ enabled: !!Ba,
2961
2968
  className: "px-3 pt-1 text-center",
2962
2969
  testId: "assistant-ai-credit-balance"
2963
- }), /* @__PURE__ */ M(Ne, { className: "px-3 pb-2 pt-1" })] })
2970
+ }), /* @__PURE__ */ M(Pe, { className: "px-3 pb-2 pt-1" })] })
2964
2971
  ]
2965
2972
  }),
2966
- ps && !$.active ? /* @__PURE__ */ M(we, {
2967
- turns: _l,
2968
- onClose: () => _s(!1),
2969
- onSave: vl,
2970
- onContinueInChat: $l ? eu : void 0,
2973
+ ms && !$.active ? /* @__PURE__ */ M(Te, {
2974
+ turns: vl,
2975
+ onClose: () => vs(!1),
2976
+ onSave: yl,
2977
+ onContinueInChat: eu ? tu : void 0,
2971
2978
  closeOnEscape: !0,
2972
- onShowEarlier: G?.sync?.hasOlder ? Zo : void 0,
2973
- showEarlierDisabled: Io,
2974
- renderAfterTurn: pl
2979
+ onShowEarlier: G?.sync?.hasOlder ? Qo : void 0,
2980
+ showEarlierDisabled: Lo,
2981
+ renderAfterTurn: ml
2975
2982
  }) : null,
2976
- zu && q.ids && q.compact ? /* @__PURE__ */ M(Be, {
2983
+ Bu && q.ids && q.compact ? /* @__PURE__ */ M(Ve, {
2977
2984
  ids: q.ids,
2978
2985
  compact: q.compact
2979
- }) : J && ms && q.ids ? F && q.compact && ms.CompactView ? /* @__PURE__ */ M(Re, {
2980
- tab: ms,
2981
- CompactView: ms.CompactView,
2986
+ }) : J && hs && q.ids ? F && q.compact && hs.CompactView ? /* @__PURE__ */ M(ze, {
2987
+ tab: hs,
2988
+ CompactView: hs.CompactView,
2982
2989
  ids: q.ids,
2983
2990
  compact: q.compact,
2984
- shown: Bu,
2985
- voice: Nu,
2991
+ shown: Vu,
2992
+ voice: Pu,
2986
2993
  ...$.active ? { mute: {
2987
2994
  muted: $.session.muted,
2988
2995
  toggle: $.toggleMute
2989
2996
  } } : {},
2990
- ...Vu ? { ask: qu } : {},
2991
- footer: /* @__PURE__ */ M(Pe, {})
2992
- }) : /* @__PURE__ */ M(Le, {
2993
- tab: ms,
2997
+ ...Hu ? { ask: Ju } : {},
2998
+ footer: /* @__PURE__ */ M(Fe, {})
2999
+ }) : /* @__PURE__ */ M(Re, {
3000
+ tab: hs,
2994
3001
  id: q.ids.avatarPanel,
2995
3002
  labelledBy: q.ids.avatarTab,
2996
3003
  leaveHintId: q.ids.leaveHint,
2997
- shown: Bu,
2998
- voice: Nu,
2999
- ...Vu ? { ask: qu } : {}
3004
+ shown: Vu,
3005
+ voice: Pu,
3006
+ ...Hu ? { ask: Ju } : {}
3000
3007
  }) : null,
3001
- $.active && /* @__PURE__ */ M(Ie, {
3008
+ $.active && /* @__PURE__ */ M(Le, {
3002
3009
  session: $.session,
3003
3010
  notice: $.notice,
3004
3011
  privacyNotice: $.handsFree.privacyNotice,
@@ -3010,66 +3017,66 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
3010
3017
  correcting: $.correcting,
3011
3018
  onLetMeFinish: $.letMeFinish,
3012
3019
  onImDone: $.imDone,
3013
- turns: Ol,
3020
+ turns: kl,
3014
3021
  spokenChunks: $.spokenChunks,
3015
- attachments: yl.attachments,
3016
- onAttachFiles: yl.addFiles,
3017
- onRemoveAttachment: yl.remove,
3018
- onRetryAttachment: yl.retry,
3019
- canAttachMore: yl.canAddMore,
3020
- preparingAttachments: yl.preparingCount,
3021
- attachmentsLocked: yl.isCommitting,
3022
- attachmentNotice: Cl,
3023
- onSaveTranscript: vl,
3024
- onContinueInChat: eu,
3022
+ attachments: bl.attachments,
3023
+ onAttachFiles: bl.addFiles,
3024
+ onRemoveAttachment: bl.remove,
3025
+ onRetryAttachment: bl.retry,
3026
+ canAttachMore: bl.canAddMore,
3027
+ preparingAttachments: bl.preparingCount,
3028
+ attachmentsLocked: bl.isCommitting,
3029
+ attachmentNotice: wl,
3030
+ onSaveTranscript: yl,
3031
+ onContinueInChat: tu,
3025
3032
  onInterrupt: () => {
3026
- _u(), $.interrupt(), Js();
3033
+ vu(), $.interrupt(), Ys();
3027
3034
  },
3028
- spoken: rl,
3035
+ spoken: il,
3029
3036
  onToggleMute: $.toggleMute,
3030
- onEnd: yu,
3031
- proposalChip: Il ? Fa && ka ? {
3037
+ onEnd: bu,
3038
+ proposalChip: Ll ? Ia && Aa ? {
3032
3039
  label: P("waitingChange.reviewInFull", "Review in full assistant"),
3033
- status: te(Il, P),
3034
- onOpen: ka
3040
+ status: te(Ll, P),
3041
+ onOpen: Aa
3035
3042
  } : {
3036
- label: te(Il, P),
3037
- onOpen: Fl
3043
+ label: te(Ll, P),
3044
+ onOpen: Il
3038
3045
  } : null,
3039
- proposalTray: Fa ? null : Rl,
3040
- renderAfterTurn: pl,
3041
- onViewChange: q.ids ? Fu : void 0,
3042
- ...Fa ? { view: J || Iu ? "mini" : "compact" } : I ? {
3046
+ proposalTray: Ia ? null : zl,
3047
+ renderAfterTurn: ml,
3048
+ onViewChange: q.ids ? Iu : void 0,
3049
+ ...Ia ? { view: J || Lu ? "mini" : "compact" } : I ? {
3043
3050
  view: "page",
3044
- pageSlot: ol
3051
+ pageSlot: sl
3045
3052
  } : {},
3046
- startedCue: F ? xs ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
3053
+ startedCue: F ? Ss ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
3047
3054
  }),
3048
3055
  /* @__PURE__ */ M(l, {
3049
- open: ls !== null,
3050
- mode: ed,
3051
- currentMode: js ?? { id: U },
3052
- onConfirm: $u,
3053
- onCancel: td
3056
+ open: us !== null,
3057
+ mode: td,
3058
+ currentMode: Ms ?? { id: U },
3059
+ onConfirm: ed,
3060
+ onCancel: nd
3054
3061
  }),
3055
3062
  F ? /* @__PURE__ */ M(l, {
3056
- open: rd?.open === !0,
3057
- mode: pd,
3058
- currentMode: js ?? { id: U },
3059
- switchPlan: dd,
3060
- onConfirm: ld,
3061
- onCancel: ud
3063
+ open: id?.open === !0,
3064
+ mode: md,
3065
+ currentMode: Ms ?? { id: U },
3066
+ switchPlan: fd,
3067
+ onConfirm: ud,
3068
+ onCancel: dd
3062
3069
  }) : null,
3063
3070
  /* @__PURE__ */ M(u, {
3064
- ...jo.dialog,
3065
- view: hl?.view ?? jo.dialog.view,
3066
- serverNow: hl?.serverNow ?? NaN,
3067
- arrivedAt: hl?.arrivedAt ?? NaN,
3068
- capabilities: hl ? Oo[hl.session.sandboxId] : null,
3069
- turnInFlight: To,
3071
+ ...Mo.dialog,
3072
+ view: gl?.view ?? Mo.dialog.view,
3073
+ serverNow: gl?.serverNow ?? NaN,
3074
+ arrivedAt: gl?.arrivedAt ?? NaN,
3075
+ capabilities: gl ? ko[gl.session.sandboxId] : null,
3076
+ turnInFlight: Eo,
3070
3077
  tr: P
3071
3078
  })
3072
3079
  ]
3073
3080
  });
3074
3081
  };
3075
- export { Sa as AssistantChatArea };
3082
+ export { Ca as AssistantChatArea };