@streamoji/avatar-widget 0.3.8 → 0.3.9
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/avatar-widget.cjs +5 -5
- package/dist/avatar-widget.js +196 -194
- package/dist/avatar-widget.umd.js +14 -14
- package/dist/avatar-widget.umd.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/package.json +1 -1
package/dist/avatar-widget.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as d, jsxs as le } from "react/jsx-runtime";
|
|
2
2
|
import { useGLTF as mt, Environment as on } from "@react-three/drei";
|
|
3
3
|
import { useFrame as an, Canvas as cn, useThree as un } from "@react-three/fiber";
|
|
4
|
-
import { memo as ln, useMemo as bt, useRef as
|
|
4
|
+
import { memo as ln, useMemo as bt, useRef as a, useState as y, useEffect as W, useCallback as $e, useLayoutEffect as dn, Suspense as hn } from "react";
|
|
5
5
|
import * as ze from "three";
|
|
6
6
|
import { GLTFLoader as fn } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
7
|
-
const Ye = "https://ai.streamoji.com", B = (...
|
|
8
|
-
}, mn = (...
|
|
9
|
-
}, Nt = ({ analyser:
|
|
10
|
-
const T =
|
|
7
|
+
const Ye = "https://ai.streamoji.com", B = (...f) => {
|
|
8
|
+
}, mn = (...f) => {
|
|
9
|
+
}, Nt = ({ analyser: f }) => {
|
|
10
|
+
const T = a(null), x = a(null);
|
|
11
11
|
return W(() => {
|
|
12
12
|
const b = T.current;
|
|
13
13
|
if (!b) return;
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
14
|
+
const S = b.getContext("2d", { alpha: !0 });
|
|
15
|
+
if (!S) return;
|
|
16
16
|
let H, I = null;
|
|
17
|
-
|
|
17
|
+
f && (f.fftSize = 128, I = new Uint8Array(f.frequencyBinCount));
|
|
18
18
|
const Ue = () => {
|
|
19
19
|
H = requestAnimationFrame(Ue), (b.width !== b.offsetWidth || b.height !== b.offsetHeight) && (b.width = b.offsetWidth, b.height = b.offsetHeight);
|
|
20
20
|
const se = b.width, R = b.height;
|
|
21
21
|
if (se === 0 || R === 0) return;
|
|
22
22
|
const we = R / 2;
|
|
23
|
-
|
|
23
|
+
S.clearRect(0, 0, se, R), S.fillStyle = "#1e293b";
|
|
24
24
|
const K = 2, l = K + 2, Q = se * 0.95, g = Math.floor(Q / l);
|
|
25
|
-
(!
|
|
25
|
+
(!x.current || x.current.length !== g) && (x.current = new Float32Array(g).fill(2));
|
|
26
26
|
const ee = g * l, k = (se - ee) / 2;
|
|
27
|
-
|
|
27
|
+
f && I && f.getByteFrequencyData(I);
|
|
28
28
|
const Te = I ? I.length : 0, te = Math.floor(Te * 0.7) / g, Se = new Float32Array(g);
|
|
29
29
|
for (let D = 0; D < g; D++) {
|
|
30
30
|
let J = 0;
|
|
@@ -40,16 +40,16 @@ const Ye = "https://ai.streamoji.com", B = (...m) => {
|
|
|
40
40
|
Se[D] = F;
|
|
41
41
|
}
|
|
42
42
|
for (let D = 0; D < g; D++) {
|
|
43
|
-
const J = g - 1 - D, Y = Math.max(Se[D], Se[J]), F =
|
|
44
|
-
|
|
43
|
+
const J = g - 1 - D, Y = Math.max(Se[D], Se[J]), F = x.current[D] + (Y - x.current[D]) * 0.3;
|
|
44
|
+
x.current[D] = F;
|
|
45
45
|
const V = k + D * l, $ = we - F / 2;
|
|
46
|
-
|
|
46
|
+
S.beginPath(), S.roundRect ? S.roundRect(V, $, K, F, 4) : S.fillRect(V, $, K, F), S.fill();
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
return Ue(), () => {
|
|
50
50
|
cancelAnimationFrame(H);
|
|
51
51
|
};
|
|
52
|
-
}, [
|
|
52
|
+
}, [f]), /* @__PURE__ */ d(
|
|
53
53
|
"canvas",
|
|
54
54
|
{
|
|
55
55
|
ref: T,
|
|
@@ -57,33 +57,33 @@ const Ye = "https://ai.streamoji.com", B = (...m) => {
|
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}, pn = "https://pub-48df6f7d60d6440bbd01676ea5d90e55.r2.dev", Pt = "https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/default-models/avatar-blue-suit.glb";
|
|
60
|
-
async function gn(
|
|
60
|
+
async function gn(f) {
|
|
61
61
|
const T = await crypto.subtle.digest(
|
|
62
62
|
"SHA-256",
|
|
63
|
-
new TextEncoder().encode(
|
|
63
|
+
new TextEncoder().encode(f)
|
|
64
64
|
);
|
|
65
|
-
return Array.from(new Uint8Array(T)).map((
|
|
65
|
+
return Array.from(new Uint8Array(T)).map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
66
66
|
}
|
|
67
|
-
function bn(
|
|
68
|
-
const [T,
|
|
67
|
+
function bn(f) {
|
|
68
|
+
const [T, x] = y(null);
|
|
69
69
|
return W(() => {
|
|
70
|
-
if (!
|
|
71
|
-
|
|
70
|
+
if (!f) {
|
|
71
|
+
x(null);
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
let b = !1;
|
|
75
|
-
return gn(
|
|
75
|
+
return gn(f).then((S) => {
|
|
76
76
|
if (b) return;
|
|
77
|
-
const H = `${pn}/${
|
|
77
|
+
const H = `${pn}/${S}.glb`;
|
|
78
78
|
fetch(H, { method: "HEAD" }).then((I) => {
|
|
79
|
-
b ||
|
|
79
|
+
b || x(I.ok ? H : Pt);
|
|
80
80
|
}).catch(() => {
|
|
81
|
-
b ||
|
|
81
|
+
b || x(Pt);
|
|
82
82
|
});
|
|
83
83
|
}), () => {
|
|
84
84
|
b = !0;
|
|
85
85
|
};
|
|
86
|
-
}, [
|
|
86
|
+
}, [f]), T;
|
|
87
87
|
}
|
|
88
88
|
const _n = [
|
|
89
89
|
"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_001.glb",
|
|
@@ -622,39 +622,39 @@ const _n = [
|
|
|
622
622
|
],
|
|
623
623
|
sil: [{ v: "sil", w: 1 }]
|
|
624
624
|
};
|
|
625
|
-
function En(
|
|
626
|
-
if (!
|
|
627
|
-
const T =
|
|
625
|
+
function En(f) {
|
|
626
|
+
if (!f) return [{ v: "sil", w: 1 }];
|
|
627
|
+
const T = f.toLowerCase();
|
|
628
628
|
return Mn[T] ?? [{ v: "sil", w: 1 }];
|
|
629
629
|
}
|
|
630
|
-
function In({ target:
|
|
630
|
+
function In({ target: f }) {
|
|
631
631
|
const { camera: T } = un();
|
|
632
632
|
return W(() => {
|
|
633
|
-
T.lookAt(...
|
|
634
|
-
}, [T,
|
|
633
|
+
T.lookAt(...f);
|
|
634
|
+
}, [T, f]), null;
|
|
635
635
|
}
|
|
636
|
-
function E(
|
|
637
|
-
if (!
|
|
636
|
+
function E(f, T, x) {
|
|
637
|
+
if (!f || !f.morphTargetDictionary)
|
|
638
638
|
return;
|
|
639
|
-
const b =
|
|
639
|
+
const b = f, S = b.morphTargetDictionary, H = b.morphTargetInfluences;
|
|
640
640
|
if (H)
|
|
641
|
-
for (const I in
|
|
642
|
-
I.toLowerCase() === T.toLowerCase() && (H[
|
|
641
|
+
for (const I in S)
|
|
642
|
+
I.toLowerCase() === T.toLowerCase() && (H[S[I]] = x);
|
|
643
643
|
}
|
|
644
|
-
function gt(
|
|
645
|
-
if (!
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
for (let b = 0; b <
|
|
649
|
-
|
|
644
|
+
function gt(f, T = 0.97) {
|
|
645
|
+
if (!f) return;
|
|
646
|
+
const x = f;
|
|
647
|
+
if (x.morphTargetInfluences)
|
|
648
|
+
for (let b = 0; b < x.morphTargetInfluences.length; b++)
|
|
649
|
+
x.morphTargetInfluences[b] *= T;
|
|
650
650
|
}
|
|
651
651
|
const Dn = ln(
|
|
652
652
|
({
|
|
653
|
-
avatarUrl:
|
|
653
|
+
avatarUrl: f,
|
|
654
654
|
isPlayingRef: T,
|
|
655
|
-
visemeQueueRef:
|
|
655
|
+
visemeQueueRef: x,
|
|
656
656
|
audioContextRef: b,
|
|
657
|
-
responseAudioStartTimeRef:
|
|
657
|
+
responseAudioStartTimeRef: S,
|
|
658
658
|
adjustments: H,
|
|
659
659
|
mood: I,
|
|
660
660
|
expression: Ue,
|
|
@@ -668,37 +668,37 @@ const Dn = ln(
|
|
|
668
668
|
isNudgeResponse: g,
|
|
669
669
|
avatarGender: ee
|
|
670
670
|
}) => {
|
|
671
|
-
const { scene: k } = mt(
|
|
672
|
-
() => Me.flatMap((
|
|
671
|
+
const { scene: k } = mt(f), Me = mt(ee === "female" ? wn : _n), te = bt(
|
|
672
|
+
() => Me.flatMap((m) => m.animations),
|
|
673
673
|
[Me]
|
|
674
674
|
), D = mt(ee === "female" ? yn : vn), J = bt(
|
|
675
|
-
() => D.flatMap((
|
|
675
|
+
() => D.flatMap((m) => m.animations),
|
|
676
676
|
[D]
|
|
677
|
-
), Y =
|
|
677
|
+
), Y = a(null), F = a(null), V = a(null), $ = a(null), Ee = a([]), [U] = y(() => new ze.AnimationMixer(k)), N = a({}), O = a(null), ve = a(0), Ne = a(!1), ye = a(0), de = a(null);
|
|
678
678
|
W(() => {
|
|
679
679
|
if (!(!te || !k)) {
|
|
680
|
-
if (te.forEach((
|
|
680
|
+
if (te.forEach((m, u) => {
|
|
681
681
|
const s = `idle_${u}`;
|
|
682
682
|
if (!N.current[s]) {
|
|
683
|
-
const o = U.clipAction(
|
|
683
|
+
const o = U.clipAction(m, k);
|
|
684
684
|
o.name = s, o.setLoop(ze.LoopOnce, 1), o.clampWhenFinished = !0, N.current[s] = o;
|
|
685
685
|
}
|
|
686
|
-
}), J.forEach((
|
|
686
|
+
}), J.forEach((m, u) => {
|
|
687
687
|
const s = `talk_${u}`;
|
|
688
688
|
if (!N.current[s]) {
|
|
689
|
-
const o = U.clipAction(
|
|
689
|
+
const o = U.clipAction(m, k);
|
|
690
690
|
o.name = s, o.setLoop(ze.LoopOnce, 1), o.clampWhenFinished = !0, N.current[s] = o;
|
|
691
691
|
}
|
|
692
692
|
}), te.length > 0) {
|
|
693
|
-
const
|
|
694
|
-
|
|
693
|
+
const m = N.current.idle_0, u = O.current && U.existingAction(O.current.getClip());
|
|
694
|
+
m && !u && (m.reset().fadeIn(0.5).play(), O.current = m);
|
|
695
695
|
}
|
|
696
696
|
return () => {
|
|
697
697
|
U.stopAllAction(), N.current = {}, O.current = null;
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
}, [te, J, k, U]);
|
|
701
|
-
const pe =
|
|
701
|
+
const pe = a("");
|
|
702
702
|
W(() => {
|
|
703
703
|
if (!l || !k || l === pe.current) return;
|
|
704
704
|
pe.current = l, de.current = l, new fn().load(
|
|
@@ -718,7 +718,7 @@ const Dn = ln(
|
|
|
718
718
|
}
|
|
719
719
|
);
|
|
720
720
|
}, [l, k, U, R]), W(() => {
|
|
721
|
-
const
|
|
721
|
+
const m = (u) => {
|
|
722
722
|
const s = u.action, o = s.name || "";
|
|
723
723
|
if (o.startsWith("idle_")) {
|
|
724
724
|
const M = (parseInt(o.split("_")[1]) + 1) % te.length, X = N.current[`idle_${M}`];
|
|
@@ -743,7 +743,7 @@ const Dn = ln(
|
|
|
743
743
|
h && (h.reset().fadeIn(0.5).play(), s.crossFadeTo(h, 0.5, !0), O.current = h);
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
|
-
return U.addEventListener("finished",
|
|
746
|
+
return U.addEventListener("finished", m), () => U.removeEventListener("finished", m);
|
|
747
747
|
}, [
|
|
748
748
|
U,
|
|
749
749
|
te,
|
|
@@ -753,13 +753,13 @@ const Dn = ln(
|
|
|
753
753
|
Q
|
|
754
754
|
]), W(() => {
|
|
755
755
|
if (R && k) {
|
|
756
|
-
const
|
|
756
|
+
const m = O.current, u = m?.name || "";
|
|
757
757
|
if (u.startsWith("idle_") || u.startsWith("talk_") || u === "") {
|
|
758
758
|
const s = de.current;
|
|
759
759
|
if (s) {
|
|
760
760
|
const o = N.current[`EXPR_${s}`];
|
|
761
761
|
if (o) {
|
|
762
|
-
o.reset().fadeIn(0.3).play(),
|
|
762
|
+
o.reset().fadeIn(0.3).play(), m && m !== o && m.crossFadeTo(o, 0.3, !0), O.current = o, de.current = null;
|
|
763
763
|
return;
|
|
764
764
|
}
|
|
765
765
|
}
|
|
@@ -767,14 +767,14 @@ const Dn = ln(
|
|
|
767
767
|
const o = Math.floor(
|
|
768
768
|
Math.random() * J.length
|
|
769
769
|
), h = N.current[`talk_${o}`];
|
|
770
|
-
h && (h.reset().fadeIn(0.5).play(),
|
|
770
|
+
h && (h.reset().fadeIn(0.5).play(), m && m.crossFadeTo(h, 0.5, !0), O.current = h);
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
} else if (!R && k) {
|
|
774
|
-
const
|
|
774
|
+
const m = O.current, u = m?.name || "";
|
|
775
775
|
if (u.startsWith("talk_") || u.startsWith("EXPR_")) {
|
|
776
776
|
const s = N.current.idle_0;
|
|
777
|
-
s && (s.reset().fadeIn(0.5).play(),
|
|
777
|
+
s && (s.reset().fadeIn(0.5).play(), m && m.crossFadeTo(s, 0.5, !0), O.current = s);
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
}, [R, k, l]), W(() => {
|
|
@@ -785,8 +785,8 @@ const Dn = ln(
|
|
|
785
785
|
(o.includes("head") || o.includes("avatar")) && (F.current = s, B(`[ANIMATION] Found head mesh: ${s.name}`)), o.includes("teeth") && (V.current = s, B(`[ANIMATION] Found teeth mesh: ${s.name}`)), o.includes("beard") && ($.current = s, B(`[ANIMATION] Found beard mesh: ${s.name}`));
|
|
786
786
|
}
|
|
787
787
|
});
|
|
788
|
-
const
|
|
789
|
-
|
|
788
|
+
const m = F.current?.morphTargetDictionary;
|
|
789
|
+
m && Object.keys(m).filter(
|
|
790
790
|
(s) => s.toLowerCase().includes("brow")
|
|
791
791
|
);
|
|
792
792
|
const u = [];
|
|
@@ -797,8 +797,8 @@ const Dn = ln(
|
|
|
797
797
|
}
|
|
798
798
|
}), Ee.current = u, u.length > 0 && B("[ANIMATION] Meshes with brow morphs:", u.length);
|
|
799
799
|
}, [k]);
|
|
800
|
-
const He = (
|
|
801
|
-
const s = `viseme_${
|
|
800
|
+
const He = (m, u = 1) => {
|
|
801
|
+
const s = `viseme_${m}`.toLowerCase(), o = Tn.find((h) => h.key.toLowerCase() === s);
|
|
802
802
|
if (o) {
|
|
803
803
|
for (const h in o.mix) {
|
|
804
804
|
const M = o.mix[h] * u;
|
|
@@ -810,15 +810,15 @@ const Dn = ln(
|
|
|
810
810
|
E(V.current, h, M);
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
}, xe = (
|
|
814
|
-
const u = nt[
|
|
813
|
+
}, xe = (m) => {
|
|
814
|
+
const u = nt[m] ?? nt.neutral;
|
|
815
815
|
for (const s in u)
|
|
816
816
|
E(F.current, s, u[s]), E(V.current, s, u[s]), E($.current, s, u[s]);
|
|
817
817
|
};
|
|
818
|
-
return an((
|
|
818
|
+
return an((m, u) => {
|
|
819
819
|
const s = Math.pow(0.88, 60 * u);
|
|
820
820
|
gt(F.current, s), gt(V.current, s), gt($.current, s), xe(I);
|
|
821
|
-
const o =
|
|
821
|
+
const o = m.clock.elapsedTime;
|
|
822
822
|
let h = 0;
|
|
823
823
|
if (Math.floor(o) % 5 === 0 && Math.floor((o - u) % 5) !== 0) {
|
|
824
824
|
let q = null;
|
|
@@ -849,9 +849,9 @@ const Dn = ln(
|
|
|
849
849
|
), Y.current.position.set(...H.position), Y.current.scale.setScalar(H.scale), Y.current.rotation.x = H.rotation[0], Y.current.rotation.z = H.rotation[2];
|
|
850
850
|
}
|
|
851
851
|
if (T.current && b.current) {
|
|
852
|
-
const q = b.current.currentTime, Be = (q -
|
|
853
|
-
for (let re = 0; re <
|
|
854
|
-
const ae =
|
|
852
|
+
const q = b.current.currentTime, Be = (q - S.current) * 1e3 - -150;
|
|
853
|
+
for (let re = 0; re < x.current.length; re++) {
|
|
854
|
+
const ae = x.current[re];
|
|
855
855
|
Be >= ae.vtime && Be < ae.vtime + ae.vduration && He(ae.viseme, ae.weight ?? 1);
|
|
856
856
|
}
|
|
857
857
|
q > we.current + 0.5 && (K(), j(!1));
|
|
@@ -859,38 +859,38 @@ const Dn = ln(
|
|
|
859
859
|
}), /* @__PURE__ */ d("group", { ref: Y, children: /* @__PURE__ */ d("primitive", { object: k }) });
|
|
860
860
|
}
|
|
861
861
|
);
|
|
862
|
-
function On(
|
|
863
|
-
return
|
|
862
|
+
function On(f) {
|
|
863
|
+
return f ? f.charAt(0).toUpperCase() + f.slice(1).toLowerCase() : "";
|
|
864
864
|
}
|
|
865
|
-
function Wt(
|
|
866
|
-
return
|
|
865
|
+
function Wt(f) {
|
|
866
|
+
return f.replace(/\*(.*?)\*/g, " $1 ").replace(/\[.*?\]/g, " ").replace(/<.*?\/>/g, " ").replace(/<.*?>.*?<\/.*?>/g, " ").replace(/\s+/g, " ").trim();
|
|
867
867
|
}
|
|
868
868
|
const Cn = ({
|
|
869
|
-
token:
|
|
869
|
+
token: f,
|
|
870
870
|
agentToken: T,
|
|
871
|
-
onNavigationRequested:
|
|
871
|
+
onNavigationRequested: x,
|
|
872
872
|
avatarGender: b,
|
|
873
|
-
presetUserDetails:
|
|
873
|
+
presetUserDetails: S,
|
|
874
874
|
onAvatarReady: H
|
|
875
875
|
} = {}) => {
|
|
876
|
-
const I =
|
|
876
|
+
const I = f ?? T ?? "", Ue = bn(I || void 0), [se, R] = y(""), [we, K] = y(""), [j, l] = y("Ready"), [Q, g] = y(!1), [ee, k] = y(!1), [Te, Me] = y([]), [te, Se] = y(""), D = a(null), [J, Y] = y(
|
|
877
877
|
() => typeof window < "u" ? window.matchMedia("(max-width: 480px)").matches : !1
|
|
878
878
|
);
|
|
879
879
|
W(() => {
|
|
880
880
|
const e = window.matchMedia("(max-width: 480px)"), t = () => Y(e.matches);
|
|
881
881
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
882
882
|
}, []);
|
|
883
|
-
const F = J ? 80 : 600, V =
|
|
884
|
-
|
|
885
|
-
const Ne =
|
|
883
|
+
const F = J ? 80 : 600, V = a(!1), $ = a([]), Ee = a(0), U = a(!1), N = a([]), O = a(null), ve = a([]);
|
|
884
|
+
a([]);
|
|
885
|
+
const Ne = a([]), ye = a(0), de = a(0), pe = a(0), He = a(0), xe = a(!1), [m, u] = y(
|
|
886
886
|
null
|
|
887
|
-
), s =
|
|
887
|
+
), s = a(null), [o, h] = y("neutral"), [M, X] = y(""), [rt, Ke] = y(""), [je, Ie] = y("Chat with us"), [ne, Qe] = y(
|
|
888
888
|
null
|
|
889
|
-
), [oe, De] =
|
|
889
|
+
), [oe, De] = y("hidden"), [Le, Pe] = y(""), Oe = a(null), q = a(oe);
|
|
890
890
|
q.current = oe;
|
|
891
|
-
const [ke, z] =
|
|
891
|
+
const [ke, z] = y(null), Be = a(null), re = a(null), [ae, _t] = y(!1), wt = a(null), [he, Xe] = y("hidden"), [St, Vt] = y(""), it = a(he);
|
|
892
892
|
it.current = he;
|
|
893
|
-
const ie =
|
|
893
|
+
const ie = a(""), ge = a(!1), be = a(""), vt = a(Date.now()), st = a([]), Je = a(!1), [ot, qe] = y(!1), [yt, xt] = y(!1), Re = a(null), We = bt(() => ae ? "Try again" : j === "Busy" ? "Busy" : j === "Thinking..." || j === "Processing Voice..." ? j : ne != null && ne !== "" && ne !== "none" && ne !== "<none>" ? `Enter ${On(ne)}` : he !== "hidden" || !yt ? null : Bt, [j, ne, ae, he, yt]), Lt = !ae && j !== "Busy" && j !== "Thinking..." && j !== "Processing Voice..." && (ne == null || ne === "" || ne === "none" || ne === "<none>");
|
|
894
894
|
W(() => {
|
|
895
895
|
if (he !== "hidden" || !Lt) {
|
|
896
896
|
xt(!1), Re.current != null && (clearTimeout(Re.current), Re.current = null);
|
|
@@ -948,21 +948,21 @@ const Cn = ({
|
|
|
948
948
|
if (e.expression != null) {
|
|
949
949
|
const r = String(e.expression).trim();
|
|
950
950
|
X(r);
|
|
951
|
-
const
|
|
952
|
-
(
|
|
951
|
+
const c = Sn.find(
|
|
952
|
+
(p) => p.name.toLowerCase() === r.toLowerCase()
|
|
953
953
|
);
|
|
954
954
|
B(
|
|
955
|
-
`[STREAM] Animation match for "${r}": ${
|
|
956
|
-
), Ke(
|
|
955
|
+
`[STREAM] Animation match for "${r}": ${c ? c.name : "NONE"}`
|
|
956
|
+
), Ke(c?.url ?? "");
|
|
957
957
|
}
|
|
958
958
|
if (e.navigation != null) {
|
|
959
959
|
const r = String(e.navigation).trim();
|
|
960
|
-
r !== "" && (
|
|
960
|
+
r !== "" && (x ? x(r) : window.open(r, "_blank"));
|
|
961
961
|
}
|
|
962
962
|
const t = e.ask_for || e.lead_capture?.ask_for, n = t ? String(t).trim().toLowerCase() : "", i = n === "none" || n === "<none>";
|
|
963
963
|
if (t && !i) {
|
|
964
964
|
const r = n;
|
|
965
|
-
if (
|
|
965
|
+
if (S && (r === "email" && S.email || r === "name" && S.name || r === "phone" && S.phone))
|
|
966
966
|
return;
|
|
967
967
|
Qe(r || null), Ie(r === "email" ? "Enter your email" : r === "name" ? "Enter your name" : r === "phone" ? "Enter your phone number" : "Chat with us");
|
|
968
968
|
} else (i || e.ask_for === null || e.lead_capture && e.lead_capture.ask_for === null || e.ask_for === "none") && (Qe(null), je !== "Chat with us" && Ie("Chat with us"));
|
|
@@ -1011,22 +1011,22 @@ const Cn = ({
|
|
|
1011
1011
|
if (!sessionStorage.getItem(
|
|
1012
1012
|
"STREAMOJI_LEADS_SESSION_LEAD_ID"
|
|
1013
1013
|
)) {
|
|
1014
|
-
const r = "secret",
|
|
1014
|
+
const r = "secret", c = Math.floor(Date.now() / 1e3).toString();
|
|
1015
1015
|
try {
|
|
1016
|
-
const
|
|
1016
|
+
const p = new TextEncoder(), _ = await crypto.subtle.importKey(
|
|
1017
1017
|
"raw",
|
|
1018
|
-
|
|
1018
|
+
p.encode(r),
|
|
1019
1019
|
{ name: "HMAC", hash: "SHA-256" },
|
|
1020
1020
|
!1,
|
|
1021
1021
|
["sign"]
|
|
1022
|
-
),
|
|
1022
|
+
), v = await crypto.subtle.sign(
|
|
1023
1023
|
"HMAC",
|
|
1024
1024
|
_,
|
|
1025
|
-
|
|
1026
|
-
), w = Array.from(new Uint8Array(
|
|
1025
|
+
p.encode(c)
|
|
1026
|
+
), w = Array.from(new Uint8Array(v)).map((A) => A.toString(16).padStart(2, "0")).join("");
|
|
1027
1027
|
sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID", w), B("[SESSION] New HMAC UID generated and saved:", w);
|
|
1028
|
-
} catch (
|
|
1029
|
-
console.error("[SESSION] HMAC generation failed:",
|
|
1028
|
+
} catch (p) {
|
|
1029
|
+
console.error("[SESSION] HMAC generation failed:", p);
|
|
1030
1030
|
const _ = Math.random().toString(36) + Date.now().toString();
|
|
1031
1031
|
sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID", _);
|
|
1032
1032
|
}
|
|
@@ -1039,7 +1039,7 @@ const Cn = ({
|
|
|
1039
1039
|
} catch {
|
|
1040
1040
|
i = [];
|
|
1041
1041
|
}
|
|
1042
|
-
i.length === 0 &&
|
|
1042
|
+
i.length === 0 && S && (S.name || S.email) ? (i = [{ role: "user", content: `PRESET_USER_DETAILS: Name is "${S.name || ""}" , Email is "${S.email || ""}"` }], sessionStorage.setItem(
|
|
1043
1043
|
"STREAMOJI_LEADS_SESSION_MESSAGES",
|
|
1044
1044
|
JSON.stringify(i)
|
|
1045
1045
|
)) : n || sessionStorage.setItem(
|
|
@@ -1047,7 +1047,7 @@ const Cn = ({
|
|
|
1047
1047
|
JSON.stringify([])
|
|
1048
1048
|
);
|
|
1049
1049
|
})();
|
|
1050
|
-
}, [
|
|
1050
|
+
}, [S]), W(() => {
|
|
1051
1051
|
const e = () => {
|
|
1052
1052
|
vt.current = Date.now(), Je.current && (Je.current = !1, qe(!1), Me([]), Se(""), K(""), k(!1));
|
|
1053
1053
|
};
|
|
@@ -1058,19 +1058,19 @@ const Cn = ({
|
|
|
1058
1058
|
qe(!0), Me(st.current);
|
|
1059
1059
|
else
|
|
1060
1060
|
try {
|
|
1061
|
-
const r = `${Ye}/nudgeUser`,
|
|
1061
|
+
const r = `${Ye}/nudgeUser`, c = {
|
|
1062
1062
|
navigationUrl: window.location.href,
|
|
1063
1063
|
token: I
|
|
1064
|
-
},
|
|
1064
|
+
}, p = await fetch(r, {
|
|
1065
1065
|
method: "POST",
|
|
1066
1066
|
headers: {
|
|
1067
1067
|
"Content-Type": "application/json"
|
|
1068
1068
|
},
|
|
1069
|
-
body: JSON.stringify(
|
|
1069
|
+
body: JSON.stringify(c)
|
|
1070
1070
|
});
|
|
1071
|
-
if (
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1071
|
+
if (p.ok) {
|
|
1072
|
+
const v = (await p.json()).nudge_questions;
|
|
1073
|
+
v && v.length > 0 && (B("[NUDGE] Received nudge questions from API:", v), st.current = v, qe(!0), Me(v));
|
|
1074
1074
|
}
|
|
1075
1075
|
} catch (r) {
|
|
1076
1076
|
console.error("[NUDGE] Error calling /nudgeUser:", r), Je.current = !1;
|
|
@@ -1083,15 +1083,15 @@ const Cn = ({
|
|
|
1083
1083
|
if (Te.length === 0) return;
|
|
1084
1084
|
let e = 0, t = 0, n = !1, i = 100;
|
|
1085
1085
|
const r = () => {
|
|
1086
|
-
const
|
|
1086
|
+
const c = Te[e];
|
|
1087
1087
|
if (n) {
|
|
1088
|
-
const
|
|
1089
|
-
Se(
|
|
1088
|
+
const p = c.substring(0, t - 1);
|
|
1089
|
+
Se(p), t--, i = 50;
|
|
1090
1090
|
} else {
|
|
1091
|
-
const
|
|
1092
|
-
Se(
|
|
1091
|
+
const p = c.substring(0, t + 1);
|
|
1092
|
+
Se(p), t++, i = 100;
|
|
1093
1093
|
}
|
|
1094
|
-
!n && t ===
|
|
1094
|
+
!n && t === c.length ? (n = !0, i = 3e3) : n && t === 0 && (n = !1, e = (e + 1) % Te.length, i = 500), D.current = setTimeout(r, i);
|
|
1095
1095
|
};
|
|
1096
1096
|
return r(), () => {
|
|
1097
1097
|
D.current && clearTimeout(D.current);
|
|
@@ -1110,11 +1110,11 @@ const Cn = ({
|
|
|
1110
1110
|
"STREAMOJI_LEADS_SESSION_MESSAGES",
|
|
1111
1111
|
JSON.stringify(e)
|
|
1112
1112
|
);
|
|
1113
|
-
}, [ct, ut] =
|
|
1113
|
+
}, [ct, ut] = y(!1), [At, lt] = y(0), fe = a(null), et = a([]), Tt = a(0), [Mt, Gt] = y(
|
|
1114
1114
|
null
|
|
1115
|
-
), [zt, dt] =
|
|
1115
|
+
), [zt, dt] = y(
|
|
1116
1116
|
null
|
|
1117
|
-
), _e =
|
|
1117
|
+
), _e = a(null), Ce = a(
|
|
1118
1118
|
null
|
|
1119
1119
|
), Ge = $e((e = !1) => {
|
|
1120
1120
|
e && (xe.current = !0, g(!1), l("Ready")), N.current = [], $.current = [], U.current = !1, k(!1), ye.current = 0, de.current = 0, pe.current = 0, ve.current.forEach((t) => {
|
|
@@ -1127,12 +1127,12 @@ const Cn = ({
|
|
|
1127
1127
|
try {
|
|
1128
1128
|
const e = await navigator.mediaDevices.getUserMedia({ audio: !0 }), t = window.AudioContext || window.webkitAudioContext, n = new t(), i = n.createMediaStreamSource(e), r = n.createAnalyser();
|
|
1129
1129
|
r.fftSize = 64, i.connect(r), _e.current = n, Ce.current = i, dt(r);
|
|
1130
|
-
const
|
|
1131
|
-
fe.current =
|
|
1132
|
-
|
|
1133
|
-
},
|
|
1134
|
-
const
|
|
1135
|
-
if (dt(null), Ce.current && (Ce.current.disconnect(), Ce.current = null), _e.current && _e.current.state !== "closed" && (_e.current.close(), _e.current = null),
|
|
1130
|
+
const c = new MediaRecorder(e);
|
|
1131
|
+
fe.current = c, et.current = [], c.ondataavailable = (p) => {
|
|
1132
|
+
p.data.size > 0 && et.current.push(p.data);
|
|
1133
|
+
}, c.onstop = async () => {
|
|
1134
|
+
const p = Date.now() - Tt.current;
|
|
1135
|
+
if (dt(null), Ce.current && (Ce.current.disconnect(), Ce.current = null), _e.current && _e.current.state !== "closed" && (_e.current.close(), _e.current = null), p < 1e3) {
|
|
1136
1136
|
l("Recording too short. Hold or click longer."), g(!1);
|
|
1137
1137
|
return;
|
|
1138
1138
|
}
|
|
@@ -1140,7 +1140,7 @@ const Cn = ({
|
|
|
1140
1140
|
type: "audio/wav"
|
|
1141
1141
|
});
|
|
1142
1142
|
await Zt(_);
|
|
1143
|
-
}, Tt.current = Date.now(),
|
|
1143
|
+
}, Tt.current = Date.now(), c.start(100), ut(!0), l("Listening...");
|
|
1144
1144
|
} catch (e) {
|
|
1145
1145
|
console.error("Error accessing microphone:", e), l("Mic Access Error");
|
|
1146
1146
|
}
|
|
@@ -1156,13 +1156,13 @@ const Cn = ({
|
|
|
1156
1156
|
if (t <= 0) return;
|
|
1157
1157
|
const n = O.current, i = ye.current;
|
|
1158
1158
|
if (!n) return;
|
|
1159
|
-
const r = n.currentTime - i,
|
|
1159
|
+
const r = n.currentTime - i, c = Math.min(Math.max(0, r), t), _ = Wt(we).trim().length;
|
|
1160
1160
|
if (_ <= 0) return;
|
|
1161
|
-
const
|
|
1162
|
-
Math.round(
|
|
1161
|
+
const v = Math.min(
|
|
1162
|
+
Math.round(c / t * _),
|
|
1163
1163
|
_
|
|
1164
1164
|
);
|
|
1165
|
-
u(
|
|
1165
|
+
u(v);
|
|
1166
1166
|
};
|
|
1167
1167
|
return clearInterval(s.current ?? void 0), s.current = setInterval(e, 90), () => clearInterval(s.current ?? void 0);
|
|
1168
1168
|
}, [ee, we, pe.current]), W(() => {
|
|
@@ -1173,20 +1173,20 @@ const Cn = ({
|
|
|
1173
1173
|
}, [ct]);
|
|
1174
1174
|
const Xt = (e) => {
|
|
1175
1175
|
const t = e.numberOfChannels, n = e.length * t * 2 + 44, i = new ArrayBuffer(n), r = new DataView(i);
|
|
1176
|
-
let
|
|
1177
|
-
const
|
|
1178
|
-
r.setUint16(
|
|
1176
|
+
let c = 0;
|
|
1177
|
+
const p = (w) => {
|
|
1178
|
+
r.setUint16(c, w, !0), c += 2;
|
|
1179
1179
|
}, _ = (w) => {
|
|
1180
|
-
r.setUint32(
|
|
1180
|
+
r.setUint32(c, w, !0), c += 4;
|
|
1181
1181
|
};
|
|
1182
|
-
_(1179011410), _(n - 8), _(1163280727), _(544501094), _(16),
|
|
1183
|
-
const
|
|
1184
|
-
for (let w = 0; w < t; w++)
|
|
1182
|
+
_(1179011410), _(n - 8), _(1163280727), _(544501094), _(16), p(1), p(t), _(e.sampleRate), _(e.sampleRate * 2 * t), p(t * 2), p(16), _(1635017060), _(n - c - 4);
|
|
1183
|
+
const v = [];
|
|
1184
|
+
for (let w = 0; w < t; w++) v.push(e.getChannelData(w));
|
|
1185
1185
|
let L = 0;
|
|
1186
|
-
for (;
|
|
1186
|
+
for (; c < n; ) {
|
|
1187
1187
|
for (let w = 0; w < t; w++) {
|
|
1188
|
-
let A = Math.max(-1, Math.min(1,
|
|
1189
|
-
A = A < 0 ? A * 32768 : A * 32767, r.setInt16(
|
|
1188
|
+
let A = Math.max(-1, Math.min(1, v[w][L]));
|
|
1189
|
+
A = A < 0 ? A * 32768 : A * 32767, r.setInt16(c, A, !0), c += 2;
|
|
1190
1190
|
}
|
|
1191
1191
|
L++;
|
|
1192
1192
|
}
|
|
@@ -1205,15 +1205,15 @@ const Cn = ({
|
|
|
1205
1205
|
try {
|
|
1206
1206
|
const i = window.AudioContext || window.webkitAudioContext, r = O.current ?? new i();
|
|
1207
1207
|
r.state === "suspended" && await r.resume(), O.current = r;
|
|
1208
|
-
const
|
|
1209
|
-
for (let P = 0; P <
|
|
1210
|
-
|
|
1211
|
-
const _ = await r.decodeAudioData(
|
|
1208
|
+
const c = window.atob(e), p = new Uint8Array(c.length);
|
|
1209
|
+
for (let P = 0; P < c.length; P++)
|
|
1210
|
+
p[P] = c.charCodeAt(P);
|
|
1211
|
+
const _ = await r.decodeAudioData(p.buffer.slice(0));
|
|
1212
1212
|
pe.current += _.duration;
|
|
1213
|
-
const
|
|
1213
|
+
const v = r.currentTime;
|
|
1214
1214
|
let L = de.current;
|
|
1215
1215
|
const w = !U.current;
|
|
1216
|
-
L <
|
|
1216
|
+
L < v && (L = v + 0.1), de.current = L + _.duration;
|
|
1217
1217
|
const A = r.createBufferSource();
|
|
1218
1218
|
A.buffer = _;
|
|
1219
1219
|
let G = Mt;
|
|
@@ -1227,11 +1227,11 @@ const Cn = ({
|
|
|
1227
1227
|
3
|
|
1228
1228
|
)}`
|
|
1229
1229
|
), ye.current = L;
|
|
1230
|
-
const P = (L -
|
|
1230
|
+
const P = (L - v) * 1e3;
|
|
1231
1231
|
Ee.current = performance.now() + P, B(
|
|
1232
1232
|
`[AUDIO] Response started. Initial startTime: ${L.toFixed(
|
|
1233
1233
|
3
|
|
1234
|
-
)}, CT: ${
|
|
1234
|
+
)}, CT: ${v.toFixed(3)}`
|
|
1235
1235
|
);
|
|
1236
1236
|
}
|
|
1237
1237
|
A.start(L);
|
|
@@ -1268,31 +1268,31 @@ const Cn = ({
|
|
|
1268
1268
|
}, Zt = async (e) => {
|
|
1269
1269
|
try {
|
|
1270
1270
|
g(!0), qe(!1), be.current = "", K(""), l("Processing Voice...");
|
|
1271
|
-
const t = await e.arrayBuffer(), i = await new (window.AudioContext || window.webkitAudioContext)().decodeAudioData(t), r = Xt(i),
|
|
1272
|
-
|
|
1273
|
-
const
|
|
1271
|
+
const t = await e.arrayBuffer(), i = await new (window.AudioContext || window.webkitAudioContext)().decodeAudioData(t), r = Xt(i), c = new FileReader();
|
|
1272
|
+
c.readAsDataURL(r), c.onloadend = async () => {
|
|
1273
|
+
const p = c.result.split(",")[1];
|
|
1274
1274
|
Ge(), R(""), ie.current = "", ge.current = !1;
|
|
1275
1275
|
const _ = `${Ye}/stt?token=${encodeURIComponent(
|
|
1276
1276
|
I
|
|
1277
|
-
)}`,
|
|
1277
|
+
)}`, v = await fetch(_, {
|
|
1278
1278
|
method: "POST",
|
|
1279
1279
|
headers: { "Content-Type": "application/json" },
|
|
1280
1280
|
body: JSON.stringify({
|
|
1281
|
-
audio_base64:
|
|
1281
|
+
audio_base64: p,
|
|
1282
1282
|
audio_format: "wav"
|
|
1283
1283
|
})
|
|
1284
1284
|
});
|
|
1285
|
-
if (
|
|
1285
|
+
if (v.status === 429) {
|
|
1286
1286
|
try {
|
|
1287
|
-
const ce = await
|
|
1287
|
+
const ce = await v.text(), C = JSON.parse(ce);
|
|
1288
1288
|
B("[STT] 429 agent at capacity:", C?.detail);
|
|
1289
1289
|
} catch {
|
|
1290
1290
|
}
|
|
1291
1291
|
R(""), l("Busy"), g(!1);
|
|
1292
1292
|
return;
|
|
1293
1293
|
}
|
|
1294
|
-
if (!
|
|
1295
|
-
const ce = await
|
|
1294
|
+
if (!v.ok) {
|
|
1295
|
+
const ce = await v.text();
|
|
1296
1296
|
let C = "STT Failed";
|
|
1297
1297
|
try {
|
|
1298
1298
|
C = JSON.parse(ce).error || C;
|
|
@@ -1301,7 +1301,7 @@ const Cn = ({
|
|
|
1301
1301
|
}
|
|
1302
1302
|
throw new Error(C);
|
|
1303
1303
|
}
|
|
1304
|
-
const L =
|
|
1304
|
+
const L = v.body;
|
|
1305
1305
|
if (B("this is body" + L), !L) {
|
|
1306
1306
|
l("STT Failed"), g(!1);
|
|
1307
1307
|
return;
|
|
@@ -1366,8 +1366,8 @@ const Cn = ({
|
|
|
1366
1366
|
}, Ve = (e) => {
|
|
1367
1367
|
const t = e.split(/\r?\n/);
|
|
1368
1368
|
let n = "", i = "";
|
|
1369
|
-
for (const
|
|
1370
|
-
|
|
1369
|
+
for (const c of t)
|
|
1370
|
+
c.startsWith("event:") ? n = c.slice(6).trim() : c.startsWith("data:") && (i = c.slice(5).trim());
|
|
1371
1371
|
if (!n) return null;
|
|
1372
1372
|
let r = {};
|
|
1373
1373
|
if (i)
|
|
@@ -1427,22 +1427,22 @@ const Cn = ({
|
|
|
1427
1427
|
}
|
|
1428
1428
|
const r = i.getReader();
|
|
1429
1429
|
xe.current = !1;
|
|
1430
|
-
const
|
|
1431
|
-
let
|
|
1430
|
+
const c = new TextDecoder();
|
|
1431
|
+
let p = "";
|
|
1432
1432
|
for (; ; ) {
|
|
1433
|
-
const { done: _, value:
|
|
1434
|
-
|
|
1435
|
-
const L =
|
|
1433
|
+
const { done: _, value: v } = await r.read();
|
|
1434
|
+
v && (p += c.decode(v, { stream: !0 }));
|
|
1435
|
+
const L = p.split(`
|
|
1436
1436
|
|
|
1437
1437
|
`);
|
|
1438
|
-
|
|
1438
|
+
p = L.pop() ?? "";
|
|
1439
1439
|
for (const w of L) {
|
|
1440
1440
|
const A = Ve(w);
|
|
1441
1441
|
A && tt(A.event, A.data);
|
|
1442
1442
|
}
|
|
1443
1443
|
if (_) {
|
|
1444
|
-
if (
|
|
1445
|
-
const w = Ve(
|
|
1444
|
+
if (p.trim()) {
|
|
1445
|
+
const w = Ve(p.trim());
|
|
1446
1446
|
w && tt(w.event, w.data);
|
|
1447
1447
|
}
|
|
1448
1448
|
l("Ready"), g(!1);
|
|
@@ -1452,13 +1452,13 @@ const Cn = ({
|
|
|
1452
1452
|
} catch (n) {
|
|
1453
1453
|
console.error("Streaming Error:", n), l("Failed"), g(!1);
|
|
1454
1454
|
}
|
|
1455
|
-
}, It = $e(async (e, t, n
|
|
1456
|
-
const
|
|
1457
|
-
await Et(
|
|
1458
|
-
}, []), Dt = $e(async (e, t, n, i
|
|
1459
|
-
const
|
|
1460
|
-
await Et(
|
|
1461
|
-
}, []), Ot =
|
|
1455
|
+
}, It = $e(async (e, t, n) => {
|
|
1456
|
+
const i = `${Ye}/avatar_tts`;
|
|
1457
|
+
await Et(i, { text: e, userQuery: t, llmPrompt: n });
|
|
1458
|
+
}, []), Dt = $e(async (e, t, n, i) => {
|
|
1459
|
+
const r = `${Ye}/avatar_ttsWithKnowledge`;
|
|
1460
|
+
await Et(r, { userQuery: e, llmPrompt: t, knowledge: n, history: i });
|
|
1461
|
+
}, []), Ot = a(!1);
|
|
1462
1462
|
W(() => {
|
|
1463
1463
|
H && !Ot.current && (H({ avatarSpeak: It, avatarRespond: Dt }), Ot.current = !0);
|
|
1464
1464
|
}, [H, It, Dt]);
|
|
@@ -1479,7 +1479,7 @@ const Cn = ({
|
|
|
1479
1479
|
lead_id: i
|
|
1480
1480
|
};
|
|
1481
1481
|
B("[CHAT] Sending payload:", r);
|
|
1482
|
-
const
|
|
1482
|
+
const c = await fetch(t, {
|
|
1483
1483
|
method: "POST",
|
|
1484
1484
|
headers: {
|
|
1485
1485
|
"Content-Type": "application/json"
|
|
@@ -1487,31 +1487,31 @@ const Cn = ({
|
|
|
1487
1487
|
body: JSON.stringify(r),
|
|
1488
1488
|
cache: "default"
|
|
1489
1489
|
});
|
|
1490
|
-
if (
|
|
1490
|
+
if (c.status === 429) {
|
|
1491
1491
|
try {
|
|
1492
|
-
const w = await
|
|
1492
|
+
const w = await c.json();
|
|
1493
1493
|
B("[CHAT] 429 agent at capacity:", w?.detail);
|
|
1494
1494
|
} catch {
|
|
1495
1495
|
}
|
|
1496
1496
|
R(""), l("Busy"), g(!1);
|
|
1497
1497
|
return;
|
|
1498
1498
|
}
|
|
1499
|
-
if (!
|
|
1499
|
+
if (!c.ok)
|
|
1500
1500
|
throw new Error("Agent request failed");
|
|
1501
|
-
const
|
|
1502
|
-
if (!
|
|
1501
|
+
const p = c.body;
|
|
1502
|
+
if (!p) {
|
|
1503
1503
|
l("Agent Failed"), g(!1);
|
|
1504
1504
|
return;
|
|
1505
1505
|
}
|
|
1506
|
-
const _ =
|
|
1506
|
+
const _ = p.getReader();
|
|
1507
1507
|
xe.current = !1;
|
|
1508
|
-
const
|
|
1508
|
+
const v = new TextDecoder();
|
|
1509
1509
|
let L = "";
|
|
1510
1510
|
for (; ; ) {
|
|
1511
1511
|
const { done: w, value: A } = await _.read();
|
|
1512
1512
|
B(
|
|
1513
1513
|
`[SSE] Chunk received. done=${w}, length=${A?.length || 0}`
|
|
1514
|
-
), A && (L +=
|
|
1514
|
+
), A && (L += v.decode(A, { stream: !0 }));
|
|
1515
1515
|
const G = L.split(`
|
|
1516
1516
|
|
|
1517
1517
|
`);
|
|
@@ -1535,7 +1535,7 @@ const Cn = ({
|
|
|
1535
1535
|
}
|
|
1536
1536
|
}, nn = we.trim(), Ct = Wt(nn), ft = Ct && ee ? Ct.slice(
|
|
1537
1537
|
0,
|
|
1538
|
-
|
|
1538
|
+
m != null && m > 0 ? m : 0
|
|
1539
1539
|
) : "";
|
|
1540
1540
|
W(() => {
|
|
1541
1541
|
const e = it.current;
|
|
@@ -1879,17 +1879,19 @@ const Cn = ({
|
|
|
1879
1879
|
] }) })
|
|
1880
1880
|
] });
|
|
1881
1881
|
}, Wn = ({
|
|
1882
|
-
token:
|
|
1882
|
+
token: f,
|
|
1883
1883
|
avatarGender: T,
|
|
1884
|
-
onNavigationRequested:
|
|
1885
|
-
presetUserDetails: b
|
|
1884
|
+
onNavigationRequested: x,
|
|
1885
|
+
presetUserDetails: b,
|
|
1886
|
+
onAvatarReady: S
|
|
1886
1887
|
}) => /* @__PURE__ */ d(
|
|
1887
1888
|
Cn,
|
|
1888
1889
|
{
|
|
1889
|
-
token:
|
|
1890
|
-
onNavigationRequested:
|
|
1890
|
+
token: f,
|
|
1891
|
+
onNavigationRequested: x,
|
|
1891
1892
|
avatarGender: T,
|
|
1892
|
-
presetUserDetails: b
|
|
1893
|
+
presetUserDetails: b,
|
|
1894
|
+
onAvatarReady: S
|
|
1893
1895
|
}
|
|
1894
1896
|
);
|
|
1895
1897
|
export {
|