@burdenoff/fe-libs 2026.1117.7 → 2026.1118.1

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