@elevenlabs/convai-widget-core 0.12.3 → 0.12.4
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.
- package/dist/index.js +148 -157
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var ae = Object.create, oe = Object.defineProperty, se = Object.getOwnPropertyDe
|
|
|
25
25
|
}, me = (e, t, n) => (n = e == null ? {} : ae(le(e)), pe(t || !e || !e.__esModule ? oe(n, "default", {
|
|
26
26
|
value: e,
|
|
27
27
|
enumerable: !0
|
|
28
|
-
}) : n, e)), he = "0.12.
|
|
28
|
+
}) : n, e)), he = "0.12.4";
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/types/attributes.ts
|
|
31
31
|
function ge(e) {
|
|
@@ -1256,7 +1256,7 @@ function vt(e) {
|
|
|
1256
1256
|
} catch {}
|
|
1257
1257
|
}
|
|
1258
1258
|
function yt({ children: e }) {
|
|
1259
|
-
let t =
|
|
1259
|
+
let t = sa(), n = j("language"), r = j("override-language"), i = y(() => (t.value.supported_language_overrides ?? []).filter(ft)), a = n.peek(), o = t.peek(), s = (o.supported_language_overrides ?? []).filter(ft), c = b(_t({
|
|
1260
1260
|
languageAttribute: a && ft(a) ? a : void 0,
|
|
1261
1261
|
supported: s,
|
|
1262
1262
|
defaultLanguage: o.language
|
|
@@ -1302,7 +1302,7 @@ function St({ children: e }) {
|
|
|
1302
1302
|
} catch (e) {
|
|
1303
1303
|
console.error(`[ConversationalAI] Cannot parse dynamic-variables: ${e?.message}`);
|
|
1304
1304
|
}
|
|
1305
|
-
}), m = j("worklet-path-raw-audio-processor"), h = j("worklet-path-audio-concat-processor"), g = j("worklet-path-libsamplerate"), { webSocketUrl: _ } = ut(), v = j("agent-id"), b = j("signed-url"), x = j("environment"), S =
|
|
1305
|
+
}), m = j("worklet-path-raw-audio-processor"), h = j("worklet-path-audio-concat-processor"), g = j("worklet-path-libsamplerate"), { webSocketUrl: _ } = ut(), v = j("agent-id"), b = j("signed-url"), x = j("environment"), S = ca(), w = ha(), T = y(() => {
|
|
1306
1306
|
let e = w.value, t = {
|
|
1307
1307
|
dynamicVariables: p.value,
|
|
1308
1308
|
overrides: d.value,
|
|
@@ -2954,7 +2954,7 @@ var Wi = {
|
|
|
2954
2954
|
componentsToDebugString: Li
|
|
2955
2955
|
}, Gi = a(null);
|
|
2956
2956
|
function Ki({ children: e }) {
|
|
2957
|
-
let t =
|
|
2957
|
+
let t = ma(), n = b(!1), r = b(!1), i = m(() => {
|
|
2958
2958
|
let e = _(() => !t.value.terms_html || r.value), i = [];
|
|
2959
2959
|
return {
|
|
2960
2960
|
termsShown: n,
|
|
@@ -3015,8 +3015,17 @@ function Zi(e) {
|
|
|
3015
3015
|
//#endregion
|
|
3016
3016
|
//#region src/contexts/conversation.tsx
|
|
3017
3017
|
var Qi = a(null);
|
|
3018
|
-
function $i(
|
|
3019
|
-
|
|
3018
|
+
function $i(e, t) {
|
|
3019
|
+
if (t.role !== "user" || t.eventId == null) return [...e, t];
|
|
3020
|
+
let n = e.findIndex((e) => e.type === "message" && e.role === "agent" && e.eventId === t.eventId && e.conversationIndex === t.conversationIndex);
|
|
3021
|
+
return n === -1 ? [...e, t] : [
|
|
3022
|
+
...e.slice(0, n),
|
|
3023
|
+
t,
|
|
3024
|
+
...e.slice(n)
|
|
3025
|
+
];
|
|
3026
|
+
}
|
|
3027
|
+
function ea({ children: e }) {
|
|
3028
|
+
let t = na();
|
|
3020
3029
|
return x(() => {
|
|
3021
3030
|
if (t.conversationTextOnly.value === !0) {
|
|
3022
3031
|
t.transcript.value;
|
|
@@ -3032,11 +3041,11 @@ function $i({ children: e }) {
|
|
|
3032
3041
|
children: e
|
|
3033
3042
|
});
|
|
3034
3043
|
}
|
|
3035
|
-
function
|
|
3044
|
+
function ta() {
|
|
3036
3045
|
return it(Qi);
|
|
3037
3046
|
}
|
|
3038
|
-
function
|
|
3039
|
-
let e = h(null), t = h(null), n = h(!1), r = h(null), i = h(!1), a = Xi(), o =
|
|
3047
|
+
function na() {
|
|
3048
|
+
let e = h(null), t = h(null), n = h(!1), r = h(null), i = h(!1), a = Xi(), o = sa(), s = ua(), c = qi(), l = Ct();
|
|
3040
3049
|
return d(() => () => {
|
|
3041
3050
|
e.current?.endSession();
|
|
3042
3051
|
}, []), m(() => {
|
|
@@ -3056,9 +3065,9 @@ function ta() {
|
|
|
3056
3065
|
if (await c.requestTerms(), e.current?.isOpen()) return e.current.getId();
|
|
3057
3066
|
if (t.current) return (await t.current).getId();
|
|
3058
3067
|
let _ = structuredClone(l.peek());
|
|
3059
|
-
_.userId ||= await
|
|
3068
|
+
_.userId ||= await ra(), p && o.value.supports_text_only && (_.textOnly = !0, o.value.text_only || (_.overrides ??= {}, _.overrides.conversation ??= {}, _.overrides.conversation.textOnly = !0));
|
|
3060
3069
|
try {
|
|
3061
|
-
_ =
|
|
3070
|
+
_ = ia(a.value ?? d, _);
|
|
3062
3071
|
} catch (e) {
|
|
3063
3072
|
console.error("[ConversationalAI] Error triggering call event:", e);
|
|
3064
3073
|
}
|
|
@@ -3102,17 +3111,17 @@ function ta() {
|
|
|
3102
3111
|
i.current = !1;
|
|
3103
3112
|
return;
|
|
3104
3113
|
}
|
|
3105
|
-
y.value =
|
|
3114
|
+
y.value = $i(y.peek(), {
|
|
3106
3115
|
type: "message",
|
|
3107
3116
|
role: e,
|
|
3108
3117
|
message: t,
|
|
3109
3118
|
isText: !1,
|
|
3110
3119
|
conversationIndex: b.peek(),
|
|
3111
3120
|
eventId: a
|
|
3112
|
-
}
|
|
3121
|
+
});
|
|
3113
3122
|
},
|
|
3114
3123
|
onAgentChatResponsePart: ({ text: e, type: t, event_id: a }) => {
|
|
3115
|
-
if (
|
|
3124
|
+
if (x.peek() === !0 && !(s.peek() && !n.current)) if (t === "start") {
|
|
3116
3125
|
i.current = !0;
|
|
3117
3126
|
let e = y.peek();
|
|
3118
3127
|
r.current = e.length, y.value = [...e, {
|
|
@@ -3237,7 +3246,7 @@ function ta() {
|
|
|
3237
3246
|
};
|
|
3238
3247
|
}, [l]);
|
|
3239
3248
|
}
|
|
3240
|
-
async function
|
|
3249
|
+
async function ra() {
|
|
3241
3250
|
let e = "elevenlabs_convai_user_id", t = localStorage.getItem(e);
|
|
3242
3251
|
if (!t) {
|
|
3243
3252
|
try {
|
|
@@ -3249,7 +3258,7 @@ async function na() {
|
|
|
3249
3258
|
}
|
|
3250
3259
|
return t;
|
|
3251
3260
|
}
|
|
3252
|
-
function
|
|
3261
|
+
function ia(e, t) {
|
|
3253
3262
|
try {
|
|
3254
3263
|
let n = new CustomEvent("elevenlabs-convai:call", {
|
|
3255
3264
|
bubbles: !0,
|
|
@@ -3263,8 +3272,8 @@ function ra(e, t) {
|
|
|
3263
3272
|
}
|
|
3264
3273
|
//#endregion
|
|
3265
3274
|
//#region src/contexts/widget-config.tsx
|
|
3266
|
-
var
|
|
3267
|
-
function
|
|
3275
|
+
var aa = a(null);
|
|
3276
|
+
function oa({ children: e }) {
|
|
3268
3277
|
let { serverUrl: t } = ut(), n = j("agent-id"), r = j("override-config"), i = j("signed-url"), a = b(null);
|
|
3269
3278
|
x(() => {
|
|
3270
3279
|
if (r.value) try {
|
|
@@ -3286,7 +3295,7 @@ function aa({ children: e }) {
|
|
|
3286
3295
|
return;
|
|
3287
3296
|
}
|
|
3288
3297
|
let s = new AbortController();
|
|
3289
|
-
return
|
|
3298
|
+
return ba(e, t.value, s.signal, o).then((e) => {
|
|
3290
3299
|
s.signal.aborted || (a.value = e);
|
|
3291
3300
|
}).catch((e) => {
|
|
3292
3301
|
console.error(`[ConversationalAI] Cannot fetch config for agent ${n.value}: ${e?.message}`), s.signal.aborted || (a.value = null);
|
|
@@ -3314,40 +3323,40 @@ function aa({ children: e }) {
|
|
|
3314
3323
|
show_conversation_id: D
|
|
3315
3324
|
};
|
|
3316
3325
|
});
|
|
3317
|
-
return w.value ? /* @__PURE__ */ C(
|
|
3326
|
+
return w.value ? /* @__PURE__ */ C(aa.Provider, {
|
|
3318
3327
|
value: w,
|
|
3319
3328
|
children: e
|
|
3320
3329
|
}) : null;
|
|
3321
3330
|
}
|
|
3322
|
-
function oa() {
|
|
3323
|
-
return it(ia);
|
|
3324
|
-
}
|
|
3325
3331
|
function sa() {
|
|
3326
|
-
|
|
3327
|
-
return y(() => ge(e.value) ?? t.value.text_only ?? !1);
|
|
3332
|
+
return it(aa);
|
|
3328
3333
|
}
|
|
3329
3334
|
function ca() {
|
|
3330
|
-
let e =
|
|
3331
|
-
return y(() =>
|
|
3335
|
+
let e = j("override-text-only"), t = sa();
|
|
3336
|
+
return y(() => ge(e.value) ?? t.value.text_only ?? !1);
|
|
3332
3337
|
}
|
|
3333
3338
|
function la() {
|
|
3334
|
-
let e =
|
|
3335
|
-
return y(() =>
|
|
3339
|
+
let e = ca(), { conversationTextOnly: t } = ta();
|
|
3340
|
+
return y(() => t.value ?? e.value);
|
|
3336
3341
|
}
|
|
3337
3342
|
function ua() {
|
|
3338
|
-
let e =
|
|
3339
|
-
return y(() => e.value.
|
|
3343
|
+
let e = j("override-first-message"), t = sa(), { language: n } = bt();
|
|
3344
|
+
return y(() => e.value ?? t.value.language_presets?.[n.value.languageCode]?.first_message ?? t.value.first_message ?? null);
|
|
3340
3345
|
}
|
|
3341
3346
|
function da() {
|
|
3342
|
-
let e =
|
|
3343
|
-
return y(() => e.value.
|
|
3347
|
+
let e = sa();
|
|
3348
|
+
return y(() => e.value.text_input_enabled ?? !1);
|
|
3344
3349
|
}
|
|
3345
3350
|
function fa() {
|
|
3346
|
-
let e =
|
|
3347
|
-
return y(() => e.value.file_input_config?.
|
|
3351
|
+
let e = sa();
|
|
3352
|
+
return y(() => e.value.file_input_config?.enabled ?? !1);
|
|
3348
3353
|
}
|
|
3349
3354
|
function pa() {
|
|
3350
|
-
let e =
|
|
3355
|
+
let e = sa();
|
|
3356
|
+
return y(() => e.value.file_input_config?.max_files_per_conversation ?? null);
|
|
3357
|
+
}
|
|
3358
|
+
function ma() {
|
|
3359
|
+
let e = sa(), { language: t } = bt();
|
|
3351
3360
|
return y(() => {
|
|
3352
3361
|
let n = e.value.language_presets?.[t.value.languageCode];
|
|
3353
3362
|
return {
|
|
@@ -3357,16 +3366,16 @@ function pa() {
|
|
|
3357
3366
|
};
|
|
3358
3367
|
});
|
|
3359
3368
|
}
|
|
3360
|
-
function
|
|
3361
|
-
let e =
|
|
3369
|
+
function ha() {
|
|
3370
|
+
let e = sa();
|
|
3362
3371
|
return y(() => e.value.use_rtc ?? !1);
|
|
3363
3372
|
}
|
|
3364
|
-
function
|
|
3365
|
-
let e =
|
|
3373
|
+
function ga() {
|
|
3374
|
+
let e = sa();
|
|
3366
3375
|
return y(() => e.value.end_feedback?.type ?? null);
|
|
3367
3376
|
}
|
|
3368
|
-
function
|
|
3369
|
-
let e = j("markdown-link-allowed-hosts"), t = j("markdown-link-include-www"), n = j("markdown-link-allow-http"), r =
|
|
3377
|
+
function _a() {
|
|
3378
|
+
let e = j("markdown-link-allowed-hosts"), t = j("markdown-link-include-www"), n = j("markdown-link-allow-http"), r = sa();
|
|
3370
3379
|
return y(() => {
|
|
3371
3380
|
let i = [];
|
|
3372
3381
|
if (e.value) i = e.value.split(",").map((e) => e.trim()).filter(Boolean);
|
|
@@ -3382,8 +3391,8 @@ function ga() {
|
|
|
3382
3391
|
};
|
|
3383
3392
|
});
|
|
3384
3393
|
}
|
|
3385
|
-
function
|
|
3386
|
-
let e = j("syntax-highlight-theme"), t =
|
|
3394
|
+
function va() {
|
|
3395
|
+
let e = j("syntax-highlight-theme"), t = sa();
|
|
3387
3396
|
return y(() => {
|
|
3388
3397
|
let n = e.value ?? t.value.syntax_highlight_theme;
|
|
3389
3398
|
if (n === "light" || n === "dark") return n;
|
|
@@ -3391,35 +3400,35 @@ function _a() {
|
|
|
3391
3400
|
return r.isValid && r.isDark() ? "dark" : "light";
|
|
3392
3401
|
});
|
|
3393
3402
|
}
|
|
3394
|
-
function
|
|
3403
|
+
function ya() {
|
|
3395
3404
|
let e = j("allow-events");
|
|
3396
3405
|
return y(() => ge(e.value) ?? !1);
|
|
3397
3406
|
}
|
|
3398
|
-
async function
|
|
3407
|
+
async function ba(e, t, n, r) {
|
|
3399
3408
|
let i = await (await fetch(`${t}/v1/convai/agents/${e}/widget${r ? `?conversation_signature=${encodeURIComponent(r)}` : ""}`, { signal: n })).json();
|
|
3400
3409
|
if (!i.widget_config) throw Error("Response does not contain widget_config");
|
|
3401
3410
|
return i.widget_config;
|
|
3402
3411
|
}
|
|
3403
3412
|
//#endregion
|
|
3404
3413
|
//#region src/styles/Style.tsx
|
|
3405
|
-
var
|
|
3406
|
-
let e =
|
|
3414
|
+
var xa = c(function() {
|
|
3415
|
+
let e = sa();
|
|
3407
3416
|
return /* @__PURE__ */ w("style", { children: [y(() => {
|
|
3408
3417
|
let t = e.value.styles;
|
|
3409
|
-
return `:host, :root {\n${nt.map((e) => `${
|
|
3418
|
+
return `:host, :root {\n${nt.map((e) => `${Sa(e)}: ${Ca(t?.[e] ?? tt[e])};`).join("\n")}\n}`;
|
|
3410
3419
|
}), ve] });
|
|
3411
3420
|
});
|
|
3412
|
-
function
|
|
3421
|
+
function Sa(e) {
|
|
3413
3422
|
return `--el-${e.replace(/_/g, "-")}`;
|
|
3414
3423
|
}
|
|
3415
|
-
function
|
|
3424
|
+
function Ca(e) {
|
|
3416
3425
|
return typeof e == "number" ? `${e}px` : e;
|
|
3417
3426
|
}
|
|
3418
3427
|
//#endregion
|
|
3419
3428
|
//#region src/contexts/conversation-mode.tsx
|
|
3420
|
-
var
|
|
3421
|
-
function
|
|
3422
|
-
let t = b("voice"), { isDisconnected: n, addModeToggleEntry: r, setVolume: i } =
|
|
3429
|
+
var wa = a(null);
|
|
3430
|
+
function Ta({ children: e }) {
|
|
3431
|
+
let t = b("voice"), { isDisconnected: n, addModeToggleEntry: r, setVolume: i } = ta();
|
|
3423
3432
|
x(() => {
|
|
3424
3433
|
i(t.value === "text" ? 0 : 1);
|
|
3425
3434
|
});
|
|
@@ -3431,19 +3440,19 @@ function wa({ children: e }) {
|
|
|
3431
3440
|
isTextMode: _(() => t.value === "text"),
|
|
3432
3441
|
isVoiceMode: _(() => t.value === "voice")
|
|
3433
3442
|
}), [n, r]);
|
|
3434
|
-
return /* @__PURE__ */ C(
|
|
3443
|
+
return /* @__PURE__ */ C(wa.Provider, {
|
|
3435
3444
|
value: a,
|
|
3436
3445
|
children: e
|
|
3437
3446
|
});
|
|
3438
3447
|
}
|
|
3439
|
-
function
|
|
3440
|
-
return it(
|
|
3448
|
+
function Ea() {
|
|
3449
|
+
return it(wa);
|
|
3441
3450
|
}
|
|
3442
3451
|
//#endregion
|
|
3443
3452
|
//#region src/contexts/audio-config.tsx
|
|
3444
|
-
var
|
|
3445
|
-
function
|
|
3446
|
-
let t =
|
|
3453
|
+
var Da = a(null);
|
|
3454
|
+
function Oa({ children: e }) {
|
|
3455
|
+
let t = sa(), { isTextMode: n } = Ea(), { setMicMuted: r, status: i } = ta(), a = y(() => t.value.mic_muting_enabled ?? !1), o = b(!1), s = h(null);
|
|
3447
3456
|
x(() => {
|
|
3448
3457
|
i.value === "disconnected" && (o.value = !1);
|
|
3449
3458
|
}), x(() => {
|
|
@@ -3456,19 +3465,19 @@ function Da({ children: e }) {
|
|
|
3456
3465
|
},
|
|
3457
3466
|
isMutingEnabled: a
|
|
3458
3467
|
}), []);
|
|
3459
|
-
return /* @__PURE__ */ C(
|
|
3468
|
+
return /* @__PURE__ */ C(Da.Provider, {
|
|
3460
3469
|
value: c,
|
|
3461
3470
|
children: e
|
|
3462
3471
|
});
|
|
3463
3472
|
}
|
|
3464
|
-
function
|
|
3465
|
-
return it(
|
|
3473
|
+
function ka() {
|
|
3474
|
+
return it(Da);
|
|
3466
3475
|
}
|
|
3467
3476
|
//#endregion
|
|
3468
3477
|
//#region src/contexts/text-contents.tsx
|
|
3469
|
-
var
|
|
3470
|
-
function
|
|
3471
|
-
let t =
|
|
3478
|
+
var Aa = a(null);
|
|
3479
|
+
function ja({ children: e }) {
|
|
3480
|
+
let t = sa(), { language: n } = bt(), r = j("text-contents"), i = y(() => {
|
|
3472
3481
|
try {
|
|
3473
3482
|
if (r.value) {
|
|
3474
3483
|
let e = JSON.parse(r.value);
|
|
@@ -3479,19 +3488,19 @@ function Aa({ children: e }) {
|
|
|
3479
3488
|
}
|
|
3480
3489
|
return {};
|
|
3481
3490
|
}), a = m(() => Object.fromEntries(et.map((e) => [e, _(() => i.value[e] ?? t.value.language_presets?.[n.value.languageCode]?.text_contents?.[e] ?? t.value.text_contents?.[e] ?? $e[e])])), []);
|
|
3482
|
-
return /* @__PURE__ */ C(
|
|
3491
|
+
return /* @__PURE__ */ C(Aa.Provider, {
|
|
3483
3492
|
value: a,
|
|
3484
3493
|
children: e
|
|
3485
3494
|
});
|
|
3486
3495
|
}
|
|
3487
|
-
function
|
|
3488
|
-
return it(
|
|
3496
|
+
function Ma() {
|
|
3497
|
+
return it(Aa);
|
|
3489
3498
|
}
|
|
3490
3499
|
//#endregion
|
|
3491
3500
|
//#region src/contexts/avatar-config.tsx
|
|
3492
|
-
var
|
|
3493
|
-
function
|
|
3494
|
-
let t =
|
|
3501
|
+
var Na = a(null);
|
|
3502
|
+
function Pa({ children: e }) {
|
|
3503
|
+
let t = sa(), n = j("avatar-image-url"), r = j("avatar-orb-color-1"), i = j("avatar-orb-color-2"), a = b(""), o = y(() => n.value ? {
|
|
3495
3504
|
type: "image",
|
|
3496
3505
|
url: n.value
|
|
3497
3506
|
} : r.value && i.value ? {
|
|
@@ -3509,44 +3518,38 @@ function Na({ children: e }) {
|
|
|
3509
3518
|
previewUrl: s,
|
|
3510
3519
|
canvasUrl: a
|
|
3511
3520
|
}), []);
|
|
3512
|
-
return /* @__PURE__ */ C(
|
|
3521
|
+
return /* @__PURE__ */ C(Na.Provider, {
|
|
3513
3522
|
value: c,
|
|
3514
3523
|
children: e
|
|
3515
3524
|
});
|
|
3516
3525
|
}
|
|
3517
|
-
function
|
|
3518
|
-
return it(
|
|
3526
|
+
function Fa() {
|
|
3527
|
+
return it(Na);
|
|
3519
3528
|
}
|
|
3520
3529
|
//#endregion
|
|
3521
3530
|
//#region src/contexts/root-portal.tsx
|
|
3522
|
-
var
|
|
3523
|
-
function
|
|
3531
|
+
var Ia = a(null);
|
|
3532
|
+
function La({ children: e, ...t }) {
|
|
3524
3533
|
let [n, r] = g(null);
|
|
3525
3534
|
return /* @__PURE__ */ C("div", {
|
|
3526
3535
|
ref: r,
|
|
3527
3536
|
...t,
|
|
3528
|
-
children: n && /* @__PURE__ */ C(
|
|
3537
|
+
children: n && /* @__PURE__ */ C(Ia.Provider, {
|
|
3529
3538
|
value: n,
|
|
3530
3539
|
children: e
|
|
3531
3540
|
})
|
|
3532
3541
|
});
|
|
3533
3542
|
}
|
|
3534
|
-
function
|
|
3535
|
-
return it(
|
|
3543
|
+
function Ra() {
|
|
3544
|
+
return it(Ia);
|
|
3536
3545
|
}
|
|
3537
3546
|
//#endregion
|
|
3538
3547
|
//#region src/utils/display-transcript.ts
|
|
3539
|
-
var
|
|
3548
|
+
var za = {
|
|
3540
3549
|
LOADING: "loading",
|
|
3541
3550
|
SUCCESS: "success",
|
|
3542
3551
|
ERROR: "error"
|
|
3543
3552
|
};
|
|
3544
|
-
function za(e, t) {
|
|
3545
|
-
let n = e.entry.eventId, r = t.entry.eventId;
|
|
3546
|
-
if (n !== r) return n - r;
|
|
3547
|
-
let i = (e) => e === "user" ? 0 : 1, a = i(e.entry.role) - i(t.entry.role);
|
|
3548
|
-
return a === 0 ? e.originalIndex - t.originalIndex : a;
|
|
3549
|
-
}
|
|
3550
3553
|
function Ba(e, t) {
|
|
3551
3554
|
let n = [];
|
|
3552
3555
|
t.firstMessage && n.push({
|
|
@@ -3577,30 +3580,18 @@ function Ba(e, t) {
|
|
|
3577
3580
|
}
|
|
3578
3581
|
n.push(i);
|
|
3579
3582
|
}
|
|
3580
|
-
let
|
|
3581
|
-
for (let e = 0; e < n.length; e++) {
|
|
3583
|
+
if (t.showAgentStatus) for (let e = 0; e < n.length; e++) {
|
|
3582
3584
|
let t = n[e];
|
|
3583
|
-
t.type === "message" && t.eventId != null && i.push({
|
|
3584
|
-
entry: t,
|
|
3585
|
-
originalIndex: e
|
|
3586
|
-
});
|
|
3587
|
-
}
|
|
3588
|
-
let a = i.map((e) => e.originalIndex).sort((e, t) => e - t);
|
|
3589
|
-
i.sort(za);
|
|
3590
|
-
let o = [...n];
|
|
3591
|
-
for (let e = 0; e < i.length; e++) o[a[e]] = i[e].entry;
|
|
3592
|
-
if (t.showAgentStatus) for (let e = 0; e < o.length; e++) {
|
|
3593
|
-
let t = o[e];
|
|
3594
3585
|
if (t.type !== "message" || t.role !== "agent" || t.eventId == null) continue;
|
|
3595
|
-
let
|
|
3596
|
-
if (!
|
|
3597
|
-
let
|
|
3598
|
-
|
|
3586
|
+
let i = r.get(t.eventId);
|
|
3587
|
+
if (!i) continue;
|
|
3588
|
+
let a = i.loading > 0 ? za.LOADING : i.error > 0 ? za.ERROR : za.SUCCESS;
|
|
3589
|
+
n[e] = {
|
|
3599
3590
|
...t,
|
|
3600
|
-
toolStatus:
|
|
3591
|
+
toolStatus: a
|
|
3601
3592
|
};
|
|
3602
3593
|
}
|
|
3603
|
-
return
|
|
3594
|
+
return n;
|
|
3604
3595
|
}
|
|
3605
3596
|
//#endregion
|
|
3606
3597
|
//#region src/utils/signalish.ts
|
|
@@ -5391,7 +5382,7 @@ var mo = (e, t) => {
|
|
|
5391
5382
|
};
|
|
5392
5383
|
}), F = (...e) => Ms(po(e)), Ns = a(null);
|
|
5393
5384
|
function Ps({ children: e }) {
|
|
5394
|
-
let t = b(null), n = b(""), r = b("initial"), { lastId: i } =
|
|
5385
|
+
let t = b(null), n = b(""), r = b("initial"), { lastId: i } = ta();
|
|
5395
5386
|
j("agent-id");
|
|
5396
5387
|
let { serverUrl: a } = ut(), o = l(async (e) => {
|
|
5397
5388
|
let n = i.value;
|
|
@@ -6092,7 +6083,7 @@ function _c({ rating: e, min: t = 1, max: n = 5, icon: r = "star" }) {
|
|
|
6092
6083
|
//#endregion
|
|
6093
6084
|
//#region src/components/Feedback.tsx
|
|
6094
6085
|
function vc({ icon: e, onRate: t }) {
|
|
6095
|
-
let n =
|
|
6086
|
+
let n = Ma();
|
|
6096
6087
|
return /* @__PURE__ */ w("div", {
|
|
6097
6088
|
className: "flex flex-col items-center",
|
|
6098
6089
|
children: [/* @__PURE__ */ C("div", {
|
|
@@ -6109,7 +6100,7 @@ function vc({ icon: e, onRate: t }) {
|
|
|
6109
6100
|
});
|
|
6110
6101
|
}
|
|
6111
6102
|
function yc({ icon: e, rating: t, showFollowUpButton: n, onFollowUpClick: r }) {
|
|
6112
|
-
let i =
|
|
6103
|
+
let i = Ma();
|
|
6113
6104
|
return /* @__PURE__ */ w("div", {
|
|
6114
6105
|
className: "flex flex-col items-center gap-3 mb-4",
|
|
6115
6106
|
children: [
|
|
@@ -22927,7 +22918,7 @@ var fA = Object.assign(lA, {
|
|
|
22927
22918
|
Actions: uA,
|
|
22928
22919
|
Content: dA
|
|
22929
22920
|
}), pA = a(""), mA = ({ code: e, language: t, className: n, ...r }) => {
|
|
22930
|
-
let i = sA[t], { isCopied: a, copyToClipboard: o, disabled: s } = hA({ code: e }), c =
|
|
22921
|
+
let i = sA[t], { isCopied: a, copyToClipboard: o, disabled: s } = hA({ code: e }), c = Ma(), l = b(!1), u = va();
|
|
22931
22922
|
return /* @__PURE__ */ C(pA.Provider, {
|
|
22932
22923
|
value: e,
|
|
22933
22924
|
children: /* @__PURE__ */ w(fA, {
|
|
@@ -23033,7 +23024,7 @@ var vA = ({ node: e, className: t, src: n, alt: r, ...i }) => {
|
|
|
23033
23024
|
let { downloadImage: a, disabled: o } = _A({
|
|
23034
23025
|
src: n?.toString() || "",
|
|
23035
23026
|
alt: r?.toString()
|
|
23036
|
-
}), s =
|
|
23027
|
+
}), s = Ma();
|
|
23037
23028
|
return n ? /* @__PURE__ */ w(fA, {
|
|
23038
23029
|
className: "inline-block self-auto",
|
|
23039
23030
|
"data-streamdown": "image-wrapper",
|
|
@@ -23114,7 +23105,7 @@ function xA({ onCopy: e, onError: t, timeout: n = 2e3 } = {}) {
|
|
|
23114
23105
|
};
|
|
23115
23106
|
}
|
|
23116
23107
|
var SA = ({ children: e, className: t, ...n }) => {
|
|
23117
|
-
let { isCopied: r, copyTableData: i, disabled: a } = xA(), o =
|
|
23108
|
+
let { isCopied: r, copyTableData: i, disabled: a } = xA(), o = Ma();
|
|
23118
23109
|
return /* @__PURE__ */ w(fA, {
|
|
23119
23110
|
"data-streamdown": "table-wrapper",
|
|
23120
23111
|
children: [/* @__PURE__ */ C(fA.Actions, { children: /* @__PURE__ */ C(fc, {
|
|
@@ -27620,7 +27611,7 @@ function eI(e) {
|
|
|
27620
27611
|
//#endregion
|
|
27621
27612
|
//#region src/widget/TranscriptMessage.tsx
|
|
27622
27613
|
function tI({ entry: e }) {
|
|
27623
|
-
let t =
|
|
27614
|
+
let t = _a(), n = sa().value.strip_audio_tags && !e.isText ? Sc(e.message) : e.message;
|
|
27624
27615
|
return /* @__PURE__ */ w("div", {
|
|
27625
27616
|
className: "pr-8",
|
|
27626
27617
|
children: [n && /* @__PURE__ */ C(UF, {
|
|
@@ -27633,7 +27624,7 @@ function tI({ entry: e }) {
|
|
|
27633
27624
|
});
|
|
27634
27625
|
}
|
|
27635
27626
|
function nI({ entry: e }) {
|
|
27636
|
-
let { previewUrl: t } =
|
|
27627
|
+
let { previewUrl: t } = Fa(), n = e.fileInput;
|
|
27637
27628
|
return /* @__PURE__ */ w("div", {
|
|
27638
27629
|
className: po("flex gap-2.5 transition-[opacity,transform] duration-200 data-hidden:opacity-0 data-hidden:scale-75", e.role === "user" ? "justify-end pl-16 origin-top-right" : "pr-16 origin-top-left"),
|
|
27639
27630
|
children: [e.role === "agent" && /* @__PURE__ */ C("img", {
|
|
@@ -27686,7 +27677,7 @@ function iI() {
|
|
|
27686
27677
|
});
|
|
27687
27678
|
}
|
|
27688
27679
|
function aI({ entry: e }) {
|
|
27689
|
-
let t =
|
|
27680
|
+
let t = Ma(), { lastId: n } = ta(), r = ga(), i = sa();
|
|
27690
27681
|
return /* @__PURE__ */ w("div", {
|
|
27691
27682
|
className: "px-8 flex flex-col",
|
|
27692
27683
|
children: [r.value === "rating" && /* @__PURE__ */ C(bc, {}), /* @__PURE__ */ w("div", {
|
|
@@ -27707,7 +27698,7 @@ function aI({ entry: e }) {
|
|
|
27707
27698
|
});
|
|
27708
27699
|
}
|
|
27709
27700
|
function oI({ entry: e }) {
|
|
27710
|
-
let t =
|
|
27701
|
+
let t = Ma(), { lastId: n } = ta();
|
|
27711
27702
|
return /* @__PURE__ */ w("div", {
|
|
27712
27703
|
className: "px-8 text-xs text-base-error text-center transition-opacity duration-200 data-hidden:opacity-0",
|
|
27713
27704
|
children: [
|
|
@@ -27726,20 +27717,20 @@ function oI({ entry: e }) {
|
|
|
27726
27717
|
});
|
|
27727
27718
|
}
|
|
27728
27719
|
function sI({ entry: e }) {
|
|
27729
|
-
let t =
|
|
27720
|
+
let t = Ma();
|
|
27730
27721
|
return /* @__PURE__ */ C("div", {
|
|
27731
27722
|
className: "px-8 text-xs text-base-subtle text-center transition-opacity duration-200 data-hidden:opacity-0",
|
|
27732
27723
|
children: e.mode === "text" ? t.switched_to_text_mode : t.switched_to_voice_mode
|
|
27733
27724
|
});
|
|
27734
27725
|
}
|
|
27735
27726
|
function cI({ status: e }) {
|
|
27736
|
-
let t =
|
|
27727
|
+
let t = Ma();
|
|
27737
27728
|
return /* @__PURE__ */ C("div", {
|
|
27738
27729
|
className: "-my-4 first:mt-0 last:mb-0 flex items-center",
|
|
27739
27730
|
children: /* @__PURE__ */ w("div", {
|
|
27740
27731
|
className: "flex items-center h-7 px-2 gap-1 rounded-button border border-base-border bg-base",
|
|
27741
27732
|
children: [
|
|
27742
|
-
e ===
|
|
27733
|
+
e === za.LOADING && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(Vs, {
|
|
27743
27734
|
name: "loader",
|
|
27744
27735
|
size: "md",
|
|
27745
27736
|
className: "animate-spin shrink-0"
|
|
@@ -27747,7 +27738,7 @@ function cI({ status: e }) {
|
|
|
27747
27738
|
className: "text-xs leading-4",
|
|
27748
27739
|
children: t.agent_working
|
|
27749
27740
|
})] }),
|
|
27750
|
-
e ===
|
|
27741
|
+
e === za.SUCCESS && /* @__PURE__ */ C(co, {
|
|
27751
27742
|
active: !0,
|
|
27752
27743
|
initial: !1,
|
|
27753
27744
|
children: /* @__PURE__ */ w("span", {
|
|
@@ -27762,7 +27753,7 @@ function cI({ status: e }) {
|
|
|
27762
27753
|
})]
|
|
27763
27754
|
})
|
|
27764
27755
|
}),
|
|
27765
|
-
e ===
|
|
27756
|
+
e === za.ERROR && /* @__PURE__ */ C(co, {
|
|
27766
27757
|
active: !0,
|
|
27767
27758
|
initial: !1,
|
|
27768
27759
|
children: /* @__PURE__ */ w("span", {
|
|
@@ -27866,7 +27857,7 @@ function mI({ className: e, ...t }) {
|
|
|
27866
27857
|
//#endregion
|
|
27867
27858
|
//#region src/widget/FeedbackPage.tsx
|
|
27868
27859
|
function hI() {
|
|
27869
|
-
let e =
|
|
27860
|
+
let e = Ma(), { rating: t, feedbackText: n } = Fs(), r = l((e) => {
|
|
27870
27861
|
n.value = e.currentTarget.value;
|
|
27871
27862
|
}, []);
|
|
27872
27863
|
return /* @__PURE__ */ C("div", {
|
|
@@ -27911,7 +27902,7 @@ function hI() {
|
|
|
27911
27902
|
//#endregion
|
|
27912
27903
|
//#region src/widget/FeedbackActions.tsx
|
|
27913
27904
|
function gI() {
|
|
27914
|
-
let e =
|
|
27905
|
+
let e = Ma(), { currentContent: t } = Rs(), { submitFeedback: n } = Fs();
|
|
27915
27906
|
return /* @__PURE__ */ C("div", {
|
|
27916
27907
|
className: "shrink-0 overflow-hidden flex p-3 items-end justify-end",
|
|
27917
27908
|
children: /* @__PURE__ */ C(fc, {
|
|
@@ -31030,7 +31021,7 @@ function iU({ size: e = "md", flagCode: t, className: n, ...r }) {
|
|
|
31030
31021
|
//#endregion
|
|
31031
31022
|
//#region src/widget/LanguageSelect.tsx
|
|
31032
31023
|
function aU({ children: e, ...t }) {
|
|
31033
|
-
let [n, r] = g(!1), { language: i, setLanguage: a, options: o } = bt(), s =
|
|
31024
|
+
let [n, r] = g(!1), { language: i, setLanguage: a, options: o } = bt(), s = Ra();
|
|
31034
31025
|
return /* @__PURE__ */ w(KH, {
|
|
31035
31026
|
open: n,
|
|
31036
31027
|
value: i.value.languageCode,
|
|
@@ -31093,7 +31084,7 @@ function aU({ children: e, ...t }) {
|
|
|
31093
31084
|
//#endregion
|
|
31094
31085
|
//#region src/widget/SheetLanguageSelect.tsx
|
|
31095
31086
|
function oU({ className: e, ...t }) {
|
|
31096
|
-
let n =
|
|
31087
|
+
let n = Ma(), { language: r, showPicker: i } = bt();
|
|
31097
31088
|
return i.value ? /* @__PURE__ */ C(aU, {
|
|
31098
31089
|
align: "center",
|
|
31099
31090
|
children: /* @__PURE__ */ w(qH, {
|
|
@@ -31121,7 +31112,7 @@ function oU({ className: e, ...t }) {
|
|
|
31121
31112
|
//#endregion
|
|
31122
31113
|
//#region src/widget/StatusLabel.tsx
|
|
31123
31114
|
function sU({ className: e, ...t }) {
|
|
31124
|
-
let { status: n, isSpeaking: r } =
|
|
31115
|
+
let { status: n, isSpeaking: r } = ta(), i = la(), { isTextMode: a } = Ea(), o = Ma(), s = y(() => n.value === "connected" ? i.value || a.value ? o.chatting_status.value : r.value ? o.speaking_status.value : o.listening_status.value : o.connecting_status.value), [c, l] = g(s.peek());
|
|
31125
31116
|
return x(() => {
|
|
31126
31117
|
let e = s.value;
|
|
31127
31118
|
if (n.value === "connected" && r.value) l(e);
|
|
@@ -31172,7 +31163,7 @@ function dU() {
|
|
|
31172
31163
|
//#endregion
|
|
31173
31164
|
//#region src/widget/ConversationModeToggleButton.tsx
|
|
31174
31165
|
function fU(e) {
|
|
31175
|
-
let t =
|
|
31166
|
+
let t = Ma(), { mode: n, setMode: r, isTextMode: i } = Ea(), a = l(() => {
|
|
31176
31167
|
r(n.peek() === "text" ? "voice" : "text");
|
|
31177
31168
|
}, [r, n]);
|
|
31178
31169
|
return /* @__PURE__ */ C(fc, {
|
|
@@ -31185,7 +31176,7 @@ function fU(e) {
|
|
|
31185
31176
|
//#endregion
|
|
31186
31177
|
//#region src/widget/SheetHeader.tsx
|
|
31187
31178
|
function pU({ showBackButton: e, onBackClick: t, showStatusLabel: n, showLanguageSelector: r, showConversationModeToggle: i, showExpandButton: a }) {
|
|
31188
|
-
let o =
|
|
31179
|
+
let o = Ma(), { toggleSize: s, variant: c } = dU(), l = y(() => c.value === "compact" ? "Expand widget" : "Collapse widget");
|
|
31189
31180
|
return /* @__PURE__ */ w("div", {
|
|
31190
31181
|
className: "w-full relative shrink-0 z-10",
|
|
31191
31182
|
children: [
|
|
@@ -31248,7 +31239,7 @@ function pU({ showBackButton: e, onBackClick: t, showStatusLabel: n, showLanguag
|
|
|
31248
31239
|
//#endregion
|
|
31249
31240
|
//#region src/widget/CallButton.tsx
|
|
31250
31241
|
function mU({ iconOnly: e, isDisconnected: t, children: n, ...r }) {
|
|
31251
|
-
let { endSession: i, startSession: a } =
|
|
31242
|
+
let { endSession: i, startSession: a } = ta(), o = Ma();
|
|
31252
31243
|
return /* @__PURE__ */ C(fc, {
|
|
31253
31244
|
variant: t ? "primary" : "secondary",
|
|
31254
31245
|
icon: t ? "phone" : "phone-off",
|
|
@@ -31261,7 +31252,7 @@ function mU({ iconOnly: e, isDisconnected: t, children: n, ...r }) {
|
|
|
31261
31252
|
//#endregion
|
|
31262
31253
|
//#region src/widget/TriggerMuteButton.tsx
|
|
31263
31254
|
function hU(e) {
|
|
31264
|
-
let t =
|
|
31255
|
+
let t = Ma(), { isMuted: n, isMutingEnabled: r, setIsMuted: i } = ka(), a = l(() => {
|
|
31265
31256
|
i(!n.peek());
|
|
31266
31257
|
}, [i]);
|
|
31267
31258
|
return r.value ? /* @__PURE__ */ C(fc, {
|
|
@@ -31275,7 +31266,7 @@ function hU(e) {
|
|
|
31275
31266
|
//#endregion
|
|
31276
31267
|
//#region src/widget/UploadFileButton.tsx
|
|
31277
31268
|
function gU({ iconOnly: e, disabled: t, onFileSelect: n, children: r, ...i }) {
|
|
31278
|
-
let a =
|
|
31269
|
+
let a = Ma(), o = h(null), s = l((e) => {
|
|
31279
31270
|
e.stopPropagation(), o.current?.click();
|
|
31280
31271
|
}, []), c = l((e) => {
|
|
31281
31272
|
let t = e.target, r = t.files?.[0];
|
|
@@ -31300,7 +31291,7 @@ function gU({ iconOnly: e, disabled: t, onFileSelect: n, children: r, ...i }) {
|
|
|
31300
31291
|
//#endregion
|
|
31301
31292
|
//#region src/widget/PendingFilePreview.tsx
|
|
31302
31293
|
function _U({ pendingFile: e, onRemove: t }) {
|
|
31303
|
-
let n =
|
|
31294
|
+
let n = Ma(), r = JF(e.file.type), i = e.status === "uploading", a = e.status === "error";
|
|
31304
31295
|
return /* @__PURE__ */ w("div", {
|
|
31305
31296
|
className: F("relative inline-flex items-center gap-2 rounded-input border py-1.5 pl-1.5 pr-7 overflow-hidden", a ? "border-base-error/30 bg-base-error/5" : "border-base-border/60 bg-base-active/40"),
|
|
31306
31297
|
children: [
|
|
@@ -31364,7 +31355,7 @@ function vU() {
|
|
|
31364
31355
|
//#endregion
|
|
31365
31356
|
//#region src/widget/SheetActions.tsx
|
|
31366
31357
|
function yU({ showTranscript: e, scrollPinned: t }) {
|
|
31367
|
-
let n =
|
|
31358
|
+
let n = da(), r = fa(), i = pa(), a = b(""), o = b(!1), s = Ma(), { isDisconnected: c, status: u, lastId: d, startSession: f, sendUserMessage: p, sendMultimodalMessage: m } = ta(), h = b(null);
|
|
31368
31359
|
x(() => {
|
|
31369
31360
|
if (!h.value) return;
|
|
31370
31361
|
let e = setTimeout(() => {
|
|
@@ -31478,7 +31469,7 @@ function yU({ showTranscript: e, scrollPinned: t }) {
|
|
|
31478
31469
|
});
|
|
31479
31470
|
}
|
|
31480
31471
|
function bU({ userMessage: e, isFocused: t, canSend: n, onSendMessage: r }) {
|
|
31481
|
-
let i =
|
|
31472
|
+
let i = Ma(), a = la(), { isDisconnected: o, conversationIndex: s, sendUserActivity: c } = ta(), u = l((t) => {
|
|
31482
31473
|
e.value = t.currentTarget.value;
|
|
31483
31474
|
}, [e]), d = l(async (e) => {
|
|
31484
31475
|
e.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), n.peek() && await r(e));
|
|
@@ -31500,7 +31491,7 @@ function bU({ userMessage: e, isFocused: t, canSend: n, onSendMessage: r }) {
|
|
|
31500
31491
|
});
|
|
31501
31492
|
}
|
|
31502
31493
|
function xU({ canSend: e, onSendMessage: t, showTranscript: n = !1, showUploadButton: r, uploadEnabled: i, onFileSelect: a }) {
|
|
31503
|
-
let o =
|
|
31494
|
+
let o = Ma(), s = la(), c = da(), { isDisconnected: l, status: u } = ta(), { isTextMode: d } = Ea(), f = y(() => !l.value || !s.value && n);
|
|
31504
31495
|
return /* @__PURE__ */ w(S, { children: [
|
|
31505
31496
|
/* @__PURE__ */ C(cc, {
|
|
31506
31497
|
visible: y(() => !s.value && !l.value && !d.value).value,
|
|
@@ -31641,7 +31632,7 @@ var SU = "#version 300 es\nprecision highp float;\n\nuniform float uTime;\nunifo
|
|
|
31641
31632
|
lg: "w-48 h-48"
|
|
31642
31633
|
};
|
|
31643
31634
|
function kU({ size: e = "sm", className: t }) {
|
|
31644
|
-
let { getInputVolume: n, getOutputVolume: r, isSpeaking: i, isDisconnected: a } =
|
|
31635
|
+
let { getInputVolume: n, getOutputVolume: r, isSpeaking: i, isDisconnected: a } = ta(), { config: o } = Fa(), s = h(null), c = h(null);
|
|
31645
31636
|
x(() => {
|
|
31646
31637
|
if (a.value) {
|
|
31647
31638
|
s.current.style.transform = "", c.current.style.transform = "";
|
|
@@ -31674,7 +31665,7 @@ function kU({ size: e = "sm", className: t }) {
|
|
|
31674
31665
|
});
|
|
31675
31666
|
}
|
|
31676
31667
|
function AU({ color1: e, color2: t }) {
|
|
31677
|
-
let { canvasUrl: n } =
|
|
31668
|
+
let { canvasUrl: n } = Fa(), [r, i] = g(null);
|
|
31678
31669
|
return d(() => {
|
|
31679
31670
|
r && (r.updateColors(e, t), r.render(), n.value = r.toDataURL());
|
|
31680
31671
|
}, [
|
|
@@ -31694,7 +31685,7 @@ function AU({ color1: e, color2: t }) {
|
|
|
31694
31685
|
//#endregion
|
|
31695
31686
|
//#region src/widget/AvatarOverlay.tsx
|
|
31696
31687
|
function jU({ showAvatar: e, showTranscript: t, isDisconnected: n, onStartSession: r }) {
|
|
31697
|
-
let i =
|
|
31688
|
+
let i = Ma(), a = da(), o = ca(), s = y(() => F("absolute origin-top-left transition-[transform,left,top,opacity,scale] duration-200 z-10", "data-hidden:opacity-0", t.value ? "top-4 left-4 scale-[0.1667]" : a.value ? "top-[40%] left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100" : "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100")), c = y(() => !t.value && n.value && !o.value), l = y(() => !t.value && !n.value);
|
|
31698
31689
|
return /* @__PURE__ */ C(co, {
|
|
31699
31690
|
active: e,
|
|
31700
31691
|
children: /* @__PURE__ */ w("div", {
|
|
@@ -31735,7 +31726,7 @@ var MU = {
|
|
|
31735
31726
|
bottom: "origin-bottom"
|
|
31736
31727
|
};
|
|
31737
31728
|
function NU({ open: e }) {
|
|
31738
|
-
let t =
|
|
31729
|
+
let t = ca(), n = la(), r = sa(), i = r.value.placement, { isDisconnected: a, startSession: o, transcript: s, conversationIndex: c } = ta(), l = ua(), { currentContent: u, currentConfig: d } = Rs(), { variant: f } = dU(), p = y(() => {
|
|
31739
31730
|
let e = t.value || n.value;
|
|
31740
31731
|
return Ba(s.value, {
|
|
31741
31732
|
showAgentStatus: r.value.show_agent_status ?? !1,
|
|
@@ -31806,7 +31797,7 @@ function PU({ onDismiss: e, className: t, ...n }) {
|
|
|
31806
31797
|
//#endregion
|
|
31807
31798
|
//#region src/widget/ExpandableTriggerActions.tsx
|
|
31808
31799
|
function FU({ expanded: e, onDismiss: t }) {
|
|
31809
|
-
let n =
|
|
31800
|
+
let n = la(), r = sa().value.variant, { isDisconnected: i } = ta(), a = Ma(), o = l(() => {
|
|
31810
31801
|
e.value = !e.value;
|
|
31811
31802
|
}, [e]);
|
|
31812
31803
|
return /* @__PURE__ */ w(S, { children: [
|
|
@@ -31853,7 +31844,7 @@ function FU({ expanded: e, onDismiss: t }) {
|
|
|
31853
31844
|
//#endregion
|
|
31854
31845
|
//#region src/widget/FullExpandableTrigger.tsx
|
|
31855
31846
|
function IU({ expanded: e, className: t, onDismiss: n, ...r }) {
|
|
31856
|
-
let { isDisconnected: i } =
|
|
31847
|
+
let { isDisconnected: i } = ta(), a = Ma();
|
|
31857
31848
|
return /* @__PURE__ */ w("div", {
|
|
31858
31849
|
className: po("transition-[border-radius] flex flex-col p-2", !e.value && i.value ? "rounded-sheet" : "rounded-compact-sheet", t),
|
|
31859
31850
|
...r,
|
|
@@ -31895,7 +31886,7 @@ function LU({ expanded: e, className: t, onDismiss: n, ...r }) {
|
|
|
31895
31886
|
//#endregion
|
|
31896
31887
|
//#region src/widget/TriggerLanguageSelect.tsx
|
|
31897
31888
|
function RU({ visible: e, className: t, ...n }) {
|
|
31898
|
-
let r =
|
|
31889
|
+
let r = Ma(), { language: i, showPicker: a } = bt();
|
|
31899
31890
|
return a.value ? /* @__PURE__ */ C(cc, {
|
|
31900
31891
|
visible: e,
|
|
31901
31892
|
className: "p-1",
|
|
@@ -31917,7 +31908,7 @@ function RU({ visible: e, className: t, ...n }) {
|
|
|
31917
31908
|
//#endregion
|
|
31918
31909
|
//#region src/widget/TriggerActions.tsx
|
|
31919
31910
|
function zU({ onDismiss: e }) {
|
|
31920
|
-
let t =
|
|
31911
|
+
let t = sa().value.variant, { isDisconnected: n, status: r } = ta();
|
|
31921
31912
|
return /* @__PURE__ */ w(S, { children: [
|
|
31922
31913
|
/* @__PURE__ */ C(mU, {
|
|
31923
31914
|
isDisconnected: n.value,
|
|
@@ -31941,7 +31932,7 @@ function zU({ onDismiss: e }) {
|
|
|
31941
31932
|
//#endregion
|
|
31942
31933
|
//#region src/widget/FullTrigger.tsx
|
|
31943
31934
|
function BU({ className: e, onDismiss: t, ...n }) {
|
|
31944
|
-
let { isDisconnected: r } =
|
|
31935
|
+
let { isDisconnected: r } = ta(), i = Ma();
|
|
31945
31936
|
return /* @__PURE__ */ w("div", {
|
|
31946
31937
|
className: po("flex flex-col p-2 rounded-sheet", e),
|
|
31947
31938
|
...n,
|
|
@@ -31975,7 +31966,7 @@ function VU({ className: e, onDismiss: t, ...n }) {
|
|
|
31975
31966
|
//#endregion
|
|
31976
31967
|
//#region src/widget/Trigger.tsx
|
|
31977
31968
|
function HU({ expandable: e, expanded: t, onDismiss: n }) {
|
|
31978
|
-
let r =
|
|
31969
|
+
let r = sa().value.variant, i = qi(), { isDisconnected: a } = ta(), o = l(async () => {
|
|
31979
31970
|
await i.requestTerms(), t.value = !t.peek();
|
|
31980
31971
|
}, [t]), s = r === "full";
|
|
31981
31972
|
return e ? /* @__PURE__ */ C(s ? IU : LU, {
|
|
@@ -31991,7 +31982,7 @@ function HU({ expandable: e, expanded: t, onDismiss: n }) {
|
|
|
31991
31982
|
//#endregion
|
|
31992
31983
|
//#region src/widget/TermsModal.tsx
|
|
31993
31984
|
function UU() {
|
|
31994
|
-
let e =
|
|
31985
|
+
let e = Ma(), t = ma(), { dismissTerms: n, acceptTerms: r } = qi();
|
|
31995
31986
|
return /* @__PURE__ */ w("div", {
|
|
31996
31987
|
className: "max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm",
|
|
31997
31988
|
children: [/* @__PURE__ */ C("div", {
|
|
@@ -32013,7 +32004,7 @@ function UU() {
|
|
|
32013
32004
|
//#endregion
|
|
32014
32005
|
//#region src/components/CopyButton.tsx
|
|
32015
32006
|
function WU({ copyText: e, children: t }) {
|
|
32016
|
-
let n =
|
|
32007
|
+
let n = Ma(), [r, i] = g(!1);
|
|
32017
32008
|
return d(() => {
|
|
32018
32009
|
if (r) {
|
|
32019
32010
|
let e = setTimeout(() => {
|
|
@@ -32034,7 +32025,7 @@ function WU({ copyText: e, children: t }) {
|
|
|
32034
32025
|
//#endregion
|
|
32035
32026
|
//#region src/widget/ErrorModal.tsx
|
|
32036
32027
|
function GU({ sawError: e }) {
|
|
32037
|
-
let t =
|
|
32028
|
+
let t = Ma(), { error: n, lastId: r } = ta(), i = l(() => {
|
|
32038
32029
|
e.value = !0;
|
|
32039
32030
|
}, []);
|
|
32040
32031
|
return /* @__PURE__ */ w("div", {
|
|
@@ -32072,7 +32063,7 @@ function GU({ sawError: e }) {
|
|
|
32072
32063
|
//#endregion
|
|
32073
32064
|
//#region src/widget/PoweredBy.tsx
|
|
32074
32065
|
function KU() {
|
|
32075
|
-
let e =
|
|
32066
|
+
let e = sa();
|
|
32076
32067
|
return e.value.disable_banner ? null : /* @__PURE__ */ w("p", {
|
|
32077
32068
|
className: po("whitespace-nowrap [line-height:var(--el-overlay-padding)] text-[10px] px-3 z-10", e.value.placement.startsWith("top") ? "-translate-y-[calc(var(--el-overlay-padding))]" : "translate-y-[calc(var(--el-overlay-padding))]"),
|
|
32078
32069
|
children: [
|
|
@@ -32120,7 +32111,7 @@ var JU = {
|
|
|
32120
32111
|
bottom: `${YU.bottom} ${JU.center}`,
|
|
32121
32112
|
"bottom-right": `${YU.bottom} ${JU.right}`
|
|
32122
32113
|
}, ZU = { display: "none" }, QU = c(function() {
|
|
32123
|
-
let e =
|
|
32114
|
+
let e = sa(), t = b(e.peek().default_expanded), n = b(!1), r = b(!1), { error: i, isDisconnected: a } = ta(), o = qi(), { variant: s } = dU(), c = y(() => e.value.transcript_enabled || e.value.text_input_enabled), l = Xi(), u = y(() => F("overlay !flex transition-[opacity] duration-200 data-hidden:opacity-0", XU[e.value.placement])), d = y(() => s.value === "fullscreen" ? F(u.value, XU.bottom) : u.value);
|
|
32124
32115
|
x(() => {
|
|
32125
32116
|
i.value && (c.value ? (r.value = !0, t.value = !0) : r.value = !1);
|
|
32126
32117
|
}), x(() => {
|
|
@@ -32140,7 +32131,7 @@ var JU = {
|
|
|
32140
32131
|
/* @__PURE__ */ C(co, {
|
|
32141
32132
|
initial: !1,
|
|
32142
32133
|
active: v,
|
|
32143
|
-
children: /* @__PURE__ */ C(
|
|
32134
|
+
children: /* @__PURE__ */ C(La, {
|
|
32144
32135
|
className: u,
|
|
32145
32136
|
style: ZU,
|
|
32146
32137
|
children: e.value.always_expanded ? /* @__PURE__ */ C(NU, { open: !0 }) : /* @__PURE__ */ w(S, { children: [c.value && /* @__PURE__ */ C(NU, { open: t }), /* @__PURE__ */ C(HU, {
|
|
@@ -32153,7 +32144,7 @@ var JU = {
|
|
|
32153
32144
|
/* @__PURE__ */ C(co, {
|
|
32154
32145
|
initial: !1,
|
|
32155
32146
|
active: T,
|
|
32156
|
-
children: /* @__PURE__ */ C(
|
|
32147
|
+
children: /* @__PURE__ */ C(La, {
|
|
32157
32148
|
className: u,
|
|
32158
32149
|
style: ZU,
|
|
32159
32150
|
children: /* @__PURE__ */ C(UU, {})
|
|
@@ -32162,7 +32153,7 @@ var JU = {
|
|
|
32162
32153
|
/* @__PURE__ */ C(co, {
|
|
32163
32154
|
initial: !1,
|
|
32164
32155
|
active: E,
|
|
32165
|
-
children: /* @__PURE__ */ C(
|
|
32156
|
+
children: /* @__PURE__ */ C(La, {
|
|
32166
32157
|
className: u,
|
|
32167
32158
|
style: ZU,
|
|
32168
32159
|
children: /* @__PURE__ */ C(GU, { sawError: r })
|
|
@@ -32171,7 +32162,7 @@ var JU = {
|
|
|
32171
32162
|
/* @__PURE__ */ C(co, {
|
|
32172
32163
|
initial: !1,
|
|
32173
32164
|
active: ee,
|
|
32174
|
-
children: /* @__PURE__ */ C(
|
|
32165
|
+
children: /* @__PURE__ */ C(La, {
|
|
32175
32166
|
className: d,
|
|
32176
32167
|
style: ZU,
|
|
32177
32168
|
children: /* @__PURE__ */ C(KU, {})
|
|
@@ -32180,7 +32171,7 @@ var JU = {
|
|
|
32180
32171
|
/* @__PURE__ */ C(co, {
|
|
32181
32172
|
initial: !1,
|
|
32182
32173
|
active: te,
|
|
32183
|
-
children: /* @__PURE__ */ C(
|
|
32174
|
+
children: /* @__PURE__ */ C(La, {
|
|
32184
32175
|
className: u,
|
|
32185
32176
|
style: ZU,
|
|
32186
32177
|
children: /* @__PURE__ */ C(qU, { onExpand: _ })
|
|
@@ -32188,7 +32179,7 @@ var JU = {
|
|
|
32188
32179
|
})
|
|
32189
32180
|
] });
|
|
32190
32181
|
}), $U = "elevenlabs-agent:user-activity", eW = "elevenlabs-agent:user-message", tW = "elevenlabs-agent:contextual-update", nW = c(function({ children: e }) {
|
|
32191
|
-
let { sendContextualUpdate: t, sendUserActivity: n, sendUserMessage: r } =
|
|
32182
|
+
let { sendContextualUpdate: t, sendUserActivity: n, sendUserMessage: r } = ta(), i = Xi(), a = ya();
|
|
32192
32183
|
return x(() => {
|
|
32193
32184
|
function e() {
|
|
32194
32185
|
n();
|
|
@@ -32216,7 +32207,7 @@ function iW(e) {
|
|
|
32216
32207
|
function aW(e) {
|
|
32217
32208
|
return /* @__PURE__ */ C(Yi, { children: /* @__PURE__ */ C(ot, {
|
|
32218
32209
|
value: e,
|
|
32219
|
-
children: /* @__PURE__ */ C(lt, { children: /* @__PURE__ */ C(
|
|
32210
|
+
children: /* @__PURE__ */ C(lt, { children: /* @__PURE__ */ C(oa, { children: /* @__PURE__ */ C(uU, { children: /* @__PURE__ */ C(yt, { children: /* @__PURE__ */ C(Ki, { children: /* @__PURE__ */ C(St, { children: /* @__PURE__ */ C(ea, { children: /* @__PURE__ */ C(Ta, { children: /* @__PURE__ */ C(Oa, { children: /* @__PURE__ */ C(ja, { children: /* @__PURE__ */ C(Pa, { children: /* @__PURE__ */ C(Ls, { children: /* @__PURE__ */ w(Ps, { children: [/* @__PURE__ */ C(xa, {}), /* @__PURE__ */ C(nW, { children: /* @__PURE__ */ C(QU, {}) })] }) }) }) }) }) }) }) }) }) }) }) }) })
|
|
32220
32211
|
}) });
|
|
32221
32212
|
}
|
|
32222
32213
|
//#endregion
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "0.12.
|
|
1
|
+
export declare const PACKAGE_VERSION = "0.12.4";
|