@burdenoff/fe-libs 2026.1024.4 → 2026.1027.1

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