@sage-rsc/talking-head-react 1.9.0 → 1.9.1
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 +520 -512
- package/package.json +1 -1
- package/src/components/SimpleTalkingAvatar.jsx +14 -3
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as Be, jsx as le } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $e, useRef as V, useState as pe, useEffect as ke, useCallback as W, useImperativeHandle as Je, useLayoutEffect as xt } from "react";
|
|
3
3
|
import * as A 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,
|
|
11
|
-
const T = [0, 0, 0, 0], U = new A.Vector3(),
|
|
4
|
+
import { OrbitControls as bt } from "three/addons/controls/OrbitControls.js";
|
|
5
|
+
import { GLTFLoader as At } from "three/addons/loaders/GLTFLoader.js";
|
|
6
|
+
import { DRACOLoader as Rt } from "three/addons/loaders/DRACOLoader.js";
|
|
7
|
+
import { FBXLoader as st } from "three/addons/loaders/FBXLoader.js";
|
|
8
|
+
import { RoomEnvironment as vt } from "three/addons/environments/RoomEnvironment.js";
|
|
9
|
+
import It from "three/addons/libs/stats.module.js";
|
|
10
|
+
let m, we, He;
|
|
11
|
+
const T = [0, 0, 0, 0], U = new A.Vector3(), Ye = new A.Vector3(), Re = new A.Vector3(), qe = new A.Vector3();
|
|
12
12
|
new A.Plane();
|
|
13
13
|
new A.Ray();
|
|
14
14
|
new A.Euler();
|
|
15
|
-
const
|
|
15
|
+
const ve = new A.Quaternion(), rt = new A.Quaternion(), Oe = new A.Matrix4(), De = new A.Matrix4();
|
|
16
16
|
new A.Vector3();
|
|
17
|
-
const
|
|
18
|
-
class
|
|
17
|
+
const _e = new A.Vector3(0, 0, 1), Lt = new A.Vector3(1, 0, 0), St = new A.Vector3(0, 1, 0), kt = new A.Vector3(0, 0, 1);
|
|
18
|
+
class wt {
|
|
19
19
|
constructor(n = null) {
|
|
20
20
|
this.opt = Object.assign({
|
|
21
21
|
warmupMs: 2e3,
|
|
@@ -338,7 +338,7 @@ class kt {
|
|
|
338
338
|
ea: [0, 0, 0, 0]
|
|
339
339
|
// External acceleration [m/s^2]
|
|
340
340
|
};
|
|
341
|
-
c.boneParent.matrixWorld.decompose(U,
|
|
341
|
+
c.boneParent.matrixWorld.decompose(U, ve, Re), U.copy(_e).applyQuaternion(ve).setY(0).normalize(), ve.premultiply(rt.setFromUnitVectors(_e, U).invert()).normalize(), c.qWorldInverseYaw = ve.clone().normalize(), this.data.push(c), this.dict[u] = c;
|
|
342
342
|
try {
|
|
343
343
|
this.setValue(u, "type", s.type), this.setValue(u, "stiffness", s.stiffness), this.setValue(u, "damping", s.damping), this.setValue(u, "external", s.external), this.setValue(u, "limits", s.limits), this.setValue(u, "excludes", s.excludes), this.setValue(u, "deltaLocal", s.deltaLocal), this.setValue(u, "deltaWorld", s.deltaWorld), this.setValue(u, "pivot", s.pivot), this.setValue(u, "helper", s.helper);
|
|
344
344
|
} catch (r) {
|
|
@@ -356,22 +356,22 @@ class kt {
|
|
|
356
356
|
for (this.timerMs += n, n > 1e3 && (this.timerMs = 0), n /= 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], U.copy(i.vWorld),
|
|
359
|
+
if (i = this.data[e], U.copy(i.vWorld), Oe.copy(i.boneParent.matrixWorld), De.copy(Oe).invert(), i.vWorld.setFromMatrixPosition(Oe), U.applyMatrix4(De), U.length() > 0.5 && (console.info("Info: Unrealistic jump of " + U.length().toFixed(2) + " meters."), U.setLength(0.5)), U.applyQuaternion(i.bone.quaternion), T[0] = U.x, T[1] = U.y, T[2] = -U.z, T[3] = U.length() / 3, i.children)
|
|
360
360
|
for (t = 0, s = i.children.length; t < s; t++)
|
|
361
361
|
m = i.children[t], T[0] -= m.v[0] * n / 3, T[1] -= m.v[1] * n / 3, T[2] += m.v[2] * n / 3, T[3] -= m.v[3] * n / 3;
|
|
362
362
|
if (m = this.opt.sensitivityFactor, T[0] *= i.ext * m, T[1] *= i.ext * m, T[2] *= i.ext * m, T[3] *= i.ext * m, i.isX && (m = T[0] / n, i.ea[0] = (m - i.ev[0]) / n, 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] * n + i.a[0] * n * n / 2 + T[0], m = i.v[0] + i.a[0] * n / 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]) * n / 2), i.isY && (m = T[1] / n, i.ea[1] = (m - i.ev[1]) / n, 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] * n + i.a[1] * n * n / 2 + T[1], m = i.v[1] + i.a[1] * n / 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]) * n / 2), i.isZ && (m = T[2] / n, i.ea[2] = (m - i.ev[2]) / n, 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] * n + i.a[2] * n * n / 2 + T[2], m = i.v[2] + i.a[2] * n / 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]) * n / 2), i.isT && (m = T[3] / n, i.ea[3] = (m - i.ev[3]) / n, 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] * n + i.a[3] * n * n / 2 + T[3], m = i.v[3] + i.a[3] * n / 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]) * n / 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), T[0] = i.p[0], T[1] = i.p[1], T[2] = i.p[2], T[3] = i.p[3], m = this.opt.movementFactor, T[0] *= m, T[1] *= m, T[2] *= m, T[3] *= m, i.dl && (m = i.dl, T[0] += m[0], T[1] += m[1], T[2] += m[2]), i.dw && (m = i.dw, U.set(
|
|
363
363
|
i.vBasis.x + T[0],
|
|
364
364
|
i.vBasis.y + T[1],
|
|
365
365
|
i.vBasis.z + T[2]
|
|
366
|
-
), U.applyMatrix4(
|
|
366
|
+
), U.applyMatrix4(Oe), U.x += m[0], U.y += m[1], U.z += m[2], U.applyMatrix4(De), T[0] += U.x - i.vBasis.x, T[1] += U.y - i.vBasis.y, T[2] += U.z - i.vBasis.z), i.limits && this.opt.isLimits && (m = i.limits, m[0] && (m[0][0] !== null && T[0] < m[0][0] && (T[0] = m[0][0]), m[0][1] !== null && T[0] > m[0][1] && (T[0] = m[0][1])), m[1] && (m[1][0] !== null && T[1] < m[1][0] && (T[1] = m[1][0]), m[1][1] !== null && T[1] > m[1][1] && (T[1] = m[1][1])), m[2] && (m[2][0] !== null && T[2] < m[2][0] && (T[2] = m[2][0]), m[2][1] !== null && T[2] > m[2][1] && (T[2] = m[2][1])), m[3] && (m[3][0] !== null && T[3] < m[3][0] && (T[3] = m[3][0]), m[3][1] !== null && T[3] > m[3][1] && (T[3] = m[3][1]))), i.isPoint)
|
|
367
367
|
i.bone.position.set(
|
|
368
368
|
i.vBasis.x + T[0],
|
|
369
369
|
i.vBasis.y + T[1],
|
|
370
370
|
i.vBasis.z - T[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(U,
|
|
372
|
+
else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(U, ve, Re), U.copy(_e).applyQuaternion(ve).setY(0).normalize(), ve.premultiply(rt.setFromUnitVectors(_e, U).invert()).normalize(), i.boneParent.quaternion.multiply(ve.invert()), i.boneParent.quaternion.multiply(i.qWorldInverseYaw)), i.isZ && (m = Math.atan(T[0] / i.l), ve.setFromAxisAngle(kt, -m), i.boneParent.quaternion.multiply(ve)), i.isY && (m = i.l / 3, m = m * Math.tanh(T[1] / m), i.bone.position.setLength(i.l + m)), i.isX && (m = Math.atan(T[2] / i.l), ve.setFromAxisAngle(Lt, -m), i.boneParent.quaternion.multiply(ve)), i.isT && (m = 1.5 * Math.tanh(T[3] * 1.5), ve.setFromAxisAngle(St, -m), i.boneParent.quaternion.multiply(ve)), i.boneParent.updateWorldMatrix(!1, !0), i.excludes && this.opt.isExcludes)
|
|
373
373
|
for (t = 0, s = i.excludes.length; t < s; t++)
|
|
374
|
-
m = i.excludes[t],
|
|
374
|
+
m = i.excludes[t], Re.set(0, 0, 0), m.deltaLocal && (Re.x += m.deltaLocal[0], Re.y += m.deltaLocal[1], Re.z += m.deltaLocal[2]), Re.applyMatrix4(m.bone.matrixWorld), De.copy(i.boneParent.matrixWorld).invert(), Re.applyMatrix4(De), U.copy(i.bone.position), !(U.distanceToSquared(Re) >= m.radiusSq) && (He = U.length(), we = Re.length(), !(we > m.radius + He) && (we < Math.abs(m.radius - He) || (we = (we * we + He * He - m.radiusSq) / (2 * we), Re.normalize(), qe.copy(Re).multiplyScalar(we), we = Math.sqrt(He * He - we * we), U.subVectors(U, qe).projectOnPlane(Re).normalize().multiplyScalar(we), Ye.subVectors(i.vBasis, qe).projectOnPlane(Re).normalize(), He = Ye.dot(U), He < 0 && (He = Math.sqrt(we * we - He * He), Ye.multiplyScalar(He), U.add(Ye)), U.add(qe).normalize(), Re.copy(i.bone.position).normalize(), ve.setFromUnitVectors(Re, U), i.boneParent.quaternion.premultiply(ve), i.boneParent.updateWorldMatrix(!1, !0))));
|
|
375
375
|
}
|
|
376
376
|
this.helpers.isActive && this.updateHelpers();
|
|
377
377
|
}
|
|
@@ -442,17 +442,17 @@ class kt {
|
|
|
442
442
|
*/
|
|
443
443
|
updateHelpers() {
|
|
444
444
|
if (m = this.helpers.points, m.bones.length) {
|
|
445
|
-
|
|
445
|
+
De.copy(this.armature.matrixWorld).invert();
|
|
446
446
|
const n = m.object.geometry.getAttribute("position");
|
|
447
447
|
for (let e = 0, t = m.bones.length; e < t; e++)
|
|
448
|
-
|
|
448
|
+
Oe.multiplyMatrices(De, m.bones[e].matrixWorld), U.setFromMatrixPosition(Oe), n.setXYZ(e, U.x, U.y, U.z);
|
|
449
449
|
n.needsUpdate = !0, m.object.updateMatrixWorld();
|
|
450
450
|
}
|
|
451
451
|
if (m = this.helpers.lines, m.bones.length) {
|
|
452
|
-
|
|
452
|
+
De.copy(this.armature.matrixWorld).invert();
|
|
453
453
|
const n = m.object.geometry.getAttribute("position");
|
|
454
454
|
for (let e = 0, t = 0, o = m.bones.length; e < o; e++, t += 2)
|
|
455
|
-
|
|
455
|
+
Oe.multiplyMatrices(De, m.bones[e].matrixWorld), U.setFromMatrixPosition(Oe), n.setXYZ(t, U.x, U.y, U.z), Oe.multiplyMatrices(De, m.bones[e].parent.matrixWorld), U.setFromMatrixPosition(Oe), n.setXYZ(t + 1, U.x, U.y, U.z);
|
|
456
456
|
n.needsUpdate = !0, m.object.updateMatrixWorld();
|
|
457
457
|
}
|
|
458
458
|
}
|
|
@@ -489,7 +489,7 @@ class kt {
|
|
|
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 Ct {
|
|
493
493
|
constructor(n) {
|
|
494
494
|
this.audioContext = n, this.analyzer = null, this.dataArray = null, this.bufferLength = 0;
|
|
495
495
|
}
|
|
@@ -814,7 +814,7 @@ class wt {
|
|
|
814
814
|
return o * s;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
class
|
|
817
|
+
class zt {
|
|
818
818
|
/**
|
|
819
819
|
* @constructor
|
|
820
820
|
*/
|
|
@@ -1396,11 +1396,11 @@ class Ct {
|
|
|
1396
1396
|
return e;
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1399
|
+
const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1400
1400
|
__proto__: null,
|
|
1401
|
-
LipsyncEn:
|
|
1401
|
+
LipsyncEn: zt
|
|
1402
1402
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1403
|
-
class
|
|
1403
|
+
class Tt {
|
|
1404
1404
|
/**
|
|
1405
1405
|
* @constructor
|
|
1406
1406
|
*/
|
|
@@ -1754,11 +1754,11 @@ class Ht {
|
|
|
1754
1754
|
return e;
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
-
const
|
|
1757
|
+
const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1758
1758
|
__proto__: null,
|
|
1759
|
-
LipsyncDe:
|
|
1759
|
+
LipsyncDe: Tt
|
|
1760
1760
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1761
|
-
class
|
|
1761
|
+
class Mt {
|
|
1762
1762
|
/**
|
|
1763
1763
|
* @constructor
|
|
1764
1764
|
*/
|
|
@@ -2289,11 +2289,11 @@ class Ft {
|
|
|
2289
2289
|
return e;
|
|
2290
2290
|
}
|
|
2291
2291
|
}
|
|
2292
|
-
const
|
|
2292
|
+
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2293
2293
|
__proto__: null,
|
|
2294
|
-
LipsyncFr:
|
|
2294
|
+
LipsyncFr: Mt
|
|
2295
2295
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2296
|
-
class
|
|
2296
|
+
class Pt {
|
|
2297
2297
|
/**
|
|
2298
2298
|
* @constructor
|
|
2299
2299
|
*/
|
|
@@ -2436,11 +2436,11 @@ class Et {
|
|
|
2436
2436
|
return e;
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
|
-
const
|
|
2439
|
+
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2440
2440
|
__proto__: null,
|
|
2441
|
-
LipsyncFi:
|
|
2441
|
+
LipsyncFi: Pt
|
|
2442
2442
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2443
|
-
class
|
|
2443
|
+
class Ot {
|
|
2444
2444
|
/**
|
|
2445
2445
|
* @constructor
|
|
2446
2446
|
*/
|
|
@@ -2620,24 +2620,24 @@ class Bt {
|
|
|
2620
2620
|
return e;
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
|
2623
|
-
const
|
|
2623
|
+
const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2624
2624
|
__proto__: null,
|
|
2625
|
-
LipsyncLt:
|
|
2626
|
-
}, Symbol.toStringTag, { value: "Module" })), Dt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoK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CBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLnJlc2V0KCk7IC8vIFJlc2V0IHRvIElETEUgc3RhdGUgZm9yIHJldXNlCiAgICAgICAgICAgIGJyZWFrOyAvLyBFeGl0IHdoaWxlIGxvb3AKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIC8vIEJVRkZFUiBVTkRFUlJVTiAoTEFHKTogUGxheSBzaWxlbmNlIGFuZCB3YWl0IGZvciBtb3JlIGRhdGEuCiAgICAgICAgICAgIHRoaXMuX3NpbGVuY2VGcmFtZXNDb3VudCsrOwogICAgICAgICAgICBp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lt:
|
|
2632
|
-
}, he = new A.Quaternion(),
|
|
2625
|
+
LipsyncLt: Ot
|
|
2626
|
+
}, Symbol.toStringTag, { value: "Module" })), Nt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxIHNlY29uZCkgYXMgYSBmYWxsYmFjayBzYWZldHkgbmV0CiAgICBjb25zdCBzaWxlbmNlRHVyYXRpb25TZWNvbmRzID0gMS4wOwogICAgdGhpcy5fc2lsZW5jZVRocmVzaG9sZEJsb2NrcyA9IE1hdGguY2VpbCgodGhpcy5fc2FtcGxlUmF0ZSAqIHNpbGVuY2VEdXJhdGlvblNlY29uZHMpIC8gMTI4KTsKCiAgICAvLyBNZXRyaWNzIGNvbmZpZ3VyYXRpb24gdmlhIG9wdGlvbnMKICAgIGNvbnN0IG1ldHJpY3NDZmcgPSBvcHRpb25zPy5wcm9jZXNzb3JPcHRpb25zPy5tZXRyaWNzIHx8IHt9OwogICAgdGhpcy5fbWV0cmljc0VuYWJsZWQgPSBtZXRyaWNzQ2ZnLmVuYWJsZWQgIT09IGZhbHNlOwogICAgY29uc3QgaW50ZXJ2YWxIeiA9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gT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICB9IGNhdGNoIChfKSB7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICB0aGl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AgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), at = {
|
|
2627
|
+
en: Ht,
|
|
2628
|
+
de: Ft,
|
|
2629
|
+
fr: Et,
|
|
2630
|
+
fi: Bt,
|
|
2631
|
+
lt: Dt
|
|
2632
|
+
}, he = new A.Quaternion(), se = new A.Euler(), We = new A.Vector3(), Ve = new A.Vector3(), lt = new A.Box3();
|
|
2633
2633
|
new A.Matrix4();
|
|
2634
2634
|
new A.Matrix4();
|
|
2635
2635
|
new A.Vector3();
|
|
2636
2636
|
new A.Vector3(0, 0, 1);
|
|
2637
|
-
const
|
|
2637
|
+
const Ut = new A.Vector3(1, 0, 0);
|
|
2638
2638
|
new A.Vector3(0, 1, 0);
|
|
2639
2639
|
new A.Vector3(0, 0, 1);
|
|
2640
|
-
class
|
|
2640
|
+
class ot {
|
|
2641
2641
|
/**
|
|
2642
2642
|
* Avatar.
|
|
2643
2643
|
* @typedef {Object} Avatar
|
|
@@ -2763,7 +2763,7 @@ class it {
|
|
|
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 It(), 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 it {
|
|
|
4086
4086
|
this.opt.lightSpotDispersion
|
|
4087
4087
|
), this.setLighting(this.opt);
|
|
4088
4088
|
const a = new A.PMREMGenerator(this.renderer);
|
|
4089
|
-
a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new
|
|
4089
|
+
a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new vt()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new bt(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 A.SkinnedMesh();
|
|
4092
4092
|
const s = {
|
|
@@ -4104,14 +4104,14 @@ class it {
|
|
|
4104
4104
|
Object.entries(s).forEach((a, u) => {
|
|
4105
4105
|
const l = new A.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 A.Skeleton(i)), this.dynamicbones = new
|
|
4107
|
+
}), this.ikMesh.bind(new A.Skeleton(i)), this.dynamicbones = new wt(), 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(n = null) {
|
|
4114
|
-
if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), n ? this.audioCtx = new AudioContext({ sampleRate: n }) : 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(), n ? this.audioCtx = new AudioContext({ sampleRate: n }) : 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 Ct(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) {
|
|
@@ -4252,9 +4252,9 @@ class it {
|
|
|
4252
4252
|
async showAvatar(n, e = null) {
|
|
4253
4253
|
if (!n || !n.hasOwnProperty("url"))
|
|
4254
4254
|
throw new Error("Invalid parameter. The avatar must have at least 'url' specified.");
|
|
4255
|
-
const t = new
|
|
4255
|
+
const t = new At();
|
|
4256
4256
|
if (this.dracoEnabled) {
|
|
4257
|
-
const l = new
|
|
4257
|
+
const l = new Rt();
|
|
4258
4258
|
l.setDecoderPath(this.dracoDecoderPath), t.setDRACOLoader(l);
|
|
4259
4259
|
}
|
|
4260
4260
|
let o = await t.loadAsync(n.url, e);
|
|
@@ -4412,9 +4412,9 @@ class it {
|
|
|
4412
4412
|
updatePoseDelta() {
|
|
4413
4413
|
for (const [n, e] of Object.entries(this.poseDelta.props)) {
|
|
4414
4414
|
if (e.x === 0 && e.y === 0 && e.z === 0) continue;
|
|
4415
|
-
|
|
4415
|
+
se.set(e.x, e.y, e.z);
|
|
4416
4416
|
const t = this.poseAvatar.props[n];
|
|
4417
|
-
t.isQuaternion ? (he.setFromEuler(
|
|
4417
|
+
t.isQuaternion ? (he.setFromEuler(se), t.multiply(he)) : t.isVector3 && t.add(se);
|
|
4418
4418
|
}
|
|
4419
4419
|
}
|
|
4420
4420
|
/**
|
|
@@ -5179,7 +5179,7 @@ class it {
|
|
|
5179
5179
|
}, o.x ? new A.Vector3(o.x, o.y, o.z) : null, !0, o.d);
|
|
5180
5180
|
break;
|
|
5181
5181
|
}
|
|
5182
|
-
if ((u || l) && (
|
|
5182
|
+
if ((u || l) && (se.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), se.x = Math.max(-0.9, Math.min(0.9, 2 * se.x - 0.5)), se.y = Math.max(-0.9, Math.min(0.9, -2.5 * se.y)), u ? (Object.assign(this.mtAvatar.eyesLookDown, { system: se.x < 0 ? -se.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: se.x < 0 ? 0 : se.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: se.y < 0 ? -se.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: se.y < 0 ? 0 : se.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: se.y < 0 ? 0 : se.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: se.y < 0 ? -se.y : 0, needsUpdate: !0 }), l && (t = -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: {
|
|
@@ -5208,7 +5208,7 @@ class it {
|
|
|
5208
5208
|
this.animationFinishedCallback = null, this.currentFBXActionCallback = null, this.currentFBXActionForCallback = null, this.currentFBXActionStartTime = null, this.currentFBXActionClipDuration = null, b();
|
|
5209
5209
|
} else this.currentFBXActionCallback && (this.currentFBXActionCallback = null, this.currentFBXActionForCallback = null, this.currentFBXActionStartTime = null, this.currentFBXActionClipDuration = null);
|
|
5210
5210
|
}
|
|
5211
|
-
if (this.updatePoseDelta(), (this.isSpeaking || this.isListening) && u ? 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), t = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(t), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(t) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (he.setFromAxisAngle(
|
|
5211
|
+
if (this.updatePoseDelta(), (this.isSpeaking || this.isListening) && u ? 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), t = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(t), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(t) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (he.setFromAxisAngle(Ut, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(he)), lt.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(We), We.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(Ve), Ve.sub(this.armature.position), this.objectHips.position.y -= lt.min.y / 2, this.objectHips.position.x -= (We.x + Ve.x) / 4, this.objectHips.position.z -= (We.z + Ve.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
|
|
5212
5212
|
this.stats && this.stats.end();
|
|
5213
5213
|
else {
|
|
5214
5214
|
if (this.cameraClock !== null && this.cameraClock < 1e3) {
|
|
@@ -5239,8 +5239,8 @@ class it {
|
|
|
5239
5239
|
if (!this.lipsync.hasOwnProperty(n)) {
|
|
5240
5240
|
const t = n.toLowerCase(), o = "Lipsync" + n.charAt(0).toUpperCase() + n.slice(1);
|
|
5241
5241
|
try {
|
|
5242
|
-
const s =
|
|
5243
|
-
s && s[o] ? this.lipsync[n] = new s[o]() : console.warn(`Lip-sync module for ${n} not found. Available modules:`, Object.keys(
|
|
5242
|
+
const s = at[t];
|
|
5243
|
+
s && s[o] ? this.lipsync[n] = new s[o]() : console.warn(`Lip-sync module for ${n} not found. Available modules:`, Object.keys(at));
|
|
5244
5244
|
} catch (s) {
|
|
5245
5245
|
console.warn(`Failed to load lip-sync module for ${n}:`, s);
|
|
5246
5246
|
}
|
|
@@ -5981,7 +5981,7 @@ class it {
|
|
|
5981
5981
|
}
|
|
5982
5982
|
if (!this.workletLoaded)
|
|
5983
5983
|
try {
|
|
5984
|
-
const a = this.audioCtx.audioWorklet.addModule(
|
|
5984
|
+
const a = this.audioCtx.audioWorklet.addModule(Nt.href), u = new Promise(
|
|
5985
5985
|
(l, c) => setTimeout(() => c(new Error("Worklet loading timed out")), 5e3)
|
|
5986
5986
|
);
|
|
5987
5987
|
await Promise.race([a, u]), this.workletLoaded = !0;
|
|
@@ -6219,7 +6219,7 @@ class it {
|
|
|
6219
6219
|
*/
|
|
6220
6220
|
lookAtCamera(n) {
|
|
6221
6221
|
let e;
|
|
6222
|
-
if (this.speakTo && (e = new A.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0),
|
|
6222
|
+
if (this.speakTo && (e = new A.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), We.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), Ve.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(We, Ve).divideScalar(2)) : this.speakTo.isObject3D ? this.speakTo.getWorldPosition(e) : this.speakTo.isVector3 ? e.set(this.speakTo) : this.speakTo.x && this.speakTo.y && this.speakTo.z && e.set(this.speakTo.x, this.speakTo.y, this.speakTo.z)), !e) {
|
|
6223
6223
|
if (this.avatar.hasOwnProperty("avatarIgnoreCamera")) {
|
|
6224
6224
|
if (this.avatar.avatarIgnoreCamera) {
|
|
6225
6225
|
this.lookAhead(n);
|
|
@@ -6232,12 +6232,12 @@ class it {
|
|
|
6232
6232
|
this.lookAt(null, null, n);
|
|
6233
6233
|
return;
|
|
6234
6234
|
}
|
|
6235
|
-
this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0),
|
|
6236
|
-
const t = new A.Vector3().subVectors(e,
|
|
6237
|
-
|
|
6238
|
-
const a = new A.Quaternion().setFromEuler(
|
|
6239
|
-
|
|
6240
|
-
let l =
|
|
6235
|
+
this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), We.setFromMatrixPosition(this.objectLeftEye.matrixWorld), Ve.setFromMatrixPosition(this.objectRightEye.matrixWorld), We.add(Ve).divideScalar(2), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]);
|
|
6236
|
+
const t = new A.Vector3().subVectors(e, We).normalize(), o = Math.atan2(t.x, t.z), s = Math.asin(-t.y);
|
|
6237
|
+
se.set(s, o, 0, "YXZ");
|
|
6238
|
+
const a = new A.Quaternion().setFromEuler(se), u = new A.Quaternion().copy(a).multiply(he.clone().invert());
|
|
6239
|
+
se.setFromQuaternion(u, "YXZ");
|
|
6240
|
+
let l = se.x / (40 / 24) + 0.2, c = se.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, l)), h = Math.min(0.8, Math.max(-0.8, c)), d = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
|
|
6241
6241
|
if (n) {
|
|
6242
6242
|
let b = this.animQueue.findIndex((L) => L.template.name === "lookat");
|
|
6243
6243
|
b !== -1 && this.animQueue.splice(b, 1);
|
|
@@ -6272,8 +6272,8 @@ class it {
|
|
|
6272
6272
|
const s = new A.Vector3().setFromMatrixPosition(this.objectLeftEye.matrixWorld), i = new A.Vector3().setFromMatrixPosition(this.objectRightEye.matrixWorld), a = new A.Vector3().addVectors(s, i).divideScalar(2);
|
|
6273
6273
|
a.project(this.camera);
|
|
6274
6274
|
let u = (a.x + 1) / 2 * o.width + o.left, l = -(a.y - 1) / 2 * o.height + o.top;
|
|
6275
|
-
n === null && (n = u), e === null && (e = l), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]),
|
|
6276
|
-
let c =
|
|
6275
|
+
n === null && (n = u), e === null && (e = l), he.copy(this.armature.quaternion), he.multiply(this.poseTarget.props["Hips.quaternion"]), he.multiply(this.poseTarget.props["Spine.quaternion"]), he.multiply(this.poseTarget.props["Spine1.quaternion"]), he.multiply(this.poseTarget.props["Spine2.quaternion"]), he.multiply(this.poseTarget.props["Neck.quaternion"]), he.multiply(this.poseTarget.props["Head.quaternion"]), se.setFromQuaternion(he);
|
|
6276
|
+
let c = se.x / (40 / 24), r = se.y / (9 / 4), h = Math.min(0.4, Math.max(-0.4, this.camera.rotation.x)), d = Math.min(0.4, Math.max(-0.4, this.camera.rotation.y)), p = Math.max(window.innerWidth - u, u), b = Math.max(window.innerHeight - l, l), f = this.convertRange(e, [l - b, l + b], [-0.3, 0.6]) - c + h, L = this.convertRange(n, [u - p, u + p], [-0.8, 0.8]) - r + d;
|
|
6277
6277
|
f = Math.min(0.6, Math.max(-0.3, f)), L = Math.min(0.8, Math.max(-0.8, L));
|
|
6278
6278
|
let Q = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
|
|
6279
6279
|
if (t) {
|
|
@@ -6518,7 +6518,7 @@ class it {
|
|
|
6518
6518
|
} catch (d) {
|
|
6519
6519
|
console.warn(`Could not verify file existence for ${n}, attempting to load anyway:`, d);
|
|
6520
6520
|
}
|
|
6521
|
-
const r = new
|
|
6521
|
+
const r = new st();
|
|
6522
6522
|
let h;
|
|
6523
6523
|
try {
|
|
6524
6524
|
h = await r.loadAsync(n, e);
|
|
@@ -6701,7 +6701,7 @@ class it {
|
|
|
6701
6701
|
let a = this.animQueue.find((u) => u.template.name === "pose");
|
|
6702
6702
|
a && (a.ts[0] = this.animClock + t * 1e3 + 2e3), this.setPoseFromTemplate(i);
|
|
6703
6703
|
} else {
|
|
6704
|
-
let u = await new
|
|
6704
|
+
let u = await new st().loadAsync(n, e);
|
|
6705
6705
|
if (u && u.animations && u.animations[o]) {
|
|
6706
6706
|
let l = u.animations[o];
|
|
6707
6707
|
const c = {};
|
|
@@ -6826,7 +6826,7 @@ class it {
|
|
|
6826
6826
|
this.isRunning = !1, this.stop(), this.stopSpeaking(), this.streamStop(), this.isAvatarOnly ? this.armature && (this.armature.parent && this.armature.parent.remove(this.armature), this.clearThree(this.armature)) : (this.clearThree(this.scene), this.resizeobserver.disconnect(), this.renderer && (this.renderer.dispose(), this.renderer.domElement && this.renderer.domElement.parentNode && this.renderer.domElement.parentNode.removeChild(this.renderer.domElement), this.renderer = null)), this.clearThree(this.ikMesh), this.dynamicbones.dispose();
|
|
6827
6827
|
}
|
|
6828
6828
|
}
|
|
6829
|
-
const
|
|
6829
|
+
const Xe = {
|
|
6830
6830
|
apiKey: "sk_ace57ef3ef65a92b9d3bee2a00183b78ca790bc3e10964f2",
|
|
6831
6831
|
// Replace with your actual API key (should start with sk_)
|
|
6832
6832
|
endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
|
|
@@ -6846,7 +6846,7 @@ const Ve = {
|
|
|
6846
6846
|
josh: "VR6AewLTigWG4xSOukaG"
|
|
6847
6847
|
// Male, American
|
|
6848
6848
|
}
|
|
6849
|
-
},
|
|
6849
|
+
}, Ke = {
|
|
6850
6850
|
defaultVoice: "aura-2-thalia-en",
|
|
6851
6851
|
// Thalia (Female, English)
|
|
6852
6852
|
voices: {
|
|
@@ -6866,17 +6866,17 @@ const Ve = {
|
|
|
6866
6866
|
// Male, English - Powerful
|
|
6867
6867
|
}
|
|
6868
6868
|
};
|
|
6869
|
-
function
|
|
6869
|
+
function et() {
|
|
6870
6870
|
return {
|
|
6871
6871
|
service: "elevenlabs",
|
|
6872
|
-
endpoint:
|
|
6873
|
-
apiKey:
|
|
6874
|
-
defaultVoice:
|
|
6875
|
-
voices:
|
|
6872
|
+
endpoint: Xe.endpoint,
|
|
6873
|
+
apiKey: Xe.apiKey,
|
|
6874
|
+
defaultVoice: Xe.defaultVoice,
|
|
6875
|
+
voices: Xe.voices
|
|
6876
6876
|
};
|
|
6877
6877
|
}
|
|
6878
|
-
function
|
|
6879
|
-
const Y =
|
|
6878
|
+
function Jt() {
|
|
6879
|
+
const Y = et(), n = [];
|
|
6880
6880
|
return Object.entries(Y.voices).forEach(([e, t]) => {
|
|
6881
6881
|
n.push({
|
|
6882
6882
|
value: t,
|
|
@@ -6884,7 +6884,7 @@ function $t() {
|
|
|
6884
6884
|
});
|
|
6885
6885
|
}), n;
|
|
6886
6886
|
}
|
|
6887
|
-
const
|
|
6887
|
+
const ut = $e(({
|
|
6888
6888
|
avatarUrl: Y = "/avatars/brunette.glb",
|
|
6889
6889
|
avatarBody: n = "F",
|
|
6890
6890
|
mood: e = "neutral",
|
|
@@ -6906,98 +6906,98 @@ const ct = Ke(({
|
|
|
6906
6906
|
style: b = {},
|
|
6907
6907
|
animations: f = {}
|
|
6908
6908
|
}, L) => {
|
|
6909
|
-
const Q = V(null), g = V(null), H = V(l), M = V(null), y = V(null), E = V(!1), S = V({ remainingText: null, originalText: null, options: null }), C = V([]), x = V(0), [I, G] =
|
|
6910
|
-
|
|
6911
|
-
E.current =
|
|
6912
|
-
}, [
|
|
6909
|
+
const Q = V(null), g = V(null), H = V(l), M = V(null), y = V(null), E = V(!1), S = V({ remainingText: null, originalText: null, options: null }), C = V([]), x = V(0), [I, G] = pe(!0), [P, D] = pe(null), [$, ye] = pe(!1), [fe, Te] = pe(!1);
|
|
6910
|
+
ke(() => {
|
|
6911
|
+
E.current = fe;
|
|
6912
|
+
}, [fe]), ke(() => {
|
|
6913
6913
|
H.current = l;
|
|
6914
6914
|
}, [l]);
|
|
6915
|
-
const
|
|
6916
|
-
let
|
|
6917
|
-
Me === "browser" ?
|
|
6915
|
+
const Ie = et(), Me = o || Ie.service;
|
|
6916
|
+
let re;
|
|
6917
|
+
Me === "browser" ? re = {
|
|
6918
6918
|
service: "browser",
|
|
6919
6919
|
endpoint: "",
|
|
6920
6920
|
apiKey: null,
|
|
6921
6921
|
defaultVoice: "Google US English"
|
|
6922
|
-
} : Me === "elevenlabs" ?
|
|
6922
|
+
} : Me === "elevenlabs" ? re = {
|
|
6923
6923
|
service: "elevenlabs",
|
|
6924
6924
|
endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
|
|
6925
|
-
apiKey: i ||
|
|
6926
|
-
defaultVoice: s ||
|
|
6927
|
-
voices:
|
|
6928
|
-
} : Me === "deepgram" ?
|
|
6925
|
+
apiKey: i || Ie.apiKey,
|
|
6926
|
+
defaultVoice: s || Ie.defaultVoice || Xe.defaultVoice,
|
|
6927
|
+
voices: Ie.voices || Xe.voices
|
|
6928
|
+
} : Me === "deepgram" ? re = {
|
|
6929
6929
|
service: "deepgram",
|
|
6930
6930
|
endpoint: "https://api.deepgram.com/v1/speak",
|
|
6931
|
-
apiKey: i ||
|
|
6932
|
-
defaultVoice: s ||
|
|
6933
|
-
voices:
|
|
6934
|
-
} :
|
|
6935
|
-
...
|
|
6931
|
+
apiKey: i || Ie.apiKey,
|
|
6932
|
+
defaultVoice: s || Ie.defaultVoice || Ke.defaultVoice,
|
|
6933
|
+
voices: Ie.voices || Ke.voices
|
|
6934
|
+
} : re = {
|
|
6935
|
+
...Ie,
|
|
6936
6936
|
// Override API key if provided via props
|
|
6937
|
-
apiKey: i !== null ? i :
|
|
6937
|
+
apiKey: i !== null ? i : Ie.apiKey
|
|
6938
6938
|
};
|
|
6939
6939
|
const R = {
|
|
6940
6940
|
url: Y,
|
|
6941
6941
|
body: n,
|
|
6942
6942
|
avatarMood: e,
|
|
6943
6943
|
ttsLang: Me === "browser" ? "en-US" : t,
|
|
6944
|
-
ttsVoice: s ||
|
|
6944
|
+
ttsVoice: s || re.defaultVoice,
|
|
6945
6945
|
lipsyncLang: "en",
|
|
6946
6946
|
showFullAvatar: l,
|
|
6947
6947
|
bodyMovement: a,
|
|
6948
6948
|
movementIntensity: u
|
|
6949
6949
|
}, v = {
|
|
6950
|
-
ttsEndpoint:
|
|
6951
|
-
ttsApikey:
|
|
6950
|
+
ttsEndpoint: re.endpoint,
|
|
6951
|
+
ttsApikey: re.apiKey,
|
|
6952
6952
|
ttsService: Me,
|
|
6953
6953
|
lipsyncModules: ["en"],
|
|
6954
6954
|
cameraView: c
|
|
6955
6955
|
}, N = W(async () => {
|
|
6956
6956
|
if (!(!Q.current || g.current))
|
|
6957
6957
|
try {
|
|
6958
|
-
if (G(!0), D(null), g.current = new
|
|
6959
|
-
if (
|
|
6960
|
-
const
|
|
6961
|
-
h(
|
|
6958
|
+
if (G(!0), D(null), g.current = new ot(Q.current, v), g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1), f && Object.keys(f).length > 0 && (g.current.customAnimations = f), await g.current.showAvatar(R, (ce) => {
|
|
6959
|
+
if (ce.lengthComputable) {
|
|
6960
|
+
const ae = Math.min(100, Math.round(ce.loaded / ce.total * 100));
|
|
6961
|
+
h(ae);
|
|
6962
6962
|
}
|
|
6963
|
-
}), await new Promise((
|
|
6964
|
-
const
|
|
6965
|
-
g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ?
|
|
6963
|
+
}), await new Promise((ce) => {
|
|
6964
|
+
const ae = () => {
|
|
6965
|
+
g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? ce() : setTimeout(ae, 100);
|
|
6966
6966
|
};
|
|
6967
|
-
|
|
6967
|
+
ae();
|
|
6968
6968
|
}), g.current && g.current.setShowFullAvatar)
|
|
6969
6969
|
try {
|
|
6970
6970
|
g.current.setShowFullAvatar(l);
|
|
6971
|
-
} catch (
|
|
6972
|
-
console.warn("Error setting full body mode on initialization:",
|
|
6971
|
+
} catch (ce) {
|
|
6972
|
+
console.warn("Error setting full body mode on initialization:", ce);
|
|
6973
6973
|
}
|
|
6974
|
-
g.current && g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1, g.current.controls.update()), G(!1),
|
|
6975
|
-
const
|
|
6974
|
+
g.current && g.current.controls && (g.current.controls.enableRotate = !1, g.current.controls.enableZoom = !1, g.current.controls.enablePan = !1, g.current.controls.enableDamping = !1, g.current.controls.update()), G(!1), ye(!0), r(g.current);
|
|
6975
|
+
const K = () => {
|
|
6976
6976
|
document.visibilityState === "visible" ? g.current?.start() : g.current?.stop();
|
|
6977
6977
|
};
|
|
6978
|
-
return document.addEventListener("visibilitychange",
|
|
6979
|
-
document.removeEventListener("visibilitychange",
|
|
6978
|
+
return document.addEventListener("visibilitychange", K), () => {
|
|
6979
|
+
document.removeEventListener("visibilitychange", K);
|
|
6980
6980
|
};
|
|
6981
6981
|
} catch (w) {
|
|
6982
6982
|
console.error("Error initializing TalkingHead:", w), D(w.message || "Failed to initialize avatar"), G(!1), d(w);
|
|
6983
6983
|
}
|
|
6984
6984
|
}, [Y, n, e, t, o, s, i, l, a, u, c]);
|
|
6985
|
-
|
|
6985
|
+
ke(() => (N(), () => {
|
|
6986
6986
|
g.current && (g.current.stop(), g.current.dispose(), g.current = null);
|
|
6987
|
-
}), [N]),
|
|
6987
|
+
}), [N]), ke(() => {
|
|
6988
6988
|
if (!Q.current || !g.current) return;
|
|
6989
|
-
const w = new ResizeObserver((
|
|
6990
|
-
for (const
|
|
6989
|
+
const w = new ResizeObserver((ce) => {
|
|
6990
|
+
for (const ae of ce)
|
|
6991
6991
|
g.current && g.current.onResize && g.current.onResize();
|
|
6992
6992
|
});
|
|
6993
6993
|
w.observe(Q.current);
|
|
6994
|
-
const
|
|
6994
|
+
const K = () => {
|
|
6995
6995
|
g.current && g.current.onResize && g.current.onResize();
|
|
6996
6996
|
};
|
|
6997
|
-
return window.addEventListener("resize",
|
|
6998
|
-
w.disconnect(), window.removeEventListener("resize",
|
|
6997
|
+
return window.addEventListener("resize", K), () => {
|
|
6998
|
+
w.disconnect(), window.removeEventListener("resize", K);
|
|
6999
6999
|
};
|
|
7000
|
-
}, [
|
|
7000
|
+
}, [$]);
|
|
7001
7001
|
const B = W(async () => {
|
|
7002
7002
|
if (g.current && g.current.audioCtx)
|
|
7003
7003
|
try {
|
|
@@ -7005,162 +7005,162 @@ const ct = Ke(({
|
|
|
7005
7005
|
} catch (w) {
|
|
7006
7006
|
console.warn("Failed to resume audio context:", w);
|
|
7007
7007
|
}
|
|
7008
|
-
}, []), j = W(async (w,
|
|
7009
|
-
if (g.current &&
|
|
7008
|
+
}, []), j = W(async (w, K = {}) => {
|
|
7009
|
+
if (g.current && $)
|
|
7010
7010
|
try {
|
|
7011
|
-
y.current && (clearInterval(y.current), y.current = null), M.current = { text: w, options:
|
|
7012
|
-
const
|
|
7013
|
-
C.current =
|
|
7014
|
-
const
|
|
7015
|
-
...
|
|
7016
|
-
lipsyncLang:
|
|
7011
|
+
y.current && (clearInterval(y.current), y.current = null), M.current = { text: w, options: K }, S.current = { remainingText: null, originalText: null, options: null };
|
|
7012
|
+
const ce = /[!\.\?\n\p{Extended_Pictographic}]/ug, ae = w.split(ce).map((J) => J.trim()).filter((J) => J.length > 0);
|
|
7013
|
+
C.current = ae, x.current = 0, Te(!1), E.current = !1, await B();
|
|
7014
|
+
const Ae = {
|
|
7015
|
+
...K,
|
|
7016
|
+
lipsyncLang: K.lipsyncLang || R.lipsyncLang || "en"
|
|
7017
7017
|
};
|
|
7018
|
-
if (
|
|
7019
|
-
const
|
|
7020
|
-
let me = null,
|
|
7021
|
-
const
|
|
7022
|
-
let
|
|
7018
|
+
if (K.onSpeechEnd && g.current) {
|
|
7019
|
+
const J = g.current;
|
|
7020
|
+
let me = null, Ce = 0;
|
|
7021
|
+
const Ne = 1200;
|
|
7022
|
+
let Ee = !1;
|
|
7023
7023
|
me = setInterval(() => {
|
|
7024
|
-
if (
|
|
7024
|
+
if (Ce++, E.current)
|
|
7025
7025
|
return;
|
|
7026
|
-
if (
|
|
7027
|
-
if (me && (clearInterval(me), me = null, y.current = null), !
|
|
7028
|
-
|
|
7026
|
+
if (Ce > Ne) {
|
|
7027
|
+
if (me && (clearInterval(me), me = null, y.current = null), !Ee && !E.current) {
|
|
7028
|
+
Ee = !0;
|
|
7029
7029
|
try {
|
|
7030
|
-
|
|
7030
|
+
K.onSpeechEnd();
|
|
7031
7031
|
} catch (Ge) {
|
|
7032
7032
|
console.error("Error in onSpeechEnd callback (timeout):", Ge);
|
|
7033
7033
|
}
|
|
7034
7034
|
}
|
|
7035
7035
|
return;
|
|
7036
7036
|
}
|
|
7037
|
-
const
|
|
7038
|
-
|
|
7039
|
-
if (
|
|
7040
|
-
|
|
7037
|
+
const ze = !J.speechQueue || J.speechQueue.length === 0, Pe = !J.audioPlaylist || J.audioPlaylist.length === 0;
|
|
7038
|
+
J && J.isSpeaking === !1 && ze && Pe && J.isAudioPlaying === !1 && !Ee && !E.current && setTimeout(() => {
|
|
7039
|
+
if (J && !E.current && J.isSpeaking === !1 && (!J.speechQueue || J.speechQueue.length === 0) && (!J.audioPlaylist || J.audioPlaylist.length === 0) && J.isAudioPlaying === !1 && !Ee && !E.current) {
|
|
7040
|
+
Ee = !0, me && (clearInterval(me), me = null, y.current = null);
|
|
7041
7041
|
try {
|
|
7042
|
-
|
|
7043
|
-
} catch (
|
|
7044
|
-
console.error("Error in onSpeechEnd callback:",
|
|
7042
|
+
K.onSpeechEnd();
|
|
7043
|
+
} catch (Qe) {
|
|
7044
|
+
console.error("Error in onSpeechEnd callback:", Qe);
|
|
7045
7045
|
}
|
|
7046
7046
|
}
|
|
7047
7047
|
}, 100);
|
|
7048
7048
|
}, 100), y.current = me;
|
|
7049
7049
|
}
|
|
7050
|
-
g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w,
|
|
7051
|
-
await B(), g.current && g.current.lipsync && (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w,
|
|
7050
|
+
g.current.lipsync && Object.keys(g.current.lipsync).length > 0 ? (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w, Ae)) : setTimeout(async () => {
|
|
7051
|
+
await B(), g.current && g.current.lipsync && (g.current.setSlowdownRate && g.current.setSlowdownRate(1.05), g.current.speakText(w, Ae));
|
|
7052
7052
|
}, 100);
|
|
7053
|
-
} catch (
|
|
7054
|
-
console.error("Error speaking text:",
|
|
7053
|
+
} catch (ce) {
|
|
7054
|
+
console.error("Error speaking text:", ce), D(ce.message || "Failed to speak text");
|
|
7055
7055
|
}
|
|
7056
|
-
}, [
|
|
7056
|
+
}, [$, B, R.lipsyncLang]), ie = W(() => {
|
|
7057
7057
|
g.current && (g.current.stopSpeaking(), g.current.setSlowdownRate && g.current.setSlowdownRate(1), M.current = null, Te(!1));
|
|
7058
7058
|
}, []), X = W(() => {
|
|
7059
7059
|
if (g.current && g.current.pauseSpeaking) {
|
|
7060
7060
|
const w = g.current;
|
|
7061
7061
|
if (w.isSpeaking || w.audioPlaylist && w.audioPlaylist.length > 0 || w.speechQueue && w.speechQueue.length > 0) {
|
|
7062
7062
|
y.current && (clearInterval(y.current), y.current = null);
|
|
7063
|
-
let
|
|
7063
|
+
let ce = "";
|
|
7064
7064
|
if (M.current && C.current.length > 0) {
|
|
7065
|
-
const
|
|
7066
|
-
if (me > 0 &&
|
|
7067
|
-
const
|
|
7068
|
-
|
|
7065
|
+
const ae = C.current.length, Ae = w.speechQueue ? w.speechQueue.filter((Ne) => Ne && Ne.text && Array.isArray(Ne.text) && Ne.text.length > 0).length : 0, J = w.audioPlaylist && w.audioPlaylist.length > 0, me = Ae + (J ? 1 : 0), Ce = ae - me;
|
|
7066
|
+
if (me > 0 && Ce < ae && (ce = C.current.slice(Ce).join(". ").trim(), !ce && Ae > 0 && w.speechQueue)) {
|
|
7067
|
+
const Ee = w.speechQueue.filter((ze) => ze && ze.text && Array.isArray(ze.text) && ze.text.length > 0).map((ze) => ze.text.map((Pe) => Pe.word || "").filter((Pe) => Pe.length > 0).join(" ")).filter((ze) => ze.length > 0).join(" ");
|
|
7068
|
+
Ee && Ee.trim() && (ce = Ee.trim());
|
|
7069
7069
|
}
|
|
7070
7070
|
}
|
|
7071
7071
|
M.current && (S.current = {
|
|
7072
|
-
remainingText:
|
|
7072
|
+
remainingText: ce || null,
|
|
7073
7073
|
originalText: M.current.text,
|
|
7074
7074
|
options: M.current.options
|
|
7075
7075
|
}), w.speechQueue && (w.speechQueue.length = 0), g.current.pauseSpeaking(), E.current = !0, Te(!0);
|
|
7076
7076
|
}
|
|
7077
7077
|
}
|
|
7078
|
-
}, []),
|
|
7079
|
-
if (!g.current || !
|
|
7078
|
+
}, []), _ = W(async () => {
|
|
7079
|
+
if (!g.current || !fe)
|
|
7080
7080
|
return;
|
|
7081
|
-
let w = "",
|
|
7081
|
+
let w = "", K = {};
|
|
7082
7082
|
if (S.current && S.current.remainingText)
|
|
7083
|
-
w = S.current.remainingText,
|
|
7083
|
+
w = S.current.remainingText, K = S.current.options || {}, S.current = { remainingText: null, originalText: null, options: null };
|
|
7084
7084
|
else if (M.current && M.current.text)
|
|
7085
|
-
w = M.current.text,
|
|
7085
|
+
w = M.current.text, K = M.current.options || {};
|
|
7086
7086
|
else {
|
|
7087
7087
|
console.warn("Resume called but no paused speech found"), Te(!1), E.current = !1;
|
|
7088
7088
|
return;
|
|
7089
7089
|
}
|
|
7090
7090
|
Te(!1), E.current = !1, await B();
|
|
7091
|
-
const
|
|
7092
|
-
...
|
|
7093
|
-
lipsyncLang:
|
|
7091
|
+
const ce = {
|
|
7092
|
+
...K,
|
|
7093
|
+
lipsyncLang: K.lipsyncLang || R.lipsyncLang || "en"
|
|
7094
7094
|
};
|
|
7095
7095
|
try {
|
|
7096
|
-
await j(w,
|
|
7097
|
-
} catch (
|
|
7098
|
-
console.error("Error resuming speech:",
|
|
7096
|
+
await j(w, ce);
|
|
7097
|
+
} catch (ae) {
|
|
7098
|
+
console.error("Error resuming speech:", ae), Te(!1), E.current = !1;
|
|
7099
7099
|
}
|
|
7100
|
-
}, [B,
|
|
7100
|
+
}, [B, fe, j, R]), Le = W((w) => {
|
|
7101
7101
|
g.current && g.current.setMood(w);
|
|
7102
|
-
}, []),
|
|
7102
|
+
}, []), xe = W((w) => {
|
|
7103
7103
|
g.current && g.current.setSlowdownRate && g.current.setSlowdownRate(w);
|
|
7104
|
-
}, []),
|
|
7104
|
+
}, []), be = W((w, K = !1) => {
|
|
7105
7105
|
if (g.current && g.current.playAnimation) {
|
|
7106
7106
|
if (f && f[w] && (w = f[w]), g.current.setShowFullAvatar)
|
|
7107
7107
|
try {
|
|
7108
7108
|
g.current.setShowFullAvatar(H.current);
|
|
7109
|
-
} catch (
|
|
7110
|
-
console.warn("Error setting full body mode:",
|
|
7109
|
+
} catch (ae) {
|
|
7110
|
+
console.warn("Error setting full body mode:", ae);
|
|
7111
7111
|
}
|
|
7112
7112
|
if (w.includes("."))
|
|
7113
7113
|
try {
|
|
7114
|
-
g.current.playAnimation(w, null, 10, 0, 0.01,
|
|
7115
|
-
} catch (
|
|
7116
|
-
console.warn(`Failed to play ${w}:`,
|
|
7114
|
+
g.current.playAnimation(w, null, 10, 0, 0.01, K);
|
|
7115
|
+
} catch (ae) {
|
|
7116
|
+
console.warn(`Failed to play ${w}:`, ae);
|
|
7117
7117
|
try {
|
|
7118
7118
|
g.current.setBodyMovement("idle");
|
|
7119
|
-
} catch (
|
|
7120
|
-
console.warn("Fallback animation also failed:",
|
|
7119
|
+
} catch (Ae) {
|
|
7120
|
+
console.warn("Fallback animation also failed:", Ae);
|
|
7121
7121
|
}
|
|
7122
7122
|
}
|
|
7123
7123
|
else {
|
|
7124
|
-
const
|
|
7125
|
-
let
|
|
7126
|
-
for (const
|
|
7124
|
+
const ae = [".fbx", ".glb", ".gltf"];
|
|
7125
|
+
let Ae = !1;
|
|
7126
|
+
for (const J of ae)
|
|
7127
7127
|
try {
|
|
7128
|
-
g.current.playAnimation(w +
|
|
7128
|
+
g.current.playAnimation(w + J, null, 10, 0, 0.01, K), Ae = !0;
|
|
7129
7129
|
break;
|
|
7130
7130
|
} catch {
|
|
7131
7131
|
}
|
|
7132
|
-
if (!
|
|
7132
|
+
if (!Ae) {
|
|
7133
7133
|
console.warn("Animation not found:", w);
|
|
7134
7134
|
try {
|
|
7135
7135
|
g.current.setBodyMovement("idle");
|
|
7136
|
-
} catch (
|
|
7137
|
-
console.warn("Fallback animation also failed:",
|
|
7136
|
+
} catch (J) {
|
|
7137
|
+
console.warn("Fallback animation also failed:", J);
|
|
7138
7138
|
}
|
|
7139
7139
|
}
|
|
7140
7140
|
}
|
|
7141
7141
|
}
|
|
7142
|
-
}, [f]),
|
|
7142
|
+
}, [f]), tt = W(() => {
|
|
7143
7143
|
g.current && g.current.onResize && g.current.onResize();
|
|
7144
7144
|
}, []);
|
|
7145
|
-
return
|
|
7145
|
+
return Je(L, () => ({
|
|
7146
7146
|
speakText: j,
|
|
7147
|
-
stopSpeaking:
|
|
7147
|
+
stopSpeaking: ie,
|
|
7148
7148
|
pauseSpeaking: X,
|
|
7149
|
-
resumeSpeaking:
|
|
7149
|
+
resumeSpeaking: _,
|
|
7150
7150
|
resumeAudioContext: B,
|
|
7151
|
-
setMood:
|
|
7152
|
-
setTimingAdjustment:
|
|
7153
|
-
playAnimation:
|
|
7154
|
-
isReady:
|
|
7155
|
-
isPaused:
|
|
7151
|
+
setMood: Le,
|
|
7152
|
+
setTimingAdjustment: xe,
|
|
7153
|
+
playAnimation: be,
|
|
7154
|
+
isReady: $,
|
|
7155
|
+
isPaused: fe,
|
|
7156
7156
|
talkingHead: g.current,
|
|
7157
|
-
handleResize:
|
|
7157
|
+
handleResize: tt,
|
|
7158
7158
|
setBodyMovement: (w) => {
|
|
7159
7159
|
if (g.current && g.current.setShowFullAvatar && g.current.setBodyMovement)
|
|
7160
7160
|
try {
|
|
7161
7161
|
g.current.setShowFullAvatar(H.current), g.current.setBodyMovement(w);
|
|
7162
|
-
} catch (
|
|
7163
|
-
console.warn("Error setting body movement:",
|
|
7162
|
+
} catch (K) {
|
|
7163
|
+
console.warn("Error setting body movement:", K);
|
|
7164
7164
|
}
|
|
7165
7165
|
},
|
|
7166
7166
|
setMovementIntensity: (w) => g.current?.setMovementIntensity(w),
|
|
@@ -7176,8 +7176,8 @@ const ct = Ke(({
|
|
|
7176
7176
|
if (g.current && g.current.setShowFullAvatar && g.current.playReaction)
|
|
7177
7177
|
try {
|
|
7178
7178
|
g.current.setShowFullAvatar(H.current), g.current.playReaction(w);
|
|
7179
|
-
} catch (
|
|
7180
|
-
console.warn("Error playing reaction:",
|
|
7179
|
+
} catch (K) {
|
|
7180
|
+
console.warn("Error playing reaction:", K);
|
|
7181
7181
|
}
|
|
7182
7182
|
},
|
|
7183
7183
|
playCelebration: () => {
|
|
@@ -7192,8 +7192,8 @@ const ct = Ke(({
|
|
|
7192
7192
|
if (g.current && g.current.setShowFullAvatar)
|
|
7193
7193
|
try {
|
|
7194
7194
|
H.current = w, g.current.setShowFullAvatar(w);
|
|
7195
|
-
} catch (
|
|
7196
|
-
console.warn("Error setting showFullAvatar:",
|
|
7195
|
+
} catch (K) {
|
|
7196
|
+
console.warn("Error setting showFullAvatar:", K);
|
|
7197
7197
|
}
|
|
7198
7198
|
},
|
|
7199
7199
|
lockAvatarPosition: () => {
|
|
@@ -7212,7 +7212,7 @@ const ct = Ke(({
|
|
|
7212
7212
|
console.warn("Error unlocking avatar position:", w);
|
|
7213
7213
|
}
|
|
7214
7214
|
}
|
|
7215
|
-
})), /* @__PURE__ */
|
|
7215
|
+
})), /* @__PURE__ */ Be(
|
|
7216
7216
|
"div",
|
|
7217
7217
|
{
|
|
7218
7218
|
className: `talking-head-avatar ${p}`,
|
|
@@ -7260,8 +7260,8 @@ const ct = Ke(({
|
|
|
7260
7260
|
}
|
|
7261
7261
|
);
|
|
7262
7262
|
});
|
|
7263
|
-
|
|
7264
|
-
const
|
|
7263
|
+
ut.displayName = "TalkingHeadAvatar";
|
|
7264
|
+
const Wt = $e(({
|
|
7265
7265
|
text: Y = "Hello! I'm a talking avatar. How are you today?",
|
|
7266
7266
|
onLoading: n = () => {
|
|
7267
7267
|
},
|
|
@@ -7273,7 +7273,7 @@ const Ut = Ke(({
|
|
|
7273
7273
|
style: s = {},
|
|
7274
7274
|
avatarConfig: i = {}
|
|
7275
7275
|
}, a) => {
|
|
7276
|
-
const u = V(null), l = V(null), [c, r] =
|
|
7276
|
+
const u = V(null), l = V(null), [c, r] = pe(!0), [h, d] = pe(null), [p, b] = pe(!1), f = et(), L = i.ttsService || f.service, Q = L === "browser" ? {
|
|
7277
7277
|
endpoint: "",
|
|
7278
7278
|
apiKey: null,
|
|
7279
7279
|
defaultVoice: "Google US English"
|
|
@@ -7306,7 +7306,7 @@ const Ut = Ke(({
|
|
|
7306
7306
|
}, M = W(async () => {
|
|
7307
7307
|
if (!(!u.current || l.current))
|
|
7308
7308
|
try {
|
|
7309
|
-
if (r(!0), d(null), l.current = new
|
|
7309
|
+
if (r(!0), d(null), l.current = new ot(u.current, H), await l.current.showAvatar(g, (P) => {
|
|
7310
7310
|
if (P.lengthComputable) {
|
|
7311
7311
|
const D = Math.min(100, Math.round(P.loaded / P.total * 100));
|
|
7312
7312
|
n(D);
|
|
@@ -7314,7 +7314,7 @@ const Ut = Ke(({
|
|
|
7314
7314
|
}), l.current.morphs && l.current.morphs.length > 0) {
|
|
7315
7315
|
const P = l.current.morphs[0].morphTargetDictionary;
|
|
7316
7316
|
console.log("Available morph targets:", Object.keys(P));
|
|
7317
|
-
const D = Object.keys(P).filter((
|
|
7317
|
+
const D = Object.keys(P).filter(($) => $.startsWith("viseme_"));
|
|
7318
7318
|
console.log("Viseme morph targets found:", D), D.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"));
|
|
7319
7319
|
}
|
|
7320
7320
|
if (await new Promise((P) => {
|
|
@@ -7339,7 +7339,7 @@ const Ut = Ke(({
|
|
|
7339
7339
|
console.error("Error initializing TalkingHead:", I), d(I.message || "Failed to initialize avatar"), r(!1), e(I);
|
|
7340
7340
|
}
|
|
7341
7341
|
}, []);
|
|
7342
|
-
|
|
7342
|
+
ke(() => (M(), () => {
|
|
7343
7343
|
l.current && (l.current.stop(), l.current.dispose(), l.current = null);
|
|
7344
7344
|
}), [M]);
|
|
7345
7345
|
const y = W((I) => {
|
|
@@ -7374,33 +7374,33 @@ const Ut = Ke(({
|
|
|
7374
7374
|
console.log(`Failed to play ${I}:`, D);
|
|
7375
7375
|
try {
|
|
7376
7376
|
l.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
|
|
7377
|
-
} catch (
|
|
7378
|
-
console.warn("Fallback animation also failed:",
|
|
7377
|
+
} catch ($) {
|
|
7378
|
+
console.warn("Fallback animation also failed:", $);
|
|
7379
7379
|
}
|
|
7380
7380
|
}
|
|
7381
7381
|
else {
|
|
7382
7382
|
const D = [".fbx", ".glb", ".gltf"];
|
|
7383
|
-
let
|
|
7384
|
-
for (const
|
|
7383
|
+
let $ = !1;
|
|
7384
|
+
for (const ye of D)
|
|
7385
7385
|
try {
|
|
7386
|
-
l.current.playAnimation(I +
|
|
7386
|
+
l.current.playAnimation(I + ye, null, 10, 0, 0.01, G), console.log("Playing animation:", I + ye), $ = !0;
|
|
7387
7387
|
break;
|
|
7388
7388
|
} catch {
|
|
7389
|
-
console.log(`Failed to play ${I}${
|
|
7389
|
+
console.log(`Failed to play ${I}${ye}, trying next format...`);
|
|
7390
7390
|
}
|
|
7391
|
-
if (
|
|
7391
|
+
if (!$) {
|
|
7392
7392
|
console.warn("Animation system not available or animation not found:", I);
|
|
7393
7393
|
try {
|
|
7394
7394
|
l.current.setBodyMovement("idle"), console.log("Fallback to idle animation");
|
|
7395
|
-
} catch (
|
|
7396
|
-
console.warn("Fallback animation also failed:",
|
|
7395
|
+
} catch (ye) {
|
|
7396
|
+
console.warn("Fallback animation also failed:", ye);
|
|
7397
7397
|
}
|
|
7398
7398
|
}
|
|
7399
7399
|
}
|
|
7400
7400
|
} else
|
|
7401
7401
|
console.warn("Animation system not available or animation not found:", I);
|
|
7402
7402
|
}, []);
|
|
7403
|
-
return
|
|
7403
|
+
return Je(a, () => ({
|
|
7404
7404
|
speakText: y,
|
|
7405
7405
|
stopSpeaking: E,
|
|
7406
7406
|
setMood: S,
|
|
@@ -7465,7 +7465,7 @@ const Ut = Ke(({
|
|
|
7465
7465
|
console.warn("Error unlocking avatar position:", I);
|
|
7466
7466
|
}
|
|
7467
7467
|
}
|
|
7468
|
-
})), /* @__PURE__ */
|
|
7468
|
+
})), /* @__PURE__ */ Be("div", { className: `talking-head-container ${o}`, style: s, children: [
|
|
7469
7469
|
/* @__PURE__ */ le(
|
|
7470
7470
|
"div",
|
|
7471
7471
|
{
|
|
@@ -7501,7 +7501,7 @@ const Ut = Ke(({
|
|
|
7501
7501
|
}, children: h })
|
|
7502
7502
|
] });
|
|
7503
7503
|
});
|
|
7504
|
-
|
|
7504
|
+
Wt.displayName = "TalkingHeadComponent";
|
|
7505
7505
|
async function je(Y) {
|
|
7506
7506
|
try {
|
|
7507
7507
|
const n = await fetch(Y);
|
|
@@ -7519,7 +7519,7 @@ async function je(Y) {
|
|
|
7519
7519
|
return n instanceof SyntaxError || console.warn("⚠️ Could not load animation manifest (this is optional):", Y), {};
|
|
7520
7520
|
}
|
|
7521
7521
|
}
|
|
7522
|
-
async function
|
|
7522
|
+
async function Vt(Y, n = "F") {
|
|
7523
7523
|
const e = [], t = Y.replace(/\/$/, "");
|
|
7524
7524
|
try {
|
|
7525
7525
|
const i = [
|
|
@@ -7563,18 +7563,18 @@ async function Wt(Y, n = "F") {
|
|
|
7563
7563
|
}
|
|
7564
7564
|
return e.length > 0, e;
|
|
7565
7565
|
}
|
|
7566
|
-
async function
|
|
7566
|
+
async function ct(Y, n = "F") {
|
|
7567
7567
|
const e = {};
|
|
7568
7568
|
for (const [t, o] of Object.entries(Y))
|
|
7569
7569
|
try {
|
|
7570
|
-
const s = await
|
|
7570
|
+
const s = await Vt(o, n);
|
|
7571
7571
|
s.length > 0 && (e[t] = s);
|
|
7572
7572
|
} catch (s) {
|
|
7573
7573
|
console.error(`❌ Failed to auto-load animations from ${o}:`, s);
|
|
7574
7574
|
}
|
|
7575
7575
|
return e;
|
|
7576
7576
|
}
|
|
7577
|
-
const
|
|
7577
|
+
const Xt = $e(({
|
|
7578
7578
|
text: Y = null,
|
|
7579
7579
|
avatarUrl: n = "/avatars/brunette.glb",
|
|
7580
7580
|
avatarBody: e = "F",
|
|
@@ -7607,11 +7607,13 @@ const Vt = Ke(({
|
|
|
7607
7607
|
// e.g., "idle" - will select from this group in order when idle
|
|
7608
7608
|
autoSpeak: E = !1
|
|
7609
7609
|
}, S) => {
|
|
7610
|
-
const C = V(null), x = V(null), I = V(c), G = V(null), P = V(null), D = V(!1),
|
|
7611
|
-
|
|
7610
|
+
const C = V(null), x = V(null), I = V(c), G = V(null), P = V(null), D = V(!1), $ = V({ remainingText: null, originalText: null, options: null }), ye = V([]), [fe, Te] = pe(!0), [Ie, Me] = pe(null), [re, R] = pe(!1), [v, N] = pe(!1), [B, j] = pe(H), ie = V(null), X = V(!1), _ = V(null), Le = V(!1), xe = V([]), be = V([]), tt = V(0), w = V(null), K = V(null), ce = V(L), ae = V("");
|
|
7611
|
+
ke(() => {
|
|
7612
7612
|
D.current = v;
|
|
7613
|
-
}, [v])
|
|
7614
|
-
|
|
7613
|
+
}, [v]), ke(() => {
|
|
7614
|
+
ce.current = L;
|
|
7615
|
+
}, [L]);
|
|
7616
|
+
const Ae = W((k) => {
|
|
7615
7617
|
let z = "F";
|
|
7616
7618
|
if (k) {
|
|
7617
7619
|
const F = k.toString().toUpperCase().trim();
|
|
@@ -7619,7 +7621,7 @@ const Vt = Ke(({
|
|
|
7619
7621
|
}
|
|
7620
7622
|
return z === "M" ? "male" : "female";
|
|
7621
7623
|
}, []);
|
|
7622
|
-
|
|
7624
|
+
ke(() => {
|
|
7623
7625
|
(async () => {
|
|
7624
7626
|
if (H.manifest && H.auto)
|
|
7625
7627
|
try {
|
|
@@ -7640,38 +7642,38 @@ const Vt = Ke(({
|
|
|
7640
7642
|
} catch {
|
|
7641
7643
|
}
|
|
7642
7644
|
if (typeof H.auto == "string") {
|
|
7643
|
-
const F = H.auto,
|
|
7645
|
+
const F = H.auto, oe = {
|
|
7644
7646
|
talking: `${F}/talking`,
|
|
7645
7647
|
idle: `${F}/idle`
|
|
7646
|
-
}, Z =
|
|
7647
|
-
|
|
7648
|
-
const
|
|
7649
|
-
if (!Object.values(
|
|
7648
|
+
}, Z = Ae(e);
|
|
7649
|
+
oe[`${Z}_talking`] = `${F}/${Z}/talking`, oe[`${Z}_idle`] = `${F}/${Z}/idle`, oe.shared_talking = `${F}/shared/talking`, oe.shared_idle = `${F}/shared/idle`;
|
|
7650
|
+
const Se = await ct(oe, e);
|
|
7651
|
+
if (!Object.values(Se).some((q) => Array.isArray(q) && q.length > 0) && z) {
|
|
7650
7652
|
j(z);
|
|
7651
7653
|
return;
|
|
7652
7654
|
}
|
|
7653
|
-
const
|
|
7655
|
+
const te = {
|
|
7654
7656
|
_genderSpecific: {
|
|
7655
7657
|
[Z]: {},
|
|
7656
7658
|
shared: {}
|
|
7657
7659
|
}
|
|
7658
7660
|
};
|
|
7659
|
-
Object.entries(
|
|
7660
|
-
if (
|
|
7661
|
-
const [
|
|
7662
|
-
|
|
7661
|
+
Object.entries(Se).forEach(([q, ne]) => {
|
|
7662
|
+
if (q.includes("_")) {
|
|
7663
|
+
const [ee, ...ge] = q.split("_"), de = ge.join("_");
|
|
7664
|
+
ee === "shared" ? (te._genderSpecific.shared[de] || (te._genderSpecific.shared[de] = []), te._genderSpecific.shared[de].push(...ne)) : ee === Z && (te._genderSpecific[Z][de] || (te._genderSpecific[Z][de] = []), te._genderSpecific[Z][de].push(...ne));
|
|
7663
7665
|
} else
|
|
7664
|
-
|
|
7665
|
-
}), z && (z._genderSpecific && Object.keys(z._genderSpecific).forEach((
|
|
7666
|
-
|
|
7667
|
-
|
|
7666
|
+
te[q] = ne;
|
|
7667
|
+
}), z && (z._genderSpecific && Object.keys(z._genderSpecific).forEach((q) => {
|
|
7668
|
+
te._genderSpecific[q] || (te._genderSpecific[q] = {}), Object.entries(z._genderSpecific[q]).forEach(([ne, ee]) => {
|
|
7669
|
+
te._genderSpecific[q][ne] || (te._genderSpecific[q][ne] = ee);
|
|
7668
7670
|
});
|
|
7669
|
-
}), Object.entries(z).forEach(([
|
|
7670
|
-
|
|
7671
|
-
})), j(
|
|
7671
|
+
}), Object.entries(z).forEach(([q, ne]) => {
|
|
7672
|
+
q !== "_genderSpecific" && !te[q] && (te[q] = ne);
|
|
7673
|
+
})), j(te);
|
|
7672
7674
|
} else if (typeof H.auto == "object") {
|
|
7673
|
-
const F = await
|
|
7674
|
-
j(!
|
|
7675
|
+
const F = await ct(H.auto, e), oe = Object.values(F).some((Z) => Array.isArray(Z) && Z.length > 0);
|
|
7676
|
+
j(!oe && z ? z : F);
|
|
7675
7677
|
}
|
|
7676
7678
|
} catch (z) {
|
|
7677
7679
|
if (console.error("Failed to auto-discover animations:", z), H.manifest)
|
|
@@ -7687,52 +7689,52 @@ const Vt = Ke(({
|
|
|
7687
7689
|
else
|
|
7688
7690
|
j(H);
|
|
7689
7691
|
})();
|
|
7690
|
-
}, [H, e,
|
|
7692
|
+
}, [H, e, Ae]), ke(() => {
|
|
7691
7693
|
I.current = c;
|
|
7692
7694
|
}, [c]);
|
|
7693
|
-
const
|
|
7694
|
-
let
|
|
7695
|
-
|
|
7695
|
+
const J = et(), me = s || J.service;
|
|
7696
|
+
let Ce;
|
|
7697
|
+
me === "browser" ? Ce = {
|
|
7696
7698
|
service: "browser",
|
|
7697
7699
|
endpoint: "",
|
|
7698
7700
|
apiKey: null,
|
|
7699
7701
|
defaultVoice: "Google US English"
|
|
7700
|
-
} :
|
|
7702
|
+
} : me === "elevenlabs" ? Ce = {
|
|
7701
7703
|
service: "elevenlabs",
|
|
7702
7704
|
endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
|
|
7703
|
-
apiKey: a ||
|
|
7704
|
-
defaultVoice: i ||
|
|
7705
|
-
voices:
|
|
7706
|
-
} :
|
|
7705
|
+
apiKey: a || J.apiKey,
|
|
7706
|
+
defaultVoice: i || J.defaultVoice || Xe.defaultVoice,
|
|
7707
|
+
voices: J.voices || Xe.voices
|
|
7708
|
+
} : me === "deepgram" ? Ce = {
|
|
7707
7709
|
service: "deepgram",
|
|
7708
7710
|
endpoint: "https://api.deepgram.com/v1/speak",
|
|
7709
|
-
apiKey: a ||
|
|
7710
|
-
defaultVoice: i ||
|
|
7711
|
-
voices:
|
|
7712
|
-
} :
|
|
7713
|
-
...
|
|
7714
|
-
apiKey: a !== null ? a :
|
|
7711
|
+
apiKey: a || J.apiKey,
|
|
7712
|
+
defaultVoice: i || J.defaultVoice || Ke.defaultVoice,
|
|
7713
|
+
voices: J.voices || Ke.voices
|
|
7714
|
+
} : Ce = {
|
|
7715
|
+
...J,
|
|
7716
|
+
apiKey: a !== null ? a : J.apiKey
|
|
7715
7717
|
};
|
|
7716
|
-
const
|
|
7718
|
+
const Ne = {
|
|
7717
7719
|
url: n,
|
|
7718
7720
|
body: e,
|
|
7719
7721
|
avatarMood: t,
|
|
7720
|
-
ttsLang:
|
|
7721
|
-
ttsVoice: i ||
|
|
7722
|
+
ttsLang: me === "browser" ? "en-US" : o,
|
|
7723
|
+
ttsVoice: i || Ce.defaultVoice,
|
|
7722
7724
|
lipsyncLang: "en",
|
|
7723
7725
|
showFullAvatar: c,
|
|
7724
7726
|
bodyMovement: u,
|
|
7725
7727
|
movementIntensity: l
|
|
7726
|
-
},
|
|
7727
|
-
ttsEndpoint:
|
|
7728
|
-
ttsApikey:
|
|
7729
|
-
ttsService:
|
|
7728
|
+
}, Ee = {
|
|
7729
|
+
ttsEndpoint: Ce.endpoint,
|
|
7730
|
+
ttsApikey: Ce.apiKey,
|
|
7731
|
+
ttsService: me,
|
|
7730
7732
|
lipsyncModules: ["en"],
|
|
7731
7733
|
cameraView: r
|
|
7732
|
-
},
|
|
7734
|
+
}, ze = W(async () => {
|
|
7733
7735
|
if (!(!C.current || x.current))
|
|
7734
7736
|
try {
|
|
7735
|
-
Te(!0), Me(null), x.current = new
|
|
7737
|
+
Te(!0), Me(null), x.current = new ot(C.current, Ee), await x.current.showAvatar(Ne, (z) => {
|
|
7736
7738
|
if (z.lengthComputable) {
|
|
7737
7739
|
const F = Math.min(100, Math.round(z.loaded / z.total * 100));
|
|
7738
7740
|
d(F);
|
|
@@ -7748,10 +7750,10 @@ const Vt = Ke(({
|
|
|
7748
7750
|
console.error("Error initializing TalkingHead:", k), Me(k.message || "Failed to initialize avatar"), Te(!1), p(k);
|
|
7749
7751
|
}
|
|
7750
7752
|
}, []);
|
|
7751
|
-
|
|
7753
|
+
ke(() => (ze(), () => {
|
|
7752
7754
|
x.current && (x.current.stop(), x.current.dispose(), x.current = null);
|
|
7753
|
-
}), [
|
|
7754
|
-
const
|
|
7755
|
+
}), [ze]);
|
|
7756
|
+
const Pe = W(async () => {
|
|
7755
7757
|
if (x.current)
|
|
7756
7758
|
try {
|
|
7757
7759
|
const k = x.current.audioCtx || x.current.audioContext;
|
|
@@ -7759,13 +7761,13 @@ const Vt = Ke(({
|
|
|
7759
7761
|
} catch (k) {
|
|
7760
7762
|
console.warn("Failed to resume audio context:", k);
|
|
7761
7763
|
}
|
|
7762
|
-
}, []),
|
|
7764
|
+
}, []), nt = W((k) => {
|
|
7763
7765
|
if (!B)
|
|
7764
7766
|
return [];
|
|
7765
7767
|
let z = null;
|
|
7766
7768
|
if (B._genderSpecific) {
|
|
7767
|
-
const F =
|
|
7768
|
-
if (
|
|
7769
|
+
const F = Ae(e), oe = B._genderSpecific[F];
|
|
7770
|
+
if (oe && oe[k] && Array.isArray(oe[k]) && oe[k].length > 0 && (z = oe[k]), !z && B._genderSpecific.shared && B._genderSpecific.shared[k]) {
|
|
7769
7771
|
const Z = B._genderSpecific.shared[k];
|
|
7770
7772
|
Array.isArray(Z) && Z.length > 0 && (z = Z);
|
|
7771
7773
|
}
|
|
@@ -7774,251 +7776,257 @@ const Vt = Ke(({
|
|
|
7774
7776
|
const F = B[k];
|
|
7775
7777
|
Array.isArray(F) && F.length > 0 ? z = F : typeof F == "string" && (z = [F]);
|
|
7776
7778
|
}
|
|
7777
|
-
return !z || Array.isArray(z) && z.length === 0 ? ((Object.keys(B).length > 0 || B._genderSpecific && Object.keys(B._genderSpecific).length > 0) && console.warn(`⚠️ No animations found for group "${k}" (gender: ${
|
|
7778
|
-
}, [B, e,
|
|
7779
|
-
if (
|
|
7780
|
-
const F =
|
|
7779
|
+
return !z || Array.isArray(z) && z.length === 0 ? ((Object.keys(B).length > 0 || B._genderSpecific && Object.keys(B._genderSpecific).length > 0) && console.warn(`⚠️ No animations found for group "${k}" (gender: ${Ae(e)}). Make sure animations are configured correctly.`), []) : Array.isArray(z) ? [...z] : typeof z == "string" ? [z] : [];
|
|
7780
|
+
}, [B, e, Ae]), Ge = W((k) => {
|
|
7781
|
+
if (be.current.length === 0) {
|
|
7782
|
+
const F = nt(k);
|
|
7781
7783
|
if (F.length === 0)
|
|
7782
7784
|
return null;
|
|
7783
|
-
|
|
7785
|
+
be.current = [...F], xe.current = [];
|
|
7784
7786
|
}
|
|
7785
|
-
const z =
|
|
7786
|
-
return z &&
|
|
7787
|
-
}, [
|
|
7788
|
-
if (!x.current || !X.current ||
|
|
7787
|
+
const z = be.current.shift();
|
|
7788
|
+
return z && xe.current.push(z), z;
|
|
7789
|
+
}, [nt]), Qe = W((k) => k ? k.split("/").pop().replace(".fbx", "").replace(/[-_]/g, " ") : "Unknown", []), Fe = W((k, z = !1, F = null) => {
|
|
7790
|
+
if (!x.current || !X.current || _.current !== k)
|
|
7789
7791
|
return null;
|
|
7790
|
-
const
|
|
7791
|
-
if (
|
|
7792
|
+
const oe = Ge(k);
|
|
7793
|
+
if (oe)
|
|
7792
7794
|
try {
|
|
7793
|
-
const Z =
|
|
7795
|
+
const Z = Qe(oe);
|
|
7794
7796
|
console.log(`🎬 Playing animation: "${Z}"`);
|
|
7795
|
-
const
|
|
7797
|
+
const Se = () => {
|
|
7796
7798
|
console.log("🎬 Animation finished, checking if should continue...");
|
|
7797
7799
|
const O = () => {
|
|
7798
7800
|
if (!x.current)
|
|
7799
7801
|
return console.log("🎬 No talkingHeadRef, stopping animations"), !1;
|
|
7800
7802
|
if (!X.current)
|
|
7801
7803
|
return console.log("🎬 isSpeakingRef is false, stopping animations"), !1;
|
|
7802
|
-
if (
|
|
7803
|
-
return console.log(`🎬 Animation group mismatch (${
|
|
7804
|
-
const
|
|
7804
|
+
if (_.current !== k)
|
|
7805
|
+
return console.log(`🎬 Animation group mismatch (${_.current} !== ${k}), stopping animations`), !1;
|
|
7806
|
+
const q = x.current, ne = q.isAudioPlaying === !0, ee = q.audioPlaylist && q.audioPlaylist.length > 0, ge = q.speechQueue && q.speechQueue.length > 0, de = q.isSpeaking === !0, Ue = de || ne || ee || ge;
|
|
7805
7807
|
return console.log("🎬 Still speaking check:", {
|
|
7806
7808
|
isSpeakingRef: X.current,
|
|
7807
|
-
isTalkingHeadSpeaking:
|
|
7808
|
-
hasAudioPlaying:
|
|
7809
|
-
hasAudioInPlaylist:
|
|
7810
|
-
hasItemsInQueue:
|
|
7811
|
-
shouldContinue:
|
|
7812
|
-
}),
|
|
7809
|
+
isTalkingHeadSpeaking: de,
|
|
7810
|
+
hasAudioPlaying: ne,
|
|
7811
|
+
hasAudioInPlaylist: ee,
|
|
7812
|
+
hasItemsInQueue: ge,
|
|
7813
|
+
shouldContinue: Ue
|
|
7814
|
+
}), Ue;
|
|
7813
7815
|
};
|
|
7814
7816
|
O() ? (console.log("🎬 Still speaking, continuing to next animation..."), requestAnimationFrame(() => {
|
|
7815
|
-
O() ? (console.log("🎬 Playing next animation..."),
|
|
7816
|
-
})) : (console.log("🎬 Speech has ended, stopping animations"), X.current = !1,
|
|
7817
|
+
O() ? (console.log("🎬 Playing next animation..."), Fe(k, z, F)) : (console.log("🎬 Speech ended, stopping animations"), X.current = !1, _.current = null, x.current && x.current.stopAnimation(), F && F());
|
|
7818
|
+
})) : (console.log("🎬 Speech has ended, stopping animations"), X.current = !1, _.current = null, x.current && x.current.stopAnimation(), F && F());
|
|
7817
7819
|
};
|
|
7818
|
-
return x.current.playAnimation(
|
|
7820
|
+
return x.current.playAnimation(oe, null, 0, 0, 0.01, z, Se), oe;
|
|
7819
7821
|
} catch (Z) {
|
|
7820
7822
|
return console.error("Failed to play animation:", Z), null;
|
|
7821
7823
|
}
|
|
7822
7824
|
else {
|
|
7823
7825
|
const Z = () => {
|
|
7824
|
-
if (!x.current || !X.current ||
|
|
7826
|
+
if (!x.current || !X.current || _.current !== k)
|
|
7825
7827
|
return !1;
|
|
7826
|
-
const O = x.current,
|
|
7827
|
-
return O.isSpeaking === !0 ||
|
|
7828
|
+
const O = x.current, te = O.isAudioPlaying === !0, q = O.audioPlaylist && O.audioPlaylist.length > 0, ne = O.speechQueue && O.speechQueue.length > 0;
|
|
7829
|
+
return O.isSpeaking === !0 || te || q || ne;
|
|
7828
7830
|
};
|
|
7829
|
-
Z() && (
|
|
7831
|
+
Z() && (be.current = [], xe.current = [], Z() ? Fe(k, z, F) : (X.current = !1, _.current = null, x.current && x.current.stopAnimation()));
|
|
7830
7832
|
}
|
|
7831
7833
|
return null;
|
|
7832
|
-
}, [
|
|
7833
|
-
y && x.current && !X.current && (
|
|
7834
|
-
!X.current && !D.current && y && (
|
|
7834
|
+
}, [Ge, Qe]), dt = W(() => {
|
|
7835
|
+
y && x.current && !X.current && (ie.current && (clearInterval(ie.current), ie.current = null), be.current = [], xe.current = [], Fe(y, !1, null), ie.current = setInterval(() => {
|
|
7836
|
+
!X.current && !D.current && y && (be.current = [], xe.current = [], Fe(y, !1, null));
|
|
7835
7837
|
}, 12e3 + Math.random() * 3e3));
|
|
7836
|
-
}, [y,
|
|
7837
|
-
|
|
7838
|
+
}, [y, Fe]);
|
|
7839
|
+
K.current = dt;
|
|
7838
7840
|
const Ze = W(async (k, z = {}) => {
|
|
7839
|
-
if (!x.current || !
|
|
7841
|
+
if (!x.current || !re || !k || k.trim() === "")
|
|
7840
7842
|
return;
|
|
7841
|
-
await
|
|
7843
|
+
await Pe(), ie.current && (clearInterval(ie.current), ie.current = null);
|
|
7842
7844
|
const F = z.animationGroup || M;
|
|
7843
|
-
F && !z.skipAnimation && (X.current = !0,
|
|
7845
|
+
F && !z.skipAnimation && (X.current = !0, _.current = F, be.current = [], xe.current = [], Fe(F));
|
|
7844
7846
|
try {
|
|
7845
7847
|
b(k), z.onSpeechStart && z.onSpeechStart(k);
|
|
7846
7848
|
} catch (O) {
|
|
7847
7849
|
console.warn("Error in onSpeechStart callback:", O);
|
|
7848
7850
|
}
|
|
7849
|
-
|
|
7850
|
-
const
|
|
7851
|
-
|
|
7851
|
+
$.current = { remainingText: null, originalText: null, options: null }, ye.current = [], G.current = { text: k, options: z }, P.current && (clearInterval(P.current), P.current = null), N(!1), D.current = !1, Le.current = !1;
|
|
7852
|
+
const oe = k.split(/[.!?]+/).filter((O) => O.trim().length > 0);
|
|
7853
|
+
ye.current = oe, tt.current = 0, ae.current = "";
|
|
7852
7854
|
const Z = (O) => {
|
|
7853
|
-
let
|
|
7854
|
-
if (O && (O.text ?
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7855
|
+
let te = "";
|
|
7856
|
+
if (O && (O.text ? te = O.text : O.vs && O.vs.subtitles ? Array.isArray(O.vs.subtitles) ? te = O.vs.subtitles.join("") : typeof O.vs.subtitles == "string" && (te = O.vs.subtitles) : O.subtitles && (Array.isArray(O.subtitles) ? te = O.subtitles.join("") : typeof O.subtitles == "string" && (te = O.subtitles))), te.trim()) {
|
|
7857
|
+
ae.current += te;
|
|
7858
|
+
const q = ce.current;
|
|
7859
|
+
if (q && typeof q == "function")
|
|
7860
|
+
try {
|
|
7861
|
+
setTimeout(() => {
|
|
7862
|
+
q(ae.current.trim());
|
|
7863
|
+
}, 0);
|
|
7864
|
+
} catch (ne) {
|
|
7865
|
+
console.warn("Error in onSubtitle callback:", ne);
|
|
7866
|
+
}
|
|
7867
|
+
}
|
|
7868
|
+
}, Se = {
|
|
7861
7869
|
lipsyncLang: z.lipsyncLang || "en",
|
|
7862
7870
|
onSubtitles: L ? Z : null
|
|
7863
7871
|
};
|
|
7864
7872
|
if (x.current) {
|
|
7865
7873
|
const O = x.current;
|
|
7866
|
-
let
|
|
7867
|
-
const
|
|
7874
|
+
let te = 0;
|
|
7875
|
+
const q = 1200;
|
|
7868
7876
|
P.current && (clearInterval(P.current), P.current = null);
|
|
7869
|
-
const
|
|
7870
|
-
if (
|
|
7877
|
+
const ne = { current: !1 }, ee = setInterval(() => {
|
|
7878
|
+
if (te++, D.current)
|
|
7871
7879
|
return;
|
|
7872
|
-
if (
|
|
7873
|
-
if (
|
|
7874
|
-
|
|
7880
|
+
if (te > q) {
|
|
7881
|
+
if (ee && (clearInterval(ee), P.current = null), !ne.current && !D.current) {
|
|
7882
|
+
ne.current = !0, X.current = !1, _.current = null, be.current = [], xe.current = [], x.current && (x.current.stopAnimation(), x.current.isSpeaking = !1);
|
|
7875
7883
|
try {
|
|
7876
7884
|
z.onSpeechEnd && z.onSpeechEnd(), f();
|
|
7877
|
-
} catch (
|
|
7878
|
-
console.error("Error in onSpeechEnd callback (timeout):",
|
|
7885
|
+
} catch (ue) {
|
|
7886
|
+
console.error("Error in onSpeechEnd callback (timeout):", ue);
|
|
7879
7887
|
}
|
|
7880
7888
|
}
|
|
7881
7889
|
return;
|
|
7882
7890
|
}
|
|
7883
|
-
const
|
|
7884
|
-
O && !D.current &&
|
|
7885
|
-
const
|
|
7886
|
-
if (!
|
|
7891
|
+
const ge = !O.speechQueue || O.speechQueue.length === 0, de = !O.audioPlaylist || O.audioPlaylist.length === 0, Ue = O.isAudioPlaying === !1;
|
|
7892
|
+
O && !D.current && ge && de && Ue && O.isSpeaking === !1 && !ne.current && !D.current && setTimeout(() => {
|
|
7893
|
+
const ue = x.current;
|
|
7894
|
+
if (!ue)
|
|
7887
7895
|
return;
|
|
7888
|
-
!D.current && (!
|
|
7889
|
-
|
|
7896
|
+
!D.current && (!ue.speechQueue || ue.speechQueue.length === 0) && (!ue.audioPlaylist || ue.audioPlaylist.length === 0) && ue.isAudioPlaying === !1 && ue.isSpeaking === !1 && !ne.current && !D.current && (ne.current = !0, ee && (clearInterval(ee), P.current = null), X.current = !1, _.current = null, be.current = [], xe.current = [], ae.current = "", ue && (ue.stopAnimation(), ue.isSpeaking = !1), Le.current = !0, setTimeout(() => {
|
|
7897
|
+
K.current && K.current();
|
|
7890
7898
|
}, 500), setTimeout(() => {
|
|
7891
7899
|
try {
|
|
7892
7900
|
z.onSpeechEnd && z.onSpeechEnd(), f(), setTimeout(() => {
|
|
7893
|
-
|
|
7901
|
+
Le.current = !1;
|
|
7894
7902
|
}, 500);
|
|
7895
|
-
} catch (
|
|
7896
|
-
console.error("Error in onSpeechEnd callback:",
|
|
7903
|
+
} catch (it) {
|
|
7904
|
+
console.error("Error in onSpeechEnd callback:", it), Le.current = !1;
|
|
7897
7905
|
}
|
|
7898
7906
|
}, 100));
|
|
7899
7907
|
}, 200);
|
|
7900
7908
|
}, 50);
|
|
7901
|
-
P.current =
|
|
7909
|
+
P.current = ee;
|
|
7902
7910
|
}
|
|
7903
7911
|
try {
|
|
7904
|
-
x.current.speakText(k,
|
|
7912
|
+
x.current.speakText(k, Se);
|
|
7905
7913
|
} catch (O) {
|
|
7906
7914
|
console.error("Error speaking text:", O), Me(O.message || "Failed to speak text");
|
|
7907
7915
|
}
|
|
7908
|
-
}, [
|
|
7909
|
-
|
|
7910
|
-
if (!
|
|
7916
|
+
}, [re, f, Pe, M, Fe]);
|
|
7917
|
+
ke(() => {
|
|
7918
|
+
if (!re || !y || !x.current)
|
|
7911
7919
|
return;
|
|
7912
|
-
|
|
7920
|
+
ie.current && (clearInterval(ie.current), ie.current = null);
|
|
7913
7921
|
const k = () => {
|
|
7914
|
-
x.current && !D.current && !X.current && (
|
|
7922
|
+
x.current && !D.current && !X.current && (be.current = [], xe.current = [], Fe(y, !1, null));
|
|
7915
7923
|
};
|
|
7916
|
-
return X.current || k(),
|
|
7924
|
+
return X.current || k(), ie.current = setInterval(() => {
|
|
7917
7925
|
X.current || k();
|
|
7918
7926
|
}, 12e3 + Math.random() * 3e3), () => {
|
|
7919
|
-
|
|
7927
|
+
ie.current && (clearInterval(ie.current), ie.current = null);
|
|
7920
7928
|
};
|
|
7921
|
-
}, [
|
|
7922
|
-
|
|
7923
|
-
}, [
|
|
7924
|
-
const
|
|
7929
|
+
}, [re, y, Fe, X]), ke(() => {
|
|
7930
|
+
re && Y && E && x.current && !X.current && !D.current && !Le.current && Ze(Y);
|
|
7931
|
+
}, [re, Y, E, Ze]);
|
|
7932
|
+
const mt = W(() => {
|
|
7925
7933
|
if (x.current)
|
|
7926
7934
|
try {
|
|
7927
7935
|
const k = x.current.isSpeaking || !1, z = [...x.current.audioPlaylist || []], F = [...x.current.speechQueue || []];
|
|
7928
7936
|
if (k || z.length > 0 || F.length > 0) {
|
|
7929
7937
|
P.current && (clearInterval(P.current), P.current = null);
|
|
7930
|
-
const
|
|
7938
|
+
const oe = ye.current;
|
|
7931
7939
|
let Z = [];
|
|
7932
|
-
const
|
|
7933
|
-
if (
|
|
7934
|
-
const
|
|
7935
|
-
|
|
7940
|
+
const Se = x.current.isAudioPlaying || !1;
|
|
7941
|
+
if (oe.length > 0) {
|
|
7942
|
+
const ee = z.length + F.length, ge = Se ? 1 : 0, de = oe.length - ee - ge, Ue = Se ? de : de + ge;
|
|
7943
|
+
Ue < oe.length && (Z = oe.slice(Ue));
|
|
7936
7944
|
} else
|
|
7937
|
-
z.length > 0 && z.forEach((
|
|
7938
|
-
if (
|
|
7939
|
-
if (Array.isArray(
|
|
7940
|
-
const
|
|
7941
|
-
|
|
7942
|
-
} else
|
|
7943
|
-
}), F.length > 0 && F.forEach((
|
|
7944
|
-
if (
|
|
7945
|
-
if (Array.isArray(
|
|
7946
|
-
const
|
|
7947
|
-
|
|
7948
|
-
} else
|
|
7945
|
+
z.length > 0 && z.forEach((ee) => {
|
|
7946
|
+
if (ee.text)
|
|
7947
|
+
if (Array.isArray(ee.text)) {
|
|
7948
|
+
const ge = ee.text.map((de) => de.word).join(" ");
|
|
7949
|
+
ge.trim() && Z.push(ge);
|
|
7950
|
+
} else ee.text.trim() && Z.push(ee.text);
|
|
7951
|
+
}), F.length > 0 && F.forEach((ee) => {
|
|
7952
|
+
if (ee.text)
|
|
7953
|
+
if (Array.isArray(ee.text)) {
|
|
7954
|
+
const ge = ee.text.map((de) => de.word).join(" ");
|
|
7955
|
+
ge.trim() && Z.push(ge);
|
|
7956
|
+
} else ee.text.trim() && Z.push(ee.text);
|
|
7949
7957
|
});
|
|
7950
7958
|
const O = Z.join(" ");
|
|
7951
|
-
|
|
7959
|
+
$.current = {
|
|
7952
7960
|
remainingText: O || null,
|
|
7953
7961
|
originalText: G.current?.text || null,
|
|
7954
7962
|
options: G.current?.options || null,
|
|
7955
7963
|
// Track if we're pausing mid-sentence (has currently playing audio)
|
|
7956
7964
|
isMidSentence: z.length > 0
|
|
7957
7965
|
};
|
|
7958
|
-
const
|
|
7966
|
+
const q = x.current.isAudioPlaying || !1 ? [...x.current.speechQueue || []] : null;
|
|
7959
7967
|
x.current.speechQueue.length = 0;
|
|
7960
|
-
const
|
|
7961
|
-
x.current.isSpeaking = !1, X.current = !1,
|
|
7968
|
+
const ne = x.current.pauseSpeaking();
|
|
7969
|
+
x.current.isSpeaking = !1, X.current = !1, _.current = null, ne && ne.audio && q ? (w.current = ne, w.current.savedSpeechQueue = q) : w.current = ne, N(!0), D.current = !0;
|
|
7962
7970
|
}
|
|
7963
7971
|
} catch (k) {
|
|
7964
7972
|
console.warn("Error pausing speech:", k);
|
|
7965
7973
|
}
|
|
7966
|
-
}, []),
|
|
7974
|
+
}, []), pt = W(async () => {
|
|
7967
7975
|
if (!(!x.current || !v))
|
|
7968
7976
|
try {
|
|
7969
|
-
if (await
|
|
7977
|
+
if (await Pe(), N(!1), D.current = !1, w.current && w.current.audio) {
|
|
7970
7978
|
X.current = !0;
|
|
7971
|
-
const Z =
|
|
7972
|
-
if (
|
|
7979
|
+
const Z = $.current?.options || G.current?.options || {}, Se = Z.animationGroup || M;
|
|
7980
|
+
if (Se && (_.current = Se), w.current.savedSpeechQueue && (x.current.speechQueue.length = 0, x.current.speechQueue.push(...w.current.savedSpeechQueue)), x.current.isSpeaking = !0, x.current) {
|
|
7973
7981
|
const O = x.current;
|
|
7974
|
-
let
|
|
7975
|
-
const
|
|
7982
|
+
let te = 0;
|
|
7983
|
+
const q = 1200, ne = { current: !1 };
|
|
7976
7984
|
P.current && (clearInterval(P.current), P.current = null);
|
|
7977
|
-
const
|
|
7978
|
-
if (
|
|
7985
|
+
const ee = setInterval(() => {
|
|
7986
|
+
if (te++, D.current)
|
|
7979
7987
|
return;
|
|
7980
|
-
if (
|
|
7981
|
-
if (
|
|
7982
|
-
|
|
7988
|
+
if (te > q) {
|
|
7989
|
+
if (ee && (clearInterval(ee), P.current = null), !ne.current && !D.current) {
|
|
7990
|
+
ne.current = !0, X.current = !1, _.current = null, be.current = [], xe.current = [], x.current && (x.current.stopAnimation(), x.current.isSpeaking = !1);
|
|
7983
7991
|
try {
|
|
7984
7992
|
Z.onSpeechEnd && Z.onSpeechEnd(), f();
|
|
7985
|
-
} catch (
|
|
7986
|
-
console.error("Error in onSpeechEnd callback (timeout):",
|
|
7993
|
+
} catch (ue) {
|
|
7994
|
+
console.error("Error in onSpeechEnd callback (timeout):", ue);
|
|
7987
7995
|
}
|
|
7988
7996
|
}
|
|
7989
7997
|
return;
|
|
7990
7998
|
}
|
|
7991
|
-
const
|
|
7992
|
-
O && !D.current &&
|
|
7993
|
-
const
|
|
7994
|
-
if (!
|
|
7995
|
-
!D.current && (!
|
|
7996
|
-
|
|
7999
|
+
const ge = !O.speechQueue || O.speechQueue.length === 0, de = !O.audioPlaylist || O.audioPlaylist.length === 0, Ue = O.isAudioPlaying === !1;
|
|
8000
|
+
O && !D.current && ge && de && Ue && O.isSpeaking === !1 && !ne.current && !D.current && setTimeout(() => {
|
|
8001
|
+
const ue = x.current;
|
|
8002
|
+
if (!ue) return;
|
|
8003
|
+
!D.current && (!ue.speechQueue || ue.speechQueue.length === 0) && (!ue.audioPlaylist || ue.audioPlaylist.length === 0) && ue.isAudioPlaying === !1 && ue.isSpeaking === !1 && !ne.current && !D.current && (ne.current = !0, ee && (clearInterval(ee), P.current = null), X.current = !1, _.current = null, be.current = [], xe.current = [], ae.current = "", ue && (ue.stopAnimation(), ue.isSpeaking = !1), Le.current = !0, setTimeout(() => {
|
|
8004
|
+
K.current && K.current();
|
|
7997
8005
|
}, 500), setTimeout(() => {
|
|
7998
8006
|
try {
|
|
7999
8007
|
Z.onSpeechEnd && Z.onSpeechEnd(), f(), setTimeout(() => {
|
|
8000
|
-
|
|
8008
|
+
Le.current = !1;
|
|
8001
8009
|
}, 500);
|
|
8002
|
-
} catch (
|
|
8003
|
-
console.error("Error in onSpeechEnd callback:",
|
|
8010
|
+
} catch (it) {
|
|
8011
|
+
console.error("Error in onSpeechEnd callback:", it), Le.current = !1;
|
|
8004
8012
|
}
|
|
8005
8013
|
}, 100));
|
|
8006
8014
|
}, 200);
|
|
8007
8015
|
}, 50);
|
|
8008
|
-
P.current =
|
|
8016
|
+
P.current = ee;
|
|
8009
8017
|
}
|
|
8010
|
-
await x.current.playAudio(!1, w.current),
|
|
8018
|
+
await x.current.playAudio(!1, w.current), Se && !Z.skipAnimation && (be.current = [], xe.current = [], Fe(Se)), w.current = null;
|
|
8011
8019
|
return;
|
|
8012
8020
|
}
|
|
8013
|
-
const k =
|
|
8014
|
-
|
|
8021
|
+
const k = $.current?.remainingText, z = $.current?.originalText || G.current?.text, F = $.current?.options || G.current?.options || {}, oe = k || z;
|
|
8022
|
+
oe && Ze(oe, F), w.current = null;
|
|
8015
8023
|
} catch (k) {
|
|
8016
8024
|
console.warn("Error resuming speech:", k), N(!1), D.current = !1, w.current = null;
|
|
8017
8025
|
}
|
|
8018
|
-
}, [v, Ze,
|
|
8026
|
+
}, [v, Ze, Pe, M, Fe]), gt = W(() => {
|
|
8019
8027
|
if (x.current) {
|
|
8020
|
-
x.current.stopAnimation(), x.current.stopSpeaking(), P.current && (clearInterval(P.current), P.current = null), X.current = !1,
|
|
8021
|
-
|
|
8028
|
+
x.current.stopAnimation(), x.current.stopSpeaking(), P.current && (clearInterval(P.current), P.current = null), X.current = !1, _.current = null, be.current = [], xe.current = [], ae.current = "", N(!1), D.current = !1, w.current = null, Le.current = !1, setTimeout(() => {
|
|
8029
|
+
K.current && K.current();
|
|
8022
8030
|
}, 500);
|
|
8023
8031
|
try {
|
|
8024
8032
|
f();
|
|
@@ -8027,14 +8035,14 @@ const Vt = Ke(({
|
|
|
8027
8035
|
}
|
|
8028
8036
|
}
|
|
8029
8037
|
}, [f]);
|
|
8030
|
-
return
|
|
8038
|
+
return Je(S, () => ({
|
|
8031
8039
|
speakText: Ze,
|
|
8032
|
-
pauseSpeaking:
|
|
8033
|
-
resumeSpeaking:
|
|
8034
|
-
stopSpeaking:
|
|
8035
|
-
resumeAudioContext:
|
|
8040
|
+
pauseSpeaking: mt,
|
|
8041
|
+
resumeSpeaking: pt,
|
|
8042
|
+
stopSpeaking: gt,
|
|
8043
|
+
resumeAudioContext: Pe,
|
|
8036
8044
|
isPaused: () => v,
|
|
8037
|
-
getCurrentSubtitle: () =>
|
|
8045
|
+
getCurrentSubtitle: () => ae.current,
|
|
8038
8046
|
// Get current subtitle text
|
|
8039
8047
|
setMood: (k) => x.current?.setMood(k),
|
|
8040
8048
|
setBodyMovement: (k) => {
|
|
@@ -8043,16 +8051,16 @@ const Vt = Ke(({
|
|
|
8043
8051
|
playAnimation: (k, z = !1) => {
|
|
8044
8052
|
x.current && x.current.playAnimation && x.current.playAnimation(k, null, 10, 0, 0.01, z);
|
|
8045
8053
|
},
|
|
8046
|
-
playRandomAnimation: (k, z = !1) =>
|
|
8054
|
+
playRandomAnimation: (k, z = !1) => Fe(k, z),
|
|
8047
8055
|
getRandomAnimation: (k) => getRandomAnimation(k),
|
|
8048
8056
|
playReaction: (k) => x.current?.playReaction(k),
|
|
8049
8057
|
playCelebration: () => x.current?.playCelebration(),
|
|
8050
8058
|
setShowFullAvatar: (k) => {
|
|
8051
8059
|
x.current && (I.current = k, x.current.setShowFullAvatar(k));
|
|
8052
8060
|
},
|
|
8053
|
-
isReady:
|
|
8061
|
+
isReady: re,
|
|
8054
8062
|
talkingHead: x.current
|
|
8055
|
-
})), /* @__PURE__ */
|
|
8063
|
+
})), /* @__PURE__ */ Be("div", { className: `simple-talking-avatar-container ${Q}`, style: g, children: [
|
|
8056
8064
|
/* @__PURE__ */ le(
|
|
8057
8065
|
"div",
|
|
8058
8066
|
{
|
|
@@ -8065,7 +8073,7 @@ const Vt = Ke(({
|
|
|
8065
8073
|
}
|
|
8066
8074
|
}
|
|
8067
8075
|
),
|
|
8068
|
-
|
|
8076
|
+
fe && /* @__PURE__ */ le("div", { className: "loading-overlay", style: {
|
|
8069
8077
|
position: "absolute",
|
|
8070
8078
|
top: "50%",
|
|
8071
8079
|
left: "50%",
|
|
@@ -8074,7 +8082,7 @@ const Vt = Ke(({
|
|
|
8074
8082
|
fontSize: "18px",
|
|
8075
8083
|
zIndex: 10
|
|
8076
8084
|
}, children: "Loading avatar..." }),
|
|
8077
|
-
|
|
8085
|
+
Ie && /* @__PURE__ */ le("div", { className: "error-overlay", style: {
|
|
8078
8086
|
position: "absolute",
|
|
8079
8087
|
top: "50%",
|
|
8080
8088
|
left: "50%",
|
|
@@ -8085,11 +8093,11 @@ const Vt = Ke(({
|
|
|
8085
8093
|
zIndex: 10,
|
|
8086
8094
|
padding: "20px",
|
|
8087
8095
|
borderRadius: "8px"
|
|
8088
|
-
}, children:
|
|
8096
|
+
}, children: Ie })
|
|
8089
8097
|
] });
|
|
8090
8098
|
});
|
|
8091
|
-
|
|
8092
|
-
const
|
|
8099
|
+
Xt.displayName = "SimpleTalkingAvatar";
|
|
8100
|
+
const Gt = $e(({
|
|
8093
8101
|
curriculumData: Y = null,
|
|
8094
8102
|
avatarConfig: n = {},
|
|
8095
8103
|
animations: e = {},
|
|
@@ -8140,7 +8148,7 @@ const Xt = Ke(({
|
|
|
8140
8148
|
animations: e,
|
|
8141
8149
|
lipsyncLang: "en"
|
|
8142
8150
|
});
|
|
8143
|
-
|
|
8151
|
+
ke(() => {
|
|
8144
8152
|
h.current = {
|
|
8145
8153
|
onLessonStart: t,
|
|
8146
8154
|
onLessonComplete: o,
|
|
@@ -8148,7 +8156,7 @@ const Xt = Ke(({
|
|
|
8148
8156
|
onCurriculumComplete: i,
|
|
8149
8157
|
onCustomAction: a
|
|
8150
8158
|
};
|
|
8151
|
-
}, [t, o, s, i, a]),
|
|
8159
|
+
}, [t, o, s, i, a]), ke(() => {
|
|
8152
8160
|
H.current = Y?.curriculum || {
|
|
8153
8161
|
title: "Default Curriculum",
|
|
8154
8162
|
description: "No curriculum data provided",
|
|
@@ -8193,9 +8201,9 @@ const Xt = Ke(({
|
|
|
8193
8201
|
} catch {
|
|
8194
8202
|
c.current.playCelebration();
|
|
8195
8203
|
}
|
|
8196
|
-
const N = H.current || { modules: [] }, B = N.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1,
|
|
8204
|
+
const N = H.current || { modules: [] }, B = N.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, ie = r.current.currentModuleIndex < (N.modules?.length || 0) - 1, X = j || ie, _ = M.current || { lipsyncLang: "en" };
|
|
8197
8205
|
c.current.speakText(v, {
|
|
8198
|
-
lipsyncLang:
|
|
8206
|
+
lipsyncLang: _.lipsyncLang,
|
|
8199
8207
|
onSpeechEnd: () => {
|
|
8200
8208
|
h.current.onCustomAction({
|
|
8201
8209
|
type: "lessonCompleteFeedbackDone",
|
|
@@ -8281,28 +8289,28 @@ const Xt = Ke(({
|
|
|
8281
8289
|
if (c.current.setMood("happy"), c.current.setBodyMovement("idle"), e.nextQuestion)
|
|
8282
8290
|
try {
|
|
8283
8291
|
c.current.playAnimation(e.nextQuestion, !0);
|
|
8284
|
-
} catch (
|
|
8285
|
-
console.warn("Failed to play nextQuestion animation:",
|
|
8292
|
+
} catch (_) {
|
|
8293
|
+
console.warn("Failed to play nextQuestion animation:", _);
|
|
8286
8294
|
}
|
|
8287
|
-
const B = M.current || { lipsyncLang: "en" },
|
|
8295
|
+
const B = M.current || { lipsyncLang: "en" }, ie = y()?.questions?.length || 0, X = r.current.currentQuestionIndex >= ie - 1;
|
|
8288
8296
|
if (v.type === "code_test") {
|
|
8289
|
-
const
|
|
8290
|
-
c.current.speakText(
|
|
8297
|
+
const _ = X ? `Great! Here's your final coding challenge: ${v.question}` : `Great! Now let's move on to your next coding challenge: ${v.question}`;
|
|
8298
|
+
c.current.speakText(_, {
|
|
8291
8299
|
lipsyncLang: B.lipsyncLang
|
|
8292
8300
|
});
|
|
8293
8301
|
} else if (v.type === "multiple_choice") {
|
|
8294
|
-
const
|
|
8295
|
-
c.current.speakText(
|
|
8302
|
+
const _ = X ? `Alright! Here's your final question: ${v.question}` : `Alright! Here's your next question: ${v.question}`;
|
|
8303
|
+
c.current.speakText(_, {
|
|
8296
8304
|
lipsyncLang: B.lipsyncLang
|
|
8297
8305
|
});
|
|
8298
8306
|
} else if (v.type === "true_false") {
|
|
8299
|
-
const
|
|
8300
|
-
c.current.speakText(
|
|
8307
|
+
const _ = X ? `Now let's try this final one: ${v.question}` : `Now let's try this one: ${v.question}`;
|
|
8308
|
+
c.current.speakText(_, {
|
|
8301
8309
|
lipsyncLang: B.lipsyncLang
|
|
8302
8310
|
});
|
|
8303
8311
|
} else {
|
|
8304
|
-
const
|
|
8305
|
-
c.current.speakText(
|
|
8312
|
+
const _ = X ? `Here's your final question: ${v.question}` : `Here's the next question: ${v.question}`;
|
|
8313
|
+
c.current.speakText(_, {
|
|
8306
8314
|
lipsyncLang: B.lipsyncLang
|
|
8307
8315
|
});
|
|
8308
8316
|
}
|
|
@@ -8329,7 +8337,7 @@ const Xt = Ke(({
|
|
|
8329
8337
|
const R = H.current || { modules: [] }, v = R.modules[r.current.currentModuleIndex];
|
|
8330
8338
|
if (r.current.currentLessonIndex < (v?.lessons?.length || 0) - 1) {
|
|
8331
8339
|
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;
|
|
8332
|
-
const B = R.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1,
|
|
8340
|
+
const B = R.modules[r.current.currentModuleIndex], j = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, ie = r.current.currentModuleIndex < (R.modules?.length || 0) - 1, X = j || ie;
|
|
8333
8341
|
h.current.onCustomAction({
|
|
8334
8342
|
type: "lessonStart",
|
|
8335
8343
|
moduleIndex: r.current.currentModuleIndex,
|
|
@@ -8342,12 +8350,12 @@ const Xt = Ke(({
|
|
|
8342
8350
|
}), c.current && (c.current.setMood("happy"), c.current.setBodyMovement("idle"));
|
|
8343
8351
|
} else if (r.current.currentModuleIndex < (R.modules?.length || 0) - 1) {
|
|
8344
8352
|
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;
|
|
8345
|
-
const j = R.modules[r.current.currentModuleIndex],
|
|
8353
|
+
const j = R.modules[r.current.currentModuleIndex], ie = r.current.currentLessonIndex < (j?.lessons?.length || 0) - 1, X = r.current.currentModuleIndex < (R.modules?.length || 0) - 1, _ = ie || X;
|
|
8346
8354
|
h.current.onCustomAction({
|
|
8347
8355
|
type: "lessonStart",
|
|
8348
8356
|
moduleIndex: r.current.currentModuleIndex,
|
|
8349
8357
|
lessonIndex: r.current.currentLessonIndex,
|
|
8350
|
-
hasNextLesson:
|
|
8358
|
+
hasNextLesson: _
|
|
8351
8359
|
}), h.current.onLessonStart({
|
|
8352
8360
|
moduleIndex: r.current.currentModuleIndex,
|
|
8353
8361
|
lessonIndex: r.current.currentLessonIndex,
|
|
@@ -8402,7 +8410,7 @@ const Xt = Ke(({
|
|
|
8402
8410
|
}
|
|
8403
8411
|
});
|
|
8404
8412
|
}
|
|
8405
|
-
}, [e.teaching, y]),
|
|
8413
|
+
}, [e.teaching, y]), $ = W((R) => {
|
|
8406
8414
|
const v = E(), N = S(R, v);
|
|
8407
8415
|
if (N && (r.current.score += 1), h.current.onQuestionAnswer({
|
|
8408
8416
|
moduleIndex: r.current.currentModuleIndex,
|
|
@@ -8422,11 +8430,11 @@ const Xt = Ke(({
|
|
|
8422
8430
|
c.current.setBodyMovement("gesturing");
|
|
8423
8431
|
const j = y()?.questions?.length || 0;
|
|
8424
8432
|
r.current.currentQuestionIndex >= j - 1;
|
|
8425
|
-
const
|
|
8426
|
-
console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", j, "hasNextQuestion:",
|
|
8427
|
-
const X = v.type === "code_test" ? `Great job! Your code passed all the tests! ${v.explanation || ""}` : `Excellent! That's correct! ${v.explanation || ""}`,
|
|
8433
|
+
const ie = r.current.currentQuestionIndex < j - 1;
|
|
8434
|
+
console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", j, "hasNextQuestion:", ie);
|
|
8435
|
+
const X = v.type === "code_test" ? `Great job! Your code passed all the tests! ${v.explanation || ""}` : `Excellent! That's correct! ${v.explanation || ""}`, _ = M.current || { lipsyncLang: "en" };
|
|
8428
8436
|
c.current.speakText(X, {
|
|
8429
|
-
lipsyncLang:
|
|
8437
|
+
lipsyncLang: _.lipsyncLang,
|
|
8430
8438
|
onSpeechEnd: () => {
|
|
8431
8439
|
h.current.onCustomAction({
|
|
8432
8440
|
type: "answerFeedbackComplete",
|
|
@@ -8434,7 +8442,7 @@ const Xt = Ke(({
|
|
|
8434
8442
|
lessonIndex: r.current.currentLessonIndex,
|
|
8435
8443
|
questionIndex: r.current.currentQuestionIndex,
|
|
8436
8444
|
isCorrect: !0,
|
|
8437
|
-
hasNextQuestion:
|
|
8445
|
+
hasNextQuestion: ie,
|
|
8438
8446
|
score: r.current.score,
|
|
8439
8447
|
totalQuestions: r.current.totalQuestions
|
|
8440
8448
|
});
|
|
@@ -8448,11 +8456,11 @@ const Xt = Ke(({
|
|
|
8448
8456
|
c.current.setBodyMovement("idle");
|
|
8449
8457
|
}
|
|
8450
8458
|
c.current.setBodyMovement("gesturing");
|
|
8451
|
-
const j = y()?.questions?.length || 0,
|
|
8459
|
+
const j = y()?.questions?.length || 0, ie = r.current.currentQuestionIndex >= j - 1, X = r.current.currentQuestionIndex < j - 1;
|
|
8452
8460
|
console.log("[CurriculumLearning] Answer feedback (incorrect) - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", j, "hasNextQuestion:", X);
|
|
8453
|
-
const
|
|
8454
|
-
c.current.speakText(
|
|
8455
|
-
lipsyncLang:
|
|
8461
|
+
const _ = v.type === "code_test" ? `Your code didn't pass all the tests. ${v.explanation || "Try again!"}` : `Not quite right, but don't worry! ${v.explanation || ""}${ie ? "" : " Let's move on to the next question."}`, Le = M.current || { lipsyncLang: "en" };
|
|
8462
|
+
c.current.speakText(_, {
|
|
8463
|
+
lipsyncLang: Le.lipsyncLang,
|
|
8456
8464
|
onSpeechEnd: () => {
|
|
8457
8465
|
h.current.onCustomAction({
|
|
8458
8466
|
type: "answerFeedbackComplete",
|
|
@@ -8481,7 +8489,7 @@ const Xt = Ke(({
|
|
|
8481
8489
|
avatarNotReady: !0
|
|
8482
8490
|
});
|
|
8483
8491
|
}
|
|
8484
|
-
}, [e.correct, e.incorrect, E, y, S]),
|
|
8492
|
+
}, [e.correct, e.incorrect, E, y, S]), ye = W((R) => {
|
|
8485
8493
|
const v = E();
|
|
8486
8494
|
if (!R || typeof R != "object") {
|
|
8487
8495
|
console.error("Invalid code test result format. Expected object with {passed: boolean, ...}");
|
|
@@ -8509,7 +8517,7 @@ const Xt = Ke(({
|
|
|
8509
8517
|
testResult: N,
|
|
8510
8518
|
question: v
|
|
8511
8519
|
}), g.current && g.current(N);
|
|
8512
|
-
}, [E, S]),
|
|
8520
|
+
}, [E, S]), fe = W(() => {
|
|
8513
8521
|
if (r.current.currentQuestionIndex > 0) {
|
|
8514
8522
|
r.current.currentQuestionIndex -= 1;
|
|
8515
8523
|
const R = E();
|
|
@@ -8567,7 +8575,7 @@ const Xt = Ke(({
|
|
|
8567
8575
|
lesson: y()
|
|
8568
8576
|
}), c.current && (c.current.setMood("happy"), c.current.setBodyMovement("idle"));
|
|
8569
8577
|
}
|
|
8570
|
-
}, [y]),
|
|
8578
|
+
}, [y]), Ie = W(() => {
|
|
8571
8579
|
r.current.currentModuleIndex = 0, r.current.currentLessonIndex = 0, r.current.currentQuestionIndex = 0, r.current.isTeaching = !1, r.current.isQuestionMode = !1, r.current.lessonCompleted = !1, r.current.curriculumCompleted = !1, r.current.score = 0, r.current.totalQuestions = 0;
|
|
8572
8580
|
}, []), Me = W((R) => {
|
|
8573
8581
|
console.log("Avatar is ready!", R);
|
|
@@ -8576,21 +8584,21 @@ const Xt = Ke(({
|
|
|
8576
8584
|
d.current && d.current();
|
|
8577
8585
|
}, 10);
|
|
8578
8586
|
}, [u, y]);
|
|
8579
|
-
|
|
8580
|
-
d.current = D, p.current = P, b.current = C, f.current = G, L.current = x, Q.current = I, g.current =
|
|
8581
|
-
}),
|
|
8587
|
+
xt(() => {
|
|
8588
|
+
d.current = D, p.current = P, b.current = C, f.current = G, L.current = x, Q.current = I, g.current = $;
|
|
8589
|
+
}), Je(l, () => ({
|
|
8582
8590
|
// Curriculum control methods
|
|
8583
8591
|
startTeaching: D,
|
|
8584
8592
|
startQuestions: I,
|
|
8585
|
-
handleAnswerSelect:
|
|
8586
|
-
handleCodeTestResult:
|
|
8593
|
+
handleAnswerSelect: $,
|
|
8594
|
+
handleCodeTestResult: ye,
|
|
8587
8595
|
nextQuestion: G,
|
|
8588
|
-
previousQuestion:
|
|
8596
|
+
previousQuestion: fe,
|
|
8589
8597
|
nextLesson: P,
|
|
8590
8598
|
previousLesson: Te,
|
|
8591
8599
|
completeLesson: C,
|
|
8592
8600
|
completeCurriculum: x,
|
|
8593
|
-
resetCurriculum:
|
|
8601
|
+
resetCurriculum: Ie,
|
|
8594
8602
|
getState: () => ({ ...r.current }),
|
|
8595
8603
|
getCurrentQuestion: () => E(),
|
|
8596
8604
|
getCurrentLesson: () => y(),
|
|
@@ -8644,8 +8652,8 @@ const Xt = Ke(({
|
|
|
8644
8652
|
handleResize: () => c.current?.handleResize(),
|
|
8645
8653
|
// Avatar readiness check (always returns current value)
|
|
8646
8654
|
isAvatarReady: () => c.current?.isReady || !1
|
|
8647
|
-
}), [D, I,
|
|
8648
|
-
const
|
|
8655
|
+
}), [D, I, $, ye, G, P, C, x, Ie, E, y]);
|
|
8656
|
+
const re = M.current || {
|
|
8649
8657
|
avatarUrl: "/avatars/brunette.glb",
|
|
8650
8658
|
avatarBody: "F",
|
|
8651
8659
|
mood: "happy",
|
|
@@ -8659,21 +8667,21 @@ const Xt = Ke(({
|
|
|
8659
8667
|
animations: e
|
|
8660
8668
|
};
|
|
8661
8669
|
return /* @__PURE__ */ le("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ le(
|
|
8662
|
-
|
|
8670
|
+
ut,
|
|
8663
8671
|
{
|
|
8664
8672
|
ref: c,
|
|
8665
|
-
avatarUrl:
|
|
8666
|
-
avatarBody:
|
|
8667
|
-
mood:
|
|
8668
|
-
ttsLang:
|
|
8669
|
-
ttsService:
|
|
8670
|
-
ttsVoice:
|
|
8671
|
-
ttsApiKey:
|
|
8672
|
-
bodyMovement:
|
|
8673
|
-
movementIntensity:
|
|
8674
|
-
showFullAvatar:
|
|
8673
|
+
avatarUrl: re.avatarUrl,
|
|
8674
|
+
avatarBody: re.avatarBody,
|
|
8675
|
+
mood: re.mood,
|
|
8676
|
+
ttsLang: re.ttsLang,
|
|
8677
|
+
ttsService: re.ttsService,
|
|
8678
|
+
ttsVoice: re.ttsVoice,
|
|
8679
|
+
ttsApiKey: re.ttsApiKey,
|
|
8680
|
+
bodyMovement: re.bodyMovement,
|
|
8681
|
+
movementIntensity: re.movementIntensity,
|
|
8682
|
+
showFullAvatar: re.showFullAvatar,
|
|
8675
8683
|
cameraView: "upper",
|
|
8676
|
-
animations:
|
|
8684
|
+
animations: re.animations,
|
|
8677
8685
|
onReady: Me,
|
|
8678
8686
|
onLoading: () => {
|
|
8679
8687
|
},
|
|
@@ -8683,8 +8691,8 @@ const Xt = Ke(({
|
|
|
8683
8691
|
}
|
|
8684
8692
|
) });
|
|
8685
8693
|
});
|
|
8686
|
-
|
|
8687
|
-
function
|
|
8694
|
+
Gt.displayName = "CurriculumLearning";
|
|
8695
|
+
function en({
|
|
8688
8696
|
manifestPath: Y = "/animations/manifest.json",
|
|
8689
8697
|
avatarBody: n = "F",
|
|
8690
8698
|
onAnimationPlay: e = null,
|
|
@@ -8692,41 +8700,41 @@ function Jt({
|
|
|
8692
8700
|
onDeleteAnimations: o = null,
|
|
8693
8701
|
style: s = {}
|
|
8694
8702
|
}) {
|
|
8695
|
-
const [i, a] =
|
|
8696
|
-
|
|
8703
|
+
const [i, a] = pe([]), [u, l] = pe(/* @__PURE__ */ new Set()), [c, r] = pe(!0), [h, d] = pe(null), [p, b] = pe("all"), [f, L] = pe("");
|
|
8704
|
+
ke(() => {
|
|
8697
8705
|
(async () => {
|
|
8698
8706
|
r(!0), d(null);
|
|
8699
8707
|
try {
|
|
8700
8708
|
const x = await je(Y), I = [];
|
|
8701
8709
|
if (x._genderSpecific) {
|
|
8702
8710
|
const P = (n?.toUpperCase() || "F") === "M" ? "male" : "female";
|
|
8703
|
-
x._genderSpecific[P] && Object.entries(x._genderSpecific[P]).forEach(([D,
|
|
8704
|
-
(Array.isArray(
|
|
8711
|
+
x._genderSpecific[P] && Object.entries(x._genderSpecific[P]).forEach(([D, $]) => {
|
|
8712
|
+
(Array.isArray($) ? $ : [$]).forEach((fe) => {
|
|
8705
8713
|
I.push({
|
|
8706
|
-
path:
|
|
8714
|
+
path: fe,
|
|
8707
8715
|
group: D,
|
|
8708
8716
|
gender: P,
|
|
8709
|
-
name:
|
|
8717
|
+
name: fe.split("/").pop().replace(".fbx", "")
|
|
8710
8718
|
});
|
|
8711
8719
|
});
|
|
8712
|
-
}), x._genderSpecific.shared && Object.entries(x._genderSpecific.shared).forEach(([D,
|
|
8713
|
-
(Array.isArray(
|
|
8720
|
+
}), x._genderSpecific.shared && Object.entries(x._genderSpecific.shared).forEach(([D, $]) => {
|
|
8721
|
+
(Array.isArray($) ? $ : [$]).forEach((fe) => {
|
|
8714
8722
|
I.push({
|
|
8715
|
-
path:
|
|
8723
|
+
path: fe,
|
|
8716
8724
|
group: D,
|
|
8717
8725
|
gender: "shared",
|
|
8718
|
-
name:
|
|
8726
|
+
name: fe.split("/").pop().replace(".fbx", "")
|
|
8719
8727
|
});
|
|
8720
8728
|
});
|
|
8721
8729
|
});
|
|
8722
8730
|
}
|
|
8723
8731
|
Object.entries(x).forEach(([G, P]) => {
|
|
8724
|
-
G !== "_genderSpecific" && (Array.isArray(P) ? P : [P]).forEach((
|
|
8725
|
-
typeof
|
|
8726
|
-
path:
|
|
8732
|
+
G !== "_genderSpecific" && (Array.isArray(P) ? P : [P]).forEach(($) => {
|
|
8733
|
+
typeof $ == "string" && I.push({
|
|
8734
|
+
path: $,
|
|
8727
8735
|
group: G,
|
|
8728
8736
|
gender: "root",
|
|
8729
|
-
name:
|
|
8737
|
+
name: $.split("/").pop().replace(".fbx", "")
|
|
8730
8738
|
});
|
|
8731
8739
|
});
|
|
8732
8740
|
}), a(I), r(!1);
|
|
@@ -8766,10 +8774,10 @@ ${x.slice(0, 5).join(`
|
|
|
8766
8774
|
}, S = (C) => {
|
|
8767
8775
|
e && e(C);
|
|
8768
8776
|
};
|
|
8769
|
-
return c ? /* @__PURE__ */ le("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ le("p", { children: "Loading animations..." }) }) : h ? /* @__PURE__ */ le("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */
|
|
8777
|
+
return c ? /* @__PURE__ */ le("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ le("p", { children: "Loading animations..." }) }) : h ? /* @__PURE__ */ le("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */ Be("p", { children: [
|
|
8770
8778
|
"Error loading animations: ",
|
|
8771
8779
|
h
|
|
8772
|
-
] }) }) : /* @__PURE__ */
|
|
8780
|
+
] }) }) : /* @__PURE__ */ Be("div", { style: {
|
|
8773
8781
|
padding: "20px",
|
|
8774
8782
|
backgroundColor: "#2a2a2a",
|
|
8775
8783
|
borderRadius: "8px",
|
|
@@ -8778,7 +8786,7 @@ ${x.slice(0, 5).join(`
|
|
|
8778
8786
|
}, children: [
|
|
8779
8787
|
/* @__PURE__ */ le("h2", { style: { marginTop: 0 }, children: "Animation Selector" }),
|
|
8780
8788
|
/* @__PURE__ */ le("p", { style: { color: "#aaa", fontSize: "14px" }, children: "Click buttons to play animations. Select animations to keep, then delete will remove the rest." }),
|
|
8781
|
-
/* @__PURE__ */
|
|
8789
|
+
/* @__PURE__ */ Be("div", { style: {
|
|
8782
8790
|
display: "flex",
|
|
8783
8791
|
gap: "10px",
|
|
8784
8792
|
marginBottom: "20px",
|
|
@@ -8852,7 +8860,7 @@ ${x.slice(0, 5).join(`
|
|
|
8852
8860
|
children: "Deselect All Visible"
|
|
8853
8861
|
}
|
|
8854
8862
|
),
|
|
8855
|
-
/* @__PURE__ */
|
|
8863
|
+
/* @__PURE__ */ Be(
|
|
8856
8864
|
"button",
|
|
8857
8865
|
{
|
|
8858
8866
|
onClick: E,
|
|
@@ -8874,7 +8882,7 @@ ${x.slice(0, 5).join(`
|
|
|
8874
8882
|
}
|
|
8875
8883
|
)
|
|
8876
8884
|
] }),
|
|
8877
|
-
/* @__PURE__ */
|
|
8885
|
+
/* @__PURE__ */ Be("div", { style: {
|
|
8878
8886
|
marginBottom: "15px",
|
|
8879
8887
|
fontSize: "14px",
|
|
8880
8888
|
color: "#aaa"
|
|
@@ -8897,7 +8905,7 @@ ${x.slice(0, 5).join(`
|
|
|
8897
8905
|
borderRadius: "6px"
|
|
8898
8906
|
}, children: g.map((C, x) => {
|
|
8899
8907
|
const I = u.has(C.path);
|
|
8900
|
-
return /* @__PURE__ */
|
|
8908
|
+
return /* @__PURE__ */ Be(
|
|
8901
8909
|
"div",
|
|
8902
8910
|
{
|
|
8903
8911
|
style: {
|
|
@@ -8910,7 +8918,7 @@ ${x.slice(0, 5).join(`
|
|
|
8910
8918
|
},
|
|
8911
8919
|
onClick: () => H(C.path),
|
|
8912
8920
|
children: [
|
|
8913
|
-
/* @__PURE__ */
|
|
8921
|
+
/* @__PURE__ */ Be("div", { style: { marginBottom: "8px" }, children: [
|
|
8914
8922
|
/* @__PURE__ */ le(
|
|
8915
8923
|
"input",
|
|
8916
8924
|
{
|
|
@@ -8924,7 +8932,7 @@ ${x.slice(0, 5).join(`
|
|
|
8924
8932
|
}
|
|
8925
8933
|
}
|
|
8926
8934
|
),
|
|
8927
|
-
/* @__PURE__ */
|
|
8935
|
+
/* @__PURE__ */ Be("span", { style: { fontSize: "12px", color: "#aaa" }, children: [
|
|
8928
8936
|
C.group,
|
|
8929
8937
|
" ",
|
|
8930
8938
|
C.gender !== "root" && `(${C.gender})`
|
|
@@ -8967,7 +8975,7 @@ ${x.slice(0, 5).join(`
|
|
|
8967
8975
|
}, children: "No animations found matching your filters." })
|
|
8968
8976
|
] });
|
|
8969
8977
|
}
|
|
8970
|
-
const
|
|
8978
|
+
const ht = {
|
|
8971
8979
|
// Code-based dance animations (no FBX required)
|
|
8972
8980
|
dance: {
|
|
8973
8981
|
name: "dance",
|
|
@@ -9070,16 +9078,16 @@ const ut = {
|
|
|
9070
9078
|
duration: 5e3,
|
|
9071
9079
|
description: "Excited, energetic movement"
|
|
9072
9080
|
}
|
|
9073
|
-
},
|
|
9081
|
+
}, tn = (Y) => ht[Y] || null, nn = (Y) => ht.hasOwnProperty(Y);
|
|
9074
9082
|
export {
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9083
|
+
en as AnimationSelector,
|
|
9084
|
+
Gt as CurriculumLearning,
|
|
9085
|
+
Xt as SimpleTalkingAvatar,
|
|
9086
|
+
ut as TalkingHeadAvatar,
|
|
9087
|
+
Wt as TalkingHeadComponent,
|
|
9088
|
+
ht as animations,
|
|
9089
|
+
et as getActiveTTSConfig,
|
|
9090
|
+
tn as getAnimation,
|
|
9091
|
+
Jt as getVoiceOptions,
|
|
9092
|
+
nn as hasAnimation
|
|
9085
9093
|
};
|