@spatialwalk/avatarkit 1.0.0-beta.24 → 1.0.0-beta.25

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.
@@ -39,8 +39,8 @@ function Zi(r) {
39
39
  gsStandard: ((d = (c = (p = r.models) == null ? void 0 : p.gsStandard) == null ? void 0 : c.resource) == null ? void 0 : d.remote) || null
40
40
  };
41
41
  }
42
- var ae = /* @__PURE__ */ ((r) => (r.cn = "cn", r.intl = "intl", r.test = "test", r))(ae || {}), be = /* @__PURE__ */ ((r) => (r.sdk = "sdk", r.host = "host", r))(be || {}), he = /* @__PURE__ */ ((r) => (r.downloading = "downloading", r.completed = "completed", r.failed = "failed", r))(he || {}), re = /* @__PURE__ */ ((r) => (r.disconnected = "disconnected", r.connecting = "connecting", r.connected = "connected", r.failed = "failed", r))(re || {}), ie = /* @__PURE__ */ ((r) => (r.idle = "idle", r.playing = "playing", r))(ie || {}), x = /* @__PURE__ */ ((r) => (r.idle = "idle", r.active = "active", r.playing = "playing", r.paused = "paused", r))(x || {});
43
- class j extends Error {
42
+ var ae = /* @__PURE__ */ ((r) => (r.cn = "cn", r.intl = "intl", r.test = "test", r))(ae || {}), Ae = /* @__PURE__ */ ((r) => (r.sdk = "sdk", r.host = "host", r))(Ae || {}), he = /* @__PURE__ */ ((r) => (r.downloading = "downloading", r.completed = "completed", r.failed = "failed", r))(he || {}), re = /* @__PURE__ */ ((r) => (r.disconnected = "disconnected", r.connecting = "connecting", r.connected = "connected", r.failed = "failed", r))(re || {}), ie = /* @__PURE__ */ ((r) => (r.idle = "idle", r.playing = "playing", r))(ie || {}), x = /* @__PURE__ */ ((r) => (r.idle = "idle", r.active = "active", r.playing = "playing", r.paused = "paused", r))(x || {});
43
+ class K extends Error {
44
44
  constructor(e, t) {
45
45
  super(e), this.code = t, this.name = "SPAvatarError";
46
46
  }
@@ -113,7 +113,7 @@ var Xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
113
113
  function vn(r) {
114
114
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
115
115
  }
116
- var Zt = { exports: {} }, Be = { exports: {} }, pt;
116
+ var Zt = { exports: {} }, De = { exports: {} }, pt;
117
117
  function yn() {
118
118
  return pt || (pt = 1, function(r, e) {
119
119
  (function(t, n) {
@@ -163,7 +163,7 @@ function yn() {
163
163
  }, d.fromString = function(S) {
164
164
  var P = S.indexOf("("), O = S.lastIndexOf(")"), I = S.substring(0, P), J = S.substring(P + 1, O).split(","), q = S.substring(O + 1);
165
165
  if (q.indexOf("@") === 0)
166
- var D = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(q, ""), $ = D[1], H = D[2], Q = D[3];
166
+ var B = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(q, ""), $ = B[1], H = B[2], Q = B[3];
167
167
  return new d({
168
168
  functionName: I,
169
169
  args: J || void 0,
@@ -186,15 +186,15 @@ function yn() {
186
186
  this[w] = Number(S);
187
187
  };
188
188
  }(s[v]);
189
- for (var A = 0; A < o.length; A++)
190
- d.prototype["get" + n(o[A])] = i(o[A]), d.prototype["set" + n(o[A])] = /* @__PURE__ */ function(w) {
189
+ for (var b = 0; b < o.length; b++)
190
+ d.prototype["get" + n(o[b])] = i(o[b]), d.prototype["set" + n(o[b])] = /* @__PURE__ */ function(w) {
191
191
  return function(S) {
192
192
  this[w] = String(S);
193
193
  };
194
- }(o[A]);
194
+ }(o[b]);
195
195
  return d;
196
196
  });
197
- }(Be)), Be.exports;
197
+ }(De)), De.exports;
198
198
  }
199
199
  (function(r, e) {
200
200
  (function(t, n) {
@@ -233,9 +233,9 @@ function yn() {
233
233
  c.indexOf("(eval ") > -1 && (c = c.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
234
234
  var d = c.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), m = d.match(/ (\(.+\)$)/);
235
235
  d = m ? d.replace(m[0], "") : d;
236
- var v = this.extractLocation(m ? m[1] : d), A = m && d || void 0, w = ["eval", "<anonymous>"].indexOf(v[0]) > -1 ? void 0 : v[0];
236
+ var v = this.extractLocation(m ? m[1] : d), b = m && d || void 0, w = ["eval", "<anonymous>"].indexOf(v[0]) > -1 ? void 0 : v[0];
237
237
  return new n({
238
- functionName: A,
238
+ functionName: b,
239
239
  fileName: w,
240
240
  lineNumber: v[1],
241
241
  columnNumber: v[2],
@@ -253,12 +253,12 @@ function yn() {
253
253
  return new n({
254
254
  functionName: c
255
255
  });
256
- var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, m = c.match(d), v = m && m[1] ? m[1] : void 0, A = this.extractLocation(c.replace(d, ""));
256
+ var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, m = c.match(d), v = m && m[1] ? m[1] : void 0, b = this.extractLocation(c.replace(d, ""));
257
257
  return new n({
258
258
  functionName: v,
259
- fileName: A[0],
260
- lineNumber: A[1],
261
- columnNumber: A[2],
259
+ fileName: b[0],
260
+ lineNumber: b[1],
261
+ columnNumber: b[2],
262
262
  source: c
263
263
  });
264
264
  }, this);
@@ -272,10 +272,10 @@ function yn() {
272
272
  parseOpera9: function(l) {
273
273
  for (var p = /Line (\d+).*script (?:in )?(\S+)/i, c = l.message.split(`
274
274
  `), d = [], m = 2, v = c.length; m < v; m += 2) {
275
- var A = p.exec(c[m]);
276
- A && d.push(new n({
277
- fileName: A[2],
278
- lineNumber: A[1],
275
+ var b = p.exec(c[m]);
276
+ b && d.push(new n({
277
+ fileName: b[2],
278
+ lineNumber: b[1],
279
279
  source: c[m]
280
280
  }));
281
281
  }
@@ -284,12 +284,12 @@ function yn() {
284
284
  parseOpera10: function(l) {
285
285
  for (var p = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, c = l.stacktrace.split(`
286
286
  `), d = [], m = 0, v = c.length; m < v; m += 2) {
287
- var A = p.exec(c[m]);
288
- A && d.push(
287
+ var b = p.exec(c[m]);
288
+ b && d.push(
289
289
  new n({
290
- functionName: A[3] || void 0,
291
- fileName: A[2],
292
- lineNumber: A[1],
290
+ functionName: b[3] || void 0,
291
+ fileName: b[2],
292
+ lineNumber: b[1],
293
293
  source: c[m]
294
294
  })
295
295
  );
@@ -303,11 +303,11 @@ function yn() {
303
303
  return !!c.match(i) && !c.match(/^Error created at/);
304
304
  }, this);
305
305
  return p.map(function(c) {
306
- var d = c.split("@"), m = this.extractLocation(d.pop()), v = d.shift() || "", A = v.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, w;
306
+ var d = c.split("@"), m = this.extractLocation(d.pop()), v = d.shift() || "", b = v.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, w;
307
307
  v.match(/\(([^)]*)\)/) && (w = v.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
308
308
  var S = w === void 0 || w === "[arguments not available]" ? void 0 : w.split(",");
309
309
  return new n({
310
- functionName: A,
310
+ functionName: b,
311
311
  args: S,
312
312
  fileName: m[0],
313
313
  lineNumber: m[1],
@@ -320,7 +320,7 @@ function yn() {
320
320
  });
321
321
  })(Zt);
322
322
  var wn = Zt.exports;
323
- const An = /* @__PURE__ */ vn(wn);
323
+ const bn = /* @__PURE__ */ vn(wn);
324
324
  let gt = () => {
325
325
  var r = (() => {
326
326
  var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, i = Object.prototype.hasOwnProperty, a = (f, g) => {
@@ -330,7 +330,7 @@ let gt = () => {
330
330
  return f;
331
331
  }, o = (f) => s(e({}, "__esModule", { value: !0 }), f), l = {};
332
332
  a(l, { default: () => cn });
333
- var p = (f) => Array.isArray(f), c = (f) => typeof f == "function", d = (f) => f.length === 0, m = (f) => typeof f == "number", v = (f) => typeof f == "object" && f !== null, A = (f) => f instanceof RegExp, w = (f) => typeof f == "string", S = (f) => f === void 0, P = (f) => {
333
+ var p = (f) => Array.isArray(f), c = (f) => typeof f == "function", d = (f) => f.length === 0, m = (f) => typeof f == "number", v = (f) => typeof f == "object" && f !== null, b = (f) => f instanceof RegExp, w = (f) => typeof f == "string", S = (f) => f === void 0, P = (f) => {
334
334
  const g = /* @__PURE__ */ new Map();
335
335
  return (y) => {
336
336
  const C = g.get(y);
@@ -342,7 +342,7 @@ let gt = () => {
342
342
  const C = { cache: {}, input: f, index: 0, indexMax: 0, options: y, output: [] };
343
343
  if (ee(g)(C) && C.index === f.length) return C.output;
344
344
  throw new Error(`Failed to parse at index ${C.indexMax}`);
345
- }, I = (f, g) => p(f) ? J(f, g) : w(f) ? D(f, g) : q(f, g), J = (f, g) => {
345
+ }, I = (f, g) => p(f) ? J(f, g) : w(f) ? B(f, g) : q(f, g), J = (f, g) => {
346
346
  const y = {};
347
347
  for (const C of f) {
348
348
  if (C.length !== 1) throw new Error(`Invalid character: "${C}"`);
@@ -352,11 +352,11 @@ let gt = () => {
352
352
  return (C) => {
353
353
  const _ = C.index, E = C.input;
354
354
  for (; C.index < E.length && E.charCodeAt(C.index) in y; ) C.index += 1;
355
- const B = C.index;
356
- if (B > _) {
355
+ const D = C.index;
356
+ if (D > _) {
357
357
  if (!S(g) && !C.options.silent) {
358
- const W = C.input.slice(_, B), K = c(g) ? g(W, E, String(_)) : g;
359
- S(K) || C.output.push(K);
358
+ const G = C.input.slice(_, D), j = c(g) ? g(G, E, String(_)) : g;
359
+ S(j) || C.output.push(j);
360
360
  }
361
361
  C.indexMax = Math.max(C.indexMax, C.index);
362
362
  }
@@ -366,16 +366,16 @@ let gt = () => {
366
366
  const y = f.source, C = f.flags.replace(/y|$/, "y"), _ = new RegExp(y, C);
367
367
  return _e((E) => {
368
368
  _.lastIndex = E.index;
369
- const B = _.exec(E.input);
370
- if (B) {
369
+ const D = _.exec(E.input);
370
+ if (D) {
371
371
  if (!S(g) && !E.options.silent) {
372
- const W = c(g) ? g(...B, E.input, String(E.index)) : g;
373
- S(W) || E.output.push(W);
372
+ const G = c(g) ? g(...D, E.input, String(E.index)) : g;
373
+ S(G) || E.output.push(G);
374
374
  }
375
- return E.index += B[0].length, E.indexMax = Math.max(E.indexMax, E.index), !0;
375
+ return E.index += D[0].length, E.indexMax = Math.max(E.indexMax, E.index), !0;
376
376
  } else return !1;
377
377
  });
378
- }, D = (f, g) => (y) => {
378
+ }, B = (f, g) => (y) => {
379
379
  if (y.input.startsWith(f, y.index)) {
380
380
  if (!S(g) && !y.options.silent) {
381
381
  const C = c(g) ? g(f, y.input, String(y.index)) : g;
@@ -386,14 +386,14 @@ let gt = () => {
386
386
  }, $ = (f, g, y, C) => {
387
387
  const _ = ee(f);
388
388
  return _e(Le(Ze((E) => {
389
- let B = 0;
390
- for (; B < y; ) {
391
- const W = E.index;
392
- if (!_(E) || (B += 1, E.index === W)) break;
389
+ let D = 0;
390
+ for (; D < y; ) {
391
+ const G = E.index;
392
+ if (!_(E) || (D += 1, E.index === G)) break;
393
393
  }
394
- return B >= g;
394
+ return D >= g;
395
395
  })));
396
- }, H = (f, g) => $(f, 0, 1), Q = (f, g) => $(f, 0, 1 / 0), G = (f, g) => {
396
+ }, H = (f, g) => $(f, 0, 1), Q = (f, g) => $(f, 0, 1 / 0), W = (f, g) => {
397
397
  const y = f.map(ee);
398
398
  return _e(Le(Ze((C) => {
399
399
  for (let _ = 0, E = y.length; _ < E; _++) if (!y[_](C)) return !1;
@@ -408,8 +408,8 @@ let gt = () => {
408
408
  }, Ze = (f, g = !1) => {
409
409
  const y = ee(f);
410
410
  return (C) => {
411
- const _ = C.index, E = C.output.length, B = y(C);
412
- return (!B || g) && (C.index = _, C.output.length !== E && (C.output.length = E)), B;
411
+ const _ = C.index, E = C.output.length, D = y(C);
412
+ return (!D || g) && (C.index = _, C.output.length !== E && (C.output.length = E)), D;
413
413
  };
414
414
  }, Le = (f, g) => ee(f), _e = /* @__PURE__ */ (() => {
415
415
  let f = 0;
@@ -419,20 +419,20 @@ let gt = () => {
419
419
  var dt;
420
420
  var E;
421
421
  if (_.options.memoization === !1) return y(_);
422
- const B = _.index, W = (E = _.cache)[C] || (E[C] = /* @__PURE__ */ new Map()), K = W.get(B);
423
- if (K === !1) return !1;
424
- if (m(K)) return _.index = K, !0;
425
- if (K) return _.index = K.index, (dt = K.output) != null && dt.length && _.output.push(...K.output), !0;
422
+ const D = _.index, G = (E = _.cache)[C] || (E[C] = /* @__PURE__ */ new Map()), j = G.get(D);
423
+ if (j === !1) return !1;
424
+ if (m(j)) return _.index = j, !0;
425
+ if (j) return _.index = j.index, (dt = j.output) != null && dt.length && _.output.push(...j.output), !0;
426
426
  {
427
427
  const ut = _.output.length;
428
428
  if (y(_)) {
429
429
  const ht = _.index, ft = _.output.length;
430
430
  if (ft > ut) {
431
431
  const dn = _.output.slice(ut, ft);
432
- W.set(B, { index: ht, output: dn });
433
- } else W.set(B, ht);
432
+ G.set(D, { index: ht, output: dn });
433
+ } else G.set(D, ht);
434
434
  return !0;
435
- } else return W.set(B, !1), !1;
435
+ } else return G.set(D, !1), !1;
436
436
  }
437
437
  };
438
438
  };
@@ -441,8 +441,8 @@ let gt = () => {
441
441
  return (y) => (g || (g = ee(f())), g(y));
442
442
  }, ee = P((f) => {
443
443
  if (c(f)) return d(f) ? Je(f) : f;
444
- if (w(f) || A(f)) return I(f);
445
- if (p(f)) return G(f);
444
+ if (w(f) || b(f)) return I(f);
445
+ if (p(f)) return W(f);
446
446
  if (v(f)) return X(Object.values(f));
447
447
  throw new Error("Invalid rule");
448
448
  }), Qe = "abcdefghijklmnopqrstuvwxyz", fr = (f) => {
@@ -464,28 +464,28 @@ let gt = () => {
464
464
  }, mr = (f, g, y) => Te(f, g).map((C) => String(C).padStart(y, "0")), tt = (f, g) => Te(et(f), et(g)).map(fr), Z = (f) => f, rt = (f) => pr((g) => O(g, f, { memoization: !1 }).join("")), pr = (f) => {
465
465
  const g = {};
466
466
  return (y) => g[y] ?? (g[y] = f(y));
467
- }, gr = I(/^\*\*\/\*$/, ".*"), vr = I(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (f, g, y) => `.*${g ? "" : "(?:^|/)"}${y.replaceAll(".", "\\.")}`), yr = I(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (f, g, y, C) => `.*${g ? "" : "(?:^|/)"}${y.replaceAll(".", "\\.")}(?:${C.replaceAll(",", "|").replaceAll(".", "\\.")})`), Re = I(/\\./, Z), wr = I(/[$.*+?^(){}[\]\|]/, (f) => `\\${f}`), Ar = I(/./, Z), br = I(/^(?:!!)*!(.*)$/, (f, g) => `(?!^${ct(g)}$).*?`), Sr = I(/^(!!)+/, ""), Cr = X([br, Sr]), Ir = I(/\/(\*\*\/)+/, "(?:/.+/|/)"), _r = I(/^(\*\*\/)+/, "(?:^|.*/)"), Pr = I(/\/(\*\*)$/, "(?:/.*|$)"), Er = I(/\*\*/, ".*"), nt = X([Ir, _r, Pr, Er]), kr = I(/\*\/(?!\*\*\/)/, "[^/]*/"), xr = I(/\*/, "[^/]*"), it = X([kr, xr]), at = I("?", "[^/]"), Mr = I("[", Z), Fr = I("]", Z), Lr = I(/[!^]/, "^/"), Tr = I(/[a-z]-[a-z]|[0-9]-[0-9]/i, Z), Rr = I(/[$.*+?^(){}[\|]/, (f) => `\\${f}`), Dr = I(/[^\]]/, Z), Br = X([Re, Rr, Tr, Dr]), st = G([Mr, H(Lr), Q(Br), Fr]), Or = I("{", "(?:"), Nr = I("}", ")"), Ur = I(/(\d+)\.\.(\d+)/, (f, g, y) => mr(+g, +y, Math.min(g.length, y.length)).join("|")), Vr = I(/([a-z]+)\.\.([a-z]+)/, (f, g, y) => tt(g, y).join("|")), zr = I(/([A-Z]+)\.\.([A-Z]+)/, (f, g, y) => tt(g.toLowerCase(), y.toLowerCase()).join("|").toUpperCase()), $r = X([Ur, Vr, zr]), ot = G([Or, $r, Nr]), Gr = I("{", "(?:"), Wr = I("}", ")"), qr = I(",", "|"), Hr = I(/[$.*+?^(){[\]\|]/, (f) => `\\${f}`), Kr = I(/[^}]/, Z), jr = Je(() => lt), Yr = X([nt, it, at, st, ot, jr, Re, Hr, qr, Kr]), lt = G([Gr, Q(Yr), Wr]), Xr = Q(X([gr, vr, yr, Cr, nt, it, at, st, ot, lt, Re, wr, Ar])), Zr = Xr, Jr = rt(Zr), ct = Jr, Qr = I(/\\./, Z), en = I(/./, Z), tn = I(/\*\*\*+/, "*"), rn = I(/([^/{[(!])\*\*/, (f, g) => `${g}*`), nn = I(/(^|.)\*\*(?=[^*/)\]}])/, (f, g) => `${g}*`), an = Q(X([Qr, tn, rn, nn, en])), sn = an, on = rt(sn), ln = on, De = (f, g) => {
467
+ }, gr = I(/^\*\*\/\*$/, ".*"), vr = I(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (f, g, y) => `.*${g ? "" : "(?:^|/)"}${y.replaceAll(".", "\\.")}`), yr = I(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (f, g, y, C) => `.*${g ? "" : "(?:^|/)"}${y.replaceAll(".", "\\.")}(?:${C.replaceAll(",", "|").replaceAll(".", "\\.")})`), Re = I(/\\./, Z), wr = I(/[$.*+?^(){}[\]\|]/, (f) => `\\${f}`), br = I(/./, Z), Ar = I(/^(?:!!)*!(.*)$/, (f, g) => `(?!^${ct(g)}$).*?`), Sr = I(/^(!!)+/, ""), Cr = X([Ar, Sr]), Ir = I(/\/(\*\*\/)+/, "(?:/.+/|/)"), _r = I(/^(\*\*\/)+/, "(?:^|.*/)"), Pr = I(/\/(\*\*)$/, "(?:/.*|$)"), Er = I(/\*\*/, ".*"), nt = X([Ir, _r, Pr, Er]), kr = I(/\*\/(?!\*\*\/)/, "[^/]*/"), xr = I(/\*/, "[^/]*"), it = X([kr, xr]), at = I("?", "[^/]"), Mr = I("[", Z), Fr = I("]", Z), Lr = I(/[!^]/, "^/"), Tr = I(/[a-z]-[a-z]|[0-9]-[0-9]/i, Z), Rr = I(/[$.*+?^(){}[\|]/, (f) => `\\${f}`), Br = I(/[^\]]/, Z), Dr = X([Re, Rr, Tr, Br]), st = W([Mr, H(Lr), Q(Dr), Fr]), Or = I("{", "(?:"), Nr = I("}", ")"), Ur = I(/(\d+)\.\.(\d+)/, (f, g, y) => mr(+g, +y, Math.min(g.length, y.length)).join("|")), Vr = I(/([a-z]+)\.\.([a-z]+)/, (f, g, y) => tt(g, y).join("|")), zr = I(/([A-Z]+)\.\.([A-Z]+)/, (f, g, y) => tt(g.toLowerCase(), y.toLowerCase()).join("|").toUpperCase()), $r = X([Ur, Vr, zr]), ot = W([Or, $r, Nr]), Wr = I("{", "(?:"), Gr = I("}", ")"), qr = I(",", "|"), Hr = I(/[$.*+?^(){[\]\|]/, (f) => `\\${f}`), jr = I(/[^}]/, Z), Kr = Je(() => lt), Yr = X([nt, it, at, st, ot, Kr, Re, Hr, qr, jr]), lt = W([Wr, Q(Yr), Gr]), Xr = Q(X([gr, vr, yr, Cr, nt, it, at, st, ot, lt, Re, wr, br])), Zr = Xr, Jr = rt(Zr), ct = Jr, Qr = I(/\\./, Z), en = I(/./, Z), tn = I(/\*\*\*+/, "*"), rn = I(/([^/{[(!])\*\*/, (f, g) => `${g}*`), nn = I(/(^|.)\*\*(?=[^*/)\]}])/, (f, g) => `${g}*`), an = Q(X([Qr, tn, rn, nn, en])), sn = an, on = rt(sn), ln = on, Be = (f, g) => {
468
468
  const y = Array.isArray(f) ? f : [f];
469
469
  if (!y.length) return !1;
470
- const C = y.map(De.compile), _ = y.every((B) => /(\/(?:\*\*)?|\[\/\])$/.test(B)), E = g.replace(/[\\\/]+/g, "/").replace(/\/$/, _ ? "/" : "");
471
- return C.some((B) => B.test(E));
470
+ const C = y.map(Be.compile), _ = y.every((D) => /(\/(?:\*\*)?|\[\/\])$/.test(D)), E = g.replace(/[\\\/]+/g, "/").replace(/\/$/, _ ? "/" : "");
471
+ return C.some((D) => D.test(E));
472
472
  };
473
- De.compile = (f) => new RegExp(`^${ct(ln(f))}$`, "s");
474
- var cn = De;
473
+ Be.compile = (f) => new RegExp(`^${ct(ln(f))}$`, "s");
474
+ var cn = Be;
475
475
  return o(l);
476
476
  })();
477
477
  return r.default || r;
478
478
  }, Oe;
479
- const bn = (r, e) => (Oe || (Oe = gt(), gt = null), Oe(r, e)), Sn = /^[A-Za-z]:\//;
479
+ const An = (r, e) => (Oe || (Oe = gt(), gt = null), Oe(r, e)), Sn = /^[A-Za-z]:\//;
480
480
  function de(r = "") {
481
481
  return r && r.replace(/\\/g, "/").replace(Sn, (e) => e.toUpperCase());
482
482
  }
483
- const Cn = /^[/\\]{2}/, In = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, Jt = /^[A-Za-z]:$/, vt = /^\/([A-Za-z]:)?$/, _n = /.(\.[^./]+|\.)$/, Pn = /^[/\\]|^[a-zA-Z]:[/\\]/, En = "/", Ke = function(r) {
483
+ const Cn = /^[/\\]{2}/, In = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, Jt = /^[A-Za-z]:$/, vt = /^\/([A-Za-z]:)?$/, _n = /.(\.[^./]+|\.)$/, Pn = /^[/\\]|^[a-zA-Z]:[/\\]/, En = "/", je = function(r) {
484
484
  if (r.length === 0)
485
485
  return ".";
486
486
  r = de(r);
487
487
  const e = r.match(Cn), t = ye(r), n = r[r.length - 1] === "/";
488
- return r = je(r, !t), r.length === 0 ? t ? "/" : n ? "./" : "." : (n && (r += "/"), Jt.test(r) && (r += "/"), e ? t ? `//${r}` : `//./${r}` : t && !ye(r) ? `/${r}` : r);
488
+ return r = Ke(r, !t), r.length === 0 ? t ? "/" : n ? "./" : "." : (n && (r += "/"), Jt.test(r) && (r += "/"), e ? t ? `//${r}` : `//./${r}` : t && !ye(r) ? `/${r}` : r);
489
489
  }, kn = function(...r) {
490
490
  let e = "";
491
491
  for (const t of r)
@@ -495,7 +495,7 @@ const Cn = /^[/\\]{2}/, In = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,
495
495
  n && i ? e += t.slice(1) : e += n || i ? t : `/${t}`;
496
496
  } else
497
497
  e += t;
498
- return Ke(e);
498
+ return je(e);
499
499
  };
500
500
  function xn() {
501
501
  return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
@@ -507,9 +507,9 @@ const xe = function(...r) {
507
507
  const i = n >= 0 ? r[n] : xn();
508
508
  !i || i.length === 0 || (e = `${i}/${e}`, t = ye(i));
509
509
  }
510
- return e = je(e, !t), t && !ye(e) ? `/${e}` : e.length > 0 ? e : ".";
510
+ return e = Ke(e, !t), t && !ye(e) ? `/${e}` : e.length > 0 ? e : ".";
511
511
  };
512
- function je(r, e) {
512
+ function Ke(r, e) {
513
513
  let t = "", n = 0, i = -1, a = 0, s = null;
514
514
  for (let o = 0; o <= r.length; ++o) {
515
515
  if (o < r.length)
@@ -589,7 +589,7 @@ const ye = function(r) {
589
589
  ext: n,
590
590
  name: t.slice(0, t.length - n.length)
591
591
  };
592
- }, Rn = (r, e) => bn(e, Ke(r)), yt = {
592
+ }, Rn = (r, e) => An(e, je(r)), yt = {
593
593
  __proto__: null,
594
594
  basename: tr,
595
595
  dirname: er,
@@ -598,21 +598,21 @@ const ye = function(r) {
598
598
  isAbsolute: ye,
599
599
  join: kn,
600
600
  matchesGlob: Rn,
601
- normalize: Ke,
602
- normalizeString: je,
601
+ normalize: je,
602
+ normalizeString: Ke,
603
603
  parse: Tn,
604
604
  relative: Fn,
605
605
  resolve: xe,
606
606
  sep: En,
607
607
  toNamespacedPath: Mn
608
- }, Dn = /* @__PURE__ */ (() => {
608
+ }, Bn = /* @__PURE__ */ (() => {
609
609
  var r;
610
610
  return ((r = globalThis.process) == null ? void 0 : r.platform) === "win32" ? ";" : ":";
611
- })(), Bn = { posix: void 0, win32: void 0 }, rr = (r = Dn) => new Proxy(yt, {
611
+ })(), Dn = { posix: void 0, win32: void 0 }, rr = (r = Bn) => new Proxy(yt, {
612
612
  get(e, t) {
613
- return t === "delimiter" ? r : t === "posix" ? Ge : t === "win32" ? On : Bn[t] || yt[t];
613
+ return t === "delimiter" ? r : t === "posix" ? We : t === "win32" ? On : Dn[t] || yt[t];
614
614
  }
615
- }), Ge = /* @__PURE__ */ rr(":"), On = /* @__PURE__ */ rr(";");
615
+ }), We = /* @__PURE__ */ rr(":"), On = /* @__PURE__ */ rr(";");
616
616
  var F = /* @__PURE__ */ ((r) => (r[r.Error = 0] = "Error", r[r.Warning = 1] = "Warning", r[r.Log = 2] = "Log", r[r.Verbose = 3] = "Verbose", r[r.Debug = 4] = "Debug", r))(F || {}), M = /* @__PURE__ */ ((r) => (r.Error = "error", r.Warning = "warn", r.Log = "log", r.Verbose = "verbose", r.Debug = "debug", r))(M || {}), se = /* @__PURE__ */ ((r) => (r.JSON = "json", r.Pretty = "pretty", r))(se || {});
617
617
  const Nn = !0;
618
618
  function R(r, e, t = r) {
@@ -655,7 +655,7 @@ function Un(r = Nn) {
655
655
  bgWhite: r ? R("\x1B[47m", "\x1B[49m") : String
656
656
  };
657
657
  }
658
- const N = Un(), We = {
658
+ const N = Un(), Ge = {
659
659
  [M.Error]: F.Error,
660
660
  [M.Warning]: F.Warning,
661
661
  [M.Log]: F.Log,
@@ -685,7 +685,7 @@ const N = Un(), We = {
685
685
  F.Log,
686
686
  F.Verbose,
687
687
  F.Debug
688
- ], At = [se.JSON, se.Pretty];
688
+ ], bt = [se.JSON, se.Pretty];
689
689
  function $n(r) {
690
690
  return r.stack == null ? [] : r.stack.split(`
691
691
  `).map((e) => e.trim()).slice(1).filter((e) => !!/^at (.*)( \(.*:(\d+):(\d+)\))|at (.*)(:(\d+):(\d+))/i.exec(e)).map((e) => {
@@ -724,11 +724,11 @@ function ar(r, e, t, n, i) {
724
724
  message: n
725
725
  };
726
726
  }
727
- function Gn(r, e, t, n, i, a) {
727
+ function Wn(r, e, t, n, i, a) {
728
728
  const s = ar(r, e, t, n, a);
729
729
  return typeof i < "u" && i !== null && (s.errored = !0, s.error = { stack: i }), s;
730
730
  }
731
- function bt(r) {
731
+ function At(r) {
732
732
  let e = "";
733
733
  switch (typeof r) {
734
734
  case "number":
@@ -752,7 +752,7 @@ function bt(r) {
752
752
  function Pe(r) {
753
753
  const e = [];
754
754
  e.push(r["@localetime"]), e.push(
755
- zn[We[r.level]](
755
+ zn[Ge[r.level]](
756
756
  `[${r.level}]`
757
757
  )
758
758
  );
@@ -763,14 +763,14 @@ function Pe(r) {
763
763
  for (const [a, s] of n) {
764
764
  let o = s;
765
765
  if (ir(s)) {
766
- if (s.message && (o = bt(s.message)), o || (o = ""), s.cause != null)
766
+ if (s.message && (o = At(s.message)), o || (o = ""), s.cause != null)
767
767
  try {
768
768
  o += JSON.stringify(s.cause);
769
769
  } catch {
770
770
  o += String(s.cause);
771
771
  }
772
772
  } else
773
- o = bt(s);
773
+ o = At(s);
774
774
  e.push(`${N.gray(a)}${N.gray("=")}${o}`);
775
775
  }
776
776
  n.length > 0 && e.push("}");
@@ -778,7 +778,7 @@ function Pe(r) {
778
778
  return r.errored != null && r.errored && r.error && r.error.stack != null && r.error.stack && (i += `
779
779
  ${r.error.stack}`), i;
780
780
  }
781
- function Wn(r) {
781
+ function Gn(r) {
782
782
  return r >= F.Debug;
783
783
  }
784
784
  function qn(r) {
@@ -787,10 +787,10 @@ function qn(r) {
787
787
  function Hn(r) {
788
788
  return r >= F.Log;
789
789
  }
790
- function Kn(r) {
790
+ function jn(r) {
791
791
  return r >= F.Warning;
792
792
  }
793
- function jn(r) {
793
+ function Kn(r) {
794
794
  return r >= F.Error;
795
795
  }
796
796
  function sr() {
@@ -863,8 +863,8 @@ function or(r) {
863
863
  withLogLevelString: (c) => {
864
864
  const d = e.child();
865
865
  if (wt.includes(c))
866
- d.logLevel = We[c], d.shouldUseGlobalConfig = !1, d.debug(
867
- `setting log level to ${c} (${We[c]})`
866
+ d.logLevel = Ge[c], d.shouldUseGlobalConfig = !1, d.debug(
867
+ `setting log level to ${c} (${Ge[c]})`
868
868
  );
869
869
  else
870
870
  throw new Error(
@@ -876,11 +876,11 @@ function or(r) {
876
876
  },
877
877
  withFormat: (c) => {
878
878
  const d = e.child();
879
- if (At.includes(c))
879
+ if (bt.includes(c))
880
880
  d.format = c, d.shouldUseGlobalConfig = !1, d.debug(`setting format to ${c}`);
881
881
  else
882
882
  throw new Error(
883
- `format ${c} is not available. available formats are: ${At.join(
883
+ `format ${c} is not available. available formats are: ${bt.join(
884
884
  ", "
885
885
  )}`
886
886
  );
@@ -949,21 +949,21 @@ function or(r) {
949
949
  Array.isArray(w) && w.length > 0 ? console[d](Pe(c), ...w) : Object.keys(w).length > 0 ? console[d](Pe(c), w) : console[d](Pe(c));
950
950
  return;
951
951
  }
952
- const A = v === se.Pretty ? Pe(c) : JSON.stringify(c);
953
- console[d](A);
952
+ const b = v === se.Pretty ? Pe(c) : JSON.stringify(c);
953
+ console[d](b);
954
954
  }, o = {
955
- [M.Debug]: Wn,
955
+ [M.Debug]: Gn,
956
956
  [M.Verbose]: qn,
957
957
  [M.Log]: Hn,
958
- [M.Warning]: Kn
958
+ [M.Warning]: jn
959
959
  }, l = {
960
960
  [M.Debug]: "debug",
961
961
  [M.Verbose]: "log",
962
962
  [M.Log]: "log",
963
963
  [M.Warning]: "warn"
964
964
  }, p = (c, d, m) => {
965
- const v = t(), A = o[c];
966
- if (!A(v))
965
+ const v = t(), b = o[c];
966
+ if (!b(v))
967
967
  return;
968
968
  const w = a(m), S = ar(
969
969
  c,
@@ -984,22 +984,22 @@ function or(r) {
984
984
  p(M.Warning, c, d);
985
985
  }, e.error = (c, d, ...m) => {
986
986
  const v = t();
987
- if (!jn(v))
987
+ if (!Kn(v))
988
988
  return;
989
- const A = a(m), w = Gn(
989
+ const b = a(m), w = Wn(
990
990
  M.Error,
991
991
  e.context,
992
- A,
992
+ b,
993
993
  c,
994
994
  d,
995
995
  i()
996
996
  );
997
- s(w, "error", A);
997
+ s(w, "error", b);
998
998
  }, e.errorWithError = (c, d, ...m) => e.withError(d).error(c, void 0, ...m), e;
999
999
  }
1000
1000
  function Qn(r) {
1001
1001
  var a;
1002
- const t = An.parse(new Error())[1], n = ((a = t.fileName) == null ? void 0 : a.replace("async", "").trim()) ?? "", i = Ge.join(...n.split(Ge.sep).slice(-2));
1002
+ const t = bn.parse(new Error())[1], n = ((a = t.fileName) == null ? void 0 : a.replace("async", "").trim()) ?? "", i = We.join(...n.split(We.sep).slice(-2));
1003
1003
  return r = r ?? `${i}:${t.lineNumber}`, or(Xn(n, r));
1004
1004
  }
1005
1005
  const ei = (r) => Qn(r).useGlobalConfig();
@@ -1145,7 +1145,7 @@ async function ci(r) {
1145
1145
  function di() {
1146
1146
  te.length > 0 && li(), h.log("[CLS] Cleaned up");
1147
1147
  }
1148
- function b(r, e = "info", t = {}) {
1148
+ function A(r, e = "info", t = {}) {
1149
1149
  const n = {
1150
1150
  environment: "unknown",
1151
1151
  sessionToken: T.getSessionToken() ?? "",
@@ -1222,7 +1222,7 @@ const Se = class Se {
1222
1222
  async createAndInitializeStreamingPlayer() {
1223
1223
  if (this.streamingPlayer)
1224
1224
  return;
1225
- const { StreamingAudioPlayer: e } = await import("./StreamingAudioPlayer-C1qVOIFx.js");
1225
+ const { StreamingAudioPlayer: e } = await import("./StreamingAudioPlayer-BWRB8VI8.js");
1226
1226
  this.streamingPlayer = new e({
1227
1227
  sampleRate: k.audio.sampleRate,
1228
1228
  channelCount: 1,
@@ -1232,7 +1232,7 @@ const Se = class Se {
1232
1232
  await this.streamingPlayer.initialize();
1233
1233
  } catch (t) {
1234
1234
  const n = t instanceof Error ? t.message : String(t);
1235
- throw h.error("[AnimationPlayer] Failed to initialize streaming player:", n), b("character_player", "error", {
1235
+ throw h.error("[AnimationPlayer] Failed to initialize streaming player:", n), A("character_player", "error", {
1236
1236
  event: "streaming_player_initialize_failed",
1237
1237
  reason: n
1238
1238
  }), t;
@@ -1555,36 +1555,36 @@ class gi {
1555
1555
  throw new Error("Failed to allocate AvatarFlameParams structure");
1556
1556
  let i = 0;
1557
1557
  for (let v = 0; v < 300; v++) {
1558
- const A = ((a = e.shape_params) == null ? void 0 : a[v]) || 0;
1559
- this.module.setValue(n + i, A, "float"), i += 4;
1558
+ const b = ((a = e.shape_params) == null ? void 0 : a[v]) || 0;
1559
+ this.module.setValue(n + i, b, "float"), i += 4;
1560
1560
  }
1561
1561
  for (let v = 0; v < 100; v++) {
1562
- const A = ((s = e.expr_params) == null ? void 0 : s[v]) || 0;
1563
- this.module.setValue(n + i, A, "float"), i += 4;
1562
+ const b = ((s = e.expr_params) == null ? void 0 : s[v]) || 0;
1563
+ this.module.setValue(n + i, b, "float"), i += 4;
1564
1564
  }
1565
1565
  for (let v = 0; v < 3; v++) {
1566
- const A = ((o = e.rotation) == null ? void 0 : o[v]) || 0;
1567
- this.module.setValue(n + i, A, "float"), i += 4;
1566
+ const b = ((o = e.rotation) == null ? void 0 : o[v]) || 0;
1567
+ this.module.setValue(n + i, b, "float"), i += 4;
1568
1568
  }
1569
1569
  for (let v = 0; v < 3; v++) {
1570
- const A = ((l = e.translation) == null ? void 0 : l[v]) || 0;
1571
- this.module.setValue(n + i, A, "float"), i += 4;
1570
+ const b = ((l = e.translation) == null ? void 0 : l[v]) || 0;
1571
+ this.module.setValue(n + i, b, "float"), i += 4;
1572
1572
  }
1573
1573
  for (let v = 0; v < 3; v++) {
1574
- const A = ((p = e.neck_pose) == null ? void 0 : p[v]) || 0;
1575
- this.module.setValue(n + i, A, "float"), i += 4;
1574
+ const b = ((p = e.neck_pose) == null ? void 0 : p[v]) || 0;
1575
+ this.module.setValue(n + i, b, "float"), i += 4;
1576
1576
  }
1577
1577
  for (let v = 0; v < 3; v++) {
1578
- const A = ((c = e.jaw_pose) == null ? void 0 : c[v]) || 0;
1579
- this.module.setValue(n + i, A, "float"), i += 4;
1578
+ const b = ((c = e.jaw_pose) == null ? void 0 : c[v]) || 0;
1579
+ this.module.setValue(n + i, b, "float"), i += 4;
1580
1580
  }
1581
1581
  for (let v = 0; v < 6; v++) {
1582
- const A = ((d = e.eyes_pose) == null ? void 0 : d[v]) || 0;
1583
- this.module.setValue(n + i, A, "float"), i += 4;
1582
+ const b = ((d = e.eyes_pose) == null ? void 0 : d[v]) || 0;
1583
+ this.module.setValue(n + i, b, "float"), i += 4;
1584
1584
  }
1585
1585
  for (let v = 0; v < 2; v++) {
1586
- const A = ((m = e.eyelid) == null ? void 0 : m[v]) || 0;
1587
- this.module.setValue(n + i, A, "float"), i += 4;
1586
+ const b = ((m = e.eyelid) == null ? void 0 : m[v]) || 0;
1587
+ this.module.setValue(n + i, b, "float"), i += 4;
1588
1588
  }
1589
1589
  return this.module.setValue(n + i, e.has_eyelid ? 1 : 0, "i32"), i += 4, n;
1590
1590
  }
@@ -2284,22 +2284,22 @@ class L {
2284
2284
  }
2285
2285
  h.log(`[AvatarKit] Initializing with appId: ${e}, environment: ${t.environment}`), this._configuration = t, T.setAppId(e), h.log(`[AvatarKit] Client ID: ${T.getClientId()}`), this._fetchSdkConfig().catch((s) => {
2286
2286
  const o = s instanceof Error ? s.message : String(s);
2287
- h.warn("Failed to fetch SDK config from remote, using defaults:", o), b("sdk_config", "warning", {
2287
+ h.warn("Failed to fetch SDK config from remote, using defaults:", o), A("sdk_config", "warning", {
2288
2288
  reason: o
2289
2289
  });
2290
- }), await this.initializeWASMModule(), await this.initializeTemplateResources(), this._isInitialized = !0, b("sdk_initialize", "info", {
2290
+ }), await this.initializeWASMModule(), await this.initializeTemplateResources(), this._isInitialized = !0, A("sdk_initialize", "info", {
2291
2291
  appId: T.getAppId(),
2292
2292
  environment: (n = this._configuration) == null ? void 0 : n.environment
2293
- }), fi() && b("sdk_first_use", "info", {
2293
+ }), fi() && A("sdk_first_use", "info", {
2294
2294
  appId: T.getAppId(),
2295
2295
  environment: (i = this._configuration) == null ? void 0 : i.environment
2296
- }), mi() && b("sdk_daily_active", "info", {
2296
+ }), mi() && A("sdk_daily_active", "info", {
2297
2297
  appId: T.getAppId(),
2298
2298
  environment: (a = this._configuration) == null ? void 0 : a.environment
2299
2299
  }), xt.start(this._configuration.environment), h.log("[AvatarKit] Successfully initialized");
2300
2300
  } catch (s) {
2301
2301
  const o = s instanceof Error ? s.message : String(s);
2302
- throw h.error("Failed to initialize AvatarKit:", o), b("sdk_startup", "error", {
2302
+ throw h.error("Failed to initialize AvatarKit:", o), A("sdk_startup", "error", {
2303
2303
  reason: o
2304
2304
  }), s;
2305
2305
  }
@@ -2345,7 +2345,7 @@ class L {
2345
2345
  await this._avatarCore.loadTemplateResourcesFromBuffers(n) ? h.log("[AvatarKit] Template resources initialized successfully") : h.log("[AvatarKit] Template resources already initialized, skipping...");
2346
2346
  } catch (e) {
2347
2347
  const t = e instanceof Error ? e.message : String(e);
2348
- throw h.error("[AvatarKit] Failed to initialize template resources:", t), b("template_init", "error", {
2348
+ throw h.error("[AvatarKit] Failed to initialize template resources:", t), A("template_init", "error", {
2349
2349
  reason: t,
2350
2350
  stage: "sdk_init"
2351
2351
  }), new Error(`SDK initialization failed: Template resources loading failed - ${t}`);
@@ -2391,7 +2391,7 @@ class L {
2391
2391
  */
2392
2392
  static getPlaybackMode() {
2393
2393
  var e;
2394
- return ((e = this._configuration) == null ? void 0 : e.drivingServiceMode) ?? be.sdk;
2394
+ return ((e = this._configuration) == null ? void 0 : e.drivingServiceMode) ?? Ae.sdk;
2395
2395
  }
2396
2396
  /**
2397
2397
  * 获取AvatarCore实例(仅供 SDK 内部使用)
@@ -2419,7 +2419,7 @@ class L {
2419
2419
  this._dynamicSdkConfig = await ui(this._version);
2420
2420
  } catch (e) {
2421
2421
  const t = e instanceof Error ? e.message : String(e);
2422
- h.warn("Failed to fetch SDK config from remote, using defaults:", t), b("sdk_config", "warning", {
2422
+ h.warn("Failed to fetch SDK config from remote, using defaults:", t), A("sdk_config", "warning", {
2423
2423
  reason: t
2424
2424
  });
2425
2425
  }
@@ -2454,7 +2454,7 @@ class L {
2454
2454
  };
2455
2455
  }
2456
2456
  }
2457
- u(L, "_isInitialized", !1), u(L, "_configuration", null), u(L, "_version", "1.0.0-beta.24"), u(L, "_avatarCore", null), u(L, "_dynamicSdkConfig", null);
2457
+ u(L, "_isInitialized", !1), u(L, "_configuration", null), u(L, "_version", "1.0.0-beta.25"), u(L, "_avatarCore", null), u(L, "_dynamicSdkConfig", null);
2458
2458
  function yi() {
2459
2459
  let r = 0, e = 0;
2460
2460
  for (let n = 0; n < 28; n += 7) {
@@ -2508,14 +2508,14 @@ function wi(r, e) {
2508
2508
  return n ? "-" + i : i;
2509
2509
  }
2510
2510
  function lr(r, e) {
2511
- if ({ lo: r, hi: e } = Ai(r, e), e <= 2097151)
2511
+ if ({ lo: r, hi: e } = bi(r, e), e <= 2097151)
2512
2512
  return String(ke * e + r);
2513
2513
  const t = r & 16777215, n = (r >>> 24 | e << 8) & 16777215, i = e >> 16 & 65535;
2514
2514
  let a = t + n * 6777216 + i * 6710656, s = n + i * 8147497, o = i * 2;
2515
2515
  const l = 1e7;
2516
2516
  return a >= l && (s += Math.floor(a / l), a %= l), s >= l && (o += Math.floor(s / l), s %= l), o.toString() + Ft(s) + Ft(a);
2517
2517
  }
2518
- function Ai(r, e) {
2518
+ function bi(r, e) {
2519
2519
  return { lo: r >>> 0, hi: e >>> 0 };
2520
2520
  }
2521
2521
  function Ye(r, e) {
@@ -2539,7 +2539,7 @@ function Lt(r, e) {
2539
2539
  e.push(1);
2540
2540
  }
2541
2541
  }
2542
- function bi() {
2542
+ function Ai() {
2543
2543
  let r = this.buf[this.pos++], e = r & 127;
2544
2544
  if (!(r & 128))
2545
2545
  return this.assertBounds(), e;
@@ -2710,7 +2710,7 @@ class ue {
2710
2710
  * Write a `uint32` value, an unsigned 32 bit varint.
2711
2711
  */
2712
2712
  uint32(e) {
2713
- for (Dt(e); e > 127; )
2713
+ for (Bt(e); e > 127; )
2714
2714
  this.buf.push(e & 127 | 128), e = e >>> 7;
2715
2715
  return this.buf.push(e), this;
2716
2716
  }
@@ -2758,7 +2758,7 @@ class ue {
2758
2758
  * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
2759
2759
  */
2760
2760
  fixed32(e) {
2761
- Dt(e);
2761
+ Bt(e);
2762
2762
  let t = new Uint8Array(4);
2763
2763
  return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t);
2764
2764
  }
@@ -2814,7 +2814,7 @@ class ue {
2814
2814
  }
2815
2815
  class V {
2816
2816
  constructor(e, t = dr().decodeUtf8) {
2817
- this.decodeUtf8 = t, this.varint64 = yi, this.uint32 = bi, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength);
2817
+ this.decodeUtf8 = t, this.varint64 = yi, this.uint32 = Ai, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength);
2818
2818
  }
2819
2819
  /**
2820
2820
  * Reads a tag - field number and wire type.
@@ -2967,7 +2967,7 @@ function Ve(r) {
2967
2967
  if (!Number.isInteger(r) || r > Pi || r < Ei)
2968
2968
  throw new Error("invalid int32: " + r);
2969
2969
  }
2970
- function Dt(r) {
2970
+ function Bt(r) {
2971
2971
  if (typeof r == "string")
2972
2972
  r = Number(r);
2973
2973
  else if (typeof r != "number")
@@ -3021,7 +3021,7 @@ function Mi(r) {
3021
3021
  return "UNRECOGNIZED";
3022
3022
  }
3023
3023
  }
3024
- function Bt() {
3024
+ function Dt() {
3025
3025
  return { reqId: "", audio: new Uint8Array(0), end: !1 };
3026
3026
  }
3027
3027
  const fe = {
@@ -3031,7 +3031,7 @@ const fe = {
3031
3031
  decode(r, e) {
3032
3032
  const t = r instanceof V ? r : new V(r);
3033
3033
  let n = e === void 0 ? t.len : t.pos + e;
3034
- const i = Bt();
3034
+ const i = Dt();
3035
3035
  for (; t.pos < n; ) {
3036
3036
  const a = t.uint32();
3037
3037
  switch (a >>> 3) {
@@ -3075,7 +3075,7 @@ const fe = {
3075
3075
  return fe.fromPartial(r ?? {});
3076
3076
  },
3077
3077
  fromPartial(r) {
3078
- const e = Bt();
3078
+ const e = Dt();
3079
3079
  return e.reqId = r.reqId ?? "", e.audio = r.audio ?? new Uint8Array(0), e.end = r.end ?? !1, e;
3080
3080
  }
3081
3081
  };
@@ -3525,7 +3525,7 @@ class Ri extends Ti {
3525
3525
  try {
3526
3526
  this.isConnecting = !0, this.currentCharacterId = t, T.generateConnectionId();
3527
3527
  const n = this.buildWebSocketUrl(t);
3528
- h.log("[AnimationWebSocketClient] Connecting to:", n), await this.connectWebSocket(n), h.log("[AnimationWebSocketClient] Connected successfully"), b("character_animation_service", "info", {
3528
+ h.log("[AnimationWebSocketClient] Connecting to:", n), await this.connectWebSocket(n), h.log("[AnimationWebSocketClient] Connected successfully"), A("character_animation_service", "info", {
3529
3529
  characterId: t,
3530
3530
  event: "connect_success",
3531
3531
  url: n
@@ -3533,7 +3533,7 @@ class Ri extends Ti {
3533
3533
  } catch (n) {
3534
3534
  this.isConnecting = !1;
3535
3535
  const i = n instanceof Error ? n.message : String(n);
3536
- throw h.error("[AnimationWebSocketClient] Connection failed:", i), b("character_animation_service", "error", {
3536
+ throw h.error("[AnimationWebSocketClient] Connection failed:", i), A("character_animation_service", "error", {
3537
3537
  characterId: t,
3538
3538
  event: "connect_failed",
3539
3539
  reason: i
@@ -3568,7 +3568,7 @@ class Ri extends Ti {
3568
3568
  return this.ws.send(o), !0;
3569
3569
  } catch (a) {
3570
3570
  const s = a instanceof Error ? a.message : String(a);
3571
- return h.error("[AnimationWebSocketClient] Failed to send audio data:", s), b("character_animation_service", "warning", {
3571
+ return h.error("[AnimationWebSocketClient] Failed to send audio data:", s), A("character_animation_service", "warning", {
3572
3572
  characterId: this.currentCharacterId,
3573
3573
  event: "send_audio_failed",
3574
3574
  conversationId: t,
@@ -3609,19 +3609,19 @@ class Ri extends Ti {
3609
3609
  this.isConnecting = !1, this.currentRetryCount = 0, this.isManuallyDisconnected = !1, this.emit("connected"), n();
3610
3610
  }, this.ws.onmessage = (a) => {
3611
3611
  a.data instanceof ArrayBuffer ? this.handleMessage(a.data) : a.data instanceof Blob ? a.data.arrayBuffer().then(this.handleMessage.bind(this)).catch((s) => {
3612
- h.error("[AnimationWebSocketClient] Failed to convert Blob to ArrayBuffer:", s), b("character_animation_service", "error", {
3612
+ h.error("[AnimationWebSocketClient] Failed to convert Blob to ArrayBuffer:", s), A("character_animation_service", "error", {
3613
3613
  characterId: this.currentCharacterId,
3614
3614
  event: "decode_blob_failed",
3615
3615
  reason: s instanceof Error ? s.message : String(s)
3616
3616
  }), this.emit("error", s);
3617
3617
  }) : h.warn("[AnimationWebSocketClient] Received non-binary data:", typeof a.data);
3618
3618
  }, this.ws.onerror = (a) => {
3619
- h.errorWithError("[AnimationWebSocketClient] WebSocket error:", a), b("character_animation_service", "error", {
3619
+ h.errorWithError("[AnimationWebSocketClient] WebSocket error:", a), A("character_animation_service", "error", {
3620
3620
  characterId: this.currentCharacterId,
3621
3621
  event: "websocket_error"
3622
3622
  }), this.emit("error", new Error("WebSocket error")), !this.isManuallyDisconnected && this.currentRetryCount < this.reconnectAttempts && this.scheduleReconnect();
3623
3623
  }, this.ws.onclose = (a) => {
3624
- h.log("[AnimationWebSocketClient] WebSocket closed:", a.code, a.reason), this.emit("disconnected", a.reason || "Connection closed"), a.code === 1012 && b("character_animation_service", "error", {
3624
+ h.log("[AnimationWebSocketClient] WebSocket closed:", a.code, a.reason), this.emit("disconnected", a.reason || "Connection closed"), a.code === 1012 && A("character_animation_service", "error", {
3625
3625
  characterId: this.currentCharacterId,
3626
3626
  event: "service_restart",
3627
3627
  reason: a.reason || "service restart"
@@ -3636,7 +3636,7 @@ class Ri extends Ti {
3636
3636
  try {
3637
3637
  const n = new V(new Uint8Array(t)), i = He.decode(n);
3638
3638
  if (i.error) {
3639
- h.error(`[AnimationWebSocketClient] Server error: reqId=${i.error.reqId}, code=${i.error.code}, reason=${i.error.reason}`), b("character_animation_service", "error", {
3639
+ h.error(`[AnimationWebSocketClient] Server error: reqId=${i.error.reqId}, code=${i.error.code}, reason=${i.error.reason}`), A("character_animation_service", "error", {
3640
3640
  characterId: this.currentCharacterId,
3641
3641
  event: "server_error",
3642
3642
  reqId: i.error.reqId,
@@ -3646,7 +3646,7 @@ class Ri extends Ti {
3646
3646
  return;
3647
3647
  }
3648
3648
  if (i.type === Ie.MESSAGE_ERROR) {
3649
- h.warn("[AnimationWebSocketClient] MESSAGE_ERROR received but no error field in message"), b("character_animation_service", "warning", {
3649
+ h.warn("[AnimationWebSocketClient] MESSAGE_ERROR received but no error field in message"), A("character_animation_service", "warning", {
3650
3650
  characterId: this.currentCharacterId,
3651
3651
  event: "message_error_without_payload"
3652
3652
  }), this.emit("error", new Error("Server returned error message without error details"));
@@ -3655,7 +3655,7 @@ class Ri extends Ti {
3655
3655
  this.emit("message", i);
3656
3656
  } catch (n) {
3657
3657
  const i = n instanceof Error ? n.message : String(n);
3658
- h.error("[AnimationWebSocketClient] Failed to decode message:", i), b("character_animation_service", "error", {
3658
+ h.error("[AnimationWebSocketClient] Failed to decode message:", i), A("character_animation_service", "error", {
3659
3659
  characterId: this.currentCharacterId,
3660
3660
  event: "decode_failed",
3661
3661
  reason: i
@@ -3672,7 +3672,7 @@ class Ri extends Ti {
3672
3672
  }, t);
3673
3673
  }
3674
3674
  }
3675
- class Di {
3675
+ class Bi {
3676
3676
  // 避免并发连接
3677
3677
  constructor(e) {
3678
3678
  u(this, "wsClient");
@@ -3700,14 +3700,14 @@ class Di {
3700
3700
  async connect(e) {
3701
3701
  var s, o, l, p;
3702
3702
  if (this.isConnecting)
3703
- throw h.warn("[NetworkLayer] Connection already in progress, waiting for current connection to complete"), new j("Connection already in progress", "CONNECTION_IN_PROGRESS");
3703
+ throw h.warn("[NetworkLayer] Connection already in progress, waiting for current connection to complete"), new K("Connection already in progress", "CONNECTION_IN_PROGRESS");
3704
3704
  (o = (s = this.dataController).onConnectionState) == null || o.call(s, re.connecting), this.isFallbackMode = !1, this.setupWebSocketListeners(), this.isConnecting = !0;
3705
3705
  const t = 15e3;
3706
3706
  let n = null;
3707
3707
  const i = this.wsClient.connect(e), a = new Promise((c) => {
3708
3708
  n = setTimeout(() => {
3709
3709
  var d, m;
3710
- this.dataController.connected || (this.isFallbackMode = !0, h.warn(`[NetworkLayer] WebSocket connection timeout (${t}ms) - entering fallback mode`), b("character_manager", "warning", {
3710
+ this.dataController.connected || (this.isFallbackMode = !0, h.warn(`[NetworkLayer] WebSocket connection timeout (${t}ms) - entering fallback mode`), A("character_manager", "warning", {
3711
3711
  characterId: this.dataController.getAvatarId(),
3712
3712
  event: "websocket_connection_timeout_fallback",
3713
3713
  timeoutMs: t
@@ -3717,7 +3717,7 @@ class Di {
3717
3717
  try {
3718
3718
  await Promise.race([i, a]), n && clearTimeout(n);
3719
3719
  } catch (c) {
3720
- throw n && clearTimeout(n), this.isFallbackMode || (this.isFallbackMode = !0, h.warn("[NetworkLayer] WebSocket connection failed - entering fallback mode"), b("character_manager", "warning", {
3720
+ throw n && clearTimeout(n), this.isFallbackMode || (this.isFallbackMode = !0, h.warn("[NetworkLayer] WebSocket connection failed - entering fallback mode"), A("character_manager", "warning", {
3721
3721
  characterId: this.dataController.getAvatarId(),
3722
3722
  event: "websocket_connection_failed_fallback"
3723
3723
  })), (p = (l = this.dataController).onConnectionState) == null || p.call(l, re.failed), c;
@@ -3738,7 +3738,7 @@ class Di {
3738
3738
  */
3739
3739
  sendAudioData(e, t) {
3740
3740
  var o, l;
3741
- this.currentConversationId || (this.currentConversationId = T.generateNewConversationId(), this.resetAudioMetrics(), b("character_manager", "info", {
3741
+ this.currentConversationId || (this.currentConversationId = T.generateNewConversationId(), this.resetAudioMetrics(), A("character_manager", "info", {
3742
3742
  characterId: this.dataController.getAvatarId(),
3743
3743
  event: "conversation_started",
3744
3744
  conversationId: this.currentConversationId
@@ -3752,7 +3752,7 @@ class Di {
3752
3752
  return;
3753
3753
  }
3754
3754
  if (!this.wsClient.sendAudioData(this.currentConversationId, e, t)) {
3755
- h.error("[NetworkLayer] Failed to send audio data to WebSocket"), (l = (o = this.dataController).onError) == null || l.call(o, new j("Failed to send audio data to WebSocket", "SEND_FAILED")), b("character_animation_service", "error", {
3755
+ h.error("[NetworkLayer] Failed to send audio data to WebSocket"), (l = (o = this.dataController).onError) == null || l.call(o, new K("Failed to send audio data to WebSocket", "SEND_FAILED")), A("character_animation_service", "error", {
3756
3756
  characterId: this.dataController.getAvatarId(),
3757
3757
  event: "send_audio_failed",
3758
3758
  conversationId: this.currentConversationId
@@ -3786,25 +3786,25 @@ class Di {
3786
3786
  setupWebSocketListeners() {
3787
3787
  this.wsClient.removeAllListeners(), this.wsClient.on("connected", () => {
3788
3788
  var e, t;
3789
- this.isFallbackMode = !1, this.dataController.setConnected(!0), (t = (e = this.dataController).onConnectionState) == null || t.call(e, re.connected), b("character_animation_service", "info", {
3789
+ this.isFallbackMode = !1, this.dataController.setConnected(!0), (t = (e = this.dataController).onConnectionState) == null || t.call(e, re.connected), A("character_animation_service", "info", {
3790
3790
  characterId: this.dataController.getAvatarId(),
3791
3791
  event: "connected"
3792
3792
  });
3793
3793
  }), this.wsClient.on("disconnected", () => {
3794
3794
  var e, t;
3795
- this.dataController.setConnected(!1), T.clearConnectionId(), (t = (e = this.dataController).onConnectionState) == null || t.call(e, re.disconnected), b("character_animation_service", "warning", {
3795
+ this.dataController.setConnected(!1), T.clearConnectionId(), (t = (e = this.dataController).onConnectionState) == null || t.call(e, re.disconnected), A("character_animation_service", "warning", {
3796
3796
  characterId: this.dataController.getAvatarId(),
3797
3797
  event: "disconnected"
3798
3798
  });
3799
3799
  }), this.wsClient.on("reconnecting", () => {
3800
- b("character_animation_service", "info", {
3800
+ A("character_animation_service", "info", {
3801
3801
  characterId: this.dataController.getAvatarId(),
3802
3802
  event: "reconnecting"
3803
3803
  });
3804
3804
  }), this.wsClient.on("error", (e) => {
3805
3805
  var n, i, a, s;
3806
3806
  const t = e instanceof Error ? e.message : String(e);
3807
- h.error("[NetworkLayer] WebSocket error:", t), b("character_animation_service", "error", {
3807
+ h.error("[NetworkLayer] WebSocket error:", t), A("character_animation_service", "error", {
3808
3808
  characterId: this.dataController.getAvatarId(),
3809
3809
  event: "websocket_error",
3810
3810
  reason: t
@@ -3828,7 +3828,7 @@ class Di {
3828
3828
  }
3829
3829
  } catch (t) {
3830
3830
  const n = t instanceof Error ? t.message : String(t);
3831
- h.error("[NetworkLayer] Failed to handle message:", n), b("character_manager", "error", {
3831
+ h.error("[NetworkLayer] Failed to handle message:", n), A("character_manager", "error", {
3832
3832
  characterId: this.dataController.getAvatarId(),
3833
3833
  event: "handle_message_failed",
3834
3834
  reason: n
@@ -3845,7 +3845,7 @@ class Di {
3845
3845
  }
3846
3846
  const { reqId: t, animation: n } = e.serverResponseAnimation, i = t;
3847
3847
  if (!this.currentConversationId || i !== this.currentConversationId) {
3848
- h.warn(`[NetworkLayer] Ignoring mismatched animation message - expected conversationId: ${this.currentConversationId}, received conversationId: ${i}`), b("character_manager", "warning", {
3848
+ h.warn(`[NetworkLayer] Ignoring mismatched animation message - expected conversationId: ${this.currentConversationId}, received conversationId: ${i}`), A("character_manager", "warning", {
3849
3849
  characterId: this.dataController.getAvatarId(),
3850
3850
  event: "animation_conversationid_mismatch",
3851
3851
  expectedConversationId: this.currentConversationId,
@@ -3857,7 +3857,7 @@ class Di {
3857
3857
  const a = n.keyframes;
3858
3858
  this.dataController.yieldFramesData(a, i), this.dataController.getIsPlaying() || this.dataController.startStreamingPlayback(), this.audioMetrics.didRecvFirstFlame || (this.audioMetrics.didRecvFirstFlame = !0, this.audioMetrics.recvFirstFlameTimestamp = Date.now(), this.currentConversationId && this.reportAudioMetrics(this.currentConversationId));
3859
3859
  } else
3860
- h.warn(`[NetworkLayer] Animation message has no keyframes - conversationId: ${i}`), b("character_manager", "warning", {
3860
+ h.warn(`[NetworkLayer] Animation message has no keyframes - conversationId: ${i}`), A("character_manager", "warning", {
3861
3861
  characterId: this.dataController.getAvatarId(),
3862
3862
  event: "animation_empty_keyframes",
3863
3863
  conversationId: i
@@ -3869,14 +3869,14 @@ class Di {
3869
3869
  handleErrorMessage(e) {
3870
3870
  var i, a, s, o;
3871
3871
  if (!e.error) {
3872
- h.warn("[NetworkLayer] MESSAGE_ERROR received but message.error is empty"), e.serverResponseAnimation && (h.warn("[NetworkLayer] MESSAGE_ERROR contains animation data, treating as animation message"), b("character_manager", "warning", {
3872
+ h.warn("[NetworkLayer] MESSAGE_ERROR received but message.error is empty"), e.serverResponseAnimation && (h.warn("[NetworkLayer] MESSAGE_ERROR contains animation data, treating as animation message"), A("character_manager", "warning", {
3873
3873
  characterId: this.dataController.getAvatarId(),
3874
3874
  event: "message_error_with_payload"
3875
3875
  }), this.handleAnimationMessage(e));
3876
3876
  return;
3877
3877
  }
3878
3878
  const t = e.error.reqId;
3879
- h.error(`[NetworkLayer] Server error: conversationId=${t}, code=${e.error.code}, reason=${e.error.reason}`), b("character_manager", "error", {
3879
+ h.error(`[NetworkLayer] Server error: conversationId=${t}, code=${e.error.code}, reason=${e.error.reason}`), A("character_manager", "error", {
3880
3880
  characterId: this.dataController.getAvatarId(),
3881
3881
  event: "server_error",
3882
3882
  conversationId: t,
@@ -3884,11 +3884,11 @@ class Di {
3884
3884
  reason: e.error.reason
3885
3885
  });
3886
3886
  const n = ((i = e.error.code) == null ? void 0 : i.toString().toLowerCase()) ?? "";
3887
- (n.includes("unauth") || n === "401") && b("sdk_verify", "error", {
3887
+ (n.includes("unauth") || n === "401") && A("sdk_verify", "error", {
3888
3888
  characterId: this.dataController.getAvatarId(),
3889
3889
  conversationId: t,
3890
3890
  reason: e.error.reason
3891
- }), (o = (s = this.dataController).onError) == null || o.call(s, new j(
3891
+ }), (o = (s = this.dataController).onError) == null || o.call(s, new K(
3892
3892
  e.error.reason || "Server error occurred",
3893
3893
  ((a = e.error.code) == null ? void 0 : a.toString()) || "SERVER_ERROR"
3894
3894
  )), this.currentConversationId && t === this.currentConversationId && (h.warn("[NetworkLayer] Server error for current conversation - triggering audio-only mode via empty keyframes"), this.dataController.yieldFramesData([], t));
@@ -3917,7 +3917,7 @@ class Di {
3917
3917
  * 上报音频指标
3918
3918
  */
3919
3919
  reportAudioMetrics(e) {
3920
- !e || this.audioMetrics.startTimestamp === 0 || b("send_audio_measure", "info", {
3920
+ !e || this.audioMetrics.startTimestamp === 0 || A("send_audio_measure", "info", {
3921
3921
  conversationId: e,
3922
3922
  start: this.audioMetrics.startTimestamp,
3923
3923
  tap2: this.audioMetrics.tap2Timestamp,
@@ -3927,7 +3927,7 @@ class Di {
3927
3927
  });
3928
3928
  }
3929
3929
  }
3930
- class Bi {
3930
+ class Di {
3931
3931
  // 音频独立播放模式标志
3932
3932
  constructor(e, t) {
3933
3933
  // ========== Configuration and Composition ==========
@@ -3963,11 +3963,9 @@ class Bi {
3963
3963
  // Maximum keyframes to keep in memory during playback
3964
3964
  u(this, "KEYFRAMES_CLEANUP_THRESHOLD", 3e3);
3965
3965
  // Cleanup threshold (keep some buffer)
3966
- u(this, "MAX_PENDING_AUDIO_CHUNKS", 100);
3967
- // Maximum pending audio chunks to prevent memory leak
3968
3966
  // ========== Audio Only Mode ==========
3969
3967
  u(this, "isAudioOnlyMode", !1);
3970
- this.avatar = e, this.playbackMode = (t == null ? void 0 : t.playbackMode) ?? be.sdk, this.playbackMode === be.sdk && (this.networkLayer = new Di(this));
3968
+ this.avatar = e, this.playbackMode = (t == null ? void 0 : t.playbackMode) ?? Ae.sdk, this.playbackMode === Ae.sdk && (this.networkLayer = new Bi(this));
3971
3969
  }
3972
3970
  // ========== Internal Accessors (for NetworkLayer and AvatarView) ==========
3973
3971
  /**
@@ -4043,7 +4041,7 @@ class Bi {
4043
4041
  */
4044
4042
  async start() {
4045
4043
  if (!this.networkLayer)
4046
- throw new j(
4044
+ throw new K(
4047
4045
  "Network layer not available. Use SDK mode.",
4048
4046
  "NETWORK_LAYER_NOT_AVAILABLE"
4049
4047
  );
@@ -4053,7 +4051,7 @@ class Bi {
4053
4051
  await this.animationPlayer.createAndInitializeStreamingPlayer();
4054
4052
  } catch (e) {
4055
4053
  const t = e instanceof Error ? e.message : String(e);
4056
- throw h.error("[AvatarController] Failed to create streaming player:", t), b("character_player", "error", {
4054
+ throw h.error("[AvatarController] Failed to create streaming player:", t), A("character_player", "error", {
4057
4055
  characterId: this.avatar.id,
4058
4056
  event: "streaming_player_init_failed",
4059
4057
  reason: t
@@ -4070,9 +4068,9 @@ class Bi {
4070
4068
  send(e, t = !1) {
4071
4069
  var i, a, s;
4072
4070
  if (!this.networkLayer)
4073
- return (i = this.onError) == null || i.call(this, new j("Network layer not available", "NETWORK_LAYER_NOT_AVAILABLE")), null;
4071
+ return (i = this.onError) == null || i.call(this, new K("Network layer not available", "NETWORK_LAYER_NOT_AVAILABLE")), null;
4074
4072
  if (!this.networkLayer.canSend())
4075
- return (a = this.onError) == null || a.call(this, new j("Service not connected", "NOT_CONNECTED")), b("character_manager", "warning", {
4073
+ return (a = this.onError) == null || a.call(this, new K("Service not connected", "NOT_CONNECTED")), A("character_manager", "warning", {
4076
4074
  characterId: this.avatar.id,
4077
4075
  event: "send_not_connected"
4078
4076
  }), null;
@@ -4096,12 +4094,12 @@ class Bi {
4096
4094
  * @internal
4097
4095
  */
4098
4096
  async playback(e, t) {
4099
- if ((this.isPlaying || this.currentConversationId) && this.interrupt(), this.currentConversationId = this.generateAndLogNewConversationId(), this.reqEnd = !1, this.clearPlaybackData(), this.animationPlayer || (this.animationPlayer = new ce()), this.animationPlayer.isStreamingReady() || await this.animationPlayer.createAndInitializeStreamingPlayer(), e && e.length > 0 && this.pendingAudioChunks.push(...e), t && t.length > 0 ? (this.currentKeyframes = t, this.emit("keyframesUpdate", this.currentKeyframes)) : (h.warn("[AvatarController] Empty animation data in playback - enabling audio-only mode"), b("character_manager", "info", {
4097
+ if ((this.isPlaying || this.currentConversationId) && this.interrupt(), this.currentConversationId = this.generateAndLogNewConversationId(), this.reqEnd = !1, this.clearPlaybackData(), this.animationPlayer || (this.animationPlayer = new ce()), this.animationPlayer.isStreamingReady() || await this.animationPlayer.createAndInitializeStreamingPlayer(), e && e.length > 0 && this.pendingAudioChunks.push(...e), t && t.length > 0 ? (this.currentKeyframes = t, this.emit("keyframesUpdate", this.currentKeyframes)) : (h.warn("[AvatarController] Empty animation data in playback - enabling audio-only mode"), A("character_manager", "info", {
4100
4098
  characterId: this.avatar.id,
4101
4099
  event: "empty_animation_data_audio_only_fallback",
4102
4100
  conversationId: this.currentConversationId
4103
4101
  }), this.isAudioOnlyMode = !0), this.pendingAudioChunks.length === 0)
4104
- throw new j("No audio chunks to play", "NO_AUDIO");
4102
+ throw new K("No audio chunks to play", "NO_AUDIO");
4105
4103
  return this.isAudioOnlyMode ? await this.startAudioOnlyPlayback() : await this.startStreamingPlayback(), this.currentConversationId;
4106
4104
  }
4107
4105
  /**
@@ -4111,16 +4109,7 @@ class Bi {
4111
4109
  */
4112
4110
  yieldAudioData(e, t = !1) {
4113
4111
  var n, i;
4114
- if (this.reqEnd && this.isPlaying && this.currentConversationId && (this.interrupt(), this.currentConversationId = this.generateAndLogNewConversationId(), this.reqEnd = !1), this.currentConversationId || (this.isPlaying && this.interrupt(), this.currentConversationId = this.generateAndLogNewConversationId(), this.reqEnd = !1, this.clearPlaybackData()), t && (this.reqEnd = !0), this.isPlaying && ((n = this.animationPlayer) != null && n.isStreamingReady()))
4115
- this.animationPlayer.addAudioChunk(e, t);
4116
- else if (e.length > 0 || t) {
4117
- if (this.pendingAudioChunks.length >= this.MAX_PENDING_AUDIO_CHUNKS) {
4118
- const a = this.pendingAudioChunks.findIndex((s) => s.isLast);
4119
- a >= 0 && a < this.pendingAudioChunks.length - 1 ? this.pendingAudioChunks.splice(0, a) : this.pendingAudioChunks.shift(), h.warn(`[AvatarController] Pending audio chunks limit reached (${this.MAX_PENDING_AUDIO_CHUNKS}), removed oldest chunk`);
4120
- }
4121
- this.pendingAudioChunks.push({ data: e, isLast: t }), (i = this.onConversationState) == null || i.call(this, this.mapToConversationState(x.active));
4122
- }
4123
- return this.currentConversationId;
4112
+ return this.reqEnd && this.isPlaying && this.currentConversationId && (this.interrupt(), this.currentConversationId = this.generateAndLogNewConversationId(), this.reqEnd = !1), this.currentConversationId || (this.isPlaying && this.interrupt(), this.currentConversationId = this.generateAndLogNewConversationId(), this.reqEnd = !1, this.clearPlaybackData()), t && (this.reqEnd = !0), this.isPlaying && ((n = this.animationPlayer) != null && n.isStreamingReady()) ? this.animationPlayer.addAudioChunk(e, t) : (e.length > 0 || t) && (this.pendingAudioChunks.push({ data: e, isLast: t }), (i = this.onConversationState) == null || i.call(this, this.mapToConversationState(x.active))), this.currentConversationId;
4124
4113
  }
4125
4114
  /**
4126
4115
  * Send animation keyframes (host mode or SDK mode)
@@ -4131,7 +4120,7 @@ class Bi {
4131
4120
  */
4132
4121
  yieldFramesData(e, t) {
4133
4122
  if (!t || typeof t != "string") {
4134
- h.error("[AvatarController] yieldFramesData requires a valid conversationId. Use getCurrentConversationId() to get the current conversationId."), b("character_manager", "error", {
4123
+ h.error("[AvatarController] yieldFramesData requires a valid conversationId. Use getCurrentConversationId() to get the current conversationId."), A("character_manager", "error", {
4135
4124
  characterId: this.avatar.id,
4136
4125
  event: "keyframes_missing_conversationid",
4137
4126
  receivedConversationId: t
@@ -4140,7 +4129,7 @@ class Bi {
4140
4129
  }
4141
4130
  const n = this.getEffectiveConversationId();
4142
4131
  if (!n || t !== n) {
4143
- h.warn(`[AvatarController] Ignoring mismatched keyframes - expected conversationId: ${n}, received conversationId: ${t}`), b("character_manager", "warning", {
4132
+ h.warn(`[AvatarController] Ignoring mismatched keyframes - expected conversationId: ${n}, received conversationId: ${t}`), A("character_manager", "warning", {
4144
4133
  characterId: this.avatar.id,
4145
4134
  event: "keyframes_conversationid_mismatch",
4146
4135
  expectedConversationId: n,
@@ -4149,7 +4138,7 @@ class Bi {
4149
4138
  return;
4150
4139
  }
4151
4140
  if (this.isAudioOnlyMode) {
4152
- h.warn("[AvatarController] Ignoring animation data in audio-only mode"), b("character_manager", "info", {
4141
+ h.warn("[AvatarController] Ignoring animation data in audio-only mode"), A("character_manager", "info", {
4153
4142
  characterId: this.avatar.id,
4154
4143
  event: "animation_data_ignored_audio_only",
4155
4144
  conversationId: t
@@ -4157,7 +4146,7 @@ class Bi {
4157
4146
  return;
4158
4147
  }
4159
4148
  if (!e || e.length === 0) {
4160
- h.warn("[AvatarController] Empty animation data received - enabling audio-only mode"), b("character_manager", "info", {
4149
+ h.warn("[AvatarController] Empty animation data received - enabling audio-only mode"), A("character_manager", "info", {
4161
4150
  characterId: this.avatar.id,
4162
4151
  event: "empty_animation_data_audio_only_fallback",
4163
4152
  conversationId: t
@@ -4166,7 +4155,7 @@ class Bi {
4166
4155
  }
4167
4156
  this.currentKeyframes.length === 0 ? this.currentKeyframes = e : this.currentKeyframes.push(...e), this.emit("keyframesUpdate", this.currentKeyframes), !this.isPlaying && this.pendingAudioChunks.length > 0 && this.currentKeyframes.length > 0 && this.startStreamingPlayback().catch((i) => {
4168
4157
  var a;
4169
- h.error("[AvatarController] Failed to auto-start playback:", i), (a = this.onError) == null || a.call(this, new j("Failed to start playback", "PLAYBACK_START_FAILED"));
4158
+ h.error("[AvatarController] Failed to auto-start playback:", i), (a = this.onError) == null || a.call(this, new K("Failed to start playback", "PLAYBACK_START_FAILED"));
4170
4159
  });
4171
4160
  }
4172
4161
  // ========== Common Interface ==========
@@ -4176,7 +4165,7 @@ class Bi {
4176
4165
  */
4177
4166
  pause() {
4178
4167
  var e, t, n;
4179
- !this.isPlaying || this.currentState === x.paused || (h.log("[AvatarController] Pausing playback"), (e = this.animationPlayer) == null || e.pause(), this.stopPlaybackLoop(), this.currentState = x.paused, (t = this.onConversationState) == null || t.call(this, this.mapToConversationState(x.paused)), h.log("[AvatarController] Playback paused"), b("character_player", "info", {
4168
+ !this.isPlaying || this.currentState === x.paused || (h.log("[AvatarController] Pausing playback"), (e = this.animationPlayer) == null || e.pause(), this.stopPlaybackLoop(), this.currentState = x.paused, (t = this.onConversationState) == null || t.call(this, this.mapToConversationState(x.paused)), h.log("[AvatarController] Playback paused"), A("character_player", "info", {
4180
4169
  characterId: this.avatar.id,
4181
4170
  event: "playback_paused",
4182
4171
  conversationId: ((n = this.networkLayer) == null ? void 0 : n.getCurrentConversationId()) || void 0
@@ -4189,7 +4178,7 @@ class Bi {
4189
4178
  */
4190
4179
  async resume() {
4191
4180
  var e, t, n;
4192
- !this.isPlaying || this.currentState !== x.paused || (h.log("[AvatarController] Resuming playback"), await ((e = this.animationPlayer) == null ? void 0 : e.resume()), this.startPlaybackLoop(), this.currentState = x.playing, (t = this.onConversationState) == null || t.call(this, this.mapToConversationState(x.playing)), h.log("[AvatarController] Playback resumed"), b("character_player", "info", {
4181
+ !this.isPlaying || this.currentState !== x.paused || (h.log("[AvatarController] Resuming playback"), await ((e = this.animationPlayer) == null ? void 0 : e.resume()), this.startPlaybackLoop(), this.currentState = x.playing, (t = this.onConversationState) == null || t.call(this, this.mapToConversationState(x.playing)), h.log("[AvatarController] Playback resumed"), A("character_player", "info", {
4193
4182
  characterId: this.avatar.id,
4194
4183
  event: "playback_resumed",
4195
4184
  conversationId: ((n = this.networkLayer) == null ? void 0 : n.getCurrentConversationId()) || void 0
@@ -4225,7 +4214,7 @@ class Bi {
4225
4214
  */
4226
4215
  generateAndLogNewConversationId() {
4227
4216
  const e = T.generateNewConversationId();
4228
- return b("character_manager", "info", {
4217
+ return A("character_manager", "info", {
4229
4218
  characterId: this.avatar.id,
4230
4219
  event: "conversation_started",
4231
4220
  conversationId: e
@@ -4251,7 +4240,7 @@ class Bi {
4251
4240
  */
4252
4241
  getEffectiveConversationId() {
4253
4242
  var e;
4254
- return this.playbackMode === be.sdk ? ((e = this.networkLayer) == null ? void 0 : e.getCurrentConversationId()) || null : this.currentConversationId;
4243
+ return this.playbackMode === Ae.sdk ? ((e = this.networkLayer) == null ? void 0 : e.getCurrentConversationId()) || null : this.currentConversationId;
4255
4244
  }
4256
4245
  // ========== Internal Methods (for NetworkLayer and AvatarView use) ==========
4257
4246
  /**
@@ -4284,7 +4273,7 @@ class Bi {
4284
4273
  */
4285
4274
  setVolume(e) {
4286
4275
  var t;
4287
- (e < 0 || e > 1) && (h.warn(`[AvatarController] Volume out of range: ${e}, clamping to [0, 1]`), e = Math.max(0, Math.min(1, e))), (t = this.animationPlayer) == null || t.setVolume(e), b("character_player", "info", {
4276
+ (e < 0 || e > 1) && (h.warn(`[AvatarController] Volume out of range: ${e}, clamping to [0, 1]`), e = Math.max(0, Math.min(1, e))), (t = this.animationPlayer) == null || t.setVolume(e), A("character_player", "info", {
4288
4277
  characterId: this.avatar.id,
4289
4278
  event: "volume_changed",
4290
4279
  volume: e
@@ -4316,7 +4305,7 @@ class Bi {
4316
4305
  await this.animationPlayer.createAndInitializeStreamingPlayer();
4317
4306
  } catch (i) {
4318
4307
  const a = i instanceof Error ? i.message : String(i);
4319
- throw h.error("[AvatarController] Failed to create streaming player:", a), b("character_player", "error", {
4308
+ throw h.error("[AvatarController] Failed to create streaming player:", a), A("character_player", "error", {
4320
4309
  characterId: this.avatar.id,
4321
4310
  event: "streaming_player_init_failed",
4322
4311
  reason: a
@@ -4329,21 +4318,21 @@ class Bi {
4329
4318
  try {
4330
4319
  await this.animationPlayer.prepareStreamingPlayer(() => {
4331
4320
  var a, s;
4332
- this.isPlaying = !1, this.currentState = x.idle, (a = this.onConversationState) == null || a.call(this, this.mapToConversationState(x.idle)), this.emit("stopRendering"), this.clearPlaybackData(), this.networkLayer ? this.networkLayer.resetConversationId() : this.currentConversationId = null, this.reqEnd = !1, this.isAudioOnlyMode = !1, b("character_player", "info", {
4321
+ this.isPlaying = !1, this.currentState = x.idle, (a = this.onConversationState) == null || a.call(this, this.mapToConversationState(x.idle)), this.emit("stopRendering"), this.clearPlaybackData(), this.networkLayer ? this.networkLayer.resetConversationId() : this.currentConversationId = null, this.reqEnd = !1, this.isAudioOnlyMode = !1, A("character_player", "info", {
4333
4322
  characterId: this.avatar.id,
4334
4323
  event: "playback_ended",
4335
4324
  conversationId: ((s = this.networkLayer) == null ? void 0 : s.getCurrentConversationId()) || void 0
4336
4325
  });
4337
4326
  }), this.emit("startRendering");
4338
4327
  const i = this.animationPlayer.getStreamingPlayer();
4339
- i && i.setAutoStart(!1), i && await i.startNewSession(this.pendingAudioChunks), this.pendingAudioChunks = [], this.isPlaying = !0, this.currentState = x.playing, (e = this.onConversationState) == null || e.call(this, this.mapToConversationState(x.playing)), this.startPlaybackLoop(), b("character_player", "info", {
4328
+ i && i.setAutoStart(!1), i && await i.startNewSession(this.pendingAudioChunks), this.pendingAudioChunks = [], this.isPlaying = !0, this.currentState = x.playing, (e = this.onConversationState) == null || e.call(this, this.mapToConversationState(x.playing)), this.startPlaybackLoop(), A("character_player", "info", {
4340
4329
  characterId: this.avatar.id,
4341
4330
  event: "playback_started",
4342
4331
  conversationId: ((t = this.networkLayer) == null ? void 0 : t.getCurrentConversationId()) || void 0
4343
4332
  });
4344
4333
  } catch (i) {
4345
4334
  const a = i instanceof Error ? i.message : String(i);
4346
- h.error("[AvatarController] Failed to start streaming playback:", a), (n = this.onError) == null || n.call(this, new j("Failed to start streaming playback", "INIT_FAILED")), this.isPlaying = !1;
4335
+ h.error("[AvatarController] Failed to start streaming playback:", a), (n = this.onError) == null || n.call(this, new K("Failed to start streaming playback", "INIT_FAILED")), this.isPlaying = !1;
4347
4336
  }
4348
4337
  }
4349
4338
  /**
@@ -4418,7 +4407,7 @@ class Bi {
4418
4407
  await this.animationPlayer.createAndInitializeStreamingPlayer();
4419
4408
  } catch (n) {
4420
4409
  const i = n instanceof Error ? n.message : String(n);
4421
- throw h.error("[AvatarController] Failed to create streaming player for audio-only mode:", i), b("character_player", "error", {
4410
+ throw h.error("[AvatarController] Failed to create streaming player for audio-only mode:", i), A("character_player", "error", {
4422
4411
  characterId: this.avatar.id,
4423
4412
  event: "audio_only_streaming_player_init_failed",
4424
4413
  reason: i
@@ -4427,21 +4416,21 @@ class Bi {
4427
4416
  try {
4428
4417
  await this.animationPlayer.prepareStreamingPlayer(() => {
4429
4418
  var i;
4430
- this.isPlaying = !1, this.currentState = x.idle, (i = this.onConversationState) == null || i.call(this, this.mapToConversationState(x.idle)), this.isAudioOnlyMode = !1, this.clearPlaybackData(), this.resetConversationIdState(), b("character_player", "info", {
4419
+ this.isPlaying = !1, this.currentState = x.idle, (i = this.onConversationState) == null || i.call(this, this.mapToConversationState(x.idle)), this.isAudioOnlyMode = !1, this.clearPlaybackData(), this.resetConversationIdState(), A("character_player", "info", {
4431
4420
  characterId: this.avatar.id,
4432
4421
  event: "audio_only_playback_ended",
4433
4422
  conversationId: this.getEffectiveConversationId() || void 0
4434
4423
  });
4435
4424
  });
4436
4425
  const n = this.animationPlayer.getStreamingPlayer();
4437
- n && n.setAutoStart(!0), n && await n.startNewSession(this.pendingAudioChunks), this.pendingAudioChunks = [], this.isPlaying = !0, this.currentState = x.playing, (e = this.onConversationState) == null || e.call(this, this.mapToConversationState(x.playing)), this.startAudioMonitoringLoop(), b("character_player", "info", {
4426
+ n && n.setAutoStart(!0), n && await n.startNewSession(this.pendingAudioChunks), this.pendingAudioChunks = [], this.isPlaying = !0, this.currentState = x.playing, (e = this.onConversationState) == null || e.call(this, this.mapToConversationState(x.playing)), this.startAudioMonitoringLoop(), A("character_player", "info", {
4438
4427
  characterId: this.avatar.id,
4439
4428
  event: "audio_only_playback_started",
4440
4429
  conversationId: this.getEffectiveConversationId() || void 0
4441
4430
  });
4442
4431
  } catch (n) {
4443
4432
  const i = n instanceof Error ? n.message : String(n);
4444
- throw h.error("[AvatarController] Failed to start audio-only playback:", i), (t = this.onError) == null || t.call(this, new j("Failed to start audio-only playback", "AUDIO_ONLY_INIT_FAILED")), this.isPlaying = !1, this.isAudioOnlyMode = !1, n;
4433
+ throw h.error("[AvatarController] Failed to start audio-only playback:", i), (t = this.onError) == null || t.call(this, new K("Failed to start audio-only playback", "AUDIO_ONLY_INIT_FAILED")), this.isPlaying = !1, this.isAudioOnlyMode = !1, n;
4445
4434
  }
4446
4435
  }
4447
4436
  /**
@@ -4484,15 +4473,7 @@ class Bi {
4484
4473
  * Add audio chunk to buffer
4485
4474
  */
4486
4475
  addAudioChunkToBuffer(e, t) {
4487
- if (this.animationPlayer || (this.animationPlayer = new ce()), this.isPlaying && this.animationPlayer.isStreamingReady())
4488
- this.animationPlayer.addAudioChunk(e, t);
4489
- else {
4490
- if (this.pendingAudioChunks.length >= this.MAX_PENDING_AUDIO_CHUNKS) {
4491
- const n = this.pendingAudioChunks.findIndex((i) => i.isLast);
4492
- n >= 0 && n < this.pendingAudioChunks.length - 1 ? this.pendingAudioChunks.splice(0, n) : this.pendingAudioChunks.shift(), h.warn(`[AvatarController] Pending audio chunks limit reached (${this.MAX_PENDING_AUDIO_CHUNKS}), removed oldest chunk`);
4493
- }
4494
- this.pendingAudioChunks.push({ data: e, isLast: t });
4495
- }
4476
+ this.animationPlayer || (this.animationPlayer = new ce()), this.isPlaying && this.animationPlayer.isStreamingReady() ? this.animationPlayer.addAudioChunk(e, t) : this.pendingAudioChunks.push({ data: e, isLast: t });
4496
4477
  }
4497
4478
  /**
4498
4479
  * Event system
@@ -4584,20 +4565,20 @@ class hr {
4584
4565
  }
4585
4566
  }, a = Object.keys(i).length;
4586
4567
  let s = 0;
4587
- const o = (A, w) => {
4568
+ const o = (b, w) => {
4588
4569
  t && (w && s++, t({
4589
4570
  stage: "template",
4590
- filename: A,
4571
+ filename: b,
4591
4572
  loaded: s,
4592
4573
  total: a,
4593
4574
  progress: Math.round(s / a * 100)
4594
4575
  }));
4595
- }, l = {}, p = Object.entries(i).map(async ([A, { url: w, resourceName: S }]) => {
4576
+ }, l = {}, p = Object.entries(i).map(async ([b, { url: w, resourceName: S }]) => {
4596
4577
  if (!w)
4597
- throw new Error(`[loadTemplateResources] Missing CDN URL for ${A} (${S})`);
4598
- o(S, !1), h.log(`📥 Loading ${A} from API CDN: ${w}`);
4578
+ throw new Error(`[loadTemplateResources] Missing CDN URL for ${b} (${S})`);
4579
+ o(S, !1), h.log(`📥 Loading ${b} from API CDN: ${w}`);
4599
4580
  const P = await ze(w);
4600
- h.log(`✅ ${A} loaded: ${P.byteLength} bytes`), l[A] = P, o(S, !0);
4581
+ h.log(`✅ ${b} loaded: ${P.byteLength} bytes`), l[b] = P, o(S, !0);
4601
4582
  });
4602
4583
  return await Promise.all(p), l;
4603
4584
  }
@@ -4671,15 +4652,15 @@ class hr {
4671
4652
  * Load character data from CharacterMeta (iOS compatible)
4672
4653
  */
4673
4654
  async loadCharacterData(e, t) {
4674
- var v, A, w, S, P, O, I, J, q;
4675
- const { progressCallback: n = null } = t || {}, i = (w = (A = (v = e.models) == null ? void 0 : v.shape) == null ? void 0 : A.resource) == null ? void 0 : w.remote, a = (O = (P = (S = e.models) == null ? void 0 : S.gsStandard) == null ? void 0 : P.resource) == null ? void 0 : O.remote, s = (q = (J = (I = e.animations) == null ? void 0 : I.frameIdle) == null ? void 0 : J.resource) == null ? void 0 : q.remote;
4655
+ var v, b, w, S, P, O, I, J, q;
4656
+ const { progressCallback: n = null } = t || {}, i = (w = (b = (v = e.models) == null ? void 0 : v.shape) == null ? void 0 : b.resource) == null ? void 0 : w.remote, a = (O = (P = (S = e.models) == null ? void 0 : S.gsStandard) == null ? void 0 : P.resource) == null ? void 0 : O.remote, s = (q = (J = (I = e.animations) == null ? void 0 : I.frameIdle) == null ? void 0 : J.resource) == null ? void 0 : q.remote;
4676
4657
  if (!i || !a) {
4677
- const D = "Missing required resources: shape or gsStandard (point cloud)";
4678
- throw b("character_load", "error", {
4658
+ const B = "Missing required resources: shape or gsStandard (point cloud)";
4659
+ throw A("character_load", "error", {
4679
4660
  characterId: e.characterId ?? "unknown",
4680
4661
  stage: "resource_validation",
4681
- reason: D
4682
- }), new Error(D);
4662
+ reason: B
4663
+ }), new Error(B);
4683
4664
  }
4684
4665
  const o = [
4685
4666
  { key: "shape", url: i, filename: "shape.pb" },
@@ -4687,32 +4668,32 @@ class hr {
4687
4668
  ];
4688
4669
  s && o.push({ key: "idleAnimation", url: s, filename: "idle.pb", optional: !0 });
4689
4670
  let l = 0;
4690
- const p = o.length, c = (D, $) => {
4671
+ const p = o.length, c = (B, $) => {
4691
4672
  n && ($ && l++, n({
4692
4673
  stage: "character",
4693
- filename: D,
4674
+ filename: B,
4694
4675
  loaded: l,
4695
4676
  total: p,
4696
4677
  progress: Math.round(l / p * 100)
4697
4678
  }));
4698
- }, d = {}, m = o.map(async ({ key: D, url: $, filename: H, optional: Q }) => {
4679
+ }, d = {}, m = o.map(async ({ key: B, url: $, filename: H, optional: Q }) => {
4699
4680
  c(H, !1);
4700
4681
  try {
4701
- const G = await ze($);
4702
- return D === "shape" ? d.shape = G : D === "pointCloud" ? d.pointCloud = G : D === "idleAnimation" && (d.idleAnimation = G), c(H, !0), { key: D, success: !0 };
4703
- } catch (G) {
4682
+ const W = await ze($);
4683
+ return B === "shape" ? d.shape = W : B === "pointCloud" ? d.pointCloud = W : B === "idleAnimation" && (d.idleAnimation = W), c(H, !0), { key: B, success: !0 };
4684
+ } catch (W) {
4704
4685
  if (!Q)
4705
- throw G;
4706
- return h.warn(`⚠️ Optional resource ${H} failed to load:`, G), c(H, !0), { key: D, success: !1 };
4686
+ throw W;
4687
+ return h.warn(`⚠️ Optional resource ${H} failed to load:`, W), c(H, !0), { key: B, success: !1 };
4707
4688
  }
4708
4689
  });
4709
4690
  if (await Promise.all(m), !d.shape || !d.pointCloud) {
4710
- const D = "Failed to load character data";
4711
- throw b("character_load", "error", {
4691
+ const B = "Failed to load character data";
4692
+ throw A("character_load", "error", {
4712
4693
  characterId: e.characterId ?? "unknown",
4713
4694
  stage: "download",
4714
- reason: D
4715
- }), new Error(D);
4695
+ reason: B
4696
+ }), new Error(B);
4716
4697
  }
4717
4698
  return d;
4718
4699
  }
@@ -4795,7 +4776,7 @@ class hr {
4795
4776
  } catch (n) {
4796
4777
  h.errorWithError("Failed to fetch character:", n);
4797
4778
  const i = n && typeof n == "object" && "message" in n ? String(n.message) : "Failed to fetch character", a = n && typeof n == "object" && "data" in n && typeof n.data == "object" && ((t = n.data) != null && t.message) ? String(n.data.message) : null;
4798
- throw b("character_load", "error", {
4779
+ throw A("character_load", "error", {
4799
4780
  characterId: e ?? "unknown",
4800
4781
  stage: "fetch",
4801
4782
  reason: a || i
@@ -4842,13 +4823,13 @@ const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4842
4823
  });
4843
4824
  h.log("[AvatarManager] Step 3: Creating Avatar instance...");
4844
4825
  const a = new fn(e, n, i);
4845
- return h.log("[AvatarManager] Avatar loaded successfully"), t == null || t({ type: he.completed }), b("character_load", "info", {
4826
+ return h.log("[AvatarManager] Avatar loaded successfully"), t == null || t({ type: he.completed }), A("character_load", "info", {
4846
4827
  characterId: e,
4847
4828
  event: "load_success"
4848
4829
  }), a;
4849
4830
  } catch (n) {
4850
4831
  const i = n instanceof Error ? n.message : String(n);
4851
- throw h.error("Failed to load avatar:", i), b("character_load", "error", {
4832
+ throw h.error("Failed to load avatar:", i), A("character_load", "error", {
4852
4833
  characterId: e,
4853
4834
  reason: i
4854
4835
  }), t == null || t({ type: he.failed, error: n }), n;
@@ -4862,15 +4843,15 @@ const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4862
4843
  }
4863
4844
  };
4864
4845
  u(Fe, "_instance", null);
4865
- let $t = Fe, we = null, Gt = null, Wt = null, qt = null, Ht = null, Kt = null;
4866
- const Xe = 2048, jt = Xe - 1;
4846
+ let $t = Fe, we = null, Wt = null, Gt = null, qt = null, Ht = null, jt = null;
4847
+ const Xe = 2048, Kt = Xe - 1;
4867
4848
  function Vi(r, e, t) {
4868
4849
  const i = r.length / 13;
4869
- (!we || we.length !== i) && (we = new Float32Array(i), Gt = new Uint32Array(we.buffer), Wt = new Uint32Array(i), qt = new Uint32Array(i), Ht = new Uint32Array(i), Kt = new Uint32Array(Xe));
4870
- const a = we, s = Gt, o = Wt, l = qt, p = Ht, c = Kt, d = e[0], m = e[1], v = e[2], A = t[0], w = t[1], S = t[2];
4850
+ (!we || we.length !== i) && (we = new Float32Array(i), Wt = new Uint32Array(we.buffer), Gt = new Uint32Array(i), qt = new Uint32Array(i), Ht = new Uint32Array(i), jt = new Uint32Array(Xe));
4851
+ const a = we, s = Wt, o = Gt, l = qt, p = Ht, c = jt, d = e[0], m = e[1], v = e[2], b = t[0], w = t[1], S = t[2];
4871
4852
  for (let P = 0; P < i; P++) {
4872
4853
  const O = P * 13;
4873
- a[P] = (r[O] - d) * A + (r[O + 1] - m) * w + (r[O + 2] - v) * S, o[P] = P;
4854
+ a[P] = (r[O] - d) * b + (r[O + 1] - m) * w + (r[O + 2] - v) * S, o[P] = P;
4874
4855
  }
4875
4856
  for (let P = 0; P < i; P++) {
4876
4857
  const O = s[P];
@@ -4884,7 +4865,7 @@ function Vi(r, e, t) {
4884
4865
  function $e(r, e, t, n, i, a) {
4885
4866
  n.fill(0);
4886
4867
  for (let o = 0; o < a; o++) {
4887
- const l = r[e[o]] >> i & jt;
4868
+ const l = r[e[o]] >> i & Kt;
4888
4869
  n[l]++;
4889
4870
  }
4890
4871
  let s = 0;
@@ -4893,23 +4874,23 @@ function $e(r, e, t, n, i, a) {
4893
4874
  n[o] = s, s += l;
4894
4875
  }
4895
4876
  for (let o = 0; o < a; o++) {
4896
- const l = e[o], p = r[l] >> i & jt;
4877
+ const l = e[o], p = r[l] >> i & Kt;
4897
4878
  t[n[p]++] = l;
4898
4879
  }
4899
4880
  }
4900
4881
  const Ee = 13;
4901
- let Ae = null;
4882
+ let be = null;
4902
4883
  function zi(r, e) {
4903
4884
  const t = e.length, n = t * Ee;
4904
- (!Ae || Ae.length !== n) && (Ae = new Float32Array(n));
4885
+ (!be || be.length !== n) && (be = new Float32Array(n));
4905
4886
  for (let i = 0; i < t; i++) {
4906
4887
  const s = e[i] * Ee, o = i * Ee;
4907
- Ae.set(
4888
+ be.set(
4908
4889
  r.subarray(s, s + Ee),
4909
4890
  o
4910
4891
  );
4911
4892
  }
4912
- return Ae;
4893
+ return be;
4913
4894
  }
4914
4895
  const $i = `#version 300 es
4915
4896
  precision highp float;
@@ -4941,7 +4922,7 @@ void main() {
4941
4922
  // 预乘 alpha 输出(匹配 premultipliedAlpha: true)
4942
4923
  // 颜色值需要乘以 alpha,这样 WebGL 才能正确混合
4943
4924
  fragColor = vec4(v_color.rgb * alpha, alpha);
4944
- }`, Gi = `#version 300 es
4925
+ }`, Wi = `#version 300 es
4945
4926
  precision highp float;
4946
4927
 
4947
4928
  // 基础四边形顶点属性(共享4个顶点)
@@ -5109,7 +5090,7 @@ void main() {
5109
5090
  v_relativePosition = relativeCoord * BOUNDS_RADIUS;
5110
5091
  v_color = a_color;
5111
5092
  }`;
5112
- class Wi {
5093
+ class Gi {
5113
5094
  // 跟踪当前 buffer 大小
5114
5095
  constructor(e, t) {
5115
5096
  u(this, "canvas");
@@ -5301,7 +5282,7 @@ class Wi {
5301
5282
  const t = e.createShader(e.VERTEX_SHADER);
5302
5283
  if (!t)
5303
5284
  throw new Error("Failed to create vertex shader");
5304
- if (e.shaderSource(t, Gi), e.compileShader(t), !e.getShaderParameter(t, e.COMPILE_STATUS)) {
5285
+ if (e.shaderSource(t, Wi), e.compileShader(t), !e.getShaderParameter(t, e.COMPILE_STATUS)) {
5305
5286
  const a = e.getShaderInfoLog(t);
5306
5287
  throw e.deleteShader(t), new Error(`Vertex shader compilation failed: ${a}`);
5307
5288
  }
@@ -5868,7 +5849,7 @@ class Hi {
5868
5849
  (e = this.sortIndexBuffer) == null || e.destroy(), (t = this.splatDataBuffer) == null || t.destroy(), (n = this.quadVertexBuffer) == null || n.destroy(), (i = this.uniformBuffer) == null || i.destroy(), (a = this.device) == null || a.destroy(), this.sortIndexBuffer = null, this.splatDataBuffer = null, this.quadVertexBuffer = null, this.uniformBuffer = null, this.uniformBindGroup = null, this.storageBindGroup = null, this.device = null, this.context = null, this.renderPipeline = null;
5869
5850
  }
5870
5851
  }
5871
- class Ki {
5852
+ class ji {
5872
5853
  // 排序耗时
5873
5854
  constructor(e) {
5874
5855
  u(this, "renderer", null);
@@ -5922,7 +5903,7 @@ class Ki {
5922
5903
  } catch (i) {
5923
5904
  h.warn("⚠️ WebGPU init failed, fallback to WebGL:", i);
5924
5905
  }
5925
- this.renderer = new Wi(this.canvas, t), await this.renderer.initialize(), this.backend = "webgl", h.log("✅ Using WebGL renderer"), this.updateCameraAspect();
5906
+ this.renderer = new Gi(this.canvas, t), await this.renderer.initialize(), this.backend = "webgl", h.log("✅ Using WebGL renderer"), this.updateCameraAspect();
5926
5907
  }
5927
5908
  /**
5928
5909
  * Load packed Splat data (zero-copy, GPU format)
@@ -6064,7 +6045,7 @@ function le(r, e, t) {
6064
6045
  i[a] = r[a] + (e[a] - r[a]) * t;
6065
6046
  return i;
6066
6047
  }
6067
- function ji(r, e, t) {
6048
+ function Ki(r, e, t) {
6068
6049
  const n = 0.5 - Math.cos(t * Math.PI) * 0.5;
6069
6050
  return {
6070
6051
  translation: le(r.translation || [0, 0, 0], e.translation || [0, 0, 0], n),
@@ -6083,7 +6064,7 @@ function Yi(r, e, t, n = 25) {
6083
6064
  const i = Math.max(1, Math.floor(t / 1e3 * n)), a = Array.from({ length: i });
6084
6065
  for (let s = 0; s < i; s++) {
6085
6066
  const o = s / (i - 1);
6086
- a[s] = ji(r, e, o);
6067
+ a[s] = Ki(r, e, o);
6087
6068
  }
6088
6069
  return a;
6089
6070
  }
@@ -6135,7 +6116,7 @@ class Ji {
6135
6116
  if (this.avatar = e, this.characterId = `${e.id}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, !L.configuration)
6136
6117
  throw new Error("AvatarKit must be initialized before creating AvatarView. Call AvatarKit.initialize() first.");
6137
6118
  const n = L.getPlaybackMode();
6138
- this.avatarController = new Bi(e, {
6119
+ this.avatarController = new Di(e, {
6139
6120
  playbackMode: n
6140
6121
  }), this.avatarController.setRenderCallback((i, a) => {
6141
6122
  this.renderRealtimeFrame(i, a);
@@ -6250,7 +6231,7 @@ class Ji {
6250
6231
  * 初始化渲染系统
6251
6232
  */
6252
6233
  async initializeRenderSystem(e) {
6253
- this.cameraConfig = e || this.getDefaultCameraConfig(), e ? h.log("[AvatarView] Using resolved camera config:", e) : h.log("[AvatarView] No camera config in resources, using default static config:", this.cameraConfig), this.renderSystem = new Ki({
6234
+ this.cameraConfig = e || this.getDefaultCameraConfig(), e ? h.log("[AvatarView] Using resolved camera config:", e) : h.log("[AvatarView] No camera config in resources, using default static config:", this.cameraConfig), this.renderSystem = new ji({
6254
6235
  canvas: this.canvas,
6255
6236
  camera: this.cameraConfig,
6256
6237
  backgroundColor: [0, 0, 0, 0]
@@ -6281,10 +6262,10 @@ class Ji {
6281
6262
  const i = ($, H) => Number.isFinite($) ? $ : H, a = i(e.translationX, t.position[0]), s = i(e.translationY, t.position[1]), o = i(e.translationZ, t.position[2]), l = i(e.rotation, 0), p = i(e.fovYRadians, 0), c = Math.hypot(a, s, o) > 1e-4, d = p > 0, m = Math.abs(l) > 1e-4;
6282
6263
  if (!c && !d && !m)
6283
6264
  return h.warn(`[AvatarView] Camera settings from ${n} appear empty, falling back to default config`), t;
6284
- const v = Math.sin(l), A = Math.cos(l), w = c ? [a, s, o] : [...t.position], S = [
6265
+ const v = Math.sin(l), b = Math.cos(l), w = c ? [a, s, o] : [...t.position], S = [
6285
6266
  -v,
6286
6267
  0,
6287
- -A
6268
+ -b
6288
6269
  ], P = Math.hypot(S[0], S[1], S[2]) || 1, O = [
6289
6270
  S[0] / P,
6290
6271
  S[1] / P,
@@ -6293,7 +6274,7 @@ class Ji {
6293
6274
  w[0] + O[0],
6294
6275
  w[1] + O[1],
6295
6276
  w[2] + O[2]
6296
- ], J = [0, 1, 0], q = d ? p * 180 / Math.PI : t.fov, D = {
6277
+ ], J = [0, 1, 0], q = d ? p * 180 / Math.PI : t.fov, B = {
6297
6278
  ...t,
6298
6279
  // 自动继承 near/far 等配置(来自 APP_CONFIG.camera)
6299
6280
  position: w,
@@ -6309,9 +6290,9 @@ class Ji {
6309
6290
  position: w,
6310
6291
  target: I,
6311
6292
  fov: q,
6312
- near: D.near,
6313
- far: D.far
6314
- }), D;
6293
+ near: B.near,
6294
+ far: B.far
6295
+ }), B;
6315
6296
  }
6316
6297
  /**
6317
6298
  * 渲染第一帧
@@ -6417,8 +6398,8 @@ class Ji {
6417
6398
  }
6418
6399
  const o = performance.now() - this.transitionStartTime, l = Math.min(1, Math.max(0, o / this.transitionDurationMs)), p = this.transitionKeyframes.length, c = Math.min(p - 1, Math.floor(l * (p - 1))), d = this.transitionKeyframes[c], m = Yt(d), v = L.getAvatarCore();
6419
6400
  if (v) {
6420
- const A = await v.computeFrameFlatFromParams(m, this.characterHandle ?? void 0);
6421
- A && (this.renderSystem.loadSplatsFromPackedData(A), this.renderSystem.renderFrame());
6401
+ const b = await v.computeFrameFlatFromParams(m, this.characterHandle ?? void 0);
6402
+ b && (this.renderSystem.loadSplatsFromPackedData(b), this.renderSystem.renderFrame());
6422
6403
  }
6423
6404
  if (l >= 1) {
6424
6405
  if (s === "transitioningToSpeaking")
@@ -6566,7 +6547,7 @@ class Ji {
6566
6547
  * 开始实时渲染循环
6567
6548
  */
6568
6549
  startRealtimeRendering() {
6569
- k.debug && h.log("[AvatarView] Starting realtime rendering with", this.currentKeyframes.length, "keyframes"), b("character_view", "info", {
6550
+ k.debug && h.log("[AvatarView] Starting realtime rendering with", this.currentKeyframes.length, "keyframes"), A("character_view", "info", {
6570
6551
  characterId: this.avatar.id,
6571
6552
  event: "rendering_started",
6572
6553
  keyframesCount: this.currentKeyframes.length
@@ -6615,7 +6596,7 @@ class Ji {
6615
6596
  * 关闭 avatarController 并清理所有相关资源
6616
6597
  */
6617
6598
  dispose() {
6618
- k.debug && h.log("[AvatarView] Disposing avatar view..."), b("character_view", "info", {
6599
+ k.debug && h.log("[AvatarView] Disposing avatar view..."), A("character_view", "info", {
6619
6600
  characterId: this.avatar.id,
6620
6601
  event: "disposed"
6621
6602
  }), this.avatarController && (this.avatarController.clear(), this.avatarController.dispose()), this.stopAllAnimationLoops(), this.setState(
@@ -6669,14 +6650,14 @@ class Ji {
6669
6650
  export {
6670
6651
  k as A,
6671
6652
  re as C,
6672
- be as D,
6653
+ Ae as D,
6673
6654
  ae as E,
6674
6655
  he as L,
6675
6656
  mn as R,
6676
- j as S,
6657
+ K as S,
6677
6658
  h as a,
6678
6659
  fn as b,
6679
- Bi as c,
6660
+ Di as c,
6680
6661
  L as d,
6681
6662
  ur as e,
6682
6663
  $t as f,
@@ -6684,6 +6665,6 @@ export {
6684
6665
  ie as h,
6685
6666
  x as i,
6686
6667
  Zi as j,
6687
- b as l
6668
+ A as l
6688
6669
  };
6689
- //# sourceMappingURL=index-PwOIOT56.js.map
6670
+ //# sourceMappingURL=index-Bebn1P_5.js.map