@liforma/client 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/next/index.js +5 -2
  3. package/dist/next/index.js.map +1 -1
  4. package/dist/next/v2/embed/iframeHost.d.ts +2 -1
  5. package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
  6. package/dist/next/v2/embed/protocol.d.ts +4 -1
  7. package/dist/next/v2/embed/protocol.d.ts.map +1 -1
  8. package/dist/next/v2/experience.d.ts +7 -2
  9. package/dist/next/v2/experience.d.ts.map +1 -1
  10. package/dist/next/v2/types/sessionInteraction.d.ts +30 -0
  11. package/dist/next/v2/types/sessionInteraction.d.ts.map +1 -1
  12. package/dist/npm/index.js +5 -2
  13. package/dist/npm/index.js.map +1 -1
  14. package/dist/npm/v2/embed/iframeHost.d.ts +2 -1
  15. package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
  16. package/dist/npm/v2/embed/protocol.d.ts +4 -1
  17. package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
  18. package/dist/npm/v2/experience.d.ts +7 -2
  19. package/dist/npm/v2/experience.d.ts.map +1 -1
  20. package/dist/npm/v2/index.d.ts +1 -1
  21. package/dist/npm/v2/index.d.ts.map +1 -1
  22. package/dist/npm/v2/npm.d.ts +1 -1
  23. package/dist/npm/v2/npm.d.ts.map +1 -1
  24. package/dist/npm/v2/types/sessionInteraction.d.ts +30 -0
  25. package/dist/npm/v2/types/sessionInteraction.d.ts.map +1 -1
  26. package/dist/react/component/experienceComponentRuntime.d.ts +1 -0
  27. package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
  28. package/dist/react/component/experienceComponentTypes.d.ts +5 -0
  29. package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
  30. package/dist/react/index.js +100 -94
  31. package/dist/react/index.js.map +1 -1
  32. package/dist/react/react/Experience.d.ts.map +1 -1
  33. package/dist/react/v2/embed/iframeHost.d.ts +2 -1
  34. package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
  35. package/dist/react/v2/embed/protocol.d.ts +4 -1
  36. package/dist/react/v2/embed/protocol.d.ts.map +1 -1
  37. package/dist/react/v2/experience.d.ts +7 -2
  38. package/dist/react/v2/experience.d.ts.map +1 -1
  39. package/dist/react/v2/types/sessionInteraction.d.ts +30 -0
  40. package/dist/react/v2/types/sessionInteraction.d.ts.map +1 -1
  41. package/dist/sdk/v2/client.js +2 -2
  42. package/dist/sdk/v2/client.js.map +1 -1
  43. package/dist/svelte/Experience.svelte +2 -0
  44. package/package.json +1 -1
@@ -234,6 +234,7 @@ function N(e = () => ({}), t = () => ({})) {
234
234
  container: n,
235
235
  fit: d.fit,
236
236
  startButton: d.startButton,
237
+ theme: d.theme,
237
238
  showFeedback: d.showFeedback,
238
239
  closeButton: d.closeButton,
239
240
  returnUrl: f,
@@ -327,42 +328,44 @@ function ee(e, t) {
327
328
  //#endregion
328
329
  //#region src/react/Experience.tsx
329
330
  var te = e(function(e, a) {
330
- let { returnUrl: c, fit: l, startButton: u, showFeedback: p, closeButton: m, onReady: h, onStarted: g, onUserTranscript: y, onUserSpeechStarted: b, onUserSpeechEnded: x, onCharacterSpeechStarted: S, onCharacterSpeechEnded: C, onCharacterFocusChanged: w, onConversationUpdate: T, onMessage: E, onListeningState: k, onActivityChange: A, onFeedback: j, onFeedbackFailed: M, onConversationProcessorError: P, onPlayerStatusChange: F, onStateUpdate: I, onClose: te, onError: ne } = e, L = o({}), re = o({
331
+ let { returnUrl: c, fit: l, startButton: u, theme: p, showFeedback: m, closeButton: h, onReady: g, onStarted: y, onUserTranscript: b, onUserSpeechStarted: x, onUserSpeechEnded: S, onCharacterSpeechStarted: C, onCharacterSpeechEnded: w, onCharacterFocusChanged: T, onConversationUpdate: E, onMessage: k, onListeningState: A, onActivityChange: j, onFeedback: M, onFeedbackFailed: P, onConversationProcessorError: F, onPlayerStatusChange: I, onStateUpdate: te, onClose: ne, onError: L } = e, re = o({}), ie = o({
331
332
  fit: l,
332
333
  startButton: u,
333
- showFeedback: p,
334
- closeButton: m,
334
+ theme: p,
335
+ showFeedback: m,
336
+ closeButton: h,
335
337
  returnUrl: c
336
- }), R = o(N(() => L.current, () => re.current)), z = o(null), [ie, ae] = s(!1), [B, V] = s(null), oe = o(null), se = o(null), ce = v(e);
337
- re.current = {
338
+ }), R = o(N(() => re.current, () => ie.current)), z = o(null), [B, ae] = s(!1), [V, oe] = s(null), se = o(null), ce = o(null), H = v(e);
339
+ ie.current = {
338
340
  fit: l,
339
341
  startButton: u,
340
- showFeedback: p,
341
- closeButton: m,
342
+ theme: p,
343
+ showFeedback: m,
344
+ closeButton: h,
342
345
  returnUrl: c
343
- }, L.current = {
344
- onReady: h,
345
- onStarted: g,
346
- onUserTranscript: y,
347
- onUserSpeechStarted: b,
348
- onUserSpeechEnded: x,
349
- onCharacterSpeechStarted: S,
350
- onCharacterSpeechEnded: C,
351
- onCharacterFocusChanged: w,
352
- onConversationUpdate: T,
353
- onMessage: E,
354
- onListeningState: k,
355
- onActivityChange: A,
356
- onFeedback: j,
357
- onFeedbackFailed: M,
358
- onConversationProcessorError: P,
359
- onPlayerStatusChange: F,
360
- onStateUpdate: I,
361
- onClose: te,
362
- onError: ne
346
+ }, re.current = {
347
+ onReady: g,
348
+ onStarted: y,
349
+ onUserTranscript: b,
350
+ onUserSpeechStarted: x,
351
+ onUserSpeechEnded: S,
352
+ onCharacterSpeechStarted: C,
353
+ onCharacterSpeechEnded: w,
354
+ onCharacterFocusChanged: T,
355
+ onConversationUpdate: E,
356
+ onMessage: k,
357
+ onListeningState: A,
358
+ onActivityChange: j,
359
+ onFeedback: M,
360
+ onFeedbackFailed: P,
361
+ onConversationProcessorError: F,
362
+ onPlayerStatusChange: I,
363
+ onStateUpdate: te,
364
+ onClose: ne,
365
+ onError: L
363
366
  };
364
- let H = t((e) => {
365
- oe.current = e, ae(e !== null);
367
+ let le = t((e) => {
368
+ se.current = e, ae(e !== null);
366
369
  }, []);
367
370
  return r(a, () => ({
368
371
  ready: () => {
@@ -394,30 +397,30 @@ var te = e(function(e, a) {
394
397
  conversion: (e) => R.current.withSession((t) => t.conversion(e)),
395
398
  end: () => R.current.withSession((e) => e.end())
396
399
  }), []), i(() => {
397
- if (!ie || !oe.current) return;
398
- let t = oe.current, n = R.current, r;
400
+ if (!B || !se.current) return;
401
+ let t = se.current, n = R.current, r;
399
402
  try {
400
403
  r = { options: _(e) };
401
404
  } catch (e) {
402
405
  r = { error: O(e) };
403
406
  }
404
- let i = n.activateGeneration(t, r, c, V);
407
+ let i = n.activateGeneration(t, r, c, oe);
405
408
  return z.current = i, () => {
406
409
  n.cancelGeneration(i), z.current === i && (z.current = null);
407
410
  };
408
411
  }, [
409
- ie,
410
- ce,
412
+ B,
413
+ H,
411
414
  c
412
415
  ]), n(() => {
413
416
  let e = R.current.getActiveInstance();
414
417
  e && e.setFit(l ?? "full");
415
418
  }, [l]), n(() => {
416
- let e = se.current;
417
- if (!e || (e.replaceChildren(), !B)) return;
418
- let t = ee(e, B);
419
+ let e = ce.current;
420
+ if (!e || (e.replaceChildren(), !V)) return;
421
+ let t = ee(e, V);
419
422
  return () => t.remove();
420
- }, [B]), /* @__PURE__ */ f("div", {
423
+ }, [V]), /* @__PURE__ */ f("div", {
421
424
  className: "liforma-experience-shell",
422
425
  style: {
423
426
  position: "relative",
@@ -426,17 +429,17 @@ var te = e(function(e, a) {
426
429
  minHeight: "inherit"
427
430
  },
428
431
  children: [/* @__PURE__ */ d("div", {
429
- ref: se,
432
+ ref: ce,
430
433
  className: "liforma-experience-error-host",
431
- "aria-hidden": B ? void 0 : !0,
434
+ "aria-hidden": V ? void 0 : !0,
432
435
  style: {
433
436
  position: "absolute",
434
437
  inset: 0,
435
438
  zIndex: 20,
436
- pointerEvents: B ? "auto" : "none"
439
+ pointerEvents: V ? "auto" : "none"
437
440
  }
438
441
  }), /* @__PURE__ */ d("div", {
439
- ref: H,
442
+ ref: le,
440
443
  className: "liforma-experience-host",
441
444
  style: {
442
445
  position: "absolute",
@@ -453,27 +456,27 @@ function ne(e) {
453
456
  }
454
457
  //#endregion
455
458
  //#region src/thumbnail/toGalleryThumbUrl.ts
456
- var L = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, re = /_CH(\.webp)/i, R = /(-)(\d+x\d+)(\.webp)(\?|$)/i;
457
- function z(e) {
459
+ var L = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, re = /_CH(\.webp)/i, ie = /(-)(\d+x\d+)(\.webp)(\?|$)/i;
460
+ function R(e) {
458
461
  let t = e.trim();
459
462
  if (!t) return t;
460
463
  let n = t.replace(L, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`);
461
- return n = n.replace(re, "_neutral$1"), n = n.replace(R, (e, t, n, r, i) => n === "256x256" ? `${t}${n}${r}${i}` : `${t}256x256${r}${i}`), n;
464
+ return n = n.replace(re, "_neutral$1"), n = n.replace(ie, (e, t, n, r, i) => n === "256x256" ? `${t}${n}${r}${i}` : `${t}256x256${r}${i}`), n;
462
465
  }
463
- function ie(e) {
466
+ function z(e) {
464
467
  let t = e.avatarImage?.trim() || e.galleryThumb?.avatarImage?.trim() || "";
465
468
  if (!t) return null;
466
469
  let n = e.backgroundImage?.trim() || e.galleryThumb?.backgroundImage?.trim() || "", r = e.foregroundImage?.trim() || e.galleryThumb?.foregroundImage?.trim() || "", i = e.fallbackImage?.trim() || "";
467
470
  return {
468
- avatarImage: z(t),
469
- ...n ? { backgroundImage: z(n) } : {},
470
- ...r ? { foregroundImage: z(r) } : {},
471
- ...i ? { fallbackImage: z(i) } : {}
471
+ avatarImage: R(t),
472
+ ...n ? { backgroundImage: R(n) } : {},
473
+ ...r ? { foregroundImage: R(r) } : {},
474
+ ...i ? { fallbackImage: R(i) } : {}
472
475
  };
473
476
  }
474
477
  //#endregion
475
478
  //#region src/shims/localStack.ts
476
- function ae() {
479
+ function B() {
477
480
  if (globalThis.__LIFORMA_STACK === "local") return !0;
478
481
  if (typeof location > "u") return !1;
479
482
  try {
@@ -484,13 +487,13 @@ function ae() {
484
487
  }
485
488
  //#endregion
486
489
  //#region src/thumbnail/hostedLaunchUrl.ts
487
- var B = "https://player.liforma.ai", V = "http://localhost:3002";
490
+ var ae = "https://player.liforma.ai", V = "http://localhost:3002";
488
491
  function oe(e) {
489
492
  return e.href?.trim() ? "anchor" : e.hasClickHandler ? "button" : e.experienceId?.trim() ? "anchor" : "presentational";
490
493
  }
491
494
  function se(e) {
492
495
  let t = e?.trim();
493
- return t ? t.replace(/\/$/, "") : ae() ? V : B;
496
+ return t ? t.replace(/\/$/, "") : B() ? V : ae;
494
497
  }
495
498
  function ce(e) {
496
499
  let t = e.experienceId.trim(), n = se(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
@@ -671,7 +674,7 @@ function ke(e, t) {
671
674
  return `${e} liforma-et__media${t ? " liforma-et__media--ready" : ""}`;
672
675
  }
673
676
  function Ae(e) {
674
- let { galleryThumb: t, avatarImage: r, backgroundImage: i, foregroundImage: c, alt: l, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: y, parallax: b = !0, fit: x = "full", lazy: S = !0, className: C = "", fallbackImage: w } = e, T = a(() => ie({
677
+ let { galleryThumb: t, avatarImage: r, backgroundImage: i, foregroundImage: c, alt: l, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: y, parallax: b = !0, fit: x = "full", lazy: S = !0, className: C = "", fallbackImage: w } = e, T = a(() => z({
675
678
  galleryThumb: t,
676
679
  avatarImage: r,
677
680
  backgroundImage: i,
@@ -687,7 +690,7 @@ function Ae(e) {
687
690
  href: m,
688
691
  hasClickHandler: typeof _ == "function",
689
692
  experienceId: p
690
- }), D = E === "anchor" && !m?.trim() && !!p?.trim(), O = !!T?.backgroundImage, k = b !== !1, A = o(null), j = o(!1), [M, N] = s(!S), [P, F] = s(!1), [I, ee] = s(!1), [te, L] = s(0), [re, R] = s(0), [z, ae] = s(!1), [B, V] = s(!1), [se, ce] = s(!1), [le, U] = s(!1), [ue, de] = s(), W = T ? z && T.fallbackImage ? T.fallbackImage : T.avatarImage : "";
693
+ }), D = E === "anchor" && !m?.trim() && !!p?.trim(), O = !!T?.backgroundImage, k = b !== !1, A = o(null), j = o(!1), [M, N] = s(!S), [P, F] = s(!1), [I, ee] = s(!1), [te, L] = s(0), [re, ie] = s(0), [R, B] = s(!1), [ae, V] = s(!1), [se, ce] = s(!1), [le, U] = s(!1), [ue, de] = s(), W = T ? R && T.fallbackImage ? T.fallbackImage : T.avatarImage : "";
691
694
  n(() => {
692
695
  Oe(Ee);
693
696
  }, []), n(() => {
@@ -705,7 +708,7 @@ function Ae(e) {
705
708
  y,
706
709
  D
707
710
  ]), n(() => {
708
- V(!1), ce(!1), U(!1), ae(!1);
711
+ V(!1), ce(!1), U(!1), B(!1);
709
712
  }, [
710
713
  T?.backgroundImage,
711
714
  T?.foregroundImage,
@@ -730,7 +733,7 @@ function Ae(e) {
730
733
  let e = A.current;
731
734
  if (!(!e || !k)) return we(e, {
732
735
  onParallax: (e) => {
733
- ee(!0), j.current || (L(e), R(0));
736
+ ee(!0), j.current || (L(e), ie(0));
734
737
  },
735
738
  pointerActive: () => j.current
736
739
  });
@@ -743,10 +746,10 @@ function Ae(e) {
743
746
  let fe = (e) => {
744
747
  if (!k || I) return;
745
748
  let t = e.currentTarget.getBoundingClientRect();
746
- t.width <= 0 || t.height <= 0 || (L(((e.clientX - t.left) / t.width - .5) * 2), R(((e.clientY - t.top) / t.height - .5) * 2));
749
+ t.width <= 0 || t.height <= 0 || (L(((e.clientX - t.left) / t.width - .5) * 2), ie(((e.clientY - t.top) / t.height - .5) * 2));
747
750
  }, pe = (e) => {
748
751
  let t = j.current;
749
- j.current = !1, F(!1), I && t ? (L(ye(e.getBoundingClientRect(), window.innerHeight)), R(0)) : I || (L(0), R(0));
752
+ j.current = !1, F(!1), I && t ? (L(ye(e.getBoundingClientRect(), window.innerHeight)), ie(0)) : I || (L(0), ie(0));
750
753
  }, me = (e) => {
751
754
  if (!k) return;
752
755
  j.current = !0, e.pointerType === "mouse" && F(!0);
@@ -765,7 +768,7 @@ function Ae(e) {
765
768
  }
766
769
  };
767
770
  if (!T) return null;
768
- let ge = k && (P || I), ve = M && (se || B || le), G = [
771
+ let ge = k && (P || I), ve = M && (se || ae || le), G = [
769
772
  "liforma-et",
770
773
  O ? "liforma-et--scene" : "",
771
774
  ne(x),
@@ -785,7 +788,7 @@ function Ae(e) {
785
788
  "aria-hidden": "true"
786
789
  }),
787
790
  M && T.backgroundImage ? /* @__PURE__ */ d("img", {
788
- className: ke("liforma-et__background", B),
791
+ className: ke("liforma-et__background", ae),
789
792
  src: T.backgroundImage,
790
793
  alt: "",
791
794
  decoding: "async",
@@ -805,7 +808,7 @@ function Ae(e) {
805
808
  },
806
809
  onLoad: () => ce(!0),
807
810
  onError: () => {
808
- T.fallbackImage ? ae(!0) : ce(!0);
811
+ T.fallbackImage ? B(!0) : ce(!0);
809
812
  }
810
813
  }) : null,
811
814
  M && T.foregroundImage ? /* @__PURE__ */ d("img", {
@@ -828,7 +831,7 @@ function Ae(e) {
828
831
  },
829
832
  onPointerMove: fe,
830
833
  onPointerLeave: () => {
831
- j.current || (F(!1), I || (L(0), R(0)));
834
+ j.current || (F(!1), I || (L(0), ie(0)));
832
835
  }
833
836
  }, q = (e) => {
834
837
  A.current = e;
@@ -888,7 +891,7 @@ function Ie() {
888
891
  return t ? t.replace(/\/$/, "") : null;
889
892
  }
890
893
  function Le() {
891
- return Ie() || (ae() ? Fe : Pe);
894
+ return Ie() || (B() ? Fe : Pe);
892
895
  }
893
896
  //#endregion
894
897
  //#region src/v2/api/fetchExperiencePreview.ts
@@ -1332,7 +1335,7 @@ function xt(e) {
1332
1335
  function St(e, t, n) {
1333
1336
  let r = e.trim();
1334
1337
  if (!r) throw Error("createLaunchMessage requires a non-empty launch string.");
1335
- let i = n?.startButton, a = n?.showFeedback;
1338
+ let i = n?.startButton, a = n?.theme, o = n?.showFeedback;
1336
1339
  return {
1337
1340
  type: "launch",
1338
1341
  schemaVersion: 2,
@@ -1340,7 +1343,8 @@ function St(e, t, n) {
1340
1343
  launch: r,
1341
1344
  ...t === void 0 ? {} : { session: t },
1342
1345
  ...i ? { startButton: i } : {},
1343
- ...a === void 0 ? {} : { showFeedback: a }
1346
+ ...a ? { theme: a } : {},
1347
+ ...o === void 0 ? {} : { showFeedback: o }
1344
1348
  }
1345
1349
  };
1346
1350
  }
@@ -1819,7 +1823,7 @@ function It() {
1819
1823
  }
1820
1824
  function Lt() {
1821
1825
  let e = It();
1822
- return e ? e.endsWith("/embed") ? e : `${e}/embed` : ae() ? Ft : Pt;
1826
+ return e ? e.endsWith("/embed") ? e : `${e}/embed` : B() ? Ft : Pt;
1823
1827
  }
1824
1828
  function Rt(e, t) {
1825
1829
  return e?.trim() || t?.trim() || void 0;
@@ -2738,9 +2742,11 @@ var An = class e {
2738
2742
  if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
2739
2743
  return this.launchToken = g, _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && tt(_), f.postLaunch(g, _, {
2740
2744
  startButton: e.startButton,
2745
+ theme: e.theme,
2741
2746
  showFeedback: e.showFeedback
2742
2747
  }), u.setValue(_)) : f.postLaunch(g, void 0, {
2743
2748
  startButton: e.startButton,
2749
+ theme: e.theme,
2744
2750
  showFeedback: e.showFeedback
2745
2751
  }), await Promise.race([s, new Promise((e, t) => {
2746
2752
  setTimeout(() => t(/* @__PURE__ */ Error("Timed out waiting for player loading UI.")), 12e4);
@@ -2917,7 +2923,7 @@ function $(e) {
2917
2923
  var Gn = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065\"/><path d=\"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0\"/></svg>", Kn = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.9 4.89a1 1 0 1 0 1.42 1.42L12 13.41l4.89 4.9a1 1 0 0 0 1.42-1.42L13.41 12l4.9-4.89a1 1 0 0 0-.01-1.4Z\"/></svg>", qn = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 10h-4V6m6-2l-6 6m-8 4h4v4m0-4l-6 6\"/></svg>", Jn = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 4h4v4m-6 2l6-6M8 20H4v-4m0 4l6-6\"/></svg>";
2918
2924
  function Yn(e, t, n) {
2919
2925
  Oe(Ee);
2920
- let r = ie({
2926
+ let r = z({
2921
2927
  galleryThumb: t.galleryThumb,
2922
2928
  avatarImage: t.avatarImage,
2923
2929
  backgroundImage: t.backgroundImage,
@@ -3011,14 +3017,14 @@ function Qn(e, t) {
3011
3017
  v.className = "liforma-ew__stage";
3012
3018
  let y = document.createElement("div");
3013
3019
  y.className = "liforma-ew__status", y.hidden = !0, f.append(v, y), u.append(d, f), a.append(o, l, u, p), e.replaceChildren(a);
3014
- let b = null, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = !1, O = 0, k = "", A = null, j = null, M = null, N = null, P = null, F = null, I = null, ee = 0, te = 0, ne = null, L = !1, re = new AbortController(), R = t.parallax !== !1, z = () => {
3020
+ let b = null, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = !1, O = 0, k = "", A = null, j = null, M = null, N = null, P = null, F = null, I = null, ee = 0, te = 0, ne = null, L = !1, re = new AbortController(), ie = t.parallax !== !1, R = () => {
3015
3021
  let e = a.dataset.state;
3016
3022
  return e === "expanded" || e === "docked" || e === "collapsed" ? e : "collapsed";
3017
- }, ie = () => {
3023
+ }, z = () => {
3018
3024
  M !== null && (clearTimeout(M), M = null);
3019
- }, ae = () => {
3020
- N !== null && (clearTimeout(N), N = null), a.classList.remove("liforma-ew--layout-settling");
3021
3025
  }, B = () => {
3026
+ N !== null && (clearTimeout(N), N = null), a.classList.remove("liforma-ew--layout-settling");
3027
+ }, ae = () => {
3022
3028
  for (let e of [
3023
3029
  f,
3024
3030
  l,
@@ -3033,11 +3039,11 @@ function Qn(e, t) {
3033
3039
  let a = p.offsetWidth || 120;
3034
3040
  p.style.left = `${e + n - a - 10}px`, p.style.top = `${t + 10}px`, p.style.right = "auto", p.style.bottom = "auto", p.style.width = "auto", p.style.height = "auto";
3035
3041
  }, oe = (e, t) => {
3036
- if (z() !== "docked") return;
3042
+ if (R() !== "docked") return;
3037
3043
  let n = zn(), r = Vn(e - ee, t - te, n);
3038
3044
  P = r.left, F = r.top, V(r.left, r.top, n.width, n.height);
3039
3045
  }, se = (e, t) => {
3040
- if (z() !== "docked" || !Number.isFinite(e) || !Number.isFinite(t) || e === 0 && t === 0) return;
3046
+ if (R() !== "docked" || !Number.isFinite(e) || !Number.isFinite(t) || e === 0 && t === 0) return;
3041
3047
  let n = zn(), r = P ?? f.getBoundingClientRect().left, i = F ?? f.getBoundingClientRect().top, a = Vn(r + e, i + t, n);
3042
3048
  P = a.left, F = a.top, V(a.left, a.top, n.width, n.height);
3043
3049
  }, ce = (e) => {
@@ -3047,12 +3053,12 @@ function Qn(e, t) {
3047
3053
  let t = ne;
3048
3054
  I = null, ne = null, p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging"), t === "toolbar" && L && (L = !1, window.removeEventListener("pointermove", ce), window.removeEventListener("pointerup", H), window.removeEventListener("pointercancel", H));
3049
3055
  }, le = (e, t, n) => {
3050
- if (S || z() !== "docked" || !Hn() || I !== null) return;
3056
+ if (S || R() !== "docked" || !Hn() || I !== null) return;
3051
3057
  I = n, ne = "toolbar", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3052
3058
  let r = f.getBoundingClientRect();
3053
3059
  ee = e - r.left, te = t - r.top, L || (L = !0, window.addEventListener("pointermove", ce), window.addEventListener("pointerup", H), window.addEventListener("pointercancel", H));
3054
3060
  }, U = (e) => {
3055
- if (S || z() !== "docked" || !Hn() || I !== null) return;
3061
+ if (S || R() !== "docked" || !Hn() || I !== null) return;
3056
3062
  I = e.pointerId, ne = "player", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3057
3063
  let t = f.getBoundingClientRect();
3058
3064
  P = t.left, F = t.top;
@@ -3061,7 +3067,7 @@ function Qn(e, t) {
3061
3067
  }, de = (e) => {
3062
3068
  ne === "player" && (I === null || e.pointerId !== I || H());
3063
3069
  }, W = () => {
3064
- let e = Hn(), t = z();
3070
+ let e = Hn(), t = R();
3065
3071
  if (!e || t !== "expanded" && t !== "docked") {
3066
3072
  h.hidden = !0;
3067
3073
  return;
@@ -3077,7 +3083,7 @@ function Qn(e, t) {
3077
3083
  });
3078
3084
  });
3079
3085
  }, me = (e) => {
3080
- if (ae(), a.classList.remove("liforma-ew--session-revealed"), a.classList.add("liforma-ew--layout-settling"), e(), !D) {
3086
+ if (B(), a.classList.remove("liforma-ew--session-revealed"), a.classList.add("liforma-ew--layout-settling"), e(), !D) {
3081
3087
  a.classList.remove("liforma-ew--layout-settling");
3082
3088
  return;
3083
3089
  }
@@ -3089,7 +3095,7 @@ function Qn(e, t) {
3089
3095
  a.classList.remove("liforma-ew--layout-settling"), pe();
3090
3096
  }, 220);
3091
3097
  }, he = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3092
- ie(), M = setTimeout(() => {
3098
+ z(), M = setTimeout(() => {
3093
3099
  M = null, a.classList.remove("liforma-ew--session-concealing"), e();
3094
3100
  }, 280);
3095
3101
  })), ge = {
@@ -3116,7 +3122,7 @@ function Qn(e, t) {
3116
3122
  w = !0, a.dataset.warm = "true", l.hidden = !1, D || (o.tabIndex = -1, o.setAttribute("aria-hidden", "true")), t.onPrefetchReady?.();
3117
3123
  }, be = (e) => {
3118
3124
  A?.(), A = null;
3119
- let t = Yn(s, e, { parallax: R });
3125
+ let t = Yn(s, e, { parallax: ie });
3120
3126
  return t ? (A = t, !0) : !1;
3121
3127
  }, K = () => {
3122
3128
  if (be(ge)) {
@@ -3148,7 +3154,7 @@ function Qn(e, t) {
3148
3154
  startButton: Xn(t),
3149
3155
  ...t.showFeedback === void 0 ? {} : { showFeedback: t.showFeedback }
3150
3156
  }), q = (e = !0) => {
3151
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), B(), a.dataset.state = "expanded", _e(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), W(), e && t.onExpanded?.();
3157
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), ae(), a.dataset.state = "expanded", _e(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), W(), e && t.onExpanded?.();
3152
3158
  }, Ce = () => {
3153
3159
  o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", _e(null), typeof document < "u" && (document.body.style.overflow = k), fe(!0), W(), b?.setWidgetChrome("docked");
3154
3160
  }, we = (e) => {
@@ -3160,9 +3166,9 @@ function Qn(e, t) {
3160
3166
  S || t.onFeedbackFailed?.(e);
3161
3167
  });
3162
3168
  }, Te = () => {
3163
- ae(), u.hidden = !0, p.hidden = !0, B(), a.dataset.state = "collapsed", a.classList.remove("liforma-ew--session-revealed"), a.classList.remove("liforma-ew--session-concealing"), g.setAttribute("aria-pressed", "false"), o.hidden = !1, o.tabIndex = 0, o.removeAttribute("aria-hidden"), C && (o.disabled = !1), _e(null), typeof document < "u" && (document.body.style.overflow = k), W();
3169
+ B(), u.hidden = !0, p.hidden = !0, ae(), a.dataset.state = "collapsed", a.classList.remove("liforma-ew--session-revealed"), a.classList.remove("liforma-ew--session-concealing"), g.setAttribute("aria-pressed", "false"), o.hidden = !1, o.tabIndex = 0, o.removeAttribute("aria-hidden"), C && (o.disabled = !1), _e(null), typeof document < "u" && (document.body.style.overflow = k), W();
3164
3170
  }, Ee = () => {
3165
- ie(), ae(), O += 1, x = !1, w = !1, T = !1, E = !1, D = !1;
3171
+ z(), B(), O += 1, x = !1, w = !1, T = !1, E = !1, D = !1;
3166
3172
  let e = b;
3167
3173
  b = null, e?.destroy(), v.replaceChildren(), l.replaceChildren(), l.hidden = !0, delete a.dataset.warm, delete a.dataset.live, a.classList.remove("liforma-ew--session-revealed");
3168
3174
  }, De = () => {
@@ -3177,19 +3183,19 @@ function Qn(e, t) {
3177
3183
  Ee(), Te(), t.onCollapsed?.(), t.onClose?.();
3178
3184
  }
3179
3185
  }, Oe = () => {
3180
- S || Hn() && z() === "expanded" && me(() => {
3186
+ S || Hn() && R() === "expanded" && me(() => {
3181
3187
  Ce();
3182
3188
  });
3183
3189
  }, ke = () => {
3184
- S || z() === "docked" && (H(), me(() => {
3185
- B(), q(!1), b?.setWidgetChrome("expanded");
3190
+ S || R() === "docked" && (H(), me(() => {
3191
+ ae(), q(!1), b?.setWidgetChrome("expanded");
3186
3192
  }));
3187
3193
  }, Ae = () => {
3188
- !b || !D || (ie(), a.classList.remove("liforma-ew--session-revealed"), q(), b.setWidgetChrome("expanded"), x = !1, pe());
3194
+ !b || !D || (z(), a.classList.remove("liforma-ew--session-revealed"), q(), b.setWidgetChrome("expanded"), x = !1, pe());
3189
3195
  }, Me = () => {
3190
- !b || !E || D || (ie(), a.classList.remove("liforma-ew--session-revealed"), q(), x = !1, w || b.setWidgetChrome("expanded"));
3196
+ !b || !E || D || (z(), a.classList.remove("liforma-ew--session-revealed"), q(), x = !1, w || b.setWidgetChrome("expanded"));
3191
3197
  }, Pe = (e) => {
3192
- S || e !== O && !D || (ie(), a.classList.remove("liforma-ew--session-revealed"), q(), x = !1, D && pe());
3198
+ S || e !== O && !D || (z(), a.classList.remove("liforma-ew--session-revealed"), q(), x = !1, D && pe());
3193
3199
  }, Fe = () => {
3194
3200
  if (S || T || w || b || $(a.dataset.state)) return;
3195
3201
  T = !0;
@@ -3312,22 +3318,22 @@ function Qn(e, t) {
3312
3318
  Ie();
3313
3319
  }
3314
3320
  }, Re = (e) => {
3315
- if (e.stopPropagation(), z() === "expanded") {
3321
+ if (e.stopPropagation(), R() === "expanded") {
3316
3322
  Oe();
3317
3323
  return;
3318
3324
  }
3319
- z() === "docked" && ke();
3325
+ R() === "docked" && ke();
3320
3326
  }, J = (e) => {
3321
3327
  g.setAttribute("aria-pressed", e ? "true" : "false");
3322
3328
  }, Be = (e) => {
3323
3329
  e.stopPropagation(), $(a.dataset.state) && b?.toggleAudioSettings();
3324
3330
  }, Ve = (e) => {
3325
- z() === "docked" && Hn() && (e.target?.closest("button") || (e.preventDefault(), le(e.clientX, e.clientY, e.pointerId)));
3331
+ R() === "docked" && Hn() && (e.target?.closest("button") || (e.preventDefault(), le(e.clientX, e.clientY, e.pointerId)));
3326
3332
  }, He = (e) => {
3327
3333
  e.key === "Escape" && $(a.dataset.state) && (e.preventDefault(), De());
3328
3334
  }, Ue = () => {
3329
3335
  if (!S) {
3330
- if (z() === "docked") {
3336
+ if (R() === "docked") {
3331
3337
  if (!Hn()) {
3332
3338
  ke();
3333
3339
  return;
@@ -3341,7 +3347,7 @@ function Qn(e, t) {
3341
3347
  }
3342
3348
  }, Y = typeof window < "u" ? window.matchMedia(Mn) : null, We = () => {
3343
3349
  if (!S) {
3344
- if (z() === "docked" && !Hn()) {
3350
+ if (R() === "docked" && !Hn()) {
3345
3351
  ke();
3346
3352
  return;
3347
3353
  }