@sage-rsc/talking-head-react 1.6.4 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { jsxs as Ie, jsx as $ } from "react/jsx-runtime";
2
- import { forwardRef as Ue, useRef as G, useState as ae, useEffect as xe, useCallback as U, useImperativeHandle as We, useLayoutEffect as et } from "react";
1
+ import { jsxs as ke, jsx as $ } from "react/jsx-runtime";
2
+ import { forwardRef as Ze, useRef as W, useState as ae, useEffect as fe, useCallback as D, useImperativeHandle as Xe, useLayoutEffect as it } from "react";
3
3
  import * as f from "three";
4
- import { OrbitControls as tt } from "three/addons/controls/OrbitControls.js";
5
- import { GLTFLoader as nt } from "three/addons/loaders/GLTFLoader.js";
6
- import { DRACOLoader as it } from "three/addons/loaders/DRACOLoader.js";
7
- import { FBXLoader as je } from "three/addons/loaders/FBXLoader.js";
8
- import { RoomEnvironment as ot } from "three/addons/environments/RoomEnvironment.js";
9
- import st from "three/addons/libs/stats.module.js";
10
- let m, fe, Re;
11
- const z = [0, 0, 0, 0], O = new f.Vector3(), Oe = new f.Vector3(), de = new f.Vector3(), Be = new f.Vector3();
4
+ import { OrbitControls as ot } from "three/addons/controls/OrbitControls.js";
5
+ import { GLTFLoader as st } from "three/addons/loaders/GLTFLoader.js";
6
+ import { DRACOLoader as rt } from "three/addons/loaders/DRACOLoader.js";
7
+ import { FBXLoader as qe } from "three/addons/loaders/FBXLoader.js";
8
+ import { RoomEnvironment as at } from "three/addons/environments/RoomEnvironment.js";
9
+ import lt from "three/addons/libs/stats.module.js";
10
+ let m, ye, Re;
11
+ const z = [0, 0, 0, 0], O = new f.Vector3(), Ue = new f.Vector3(), he = new f.Vector3(), We = new f.Vector3();
12
12
  new f.Plane();
13
13
  new f.Ray();
14
14
  new f.Euler();
15
- const me = new f.Quaternion(), Ye = new f.Quaternion(), Ae = new f.Matrix4(), Le = new f.Matrix4();
15
+ const de = new f.Quaternion(), _e = new f.Quaternion(), we = new f.Matrix4(), Ce = new f.Matrix4();
16
16
  new f.Vector3();
17
- const De = new f.Vector3(0, 0, 1), rt = new f.Vector3(1, 0, 0), at = new f.Vector3(0, 1, 0), lt = new f.Vector3(0, 0, 1);
18
- class ut {
17
+ const Ve = new f.Vector3(0, 0, 1), ut = new f.Vector3(1, 0, 0), ct = new f.Vector3(0, 1, 0), ht = new f.Vector3(0, 0, 1);
18
+ class dt {
19
19
  constructor(t = null) {
20
20
  this.opt = Object.assign({
21
21
  warmupMs: 2e3,
@@ -338,7 +338,7 @@ class ut {
338
338
  ea: [0, 0, 0, 0]
339
339
  // External acceleration [m/s^2]
340
340
  };
341
- u.boneParent.matrixWorld.decompose(O, me, de), O.copy(De).applyQuaternion(me).setY(0).normalize(), me.premultiply(Ye.setFromUnitVectors(De, O).invert()).normalize(), u.qWorldInverseYaw = me.clone().normalize(), this.data.push(u), this.dict[c] = u;
341
+ u.boneParent.matrixWorld.decompose(O, de, he), O.copy(Ve).applyQuaternion(de).setY(0).normalize(), de.premultiply(_e.setFromUnitVectors(Ve, O).invert()).normalize(), u.qWorldInverseYaw = de.clone().normalize(), this.data.push(u), this.dict[c] = u;
342
342
  try {
343
343
  this.setValue(c, "type", s.type), this.setValue(c, "stiffness", s.stiffness), this.setValue(c, "damping", s.damping), this.setValue(c, "external", s.external), this.setValue(c, "limits", s.limits), this.setValue(c, "excludes", s.excludes), this.setValue(c, "deltaLocal", s.deltaLocal), this.setValue(c, "deltaWorld", s.deltaWorld), this.setValue(c, "pivot", s.pivot), this.setValue(c, "helper", s.helper);
344
344
  } catch (r) {
@@ -356,22 +356,22 @@ class ut {
356
356
  for (this.timerMs += t, t > 1e3 && (this.timerMs = 0), t /= 1e3, e = 0, o = this.objectsUpdate.length; e < o; e++)
357
357
  i = this.objectsUpdate[e], i.updateMatrix(), i.parent === null ? i.matrixWorld.copy(i.matrix) : i.matrixWorld.multiplyMatrices(i.parent.matrixWorld, i.matrix), i.matrixWorldNeedsUpdate = !1;
358
358
  for (e = 0, o = this.data.length; e < o; e++) {
359
- if (i = this.data[e], O.copy(i.vWorld), Ae.copy(i.boneParent.matrixWorld), Le.copy(Ae).invert(), i.vWorld.setFromMatrixPosition(Ae), O.applyMatrix4(Le), O.length() > 0.5 && (console.info("Info: Unrealistic jump of " + O.length().toFixed(2) + " meters."), O.setLength(0.5)), O.applyQuaternion(i.bone.quaternion), z[0] = O.x, z[1] = O.y, z[2] = -O.z, z[3] = O.length() / 3, i.children)
359
+ if (i = this.data[e], O.copy(i.vWorld), we.copy(i.boneParent.matrixWorld), Ce.copy(we).invert(), i.vWorld.setFromMatrixPosition(we), O.applyMatrix4(Ce), O.length() > 0.5 && (console.info("Info: Unrealistic jump of " + O.length().toFixed(2) + " meters."), O.setLength(0.5)), O.applyQuaternion(i.bone.quaternion), z[0] = O.x, z[1] = O.y, z[2] = -O.z, z[3] = O.length() / 3, i.children)
360
360
  for (n = 0, s = i.children.length; n < s; n++)
361
361
  m = i.children[n], z[0] -= m.v[0] * t / 3, z[1] -= m.v[1] * t / 3, z[2] += m.v[2] * t / 3, z[3] -= m.v[3] * t / 3;
362
362
  if (m = this.opt.sensitivityFactor, z[0] *= i.ext * m, z[1] *= i.ext * m, z[2] *= i.ext * m, z[3] *= i.ext * m, i.isX && (m = z[0] / t, i.ea[0] = (m - i.ev[0]) / t, i.ev[0] = m, i.a[0] = -i.k[0] * i.p[0] - i.c[0] * i.v[0] - i.ea[0], i.p[0] += i.v[0] * t + i.a[0] * t * t / 2 + z[0], m = i.v[0] + i.a[0] * t / 2, m = -i.k[0] * i.p[0] - i.c[0] * m - i.ea[0], i.v[0] = i.v[0] + (m + i.a[0]) * t / 2), i.isY && (m = z[1] / t, i.ea[1] = (m - i.ev[1]) / t, i.ev[1] = m, i.a[1] = -i.k[1] * i.p[1] - i.c[1] * i.v[1] - i.ea[1], i.p[1] += i.v[1] * t + i.a[1] * t * t / 2 + z[1], m = i.v[1] + i.a[1] * t / 2, m = -i.k[1] * i.p[1] - i.c[1] * m - i.ea[1], i.v[1] = i.v[1] + (m + i.a[1]) * t / 2), i.isZ && (m = z[2] / t, i.ea[2] = (m - i.ev[2]) / t, i.ev[2] = m, i.a[2] = -i.k[2] * i.p[2] - i.c[2] * i.v[2] - i.ea[2], i.p[2] += i.v[2] * t + i.a[2] * t * t / 2 + z[2], m = i.v[2] + i.a[2] * t / 2, m = -i.k[2] * i.p[2] - i.c[2] * m - i.ea[2], i.v[2] = i.v[2] + (m + i.a[2]) * t / 2), i.isT && (m = z[3] / t, i.ea[3] = (m - i.ev[3]) / t, i.ev[3] = m, i.a[3] = -i.k[3] * i.p[3] - i.c[3] * i.v[3] - i.ea[3], i.p[3] += i.v[3] * t + i.a[3] * t * t / 2 + z[3], m = i.v[3] + i.a[3] * t / 2, m = -i.k[3] * i.p[3] - i.c[3] * m - i.ea[3], i.v[3] = i.v[3] + (m + i.a[3]) * t / 2), this.timerMs < this.opt.warmupMs && (i.v[0] *= 1e-4, i.p[0] *= 1e-4, i.v[1] *= 1e-4, i.p[1] *= 1e-4, i.v[2] *= 1e-4, i.p[2] *= 1e-4, i.v[3] *= 1e-4, i.p[3] *= 1e-4), z[0] = i.p[0], z[1] = i.p[1], z[2] = i.p[2], z[3] = i.p[3], m = this.opt.movementFactor, z[0] *= m, z[1] *= m, z[2] *= m, z[3] *= m, i.dl && (m = i.dl, z[0] += m[0], z[1] += m[1], z[2] += m[2]), i.dw && (m = i.dw, O.set(
363
363
  i.vBasis.x + z[0],
364
364
  i.vBasis.y + z[1],
365
365
  i.vBasis.z + z[2]
366
- ), O.applyMatrix4(Ae), O.x += m[0], O.y += m[1], O.z += m[2], O.applyMatrix4(Le), z[0] += O.x - i.vBasis.x, z[1] += O.y - i.vBasis.y, z[2] += O.z - i.vBasis.z), i.limits && this.opt.isLimits && (m = i.limits, m[0] && (m[0][0] !== null && z[0] < m[0][0] && (z[0] = m[0][0]), m[0][1] !== null && z[0] > m[0][1] && (z[0] = m[0][1])), m[1] && (m[1][0] !== null && z[1] < m[1][0] && (z[1] = m[1][0]), m[1][1] !== null && z[1] > m[1][1] && (z[1] = m[1][1])), m[2] && (m[2][0] !== null && z[2] < m[2][0] && (z[2] = m[2][0]), m[2][1] !== null && z[2] > m[2][1] && (z[2] = m[2][1])), m[3] && (m[3][0] !== null && z[3] < m[3][0] && (z[3] = m[3][0]), m[3][1] !== null && z[3] > m[3][1] && (z[3] = m[3][1]))), i.isPoint)
366
+ ), O.applyMatrix4(we), O.x += m[0], O.y += m[1], O.z += m[2], O.applyMatrix4(Ce), z[0] += O.x - i.vBasis.x, z[1] += O.y - i.vBasis.y, z[2] += O.z - i.vBasis.z), i.limits && this.opt.isLimits && (m = i.limits, m[0] && (m[0][0] !== null && z[0] < m[0][0] && (z[0] = m[0][0]), m[0][1] !== null && z[0] > m[0][1] && (z[0] = m[0][1])), m[1] && (m[1][0] !== null && z[1] < m[1][0] && (z[1] = m[1][0]), m[1][1] !== null && z[1] > m[1][1] && (z[1] = m[1][1])), m[2] && (m[2][0] !== null && z[2] < m[2][0] && (z[2] = m[2][0]), m[2][1] !== null && z[2] > m[2][1] && (z[2] = m[2][1])), m[3] && (m[3][0] !== null && z[3] < m[3][0] && (z[3] = m[3][0]), m[3][1] !== null && z[3] > m[3][1] && (z[3] = m[3][1]))), i.isPoint)
367
367
  i.bone.position.set(
368
368
  i.vBasis.x + z[0],
369
369
  i.vBasis.y + z[1],
370
370
  i.vBasis.z - z[2]
371
371
  );
372
- else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(O, me, de), O.copy(De).applyQuaternion(me).setY(0).normalize(), me.premultiply(Ye.setFromUnitVectors(De, O).invert()).normalize(), i.boneParent.quaternion.multiply(me.invert()), i.boneParent.quaternion.multiply(i.qWorldInverseYaw)), i.isZ && (m = Math.atan(z[0] / i.l), me.setFromAxisAngle(lt, -m), i.boneParent.quaternion.multiply(me)), i.isY && (m = i.l / 3, m = m * Math.tanh(z[1] / m), i.bone.position.setLength(i.l + m)), i.isX && (m = Math.atan(z[2] / i.l), me.setFromAxisAngle(rt, -m), i.boneParent.quaternion.multiply(me)), i.isT && (m = 1.5 * Math.tanh(z[3] * 1.5), me.setFromAxisAngle(at, -m), i.boneParent.quaternion.multiply(me)), i.boneParent.updateWorldMatrix(!1, !0), i.excludes && this.opt.isExcludes)
372
+ else if (i.boneParent.quaternion.copy(i.qBasis), i.pivot && this.opt.isPivots && (i.boneParent.updateWorldMatrix(!1, !1), i.boneParent.matrixWorld.decompose(O, de, he), O.copy(Ve).applyQuaternion(de).setY(0).normalize(), de.premultiply(_e.setFromUnitVectors(Ve, O).invert()).normalize(), i.boneParent.quaternion.multiply(de.invert()), i.boneParent.quaternion.multiply(i.qWorldInverseYaw)), i.isZ && (m = Math.atan(z[0] / i.l), de.setFromAxisAngle(ht, -m), i.boneParent.quaternion.multiply(de)), i.isY && (m = i.l / 3, m = m * Math.tanh(z[1] / m), i.bone.position.setLength(i.l + m)), i.isX && (m = Math.atan(z[2] / i.l), de.setFromAxisAngle(ut, -m), i.boneParent.quaternion.multiply(de)), i.isT && (m = 1.5 * Math.tanh(z[3] * 1.5), de.setFromAxisAngle(ct, -m), i.boneParent.quaternion.multiply(de)), i.boneParent.updateWorldMatrix(!1, !0), i.excludes && this.opt.isExcludes)
373
373
  for (n = 0, s = i.excludes.length; n < s; n++)
374
- m = i.excludes[n], de.set(0, 0, 0), m.deltaLocal && (de.x += m.deltaLocal[0], de.y += m.deltaLocal[1], de.z += m.deltaLocal[2]), de.applyMatrix4(m.bone.matrixWorld), Le.copy(i.boneParent.matrixWorld).invert(), de.applyMatrix4(Le), O.copy(i.bone.position), !(O.distanceToSquared(de) >= m.radiusSq) && (Re = O.length(), fe = de.length(), !(fe > m.radius + Re) && (fe < Math.abs(m.radius - Re) || (fe = (fe * fe + Re * Re - m.radiusSq) / (2 * fe), de.normalize(), Be.copy(de).multiplyScalar(fe), fe = Math.sqrt(Re * Re - fe * fe), O.subVectors(O, Be).projectOnPlane(de).normalize().multiplyScalar(fe), Oe.subVectors(i.vBasis, Be).projectOnPlane(de).normalize(), Re = Oe.dot(O), Re < 0 && (Re = Math.sqrt(fe * fe - Re * Re), Oe.multiplyScalar(Re), O.add(Oe)), O.add(Be).normalize(), de.copy(i.bone.position).normalize(), me.setFromUnitVectors(de, O), i.boneParent.quaternion.premultiply(me), i.boneParent.updateWorldMatrix(!1, !0))));
374
+ m = i.excludes[n], he.set(0, 0, 0), m.deltaLocal && (he.x += m.deltaLocal[0], he.y += m.deltaLocal[1], he.z += m.deltaLocal[2]), he.applyMatrix4(m.bone.matrixWorld), Ce.copy(i.boneParent.matrixWorld).invert(), he.applyMatrix4(Ce), O.copy(i.bone.position), !(O.distanceToSquared(he) >= m.radiusSq) && (Re = O.length(), ye = he.length(), !(ye > m.radius + Re) && (ye < Math.abs(m.radius - Re) || (ye = (ye * ye + Re * Re - m.radiusSq) / (2 * ye), he.normalize(), We.copy(he).multiplyScalar(ye), ye = Math.sqrt(Re * Re - ye * ye), O.subVectors(O, We).projectOnPlane(he).normalize().multiplyScalar(ye), Ue.subVectors(i.vBasis, We).projectOnPlane(he).normalize(), Re = Ue.dot(O), Re < 0 && (Re = Math.sqrt(ye * ye - Re * Re), Ue.multiplyScalar(Re), O.add(Ue)), O.add(We).normalize(), he.copy(i.bone.position).normalize(), de.setFromUnitVectors(he, O), i.boneParent.quaternion.premultiply(de), i.boneParent.updateWorldMatrix(!1, !0))));
375
375
  }
376
376
  this.helpers.isActive && this.updateHelpers();
377
377
  }
@@ -442,17 +442,17 @@ class ut {
442
442
  */
443
443
  updateHelpers() {
444
444
  if (m = this.helpers.points, m.bones.length) {
445
- Le.copy(this.armature.matrixWorld).invert();
445
+ Ce.copy(this.armature.matrixWorld).invert();
446
446
  const t = m.object.geometry.getAttribute("position");
447
447
  for (let e = 0, n = m.bones.length; e < n; e++)
448
- Ae.multiplyMatrices(Le, m.bones[e].matrixWorld), O.setFromMatrixPosition(Ae), t.setXYZ(e, O.x, O.y, O.z);
448
+ we.multiplyMatrices(Ce, m.bones[e].matrixWorld), O.setFromMatrixPosition(we), t.setXYZ(e, O.x, O.y, O.z);
449
449
  t.needsUpdate = !0, m.object.updateMatrixWorld();
450
450
  }
451
451
  if (m = this.helpers.lines, m.bones.length) {
452
- Le.copy(this.armature.matrixWorld).invert();
452
+ Ce.copy(this.armature.matrixWorld).invert();
453
453
  const t = m.object.geometry.getAttribute("position");
454
454
  for (let e = 0, n = 0, o = m.bones.length; e < o; e++, n += 2)
455
- Ae.multiplyMatrices(Le, m.bones[e].matrixWorld), O.setFromMatrixPosition(Ae), t.setXYZ(n, O.x, O.y, O.z), Ae.multiplyMatrices(Le, m.bones[e].parent.matrixWorld), O.setFromMatrixPosition(Ae), t.setXYZ(n + 1, O.x, O.y, O.z);
455
+ we.multiplyMatrices(Ce, m.bones[e].matrixWorld), O.setFromMatrixPosition(we), t.setXYZ(n, O.x, O.y, O.z), we.multiplyMatrices(Ce, m.bones[e].parent.matrixWorld), O.setFromMatrixPosition(we), t.setXYZ(n + 1, O.x, O.y, O.z);
456
456
  t.needsUpdate = !0, m.object.updateMatrixWorld();
457
457
  }
458
458
  }
@@ -489,7 +489,7 @@ class ut {
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 ct {
492
+ class mt {
493
493
  constructor(t) {
494
494
  this.audioContext = t, this.analyzer = null, this.dataArray = null, this.bufferLength = 0;
495
495
  }
@@ -814,7 +814,7 @@ class ct {
814
814
  return o * s;
815
815
  }
816
816
  }
817
- class ht {
817
+ class pt {
818
818
  /**
819
819
  * @constructor
820
820
  */
@@ -1396,11 +1396,11 @@ class ht {
1396
1396
  return e;
1397
1397
  }
1398
1398
  }
1399
- const dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1399
+ const gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1400
1400
  __proto__: null,
1401
- LipsyncEn: ht
1401
+ LipsyncEn: pt
1402
1402
  }, Symbol.toStringTag, { value: "Module" }));
1403
- class mt {
1403
+ class yt {
1404
1404
  /**
1405
1405
  * @constructor
1406
1406
  */
@@ -1754,11 +1754,11 @@ class mt {
1754
1754
  return e;
1755
1755
  }
1756
1756
  }
1757
- const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1757
+ const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1758
1758
  __proto__: null,
1759
- LipsyncDe: mt
1759
+ LipsyncDe: yt
1760
1760
  }, Symbol.toStringTag, { value: "Module" }));
1761
- class gt {
1761
+ class xt {
1762
1762
  /**
1763
1763
  * @constructor
1764
1764
  */
@@ -2289,11 +2289,11 @@ class gt {
2289
2289
  return e;
2290
2290
  }
2291
2291
  }
2292
- const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2292
+ const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2293
2293
  __proto__: null,
2294
- LipsyncFr: gt
2294
+ LipsyncFr: xt
2295
2295
  }, Symbol.toStringTag, { value: "Module" }));
2296
- class ft {
2296
+ class Rt {
2297
2297
  /**
2298
2298
  * @constructor
2299
2299
  */
@@ -2436,11 +2436,11 @@ class ft {
2436
2436
  return e;
2437
2437
  }
2438
2438
  }
2439
- const xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2439
+ const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2440
2440
  __proto__: null,
2441
- LipsyncFi: ft
2441
+ LipsyncFi: Rt
2442
2442
  }, Symbol.toStringTag, { value: "Module" }));
2443
- class bt {
2443
+ class It {
2444
2444
  /**
2445
2445
  * @constructor
2446
2446
  */
@@ -2620,24 +2620,24 @@ class bt {
2620
2620
  return e;
2621
2621
  }
2622
2622
  }
2623
- const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2623
+ const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2624
2624
  __proto__: null,
2625
- LipsyncLt: bt
2626
- }, Symbol.toStringTag, { value: "Module" })), vt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxIHNlY29uZCkgYXMgYSBmYWxsYmFjayBzYWZldHkgbmV0CiAgICBjb25zdCBzaWxlbmNlRHVyYXRpb25TZWNvbmRzID0gMS4wOwogICAgdGhpcy5fc2lsZW5jZVRocmVzaG9sZEJsb2NrcyA9IE1hdGguY2VpbCgodGhpcy5fc2FtcGxlUmF0ZSAqIHNpbGVuY2VEdXJhdGlvblNlY29uZHMpIC8gMTI4KTsKCiAgICAvLyBNZXRyaWNzIGNvbmZpZ3VyYXRpb24gdmlhIG9wdGlvbnMKICAgIGNvbnN0IG1ldHJpY3NDZmcgPSBvcHRpb25zPy5wcm9jZXNzb3JPcHRpb25zPy5tZXRyaWNzIHx8IHt9OwogICAgdGh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Y2tzOwoKICAgICAgICAgIGlmICh0aGlzLl9ub01vcmVEYXRhUmVjZWl2ZWQgfHwgaXNUaW1lZE91dCkgewogICAgICAgICAgICAvLyBFTkQgT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1ZXVlZE1zOiAwLAogICAgICAgICAgICAgICAgICAgIG1heFF1ZXVlZE1zOiBNYXRoLnJvdW5kKCh0aGlzLl9tYXhRdWV1ZVNhbXBsZXMgLyB0aGlzLl9zYW1wbGVSYXRlKSAqIDEwMDApLAogICAgICAgICAgICAgICAgICAgIHVuZGVycnVuQmxvY2tzOiB0aGlzLl91bmRlcnJ1bkJsb2NrcywKICAgICAgICAgICAgICAgICAgICBmcmFtZXNQcm9jZXNzZWQ6IHRoaXMuX2ZyYW1lc1Byb2Nlc3NlZAogICAgICAgICAg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ykgeyB9CiAgICAgICAgLy8gRG9uJ3QgcmVzZXQgbWF4IHRyYWNrZXIgLSBrZWVwIHNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), Qe = {
2627
- en: dt,
2628
- de: pt,
2629
- fr: yt,
2630
- fi: xt,
2631
- lt: Rt
2632
- }, oe = new f.Quaternion(), _ = new f.Euler(), ke = new f.Vector3(), Ce = new f.Vector3(), qe = new f.Box3();
2625
+ LipsyncLt: It
2626
+ }, Symbol.toStringTag, { value: "Module" })), Lt = new URL("data:text/javascript;base64,Y2xhc3MgUGxheWJhY2tXb3JrbGV0IGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgRlNNID0gewogICAgSURMRTogMCwKICAgIFBMQVlJTkc6IDEsCiAgfTsKCiAgY29uc3RydWN0b3Iob3B0aW9ucykgewogICAgc3VwZXIoKTsKICAgIHRoaXMucG9ydC5vbm1lc3NhZ2UgPSB0aGlzLmhhbmRsZU1lc3NhZ2UuYmluZCh0aGlzKTsKCiAgICB0aGlzLl9zYW1wbGVSYXRlID0gb3B0aW9ucz8ucHJvY2Vzc29yT3B0aW9ucz8uc2FtcGxlUmF0ZSB8fCBzYW1wbGVSYXRlOwogICAgdGhpcy5fc2NhbGUgPSAxIC8gMzI3Njg7IC8vIFBDTTE2IC0+IGZsb2F0CgogICAgLy8gU2lsZW5jZSBkZXRlY3Rpb24gdGhyZXNob2xkICgxIHNlY29uZCkgYXMgYSBmYWxsYmFjayBzYWZldHkgbmV0CiAgICBjb25zdCBzaWxlbmNlRHVyYXRpb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DaHVuayA9IHRoaXMuX2J1ZmZlclF1ZXVlLnNoaWZ0KCk7CiAgICAgICAgICB0aGlzLl9jdXJyZW50Q2h1bmtPZmZzZXQgPSAwOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAvLyBCdWZmZXIgaXMgZW1wdHkuIENoZWNrIGZvciBlbmQgY29uZGl0aW9ucy4KICAgICAgICAgIGNvbnN0IGlzVGltZWRPdXQgPSB0aGlzLl9zaWxlbmNlRnJhbWVzQ291bnQgPiB0aGlzLl9zaWxlbmNlVGhyZXNob2xkQmxvY2tzOwoKICAgICAgICAgIGlmICh0aGlzLl9ub01vcmVEYXRhUmVjZWl2ZWQgfHwgaXNUaW1lZE91dCkgewogICAgICAgICAgICAvLyBFTkQgT0YgUExBWUJBQ0s6IEVpdGhlciBleHBsaWNpdGx5IHNpZ25hbGVkIG9yIHRpbWVkIG91dC4KICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNTZW50RW5kZWQpIHsKICAgICAgICAgICAgICB0aGlzLnBvcnQucG9zdE1lc3NhZ2UoeyB0eXBlOiAicGxheWJhY2stZW5kZWQiIH0pOwogICAgICAgICAgICAgIHRoaXMuX2hhc1NlbnRFbmRlZCA9IHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gU2VuZCBmaW5hbCBtZXRyaWNzIHNob3dpbmcgY2xlYXJlZCBzdGF0ZQogICAgICAgICAgICBpZiAodGhpcy5fbWV0cmljc0VuYWJsZWQpIHsKICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgICAgdHlwZTogIm1ldHJpY3MiLAogICAgICAgICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU6IFBsYXliYWNrV29ya2xldC5GU00uSURMRSwKICAgICAgICAgICAgICAgICAgICBxdWV1ZWRTYW1wbGVzOiAwLAogICAgICAgICAgICAgICAgICAgIHF1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ICAgICAgICBtYXhRdWV1ZWRNczogTWF0aC5yb3VuZCgodGhpcy5fbWF4UXVldWVTYW1wbGVzIC8gdGhpcy5fc2FtcGxlUmF0ZSkgKiAxMDAwKSwKICAgICAgICAgICAgICB1bmRlcnJ1bkJsb2NrczogdGhpcy5fdW5kZXJydW5CbG9ja3MsCiAgICAgICAgICAgICAgZnJhbWVzUHJvY2Vzc2VkOiB0aGlzLl9mcmFtZXNQcm9jZXNzZWQKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSBjYXRjaCAoXykgeyB9CiAgICAgICAgLy8gRG9uJ3QgcmVzZXQgbWF4IHRyYWNrZXIgLSBrZWVwIHNlc3Npb24gcGVhayB1bnRpbCBpZGxlCiAgICAgIH0KICAgIH0KCiAgICAvLyBBTFdBWVMgcmV0dXJuIHRydWUgdG8ga2VlcCB0aGUgcHJvY2Vzc29yIGFsaXZlIGZvciByZXVzZS4KICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoInBsYXliYWNrLXdvcmtsZXQiLCBQbGF5YmFja1dvcmtsZXQpOwo=", import.meta.url), Ke = {
2627
+ en: gt,
2628
+ de: ft,
2629
+ fr: bt,
2630
+ fi: vt,
2631
+ lt: At
2632
+ }, ie = new f.Quaternion(), q = new f.Euler(), Te = new f.Vector3(), Ee = new f.Vector3(), Je = new f.Box3();
2633
2633
  new f.Matrix4();
2634
2634
  new f.Matrix4();
2635
2635
  new f.Vector3();
2636
2636
  new f.Vector3(0, 0, 1);
2637
- const It = new f.Vector3(1, 0, 0);
2637
+ const St = new f.Vector3(1, 0, 0);
2638
2638
  new f.Vector3(0, 1, 0);
2639
2639
  new f.Vector3(0, 0, 1);
2640
- class Ze {
2640
+ class Qe {
2641
2641
  /**
2642
2642
  * Avatar.
2643
2643
  * @typedef {Object} Avatar
@@ -2763,7 +2763,7 @@ class Ze {
2763
2763
  avatarOnlyCamera: null,
2764
2764
  statsNode: null,
2765
2765
  statsStyle: null
2766
- }, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new st(), this.opt.statsStyle && (this.stats.dom.style.cssText = this.opt.statsStyle), this.opt.statsNode.appendChild(this.stats.dom)), this.poseTemplates = {
2766
+ }, Object.assign(this.opt, e || {}), this.opt.statsNode && (this.stats = new lt(), 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 Ze {
4086
4086
  this.opt.lightSpotDispersion
4087
4087
  ), this.setLighting(this.opt);
4088
4088
  const a = new f.PMREMGenerator(this.renderer);
4089
- a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new ot()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new tt(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;
4089
+ a.compileEquirectangularShader(), this.scene.environment = a.fromScene(new at()).texture, this.resizeobserver = new ResizeObserver(this.onResize.bind(this)), this.resizeobserver.observe(this.nodeAvatar), this.controls = new ot(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 f.SkinnedMesh();
4092
4092
  const s = {
@@ -4104,14 +4104,14 @@ class Ze {
4104
4104
  Object.entries(s).forEach((a, c) => {
4105
4105
  const l = new f.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 f.Skeleton(i)), this.dynamicbones = new ut(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
4107
+ }), this.ikMesh.bind(new f.Skeleton(i)), this.dynamicbones = new dt(), this.isStreaming = !1, this.streamWorkletNode = null, this.streamAudioStartTime = null, this.streamWaitForAudioChunks = !0, this.streamLipsyncLang = null, this.streamLipsyncType = "visemes", this.streamLipsyncQueue = [];
4108
4108
  }
4109
4109
  /**
4110
4110
  * Helper that re/creates the audio context and the other nodes.
4111
4111
  * @param {number} sampleRate
4112
4112
  */
4113
4113
  initAudioGraph(t = null) {
4114
- if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), t ? this.audioCtx = new AudioContext({ sampleRate: t }) : this.audioCtx = new AudioContext(), this.audioSpeechSource = this.audioCtx.createBufferSource(), this.audioBackgroundSource = this.audioCtx.createBufferSource(), this.audioBackgroundGainNode = this.audioCtx.createGain(), this.audioSpeechGainNode = this.audioCtx.createGain(), this.audioStreamGainNode = this.audioCtx.createGain(), this.audioAnalyzerNode = this.audioCtx.createAnalyser(), this.audioAnalyzerNode.fftSize = 256, this.audioAnalyzerNode.smoothingTimeConstant = 0.1, this.audioAnalyzerNode.minDecibels = -70, this.audioAnalyzerNode.maxDecibels = -10, this.audioAnalyzer = new 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(
4114
+ if (this.audioCtx && this.audioCtx.state !== "closed" && this.audioCtx.close(), t ? this.audioCtx = new AudioContext({ sampleRate: t }) : this.audioCtx = new AudioContext(), this.audioSpeechSource = this.audioCtx.createBufferSource(), this.audioBackgroundSource = this.audioCtx.createBufferSource(), this.audioBackgroundGainNode = this.audioCtx.createGain(), this.audioSpeechGainNode = this.audioCtx.createGain(), this.audioStreamGainNode = this.audioCtx.createGain(), this.audioAnalyzerNode = this.audioCtx.createAnalyser(), this.audioAnalyzerNode.fftSize = 256, this.audioAnalyzerNode.smoothingTimeConstant = 0.1, this.audioAnalyzerNode.minDecibels = -70, this.audioAnalyzerNode.maxDecibels = -10, this.audioAnalyzer = new mt(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 Ze {
4252
4252
  async showAvatar(t, e = null) {
4253
4253
  if (!t || !t.hasOwnProperty("url"))
4254
4254
  throw new Error("Invalid parameter. The avatar must have at least 'url' specified.");
4255
- const n = new nt();
4255
+ const n = new st();
4256
4256
  if (this.dracoEnabled) {
4257
- const l = new it();
4257
+ const l = new rt();
4258
4258
  l.setDecoderPath(this.dracoDecoderPath), n.setDRACOLoader(l);
4259
4259
  }
4260
4260
  let o = await n.loadAsync(t.url, e);
@@ -4412,9 +4412,9 @@ class Ze {
4412
4412
  updatePoseDelta() {
4413
4413
  for (const [t, e] of Object.entries(this.poseDelta.props)) {
4414
4414
  if (e.x === 0 && e.y === 0 && e.z === 0) continue;
4415
- _.set(e.x, e.y, e.z);
4415
+ q.set(e.x, e.y, e.z);
4416
4416
  const n = this.poseAvatar.props[t];
4417
- n.isQuaternion ? (oe.setFromEuler(_), n.multiply(oe)) : n.isVector3 && n.add(_);
4417
+ n.isQuaternion ? (ie.setFromEuler(q), n.multiply(ie)) : n.isVector3 && n.add(q);
4418
4418
  }
4419
4419
  }
4420
4420
  /**
@@ -5179,7 +5179,7 @@ class Ze {
5179
5179
  }, o.x ? new f.Vector3(o.x, o.y, o.z) : null, !0, o.d);
5180
5180
  break;
5181
5181
  }
5182
- if ((c || l) && (_.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), _.x = Math.max(-0.9, Math.min(0.9, 2 * _.x - 0.5)), _.y = Math.max(-0.9, Math.min(0.9, -2.5 * _.y)), c ? (Object.assign(this.mtAvatar.eyesLookDown, { system: _.x < 0 ? -_.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: _.x < 0 ? 0 : _.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: _.y < 0 ? -_.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: _.y < 0 ? 0 : _.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: _.y < 0 ? 0 : _.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: _.y < 0 ? -_.y : 0, needsUpdate: !0 }), l && (n = -this.mtAvatar.bodyRotateY.value, o = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
5182
+ if ((c || l) && (q.setFromQuaternion(this.poseAvatar.props["Head.quaternion"]), q.x = Math.max(-0.9, Math.min(0.9, 2 * q.x - 0.5)), q.y = Math.max(-0.9, Math.min(0.9, -2.5 * q.y)), c ? (Object.assign(this.mtAvatar.eyesLookDown, { system: q.x < 0 ? -q.x : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyesLookUp, { system: q.x < 0 ? 0 : q.x, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInLeft, { system: q.y < 0 ? -q.y : 0, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutLeft, { system: q.y < 0 ? 0 : q.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookInRight, { system: q.y < 0 ? 0 : q.y, needsUpdate: !0 }), Object.assign(this.mtAvatar.eyeLookOutRight, { system: q.y < 0 ? -q.y : 0, needsUpdate: !0 }), l && (n = -this.mtAvatar.bodyRotateY.value, o = this.gaussianRandom(-0.2, 0.2), this.animQueue.push(this.animFactory({
5183
5183
  name: "headmove",
5184
5184
  dt: [[1e3, 2e3], [1e3, 2e3, 1, 2], [1e3, 2e3], [1e3, 2e3, 1, 2]],
5185
5185
  vs: {
@@ -5200,7 +5200,7 @@ class Ze {
5200
5200
  eyeLookOutRight: [null, 0],
5201
5201
  eyeContact: [0]
5202
5202
  }
5203
- })))), e > 2 * this.animFrameDur && (e = 2 * this.animFrameDur), (this.viewName !== "full" || this.isAvatarOnly) && (n = this.mtRandomized[Math.floor(Math.random() * this.mtRandomized.length)], o = this.mtAvatar[n], o.needsUpdate || Object.assign(o, { base: (this.mood.baseline[n] || 0) + (1 + a / 255) * Math.random() / 5, needsUpdate: !0 })), this.updatePoseBase(this.animClock), this.mixer && this.mixer.update(e / 1e3 * this.mixer.timeScale), this.updatePoseDelta(), this.applyShoulderAdjustmentToBones(), (this.isSpeaking || this.isListening) && c ? a > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = a) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), n = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(n), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(n) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (oe.setFromAxisAngle(It, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(oe)), qe.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(ke), ke.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(Ce), Ce.sub(this.armature.position), this.objectHips.position.y -= qe.min.y / 2, this.objectHips.position.x -= (ke.x + Ce.x) / 4, this.objectHips.position.z -= (ke.z + Ce.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
5203
+ })))), e > 2 * this.animFrameDur && (e = 2 * this.animFrameDur), (this.viewName !== "full" || this.isAvatarOnly) && (n = this.mtRandomized[Math.floor(Math.random() * this.mtRandomized.length)], o = this.mtAvatar[n], o.needsUpdate || Object.assign(o, { base: (this.mood.baseline[n] || 0) + (1 + a / 255) * Math.random() / 5, needsUpdate: !0 })), this.updatePoseBase(this.animClock), this.mixer && this.mixer.update(e / 1e3 * this.mixer.timeScale), this.updatePoseDelta(), this.applyShoulderAdjustmentToBones(), (this.isSpeaking || this.isListening) && c ? a > this.volumeMax ? (this.volumeHeadBase = 0.05, Math.random() > 0.6 && (this.volumeHeadTarget = -0.05 - Math.random() / 15), this.volumeMax = a) : (this.volumeMax *= 0.92, this.volumeHeadTarget = this.volumeHeadBase - 0.9 * (this.volumeHeadBase - this.volumeHeadTarget)) : (this.volumeHeadTarget = 0, this.volumeMax = 0), n = this.volumeHeadTarget - this.volumeHeadCurrent, o = Math.abs(n), o > 1e-4 && (i = o * (this.volumeHeadEasing(Math.min(1, this.volumeHeadVelocity * e / 1e3 / o) / 2 + 0.5) - 0.5), this.volumeHeadCurrent += Math.sign(n) * Math.min(o, i)), Math.abs(this.volumeHeadCurrent) > 1e-4 && (ie.setFromAxisAngle(St, this.volumeHeadCurrent), this.objectNeck.quaternion.multiply(ie)), Je.setFromObject(this.armature), this.objectLeftToeBase.getWorldPosition(Te), Te.sub(this.armature.position), this.objectRightToeBase.getWorldPosition(Ee), Ee.sub(this.armature.position), this.objectHips.position.y -= Je.min.y / 2, this.objectHips.position.x -= (Te.x + Ee.x) / 4, this.objectHips.position.z -= (Te.z + Ee.z) / 2, this.dynamicbones.update(e), this.fbxAnimationLoader && this.fbxAnimationLoader.update(), this.opt.update && this.opt.update(e), this.updateMorphTargets(e), this.isAvatarOnly)
5204
5204
  this.stats && this.stats.end();
5205
5205
  else {
5206
5206
  if (this.cameraClock !== null && this.cameraClock < 1e3) {
@@ -5231,8 +5231,8 @@ class Ze {
5231
5231
  if (!this.lipsync.hasOwnProperty(t)) {
5232
5232
  const n = t.toLowerCase(), o = "Lipsync" + t.charAt(0).toUpperCase() + t.slice(1);
5233
5233
  try {
5234
- const s = Qe[n];
5235
- s && s[o] ? this.lipsync[t] = new s[o]() : console.warn(`Lip-sync module for ${t} not found. Available modules:`, Object.keys(Qe));
5234
+ const s = Ke[n];
5235
+ s && s[o] ? this.lipsync[t] = new s[o]() : console.warn(`Lip-sync module for ${t} not found. Available modules:`, Object.keys(Ke));
5236
5236
  } catch (s) {
5237
5237
  console.warn(`Failed to load lip-sync module for ${t}:`, s);
5238
5238
  }
@@ -5861,7 +5861,7 @@ class Ze {
5861
5861
  }
5862
5862
  if (!this.workletLoaded)
5863
5863
  try {
5864
- const a = this.audioCtx.audioWorklet.addModule(vt.href), c = new Promise(
5864
+ const a = this.audioCtx.audioWorklet.addModule(Lt.href), c = new Promise(
5865
5865
  (l, u) => setTimeout(() => u(new Error("Worklet loading timed out")), 5e3)
5866
5866
  );
5867
5867
  await Promise.race([a, c]), this.workletLoaded = !0;
@@ -6099,7 +6099,7 @@ class Ze {
6099
6099
  */
6100
6100
  lookAtCamera(t) {
6101
6101
  let e;
6102
- if (this.speakTo && (e = new f.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), ke.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), Ce.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(ke, Ce).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) {
6102
+ if (this.speakTo && (e = new f.Vector3(), this.speakTo.objectLeftEye?.isObject3D ? (this.speakTo.armature.objectHead, this.speakTo.objectLeftEye.updateMatrixWorld(!0), this.speakTo.objectRightEye.updateMatrixWorld(!0), Te.setFromMatrixPosition(this.speakTo.objectLeftEye.matrixWorld), Ee.setFromMatrixPosition(this.speakTo.objectRightEye.matrixWorld), e.addVectors(Te, Ee).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) {
6103
6103
  if (this.avatar.hasOwnProperty("avatarIgnoreCamera")) {
6104
6104
  if (this.avatar.avatarIgnoreCamera) {
6105
6105
  this.lookAhead(t);
@@ -6112,12 +6112,12 @@ class Ze {
6112
6112
  this.lookAt(null, null, t);
6113
6113
  return;
6114
6114
  }
6115
- this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), ke.setFromMatrixPosition(this.objectLeftEye.matrixWorld), Ce.setFromMatrixPosition(this.objectRightEye.matrixWorld), ke.add(Ce).divideScalar(2), oe.copy(this.armature.quaternion), oe.multiply(this.poseTarget.props["Hips.quaternion"]), oe.multiply(this.poseTarget.props["Spine.quaternion"]), oe.multiply(this.poseTarget.props["Spine1.quaternion"]), oe.multiply(this.poseTarget.props["Spine2.quaternion"]), oe.multiply(this.poseTarget.props["Neck.quaternion"]), oe.multiply(this.poseTarget.props["Head.quaternion"]);
6116
- const n = new f.Vector3().subVectors(e, ke).normalize(), o = Math.atan2(n.x, n.z), s = Math.asin(-n.y);
6117
- _.set(s, o, 0, "YXZ");
6118
- const a = new f.Quaternion().setFromEuler(_), c = new f.Quaternion().copy(a).multiply(oe.clone().invert());
6119
- _.setFromQuaternion(c, "YXZ");
6120
- let l = _.x / (40 / 24) + 0.2, u = _.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, l)), d = Math.min(0.8, Math.max(-0.8, u)), h = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
6115
+ this.objectLeftEye.updateMatrixWorld(!0), this.objectRightEye.updateMatrixWorld(!0), Te.setFromMatrixPosition(this.objectLeftEye.matrixWorld), Ee.setFromMatrixPosition(this.objectRightEye.matrixWorld), Te.add(Ee).divideScalar(2), ie.copy(this.armature.quaternion), ie.multiply(this.poseTarget.props["Hips.quaternion"]), ie.multiply(this.poseTarget.props["Spine.quaternion"]), ie.multiply(this.poseTarget.props["Spine1.quaternion"]), ie.multiply(this.poseTarget.props["Spine2.quaternion"]), ie.multiply(this.poseTarget.props["Neck.quaternion"]), ie.multiply(this.poseTarget.props["Head.quaternion"]);
6116
+ const n = new f.Vector3().subVectors(e, Te).normalize(), o = Math.atan2(n.x, n.z), s = Math.asin(-n.y);
6117
+ q.set(s, o, 0, "YXZ");
6118
+ const a = new f.Quaternion().setFromEuler(q), c = new f.Quaternion().copy(a).multiply(ie.clone().invert());
6119
+ q.setFromQuaternion(c, "YXZ");
6120
+ let l = q.x / (40 / 24) + 0.2, u = q.y / (9 / 4), r = Math.min(0.6, Math.max(-0.3, l)), d = Math.min(0.8, Math.max(-0.8, u)), h = (Math.random() - 0.5) / 4, g = (Math.random() - 0.5) / 4;
6121
6121
  if (t) {
6122
6122
  let R = this.animQueue.findIndex((L) => L.template.name === "lookat");
6123
6123
  R !== -1 && this.animQueue.splice(R, 1);
@@ -6152,8 +6152,8 @@ class Ze {
6152
6152
  const s = new f.Vector3().setFromMatrixPosition(this.objectLeftEye.matrixWorld), i = new f.Vector3().setFromMatrixPosition(this.objectRightEye.matrixWorld), a = new f.Vector3().addVectors(s, i).divideScalar(2);
6153
6153
  a.project(this.camera);
6154
6154
  let c = (a.x + 1) / 2 * o.width + o.left, l = -(a.y - 1) / 2 * o.height + o.top;
6155
- t === null && (t = c), e === null && (e = l), oe.copy(this.armature.quaternion), oe.multiply(this.poseTarget.props["Hips.quaternion"]), oe.multiply(this.poseTarget.props["Spine.quaternion"]), oe.multiply(this.poseTarget.props["Spine1.quaternion"]), oe.multiply(this.poseTarget.props["Spine2.quaternion"]), oe.multiply(this.poseTarget.props["Neck.quaternion"]), oe.multiply(this.poseTarget.props["Head.quaternion"]), _.setFromQuaternion(oe);
6156
- let u = _.x / (40 / 24), r = _.y / (9 / 4), d = Math.min(0.4, Math.max(-0.4, this.camera.rotation.x)), h = Math.min(0.4, Math.max(-0.4, this.camera.rotation.y)), g = Math.max(window.innerWidth - c, c), R = Math.max(window.innerHeight - l, l), b = this.convertRange(e, [l - R, l + R], [-0.3, 0.6]) - u + d, L = this.convertRange(t, [c - g, c + g], [-0.8, 0.8]) - r + h;
6155
+ t === null && (t = c), e === null && (e = l), ie.copy(this.armature.quaternion), ie.multiply(this.poseTarget.props["Hips.quaternion"]), ie.multiply(this.poseTarget.props["Spine.quaternion"]), ie.multiply(this.poseTarget.props["Spine1.quaternion"]), ie.multiply(this.poseTarget.props["Spine2.quaternion"]), ie.multiply(this.poseTarget.props["Neck.quaternion"]), ie.multiply(this.poseTarget.props["Head.quaternion"]), q.setFromQuaternion(ie);
6156
+ let u = q.x / (40 / 24), r = q.y / (9 / 4), d = Math.min(0.4, Math.max(-0.4, this.camera.rotation.x)), h = Math.min(0.4, Math.max(-0.4, this.camera.rotation.y)), g = Math.max(window.innerWidth - c, c), R = Math.max(window.innerHeight - l, l), b = this.convertRange(e, [l - R, l + R], [-0.3, 0.6]) - u + d, L = this.convertRange(t, [c - g, c + g], [-0.8, 0.8]) - r + h;
6157
6157
  b = Math.min(0.6, Math.max(-0.3, b)), L = Math.min(0.8, Math.max(-0.8, L));
6158
6158
  let T = (Math.random() - 0.5) / 4, p = (Math.random() - 0.5) / 4;
6159
6159
  if (n) {
@@ -6384,7 +6384,7 @@ class Ze {
6384
6384
  } catch (h) {
6385
6385
  console.warn(`Could not verify file existence for ${t}, attempting to load anyway:`, h);
6386
6386
  }
6387
- const r = new je();
6387
+ const r = new qe();
6388
6388
  let d;
6389
6389
  try {
6390
6390
  d = await r.loadAsync(t, e);
@@ -6510,8 +6510,8 @@ class Ze {
6510
6510
  const x = y.name.replaceAll("mixamorig", "").split("."), S = x[0], H = x[1], I = b(S);
6511
6511
  if (!(I && (I === "LeftShoulder" || I === "RightShoulder") && (H === "quaternion" || H === "rotation")))
6512
6512
  if (I && H) {
6513
- const N = `${I}.${H}`, V = y.clone();
6514
- V.name = N, T.push(V), S !== I && R.set(S, I);
6513
+ const U = `${I}.${H}`, G = y.clone();
6514
+ G.name = U, T.push(G), S !== I && R.set(S, I);
6515
6515
  } else
6516
6516
  p.add(S), (S.toLowerCase().includes("arm") || S.toLowerCase().includes("hand") || S.toLowerCase().includes("shoulder")) && console.warn(`⚠️ Arm bone "${S}" could not be mapped to avatar skeleton`);
6517
6517
  }), T.length > 0 ? h = new f.AnimationClip(h.name, h.duration, T) : console.error("No tracks could be mapped! Animation may not work correctly.");
@@ -6567,7 +6567,7 @@ class Ze {
6567
6567
  let a = this.animQueue.find((c) => c.template.name === "pose");
6568
6568
  a && (a.ts[0] = this.animClock + n * 1e3 + 2e3), this.setPoseFromTemplate(i);
6569
6569
  } else {
6570
- let c = await new je().loadAsync(t, e);
6570
+ let c = await new qe().loadAsync(t, e);
6571
6571
  if (c && c.animations && c.animations[o]) {
6572
6572
  let l = c.animations[o];
6573
6573
  const u = {};
@@ -6669,7 +6669,7 @@ class Ze {
6669
6669
  const E = R[p].bone;
6670
6670
  E.matrixWorld.decompose(c, l, u), l.invert(), i.setFromMatrixPosition(g.matrixWorld), a.subVectors(i, c), a.applyQuaternion(l), a.normalize(), s.subVectors(e, c), s.applyQuaternion(l), s.normalize();
6671
6671
  let y = s.dot(a);
6672
- y > 1 ? y = 1 : y < -1 && (y = -1), y = Math.acos(y), !(y < 1e-5) && (R[p].minAngle !== void 0 && y < R[p].minAngle && (y = R[p].minAngle), R[p].maxAngle !== void 0 && y > R[p].maxAngle && (y = R[p].maxAngle), r.crossVectors(a, s), r.normalize(), oe.setFromAxisAngle(r, y), E.quaternion.multiply(oe), E.rotation.setFromVector3(d.setFromEuler(E.rotation).clamp(new f.Vector3(
6672
+ y > 1 ? y = 1 : y < -1 && (y = -1), y = Math.acos(y), !(y < 1e-5) && (R[p].minAngle !== void 0 && y < R[p].minAngle && (y = R[p].minAngle), R[p].maxAngle !== void 0 && y > R[p].maxAngle && (y = R[p].maxAngle), r.crossVectors(a, s), r.normalize(), ie.setFromAxisAngle(r, y), E.quaternion.multiply(ie), E.rotation.setFromVector3(d.setFromEuler(E.rotation).clamp(new f.Vector3(
6673
6673
  R[p].minx !== void 0 ? R[p].minx : -1 / 0,
6674
6674
  R[p].miny !== void 0 ? R[p].miny : -1 / 0,
6675
6675
  R[p].minz !== void 0 ? R[p].minz : -1 / 0
@@ -6692,7 +6692,7 @@ class Ze {
6692
6692
  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();
6693
6693
  }
6694
6694
  }
6695
- const ze = {
6695
+ const Pe = {
6696
6696
  apiKey: "sk_ace57ef3ef65a92b9d3bee2a00183b78ca790bc3e10964f2",
6697
6697
  // Replace with your actual API key (should start with sk_)
6698
6698
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
@@ -6712,7 +6712,7 @@ const ze = {
6712
6712
  josh: "VR6AewLTigWG4xSOukaG"
6713
6713
  // Male, American
6714
6714
  }
6715
- }, Ne = {
6715
+ }, Ge = {
6716
6716
  defaultVoice: "aura-2-thalia-en",
6717
6717
  // Thalia (Female, English)
6718
6718
  voices: {
@@ -6732,26 +6732,26 @@ const ze = {
6732
6732
  // Male, English - Powerful
6733
6733
  }
6734
6734
  };
6735
- function Ve() {
6735
+ function je() {
6736
6736
  return {
6737
6737
  service: "elevenlabs",
6738
- endpoint: ze.endpoint,
6739
- apiKey: ze.apiKey,
6740
- defaultVoice: ze.defaultVoice,
6741
- voices: ze.voices
6738
+ endpoint: Pe.endpoint,
6739
+ apiKey: Pe.apiKey,
6740
+ defaultVoice: Pe.defaultVoice,
6741
+ voices: Pe.voices
6742
6742
  };
6743
6743
  }
6744
- function Pt() {
6745
- const W = Ve(), t = [];
6746
- return Object.entries(W.voices).forEach(([e, n]) => {
6744
+ function Nt() {
6745
+ const V = je(), t = [];
6746
+ return Object.entries(V.voices).forEach(([e, n]) => {
6747
6747
  t.push({
6748
6748
  value: n,
6749
- label: `${e.charAt(0).toUpperCase() + e.slice(1)} (${W.service})`
6749
+ label: `${e.charAt(0).toUpperCase() + e.slice(1)} (${V.service})`
6750
6750
  });
6751
6751
  }), t;
6752
6752
  }
6753
- const Ke = Ue(({
6754
- avatarUrl: W = "/avatars/brunette.glb",
6753
+ const et = Ze(({
6754
+ avatarUrl: V = "/avatars/brunette.glb",
6755
6755
  avatarBody: t = "F",
6756
6756
  mood: e = "neutral",
6757
6757
  ttsLang: n = "en",
@@ -6772,41 +6772,41 @@ const Ke = Ue(({
6772
6772
  style: R = {},
6773
6773
  animations: b = {}
6774
6774
  }, L) => {
6775
- const T = G(null), p = G(null), P = G(l), E = G(null), y = G(null), F = G(!1), x = G({ remainingText: null, originalText: null, options: null }), S = G([]), H = G(0), [I, N] = ae(!0), [V, j] = ae(null), [Y, ue] = ae(!1), [le, ve] = ae(!1);
6776
- xe(() => {
6775
+ const T = W(null), p = W(null), P = W(l), E = W(null), y = W(null), F = W(!1), x = W({ remainingText: null, originalText: null, options: null }), S = W([]), H = W(0), [I, U] = ae(!0), [G, j] = ae(null), [Y, ue] = ae(!1), [le, ve] = ae(!1);
6776
+ fe(() => {
6777
6777
  F.current = le;
6778
- }, [le]), xe(() => {
6778
+ }, [le]), fe(() => {
6779
6779
  P.current = l;
6780
6780
  }, [l]);
6781
- const se = Ve(), Se = o || se.service;
6781
+ const se = je(), ze = o || se.service;
6782
6782
  let ee;
6783
- Se === "browser" ? ee = {
6783
+ ze === "browser" ? ee = {
6784
6784
  service: "browser",
6785
6785
  endpoint: "",
6786
6786
  apiKey: null,
6787
6787
  defaultVoice: "Google US English"
6788
- } : Se === "elevenlabs" ? ee = {
6788
+ } : ze === "elevenlabs" ? ee = {
6789
6789
  service: "elevenlabs",
6790
6790
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
6791
6791
  apiKey: i || se.apiKey,
6792
- defaultVoice: s || se.defaultVoice || ze.defaultVoice,
6793
- voices: se.voices || ze.voices
6794
- } : Se === "deepgram" ? ee = {
6792
+ defaultVoice: s || se.defaultVoice || Pe.defaultVoice,
6793
+ voices: se.voices || Pe.voices
6794
+ } : ze === "deepgram" ? ee = {
6795
6795
  service: "deepgram",
6796
6796
  endpoint: "https://api.deepgram.com/v1/speak",
6797
6797
  apiKey: i || se.apiKey,
6798
- defaultVoice: s || se.defaultVoice || Ne.defaultVoice,
6799
- voices: se.voices || Ne.voices
6798
+ defaultVoice: s || se.defaultVoice || Ge.defaultVoice,
6799
+ voices: se.voices || Ge.voices
6800
6800
  } : ee = {
6801
6801
  ...se,
6802
6802
  // Override API key if provided via props
6803
6803
  apiKey: i !== null ? i : se.apiKey
6804
6804
  };
6805
6805
  const v = {
6806
- url: W,
6806
+ url: V,
6807
6807
  body: t,
6808
6808
  avatarMood: e,
6809
- ttsLang: Se === "browser" ? "en-US" : n,
6809
+ ttsLang: ze === "browser" ? "en-US" : n,
6810
6810
  ttsVoice: s || ee.defaultVoice,
6811
6811
  lipsyncLang: "en",
6812
6812
  showFullAvatar: l,
@@ -6815,233 +6815,233 @@ const Ke = Ue(({
6815
6815
  }, A = {
6816
6816
  ttsEndpoint: ee.endpoint,
6817
6817
  ttsApikey: ee.apiKey,
6818
- ttsService: Se,
6818
+ ttsService: ze,
6819
6819
  lipsyncModules: ["en"],
6820
6820
  cameraView: u
6821
- }, M = U(async () => {
6821
+ }, M = D(async () => {
6822
6822
  if (!(!T.current || p.current))
6823
6823
  try {
6824
- if (N(!0), j(null), p.current = new Ze(T.current, A), p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1), b && Object.keys(b).length > 0 && (p.current.customAnimations = b), await p.current.showAvatar(v, (ne) => {
6825
- if (ne.lengthComputable) {
6826
- const ie = Math.min(100, Math.round(ne.loaded / ne.total * 100));
6827
- d(ie);
6824
+ if (U(!0), j(null), p.current = new Qe(T.current, A), p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1), b && Object.keys(b).length > 0 && (p.current.customAnimations = b), await p.current.showAvatar(v, (Q) => {
6825
+ if (Q.lengthComputable) {
6826
+ const oe = Math.min(100, Math.round(Q.loaded / Q.total * 100));
6827
+ d(oe);
6828
6828
  }
6829
- }), await new Promise((ne) => {
6830
- const ie = () => {
6831
- p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? ne() : setTimeout(ie, 100);
6829
+ }), await new Promise((Q) => {
6830
+ const oe = () => {
6831
+ p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? Q() : setTimeout(oe, 100);
6832
6832
  };
6833
- ie();
6833
+ oe();
6834
6834
  }), p.current && p.current.setShowFullAvatar)
6835
6835
  try {
6836
6836
  p.current.setShowFullAvatar(l);
6837
- } catch (ne) {
6838
- console.warn("Error setting full body mode on initialization:", ne);
6837
+ } catch (Q) {
6838
+ console.warn("Error setting full body mode on initialization:", Q);
6839
6839
  }
6840
- p.current && p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1, p.current.controls.update()), N(!1), ue(!0), r(p.current);
6840
+ p.current && p.current.controls && (p.current.controls.enableRotate = !1, p.current.controls.enableZoom = !1, p.current.controls.enablePan = !1, p.current.controls.enableDamping = !1, p.current.controls.update()), U(!1), ue(!0), r(p.current);
6841
6841
  const X = () => {
6842
6842
  document.visibilityState === "visible" ? p.current?.start() : p.current?.stop();
6843
6843
  };
6844
6844
  return document.addEventListener("visibilitychange", X), () => {
6845
6845
  document.removeEventListener("visibilitychange", X);
6846
6846
  };
6847
- } catch (k) {
6848
- console.error("Error initializing TalkingHead:", k), j(k.message || "Failed to initialize avatar"), N(!1), h(k);
6847
+ } catch (w) {
6848
+ console.error("Error initializing TalkingHead:", w), j(w.message || "Failed to initialize avatar"), U(!1), h(w);
6849
6849
  }
6850
- }, [W, t, e, n, o, s, i, l, a, c, u]);
6851
- xe(() => (M(), () => {
6850
+ }, [V, t, e, n, o, s, i, l, a, c, u]);
6851
+ fe(() => (M(), () => {
6852
6852
  p.current && (p.current.stop(), p.current.dispose(), p.current = null);
6853
- }), [M]), xe(() => {
6853
+ }), [M]), fe(() => {
6854
6854
  if (!T.current || !p.current) return;
6855
- const k = new ResizeObserver((ne) => {
6856
- for (const ie of ne)
6855
+ const w = new ResizeObserver((Q) => {
6856
+ for (const oe of Q)
6857
6857
  p.current && p.current.onResize && p.current.onResize();
6858
6858
  });
6859
- k.observe(T.current);
6859
+ w.observe(T.current);
6860
6860
  const X = () => {
6861
6861
  p.current && p.current.onResize && p.current.onResize();
6862
6862
  };
6863
6863
  return window.addEventListener("resize", X), () => {
6864
- k.disconnect(), window.removeEventListener("resize", X);
6864
+ w.disconnect(), window.removeEventListener("resize", X);
6865
6865
  };
6866
6866
  }, [Y]);
6867
- const B = U(async () => {
6867
+ const B = D(async () => {
6868
6868
  if (p.current && p.current.audioCtx)
6869
6869
  try {
6870
6870
  (p.current.audioCtx.state === "suspended" || p.current.audioCtx.state === "interrupted") && (await p.current.audioCtx.resume(), console.log("Audio context resumed"));
6871
- } catch (k) {
6872
- console.warn("Failed to resume audio context:", k);
6871
+ } catch (w) {
6872
+ console.warn("Failed to resume audio context:", w);
6873
6873
  }
6874
- }, []), Z = U(async (k, X = {}) => {
6874
+ }, []), Z = D(async (w, X = {}) => {
6875
6875
  if (p.current && Y)
6876
6876
  try {
6877
- y.current && (clearInterval(y.current), y.current = null), E.current = { text: k, options: X }, x.current = { remainingText: null, originalText: null, options: null };
6878
- const ne = /[!\.\?\n\p{Extended_Pictographic}]/ug, ie = k.split(ne).map((J) => J.trim()).filter((J) => J.length > 0);
6879
- S.current = ie, H.current = 0, ve(!1), F.current = !1, await B();
6880
- const ce = {
6877
+ y.current && (clearInterval(y.current), y.current = null), E.current = { text: w, options: X }, x.current = { remainingText: null, originalText: null, options: null };
6878
+ const Q = /[!\.\?\n\p{Extended_Pictographic}]/ug, oe = w.split(Q).map((_) => _.trim()).filter((_) => _.length > 0);
6879
+ S.current = oe, H.current = 0, ve(!1), F.current = !1, await B();
6880
+ const xe = {
6881
6881
  ...X,
6882
6882
  lipsyncLang: X.lipsyncLang || v.lipsyncLang || "en"
6883
6883
  };
6884
6884
  if (X.onSpeechEnd && p.current) {
6885
- const J = p.current;
6886
- let pe = null, He = 0;
6887
- const w = 1200;
6888
- let C = !1;
6885
+ const _ = p.current;
6886
+ let pe = null, Ie = 0;
6887
+ const be = 1200;
6888
+ let Le = !1;
6889
6889
  pe = setInterval(() => {
6890
- if (He++, F.current)
6890
+ if (Ie++, F.current)
6891
6891
  return;
6892
- if (He > w) {
6893
- if (pe && (clearInterval(pe), pe = null, y.current = null), !C && !F.current) {
6894
- C = !0;
6892
+ if (Ie > be) {
6893
+ if (pe && (clearInterval(pe), pe = null, y.current = null), !Le && !F.current) {
6894
+ Le = !0;
6895
6895
  try {
6896
6896
  X.onSpeechEnd();
6897
- } catch (ge) {
6898
- console.error("Error in onSpeechEnd callback (timeout):", ge);
6897
+ } catch (C) {
6898
+ console.error("Error in onSpeechEnd callback (timeout):", C);
6899
6899
  }
6900
6900
  }
6901
6901
  return;
6902
6902
  }
6903
- const D = !J.speechQueue || J.speechQueue.length === 0, Q = !J.audioPlaylist || J.audioPlaylist.length === 0;
6904
- J && J.isSpeaking === !1 && D && Q && J.isAudioPlaying === !1 && !C && !F.current && setTimeout(() => {
6905
- if (J && !F.current && J.isSpeaking === !1 && (!J.speechQueue || J.speechQueue.length === 0) && (!J.audioPlaylist || J.audioPlaylist.length === 0) && J.isAudioPlaying === !1 && !C && !F.current) {
6906
- C = !0, pe && (clearInterval(pe), pe = null, y.current = null);
6903
+ const Ae = !_.speechQueue || _.speechQueue.length === 0, Oe = !_.audioPlaylist || _.audioPlaylist.length === 0;
6904
+ _ && _.isSpeaking === !1 && Ae && Oe && _.isAudioPlaying === !1 && !Le && !F.current && setTimeout(() => {
6905
+ if (_ && !F.current && _.isSpeaking === !1 && (!_.speechQueue || _.speechQueue.length === 0) && (!_.audioPlaylist || _.audioPlaylist.length === 0) && _.isAudioPlaying === !1 && !Le && !F.current) {
6906
+ Le = !0, pe && (clearInterval(pe), pe = null, y.current = null);
6907
6907
  try {
6908
6908
  X.onSpeechEnd();
6909
- } catch (Xe) {
6910
- console.error("Error in onSpeechEnd callback:", Xe);
6909
+ } catch (N) {
6910
+ console.error("Error in onSpeechEnd callback:", N);
6911
6911
  }
6912
6912
  }
6913
6913
  }, 100);
6914
6914
  }, 100), y.current = pe;
6915
6915
  }
6916
- p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(k, ce)) : setTimeout(async () => {
6917
- await B(), p.current && p.current.lipsync && (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(k, ce));
6916
+ p.current.lipsync && Object.keys(p.current.lipsync).length > 0 ? (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(w, xe)) : setTimeout(async () => {
6917
+ await B(), p.current && p.current.lipsync && (p.current.setSlowdownRate && p.current.setSlowdownRate(1.05), p.current.speakText(w, xe));
6918
6918
  }, 100);
6919
- } catch (ne) {
6920
- console.error("Error speaking text:", ne), j(ne.message || "Failed to speak text");
6919
+ } catch (Q) {
6920
+ console.error("Error speaking text:", Q), j(Q.message || "Failed to speak text");
6921
6921
  }
6922
- }, [Y, B, v.lipsyncLang]), re = U(() => {
6922
+ }, [Y, B, v.lipsyncLang]), re = D(() => {
6923
6923
  p.current && (p.current.stopSpeaking(), p.current.setSlowdownRate && p.current.setSlowdownRate(1), E.current = null, ve(!1));
6924
- }, []), K = U(() => {
6924
+ }, []), ne = D(() => {
6925
6925
  if (p.current && p.current.pauseSpeaking) {
6926
- const k = p.current;
6927
- if (k.isSpeaking || k.audioPlaylist && k.audioPlaylist.length > 0 || k.speechQueue && k.speechQueue.length > 0) {
6926
+ const w = p.current;
6927
+ if (w.isSpeaking || w.audioPlaylist && w.audioPlaylist.length > 0 || w.speechQueue && w.speechQueue.length > 0) {
6928
6928
  y.current && (clearInterval(y.current), y.current = null);
6929
- let ne = "";
6929
+ let Q = "";
6930
6930
  if (E.current && S.current.length > 0) {
6931
- const ie = S.current.length, ce = k.speechQueue ? k.speechQueue.filter((w) => w && w.text && Array.isArray(w.text) && w.text.length > 0).length : 0, J = k.audioPlaylist && k.audioPlaylist.length > 0, pe = ce + (J ? 1 : 0), He = ie - pe;
6932
- if (pe > 0 && He < ie && (ne = S.current.slice(He).join(". ").trim(), !ne && ce > 0 && k.speechQueue)) {
6933
- const C = k.speechQueue.filter((D) => D && D.text && Array.isArray(D.text) && D.text.length > 0).map((D) => D.text.map((Q) => Q.word || "").filter((Q) => Q.length > 0).join(" ")).filter((D) => D.length > 0).join(" ");
6934
- C && C.trim() && (ne = C.trim());
6931
+ const oe = S.current.length, xe = w.speechQueue ? w.speechQueue.filter((be) => be && be.text && Array.isArray(be.text) && be.text.length > 0).length : 0, _ = w.audioPlaylist && w.audioPlaylist.length > 0, pe = xe + (_ ? 1 : 0), Ie = oe - pe;
6932
+ if (pe > 0 && Ie < oe && (Q = S.current.slice(Ie).join(". ").trim(), !Q && xe > 0 && w.speechQueue)) {
6933
+ const Le = w.speechQueue.filter((Ae) => Ae && Ae.text && Array.isArray(Ae.text) && Ae.text.length > 0).map((Ae) => Ae.text.map((Oe) => Oe.word || "").filter((Oe) => Oe.length > 0).join(" ")).filter((Ae) => Ae.length > 0).join(" ");
6934
+ Le && Le.trim() && (Q = Le.trim());
6935
6935
  }
6936
6936
  }
6937
6937
  E.current && (x.current = {
6938
- remainingText: ne || null,
6938
+ remainingText: Q || null,
6939
6939
  originalText: E.current.text,
6940
6940
  options: E.current.options
6941
- }), k.speechQueue && (k.speechQueue.length = 0), p.current.pauseSpeaking(), F.current = !0, ve(!0);
6941
+ }), w.speechQueue && (w.speechQueue.length = 0), p.current.pauseSpeaking(), F.current = !0, ve(!0);
6942
6942
  }
6943
6943
  }
6944
- }, []), te = U(async () => {
6944
+ }, []), J = D(async () => {
6945
6945
  if (!p.current || !le)
6946
6946
  return;
6947
- let k = "", X = {};
6947
+ let w = "", X = {};
6948
6948
  if (x.current && x.current.remainingText)
6949
- k = x.current.remainingText, X = x.current.options || {}, x.current = { remainingText: null, originalText: null, options: null };
6949
+ w = x.current.remainingText, X = x.current.options || {}, x.current = { remainingText: null, originalText: null, options: null };
6950
6950
  else if (E.current && E.current.text)
6951
- k = E.current.text, X = E.current.options || {};
6951
+ w = E.current.text, X = E.current.options || {};
6952
6952
  else {
6953
6953
  console.warn("Resume called but no paused speech found"), ve(!1), F.current = !1;
6954
6954
  return;
6955
6955
  }
6956
6956
  ve(!1), F.current = !1, await B();
6957
- const ne = {
6957
+ const Q = {
6958
6958
  ...X,
6959
6959
  lipsyncLang: X.lipsyncLang || v.lipsyncLang || "en"
6960
6960
  };
6961
6961
  try {
6962
- await Z(k, ne);
6963
- } catch (ie) {
6964
- console.error("Error resuming speech:", ie), ve(!1), F.current = !1;
6962
+ await Z(w, Q);
6963
+ } catch (oe) {
6964
+ console.error("Error resuming speech:", oe), ve(!1), F.current = !1;
6965
6965
  }
6966
- }, [B, le, Z, v]), be = U((k) => {
6967
- p.current && p.current.setMood(k);
6968
- }, []), Fe = U((k) => {
6969
- p.current && p.current.setSlowdownRate && p.current.setSlowdownRate(k);
6970
- }, []), Ge = U((k, X = !1) => {
6966
+ }, [B, le, Z, v]), me = D((w) => {
6967
+ p.current && p.current.setMood(w);
6968
+ }, []), Me = D((w) => {
6969
+ p.current && p.current.setSlowdownRate && p.current.setSlowdownRate(w);
6970
+ }, []), He = D((w, X = !1) => {
6971
6971
  if (p.current && p.current.playAnimation) {
6972
- if (b && b[k] && (k = b[k]), p.current.setShowFullAvatar)
6972
+ if (b && b[w] && (w = b[w]), p.current.setShowFullAvatar)
6973
6973
  try {
6974
6974
  p.current.setShowFullAvatar(P.current);
6975
- } catch (ie) {
6976
- console.warn("Error setting full body mode:", ie);
6975
+ } catch (oe) {
6976
+ console.warn("Error setting full body mode:", oe);
6977
6977
  }
6978
- if (k.includes("."))
6978
+ if (w.includes("."))
6979
6979
  try {
6980
- p.current.playAnimation(k, null, 10, 0, 0.01, X);
6981
- } catch (ie) {
6982
- console.warn(`Failed to play ${k}:`, ie);
6980
+ p.current.playAnimation(w, null, 10, 0, 0.01, X);
6981
+ } catch (oe) {
6982
+ console.warn(`Failed to play ${w}:`, oe);
6983
6983
  try {
6984
6984
  p.current.setBodyMovement("idle");
6985
- } catch (ce) {
6986
- console.warn("Fallback animation also failed:", ce);
6985
+ } catch (xe) {
6986
+ console.warn("Fallback animation also failed:", xe);
6987
6987
  }
6988
6988
  }
6989
6989
  else {
6990
- const ie = [".fbx", ".glb", ".gltf"];
6991
- let ce = !1;
6992
- for (const J of ie)
6990
+ const oe = [".fbx", ".glb", ".gltf"];
6991
+ let xe = !1;
6992
+ for (const _ of oe)
6993
6993
  try {
6994
- p.current.playAnimation(k + J, null, 10, 0, 0.01, X), ce = !0;
6994
+ p.current.playAnimation(w + _, null, 10, 0, 0.01, X), xe = !0;
6995
6995
  break;
6996
6996
  } catch {
6997
6997
  }
6998
- if (!ce) {
6999
- console.warn("Animation not found:", k);
6998
+ if (!xe) {
6999
+ console.warn("Animation not found:", w);
7000
7000
  try {
7001
7001
  p.current.setBodyMovement("idle");
7002
- } catch (J) {
7003
- console.warn("Fallback animation also failed:", J);
7002
+ } catch (_) {
7003
+ console.warn("Fallback animation also failed:", _);
7004
7004
  }
7005
7005
  }
7006
7006
  }
7007
7007
  }
7008
- }, [b]), Ee = U(() => {
7008
+ }, [b]), Ye = D(() => {
7009
7009
  p.current && p.current.onResize && p.current.onResize();
7010
7010
  }, []);
7011
- return We(L, () => ({
7011
+ return Xe(L, () => ({
7012
7012
  speakText: Z,
7013
7013
  stopSpeaking: re,
7014
- pauseSpeaking: K,
7015
- resumeSpeaking: te,
7014
+ pauseSpeaking: ne,
7015
+ resumeSpeaking: J,
7016
7016
  resumeAudioContext: B,
7017
- setMood: be,
7018
- setTimingAdjustment: Fe,
7019
- playAnimation: Ge,
7017
+ setMood: me,
7018
+ setTimingAdjustment: Me,
7019
+ playAnimation: He,
7020
7020
  isReady: Y,
7021
7021
  isPaused: le,
7022
7022
  talkingHead: p.current,
7023
- handleResize: Ee,
7024
- setBodyMovement: (k) => {
7023
+ handleResize: Ye,
7024
+ setBodyMovement: (w) => {
7025
7025
  if (p.current && p.current.setShowFullAvatar && p.current.setBodyMovement)
7026
7026
  try {
7027
- p.current.setShowFullAvatar(P.current), p.current.setBodyMovement(k);
7027
+ p.current.setShowFullAvatar(P.current), p.current.setBodyMovement(w);
7028
7028
  } catch (X) {
7029
7029
  console.warn("Error setting body movement:", X);
7030
7030
  }
7031
7031
  },
7032
- setMovementIntensity: (k) => p.current?.setMovementIntensity(k),
7032
+ setMovementIntensity: (w) => p.current?.setMovementIntensity(w),
7033
7033
  playRandomDance: () => {
7034
7034
  if (p.current && p.current.setShowFullAvatar && p.current.playRandomDance)
7035
7035
  try {
7036
7036
  p.current.setShowFullAvatar(P.current), p.current.playRandomDance();
7037
- } catch (k) {
7038
- console.warn("Error playing random dance:", k);
7037
+ } catch (w) {
7038
+ console.warn("Error playing random dance:", w);
7039
7039
  }
7040
7040
  },
7041
- playReaction: (k) => {
7041
+ playReaction: (w) => {
7042
7042
  if (p.current && p.current.setShowFullAvatar && p.current.playReaction)
7043
7043
  try {
7044
- p.current.setShowFullAvatar(P.current), p.current.playReaction(k);
7044
+ p.current.setShowFullAvatar(P.current), p.current.playReaction(w);
7045
7045
  } catch (X) {
7046
7046
  console.warn("Error playing reaction:", X);
7047
7047
  }
@@ -7050,14 +7050,14 @@ const Ke = Ue(({
7050
7050
  if (p.current && p.current.setShowFullAvatar && p.current.playCelebration)
7051
7051
  try {
7052
7052
  p.current.setShowFullAvatar(P.current), p.current.playCelebration();
7053
- } catch (k) {
7054
- console.warn("Error playing celebration:", k);
7053
+ } catch (w) {
7054
+ console.warn("Error playing celebration:", w);
7055
7055
  }
7056
7056
  },
7057
- setShowFullAvatar: (k) => {
7057
+ setShowFullAvatar: (w) => {
7058
7058
  if (p.current && p.current.setShowFullAvatar)
7059
7059
  try {
7060
- P.current = k, p.current.setShowFullAvatar(k);
7060
+ P.current = w, p.current.setShowFullAvatar(w);
7061
7061
  } catch (X) {
7062
7062
  console.warn("Error setting showFullAvatar:", X);
7063
7063
  }
@@ -7066,19 +7066,19 @@ const Ke = Ue(({
7066
7066
  if (p.current && p.current.lockAvatarPosition)
7067
7067
  try {
7068
7068
  p.current.lockAvatarPosition();
7069
- } catch (k) {
7070
- console.warn("Error locking avatar position:", k);
7069
+ } catch (w) {
7070
+ console.warn("Error locking avatar position:", w);
7071
7071
  }
7072
7072
  },
7073
7073
  unlockAvatarPosition: () => {
7074
7074
  if (p.current && p.current.unlockAvatarPosition)
7075
7075
  try {
7076
7076
  p.current.unlockAvatarPosition();
7077
- } catch (k) {
7078
- console.warn("Error unlocking avatar position:", k);
7077
+ } catch (w) {
7078
+ console.warn("Error unlocking avatar position:", w);
7079
7079
  }
7080
7080
  }
7081
- })), /* @__PURE__ */ Ie(
7081
+ })), /* @__PURE__ */ ke(
7082
7082
  "div",
7083
7083
  {
7084
7084
  className: `talking-head-avatar ${g}`,
@@ -7110,7 +7110,7 @@ const Ke = Ue(({
7110
7110
  fontSize: "18px",
7111
7111
  zIndex: 10
7112
7112
  }, children: "Loading avatar..." }),
7113
- V && /* @__PURE__ */ $("div", { className: "error-overlay", style: {
7113
+ G && /* @__PURE__ */ $("div", { className: "error-overlay", style: {
7114
7114
  position: "absolute",
7115
7115
  top: "50%",
7116
7116
  left: "50%",
@@ -7121,14 +7121,14 @@ const Ke = Ue(({
7121
7121
  zIndex: 10,
7122
7122
  padding: "20px",
7123
7123
  borderRadius: "8px"
7124
- }, children: V })
7124
+ }, children: G })
7125
7125
  ]
7126
7126
  }
7127
7127
  );
7128
7128
  });
7129
- Ke.displayName = "TalkingHeadAvatar";
7130
- const At = Ue(({
7131
- text: W = "Hello! I'm a talking avatar. How are you today?",
7129
+ et.displayName = "TalkingHeadAvatar";
7130
+ const kt = Ze(({
7131
+ text: V = "Hello! I'm a talking avatar. How are you today?",
7132
7132
  onLoading: t = () => {
7133
7133
  },
7134
7134
  onError: e = () => {
@@ -7139,7 +7139,7 @@ const At = Ue(({
7139
7139
  style: s = {},
7140
7140
  avatarConfig: i = {}
7141
7141
  }, a) => {
7142
- const c = G(null), l = G(null), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae(!1), b = Ve(), L = i.ttsService || b.service, T = L === "browser" ? {
7142
+ const c = W(null), l = W(null), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae(!1), b = je(), L = i.ttsService || b.service, T = L === "browser" ? {
7143
7143
  endpoint: "",
7144
7144
  apiKey: null,
7145
7145
  defaultVoice: "Google US English"
@@ -7169,63 +7169,63 @@ const At = Ue(({
7169
7169
  ttsService: L,
7170
7170
  lipsyncModules: ["en"],
7171
7171
  cameraView: "upper"
7172
- }, E = U(async () => {
7172
+ }, E = D(async () => {
7173
7173
  if (!(!c.current || l.current))
7174
7174
  try {
7175
- if (r(!0), h(null), l.current = new Ze(c.current, P), await l.current.showAvatar(p, (V) => {
7176
- if (V.lengthComputable) {
7177
- const j = Math.min(100, Math.round(V.loaded / V.total * 100));
7175
+ if (r(!0), h(null), l.current = new Qe(c.current, P), await l.current.showAvatar(p, (G) => {
7176
+ if (G.lengthComputable) {
7177
+ const j = Math.min(100, Math.round(G.loaded / G.total * 100));
7178
7178
  t(j);
7179
7179
  }
7180
7180
  }), l.current.morphs && l.current.morphs.length > 0) {
7181
- const V = l.current.morphs[0].morphTargetDictionary;
7182
- console.log("Available morph targets:", Object.keys(V));
7183
- const j = Object.keys(V).filter((Y) => Y.startsWith("viseme_"));
7181
+ const G = l.current.morphs[0].morphTargetDictionary;
7182
+ console.log("Available morph targets:", Object.keys(G));
7183
+ const j = Object.keys(G).filter((Y) => Y.startsWith("viseme_"));
7184
7184
  console.log("Viseme morph targets found:", j), j.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"));
7185
7185
  }
7186
- if (await new Promise((V) => {
7186
+ if (await new Promise((G) => {
7187
7187
  const j = () => {
7188
- l.current.lipsync && Object.keys(l.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(l.current.lipsync)), V()) : (console.log("Waiting for lip-sync modules to load..."), setTimeout(j, 100));
7188
+ l.current.lipsync && Object.keys(l.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(l.current.lipsync)), G()) : (console.log("Waiting for lip-sync modules to load..."), setTimeout(j, 100));
7189
7189
  };
7190
7190
  j();
7191
7191
  }), l.current && l.current.setShowFullAvatar)
7192
7192
  try {
7193
7193
  l.current.setShowFullAvatar(!0), console.log("Avatar initialized in full body mode");
7194
- } catch (V) {
7195
- console.warn("Error setting full body mode on initialization:", V);
7194
+ } catch (G) {
7195
+ console.warn("Error setting full body mode on initialization:", G);
7196
7196
  }
7197
7197
  r(!1), R(!0), n(l.current);
7198
- const N = () => {
7198
+ const U = () => {
7199
7199
  document.visibilityState === "visible" ? l.current?.start() : l.current?.stop();
7200
7200
  };
7201
- return document.addEventListener("visibilitychange", N), () => {
7202
- document.removeEventListener("visibilitychange", N);
7201
+ return document.addEventListener("visibilitychange", U), () => {
7202
+ document.removeEventListener("visibilitychange", U);
7203
7203
  };
7204
7204
  } catch (I) {
7205
7205
  console.error("Error initializing TalkingHead:", I), h(I.message || "Failed to initialize avatar"), r(!1), e(I);
7206
7206
  }
7207
7207
  }, []);
7208
- xe(() => (E(), () => {
7208
+ fe(() => (E(), () => {
7209
7209
  l.current && (l.current.stop(), l.current.dispose(), l.current = null);
7210
7210
  }), [E]);
7211
- const y = U((I) => {
7211
+ const y = D((I) => {
7212
7212
  if (l.current && g)
7213
7213
  try {
7214
7214
  console.log("Speaking text:", I), console.log("Avatar config:", p), console.log("TalkingHead instance:", l.current), l.current.lipsync && Object.keys(l.current.lipsync).length > 0 ? (console.log("Lip-sync modules loaded:", Object.keys(l.current.lipsync)), l.current.setSlowdownRate && (l.current.setSlowdownRate(1.05), console.log("Applied timing adjustment for better lip-sync")), l.current.speakText(I)) : (console.warn("Lip-sync modules not ready, waiting..."), setTimeout(() => {
7215
7215
  l.current && l.current.lipsync ? (console.log("Lip-sync now ready, speaking..."), l.current.setSlowdownRate && (l.current.setSlowdownRate(1.05), console.log("Applied timing adjustment for better lip-sync")), l.current.speakText(I)) : console.error("Lip-sync still not ready after waiting");
7216
7216
  }, 500));
7217
- } catch (N) {
7218
- console.error("Error speaking text:", N), h(N.message || "Failed to speak text");
7217
+ } catch (U) {
7218
+ console.error("Error speaking text:", U), h(U.message || "Failed to speak text");
7219
7219
  }
7220
7220
  else
7221
7221
  console.warn("Avatar not ready for speaking. isReady:", g, "talkingHeadRef:", !!l.current);
7222
- }, [g, p]), F = U(() => {
7222
+ }, [g, p]), F = D(() => {
7223
7223
  l.current && (l.current.stopSpeaking(), l.current.setSlowdownRate && (l.current.setSlowdownRate(1), console.log("Reset timing to normal")));
7224
- }, []), x = U((I) => {
7224
+ }, []), x = D((I) => {
7225
7225
  l.current && l.current.setMood(I);
7226
- }, []), S = U((I) => {
7226
+ }, []), S = D((I) => {
7227
7227
  l.current && l.current.setSlowdownRate && (l.current.setSlowdownRate(I), console.log("Timing adjustment set to:", I));
7228
- }, []), H = U((I, N = !1) => {
7228
+ }, []), H = D((I, U = !1) => {
7229
7229
  if (l.current && l.current.playAnimation) {
7230
7230
  if (l.current.setShowFullAvatar)
7231
7231
  try {
@@ -7235,7 +7235,7 @@ const At = Ue(({
7235
7235
  }
7236
7236
  if (I.includes("."))
7237
7237
  try {
7238
- l.current.playAnimation(I, null, 10, 0, 0.01, N), console.log("Playing animation:", I);
7238
+ l.current.playAnimation(I, null, 10, 0, 0.01, U), console.log("Playing animation:", I);
7239
7239
  } catch (j) {
7240
7240
  console.log(`Failed to play ${I}:`, j);
7241
7241
  try {
@@ -7249,7 +7249,7 @@ const At = Ue(({
7249
7249
  let Y = !1;
7250
7250
  for (const ue of j)
7251
7251
  try {
7252
- l.current.playAnimation(I + ue, null, 10, 0, 0.01, N), console.log("Playing animation:", I + ue), Y = !0;
7252
+ l.current.playAnimation(I + ue, null, 10, 0, 0.01, U), console.log("Playing animation:", I + ue), Y = !0;
7253
7253
  break;
7254
7254
  } catch {
7255
7255
  console.log(`Failed to play ${I}${ue}, trying next format...`);
@@ -7266,7 +7266,7 @@ const At = Ue(({
7266
7266
  } else
7267
7267
  console.warn("Animation system not available or animation not found:", I);
7268
7268
  }, []);
7269
- return We(a, () => ({
7269
+ return Xe(a, () => ({
7270
7270
  speakText: y,
7271
7271
  stopSpeaking: F,
7272
7272
  setMood: x,
@@ -7278,8 +7278,8 @@ const At = Ue(({
7278
7278
  if (l.current && l.current.setShowFullAvatar && l.current.setBodyMovement)
7279
7279
  try {
7280
7280
  l.current.setShowFullAvatar(!0), l.current.setBodyMovement(I), console.log("Body movement set with full body mode:", I);
7281
- } catch (N) {
7282
- console.warn("Error setting body movement:", N);
7281
+ } catch (U) {
7282
+ console.warn("Error setting body movement:", U);
7283
7283
  }
7284
7284
  },
7285
7285
  setMovementIntensity: (I) => l.current?.setMovementIntensity(I),
@@ -7295,8 +7295,8 @@ const At = Ue(({
7295
7295
  if (l.current && l.current.setShowFullAvatar && l.current.playReaction)
7296
7296
  try {
7297
7297
  l.current.setShowFullAvatar(!0), l.current.playReaction(I), console.log("Reaction played with full body mode:", I);
7298
- } catch (N) {
7299
- console.warn("Error playing reaction:", N);
7298
+ } catch (U) {
7299
+ console.warn("Error playing reaction:", U);
7300
7300
  }
7301
7301
  },
7302
7302
  playCelebration: () => {
@@ -7311,8 +7311,8 @@ const At = Ue(({
7311
7311
  if (l.current && l.current.setShowFullAvatar)
7312
7312
  try {
7313
7313
  l.current.setShowFullAvatar(I), console.log("Show full avatar set to:", I);
7314
- } catch (N) {
7315
- console.warn("Error setting showFullAvatar:", N);
7314
+ } catch (U) {
7315
+ console.warn("Error setting showFullAvatar:", U);
7316
7316
  }
7317
7317
  },
7318
7318
  lockAvatarPosition: () => {
@@ -7331,7 +7331,7 @@ const At = Ue(({
7331
7331
  console.warn("Error unlocking avatar position:", I);
7332
7332
  }
7333
7333
  }
7334
- })), /* @__PURE__ */ Ie("div", { className: `talking-head-container ${o}`, style: s, children: [
7334
+ })), /* @__PURE__ */ ke("div", { className: `talking-head-container ${o}`, style: s, children: [
7335
7335
  /* @__PURE__ */ $(
7336
7336
  "div",
7337
7337
  {
@@ -7367,10 +7367,10 @@ const At = Ue(({
7367
7367
  }, children: d })
7368
7368
  ] });
7369
7369
  });
7370
- At.displayName = "TalkingHeadComponent";
7371
- async function Me(W) {
7370
+ kt.displayName = "TalkingHeadComponent";
7371
+ async function De(V) {
7372
7372
  try {
7373
- const t = await fetch(W);
7373
+ const t = await fetch(V);
7374
7374
  if (!t.ok)
7375
7375
  throw new Error(`Failed to fetch manifest: ${t.status} ${t.statusText}`);
7376
7376
  return (await t.json()).animations || {};
@@ -7378,8 +7378,8 @@ async function Me(W) {
7378
7378
  return console.error("Failed to load animation manifest:", t), {};
7379
7379
  }
7380
7380
  }
7381
- async function Lt(W, t = "F") {
7382
- const e = [], n = W.replace(/\/$/, "");
7381
+ async function wt(V, t = "F") {
7382
+ const e = [], n = V.replace(/\/$/, "");
7383
7383
  try {
7384
7384
  const s = [
7385
7385
  `${n}/.list.json`,
@@ -7417,19 +7417,19 @@ async function Lt(W, t = "F") {
7417
7417
  }
7418
7418
  return e.length > 0, e;
7419
7419
  }
7420
- async function _e(W, t = "F") {
7420
+ async function $e(V, t = "F") {
7421
7421
  const e = {};
7422
- for (const [n, o] of Object.entries(W))
7422
+ for (const [n, o] of Object.entries(V))
7423
7423
  try {
7424
- const s = await Lt(o, t);
7424
+ const s = await wt(o, t);
7425
7425
  s.length > 0 && (e[n] = s);
7426
7426
  } catch (s) {
7427
7427
  console.error(`❌ Failed to auto-load animations from ${o}:`, s);
7428
7428
  }
7429
7429
  return e;
7430
7430
  }
7431
- const St = Ue(({
7432
- text: W = null,
7431
+ const Ct = Ze(({
7432
+ text: V = null,
7433
7433
  avatarUrl: t = "/avatars/brunette.glb",
7434
7434
  avatarBody: e = "F",
7435
7435
  mood: n = "neutral",
@@ -7458,21 +7458,21 @@ const St = Ue(({
7458
7458
  // e.g., "idle" - will randomly select from this group when idle
7459
7459
  autoSpeak: E = !1
7460
7460
  }, y) => {
7461
- const F = G(null), x = G(null), S = G(u), H = G(null), I = G(null), N = G(!1), V = G({ remainingText: null, originalText: null, options: null }), j = G([]), [Y, ue] = ae(!0), [le, ve] = ae(null), [se, Se] = ae(!1), [ee, v] = ae(!1), [A, M] = ae(T), B = G(null), Z = G(!1), re = G(null);
7462
- xe(() => {
7463
- N.current = ee;
7464
- }, [ee]), xe(() => {
7461
+ const F = W(null), x = W(null), S = W(u), H = W(null), I = W(null), U = W(!1), G = W({ remainingText: null, originalText: null, options: null }), j = W([]), [Y, ue] = ae(!0), [le, ve] = ae(null), [se, ze] = ae(!1), [ee, v] = ae(!1), [A, M] = ae(T), B = W(null), Z = W(!1), re = W(null), ne = W([]), J = W([]);
7462
+ fe(() => {
7463
+ U.current = ee;
7464
+ }, [ee]), fe(() => {
7465
7465
  (async () => {
7466
7466
  if (T.manifest && T.auto)
7467
7467
  try {
7468
- const C = await Me(T.manifest);
7468
+ const C = await De(T.manifest);
7469
7469
  M(C);
7470
7470
  return;
7471
7471
  } catch {
7472
7472
  }
7473
7473
  if (T.manifest && !T.auto)
7474
7474
  try {
7475
- const C = await Me(T.manifest);
7475
+ const C = await De(T.manifest);
7476
7476
  M(C);
7477
7477
  } catch (C) {
7478
7478
  console.error("Failed to load animation manifest:", C), M(T);
@@ -7482,48 +7482,48 @@ const St = Ue(({
7482
7482
  let C = null;
7483
7483
  if (T.manifest)
7484
7484
  try {
7485
- C = await Me(T.manifest);
7485
+ C = await De(T.manifest);
7486
7486
  } catch {
7487
7487
  }
7488
7488
  if (typeof T.auto == "string") {
7489
- const D = T.auto, Q = {
7490
- talking: `${D}/talking`,
7491
- idle: `${D}/idle`
7492
- }, q = e === "M" ? "male" : "female";
7493
- Q[`${q}_talking`] = `${D}/${q}/talking`, Q[`${q}_idle`] = `${D}/${q}/idle`, Q.shared_talking = `${D}/shared/talking`, Q.shared_idle = `${D}/shared/idle`;
7494
- const ge = await _e(Q, e);
7495
- if (!Object.values(ge).some((he) => Array.isArray(he) && he.length > 0) && C) {
7489
+ const N = T.auto, te = {
7490
+ talking: `${N}/talking`,
7491
+ idle: `${N}/idle`
7492
+ }, K = e === "M" ? "male" : "female";
7493
+ te[`${K}_talking`] = `${N}/${K}/talking`, te[`${K}_idle`] = `${N}/${K}/idle`, te.shared_talking = `${N}/shared/talking`, te.shared_idle = `${N}/shared/idle`;
7494
+ const Se = await $e(te, e);
7495
+ if (!Object.values(Se).some((ce) => Array.isArray(ce) && ce.length > 0) && C) {
7496
7496
  M(C);
7497
7497
  return;
7498
7498
  }
7499
- const ye = {
7499
+ const ge = {
7500
7500
  _genderSpecific: {
7501
- [q]: {},
7501
+ [K]: {},
7502
7502
  shared: {}
7503
7503
  }
7504
7504
  };
7505
- Object.entries(ge).forEach(([he, we]) => {
7506
- if (he.includes("_")) {
7507
- const [Pe, ...$e] = he.split("_"), Te = $e.join("_");
7508
- Pe === "shared" ? (ye._genderSpecific.shared[Te] || (ye._genderSpecific.shared[Te] = []), ye._genderSpecific.shared[Te].push(...we)) : Pe === q && (ye._genderSpecific[q][Te] || (ye._genderSpecific[q][Te] = []), ye._genderSpecific[q][Te].push(...we));
7505
+ Object.entries(Se).forEach(([ce, Fe]) => {
7506
+ if (ce.includes("_")) {
7507
+ const [Ne, ...nt] = ce.split("_"), Be = nt.join("_");
7508
+ Ne === "shared" ? (ge._genderSpecific.shared[Be] || (ge._genderSpecific.shared[Be] = []), ge._genderSpecific.shared[Be].push(...Fe)) : Ne === K && (ge._genderSpecific[K][Be] || (ge._genderSpecific[K][Be] = []), ge._genderSpecific[K][Be].push(...Fe));
7509
7509
  } else
7510
- ye[he] = we;
7511
- }), C && (C._genderSpecific && Object.keys(C._genderSpecific).forEach((he) => {
7512
- ye._genderSpecific[he] || (ye._genderSpecific[he] = {}), Object.entries(C._genderSpecific[he]).forEach(([we, Pe]) => {
7513
- ye._genderSpecific[he][we] || (ye._genderSpecific[he][we] = Pe);
7510
+ ge[ce] = Fe;
7511
+ }), C && (C._genderSpecific && Object.keys(C._genderSpecific).forEach((ce) => {
7512
+ ge._genderSpecific[ce] || (ge._genderSpecific[ce] = {}), Object.entries(C._genderSpecific[ce]).forEach(([Fe, Ne]) => {
7513
+ ge._genderSpecific[ce][Fe] || (ge._genderSpecific[ce][Fe] = Ne);
7514
7514
  });
7515
- }), Object.entries(C).forEach(([he, we]) => {
7516
- he !== "_genderSpecific" && !ye[he] && (ye[he] = we);
7517
- })), M(ye);
7515
+ }), Object.entries(C).forEach(([ce, Fe]) => {
7516
+ ce !== "_genderSpecific" && !ge[ce] && (ge[ce] = Fe);
7517
+ })), M(ge);
7518
7518
  } else if (typeof T.auto == "object") {
7519
- const D = await _e(T.auto, e), Q = Object.values(D).some((q) => Array.isArray(q) && q.length > 0);
7520
- M(!Q && C ? C : D);
7519
+ const N = await $e(T.auto, e), te = Object.values(N).some((K) => Array.isArray(K) && K.length > 0);
7520
+ M(!te && C ? C : N);
7521
7521
  }
7522
7522
  } catch (C) {
7523
7523
  if (console.error("Failed to auto-discover animations:", C), T.manifest)
7524
7524
  try {
7525
- const D = await Me(T.manifest);
7526
- M(D);
7525
+ const N = await De(T.manifest);
7526
+ M(N);
7527
7527
  } catch {
7528
7528
  M(T);
7529
7529
  }
@@ -7533,198 +7533,208 @@ const St = Ue(({
7533
7533
  else
7534
7534
  M(T);
7535
7535
  })();
7536
- }, [T, e]), xe(() => {
7536
+ }, [T, e]), fe(() => {
7537
7537
  S.current = u;
7538
7538
  }, [u]);
7539
- const K = Ve(), te = s || K.service;
7540
- let be;
7541
- te === "browser" ? be = {
7539
+ const me = je(), Me = s || me.service;
7540
+ let He;
7541
+ Me === "browser" ? He = {
7542
7542
  service: "browser",
7543
7543
  endpoint: "",
7544
7544
  apiKey: null,
7545
7545
  defaultVoice: "Google US English"
7546
- } : te === "elevenlabs" ? be = {
7546
+ } : Me === "elevenlabs" ? He = {
7547
7547
  service: "elevenlabs",
7548
7548
  endpoint: "https://api.elevenlabs.io/v1/text-to-speech",
7549
- apiKey: a || K.apiKey,
7550
- defaultVoice: i || K.defaultVoice || ze.defaultVoice,
7551
- voices: K.voices || ze.voices
7552
- } : te === "deepgram" ? be = {
7549
+ apiKey: a || me.apiKey,
7550
+ defaultVoice: i || me.defaultVoice || Pe.defaultVoice,
7551
+ voices: me.voices || Pe.voices
7552
+ } : Me === "deepgram" ? He = {
7553
7553
  service: "deepgram",
7554
7554
  endpoint: "https://api.deepgram.com/v1/speak",
7555
- apiKey: a || K.apiKey,
7556
- defaultVoice: i || K.defaultVoice || Ne.defaultVoice,
7557
- voices: K.voices || Ne.voices
7558
- } : be = {
7559
- ...K,
7560
- apiKey: a !== null ? a : K.apiKey
7555
+ apiKey: a || me.apiKey,
7556
+ defaultVoice: i || me.defaultVoice || Ge.defaultVoice,
7557
+ voices: me.voices || Ge.voices
7558
+ } : He = {
7559
+ ...me,
7560
+ apiKey: a !== null ? a : me.apiKey
7561
7561
  };
7562
- const Fe = {
7562
+ const Ye = {
7563
7563
  url: t,
7564
7564
  body: e,
7565
7565
  avatarMood: n,
7566
- ttsLang: te === "browser" ? "en-US" : o,
7567
- ttsVoice: i || be.defaultVoice,
7566
+ ttsLang: Me === "browser" ? "en-US" : o,
7567
+ ttsVoice: i || He.defaultVoice,
7568
7568
  lipsyncLang: "en",
7569
7569
  showFullAvatar: u,
7570
7570
  bodyMovement: c,
7571
7571
  movementIntensity: l
7572
- }, Ge = {
7573
- ttsEndpoint: be.endpoint,
7574
- ttsApikey: be.apiKey,
7575
- ttsService: te,
7572
+ }, w = {
7573
+ ttsEndpoint: He.endpoint,
7574
+ ttsApikey: He.apiKey,
7575
+ ttsService: Me,
7576
7576
  lipsyncModules: ["en"],
7577
7577
  cameraView: r
7578
- }, Ee = U(async () => {
7578
+ }, X = D(async () => {
7579
7579
  if (!(!F.current || x.current))
7580
7580
  try {
7581
- ue(!0), ve(null), x.current = new Ze(F.current, Ge), await x.current.showAvatar(Fe, (C) => {
7581
+ ue(!0), ve(null), x.current = new Qe(F.current, w), await x.current.showAvatar(Ye, (C) => {
7582
7582
  if (C.lengthComputable) {
7583
- const D = Math.min(100, Math.round(C.loaded / C.total * 100));
7584
- h(D);
7583
+ const N = Math.min(100, Math.round(C.loaded / C.total * 100));
7584
+ h(N);
7585
7585
  }
7586
- }), ue(!1), Se(!0), d(x.current);
7587
- const w = () => {
7586
+ }), ue(!1), ze(!0), d(x.current);
7587
+ const k = () => {
7588
7588
  document.visibilityState === "visible" ? x.current?.start() : x.current?.stop();
7589
7589
  };
7590
- return document.addEventListener("visibilitychange", w), () => {
7591
- document.removeEventListener("visibilitychange", w);
7590
+ return document.addEventListener("visibilitychange", k), () => {
7591
+ document.removeEventListener("visibilitychange", k);
7592
7592
  };
7593
- } catch (w) {
7594
- console.error("Error initializing TalkingHead:", w), ve(w.message || "Failed to initialize avatar"), ue(!1), g(w);
7593
+ } catch (k) {
7594
+ console.error("Error initializing TalkingHead:", k), ve(k.message || "Failed to initialize avatar"), ue(!1), g(k);
7595
7595
  }
7596
7596
  }, []);
7597
- xe(() => (Ee(), () => {
7597
+ fe(() => (X(), () => {
7598
7598
  x.current && (x.current.stop(), x.current.dispose(), x.current = null);
7599
- }), [Ee]);
7600
- const k = U(async () => {
7599
+ }), [X]);
7600
+ const Q = D(async () => {
7601
7601
  if (x.current)
7602
7602
  try {
7603
- const w = x.current.audioCtx || x.current.audioContext;
7604
- w && (w.state === "suspended" || w.state === "interrupted") && await w.resume();
7605
- } catch (w) {
7606
- console.warn("Failed to resume audio context:", w);
7603
+ const k = x.current.audioCtx || x.current.audioContext;
7604
+ k && (k.state === "suspended" || k.state === "interrupted") && await k.resume();
7605
+ } catch (k) {
7606
+ console.warn("Failed to resume audio context:", k);
7607
7607
  }
7608
- }, []), X = U((w) => {
7608
+ }, []), oe = D((k) => {
7609
7609
  if (!A)
7610
- return null;
7610
+ return [];
7611
7611
  let C = null;
7612
7612
  if (A._genderSpecific) {
7613
- const Q = (e?.toUpperCase() || "F") === "M" ? "male" : "female", q = A._genderSpecific[Q];
7614
- q && q[w] ? C = q[w] : A._genderSpecific.shared && A._genderSpecific.shared[w] && (C = A._genderSpecific.shared[w]);
7613
+ const te = (e?.toUpperCase() || "F") === "M" ? "male" : "female", K = A._genderSpecific[te];
7614
+ K && K[k] ? C = K[k] : A._genderSpecific.shared && A._genderSpecific.shared[k] && (C = A._genderSpecific.shared[k]);
7615
7615
  }
7616
- if (!C && A[w] && (C = A[w]), !C)
7617
- return null;
7618
- if (Array.isArray(C) && C.length > 0) {
7619
- const D = Math.floor(Math.random() * C.length);
7620
- return C[D];
7616
+ return !C && A[k] && (C = A[k]), C ? Array.isArray(C) ? [...C] : typeof C == "string" ? [C] : [] : [];
7617
+ }, [A, e]), xe = D((k) => {
7618
+ const C = [...k];
7619
+ for (let N = C.length - 1; N > 0; N--) {
7620
+ const te = Math.floor(Math.random() * (N + 1));
7621
+ [C[N], C[te]] = [C[te], C[N]];
7622
+ }
7623
+ return C;
7624
+ }, []), _ = D((k) => {
7625
+ if (J.current.length === 0) {
7626
+ const N = oe(k);
7627
+ if (N.length === 0)
7628
+ return null;
7629
+ J.current = xe(N), ne.current = [];
7621
7630
  }
7622
- return typeof C == "string" ? C : null;
7623
- }, [A, e]), ne = U((w) => w ? w.split("/").pop().replace(".fbx", "").replace(/[-_]/g, " ") : "Unknown", []), ie = U((w, C = !1, D = null) => {
7631
+ const C = J.current.shift();
7632
+ return ne.current.push(C), C;
7633
+ }, [oe, xe]), pe = D((k) => k ? k.split("/").pop().replace(".fbx", "").replace(/[-_]/g, " ") : "Unknown", []), Ie = D((k, C = !1, N = null) => {
7624
7634
  if (!x.current)
7625
7635
  return null;
7626
- const Q = X(w);
7627
- if (Q)
7636
+ const te = _(k);
7637
+ if (te)
7628
7638
  try {
7629
- const q = ne(Q);
7630
- console.log(`🎬 Playing animation: "${q}"`);
7631
- const ge = () => {
7632
- Z.current && re.current === w ? setTimeout(() => {
7633
- ie(w, C, D);
7634
- }, 100) : D && D();
7639
+ const K = pe(te);
7640
+ console.log(`🎬 Playing animation: "${K}"`);
7641
+ const Se = () => {
7642
+ Z.current && re.current === k ? setTimeout(() => {
7643
+ Ie(k, C, N);
7644
+ }, 100) : N && N();
7635
7645
  };
7636
- return x.current.playAnimation(Q, null, 10, 0, 0.01, C, ge), Q;
7637
- } catch (q) {
7638
- return console.error("Failed to play animation:", q), null;
7646
+ return x.current.playAnimation(te, null, 10, 0, 0.01, C, Se), te;
7647
+ } catch (K) {
7648
+ return console.error("Failed to play animation:", K), null;
7639
7649
  }
7640
7650
  return null;
7641
- }, [X, ne]), ce = U(async (w, C = {}) => {
7642
- if (!x.current || !se || !w || w.trim() === "")
7651
+ }, [_, pe]), be = D(async (k, C = {}) => {
7652
+ if (!x.current || !se || !k || k.trim() === "")
7643
7653
  return;
7644
- await k();
7645
- const D = C.animationGroup || p;
7646
- D && !C.skipAnimation && (Z.current = !0, re.current = D, ie(D)), V.current = { remainingText: null, originalText: null, options: null }, j.current = [], H.current = { text: w, options: C }, I.current && (clearInterval(I.current), I.current = null), v(!1), N.current = !1;
7647
- const Q = w.split(/[.!?]+/).filter((ge) => ge.trim().length > 0);
7648
- j.current = Q;
7649
- const q = {
7654
+ await Q();
7655
+ const N = C.animationGroup || p;
7656
+ N && !C.skipAnimation && (Z.current = !0, re.current = N, J.current = [], ne.current = [], Ie(N)), G.current = { remainingText: null, originalText: null, options: null }, j.current = [], H.current = { text: k, options: C }, I.current && (clearInterval(I.current), I.current = null), v(!1), U.current = !1;
7657
+ const te = k.split(/[.!?]+/).filter((Se) => Se.trim().length > 0);
7658
+ j.current = te;
7659
+ const K = {
7650
7660
  lipsyncLang: C.lipsyncLang || "en",
7651
7661
  onSpeechEnd: () => {
7652
- I.current && (clearInterval(I.current), I.current = null), Z.current = !1, re.current = null, C.onSpeechEnd && C.onSpeechEnd(), R();
7662
+ I.current && (clearInterval(I.current), I.current = null), Z.current = !1, re.current = null, J.current = [], ne.current = [], C.onSpeechEnd && C.onSpeechEnd(), R();
7653
7663
  }
7654
7664
  };
7655
7665
  try {
7656
- x.current.speakText(w, q);
7657
- } catch (ge) {
7658
- console.error("Error speaking text:", ge), ve(ge.message || "Failed to speak text");
7666
+ x.current.speakText(k, K);
7667
+ } catch (Se) {
7668
+ console.error("Error speaking text:", Se), ve(Se.message || "Failed to speak text");
7659
7669
  }
7660
- }, [se, R, k, p, ie]);
7661
- xe(() => {
7670
+ }, [se, R, Q, p, Ie]);
7671
+ fe(() => {
7662
7672
  if (!se || !P || !x.current)
7663
7673
  return;
7664
7674
  B.current && clearInterval(B.current);
7665
- const w = () => {
7666
- x.current && !N.current && ie(P);
7675
+ const k = () => {
7676
+ x.current && !U.current && Ie(P);
7667
7677
  };
7668
- return w(), B.current = setInterval(() => {
7669
- w();
7678
+ return k(), B.current = setInterval(() => {
7679
+ k();
7670
7680
  }, 12e3 + Math.random() * 3e3), () => {
7671
7681
  B.current && (clearInterval(B.current), B.current = null);
7672
7682
  };
7673
- }, [se, P, ie]), xe(() => {
7674
- se && W && E && x.current && ce(W);
7675
- }, [se, W, E, ce]);
7676
- const J = U(() => {
7683
+ }, [se, P, Ie]), fe(() => {
7684
+ se && V && E && x.current && be(V);
7685
+ }, [se, V, E, be]);
7686
+ const Le = D(() => {
7677
7687
  if (x.current)
7678
7688
  try {
7679
- const w = x.current.isSpeaking || !1, C = x.current.audioPlaylist || [], D = x.current.speechQueue || [];
7680
- if (w || C.length > 0 || D.length > 0) {
7689
+ const k = x.current.isSpeaking || !1, C = x.current.audioPlaylist || [], N = x.current.speechQueue || [];
7690
+ if (k || C.length > 0 || N.length > 0) {
7681
7691
  I.current && (clearInterval(I.current), I.current = null);
7682
- let Q = "";
7683
- D.length > 0 && (Q = D.map((q) => q.text && Array.isArray(q.text) ? q.text.map((ge) => ge.word).join(" ") : q.text || "").join(" ")), V.current = {
7684
- remainingText: Q || null,
7692
+ let te = "";
7693
+ N.length > 0 && (te = N.map((K) => K.text && Array.isArray(K.text) ? K.text.map((Se) => Se.word).join(" ") : K.text || "").join(" ")), G.current = {
7694
+ remainingText: te || null,
7685
7695
  originalText: H.current?.text || null,
7686
7696
  options: H.current?.options || null
7687
- }, x.current.speechQueue.length = 0, x.current.pauseSpeaking(), v(!0), N.current = !0;
7697
+ }, x.current.speechQueue.length = 0, x.current.pauseSpeaking(), v(!0), U.current = !0;
7688
7698
  }
7689
- } catch (w) {
7690
- console.warn("Error pausing speech:", w);
7699
+ } catch (k) {
7700
+ console.warn("Error pausing speech:", k);
7691
7701
  }
7692
- }, []), pe = U(async () => {
7702
+ }, []), Ae = D(async () => {
7693
7703
  if (!(!x.current || !ee))
7694
7704
  try {
7695
- await k(), v(!1), N.current = !1;
7696
- const w = V.current?.remainingText, C = V.current?.originalText || H.current?.text, D = V.current?.options || H.current?.options || {}, Q = w || C;
7697
- Q && ce(Q, D);
7698
- } catch (w) {
7699
- console.warn("Error resuming speech:", w), v(!1), N.current = !1;
7705
+ await Q(), v(!1), U.current = !1;
7706
+ const k = G.current?.remainingText, C = G.current?.originalText || H.current?.text, N = G.current?.options || H.current?.options || {}, te = k || C;
7707
+ te && be(te, N);
7708
+ } catch (k) {
7709
+ console.warn("Error resuming speech:", k), v(!1), U.current = !1;
7700
7710
  }
7701
- }, [ee, ce, k]), He = U(() => {
7702
- x.current && (x.current.stopSpeaking(), I.current && (clearInterval(I.current), I.current = null), Z.current = !1, re.current = null, v(!1), N.current = !1);
7711
+ }, [ee, be, Q]), Oe = D(() => {
7712
+ x.current && (x.current.stopSpeaking(), I.current && (clearInterval(I.current), I.current = null), Z.current = !1, re.current = null, J.current = [], ne.current = [], v(!1), U.current = !1);
7703
7713
  }, []);
7704
- return We(y, () => ({
7705
- speakText: ce,
7706
- pauseSpeaking: J,
7707
- resumeSpeaking: pe,
7708
- stopSpeaking: He,
7709
- resumeAudioContext: k,
7714
+ return Xe(y, () => ({
7715
+ speakText: be,
7716
+ pauseSpeaking: Le,
7717
+ resumeSpeaking: Ae,
7718
+ stopSpeaking: Oe,
7719
+ resumeAudioContext: Q,
7710
7720
  isPaused: () => ee,
7711
- setMood: (w) => x.current?.setMood(w),
7712
- setBodyMovement: (w) => {
7713
- x.current && x.current.setBodyMovement(w);
7721
+ setMood: (k) => x.current?.setMood(k),
7722
+ setBodyMovement: (k) => {
7723
+ x.current && x.current.setBodyMovement(k);
7714
7724
  },
7715
- playAnimation: (w, C = !1) => {
7716
- x.current && x.current.playAnimation && x.current.playAnimation(w, null, 10, 0, 0.01, C);
7725
+ playAnimation: (k, C = !1) => {
7726
+ x.current && x.current.playAnimation && x.current.playAnimation(k, null, 10, 0, 0.01, C);
7717
7727
  },
7718
- playRandomAnimation: (w, C = !1) => ie(w, C),
7719
- getRandomAnimation: (w) => X(w),
7720
- playReaction: (w) => x.current?.playReaction(w),
7728
+ playRandomAnimation: (k, C = !1) => Ie(k, C),
7729
+ getRandomAnimation: (k) => getRandomAnimation(k),
7730
+ playReaction: (k) => x.current?.playReaction(k),
7721
7731
  playCelebration: () => x.current?.playCelebration(),
7722
- setShowFullAvatar: (w) => {
7723
- x.current && (S.current = w, x.current.setShowFullAvatar(w));
7732
+ setShowFullAvatar: (k) => {
7733
+ x.current && (S.current = k, x.current.setShowFullAvatar(k));
7724
7734
  },
7725
7735
  isReady: se,
7726
7736
  talkingHead: x.current
7727
- })), /* @__PURE__ */ Ie("div", { className: `simple-talking-avatar-container ${b}`, style: L, children: [
7737
+ })), /* @__PURE__ */ ke("div", { className: `simple-talking-avatar-container ${b}`, style: L, children: [
7728
7738
  /* @__PURE__ */ $(
7729
7739
  "div",
7730
7740
  {
@@ -7760,9 +7770,9 @@ const St = Ue(({
7760
7770
  }, children: le })
7761
7771
  ] });
7762
7772
  });
7763
- St.displayName = "SimpleTalkingAvatar";
7764
- const kt = Ue(({
7765
- curriculumData: W = null,
7773
+ Ct.displayName = "SimpleTalkingAvatar";
7774
+ const zt = Ze(({
7775
+ curriculumData: V = null,
7766
7776
  avatarConfig: t = {},
7767
7777
  animations: e = {},
7768
7778
  onLessonStart: n = () => {
@@ -7777,7 +7787,7 @@ const kt = Ue(({
7777
7787
  },
7778
7788
  autoStart: c = !1
7779
7789
  }, l) => {
7780
- const u = G(null), r = G({
7790
+ const u = W(null), r = W({
7781
7791
  currentModuleIndex: 0,
7782
7792
  currentLessonIndex: 0,
7783
7793
  currentQuestionIndex: 0,
@@ -7787,18 +7797,18 @@ const kt = Ue(({
7787
7797
  curriculumCompleted: !1,
7788
7798
  score: 0,
7789
7799
  totalQuestions: 0
7790
- }), d = G({
7800
+ }), d = W({
7791
7801
  onLessonStart: n,
7792
7802
  onLessonComplete: o,
7793
7803
  onQuestionAnswer: s,
7794
7804
  onCurriculumComplete: i,
7795
7805
  onCustomAction: a
7796
- }), h = G(null), g = G(null), R = G(null), b = G(null), L = G(null), T = G(null), p = G(null), P = G(W?.curriculum || {
7806
+ }), h = W(null), g = W(null), R = W(null), b = W(null), L = W(null), T = W(null), p = W(null), P = W(V?.curriculum || {
7797
7807
  title: "Default Curriculum",
7798
7808
  description: "No curriculum data provided",
7799
7809
  language: "en",
7800
7810
  modules: []
7801
- }), E = G({
7811
+ }), E = W({
7802
7812
  avatarUrl: t.avatarUrl || "/avatars/brunette.glb",
7803
7813
  avatarBody: t.avatarBody || "F",
7804
7814
  mood: t.mood || "happy",
@@ -7812,7 +7822,7 @@ const kt = Ue(({
7812
7822
  animations: e,
7813
7823
  lipsyncLang: "en"
7814
7824
  });
7815
- xe(() => {
7825
+ fe(() => {
7816
7826
  d.current = {
7817
7827
  onLessonStart: n,
7818
7828
  onLessonComplete: o,
@@ -7820,8 +7830,8 @@ const kt = Ue(({
7820
7830
  onCurriculumComplete: i,
7821
7831
  onCustomAction: a
7822
7832
  };
7823
- }, [n, o, s, i, a]), xe(() => {
7824
- P.current = W?.curriculum || {
7833
+ }, [n, o, s, i, a]), fe(() => {
7834
+ P.current = V?.curriculum || {
7825
7835
  title: "Default Curriculum",
7826
7836
  description: "No curriculum data provided",
7827
7837
  language: "en",
@@ -7840,8 +7850,8 @@ const kt = Ue(({
7840
7850
  animations: e,
7841
7851
  lipsyncLang: "en"
7842
7852
  };
7843
- }, [W, t, e]);
7844
- const y = U(() => (P.current || { modules: [] }).modules[r.current.currentModuleIndex]?.lessons[r.current.currentLessonIndex], []), F = U(() => y()?.questions[r.current.currentQuestionIndex], [y]), x = U((v, A) => A.type === "multiple_choice" || A.type === "true_false" ? v === A.answer : A.type === "code_test" && typeof v == "object" && v !== null ? v.passed === !0 : !1, []), S = U(() => {
7853
+ }, [V, t, e]);
7854
+ const y = D(() => (P.current || { modules: [] }).modules[r.current.currentModuleIndex]?.lessons[r.current.currentLessonIndex], []), F = D(() => y()?.questions[r.current.currentQuestionIndex], [y]), x = D((v, A) => A.type === "multiple_choice" || A.type === "true_false" ? v === A.answer : A.type === "code_test" && typeof v == "object" && v !== null ? v.passed === !0 : !1, []), S = D(() => {
7845
7855
  r.current.lessonCompleted = !0, r.current.isQuestionMode = !1;
7846
7856
  const v = r.current.totalQuestions > 0 ? Math.round(r.current.score / r.current.totalQuestions * 100) : 100;
7847
7857
  let A = "Congratulations! You've completed this lesson";
@@ -7865,9 +7875,9 @@ const kt = Ue(({
7865
7875
  } catch {
7866
7876
  u.current.playCelebration();
7867
7877
  }
7868
- const M = P.current || { modules: [] }, B = M.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, re = r.current.currentModuleIndex < (M.modules?.length || 0) - 1, K = Z || re, te = E.current || { lipsyncLang: "en" };
7878
+ const M = P.current || { modules: [] }, B = M.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, re = r.current.currentModuleIndex < (M.modules?.length || 0) - 1, ne = Z || re, J = E.current || { lipsyncLang: "en" };
7869
7879
  u.current.speakText(A, {
7870
- lipsyncLang: te.lipsyncLang,
7880
+ lipsyncLang: J.lipsyncLang,
7871
7881
  onSpeechEnd: () => {
7872
7882
  d.current.onCustomAction({
7873
7883
  type: "lessonCompleteFeedbackDone",
@@ -7876,12 +7886,12 @@ const kt = Ue(({
7876
7886
  score: r.current.score,
7877
7887
  totalQuestions: r.current.totalQuestions,
7878
7888
  percentage: v,
7879
- hasNextLesson: K
7889
+ hasNextLesson: ne
7880
7890
  });
7881
7891
  }
7882
7892
  });
7883
7893
  }
7884
- }, [e.lessonComplete]), H = U(() => {
7894
+ }, [e.lessonComplete]), H = D(() => {
7885
7895
  r.current.curriculumCompleted = !0;
7886
7896
  const v = P.current || { modules: [] };
7887
7897
  if (d.current.onCurriculumComplete({
@@ -7897,7 +7907,7 @@ const kt = Ue(({
7897
7907
  const A = E.current || { lipsyncLang: "en" };
7898
7908
  u.current.speakText("Amazing! You've completed the entire curriculum! You're now ready to move on to more advanced topics. Well done!", { lipsyncLang: A.lipsyncLang });
7899
7909
  }
7900
- }, [e.curriculumComplete]), I = U(() => {
7910
+ }, [e.curriculumComplete]), I = D(() => {
7901
7911
  const v = y();
7902
7912
  r.current.isQuestionMode = !0, r.current.currentQuestionIndex = 0, r.current.totalQuestions = v?.questions?.length || 0, r.current.score = 0;
7903
7913
  const A = F();
@@ -7934,7 +7944,7 @@ const kt = Ue(({
7934
7944
  clearInterval(B);
7935
7945
  }, 5e3);
7936
7946
  }
7937
- }, [e.questionStart, y, F]), N = U(() => {
7947
+ }, [e.questionStart, y, F]), U = D(() => {
7938
7948
  const v = y();
7939
7949
  if (r.current.currentQuestionIndex < (v?.questions?.length || 0) - 1) {
7940
7950
  u.current && u.current.stopSpeaking && u.current.stopSpeaking(), r.current.currentQuestionIndex += 1;
@@ -7953,28 +7963,28 @@ const kt = Ue(({
7953
7963
  if (u.current.setMood("happy"), u.current.setBodyMovement("idle"), e.nextQuestion)
7954
7964
  try {
7955
7965
  u.current.playAnimation(e.nextQuestion, !0);
7956
- } catch (te) {
7957
- console.warn("Failed to play nextQuestion animation:", te);
7966
+ } catch (J) {
7967
+ console.warn("Failed to play nextQuestion animation:", J);
7958
7968
  }
7959
- const B = E.current || { lipsyncLang: "en" }, re = y()?.questions?.length || 0, K = r.current.currentQuestionIndex >= re - 1;
7969
+ const B = E.current || { lipsyncLang: "en" }, re = y()?.questions?.length || 0, ne = r.current.currentQuestionIndex >= re - 1;
7960
7970
  if (A.type === "code_test") {
7961
- const te = K ? `Great! Here's your final coding challenge: ${A.question}` : `Great! Now let's move on to your next coding challenge: ${A.question}`;
7962
- u.current.speakText(te, {
7971
+ const J = ne ? `Great! Here's your final coding challenge: ${A.question}` : `Great! Now let's move on to your next coding challenge: ${A.question}`;
7972
+ u.current.speakText(J, {
7963
7973
  lipsyncLang: B.lipsyncLang
7964
7974
  });
7965
7975
  } else if (A.type === "multiple_choice") {
7966
- const te = K ? `Alright! Here's your final question: ${A.question}` : `Alright! Here's your next question: ${A.question}`;
7967
- u.current.speakText(te, {
7976
+ const J = ne ? `Alright! Here's your final question: ${A.question}` : `Alright! Here's your next question: ${A.question}`;
7977
+ u.current.speakText(J, {
7968
7978
  lipsyncLang: B.lipsyncLang
7969
7979
  });
7970
7980
  } else if (A.type === "true_false") {
7971
- const te = K ? `Now let's try this final one: ${A.question}` : `Now let's try this one: ${A.question}`;
7972
- u.current.speakText(te, {
7981
+ const J = ne ? `Now let's try this final one: ${A.question}` : `Now let's try this one: ${A.question}`;
7982
+ u.current.speakText(J, {
7973
7983
  lipsyncLang: B.lipsyncLang
7974
7984
  });
7975
7985
  } else {
7976
- const te = K ? `Here's your final question: ${A.question}` : `Here's the next question: ${A.question}`;
7977
- u.current.speakText(te, {
7986
+ const J = ne ? `Here's your final question: ${A.question}` : `Here's the next question: ${A.question}`;
7987
+ u.current.speakText(J, {
7978
7988
  lipsyncLang: B.lipsyncLang
7979
7989
  });
7980
7990
  }
@@ -7997,16 +8007,16 @@ const kt = Ue(({
7997
8007
  totalQuestions: r.current.totalQuestions,
7998
8008
  score: r.current.score
7999
8009
  });
8000
- }, [e.nextQuestion, y, F]), V = U(() => {
8010
+ }, [e.nextQuestion, y, F]), G = D(() => {
8001
8011
  const v = P.current || { modules: [] }, A = v.modules[r.current.currentModuleIndex];
8002
8012
  if (r.current.currentLessonIndex < (A?.lessons?.length || 0) - 1) {
8003
8013
  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;
8004
- const B = v.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, re = r.current.currentModuleIndex < (v.modules?.length || 0) - 1, K = Z || re;
8014
+ const B = v.modules[r.current.currentModuleIndex], Z = r.current.currentLessonIndex < (B?.lessons?.length || 0) - 1, re = r.current.currentModuleIndex < (v.modules?.length || 0) - 1, ne = Z || re;
8005
8015
  d.current.onCustomAction({
8006
8016
  type: "lessonStart",
8007
8017
  moduleIndex: r.current.currentModuleIndex,
8008
8018
  lessonIndex: r.current.currentLessonIndex,
8009
- hasNextLesson: K
8019
+ hasNextLesson: ne
8010
8020
  }), d.current.onLessonStart({
8011
8021
  moduleIndex: r.current.currentModuleIndex,
8012
8022
  lessonIndex: r.current.currentLessonIndex,
@@ -8014,12 +8024,12 @@ const kt = Ue(({
8014
8024
  }), u.current && (u.current.setMood("happy"), u.current.setBodyMovement("idle"));
8015
8025
  } else if (r.current.currentModuleIndex < (v.modules?.length || 0) - 1) {
8016
8026
  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;
8017
- const Z = v.modules[r.current.currentModuleIndex], re = r.current.currentLessonIndex < (Z?.lessons?.length || 0) - 1, K = r.current.currentModuleIndex < (v.modules?.length || 0) - 1, te = re || K;
8027
+ const Z = v.modules[r.current.currentModuleIndex], re = r.current.currentLessonIndex < (Z?.lessons?.length || 0) - 1, ne = r.current.currentModuleIndex < (v.modules?.length || 0) - 1, J = re || ne;
8018
8028
  d.current.onCustomAction({
8019
8029
  type: "lessonStart",
8020
8030
  moduleIndex: r.current.currentModuleIndex,
8021
8031
  lessonIndex: r.current.currentLessonIndex,
8022
- hasNextLesson: te
8032
+ hasNextLesson: J
8023
8033
  }), d.current.onLessonStart({
8024
8034
  moduleIndex: r.current.currentModuleIndex,
8025
8035
  lessonIndex: r.current.currentLessonIndex,
@@ -8027,7 +8037,7 @@ const kt = Ue(({
8027
8037
  }), u.current && (u.current.setMood("happy"), u.current.setBodyMovement("idle"));
8028
8038
  } else
8029
8039
  L.current && L.current();
8030
- }, []), j = U(() => {
8040
+ }, []), j = D(() => {
8031
8041
  const v = y();
8032
8042
  let A = null;
8033
8043
  if (v?.avatar_script && v?.body) {
@@ -8074,7 +8084,7 @@ const kt = Ue(({
8074
8084
  }
8075
8085
  });
8076
8086
  }
8077
- }, [e.teaching, y]), Y = U((v) => {
8087
+ }, [e.teaching, y]), Y = D((v) => {
8078
8088
  const A = F(), M = x(v, A);
8079
8089
  if (M && (r.current.score += 1), d.current.onQuestionAnswer({
8080
8090
  moduleIndex: r.current.currentModuleIndex,
@@ -8096,9 +8106,9 @@ const kt = Ue(({
8096
8106
  r.current.currentQuestionIndex >= Z - 1;
8097
8107
  const re = r.current.currentQuestionIndex < Z - 1;
8098
8108
  console.log("[CurriculumLearning] Answer feedback - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", Z, "hasNextQuestion:", re);
8099
- const K = A.type === "code_test" ? `Great job! Your code passed all the tests! ${A.explanation || ""}` : `Excellent! That's correct! ${A.explanation || ""}`, te = E.current || { lipsyncLang: "en" };
8100
- u.current.speakText(K, {
8101
- lipsyncLang: te.lipsyncLang,
8109
+ const ne = A.type === "code_test" ? `Great job! Your code passed all the tests! ${A.explanation || ""}` : `Excellent! That's correct! ${A.explanation || ""}`, J = E.current || { lipsyncLang: "en" };
8110
+ u.current.speakText(ne, {
8111
+ lipsyncLang: J.lipsyncLang,
8102
8112
  onSpeechEnd: () => {
8103
8113
  d.current.onCustomAction({
8104
8114
  type: "answerFeedbackComplete",
@@ -8120,11 +8130,11 @@ const kt = Ue(({
8120
8130
  u.current.setBodyMovement("idle");
8121
8131
  }
8122
8132
  u.current.setBodyMovement("gesturing");
8123
- const Z = y()?.questions?.length || 0, re = r.current.currentQuestionIndex >= Z - 1, K = r.current.currentQuestionIndex < Z - 1;
8124
- console.log("[CurriculumLearning] Answer feedback (incorrect) - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", Z, "hasNextQuestion:", K);
8125
- const te = A.type === "code_test" ? `Your code didn't pass all the tests. ${A.explanation || "Try again!"}` : `Not quite right, but don't worry! ${A.explanation || ""}${re ? "" : " Let's move on to the next question."}`, be = E.current || { lipsyncLang: "en" };
8126
- u.current.speakText(te, {
8127
- lipsyncLang: be.lipsyncLang,
8133
+ const Z = y()?.questions?.length || 0, re = r.current.currentQuestionIndex >= Z - 1, ne = r.current.currentQuestionIndex < Z - 1;
8134
+ console.log("[CurriculumLearning] Answer feedback (incorrect) - questionIndex:", r.current.currentQuestionIndex, "totalQuestions:", Z, "hasNextQuestion:", ne);
8135
+ const J = A.type === "code_test" ? `Your code didn't pass all the tests. ${A.explanation || "Try again!"}` : `Not quite right, but don't worry! ${A.explanation || ""}${re ? "" : " Let's move on to the next question."}`, me = E.current || { lipsyncLang: "en" };
8136
+ u.current.speakText(J, {
8137
+ lipsyncLang: me.lipsyncLang,
8128
8138
  onSpeechEnd: () => {
8129
8139
  d.current.onCustomAction({
8130
8140
  type: "answerFeedbackComplete",
@@ -8132,7 +8142,7 @@ const kt = Ue(({
8132
8142
  lessonIndex: r.current.currentLessonIndex,
8133
8143
  questionIndex: r.current.currentQuestionIndex,
8134
8144
  isCorrect: !1,
8135
- hasNextQuestion: K,
8145
+ hasNextQuestion: ne,
8136
8146
  score: r.current.score,
8137
8147
  totalQuestions: r.current.totalQuestions
8138
8148
  });
@@ -8153,7 +8163,7 @@ const kt = Ue(({
8153
8163
  avatarNotReady: !0
8154
8164
  });
8155
8165
  }
8156
- }, [e.correct, e.incorrect, F, y, x]), ue = U((v) => {
8166
+ }, [e.correct, e.incorrect, F, y, x]), ue = D((v) => {
8157
8167
  const A = F();
8158
8168
  if (!v || typeof v != "object") {
8159
8169
  console.error("Invalid code test result format. Expected object with {passed: boolean, ...}");
@@ -8181,7 +8191,7 @@ const kt = Ue(({
8181
8191
  testResult: M,
8182
8192
  question: A
8183
8193
  }), p.current && p.current(M);
8184
- }, [F, x]), le = U(() => {
8194
+ }, [F, x]), le = D(() => {
8185
8195
  if (r.current.currentQuestionIndex > 0) {
8186
8196
  r.current.currentQuestionIndex -= 1;
8187
8197
  const v = F();
@@ -8215,7 +8225,7 @@ const kt = Ue(({
8215
8225
  }, 5e3);
8216
8226
  }
8217
8227
  }
8218
- }, [F]), ve = U(() => {
8228
+ }, [F]), ve = D(() => {
8219
8229
  const v = P.current || { modules: [] };
8220
8230
  if (v.modules[r.current.currentModuleIndex], r.current.currentLessonIndex > 0)
8221
8231
  r.current.currentLessonIndex -= 1, r.current.currentQuestionIndex = 0, r.current.lessonCompleted = !1, r.current.isQuestionMode = !1, r.current.isTeaching = !1, r.current.score = 0, r.current.totalQuestions = 0, d.current.onCustomAction({
@@ -8239,26 +8249,26 @@ const kt = Ue(({
8239
8249
  lesson: y()
8240
8250
  }), u.current && (u.current.setMood("happy"), u.current.setBodyMovement("idle"));
8241
8251
  }
8242
- }, [y]), se = U(() => {
8252
+ }, [y]), se = D(() => {
8243
8253
  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;
8244
- }, []), Se = U((v) => {
8254
+ }, []), ze = D((v) => {
8245
8255
  console.log("Avatar is ready!", v);
8246
8256
  const A = y(), M = A?.avatar_script || A?.body;
8247
8257
  c && M && setTimeout(() => {
8248
8258
  h.current && h.current();
8249
8259
  }, 10);
8250
8260
  }, [c, y]);
8251
- et(() => {
8252
- h.current = j, g.current = V, R.current = S, b.current = N, L.current = H, T.current = I, p.current = Y;
8253
- }), We(l, () => ({
8261
+ it(() => {
8262
+ h.current = j, g.current = G, R.current = S, b.current = U, L.current = H, T.current = I, p.current = Y;
8263
+ }), Xe(l, () => ({
8254
8264
  // Curriculum control methods
8255
8265
  startTeaching: j,
8256
8266
  startQuestions: I,
8257
8267
  handleAnswerSelect: Y,
8258
8268
  handleCodeTestResult: ue,
8259
- nextQuestion: N,
8269
+ nextQuestion: U,
8260
8270
  previousQuestion: le,
8261
- nextLesson: V,
8271
+ nextLesson: G,
8262
8272
  previousLesson: ve,
8263
8273
  completeLesson: S,
8264
8274
  completeCurriculum: H,
@@ -8316,7 +8326,7 @@ const kt = Ue(({
8316
8326
  handleResize: () => u.current?.handleResize(),
8317
8327
  // Avatar readiness check (always returns current value)
8318
8328
  isAvatarReady: () => u.current?.isReady || !1
8319
- }), [j, I, Y, ue, N, V, S, H, se, F, y]);
8329
+ }), [j, I, Y, ue, U, G, S, H, se, F, y]);
8320
8330
  const ee = E.current || {
8321
8331
  avatarUrl: "/avatars/brunette.glb",
8322
8332
  avatarBody: "F",
@@ -8331,7 +8341,7 @@ const kt = Ue(({
8331
8341
  animations: e
8332
8342
  };
8333
8343
  return /* @__PURE__ */ $("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ $(
8334
- Ke,
8344
+ et,
8335
8345
  {
8336
8346
  ref: u,
8337
8347
  avatarUrl: ee.avatarUrl,
@@ -8346,7 +8356,7 @@ const kt = Ue(({
8346
8356
  showFullAvatar: ee.showFullAvatar,
8347
8357
  cameraView: "upper",
8348
8358
  animations: ee.animations,
8349
- onReady: Se,
8359
+ onReady: ze,
8350
8360
  onLoading: () => {
8351
8361
  },
8352
8362
  onError: (v) => {
@@ -8355,9 +8365,9 @@ const kt = Ue(({
8355
8365
  }
8356
8366
  ) });
8357
8367
  });
8358
- kt.displayName = "CurriculumLearning";
8359
- function Ot({
8360
- manifestPath: W = "/animations/manifest.json",
8368
+ zt.displayName = "CurriculumLearning";
8369
+ function Ut({
8370
+ manifestPath: V = "/animations/manifest.json",
8361
8371
  avatarBody: t = "F",
8362
8372
  onAnimationPlay: e = null,
8363
8373
  onAnimationsSelected: n = null,
@@ -8365,19 +8375,19 @@ function Ot({
8365
8375
  style: s = {}
8366
8376
  }) {
8367
8377
  const [i, a] = ae([]), [c, l] = ae(/* @__PURE__ */ new Set()), [u, r] = ae(!0), [d, h] = ae(null), [g, R] = ae("all"), [b, L] = ae("");
8368
- xe(() => {
8378
+ fe(() => {
8369
8379
  (async () => {
8370
8380
  r(!0), h(null);
8371
8381
  try {
8372
- const H = await Me(W), I = [];
8382
+ const H = await De(V), I = [];
8373
8383
  if (H._genderSpecific) {
8374
- const V = (t?.toUpperCase() || "F") === "M" ? "male" : "female";
8375
- H._genderSpecific[V] && Object.entries(H._genderSpecific[V]).forEach(([j, Y]) => {
8384
+ const G = (t?.toUpperCase() || "F") === "M" ? "male" : "female";
8385
+ H._genderSpecific[G] && Object.entries(H._genderSpecific[G]).forEach(([j, Y]) => {
8376
8386
  (Array.isArray(Y) ? Y : [Y]).forEach((le) => {
8377
8387
  I.push({
8378
8388
  path: le,
8379
8389
  group: j,
8380
- gender: V,
8390
+ gender: G,
8381
8391
  name: le.split("/").pop().replace(".fbx", "")
8382
8392
  });
8383
8393
  });
@@ -8392,11 +8402,11 @@ function Ot({
8392
8402
  });
8393
8403
  });
8394
8404
  }
8395
- Object.entries(H).forEach(([N, V]) => {
8396
- N !== "_genderSpecific" && (Array.isArray(V) ? V : [V]).forEach((Y) => {
8405
+ Object.entries(H).forEach(([U, G]) => {
8406
+ U !== "_genderSpecific" && (Array.isArray(G) ? G : [G]).forEach((Y) => {
8397
8407
  typeof Y == "string" && I.push({
8398
8408
  path: Y,
8399
- group: N,
8409
+ group: U,
8400
8410
  gender: "root",
8401
8411
  name: Y.split("/").pop().replace(".fbx", "")
8402
8412
  });
@@ -8406,7 +8416,7 @@ function Ot({
8406
8416
  console.error("Failed to load animations:", H), h(H.message), r(!1);
8407
8417
  }
8408
8418
  })();
8409
- }, [W, t]);
8419
+ }, [V, t]);
8410
8420
  const T = ["all", ...new Set(i.map((S) => S.group))], p = i.filter((S) => {
8411
8421
  const H = g === "all" || S.group === g, I = b === "" || S.name.toLowerCase().includes(b.toLowerCase()) || S.path.toLowerCase().includes(b.toLowerCase());
8412
8422
  return H && I;
@@ -8438,10 +8448,10 @@ ${H.slice(0, 5).join(`
8438
8448
  }, x = (S) => {
8439
8449
  e && e(S);
8440
8450
  };
8441
- return u ? /* @__PURE__ */ $("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ $("p", { children: "Loading animations..." }) }) : d ? /* @__PURE__ */ $("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */ Ie("p", { children: [
8451
+ return u ? /* @__PURE__ */ $("div", { style: { padding: "20px", textAlign: "center", ...s }, children: /* @__PURE__ */ $("p", { children: "Loading animations..." }) }) : d ? /* @__PURE__ */ $("div", { style: { padding: "20px", color: "red", ...s }, children: /* @__PURE__ */ ke("p", { children: [
8442
8452
  "Error loading animations: ",
8443
8453
  d
8444
- ] }) }) : /* @__PURE__ */ Ie("div", { style: {
8454
+ ] }) }) : /* @__PURE__ */ ke("div", { style: {
8445
8455
  padding: "20px",
8446
8456
  backgroundColor: "#2a2a2a",
8447
8457
  borderRadius: "8px",
@@ -8450,7 +8460,7 @@ ${H.slice(0, 5).join(`
8450
8460
  }, children: [
8451
8461
  /* @__PURE__ */ $("h2", { style: { marginTop: 0 }, children: "Animation Selector" }),
8452
8462
  /* @__PURE__ */ $("p", { style: { color: "#aaa", fontSize: "14px" }, children: "Click buttons to play animations. Select animations to keep, then delete will remove the rest." }),
8453
- /* @__PURE__ */ Ie("div", { style: {
8463
+ /* @__PURE__ */ ke("div", { style: {
8454
8464
  display: "flex",
8455
8465
  gap: "10px",
8456
8466
  marginBottom: "20px",
@@ -8524,7 +8534,7 @@ ${H.slice(0, 5).join(`
8524
8534
  children: "Deselect All Visible"
8525
8535
  }
8526
8536
  ),
8527
- /* @__PURE__ */ Ie(
8537
+ /* @__PURE__ */ ke(
8528
8538
  "button",
8529
8539
  {
8530
8540
  onClick: F,
@@ -8546,7 +8556,7 @@ ${H.slice(0, 5).join(`
8546
8556
  }
8547
8557
  )
8548
8558
  ] }),
8549
- /* @__PURE__ */ Ie("div", { style: {
8559
+ /* @__PURE__ */ ke("div", { style: {
8550
8560
  marginBottom: "15px",
8551
8561
  fontSize: "14px",
8552
8562
  color: "#aaa"
@@ -8569,7 +8579,7 @@ ${H.slice(0, 5).join(`
8569
8579
  borderRadius: "6px"
8570
8580
  }, children: p.map((S, H) => {
8571
8581
  const I = c.has(S.path);
8572
- return /* @__PURE__ */ Ie(
8582
+ return /* @__PURE__ */ ke(
8573
8583
  "div",
8574
8584
  {
8575
8585
  style: {
@@ -8582,21 +8592,21 @@ ${H.slice(0, 5).join(`
8582
8592
  },
8583
8593
  onClick: () => P(S.path),
8584
8594
  children: [
8585
- /* @__PURE__ */ Ie("div", { style: { marginBottom: "8px" }, children: [
8595
+ /* @__PURE__ */ ke("div", { style: { marginBottom: "8px" }, children: [
8586
8596
  /* @__PURE__ */ $(
8587
8597
  "input",
8588
8598
  {
8589
8599
  type: "checkbox",
8590
8600
  checked: I,
8591
8601
  onChange: () => P(S.path),
8592
- onClick: (N) => N.stopPropagation(),
8602
+ onClick: (U) => U.stopPropagation(),
8593
8603
  style: {
8594
8604
  marginRight: "8px",
8595
8605
  cursor: "pointer"
8596
8606
  }
8597
8607
  }
8598
8608
  ),
8599
- /* @__PURE__ */ Ie("span", { style: { fontSize: "12px", color: "#aaa" }, children: [
8609
+ /* @__PURE__ */ ke("span", { style: { fontSize: "12px", color: "#aaa" }, children: [
8600
8610
  S.group,
8601
8611
  " ",
8602
8612
  S.gender !== "root" && `(${S.gender})`
@@ -8611,8 +8621,8 @@ ${H.slice(0, 5).join(`
8611
8621
  /* @__PURE__ */ $(
8612
8622
  "button",
8613
8623
  {
8614
- onClick: (N) => {
8615
- N.stopPropagation(), x(S.path);
8624
+ onClick: (U) => {
8625
+ U.stopPropagation(), x(S.path);
8616
8626
  },
8617
8627
  style: {
8618
8628
  width: "100%",
@@ -8639,7 +8649,7 @@ ${H.slice(0, 5).join(`
8639
8649
  }, children: "No animations found matching your filters." })
8640
8650
  ] });
8641
8651
  }
8642
- const Je = {
8652
+ const tt = {
8643
8653
  // Code-based dance animations (no FBX required)
8644
8654
  dance: {
8645
8655
  name: "dance",
@@ -8742,16 +8752,16 @@ const Je = {
8742
8752
  duration: 5e3,
8743
8753
  description: "Excited, energetic movement"
8744
8754
  }
8745
- }, Bt = (W) => Je[W] || null, Dt = (W) => Je.hasOwnProperty(W);
8755
+ }, Wt = (V) => tt[V] || null, Vt = (V) => tt.hasOwnProperty(V);
8746
8756
  export {
8747
- Ot as AnimationSelector,
8748
- kt as CurriculumLearning,
8749
- St as SimpleTalkingAvatar,
8750
- Ke as TalkingHeadAvatar,
8751
- At as TalkingHeadComponent,
8752
- Je as animations,
8753
- Ve as getActiveTTSConfig,
8754
- Bt as getAnimation,
8755
- Pt as getVoiceOptions,
8756
- Dt as hasAnimation
8757
+ Ut as AnimationSelector,
8758
+ zt as CurriculumLearning,
8759
+ Ct as SimpleTalkingAvatar,
8760
+ et as TalkingHeadAvatar,
8761
+ kt as TalkingHeadComponent,
8762
+ tt as animations,
8763
+ je as getActiveTTSConfig,
8764
+ Wt as getAnimation,
8765
+ Nt as getVoiceOptions,
8766
+ Vt as hasAnimation
8757
8767
  };