@vanira/sdk 0.0.87 → 0.0.90

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,6 +1,6 @@
1
1
  var q = Object.defineProperty;
2
- var X = (i, e, t) => e in i ? q(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var l = (i, e, t) => X(i, typeof e != "symbol" ? e + "" : e, t);
2
+ var X = (n, e, t) => e in n ? q(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var d = (n, e, t) => X(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  class Z {
5
5
  pause() {
6
6
  }
@@ -34,22 +34,22 @@ class ee {
34
34
  }
35
35
  class te {
36
36
  bind(e, t) {
37
- return e.onopen = () => t.onOpen(), e.onerror = (n) => t.onError(n), e.onmessage = (n) => {
38
- if (typeof n.data == "string") {
39
- t.onMessage({ text: n.data });
37
+ return e.onopen = () => t.onOpen(), e.onerror = (i) => t.onError(i), e.onmessage = (i) => {
38
+ if (typeof i.data == "string") {
39
+ t.onMessage({ text: i.data });
40
40
  return;
41
41
  }
42
- if (n.data instanceof ArrayBuffer) {
42
+ if (i.data instanceof ArrayBuffer) {
43
43
  try {
44
- const a = new TextDecoder().decode(n.data), r = JSON.parse(a);
44
+ const a = new TextDecoder().decode(i.data), r = JSON.parse(a);
45
45
  (r == null ? void 0 : r.event) === "client_tool_call" && t.onMessage({ text: a });
46
46
  } catch {
47
47
  }
48
48
  return;
49
49
  }
50
50
  }, {
51
- send(n) {
52
- e.readyState === "open" && e.send(n);
51
+ send(i) {
52
+ e.readyState === "open" && e.send(i);
53
53
  },
54
54
  isOpen() {
55
55
  return e.readyState === "open";
@@ -60,7 +60,7 @@ class te {
60
60
  };
61
61
  }
62
62
  }
63
- const ne = "https://api.vanira.io", c = {
63
+ const ie = "https://api.vanira.io", o = {
64
64
  Form: "vanira_form",
65
65
  Calendar: "vanira_calendar",
66
66
  Navigate: "vanira_navigate",
@@ -87,143 +87,152 @@ const ne = "https://api.vanira.io", c = {
87
87
  KycDocumentCapture: "vanira_kyc_document_capture",
88
88
  KycSelfieCapture: "vanira_kyc_selfie_capture",
89
89
  KycSignatureCapture: "vanira_kyc_signature_capture"
90
- }, ie = Object.values(c), ae = new Set(ie);
91
- function K(i) {
92
- return !!i && ae.has(i);
90
+ }, ne = Object.values(o), ae = new Set(ne), re = /* @__PURE__ */ new Set([
91
+ o.KycDocumentCapture,
92
+ o.KycSelfieCapture,
93
+ o.KycSignatureCapture
94
+ ]);
95
+ [
96
+ ...re,
97
+ o.Form,
98
+ o.Upload
99
+ ];
100
+ function B(n) {
101
+ return !!n && ae.has(n);
93
102
  }
94
- function J(i) {
95
- if (typeof i == "string")
103
+ function J(n) {
104
+ if (typeof n == "string")
96
105
  try {
97
- return JSON.parse(i);
106
+ return JSON.parse(n);
98
107
  } catch {
99
108
  return {};
100
109
  }
101
- return i && typeof i == "object" ? i : {};
110
+ return n && typeof n == "object" ? n : {};
102
111
  }
103
112
  const $ = {
104
- type_on_whiteboard: c.TypeText,
105
- write_on_whiteboard: c.TypeText,
106
- write_on_white_board: c.TypeText,
107
- dom_typing_simulation: c.TypeText,
108
- write_latex_text: c.WriteLatexText,
109
- write_latex_on_board: c.WriteLatexText,
110
- latex_on_whiteboard: c.WriteLatexText,
111
- show_geogebra: c.GeoGebra,
112
- geogebra_diagram: c.GeoGebra,
113
- geogebra: c.GeoGebra,
114
- erase_text: c.EraseText,
115
- dom_erase: c.EraseText,
116
- open_live_camera: c.LiveVision,
117
- live_vision: c.LiveVision,
118
- close_live_camera: c.CloseLiveCamera,
119
- stop_live_camera: c.CloseLiveCamera,
120
- open_live_screen: c.LiveScreen,
121
- close_live_screen: c.CloseLiveScreen,
122
- screen_vision: c.ScreenVision,
123
- capture_screen_vision: c.ScreenVision,
124
- capture_screen: c.ScreenVision,
125
- tab_screenshot: c.ScreenVision,
126
- capture_tab: c.ScreenVision,
127
- capture_tab_screenshot: c.ScreenVision,
128
- screenshot_tab: c.ScreenVision,
129
- point_at: c.PointAt,
130
- point_at_screen: c.PointAt,
131
- draw_on_screen: c.DrawOnScreen,
132
- screen_draw: c.DrawOnScreen,
133
- clear_screen_draw: c.ClearScreenDraw,
134
- clear_screen_annotations: c.ClearScreenDraw,
135
- highlight_on_screen: c.HighlightOnScreen,
136
- highlight_element_on_screen: c.HighlightOnScreen,
137
- highlight_screen_element: c.HighlightOnScreen,
138
- kyc_document_capture: c.KycDocumentCapture,
139
- capture_id_document: c.KycDocumentCapture,
140
- document_capture: c.KycDocumentCapture,
141
- capture_kyc_document: c.KycDocumentCapture,
142
- kyc_selfie_capture: c.KycSelfieCapture,
143
- capture_selfie: c.KycSelfieCapture,
144
- selfie_capture: c.KycSelfieCapture,
145
- capture_kyc_selfie: c.KycSelfieCapture,
146
- kyc_signature_capture: c.KycSignatureCapture,
147
- capture_kyc_signature: c.KycSignatureCapture,
148
- signature_capture: c.KycSignatureCapture
113
+ type_on_whiteboard: o.TypeText,
114
+ write_on_whiteboard: o.TypeText,
115
+ write_on_white_board: o.TypeText,
116
+ dom_typing_simulation: o.TypeText,
117
+ write_latex_text: o.WriteLatexText,
118
+ write_latex_on_board: o.WriteLatexText,
119
+ latex_on_whiteboard: o.WriteLatexText,
120
+ show_geogebra: o.GeoGebra,
121
+ geogebra_diagram: o.GeoGebra,
122
+ geogebra: o.GeoGebra,
123
+ erase_text: o.EraseText,
124
+ dom_erase: o.EraseText,
125
+ open_live_camera: o.LiveVision,
126
+ live_vision: o.LiveVision,
127
+ close_live_camera: o.CloseLiveCamera,
128
+ stop_live_camera: o.CloseLiveCamera,
129
+ open_live_screen: o.LiveScreen,
130
+ close_live_screen: o.CloseLiveScreen,
131
+ screen_vision: o.ScreenVision,
132
+ capture_screen_vision: o.ScreenVision,
133
+ capture_screen: o.ScreenVision,
134
+ tab_screenshot: o.ScreenVision,
135
+ capture_tab: o.ScreenVision,
136
+ capture_tab_screenshot: o.ScreenVision,
137
+ screenshot_tab: o.ScreenVision,
138
+ point_at: o.PointAt,
139
+ point_at_screen: o.PointAt,
140
+ draw_on_screen: o.DrawOnScreen,
141
+ screen_draw: o.DrawOnScreen,
142
+ clear_screen_draw: o.ClearScreenDraw,
143
+ clear_screen_annotations: o.ClearScreenDraw,
144
+ highlight_on_screen: o.HighlightOnScreen,
145
+ highlight_element_on_screen: o.HighlightOnScreen,
146
+ highlight_screen_element: o.HighlightOnScreen,
147
+ kyc_document_capture: o.KycDocumentCapture,
148
+ capture_id_document: o.KycDocumentCapture,
149
+ document_capture: o.KycDocumentCapture,
150
+ capture_kyc_document: o.KycDocumentCapture,
151
+ kyc_selfie_capture: o.KycSelfieCapture,
152
+ capture_selfie: o.KycSelfieCapture,
153
+ selfie_capture: o.KycSelfieCapture,
154
+ capture_kyc_selfie: o.KycSelfieCapture,
155
+ kyc_signature_capture: o.KycSignatureCapture,
156
+ capture_kyc_signature: o.KycSignatureCapture,
157
+ signature_capture: o.KycSignatureCapture
149
158
  }, j = {
150
- vanira_tab_screenshot: c.ScreenVision,
151
- vanira_document_capture: c.KycDocumentCapture,
152
- vanira_selfie_capture: c.KycSelfieCapture,
153
- vanira_signature_capture: c.KycSignatureCapture,
154
- vanira_kyc_signature: c.KycSignatureCapture
159
+ vanira_tab_screenshot: o.ScreenVision,
160
+ vanira_document_capture: o.KycDocumentCapture,
161
+ vanira_selfie_capture: o.KycSelfieCapture,
162
+ vanira_signature_capture: o.KycSignatureCapture,
163
+ vanira_kyc_signature: o.KycSignatureCapture
155
164
  };
156
- function re(i, e) {
157
- const t = i.commands ?? (e == null ? void 0 : e.commands) ?? i.construction ?? (e == null ? void 0 : e.construction) ?? i.geogebra_commands ?? (e == null ? void 0 : e.geogebra_commands) ?? i.script ?? (e == null ? void 0 : e.script);
158
- return Array.isArray(t) ? t.some((n) => String(n).trim().length > 0) : typeof t == "string" && t.trim().length > 0;
165
+ function se(n, e) {
166
+ const t = n.commands ?? (e == null ? void 0 : e.commands) ?? n.construction ?? (e == null ? void 0 : e.construction) ?? n.geogebra_commands ?? (e == null ? void 0 : e.geogebra_commands) ?? n.script ?? (e == null ? void 0 : e.script);
167
+ return Array.isArray(t) ? t.some((i) => String(i).trim().length > 0) : typeof t == "string" && t.trim().length > 0;
159
168
  }
160
- function se(i, e) {
161
- const t = i.material_id ?? (e == null ? void 0 : e.material_id) ?? i.materialId ?? (e == null ? void 0 : e.materialId);
169
+ function oe(n, e) {
170
+ const t = n.material_id ?? (e == null ? void 0 : e.material_id) ?? n.materialId ?? (e == null ? void 0 : e.materialId);
162
171
  return typeof t == "string" && t.trim().length > 0;
163
172
  }
164
- function oe(i, e) {
165
- const t = i.latex_text ?? (e == null ? void 0 : e.latex_text);
173
+ function ce(n, e) {
174
+ const t = n.latex_text ?? (e == null ? void 0 : e.latex_text);
166
175
  return typeof t == "string" && t.trim().length > 0;
167
176
  }
168
- function G(i, e) {
169
- const t = i.text_to_type ?? (e == null ? void 0 : e.text_to_type) ?? i.text ?? (e == null ? void 0 : e.text) ?? i.value ?? (e == null ? void 0 : e.value);
177
+ function G(n, e) {
178
+ const t = n.text_to_type ?? (e == null ? void 0 : e.text_to_type) ?? n.text ?? (e == null ? void 0 : e.text) ?? n.value ?? (e == null ? void 0 : e.value);
170
179
  return typeof t == "string" && t.trim().length > 0;
171
180
  }
172
- function ce(i, e) {
173
- const t = i.fields ?? (e == null ? void 0 : e.fields);
174
- return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.split(",").map((n) => n.trim()).filter(Boolean).length > 0 : !1;
181
+ function le(n, e) {
182
+ const t = n.fields ?? (e == null ? void 0 : e.fields);
183
+ return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.split(",").map((i) => i.trim()).filter(Boolean).length > 0 : !1;
175
184
  }
176
- function le(i, e) {
177
- const t = i == null ? void 0 : i.preset_id;
185
+ function de(n, e) {
186
+ const t = n == null ? void 0 : n.preset_id;
178
187
  if (typeof t == "string") {
179
- if (K(t)) return t;
188
+ if (B(t)) return t;
180
189
  const r = j[t];
181
190
  if (r) return r;
182
191
  }
183
192
  const a = J(e).preset_id;
184
193
  if (typeof a == "string") {
185
- if (K(a)) return a;
194
+ if (B(a)) return a;
186
195
  const r = j[a];
187
196
  if (r) return r;
188
197
  }
189
198
  }
190
- function de(i, e, t) {
191
- const n = J(e);
192
- let a = le(i, n);
193
- if (a === c.Form && G(n, i) && !ce(n, i))
194
- return c.TypeText;
199
+ function he(n, e, t) {
200
+ const i = J(e);
201
+ let a = de(n, i);
202
+ if (a === o.Form && G(i, n) && !le(i, n))
203
+ return o.TypeText;
195
204
  if (a) return a;
196
205
  const r = String(t ?? "").trim().toLowerCase();
197
206
  if (r && $[r])
198
207
  return $[r];
199
- if (re(n, i) || se(n, i))
200
- return c.GeoGebra;
201
- if (oe(n, i))
202
- return c.WriteLatexText;
203
- if (G(n, i))
204
- return c.TypeText;
208
+ if (se(i, n) || oe(i, n))
209
+ return o.GeoGebra;
210
+ if (ce(i, n))
211
+ return o.WriteLatexText;
212
+ if (G(i, n))
213
+ return o.TypeText;
205
214
  }
206
- const I = "vanira_latest_call_id", k = "vanira_prospect_id";
207
- function T(i) {
208
- return `vanira_latest_call_id_${i}`;
215
+ const T = "vanira_latest_call_id", k = "vanira_prospect_id";
216
+ function I(n) {
217
+ return `vanira_latest_call_id_${n}`;
209
218
  }
210
- function b(i) {
211
- return `vanira_prospect_id_${i}`;
219
+ function b(n) {
220
+ return `vanira_prospect_id_${n}`;
212
221
  }
213
- function z(i) {
214
- return `vanira_call_meta_${i}`;
222
+ function z(n) {
223
+ return `vanira_call_meta_${n}`;
215
224
  }
216
- function S(i, e) {
217
- if (!i) return null;
225
+ function S(n, e) {
226
+ if (!n) return null;
218
227
  try {
219
- return i.getItem(e);
228
+ return n.getItem(e);
220
229
  } catch {
221
230
  return null;
222
231
  }
223
232
  }
224
- function W(i) {
225
- if (typeof window > "u" || !i) return null;
226
- const e = [], t = S(window.localStorage, z(i));
233
+ function W(n) {
234
+ if (typeof window > "u" || !n) return null;
235
+ const e = [], t = S(window.localStorage, z(n));
227
236
  if (t)
228
237
  try {
229
238
  const h = JSON.parse(t);
@@ -234,136 +243,136 @@ function W(i) {
234
243
  });
235
244
  } catch {
236
245
  }
237
- const n = (h, s, u) => {
246
+ const i = (h, _, s) => {
238
247
  h && e.push({
239
248
  callId: h,
240
- prospectId: s || void 0,
241
- updatedAt: u
249
+ prospectId: _ || void 0,
250
+ updatedAt: s
242
251
  });
243
- }, a = S(window.localStorage, b(i)), r = S(window.sessionStorage, b(i)), o = S(window.localStorage, k);
244
- return n(
245
- S(window.localStorage, T(i)),
246
- a || o,
252
+ }, a = S(window.localStorage, b(n)), r = S(window.sessionStorage, b(n)), c = S(window.localStorage, k);
253
+ return i(
254
+ S(window.localStorage, I(n)),
255
+ a || c,
247
256
  2
248
- ), n(
249
- S(window.sessionStorage, T(i)),
250
- r || o,
257
+ ), i(
258
+ S(window.sessionStorage, I(n)),
259
+ r || c,
251
260
  1
252
- ), n(S(window.localStorage, I), o, 0), n(S(window.sessionStorage, I), o, 0), e.length ? (e.sort((h, s) => s.updatedAt - h.updatedAt), e[0]) : null;
261
+ ), i(S(window.localStorage, T), c, 0), i(S(window.sessionStorage, T), c, 0), e.length ? (e.sort((h, _) => _.updatedAt - h.updatedAt), e[0]) : null;
253
262
  }
254
- function he(i, e, t) {
255
- var a, r, o, h, s, u, p, d, _;
256
- if (typeof window > "u" || !i || !e) return;
257
- const n = {
263
+ function ue(n, e, t) {
264
+ var a, r, c, h, _, s, u, l, p;
265
+ if (typeof window > "u" || !n || !e) return;
266
+ const i = {
258
267
  callId: e,
259
268
  prospectId: t,
260
269
  updatedAt: Date.now()
261
270
  };
262
271
  try {
263
- (a = window.localStorage) == null || a.setItem(z(i), JSON.stringify(n)), (r = window.localStorage) == null || r.setItem(T(i), e), (o = window.sessionStorage) == null || o.setItem(T(i), e), t && ((h = window.localStorage) == null || h.setItem(b(i), t), (s = window.sessionStorage) == null || s.setItem(b(i), t)), (u = window.localStorage) == null || u.setItem(I, e), (p = window.sessionStorage) == null || p.setItem(I, e), t && ((d = window.localStorage) == null || d.setItem(k, t), (_ = window.sessionStorage) == null || _.setItem(k, t));
272
+ (a = window.localStorage) == null || a.setItem(z(n), JSON.stringify(i)), (r = window.localStorage) == null || r.setItem(I(n), e), (c = window.sessionStorage) == null || c.setItem(I(n), e), t && ((h = window.localStorage) == null || h.setItem(b(n), t), (_ = window.sessionStorage) == null || _.setItem(b(n), t)), (s = window.localStorage) == null || s.setItem(T, e), (u = window.sessionStorage) == null || u.setItem(T, e), t && ((l = window.localStorage) == null || l.setItem(k, t), (p = window.sessionStorage) == null || p.setItem(k, t));
264
273
  } catch {
265
274
  }
266
275
  }
267
- const ue = /* @__PURE__ */ new Set([
276
+ const pe = /* @__PURE__ */ new Set([
268
277
  "client_tool_call",
269
278
  "clearAudio",
270
279
  "client_tool_cancel"
271
280
  ]);
272
- function pe(i) {
273
- if (!i || typeof i != "object") return !1;
274
- const e = i.event;
275
- return typeof e == "string" && ue.has(e);
281
+ function _e(n) {
282
+ if (!n || typeof n != "object") return !1;
283
+ const e = n.event;
284
+ return typeof e == "string" && pe.has(e);
276
285
  }
277
- const x = 16 * 1024, _e = 256 * 1024;
278
- function E(i, e) {
279
- return (i == null ? void 0 : i.readyState) === "open" && (e == null ? void 0 : e.readyState) === "open";
286
+ const x = 16 * 1024, me = 256 * 1024;
287
+ function E(n, e) {
288
+ return (n == null ? void 0 : n.readyState) === "open" && (e == null ? void 0 : e.readyState) === "open";
280
289
  }
281
- function me(i, e) {
290
+ function fe(n, e) {
282
291
  return {
283
- control: (i == null ? void 0 : i.readyState) ?? "missing",
292
+ control: (n == null ? void 0 : n.readyState) ?? "missing",
284
293
  mediaBytes: (e == null ? void 0 : e.readyState) ?? "missing"
285
294
  };
286
295
  }
287
- async function fe(i, e, t = 8e3) {
288
- if (E(i, e))
296
+ async function ye(n, e, t = 8e3) {
297
+ if (E(n, e))
289
298
  return !0;
290
- const n = Date.now() + t;
291
- for (; Date.now() < n; ) {
292
- if (E(i, e))
299
+ const i = Date.now() + t;
300
+ for (; Date.now() < i; ) {
301
+ if (E(n, e))
293
302
  return !0;
294
303
  await new Promise((a) => setTimeout(a, 50));
295
304
  }
296
- return E(i, e);
305
+ return E(n, e);
297
306
  }
298
- async function H(i) {
299
- for (; i.bufferedAmount > _e; )
307
+ async function H(n) {
308
+ for (; n.bufferedAmount > me; )
300
309
  await new Promise((e) => setTimeout(e, 10));
301
310
  }
302
- async function ye(i) {
311
+ async function Se(n) {
303
312
  const {
304
313
  bytes: e,
305
314
  filename: t,
306
- contentType: n,
315
+ contentType: i,
307
316
  reason: a,
308
317
  message: r,
309
- callId: o,
318
+ callId: c,
310
319
  mediaBytesChannel: h,
311
- sendControlEvent: s,
312
- uploadId: u = crypto.randomUUID(),
313
- uploadKind: p = "media"
314
- } = i, d = e.byteLength, _ = d === 0 ? 0 : Math.ceil(d / x);
315
- s("client_media_upload_start", {
320
+ sendControlEvent: _,
321
+ uploadId: s = crypto.randomUUID(),
322
+ uploadKind: u = "media"
323
+ } = n, l = e.byteLength, p = l === 0 ? 0 : Math.ceil(l / x);
324
+ _("client_media_upload_start", {
316
325
  data: {
317
- upload_id: u,
318
- call_id: o,
326
+ upload_id: s,
327
+ call_id: c,
319
328
  reason: a,
320
329
  message: r,
321
330
  filename: t,
322
- content_type: n,
323
- size: d,
324
- chunk_count: _,
325
- upload_kind: p
331
+ content_type: i,
332
+ size: l,
333
+ chunk_count: p,
334
+ upload_kind: u
326
335
  }
327
336
  });
328
337
  const m = new Uint8Array(e);
329
- for (let f = 0; f < d; f += x) {
338
+ for (let f = 0; f < l; f += x) {
330
339
  await H(h);
331
- const w = Math.min(f + x, d);
340
+ const w = Math.min(f + x, l);
332
341
  h.send(m.subarray(f, w));
333
342
  }
334
- return await H(h), s("client_media_upload_complete", {
343
+ return await H(h), _("client_media_upload_complete", {
335
344
  data: {
336
- upload_id: u,
337
- call_id: o,
345
+ upload_id: s,
346
+ call_id: c,
338
347
  reason: a,
339
348
  message: r,
340
- chunk_count: _,
341
- upload_kind: p
349
+ chunk_count: p,
350
+ upload_kind: u
342
351
  }
343
- }), { media_id: u, url: "", content_type: n };
352
+ }), { media_id: s, url: "", content_type: i };
344
353
  }
345
- async function Se(i) {
346
- return typeof i.arrayBuffer == "function" ? i.arrayBuffer() : new Response(i).arrayBuffer();
354
+ async function we(n) {
355
+ return typeof n.arrayBuffer == "function" ? n.arrayBuffer() : new Response(n).arrayBuffer();
347
356
  }
348
- const we = 15e3, R = "vanira-connect-stall-prompt";
357
+ const ge = 15e3, R = "vanira-connect-stall-prompt";
349
358
  let v = null;
350
- function ge(i = we) {
359
+ function ve(n = ge) {
351
360
  typeof window > "u" || (g(!1), v = setTimeout(() => {
352
- v = null, ve(), window.dispatchEvent(new CustomEvent("vanira:connect-stall"));
353
- }, i));
361
+ v = null, Ce(), window.dispatchEvent(new CustomEvent("vanira:connect-stall"));
362
+ }, n));
354
363
  }
355
- function g(i = !0) {
356
- v !== null && (clearTimeout(v), v = null), i && P();
364
+ function g(n = !0) {
365
+ v !== null && (clearTimeout(v), v = null), n && P();
357
366
  }
358
367
  function P() {
359
- var i;
360
- typeof document > "u" || (i = document.getElementById(R)) == null || i.remove();
368
+ var n;
369
+ typeof document > "u" || (n = document.getElementById(R)) == null || n.remove();
361
370
  }
362
- function ve() {
363
- var t, n;
371
+ function Ce() {
372
+ var t, i;
364
373
  if (typeof document > "u" || document.getElementById(R)) return;
365
- const i = document.createElement("div");
366
- i.id = R, i.setAttribute("role", "alertdialog"), i.setAttribute("aria-modal", "true"), i.setAttribute("aria-labelledby", "vanira-stall-title"), i.style.cssText = [
374
+ const n = document.createElement("div");
375
+ n.id = R, n.setAttribute("role", "alertdialog"), n.setAttribute("aria-modal", "true"), n.setAttribute("aria-labelledby", "vanira-stall-title"), n.style.cssText = [
367
376
  "position:fixed",
368
377
  "inset:0",
369
378
  "z-index:2147483646",
@@ -399,11 +408,11 @@ function ve() {
399
408
  <p style="margin:12px 0 0;font-size:12px;color:#888">
400
409
  Tip: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)
401
410
  </p>
402
- `, i.appendChild(e), document.body.appendChild(i), (t = e.querySelector("#vanira-stall-refresh")) == null || t.addEventListener("click", () => {
411
+ `, n.appendChild(e), document.body.appendChild(n), (t = e.querySelector("#vanira-stall-refresh")) == null || t.addEventListener("click", () => {
403
412
  P(), window.location.reload();
404
- }), (n = e.querySelector("#vanira-stall-dismiss")) == null || n.addEventListener("click", () => P());
413
+ }), (i = e.querySelector("#vanira-stall-dismiss")) == null || i.addEventListener("click", () => P());
405
414
  }
406
- function Ce(i) {
415
+ function Te(n) {
407
416
  return null;
408
417
  }
409
418
  function C() {
@@ -411,16 +420,16 @@ function C() {
411
420
  }
412
421
  class Ie {
413
422
  constructor(e) {
414
- l(this, "active", !1);
415
- l(this, "initialSent", !1);
416
- l(this, "lastRoute", "");
417
- l(this, "sendContext");
418
- l(this, "isReady");
419
- l(this, "cleanupFns", []);
420
- l(this, "initialRetryTimer", null);
421
- l(this, "routePollTimer", null);
422
- l(this, "originalPushState", null);
423
- l(this, "originalReplaceState", null);
423
+ d(this, "active", !1);
424
+ d(this, "initialSent", !1);
425
+ d(this, "lastRoute", "");
426
+ d(this, "sendContext");
427
+ d(this, "isReady");
428
+ d(this, "cleanupFns", []);
429
+ d(this, "initialRetryTimer", null);
430
+ d(this, "routePollTimer", null);
431
+ d(this, "originalPushState", null);
432
+ d(this, "originalReplaceState", null);
424
433
  this.sendContext = e.sendContext, this.isReady = e.isReady ?? (() => !0);
425
434
  }
426
435
  start() {
@@ -454,23 +463,23 @@ class Ie {
454
463
  }
455
464
  }
456
465
  attachListeners() {
457
- const e = (r, o = 0) => {
466
+ const e = (r, c = 0) => {
458
467
  const h = () => {
459
- const s = C();
460
- s !== this.lastRoute && this.handleRouteChange(s, r);
468
+ const _ = C();
469
+ _ !== this.lastRoute && this.handleRouteChange(_, r);
461
470
  };
462
- o > 0 ? window.setTimeout(h, o) : queueMicrotask(h);
463
- }, t = () => e("popstate"), n = () => e("hashchange"), a = (r) => {
464
- const o = r.detail;
465
- if ((o == null ? void 0 : o.initiated_by) === "agent") {
471
+ c > 0 ? window.setTimeout(h, c) : queueMicrotask(h);
472
+ }, t = () => e("popstate"), i = () => e("hashchange"), a = (r) => {
473
+ const c = r.detail;
474
+ if ((c == null ? void 0 : c.initiated_by) === "agent") {
466
475
  e("vanira_navigate_agent", 120);
467
476
  return;
468
477
  }
469
478
  e("vanira_navigate", 120);
470
479
  };
471
- window.addEventListener("popstate", t), window.addEventListener("hashchange", n), window.addEventListener("vanira:navigate", a), this.cleanupFns.push(
480
+ window.addEventListener("popstate", t), window.addEventListener("hashchange", i), window.addEventListener("vanira:navigate", a), this.cleanupFns.push(
472
481
  () => window.removeEventListener("popstate", t),
473
- () => window.removeEventListener("hashchange", n),
482
+ () => window.removeEventListener("hashchange", i),
474
483
  () => window.removeEventListener("vanira:navigate", a)
475
484
  ), this.originalPushState = history.pushState.bind(history), this.originalReplaceState = history.replaceState.bind(history), history.pushState = (...r) => {
476
485
  this.originalPushState(...r), e("pushState");
@@ -484,88 +493,90 @@ class Ie {
484
493
  }
485
494
  handleRouteChange(e, t) {
486
495
  if (!this.active) return;
487
- const n = this.lastRoute;
488
- if (n === e) return;
496
+ const i = this.lastRoute;
497
+ if (i === e) return;
489
498
  if (this.lastRoute = e, !this.initialSent) {
490
499
  this.scheduleInitialContextSend();
491
500
  return;
492
501
  }
493
- !this.isReady() || Ce() || this.sendRouteContext("route_changed", n, t, "user");
502
+ !this.isReady() || Te() || this.sendRouteContext("route_changed", i, t, "user");
494
503
  }
495
- sendRouteContext(e, t, n, a = "user") {
504
+ sendRouteContext(e, t, i, a = "user") {
496
505
  const r = C();
497
506
  this.lastRoute = r;
498
- const o = {
507
+ const c = {
499
508
  ui_state: "page_navigation",
500
509
  navigation_led_by: a,
501
510
  current_route: r,
502
511
  current_page: r,
503
512
  user_action: e === "call_started" ? "call_started_on_page" : "user_navigated"
504
513
  };
505
- e === "call_started" ? o.message = `User started the call while viewing ${r}.` : (o.previous_route = t ?? "", o.message = `User navigated from ${t || "(unknown)"} to ${r}.`, n && (o.navigation_source = n));
514
+ e === "call_started" ? c.message = `User started the call while viewing ${r}.` : (c.previous_route = t ?? "", c.message = `User navigated from ${t || "(unknown)"} to ${r}.`, i && (c.navigation_source = i));
506
515
  try {
507
- this.sendContext(o);
516
+ this.sendContext(c);
508
517
  } catch {
509
518
  }
510
519
  }
511
520
  }
512
521
  const y = class y {
513
522
  constructor(e) {
514
- l(this, "serverUrl");
515
- l(this, "agentId");
516
- l(this, "callId");
517
- l(this, "prospectId");
518
- l(this, "apiKey");
519
- l(this, "backendUrl");
520
- l(this, "token");
521
- l(this, "prospectName");
522
- l(this, "extraDetails");
523
- l(this, "onConnected");
524
- l(this, "onDisconnected");
525
- l(this, "onError");
526
- l(this, "onTranscription");
527
- l(this, "onLocalStream");
523
+ d(this, "serverUrl");
524
+ d(this, "agentId");
525
+ d(this, "callId");
526
+ d(this, "prospectId");
527
+ d(this, "apiKey");
528
+ d(this, "backendUrl");
529
+ d(this, "token");
530
+ d(this, "prospectName");
531
+ d(this, "welcomeMessage");
532
+ d(this, "extraDetails");
533
+ d(this, "onConnected");
534
+ d(this, "onDisconnected");
535
+ d(this, "onError");
536
+ d(this, "onTranscription");
537
+ d(this, "onLocalStream");
528
538
  // @ts-ignore
529
- l(this, "onRemoteTrack");
530
- l(this, "onClientToolCall");
531
- l(this, "onSessionStarted");
532
- l(this, "sessionStartedEmitted", !1);
533
- l(this, "pc", null);
534
- l(this, "dataChannel", null);
535
- l(this, "mediaBytesChannel", null);
536
- l(this, "audioElement", null);
537
- l(this, "localStream", null);
538
- l(this, "micMuted", !1);
539
- l(this, "connected", !1);
540
- l(this, "appliedRemoteCandidates", /* @__PURE__ */ new Set());
541
- l(this, "remoteDescSet", !1);
542
- l(this, "pendingServerIce", []);
543
- l(this, "icePollStop", !1);
544
- l(this, "iceServers");
545
- l(this, "callSessionLoaded", !1);
546
- l(this, "connectGeneration", 0);
547
- l(this, "runtime");
548
- l(this, "sessionBehavior");
549
- l(this, "routeTracker", null);
550
- l(this, "_status", "idle");
551
- l(this, "listeners", /* @__PURE__ */ new Map());
539
+ d(this, "onRemoteTrack");
540
+ d(this, "onClientToolCall");
541
+ d(this, "onSessionStarted");
542
+ d(this, "sessionStartedEmitted", !1);
543
+ d(this, "pc", null);
544
+ d(this, "dataChannel", null);
545
+ d(this, "mediaBytesChannel", null);
546
+ d(this, "audioElement", null);
547
+ d(this, "localStream", null);
548
+ d(this, "micMuted", !1);
549
+ d(this, "connected", !1);
550
+ d(this, "appliedRemoteCandidates", /* @__PURE__ */ new Set());
551
+ d(this, "remoteDescSet", !1);
552
+ d(this, "pendingServerIce", []);
553
+ d(this, "icePollStop", !1);
554
+ d(this, "iceServers");
555
+ d(this, "callSessionLoaded", !1);
556
+ d(this, "connectGeneration", 0);
557
+ d(this, "runtime");
558
+ d(this, "sessionBehavior");
559
+ d(this, "routeTracker", null);
560
+ d(this, "_status", "idle");
561
+ d(this, "listeners", /* @__PURE__ */ new Map());
552
562
  /** Live vision config — auto-starts camera on connect when scope is full_call. */
553
- l(this, "liveVision");
554
- l(this, "liveVisionAutoStarted", !1);
555
- l(this, "connectStallTimeoutMs");
563
+ d(this, "liveVision");
564
+ d(this, "liveVisionAutoStarted", !1);
565
+ d(this, "connectStallTimeoutMs");
566
+ var _;
556
567
  if (!e.agentId) throw new Error("agentId is required");
557
- const t = !!(e.apiKey || e.token), n = !!(e.serverUrl && e.callId), a = y.normalizeIceServers(
568
+ const t = !!(e.apiKey || e.token), i = !!(e.serverUrl && e.callId), a = y.normalizeIceServers(
558
569
  e.iceServers
559
570
  );
560
- if (!t && !n)
571
+ if (!t && !i)
561
572
  throw new Error(
562
573
  "apiKey or token is required — or pass serverUrl and callId from a prior POST /calls/create"
563
574
  );
564
- this.agentId = e.agentId, this.sessionBehavior = e.sessionBehavior, this.serverUrl = (e.serverUrl || "").replace(/\/$/, ""), this.apiKey = e.apiKey, this.token = e.token, this.prospectName = e.prospectName, this.extraDetails = e.extraDetails, this.backendUrl = (e.backendUrl || ne).replace(/\/$/, ""), a.length && (this.iceServers = a), n && (this.callSessionLoaded = !0);
575
+ this.agentId = e.agentId, this.sessionBehavior = e.sessionBehavior, this.serverUrl = (e.serverUrl || "").replace(/\/$/, ""), this.apiKey = e.apiKey, this.token = e.token, this.prospectName = e.prospectName, this.welcomeMessage = ((_ = e.welcomeMessage) == null ? void 0 : _.trim()) || void 0, this.extraDetails = e.extraDetails, this.backendUrl = (e.backendUrl || ie).replace(/\/$/, ""), a.length && (this.iceServers = a), i && (this.callSessionLoaded = !0);
565
576
  const r = typeof window < "u";
566
577
  this.prospectId = e.prospectId;
567
- const o = e.sessionBehavior === "continue";
568
- if (o && r && !e.callId) {
578
+ const c = e.sessionBehavior === "continue";
579
+ if (c && r && !e.callId) {
569
580
  const s = W(this.agentId);
570
581
  s && (e.callId || (this.callId = s.callId), !this.prospectId && s.prospectId && (this.prospectId = s.prospectId));
571
582
  }
@@ -575,7 +586,7 @@ const y = class y {
575
586
  this.prospectId = (s == null ? void 0 : s.prospectId) || window.sessionStorage && window.sessionStorage.getItem("vanira_prospect_id") || window.localStorage && window.localStorage.getItem("vanira_prospect_id") || void 0;
576
587
  } catch {
577
588
  }
578
- e.callId ? this.callId = e.callId : o || (this.callId = void 0);
589
+ e.callId ? this.callId = e.callId : c || (this.callId = void 0);
579
590
  const h = e.onSessionStarted;
580
591
  this.onSessionStarted = (s) => {
581
592
  h == null || h(s), this.emit("session_started", s);
@@ -586,28 +597,28 @@ const y = class y {
586
597
  var s;
587
598
  g(), this._status = "disconnected", (s = e.onDisconnected) == null || s.call(e), this.emit("disconnected");
588
599
  }, this.onError = (s) => {
589
- var p;
600
+ var l;
590
601
  g(), this._status = "error";
591
602
  const u = typeof s == "string" ? s : (s == null ? void 0 : s.message) || "Connection error";
592
- (p = e.onError) == null || p.call(e, s), this.emit("error", u);
593
- }, this.onTranscription = (s, u, p) => {
594
- var d;
595
- (d = e.onTranscription) == null || d.call(e, s, u), this.emit("transcription", { text: s, isFinal: u, role: p });
603
+ (l = e.onError) == null || l.call(e, s), this.emit("error", u);
604
+ }, this.onTranscription = (s, u, l) => {
605
+ var p;
606
+ (p = e.onTranscription) == null || p.call(e, s, u), this.emit("transcription", { text: s, isFinal: u, role: l });
596
607
  }, this.onLocalStream = e.onLocalStream || (() => {
597
608
  }), this.onRemoteTrack = (s, u) => {
598
- var p;
599
- (p = e.onRemoteTrack) == null || p.call(e, s, u), this.emit("track", { track: s, stream: u });
609
+ var l;
610
+ (l = e.onRemoteTrack) == null || l.call(e, s, u), this.emit("track", { track: s, stream: u });
600
611
  }, this.onClientToolCall = (s) => {
601
- var d;
602
- (d = e.onClientToolCall) == null || d.call(e, s);
603
- const u = (s == null ? void 0 : s.data) || s, p = {
612
+ var p;
613
+ (p = e.onClientToolCall) == null || p.call(e, s);
614
+ const u = (s == null ? void 0 : s.data) || s, l = {
604
615
  name: String(u.name || u.tool_name || ""),
605
616
  arguments: u.arguments || u.args || {},
606
617
  tool_call_id: String(u.tool_call_id || u.call_id || ""),
607
618
  execution_mode: u.execution_mode === "blocking" ? "blocking" : "fire_and_forget",
608
619
  client_fields: u.client_fields || {}
609
620
  };
610
- p.name && p.tool_call_id && this.emit("tool_call", p);
621
+ l.name && l.tool_call_id && this.emit("tool_call", l);
611
622
  }, this.runtime = e.runtime, typeof window < "u" && e.trackRouteContext !== !1 && (this.routeTracker = new Ie({
612
623
  sendContext: (s) => this.sendContextUpdate(s),
613
624
  isReady: () => {
@@ -634,7 +645,7 @@ const y = class y {
634
645
  */
635
646
  async connect() {
636
647
  var t;
637
- this._status = "connecting", this.connectStallTimeoutMs > 0 && ge(this.connectStallTimeoutMs);
648
+ this._status = "connecting", this.connectStallTimeoutMs > 0 && ve(this.connectStallTimeoutMs);
638
649
  const e = ++this.connectGeneration;
639
650
  if (await this.loadCallSession(), !this.isConnectCancelled(e)) {
640
651
  if (!this.serverUrl)
@@ -648,9 +659,9 @@ const y = class y {
648
659
  }
649
660
  try {
650
661
  this.appliedRemoteCandidates.clear(), this.remoteDescSet = !1, this.pendingServerIce = [], this.icePollStop = !1, this.stopRemoteIcePolling();
651
- const n = this.getIceServers();
662
+ const i = this.getIceServers();
652
663
  this.pc = new RTCPeerConnection({
653
- iceServers: n,
664
+ iceServers: i,
654
665
  iceTransportPolicy: "all"
655
666
  });
656
667
  let a;
@@ -664,77 +675,77 @@ const y = class y {
664
675
  channelCount: 1
665
676
  }
666
677
  });
667
- } catch (d) {
668
- if (d.name === "NotAllowedError" || d.name === "PermissionDeniedError" || (t = d.message) != null && t.includes("Permission denied")) {
669
- const _ = navigator.userAgent, m = /iPad|iPhone|iPod/.test(_) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
678
+ } catch (l) {
679
+ if (l.name === "NotAllowedError" || l.name === "PermissionDeniedError" || (t = l.message) != null && t.includes("Permission denied")) {
680
+ const p = navigator.userAgent, m = /iPad|iPhone|iPod/.test(p) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
670
681
  let f = "Microphone access denied. Please allow microphone access in your browser settings.";
671
- m && (_.includes("CriOS") ? f = "Microphone access blocked. Please enable it in iOS Settings > Chrome > Microphone, then reload the page." : _.includes("FxiOS") ? f = "Microphone access blocked. Please enable it in iOS Settings > Firefox > Microphone, then reload the page." : f = "Microphone access blocked. Please enable it in iOS Settings > Safari > Microphone (or tap 'aA' > Website Settings > Allow Microphone).");
682
+ m && (p.includes("CriOS") ? f = "Microphone access blocked. Please enable it in iOS Settings > Chrome > Microphone, then reload the page." : p.includes("FxiOS") ? f = "Microphone access blocked. Please enable it in iOS Settings > Firefox > Microphone, then reload the page." : f = "Microphone access blocked. Please enable it in iOS Settings > Safari > Microphone (or tap 'aA' > Website Settings > Allow Microphone).");
672
683
  const w = new Error(f);
673
- throw w.name = d.name, w;
684
+ throw w.name = l.name, w;
674
685
  }
675
- throw d;
686
+ throw l;
676
687
  }
677
688
  if (this.isConnectCancelled(e)) {
678
- a.getTracks().forEach((d) => d.stop());
689
+ a.getTracks().forEach((l) => l.stop());
679
690
  return;
680
691
  }
681
692
  if (this.localStream = a, !this.pc || this.isConnectCancelled(e)) {
682
- a.getTracks().forEach((d) => d.stop());
693
+ a.getTracks().forEach((l) => l.stop());
683
694
  return;
684
695
  }
685
- if (this.onLocalStream(a), a.getTracks().forEach((d) => {
686
- var _;
687
- (_ = this.pc) == null || _.addTrack(d, a);
696
+ if (this.onLocalStream(a), a.getTracks().forEach((l) => {
697
+ var p;
698
+ (p = this.pc) == null || p.addTrack(l, a);
688
699
  }), !this.pc)
689
700
  throw new Error("RTCPeerConnection was closed unexpectedly");
690
701
  this.dataChannel = this.pc.createDataChannel("control"), this.dataChannel.onopen = () => {
691
- var d;
692
- (d = this.routeTracker) == null || d.onChannelReady();
693
- }, this.dataChannel.onmessage = (d) => {
694
- if (typeof d.data == "string")
702
+ var l;
703
+ (l = this.routeTracker) == null || l.onChannelReady();
704
+ }, this.dataChannel.onmessage = (l) => {
705
+ if (typeof l.data == "string")
695
706
  try {
696
- this.handleControlEvent(JSON.parse(d.data));
707
+ this.handleControlEvent(JSON.parse(l.data));
697
708
  } catch {
698
709
  }
699
- else if (d.data instanceof ArrayBuffer)
710
+ else if (l.data instanceof ArrayBuffer)
700
711
  try {
701
- const _ = new TextDecoder().decode(d.data);
712
+ const p = new TextDecoder().decode(l.data);
702
713
  try {
703
- const m = JSON.parse(_);
704
- pe(m) && this.handleControlEvent(m);
714
+ const m = JSON.parse(p);
715
+ _e(m) && this.handleControlEvent(m);
705
716
  } catch {
706
717
  }
707
718
  } catch {
708
719
  }
709
- else d.data instanceof Blob && d.data.text().then((_) => {
720
+ else l.data instanceof Blob && l.data.text().then((p) => {
710
721
  try {
711
- this.handleControlEvent(JSON.parse(_));
722
+ this.handleControlEvent(JSON.parse(p));
712
723
  } catch {
713
724
  }
714
725
  });
715
- }, this.dataChannel.onerror = (d) => {
726
+ }, this.dataChannel.onerror = (l) => {
716
727
  }, this.mediaBytesChannel = this.pc.createDataChannel("media-bytes", { ordered: !0 }), this.mediaBytesChannel.binaryType = "arraybuffer", this.mediaBytesChannel.onopen = () => {
717
- }, this.mediaBytesChannel.onerror = (d) => {
718
- }, this.pc.ontrack = (d) => {
719
- const _ = d.track, m = d.streams[0];
720
- _.kind === "audio" ? (this.audioElement = new Audio(), this.audioElement.srcObject = m, this.audioElement.play().catch((f) => {
728
+ }, this.mediaBytesChannel.onerror = (l) => {
729
+ }, this.pc.ontrack = (l) => {
730
+ const p = l.track, m = l.streams[0];
731
+ p.kind === "audio" ? (this.audioElement = new Audio(), this.audioElement.srcObject = m, this.audioElement.play().catch((f) => {
721
732
  }), this.audioElement.onended = () => {
722
733
  this.sendEvent("playedStream"), typeof window < "u" && window.dispatchEvent(new CustomEvent("vanira:agent-playback-ended"));
723
- }, this.onRemoteTrack(_, m)) : _.kind === "video" && this.onRemoteTrack(_, m);
734
+ }, this.onRemoteTrack(p, m)) : p.kind === "video" && this.onRemoteTrack(p, m);
724
735
  };
725
736
  const r = () => {
726
- var m, f, w, U, L, M, D, O, N, V, B;
727
- const d = ((m = this.pc) == null ? void 0 : m.connectionState) === "connected" || ((f = this.pc) == null ? void 0 : f.iceConnectionState) === "connected" || ((w = this.pc) == null ? void 0 : w.iceConnectionState) === "completed", _ = ((U = this.pc) == null ? void 0 : U.connectionState) === "failed" || ((L = this.pc) == null ? void 0 : L.iceConnectionState) === "failed" || ((M = this.pc) == null ? void 0 : M.connectionState) === "closed" || ((D = this.pc) == null ? void 0 : D.iceConnectionState) === "closed" || ((O = this.pc) == null ? void 0 : O.connectionState) === "disconnected" || ((N = this.pc) == null ? void 0 : N.iceConnectionState) === "disconnected";
728
- ((V = this.pc) == null ? void 0 : V.connectionState) === "connected" && this.stopRemoteIcePolling(), d && !this.connected ? (this.connected = !0, (B = this.routeTracker) == null || B.start(), this.onConnected()) : _ && this.connected && (this.connected = !1, this.liveVisionAutoStarted = !1, this.onDisconnected());
737
+ var m, f, w, U, M, L, D, O, N, V, K;
738
+ const l = ((m = this.pc) == null ? void 0 : m.connectionState) === "connected" || ((f = this.pc) == null ? void 0 : f.iceConnectionState) === "connected" || ((w = this.pc) == null ? void 0 : w.iceConnectionState) === "completed", p = ((U = this.pc) == null ? void 0 : U.connectionState) === "failed" || ((M = this.pc) == null ? void 0 : M.iceConnectionState) === "failed" || ((L = this.pc) == null ? void 0 : L.connectionState) === "closed" || ((D = this.pc) == null ? void 0 : D.iceConnectionState) === "closed" || ((O = this.pc) == null ? void 0 : O.connectionState) === "disconnected" || ((N = this.pc) == null ? void 0 : N.iceConnectionState) === "disconnected";
739
+ ((V = this.pc) == null ? void 0 : V.connectionState) === "connected" && this.stopRemoteIcePolling(), l && !this.connected ? (this.connected = !0, (K = this.routeTracker) == null || K.start(), this.onConnected()) : p && this.connected && (this.connected = !1, this.liveVisionAutoStarted = !1, this.onDisconnected());
729
740
  };
730
741
  this.pc.onconnectionstatechange = r, this.pc.oniceconnectionstatechange = r;
731
- const o = this.getIceTrickleUrl();
732
- this.pc.onicecandidate = (d) => {
733
- d.candidate && this.sendRemoteIceCandidate(d.candidate, o);
742
+ const c = this.getIceTrickleUrl();
743
+ this.pc.onicecandidate = (l) => {
744
+ l.candidate && this.sendRemoteIceCandidate(l.candidate, c);
734
745
  };
735
746
  const h = await this.pc.createOffer();
736
747
  if (this.isConnectCancelled(e) || (await this.pc.setLocalDescription(h), this.isConnectCancelled(e))) return;
737
- const s = this.serverUrl.includes("?") ? this.serverUrl : `${this.serverUrl}/webrtc?agent=${this.agentId}_${this.callId}`, u = await fetch(s, {
748
+ const _ = this.serverUrl.includes("?") ? this.serverUrl : `${this.serverUrl}/webrtc?agent=${this.agentId}_${this.callId}`, s = await fetch(_, {
738
749
  method: "POST",
739
750
  headers: { "Content-Type": "application/json" },
740
751
  body: JSON.stringify({
@@ -744,32 +755,32 @@ const y = class y {
744
755
  })
745
756
  });
746
757
  if (this.isConnectCancelled(e)) return;
747
- if (!u.ok) {
748
- const d = await u.json();
749
- throw new Error(d.error || `HTTP ${u.status}`);
758
+ if (!s.ok) {
759
+ const l = await s.json();
760
+ throw new Error(l.error || `HTTP ${s.status}`);
750
761
  }
751
- const { answer: p } = await u.json();
752
- if (this.isConnectCancelled(e) || !this.pc || (await this.pc.setRemoteDescription(p), this.isConnectCancelled(e)) || (this.remoteDescSet = !0, await this.flushPendingServerIce(), this.isConnectCancelled(e))) return;
753
- this.startRemoteIcePolling(o);
754
- } catch (n) {
762
+ const { answer: u } = await s.json();
763
+ if (this.isConnectCancelled(e) || !this.pc || (await this.pc.setRemoteDescription(u), this.isConnectCancelled(e)) || (this.remoteDescSet = !0, await this.flushPendingServerIce(), this.isConnectCancelled(e))) return;
764
+ this.startRemoteIcePolling(c);
765
+ } catch (i) {
755
766
  if (this.isConnectCancelled(e)) return;
756
- throw this.disconnect(), this.onError(n.message || n), n;
767
+ throw this.disconnect(), this.onError(i.message || i), i;
757
768
  }
758
769
  }
759
770
  }
760
771
  createCallCacheKey(e, t) {
761
- const n = this.apiKey ? `key:${this.apiKey.slice(0, 16)}` : `token:${(this.token || "").slice(-16)}`;
772
+ const i = this.apiKey ? `key:${this.apiKey.slice(0, 16)}` : `token:${(this.token || "").slice(-16)}`;
762
773
  return [
763
774
  this.backendUrl,
764
775
  this.agentId,
765
776
  e,
766
777
  t || "",
767
778
  this.prospectId || "",
768
- n
779
+ i
769
780
  ].join("|");
770
781
  }
771
- async postCreateCall(e, t, n) {
772
- var h, s, u;
782
+ async postCreateCall(e, t, i) {
783
+ var h, _, s;
773
784
  const a = await fetch(`${this.backendUrl}/calls/create`, {
774
785
  method: "POST",
775
786
  headers: e,
@@ -777,32 +788,33 @@ const y = class y {
777
788
  agent_id: this.agentId,
778
789
  type: ((h = this.runtime) == null ? void 0 : h.callType) || "web",
779
790
  mode: t,
780
- ...(s = this.runtime) != null && s.runtimeName ? { runtime: this.runtime.runtimeName } : {},
791
+ ...(_ = this.runtime) != null && _.runtimeName ? { runtime: this.runtime.runtimeName } : {},
781
792
  prospect_id: this.prospectId,
782
793
  ...this.prospectName ? { prospect_name: this.prospectName } : {},
794
+ ...this.welcomeMessage ? { welcome_message: this.welcomeMessage } : {},
783
795
  ...this.extraDetails && Object.keys(this.extraDetails).length ? { extra_details: this.extraDetails } : {},
784
- ...n ? { call_id: n } : {}
796
+ ...i ? { call_id: i } : {}
785
797
  })
786
798
  });
787
799
  if (!a.ok) {
788
- const p = await a.json().catch(() => ({}));
789
- throw new Error(`[VaniraClient] createCall failed (${a.status}): ${((u = p == null ? void 0 : p.detail) == null ? void 0 : u.message) || (p == null ? void 0 : p.message) || a.statusText}`);
800
+ const u = await a.json().catch(() => ({}));
801
+ throw new Error(`[VaniraClient] createCall failed (${a.status}): ${((s = u == null ? void 0 : u.detail) == null ? void 0 : s.message) || (u == null ? void 0 : u.message) || a.statusText}`);
790
802
  }
791
803
  const r = await a.json();
792
804
  if (!r.call_id || !r.worker_url)
793
805
  throw new Error("[VaniraClient] /calls/create response missing call_id or worker_url");
794
- const o = y.normalizeIceServers(r.ice_servers);
795
- if (!o.length)
806
+ const c = y.normalizeIceServers(r.ice_servers);
807
+ if (!c.length)
796
808
  throw new Error("[VaniraClient] /calls/create response missing ice_servers");
797
809
  return {
798
810
  callId: r.call_id,
799
811
  prospectId: r.prospect_id || this.prospectId,
800
812
  serverUrl: r.worker_url.replace(/\/$/, ""),
801
- iceServers: o
813
+ iceServers: c
802
814
  };
803
815
  }
804
816
  applyCreateCallSession(e) {
805
- if (this.callId = e.callId, this.prospectId = e.prospectId || this.prospectId, this.serverUrl = e.serverUrl, this.iceServers = e.iceServers, this.callSessionLoaded = !0, he(this.agentId, this.callId || "", this.prospectId), this.onSessionStarted && this.prospectId && this.callId && !this.sessionStartedEmitted)
817
+ if (this.callId = e.callId, this.prospectId = e.prospectId || this.prospectId, this.serverUrl = e.serverUrl, this.iceServers = e.iceServers, this.callSessionLoaded = !0, ue(this.agentId, this.callId || "", this.prospectId), this.onSessionStarted && this.prospectId && this.callId && !this.sessionStartedEmitted)
806
818
  try {
807
819
  this.onSessionStarted({ prospectId: this.prospectId, callId: this.callId, serverUrl: this.serverUrl }), this.sessionStartedEmitted = !0;
808
820
  } catch {
@@ -818,13 +830,13 @@ const y = class y {
818
830
  throw new Error("[VaniraClient] apiKey or token is required to create a call session");
819
831
  const e = { "Content-Type": "application/json" };
820
832
  this.apiKey ? e["X-API-Key"] = this.apiKey : this.token && (e.Authorization = this.token.startsWith("Bearer ") ? this.token : `Bearer ${this.token}`);
821
- const t = this.sessionBehavior === "continue" ? this.callId : void 0, n = this.sessionBehavior === "continue" ? "continue" : "new", a = this.createCallCacheKey(n, t);
833
+ const t = this.sessionBehavior === "continue" ? this.callId : void 0, i = this.sessionBehavior === "continue" ? "continue" : "new", a = this.createCallCacheKey(i, t);
822
834
  let r = y.inflightCreates.get(a);
823
- r || (r = this.postCreateCall(e, n, t), y.inflightCreates.set(a, r), r.finally(() => {
835
+ r || (r = this.postCreateCall(e, i, t), y.inflightCreates.set(a, r), r.finally(() => {
824
836
  y.inflightCreates.get(a) === r && y.inflightCreates.delete(a);
825
837
  }));
826
- const o = await r;
827
- this.applyCreateCallSession(o);
838
+ const c = await r;
839
+ this.applyCreateCallSession(c);
828
840
  }
829
841
  getIceServers() {
830
842
  var e;
@@ -834,11 +846,11 @@ const y = class y {
834
846
  static normalizeIceServers(e) {
835
847
  if (!Array.isArray(e)) return [];
836
848
  const t = [];
837
- for (const n of e) {
838
- const a = n == null ? void 0 : n.urls, r = Array.isArray(a) ? a.filter(Boolean) : typeof a == "string" && a.trim() ? [a.trim()] : [];
849
+ for (const i of e) {
850
+ const a = i == null ? void 0 : i.urls, r = Array.isArray(a) ? a.filter(Boolean) : typeof a == "string" && a.trim() ? [a.trim()] : [];
839
851
  if (!r.length) continue;
840
- const o = { urls: r.length === 1 ? r[0] : r }, h = n.username, s = n.credential;
841
- h && (o.username = h), s && (o.credential = s), t.push(o);
852
+ const c = { urls: r.length === 1 ? r[0] : r }, h = i.username, _ = i.credential;
853
+ h && (c.username = h), _ && (c.credential = _), t.push(c);
842
854
  }
843
855
  return t;
844
856
  }
@@ -865,13 +877,13 @@ const y = class y {
865
877
  }
866
878
  async sendRemoteIceCandidate(e, t) {
867
879
  try {
868
- const n = await fetch(t, {
880
+ const i = await fetch(t, {
869
881
  method: "POST",
870
882
  headers: { "Content-Type": "application/json" },
871
883
  body: JSON.stringify({ candidate: e.toJSON() })
872
884
  });
873
- if (n.ok) {
874
- const a = await n.json();
885
+ if (i.ok) {
886
+ const a = await i.json();
875
887
  await this.applyServerIceCandidates(a.candidates);
876
888
  }
877
889
  } catch {
@@ -885,9 +897,9 @@ const y = class y {
885
897
  return;
886
898
  }
887
899
  for (const t of e) {
888
- const n = JSON.stringify(t);
889
- if (!this.appliedRemoteCandidates.has(n)) {
890
- this.appliedRemoteCandidates.add(n);
900
+ const i = JSON.stringify(t);
901
+ if (!this.appliedRemoteCandidates.has(i)) {
902
+ this.appliedRemoteCandidates.add(i);
891
903
  try {
892
904
  await this.pc.addIceCandidate(t);
893
905
  } catch {
@@ -901,9 +913,9 @@ const y = class y {
901
913
  const e = this.pendingServerIce;
902
914
  this.pendingServerIce = [];
903
915
  for (const t of e) {
904
- const n = JSON.stringify(t);
905
- if (!this.appliedRemoteCandidates.has(n)) {
906
- this.appliedRemoteCandidates.add(n);
916
+ const i = JSON.stringify(t);
917
+ if (!this.appliedRemoteCandidates.has(i)) {
918
+ this.appliedRemoteCandidates.add(i);
907
919
  try {
908
920
  await this.pc.addIceCandidate(t);
909
921
  } catch {
@@ -915,16 +927,16 @@ const y = class y {
915
927
  this.icePollStop = !1, this.pollServerIce(e);
916
928
  }
917
929
  async pollServerIce(e) {
918
- var n;
930
+ var i;
919
931
  const t = Date.now() + 15e3;
920
932
  for (; !this.icePollStop && Date.now() < t; ) {
921
- const a = (n = this.pc) == null ? void 0 : n.connectionState;
933
+ const a = (i = this.pc) == null ? void 0 : i.connectionState;
922
934
  if (a === "connected" || a === "failed" || a === "closed") break;
923
935
  try {
924
936
  const r = await fetch(e, { method: "GET" });
925
937
  if (r.ok) {
926
- const o = await r.json();
927
- if (await this.applyServerIceCandidates(o.candidates), o.done && (!o.candidates || o.candidates.length === 0)) break;
938
+ const c = await r.json();
939
+ if (await this.applyServerIceCandidates(c.candidates), c.done && (!c.candidates || c.candidates.length === 0)) break;
928
940
  }
929
941
  } catch {
930
942
  }
@@ -938,20 +950,20 @@ const y = class y {
938
950
  * Send control event via DataChannel
939
951
  */
940
952
  sendEvent(e, t = {}) {
941
- var n;
942
- if (((n = this.dataChannel) == null ? void 0 : n.readyState) === "open") {
953
+ var i;
954
+ if (((i = this.dataChannel) == null ? void 0 : i.readyState) === "open") {
943
955
  const a = { event: e, ...t };
944
956
  this.dataChannel.send(JSON.stringify(a));
945
957
  }
946
958
  }
947
959
  /** Wait for control DataChannel, then send (live vision lifecycle events). */
948
- async sendEventWhenReady(e, t = {}, n = 1e4) {
960
+ async sendEventWhenReady(e, t = {}, i = 1e4) {
949
961
  var r;
950
- const a = Date.now() + n;
962
+ const a = Date.now() + i;
951
963
  for (; Date.now() < a; ) {
952
964
  if (((r = this.dataChannel) == null ? void 0 : r.readyState) === "open")
953
965
  return this.sendEvent(e, t), !0;
954
- await new Promise((o) => setTimeout(o, 50));
966
+ await new Promise((c) => setTimeout(c, 50));
955
967
  }
956
968
  return !1;
957
969
  }
@@ -966,7 +978,7 @@ const y = class y {
966
978
  name: "open_live_camera",
967
979
  tool_call_id: `lv_${crypto.randomUUID()}`,
968
980
  execution_mode: "fire_and_forget",
969
- client_fields: { preset_id: c.LiveVision },
981
+ client_fields: { preset_id: o.LiveVision },
970
982
  arguments: {
971
983
  mode: "live",
972
984
  scope: t,
@@ -994,15 +1006,15 @@ const y = class y {
994
1006
  this.dispatchBoardAbort(
995
1007
  "User interrupted while LaTeX was writing",
996
1008
  void 0,
997
- c.WriteLatexText
1009
+ o.WriteLatexText
998
1010
  );
999
1011
  break;
1000
1012
  case "transcription":
1001
1013
  {
1002
- const n = e.data && typeof e.data == "object" ? e.data : {}, a = String(e.text ?? n.text ?? "").trim(), r = e.isFinal ?? e.is_final ?? n.isFinal ?? n.is_final, o = r === void 0 ? !0 : r === !0 || r === "true", h = String(
1003
- e.role ?? e.speaker ?? n.role ?? n.speaker ?? ""
1014
+ const i = e.data && typeof e.data == "object" ? e.data : {}, a = String(e.text ?? i.text ?? "").trim(), r = e.isFinal ?? e.is_final ?? i.isFinal ?? i.is_final, c = r === void 0 ? !0 : r === !0 || r === "true", h = String(
1015
+ e.role ?? e.speaker ?? i.role ?? i.speaker ?? ""
1004
1016
  ).trim() || void 0;
1005
- a && this.onTranscription(a, o, h);
1017
+ a && this.onTranscription(a, c, h);
1006
1018
  }
1007
1019
  break;
1008
1020
  case "mark":
@@ -1013,12 +1025,12 @@ const y = class y {
1013
1025
  break;
1014
1026
  }
1015
1027
  case "client_tool_call": {
1016
- const n = e.tool_call || e.data || e, a = (n == null ? void 0 : n.tool_call_id) || (n == null ? void 0 : n.call_id) || e.tool_call_id || "";
1028
+ const i = e.tool_call || e.data || e, a = (i == null ? void 0 : i.tool_call_id) || (i == null ? void 0 : i.call_id) || e.tool_call_id || "";
1017
1029
  a && ((t = this.dataChannel) == null ? void 0 : t.readyState) === "open" && this.dataChannel.send(JSON.stringify({
1018
1030
  event: "client_tool_ack",
1019
1031
  data: { tool_call_id: a }
1020
1032
  }));
1021
- const r = (n == null ? void 0 : n.arguments) || (n == null ? void 0 : n.args) || {}, o = (n == null ? void 0 : n.client_fields) || {}, h = (n == null ? void 0 : n.name) || (n == null ? void 0 : n.tool_name) || "", s = de(o, r, h);
1033
+ const r = (i == null ? void 0 : i.arguments) || (i == null ? void 0 : i.args) || {}, c = (i == null ? void 0 : i.client_fields) || {}, h = (i == null ? void 0 : i.name) || (i == null ? void 0 : i.tool_name) || "", _ = he(c, r, h);
1022
1034
  if (h === "end_call") {
1023
1035
  a && this.sendToolResult(a, {
1024
1036
  status: "client_ack_end_call",
@@ -1026,13 +1038,13 @@ const y = class y {
1026
1038
  }), window.setTimeout(() => this.disconnect(), 120);
1027
1039
  break;
1028
1040
  }
1029
- if (s) {
1041
+ if (_) {
1030
1042
  window.dispatchEvent(new CustomEvent("vanira:preset", {
1031
- detail: { toolCall: n, client: this }
1032
- })), this.onClientToolCall(n);
1043
+ detail: { toolCall: i, client: this }
1044
+ })), this.onClientToolCall(i);
1033
1045
  break;
1034
1046
  }
1035
- this.onClientToolCall(n);
1047
+ this.onClientToolCall(i);
1036
1048
  break;
1037
1049
  }
1038
1050
  }
@@ -1056,10 +1068,10 @@ const y = class y {
1056
1068
  * Uses track.enabled (not pause) so audio resumes correctly when unmuted.
1057
1069
  */
1058
1070
  setMicrophoneMuted(e) {
1059
- var t, n;
1071
+ var t, i;
1060
1072
  this.micMuted = e, (t = this.localStream) == null || t.getAudioTracks().forEach((a) => {
1061
1073
  a.enabled = !e;
1062
- }), (n = this.pc) == null || n.getSenders().forEach((a) => {
1074
+ }), (i = this.pc) == null || i.getSenders().forEach((a) => {
1063
1075
  var r;
1064
1076
  ((r = a.track) == null ? void 0 : r.kind) === "audio" && (a.track.enabled = !e);
1065
1077
  });
@@ -1074,9 +1086,9 @@ const y = class y {
1074
1086
  return e !== this.connectGeneration;
1075
1087
  }
1076
1088
  /** Notify WidgetPresetRenderer to cancel in-flight board animations */
1077
- dispatchBoardAbort(e, t, n) {
1089
+ dispatchBoardAbort(e, t, i) {
1078
1090
  typeof window > "u" || window.dispatchEvent(new CustomEvent("vanira:board_abort", {
1079
- detail: { reason: e, toolCallId: t, presetId: n }
1091
+ detail: { reason: e, toolCallId: t, presetId: i }
1080
1092
  }));
1081
1093
  }
1082
1094
  /**
@@ -1165,8 +1177,8 @@ const y = class y {
1165
1177
  * @param reason Routing key for backend processing (default: 'general')
1166
1178
  * @param message Optional user text message about the file
1167
1179
  */
1168
- async uploadMedia(e, t = "general", n = "") {
1169
- return await fe(this.dataChannel, this.mediaBytesChannel) ? this._uploadMediaViaDataChannel(e, t, n) : (me(this.dataChannel, this.mediaBytesChannel), this._uploadMediaViaHTTP(e, t, n));
1180
+ async uploadMedia(e, t = "general", i = "") {
1181
+ return await ye(this.dataChannel, this.mediaBytesChannel) ? this._uploadMediaViaDataChannel(e, t, i) : (fe(this.dataChannel, this.mediaBytesChannel), this._uploadMediaViaHTTP(e, t, i));
1170
1182
  }
1171
1183
  /**
1172
1184
  * Upload a live vision / screen frame — HTTP only for now, never sends client_media_update.
@@ -1175,45 +1187,45 @@ const y = class y {
1175
1187
  * Frames require a real media_url (server rejects empty). WebRTC upload returns url="" until
1176
1188
  * the server adds client_media_upload_ready ack — use HTTP for frame JPEGs until then.
1177
1189
  */
1178
- async uploadMediaFrame(e, t = "camera_capture", n) {
1179
- const a = n && !(e instanceof File) ? new File([e], n, { type: e.type || "image/jpeg" }) : e, { media_id: r, url: o, contentType: h } = await this._postMediaUpload(a, t, !0);
1180
- if (!r || !o)
1190
+ async uploadMediaFrame(e, t = "camera_capture", i) {
1191
+ const a = i && !(e instanceof File) ? new File([e], i, { type: e.type || "image/jpeg" }) : e, { media_id: r, url: c, contentType: h } = await this._postMediaUpload(a, t, !0);
1192
+ if (!r || !c)
1181
1193
  throw new Error("Frame upload failed: server response missing media_id or url");
1182
- return { media_id: r, url: o, content_type: h };
1194
+ return { media_id: r, url: c, content_type: h };
1183
1195
  }
1184
1196
  /** WebRTC media-bytes path (control start/complete + binary chunks). */
1185
- async _uploadBytesViaDataChannel(e, t, n, a, r) {
1197
+ async _uploadBytesViaDataChannel(e, t, i, a, r) {
1186
1198
  if (!this.callId || !this.mediaBytesChannel)
1187
1199
  throw new Error("Upload failed: call not ready for WebRTC media upload.");
1188
- const o = r || (e instanceof File ? e.name : a === "frame" ? "frame.jpg" : "upload.bin"), h = e.type || (a === "frame" ? "image/jpeg" : "application/octet-stream"), s = await Se(e);
1189
- return ye({
1190
- bytes: s,
1191
- filename: o,
1200
+ const c = r || (e instanceof File ? e.name : a === "frame" ? "frame.jpg" : "upload.bin"), h = e.type || (a === "frame" ? "image/jpeg" : "application/octet-stream"), _ = await we(e);
1201
+ return Se({
1202
+ bytes: _,
1203
+ filename: c,
1192
1204
  contentType: h,
1193
1205
  reason: t,
1194
- message: n,
1206
+ message: i,
1195
1207
  callId: this.callId,
1196
1208
  mediaBytesChannel: this.mediaBytesChannel,
1197
- sendControlEvent: (u, p) => this.sendEvent(u, p),
1209
+ sendControlEvent: (s, u) => this.sendEvent(s, u),
1198
1210
  uploadKind: a
1199
1211
  });
1200
1212
  }
1201
- async _uploadMediaViaDataChannel(e, t, n) {
1202
- const a = await this._uploadBytesViaDataChannel(e, t, n, "media");
1213
+ async _uploadMediaViaDataChannel(e, t, i) {
1214
+ const a = await this._uploadBytesViaDataChannel(e, t, i, "media");
1203
1215
  return { media_id: a.media_id, url: a.url };
1204
1216
  }
1205
1217
  /** HTTP fallback — original uploadMedia behavior (unchanged). */
1206
- async _uploadMediaViaHTTP(e, t = "general", n = "") {
1207
- const { media_id: a, url: r, contentType: o } = await this._postMediaUpload(e, t, !0);
1218
+ async _uploadMediaViaHTTP(e, t = "general", i = "") {
1219
+ const { media_id: a, url: r, contentType: c } = await this._postMediaUpload(e, t, !0);
1208
1220
  return this.sendMediaUpdate({
1209
1221
  media_id: a,
1210
1222
  media_url: r,
1211
- content_type: o,
1223
+ content_type: c,
1212
1224
  reason: t,
1213
- message: n
1225
+ message: i
1214
1226
  }), { media_id: a, url: r };
1215
1227
  }
1216
- async _postMediaUpload(e, t, n = !1) {
1228
+ async _postMediaUpload(e, t, i = !1) {
1217
1229
  if (!this.serverUrl)
1218
1230
  throw new Error("Upload failed: serverUrl is not set. Connect the VaniraClient first.");
1219
1231
  if (!this.callId)
@@ -1223,24 +1235,24 @@ const y = class y {
1223
1235
  throw new Error(
1224
1236
  "Upload failed: worker_url is not set. Connect the call before uploading media."
1225
1237
  );
1226
- const r = `${a}/media/upload`, o = new FormData();
1227
- o.append("file", e), o.append("call_id", this.callId), o.append("reason", t);
1238
+ const r = `${a}/media/upload`, c = new FormData();
1239
+ c.append("file", e), c.append("call_id", this.callId), c.append("reason", t);
1228
1240
  const h = await fetch(r, {
1229
1241
  method: "POST",
1230
- body: o
1242
+ body: c
1231
1243
  });
1232
1244
  if (!h.ok) {
1233
- let _ = `HTTP ${h.status}`;
1245
+ let p = `HTTP ${h.status}`;
1234
1246
  try {
1235
- _ = (await h.json()).error || _;
1247
+ p = (await h.json()).error || p;
1236
1248
  } catch {
1237
1249
  }
1238
- throw new Error(`Upload failed: ${_}`);
1250
+ throw new Error(`Upload failed: ${p}`);
1239
1251
  }
1240
- const s = await h.json(), u = s.media_id, p = s.url, d = s.content_type || e.type;
1241
- if (!u || !p)
1252
+ const _ = await h.json(), s = _.media_id, u = _.url, l = _.content_type || e.type;
1253
+ if (!s || !u)
1242
1254
  throw new Error("Upload failed: server response missing media_id or url");
1243
- return n ? { media_id: u, url: p, contentType: d } : { media_id: u, url: p, contentType: d };
1255
+ return i ? { media_id: s, url: u, contentType: l } : { media_id: s, url: u, contentType: l };
1244
1256
  }
1245
1257
  // ─── Event emitter (replaces retired VaniraAI) ───────────────────────────
1246
1258
  get status() {
@@ -1253,12 +1265,12 @@ const y = class y {
1253
1265
  return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), this;
1254
1266
  }
1255
1267
  off(e, t) {
1256
- var n;
1257
- return (n = this.listeners.get(e)) == null || n.delete(t), this;
1268
+ var i;
1269
+ return (i = this.listeners.get(e)) == null || i.delete(t), this;
1258
1270
  }
1259
1271
  emit(e, t) {
1260
- var n;
1261
- (n = this.listeners.get(e)) == null || n.forEach((a) => a(t));
1272
+ var i;
1273
+ (i = this.listeners.get(e)) == null || i.forEach((a) => a(t));
1262
1274
  }
1263
1275
  /** Alias for connect() — VaniraAI compatibility */
1264
1276
  async start() {
@@ -1288,9 +1300,9 @@ const y = class y {
1288
1300
  }
1289
1301
  };
1290
1302
  /** Dedupes concurrent POST /calls/create (e.g. React StrictMode double-mount). */
1291
- l(y, "inflightCreates", /* @__PURE__ */ new Map());
1303
+ d(y, "inflightCreates", /* @__PURE__ */ new Map());
1292
1304
  let A = y;
1293
- const Te = {
1305
+ const be = {
1294
1306
  supportsAudioEndedEvent: !1,
1295
1307
  supportsScreenShare: !1,
1296
1308
  supportsDom: !1,
@@ -1298,28 +1310,28 @@ const Te = {
1298
1310
  supportsCustomElements: !1,
1299
1311
  supportsLocalStorage: !1,
1300
1312
  supportsBroadcastChannel: !1
1301
- }, be = {
1313
+ }, xe = {
1302
1314
  name: "react-native",
1303
1315
  callType: "web",
1304
1316
  runtimeName: "react-native",
1305
1317
  callIdPrefix: "rn_",
1306
- capabilities: Te,
1318
+ capabilities: be,
1307
1319
  audio: new Q(),
1308
1320
  media: new F(),
1309
1321
  peer: new ee(),
1310
1322
  dataChannel: new te()
1311
1323
  };
1312
- function Y(i) {
1324
+ function Y(n) {
1313
1325
  return new A({
1314
- ...i,
1315
- runtime: be
1326
+ ...n,
1327
+ runtime: xe
1316
1328
  });
1317
1329
  }
1318
- const ke = Y;
1319
- function xe(i) {
1320
- return Y(i);
1330
+ const Re = Y;
1331
+ function Ee(n) {
1332
+ return Y(n);
1321
1333
  }
1322
- const Re = xe;
1334
+ const Pe = Ee;
1323
1335
  export {
1324
1336
  Q as RNAudioAdapter,
1325
1337
  te as RNDataChannelAdapter,
@@ -1328,10 +1340,10 @@ export {
1328
1340
  A as VaniraAI,
1329
1341
  A as VaniraClient,
1330
1342
  A as WebRTCClient,
1331
- ke as createReactNativeAI,
1343
+ Re as createReactNativeAI,
1332
1344
  Y as createReactNativeClient,
1333
- Re as createVaniraAI,
1334
- xe as createVaniraClient,
1335
- Te as reactNativeCapabilities,
1336
- be as reactNativeRuntime
1345
+ Pe as createVaniraAI,
1346
+ Ee as createVaniraClient,
1347
+ be as reactNativeCapabilities,
1348
+ xe as reactNativeRuntime
1337
1349
  };