@burdenoff/fe-libs 2026.1015.1 → 2026.1015.2

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