@sage-rsc/talking-head-react 1.7.4 → 1.7.5
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.cjs +3 -3
- package/dist/index.js +582 -573
- package/package.json +1 -1
- package/src/components/SimpleTalkingAvatar.jsx +22 -15
- package/src/utils/animationLoader.js +12 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as Se, jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Xe, useRef as W, useState as ae, useEffect as xe, useCallback as N, useImperativeHandle as je, useLayoutEffect as st } from "react";
|
|
3
3
|
import * as x from "three";
|
|
4
|
-
import { OrbitControls as
|
|
5
|
-
import { GLTFLoader as
|
|
6
|
-
import { DRACOLoader as
|
|
7
|
-
import { FBXLoader as
|
|
8
|
-
import { RoomEnvironment as
|
|
9
|
-
import
|
|
10
|
-
let m, fe,
|
|
11
|
-
const z = [0, 0, 0, 0],
|
|
4
|
+
import { OrbitControls as rt } from "three/addons/controls/OrbitControls.js";
|
|
5
|
+
import { GLTFLoader as at } from "three/addons/loaders/GLTFLoader.js";
|
|
6
|
+
import { DRACOLoader as lt } from "three/addons/loaders/DRACOLoader.js";
|
|
7
|
+
import { FBXLoader as _e } from "three/addons/loaders/FBXLoader.js";
|
|
8
|
+
import { RoomEnvironment as ut } from "three/addons/environments/RoomEnvironment.js";
|
|
9
|
+
import ct from "three/addons/libs/stats.module.js";
|
|
10
|
+
let m, fe, Re;
|
|
11
|
+
const z = [0, 0, 0, 0], B = new x.Vector3(), We = new x.Vector3(), he = new x.Vector3(), Ve = new x.Vector3();
|
|
12
12
|
new x.Plane();
|
|
13
13
|
new x.Ray();
|
|
14
14
|
new x.Euler();
|
|
15
|
-
const
|
|
15
|
+
const de = new x.Quaternion(), Ke = new x.Quaternion(), we = new x.Matrix4(), Ce = new x.Matrix4();
|
|
16
16
|
new x.Vector3();
|
|
17
|
-
const
|
|
18
|
-
class
|
|
17
|
+
const Ge = new x.Vector3(0, 0, 1), ht = new x.Vector3(1, 0, 0), dt = new x.Vector3(0, 1, 0), mt = new x.Vector3(0, 0, 1);
|
|
18
|
+
class pt {
|
|
19
19
|
constructor(t = null) {
|
|
20
20
|
this.opt = Object.assign({
|
|
21
21
|
warmupMs: 2e3,
|
|
@@ -321,7 +321,7 @@ class mt {
|
|
|
321
321
|
/// Bone's parent object
|
|
322
322
|
vBasis: l.position.clone(),
|
|
323
323
|
// Original local position
|
|
324
|
-
vWorld: l.parent.getWorldPosition(
|
|
324
|
+
vWorld: l.parent.getWorldPosition(B).clone(),
|
|
325
325
|
// World position, parent
|
|
326
326
|
qBasis: l.parent.quaternion.clone(),
|
|
327
327
|
// Original quaternion, parent
|
|
@@ -338,7 +338,7 @@ class mt {
|
|
|
338
338
|
ea: [0, 0, 0, 0]
|
|
339
339
|
// External acceleration [m/s^2]
|
|
340
340
|
};
|
|
341
|
-
u.boneParent.matrixWorld.decompose(
|
|
341
|
+
u.boneParent.matrixWorld.decompose(B, de, he), B.copy(Ge).applyQuaternion(de).setY(0).normalize(), de.premultiply(Ke.setFromUnitVectors(Ge, B).invert()).normalize(), u.qWorldInverseYaw = de.clone().normalize(), this.data.push(u), this.dict[c] = u;
|
|
342
342
|
try {
|
|
343
343
|
this.setValue(c, "type", s.type), this.setValue(c, "stiffness", s.stiffness), this.setValue(c, "damping", s.damping), this.setValue(c, "external", s.external), this.setValue(c, "limits", s.limits), this.setValue(c, "excludes", s.excludes), this.setValue(c, "deltaLocal", s.deltaLocal), this.setValue(c, "deltaWorld", s.deltaWorld), this.setValue(c, "pivot", s.pivot), this.setValue(c, "helper", s.helper);
|
|
344
344
|
} catch (r) {
|
|
@@ -356,22 +356,22 @@ class mt {
|
|
|
356
356
|
for (this.timerMs += t, t > 1e3 && (this.timerMs = 0), t /= 1e3, e = 0, o = this.objectsUpdate.length; e < o; e++)
|
|
357
357
|
i = this.objectsUpdate[e], i.updateMatrix(), i.parent === null ? i.matrixWorld.copy(i.matrix) : i.matrixWorld.multiplyMatrices(i.parent.matrixWorld, i.matrix), i.matrixWorldNeedsUpdate = !1;
|
|
358
358
|
for (e = 0, o = this.data.length; e < o; e++) {
|
|
359
|
-
if (i = this.data[e],
|
|
359
|
+
if (i = this.data[e], B.copy(i.vWorld), we.copy(i.boneParent.matrixWorld), Ce.copy(we).invert(), i.vWorld.setFromMatrixPosition(we), B.applyMatrix4(Ce), B.length() > 0.5 && (console.info("Info: Unrealistic jump of " + B.length().toFixed(2) + " meters."), B.setLength(0.5)), B.applyQuaternion(i.bone.quaternion), z[0] = B.x, z[1] = B.y, z[2] = -B.z, z[3] = B.length() / 3, i.children)
|
|
360
360
|
for (n = 0, s = i.children.length; n < s; n++)
|
|
361
361
|
m = i.children[n], z[0] -= m.v[0] * t / 3, z[1] -= m.v[1] * t / 3, z[2] += m.v[2] * t / 3, z[3] -= m.v[3] * t / 3;
|
|
362
|
-
if (m = this.opt.sensitivityFactor, z[0] *= i.ext * m, z[1] *= i.ext * m, z[2] *= i.ext * m, z[3] *= i.ext * m, i.isX && (m = z[0] / t, i.ea[0] = (m - i.ev[0]) / t, i.ev[0] = m, i.a[0] = -i.k[0] * i.p[0] - i.c[0] * i.v[0] - i.ea[0], i.p[0] += i.v[0] * t + i.a[0] * t * t / 2 + z[0], m = i.v[0] + i.a[0] * t / 2, m = -i.k[0] * i.p[0] - i.c[0] * m - i.ea[0], i.v[0] = i.v[0] + (m + i.a[0]) * t / 2), i.isY && (m = z[1] / t, i.ea[1] = (m - i.ev[1]) / t, i.ev[1] = m, i.a[1] = -i.k[1] * i.p[1] - i.c[1] * i.v[1] - i.ea[1], i.p[1] += i.v[1] * t + i.a[1] * t * t / 2 + z[1], m = i.v[1] + i.a[1] * t / 2, m = -i.k[1] * i.p[1] - i.c[1] * m - i.ea[1], i.v[1] = i.v[1] + (m + i.a[1]) * t / 2), i.isZ && (m = z[2] / t, i.ea[2] = (m - i.ev[2]) / t, i.ev[2] = m, i.a[2] = -i.k[2] * i.p[2] - i.c[2] * i.v[2] - i.ea[2], i.p[2] += i.v[2] * t + i.a[2] * t * t / 2 + z[2], m = i.v[2] + i.a[2] * t / 2, m = -i.k[2] * i.p[2] - i.c[2] * m - i.ea[2], i.v[2] = i.v[2] + (m + i.a[2]) * t / 2), i.isT && (m = z[3] / t, i.ea[3] = (m - i.ev[3]) / t, i.ev[3] = m, i.a[3] = -i.k[3] * i.p[3] - i.c[3] * i.v[3] - i.ea[3], i.p[3] += i.v[3] * t + i.a[3] * t * t / 2 + z[3], m = i.v[3] + i.a[3] * t / 2, m = -i.k[3] * i.p[3] - i.c[3] * m - i.ea[3], i.v[3] = i.v[3] + (m + i.a[3]) * t / 2), this.timerMs < this.opt.warmupMs && (i.v[0] *= 1e-4, i.p[0] *= 1e-4, i.v[1] *= 1e-4, i.p[1] *= 1e-4, i.v[2] *= 1e-4, i.p[2] *= 1e-4, i.v[3] *= 1e-4, i.p[3] *= 1e-4), z[0] = i.p[0], z[1] = i.p[1], z[2] = i.p[2], z[3] = i.p[3], m = this.opt.movementFactor, z[0] *= m, z[1] *= m, z[2] *= m, z[3] *= m, i.dl && (m = i.dl, z[0] += m[0], z[1] += m[1], z[2] += m[2]), i.dw && (m = i.dw,
|
|
362
|
+
if (m = this.opt.sensitivityFactor, z[0] *= i.ext * m, z[1] *= i.ext * m, z[2] *= i.ext * m, z[3] *= i.ext * m, i.isX && (m = z[0] / t, i.ea[0] = (m - i.ev[0]) / t, i.ev[0] = m, i.a[0] = -i.k[0] * i.p[0] - i.c[0] * i.v[0] - i.ea[0], i.p[0] += i.v[0] * t + i.a[0] * t * t / 2 + z[0], m = i.v[0] + i.a[0] * t / 2, m = -i.k[0] * i.p[0] - i.c[0] * m - i.ea[0], i.v[0] = i.v[0] + (m + i.a[0]) * t / 2), i.isY && (m = z[1] / t, i.ea[1] = (m - i.ev[1]) / t, i.ev[1] = m, i.a[1] = -i.k[1] * i.p[1] - i.c[1] * i.v[1] - i.ea[1], i.p[1] += i.v[1] * t + i.a[1] * t * t / 2 + z[1], m = i.v[1] + i.a[1] * t / 2, m = -i.k[1] * i.p[1] - i.c[1] * m - i.ea[1], i.v[1] = i.v[1] + (m + i.a[1]) * t / 2), i.isZ && (m = z[2] / t, i.ea[2] = (m - i.ev[2]) / t, i.ev[2] = m, i.a[2] = -i.k[2] * i.p[2] - i.c[2] * i.v[2] - i.ea[2], i.p[2] += i.v[2] * t + i.a[2] * t * t / 2 + z[2], m = i.v[2] + i.a[2] * t / 2, m = -i.k[2] * i.p[2] - i.c[2] * m - i.ea[2], i.v[2] = i.v[2] + (m + i.a[2]) * t / 2), i.isT && (m = z[3] / t, i.ea[3] = (m - i.ev[3]) / t, i.ev[3] = m, i.a[3] = -i.k[3] * i.p[3] - i.c[3] * i.v[3] - i.ea[3], i.p[3] += i.v[3] * t + i.a[3] * t * t / 2 + z[3], m = i.v[3] + i.a[3] * t / 2, m = -i.k[3] * i.p[3] - i.c[3] * m - i.ea[3], i.v[3] = i.v[3] + (m + i.a[3]) * t / 2), this.timerMs < this.opt.warmupMs && (i.v[0] *= 1e-4, i.p[0] *= 1e-4, i.v[1] *= 1e-4, i.p[1] *= 1e-4, i.v[2] *= 1e-4, i.p[2] *= 1e-4, i.v[3] *= 1e-4, i.p[3] *= 1e-4), z[0] = i.p[0], z[1] = i.p[1], z[2] = i.p[2], z[3] = i.p[3], m = this.opt.movementFactor, z[0] *= m, z[1] *= m, z[2] *= m, z[3] *= m, i.dl && (m = i.dl, z[0] += m[0], z[1] += m[1], z[2] += m[2]), i.dw && (m = i.dw, B.set(
|
|
363
363
|
i.vBasis.x + z[0],
|
|
364
364
|
i.vBasis.y + z[1],
|
|
365
365
|
i.vBasis.z + z[2]
|
|
366
|
-
),
|
|
366
|
+
), B.applyMatrix4(we), B.x += m[0], B.y += m[1], B.z += m[2], B.applyMatrix4(Ce), z[0] += B.x - i.vBasis.x, z[1] += B.y - i.vBasis.y, z[2] += B.z - i.vBasis.z), i.limits && this.opt.isLimits && (m = i.limits, m[0] && (m[0][0] !== null && z[0] < m[0][0] && (z[0] = m[0][0]), m[0][1] !== null && z[0] > m[0][1] && (z[0] = m[0][1])), m[1] && (m[1][0] !== null && z[1] < m[1][0] && (z[1] = m[1][0]), m[1][1] !== null && z[1] > m[1][1] && (z[1] = m[1][1])), m[2] && (m[2][0] !== null && z[2] < m[2][0] && (z[2] = m[2][0]), m[2][1] !== null && z[2] > m[2][1] && (z[2] = m[2][1])), m[3] && (m[3][0] !== null && z[3] < m[3][0] && (z[3] = m[3][0]), m[3][1] !== null && z[3] > m[3][1] && (z[3] = m[3][1]))), i.isPoint)
|
|
367
367
|
i.bone.position.set(
|
|
368
368
|
i.vBasis.x + z[0],
|
|
369
369
|
i.vBasis.y + z[1],
|
|
370
370
|
i.vBasis.z - z[2]
|
|
371
371
|
);
|
|
372
|
-
else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(
|
|
372
|
+
else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(B, de, he), B.copy(Ge).applyQuaternion(de).setY(0).normalize(), de.premultiply(Ke.setFromUnitVectors(Ge, B).invert()).normalize(), i.boneParent.quaternion.multiply(de.invert()), i.boneParent.quaternion.multiply(i.qWorldInverseYaw)), i.isZ && (m = Math.atan(z[0] / i.l), de.setFromAxisAngle(mt, -m), i.boneParent.quaternion.multiply(de)), i.isY && (m = i.l / 3, m = m * Math.tanh(z[1] / m), i.bone.position.setLength(i.l + m)), i.isX && (m = Math.atan(z[2] / i.l), de.setFromAxisAngle(ht, -m), i.boneParent.quaternion.multiply(de)), i.isT && (m = 1.5 * Math.tanh(z[3] * 1.5), de.setFromAxisAngle(dt, -m), i.boneParent.quaternion.multiply(de)), i.boneParent.updateWorldMatrix(!1, !0), i.excludes && this.opt.isExcludes)
|
|
373
373
|
for (n = 0, s = i.excludes.length; n < s; n++)
|
|
374
|
-
m = i.excludes[n],
|
|
374
|
+
m = i.excludes[n], he.set(0, 0, 0), m.deltaLocal && (he.x += m.deltaLocal[0], he.y += m.deltaLocal[1], he.z += m.deltaLocal[2]), he.applyMatrix4(m.bone.matrixWorld), Ce.copy(i.boneParent.matrixWorld).invert(), he.applyMatrix4(Ce), B.copy(i.bone.position), !(B.distanceToSquared(he) >= m.radiusSq) && (Re = B.length(), fe = he.length(), !(fe > m.radius + Re) && (fe < Math.abs(m.radius - Re) || (fe = (fe * fe + Re * Re - m.radiusSq) / (2 * fe), he.normalize(), Ve.copy(he).multiplyScalar(fe), fe = Math.sqrt(Re * Re - fe * fe), B.subVectors(B, Ve).projectOnPlane(he).normalize().multiplyScalar(fe), We.subVectors(i.vBasis, Ve).projectOnPlane(he).normalize(), Re = We.dot(B), Re < 0 && (Re = Math.sqrt(fe * fe - Re * Re), We.multiplyScalar(Re), B.add(We)), B.add(Ve).normalize(), he.copy(i.bone.position).normalize(), de.setFromUnitVectors(he, B), i.boneParent.quaternion.premultiply(de), i.boneParent.updateWorldMatrix(!1, !0))));
|
|
375
375
|
}
|
|
376
376
|
this.helpers.isActive && this.updateHelpers();
|
|
377
377
|
}
|
|
@@ -445,14 +445,14 @@ class mt {
|
|
|
445
445
|
Ce.copy(this.armature.matrixWorld).invert();
|
|
446
446
|
const t = m.object.geometry.getAttribute("position");
|
|
447
447
|
for (let e = 0, n = m.bones.length; e < n; e++)
|
|
448
|
-
we.multiplyMatrices(Ce, m.bones[e].matrixWorld),
|
|
448
|
+
we.multiplyMatrices(Ce, m.bones[e].matrixWorld), B.setFromMatrixPosition(we), t.setXYZ(e, B.x, B.y, B.z);
|
|
449
449
|
t.needsUpdate = !0, m.object.updateMatrixWorld();
|
|
450
450
|
}
|
|
451
451
|
if (m = this.helpers.lines, m.bones.length) {
|
|
452
452
|
Ce.copy(this.armature.matrixWorld).invert();
|
|
453
453
|
const t = m.object.geometry.getAttribute("position");
|
|
454
454
|
for (let e = 0, n = 0, o = m.bones.length; e < o; e++, n += 2)
|
|
455
|
-
we.multiplyMatrices(Ce, m.bones[e].matrixWorld),
|
|
455
|
+
we.multiplyMatrices(Ce, m.bones[e].matrixWorld), B.setFromMatrixPosition(we), t.setXYZ(n, B.x, B.y, B.z), we.multiplyMatrices(Ce, m.bones[e].parent.matrixWorld), B.setFromMatrixPosition(we), t.setXYZ(n + 1, B.x, B.y, B.z);
|
|
456
456
|
t.needsUpdate = !0, m.object.updateMatrixWorld();
|
|
457
457
|
}
|
|
458
458
|
}
|
|
@@ -489,7 +489,7 @@ class mt {
|
|
|
489
489
|
this.stop(), this.scene = null, this.armature = null, this.config = [], this.data = [], this.dict = {}, this.objectsUpdate = [], this.timerMs = 0;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
class
|
|
492
|
+
class gt {
|
|
493
493
|
constructor(t) {
|
|
494
494
|
this.audioContext = t, this.analyzer = null, this.dataArray = null, this.bufferLength = 0;
|
|
495
495
|
}
|
|
@@ -608,8 +608,8 @@ class pt {
|
|
|
608
608
|
for (let r = 0; r < o / 2; r++) {
|
|
609
609
|
const d = n[(c + r) * 2], h = n[(c + r) * 2 + 1], g = n[(c + r + o / 2) * 2] * l - n[(c + r + o / 2) * 2 + 1] * u, R = n[(c + r + o / 2) * 2] * u + n[(c + r + o / 2) * 2 + 1] * l;
|
|
610
610
|
n[(c + r) * 2] = d + g, n[(c + r) * 2 + 1] = h + R, n[(c + r + o / 2) * 2] = d - g, n[(c + r + o / 2) * 2 + 1] = h - R;
|
|
611
|
-
const b = l * i - u * a,
|
|
612
|
-
l = b, u =
|
|
611
|
+
const b = l * i - u * a, k = l * a + u * i;
|
|
612
|
+
l = b, u = k;
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
}
|
|
@@ -814,7 +814,7 @@ class pt {
|
|
|
814
814
|
return o * s;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
class
|
|
817
|
+
class yt {
|
|
818
818
|
/**
|
|
819
819
|
* @constructor
|
|
820
820
|
*/
|
|
@@ -1396,11 +1396,11 @@ class gt {
|
|
|
1396
1396
|
return e;
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1399
|
+
const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1400
1400
|
__proto__: null,
|
|
1401
|
-
LipsyncEn:
|
|
1401
|
+
LipsyncEn: yt
|
|
1402
1402
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1403
|
-
class
|
|
1403
|
+
class xt {
|
|
1404
1404
|
/**
|
|
1405
1405
|
* @constructor
|
|
1406
1406
|
*/
|
|
@@ -1754,11 +1754,11 @@ class ft {
|
|
|
1754
1754
|
return e;
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
-
const
|
|
1757
|
+
const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1758
1758
|
__proto__: null,
|
|
1759
|
-
LipsyncDe:
|
|
1759
|
+
LipsyncDe: xt
|
|
1760
1760
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1761
|
-
class
|
|
1761
|
+
class Rt {
|
|
1762
1762
|
/**
|
|
1763
1763
|
* @constructor
|
|
1764
1764
|
*/
|
|
@@ -2289,11 +2289,11 @@ class bt {
|
|
|
2289
2289
|
return e;
|
|
2290
2290
|
}
|
|
2291
2291
|
}
|
|
2292
|
-
const
|
|
2292
|
+
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2293
2293
|
__proto__: null,
|
|
2294
|
-
LipsyncFr:
|
|
2294
|
+
LipsyncFr: Rt
|
|
2295
2295
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2296
|
-
class
|
|
2296
|
+
class It {
|
|
2297
2297
|
/**
|
|
2298
2298
|
* @constructor
|
|
2299
2299
|
*/
|
|
@@ -2436,11 +2436,11 @@ class vt {
|
|
|
2436
2436
|
return e;
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
|
-
const
|
|
2439
|
+
const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2440
2440
|
__proto__: null,
|
|
2441
|
-
LipsyncFi:
|
|
2441
|
+
LipsyncFi: It
|
|
2442
2442
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2443
|
-
class
|
|
2443
|
+
class Lt {
|
|
2444
2444
|
/**
|
|
2445
2445
|
* @constructor
|
|
2446
2446
|
*/
|
|
@@ -2620,21 +2620,21 @@ class At {
|
|
|
2620
2620
|
return e;
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
|
2623
|
-
const
|
|
2623
|
+
const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2624
2624
|
__proto__: null,
|
|
2625
|
-
LipsyncLt:
|
|
2626
|
-
}, Symbol.toStringTag, { value: "Module" })), St = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxI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HRoaXMuX2J1ZmZlclF1ZXVlLmxlbmd0aCA+IDApIHsKICAgICAgICAgIHRoaXMuX2N1cnJlbnRDaHVuayA9IHRoaXMuX2J1ZmZlclF1ZXVlLnNoaWZ0KCk7CiAgICAgICAgICB0aGlzLl9jdXJyZW50Q2h1bmtPZmZzZXQgPSAwOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAvLyBCdWZmZXIgaXMgZW1wdHkuIENoZWNrIGZvciBlbmQgY29uZGl0aW9ucy4KICAgICAgICAgIGNvbnN0IGlzVGltZWRPdXQgPSB0aGlzLl9zaWxlbmNlRnJhbWVzQ291bnQgPiB0aGlzLl9zaWxlbmNlVGhyZXNob2xkQmxvY2tzOwoKICAgICAgICAgIGlmICh0aGlzLl9ub01vcmVEYXRhUmVjZWl2ZWQgfHwgaXNUaW1lZE91dCkgewogICAgICAgICAgICAvLyBFTkQgT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLnJlc2V0KCk7IC8vIFJlc2V0IHRvIElETEUgc3RhdGUgZm9yIHJldXNlCiAgICAgICAgICAgIGJyZWFrOyAvLyBFeGl0IHdoaWxlIGxvb3AKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIEJVRkZFUiBVTkRFUlJVTiAoTEFHKTogUGxheSBzaWxlbmNlIGFuZCB3YWl0IGZvciBtb3JlIGRhdGEuCiAgICAgICAgICAgIHRoaXMuX3NpbGVuY2VGcmFtZXNDb3VudCsrOwogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHRoaXMuX3VuZGVycnVuQmxvY2tzKys7CiAgICAgICAgICAgIGJyZWFrOyAvLyBFeGl0IHdoaWxlIGxvb3AKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KCiAgICAgIC8vIElmIHdlIGhhdmUgYSBjaHVuayAoY291bGQgYmUgYSBuZXcgb25lIGZyb20gdGhlIGxvZ2ljIGFib3ZlKSwgcHJvY2VzcyBpdC4KICAgICAgaWYgKHRoaXMuX2N1cnJlbnRDaHVuaykgewogIC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dW5kKChxdWV1ZWRTYW1wbGVzIC8gdGhpcy5fc2FtcGxlUmF0ZSkgKiAxMDAwKSwKICAgICAgICAgICAgICBtYXhRdWV1ZWRNczogTWF0aC5yb3VuZCgodGhpcy5fbWF4UXVldWVTYW1wbGVzIC8gdGhpcy5fc2FtcGxlUmF0ZSkgKiAxMDAwKSwKICAgICAgICAgICAgICB1bmRlcnJ1bkJsb2NrczogdGhpcy5fdW5kZXJydW5CbG9ja3MsCiAgICAgICAgICAgICAgZnJhbWVzUHJvY2Vzc2VkOiB0aGlzLl9mcmFtZXNQcm9jZXNzZWQKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSBjYXRjaCAoXykgeyB9CiAgICAgICAgLy8gRG9uJ3QgcmVzZXQgbWF4IHRyYWNrZXIgLSBrZWVwIHNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), Ke = {
|
|
2627
|
-
en:
|
|
2628
|
-
de:
|
|
2629
|
-
fr:
|
|
2630
|
-
fi:
|
|
2631
|
-
lt:
|
|
2632
|
-
},
|
|
2625
|
+
LipsyncLt: Lt
|
|
2626
|
+
}, Symbol.toStringTag, { value: "Module" })), kt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5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HNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLnJlc2V0KCk7IC8vIFJlc2V0IHRvIElETEUgc3RhdGUgZm9yIHJldXNlCiAgICAgICAgICAgIGJyZWFrOyAvLyBFeGl0IHdoaWxlIGxvb3AKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIEJVRkZFUiBVTkRFUlJVTiAoTEFHKTogUGxheSBzaWxlbmNlIGFuZCB3YWl0IGZvciBtb3JlIGRhdGEuCiAgICAgICAgICAgIHRoaXMuX3NpbGVuY2VGcmFtZXNDb3VudCsrOwogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0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2632
|
+
}, oe = new x.Quaternion(), Q = new x.Euler(), Te = new x.Vector3(), Ee = new x.Vector3(), Je = new x.Box3();
|
|
2633
2633
|
new x.Matrix4();
|
|
2634
2634
|
new x.Matrix4();
|
|
2635
2635
|
new x.Vector3();
|
|
2636
2636
|
new x.Vector3(0, 0, 1);
|
|
2637
|
-
const
|
|
2637
|
+
const wt = new x.Vector3(1, 0, 0);
|
|
2638
2638
|
new x.Vector3(0, 1, 0);
|
|
2639
2639
|
new x.Vector3(0, 0, 1);
|
|
2640
2640
|
class Qe {
|
|
@@ -2763,7 +2763,7 @@ class Qe {
|
|
|
2763
2763
|
avatarOnlyCamera: null,
|
|
2764
2764
|
statsNode: null,
|
|
2765
2765
|
statsStyle: null
|
|
2766
|
-
}, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new
|
|
2766
|
+
}, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new ct(), this.opt.statsStyle && (this.stats.dom.style.cssText = this.opt.statsStyle), this.opt.statsNode.appendChild(this.stats.dom)), this.poseTemplates = {
|
|
2767
2767
|
side: {
|
|
2768
2768
|
standing: !0,
|
|
2769
2769
|
props: {
|
|
@@ -4086,7 +4086,7 @@ class Qe {
|
|
|
4086
4086
|
this.opt.lightSpotDispersion
|
|
4087
4087
|
), this.setLighting(this.opt);
|
|
4088
4088
|
const a = new x.PMREMGenerator(this.renderer);
|
|
4089
|
-
a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new
|
|
4089
|
+
a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new ut()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new rt(this.camera, this.renderer.domElement), this.controls.enableZoom = this.opt.cameraZoomEnable, this.controls.enableRotate = this.opt.cameraRotateEnable, this.controls.enablePan = this.opt.cameraPanEnable, this.controls.minDistance = 2, this.controls.maxDistance = 2e3, this.controls.autoRotateSpeed = 0, this.controls.autoRotate = !1, this.controls.update(), this.cameraClock = null;
|
|
4090
4090
|
}
|
|
4091
4091
|
this.ikMesh = new x.SkinnedMesh();
|
|
4092
4092
|
const s = {
|
|
@@ -4104,14 +4104,14 @@ class Qe {
|
|
|
4104
4104
|
Object.entries(s).forEach((a, c) => {
|
|
4105
4105
|
const l = new x.Bone();
|
|
4106
4106
|
l.name = a[0], a[1] ? this.ikMesh.getObjectByName(a[1]).add(l) : this.ikMesh.add(l), i.push(l);
|
|
4107
|
-
}), this.ikMesh.bind(new x.Skeleton(i)), this.dynamicbones = new
|
|
4107
|
+
}), this.ikMesh.bind(new x.Skeleton(i)), this.dynamicbones = new pt(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
|
|
4108
4108
|
}
|
|
4109
4109
|
/**
|
|
4110
4110
|
* Helper that re/creates the audio context and the other nodes.
|
|
4111
4111
|
* @param {number} sampleRate
|
|
4112
4112
|
*/
|
|
4113
4113
|
initAudioGraph(t = null) {
|
|
4114
|
-
if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), t ? this.audioCtx = new AudioContext({ sampleRate: t }) : this.audioCtx = new AudioContext(), this.audioSpeechSource = this.audioCtx.createBufferSource(), this.audioBackgroundSource = this.audioCtx.createBufferSource(), this.audioBackgroundGainNode = this.audioCtx.createGain(), this.audioSpeechGainNode = this.audioCtx.createGain(), this.audioStreamGainNode = this.audioCtx.createGain(), this.audioAnalyzerNode = this.audioCtx.createAnalyser(), this.audioAnalyzerNode.fftSize = 256, this.audioAnalyzerNode.smoothingTimeConstant = 0.1, this.audioAnalyzerNode.minDecibels = -70, this.audioAnalyzerNode.maxDecibels = -10, this.audioAnalyzer = new
|
|
4114
|
+
if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), t ? this.audioCtx = new AudioContext({ sampleRate: t }) : this.audioCtx = new AudioContext(), this.audioSpeechSource = this.audioCtx.createBufferSource(), this.audioBackgroundSource = this.audioCtx.createBufferSource(), this.audioBackgroundGainNode = this.audioCtx.createGain(), this.audioSpeechGainNode = this.audioCtx.createGain(), this.audioStreamGainNode = this.audioCtx.createGain(), this.audioAnalyzerNode = this.audioCtx.createAnalyser(), this.audioAnalyzerNode.fftSize = 256, this.audioAnalyzerNode.smoothingTimeConstant = 0.1, this.audioAnalyzerNode.minDecibels = -70, this.audioAnalyzerNode.maxDecibels = -10, this.audioAnalyzer = new gt(this.audioCtx), this.audioReverbNode = this.audioCtx.createConvolver(), this.audioBackgroundGainNode.connect(this.audioReverbNode), this.audioAnalyzerNode.connect(this.audioSpeechGainNode), this.audioSpeechGainNode.connect(this.audioReverbNode), this.audioStreamGainNode.connect(this.audioReverbNode), this.audioReverbNode.connect(this.audioCtx.destination), this.setReverb(this.currentReverb || null), this.setMixerGain(
|
|
4115
4115
|
this.opt.mixerGainSpeech,
|
|
4116
4116
|
this.opt.mixerGainBackground
|
|
4117
4117
|
), this.workletLoaded = !1, this.streamWorkletNode) {
|
|
@@ -4228,13 +4228,13 @@ class Qe {
|
|
|
4228
4228
|
const r = s.morphTargetDictionary[l], d = i.morphAttributes.position[r], h = i.morphAttributes.normal?.[r];
|
|
4229
4229
|
a || (a = new x.Float32BufferAttribute(d.count * 3, 3), h && (c = new x.Float32BufferAttribute(d.count * 3, 3)));
|
|
4230
4230
|
for (let g = 0; g < d.count; g++) {
|
|
4231
|
-
const R = a.getX(g) + d.getX(g) * u, b = a.getY(g) + d.getY(g) * u,
|
|
4232
|
-
a.setXYZ(g, R, b,
|
|
4231
|
+
const R = a.getX(g) + d.getX(g) * u, b = a.getY(g) + d.getY(g) * u, k = a.getZ(g) + d.getZ(g) * u;
|
|
4232
|
+
a.setXYZ(g, R, b, k);
|
|
4233
4233
|
}
|
|
4234
4234
|
if (h)
|
|
4235
4235
|
for (let g = 0; g < d.count; g++) {
|
|
4236
|
-
const R = c.getX(g) + h.getX(g) * u, b = c.getY(g) + h.getY(g) * u,
|
|
4237
|
-
c.setXYZ(g, R, b,
|
|
4236
|
+
const R = c.getX(g) + h.getX(g) * u, b = c.getY(g) + h.getY(g) * u, k = c.getZ(g) + h.getZ(g) * u;
|
|
4237
|
+
c.setXYZ(g, R, b, k);
|
|
4238
4238
|
}
|
|
4239
4239
|
}
|
|
4240
4240
|
if (a) {
|
|
@@ -4252,9 +4252,9 @@ class Qe {
|
|
|
4252
4252
|
async showAvatar(t, e = null) {
|
|
4253
4253
|
if (!t || !t.hasOwnProperty("url"))
|
|
4254
4254
|
throw new Error("Invalid parameter. The avatar must have at least 'url' specified.");
|
|
4255
|
-
const n = new
|
|
4255
|
+
const n = new at();
|
|
4256
4256
|
if (this.dracoEnabled) {
|
|
4257
|
-
const l = new
|
|
4257
|
+
const l = new lt();
|
|
4258
4258
|
l.setDecoderPath(this.dracoDecoderPath), n.setDRACOLoader(l);
|
|
4259
4259
|
}
|
|
4260
4260
|
let o = await n.loadAsync(t.url, e);
|
|
@@ -4412,9 +4412,9 @@ class Qe {
|
|
|
4412
4412
|
updatePoseDelta() {
|
|
4413
4413
|
for (const [t, e] of Object.entries(this.poseDelta.props)) {
|
|
4414
4414
|
if (e.x === 0 && e.y === 0 && e.z === 0) continue;
|
|
4415
|
-
|
|
4415
|
+
Q.set(e.x, e.y, e.z);
|
|
4416
4416
|
const n = this.poseAvatar.props[t];
|
|
4417
|
-
n.isQuaternion ? (
|
|
4417
|
+
n.isQuaternion ? (oe.setFromEuler(Q), n.multiply(oe)) : n.isVector3 && n.add(Q);
|
|
4418
4418
|
}
|
|
4419
4419
|
}
|
|
4420
4420
|
/**
|
|
@@ -5179,7 +5179,7 @@ class Qe {
|
|
|
5179
5179
|
}, o.x ? new x.Vector3(o.x, o.y, o.z) : null, !0, o.d);
|
|
5180
5180
|
break;
|
|
5181
5181
|
}
|
|
5182
|
-
if ((c || l) && (
|
|
5182
|
+
if ((c || l) && (Q.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), Q.x = Math.max(-0.9, Math.min(0.9, 2 * Q.x - 0.5)), Q.y = Math.max(-0.9, Math.min(0.9, -2.5 * Q.y)), c ? (Object.assign(this.mtAvatar.eyesLookDown, { system: Q.x < 0 ? -Q.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: Q.x < 0 ? 0 : Q.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: Q.y < 0 ? -Q.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: Q.y < 0 ? 0 : Q.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: Q.y < 0 ? 0 : Q.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: Q.y < 0 ? -Q.y : 0, needsUpdate: !0 }), l && (n = -this.mtAvatar.bodyRotateY.value, o = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
|
|
5183
5183
|
name: "headmove",
|
|
5184
5184
|
dt: [[1e3, 2e3], [1e3, 2e3, 1, 2], [1e3, 2e3], [1e3, 2e3, 1, 2]],
|
|
5185
5185
|
vs: {
|
|
@@ -5200,7 +5200,7 @@ class Qe {
|
|
|
5200
5200
|
eyeLookOutRight: [null, 0],
|
|
5201
5201
|
eyeContact: [0]
|
|
5202
5202
|
}
|
|
5203
|
-
})))), e > 2 * this.animFrameDur && (e = 2 * this.animFrameDur), (this.viewName !== "full" || this.isAvatarOnly) && (n = this.mtRandomized[Math.floor(Math.random() * this.mtRandomized.length)], o = this.mtAvatar[n], o.needsUpdate || Object.assign(o, { base: (this.mood.baseline[n] || 0) + (1 + a / 255) * Math.random() / 5, needsUpdate: !0 })), this.updatePoseBase(this.animClock), this.mixer && this.mixer.update(e / 1e3 * this.mixer.timeScale), this.updatePoseDelta(), (this.isSpeaking || this.isListening) && c ? a > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = a) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), n = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(n), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(n) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (
|
|
5203
|
+
})))), e > 2 * this.animFrameDur && (e = 2 * this.animFrameDur), (this.viewName !== "full" || this.isAvatarOnly) && (n = this.mtRandomized[Math.floor(Math.random() * this.mtRandomized.length)], o = this.mtAvatar[n], o.needsUpdate || Object.assign(o, { base: (this.mood.baseline[n] || 0) + (1 + a / 255) * Math.random() / 5, needsUpdate: !0 })), this.updatePoseBase(this.animClock), this.mixer && this.mixer.update(e / 1e3 * this.mixer.timeScale), this.updatePoseDelta(), (this.isSpeaking || this.isListening) && c ? a > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = a) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), n = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(n), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(n) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (oe.setFromAxisAngle(wt, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(oe)), Je.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(Te), Te.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(Ee), Ee.sub(this.armature.position), this.objectHips.position.y -= Je.min.y / 2, this.objectHips.position.x -= (Te.x + Ee.x) / 4, this.objectHips.position.z -= (Te.z + Ee.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
|
|
5204
5204
|
this.stats && this.stats.end();
|
|
5205
5205
|
else {
|
|
5206
5206
|
if (this.cameraClock !== null && this.cameraClock < 1e3) {
|
|
@@ -5231,8 +5231,8 @@ class Qe {
|
|
|
5231
5231
|
if (!this.lipsync.hasOwnProperty(t)) {
|
|
5232
5232
|
const n = t.toLowerCase(), o = "Lipsync" + t.charAt(0).toUpperCase() + t.slice(1);
|
|
5233
5233
|
try {
|
|
5234
|
-
const s =
|
|
5235
|
-
s && s[o] ? this.lipsync[t] = new s[o]() : console.warn(`Lip-sync module for ${t} not found. Available modules:`, Object.keys(
|
|
5234
|
+
const s = $e[n];
|
|
5235
|
+
s && s[o] ? this.lipsync[t] = new s[o]() : console.warn(`Lip-sync module for ${t} not found. Available modules:`, Object.keys($e));
|
|
5236
5236
|
} catch (s) {
|
|
5237
5237
|
console.warn(`Failed to load lip-sync module for ${t}:`, s);
|
|
5238
5238
|
}
|
|
@@ -5271,10 +5271,10 @@ class Qe {
|
|
|
5271
5271
|
let u = "", r = "", d = 0, h = [], g = [];
|
|
5272
5272
|
const R = Array.from(this.segmenter.segment(t), (b) => b.segment);
|
|
5273
5273
|
for (let b = 0; b < R.length; b++) {
|
|
5274
|
-
const
|
|
5274
|
+
const k = b === R.length - 1, T = R[b].match(a);
|
|
5275
5275
|
let p = R[b].match(s);
|
|
5276
|
-
const
|
|
5277
|
-
if (p && !
|
|
5276
|
+
const O = R[b].match(c), E = R[b].match(i);
|
|
5277
|
+
if (p && !k && !O && R[b + 1].match(s) && (p = !1), n && (u += R[b]), T && (!o || o.every((y) => b < y[0] || b > y[1])) && (r += R[b]), (E || p || k) && (r.length && (r = this.lipsyncPreProcessText(r, l), r.length && h.push({
|
|
5278
5278
|
mark: d,
|
|
5279
5279
|
word: r
|
|
5280
5280
|
})), u.length && (g.push({
|
|
@@ -5300,14 +5300,14 @@ class Qe {
|
|
|
5300
5300
|
}
|
|
5301
5301
|
r = "", d++;
|
|
5302
5302
|
}
|
|
5303
|
-
if (p ||
|
|
5304
|
-
if (h.length ||
|
|
5303
|
+
if (p || k) {
|
|
5304
|
+
if (h.length || k && g.length) {
|
|
5305
5305
|
const y = {
|
|
5306
5306
|
anim: g
|
|
5307
5307
|
};
|
|
5308
5308
|
n && (y.onSubtitles = n), h.length && !e.avatarMute && (y.text = h, e.avatarMood && (y.mood = e.avatarMood), e.ttsLang && (y.lang = e.ttsLang), e.ttsVoice && (y.voice = e.ttsVoice), e.ttsRate && (y.rate = e.ttsRate), e.ttsVoice && (y.pitch = e.ttsPitch), e.ttsVolume && (y.volume = e.ttsVolume)), this.speechQueue.push(y), h = [], r = "", d = 0, g = [];
|
|
5309
5309
|
}
|
|
5310
|
-
if (
|
|
5310
|
+
if (O) {
|
|
5311
5311
|
let y = this.animEmojis[R[b]];
|
|
5312
5312
|
y && y.link && (y = this.animEmojis[y.link]), y && this.speechQueue.push({ emoji: y });
|
|
5313
5313
|
}
|
|
@@ -5405,10 +5405,10 @@ class Qe {
|
|
|
5405
5405
|
let R = 0.6 + this.convertRange(g, [0, u], [0, 0.4]);
|
|
5406
5406
|
if (u = Math.min(u, d.visemes.length * 200), h > 0)
|
|
5407
5407
|
for (let b = 0; b < d.visemes.length; b++) {
|
|
5408
|
-
const
|
|
5408
|
+
const k = l + d.times[b] / h * u, T = d.durations[b] / h * u;
|
|
5409
5409
|
i.push({
|
|
5410
5410
|
template: { name: "viseme" },
|
|
5411
|
-
ts: [
|
|
5411
|
+
ts: [k - Math.min(60, 2 * T / 3), k + Math.min(25, T / 2), k + T + Math.min(60, T / 2)],
|
|
5412
5412
|
vs: {
|
|
5413
5413
|
["viseme_" + d.visemes[b]]: [null, d.visemes[b] === "PP" || d.visemes[b] === "FF" ? 0.9 : R, 0]
|
|
5414
5414
|
}
|
|
@@ -5490,15 +5490,15 @@ class Qe {
|
|
|
5490
5490
|
s.lang = i, s.rate = Math.max(0.1, Math.min(10, a)), s.pitch = Math.max(0, Math.min(2, c)), s.volume = Math.max(0, Math.min(1, l));
|
|
5491
5491
|
const u = speechSynthesis.getVoices(), r = t.voice || this.avatar.ttsVoice || this.opt.ttsVoice;
|
|
5492
5492
|
if (r && u.length > 0) {
|
|
5493
|
-
const p = u.find((
|
|
5493
|
+
const p = u.find((O) => O.name.includes(r) || O.lang === i);
|
|
5494
5494
|
p && (s.voice = p);
|
|
5495
5495
|
}
|
|
5496
|
-
const d = o.length * 100 / s.rate, h = this.audioCtx.createBuffer(1, this.audioCtx.sampleRate * (d / 1e3), this.audioCtx.sampleRate), g = this.avatar.lipsyncLang || this.opt.lipsyncLang || "en", R = this.lipsyncPreProcessText(o, g), b = this.lipsyncWordsToVisemes(R, g),
|
|
5496
|
+
const d = o.length * 100 / s.rate, h = this.audioCtx.createBuffer(1, this.audioCtx.sampleRate * (d / 1e3), this.audioCtx.sampleRate), g = this.avatar.lipsyncLang || this.opt.lipsyncLang || "en", R = this.lipsyncPreProcessText(o, g), b = this.lipsyncWordsToVisemes(R, g), k = [];
|
|
5497
5497
|
if (b && b.visemes && b.visemes.length > 0) {
|
|
5498
5498
|
const p = b.times[b.visemes.length - 1] + b.durations[b.visemes.length - 1];
|
|
5499
|
-
for (let
|
|
5500
|
-
const E = b.visemes[
|
|
5501
|
-
|
|
5499
|
+
for (let O = 0; O < b.visemes.length; O++) {
|
|
5500
|
+
const E = b.visemes[O], y = b.times[O] / p, F = b.durations[O] / p, f = y * d, w = F * d;
|
|
5501
|
+
k.push({
|
|
5502
5502
|
template: { name: "viseme" },
|
|
5503
5503
|
ts: [f - Math.min(60, 2 * w / 3), f + Math.min(25, w / 2), f + w + Math.min(60, w / 2)],
|
|
5504
5504
|
vs: {
|
|
@@ -5507,7 +5507,7 @@ class Qe {
|
|
|
5507
5507
|
});
|
|
5508
5508
|
}
|
|
5509
5509
|
}
|
|
5510
|
-
const T = [...t.anim, ...
|
|
5510
|
+
const T = [...t.anim, ...k];
|
|
5511
5511
|
this.audioPlaylist.push({ anim: T, audio: h }), this.onSubtitles = t.onSubtitles || null, this.resetLips(), t.mood && this.setMood(t.mood), this.playAudio(), s.onend = () => {
|
|
5512
5512
|
e();
|
|
5513
5513
|
}, s.onerror = (p) => {
|
|
@@ -5573,8 +5573,8 @@ class Qe {
|
|
|
5573
5573
|
const h = e.toLowerCase().split(/\s+/), g = [];
|
|
5574
5574
|
for (const R of h)
|
|
5575
5575
|
for (const b of R) {
|
|
5576
|
-
let
|
|
5577
|
-
"aeiou".includes(b) ?
|
|
5576
|
+
let k = "aa";
|
|
5577
|
+
"aeiou".includes(b) ? k = "aa" : "bp".includes(b) ? k = "PP" : "fv".includes(b) ? k = "FF" : "st".includes(b) ? k = "SS" : "dln".includes(b) ? k = "DD" : "kg".includes(b) ? k = "kk" : "rw".includes(b) && (k = "RR"), g.push(k);
|
|
5578
5578
|
}
|
|
5579
5579
|
l = {
|
|
5580
5580
|
visemes: g.map((R, b) => ({
|
|
@@ -5655,8 +5655,8 @@ class Qe {
|
|
|
5655
5655
|
const h = e.toLowerCase().split(/\s+/), g = [];
|
|
5656
5656
|
for (const R of h)
|
|
5657
5657
|
for (const b of R) {
|
|
5658
|
-
let
|
|
5659
|
-
"aeiou".includes(b) ?
|
|
5658
|
+
let k = "aa";
|
|
5659
|
+
"aeiou".includes(b) ? k = "aa" : "bp".includes(b) ? k = "PP" : "fv".includes(b) ? k = "FF" : "st".includes(b) ? k = "SS" : "dln".includes(b) ? k = "DD" : "kg".includes(b) ? k = "kk" : "rw".includes(b) && (k = "RR"), g.push(k);
|
|
5660
5660
|
}
|
|
5661
5661
|
l = {
|
|
5662
5662
|
visemes: g.map((R, b) => ({
|
|
@@ -5861,7 +5861,7 @@ class Qe {
|
|
|
5861
5861
|
}
|
|
5862
5862
|
if (!this.workletLoaded)
|
|
5863
5863
|
try {
|
|
5864
|
-
const a = this.audioCtx.audioWorklet.addModule(
|
|
5864
|
+
const a = this.audioCtx.audioWorklet.addModule(kt.href), c = new Promise(
|
|
5865
5865
|
(l, u) => setTimeout(() => u(new Error("Worklet loading timed out")), 5e3)
|
|
5866
5866
|
);
|
|
5867
5867
|
await Promise.race([a, c]), this.workletLoaded = !0;
|
|
@@ -6112,14 +6112,14 @@ class Qe {
|
|
|
6112
6112
|
this.lookAt(null, null, t);
|
|
6113
6113
|
return;
|
|
6114
6114
|
}
|
|
6115
|
-
this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), Te.setFromMatrixPosition(this.objectLeftEye.matrixWorld), Ee.setFromMatrixPosition(this.objectRightEye.matrixWorld), Te.add(Ee).divideScalar(2),
|
|
6115
|
+
this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), Te.setFromMatrixPosition(this.objectLeftEye.matrixWorld), Ee.setFromMatrixPosition(this.objectRightEye.matrixWorld), Te.add(Ee).divideScalar(2), oe.copy(this.armature.quaternion), oe.multiply(this.poseTarget.props["Hips.quaternion"]), oe.multiply(this.poseTarget.props["Spine.quaternion"]), oe.multiply(this.poseTarget.props["Spine1.quaternion"]), oe.multiply(this.poseTarget.props["Spine2.quaternion"]), oe.multiply(this.poseTarget.props["Neck.quaternion"]), oe.multiply(this.poseTarget.props["Head.quaternion"]);
|
|
6116
6116
|
const n = new x.Vector3().subVectors(e, Te).normalize(), o = Math.atan2(n.x, n.z), s = Math.asin(-n.y);
|
|
6117
|
-
|
|
6118
|
-
const a = new x.Quaternion().setFromEuler(
|
|
6119
|
-
|
|
6120
|
-
let l =
|
|
6117
|
+
Q.set(s, o, 0, "YXZ");
|
|
6118
|
+
const a = new x.Quaternion().setFromEuler(Q), c = new x.Quaternion().copy(a).multiply(oe.clone().invert());
|
|
6119
|
+
Q.setFromQuaternion(c, "YXZ");
|
|
6120
|
+
let l = Q.x / (40 / 24) + 0.2, u = Q.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, l)), d = Math.min(0.8, Math.max(-0.8, u)), h = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
|
|
6121
6121
|
if (t) {
|
|
6122
|
-
let R = this.animQueue.findIndex((
|
|
6122
|
+
let R = this.animQueue.findIndex((k) => k.template.name === "lookat");
|
|
6123
6123
|
R !== -1 && this.animQueue.splice(R, 1);
|
|
6124
6124
|
const b = {
|
|
6125
6125
|
name: "lookat",
|
|
@@ -6152,19 +6152,19 @@ class Qe {
|
|
|
6152
6152
|
const s = new x.Vector3().setFromMatrixPosition(this.objectLeftEye.matrixWorld), i = new x.Vector3().setFromMatrixPosition(this.objectRightEye.matrixWorld), a = new x.Vector3().addVectors(s, i).divideScalar(2);
|
|
6153
6153
|
a.project(this.camera);
|
|
6154
6154
|
let c = (a.x + 1) / 2 * o.width + o.left, l = -(a.y - 1) / 2 * o.height + o.top;
|
|
6155
|
-
t === null && (t = c), e === null && (e = l),
|
|
6156
|
-
let u =
|
|
6157
|
-
b = Math.min(0.6, Math.max(-0.3, b)),
|
|
6155
|
+
t === null && (t = c), e === null && (e = l), oe.copy(this.armature.quaternion), oe.multiply(this.poseTarget.props["Hips.quaternion"]), oe.multiply(this.poseTarget.props["Spine.quaternion"]), oe.multiply(this.poseTarget.props["Spine1.quaternion"]), oe.multiply(this.poseTarget.props["Spine2.quaternion"]), oe.multiply(this.poseTarget.props["Neck.quaternion"]), oe.multiply(this.poseTarget.props["Head.quaternion"]), Q.setFromQuaternion(oe);
|
|
6156
|
+
let u = Q.x / (40 / 24), r = Q.y / (9 / 4), d = Math.min(0.4, Math.max(-0.4, this.camera.rotation.x)), h = Math.min(0.4, Math.max(-0.4, this.camera.rotation.y)), g = Math.max(window.innerWidth - c, c), R = Math.max(window.innerHeight - l, l), b = this.convertRange(e, [l - R, l + R], [-0.3, 0.6]) - u + d, k = this.convertRange(t, [c - g, c + g], [-0.8, 0.8]) - r + h;
|
|
6157
|
+
b = Math.min(0.6, Math.max(-0.3, b)), k = Math.min(0.8, Math.max(-0.8, k));
|
|
6158
6158
|
let T = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
|
|
6159
6159
|
if (n) {
|
|
6160
|
-
let
|
|
6161
|
-
|
|
6160
|
+
let O = this.animQueue.findIndex((y) => y.template.name === "lookat");
|
|
6161
|
+
O !== -1 && this.animQueue.splice(O, 1);
|
|
6162
6162
|
const E = {
|
|
6163
6163
|
name: "lookat",
|
|
6164
6164
|
dt: [750, n],
|
|
6165
6165
|
vs: {
|
|
6166
6166
|
bodyRotateX: [b + T],
|
|
6167
|
-
bodyRotateY: [
|
|
6167
|
+
bodyRotateY: [k + p],
|
|
6168
6168
|
eyesRotateX: [-3 * T + 0.1],
|
|
6169
6169
|
eyesRotateY: [-5 * p],
|
|
6170
6170
|
browInnerUp: [[0, 0.7]],
|
|
@@ -6386,7 +6386,7 @@ class Qe {
|
|
|
6386
6386
|
} catch (h) {
|
|
6387
6387
|
console.warn(`Could not verify file existence for ${t}, attempting to load anyway:`, h);
|
|
6388
6388
|
}
|
|
6389
|
-
const r = new
|
|
6389
|
+
const r = new _e();
|
|
6390
6390
|
let d;
|
|
6391
6391
|
try {
|
|
6392
6392
|
d = await r.loadAsync(t, e);
|
|
@@ -6498,11 +6498,11 @@ class Qe {
|
|
|
6498
6498
|
return H;
|
|
6499
6499
|
}
|
|
6500
6500
|
return null;
|
|
6501
|
-
},
|
|
6501
|
+
}, k = /* @__PURE__ */ new Set();
|
|
6502
6502
|
h.tracks.forEach((y) => {
|
|
6503
6503
|
const F = y.name.split(".");
|
|
6504
|
-
|
|
6505
|
-
}), Array.from(
|
|
6504
|
+
k.add(F[0]);
|
|
6505
|
+
}), Array.from(k).filter(
|
|
6506
6506
|
(y) => y.toLowerCase().includes("arm") || y.toLowerCase().includes("hand") || y.toLowerCase().includes("shoulder")
|
|
6507
6507
|
), Array.from(g).filter(
|
|
6508
6508
|
(y) => y.includes("Arm") || y.includes("Hand") || y.includes("Shoulder")
|
|
@@ -6517,18 +6517,18 @@ class Qe {
|
|
|
6517
6517
|
} else
|
|
6518
6518
|
p.add(w), (w.toLowerCase().includes("arm") || w.toLowerCase().includes("hand") || w.toLowerCase().includes("shoulder")) && console.warn(`⚠️ Arm bone "${w}" could not be mapped to avatar skeleton`);
|
|
6519
6519
|
}), T.length > 0 ? h = new x.AnimationClip(h.name, h.duration, T) : console.error("No tracks could be mapped! Animation may not work correctly.");
|
|
6520
|
-
const
|
|
6520
|
+
const O = {};
|
|
6521
6521
|
h.tracks.forEach((y) => {
|
|
6522
6522
|
y.name = y.name.replaceAll("mixamorig", "");
|
|
6523
6523
|
const F = y.name.split(".");
|
|
6524
6524
|
if (F[1] === "position") {
|
|
6525
6525
|
for (let f = 0; f < y.values.length; f++)
|
|
6526
6526
|
y.values[f] = y.values[f] * s;
|
|
6527
|
-
|
|
6528
|
-
} else F[1] === "quaternion" ?
|
|
6527
|
+
O[y.name] = new x.Vector3(y.values[0], y.values[1], y.values[2]);
|
|
6528
|
+
} else F[1] === "quaternion" ? O[y.name] = new x.Quaternion(y.values[0], y.values[1], y.values[2], y.values[3]) : F[1] === "rotation" && (O[F[0] + ".quaternion"] = new x.Quaternion().setFromEuler(new x.Euler(y.values[0], y.values[1], y.values[2], "XYZ")).normalize());
|
|
6529
6529
|
});
|
|
6530
|
-
const E = { props:
|
|
6531
|
-
|
|
6530
|
+
const E = { props: O };
|
|
6531
|
+
O["Hips.position"] && (O["Hips.position"].y < 0.5 ? E.lying = !0 : E.standing = !0), this.animClips.push({
|
|
6532
6532
|
url: t + "-" + o,
|
|
6533
6533
|
clip: h,
|
|
6534
6534
|
pose: E
|
|
@@ -6569,7 +6569,7 @@ class Qe {
|
|
|
6569
6569
|
let a = this.animQueue.find((c) => c.template.name === "pose");
|
|
6570
6570
|
a && (a.ts[0] = this.animClock + n * 1e3 + 2e3), this.setPoseFromTemplate(i);
|
|
6571
6571
|
} else {
|
|
6572
|
-
let c = await new
|
|
6572
|
+
let c = await new _e().loadAsync(t, e);
|
|
6573
6573
|
if (c && c.animations && c.animations[o]) {
|
|
6574
6574
|
let l = c.animations[o];
|
|
6575
6575
|
const u = {};
|
|
@@ -6624,7 +6624,7 @@ class Qe {
|
|
|
6624
6624
|
const d = [];
|
|
6625
6625
|
for (let R = 1; R < a.ts.length; R++) d.push(a.ts[R] - a.ts[R - 1]);
|
|
6626
6626
|
const h = i.template?.rescale || d.map((R) => R / u), g = e * 1e3 - u;
|
|
6627
|
-
a.ts = a.ts.map((R, b,
|
|
6627
|
+
a.ts = a.ts.map((R, b, k) => b === 0 ? c : k[b - 1] + d[b - 1] + h[b - 1] * g);
|
|
6628
6628
|
} else {
|
|
6629
6629
|
const d = e * 1e3 / u;
|
|
6630
6630
|
a.ts = a.ts.map((h) => c + d * (h - c));
|
|
@@ -6660,18 +6660,18 @@ class Qe {
|
|
|
6660
6660
|
const s = new x.Vector3(), i = new x.Vector3(), a = new x.Vector3(), c = new x.Vector3(), l = new x.Quaternion(), u = new x.Vector3(), r = new x.Vector3(), d = new x.Vector3(), h = this.ikMesh.getObjectByName(t.root);
|
|
6661
6661
|
h.position.setFromMatrixPosition(this.armature.getObjectByName(t.root).matrixWorld), h.quaternion.setFromRotationMatrix(this.armature.getObjectByName(t.root).matrixWorld), e && n && e.applyQuaternion(this.armature.quaternion).add(h.position);
|
|
6662
6662
|
const g = this.ikMesh.getObjectByName(t.effector), R = t.links;
|
|
6663
|
-
R.forEach((
|
|
6664
|
-
|
|
6663
|
+
R.forEach((k) => {
|
|
6664
|
+
k.bone = this.ikMesh.getObjectByName(k.link), k.bone.quaternion.copy(this.getPoseTemplateProp(k.link + ".quaternion"));
|
|
6665
6665
|
}), h.updateMatrixWorld(!0);
|
|
6666
6666
|
const b = t.iterations || 10;
|
|
6667
6667
|
if (e)
|
|
6668
|
-
for (let
|
|
6668
|
+
for (let k = 0; k < b; k++) {
|
|
6669
6669
|
let T = !1;
|
|
6670
|
-
for (let p = 0,
|
|
6670
|
+
for (let p = 0, O = R.length; p < O; p++) {
|
|
6671
6671
|
const E = R[p].bone;
|
|
6672
6672
|
E.matrixWorld.decompose(c, l, u), l.invert(), i.setFromMatrixPosition(g.matrixWorld), a.subVectors(i, c), a.applyQuaternion(l), a.normalize(), s.subVectors(e, c), s.applyQuaternion(l), s.normalize();
|
|
6673
6673
|
let y = s.dot(a);
|
|
6674
|
-
y > 1 ? y = 1 : y < -1 && (y = -1), y = Math.acos(y), !(y < 1e-5) && (R[p].minAngle !== void 0 && y < R[p].minAngle && (y = R[p].minAngle), R[p].maxAngle !== void 0 && y > R[p].maxAngle && (y = R[p].maxAngle), r.crossVectors(a, s), r.normalize(),
|
|
6674
|
+
y > 1 ? y = 1 : y < -1 && (y = -1), y = Math.acos(y), !(y < 1e-5) && (R[p].minAngle !== void 0 && y < R[p].minAngle && (y = R[p].minAngle), R[p].maxAngle !== void 0 && y > R[p].maxAngle && (y = R[p].maxAngle), r.crossVectors(a, s), r.normalize(), oe.setFromAxisAngle(r, y), E.quaternion.multiply(oe), E.rotation.setFromVector3(d.setFromEuler(E.rotation).clamp(new x.Vector3(
|
|
6675
6675
|
R[p].minx !== void 0 ? R[p].minx : -1 / 0,
|
|
6676
6676
|
R[p].miny !== void 0 ? R[p].miny : -1 / 0,
|
|
6677
6677
|
R[p].minz !== void 0 ? R[p].minz : -1 / 0
|
|
@@ -6683,8 +6683,8 @@ class Qe {
|
|
|
6683
6683
|
}
|
|
6684
6684
|
if (!T) break;
|
|
6685
6685
|
}
|
|
6686
|
-
o && R.forEach((
|
|
6687
|
-
this.poseTarget.props[
|
|
6686
|
+
o && R.forEach((k) => {
|
|
6687
|
+
this.poseTarget.props[k.link + ".quaternion"].copy(k.bone.quaternion), this.poseTarget.props[k.link + ".quaternion"].t = this.animClock, this.poseTarget.props[k.link + ".quaternion"].d = o;
|
|
6688
6688
|
});
|
|
6689
6689
|
}
|
|
6690
6690
|
/**
|
|
@@ -6714,7 +6714,7 @@ const Pe = {
|
|
|
6714
6714
|
josh: "VR6AewLTigWG4xSOukaG"
|
|
6715
6715
|
// Male, American
|
|
6716
6716
|
}
|
|
6717
|
-
},
|
|
6717
|
+
}, Ze = {
|
|
6718
6718
|
defaultVoice: "aura-2-thalia-en",
|
|
6719
6719
|
// Thalia (Female, English)
|
|
6720
6720
|
voices: {
|
|
@@ -6734,7 +6734,7 @@ const Pe = {
|
|
|
6734
6734
|
// Male, English - Powerful
|
|
6735
6735
|
}
|
|
6736
6736
|
};
|
|
6737
|
-
function
|
|
6737
|
+
function Ye() {
|
|
6738
6738
|
return {
|
|
6739
6739
|
service: "elevenlabs",
|
|
6740
6740
|
endpoint: Pe.endpoint,
|
|
@@ -6743,8 +6743,8 @@ function je() {
|
|
|
6743
6743
|
voices: Pe.voices
|
|
6744
6744
|
};
|
|
6745
6745
|
}
|
|
6746
|
-
function
|
|
6747
|
-
const V =
|
|
6746
|
+
function Ut() {
|
|
6747
|
+
const V = Ye(), t = [];
|
|
6748
6748
|
return Object.entries(V.voices).forEach(([e, n]) => {
|
|
6749
6749
|
t.push({
|
|
6750
6750
|
value: n,
|
|
@@ -6752,7 +6752,7 @@ function Nt() {
|
|
|
6752
6752
|
});
|
|
6753
6753
|
}), t;
|
|
6754
6754
|
}
|
|
6755
|
-
const
|
|
6755
|
+
const tt = Xe(({
|
|
6756
6756
|
avatarUrl: V = "/avatars/brunette.glb",
|
|
6757
6757
|
avatarBody: t = "F",
|
|
6758
6758
|
mood: e = "neutral",
|
|
@@ -6773,33 +6773,33 @@ const et = Ze(({
|
|
|
6773
6773
|
className: g = "",
|
|
6774
6774
|
style: R = {},
|
|
6775
6775
|
animations: b = {}
|
|
6776
|
-
},
|
|
6777
|
-
const T = W(null), p = W(null),
|
|
6776
|
+
}, k) => {
|
|
6777
|
+
const T = W(null), p = W(null), O = W(l), E = W(null), y = W(null), F = W(!1), f = W({ remainingText: null, originalText: null, options: null }), w = W([]), H = W(0), [I, U] = ae(!0), [G, X] = ae(null), [j, ue] = ae(!1), [le, ve] = ae(!1);
|
|
6778
6778
|
xe(() => {
|
|
6779
6779
|
F.current = le;
|
|
6780
6780
|
}, [le]), xe(() => {
|
|
6781
|
-
|
|
6781
|
+
O.current = l;
|
|
6782
6782
|
}, [l]);
|
|
6783
|
-
const re =
|
|
6784
|
-
let
|
|
6785
|
-
ze === "browser" ?
|
|
6783
|
+
const re = Ye(), ze = o || re.service;
|
|
6784
|
+
let J;
|
|
6785
|
+
ze === "browser" ? J = {
|
|
6786
6786
|
service: "browser",
|
|
6787
6787
|
endpoint: "",
|
|
6788
6788
|
apiKey: null,
|
|
6789
6789
|
defaultVoice: "Google US English"
|
|
6790
|
-
} : ze === "elevenlabs" ?
|
|
6790
|
+
} : ze === "elevenlabs" ? J = {
|
|
6791
6791
|
service: "elevenlabs",
|
|
6792
6792
|
endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
|
|
6793
6793
|
apiKey: i || re.apiKey,
|
|
6794
6794
|
defaultVoice: s || re.defaultVoice || Pe.defaultVoice,
|
|
6795
6795
|
voices: re.voices || Pe.voices
|
|
6796
|
-
} : ze === "deepgram" ?
|
|
6796
|
+
} : ze === "deepgram" ? J = {
|
|
6797
6797
|
service: "deepgram",
|
|
6798
6798
|
endpoint: "https://api.deepgram.com/v1/speak",
|
|
6799
6799
|
apiKey: i || re.apiKey,
|
|
6800
|
-
defaultVoice: s || re.defaultVoice ||
|
|
6801
|
-
voices: re.voices ||
|
|
6802
|
-
} :
|
|
6800
|
+
defaultVoice: s || re.defaultVoice || Ze.defaultVoice,
|
|
6801
|
+
voices: re.voices || Ze.voices
|
|
6802
|
+
} : J = {
|
|
6803
6803
|
...re,
|
|
6804
6804
|
// Override API key if provided via props
|
|
6805
6805
|
apiKey: i !== null ? i : re.apiKey
|
|
@@ -6809,63 +6809,63 @@ const et = Ze(({
|
|
|
6809
6809
|
body: t,
|
|
6810
6810
|
avatarMood: e,
|
|
6811
6811
|
ttsLang: ze === "browser" ? "en-US" : n,
|
|
6812
|
-
ttsVoice: s ||
|
|
6812
|
+
ttsVoice: s || J.defaultVoice,
|
|
6813
6813
|
lipsyncLang: "en",
|
|
6814
6814
|
showFullAvatar: l,
|
|
6815
6815
|
bodyMovement: a,
|
|
6816
6816
|
movementIntensity: c
|
|
6817
6817
|
}, A = {
|
|
6818
|
-
ttsEndpoint:
|
|
6819
|
-
ttsApikey:
|
|
6818
|
+
ttsEndpoint: J.endpoint,
|
|
6819
|
+
ttsApikey: J.apiKey,
|
|
6820
6820
|
ttsService: ze,
|
|
6821
6821
|
lipsyncModules: ["en"],
|
|
6822
6822
|
cameraView: u
|
|
6823
6823
|
}, M = N(async () => {
|
|
6824
6824
|
if (!(!T.current || p.current))
|
|
6825
6825
|
try {
|
|
6826
|
-
if (U(!0),
|
|
6827
|
-
if (
|
|
6828
|
-
const
|
|
6829
|
-
d(
|
|
6826
|
+
if (U(!0), X(null), p.current = new Qe(T.current, A), p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1), b && Object.keys(b).length > 0 && (p.current.customAnimations = b), await p.current.showAvatar(v, (ee) => {
|
|
6827
|
+
if (ee.lengthComputable) {
|
|
6828
|
+
const ie = Math.min(100, Math.round(ee.loaded / ee.total * 100));
|
|
6829
|
+
d(ie);
|
|
6830
6830
|
}
|
|
6831
|
-
}), await new Promise((
|
|
6832
|
-
const
|
|
6833
|
-
p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ?
|
|
6831
|
+
}), await new Promise((ee) => {
|
|
6832
|
+
const ie = () => {
|
|
6833
|
+
p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? ee() : setTimeout(ie, 100);
|
|
6834
6834
|
};
|
|
6835
|
-
|
|
6835
|
+
ie();
|
|
6836
6836
|
}), p.current && p.current.setShowFullAvatar)
|
|
6837
6837
|
try {
|
|
6838
6838
|
p.current.setShowFullAvatar(l);
|
|
6839
|
-
} catch (
|
|
6840
|
-
console.warn("Error setting full body mode on initialization:",
|
|
6839
|
+
} catch (ee) {
|
|
6840
|
+
console.warn("Error setting full body mode on initialization:", ee);
|
|
6841
6841
|
}
|
|
6842
6842
|
p.current && p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1, p.current.controls.update()), U(!1), ue(!0), r(p.current);
|
|
6843
|
-
const
|
|
6843
|
+
const Y = () => {
|
|
6844
6844
|
document.visibilityState === "visible" ? p.current?.start() : p.current?.stop();
|
|
6845
6845
|
};
|
|
6846
|
-
return document.addEventListener("visibilitychange",
|
|
6847
|
-
document.removeEventListener("visibilitychange",
|
|
6846
|
+
return document.addEventListener("visibilitychange", Y), () => {
|
|
6847
|
+
document.removeEventListener("visibilitychange", Y);
|
|
6848
6848
|
};
|
|
6849
6849
|
} catch (C) {
|
|
6850
|
-
console.error("Error initializing TalkingHead:", C),
|
|
6850
|
+
console.error("Error initializing TalkingHead:", C), X(C.message || "Failed to initialize avatar"), U(!1), h(C);
|
|
6851
6851
|
}
|
|
6852
6852
|
}, [V, t, e, n, o, s, i, l, a, c, u]);
|
|
6853
6853
|
xe(() => (M(), () => {
|
|
6854
6854
|
p.current && (p.current.stop(), p.current.dispose(), p.current = null);
|
|
6855
6855
|
}), [M]), xe(() => {
|
|
6856
6856
|
if (!T.current || !p.current) return;
|
|
6857
|
-
const C = new ResizeObserver((
|
|
6858
|
-
for (const
|
|
6857
|
+
const C = new ResizeObserver((ee) => {
|
|
6858
|
+
for (const ie of ee)
|
|
6859
6859
|
p.current && p.current.onResize && p.current.onResize();
|
|
6860
6860
|
});
|
|
6861
6861
|
C.observe(T.current);
|
|
6862
|
-
const
|
|
6862
|
+
const Y = () => {
|
|
6863
6863
|
p.current && p.current.onResize && p.current.onResize();
|
|
6864
6864
|
};
|
|
6865
|
-
return window.addEventListener("resize",
|
|
6866
|
-
C.disconnect(), window.removeEventListener("resize",
|
|
6865
|
+
return window.addEventListener("resize", Y), () => {
|
|
6866
|
+
C.disconnect(), window.removeEventListener("resize", Y);
|
|
6867
6867
|
};
|
|
6868
|
-
}, [
|
|
6868
|
+
}, [j]);
|
|
6869
6869
|
const D = N(async () => {
|
|
6870
6870
|
if (p.current && p.current.audioCtx)
|
|
6871
6871
|
try {
|
|
@@ -6873,115 +6873,115 @@ const et = Ze(({
|
|
|
6873
6873
|
} catch (C) {
|
|
6874
6874
|
console.warn("Failed to resume audio context:", C);
|
|
6875
6875
|
}
|
|
6876
|
-
}, []), Z = N(async (C,
|
|
6877
|
-
if (p.current &&
|
|
6876
|
+
}, []), Z = N(async (C, Y = {}) => {
|
|
6877
|
+
if (p.current && j)
|
|
6878
6878
|
try {
|
|
6879
|
-
y.current && (clearInterval(y.current), y.current = null), E.current = { text: C, options:
|
|
6880
|
-
const
|
|
6881
|
-
w.current =
|
|
6879
|
+
y.current && (clearInterval(y.current), y.current = null), E.current = { text: C, options: Y }, f.current = { remainingText: null, originalText: null, options: null };
|
|
6880
|
+
const ee = /[!\.\?\n\p{Extended_Pictographic}]/ug, ie = C.split(ee).map((_) => _.trim()).filter((_) => _.length > 0);
|
|
6881
|
+
w.current = ie, H.current = 0, ve(!1), F.current = !1, await D();
|
|
6882
6882
|
const be = {
|
|
6883
|
-
...
|
|
6884
|
-
lipsyncLang:
|
|
6883
|
+
...Y,
|
|
6884
|
+
lipsyncLang: Y.lipsyncLang || v.lipsyncLang || "en"
|
|
6885
6885
|
};
|
|
6886
|
-
if (
|
|
6887
|
-
const
|
|
6888
|
-
let
|
|
6889
|
-
const
|
|
6890
|
-
let
|
|
6891
|
-
|
|
6892
|
-
if (
|
|
6886
|
+
if (Y.onSpeechEnd && p.current) {
|
|
6887
|
+
const _ = p.current;
|
|
6888
|
+
let me = null, Me = 0;
|
|
6889
|
+
const pe = 1200;
|
|
6890
|
+
let ge = !1;
|
|
6891
|
+
me = setInterval(() => {
|
|
6892
|
+
if (Me++, F.current)
|
|
6893
6893
|
return;
|
|
6894
|
-
if (
|
|
6895
|
-
if (
|
|
6896
|
-
|
|
6894
|
+
if (Me > pe) {
|
|
6895
|
+
if (me && (clearInterval(me), me = null, y.current = null), !ge && !F.current) {
|
|
6896
|
+
ge = !0;
|
|
6897
6897
|
try {
|
|
6898
|
-
|
|
6899
|
-
} catch (
|
|
6900
|
-
console.error("Error in onSpeechEnd callback (timeout):",
|
|
6898
|
+
Y.onSpeechEnd();
|
|
6899
|
+
} catch (L) {
|
|
6900
|
+
console.error("Error in onSpeechEnd callback (timeout):", L);
|
|
6901
6901
|
}
|
|
6902
6902
|
}
|
|
6903
6903
|
return;
|
|
6904
6904
|
}
|
|
6905
|
-
const
|
|
6906
|
-
|
|
6907
|
-
if (
|
|
6908
|
-
|
|
6905
|
+
const Ae = !_.speechQueue || _.speechQueue.length === 0, Be = !_.audioPlaylist || _.audioPlaylist.length === 0;
|
|
6906
|
+
_ && _.isSpeaking === !1 && Ae && Be && _.isAudioPlaying === !1 && !ge && !F.current && setTimeout(() => {
|
|
6907
|
+
if (_ && !F.current && _.isSpeaking === !1 && (!_.speechQueue || _.speechQueue.length === 0) && (!_.audioPlaylist || _.audioPlaylist.length === 0) && _.isAudioPlaying === !1 && !ge && !F.current) {
|
|
6908
|
+
ge = !0, me && (clearInterval(me), me = null, y.current = null);
|
|
6909
6909
|
try {
|
|
6910
|
-
|
|
6911
|
-
} catch (
|
|
6912
|
-
console.error("Error in onSpeechEnd callback:",
|
|
6910
|
+
Y.onSpeechEnd();
|
|
6911
|
+
} catch (S) {
|
|
6912
|
+
console.error("Error in onSpeechEnd callback:", S);
|
|
6913
6913
|
}
|
|
6914
6914
|
}
|
|
6915
6915
|
}, 100);
|
|
6916
|
-
}, 100), y.current =
|
|
6916
|
+
}, 100), y.current = me;
|
|
6917
6917
|
}
|
|
6918
6918
|
p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(C, be)) : setTimeout(async () => {
|
|
6919
6919
|
await D(), p.current && p.current.lipsync && (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(C, be));
|
|
6920
6920
|
}, 100);
|
|
6921
|
-
} catch (
|
|
6922
|
-
console.error("Error speaking text:",
|
|
6921
|
+
} catch (ee) {
|
|
6922
|
+
console.error("Error speaking text:", ee), X(ee.message || "Failed to speak text");
|
|
6923
6923
|
}
|
|
6924
|
-
}, [
|
|
6925
|
-
p.current && (p.current.stopSpeaking(), p.current.setSlowdownRate && p.current.setSlowdownRate(1), E.current = null,
|
|
6924
|
+
}, [j, D, v.lipsyncLang]), se = N(() => {
|
|
6925
|
+
p.current && (p.current.stopSpeaking(), p.current.setSlowdownRate && p.current.setSlowdownRate(1), E.current = null, ve(!1));
|
|
6926
6926
|
}, []), ne = N(() => {
|
|
6927
6927
|
if (p.current && p.current.pauseSpeaking) {
|
|
6928
6928
|
const C = p.current;
|
|
6929
6929
|
if (C.isSpeaking || C.audioPlaylist && C.audioPlaylist.length > 0 || C.speechQueue && C.speechQueue.length > 0) {
|
|
6930
6930
|
y.current && (clearInterval(y.current), y.current = null);
|
|
6931
|
-
let
|
|
6931
|
+
let ee = "";
|
|
6932
6932
|
if (E.current && w.current.length > 0) {
|
|
6933
|
-
const
|
|
6934
|
-
if (
|
|
6935
|
-
const
|
|
6936
|
-
|
|
6933
|
+
const ie = w.current.length, be = C.speechQueue ? C.speechQueue.filter((pe) => pe && pe.text && Array.isArray(pe.text) && pe.text.length > 0).length : 0, _ = C.audioPlaylist && C.audioPlaylist.length > 0, me = be + (_ ? 1 : 0), Me = ie - me;
|
|
6934
|
+
if (me > 0 && Me < ie && (ee = w.current.slice(Me).join(". ").trim(), !ee && be > 0 && C.speechQueue)) {
|
|
6935
|
+
const ge = C.speechQueue.filter((Ae) => Ae && Ae.text && Array.isArray(Ae.text) && Ae.text.length > 0).map((Ae) => Ae.text.map((Be) => Be.word || "").filter((Be) => Be.length > 0).join(" ")).filter((Ae) => Ae.length > 0).join(" ");
|
|
6936
|
+
ge && ge.trim() && (ee = ge.trim());
|
|
6937
6937
|
}
|
|
6938
6938
|
}
|
|
6939
6939
|
E.current && (f.current = {
|
|
6940
|
-
remainingText:
|
|
6940
|
+
remainingText: ee || null,
|
|
6941
6941
|
originalText: E.current.text,
|
|
6942
6942
|
options: E.current.options
|
|
6943
|
-
}), C.speechQueue && (C.speechQueue.length = 0), p.current.pauseSpeaking(), F.current = !0,
|
|
6943
|
+
}), C.speechQueue && (C.speechQueue.length = 0), p.current.pauseSpeaking(), F.current = !0, ve(!0);
|
|
6944
6944
|
}
|
|
6945
6945
|
}
|
|
6946
|
-
}, []),
|
|
6946
|
+
}, []), q = N(async () => {
|
|
6947
6947
|
if (!p.current || !le)
|
|
6948
6948
|
return;
|
|
6949
|
-
let C = "",
|
|
6949
|
+
let C = "", Y = {};
|
|
6950
6950
|
if (f.current && f.current.remainingText)
|
|
6951
|
-
C = f.current.remainingText,
|
|
6951
|
+
C = f.current.remainingText, Y = f.current.options || {}, f.current = { remainingText: null, originalText: null, options: null };
|
|
6952
6952
|
else if (E.current && E.current.text)
|
|
6953
|
-
C = E.current.text,
|
|
6953
|
+
C = E.current.text, Y = E.current.options || {};
|
|
6954
6954
|
else {
|
|
6955
|
-
console.warn("Resume called but no paused speech found"),
|
|
6955
|
+
console.warn("Resume called but no paused speech found"), ve(!1), F.current = !1;
|
|
6956
6956
|
return;
|
|
6957
6957
|
}
|
|
6958
|
-
|
|
6959
|
-
const
|
|
6960
|
-
...
|
|
6961
|
-
lipsyncLang:
|
|
6958
|
+
ve(!1), F.current = !1, await D();
|
|
6959
|
+
const ee = {
|
|
6960
|
+
...Y,
|
|
6961
|
+
lipsyncLang: Y.lipsyncLang || v.lipsyncLang || "en"
|
|
6962
6962
|
};
|
|
6963
6963
|
try {
|
|
6964
|
-
await Z(C,
|
|
6965
|
-
} catch (
|
|
6966
|
-
console.error("Error resuming speech:",
|
|
6964
|
+
await Z(C, ee);
|
|
6965
|
+
} catch (ie) {
|
|
6966
|
+
console.error("Error resuming speech:", ie), ve(!1), F.current = !1;
|
|
6967
6967
|
}
|
|
6968
|
-
}, [D, le, Z, v]),
|
|
6968
|
+
}, [D, le, Z, v]), ke = N((C) => {
|
|
6969
6969
|
p.current && p.current.setMood(C);
|
|
6970
|
-
}, []),
|
|
6970
|
+
}, []), Ie = N((C) => {
|
|
6971
6971
|
p.current && p.current.setSlowdownRate && p.current.setSlowdownRate(C);
|
|
6972
|
-
}, []),
|
|
6972
|
+
}, []), Oe = N((C, Y = !1) => {
|
|
6973
6973
|
if (p.current && p.current.playAnimation) {
|
|
6974
6974
|
if (b && b[C] && (C = b[C]), p.current.setShowFullAvatar)
|
|
6975
6975
|
try {
|
|
6976
|
-
p.current.setShowFullAvatar(
|
|
6977
|
-
} catch (
|
|
6978
|
-
console.warn("Error setting full body mode:",
|
|
6976
|
+
p.current.setShowFullAvatar(O.current);
|
|
6977
|
+
} catch (ie) {
|
|
6978
|
+
console.warn("Error setting full body mode:", ie);
|
|
6979
6979
|
}
|
|
6980
6980
|
if (C.includes("."))
|
|
6981
6981
|
try {
|
|
6982
|
-
p.current.playAnimation(C, null, 10, 0, 0.01,
|
|
6983
|
-
} catch (
|
|
6984
|
-
console.warn(`Failed to play ${C}:`,
|
|
6982
|
+
p.current.playAnimation(C, null, 10, 0, 0.01, Y);
|
|
6983
|
+
} catch (ie) {
|
|
6984
|
+
console.warn(`Failed to play ${C}:`, ie);
|
|
6985
6985
|
try {
|
|
6986
6986
|
p.current.setBodyMovement("idle");
|
|
6987
6987
|
} catch (be) {
|
|
@@ -6989,11 +6989,11 @@ const et = Ze(({
|
|
|
6989
6989
|
}
|
|
6990
6990
|
}
|
|
6991
6991
|
else {
|
|
6992
|
-
const
|
|
6992
|
+
const ie = [".fbx", ".glb", ".gltf"];
|
|
6993
6993
|
let be = !1;
|
|
6994
|
-
for (const
|
|
6994
|
+
for (const _ of ie)
|
|
6995
6995
|
try {
|
|
6996
|
-
p.current.playAnimation(C +
|
|
6996
|
+
p.current.playAnimation(C + _, null, 10, 0, 0.01, Y), be = !0;
|
|
6997
6997
|
break;
|
|
6998
6998
|
} catch {
|
|
6999
6999
|
}
|
|
@@ -7001,41 +7001,41 @@ const et = Ze(({
|
|
|
7001
7001
|
console.warn("Animation not found:", C);
|
|
7002
7002
|
try {
|
|
7003
7003
|
p.current.setBodyMovement("idle");
|
|
7004
|
-
} catch (
|
|
7005
|
-
console.warn("Fallback animation also failed:",
|
|
7004
|
+
} catch (_) {
|
|
7005
|
+
console.warn("Fallback animation also failed:", _);
|
|
7006
7006
|
}
|
|
7007
7007
|
}
|
|
7008
7008
|
}
|
|
7009
7009
|
}
|
|
7010
|
-
}, [b]),
|
|
7010
|
+
}, [b]), He = N(() => {
|
|
7011
7011
|
p.current && p.current.onResize && p.current.onResize();
|
|
7012
7012
|
}, []);
|
|
7013
|
-
return
|
|
7013
|
+
return je(k, () => ({
|
|
7014
7014
|
speakText: Z,
|
|
7015
|
-
stopSpeaking:
|
|
7015
|
+
stopSpeaking: se,
|
|
7016
7016
|
pauseSpeaking: ne,
|
|
7017
|
-
resumeSpeaking:
|
|
7017
|
+
resumeSpeaking: q,
|
|
7018
7018
|
resumeAudioContext: D,
|
|
7019
|
-
setMood:
|
|
7020
|
-
setTimingAdjustment:
|
|
7021
|
-
playAnimation:
|
|
7022
|
-
isReady:
|
|
7019
|
+
setMood: ke,
|
|
7020
|
+
setTimingAdjustment: Ie,
|
|
7021
|
+
playAnimation: Oe,
|
|
7022
|
+
isReady: j,
|
|
7023
7023
|
isPaused: le,
|
|
7024
7024
|
talkingHead: p.current,
|
|
7025
|
-
handleResize:
|
|
7025
|
+
handleResize: He,
|
|
7026
7026
|
setBodyMovement: (C) => {
|
|
7027
7027
|
if (p.current && p.current.setShowFullAvatar && p.current.setBodyMovement)
|
|
7028
7028
|
try {
|
|
7029
|
-
p.current.setShowFullAvatar(
|
|
7030
|
-
} catch (
|
|
7031
|
-
console.warn("Error setting body movement:",
|
|
7029
|
+
p.current.setShowFullAvatar(O.current), p.current.setBodyMovement(C);
|
|
7030
|
+
} catch (Y) {
|
|
7031
|
+
console.warn("Error setting body movement:", Y);
|
|
7032
7032
|
}
|
|
7033
7033
|
},
|
|
7034
7034
|
setMovementIntensity: (C) => p.current?.setMovementIntensity(C),
|
|
7035
7035
|
playRandomDance: () => {
|
|
7036
7036
|
if (p.current && p.current.setShowFullAvatar && p.current.playRandomDance)
|
|
7037
7037
|
try {
|
|
7038
|
-
p.current.setShowFullAvatar(
|
|
7038
|
+
p.current.setShowFullAvatar(O.current), p.current.playRandomDance();
|
|
7039
7039
|
} catch (C) {
|
|
7040
7040
|
console.warn("Error playing random dance:", C);
|
|
7041
7041
|
}
|
|
@@ -7043,15 +7043,15 @@ const et = Ze(({
|
|
|
7043
7043
|
playReaction: (C) => {
|
|
7044
7044
|
if (p.current && p.current.setShowFullAvatar && p.current.playReaction)
|
|
7045
7045
|
try {
|
|
7046
|
-
p.current.setShowFullAvatar(
|
|
7047
|
-
} catch (
|
|
7048
|
-
console.warn("Error playing reaction:",
|
|
7046
|
+
p.current.setShowFullAvatar(O.current), p.current.playReaction(C);
|
|
7047
|
+
} catch (Y) {
|
|
7048
|
+
console.warn("Error playing reaction:", Y);
|
|
7049
7049
|
}
|
|
7050
7050
|
},
|
|
7051
7051
|
playCelebration: () => {
|
|
7052
7052
|
if (p.current && p.current.setShowFullAvatar && p.current.playCelebration)
|
|
7053
7053
|
try {
|
|
7054
|
-
p.current.setShowFullAvatar(
|
|
7054
|
+
p.current.setShowFullAvatar(O.current), p.current.playCelebration();
|
|
7055
7055
|
} catch (C) {
|
|
7056
7056
|
console.warn("Error playing celebration:", C);
|
|
7057
7057
|
}
|
|
@@ -7059,9 +7059,9 @@ const et = Ze(({
|
|
|
7059
7059
|
setShowFullAvatar: (C) => {
|
|
7060
7060
|
if (p.current && p.current.setShowFullAvatar)
|
|
7061
7061
|
try {
|
|
7062
|
-
|
|
7063
|
-
} catch (
|
|
7064
|
-
console.warn("Error setting showFullAvatar:",
|
|
7062
|
+
O.current = C, p.current.setShowFullAvatar(C);
|
|
7063
|
+
} catch (Y) {
|
|
7064
|
+
console.warn("Error setting showFullAvatar:", Y);
|
|
7065
7065
|
}
|
|
7066
7066
|
},
|
|
7067
7067
|
lockAvatarPosition: () => {
|
|
@@ -7080,7 +7080,7 @@ const et = Ze(({
|
|
|
7080
7080
|
console.warn("Error unlocking avatar position:", C);
|
|
7081
7081
|
}
|
|
7082
7082
|
}
|
|
7083
|
-
})), /* @__PURE__ */
|
|
7083
|
+
})), /* @__PURE__ */ Se(
|
|
7084
7084
|
"div",
|
|
7085
7085
|
{
|
|
7086
7086
|
className: `talking-head-avatar ${g}`,
|
|
@@ -7091,7 +7091,7 @@ const et = Ze(({
|
|
|
7091
7091
|
...R
|
|
7092
7092
|
},
|
|
7093
7093
|
children: [
|
|
7094
|
-
/* @__PURE__ */
|
|
7094
|
+
/* @__PURE__ */ $(
|
|
7095
7095
|
"div",
|
|
7096
7096
|
{
|
|
7097
7097
|
ref: T,
|
|
@@ -7103,7 +7103,7 @@ const et = Ze(({
|
|
|
7103
7103
|
}
|
|
7104
7104
|
}
|
|
7105
7105
|
),
|
|
7106
|
-
I && /* @__PURE__ */
|
|
7106
|
+
I && /* @__PURE__ */ $("div", { className: "loading-overlay", style: {
|
|
7107
7107
|
position: "absolute",
|
|
7108
7108
|
top: "50%",
|
|
7109
7109
|
left: "50%",
|
|
@@ -7112,7 +7112,7 @@ const et = Ze(({
|
|
|
7112
7112
|
fontSize: "18px",
|
|
7113
7113
|
zIndex: 10
|
|
7114
7114
|
}, children: "Loading avatar..." }),
|
|
7115
|
-
G && /* @__PURE__ */
|
|
7115
|
+
G && /* @__PURE__ */ $("div", { className: "error-overlay", style: {
|
|
7116
7116
|
position: "absolute",
|
|
7117
7117
|
top: "50%",
|
|
7118
7118
|
left: "50%",
|
|
@@ -7128,8 +7128,8 @@ const et = Ze(({
|
|
|
7128
7128
|
}
|
|
7129
7129
|
);
|
|
7130
7130
|
});
|
|
7131
|
-
|
|
7132
|
-
const
|
|
7131
|
+
tt.displayName = "TalkingHeadAvatar";
|
|
7132
|
+
const Ct = Xe(({
|
|
7133
7133
|
text: V = "Hello! I'm a talking avatar. How are you today?",
|
|
7134
7134
|
onLoading: t = () => {
|
|
7135
7135
|
},
|
|
@@ -7141,7 +7141,7 @@ const wt = Ze(({
|
|
|
7141
7141
|
style: s = {},
|
|
7142
7142
|
avatarConfig: i = {}
|
|
7143
7143
|
}, a) => {
|
|
7144
|
-
const c = W(null), l = W(null), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae(!1), b =
|
|
7144
|
+
const c = W(null), l = W(null), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae(!1), b = Ye(), k = i.ttsService || b.service, T = k === "browser" ? {
|
|
7145
7145
|
endpoint: "",
|
|
7146
7146
|
apiKey: null,
|
|
7147
7147
|
defaultVoice: "Google US English"
|
|
@@ -7150,13 +7150,13 @@ const wt = Ze(({
|
|
|
7150
7150
|
// Override API key if provided via avatarConfig
|
|
7151
7151
|
apiKey: i.ttsApiKey !== void 0 && i.ttsApiKey !== null ? i.ttsApiKey : b.apiKey,
|
|
7152
7152
|
// Override endpoint for ElevenLabs if service is explicitly set
|
|
7153
|
-
endpoint:
|
|
7153
|
+
endpoint: k === "elevenlabs" && i.ttsApiKey ? "https://api.elevenlabs.io/v1/text-to-speech" : b.endpoint
|
|
7154
7154
|
}, p = {
|
|
7155
7155
|
url: "/avatars/brunette.glb",
|
|
7156
7156
|
// Use brunette avatar (working glTF file)
|
|
7157
7157
|
body: "F",
|
|
7158
7158
|
avatarMood: "neutral",
|
|
7159
|
-
ttsLang:
|
|
7159
|
+
ttsLang: k === "browser" ? "en-US" : "en",
|
|
7160
7160
|
ttsVoice: i.ttsVoice || T.defaultVoice,
|
|
7161
7161
|
lipsyncLang: "en",
|
|
7162
7162
|
// English lip-sync
|
|
@@ -7165,31 +7165,31 @@ const wt = Ze(({
|
|
|
7165
7165
|
bodyMovement: "idle",
|
|
7166
7166
|
movementIntensity: 0.5,
|
|
7167
7167
|
...i
|
|
7168
|
-
},
|
|
7168
|
+
}, O = {
|
|
7169
7169
|
ttsEndpoint: T.endpoint,
|
|
7170
7170
|
ttsApikey: T.apiKey,
|
|
7171
|
-
ttsService:
|
|
7171
|
+
ttsService: k,
|
|
7172
7172
|
lipsyncModules: ["en"],
|
|
7173
7173
|
cameraView: "upper"
|
|
7174
7174
|
}, E = N(async () => {
|
|
7175
7175
|
if (!(!c.current || l.current))
|
|
7176
7176
|
try {
|
|
7177
|
-
if (r(!0), h(null), l.current = new Qe(c.current,
|
|
7177
|
+
if (r(!0), h(null), l.current = new Qe(c.current, O), await l.current.showAvatar(p, (G) => {
|
|
7178
7178
|
if (G.lengthComputable) {
|
|
7179
|
-
const
|
|
7180
|
-
t(
|
|
7179
|
+
const X = Math.min(100, Math.round(G.loaded / G.total * 100));
|
|
7180
|
+
t(X);
|
|
7181
7181
|
}
|
|
7182
7182
|
}), l.current.morphs && l.current.morphs.length > 0) {
|
|
7183
7183
|
const G = l.current.morphs[0].morphTargetDictionary;
|
|
7184
7184
|
console.log("Available morph targets:", Object.keys(G));
|
|
7185
|
-
const
|
|
7186
|
-
console.log("Viseme morph targets found:",
|
|
7185
|
+
const X = Object.keys(G).filter((j) => j.startsWith("viseme_"));
|
|
7186
|
+
console.log("Viseme morph targets found:", X), X.length === 0 && (console.warn("No viseme morph targets found! Lip-sync will not work properly."), console.log("Expected viseme targets: viseme_aa, viseme_E, viseme_I, viseme_O, viseme_U, viseme_PP, viseme_SS, viseme_TH, viseme_DD, viseme_FF, viseme_kk, viseme_nn, viseme_RR, viseme_CH, viseme_sil"));
|
|
7187
7187
|
}
|
|
7188
7188
|
if (await new Promise((G) => {
|
|
7189
|
-
const
|
|
7190
|
-
l.current.lipsync && Object.keys(l.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(l.current.lipsync)), G()) : (console.log("Waiting for lip-sync modules to load..."), setTimeout(
|
|
7189
|
+
const X = () => {
|
|
7190
|
+
l.current.lipsync && Object.keys(l.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(l.current.lipsync)), G()) : (console.log("Waiting for lip-sync modules to load..."), setTimeout(X, 100));
|
|
7191
7191
|
};
|
|
7192
|
-
|
|
7192
|
+
X();
|
|
7193
7193
|
}), l.current && l.current.setShowFullAvatar)
|
|
7194
7194
|
try {
|
|
7195
7195
|
l.current.setShowFullAvatar(!0), console.log("Avatar initialized in full body mode");
|
|
@@ -7232,31 +7232,31 @@ const wt = Ze(({
|
|
|
7232
7232
|
if (l.current.setShowFullAvatar)
|
|
7233
7233
|
try {
|
|
7234
7234
|
l.current.setShowFullAvatar(!0);
|
|
7235
|
-
} catch (
|
|
7236
|
-
console.warn("Error setting full body mode:",
|
|
7235
|
+
} catch (X) {
|
|
7236
|
+
console.warn("Error setting full body mode:", X);
|
|
7237
7237
|
}
|
|
7238
7238
|
if (I.includes("."))
|
|
7239
7239
|
try {
|
|
7240
7240
|
l.current.playAnimation(I, null, 10, 0, 0.01, U), console.log("Playing animation:", I);
|
|
7241
|
-
} catch (
|
|
7242
|
-
console.log(`Failed to play ${I}:`,
|
|
7241
|
+
} catch (X) {
|
|
7242
|
+
console.log(`Failed to play ${I}:`, X);
|
|
7243
7243
|
try {
|
|
7244
7244
|
l.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
|
|
7245
|
-
} catch (
|
|
7246
|
-
console.warn("Fallback animation also failed:",
|
|
7245
|
+
} catch (j) {
|
|
7246
|
+
console.warn("Fallback animation also failed:", j);
|
|
7247
7247
|
}
|
|
7248
7248
|
}
|
|
7249
7249
|
else {
|
|
7250
|
-
const
|
|
7251
|
-
let
|
|
7252
|
-
for (const ue of
|
|
7250
|
+
const X = [".fbx", ".glb", ".gltf"];
|
|
7251
|
+
let j = !1;
|
|
7252
|
+
for (const ue of X)
|
|
7253
7253
|
try {
|
|
7254
|
-
l.current.playAnimation(I + ue, null, 10, 0, 0.01, U), console.log("Playing animation:", I + ue),
|
|
7254
|
+
l.current.playAnimation(I + ue, null, 10, 0, 0.01, U), console.log("Playing animation:", I + ue), j = !0;
|
|
7255
7255
|
break;
|
|
7256
7256
|
} catch {
|
|
7257
7257
|
console.log(`Failed to play ${I}${ue}, trying next format...`);
|
|
7258
7258
|
}
|
|
7259
|
-
if (!
|
|
7259
|
+
if (!j) {
|
|
7260
7260
|
console.warn("Animation system not available or animation not found:", I);
|
|
7261
7261
|
try {
|
|
7262
7262
|
l.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
|
|
@@ -7268,7 +7268,7 @@ const wt = Ze(({
|
|
|
7268
7268
|
} else
|
|
7269
7269
|
console.warn("Animation system not available or animation not found:", I);
|
|
7270
7270
|
}, []);
|
|
7271
|
-
return
|
|
7271
|
+
return je(a, () => ({
|
|
7272
7272
|
speakText: y,
|
|
7273
7273
|
stopSpeaking: F,
|
|
7274
7274
|
setMood: f,
|
|
@@ -7333,8 +7333,8 @@ const wt = Ze(({
|
|
|
7333
7333
|
console.warn("Error unlocking avatar position:", I);
|
|
7334
7334
|
}
|
|
7335
7335
|
}
|
|
7336
|
-
})), /* @__PURE__ */
|
|
7337
|
-
/* @__PURE__ */
|
|
7336
|
+
})), /* @__PURE__ */ Se("div", { className: `talking-head-container ${o}`, style: s, children: [
|
|
7337
|
+
/* @__PURE__ */ $(
|
|
7338
7338
|
"div",
|
|
7339
7339
|
{
|
|
7340
7340
|
ref: c,
|
|
@@ -7346,7 +7346,7 @@ const wt = Ze(({
|
|
|
7346
7346
|
}
|
|
7347
7347
|
}
|
|
7348
7348
|
),
|
|
7349
|
-
u && /* @__PURE__ */
|
|
7349
|
+
u && /* @__PURE__ */ $("div", { className: "loading-overlay", style: {
|
|
7350
7350
|
position: "absolute",
|
|
7351
7351
|
top: "50%",
|
|
7352
7352
|
left: "50%",
|
|
@@ -7355,7 +7355,7 @@ const wt = Ze(({
|
|
|
7355
7355
|
fontSize: "18px",
|
|
7356
7356
|
zIndex: 10
|
|
7357
7357
|
}, children: "Loading avatar..." }),
|
|
7358
|
-
d && /* @__PURE__ */
|
|
7358
|
+
d && /* @__PURE__ */ $("div", { className: "error-overlay", style: {
|
|
7359
7359
|
position: "absolute",
|
|
7360
7360
|
top: "50%",
|
|
7361
7361
|
left: "50%",
|
|
@@ -7369,8 +7369,8 @@ const wt = Ze(({
|
|
|
7369
7369
|
}, children: d })
|
|
7370
7370
|
] });
|
|
7371
7371
|
});
|
|
7372
|
-
|
|
7373
|
-
async function
|
|
7372
|
+
Ct.displayName = "TalkingHeadComponent";
|
|
7373
|
+
async function Ne(V) {
|
|
7374
7374
|
try {
|
|
7375
7375
|
const t = await fetch(V);
|
|
7376
7376
|
if (!t.ok)
|
|
@@ -7380,10 +7380,10 @@ async function De(V) {
|
|
|
7380
7380
|
return console.error("Failed to load animation manifest:", t), {};
|
|
7381
7381
|
}
|
|
7382
7382
|
}
|
|
7383
|
-
async function
|
|
7383
|
+
async function zt(V, t = "F") {
|
|
7384
7384
|
const e = [], n = V.replace(/\/$/, "");
|
|
7385
7385
|
try {
|
|
7386
|
-
const
|
|
7386
|
+
const i = [
|
|
7387
7387
|
`${n}/.list.json`,
|
|
7388
7388
|
// Custom listing file
|
|
7389
7389
|
`/api/directory?path=${encodeURIComponent(n)}`,
|
|
@@ -7391,46 +7391,51 @@ async function Ct(V, t = "F") {
|
|
|
7391
7391
|
`${n}/index.json`
|
|
7392
7392
|
// Index file
|
|
7393
7393
|
];
|
|
7394
|
-
for (const
|
|
7394
|
+
for (const a of i)
|
|
7395
7395
|
try {
|
|
7396
|
-
const
|
|
7397
|
-
if (
|
|
7398
|
-
const
|
|
7399
|
-
if (
|
|
7400
|
-
return
|
|
7396
|
+
const c = await fetch(a);
|
|
7397
|
+
if (c.ok) {
|
|
7398
|
+
const l = await c.json(), r = (Array.isArray(l) ? l : l.files || []).filter((d) => typeof d == "string" && d.toLowerCase().endsWith(".fbx")).map((d) => d.startsWith("/") ? d : `${n}/${d}`);
|
|
7399
|
+
if (r.length > 0)
|
|
7400
|
+
return r;
|
|
7401
7401
|
}
|
|
7402
7402
|
} catch {
|
|
7403
7403
|
continue;
|
|
7404
7404
|
}
|
|
7405
|
-
} catch (
|
|
7406
|
-
console.warn(`⚠️ Could not use directory listing API for ${n}:`,
|
|
7405
|
+
} catch (i) {
|
|
7406
|
+
console.warn(`⚠️ Could not use directory listing API for ${n}:`, i);
|
|
7407
7407
|
}
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7408
|
+
let o = "F";
|
|
7409
|
+
if (t) {
|
|
7410
|
+
const i = t.toString().toUpperCase().trim();
|
|
7411
|
+
i === "M" || i === "MALE" ? o = "M" : (i === "F" || i === "FEMALE") && (o = "F");
|
|
7412
|
+
}
|
|
7413
|
+
const s = [];
|
|
7414
|
+
o === "M" ? s.push(`${n}/male`, `${n}/m`) : s.push(`${n}/female`, `${n}/f`), s.push(`${n}/shared`);
|
|
7415
|
+
for (const i of s)
|
|
7411
7416
|
try {
|
|
7412
|
-
const
|
|
7413
|
-
if (
|
|
7414
|
-
const
|
|
7415
|
-
|
|
7417
|
+
const a = `${i}/.list.json`, c = await fetch(a);
|
|
7418
|
+
if (c.ok) {
|
|
7419
|
+
const l = await c.json(), u = (Array.isArray(l) ? l : l.files || []).filter((r) => typeof r == "string" && r.toLowerCase().endsWith(".fbx")).map((r) => r.startsWith("/") ? r : `${i}/${r}`);
|
|
7420
|
+
u.length > 0 && e.push(...u);
|
|
7416
7421
|
}
|
|
7417
7422
|
} catch {
|
|
7418
7423
|
continue;
|
|
7419
7424
|
}
|
|
7420
7425
|
return e.length > 0, e;
|
|
7421
7426
|
}
|
|
7422
|
-
async function
|
|
7427
|
+
async function et(V, t = "F") {
|
|
7423
7428
|
const e = {};
|
|
7424
7429
|
for (const [n, o] of Object.entries(V))
|
|
7425
7430
|
try {
|
|
7426
|
-
const s = await
|
|
7431
|
+
const s = await zt(o, t);
|
|
7427
7432
|
s.length > 0 && (e[n] = s);
|
|
7428
7433
|
} catch (s) {
|
|
7429
7434
|
console.error(`❌ Failed to auto-load animations from ${o}:`, s);
|
|
7430
7435
|
}
|
|
7431
7436
|
return e;
|
|
7432
7437
|
}
|
|
7433
|
-
const
|
|
7438
|
+
const Ht = Xe(({
|
|
7434
7439
|
text: V = null,
|
|
7435
7440
|
avatarUrl: t = "/avatars/brunette.glb",
|
|
7436
7441
|
avatarBody: e = "F",
|
|
@@ -7452,80 +7457,89 @@ const zt = Ze(({
|
|
|
7452
7457
|
onSpeechEnd: R = () => {
|
|
7453
7458
|
},
|
|
7454
7459
|
className: b = "",
|
|
7455
|
-
style:
|
|
7460
|
+
style: k = {},
|
|
7456
7461
|
animations: T = {},
|
|
7457
7462
|
autoAnimationGroup: p = null,
|
|
7458
7463
|
// e.g., "talking" - will randomly select from this group when speaking
|
|
7459
|
-
autoIdleGroup:
|
|
7464
|
+
autoIdleGroup: O = null,
|
|
7460
7465
|
// e.g., "idle" - will randomly select from this group when idle
|
|
7461
7466
|
autoSpeak: E = !1
|
|
7462
7467
|
}, y) => {
|
|
7463
|
-
const F = W(null), f = W(null), w = W(u), H = W(null), I = W(null), U = W(!1), G = W({ remainingText: null, originalText: null, options: null }),
|
|
7468
|
+
const F = W(null), f = W(null), w = W(u), H = W(null), I = W(null), U = W(!1), G = W({ remainingText: null, originalText: null, options: null }), X = W([]), [j, ue] = ae(!0), [le, ve] = ae(null), [re, ze] = ae(!1), [J, v] = ae(!1), [A, M] = ae(T), D = W(null), Z = W(!1), se = W(null), ne = W([]), q = W([]);
|
|
7469
|
+
xe(() => {
|
|
7470
|
+
U.current = J;
|
|
7471
|
+
}, [J]);
|
|
7472
|
+
const ke = N((L) => {
|
|
7473
|
+
let S = "F";
|
|
7474
|
+
if (L) {
|
|
7475
|
+
const P = L.toString().toUpperCase().trim();
|
|
7476
|
+
P === "M" || P === "MALE" ? S = "M" : (P === "F" || P === "FEMALE") && (S = "F");
|
|
7477
|
+
}
|
|
7478
|
+
return S === "M" ? "male" : "female";
|
|
7479
|
+
}, []);
|
|
7464
7480
|
xe(() => {
|
|
7465
|
-
U.current = te;
|
|
7466
|
-
}, [te]), xe(() => {
|
|
7467
7481
|
(async () => {
|
|
7468
7482
|
if (T.manifest && T.auto)
|
|
7469
7483
|
try {
|
|
7470
|
-
const
|
|
7471
|
-
M(
|
|
7484
|
+
const S = await Ne(T.manifest);
|
|
7485
|
+
M(S);
|
|
7472
7486
|
return;
|
|
7473
7487
|
} catch {
|
|
7474
7488
|
}
|
|
7475
7489
|
if (T.manifest && !T.auto)
|
|
7476
7490
|
try {
|
|
7477
|
-
const
|
|
7478
|
-
M(
|
|
7479
|
-
} catch (
|
|
7480
|
-
console.error("Failed to load animation manifest:",
|
|
7491
|
+
const S = await Ne(T.manifest);
|
|
7492
|
+
M(S);
|
|
7493
|
+
} catch (S) {
|
|
7494
|
+
console.error("Failed to load animation manifest:", S), M(T);
|
|
7481
7495
|
}
|
|
7482
7496
|
else if (T.auto)
|
|
7483
7497
|
try {
|
|
7484
|
-
let
|
|
7498
|
+
let S = null;
|
|
7485
7499
|
if (T.manifest)
|
|
7486
7500
|
try {
|
|
7487
|
-
|
|
7501
|
+
S = await Ne(T.manifest);
|
|
7488
7502
|
} catch {
|
|
7489
7503
|
}
|
|
7490
7504
|
if (typeof T.auto == "string") {
|
|
7491
|
-
const
|
|
7492
|
-
talking: `${
|
|
7493
|
-
idle: `${
|
|
7494
|
-
},
|
|
7495
|
-
|
|
7496
|
-
const
|
|
7497
|
-
if (!Object.values(
|
|
7498
|
-
M(
|
|
7505
|
+
const P = T.auto, K = {
|
|
7506
|
+
talking: `${P}/talking`,
|
|
7507
|
+
idle: `${P}/idle`
|
|
7508
|
+
}, te = ke(e);
|
|
7509
|
+
K[`${te}_talking`] = `${P}/${te}/talking`, K[`${te}_idle`] = `${P}/${te}/idle`, K.shared_talking = `${P}/shared/talking`, K.shared_idle = `${P}/shared/idle`, console.log(`📁 Loading animations from folders with genderKey="${te}" for avatarBody="${e}"`);
|
|
7510
|
+
const Le = await et(K, e);
|
|
7511
|
+
if (!Object.values(Le).some((ce) => Array.isArray(ce) && ce.length > 0) && S) {
|
|
7512
|
+
M(S);
|
|
7499
7513
|
return;
|
|
7500
7514
|
}
|
|
7501
7515
|
const ye = {
|
|
7502
7516
|
_genderSpecific: {
|
|
7503
|
-
[
|
|
7517
|
+
[te]: {},
|
|
7504
7518
|
shared: {}
|
|
7505
7519
|
}
|
|
7506
7520
|
};
|
|
7507
|
-
Object.entries(
|
|
7508
|
-
if (
|
|
7509
|
-
const [
|
|
7510
|
-
|
|
7521
|
+
Object.entries(Le).forEach(([ce, Fe]) => {
|
|
7522
|
+
if (ce.includes("_")) {
|
|
7523
|
+
const [Ue, ...ot] = ce.split("_"), De = ot.join("_");
|
|
7524
|
+
Ue === "shared" ? (ye._genderSpecific.shared[De] || (ye._genderSpecific.shared[De] = []), ye._genderSpecific.shared[De].push(...Fe)) : Ue === te && (ye._genderSpecific[te][De] || (ye._genderSpecific[te][De] = []), ye._genderSpecific[te][De].push(...Fe));
|
|
7511
7525
|
} else
|
|
7512
|
-
ye[
|
|
7513
|
-
}),
|
|
7514
|
-
ye._genderSpecific[
|
|
7515
|
-
ye._genderSpecific[
|
|
7526
|
+
ye[ce] = Fe;
|
|
7527
|
+
}), S && (S._genderSpecific && Object.keys(S._genderSpecific).forEach((ce) => {
|
|
7528
|
+
ye._genderSpecific[ce] || (ye._genderSpecific[ce] = {}), Object.entries(S._genderSpecific[ce]).forEach(([Fe, Ue]) => {
|
|
7529
|
+
ye._genderSpecific[ce][Fe] || (ye._genderSpecific[ce][Fe] = Ue);
|
|
7516
7530
|
});
|
|
7517
|
-
}), Object.entries(
|
|
7518
|
-
|
|
7531
|
+
}), Object.entries(S).forEach(([ce, Fe]) => {
|
|
7532
|
+
ce !== "_genderSpecific" && !ye[ce] && (ye[ce] = Fe);
|
|
7519
7533
|
})), M(ye);
|
|
7520
7534
|
} else if (typeof T.auto == "object") {
|
|
7521
|
-
const
|
|
7522
|
-
M(!
|
|
7535
|
+
const P = await et(T.auto, e), K = Object.values(P).some((te) => Array.isArray(te) && te.length > 0);
|
|
7536
|
+
M(!K && S ? S : P);
|
|
7523
7537
|
}
|
|
7524
|
-
} catch (
|
|
7525
|
-
if (console.error("Failed to auto-discover animations:",
|
|
7538
|
+
} catch (S) {
|
|
7539
|
+
if (console.error("Failed to auto-discover animations:", S), T.manifest)
|
|
7526
7540
|
try {
|
|
7527
|
-
const
|
|
7528
|
-
M(
|
|
7541
|
+
const P = await Ne(T.manifest);
|
|
7542
|
+
M(P);
|
|
7529
7543
|
} catch {
|
|
7530
7544
|
M(T);
|
|
7531
7545
|
}
|
|
@@ -7535,220 +7549,215 @@ const zt = Ze(({
|
|
|
7535
7549
|
else
|
|
7536
7550
|
M(T);
|
|
7537
7551
|
})();
|
|
7538
|
-
}, [T, e]), xe(() => {
|
|
7552
|
+
}, [T, e, ke]), xe(() => {
|
|
7539
7553
|
w.current = u;
|
|
7540
7554
|
}, [u]);
|
|
7541
|
-
const
|
|
7555
|
+
const Ie = Ye(), Oe = s || Ie.service;
|
|
7542
7556
|
let He;
|
|
7543
|
-
|
|
7557
|
+
Oe === "browser" ? He = {
|
|
7544
7558
|
service: "browser",
|
|
7545
7559
|
endpoint: "",
|
|
7546
7560
|
apiKey: null,
|
|
7547
7561
|
defaultVoice: "Google US English"
|
|
7548
|
-
} :
|
|
7562
|
+
} : Oe === "elevenlabs" ? He = {
|
|
7549
7563
|
service: "elevenlabs",
|
|
7550
7564
|
endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
|
|
7551
|
-
apiKey: a ||
|
|
7552
|
-
defaultVoice: i ||
|
|
7553
|
-
voices:
|
|
7554
|
-
} :
|
|
7565
|
+
apiKey: a || Ie.apiKey,
|
|
7566
|
+
defaultVoice: i || Ie.defaultVoice || Pe.defaultVoice,
|
|
7567
|
+
voices: Ie.voices || Pe.voices
|
|
7568
|
+
} : Oe === "deepgram" ? He = {
|
|
7555
7569
|
service: "deepgram",
|
|
7556
7570
|
endpoint: "https://api.deepgram.com/v1/speak",
|
|
7557
|
-
apiKey: a ||
|
|
7558
|
-
defaultVoice: i ||
|
|
7559
|
-
voices:
|
|
7571
|
+
apiKey: a || Ie.apiKey,
|
|
7572
|
+
defaultVoice: i || Ie.defaultVoice || Ze.defaultVoice,
|
|
7573
|
+
voices: Ie.voices || Ze.voices
|
|
7560
7574
|
} : He = {
|
|
7561
|
-
...
|
|
7562
|
-
apiKey: a !== null ? a :
|
|
7575
|
+
...Ie,
|
|
7576
|
+
apiKey: a !== null ? a : Ie.apiKey
|
|
7563
7577
|
};
|
|
7564
|
-
const
|
|
7578
|
+
const C = {
|
|
7565
7579
|
url: t,
|
|
7566
7580
|
body: e,
|
|
7567
7581
|
avatarMood: n,
|
|
7568
|
-
ttsLang:
|
|
7582
|
+
ttsLang: Oe === "browser" ? "en-US" : o,
|
|
7569
7583
|
ttsVoice: i || He.defaultVoice,
|
|
7570
7584
|
lipsyncLang: "en",
|
|
7571
7585
|
showFullAvatar: u,
|
|
7572
7586
|
bodyMovement: c,
|
|
7573
7587
|
movementIntensity: l
|
|
7574
|
-
},
|
|
7588
|
+
}, Y = {
|
|
7575
7589
|
ttsEndpoint: He.endpoint,
|
|
7576
7590
|
ttsApikey: He.apiKey,
|
|
7577
|
-
ttsService:
|
|
7591
|
+
ttsService: Oe,
|
|
7578
7592
|
lipsyncModules: ["en"],
|
|
7579
7593
|
cameraView: r
|
|
7580
|
-
},
|
|
7594
|
+
}, ee = N(async () => {
|
|
7581
7595
|
if (!(!F.current || f.current))
|
|
7582
7596
|
try {
|
|
7583
|
-
ue(!0),
|
|
7584
|
-
if (
|
|
7585
|
-
const
|
|
7586
|
-
h(
|
|
7597
|
+
ue(!0), ve(null), f.current = new Qe(F.current, Y), await f.current.showAvatar(C, (S) => {
|
|
7598
|
+
if (S.lengthComputable) {
|
|
7599
|
+
const P = Math.min(100, Math.round(S.loaded / S.total * 100));
|
|
7600
|
+
h(P);
|
|
7587
7601
|
}
|
|
7588
7602
|
}), ue(!1), ze(!0), d(f.current);
|
|
7589
|
-
const
|
|
7603
|
+
const L = () => {
|
|
7590
7604
|
document.visibilityState === "visible" ? f.current?.start() : f.current?.stop();
|
|
7591
7605
|
};
|
|
7592
|
-
return document.addEventListener("visibilitychange",
|
|
7593
|
-
document.removeEventListener("visibilitychange",
|
|
7606
|
+
return document.addEventListener("visibilitychange", L), () => {
|
|
7607
|
+
document.removeEventListener("visibilitychange", L);
|
|
7594
7608
|
};
|
|
7595
|
-
} catch (
|
|
7596
|
-
console.error("Error initializing TalkingHead:",
|
|
7609
|
+
} catch (L) {
|
|
7610
|
+
console.error("Error initializing TalkingHead:", L), ve(L.message || "Failed to initialize avatar"), ue(!1), g(L);
|
|
7597
7611
|
}
|
|
7598
7612
|
}, []);
|
|
7599
|
-
xe(() => (
|
|
7613
|
+
xe(() => (ee(), () => {
|
|
7600
7614
|
f.current && (f.current.stop(), f.current.dispose(), f.current = null);
|
|
7601
|
-
}), [
|
|
7602
|
-
const
|
|
7615
|
+
}), [ee]);
|
|
7616
|
+
const ie = N(async () => {
|
|
7603
7617
|
if (f.current)
|
|
7604
7618
|
try {
|
|
7605
|
-
const
|
|
7606
|
-
|
|
7607
|
-
} catch (
|
|
7608
|
-
console.warn("Failed to resume audio context:",
|
|
7619
|
+
const L = f.current.audioCtx || f.current.audioContext;
|
|
7620
|
+
L && (L.state === "suspended" || L.state === "interrupted") && await L.resume();
|
|
7621
|
+
} catch (L) {
|
|
7622
|
+
console.warn("Failed to resume audio context:", L);
|
|
7609
7623
|
}
|
|
7610
|
-
}, []),
|
|
7624
|
+
}, []), be = N((L) => {
|
|
7611
7625
|
if (!A)
|
|
7612
7626
|
return [];
|
|
7613
|
-
let
|
|
7627
|
+
let S = null;
|
|
7614
7628
|
if (A._genderSpecific) {
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
}
|
|
7620
|
-
const q = B === "M" ? "male" : "female";
|
|
7621
|
-
console.log(`🔍 Gender detection: avatarBody="${e}" -> avatarGender="${B}" -> genderKey="${q}"`);
|
|
7622
|
-
const _ = A._genderSpecific[q];
|
|
7623
|
-
_ && _[S] ? (k = _[S], console.log(`✅ Found ${q} animations for "${S}": ${Array.isArray(k) ? k.length : 1} animation(s)`)) : A._genderSpecific.shared && A._genderSpecific.shared[S] ? (k = A._genderSpecific.shared[S], console.log(`✅ Found shared animations for "${S}": ${Array.isArray(k) ? k.length : 1} animation(s)`)) : console.log(`⚠️ No ${q} or shared animations found for "${S}"`);
|
|
7629
|
+
const P = ke(e);
|
|
7630
|
+
console.log(`🔍 Gender detection: avatarBody="${e}" -> genderKey="${P}"`);
|
|
7631
|
+
const K = A._genderSpecific[P];
|
|
7632
|
+
K && K[L] ? (S = K[L], console.log(`✅ Found ${P} animations for "${L}": ${Array.isArray(S) ? S.length : 1} animation(s)`)) : A._genderSpecific.shared && A._genderSpecific.shared[L] ? (S = A._genderSpecific.shared[L], console.log(`✅ Found shared animations for "${L}": ${Array.isArray(S) ? S.length : 1} animation(s)`)) : console.log(`⚠️ No ${P} or shared animations found for "${L}"`);
|
|
7624
7633
|
}
|
|
7625
|
-
return !
|
|
7626
|
-
}, [A, e]),
|
|
7627
|
-
const
|
|
7628
|
-
for (let
|
|
7629
|
-
const
|
|
7630
|
-
[
|
|
7634
|
+
return !S && A[L] && (S = A[L], console.log(`✅ Found root-level animations for "${L}": ${Array.isArray(S) ? S.length : 1} animation(s)`)), S ? Array.isArray(S) ? [...S] : typeof S == "string" ? [S] : [] : (console.log(`❌ No animations found for "${L}"`), []);
|
|
7635
|
+
}, [A, e, ke]), _ = N((L) => {
|
|
7636
|
+
const S = [...L];
|
|
7637
|
+
for (let P = S.length - 1; P > 0; P--) {
|
|
7638
|
+
const K = Math.floor(Math.random() * (P + 1));
|
|
7639
|
+
[S[P], S[K]] = [S[K], S[P]];
|
|
7631
7640
|
}
|
|
7632
|
-
return
|
|
7633
|
-
}, []),
|
|
7634
|
-
if (
|
|
7635
|
-
const
|
|
7636
|
-
if (
|
|
7641
|
+
return S;
|
|
7642
|
+
}, []), me = N((L) => {
|
|
7643
|
+
if (q.current.length === 0) {
|
|
7644
|
+
const P = be(L);
|
|
7645
|
+
if (P.length === 0)
|
|
7637
7646
|
return null;
|
|
7638
|
-
|
|
7647
|
+
q.current = _(P), ne.current = [];
|
|
7639
7648
|
}
|
|
7640
|
-
const
|
|
7641
|
-
return
|
|
7642
|
-
}, [
|
|
7649
|
+
const S = q.current.shift();
|
|
7650
|
+
return S && ne.current.push(S), S;
|
|
7651
|
+
}, [be, _]), Me = N((L) => L ? L.split("/").pop().replace(".fbx", "").replace(/[-_]/g, " ") : "Unknown", []), pe = N((L, S = !1, P = null) => {
|
|
7643
7652
|
if (!f.current)
|
|
7644
7653
|
return null;
|
|
7645
|
-
const
|
|
7646
|
-
if (
|
|
7654
|
+
const K = me(L);
|
|
7655
|
+
if (K)
|
|
7647
7656
|
try {
|
|
7648
|
-
const
|
|
7649
|
-
console.log(`🎬 Playing animation: "${
|
|
7650
|
-
const
|
|
7651
|
-
Z.current &&
|
|
7652
|
-
|
|
7653
|
-
}, 100) : (Z.current = !1,
|
|
7657
|
+
const te = Me(K);
|
|
7658
|
+
console.log(`🎬 Playing animation: "${te}"`);
|
|
7659
|
+
const Le = () => {
|
|
7660
|
+
Z.current && se.current === L && f.current && (f.current.isSpeaking || f.current.audioPlaylist && f.current.audioPlaylist.length > 0 || f.current.speechQueue && f.current.speechQueue.length > 0) ? setTimeout(() => {
|
|
7661
|
+
pe(L, S, P);
|
|
7662
|
+
}, 100) : (Z.current = !1, se.current = null, P && P());
|
|
7654
7663
|
};
|
|
7655
|
-
return f.current.playAnimation(
|
|
7656
|
-
} catch (
|
|
7657
|
-
return console.error("Failed to play animation:",
|
|
7664
|
+
return f.current.playAnimation(K, null, 0, 0, 0.01, S, Le), K;
|
|
7665
|
+
} catch (te) {
|
|
7666
|
+
return console.error("Failed to play animation:", te), null;
|
|
7658
7667
|
}
|
|
7659
7668
|
else
|
|
7660
|
-
Z.current &&
|
|
7661
|
-
|
|
7669
|
+
Z.current && se.current === L && f.current && (f.current.isSpeaking || f.current.audioPlaylist && f.current.audioPlaylist.length > 0 || f.current.speechQueue && f.current.speechQueue.length > 0) && (q.current = [], ne.current = [], setTimeout(() => {
|
|
7670
|
+
pe(L, S, P);
|
|
7662
7671
|
}, 100));
|
|
7663
7672
|
return null;
|
|
7664
|
-
}, [
|
|
7665
|
-
if (!f.current || !re || !
|
|
7673
|
+
}, [me, Me]), ge = N(async (L, S = {}) => {
|
|
7674
|
+
if (!f.current || !re || !L || L.trim() === "")
|
|
7666
7675
|
return;
|
|
7667
|
-
await
|
|
7668
|
-
const
|
|
7669
|
-
|
|
7670
|
-
const
|
|
7671
|
-
|
|
7672
|
-
const
|
|
7673
|
-
lipsyncLang:
|
|
7676
|
+
await ie();
|
|
7677
|
+
const P = S.animationGroup || p;
|
|
7678
|
+
P && !S.skipAnimation && (Z.current = !0, se.current = P, q.current = [], ne.current = [], pe(P)), G.current = { remainingText: null, originalText: null, options: null }, X.current = [], H.current = { text: L, options: S }, I.current && (clearInterval(I.current), I.current = null), v(!1), U.current = !1;
|
|
7679
|
+
const K = L.split(/[.!?]+/).filter((Le) => Le.trim().length > 0);
|
|
7680
|
+
X.current = K;
|
|
7681
|
+
const te = {
|
|
7682
|
+
lipsyncLang: S.lipsyncLang || "en",
|
|
7674
7683
|
onSpeechEnd: () => {
|
|
7675
|
-
I.current && (clearInterval(I.current), I.current = null), Z.current = !1,
|
|
7684
|
+
I.current && (clearInterval(I.current), I.current = null), Z.current = !1, se.current = null, q.current = [], ne.current = [], S.onSpeechEnd && S.onSpeechEnd(), R();
|
|
7676
7685
|
}
|
|
7677
7686
|
};
|
|
7678
7687
|
try {
|
|
7679
|
-
f.current.speakText(
|
|
7680
|
-
} catch (
|
|
7681
|
-
console.error("Error speaking text:",
|
|
7688
|
+
f.current.speakText(L, te);
|
|
7689
|
+
} catch (Le) {
|
|
7690
|
+
console.error("Error speaking text:", Le), ve(Le.message || "Failed to speak text");
|
|
7682
7691
|
}
|
|
7683
|
-
}, [re, R,
|
|
7692
|
+
}, [re, R, ie, p, pe]);
|
|
7684
7693
|
xe(() => {
|
|
7685
|
-
if (!re || !
|
|
7694
|
+
if (!re || !O || !f.current)
|
|
7686
7695
|
return;
|
|
7687
7696
|
D.current && clearInterval(D.current);
|
|
7688
|
-
const
|
|
7689
|
-
f.current && !U.current &&
|
|
7697
|
+
const L = () => {
|
|
7698
|
+
f.current && !U.current && pe(O);
|
|
7690
7699
|
};
|
|
7691
|
-
return
|
|
7692
|
-
|
|
7700
|
+
return L(), D.current = setInterval(() => {
|
|
7701
|
+
L();
|
|
7693
7702
|
}, 12e3 + Math.random() * 3e3), () => {
|
|
7694
7703
|
D.current && (clearInterval(D.current), D.current = null);
|
|
7695
7704
|
};
|
|
7696
|
-
}, [re,
|
|
7697
|
-
re && V && E && f.current &&
|
|
7698
|
-
}, [re, V, E,
|
|
7699
|
-
const
|
|
7705
|
+
}, [re, O, pe]), xe(() => {
|
|
7706
|
+
re && V && E && f.current && ge(V);
|
|
7707
|
+
}, [re, V, E, ge]);
|
|
7708
|
+
const Ae = N(() => {
|
|
7700
7709
|
if (f.current)
|
|
7701
7710
|
try {
|
|
7702
|
-
const
|
|
7703
|
-
if (
|
|
7711
|
+
const L = f.current.isSpeaking || !1, S = f.current.audioPlaylist || [], P = f.current.speechQueue || [];
|
|
7712
|
+
if (L || S.length > 0 || P.length > 0) {
|
|
7704
7713
|
I.current && (clearInterval(I.current), I.current = null);
|
|
7705
|
-
let
|
|
7706
|
-
|
|
7707
|
-
remainingText:
|
|
7714
|
+
let K = "";
|
|
7715
|
+
P.length > 0 && (K = P.map((te) => te.text && Array.isArray(te.text) ? te.text.map((Le) => Le.word).join(" ") : te.text || "").join(" ")), G.current = {
|
|
7716
|
+
remainingText: K || null,
|
|
7708
7717
|
originalText: H.current?.text || null,
|
|
7709
7718
|
options: H.current?.options || null
|
|
7710
7719
|
}, f.current.speechQueue.length = 0, f.current.pauseSpeaking(), v(!0), U.current = !0;
|
|
7711
7720
|
}
|
|
7712
|
-
} catch (
|
|
7713
|
-
console.warn("Error pausing speech:",
|
|
7721
|
+
} catch (L) {
|
|
7722
|
+
console.warn("Error pausing speech:", L);
|
|
7714
7723
|
}
|
|
7715
|
-
}, []),
|
|
7716
|
-
if (!(!f.current || !
|
|
7724
|
+
}, []), Be = N(async () => {
|
|
7725
|
+
if (!(!f.current || !J))
|
|
7717
7726
|
try {
|
|
7718
|
-
await
|
|
7719
|
-
const
|
|
7720
|
-
|
|
7721
|
-
} catch (
|
|
7722
|
-
console.warn("Error resuming speech:",
|
|
7727
|
+
await ie(), v(!1), U.current = !1;
|
|
7728
|
+
const L = G.current?.remainingText, S = G.current?.originalText || H.current?.text, P = G.current?.options || H.current?.options || {}, K = L || S;
|
|
7729
|
+
K && ge(K, P);
|
|
7730
|
+
} catch (L) {
|
|
7731
|
+
console.warn("Error resuming speech:", L), v(!1), U.current = !1;
|
|
7723
7732
|
}
|
|
7724
|
-
}, [
|
|
7725
|
-
f.current && (f.current.stopSpeaking(), I.current && (clearInterval(I.current), I.current = null), Z.current = !1,
|
|
7733
|
+
}, [J, ge, ie]), qe = N(() => {
|
|
7734
|
+
f.current && (f.current.stopSpeaking(), I.current && (clearInterval(I.current), I.current = null), Z.current = !1, se.current = null, q.current = [], ne.current = [], v(!1), U.current = !1);
|
|
7726
7735
|
}, []);
|
|
7727
|
-
return
|
|
7728
|
-
speakText:
|
|
7729
|
-
pauseSpeaking:
|
|
7730
|
-
resumeSpeaking:
|
|
7731
|
-
stopSpeaking:
|
|
7732
|
-
resumeAudioContext:
|
|
7733
|
-
isPaused: () =>
|
|
7734
|
-
setMood: (
|
|
7735
|
-
setBodyMovement: (
|
|
7736
|
-
f.current && f.current.setBodyMovement(
|
|
7736
|
+
return je(y, () => ({
|
|
7737
|
+
speakText: ge,
|
|
7738
|
+
pauseSpeaking: Ae,
|
|
7739
|
+
resumeSpeaking: Be,
|
|
7740
|
+
stopSpeaking: qe,
|
|
7741
|
+
resumeAudioContext: ie,
|
|
7742
|
+
isPaused: () => J,
|
|
7743
|
+
setMood: (L) => f.current?.setMood(L),
|
|
7744
|
+
setBodyMovement: (L) => {
|
|
7745
|
+
f.current && f.current.setBodyMovement(L);
|
|
7737
7746
|
},
|
|
7738
|
-
playAnimation: (
|
|
7739
|
-
f.current && f.current.playAnimation && f.current.playAnimation(
|
|
7747
|
+
playAnimation: (L, S = !1) => {
|
|
7748
|
+
f.current && f.current.playAnimation && f.current.playAnimation(L, null, 10, 0, 0.01, S);
|
|
7740
7749
|
},
|
|
7741
|
-
playRandomAnimation: (
|
|
7742
|
-
getRandomAnimation: (
|
|
7743
|
-
playReaction: (
|
|
7750
|
+
playRandomAnimation: (L, S = !1) => pe(L, S),
|
|
7751
|
+
getRandomAnimation: (L) => getRandomAnimation(L),
|
|
7752
|
+
playReaction: (L) => f.current?.playReaction(L),
|
|
7744
7753
|
playCelebration: () => f.current?.playCelebration(),
|
|
7745
|
-
setShowFullAvatar: (
|
|
7746
|
-
f.current && (w.current =
|
|
7754
|
+
setShowFullAvatar: (L) => {
|
|
7755
|
+
f.current && (w.current = L, f.current.setShowFullAvatar(L));
|
|
7747
7756
|
},
|
|
7748
7757
|
isReady: re,
|
|
7749
7758
|
talkingHead: f.current
|
|
7750
|
-
})), /* @__PURE__ */
|
|
7751
|
-
/* @__PURE__ */
|
|
7759
|
+
})), /* @__PURE__ */ Se("div", { className: `simple-talking-avatar-container ${b}`, style: k, children: [
|
|
7760
|
+
/* @__PURE__ */ $(
|
|
7752
7761
|
"div",
|
|
7753
7762
|
{
|
|
7754
7763
|
ref: F,
|
|
@@ -7760,7 +7769,7 @@ const zt = Ze(({
|
|
|
7760
7769
|
}
|
|
7761
7770
|
}
|
|
7762
7771
|
),
|
|
7763
|
-
|
|
7772
|
+
j && /* @__PURE__ */ $("div", { className: "loading-overlay", style: {
|
|
7764
7773
|
position: "absolute",
|
|
7765
7774
|
top: "50%",
|
|
7766
7775
|
left: "50%",
|
|
@@ -7769,7 +7778,7 @@ const zt = Ze(({
|
|
|
7769
7778
|
fontSize: "18px",
|
|
7770
7779
|
zIndex: 10
|
|
7771
7780
|
}, children: "Loading avatar..." }),
|
|
7772
|
-
le && /* @__PURE__ */
|
|
7781
|
+
le && /* @__PURE__ */ $("div", { className: "error-overlay", style: {
|
|
7773
7782
|
position: "absolute",
|
|
7774
7783
|
top: "50%",
|
|
7775
7784
|
left: "50%",
|
|
@@ -7783,8 +7792,8 @@ const zt = Ze(({
|
|
|
7783
7792
|
}, children: le })
|
|
7784
7793
|
] });
|
|
7785
7794
|
});
|
|
7786
|
-
|
|
7787
|
-
const
|
|
7795
|
+
Ht.displayName = "SimpleTalkingAvatar";
|
|
7796
|
+
const Tt = Xe(({
|
|
7788
7797
|
curriculumData: V = null,
|
|
7789
7798
|
avatarConfig: t = {},
|
|
7790
7799
|
animations: e = {},
|
|
@@ -7816,7 +7825,7 @@ const Ht = Ze(({
|
|
|
7816
7825
|
onQuestionAnswer: s,
|
|
7817
7826
|
onCurriculumComplete: i,
|
|
7818
7827
|
onCustomAction: a
|
|
7819
|
-
}), h = W(null), g = W(null), R = W(null), b = W(null),
|
|
7828
|
+
}), h = W(null), g = W(null), R = W(null), b = W(null), k = W(null), T = W(null), p = W(null), O = W(V?.curriculum || {
|
|
7820
7829
|
title: "Default Curriculum",
|
|
7821
7830
|
description: "No curriculum data provided",
|
|
7822
7831
|
language: "en",
|
|
@@ -7844,7 +7853,7 @@ const Ht = Ze(({
|
|
|
7844
7853
|
onCustomAction: a
|
|
7845
7854
|
};
|
|
7846
7855
|
}, [n, o, s, i, a]), xe(() => {
|
|
7847
|
-
|
|
7856
|
+
O.current = V?.curriculum || {
|
|
7848
7857
|
title: "Default Curriculum",
|
|
7849
7858
|
description: "No curriculum data provided",
|
|
7850
7859
|
language: "en",
|
|
@@ -7864,7 +7873,7 @@ const Ht = Ze(({
|
|
|
7864
7873
|
lipsyncLang: "en"
|
|
7865
7874
|
};
|
|
7866
7875
|
}, [V, t, e]);
|
|
7867
|
-
const y = N(() => (
|
|
7876
|
+
const y = N(() => (O.current || { modules: [] }).modules[r.current.currentModuleIndex]?.lessons[r.current.currentLessonIndex], []), F = N(() => y()?.questions[r.current.currentQuestionIndex], [y]), f = N((v, A) => A.type === "multiple_choice" || A.type === "true_false" ? v === A.answer : A.type === "code_test" && typeof v == "object" && v !== null ? v.passed === !0 : !1, []), w = N(() => {
|
|
7868
7877
|
r.current.lessonCompleted = !0, r.current.isQuestionMode = !1;
|
|
7869
7878
|
const v = r.current.totalQuestions > 0 ? Math.round(r.current.score / r.current.totalQuestions * 100) : 100;
|
|
7870
7879
|
let A = "Congratulations! You've completed this lesson";
|
|
@@ -7888,9 +7897,9 @@ const Ht = Ze(({
|
|
|
7888
7897
|
} catch {
|
|
7889
7898
|
u.current.playCelebration();
|
|
7890
7899
|
}
|
|
7891
|
-
const M =
|
|
7900
|
+
const M = O.current || { modules: [] }, D = M.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (D?.lessons?.length || 0) - 1, se = r.current.currentModuleIndex < (M.modules?.length || 0) - 1, ne = Z || se, q = E.current || { lipsyncLang: "en" };
|
|
7892
7901
|
u.current.speakText(A, {
|
|
7893
|
-
lipsyncLang:
|
|
7902
|
+
lipsyncLang: q.lipsyncLang,
|
|
7894
7903
|
onSpeechEnd: () => {
|
|
7895
7904
|
d.current.onCustomAction({
|
|
7896
7905
|
type: "lessonCompleteFeedbackDone",
|
|
@@ -7906,7 +7915,7 @@ const Ht = Ze(({
|
|
|
7906
7915
|
}
|
|
7907
7916
|
}, [e.lessonComplete]), H = N(() => {
|
|
7908
7917
|
r.current.curriculumCompleted = !0;
|
|
7909
|
-
const v =
|
|
7918
|
+
const v = O.current || { modules: [] };
|
|
7910
7919
|
if (d.current.onCurriculumComplete({
|
|
7911
7920
|
modules: v.modules.length,
|
|
7912
7921
|
totalLessons: v.modules.reduce((A, M) => A + M.lessons.length, 0)
|
|
@@ -7976,28 +7985,28 @@ const Ht = Ze(({
|
|
|
7976
7985
|
if (u.current.setMood("happy"), u.current.setBodyMovement("idle"), e.nextQuestion)
|
|
7977
7986
|
try {
|
|
7978
7987
|
u.current.playAnimation(e.nextQuestion, !0);
|
|
7979
|
-
} catch (
|
|
7980
|
-
console.warn("Failed to play nextQuestion animation:",
|
|
7988
|
+
} catch (q) {
|
|
7989
|
+
console.warn("Failed to play nextQuestion animation:", q);
|
|
7981
7990
|
}
|
|
7982
|
-
const D = E.current || { lipsyncLang: "en" },
|
|
7991
|
+
const D = E.current || { lipsyncLang: "en" }, se = y()?.questions?.length || 0, ne = r.current.currentQuestionIndex >= se - 1;
|
|
7983
7992
|
if (A.type === "code_test") {
|
|
7984
|
-
const
|
|
7985
|
-
u.current.speakText(
|
|
7993
|
+
const q = ne ? `Great! Here's your final coding challenge: ${A.question}` : `Great! Now let's move on to your next coding challenge: ${A.question}`;
|
|
7994
|
+
u.current.speakText(q, {
|
|
7986
7995
|
lipsyncLang: D.lipsyncLang
|
|
7987
7996
|
});
|
|
7988
7997
|
} else if (A.type === "multiple_choice") {
|
|
7989
|
-
const
|
|
7990
|
-
u.current.speakText(
|
|
7998
|
+
const q = ne ? `Alright! Here's your final question: ${A.question}` : `Alright! Here's your next question: ${A.question}`;
|
|
7999
|
+
u.current.speakText(q, {
|
|
7991
8000
|
lipsyncLang: D.lipsyncLang
|
|
7992
8001
|
});
|
|
7993
8002
|
} else if (A.type === "true_false") {
|
|
7994
|
-
const
|
|
7995
|
-
u.current.speakText(
|
|
8003
|
+
const q = ne ? `Now let's try this final one: ${A.question}` : `Now let's try this one: ${A.question}`;
|
|
8004
|
+
u.current.speakText(q, {
|
|
7996
8005
|
lipsyncLang: D.lipsyncLang
|
|
7997
8006
|
});
|
|
7998
8007
|
} else {
|
|
7999
|
-
const
|
|
8000
|
-
u.current.speakText(
|
|
8008
|
+
const q = ne ? `Here's your final question: ${A.question}` : `Here's the next question: ${A.question}`;
|
|
8009
|
+
u.current.speakText(q, {
|
|
8001
8010
|
lipsyncLang: D.lipsyncLang
|
|
8002
8011
|
});
|
|
8003
8012
|
}
|
|
@@ -8021,10 +8030,10 @@ const Ht = Ze(({
|
|
|
8021
8030
|
score: r.current.score
|
|
8022
8031
|
});
|
|
8023
8032
|
}, [e.nextQuestion, y, F]), G = N(() => {
|
|
8024
|
-
const v =
|
|
8033
|
+
const v = O.current || { modules: [] }, A = v.modules[r.current.currentModuleIndex];
|
|
8025
8034
|
if (r.current.currentLessonIndex < (A?.lessons?.length || 0) - 1) {
|
|
8026
8035
|
r.current.currentLessonIndex += 1, r.current.currentQuestionIndex = 0, r.current.lessonCompleted = !1, r.current.isQuestionMode = !1, r.current.isTeaching = !1, r.current.score = 0, r.current.totalQuestions = 0;
|
|
8027
|
-
const D = v.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (D?.lessons?.length || 0) - 1,
|
|
8036
|
+
const D = v.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (D?.lessons?.length || 0) - 1, se = r.current.currentModuleIndex < (v.modules?.length || 0) - 1, ne = Z || se;
|
|
8028
8037
|
d.current.onCustomAction({
|
|
8029
8038
|
type: "lessonStart",
|
|
8030
8039
|
moduleIndex: r.current.currentModuleIndex,
|
|
@@ -8037,20 +8046,20 @@ const Ht = Ze(({
|
|
|
8037
8046
|
}), u.current && (u.current.setMood("happy"), u.current.setBodyMovement("idle"));
|
|
8038
8047
|
} else if (r.current.currentModuleIndex < (v.modules?.length || 0) - 1) {
|
|
8039
8048
|
r.current.currentModuleIndex += 1, r.current.currentLessonIndex = 0, r.current.currentQuestionIndex = 0, r.current.lessonCompleted = !1, r.current.isQuestionMode = !1, r.current.isTeaching = !1, r.current.score = 0, r.current.totalQuestions = 0;
|
|
8040
|
-
const Z = v.modules[r.current.currentModuleIndex],
|
|
8049
|
+
const Z = v.modules[r.current.currentModuleIndex], se = r.current.currentLessonIndex < (Z?.lessons?.length || 0) - 1, ne = r.current.currentModuleIndex < (v.modules?.length || 0) - 1, q = se || ne;
|
|
8041
8050
|
d.current.onCustomAction({
|
|
8042
8051
|
type: "lessonStart",
|
|
8043
8052
|
moduleIndex: r.current.currentModuleIndex,
|
|
8044
8053
|
lessonIndex: r.current.currentLessonIndex,
|
|
8045
|
-
hasNextLesson:
|
|
8054
|
+
hasNextLesson: q
|
|
8046
8055
|
}), d.current.onLessonStart({
|
|
8047
8056
|
moduleIndex: r.current.currentModuleIndex,
|
|
8048
8057
|
lessonIndex: r.current.currentLessonIndex,
|
|
8049
8058
|
lesson: y()
|
|
8050
8059
|
}), u.current && (u.current.setMood("happy"), u.current.setBodyMovement("idle"));
|
|
8051
8060
|
} else
|
|
8052
|
-
|
|
8053
|
-
}, []),
|
|
8061
|
+
k.current && k.current();
|
|
8062
|
+
}, []), X = N(() => {
|
|
8054
8063
|
const v = y();
|
|
8055
8064
|
let A = null;
|
|
8056
8065
|
if (v?.avatar_script && v?.body) {
|
|
@@ -8097,7 +8106,7 @@ const Ht = Ze(({
|
|
|
8097
8106
|
}
|
|
8098
8107
|
});
|
|
8099
8108
|
}
|
|
8100
|
-
}, [e.teaching, y]),
|
|
8109
|
+
}, [e.teaching, y]), j = N((v) => {
|
|
8101
8110
|
const A = F(), M = f(v, A);
|
|
8102
8111
|
if (M && (r.current.score += 1), d.current.onQuestionAnswer({
|
|
8103
8112
|
moduleIndex: r.current.currentModuleIndex,
|
|
@@ -8117,11 +8126,11 @@ const Ht = Ze(({
|
|
|
8117
8126
|
u.current.setBodyMovement("gesturing");
|
|
8118
8127
|
const Z = y()?.questions?.length || 0;
|
|
8119
8128
|
r.current.currentQuestionIndex >= Z - 1;
|
|
8120
|
-
const
|
|
8121
|
-
console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", Z, "hasNextQuestion:",
|
|
8122
|
-
const ne = A.type === "code_test" ? `Great job! Your code passed all the tests! ${A.explanation || ""}` : `Excellent! That's correct! ${A.explanation || ""}`,
|
|
8129
|
+
const se = r.current.currentQuestionIndex < Z - 1;
|
|
8130
|
+
console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", Z, "hasNextQuestion:", se);
|
|
8131
|
+
const ne = A.type === "code_test" ? `Great job! Your code passed all the tests! ${A.explanation || ""}` : `Excellent! That's correct! ${A.explanation || ""}`, q = E.current || { lipsyncLang: "en" };
|
|
8123
8132
|
u.current.speakText(ne, {
|
|
8124
|
-
lipsyncLang:
|
|
8133
|
+
lipsyncLang: q.lipsyncLang,
|
|
8125
8134
|
onSpeechEnd: () => {
|
|
8126
8135
|
d.current.onCustomAction({
|
|
8127
8136
|
type: "answerFeedbackComplete",
|
|
@@ -8129,7 +8138,7 @@ const Ht = Ze(({
|
|
|
8129
8138
|
lessonIndex: r.current.currentLessonIndex,
|
|
8130
8139
|
questionIndex: r.current.currentQuestionIndex,
|
|
8131
8140
|
isCorrect: !0,
|
|
8132
|
-
hasNextQuestion:
|
|
8141
|
+
hasNextQuestion: se,
|
|
8133
8142
|
score: r.current.score,
|
|
8134
8143
|
totalQuestions: r.current.totalQuestions
|
|
8135
8144
|
});
|
|
@@ -8143,11 +8152,11 @@ const Ht = Ze(({
|
|
|
8143
8152
|
u.current.setBodyMovement("idle");
|
|
8144
8153
|
}
|
|
8145
8154
|
u.current.setBodyMovement("gesturing");
|
|
8146
|
-
const Z = y()?.questions?.length || 0,
|
|
8155
|
+
const Z = y()?.questions?.length || 0, se = r.current.currentQuestionIndex >= Z - 1, ne = r.current.currentQuestionIndex < Z - 1;
|
|
8147
8156
|
console.log("[CurriculumLearning] Answer feedback (incorrect) - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", Z, "hasNextQuestion:", ne);
|
|
8148
|
-
const
|
|
8149
|
-
u.current.speakText(
|
|
8150
|
-
lipsyncLang:
|
|
8157
|
+
const q = A.type === "code_test" ? `Your code didn't pass all the tests. ${A.explanation || "Try again!"}` : `Not quite right, but don't worry! ${A.explanation || ""}${se ? "" : " Let's move on to the next question."}`, ke = E.current || { lipsyncLang: "en" };
|
|
8158
|
+
u.current.speakText(q, {
|
|
8159
|
+
lipsyncLang: ke.lipsyncLang,
|
|
8151
8160
|
onSpeechEnd: () => {
|
|
8152
8161
|
d.current.onCustomAction({
|
|
8153
8162
|
type: "answerFeedbackComplete",
|
|
@@ -8238,8 +8247,8 @@ const Ht = Ze(({
|
|
|
8238
8247
|
}, 5e3);
|
|
8239
8248
|
}
|
|
8240
8249
|
}
|
|
8241
|
-
}, [F]),
|
|
8242
|
-
const v =
|
|
8250
|
+
}, [F]), ve = N(() => {
|
|
8251
|
+
const v = O.current || { modules: [] };
|
|
8243
8252
|
if (v.modules[r.current.currentModuleIndex], r.current.currentLessonIndex > 0)
|
|
8244
8253
|
r.current.currentLessonIndex -= 1, r.current.currentQuestionIndex = 0, r.current.lessonCompleted = !1, r.current.isQuestionMode = !1, r.current.isTeaching = !1, r.current.score = 0, r.current.totalQuestions = 0, d.current.onCustomAction({
|
|
8245
8254
|
type: "lessonStart",
|
|
@@ -8271,18 +8280,18 @@ const Ht = Ze(({
|
|
|
8271
8280
|
h.current && h.current();
|
|
8272
8281
|
}, 10);
|
|
8273
8282
|
}, [c, y]);
|
|
8274
|
-
|
|
8275
|
-
h.current =
|
|
8276
|
-
}),
|
|
8283
|
+
st(() => {
|
|
8284
|
+
h.current = X, g.current = G, R.current = w, b.current = U, k.current = H, T.current = I, p.current = j;
|
|
8285
|
+
}), je(l, () => ({
|
|
8277
8286
|
// Curriculum control methods
|
|
8278
|
-
startTeaching:
|
|
8287
|
+
startTeaching: X,
|
|
8279
8288
|
startQuestions: I,
|
|
8280
|
-
handleAnswerSelect:
|
|
8289
|
+
handleAnswerSelect: j,
|
|
8281
8290
|
handleCodeTestResult: ue,
|
|
8282
8291
|
nextQuestion: U,
|
|
8283
8292
|
previousQuestion: le,
|
|
8284
8293
|
nextLesson: G,
|
|
8285
|
-
previousLesson:
|
|
8294
|
+
previousLesson: ve,
|
|
8286
8295
|
completeLesson: w,
|
|
8287
8296
|
completeCurriculum: H,
|
|
8288
8297
|
resetCurriculum: re,
|
|
@@ -8339,8 +8348,8 @@ const Ht = Ze(({
|
|
|
8339
8348
|
handleResize: () => u.current?.handleResize(),
|
|
8340
8349
|
// Avatar readiness check (always returns current value)
|
|
8341
8350
|
isAvatarReady: () => u.current?.isReady || !1
|
|
8342
|
-
}), [
|
|
8343
|
-
const
|
|
8351
|
+
}), [X, I, j, ue, U, G, w, H, re, F, y]);
|
|
8352
|
+
const J = E.current || {
|
|
8344
8353
|
avatarUrl: "/avatars/brunette.glb",
|
|
8345
8354
|
avatarBody: "F",
|
|
8346
8355
|
mood: "happy",
|
|
@@ -8353,22 +8362,22 @@ const Ht = Ze(({
|
|
|
8353
8362
|
showFullAvatar: !1,
|
|
8354
8363
|
animations: e
|
|
8355
8364
|
};
|
|
8356
|
-
return /* @__PURE__ */
|
|
8357
|
-
|
|
8365
|
+
return /* @__PURE__ */ $("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ $(
|
|
8366
|
+
tt,
|
|
8358
8367
|
{
|
|
8359
8368
|
ref: u,
|
|
8360
|
-
avatarUrl:
|
|
8361
|
-
avatarBody:
|
|
8362
|
-
mood:
|
|
8363
|
-
ttsLang:
|
|
8364
|
-
ttsService:
|
|
8365
|
-
ttsVoice:
|
|
8366
|
-
ttsApiKey:
|
|
8367
|
-
bodyMovement:
|
|
8368
|
-
movementIntensity:
|
|
8369
|
-
showFullAvatar:
|
|
8369
|
+
avatarUrl: J.avatarUrl,
|
|
8370
|
+
avatarBody: J.avatarBody,
|
|
8371
|
+
mood: J.mood,
|
|
8372
|
+
ttsLang: J.ttsLang,
|
|
8373
|
+
ttsService: J.ttsService,
|
|
8374
|
+
ttsVoice: J.ttsVoice,
|
|
8375
|
+
ttsApiKey: J.ttsApiKey,
|
|
8376
|
+
bodyMovement: J.bodyMovement,
|
|
8377
|
+
movementIntensity: J.movementIntensity,
|
|
8378
|
+
showFullAvatar: J.showFullAvatar,
|
|
8370
8379
|
cameraView: "upper",
|
|
8371
|
-
animations:
|
|
8380
|
+
animations: J.animations,
|
|
8372
8381
|
onReady: ze,
|
|
8373
8382
|
onLoading: () => {
|
|
8374
8383
|
},
|
|
@@ -8378,8 +8387,8 @@ const Ht = Ze(({
|
|
|
8378
8387
|
}
|
|
8379
8388
|
) });
|
|
8380
8389
|
});
|
|
8381
|
-
|
|
8382
|
-
function
|
|
8390
|
+
Tt.displayName = "CurriculumLearning";
|
|
8391
|
+
function Wt({
|
|
8383
8392
|
manifestPath: V = "/animations/manifest.json",
|
|
8384
8393
|
avatarBody: t = "F",
|
|
8385
8394
|
onAnimationPlay: e = null,
|
|
@@ -8387,28 +8396,28 @@ function Ut({
|
|
|
8387
8396
|
onDeleteAnimations: o = null,
|
|
8388
8397
|
style: s = {}
|
|
8389
8398
|
}) {
|
|
8390
|
-
const [i, a] = ae([]), [c, l] = ae(/* @__PURE__ */ new Set()), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae("all"), [b,
|
|
8399
|
+
const [i, a] = ae([]), [c, l] = ae(/* @__PURE__ */ new Set()), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae("all"), [b, k] = ae("");
|
|
8391
8400
|
xe(() => {
|
|
8392
8401
|
(async () => {
|
|
8393
8402
|
r(!0), h(null);
|
|
8394
8403
|
try {
|
|
8395
|
-
const H = await
|
|
8404
|
+
const H = await Ne(V), I = [];
|
|
8396
8405
|
if (H._genderSpecific) {
|
|
8397
8406
|
const G = (t?.toUpperCase() || "F") === "M" ? "male" : "female";
|
|
8398
|
-
H._genderSpecific[G] && Object.entries(H._genderSpecific[G]).forEach(([
|
|
8399
|
-
(Array.isArray(
|
|
8407
|
+
H._genderSpecific[G] && Object.entries(H._genderSpecific[G]).forEach(([X, j]) => {
|
|
8408
|
+
(Array.isArray(j) ? j : [j]).forEach((le) => {
|
|
8400
8409
|
I.push({
|
|
8401
8410
|
path: le,
|
|
8402
|
-
group:
|
|
8411
|
+
group: X,
|
|
8403
8412
|
gender: G,
|
|
8404
8413
|
name: le.split("/").pop().replace(".fbx", "")
|
|
8405
8414
|
});
|
|
8406
8415
|
});
|
|
8407
|
-
}), H._genderSpecific.shared && Object.entries(H._genderSpecific.shared).forEach(([
|
|
8408
|
-
(Array.isArray(
|
|
8416
|
+
}), H._genderSpecific.shared && Object.entries(H._genderSpecific.shared).forEach(([X, j]) => {
|
|
8417
|
+
(Array.isArray(j) ? j : [j]).forEach((le) => {
|
|
8409
8418
|
I.push({
|
|
8410
8419
|
path: le,
|
|
8411
|
-
group:
|
|
8420
|
+
group: X,
|
|
8412
8421
|
gender: "shared",
|
|
8413
8422
|
name: le.split("/").pop().replace(".fbx", "")
|
|
8414
8423
|
});
|
|
@@ -8416,12 +8425,12 @@ function Ut({
|
|
|
8416
8425
|
});
|
|
8417
8426
|
}
|
|
8418
8427
|
Object.entries(H).forEach(([U, G]) => {
|
|
8419
|
-
U !== "_genderSpecific" && (Array.isArray(G) ? G : [G]).forEach((
|
|
8420
|
-
typeof
|
|
8421
|
-
path:
|
|
8428
|
+
U !== "_genderSpecific" && (Array.isArray(G) ? G : [G]).forEach((j) => {
|
|
8429
|
+
typeof j == "string" && I.push({
|
|
8430
|
+
path: j,
|
|
8422
8431
|
group: U,
|
|
8423
8432
|
gender: "root",
|
|
8424
|
-
name:
|
|
8433
|
+
name: j.split("/").pop().replace(".fbx", "")
|
|
8425
8434
|
});
|
|
8426
8435
|
});
|
|
8427
8436
|
}), a(I), r(!1);
|
|
@@ -8433,7 +8442,7 @@ function Ut({
|
|
|
8433
8442
|
const T = ["all", ...new Set(i.map((w) => w.group))], p = i.filter((w) => {
|
|
8434
8443
|
const H = g === "all" || w.group === g, I = b === "" || w.name.toLowerCase().includes(b.toLowerCase()) || w.path.toLowerCase().includes(b.toLowerCase());
|
|
8435
8444
|
return H && I;
|
|
8436
|
-
}),
|
|
8445
|
+
}), O = (w) => {
|
|
8437
8446
|
const H = new Set(c);
|
|
8438
8447
|
H.has(w) ? H.delete(w) : H.add(w), l(H), n && n(Array.from(H));
|
|
8439
8448
|
}, E = () => {
|
|
@@ -8461,32 +8470,32 @@ ${H.slice(0, 5).join(`
|
|
|
8461
8470
|
}, f = (w) => {
|
|
8462
8471
|
e && e(w);
|
|
8463
8472
|
};
|
|
8464
|
-
return u ? /* @__PURE__ */
|
|
8473
|
+
return u ? /* @__PURE__ */ $("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ $("p", { children: "Loading animations..." }) }) : d ? /* @__PURE__ */ $("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */ Se("p", { children: [
|
|
8465
8474
|
"Error loading animations: ",
|
|
8466
8475
|
d
|
|
8467
|
-
] }) }) : /* @__PURE__ */
|
|
8476
|
+
] }) }) : /* @__PURE__ */ Se("div", { style: {
|
|
8468
8477
|
padding: "20px",
|
|
8469
8478
|
backgroundColor: "#2a2a2a",
|
|
8470
8479
|
borderRadius: "8px",
|
|
8471
8480
|
color: "#fff",
|
|
8472
8481
|
...s
|
|
8473
8482
|
}, children: [
|
|
8474
|
-
/* @__PURE__ */
|
|
8475
|
-
/* @__PURE__ */
|
|
8476
|
-
/* @__PURE__ */
|
|
8483
|
+
/* @__PURE__ */ $("h2", { style: { marginTop: 0 }, children: "Animation Selector" }),
|
|
8484
|
+
/* @__PURE__ */ $("p", { style: { color: "#aaa", fontSize: "14px" }, children: "Click buttons to play animations. Select animations to keep, then delete will remove the rest." }),
|
|
8485
|
+
/* @__PURE__ */ Se("div", { style: {
|
|
8477
8486
|
display: "flex",
|
|
8478
8487
|
gap: "10px",
|
|
8479
8488
|
marginBottom: "20px",
|
|
8480
8489
|
flexWrap: "wrap",
|
|
8481
8490
|
alignItems: "center"
|
|
8482
8491
|
}, children: [
|
|
8483
|
-
/* @__PURE__ */
|
|
8492
|
+
/* @__PURE__ */ $(
|
|
8484
8493
|
"input",
|
|
8485
8494
|
{
|
|
8486
8495
|
type: "text",
|
|
8487
8496
|
placeholder: "Search animations...",
|
|
8488
8497
|
value: b,
|
|
8489
|
-
onChange: (w) =>
|
|
8498
|
+
onChange: (w) => k(w.target.value),
|
|
8490
8499
|
style: {
|
|
8491
8500
|
padding: "8px 12px",
|
|
8492
8501
|
borderRadius: "6px",
|
|
@@ -8499,7 +8508,7 @@ ${H.slice(0, 5).join(`
|
|
|
8499
8508
|
}
|
|
8500
8509
|
}
|
|
8501
8510
|
),
|
|
8502
|
-
/* @__PURE__ */
|
|
8511
|
+
/* @__PURE__ */ $(
|
|
8503
8512
|
"select",
|
|
8504
8513
|
{
|
|
8505
8514
|
value: g,
|
|
@@ -8512,10 +8521,10 @@ ${H.slice(0, 5).join(`
|
|
|
8512
8521
|
color: "#fff",
|
|
8513
8522
|
fontSize: "14px"
|
|
8514
8523
|
},
|
|
8515
|
-
children: T.map((w) => /* @__PURE__ */
|
|
8524
|
+
children: T.map((w) => /* @__PURE__ */ $("option", { value: w, children: w === "all" ? "All Groups" : w }, w))
|
|
8516
8525
|
}
|
|
8517
8526
|
),
|
|
8518
|
-
/* @__PURE__ */
|
|
8527
|
+
/* @__PURE__ */ $(
|
|
8519
8528
|
"button",
|
|
8520
8529
|
{
|
|
8521
8530
|
onClick: E,
|
|
@@ -8531,7 +8540,7 @@ ${H.slice(0, 5).join(`
|
|
|
8531
8540
|
children: "Select All Visible"
|
|
8532
8541
|
}
|
|
8533
8542
|
),
|
|
8534
|
-
/* @__PURE__ */
|
|
8543
|
+
/* @__PURE__ */ $(
|
|
8535
8544
|
"button",
|
|
8536
8545
|
{
|
|
8537
8546
|
onClick: y,
|
|
@@ -8547,7 +8556,7 @@ ${H.slice(0, 5).join(`
|
|
|
8547
8556
|
children: "Deselect All Visible"
|
|
8548
8557
|
}
|
|
8549
8558
|
),
|
|
8550
|
-
/* @__PURE__ */
|
|
8559
|
+
/* @__PURE__ */ Se(
|
|
8551
8560
|
"button",
|
|
8552
8561
|
{
|
|
8553
8562
|
onClick: F,
|
|
@@ -8569,7 +8578,7 @@ ${H.slice(0, 5).join(`
|
|
|
8569
8578
|
}
|
|
8570
8579
|
)
|
|
8571
8580
|
] }),
|
|
8572
|
-
/* @__PURE__ */
|
|
8581
|
+
/* @__PURE__ */ Se("div", { style: {
|
|
8573
8582
|
marginBottom: "15px",
|
|
8574
8583
|
fontSize: "14px",
|
|
8575
8584
|
color: "#aaa"
|
|
@@ -8581,7 +8590,7 @@ ${H.slice(0, 5).join(`
|
|
|
8581
8590
|
" | Showing: ",
|
|
8582
8591
|
p.length
|
|
8583
8592
|
] }),
|
|
8584
|
-
/* @__PURE__ */
|
|
8593
|
+
/* @__PURE__ */ $("div", { style: {
|
|
8585
8594
|
display: "grid",
|
|
8586
8595
|
gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
|
|
8587
8596
|
gap: "10px",
|
|
@@ -8592,7 +8601,7 @@ ${H.slice(0, 5).join(`
|
|
|
8592
8601
|
borderRadius: "6px"
|
|
8593
8602
|
}, children: p.map((w, H) => {
|
|
8594
8603
|
const I = c.has(w.path);
|
|
8595
|
-
return /* @__PURE__ */
|
|
8604
|
+
return /* @__PURE__ */ Se(
|
|
8596
8605
|
"div",
|
|
8597
8606
|
{
|
|
8598
8607
|
style: {
|
|
@@ -8603,15 +8612,15 @@ ${H.slice(0, 5).join(`
|
|
|
8603
8612
|
cursor: "pointer",
|
|
8604
8613
|
transition: "all 0.2s"
|
|
8605
8614
|
},
|
|
8606
|
-
onClick: () =>
|
|
8615
|
+
onClick: () => O(w.path),
|
|
8607
8616
|
children: [
|
|
8608
|
-
/* @__PURE__ */
|
|
8609
|
-
/* @__PURE__ */
|
|
8617
|
+
/* @__PURE__ */ Se("div", { style: { marginBottom: "8px" }, children: [
|
|
8618
|
+
/* @__PURE__ */ $(
|
|
8610
8619
|
"input",
|
|
8611
8620
|
{
|
|
8612
8621
|
type: "checkbox",
|
|
8613
8622
|
checked: I,
|
|
8614
|
-
onChange: () =>
|
|
8623
|
+
onChange: () => O(w.path),
|
|
8615
8624
|
onClick: (U) => U.stopPropagation(),
|
|
8616
8625
|
style: {
|
|
8617
8626
|
marginRight: "8px",
|
|
@@ -8619,19 +8628,19 @@ ${H.slice(0, 5).join(`
|
|
|
8619
8628
|
}
|
|
8620
8629
|
}
|
|
8621
8630
|
),
|
|
8622
|
-
/* @__PURE__ */
|
|
8631
|
+
/* @__PURE__ */ Se("span", { style: { fontSize: "12px", color: "#aaa" }, children: [
|
|
8623
8632
|
w.group,
|
|
8624
8633
|
" ",
|
|
8625
8634
|
w.gender !== "root" && `(${w.gender})`
|
|
8626
8635
|
] })
|
|
8627
8636
|
] }),
|
|
8628
|
-
/* @__PURE__ */
|
|
8637
|
+
/* @__PURE__ */ $("div", { style: {
|
|
8629
8638
|
fontSize: "13px",
|
|
8630
8639
|
fontWeight: "bold",
|
|
8631
8640
|
marginBottom: "8px",
|
|
8632
8641
|
wordBreak: "break-word"
|
|
8633
8642
|
}, children: w.name }),
|
|
8634
|
-
/* @__PURE__ */
|
|
8643
|
+
/* @__PURE__ */ $(
|
|
8635
8644
|
"button",
|
|
8636
8645
|
{
|
|
8637
8646
|
onClick: (U) => {
|
|
@@ -8655,14 +8664,14 @@ ${H.slice(0, 5).join(`
|
|
|
8655
8664
|
`${w.path}-${H}`
|
|
8656
8665
|
);
|
|
8657
8666
|
}) }),
|
|
8658
|
-
p.length === 0 && /* @__PURE__ */
|
|
8667
|
+
p.length === 0 && /* @__PURE__ */ $("div", { style: {
|
|
8659
8668
|
padding: "40px",
|
|
8660
8669
|
textAlign: "center",
|
|
8661
8670
|
color: "#aaa"
|
|
8662
8671
|
}, children: "No animations found matching your filters." })
|
|
8663
8672
|
] });
|
|
8664
8673
|
}
|
|
8665
|
-
const
|
|
8674
|
+
const nt = {
|
|
8666
8675
|
// Code-based dance animations (no FBX required)
|
|
8667
8676
|
dance: {
|
|
8668
8677
|
name: "dance",
|
|
@@ -8765,16 +8774,16 @@ const tt = {
|
|
|
8765
8774
|
duration: 5e3,
|
|
8766
8775
|
description: "Excited, energetic movement"
|
|
8767
8776
|
}
|
|
8768
|
-
},
|
|
8777
|
+
}, Vt = (V) => nt[V] || null, Gt = (V) => nt.hasOwnProperty(V);
|
|
8769
8778
|
export {
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8779
|
+
Wt as AnimationSelector,
|
|
8780
|
+
Tt as CurriculumLearning,
|
|
8781
|
+
Ht as SimpleTalkingAvatar,
|
|
8782
|
+
tt as TalkingHeadAvatar,
|
|
8783
|
+
Ct as TalkingHeadComponent,
|
|
8784
|
+
nt as animations,
|
|
8785
|
+
Ye as getActiveTTSConfig,
|
|
8786
|
+
Vt as getAnimation,
|
|
8787
|
+
Ut as getVoiceOptions,
|
|
8788
|
+
Gt as hasAnimation
|
|
8780
8789
|
};
|