@burdenoff/fe-libs 2026.908.2 → 2026.909.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantSpeechProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantSpeechProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EASL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AA2B/D,OAAO,EAQL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAiB/B,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,iBAAiB,CAAC;IAChC;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;;;OAMG;IACH,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACjD;;;;OAIG;IACH,YAAY,EAAE,SAAS,eAAe,EAAE,CAAC;IACzC,8EAA8E;IAC9E;;;;;;OAMG;IACH,YAAY,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mEAAmE;IACnE,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,U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AC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,kFAAkF;IAClF,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AA4BD,wBAAgB,kBAAkB,IAAI,2BAA2B,CAEhE;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,KAAK,CAsyB7C,CAAC"}
@@ -9,12 +9,12 @@ import { resolveLanguagePair as te } from "../voice/languagePair.js";
9
9
  import { useAssistantTr as ne } from "../i18n.js";
10
10
  import { speechLabelsFor as re } from "../voice/speechLabels.js";
11
11
  import { resolveSpeechLocale as ie } from "../voice/replyLanguage.js";
12
- import { IDLE_PLAYBACK as ae, isSpeakingMessage as oe, speechPlaybackReducer as se } from "../voice/speechPlayback.js";
12
+ import { IDLE_PLAYBACK as ae, isSpeakingMessage as oe, publishedChunks as se, speechPlaybackReducer as ce } from "../voice/speechPlayback.js";
13
13
  import { useAssistantStore as p } from "../store.js";
14
- import { isTurnInFlight as ce } from "../turnState.js";
15
- import { parseToolActivity as le } from "./AssistantToolActivity.js";
14
+ import { isTurnInFlight as le } from "../turnState.js";
15
+ import { parseToolActivity as ue } from "./AssistantToolActivity.js";
16
16
  import "../speech/index.js";
17
- import { createContext as ue, useCallback as m, useContext as h, useEffect as g, useMemo as _, useReducer as de, useRef as v, useState as y } from "react";
17
+ import { createContext as m, useCallback as h, useContext as g, useEffect as _, useMemo as v, useReducer as de, useRef as y, useState as b } from "react";
18
18
  import { jsx as fe } from "react/jsx-runtime";
19
19
  //#region src/shared/assistant/ui/AssistantSpeechProvider.tsx
20
20
  var pe = {
@@ -26,7 +26,7 @@ var pe = {
26
26
  emailAt: "at",
27
27
  emailDot: "dot",
28
28
  nestedItem: ""
29
- }, me = 4e3, b = ue({
29
+ }, me = 4e3, x = m({
30
30
  isSupported: !1,
31
31
  availability: "unsupported",
32
32
  isBlocked: !0,
@@ -48,265 +48,262 @@ var pe = {
48
48
  setSessionMicOpen: () => {},
49
49
  previewVoice: () => {}
50
50
  });
51
- function x() {
52
- return h(b);
51
+ function S() {
52
+ return g(x);
53
53
  }
54
- var S = ({ children: ue, visible: h = !0, engine: x = n() }) => {
55
- let S = ne(), { locale: C } = e(), [w, T] = de(se, ae), [E, D] = y(() => x.listVoices()), [O, k] = y(!1), [A, j] = y(() => /* @__PURE__ */ new Map()), M = v(0), N = v(null);
56
- g(() => () => {
57
- N.current !== null && clearTimeout(N.current);
54
+ var C = ({ children: m, visible: g = !0, engine: S = n() }) => {
55
+ let C = ne(), { locale: w } = e(), [T, E] = de(ce, ae), [D, O] = b(() => S.listVoices()), [k, he] = b(!1), [ge, A] = b(() => /* @__PURE__ */ new Map()), j = y(0), M = y(null);
56
+ _(() => () => {
57
+ M.current !== null && clearTimeout(M.current);
58
58
  }, []);
59
- let [P, F] = y(null), I = v(null), he = v(() => {}), L = m(() => {
60
- I.current?.(), I.current = null;
61
- }, []), R = p((e) => e.autoSpeakEnabled), z = p((e) => e.setAutoSpeak), [B, ge] = y(!1), V = v(!1), H = m((e) => {
59
+ let [N, P] = b(null), F = y(null), I = y(() => {}), L = h(() => {
60
+ F.current?.(), F.current = null;
61
+ }, []), R = p((e) => e.autoSpeakEnabled), z = p((e) => e.setAutoSpeak), [B, _e] = b(!1), V = y(!1), H = h((e) => {
62
62
  V.current = e;
63
- }, []), _e = p((e) => e.activeConversationId), U = _(() => x.isSupported(), [x]);
64
- g(() => {
63
+ }, []), ve = p((e) => e.activeConversationId), U = v(() => S.isSupported(), [S]);
64
+ _(() => {
65
65
  if (!U) return;
66
66
  let e = () => {
67
- D(x.listVoices()), j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
67
+ O(S.listVoices()), A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
68
68
  };
69
- return e(), x.subscribeVoices(e);
70
- }, [x, U]);
71
- let W = p((e) => e.assistantLanguage), ve = p((e) => e.replyLanguage), G = p((e) => e.preferredVoices), ye = p((e) => e.setPreferredVoice), K = _(() => te(W, ve, C).reply, [
72
- W,
73
- ve,
74
- C
75
- ]), q = K.code, J = m((e) => f(e)?.tag ?? s(e), []), be = m((e) => f(e)?.rate ?? .9, []), Y = _(() => c(U, E, K.tag, O), [
69
+ return e(), S.subscribeVoices(e);
70
+ }, [S, U]);
71
+ let ye = p((e) => e.assistantLanguage), be = p((e) => e.replyLanguage), W = p((e) => e.preferredVoices), xe = p((e) => e.setPreferredVoice), G = v(() => te(ye, be, w).reply, [
72
+ ye,
73
+ be,
74
+ w
75
+ ]), K = G.code, q = h((e) => f(e)?.tag ?? s(e), []), Se = h((e) => f(e)?.rate ?? .9, []), J = v(() => c(U, D, G.tag, k), [
76
76
  U,
77
- E,
78
- K,
79
- O
80
- ]), xe = _(() => ({
81
- codeBlock: S("speech.codeBlock", "Code block"),
82
- image: S("speech.image", "image"),
83
- link: S("speech.link", "link"),
84
- largeTable: S("speech.largeTable", "Table with {{rows}} rows and {{columns}} columns"),
85
- truncated: S("speech.truncated", "The rest of this message is not read aloud"),
86
- nestedItem: S("speech.nestedItem", "Sub-item {{ordinal}}"),
87
- emailAt: S("speech.emailAt", "at"),
88
- emailDot: S("speech.emailDot", "dot")
89
- }), [S]), X = m(() => {
90
- L(), x.cancel(), T({ type: "stop" });
91
- }, [L, x]), Se = m((e) => {
92
- let t = x.listVoices().find((t) => t.name === e) ?? null;
93
- t && (X(), x.speak([d(q)], {
77
+ D,
78
+ G,
79
+ k
80
+ ]), Y = v(() => ({
81
+ codeBlock: C("speech.codeBlock", "Code block"),
82
+ image: C("speech.image", "image"),
83
+ link: C("speech.link", "link"),
84
+ largeTable: C("speech.largeTable", "Table with {{rows}} rows and {{columns}} columns"),
85
+ truncated: C("speech.truncated", "The rest of this message is not read aloud"),
86
+ nestedItem: C("speech.nestedItem", "Sub-item {{ordinal}}"),
87
+ emailAt: C("speech.emailAt", "at"),
88
+ emailDot: C("speech.emailDot", "dot")
89
+ }), [C]), X = h(() => {
90
+ L(), S.cancel(), E({ type: "stop" });
91
+ }, [L, S]), Ce = h((e) => {
92
+ let t = S.listVoices().find((t) => t.name === e) ?? null;
93
+ t && (X(), S.speak([d(K)], {
94
94
  voice: t,
95
- lang: J(q)
95
+ lang: q(K)
96
96
  }));
97
97
  }, [
98
- x,
99
- q,
98
+ S,
99
+ K,
100
100
  X,
101
- J
102
- ]), Z = m((e) => A.get(e) ?? null, [A]), Ce = m((e, t, n) => {
101
+ q
102
+ ]), we = h((e) => ge.get(e) ?? null, [ge]), Te = h((e, t, n) => {
103
103
  L();
104
104
  let i = !1, a = () => {}, o = (r) => {
105
105
  if (!i) {
106
- if (i = !0, I.current = null, clearTimeout(s), a(), r.length === 0) {
107
- k(!0);
106
+ if (i = !0, F.current = null, clearTimeout(s), a(), r.length === 0) {
107
+ he(!0);
108
108
  return;
109
109
  }
110
- D(r), he.current(e, t, r, n);
110
+ O(r), I.current(e, t, r, n);
111
111
  }
112
- }, s = setTimeout(() => o(x.listVoices()), r);
113
- a = x.subscribeVoices(() => o(x.listVoices())), I.current = () => {
114
- i || (i = !0, clearTimeout(s), a(), I.current = null);
112
+ }, s = setTimeout(() => o(S.listVoices()), r);
113
+ a = S.subscribeVoices(() => o(S.listVoices())), F.current = () => {
114
+ i || (i = !0, clearTimeout(s), a(), F.current = null);
115
115
  };
116
- }, [L, x]), Q = m((e, t, n, r) => {
116
+ }, [L, S]), Z = h((e, t, n, r) => {
117
117
  let s = n;
118
118
  if (s.length === 0) {
119
- let e = x.listVoices();
120
- e.length > 0 && (s = e, D(e));
119
+ let e = S.listVoices();
120
+ e.length > 0 && (s = e, O(e));
121
121
  }
122
- let l = J(r), u = o(c(!0, s, r, O));
122
+ let l = q(r), u = o(c(!0, s, r, k));
123
123
  if (u === "block") {
124
- let t = S("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: i(l, C) });
125
- j((n) => new Map(n).set(e, t));
124
+ let t = C("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: i(l, w) });
125
+ A((n) => new Map(n).set(e, t));
126
126
  return;
127
127
  }
128
128
  if (u === "wait-for-voices") {
129
- Ce(e, t, r);
129
+ Te(e, t, r);
130
130
  return;
131
131
  }
132
- j((t) => {
132
+ A((t) => {
133
133
  if (!t.has(e)) return t;
134
134
  let n = new Map(t);
135
135
  return n.delete(e), n;
136
136
  });
137
- let d = M.current + 1;
138
- M.current = d, T({
137
+ let d = j.current + 1;
138
+ j.current = d, E({
139
139
  type: "start",
140
140
  messageId: e,
141
141
  requestId: d
142
142
  });
143
143
  let f = ee(t);
144
- F({
144
+ P({
145
145
  requestId: d,
146
146
  chunks: f,
147
147
  index: -1
148
- }), N.current !== null && clearTimeout(N.current), N.current = setTimeout(() => {
149
- F((e) => e?.requestId === d && e.index < 0 ? null : e);
150
- }, me), x.speak(f, {
151
- voice: a(s, l, G[r]),
148
+ }), M.current !== null && clearTimeout(M.current), M.current = setTimeout(() => {
149
+ P((e) => e?.requestId === d && e.index < 0 ? null : e);
150
+ }, me), S.speak(f, {
151
+ voice: a(s, l, W[r]),
152
152
  lang: l,
153
- rate: be(r)
153
+ rate: Se(r)
154
154
  }, {
155
155
  onChunkStart: (e) => {
156
- M.current === d && N.current !== null && (clearTimeout(N.current), N.current = null), F((t) => t?.requestId === d ? {
156
+ j.current === d && M.current !== null && (clearTimeout(M.current), M.current = null), P((t) => t?.requestId === d ? {
157
157
  ...t,
158
158
  index: e
159
- } : M.current === d ? {
159
+ } : j.current === d ? {
160
160
  requestId: d,
161
161
  chunks: f,
162
162
  index: e
163
163
  } : t);
164
164
  },
165
- onEnd: () => T({
165
+ onEnd: () => E({
166
166
  type: "finished",
167
167
  requestId: d
168
168
  }),
169
- onError: () => T({
169
+ onError: () => E({
170
170
  type: "failed",
171
171
  requestId: d
172
172
  })
173
173
  });
174
174
  }, [
175
- x,
176
- C,
177
- G,
178
- be,
179
- J,
180
175
  S,
181
- O,
182
- Ce
176
+ w,
177
+ W,
178
+ Se,
179
+ q,
180
+ C,
181
+ k,
182
+ Te
183
183
  ]);
184
- g(() => {
185
- he.current = Q;
186
- }, [Q]);
187
- let $ = m((e, t, n) => {
184
+ _(() => {
185
+ I.current = Z;
186
+ }, [Z]);
187
+ let Q = h((e, t, n) => {
188
188
  if (!U) return;
189
- let r = ie(u(t, { labels: pe }), n ?? q), i = u(t, { labels: re(r, xe) });
190
- i && Q(e, i, E, r);
189
+ let r = ie(u(t, { labels: pe }), n ?? K), i = u(t, { labels: re(r, Y) });
190
+ i && Z(e, i, D, r);
191
191
  }, [
192
192
  U,
193
- xe,
194
- q,
195
- Q,
196
- E
197
- ]), we = m((e, t, n) => {
198
- if (oe(w, e)) {
193
+ Y,
194
+ K,
195
+ Z,
196
+ D
197
+ ]), Ee = h((e, t, n) => {
198
+ if (oe(T, e)) {
199
199
  X();
200
200
  return;
201
201
  }
202
- $(e, t, n);
202
+ Q(e, t, n);
203
203
  }, [
204
- w,
205
- $,
204
+ T,
205
+ Q,
206
206
  X
207
207
  ]);
208
- g(() => {
209
- h || X();
210
- }, [h, X]), g(() => {
211
- X(), j(/* @__PURE__ */ new Map());
212
- }, [_e, X]), g(() => {
213
- j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), X();
214
- }, [q, X]), g(() => () => {
215
- I.current?.(), I.current = null, x.cancel();
216
- }, [x]), g(() => {
208
+ _(() => {
209
+ g || X();
210
+ }, [g, X]), _(() => {
211
+ X(), A(/* @__PURE__ */ new Map());
212
+ }, [ve, X]), _(() => {
213
+ A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), X();
214
+ }, [K, X]), _(() => () => {
215
+ F.current?.(), F.current = null, S.cancel();
216
+ }, [S]), _(() => {
217
217
  if (typeof window > "u") return;
218
- let e = () => x.cancel();
218
+ let e = () => S.cancel();
219
219
  return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
220
- }, [x]), g(() => {
220
+ }, [S]), _(() => {
221
221
  if (typeof document > "u" || !U) return;
222
222
  let e = () => {
223
223
  if (document.visibilityState !== "visible") return;
224
- let e = x.listVoices();
225
- e.length > 0 && L(), D(e), k(!1), j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
224
+ let e = S.listVoices();
225
+ e.length > 0 && L(), O(e), he(!1), A((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
226
226
  };
227
227
  return document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), () => {
228
228
  document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e);
229
229
  };
230
230
  }, [
231
231
  L,
232
- x,
232
+ S,
233
233
  U
234
234
  ]);
235
- let Te = v($);
236
- g(() => {
237
- Te.current = $;
238
- }, [$]), g(() => {
239
- if (!(!R && !B || !h || !U)) return p.subscribe((e, n) => {
235
+ let De = y(Q);
236
+ _(() => {
237
+ De.current = Q;
238
+ }, [Q]), _(() => {
239
+ if (!(!R && !B || !g || !U)) return p.subscribe((e, n) => {
240
240
  let r = e.activeConversationId;
241
241
  if (!r || r !== n.activeConversationId) return;
242
242
  let i = e.processingByConversationId[r], a = n.processingByConversationId[r];
243
- if (i?.status !== "complete" || !ce(a?.status)) return;
243
+ if (i?.status !== "complete" || !le(a?.status)) return;
244
244
  let o = i.messageId ?? a?.messageId ?? null;
245
245
  if (!o) return;
246
246
  let s = e.conversations.find((e) => e.id === r)?.messages.find((e) => e.id === o);
247
247
  if (!s || s.role !== "assistant" || t(s) !== B || V.current) return;
248
- let { text: c } = le(s.content);
249
- c.trim() && Te.current(o, c, s.metadata?.lang);
248
+ let { text: c } = ue(s.content);
249
+ c.trim() && De.current(o, c, s.metadata?.lang);
250
250
  });
251
251
  }, [
252
252
  R,
253
253
  B,
254
254
  U,
255
- h
255
+ g
256
256
  ]);
257
- let Ee = _(() => l(E, K.tag), [E, K]), De = _(() => a(E, K.tag, G[q]), [
258
- E,
259
- K,
257
+ let Oe = v(() => l(D, G.tag), [D, G]), $ = v(() => a(D, G.tag, W[K]), [
258
+ D,
260
259
  G,
261
- q
262
- ]), Oe = _(() => ({
260
+ W,
261
+ K
262
+ ]), ke = v(() => ({
263
263
  isSupported: U,
264
- availability: Y,
265
- isBlocked: Y === "no-voices",
266
- disabledReason: Y === "no-voices" ? S("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
267
- blockedFor: Z,
268
- voiceChoices: Ee,
269
- spokenChunks: P ? {
270
- chunks: P.chunks,
271
- index: P.index
272
- } : null,
273
- activeVoiceName: De?.name ?? null,
274
- preferredVoiceName: G[q] ?? null,
275
- setVoice: (e) => ye(q, e),
276
- speakingMessageId: w.status === "speaking" ? w.messageId : null,
277
- isSpeaking: (e) => oe(w, e),
278
- toggle: we,
264
+ availability: J,
265
+ isBlocked: J === "no-voices",
266
+ disabledReason: J === "no-voices" ? C("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
267
+ blockedFor: we,
268
+ voiceChoices: Oe,
269
+ spokenChunks: se(T, N),
270
+ activeVoiceName: $?.name ?? null,
271
+ preferredVoiceName: W[K] ?? null,
272
+ setVoice: (e) => xe(K, e),
273
+ speakingMessageId: T.status === "speaking" ? T.messageId : null,
274
+ isSpeaking: (e) => oe(T, e),
275
+ toggle: Ee,
279
276
  stop: X,
280
277
  autoSpeakEnabled: R,
281
278
  setAutoSpeak: z,
282
279
  sessionSpeaking: B,
283
- setSessionSpeaking: ge,
280
+ setSessionSpeaking: _e,
284
281
  setSessionMicOpen: H,
285
- previewVoice: Se
282
+ previewVoice: Ce
286
283
  }), [
287
284
  U,
288
- Y,
289
- Z,
290
- Ee,
291
- De,
292
- G,
293
- ye,
294
- q,
295
- w,
285
+ J,
296
286
  we,
287
+ Oe,
288
+ $,
289
+ W,
290
+ xe,
291
+ K,
292
+ T,
293
+ Ee,
297
294
  X,
298
295
  R,
299
296
  z,
300
297
  B,
301
298
  H,
302
- Se,
303
- S,
304
- P
299
+ Ce,
300
+ C,
301
+ N
305
302
  ]);
306
- return /* @__PURE__ */ fe(b.Provider, {
307
- value: Oe,
308
- children: ue
303
+ return /* @__PURE__ */ fe(x.Provider, {
304
+ value: ke,
305
+ children: m
309
306
  });
310
307
  };
311
308
  //#endregion
312
- export { S as AssistantSpeechProvider, x as useAssistantSpeech };
309
+ export { C as AssistantSpeechProvider, S as useAssistantSpeech };
@@ -13,7 +13,7 @@ import { VoiceSessionSnapshot } from '../../voice/voiceSession';
13
13
  * - listening -> mute (Mic)
14
14
  * - muted -> unmute (MicOff)
15
15
  * - speaking -> interrupt (Square — the stop glyph, not a microphone)
16
- * - thinking -> nothing (disabled; there is nothing to stop or mute yet)
16
+ * - thinking -> interrupt (Square stop the answer being generated)
17
17
  *
18
18
  * Interruption living here is deliberate: it is the biggest target on screen,
19
19
  * and it replaced barge-in when the microphone had to be closed during playback
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantVoiceOrb.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CA8EvC,CAAC"}
1
+ {"version":3,"file":"AssistantVoiceOrb.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAkGvC,CAAC"}
@@ -3,14 +3,14 @@ import { Mic as t, MicOff as n, Square as r } from "lucide-react";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  //#region src/shared/assistant/ui/voice/AssistantVoiceOrb.tsx
5
5
  var a = ({ session: a, compact: o = !1, onPress: s, label: c, connecting: l = !1 }) => {
6
- let u = e(a), { muted: d, phase: f, error: p } = a, m = f === "thinking" || f === "idle" || f === "ended" || p !== null || l, h = d && f !== "speaking" ? "from-bg-elevated to-bg-elevated" : u === "listening" ? "from-action-primary-bg/80 to-action-primary-bg/20" : u === "thinking" ? "from-text-muted/60 to-text-muted/10" : u === "speaking" ? "from-action-primary-bg to-action-primary-bg/40" : "from-bg-elevated to-bg-elevated/40", g = d && f !== "speaking" ? "" : u === "listening" ? "motion-safe:animate-pulse" : u === "thinking" ? "motion-safe:animate-[pulse_1.6s_ease-in-out_infinite]" : u === "speaking" ? "motion-safe:animate-[pulse_0.9s_ease-in-out_infinite]" : "", _ = o ? "h-16 w-40" : "h-24 w-56", v = o ? "size-6" : "size-8", y = f === "speaking" ? r : d ? n : t;
6
+ let u = e(a), { muted: d, phase: f, error: p } = a, m = f === "idle" || f === "ended" || p !== null || l, h = d && f !== "speaking" ? "from-bg-elevated to-bg-elevated" : u === "listening" ? "from-action-primary-bg/80 to-action-primary-bg/20" : u === "thinking" ? "from-action-primary-bg/55 to-action-primary-bg/15" : u === "speaking" ? "from-action-primary-bg to-action-primary-bg/40" : "from-bg-elevated to-bg-elevated/40", g = d && f !== "speaking" ? "" : u === "listening" ? "motion-safe:animate-pulse" : u === "thinking" ? "motion-safe:animate-[pulse_1.6s_ease-in-out_infinite]" : u === "speaking" ? "motion-safe:animate-[pulse_0.9s_ease-in-out_infinite]" : "", _ = o ? "h-16 w-40" : "h-24 w-56", v = o ? "size-6" : "size-8", y = f === "speaking" || f === "thinking" ? r : d ? n : t;
7
7
  return /* @__PURE__ */ i("button", {
8
8
  type: "button",
9
9
  onClick: s,
10
10
  disabled: m || !s,
11
11
  className: `flex ${_} items-center justify-center rounded-full bg-gradient-to-b ${h} ${g} text-text-primary shadow-lg transition-colors duration-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-default`,
12
12
  "aria-label": c,
13
- "aria-pressed": f === "speaking" ? void 0 : d,
13
+ "aria-pressed": f === "speaking" || f === "thinking" ? void 0 : d,
14
14
  "data-testid": "assistant-voice-orb",
15
15
  "data-state": u,
16
16
  "data-muted": d || void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantVoiceSession.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceSession.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAO7D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,gFAAgF;AAChF,MAAM,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