@liforma/client 0.4.10 → 0.4.12

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 (117) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/next/index.js +754 -618
  3. package/dist/next/index.js.map +1 -1
  4. package/dist/next/react/ExperienceThumbnail.d.ts +2 -0
  5. package/dist/next/react/ExperienceThumbnail.d.ts.map +1 -1
  6. package/dist/next/react/ExperienceWidget.d.ts +3 -0
  7. package/dist/next/react/ExperienceWidget.d.ts.map +1 -1
  8. package/dist/next/thumbnail/expandAssetUrl.d.ts +17 -0
  9. package/dist/next/thumbnail/expandAssetUrl.d.ts.map +1 -0
  10. package/dist/next/thumbnail/expandAssetUrl.test.d.ts +2 -0
  11. package/dist/next/thumbnail/expandAssetUrl.test.d.ts.map +1 -0
  12. package/dist/next/thumbnail/index.d.ts +3 -0
  13. package/dist/next/thumbnail/index.d.ts.map +1 -1
  14. package/dist/next/thumbnail/locationPlate.d.ts +13 -0
  15. package/dist/next/thumbnail/locationPlate.d.ts.map +1 -0
  16. package/dist/next/thumbnail/locationPlate.test.d.ts +2 -0
  17. package/dist/next/thumbnail/locationPlate.test.d.ts.map +1 -0
  18. package/dist/next/thumbnail/styles.d.ts.map +1 -1
  19. package/dist/next/thumbnail/toGalleryThumbUrl.d.ts +12 -2
  20. package/dist/next/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
  21. package/dist/next/thumbnail/types.d.ts +7 -1
  22. package/dist/next/thumbnail/types.d.ts.map +1 -1
  23. package/dist/next/thumbnail.js +273 -192
  24. package/dist/next/thumbnail.js.map +1 -1
  25. package/dist/next/v2/embed/iframeHost.d.ts +3 -0
  26. package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
  27. package/dist/next/v2/embed/protocol.d.ts +21 -0
  28. package/dist/next/v2/embed/protocol.d.ts.map +1 -1
  29. package/dist/next/v2/experience.d.ts +20 -0
  30. package/dist/next/v2/experience.d.ts.map +1 -1
  31. package/dist/next/v2/shims/embedBaseUrl.d.ts +15 -1
  32. package/dist/next/v2/shims/embedBaseUrl.d.ts.map +1 -1
  33. package/dist/next/v2/types/stage.d.ts +8 -0
  34. package/dist/next/v2/types/stage.d.ts.map +1 -0
  35. package/dist/next/widget/mountExperienceWidget.d.ts.map +1 -1
  36. package/dist/npm/index.js +557 -449
  37. package/dist/npm/index.js.map +1 -1
  38. package/dist/npm/thumbnail/expandAssetUrl.d.ts +17 -0
  39. package/dist/npm/thumbnail/expandAssetUrl.d.ts.map +1 -0
  40. package/dist/npm/thumbnail/index.d.ts +3 -0
  41. package/dist/npm/thumbnail/index.d.ts.map +1 -1
  42. package/dist/npm/thumbnail/index.js +151 -75
  43. package/dist/npm/thumbnail/index.js.map +1 -1
  44. package/dist/npm/thumbnail/locationPlate.d.ts +13 -0
  45. package/dist/npm/thumbnail/locationPlate.d.ts.map +1 -0
  46. package/dist/npm/thumbnail/styles.d.ts.map +1 -1
  47. package/dist/npm/thumbnail/toGalleryThumbUrl.d.ts +12 -2
  48. package/dist/npm/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
  49. package/dist/npm/thumbnail/types.d.ts +7 -1
  50. package/dist/npm/thumbnail/types.d.ts.map +1 -1
  51. package/dist/npm/v2/embed/iframeHost.d.ts +3 -0
  52. package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
  53. package/dist/npm/v2/embed/protocol.d.ts +21 -0
  54. package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
  55. package/dist/npm/v2/experience.d.ts +20 -0
  56. package/dist/npm/v2/experience.d.ts.map +1 -1
  57. package/dist/npm/v2/index.d.ts +1 -0
  58. package/dist/npm/v2/index.d.ts.map +1 -1
  59. package/dist/npm/v2/liforma-experience-thumbnail.d.ts.map +1 -1
  60. package/dist/npm/v2/liforma-experience.d.ts.map +1 -1
  61. package/dist/npm/v2/npm.d.ts +1 -0
  62. package/dist/npm/v2/npm.d.ts.map +1 -1
  63. package/dist/npm/v2/shims/embedBaseUrl.d.ts +15 -1
  64. package/dist/npm/v2/shims/embedBaseUrl.d.ts.map +1 -1
  65. package/dist/npm/v2/types/stage.d.ts +8 -0
  66. package/dist/npm/v2/types/stage.d.ts.map +1 -0
  67. package/dist/npm/widget/mountExperienceWidget.d.ts.map +1 -1
  68. package/dist/react/component/experienceComponentRuntime.d.ts +3 -0
  69. package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
  70. package/dist/react/component/experienceComponentTypes.d.ts +13 -1
  71. package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
  72. package/dist/react/index.js +870 -712
  73. package/dist/react/index.js.map +1 -1
  74. package/dist/react/react/Experience.d.ts.map +1 -1
  75. package/dist/react/react/ExperienceThumbnail.d.ts +2 -0
  76. package/dist/react/react/ExperienceThumbnail.d.ts.map +1 -1
  77. package/dist/react/react/ExperienceWidget.d.ts +3 -0
  78. package/dist/react/react/ExperienceWidget.d.ts.map +1 -1
  79. package/dist/react/thumbnail/expandAssetUrl.d.ts +17 -0
  80. package/dist/react/thumbnail/expandAssetUrl.d.ts.map +1 -0
  81. package/dist/react/thumbnail/expandAssetUrl.test.d.ts +2 -0
  82. package/dist/react/thumbnail/expandAssetUrl.test.d.ts.map +1 -0
  83. package/dist/react/thumbnail/index.d.ts +3 -0
  84. package/dist/react/thumbnail/index.d.ts.map +1 -1
  85. package/dist/react/thumbnail/locationPlate.d.ts +13 -0
  86. package/dist/react/thumbnail/locationPlate.d.ts.map +1 -0
  87. package/dist/react/thumbnail/locationPlate.test.d.ts +2 -0
  88. package/dist/react/thumbnail/locationPlate.test.d.ts.map +1 -0
  89. package/dist/react/thumbnail/styles.d.ts.map +1 -1
  90. package/dist/react/thumbnail/toGalleryThumbUrl.d.ts +12 -2
  91. package/dist/react/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
  92. package/dist/react/thumbnail/types.d.ts +7 -1
  93. package/dist/react/thumbnail/types.d.ts.map +1 -1
  94. package/dist/react/thumbnail.js +273 -192
  95. package/dist/react/thumbnail.js.map +1 -1
  96. package/dist/react/v2/embed/iframeHost.d.ts +3 -0
  97. package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
  98. package/dist/react/v2/embed/protocol.d.ts +21 -0
  99. package/dist/react/v2/embed/protocol.d.ts.map +1 -1
  100. package/dist/react/v2/experience.d.ts +20 -0
  101. package/dist/react/v2/experience.d.ts.map +1 -1
  102. package/dist/react/v2/shims/embedBaseUrl.d.ts +15 -1
  103. package/dist/react/v2/shims/embedBaseUrl.d.ts.map +1 -1
  104. package/dist/react/v2/types/stage.d.ts +8 -0
  105. package/dist/react/v2/types/stage.d.ts.map +1 -0
  106. package/dist/react/widget/mountExperienceWidget.d.ts.map +1 -1
  107. package/dist/sdk/v2/client.js +2 -2
  108. package/dist/sdk/v2/client.js.map +1 -1
  109. package/dist/sdk/v2/thumbnail.js +9 -2
  110. package/dist/sdk/v2/thumbnail.js.map +1 -1
  111. package/dist/svelte/Experience.svelte +41 -0
  112. package/dist/svelte/Experience.svelte.d.ts +3 -0
  113. package/dist/svelte/ExperienceThumbnail.svelte +24 -2
  114. package/dist/svelte/ExperienceThumbnail.svelte.d.ts +2 -0
  115. package/dist/svelte/ExperienceWidget.svelte +9 -0
  116. package/dist/svelte/ExperienceWidget.svelte.d.ts +3 -0
  117. package/package.json +1 -1
@@ -106,28 +106,98 @@ function y(e) {
106
106
  return e === "face" ? "liforma-et--fit-face" : e === "medium" ? "liforma-et--fit-medium" : "";
107
107
  }
108
108
  //#endregion
109
+ //#region src/thumbnail/locationPlate.ts
110
+ var b = /(-)(\d+x\d+)(\.webp)(\?|$)/i;
111
+ function x(e, t) {
112
+ return !Number.isFinite(e) || !Number.isFinite(t) || e < 1 || t < 1 || e <= t ? "256x256" : e > 800 || t > 450 ? "1672x941" : "800x450";
113
+ }
114
+ function S(e, t) {
115
+ let n = e.trim();
116
+ return n && n.replace(b, (e, n, r, i, a) => `${n}${t}${i}${a}`);
117
+ }
118
+ function C(e, t) {
119
+ let n = () => {
120
+ t(e.clientWidth, e.clientHeight);
121
+ };
122
+ if (n(), typeof ResizeObserver > "u") return () => {};
123
+ let r = new ResizeObserver(n);
124
+ return r.observe(e), () => r.disconnect();
125
+ }
126
+ var w = /-(256x256|400x450|800x450|836x971|1672x941|167x94)$/i;
127
+ function T(e) {
128
+ return e?.trim().replace(/\/$/, "") || "https://cdn.liforma.ai";
129
+ }
130
+ function E(e) {
131
+ return /^https?:\/\//i.test(e) || e.startsWith("//");
132
+ }
133
+ function D(e) {
134
+ return e.startsWith("//") ? `https:${e}` : e;
135
+ }
136
+ function O(e) {
137
+ let t = e.indexOf("?");
138
+ return t === -1 ? {
139
+ pathname: e,
140
+ search: ""
141
+ } : {
142
+ pathname: e.slice(0, t),
143
+ search: e.slice(t)
144
+ };
145
+ }
146
+ function k(e, t, n = "") {
147
+ return `${e}${t.startsWith("/") ? t : `/${t}`}${n}`;
148
+ }
149
+ function A(e, t, n) {
150
+ let r = e.trim();
151
+ if (!r) return r;
152
+ let i = T(n);
153
+ if (E(r)) return S(D(r), t);
154
+ let { pathname: a, search: o } = O(r.replace(/\\/g, "/")), s = a;
155
+ if (!s.startsWith("/")) s = `/locations/${s.replace(/^locations\//i, "")}`;
156
+ else if (!/^\/locations\//i.test(s)) return /^\/avatars\//i.test(s) ? k(i, s, o) : r;
157
+ if (/\.webp$/i.test(s) && !w.test(s.replace(/\.webp$/i, ""))) return k(i, s, o);
158
+ let c = s.replace(/^\/locations\//i, "").replace(/\.webp$/i, "");
159
+ return c = c.replace(w, ""), `${i}/locations/${c}-${t}.webp${o}`;
160
+ }
161
+ function j(e, t) {
162
+ let n = e.trim();
163
+ if (!n) return n;
164
+ let r = T(t);
165
+ if (E(n)) return D(n);
166
+ let { pathname: i, search: a } = O(n.replace(/\\/g, "/")), o = i;
167
+ if (!o.startsWith("/")) if (/^avatars\//i.test(o)) o = `/${o}`;
168
+ else if (/^[^/]+$/.test(o) && !a) return `${r}/avatars/${o}/256/${o}_neutral.webp`;
169
+ else return n;
170
+ if (!/^\/avatars\//i.test(o)) return n;
171
+ let s = o.replace(/^\/avatars\//i, "").replace(/\/+$/, "");
172
+ return s && !s.includes("/") && !a ? `${r}/avatars/${s}/256/${s}_neutral.webp` : k(r, o, a);
173
+ }
174
+ //#endregion
109
175
  //#region src/thumbnail/toGalleryThumbUrl.ts
110
- var b = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, x = /_CH(\.webp)/i, S = /(-)(\d+x\d+)(\.webp)(\?|$)/i;
111
- function C(e) {
112
- let t = e.trim();
113
- if (!t) return t;
114
- let n = t.replace(b, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`);
115
- return n = n.replace(x, "_neutral$1"), n = n.replace(S, (e, t, n, r, i) => n === "256x256" ? `${t}${n}${r}${i}` : `${t}256x256${r}${i}`), n;
116
- }
117
- function w(e) {
176
+ var M = /(\/avatars\/[^/]+\/)(\d+)(\/)/i, ee = /_CH(\.webp)/i;
177
+ function N(e) {
178
+ return /\/locations\//i.test(e) || /^locations\//i.test(e) ? !0 : /^https?:\/\//i.test(e) || e.startsWith("//") || /^\/?avatars\//i.test(e) || e.startsWith("/") ? !1 : e.includes("/");
179
+ }
180
+ function P(e, t = "256x256", n) {
181
+ let r = e.trim();
182
+ if (!r) return r;
183
+ if (N(r)) return A(r, t, n);
184
+ let i = j(r, n);
185
+ return i = i.replace(M, (e, t, n, r) => n === "256" ? `${t}${n}${r}` : `${t}256${r}`), i.replace(ee, "_neutral$1");
186
+ }
187
+ function F(e) {
118
188
  let t = e.avatarImage?.trim() || e.galleryThumb?.avatarImage?.trim() || "";
119
189
  if (!t) return null;
120
- let n = e.backgroundImage?.trim() || e.galleryThumb?.backgroundImage?.trim() || "", r = e.foregroundImage?.trim() || e.galleryThumb?.foregroundImage?.trim() || "", i = e.fallbackImage?.trim() || "";
190
+ let n = e.backgroundImage?.trim() || e.galleryThumb?.backgroundImage?.trim() || "", r = e.foregroundImage?.trim() || e.galleryThumb?.foregroundImage?.trim() || "", i = e.fallbackImage?.trim() || "", a = e.locationPlateSize ?? "256x256", o = T(e.cdnBaseUrl), s = e.normalize !== !1, c = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : P(e, a, o), l = (e) => !s && /^https?:\/\//i.test(e.trim()) ? e.trim() : A(e, a, o);
121
191
  return {
122
- avatarImage: C(t),
123
- ...n ? { backgroundImage: C(n) } : {},
124
- ...r ? { foregroundImage: C(r) } : {},
125
- ...i ? { fallbackImage: C(i) } : {}
192
+ avatarImage: c(t),
193
+ ...n ? { backgroundImage: l(n) } : {},
194
+ ...r ? { foregroundImage: l(r) } : {},
195
+ ...i ? { fallbackImage: c(i) } : {}
126
196
  };
127
197
  }
128
198
  //#endregion
129
199
  //#region src/shims/localStack.ts
130
- function T() {
200
+ function te() {
131
201
  if (globalThis.__LIFORMA_STACK === "local") return !0;
132
202
  if (typeof location > "u") return !1;
133
203
  try {
@@ -138,83 +208,83 @@ function T() {
138
208
  }
139
209
  //#endregion
140
210
  //#region src/thumbnail/hostedLaunchUrl.ts
141
- var E = "https://player.liforma.ai", D = "http://localhost:3002";
142
- function O(e) {
211
+ var I = "https://player.liforma.ai", L = "http://localhost:3002";
212
+ function ne(e) {
143
213
  return e.href?.trim() ? "anchor" : e.hasClickHandler ? "button" : e.experienceId?.trim() ? "anchor" : "presentational";
144
214
  }
145
- function k(e) {
215
+ function re(e) {
146
216
  let t = e?.trim();
147
- return t ? t.replace(/\/$/, "") : T() ? D : E;
217
+ return t ? t.replace(/\/$/, "") : te() ? L : I;
148
218
  }
149
- function A(e) {
150
- let t = e.experienceId.trim(), n = k(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
219
+ function ie(e) {
220
+ let t = e.experienceId.trim(), n = re(e.playerBaseUrl), r = new URL(`${n}/${encodeURIComponent(t)}`), i = e.returnUrl?.trim();
151
221
  return i && r.searchParams.set("returnUrl", i), r.toString();
152
222
  }
153
- function ee(e) {
223
+ function R(e) {
154
224
  let t = e.href?.trim();
155
225
  if (t) return t;
156
226
  let n = e.experienceId?.trim();
157
227
  if (!n) return;
158
228
  let r = e.returnUrl?.trim();
159
- return !r && e.useCurrentPageAsReturnUrl && typeof window < "u" && (r = window.location.href), A({
229
+ return !r && e.useCurrentPageAsReturnUrl && typeof window < "u" && (r = window.location.href), ie({
160
230
  experienceId: n,
161
231
  ...r ? { returnUrl: r } : {},
162
232
  playerBaseUrl: e.playerBaseUrl
163
233
  });
164
234
  }
165
- function j() {
235
+ function z() {
166
236
  return typeof window > "u" ? !1 : window.matchMedia("(hover: none), (pointer: coarse)").matches;
167
237
  }
168
- var M = 0, N = [];
169
- function P() {
170
- return j() ? 4 : Infinity;
238
+ var B = 0, ae = [];
239
+ function oe() {
240
+ return z() ? 4 : Infinity;
171
241
  }
172
- function F() {
173
- return j() ? 160 : 0;
242
+ function se() {
243
+ return z() ? 160 : 0;
174
244
  }
175
- function te() {
176
- let e = P();
177
- for (; M < e && N.length > 0;) {
178
- let e = N.shift();
245
+ function ce() {
246
+ let e = oe();
247
+ for (; B < e && ae.length > 0;) {
248
+ let e = ae.shift();
179
249
  if (!e || e.cancelled) continue;
180
- M += 1, e.start();
181
- let t = F();
250
+ B += 1, e.start();
251
+ let t = se();
182
252
  if (t <= 0) {
183
- M = Math.max(0, M - 1);
253
+ B = Math.max(0, B - 1);
184
254
  continue;
185
255
  }
186
256
  window.setTimeout(() => {
187
- M = Math.max(0, M - 1), te();
257
+ B = Math.max(0, B - 1), ce();
188
258
  }, t);
189
259
  }
190
260
  }
191
- function ne(e) {
192
- if (!j()) return e(), () => {};
261
+ function le(e) {
262
+ if (!z()) return e(), () => {};
193
263
  let t = {
194
264
  start: e,
195
265
  cancelled: !1
196
266
  };
197
- return N.push(t), te(), () => {
267
+ return ae.push(t), ce(), () => {
198
268
  t.cancelled = !0;
199
269
  };
200
270
  }
201
271
  //#endregion
202
272
  //#region src/thumbnail/lazyLoad.ts
203
- function I() {
204
- return j() ? "96px 0px" : "280px 0px";
273
+ function V() {
274
+ return z() ? "96px 0px" : "280px 0px";
205
275
  }
206
- function L(e) {
276
+ function ue(e) {
207
277
  let t = e.trim().split(/\s+/)[0] ?? "0px", n = Number.parseFloat(t);
208
278
  return Number.isFinite(n) ? Math.abs(n) : 280;
209
279
  }
210
- function re(e, t) {
280
+ function de(e, t) {
211
281
  if (typeof window > "u") return !1;
212
282
  let n = e.getBoundingClientRect();
213
283
  return n.bottom >= -t && n.top <= window.innerHeight + t;
214
284
  }
215
- function ie(e, t) {
216
- let { onVisibleChange: n } = t, r = t.rootMargin ?? I(), i = L(r), a = !1, o = !1, s = null, c = () => {
217
- o || (s?.(), s = ne(() => {
285
+ function fe(e, t) {
286
+ let { onVisibleChange: n } = t, r = t.rootMargin ?? V(), i = ue(r), a = !1, o = !1, s = null, c = () => {
287
+ o || (s?.(), s = le(() => {
218
288
  s = null, o = !0, n(!0);
219
289
  }));
220
290
  }, l = (e) => {
@@ -236,55 +306,55 @@ function ie(e, t) {
236
306
  rootMargin: r,
237
307
  threshold: 0
238
308
  });
239
- return u.observe(e), re(e, i) && l(!0), () => {
309
+ return u.observe(e), de(e, i) && l(!0), () => {
240
310
  s?.(), s = null, u.disconnect();
241
311
  };
242
312
  }
243
313
  //#endregion
244
314
  //#region src/thumbnail/scrollParallax.ts
245
- function R() {
315
+ function pe() {
246
316
  return typeof window > "u" || window.matchMedia("(prefers-reduced-motion: reduce)").matches ? !1 : window.matchMedia("(hover: none), (pointer: coarse)").matches;
247
317
  }
248
- function z(e, t) {
318
+ function H(e, t) {
249
319
  return ((e.top + e.height / 2) / Math.max(t, 1) - .5) * 2;
250
320
  }
251
- var B = /* @__PURE__ */ new Set(), ae = !1, V = 0;
252
- function oe() {
253
- if (V = 0, B.size === 0 || typeof window > "u") return;
321
+ var me = /* @__PURE__ */ new Set(), U = !1, W = 0;
322
+ function he() {
323
+ if (W = 0, me.size === 0 || typeof window > "u") return;
254
324
  let e = window.innerHeight;
255
- for (let t of B) {
325
+ for (let t of me) {
256
326
  if (t.pointerActive?.()) continue;
257
327
  let n = t.element.getBoundingClientRect();
258
- n.bottom < -64 || n.top > e + 64 || t.onParallax(z(n, e));
328
+ n.bottom < -64 || n.top > e + 64 || t.onParallax(H(n, e));
259
329
  }
260
330
  }
261
- function se() {
262
- V === 0 && (V = requestAnimationFrame(oe));
331
+ function ge() {
332
+ W === 0 && (W = requestAnimationFrame(he));
263
333
  }
264
- function ce() {
265
- ae || typeof window > "u" || (ae = !0, window.addEventListener("scroll", se, { passive: !0 }), window.addEventListener("resize", se, { passive: !0 }));
334
+ function G() {
335
+ U || typeof window > "u" || (U = !0, window.addEventListener("scroll", ge, { passive: !0 }), window.addEventListener("resize", ge, { passive: !0 }));
266
336
  }
267
- function H() {
268
- B.size > 0 || !ae || typeof window > "u" || (ae = !1, V !== 0 && (cancelAnimationFrame(V), V = 0), window.removeEventListener("scroll", se), window.removeEventListener("resize", se));
337
+ function _e() {
338
+ me.size > 0 || !U || typeof window > "u" || (U = !1, W !== 0 && (cancelAnimationFrame(W), W = 0), window.removeEventListener("scroll", ge), window.removeEventListener("resize", ge));
269
339
  }
270
- function le(e, t) {
271
- if (!R()) return () => {};
340
+ function ve(e, t) {
341
+ if (!pe()) return () => {};
272
342
  let n = {
273
343
  element: e,
274
344
  onParallax: t.onParallax,
275
345
  pointerActive: t.pointerActive
276
346
  };
277
- return B.add(n), ce(), n.pointerActive?.() || t.onParallax(z(e.getBoundingClientRect(), window.innerHeight)), () => {
278
- B.delete(n), H();
347
+ return me.add(n), G(), n.pointerActive?.() || t.onParallax(H(e.getBoundingClientRect(), window.innerHeight)), () => {
348
+ me.delete(n), _e();
279
349
  };
280
350
  }
281
351
  //#endregion
282
352
  //#region src/thumbnail/attachThumbnailParallax.ts
283
- function ue(e) {
353
+ function ye(e) {
284
354
  let t = 0, n = 0, r = !1, i = !1, a = !1, o = () => {
285
355
  let a = r || i;
286
356
  e.classList.toggle("liforma-et--parallax", a), e.classList.toggle("liforma-et--scroll-parallax", i), e.style.setProperty("--liforma-et-parallax-x", String(t)), e.style.setProperty("--liforma-et-parallax-y", String(n));
287
- }, s = le(e, {
357
+ }, s = ve(e, {
288
358
  onParallax: (e) => {
289
359
  i = !0, a || (t = e, n = 0, o());
290
360
  },
@@ -297,7 +367,7 @@ function ue(e) {
297
367
  a = !0, e.pointerType === "mouse" && (r = !0), o();
298
368
  }, u = () => {
299
369
  let s = a;
300
- a = !1, r = !1, i && s ? (t = z(e.getBoundingClientRect(), window.innerHeight), n = 0) : i || (t = 0, n = 0), o();
370
+ a = !1, r = !1, i && s ? (t = H(e.getBoundingClientRect(), window.innerHeight), n = 0) : i || (t = 0, n = 0), o();
301
371
  }, d = (e) => {
302
372
  e.pointerType === "mouse" && (r = !0, o());
303
373
  }, f = () => {
@@ -309,108 +379,119 @@ function ue(e) {
309
379
  }
310
380
  //#endregion
311
381
  //#region src/thumbnail/styles.ts
312
- var de = ".liforma-et {\n --liforma-et-parallax-x: 0;\n --liforma-et-parallax-y: 0;\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n --liforma-et-reveal-duration: 420ms;\n\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0.65rem;\n overflow: hidden;\n background: #111;\n color: inherit;\n text-decoration: none;\n cursor: inherit;\n -webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n cursor: pointer;\n}\n\nbutton.liforma-et {\n font: inherit;\n appearance: none;\n}\n\n.liforma-et__placeholder {\n position: absolute;\n inset: 0;\n z-index: 0;\n background:\n radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n linear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n opacity: 1;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n opacity: 0;\n}\n\n.liforma-et__media {\n opacity: 0;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n opacity: 1;\n}\n\n.liforma-et__background {\n position: absolute;\n inset: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n )\n scale(var(--liforma-et-bg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et__avatar {\n position: relative;\n z-index: 2;\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n object-position: center bottom;\n transform: scale(var(--liforma-et-avatar-scale))\n translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n );\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n transform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.35;\n --liforma-et-bg-scale: 1.35;\n --liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n transform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n position: absolute;\n inset: 0;\n z-index: 3;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n pointer-events: none;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n )\n scale(var(--liforma-et-fg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et--parallax {\n --liforma-et-bg-scale: 1.08;\n --liforma-et-fg-scale: 1.05;\n --liforma-et-avatar-scale: 1.08;\n --liforma-et-bg-shift: 10px;\n --liforma-et-fg-shift: 4px;\n --liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n will-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.95;\n --liforma-et-bg-scale: 1.95;\n --liforma-et-fg-scale: 1.95;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.42;\n --liforma-et-bg-scale: 1.42;\n --liforma-et-fg-scale: 1.42;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-et {\n --liforma-et-reveal-duration: 0ms;\n }\n\n .liforma-et--parallax {\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n }\n\n .liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n }\n\n .liforma-et__background,\n .liforma-et__foreground,\n .liforma-et__avatar {\n transition: none;\n }\n}", U = !1;
313
- function W(e) {
314
- if (typeof document > "u" || U) return;
382
+ var be = ":host {\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n}\n\n.liforma-et {\n --liforma-et-parallax-x: 0;\n --liforma-et-parallax-y: 0;\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n --liforma-et-reveal-duration: 420ms;\n\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0.65rem;\n overflow: hidden;\n background: #111;\n color: inherit;\n text-decoration: none;\n cursor: inherit;\n -webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n cursor: pointer;\n}\n\nbutton.liforma-et {\n font: inherit;\n appearance: none;\n}\n\n.liforma-et__placeholder {\n position: absolute;\n inset: 0;\n z-index: 0;\n background:\n radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n linear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n opacity: 1;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n opacity: 0;\n}\n\n.liforma-et__media {\n opacity: 0;\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n opacity: 1;\n}\n\n.liforma-et__background {\n position: absolute;\n inset: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n )\n scale(var(--liforma-et-bg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et__avatar {\n position: relative;\n z-index: 2;\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n object-position: center bottom;\n transform: scale(var(--liforma-et-avatar-scale))\n translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n );\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n transform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.35;\n --liforma-et-bg-scale: 1.35;\n --liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n transform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n object-fit: cover;\n object-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n position: absolute;\n inset: 0;\n z-index: 3;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n pointer-events: none;\n transform: translate(\n calc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n calc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n )\n scale(var(--liforma-et-fg-scale));\n transform-origin: center center;\n transition:\n opacity var(--liforma-et-reveal-duration) ease,\n transform 160ms ease;\n}\n\n.liforma-et--parallax {\n --liforma-et-bg-scale: 1.08;\n --liforma-et-fg-scale: 1.05;\n --liforma-et-avatar-scale: 1.08;\n --liforma-et-bg-shift: 10px;\n --liforma-et-fg-shift: 4px;\n --liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n will-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.95;\n --liforma-et-bg-scale: 1.95;\n --liforma-et-fg-scale: 1.95;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n --liforma-et-avatar-scale: 1.42;\n --liforma-et-bg-scale: 1.42;\n --liforma-et-fg-scale: 1.42;\n --liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n transition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-et {\n --liforma-et-reveal-duration: 0ms;\n }\n\n .liforma-et--parallax {\n --liforma-et-bg-scale: 1;\n --liforma-et-fg-scale: 1;\n --liforma-et-avatar-scale: 1;\n --liforma-et-bg-shift: 0px;\n --liforma-et-fg-shift: 0px;\n --liforma-et-avatar-shift: 0px;\n }\n\n .liforma-et--parallax.liforma-et--fit-face {\n --liforma-et-avatar-scale: 1.85;\n --liforma-et-bg-scale: 1.85;\n --liforma-et-fg-scale: 1.85;\n }\n\n .liforma-et__background,\n .liforma-et__foreground,\n .liforma-et__avatar {\n transition: none;\n }\n}", xe = !1;
383
+ function Se(e) {
384
+ if (typeof document > "u" || xe) return;
315
385
  if (document.querySelector("style[data-liforma-et]")) {
316
- U = !0;
386
+ xe = !0;
317
387
  return;
318
388
  }
319
389
  let t = document.createElement("style");
320
- t.setAttribute("data-liforma-et", ""), t.textContent = e, document.head.appendChild(t), U = !0;
390
+ t.setAttribute("data-liforma-et", ""), t.textContent = e, document.head.appendChild(t), xe = !0;
321
391
  }
322
392
  //#endregion
323
393
  //#region src/react/ExperienceThumbnail.tsx
324
- function fe(e, t) {
394
+ function Ce(e, t) {
325
395
  return `${e} liforma-et__media${t ? " liforma-et__media--ready" : ""}`;
326
396
  }
327
- function pe(s) {
328
- let { galleryThumb: c, avatarImage: l, backgroundImage: u, foregroundImage: d, alt: f, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: b, parallax: x = !0, fit: S = "full", lazy: C = !0, className: T = "", fallbackImage: E } = s, D = t(() => w({
397
+ function we(s) {
398
+ let { galleryThumb: c, avatarImage: l, backgroundImage: u, foregroundImage: d, alt: f, experienceId: p, href: m, target: h, rel: g, onClick: _, returnUrl: v, playerBaseUrl: b, parallax: S = !0, fit: w = "full", lazy: T = !0, className: E = "", fallbackImage: D, normalizeUrls: O = !0, cdnBaseUrl: k } = s, A = n(null), j = n(!1), [M, ee] = r(0), [N, P] = r(0), te = x(M, N), I = t(() => F({
329
399
  galleryThumb: c,
330
400
  avatarImage: l,
331
401
  backgroundImage: u,
332
402
  foregroundImage: d,
333
- fallbackImage: E
403
+ fallbackImage: D,
404
+ normalize: O,
405
+ locationPlateSize: te,
406
+ cdnBaseUrl: k
334
407
  }), [
335
408
  c,
336
409
  l,
337
410
  u,
338
411
  d,
339
- E
340
- ]), k = O({
412
+ D,
413
+ O,
414
+ te,
415
+ k
416
+ ]), L = ne({
341
417
  href: m,
342
418
  hasClickHandler: typeof _ == "function",
343
419
  experienceId: p
344
- }), A = k === "anchor" && !m?.trim() && !!p?.trim(), j = !!D?.backgroundImage, M = x !== !1, N = n(null), P = n(!1), [F, te] = r(!C), [ne, I] = r(!1), [L, re] = r(!1), [R, B] = r(0), [ae, V] = r(0), [oe, se] = r(!1), [ce, H] = r(!1), [ue, U] = r(!1), [pe, me] = r(!1), [G, he] = r(), ge = D ? oe && D.fallbackImage ? D.fallbackImage : D.avatarImage : "";
420
+ }), re = L === "anchor" && !m?.trim() && !!p?.trim(), ie = !!I?.backgroundImage, z = S !== !1, [B, ae] = r(!T), [oe, se] = r(!1), [ce, le] = r(!1), [V, ue] = r(0), [de, pe] = r(0), [me, U] = r(!1), [W, he] = r(!1), [ge, G] = r(!1), [_e, ye] = r(!1), [xe, we] = r(), Te = I ? me && I.fallbackImage ? I.fallbackImage : I.avatarImage : "";
345
421
  e(() => {
346
- W(de);
422
+ Se(be);
347
423
  }, []), e(() => {
348
- he(ee({
424
+ we(R({
349
425
  href: m,
350
426
  experienceId: p,
351
427
  returnUrl: v,
352
428
  playerBaseUrl: b,
353
- useCurrentPageAsReturnUrl: A && !v?.trim()
429
+ useCurrentPageAsReturnUrl: re && !v?.trim()
354
430
  }));
355
431
  }, [
356
432
  m,
357
433
  p,
358
434
  v,
359
435
  b,
360
- A
436
+ re
361
437
  ]), e(() => {
362
- H(!1), U(!1), me(!1), se(!1);
438
+ he(!1), G(!1), ye(!1), U(!1);
363
439
  }, [
364
- D?.backgroundImage,
365
- D?.foregroundImage,
366
- ge
440
+ I?.backgroundImage,
441
+ I?.foregroundImage,
442
+ Te
367
443
  ]), e(() => {
368
- let e = N.current;
444
+ let e = A.current;
445
+ if (e) return C(e, (e, t) => {
446
+ ee(e), P(t);
447
+ });
448
+ }, [L, xe]), e(() => {
449
+ let e = A.current;
369
450
  if (e) {
370
- if (!C) {
371
- te(!0);
451
+ if (!T) {
452
+ ae(!0);
372
453
  return;
373
454
  }
374
- return ie(e, { onVisibleChange: (e) => {
375
- e && te(!0);
455
+ return fe(e, { onVisibleChange: (e) => {
456
+ e && ae(!0);
376
457
  } });
377
458
  }
378
459
  }, [
379
- C,
380
- D,
381
- k,
382
- G
460
+ T,
461
+ I,
462
+ L,
463
+ xe
383
464
  ]), e(() => {
384
- let e = N.current;
385
- if (!(!e || !M)) return le(e, {
465
+ let e = A.current;
466
+ if (!(!e || !z)) return ve(e, {
386
467
  onParallax: (e) => {
387
- re(!0), P.current || (B(e), V(0));
468
+ le(!0), j.current || (ue(e), pe(0));
388
469
  },
389
- pointerActive: () => P.current
470
+ pointerActive: () => j.current
390
471
  });
391
472
  }, [
392
- M,
393
- D,
394
- k,
395
- G
473
+ z,
474
+ I,
475
+ L,
476
+ xe
396
477
  ]);
397
- let _e = (e) => {
398
- if (!M || L) return;
478
+ let Ee = (e) => {
479
+ if (!z || ce) return;
399
480
  let t = e.currentTarget.getBoundingClientRect();
400
- t.width <= 0 || t.height <= 0 || (B(((e.clientX - t.left) / t.width - .5) * 2), V(((e.clientY - t.top) / t.height - .5) * 2));
401
- }, K = (e) => {
402
- let t = P.current;
403
- P.current = !1, I(!1), L && t ? (B(z(e.getBoundingClientRect(), window.innerHeight)), V(0)) : L || (B(0), V(0));
404
- }, ve = (e) => {
405
- if (!M) return;
406
- P.current = !0, e.pointerType === "mouse" && I(!0);
481
+ t.width <= 0 || t.height <= 0 || (ue(((e.clientX - t.left) / t.width - .5) * 2), pe(((e.clientY - t.top) / t.height - .5) * 2));
482
+ }, De = (e) => {
483
+ let t = j.current;
484
+ j.current = !1, se(!1), ce && t ? (ue(H(e.getBoundingClientRect(), window.innerHeight)), pe(0)) : ce || (ue(0), pe(0));
485
+ }, Oe = (e) => {
486
+ if (!z) return;
487
+ j.current = !0, e.pointerType === "mouse" && se(!0);
407
488
  let t = e.currentTarget, n = () => {
408
- K(t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
489
+ De(t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
409
490
  };
410
491
  window.addEventListener("pointerup", n), window.addEventListener("pointercancel", n);
411
- }, ye = (e) => {
412
- if (_?.(e), !e.defaultPrevented && A && !v?.trim()) {
413
- let t = ee({
492
+ }, ke = (e) => {
493
+ if (_?.(e), !e.defaultPrevented && re && !v?.trim()) {
494
+ let t = R({
414
495
  experienceId: p,
415
496
  playerBaseUrl: b,
416
497
  useCurrentPageAsReturnUrl: !0
@@ -418,135 +499,135 @@ function pe(s) {
418
499
  t && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && (e.preventDefault(), window.location.assign(t));
419
500
  }
420
501
  };
421
- if (!D) return null;
422
- let be = M && (ne || L), q = F && (ue || ce || pe), xe = [
502
+ if (!I) return null;
503
+ let Ae = z && (oe || ce), K = B && (ge || W || _e), je = [
423
504
  "liforma-et",
424
- j ? "liforma-et--scene" : "",
425
- y(S),
426
- be ? "liforma-et--parallax" : "",
427
- L ? "liforma-et--scroll-parallax" : "",
428
- F && !q ? "liforma-et--loading" : "",
429
- q ? "liforma-et--revealed" : "",
430
- T
431
- ].filter(Boolean).join(" "), Se = {
432
- "--liforma-et-parallax-x": R,
433
- "--liforma-et-parallax-y": ae
434
- }, Ce = (e, t) => {
505
+ ie ? "liforma-et--scene" : "",
506
+ y(w),
507
+ Ae ? "liforma-et--parallax" : "",
508
+ ce ? "liforma-et--scroll-parallax" : "",
509
+ B && !K ? "liforma-et--loading" : "",
510
+ K ? "liforma-et--revealed" : "",
511
+ E
512
+ ].filter(Boolean).join(" "), Me = {
513
+ "--liforma-et-parallax-x": V,
514
+ "--liforma-et-parallax-y": de
515
+ }, q = (e, t) => {
435
516
  e.complete && t(!0);
436
- }, we = /* @__PURE__ */ o(i, { children: [
517
+ }, Ne = /* @__PURE__ */ o(i, { children: [
437
518
  /* @__PURE__ */ a("span", {
438
519
  className: "liforma-et__placeholder",
439
520
  "aria-hidden": "true"
440
521
  }),
441
- F && D.backgroundImage ? /* @__PURE__ */ a("img", {
442
- className: fe("liforma-et__background", ce),
443
- src: D.backgroundImage,
522
+ B && I.backgroundImage ? /* @__PURE__ */ a("img", {
523
+ className: Ce("liforma-et__background", W),
524
+ src: I.backgroundImage,
444
525
  alt: "",
445
526
  decoding: "async",
446
527
  ref: (e) => {
447
- e && Ce(e, H);
528
+ e && q(e, he);
448
529
  },
449
- onLoad: () => H(!0),
450
- onError: () => H(!0)
530
+ onLoad: () => he(!0),
531
+ onError: () => he(!0)
451
532
  }) : null,
452
- F && ge ? /* @__PURE__ */ a("img", {
453
- className: fe("liforma-et__avatar", ue),
454
- src: ge,
533
+ B && Te ? /* @__PURE__ */ a("img", {
534
+ className: Ce("liforma-et__avatar", ge),
535
+ src: Te,
455
536
  alt: "",
456
537
  decoding: "async",
457
538
  ref: (e) => {
458
- e && Ce(e, U);
539
+ e && q(e, G);
459
540
  },
460
- onLoad: () => U(!0),
541
+ onLoad: () => G(!0),
461
542
  onError: () => {
462
- D.fallbackImage ? se(!0) : U(!0);
543
+ I.fallbackImage ? U(!0) : G(!0);
463
544
  }
464
545
  }) : null,
465
- F && D.foregroundImage ? /* @__PURE__ */ a("img", {
466
- className: fe("liforma-et__foreground", pe),
467
- src: D.foregroundImage,
546
+ B && I.foregroundImage ? /* @__PURE__ */ a("img", {
547
+ className: Ce("liforma-et__foreground", _e),
548
+ src: I.foregroundImage,
468
549
  alt: "",
469
550
  decoding: "async",
470
551
  ref: (e) => {
471
- e && Ce(e, me);
552
+ e && q(e, ye);
472
553
  },
473
- onLoad: () => me(!0),
474
- onError: () => me(!0)
554
+ onLoad: () => ye(!0),
555
+ onError: () => ye(!0)
475
556
  }) : null
476
- ] }), J = {
477
- onPointerDown: ve,
478
- onPointerUp: (e) => K(e.currentTarget),
479
- onPointerCancel: (e) => K(e.currentTarget),
557
+ ] }), Pe = {
558
+ onPointerDown: Oe,
559
+ onPointerUp: (e) => De(e.currentTarget),
560
+ onPointerCancel: (e) => De(e.currentTarget),
480
561
  onPointerEnter: (e) => {
481
- M && e.pointerType === "mouse" && I(!0);
562
+ z && e.pointerType === "mouse" && se(!0);
482
563
  },
483
- onPointerMove: _e,
564
+ onPointerMove: Ee,
484
565
  onPointerLeave: () => {
485
- P.current || (I(!1), L || (B(0), V(0)));
566
+ j.current || (se(!1), ce || (ue(0), pe(0)));
486
567
  }
487
- }, Te = (e) => {
488
- N.current = e;
568
+ }, Fe = (e) => {
569
+ A.current = e;
489
570
  };
490
- return k === "anchor" && G ? /* @__PURE__ */ a("a", {
491
- ref: Te,
492
- className: xe,
493
- style: Se,
494
- href: G,
571
+ return L === "anchor" && xe ? /* @__PURE__ */ a("a", {
572
+ ref: Fe,
573
+ className: je,
574
+ style: Me,
575
+ href: xe,
495
576
  target: h,
496
577
  rel: g,
497
578
  "aria-label": f,
498
- onClick: ye,
499
- ...J,
500
- children: we
501
- }) : k === "button" ? /* @__PURE__ */ a("button", {
579
+ onClick: ke,
580
+ ...Pe,
581
+ children: Ne
582
+ }) : L === "button" ? /* @__PURE__ */ a("button", {
502
583
  type: "button",
503
- ref: Te,
504
- className: xe,
505
- style: Se,
584
+ ref: Fe,
585
+ className: je,
586
+ style: Me,
506
587
  "aria-label": f,
507
- onClick: ye,
508
- ...J,
509
- children: we
588
+ onClick: ke,
589
+ ...Pe,
590
+ children: Ne
510
591
  }) : /* @__PURE__ */ a("div", {
511
- ref: Te,
512
- className: xe,
513
- style: Se,
592
+ ref: Fe,
593
+ className: je,
594
+ style: Me,
514
595
  role: f ? "img" : void 0,
515
596
  "aria-label": f || void 0,
516
597
  "aria-hidden": f ? void 0 : !0,
517
- ...J,
518
- children: we
598
+ ...Pe,
599
+ children: Ne
519
600
  });
520
601
  }
521
602
  //#endregion
522
603
  //#region src/widget/styles.ts
523
- var me = "\n.liforma-ew {\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n/* Optional self-positioned FAB (position=bottom-right|bottom-left).\n * Cap at 50vmin so small phones don't get an oversized thumb (desktop 224px stays). */\n.liforma-ew[data-position='bottom-right'],\n.liforma-ew[data-position='bottom-left'] {\n position: fixed;\n width: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n height: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n bottom: var(--liforma-ew-offset, 16px);\n z-index: 2147482900;\n}\n\n.liforma-ew[data-position='bottom-right'] {\n right: var(--liforma-ew-offset, 16px);\n left: auto;\n}\n\n.liforma-ew[data-position='bottom-left'] {\n left: var(--liforma-ew-offset, 16px);\n right: auto;\n}\n\n/* While open, collapse the FAB box so a corner hole / thumb never remains. */\n.liforma-ew[data-position='bottom-right'][data-state='expanded'],\n.liforma-ew[data-position='bottom-right'][data-state='docked'],\n.liforma-ew[data-position='bottom-left'][data-state='expanded'],\n.liforma-ew[data-position='bottom-left'][data-state='docked'] {\n width: 0;\n height: 0;\n min-width: 0;\n min-height: 0;\n overflow: visible;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='expanded'] .liforma-ew__overlay,\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar,\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__hit {\n box-sizing: border-box;\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n font: inherit;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n transform: scale(1);\n transform-origin: center center;\n transition:\n transform 180ms ease,\n filter 180ms ease;\n will-change: transform;\n}\n\n/* Author display must not defeat the HTML hidden attribute. */\n.liforma-ew__hit[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 3px;\n border-radius: 0.75rem;\n}\n\n@media (hover: hover) and (pointer: fine) {\n /* Scale the thumb whenever the collapsed FAB is hovered — including via the warm iframe hit layer. */\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: scale(1.06);\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover .liforma-et,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-et {\n box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);\n }\n}\n\n.liforma-ew__face {\n width: 100%;\n height: 100%;\n min-height: 0;\n position: relative;\n}\n\n.liforma-ew__face-status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 0.5rem;\n text-align: center;\n font: 600 0.75rem/1.3 system-ui, sans-serif;\n color: #e8ecf4;\n background: rgba(10, 12, 18, 0.72);\n border-radius: 0.75rem;\n pointer-events: none;\n}\n\n.liforma-ew__face-status[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:disabled {\n cursor: default;\n opacity: 0.85;\n}\n\n.liforma-ew__face .liforma-et {\n border-radius: 0.75rem;\n box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);\n transition: box-shadow 180ms ease;\n}\n\n.liforma-ew__warm {\n box-sizing: border-box;\n position: absolute;\n inset: 0;\n z-index: 2;\n border-radius: 0.75rem;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n/*\n * Collapsed: keep the warm iframe as an invisible hit target only.\n * Painting it over the thumb causes a “ghost enlarge” (face scales under a static iframe).\n */\n.liforma-ew[data-state='collapsed'] .liforma-ew__warm {\n opacity: 0;\n transition: none;\n}\n\n.liforma-ew[data-warm='true'] .liforma-ew__warm {\n pointer-events: auto;\n}\n\n.liforma-ew[data-warm='true']:not([data-live='true']) .liforma-ew__hit {\n pointer-events: none;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__hit {\n pointer-events: auto;\n}\n\n.liforma-ew[data-live='true'] .liforma-ew__warm,\n.liforma-ew[data-live='true'] .liforma-ew__stage {\n /* Hidden under the thumb / until post-resize fade-in (matches cold avatar reveal). */\n opacity: 0;\n}\n\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__stage,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__stage {\n opacity: 1;\n}\n\n.liforma-ew--session-concealing .liforma-ew__warm,\n.liforma-ew--session-concealing .liforma-ew__stage {\n transition-duration: 280ms;\n}\n\n/* Instant hide while dock/maximize geometry settles (player morph resize ~160ms). */\n.liforma-ew--layout-settling .liforma-ew__warm,\n.liforma-ew--layout-settling .liforma-ew__stage {\n opacity: 0 !important;\n transition: none !important;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__warm {\n /* Keep the live iframe under the thumb; FAB click resumes the shell. */\n pointer-events: none;\n opacity: 0;\n /* Instant hide when collapsed so the FAB never shows a resized live mesh. */\n transition: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n position: fixed;\n /* Match overlay panel inset so the warm iframe fills the conversation shell. */\n inset: clamp(12px, 3vw, 28px);\n z-index: 2147483001;\n width: auto;\n height: auto;\n border-radius: 16px;\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__warm {\n position: fixed;\n inset: auto;\n z-index: 2147483001;\n border-radius: 16px;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew__toolbar {\n display: none;\n position: fixed;\n z-index: 2147483002;\n pointer-events: auto;\n box-sizing: border-box;\n align-items: center;\n gap: 0.35rem;\n padding: 0.35rem 0.4rem;\n border-radius: 999px;\n background: rgba(12, 14, 20, 0.72);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n display: flex;\n top: calc(clamp(12px, 3vw, 28px) + 10px);\n right: calc(clamp(12px, 3vw, 28px) + 10px);\n left: auto;\n cursor: default;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n display: flex;\n /* left/top set inline to track the panel; strip remains a drag handle */\n cursor: grab;\n touch-action: none;\n user-select: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__stage {\n /* Player also reports surface drags via postMessage when docked. */\n cursor: grab;\n touch-action: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar.liforma-ew__toolbar--dragging,\n.liforma-ew--dock-dragging,\n.liforma-ew--dock-dragging .liforma-ew__toolbar,\n.liforma-ew--dock-dragging .liforma-ew__panel,\n.liforma-ew--dock-dragging .liforma-ew__warm,\n.liforma-ew--dock-dragging .liforma-ew__stage {\n cursor: grabbing;\n}\n\n\n.liforma-ew__toolbar[hidden] {\n display: none !important;\n}\n\n.liforma-ew__icon-btn {\n appearance: none;\n box-sizing: border-box;\n display: inline-grid;\n place-items: center;\n width: 2rem;\n height: 2rem;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 999px;\n color: #f5f7fb;\n background: transparent;\n cursor: pointer;\n}\n\n.liforma-ew__icon-btn:hover {\n background: rgba(255, 255, 255, 0.12);\n}\n\n.liforma-ew__icon-btn[aria-pressed='true'] {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.liforma-ew__icon-btn:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 2px;\n}\n\n.liforma-ew__icon-btn svg {\n width: 1.05rem;\n height: 1.05rem;\n display: block;\n}\n\n.liforma-ew__drag-grip {\n display: none;\n width: 0.85rem;\n height: 1.25rem;\n margin: 0 0.15rem 0 0.25rem;\n background:\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0 0 / 0.35rem 0.35rem,\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0.35rem 0 / 0.35rem 0.35rem;\n background-repeat: repeat-y;\n opacity: 0.55;\n color: #f5f7fb;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__drag-grip {\n display: block;\n}\n\n.liforma-ew__dock-toggle[hidden] {\n display: none !important;\n}\n\n.liforma-ew__overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: clamp(12px, 3vw, 28px);\n box-sizing: border-box;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n padding: 0;\n align-items: stretch;\n justify-content: stretch;\n pointer-events: none;\n background: transparent;\n}\n\n.liforma-ew__overlay[hidden] {\n display: none !important;\n}\n\n.liforma-ew__backdrop {\n position: absolute;\n inset: 0;\n border: 0;\n padding: 0;\n margin: 0;\n background: rgba(6, 8, 14, 0.62);\n cursor: pointer;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__backdrop {\n display: none !important;\n}\n\n.liforma-ew__panel {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n /* Fill the overlay so player loading / start UI centers in the visible window. */\n width: var(--liforma-ew-max-w, 100%);\n height: var(--liforma-ew-max-h, 100%);\n max-width: 100%;\n max-height: 100%;\n border-radius: 16px;\n overflow: hidden;\n background: #030508;\n box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);\n /* Warm iframe sits above as a sibling; keep panel as chrome shell. */\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n position: fixed;\n inset: auto;\n max-width: none;\n max-height: none;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew:not([data-warm='true']) .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__stage {\n position: relative;\n flex: 1;\n min-height: 0;\n width: 100%;\n height: 100%;\n background: #030508;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n.liforma-ew__status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 1.5rem;\n text-align: center;\n color: #d7dde8;\n font: 500 0.9375rem/1.45 system-ui, sans-serif;\n background: rgba(3, 5, 8, 0.92);\n pointer-events: none;\n}\n\n.liforma-ew__status[hidden] {\n display: none !important;\n}\n\n/* Mobile expanded: ~90% viewport, no reduce control. */\n@media (max-width: 767px) {\n .liforma-ew[data-state='expanded'] .liforma-ew__overlay {\n padding: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__panel {\n width: 90vw;\n height: 90vh;\n max-width: 90vw;\n max-height: 90vh;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__warm {\n inset: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n top: calc(5vh + 10px);\n right: calc(5vw + 10px);\n }\n\n .liforma-ew__dock-toggle {\n display: none !important;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-ew__hit {\n transition: none;\n will-change: auto;\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: none;\n }\n\n .liforma-ew__face .liforma-et {\n box-shadow: none;\n transition: none;\n }\n\n .liforma-ew__warm,\n .liforma-ew__stage {\n transition: none;\n }\n}\n", G = "liforma-experience-widget-styles";
524
- function he(e = me) {
604
+ var Te = "\n.liforma-ew {\n box-sizing: border-box;\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n/* Optional self-positioned FAB (position=bottom-right|bottom-left).\n * Cap at 50vmin so small phones don't get an oversized thumb (desktop 224px stays). */\n.liforma-ew[data-position='bottom-right'],\n.liforma-ew[data-position='bottom-left'] {\n position: fixed;\n width: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n height: min(var(--liforma-ew-fab-size, 224px), 50vmin);\n bottom: var(--liforma-ew-offset, 16px);\n z-index: 2147482900;\n}\n\n.liforma-ew[data-position='bottom-right'] {\n right: var(--liforma-ew-offset, 16px);\n left: auto;\n}\n\n.liforma-ew[data-position='bottom-left'] {\n left: var(--liforma-ew-offset, 16px);\n right: auto;\n}\n\n/* While open, collapse the FAB box so a corner hole / thumb never remains. */\n.liforma-ew[data-position='bottom-right'][data-state='expanded'],\n.liforma-ew[data-position='bottom-right'][data-state='docked'],\n.liforma-ew[data-position='bottom-left'][data-state='expanded'],\n.liforma-ew[data-position='bottom-left'][data-state='docked'] {\n width: 0;\n height: 0;\n min-width: 0;\n min-height: 0;\n overflow: visible;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='expanded'] .liforma-ew__overlay,\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar,\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__hit {\n box-sizing: border-box;\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n font: inherit;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n transform: scale(1);\n transform-origin: center center;\n transition:\n transform 180ms ease,\n filter 180ms ease;\n will-change: transform;\n}\n\n/* Author display must not defeat the HTML hidden attribute. */\n.liforma-ew__hit[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 3px;\n border-radius: 0.75rem;\n}\n\n@media (hover: hover) and (pointer: fine) {\n /* Scale the thumb whenever the collapsed FAB is hovered — including via the warm iframe hit layer. */\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: scale(1.06);\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover .liforma-et,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-et {\n box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);\n }\n}\n\n.liforma-ew__face {\n width: 100%;\n height: 100%;\n min-height: 0;\n position: relative;\n}\n\n.liforma-ew__face-status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 0.5rem;\n text-align: center;\n font: 600 0.75rem/1.3 system-ui, sans-serif;\n color: #e8ecf4;\n background: rgba(10, 12, 18, 0.72);\n border-radius: 0.75rem;\n pointer-events: none;\n}\n\n.liforma-ew__face-status[hidden] {\n display: none !important;\n}\n\n.liforma-ew__hit:disabled {\n cursor: default;\n opacity: 0.85;\n}\n\n.liforma-ew__face .liforma-et {\n border-radius: 0.75rem;\n box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);\n transition: box-shadow 180ms ease;\n}\n\n.liforma-ew__warm {\n box-sizing: border-box;\n position: absolute;\n inset: 0;\n z-index: 2;\n border-radius: 0.75rem;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n/*\n * Collapsed: keep the warm iframe as an invisible hit target only.\n * Painting it over the thumb causes a “ghost enlarge” (face scales under a static iframe).\n */\n.liforma-ew[data-state='collapsed'] .liforma-ew__warm {\n opacity: 0;\n transition: none;\n}\n\n.liforma-ew[data-warm='true'] .liforma-ew__warm {\n pointer-events: auto;\n}\n\n.liforma-ew[data-warm='true']:not([data-live='true']) .liforma-ew__hit {\n pointer-events: none;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__hit {\n pointer-events: auto;\n}\n\n.liforma-ew[data-live='true'] .liforma-ew__warm,\n.liforma-ew[data-live='true'] .liforma-ew__stage {\n /* Hidden under the thumb / until post-resize fade-in (matches cold avatar reveal). */\n opacity: 0;\n}\n\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='expanded'] .liforma-ew__stage,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-live='true'].liforma-ew--session-revealed[data-state='docked'] .liforma-ew__stage {\n opacity: 1;\n}\n\n.liforma-ew--session-concealing .liforma-ew__warm,\n.liforma-ew--session-concealing .liforma-ew__stage {\n transition-duration: 280ms;\n}\n\n/* Instant hide while dock/maximize geometry settles (player morph resize ~160ms). */\n.liforma-ew--layout-settling .liforma-ew__warm,\n.liforma-ew--layout-settling .liforma-ew__stage {\n opacity: 0 !important;\n transition: none !important;\n}\n\n.liforma-ew[data-live='true'][data-state='collapsed'] .liforma-ew__warm {\n /* Keep the live iframe under the thumb; FAB click resumes the shell. */\n pointer-events: none;\n opacity: 0;\n /* Instant hide when collapsed so the FAB never shows a resized live mesh. */\n transition: none;\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__warm {\n position: fixed;\n /* Match overlay panel inset so the warm iframe fills the conversation shell. */\n inset: clamp(12px, 3vw, 28px);\n z-index: 2147483001;\n width: auto;\n height: auto;\n border-radius: 16px;\n pointer-events: auto;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__warm {\n position: fixed;\n inset: auto;\n z-index: 2147483001;\n border-radius: 16px;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew__toolbar {\n display: none;\n position: fixed;\n z-index: 2147483002;\n pointer-events: auto;\n box-sizing: border-box;\n align-items: center;\n gap: 0.35rem;\n padding: 0.35rem 0.4rem;\n border-radius: 999px;\n background: rgba(12, 14, 20, 0.72);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);\n}\n\n.liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n display: flex;\n top: calc(clamp(12px, 3vw, 28px) + 10px);\n right: calc(clamp(12px, 3vw, 28px) + 10px);\n left: auto;\n cursor: default;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar {\n display: flex;\n /* left/top set inline to track the panel; strip remains a drag handle */\n cursor: grab;\n touch-action: none;\n user-select: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel,\n.liforma-ew[data-state='docked'] .liforma-ew__warm,\n.liforma-ew[data-state='docked'] .liforma-ew__stage {\n /* Player also reports surface drags via postMessage when docked. */\n cursor: grab;\n touch-action: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__toolbar.liforma-ew__toolbar--dragging,\n.liforma-ew--dock-dragging,\n.liforma-ew--dock-dragging .liforma-ew__toolbar,\n.liforma-ew--dock-dragging .liforma-ew__panel,\n.liforma-ew--dock-dragging .liforma-ew__warm,\n.liforma-ew--dock-dragging .liforma-ew__stage {\n cursor: grabbing;\n}\n\n\n.liforma-ew__toolbar[hidden] {\n display: none !important;\n}\n\n.liforma-ew__icon-btn {\n appearance: none;\n box-sizing: border-box;\n display: inline-grid;\n place-items: center;\n width: 2rem;\n height: 2rem;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 999px;\n color: #f5f7fb;\n background: transparent;\n cursor: pointer;\n}\n\n.liforma-ew__icon-btn:hover {\n background: rgba(255, 255, 255, 0.12);\n}\n\n.liforma-ew__icon-btn[aria-pressed='true'] {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.liforma-ew__icon-btn:focus-visible {\n outline: 2px solid #5b8def;\n outline-offset: 2px;\n}\n\n.liforma-ew__icon-btn svg {\n width: 1.05rem;\n height: 1.05rem;\n display: block;\n}\n\n.liforma-ew__drag-grip {\n display: none;\n width: 0.85rem;\n height: 1.25rem;\n margin: 0 0.15rem 0 0.25rem;\n background:\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0 0 / 0.35rem 0.35rem,\n radial-gradient(circle, currentColor 1.1px, transparent 1.2px) 0.35rem 0 / 0.35rem 0.35rem;\n background-repeat: repeat-y;\n opacity: 0.55;\n color: #f5f7fb;\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__drag-grip {\n display: block;\n}\n\n.liforma-ew__dock-toggle[hidden] {\n display: none !important;\n}\n\n.liforma-ew__overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: clamp(12px, 3vw, 28px);\n box-sizing: border-box;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__overlay {\n padding: 0;\n align-items: stretch;\n justify-content: stretch;\n pointer-events: none;\n background: transparent;\n}\n\n.liforma-ew__overlay[hidden] {\n display: none !important;\n}\n\n.liforma-ew__backdrop {\n position: absolute;\n inset: 0;\n border: 0;\n padding: 0;\n margin: 0;\n background: rgba(6, 8, 14, 0.62);\n cursor: pointer;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__backdrop {\n display: none !important;\n}\n\n.liforma-ew__panel {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n /* Fill the overlay so player loading / start UI centers in the visible window. */\n width: var(--liforma-ew-max-w, 100%);\n height: var(--liforma-ew-max-h, 100%);\n max-width: 100%;\n max-height: 100%;\n border-radius: 16px;\n overflow: hidden;\n background: #030508;\n box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);\n /* Warm iframe sits above as a sibling; keep panel as chrome shell. */\n pointer-events: none;\n}\n\n.liforma-ew[data-state='docked'] .liforma-ew__panel {\n position: fixed;\n inset: auto;\n max-width: none;\n max-height: none;\n pointer-events: auto;\n /* left/top/width/height set inline from dock geometry */\n}\n\n.liforma-ew:not([data-warm='true']) .liforma-ew__panel {\n pointer-events: auto;\n}\n\n.liforma-ew__stage {\n position: relative;\n flex: 1;\n min-height: 0;\n width: 100%;\n height: 100%;\n background: #030508;\n opacity: 1;\n transition: opacity 1000ms ease;\n}\n\n.liforma-ew__status {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: grid;\n place-items: center;\n padding: 1.5rem;\n text-align: center;\n color: #d7dde8;\n font: 500 0.9375rem/1.45 system-ui, sans-serif;\n background: rgba(3, 5, 8, 0.92);\n pointer-events: none;\n}\n\n.liforma-ew__status[hidden] {\n display: none !important;\n}\n\n/* Mobile expanded: ~90% viewport, no reduce control. */\n@media (max-width: 767px) {\n .liforma-ew[data-state='expanded'] .liforma-ew__overlay {\n padding: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__panel {\n width: 90vw;\n height: 90vh;\n max-width: 90vw;\n max-height: 90vh;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__warm {\n inset: 5vh 5vw;\n }\n\n .liforma-ew[data-state='expanded'] .liforma-ew__toolbar {\n top: calc(5vh + 10px);\n right: calc(5vw + 10px);\n }\n\n .liforma-ew__dock-toggle {\n display: none !important;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .liforma-ew__hit {\n transition: none;\n will-change: auto;\n }\n\n .liforma-ew[data-state='collapsed'] .liforma-ew__hit:not(:disabled):hover,\n .liforma-ew[data-state='collapsed']:has(.liforma-ew__warm:hover) .liforma-ew__hit {\n transform: none;\n }\n\n .liforma-ew__face .liforma-et {\n box-shadow: none;\n transition: none;\n }\n\n .liforma-ew__warm,\n .liforma-ew__stage {\n transition: none;\n }\n}\n", Ee = "liforma-experience-widget-styles";
605
+ function De(e = Te) {
525
606
  if (typeof document > "u") return;
526
- let t = document.getElementById(G);
607
+ let t = document.getElementById(Ee);
527
608
  if (t) {
528
609
  t.textContent = e;
529
610
  return;
530
611
  }
531
612
  let n = document.createElement("style");
532
- n.id = G, n.textContent = e, document.head.append(n);
613
+ n.id = Ee, n.textContent = e, document.head.append(n);
533
614
  }
534
615
  //#endregion
535
616
  //#region src/shims/apiBaseUrl.ts
536
- var ge = "https://api.liforma.ai", _e = "http://localhost:3001";
537
- function K() {
617
+ var Oe = "https://api.liforma.ai", ke = "http://localhost:3001";
618
+ function Ae() {
538
619
  let e = globalThis.__LIFORMA_API_BASE_URL;
539
620
  if (e?.trim()) return e.trim().replace(/\/$/, "");
540
621
  if (typeof document > "u") return null;
541
622
  let t = (document.querySelector("script[data-liforma-sdk][src*=\"client.js\"]") ?? document.querySelector("script[src*=\"/sdk/v2/client.js\"]"))?.getAttribute("data-api-base-url")?.trim();
542
623
  return t ? t.replace(/\/$/, "") : null;
543
624
  }
544
- function ve() {
545
- return K() || (T() ? _e : ge);
625
+ function K() {
626
+ return Ae() || (te() ? ke : Oe);
546
627
  }
547
628
  //#endregion
548
629
  //#region src/v2/api/fetchExperiencePreview.ts
549
- function ye(e) {
630
+ function je(e) {
550
631
  if (!e || typeof e != "object") return null;
551
632
  let t = e, n = typeof t.avatarImage == "string" ? t.avatarImage.trim() : "";
552
633
  return n ? {
@@ -555,10 +636,10 @@ function ye(e) {
555
636
  ...typeof t.foregroundImage == "string" && t.foregroundImage.trim() ? { foregroundImage: t.foregroundImage.trim() } : {}
556
637
  } : null;
557
638
  }
558
- async function be(e, t) {
639
+ async function Me(e, t) {
559
640
  let n = e.trim();
560
641
  if (!n) throw Error("Experience preview requires experienceId.");
561
- let r = (t?.apiBaseUrl ?? ve()).replace(/\/$/, ""), i = await fetch(`${r}/v1/experiences/${encodeURIComponent(n)}/preview`, {
642
+ let r = (t?.apiBaseUrl ?? K()).replace(/\/$/, ""), i = await fetch(`${r}/v1/experiences/${encodeURIComponent(n)}/preview`, {
562
643
  method: "GET",
563
644
  headers: { Accept: "application/json" },
564
645
  signal: t?.signal
@@ -578,7 +659,7 @@ async function be(e, t) {
578
659
  throw Error("Experience preview returned invalid JSON.");
579
660
  }
580
661
  if (!a || typeof a != "object") throw Error("Experience preview returned an invalid payload.");
581
- let o = a, s = typeof o.experienceId == "string" ? o.experienceId.trim() : n, c = typeof o.title == "string" ? o.title.trim() : "", l = ye(o.galleryThumb);
662
+ let o = a, s = typeof o.experienceId == "string" ? o.experienceId.trim() : n, c = typeof o.title == "string" ? o.title.trim() : "", l = je(o.galleryThumb);
582
663
  if (!l) throw Error("Experience preview is missing gallery thumb images.");
583
664
  return {
584
665
  experienceId: s || n,
@@ -597,15 +678,15 @@ var q = class extends Error {
597
678
  super(e, t?.cause === void 0 ? void 0 : { cause: t.cause }), this.name = "LiformaError", this.code = t?.code?.trim() || "UNKNOWN", this.requestId = t?.requestId?.trim() || void 0, this.status = t?.status, this.details = t?.details;
598
679
  }
599
680
  };
600
- function xe(e) {
681
+ function Ne(e) {
601
682
  if (!(!e || typeof e != "object" || Array.isArray(e))) return e;
602
683
  }
603
- function Se(e, t, n) {
684
+ function Pe(e, t, n) {
604
685
  let r = n?.get("Liforma-Request-Id")?.trim() || void 0, i;
605
686
  try {
606
687
  i = JSON.parse(t);
607
688
  } catch {}
608
- let a = i?.error && typeof i.error == "object" ? i.error : void 0, o = a?.code ?? i?.code, s = a?.message ?? i?.message, c = a?.requestId ?? i?.requestId ?? r, l = typeof o == "string" && o.trim() ? o.trim() : "HTTP_ERROR", u = typeof s == "string" && s.trim() ? s.trim() : t.trim().slice(0, 500) || `Request failed (${e})`, d = typeof c == "string" && c.trim() ? c.trim() : r, { code: f, message: p, requestId: m, ...h } = xe(a) ?? xe(i) ?? {};
689
+ let a = i?.error && typeof i.error == "object" ? i.error : void 0, o = a?.code ?? i?.code, s = a?.message ?? i?.message, c = a?.requestId ?? i?.requestId ?? r, l = typeof o == "string" && o.trim() ? o.trim() : "HTTP_ERROR", u = typeof s == "string" && s.trim() ? s.trim() : t.trim().slice(0, 500) || `Request failed (${e})`, d = typeof c == "string" && c.trim() ? c.trim() : r, { code: f, message: p, requestId: m, ...h } = Ne(a) ?? Ne(i) ?? {};
609
690
  return new q(u, {
610
691
  code: l,
611
692
  requestId: d,
@@ -615,13 +696,13 @@ function Se(e, t, n) {
615
696
  }
616
697
  //#endregion
617
698
  //#region src/v2/api/captureAttribution.ts
618
- var Ce = 128, we = /[\u0000-\u001f\u007f]/g;
699
+ var Fe = 128, Ie = /[\u0000-\u001f\u007f]/g;
619
700
  function J(e) {
620
701
  if (!e) return;
621
- let t = e.replace(we, "").trim();
622
- if (t) return t.slice(0, Ce);
702
+ let t = e.replace(Ie, "").trim();
703
+ if (t) return t.slice(0, Fe);
623
704
  }
624
- function Te(e) {
705
+ function Le(e) {
625
706
  let t = new URLSearchParams((e ?? "").startsWith("?") ? (e ?? "").slice(1) : e ?? "");
626
707
  return {
627
708
  ...J(t.get("utm_source")) ? { utmSource: J(t.get("utm_source")) } : {},
@@ -631,7 +712,7 @@ function Te(e) {
631
712
  ...J(t.get("utm_term")) ? { utmTerm: J(t.get("utm_term")) } : {}
632
713
  };
633
714
  }
634
- function Ee(e) {
715
+ function Re(e) {
635
716
  if (e === !1) return;
636
717
  if (e && typeof e == "object") {
637
718
  let t = {
@@ -645,7 +726,7 @@ function Ee(e) {
645
726
  return Object.keys(t).length ? t : void 0;
646
727
  }
647
728
  if (typeof window > "u") return;
648
- let t = Te(window.location?.search), n = J(document.referrer || void 0), r = {
729
+ let t = Le(window.location?.search), n = J(document.referrer || void 0), r = {
649
730
  ...t,
650
731
  ...n ? { referrer: n } : {}
651
732
  };
@@ -653,19 +734,19 @@ function Ee(e) {
653
734
  }
654
735
  //#endregion
655
736
  //#region src/v2/api/sessionEndpointRequest.ts
656
- function De(e) {
737
+ function ze(e) {
657
738
  let t = e.locale?.trim();
658
739
  if (t) return t;
659
740
  let n = e.language?.trim();
660
741
  if (n) return n;
661
742
  if (typeof navigator < "u" && navigator.language?.trim()) return navigator.language.trim();
662
743
  }
663
- function Oe(e) {
744
+ function Be(e) {
664
745
  let t = e.secondaryLocale?.trim(), n = e.learningLocale?.trim();
665
746
  if (t && n && t !== n) throw Error("secondaryLocale and learningLocale disagree; pass only one or make them equal.");
666
747
  return t || n || void 0;
667
748
  }
668
- function ke(e, t) {
749
+ function Ve(e, t) {
669
750
  let n = e.trim();
670
751
  if (!n) throw Error("sessionEndpoint must not be empty.");
671
752
  if (typeof location > "u") throw Error("sessionEndpoint is only available in a browser.");
@@ -673,7 +754,7 @@ function ke(e, t) {
673
754
  if (r.origin !== location.origin) throw Error("sessionEndpoint must be same-origin.");
674
755
  let i = t.experienceId.trim();
675
756
  if (!i) throw Error("sessionEndpoint requires experienceId.");
676
- let a = De(t), o = Oe(t), s = t.idempotencyKey?.trim();
757
+ let a = ze(t), o = Be(t), s = t.idempotencyKey?.trim();
677
758
  return {
678
759
  url: r.toString(),
679
760
  init: {
@@ -692,7 +773,7 @@ function ke(e, t) {
692
773
  ...t.speechInputMode ? { speechInputMode: t.speechInputMode } : {},
693
774
  ...t.speechOnly === void 0 ? {} : { speechOnly: t.speechOnly },
694
775
  ...(() => {
695
- let e = Ee(t.attribution);
776
+ let e = Re(t.attribution);
696
777
  return e ? { attribution: e } : {};
697
778
  })(),
698
779
  ...t.alreadyConverted?.length ? { alreadyConverted: [...t.alreadyConverted] } : {}
@@ -708,7 +789,7 @@ function Y(e) {
708
789
  function X(e) {
709
790
  return typeof e == "boolean";
710
791
  }
711
- function Ae(e) {
792
+ function He(e) {
712
793
  if (!Y(e)) return null;
713
794
  let t = e.speech, n = e.conversation, r = e.avatar, i = e.tools;
714
795
  return !Y(t) || !Y(n) || !Y(r) || !Y(i) || !X(t.input) || !X(t.output) || !X(t.externalAudio) || !X(n.managed) || !X(r.enabled) || !X(i.enabled) ? null : {
@@ -722,7 +803,7 @@ function Ae(e) {
722
803
  tools: { enabled: i.enabled }
723
804
  };
724
805
  }
725
- function je(e) {
806
+ function Ue(e) {
726
807
  return !Y(e) || !X(e.avatar) || !X(e.speechInput) || !X(e.speechOutput) || !X(e.tools) || !X(e.externalAudio) ? null : {
727
808
  speech: {
728
809
  input: e.speechInput,
@@ -734,12 +815,12 @@ function je(e) {
734
815
  tools: { enabled: e.tools }
735
816
  };
736
817
  }
737
- function Me(e) {
738
- return Ae(e) ?? je(e);
818
+ function We(e) {
819
+ return He(e) ?? Ue(e);
739
820
  }
740
- function Ne(e) {
821
+ function Ge(e) {
741
822
  if (!Y(e)) throw Error("Session Launch response is missing session.");
742
- let t = typeof e.id == "string" ? e.id.trim() : "", n = typeof e.experienceId == "string" ? e.experienceId.trim() : "", r = typeof e.experienceRevisionId == "string" ? e.experienceRevisionId.trim() : "", i = typeof e.expiresAt == "string" ? e.expiresAt.trim() : "", a = typeof e.locale == "string" ? e.locale.trim() : "", o = typeof e.secondaryLocale == "string" && e.secondaryLocale.trim() ? e.secondaryLocale.trim() : void 0, s = e.mode === "conversation" || e.mode === "presenter" ? e.mode : null, c = Me(e.capabilities), l = Pe(e.localeVoiceFallbacks), u = e.status === "active" || e.status === "ended" ? e.status : void 0, d = typeof e.createdAt == "string" && e.createdAt.trim() ? e.createdAt.trim() : void 0;
823
+ let t = typeof e.id == "string" ? e.id.trim() : "", n = typeof e.experienceId == "string" ? e.experienceId.trim() : "", r = typeof e.experienceRevisionId == "string" ? e.experienceRevisionId.trim() : "", i = typeof e.expiresAt == "string" ? e.expiresAt.trim() : "", a = typeof e.locale == "string" ? e.locale.trim() : "", o = typeof e.secondaryLocale == "string" && e.secondaryLocale.trim() ? e.secondaryLocale.trim() : void 0, s = e.mode === "conversation" || e.mode === "presenter" ? e.mode : null, c = We(e.capabilities), l = Ke(e.localeVoiceFallbacks), u = e.status === "active" || e.status === "ended" ? e.status : void 0, d = typeof e.createdAt == "string" && e.createdAt.trim() ? e.createdAt.trim() : void 0;
743
824
  if (!t || !n || !r || !i || !a || !s || !c) throw Error("Session Launch response has an invalid session object.");
744
825
  return {
745
826
  id: t,
@@ -755,7 +836,7 @@ function Ne(e) {
755
836
  ...d ? { createdAt: d } : {}
756
837
  };
757
838
  }
758
- function Pe(e) {
839
+ function Ke(e) {
759
840
  if (!Array.isArray(e) || e.length === 0) return;
760
841
  let t = [];
761
842
  for (let n of e) {
@@ -770,35 +851,35 @@ function Pe(e) {
770
851
  }
771
852
  return t.length > 0 ? t : void 0;
772
853
  }
773
- function Fe(e) {
854
+ function qe(e) {
774
855
  let t = e.localeVoiceFallbacks;
775
856
  if (t?.length) for (let e of t) {
776
857
  let t = e.axis === "secondaryLocale" ? "secondaryLocale" : "locale";
777
858
  console.warn(`[liforma] Session ${t} fell back to ${e.resolved} because the voice does not support ${e.requested}.`);
778
859
  }
779
860
  }
780
- function Ie(e) {
861
+ function Je(e) {
781
862
  if (!Y(e)) throw Error("Session Launch response must be a JSON object.");
782
863
  let t = typeof e.launch == "string" ? e.launch.trim() : "";
783
864
  if (!t) throw Error("Session Launch response is missing launch.");
784
- let n = Ne(e.session);
785
- return Fe(n), {
865
+ let n = Ge(e.session);
866
+ return qe(n), {
786
867
  session: n,
787
868
  launch: t
788
869
  };
789
870
  }
790
871
  //#endregion
791
872
  //#region src/v2/api/mintPublicSession.ts
792
- function Le() {
873
+ function Ye() {
793
874
  try {
794
875
  if (typeof globalThis.location?.origin == "string" && globalThis.location.origin) return globalThis.location.origin;
795
876
  } catch {}
796
877
  }
797
- function Re(e) {
878
+ function Xe(e) {
798
879
  return e ? e.trim().toUpperCase().replace(/-/g, "_") : "";
799
880
  }
800
- function ze(e, t) {
801
- let n = Le(), r = Re(t.code), i = t.message.trim(), a = t.details ?? {};
881
+ function Ze(e, t) {
882
+ let n = Ye(), r = Xe(t.code), i = t.message.trim(), a = t.details ?? {};
802
883
  if (r === "ORIGIN_NOT_ALLOWED" || /^Origin not allowed/i.test(i) && n) {
803
884
  if (i.includes(e) && i.includes("allowed origin")) return t;
804
885
  let r = typeof a.origin == "string" && a.origin || n || "(unknown origin)";
@@ -821,38 +902,38 @@ function ze(e, t) {
821
902
  details: a
822
903
  }) : t;
823
904
  }
824
- function Be(e) {
905
+ function Qe(e) {
825
906
  let t = e?.locale?.trim();
826
907
  if (t) return t;
827
908
  let n = e?.language?.trim();
828
909
  if (n) return n;
829
910
  if (typeof navigator < "u" && navigator.language?.trim()) return navigator.language.trim();
830
911
  }
831
- function Ve(e) {
912
+ function $e(e) {
832
913
  let t = e?.secondaryLocale?.trim(), n = e?.learningLocale?.trim();
833
914
  if (t && n && t !== n) throw new q("secondaryLocale and learningLocale disagree; pass only one or make them equal.", { code: "INVALID_BODY" });
834
915
  return t || n || void 0;
835
916
  }
836
- function He(e, t) {
837
- let n = { experienceId: e }, r = Be(t);
917
+ function et(e, t) {
918
+ let n = { experienceId: e }, r = Qe(t);
838
919
  r && (n.locale = r);
839
- let i = Ve(t);
920
+ let i = $e(t);
840
921
  i && (n.secondaryLocale = i), t?.mode && (n.mode = t.mode), t?.speechInputMode && (n.speechInputMode = t.speechInputMode), t?.speechOnly !== void 0 && (n.speechOnly = t.speechOnly);
841
- let a = Ee(t?.attribution);
922
+ let a = Re(t?.attribution);
842
923
  return a && (n.attribution = a), t?.alreadyConverted?.length && (n.alreadyConverted = [...t.alreadyConverted]), n;
843
924
  }
844
- async function Ue(e, t) {
845
- let n = ve(), r = t?.idempotencyKey?.trim(), i = await fetch(`${n}/v1/browser-sessions`, {
925
+ async function tt(e, t) {
926
+ let n = K(), r = t?.idempotencyKey?.trim(), i = await fetch(`${n}/v1/browser-sessions`, {
846
927
  method: "POST",
847
928
  headers: {
848
929
  "Content-Type": "application/json",
849
930
  ...r ? { "Idempotency-Key": r } : {}
850
931
  },
851
- body: JSON.stringify(He(e, t))
932
+ body: JSON.stringify(et(e, t))
852
933
  });
853
934
  if (!i.ok) {
854
935
  let t = await i.text();
855
- throw ze(e, Se(i.status, t, i.headers));
936
+ throw Ze(e, Pe(i.status, t, i.headers));
856
937
  }
857
938
  let a;
858
939
  try {
@@ -864,10 +945,10 @@ async function Ue(e, t) {
864
945
  requestId: i.headers.get("Liforma-Request-Id") ?? void 0
865
946
  });
866
947
  }
867
- return Ie(a);
948
+ return Je(a);
868
949
  }
869
- async function We(e, t) {
870
- let n = ke(e, t), r = new AbortController(), i = () => r.abort(t.signal?.reason);
950
+ async function nt(e, t) {
951
+ let n = Ve(e, t), r = new AbortController(), i = () => r.abort(t.signal?.reason);
871
952
  t.signal?.aborted ? i() : t.signal?.addEventListener("abort", i, { once: !0 });
872
953
  let a = globalThis.setTimeout(() => r.abort(new DOMException("Session endpoint timed out.", "TimeoutError")), t.timeoutMs ?? 3e4), o;
873
954
  try {
@@ -880,7 +961,7 @@ async function We(e, t) {
880
961
  }
881
962
  if (!o.ok) {
882
963
  let e = await o.text();
883
- throw Se(o.status, e, o.headers);
964
+ throw Pe(o.status, e, o.headers);
884
965
  }
885
966
  if (!o.headers.get("content-type")?.toLowerCase().includes("application/json")) throw new q("Session endpoint must return a JSON Session Launch response.", {
886
967
  code: "INVALID_RESPONSE",
@@ -897,14 +978,14 @@ async function We(e, t) {
897
978
  requestId: o.headers.get("Liforma-Request-Id") ?? void 0
898
979
  });
899
980
  }
900
- return Ie(s);
981
+ return Je(s);
901
982
  }
902
983
  //#endregion
903
984
  //#region src/v2/conversationProcessor.ts
904
- function Ge(e) {
985
+ function rt(e) {
905
986
  return typeof e != "object" || !e ? !1 : typeof e[Symbol.asyncIterator] == "function";
906
987
  }
907
- function Ke(e) {
988
+ function it(e) {
908
989
  if (typeof e == "string") {
909
990
  let t = e.trim();
910
991
  if (!t) throw Error("conversationProcessor returned empty text.");
@@ -918,24 +999,24 @@ function Ke(e) {
918
999
  ...e.behavior ? { behavior: e.behavior } : {}
919
1000
  };
920
1001
  }
921
- async function qe(e, t) {
1002
+ async function at(e, t) {
922
1003
  let n = await e(t);
923
- return Ge(n) ? {
1004
+ return rt(n) ? {
924
1005
  kind: "stream",
925
1006
  stream: n
926
1007
  } : {
927
1008
  kind: "complete",
928
- speech: Ke(n)
1009
+ speech: it(n)
929
1010
  };
930
1011
  }
931
1012
  //#endregion
932
1013
  //#region src/v2/embed/playerReachability.ts
933
- var Je = "3002";
934
- function Ye(e) {
1014
+ var ot = "3002";
1015
+ function st(e) {
935
1016
  let t = new URL(e);
936
- return t.hostname === "localhost" || t.hostname === "127.0.0.1" ? `Cannot connect to the Liforma player at ${e} — nothing is listening on port ${t.port || Je}. Start the player dev server in player.liforma.ai (npm run dev).` : `Cannot connect to the Liforma player at ${e}. The embed did not load; check your network connection and player URL configuration.`;
1017
+ return t.hostname === "localhost" || t.hostname === "127.0.0.1" ? `Cannot connect to the Liforma player at ${e} — nothing is listening on port ${t.port || ot}. Start the player dev server in player.liforma.ai (npm run dev).` : `Cannot connect to the Liforma player at ${e}. The embed did not load; check your network connection and player URL configuration.`;
937
1018
  }
938
- async function Xe(e, t) {
1019
+ async function ct(e, t) {
939
1020
  try {
940
1021
  await fetch(e, {
941
1022
  method: "GET",
@@ -943,25 +1024,25 @@ async function Xe(e, t) {
943
1024
  signal: AbortSignal.timeout(8e3)
944
1025
  });
945
1026
  } catch {
946
- throw Error(Ye(t));
1027
+ throw Error(st(t));
947
1028
  }
948
1029
  }
949
- function Ze(e, t, n, r) {
1030
+ function lt(e, t, n, r) {
950
1031
  try {
951
1032
  r && r.length > 0 ? e.postMessage(t, n, r) : e.postMessage(t, n);
952
1033
  } catch (e) {
953
- throw e instanceof DOMException && e.name === "SecurityError" ? Error(Ye(n), { cause: e }) : e;
1034
+ throw e instanceof DOMException && e.name === "SecurityError" ? Error(st(n), { cause: e }) : e;
954
1035
  }
955
1036
  }
956
- var Qe = new Set([1, 2]);
957
- function $e(e) {
958
- return typeof e == "number" && Qe.has(e);
1037
+ var ut = new Set([1, 2]);
1038
+ function dt(e) {
1039
+ return typeof e == "number" && ut.has(e);
959
1040
  }
960
- var et = new Set(/* @__PURE__ */ "close.stateUpdate.commandResult.userTranscript.characterSpeechStarted.characterSpeechEnded.characterFocusChanged.conversationUpdate.listeningState.userSpeechStarted.userSpeechEnded.modeChange.activityChange.feedback.feedbackFailed.message.started.embedReady.widgetReady.widgetExpand.widgetCollapse.widgetAudioSettings.widgetDragStart.widgetDragMove.widgetDragEnd.fullWindow.interactionChange".split("."));
961
- function tt(e) {
1041
+ var ft = new Set(/* @__PURE__ */ "close.stateUpdate.commandResult.userTranscript.characterSpeechStarted.characterSpeechEnded.characterFocusChanged.conversationUpdate.listeningState.userSpeechStarted.userSpeechEnded.modeChange.activityChange.feedback.feedbackFailed.message.started.embedReady.widgetReady.widgetExpand.widgetCollapse.widgetAudioSettings.widgetDragStart.widgetDragMove.widgetDragEnd.fullWindow.interactionChange".split("."));
1042
+ function pt(e) {
962
1043
  if (!e || typeof e != "object") return null;
963
1044
  let t = e;
964
- if (!$e(t.schemaVersion) || !t.type || !et.has(t.type)) return null;
1045
+ if (!dt(t.schemaVersion) || !t.type || !ft.has(t.type)) return null;
965
1046
  if (t.type === "embedReady" || t.type === "widgetReady" || t.type === "widgetExpand" || t.type === "widgetCollapse") return t;
966
1047
  if (t.type === "fullWindow") {
967
1048
  let e = t.payload;
@@ -984,7 +1065,7 @@ function tt(e) {
984
1065
  let n = t.payload;
985
1066
  return !n || typeof n != "object" ? null : t;
986
1067
  }
987
- function nt(e, t, n) {
1068
+ function mt(e, t, n) {
988
1069
  let r = e.trim();
989
1070
  if (!r) throw Error("createLaunchMessage requires a non-empty launch string.");
990
1071
  let i = n?.startButton, a = n?.theme, o = n?.showFeedback, s = n?.interaction;
@@ -1001,20 +1082,20 @@ function nt(e, t, n) {
1001
1082
  }
1002
1083
  };
1003
1084
  }
1004
- function rt() {
1085
+ function ht() {
1005
1086
  return {
1006
1087
  type: "parentHello",
1007
1088
  schemaVersion: 2
1008
1089
  };
1009
1090
  }
1010
- function it(e) {
1091
+ function gt(e) {
1011
1092
  return {
1012
1093
  type: "widgetSetChrome",
1013
1094
  schemaVersion: 2,
1014
1095
  payload: { mode: e }
1015
1096
  };
1016
1097
  }
1017
- function at() {
1098
+ function _t() {
1018
1099
  return {
1019
1100
  type: "widgetToggleAudioSettings",
1020
1101
  schemaVersion: 2,
@@ -1023,8 +1104,8 @@ function at() {
1023
1104
  }
1024
1105
  //#endregion
1025
1106
  //#region src/v2/embed/fullWindowHost.ts
1026
- var ot = "2147483000";
1027
- function st(e) {
1107
+ var vt = "2147483000";
1108
+ function yt(e) {
1028
1109
  let { style: t } = e;
1029
1110
  return {
1030
1111
  position: t.position,
@@ -1042,11 +1123,11 @@ function st(e) {
1042
1123
  maxHeight: t.maxHeight
1043
1124
  };
1044
1125
  }
1045
- function ct(e) {
1126
+ function bt(e) {
1046
1127
  let { style: t } = e;
1047
- t.position = "fixed", t.top = "0", t.right = "0", t.bottom = "0", t.left = "0", t.inset = "0", t.width = "100vw", t.width = "100dvw", t.height = "100vh", t.height = "100dvh", t.zIndex = ot, t.margin = "0", t.borderRadius = "0", t.maxWidth = "none", t.maxHeight = "none", e.dataset.liformaFullWindow = "1";
1128
+ t.position = "fixed", t.top = "0", t.right = "0", t.bottom = "0", t.left = "0", t.inset = "0", t.width = "100vw", t.width = "100dvw", t.height = "100vh", t.height = "100dvh", t.zIndex = vt, t.margin = "0", t.borderRadius = "0", t.maxWidth = "none", t.maxHeight = "none", e.dataset.liformaFullWindow = "1";
1048
1129
  }
1049
- function lt(e, t) {
1130
+ function xt(e, t) {
1050
1131
  if (delete e.dataset.liformaFullWindow, !t) {
1051
1132
  e.style.position = "", e.style.top = "", e.style.right = "", e.style.bottom = "", e.style.left = "", e.style.inset = "", e.style.width = "", e.style.height = "", e.style.zIndex = "", e.style.margin = "", e.style.borderRadius = "", e.style.maxWidth = "", e.style.maxHeight = "";
1052
1133
  return;
@@ -1056,20 +1137,20 @@ function lt(e, t) {
1056
1137
  }
1057
1138
  //#endregion
1058
1139
  //#region src/v2/embed/iframeHost.ts
1059
- function ut(e) {
1140
+ function St(e) {
1060
1141
  return e;
1061
1142
  }
1062
1143
  function Z() {
1063
1144
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `cmd_${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}` : `cmd_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
1064
1145
  }
1065
- var dt = 3e4;
1066
- function ft(e) {
1146
+ var Ct = 3e4;
1147
+ function wt(e) {
1067
1148
  let t = e.container;
1068
1149
  getComputedStyle(t).position === "static" && (t.style.position = "relative");
1069
1150
  let n = document.createElement("iframe");
1070
1151
  n.src = e.src, n.title = "Liforma experience", n.setAttribute("allow", "microphone; autoplay; clipboard-read; clipboard-write"), n.style.cssText = e.transparent ? "display:block;position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;" : "display:block;position:absolute;inset:0;width:100%;height:100%;border:0;background:#030508;", e.transparent && n.setAttribute("allowtransparency", "true");
1071
1152
  let r = !1, i = !1, a = null, o = t.closest(".liforma-experience-shell") instanceof HTMLElement ? t.closest(".liforma-experience-shell") : t, s = (t) => {
1072
- i !== t && (i = t, t ? (a = st(o), ct(o)) : (lt(o, a), a = null), e.onFullWindowChange?.(t));
1153
+ i !== t && (i = t, t ? (a = yt(o), bt(o)) : (xt(o, a), a = null), e.onFullWindowChange?.(t));
1073
1154
  }, c = /* @__PURE__ */ new Map(), l = null, u = 0, d = 0, f = [], p = null, m = null, h = new Promise((e, t) => {
1074
1155
  p = e, m = t;
1075
1156
  }), g = () => {
@@ -1080,10 +1161,10 @@ function ft(e) {
1080
1161
  let i = Date.now();
1081
1162
  if (d > 0 && i - d < 250) return;
1082
1163
  d = i, g();
1083
- let a = nt(t.launch, t.session, t.chrome), o = () => {
1164
+ let a = mt(t.launch, t.session, t.chrome), o = () => {
1084
1165
  if (r) return;
1085
1166
  let t = n.contentWindow;
1086
- t && Ze(t, a, e.playerOrigin);
1167
+ t && lt(t, a, e.playerOrigin);
1087
1168
  };
1088
1169
  o();
1089
1170
  for (let e = 1; e <= 12; e += 1) f.push(window.setTimeout(o, e * 75));
@@ -1091,17 +1172,17 @@ function ft(e) {
1091
1172
  r || !l || _(l);
1092
1173
  }, y = () => {
1093
1174
  if (u += 1, u === 1) {
1094
- Xe(e.src, e.playerOrigin).then(() => p?.(), (e) => m?.(e instanceof Error ? e : Error(String(e))));
1175
+ ct(e.src, e.playerOrigin).then(() => p?.(), (e) => m?.(e instanceof Error ? e : Error(String(e))));
1095
1176
  return;
1096
1177
  }
1097
1178
  d = 0, v();
1098
1179
  }, b = () => {
1099
- u > 0 || m?.(Error(Ye(e.playerOrigin)));
1180
+ u > 0 || m?.(Error(st(e.playerOrigin)));
1100
1181
  };
1101
1182
  n.addEventListener("load", y), n.addEventListener("error", b);
1102
1183
  let x = (t) => {
1103
1184
  if (r || t.source !== n.contentWindow || t.origin !== e.playerOrigin) return;
1104
- let i = tt(t.data);
1185
+ let i = pt(t.data);
1105
1186
  if (i) switch (i.type) {
1106
1187
  case "close":
1107
1188
  e.onClose?.(i.payload);
@@ -1140,7 +1221,7 @@ function ft(e) {
1140
1221
  e.onUserSpeechEnded?.(i.payload);
1141
1222
  break;
1142
1223
  case "modeChange":
1143
- e.onActivityChange?.(ut(i.payload.mode));
1224
+ e.onActivityChange?.(St(i.payload.mode));
1144
1225
  break;
1145
1226
  case "activityChange":
1146
1227
  e.onActivityChange?.(i.payload.activity);
@@ -1196,8 +1277,8 @@ function ft(e) {
1196
1277
  let S = (t, i) => {
1197
1278
  if (r) return;
1198
1279
  let a = n.contentWindow;
1199
- if (!a) throw Error(Ye(e.playerOrigin));
1200
- Ze(a, t, e.playerOrigin, i);
1280
+ if (!a) throw Error(st(e.playerOrigin));
1281
+ lt(a, t, e.playerOrigin, i);
1201
1282
  }, C = (e, t = 12e4, n) => {
1202
1283
  let r = e.type !== "parentHello" && e.payload && "correlationId" in e.payload ? e.payload.correlationId : Z();
1203
1284
  return e.type !== "parentHello" && e.payload && "correlationId" in e.payload || e.type !== "parentHello" && e.payload && (e.payload.correlationId = r), new Promise((i, a) => {
@@ -1214,7 +1295,7 @@ function ft(e) {
1214
1295
  return h;
1215
1296
  },
1216
1297
  postParentHello() {
1217
- S(rt());
1298
+ S(ht());
1218
1299
  },
1219
1300
  postLaunch(e, t, n) {
1220
1301
  r || (l = {
@@ -1236,10 +1317,10 @@ function ft(e) {
1236
1317
  throw Error("postManifest is deprecated; use postLaunch with an opaque launch string from SessionLaunchResponse.");
1237
1318
  },
1238
1319
  postWidgetSetChrome(e) {
1239
- S(it(e));
1320
+ S(gt(e));
1240
1321
  },
1241
1322
  postWidgetToggleAudioSettings() {
1242
- S(at());
1323
+ S(_t());
1243
1324
  },
1244
1325
  speak(e) {
1245
1326
  return C({
@@ -1361,7 +1442,7 @@ function ft(e) {
1361
1442
  audio: e.audio,
1362
1443
  byteLength: e.byteLength
1363
1444
  }
1364
- }, dt, [e.audio]);
1445
+ }, Ct, [e.audio]);
1365
1446
  },
1366
1447
  speechUtteranceSetTranscript(e) {
1367
1448
  return C({
@@ -1433,6 +1514,36 @@ function ft(e) {
1433
1514
  }
1434
1515
  });
1435
1516
  },
1517
+ setStage(e) {
1518
+ return C({
1519
+ type: "setStage",
1520
+ schemaVersion: 2,
1521
+ payload: {
1522
+ correlationId: Z(),
1523
+ stage: e
1524
+ }
1525
+ });
1526
+ },
1527
+ setPipBackground(e) {
1528
+ return C({
1529
+ type: "setPipBackground",
1530
+ schemaVersion: 2,
1531
+ payload: {
1532
+ correlationId: Z(),
1533
+ pipBackground: e
1534
+ }
1535
+ });
1536
+ },
1537
+ setPipShadow(e) {
1538
+ return C({
1539
+ type: "setPipShadow",
1540
+ schemaVersion: 2,
1541
+ payload: {
1542
+ correlationId: Z(),
1543
+ pipShadow: e
1544
+ }
1545
+ });
1546
+ },
1436
1547
  setInteraction(e) {
1437
1548
  return C({
1438
1549
  type: "setInteraction",
@@ -1493,7 +1604,7 @@ function ft(e) {
1493
1604
  }
1494
1605
  //#endregion
1495
1606
  //#region src/v2/embed/readyGate.ts
1496
- function pt(e) {
1607
+ function Tt(e) {
1497
1608
  let t, n = !1, r = !1, i = () => {
1498
1609
  r || !n || t === void 0 || (r = !0, e(t));
1499
1610
  };
@@ -1508,9 +1619,9 @@ function pt(e) {
1508
1619
  }
1509
1620
  //#endregion
1510
1621
  //#region src/v2/sdkRelease.ts
1511
- var mt = `sdk@${{
1622
+ var Et = `sdk@${{
1512
1623
  name: "@liforma/client",
1513
- version: "0.4.10",
1624
+ version: "0.4.11",
1514
1625
  type: "module",
1515
1626
  description: "Liforma browser SDK — Experience sessions, speech API, and Svelte embed component.",
1516
1627
  license: "MIT",
@@ -1729,50 +1840,50 @@ var mt = `sdk@${{
1729
1840
  vitest: "^4.1.10",
1730
1841
  wrangler: "^4.101.0"
1731
1842
  }
1732
- }.version}`, ht = "https://player.liforma.ai/embed", gt = "http://localhost:3002/embed";
1733
- function _t() {
1843
+ }.version}`, Dt = "https://player.liforma.ai/embed", Ot = "http://localhost:3002/embed";
1844
+ function kt() {
1734
1845
  let e = globalThis.__LIFORMA_PLAYER_EMBED_URL;
1735
1846
  if (e?.trim()) return e.trim().replace(/\/$/, "");
1736
1847
  if (typeof document > "u") return null;
1737
1848
  let t = (document.querySelector("script[data-liforma-sdk][src*=\"client.js\"]") ?? document.querySelector("script[src*=\"/sdk/v2/client.js\"]"))?.getAttribute("data-player-embed-url")?.trim();
1738
1849
  return t ? t.replace(/\/$/, "") : null;
1739
1850
  }
1740
- function vt() {
1741
- let e = _t();
1742
- return e ? e.endsWith("/embed") ? e : `${e}/embed` : T() ? gt : ht;
1851
+ function At() {
1852
+ let e = kt();
1853
+ return e ? e.endsWith("/embed") ? e : `${e}/embed` : te() ? Ot : Dt;
1743
1854
  }
1744
- function yt(e, t) {
1855
+ function jt(e, t) {
1745
1856
  return e?.trim() || t?.trim() || void 0;
1746
1857
  }
1747
- function bt(e, t, n, r, i, a, o, s) {
1748
- let c = (e ?? vt()).replace(/\/$/, ""), l = c.endsWith("/embed") ? c : `${c}/embed`, u = new URL(l), d = n?.trim();
1749
- d && (u.searchParams.set("backdropId", d), u.searchParams.set("locationId", d));
1750
- let f = r?.trim();
1751
- return f && u.searchParams.set("avatarId", f), (i === "face" || i === "medium") && u.searchParams.set("fit", i), a === "widget" && u.searchParams.set("ui", "widget"), o && u.searchParams.set("close", "1"), t && u.searchParams.set("debug", "true"), (s === 2 || s === 3 || s === 4) && u.searchParams.set("cast", String(s)), xt(u.toString());
1858
+ function Mt(e, t, n, r, i, a, o, s, c, l, u) {
1859
+ let d = (e ?? At()).replace(/\/$/, ""), f = d.endsWith("/embed") ? d : `${d}/embed`, p = new URL(f), m = n?.trim();
1860
+ m && p.searchParams.set("backdropId", m);
1861
+ let h = r?.trim();
1862
+ return h && p.searchParams.set("avatarId", h), (i === "face" || i === "medium") && p.searchParams.set("fit", i), c === "pip" && p.searchParams.set("stage", "pip"), l === "set" && p.searchParams.set("pipBackground", "set"), u === !1 && p.searchParams.set("pipShadow", "0"), a === "widget" && p.searchParams.set("ui", "widget"), o && p.searchParams.set("close", "1"), t && p.searchParams.set("debug", "true"), (s === 2 || s === 3 || s === 4) && p.searchParams.set("cast", String(s)), Nt(p.toString());
1752
1863
  }
1753
- function xt(e) {
1864
+ function Nt(e) {
1754
1865
  if (typeof location > "u") return e;
1755
1866
  let t = new URL(e);
1756
1867
  return t.searchParams.set("parentOrigin", location.origin), t.toString();
1757
1868
  }
1758
- function St(e) {
1869
+ function Pt(e) {
1759
1870
  return new URL(e).origin;
1760
1871
  }
1761
1872
  //#endregion
1762
1873
  //#region src/v2/experienceEvents.ts
1763
- function Ct() {
1874
+ function Ft() {
1764
1875
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `evt_${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}` : `evt_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
1765
1876
  }
1766
- function wt(e, t, n) {
1877
+ function It(e, t, n) {
1767
1878
  return {
1768
- id: Ct(),
1879
+ id: Ft(),
1769
1880
  type: e,
1770
1881
  sessionId: t,
1771
1882
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1772
1883
  data: n
1773
1884
  };
1774
1885
  }
1775
- function Tt() {
1886
+ function Lt() {
1776
1887
  return {
1777
1888
  ready: /* @__PURE__ */ new Set(),
1778
1889
  started: /* @__PURE__ */ new Set(),
@@ -1793,39 +1904,39 @@ function Tt() {
1793
1904
  conversationProcessorError: /* @__PURE__ */ new Set()
1794
1905
  };
1795
1906
  }
1796
- function Et(e, t, n) {
1907
+ function Rt(e, t, n) {
1797
1908
  return e[t].add(n), () => e[t].delete(n);
1798
1909
  }
1799
- function Dt(e, t, n) {
1910
+ function zt(e, t, n) {
1800
1911
  for (let r of e[t]) r(n);
1801
1912
  }
1802
- function Ot(e) {
1913
+ function Bt(e) {
1803
1914
  for (let t of Object.keys(e)) e[t].clear();
1804
1915
  }
1805
1916
  //#endregion
1806
1917
  //#region src/v2/speech/types.ts
1807
- function kt(e) {
1918
+ function Vt(e) {
1808
1919
  return "data" in e && "format" in e && e.format != null && !("track" in e);
1809
1920
  }
1810
- function At(e) {
1921
+ function Ht(e) {
1811
1922
  return "url" in e && typeof e.url == "string";
1812
1923
  }
1813
- function jt(e) {
1924
+ function Ut(e) {
1814
1925
  if (!("track" in e)) return !1;
1815
1926
  let t = e.track;
1816
1927
  return typeof t != "object" || !t ? !1 : typeof MediaStreamTrack < "u" && t instanceof MediaStreamTrack ? !0 : "kind" in t && "readyState" in t;
1817
1928
  }
1818
- function Mt(e) {
1819
- return !kt(e) && !At(e) && !jt(e) && "encoding" in e && typeof e.encoding == "string";
1929
+ function Wt(e) {
1930
+ return !Vt(e) && !Ht(e) && !Ut(e) && "encoding" in e && typeof e.encoding == "string";
1820
1931
  }
1821
- var Nt = [
1932
+ var Gt = [
1822
1933
  8e3,
1823
1934
  16e3,
1824
1935
  22050,
1825
1936
  24e3,
1826
1937
  44100,
1827
1938
  48e3
1828
- ], Pt = {
1939
+ ], Kt = {
1829
1940
  MAX_CHUNK_BYTES: 64 * 1024,
1830
1941
  RECOMMENDED_CHUNK_MS_MIN: 20,
1831
1942
  RECOMMENDED_CHUNK_MS_MAX: 200,
@@ -1836,14 +1947,14 @@ var Nt = [
1836
1947
  MAX_UTTERANCE_DURATION_MS: 9e4,
1837
1948
  MAX_PENDING_WRITES: 8,
1838
1949
  DEFAULT_WRITE_TIMEOUT_MS: 5e3
1839
- }, Ft = class extends Error {
1950
+ }, qt = class extends Error {
1840
1951
  operation;
1841
1952
  requiredCapability;
1842
1953
  name = "UnsupportedSpeechOperationError";
1843
1954
  constructor(e, t) {
1844
1955
  super(`Speech operation "${e}" requires capability "${t}".`), this.operation = e, this.requiredCapability = t;
1845
1956
  }
1846
- }, It = class extends Error {
1957
+ }, Jt = class extends Error {
1847
1958
  name = "SpeechUtteranceClosedError";
1848
1959
  constructor(e = "Cannot write to a closed or cancelled speech utterance.") {
1849
1960
  super(e);
@@ -1853,72 +1964,72 @@ var Nt = [
1853
1964
  constructor(e, t) {
1854
1965
  super(e, t);
1855
1966
  }
1856
- }, Lt = class extends Error {
1967
+ }, Yt = class extends Error {
1857
1968
  name = "SpeechBufferTimeoutError";
1858
1969
  constructor(e = "Timed out waiting for speech buffer capacity.") {
1859
1970
  super(e);
1860
1971
  }
1861
1972
  };
1862
- function Rt(e = "none") {
1973
+ function Xt(e = "none") {
1863
1974
  return {
1864
1975
  mode: e,
1865
1976
  trackedDurationMs: 0,
1866
1977
  fallbackDurationMs: 0
1867
1978
  };
1868
1979
  }
1869
- function zt(e) {
1870
- return Nt.includes(e);
1980
+ function Zt(e) {
1981
+ return Gt.includes(e);
1871
1982
  }
1872
- function Bt(e) {
1983
+ function Qt(e) {
1873
1984
  if (e.encoding !== "pcm_s16le") throw new Q(`Unsupported audio encoding: ${e.encoding}`);
1874
1985
  if (e.channels !== 1) throw new Q(`Unsupported channel count: ${e.channels}`);
1875
- if (!zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1986
+ if (!Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1876
1987
  }
1877
- function Vt(e) {
1878
- if (kt(e)) {
1879
- Bt(e.format);
1988
+ function $t(e) {
1989
+ if (Vt(e)) {
1990
+ Qt(e.format);
1880
1991
  return;
1881
1992
  }
1882
- if (At(e)) {
1993
+ if (Ht(e)) {
1883
1994
  if (!e.url.trim()) throw new Q("Audio URL must be non-empty.");
1884
- if (e.sampleRate !== void 0 && !zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1995
+ if (e.sampleRate !== void 0 && !Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1885
1996
  return;
1886
1997
  }
1887
- if (jt(e)) {
1998
+ if (Ut(e)) {
1888
1999
  if (e.track.kind !== "audio") throw new Q("speech.play track must be an audio MediaStreamTrack.");
1889
- if (e.sampleRate !== void 0 && !zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2000
+ if (e.sampleRate !== void 0 && !Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1890
2001
  return;
1891
2002
  }
1892
- if (Mt(e)) {
2003
+ if (Wt(e)) {
1893
2004
  let t = e.encoding.trim().toLowerCase();
1894
2005
  if (!t) throw new Q("Encoded audio MIME type is required.");
1895
2006
  if (t === "pcm_s16le") throw new Q("Use format: { encoding: \"pcm_s16le\", … } for raw PCM.");
1896
- if (e.sampleRate !== void 0 && !zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
2007
+ if (e.sampleRate !== void 0 && !Zt(e.sampleRate)) throw new Q(`Unsupported sample rate: ${e.sampleRate}`);
1897
2008
  return;
1898
2009
  }
1899
2010
  throw new Q("Unsupported speech.play audio shape.");
1900
2011
  }
1901
- function Ht(e) {
1902
- if (e.format) return Bt(e.format), e.format;
2012
+ function en(e) {
2013
+ if (e.format) return Qt(e.format), e.format;
1903
2014
  if (e.track) {
1904
2015
  let t = {
1905
2016
  encoding: "pcm_s16le",
1906
2017
  sampleRate: e.sampleRate ?? 24e3,
1907
2018
  channels: 1
1908
2019
  };
1909
- return Bt(t), t;
2020
+ return Qt(t), t;
1910
2021
  }
1911
2022
  throw new Q("createUtterance requires format or track.");
1912
2023
  }
1913
- function Ut(e) {
2024
+ function tn(e) {
1914
2025
  return e instanceof Uint8Array ? e : new Uint8Array(e);
1915
2026
  }
1916
- function Wt(e) {
2027
+ function nn(e) {
1917
2028
  return e === "replace-active" || e === "replace-all" ? "interrupt" : "enqueue";
1918
2029
  }
1919
2030
  //#endregion
1920
2031
  //#region src/byo/pcm.ts
1921
- function Gt(e) {
2032
+ function rn(e) {
1922
2033
  let t = new Uint8Array(e.length * 2), n = new DataView(t.buffer);
1923
2034
  for (let t = 0; t < e.length; t++) {
1924
2035
  let r = Math.max(-1, Math.min(1, e[t]));
@@ -1928,11 +2039,11 @@ function Gt(e) {
1928
2039
  }
1929
2040
  //#endregion
1930
2041
  //#region src/byo/resample.ts
1931
- function Kt(e, t, n, r, i) {
2042
+ function an(e, t, n, r, i) {
1932
2043
  let a = -.5 * e + 1.5 * t - 1.5 * n + .5 * r, o = e - 2.5 * t + 2 * n - .5 * r, s = -.5 * e + .5 * n, c = t;
1933
2044
  return ((a * i + o) * i + s) * i + c;
1934
2045
  }
1935
- function qt(e, t) {
2046
+ function on(e, t) {
1936
2047
  if (!(e > 0) || !(t > 0)) throw Error("Resampler rates must be positive");
1937
2048
  if (e === t) return {
1938
2049
  fromRate: e,
@@ -1955,7 +2066,7 @@ function qt(e, t) {
1955
2066
  let a = [];
1956
2067
  for (; i + 2 < r.length - 1;) {
1957
2068
  let e = Math.floor(i), t = i - e, o = Math.max(0, e - 1), s = Math.min(r.length - 1, e + 1), c = Math.min(r.length - 1, e + 2);
1958
- a.push(Kt(r[o], r[e], r[s], r[c], t)), i += n;
2069
+ a.push(an(r[o], r[e], r[s], r[c], t)), i += n;
1959
2070
  }
1960
2071
  let o = Math.max(0, Math.floor(i) - 1);
1961
2072
  return o > 0 && (r = r.subarray(o), i -= o), a.length ? Float32Array.from(a) : new Float32Array();
@@ -1967,7 +2078,7 @@ function qt(e, t) {
1967
2078
  }
1968
2079
  //#endregion
1969
2080
  //#region src/byo/audioCapture.ts
1970
- var Jt = "liforma-pcm-capture", Yt = `
2081
+ var sn = "liforma-pcm-capture", cn = `
1971
2082
  class LiformaPcmCaptureProcessor extends AudioWorkletProcessor {
1972
2083
  process(inputs) {
1973
2084
  const ch = inputs[0] && inputs[0][0];
@@ -1979,29 +2090,29 @@ class LiformaPcmCaptureProcessor extends AudioWorkletProcessor {
1979
2090
  return true;
1980
2091
  }
1981
2092
  }
1982
- registerProcessor('${Jt}', LiformaPcmCaptureProcessor);
1983
- `, Xt = null;
1984
- function Zt() {
1985
- return Xt ||= URL.createObjectURL(new Blob([Yt], { type: "application/javascript" })), Xt;
2093
+ registerProcessor('${sn}', LiformaPcmCaptureProcessor);
2094
+ `, ln = null;
2095
+ function un() {
2096
+ return ln ||= URL.createObjectURL(new Blob([cn], { type: "application/javascript" })), ln;
1986
2097
  }
1987
- function Qt() {
2098
+ function dn() {
1988
2099
  return window.AudioContext || window.webkitAudioContext || null;
1989
2100
  }
1990
- async function $t(e) {
1991
- let { mediaStream: t, targetSampleRate: n, onPcm: r, shouldSend: i, onLog: a } = e, o = Qt();
2101
+ async function fn(e) {
2102
+ let { mediaStream: t, targetSampleRate: n, onPcm: r, shouldSend: i, onLog: a } = e, o = dn();
1992
2103
  if (!o) throw Error("Web Audio is required for audio capture");
1993
2104
  let s = new o(), c = s.createMediaStreamSource(t), l = s.createGain();
1994
2105
  l.gain.value = 0;
1995
- let u = s.sampleRate, d = qt(u, n), f = !1, p = !1, m = (e) => {
2106
+ let u = s.sampleRate, d = on(u, n), f = !1, p = !1, m = (e) => {
1996
2107
  if (f || i && !i()) return;
1997
2108
  let t = d.push(e);
1998
- t.length !== 0 && r(Gt(t));
2109
+ t.length !== 0 && r(rn(t));
1999
2110
  }, h = () => void 0;
2000
2111
  return await (async () => {
2001
2112
  if (typeof s.audioWorklet?.addModule != "function") return !1;
2002
2113
  try {
2003
- await s.audioWorklet.addModule(Zt());
2004
- let e = new AudioWorkletNode(s, Jt, {
2114
+ await s.audioWorklet.addModule(un());
2115
+ let e = new AudioWorkletNode(s, sn, {
2005
2116
  numberOfInputs: 1,
2006
2117
  numberOfOutputs: 1,
2007
2118
  outputChannelCount: [1]
@@ -2051,7 +2162,7 @@ async function $t(e) {
2051
2162
  }
2052
2163
  //#endregion
2053
2164
  //#region src/v2/speech/captureMediaStreamTrack.ts
2054
- async function en(e) {
2165
+ async function pn(e) {
2055
2166
  let { track: t, utterance: n, sampleRate: r, signal: i } = e;
2056
2167
  if (typeof MediaStreamTrack > "u" || !(t instanceof MediaStreamTrack)) throw new Q("MediaStreamTrack is not available in this environment.");
2057
2168
  if (t.kind !== "audio") throw new Q("speech.play track must be an audio MediaStreamTrack.");
@@ -2060,18 +2171,18 @@ async function en(e) {
2060
2171
  s || (s = !0, c?.stop(), c = null);
2061
2172
  };
2062
2173
  try {
2063
- c = await $t({
2174
+ c = await fn({
2064
2175
  mediaStream: a,
2065
2176
  targetSampleRate: r,
2066
2177
  shouldSend: () => !s && !i?.aborted,
2067
2178
  onPcm: (e) => {
2068
2179
  if (s || i?.aborted) return;
2069
- let t = Ut(e);
2180
+ let t = tn(e);
2070
2181
  o = o.then(async () => {
2071
2182
  if (s || i?.aborted) return;
2072
2183
  let e = 0;
2073
2184
  for (; e < t.byteLength;) {
2074
- let r = Math.min(e + Pt.MAX_CHUNK_BYTES, t.byteLength);
2185
+ let r = Math.min(e + Kt.MAX_CHUNK_BYTES, t.byteLength);
2075
2186
  if ((r - e) % 2 == 1 && --r, r <= e) break;
2076
2187
  let i = t.subarray(e, r);
2077
2188
  e = r, i.byteLength !== 0 && await n.write(i);
@@ -2095,10 +2206,10 @@ async function en(e) {
2095
2206
  }
2096
2207
  //#endregion
2097
2208
  //#region src/v2/speech/speechController.ts
2098
- async function tn(e, t) {
2099
- if (jt(e)) throw new Q("MediaStreamTrack play is handled on the host before embed.");
2100
- if (kt(e)) {
2101
- let t = Ut(e.data);
2209
+ async function mn(e, t) {
2210
+ if (Ut(e)) throw new Q("MediaStreamTrack play is handled on the host before embed.");
2211
+ if (Vt(e)) {
2212
+ let t = tn(e.data);
2102
2213
  if (t.byteLength & 1) throw new Q("PCM byte length must be even.");
2103
2214
  return {
2104
2215
  kind: "pcm",
@@ -2106,17 +2217,17 @@ async function tn(e, t) {
2106
2217
  format: e.format
2107
2218
  };
2108
2219
  }
2109
- if (At(e)) return {
2220
+ if (Ht(e)) return {
2110
2221
  kind: "url",
2111
2222
  url: e.url.trim(),
2112
2223
  ...e.sampleRate === void 0 ? {} : { sampleRate: e.sampleRate }
2113
2224
  };
2114
- if (!Mt(e)) throw new Q("Unsupported speech.play audio shape.");
2225
+ if (!Wt(e)) throw new Q("Unsupported speech.play audio shape.");
2115
2226
  let n;
2116
2227
  if (typeof Blob < "u" && e.data instanceof Blob) {
2117
2228
  if (t?.aborted) throw new DOMException("Play aborted.", "AbortError");
2118
2229
  n = new Uint8Array(await e.data.arrayBuffer());
2119
- } else n = Ut(e.data);
2230
+ } else n = tn(e.data);
2120
2231
  return {
2121
2232
  kind: "encoded",
2122
2233
  data: n.slice().buffer,
@@ -2124,10 +2235,10 @@ async function tn(e, t) {
2124
2235
  ...e.sampleRate === void 0 ? {} : { sampleRate: e.sampleRate }
2125
2236
  };
2126
2237
  }
2127
- function nn() {
2238
+ function hn() {
2128
2239
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `utt_${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}` : `utt_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
2129
2240
  }
2130
- function rn(e, t = "completed") {
2241
+ function gn(e, t = "completed") {
2131
2242
  return {
2132
2243
  utteranceId: e.speechId,
2133
2244
  characterId: e.characterId,
@@ -2141,13 +2252,13 @@ function rn(e, t = "completed") {
2141
2252
  }
2142
2253
  };
2143
2254
  }
2144
- function an(e) {
2255
+ function _n(e) {
2145
2256
  return e instanceof Error ? e : new Q(String(e));
2146
2257
  }
2147
- function on(e) {
2258
+ function vn(e) {
2148
2259
  return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && e.name === "AbortError";
2149
2260
  }
2150
- var sn = class {
2261
+ var yn = class {
2151
2262
  id;
2152
2263
  characterId;
2153
2264
  result;
@@ -2176,29 +2287,29 @@ var sn = class {
2176
2287
  queue: e.queue,
2177
2288
  ...e.transcript === void 0 ? {} : { transcript: e.transcript }
2178
2289
  }).catch((e) => {
2179
- throw this.fail(an(e)), an(e);
2290
+ throw this.fail(_n(e)), _n(e);
2180
2291
  }), this.signal?.addEventListener("abort", () => {
2181
2292
  this.cancel();
2182
2293
  }, { once: !0 });
2183
2294
  }
2184
2295
  async write(e, t) {
2185
- if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new It();
2186
- let n = Ut(e);
2296
+ if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new Jt();
2297
+ let n = tn(e);
2187
2298
  if (n.byteLength & 1) throw new Q("PCM chunk byte length must be even (complete s16 samples).");
2188
- if (n.byteLength > Pt.MAX_CHUNK_BYTES) throw new Q(`PCM chunk exceeds MAX_CHUNK_BYTES (${Pt.MAX_CHUNK_BYTES}).`);
2299
+ if (n.byteLength > Kt.MAX_CHUNK_BYTES) throw new Q(`PCM chunk exceeds MAX_CHUNK_BYTES (${Kt.MAX_CHUNK_BYTES}).`);
2189
2300
  if (n.byteLength === 0) return;
2190
- let r = t?.timeoutMs ?? Pt.DEFAULT_WRITE_TIMEOUT_MS;
2301
+ let r = t?.timeoutMs ?? Kt.DEFAULT_WRITE_TIMEOUT_MS;
2191
2302
  await this.acquireWriteSlot(r);
2192
2303
  let i = n.byteLength / 2 / this.sampleRate * 1e3;
2193
- if (this.bufferedMs + i > Pt.MAX_UTTERANCE_DURATION_MS) throw this.releaseWriteSlot(), new Q("Utterance exceeds MAX_UTTERANCE_DURATION_MS.");
2304
+ if (this.bufferedMs + i > Kt.MAX_UTTERANCE_DURATION_MS) throw this.releaseWriteSlot(), new Q("Utterance exceeds MAX_UTTERANCE_DURATION_MS.");
2194
2305
  let a = async () => {
2195
- if (this.closed || this.settled) throw new It();
2306
+ if (this.closed || this.settled) throw new Jt();
2196
2307
  let e = this.requireHost(), t = n.slice(), i = e.speechUtteranceWrite({
2197
2308
  utteranceId: this.id,
2198
2309
  audio: t.buffer,
2199
2310
  byteLength: t.byteLength
2200
2311
  }), a = await Promise.race([i, new Promise((e, t) => {
2201
- setTimeout(() => t(new Lt()), r);
2312
+ setTimeout(() => t(new Yt()), r);
2202
2313
  })]);
2203
2314
  this.bufferedMs = Math.max(0, a.bufferedMs);
2204
2315
  }, o = this.writeChain.then(a, a);
@@ -2210,7 +2321,7 @@ var sn = class {
2210
2321
  }
2211
2322
  }
2212
2323
  async setTranscript(e) {
2213
- if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new It();
2324
+ if (this.closed || this.settled || (await this.beginPromise.catch(() => void 0), this.closed || this.settled)) throw new Jt();
2214
2325
  await this.requireHost().speechUtteranceSetTranscript({
2215
2326
  utteranceId: this.id,
2216
2327
  transcript: e
@@ -2227,7 +2338,7 @@ var sn = class {
2227
2338
  });
2228
2339
  return this.resolve(t), t;
2229
2340
  } catch (e) {
2230
- let t = an(e);
2341
+ let t = _n(e);
2231
2342
  throw this.fail(t), t;
2232
2343
  }
2233
2344
  }
@@ -2245,11 +2356,11 @@ var sn = class {
2245
2356
  characterId: this.characterId,
2246
2357
  status: "cancelled",
2247
2358
  durationMs: 0,
2248
- animation: Rt("none")
2359
+ animation: Xt("none")
2249
2360
  };
2250
2361
  return this.resolve(t), t;
2251
2362
  } catch (e) {
2252
- let t = an(e);
2363
+ let t = _n(e);
2253
2364
  throw this.fail(t), t;
2254
2365
  }
2255
2366
  }
@@ -2262,19 +2373,19 @@ var sn = class {
2262
2373
  return e;
2263
2374
  }
2264
2375
  resolve(e) {
2265
- this.settled || (this.settled = !0, this.settleResolve(Object.freeze(e)), this.flushWriteWaiters(new It()));
2376
+ this.settled || (this.settled = !0, this.settleResolve(Object.freeze(e)), this.flushWriteWaiters(new Jt()));
2266
2377
  }
2267
2378
  fail(e) {
2268
2379
  this.settled || (this.settled = !0, this.settleReject(e), this.flushWriteWaiters(e));
2269
2380
  }
2270
2381
  async acquireWriteSlot(e) {
2271
- if (this.pendingWriteCount < Pt.MAX_PENDING_WRITES) {
2382
+ if (this.pendingWriteCount < Kt.MAX_PENDING_WRITES) {
2272
2383
  this.pendingWriteCount += 1;
2273
2384
  return;
2274
2385
  }
2275
2386
  await new Promise((t, n) => {
2276
2387
  let r = setTimeout(() => {
2277
- n(new Lt());
2388
+ n(new Yt());
2278
2389
  }, e);
2279
2390
  this.pendingWriteWaiters.push({
2280
2391
  resolve: () => {
@@ -2293,13 +2404,13 @@ var sn = class {
2293
2404
  for (; this.pendingWriteWaiters.length > 0;) this.pendingWriteWaiters.shift()?.reject(e);
2294
2405
  }
2295
2406
  };
2296
- function cn(e) {
2407
+ function bn(e) {
2297
2408
  let t = null, n = (t, n) => {
2298
- if (!e.getCapabilities()[n]) throw new Ft(t, n);
2409
+ if (!e.getCapabilities()[n]) throw new qt(t, n);
2299
2410
  }, r = {
2300
2411
  async speak(r) {
2301
2412
  if (e.assertSessionStarted(), n("speak", "textSpeech"), r.signal?.aborted) throw new DOMException("Speak aborted.", "AbortError");
2302
- let i = Wt(r.queue ?? "append");
2413
+ let i = nn(r.queue ?? "append");
2303
2414
  i === "interrupt" && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null));
2304
2415
  let a = e.getIframeHost();
2305
2416
  if (!a) throw new Q("Speech session is not attached.");
@@ -2319,41 +2430,41 @@ function cn(e) {
2319
2430
  return;
2320
2431
  }
2321
2432
  t.addEventListener("abort", s, { once: !0 }), o.then((e) => {
2322
- t.removeEventListener("abort", s), n(rn(e, "completed"));
2433
+ t.removeEventListener("abort", s), n(gn(e, "completed"));
2323
2434
  }, (a) => {
2324
- if (t.removeEventListener("abort", s), on(a)) {
2435
+ if (t.removeEventListener("abort", s), vn(a)) {
2325
2436
  n({
2326
2437
  utteranceId: "utt_interrupted",
2327
2438
  characterId: r.characterId ?? e.getActiveCharacterId(),
2328
2439
  status: "interrupted",
2329
2440
  durationMs: 0,
2330
2441
  transcript: r.text,
2331
- animation: Rt("none")
2442
+ animation: Xt("none")
2332
2443
  });
2333
2444
  return;
2334
2445
  }
2335
- i(an(a));
2446
+ i(_n(a));
2336
2447
  });
2337
2448
  });
2338
2449
  }
2339
2450
  try {
2340
- return rn(await o, "completed");
2451
+ return gn(await o, "completed");
2341
2452
  } catch (t) {
2342
- if (on(t)) return {
2453
+ if (vn(t)) return {
2343
2454
  utteranceId: "utt_interrupted",
2344
2455
  characterId: r.characterId ?? e.getActiveCharacterId(),
2345
2456
  status: "interrupted",
2346
2457
  durationMs: 0,
2347
2458
  transcript: r.text,
2348
- animation: Rt("none")
2459
+ animation: Xt("none")
2349
2460
  };
2350
- throw an(t);
2461
+ throw _n(t);
2351
2462
  }
2352
2463
  },
2353
2464
  async play(i) {
2354
- if (e.assertSessionStarted(), n("play", "externalSpeechAudio"), Vt(i.audio), i.signal?.aborted) throw new DOMException("Play aborted.", "AbortError");
2465
+ if (e.assertSessionStarted(), n("play", "externalSpeechAudio"), $t(i.audio), i.signal?.aborted) throw new DOMException("Play aborted.", "AbortError");
2355
2466
  let a = i.queue ?? "append";
2356
- if ((a === "replace-active" || a === "replace-all") && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null)), jt(i.audio)) {
2467
+ if ((a === "replace-active" || a === "replace-all") && (e.onProcessorInterrupt?.(), t &&= (t.cancel(), null)), Ut(i.audio)) {
2357
2468
  let e = i.audio.sampleRate ?? 24e3;
2358
2469
  return r.createUtterance({
2359
2470
  format: {
@@ -2369,7 +2480,7 @@ function cn(e) {
2369
2480
  }
2370
2481
  let o = e.getIframeHost();
2371
2482
  if (!o) throw new Q("Speech session is not attached.");
2372
- let s = await tn(i.audio, i.signal);
2483
+ let s = await mn(i.audio, i.signal);
2373
2484
  return o.speechPlay({
2374
2485
  source: s,
2375
2486
  characterId: i.characterId,
@@ -2381,13 +2492,13 @@ function cn(e) {
2381
2492
  },
2382
2493
  createUtterance(r) {
2383
2494
  e.assertSessionStarted(), n("createUtterance", "externalSpeechAudio");
2384
- let i = Ht(r);
2495
+ let i = en(r);
2385
2496
  if (r.track && r.track.kind !== "audio") throw new Q("createUtterance track must be an audio MediaStreamTrack.");
2386
2497
  let a = r.queue ?? "replace-active";
2387
2498
  if (a !== "replace-active" && a !== "replace-all") throw new Q("createUtterance queue must be replace-active or replace-all.");
2388
2499
  e.onProcessorInterrupt?.(), t &&= (t.cancel(), null);
2389
- let o = new sn({
2390
- id: nn(),
2500
+ let o = new yn({
2501
+ id: hn(),
2391
2502
  characterId: r.characterId ?? e.getActiveCharacterId(),
2392
2503
  format: i,
2393
2504
  queue: a,
@@ -2399,7 +2510,7 @@ function cn(e) {
2399
2510
  t === o && (t = null);
2400
2511
  }), r.track && (async () => {
2401
2512
  try {
2402
- if (await en({
2513
+ if (await pn({
2403
2514
  track: r.track,
2404
2515
  utterance: o,
2405
2516
  sampleRate: i.sampleRate,
@@ -2427,16 +2538,16 @@ function cn(e) {
2427
2538
  }
2428
2539
  //#endregion
2429
2540
  //#region src/v2/types/sessionInteraction.ts
2430
- function ln(e) {
2541
+ function xn(e) {
2431
2542
  let t = e?.trim();
2432
2543
  return t === "full" || t === "face" || t === "medium" ? t : void 0;
2433
2544
  }
2434
2545
  //#endregion
2435
2546
  //#region src/v2/experience.ts
2436
- function un(e) {
2547
+ function Sn(e) {
2437
2548
  return !!(e.showClose === !0 || e.returnUrl?.trim() || e.closeButton === !0 || e.closeButton && typeof e.closeButton == "object" && e.closeButton.visible !== !1);
2438
2549
  }
2439
- var dn = class e {
2550
+ var Cn = class e {
2440
2551
  bootstrap;
2441
2552
  conversationProcessor;
2442
2553
  iframeHost = null;
@@ -2450,19 +2561,22 @@ var dn = class e {
2450
2561
  closed = !1;
2451
2562
  attached = !1;
2452
2563
  pendingFit = null;
2564
+ pendingStage = null;
2565
+ pendingPipBackground = null;
2566
+ pendingPipShadow = null;
2453
2567
  lastInteraction = null;
2454
2568
  closeHandlers = [];
2455
- eventRegistry = Tt();
2569
+ eventRegistry = Lt();
2456
2570
  readyEnvelope = null;
2457
2571
  startedEnvelope = null;
2458
2572
  sessionMintedEnvelope = null;
2459
2573
  conversationCache = [];
2460
2574
  speech;
2461
2575
  constructor(e) {
2462
- this.bootstrap = e, this.conversationProcessor = e.conversationProcessor ?? null, this.resolvedSession = e.kind === "launch" ? e.session ?? null : null, this.launchToken = e.kind === "launch" ? e.launch : null, this.speech = cn({
2576
+ this.bootstrap = e, this.conversationProcessor = e.conversationProcessor ?? null, this.resolvedSession = e.kind === "launch" ? e.session ?? null : null, this.launchToken = e.kind === "launch" ? e.launch : null, this.speech = bn({
2463
2577
  getIframeHost: () => this.iframeHost,
2464
2578
  assertSessionStarted: () => this.assertSessionStarted(),
2465
- getCapabilities: () => fn(this.resolvedSession),
2579
+ getCapabilities: () => wn(this.resolvedSession),
2466
2580
  getActiveCharacterId: () => "character_unknown",
2467
2581
  onProcessorInterrupt: () => {
2468
2582
  this.processorAbortController?.abort(), this.processorAbortController = null;
@@ -2545,7 +2659,7 @@ var dn = class e {
2545
2659
  return null;
2546
2660
  }
2547
2661
  on(e, t) {
2548
- let n = Et(this.eventRegistry, e, t);
2662
+ let n = Rt(this.eventRegistry, e, t);
2549
2663
  return e === "ready" && this.readyEnvelope && queueMicrotask(() => t(this.readyEnvelope)), e === "started" && this.startedEnvelope && queueMicrotask(() => t(this.startedEnvelope)), e === "sessionMinted" && this.sessionMintedEnvelope && queueMicrotask(() => t(this.sessionMintedEnvelope)), n;
2550
2664
  }
2551
2665
  async attach(e) {
@@ -2559,13 +2673,13 @@ var dn = class e {
2559
2673
  if (this.closed) throw Error("Session has ended.");
2560
2674
  if (this.attached && this.iframeHost) return this.createPlayerFacade();
2561
2675
  this.iframeHost &&= (this.iframeHost.destroy(), null), this.attachReturnUrl = e.returnUrl?.trim() || null;
2562
- let t = this.bootstrap.embedBaseUrl ?? vt(), n = this.bootstrap.debug === !0, r = this.bootstrap.speechOnly === !0, i = bt(t, n, r ? void 0 : yt(this.bootstrap.backdropId, this.bootstrap.locationId), r ? void 0 : this.bootstrap.avatarId, e.fit, this.bootstrap.ui, un(e), this.bootstrap.kind === "launch" ? void 0 : this.bootstrap.castSize), a = St(i), o = null, s = new Promise((e) => {
2676
+ let t = this.bootstrap.embedBaseUrl ?? At(), n = this.bootstrap.debug === !0, r = this.bootstrap.speechOnly === !0, i = Mt(t, n, r ? void 0 : jt(this.bootstrap.backdropId, this.bootstrap.locationId), r ? void 0 : this.bootstrap.avatarId, e.fit, this.bootstrap.ui, Sn(e), this.bootstrap.kind === "launch" ? void 0 : this.bootstrap.castSize, e.stage, e.pipBackground, e.pipShadow), a = Pt(i), o = null, s = new Promise((e) => {
2563
2677
  o = e;
2564
2678
  }), c = null, l = new Promise((e) => {
2565
2679
  c = e;
2566
- }), u = pt((e) => {
2680
+ }), u = Tt((e) => {
2567
2681
  this.readyEnvelope ||= (this.resolvedSession = e, this.emitWrapped("ready", { session: e }));
2568
- }), d = this.bootstrap.onUserTranscript, f = ft({
2682
+ }), d = this.bootstrap.onUserTranscript, f = wt({
2569
2683
  container: e.container,
2570
2684
  src: i,
2571
2685
  playerOrigin: a,
@@ -2631,7 +2745,7 @@ var dn = class e {
2631
2745
  onWidgetDragEnd: (t) => e.onWidgetDragEnd?.(t)
2632
2746
  });
2633
2747
  this.iframeHost = f;
2634
- let p = this.resolveMintInteraction(), m = this.bootstrap.kind === "sessionEndpoint" ? (this.endpointAbortController = new AbortController(), We(this.bootstrap.sessionEndpoint, {
2748
+ let p = this.resolveMintInteraction(), m = this.bootstrap.kind === "sessionEndpoint" ? (this.endpointAbortController = new AbortController(), nt(this.bootstrap.sessionEndpoint, {
2635
2749
  experienceId: this.bootstrap.experienceId,
2636
2750
  locale: this.bootstrap.locale,
2637
2751
  secondaryLocale: this.bootstrap.secondaryLocale,
@@ -2643,7 +2757,7 @@ var dn = class e {
2643
2757
  attribution: this.bootstrap.attribution,
2644
2758
  alreadyConverted: this.bootstrap.alreadyConverted,
2645
2759
  signal: this.endpointAbortController.signal
2646
- })) : this.bootstrap.kind === "public" ? Ue(this.bootstrap.experienceId, {
2760
+ })) : this.bootstrap.kind === "public" ? tt(this.bootstrap.experienceId, {
2647
2761
  locale: this.bootstrap.locale,
2648
2762
  secondaryLocale: this.bootstrap.secondaryLocale,
2649
2763
  learningLocale: this.bootstrap.learningLocale,
@@ -2667,7 +2781,7 @@ var dn = class e {
2667
2781
  operation: "attach",
2668
2782
  message: e instanceof Error ? e.message : String(e),
2669
2783
  stack: e instanceof Error ? e.stack : void 0,
2670
- release: mt
2784
+ release: Et
2671
2785
  });
2672
2786
  } catch {}
2673
2787
  throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), e;
@@ -2679,7 +2793,7 @@ var dn = class e {
2679
2793
  if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
2680
2794
  this.launchToken = g;
2681
2795
  let v = _ ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
2682
- return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && Fe(_), f.postLaunch(g, _, {
2796
+ return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && qe(_), f.postLaunch(g, _, {
2683
2797
  startButton: e.startButton,
2684
2798
  theme: e.theme,
2685
2799
  showFeedback: e.showFeedback,
@@ -2699,7 +2813,7 @@ var dn = class e {
2699
2813
  operation: "attach",
2700
2814
  message: e instanceof Error ? e.message : String(e),
2701
2815
  stack: e instanceof Error ? e.stack : void 0,
2702
- release: mt
2816
+ release: Et
2703
2817
  });
2704
2818
  } catch {}
2705
2819
  throw e;
@@ -2713,11 +2827,11 @@ var dn = class e {
2713
2827
  operation: "attach",
2714
2828
  message: e instanceof Error ? e.message : String(e),
2715
2829
  stack: e instanceof Error ? e.stack : void 0,
2716
- release: mt
2830
+ release: Et
2717
2831
  });
2718
2832
  } catch {}
2719
2833
  throw e;
2720
- }), this.attached = !0, this.pendingFit && await f.setFit(this.pendingFit), this.createPlayerFacade();
2834
+ }), this.attached = !0, this.pendingFit && await f.setFit(this.pendingFit), this.pendingStage && await f.setStage(this.pendingStage), this.pendingPipBackground && await f.setPipBackground(this.pendingPipBackground), this.pendingPipShadow !== null && await f.setPipShadow(this.pendingPipShadow), this.createPlayerFacade();
2721
2835
  }
2722
2836
  async startListening() {
2723
2837
  this.assertSessionStarted(), await this.iframeHost.startListening();
@@ -2741,11 +2855,25 @@ var dn = class e {
2741
2855
  this.assertSessionStarted(), await this.iframeHost.focusCharacter(e);
2742
2856
  }
2743
2857
  async setFit(e) {
2744
- let t = ln(e);
2858
+ let t = xn(e);
2745
2859
  if (!t) throw Error("setFit requires \"full\", \"medium\", or \"face\".");
2746
2860
  if (this.closed) throw Error("Session has ended.");
2747
2861
  this.pendingFit = t, !(!this.attached || !this.iframeHost) && await this.iframeHost.setFit(t);
2748
2862
  }
2863
+ async setStage(e) {
2864
+ if (e !== "fill" && e !== "pip") throw Error("setStage requires \"fill\" or \"pip\".");
2865
+ if (this.closed) throw Error("Session has ended.");
2866
+ this.pendingStage = e, !(!this.attached || !this.iframeHost) && await this.iframeHost.setStage(e);
2867
+ }
2868
+ async setPipBackground(e) {
2869
+ if (e !== "none" && e !== "set") throw Error("setPipBackground requires \"none\" or \"set\".");
2870
+ if (this.closed) throw Error("Session has ended.");
2871
+ this.pendingPipBackground = e, !(!this.attached || !this.iframeHost) && await this.iframeHost.setPipBackground(e);
2872
+ }
2873
+ async setPipShadow(e) {
2874
+ if (this.closed) throw Error("Session has ended.");
2875
+ this.pendingPipShadow = e, !(!this.attached || !this.iframeHost) && await this.iframeHost.setPipShadow(e);
2876
+ }
2749
2877
  async setInteraction(e) {
2750
2878
  if (this.closed) throw Error("Session has ended.");
2751
2879
  if (!this.iframeHost) throw Error("setInteraction() requires attach() first.");
@@ -2777,7 +2905,7 @@ var dn = class e {
2777
2905
  this.close();
2778
2906
  }
2779
2907
  destroy() {
2780
- this.closed || (this.closed = !0, this.processorAbortController?.abort(), this.processorAbortController = null, this.endpointAbortController?.abort(), this.endpointAbortController = null, this.attachInFlight = null, this.iframeHost?.destroy(), this.iframeHost = null, Ot(this.eventRegistry), this.readyEnvelope = null, this.startedEnvelope = null, this.closeHandlers.length = 0, this.lastInteraction = null, this.attached = !1);
2908
+ this.closed || (this.closed = !0, this.processorAbortController?.abort(), this.processorAbortController = null, this.endpointAbortController?.abort(), this.endpointAbortController = null, this.attachInFlight = null, this.iframeHost?.destroy(), this.iframeHost = null, Bt(this.eventRegistry), this.readyEnvelope = null, this.startedEnvelope = null, this.closeHandlers.length = 0, this.lastInteraction = null, this.attached = !1);
2781
2909
  }
2782
2910
  resolveMintInteraction() {
2783
2911
  return this.bootstrap.kind === "launch" ? {} : {
@@ -2789,8 +2917,8 @@ var dn = class e {
2789
2917
  return this.resolvedSession?.id ?? "";
2790
2918
  }
2791
2919
  emitWrapped(e, t) {
2792
- let n = wt(e, this.getSessionId(), t);
2793
- return Dt(this.eventRegistry, e, n), n;
2920
+ let n = It(e, this.getSessionId(), t);
2921
+ return zt(this.eventRegistry, e, n), n;
2794
2922
  }
2795
2923
  queueProcessorTurn(e) {
2796
2924
  if (!e.isFinal || !e.text.trim() || !this.conversationProcessor) return;
@@ -2799,7 +2927,7 @@ var dn = class e {
2799
2927
  let n = this.processorAbortController.signal;
2800
2928
  this.processorChain = this.processorChain.then(async () => {
2801
2929
  if (!n.aborted) try {
2802
- let r = await qe(t, {
2930
+ let r = await at(t, {
2803
2931
  utteranceId: e.utteranceId,
2804
2932
  text: e.text,
2805
2933
  conversation: this.conversationCache,
@@ -2849,7 +2977,7 @@ var dn = class e {
2849
2977
  };
2850
2978
  }
2851
2979
  };
2852
- function fn(e) {
2980
+ function wn(e) {
2853
2981
  return e ? {
2854
2982
  textSpeech: e.capabilities.speech.output,
2855
2983
  externalSpeechAudio: e.capabilities.speech.externalAudio
@@ -2860,41 +2988,41 @@ function fn(e) {
2860
2988
  }
2861
2989
  //#endregion
2862
2990
  //#region src/widget/dockGeometry.ts
2863
- var pn = "(min-width: 768px)", mn = 24, hn = .5, gn = 1200, _n = .85, vn = 9 / 16;
2864
- function yn() {
2991
+ var Tn = "(min-width: 768px)", En = 24, Dn = .5, On = 1200, kn = .85, An = 9 / 16;
2992
+ function jn() {
2865
2993
  if (typeof window > "u") return 800;
2866
2994
  let e = window.screen?.availHeight;
2867
2995
  return typeof e == "number" && e > 0 ? e : window.innerHeight;
2868
2996
  }
2869
- function bn(e = typeof window < "u" ? window.innerWidth : 1280, t = typeof window < "u" ? window.innerHeight : 800, n = mn, r = typeof window < "u" ? yn() : 800) {
2870
- let i = Math.max(160, Math.min(t - n * 2, t * _n)), a = Math.max(120, e - n * 2), o = Math.min(r * hn, gn, i), s = o * vn;
2871
- return s > a && (s = a, o = s / vn, o > i && (o = i, s = o * vn)), {
2997
+ function Mn(e = typeof window < "u" ? window.innerWidth : 1280, t = typeof window < "u" ? window.innerHeight : 800, n = En, r = typeof window < "u" ? jn() : 800) {
2998
+ let i = Math.max(160, Math.min(t - n * 2, t * kn)), a = Math.max(120, e - n * 2), o = Math.min(r * Dn, On, i), s = o * An;
2999
+ return s > a && (s = a, o = s / An, o > i && (o = i, s = o * An)), {
2872
3000
  width: Math.round(s),
2873
3001
  height: Math.round(o)
2874
3002
  };
2875
3003
  }
2876
- function xn(e, t = typeof window < "u" ? window.innerWidth : 1280, n = typeof window < "u" ? window.innerHeight : 800, r = mn) {
3004
+ function Nn(e, t = typeof window < "u" ? window.innerWidth : 1280, n = typeof window < "u" ? window.innerHeight : 800, r = En) {
2877
3005
  return {
2878
3006
  left: Math.max(r, t - e.width - r),
2879
3007
  top: Math.max(r, n - e.height - r)
2880
3008
  };
2881
3009
  }
2882
- function Sn(e, t, n, r = typeof window < "u" ? window.innerWidth : 1280, i = typeof window < "u" ? window.innerHeight : 800, a = mn) {
3010
+ function Pn(e, t, n, r = typeof window < "u" ? window.innerWidth : 1280, i = typeof window < "u" ? window.innerHeight : 800, a = En) {
2883
3011
  let o = Math.max(a, r - n.width - a), s = Math.max(a, i - n.height - a);
2884
3012
  return {
2885
3013
  left: Math.min(Math.max(a, e), o),
2886
3014
  top: Math.min(Math.max(a, t), s)
2887
3015
  };
2888
3016
  }
2889
- function Cn(e = typeof window < "u" ? window.matchMedia.bind(window) : () => ({ matches: !0 })) {
2890
- return e(pn).matches;
3017
+ function Fn(e = typeof window < "u" ? window.matchMedia.bind(window) : () => ({ matches: !0 })) {
3018
+ return e(Tn).matches;
2891
3019
  }
2892
3020
  //#endregion
2893
3021
  //#region src/widget/mountExperienceWidget.ts
2894
- function wn(e) {
3022
+ function In(e) {
2895
3023
  return e === "bottom-right" || e === "bottom-left" ? e : "static";
2896
3024
  }
2897
- function Tn(e) {
3025
+ function Ln(e) {
2898
3026
  if (typeof e == "number" && Number.isFinite(e)) return `${e}px`;
2899
3027
  let t = typeof e == "string" ? e.trim() : "";
2900
3028
  return t ? /^\d+(\.\d+)?$/.test(t) ? `${t}px` : t : "16px";
@@ -2902,10 +3030,10 @@ function Tn(e) {
2902
3030
  function $(e) {
2903
3031
  return e === "expanded" || e === "docked";
2904
3032
  }
2905
- var En = "<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>", Dn = "<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>", On = "<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>", kn = "<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>";
2906
- function An(e, t, n) {
2907
- W(de);
2908
- let r = w({
3033
+ var Rn = "<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>", zn = "<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>", Bn = "<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>", Vn = "<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>";
3034
+ function Hn(e, t, n) {
3035
+ Se(be);
3036
+ let r = F({
2909
3037
  galleryThumb: t.galleryThumb,
2910
3038
  avatarImage: t.avatarImage,
2911
3039
  backgroundImage: t.backgroundImage,
@@ -2931,9 +3059,9 @@ function An(e, t, n) {
2931
3059
  let e = document.createElement("img");
2932
3060
  e.className = "liforma-et__foreground liforma-et__media", e.alt = "", e.decoding = "async", e.src = r.foregroundImage, e.addEventListener("load", () => o(e), { once: !0 }), i.append(e);
2933
3061
  }
2934
- return e.replaceChildren(i), n?.parallax === !1 ? () => {} : ue(i);
3062
+ return e.replaceChildren(i), n?.parallax === !1 ? () => {} : ye(i);
2935
3063
  }
2936
- function jn(e) {
3064
+ function Un(e) {
2937
3065
  return e.startButton ? {
2938
3066
  ...e.startButton,
2939
3067
  label: e.startButton.label ?? e.startButtonLabel ?? "Tap to talk",
@@ -2945,7 +3073,7 @@ function jn(e) {
2945
3073
  variant: "primary"
2946
3074
  };
2947
3075
  }
2948
- function Mn(e) {
3076
+ function Wn(e) {
2949
3077
  let t = !1, n = () => {
2950
3078
  t || e();
2951
3079
  }, r = () => {
@@ -2965,12 +3093,12 @@ function Mn(e) {
2965
3093
  t = !0, window.removeEventListener("load", r), i?.();
2966
3094
  };
2967
3095
  }
2968
- function Nn(e, t) {
2969
- he(me);
3096
+ function Gn(e, t) {
3097
+ De(Te);
2970
3098
  let n = t.experienceId?.trim();
2971
3099
  if (!n) throw Error("ExperienceWidget requires experienceId.");
2972
- let r = t.prefetch ?? "onExpand", i = wn(t.position), a = document.createElement("div");
2973
- a.className = "liforma-ew", a.dataset.state = "collapsed", a.dataset.prefetch = r, a.dataset.position = i, a.style.setProperty("--liforma-ew-max-w", t.expandedMaxWidth ?? "100%"), a.style.setProperty("--liforma-ew-max-h", t.expandedMaxHeight ?? "100%"), i !== "static" && a.style.setProperty("--liforma-ew-offset", Tn(t.offset));
3100
+ let r = t.prefetch ?? "onExpand", i = In(t.position), a = document.createElement("div");
3101
+ a.className = "liforma-ew", a.dataset.state = "collapsed", a.dataset.prefetch = r, a.dataset.position = i, a.style.setProperty("--liforma-ew-max-w", t.expandedMaxWidth ?? "100%"), a.style.setProperty("--liforma-ew-max-h", t.expandedMaxHeight ?? "100%"), i !== "static" && a.style.setProperty("--liforma-ew-offset", Ln(t.offset));
2974
3102
  let o = document.createElement("button");
2975
3103
  o.type = "button", o.className = "liforma-ew__hit", o.setAttribute("aria-label", t.alt), o.disabled = !0;
2976
3104
  let s = document.createElement("div");
@@ -2990,22 +3118,22 @@ function Nn(e, t) {
2990
3118
  let m = document.createElement("span");
2991
3119
  m.className = "liforma-ew__drag-grip", m.setAttribute("aria-hidden", "true");
2992
3120
  let h = document.createElement("button");
2993
- h.type = "button", h.className = "liforma-ew__icon-btn liforma-ew__dock-toggle", h.innerHTML = On, h.setAttribute("aria-label", "Reduce");
3121
+ h.type = "button", h.className = "liforma-ew__icon-btn liforma-ew__dock-toggle", h.innerHTML = Bn, h.setAttribute("aria-label", "Reduce");
2994
3122
  let g = document.createElement("button");
2995
- g.type = "button", g.className = "liforma-ew__icon-btn liforma-ew__settings", g.innerHTML = En, g.setAttribute("aria-label", "Audio settings"), g.setAttribute("aria-pressed", "false");
3123
+ g.type = "button", g.className = "liforma-ew__icon-btn liforma-ew__settings", g.innerHTML = Rn, g.setAttribute("aria-label", "Audio settings"), g.setAttribute("aria-pressed", "false");
2996
3124
  let _ = document.createElement("button");
2997
- _.type = "button", _.className = "liforma-ew__icon-btn liforma-ew__close", _.innerHTML = Dn, _.setAttribute("aria-label", "Close"), p.append(m, h, g, _);
3125
+ _.type = "button", _.className = "liforma-ew__icon-btn liforma-ew__close", _.innerHTML = zn, _.setAttribute("aria-label", "Close"), p.append(m, h, g, _);
2998
3126
  let v = document.createElement("div");
2999
3127
  v.className = "liforma-ew__stage";
3000
3128
  let y = document.createElement("div");
3001
3129
  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);
3002
- let b = null, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = !1, O = 0, k = "", A = null, ee = null, j = null, M = null, N = null, P = null, F = null, te = 0, ne = 0, I = null, L = !1, re = new AbortController(), ie = t.parallax !== !1, R = () => {
3130
+ 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, ee = null, N = null, P = null, F = null, te = 0, I = 0, L = null, ne = !1, re = new AbortController(), ie = t.parallax !== !1, R = () => {
3003
3131
  let e = a.dataset.state;
3004
3132
  return e === "expanded" || e === "docked" || e === "collapsed" ? e : "collapsed";
3005
3133
  }, z = () => {
3006
- j !== null && (clearTimeout(j), j = null);
3134
+ M !== null && (clearTimeout(M), M = null);
3007
3135
  }, B = () => {
3008
- M !== null && (clearTimeout(M), M = null), a.classList.remove("liforma-ew--layout-settling");
3136
+ ee !== null && (clearTimeout(ee), ee = null), a.classList.remove("liforma-ew--layout-settling");
3009
3137
  }, ae = () => {
3010
3138
  for (let e of [
3011
3139
  f,
@@ -3013,208 +3141,210 @@ function Nn(e, t) {
3013
3141
  p
3014
3142
  ]) e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("width"), e.style.removeProperty("height"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
3015
3143
  p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging");
3016
- }, V = (e, t, n, r) => {
3144
+ }, oe = (e, t, n, r) => {
3017
3145
  let i = (i) => {
3018
3146
  i.style.left = `${e}px`, i.style.top = `${t}px`, i.style.width = `${n}px`, i.style.height = `${r}px`, i.style.right = "auto", i.style.bottom = "auto";
3019
3147
  };
3020
3148
  i(f), i(l);
3021
3149
  let a = p.offsetWidth || 120;
3022
3150
  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";
3023
- }, oe = (e, t) => {
3024
- if (R() !== "docked") return;
3025
- let n = bn(), r = Sn(e - te, t - ne, n);
3026
- N = r.left, P = r.top, V(r.left, r.top, n.width, n.height);
3027
3151
  }, se = (e, t) => {
3152
+ if (R() !== "docked") return;
3153
+ let n = Mn(), r = Pn(e - te, t - I, n);
3154
+ N = r.left, P = r.top, oe(r.left, r.top, n.width, n.height);
3155
+ }, ce = (e, t) => {
3028
3156
  if (R() !== "docked" || !Number.isFinite(e) || !Number.isFinite(t) || e === 0 && t === 0) return;
3029
- let n = bn(), r = N ?? f.getBoundingClientRect().left, i = P ?? f.getBoundingClientRect().top, a = Sn(r + e, i + t, n);
3030
- N = a.left, P = a.top, V(a.left, a.top, n.width, n.height);
3031
- }, ce = (e) => {
3032
- I === "toolbar" && (F === null || e.pointerId !== F || (e.preventDefault(), oe(e.clientX, e.clientY)));
3033
- }, H = (e) => {
3157
+ let n = Mn(), r = N ?? f.getBoundingClientRect().left, i = P ?? f.getBoundingClientRect().top, a = Pn(r + e, i + t, n);
3158
+ N = a.left, P = a.top, oe(a.left, a.top, n.width, n.height);
3159
+ }, le = (e) => {
3160
+ L === "toolbar" && (F === null || e.pointerId !== F || (e.preventDefault(), se(e.clientX, e.clientY)));
3161
+ }, V = (e) => {
3034
3162
  if (F === null || e && e.pointerId !== F) return;
3035
- let t = I;
3036
- F = null, I = 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));
3037
- }, le = (e, t, n) => {
3038
- if (S || R() !== "docked" || !Cn() || F !== null) return;
3039
- F = n, I = "toolbar", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3163
+ let t = L;
3164
+ F = null, L = null, p.classList.remove("liforma-ew__toolbar--dragging"), a.classList.remove("liforma-ew--dock-dragging"), t === "toolbar" && ne && (ne = !1, window.removeEventListener("pointermove", le), window.removeEventListener("pointerup", V), window.removeEventListener("pointercancel", V));
3165
+ }, ue = (e, t, n) => {
3166
+ if (S || R() !== "docked" || !Fn() || F !== null) return;
3167
+ F = n, L = "toolbar", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3040
3168
  let r = f.getBoundingClientRect();
3041
- te = e - r.left, ne = t - r.top, L || (L = !0, window.addEventListener("pointermove", ce), window.addEventListener("pointerup", H), window.addEventListener("pointercancel", H));
3042
- }, ue = (e) => {
3043
- if (S || R() !== "docked" || !Cn() || F !== null) return;
3044
- F = e.pointerId, I = "player", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3169
+ te = e - r.left, I = t - r.top, ne || (ne = !0, window.addEventListener("pointermove", le), window.addEventListener("pointerup", V), window.addEventListener("pointercancel", V));
3170
+ }, de = (e) => {
3171
+ if (S || R() !== "docked" || !Fn() || F !== null) return;
3172
+ F = e.pointerId, L = "player", p.classList.add("liforma-ew__toolbar--dragging"), a.classList.add("liforma-ew--dock-dragging");
3045
3173
  let t = f.getBoundingClientRect();
3046
3174
  N = t.left, P = t.top;
3047
- }, de = (e) => {
3048
- I === "player" && (F === null || e.pointerId !== F || se(e.dx, e.dy));
3049
- }, U = (e) => {
3050
- I === "player" && (F === null || e.pointerId !== F || H());
3051
- }, W = () => {
3052
- let e = Cn(), t = R();
3175
+ }, fe = (e) => {
3176
+ L === "player" && (F === null || e.pointerId !== F || ce(e.dx, e.dy));
3177
+ }, pe = (e) => {
3178
+ L === "player" && (F === null || e.pointerId !== F || V());
3179
+ }, H = () => {
3180
+ let e = Fn(), t = R();
3053
3181
  if (!e || t !== "expanded" && t !== "docked") {
3054
3182
  h.hidden = !0;
3055
3183
  return;
3056
3184
  }
3057
- h.hidden = !1, t === "docked" ? (h.innerHTML = kn, h.setAttribute("aria-label", "Maximize")) : (h.innerHTML = On, h.setAttribute("aria-label", "Reduce"));
3058
- }, fe = (e) => {
3059
- let t = bn(), n = e && N !== null && P !== null ? Sn(N, P, t) : xn(t);
3060
- n = Sn(n.left, n.top, t), N = n.left, P = n.top, V(n.left, n.top, t.width, t.height), W();
3061
- }, pe = () => {
3185
+ h.hidden = !1, t === "docked" ? (h.innerHTML = Vn, h.setAttribute("aria-label", "Maximize")) : (h.innerHTML = Bn, h.setAttribute("aria-label", "Reduce"));
3186
+ }, me = (e) => {
3187
+ let t = Mn(), n = e && N !== null && P !== null ? Pn(N, P, t) : Nn(t);
3188
+ n = Pn(n.left, n.top, t), N = n.left, P = n.top, oe(n.left, n.top, t.width, t.height), H();
3189
+ }, U = () => {
3062
3190
  a.classList.remove("liforma-ew--session-revealed"), requestAnimationFrame(() => {
3063
3191
  requestAnimationFrame(() => {
3064
3192
  S || !$(a.dataset.state) || a.classList.add("liforma-ew--session-revealed");
3065
3193
  });
3066
3194
  });
3067
- }, G = (e) => {
3195
+ }, W = (e) => {
3068
3196
  if (B(), a.classList.remove("liforma-ew--session-revealed"), a.classList.add("liforma-ew--layout-settling"), e(), !D) {
3069
3197
  a.classList.remove("liforma-ew--layout-settling");
3070
3198
  return;
3071
3199
  }
3072
- M = setTimeout(() => {
3073
- if (M = null, S || !$(a.dataset.state)) {
3200
+ ee = setTimeout(() => {
3201
+ if (ee = null, S || !$(a.dataset.state)) {
3074
3202
  a.classList.remove("liforma-ew--layout-settling");
3075
3203
  return;
3076
3204
  }
3077
- a.classList.remove("liforma-ew--layout-settling"), pe();
3205
+ a.classList.remove("liforma-ew--layout-settling"), U();
3078
3206
  }, 220);
3079
- }, ge = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3080
- z(), j = setTimeout(() => {
3081
- j = null, a.classList.remove("liforma-ew--session-concealing"), e();
3207
+ }, he = () => (a.classList.add("liforma-ew--session-concealing"), a.classList.remove("liforma-ew--session-revealed"), new Promise((e) => {
3208
+ z(), M = setTimeout(() => {
3209
+ M = null, a.classList.remove("liforma-ew--session-concealing"), e();
3082
3210
  }, 280);
3083
- })), _e = {
3211
+ })), ge = {
3084
3212
  galleryThumb: t.galleryThumb,
3085
3213
  avatarImage: t.avatarImage,
3086
3214
  backgroundImage: t.backgroundImage,
3087
3215
  foregroundImage: t.foregroundImage,
3088
3216
  fallbackImage: t.fallbackImage
3089
- }, K = (e) => {
3217
+ }, G = (e) => {
3090
3218
  if (!e) {
3091
3219
  y.hidden = !0, y.textContent = "";
3092
3220
  return;
3093
3221
  }
3094
3222
  y.hidden = !1, y.textContent = e;
3095
- }, ve = (e) => {
3223
+ }, _e = (e) => {
3096
3224
  if (!e) {
3097
3225
  c.hidden = !0, c.textContent = "";
3098
3226
  return;
3099
3227
  }
3100
3228
  c.hidden = !1, c.textContent = e, s.contains(c) || s.append(c);
3229
+ }, ve = () => {
3230
+ C = !0, o.disabled = !1, _e(null), r === "onExpand" && t.onPrefetchReady?.();
3101
3231
  }, ye = () => {
3102
- C = !0, o.disabled = !1, ve(null), r === "onExpand" && t.onPrefetchReady?.();
3103
- }, q = () => {
3104
3232
  w = !0, a.dataset.warm = "true", l.hidden = !1, D || (o.tabIndex = -1, o.setAttribute("aria-hidden", "true")), t.onPrefetchReady?.();
3105
- }, xe = (e) => {
3233
+ }, be = (e) => {
3106
3234
  A?.(), A = null;
3107
- let t = An(s, e, { parallax: ie });
3235
+ let t = Hn(s, e, { parallax: ie });
3108
3236
  return t ? (A = t, !0) : !1;
3109
- }, Se = () => {
3110
- if (xe(_e)) {
3111
- ye();
3237
+ }, xe = () => {
3238
+ if (be(ge)) {
3239
+ ve();
3112
3240
  return;
3113
3241
  }
3114
- ve("Loading…"), be(n, { signal: re.signal }).then((e) => {
3242
+ _e("Loading…"), Me(n, { signal: re.signal }).then((e) => {
3115
3243
  if (!S) {
3116
- if (!xe({ galleryThumb: e.galleryThumb })) throw Error("Experience preview is missing gallery thumb images.");
3117
- ye();
3244
+ if (!be({ galleryThumb: e.galleryThumb })) throw Error("Experience preview is missing gallery thumb images.");
3245
+ ve();
3118
3246
  }
3119
3247
  }).catch((e) => {
3120
3248
  if (S || re.signal.aborted) return;
3121
3249
  let n = e instanceof Error ? e : Error(String(e));
3122
- ve("Preview unavailable"), o.disabled = !0, t.onError?.(n), console.error("[ExperienceWidget]", n);
3250
+ _e("Preview unavailable"), o.disabled = !0, t.onError?.(n), console.error("[ExperienceWidget]", n);
3123
3251
  });
3124
- }, Ce = () => ({
3252
+ }, Se = () => ({
3125
3253
  experienceId: n,
3126
3254
  ui: "widget",
3127
3255
  ...t.sessionEndpoint ? { sessionEndpoint: t.sessionEndpoint } : {},
3128
3256
  ...t.locale ? { locale: t.locale } : {},
3257
+ ...t.secondaryLocale ? { secondaryLocale: t.secondaryLocale } : {},
3258
+ ...t.learningLocale ? { learningLocale: t.learningLocale } : {},
3129
3259
  ...t.language ? { language: t.language } : {},
3130
3260
  ...t.mode ? { mode: t.mode } : {},
3131
3261
  ...t.speechInputMode ? { speechInputMode: t.speechInputMode } : {},
3132
3262
  ...t.speechOnly === void 0 ? {} : { speechOnly: t.speechOnly },
3133
3263
  ...t.alreadyConverted?.length ? { alreadyConverted: t.alreadyConverted } : {},
3134
3264
  ...t.embedBaseUrl ? { embedBaseUrl: t.embedBaseUrl } : {}
3135
- }), we = () => ({
3265
+ }), Ce = () => ({
3136
3266
  ...t.fit ? { fit: t.fit } : {},
3137
- startButton: jn(t),
3267
+ startButton: Un(t),
3138
3268
  ...t.showFeedback === void 0 ? {} : { showFeedback: t.showFeedback },
3139
3269
  ...t.interaction ? { interaction: t.interaction } : {}
3140
- }), J = (e = !0) => {
3141
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), ae(), a.dataset.state = "expanded", K(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), W(), e && t.onExpanded?.();
3142
- }, Te = () => {
3143
- o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", K(null), typeof document < "u" && (document.body.style.overflow = k), fe(!0), W(), b?.setWidgetChrome("docked");
3144
- }, Ee = (e) => {
3270
+ }), we = (e = !0) => {
3271
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "true"), ae(), a.dataset.state = "expanded", G(null), typeof document < "u" && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), H(), e && t.onExpanded?.();
3272
+ }, Ee = () => {
3273
+ o.hidden = !0, u.hidden = !1, p.hidden = !1, u.setAttribute("aria-modal", "false"), a.dataset.state = "docked", G(null), typeof document < "u" && (document.body.style.overflow = k), me(!0), H(), b?.setWidgetChrome("docked");
3274
+ }, Oe = (e) => {
3145
3275
  e.on("started", () => {
3146
- S || (D = !0, a.dataset.live = "true", K(null), t.onStarted?.(), $(a.dataset.state) && pe());
3276
+ S || (D = !0, a.dataset.live = "true", G(null), t.onStarted?.(), $(a.dataset.state) && U());
3147
3277
  }), e.on("feedback", (e) => {
3148
3278
  S || t.onFeedback?.(e);
3149
3279
  }), e.on("feedbackFailed", (e) => {
3150
3280
  S || t.onFeedbackFailed?.(e);
3151
3281
  });
3152
- }, De = () => {
3153
- 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), K(null), typeof document < "u" && (document.body.style.overflow = k), W();
3154
- }, Oe = () => {
3282
+ }, ke = () => {
3283
+ 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), G(null), typeof document < "u" && (document.body.style.overflow = k), H();
3284
+ }, Ae = () => {
3155
3285
  z(), B(), O += 1, x = !1, w = !1, T = !1, E = !1, D = !1;
3156
3286
  let e = b;
3157
3287
  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");
3158
- }, ke = () => {
3288
+ }, K = () => {
3159
3289
  if (!S && $(a.dataset.state)) {
3160
- if (H(), x = !1, b && E) {
3290
+ if (V(), x = !1, b && E) {
3161
3291
  let e = b;
3162
3292
  (async () => {
3163
- D && (await ge(), S || b !== e) || (w && e.setWidgetChrome("collapsed"), De(), D ? (a.dataset.live = "true", o.tabIndex = 0, o.removeAttribute("aria-hidden"), o.disabled = !1) : w && q(), t.onCollapsed?.(), t.onClose?.());
3293
+ D && (await he(), S || b !== e) || (w && e.setWidgetChrome("collapsed"), ke(), D ? (a.dataset.live = "true", o.tabIndex = 0, o.removeAttribute("aria-hidden"), o.disabled = !1) : w && ye(), t.onCollapsed?.(), t.onClose?.());
3164
3294
  })();
3165
3295
  return;
3166
3296
  }
3167
- Oe(), De(), t.onCollapsed?.(), t.onClose?.();
3297
+ Ae(), ke(), t.onCollapsed?.(), t.onClose?.();
3168
3298
  }
3169
- }, Y = () => {
3170
- S || Cn() && R() === "expanded" && G(() => {
3171
- Te();
3299
+ }, je = () => {
3300
+ S || Fn() && R() === "expanded" && W(() => {
3301
+ Ee();
3172
3302
  });
3173
- }, X = () => {
3174
- S || R() === "docked" && (H(), G(() => {
3175
- ae(), J(!1), b?.setWidgetChrome("expanded");
3303
+ }, q = () => {
3304
+ S || R() === "docked" && (V(), W(() => {
3305
+ ae(), we(!1), b?.setWidgetChrome("expanded");
3176
3306
  }));
3177
- }, Ae = () => {
3178
- !b || !D || (z(), a.classList.remove("liforma-ew--session-revealed"), J(), b.setWidgetChrome("expanded"), x = !1, pe());
3179
- }, je = () => {
3180
- !b || !E || D || (z(), a.classList.remove("liforma-ew--session-revealed"), J(), x = !1, w || b.setWidgetChrome("expanded"));
3181
- }, Me = (e) => {
3182
- S || e !== O && !D || (z(), a.classList.remove("liforma-ew--session-revealed"), J(), x = !1, D && pe());
3183
3307
  }, Ne = () => {
3308
+ !b || !D || (z(), a.classList.remove("liforma-ew--session-revealed"), we(), b.setWidgetChrome("expanded"), x = !1, U());
3309
+ }, Pe = () => {
3310
+ !b || !E || D || (z(), a.classList.remove("liforma-ew--session-revealed"), we(), x = !1, w || b.setWidgetChrome("expanded"));
3311
+ }, Fe = (e) => {
3312
+ S || e !== O && !D || (z(), a.classList.remove("liforma-ew--session-revealed"), we(), x = !1, D && U());
3313
+ }, Ie = () => {
3184
3314
  if (S || T || w || b || $(a.dataset.state)) return;
3185
3315
  T = !0;
3186
3316
  let e = O;
3187
3317
  l.hidden = !1, (async () => {
3188
3318
  try {
3189
- let t = await dn.startSession(Ce());
3319
+ let t = await Cn.startSession(Se());
3190
3320
  if (S || e !== O) {
3191
3321
  t.destroy();
3192
3322
  return;
3193
3323
  }
3194
- b = t, Ee(t);
3324
+ b = t, Oe(t);
3195
3325
  let n = await t.attach({
3196
3326
  container: l,
3197
- ...we(),
3327
+ ...Ce(),
3198
3328
  onWidgetReady: () => {
3199
- S || e !== O || (T = !1, E = !0, $(a.dataset.state) ? t.setWidgetChrome("expanded") : q());
3329
+ S || e !== O || (T = !1, E = !0, $(a.dataset.state) ? t.setWidgetChrome("expanded") : ye());
3200
3330
  },
3201
3331
  onWidgetExpand: () => {
3202
- Me(e);
3332
+ Fe(e);
3203
3333
  },
3204
3334
  onWidgetAudioSettings: (e) => {
3205
- S || Le(e);
3335
+ S || ze(e);
3206
3336
  },
3207
3337
  onWidgetDragStart: (e) => {
3208
- S || ue(e);
3338
+ S || de(e);
3209
3339
  },
3210
3340
  onWidgetDragMove: (e) => {
3211
- S || de(e);
3341
+ S || fe(e);
3212
3342
  },
3213
3343
  onWidgetDragEnd: (e) => {
3214
- S || U(e);
3344
+ S || pe(e);
3215
3345
  },
3216
3346
  onPlayerStatusChange: (e) => {
3217
- S || e === "error" && $(a.dataset.state) && K("Could not load the experience.");
3347
+ S || e === "error" && $(a.dataset.state) && G("Could not load the experience.");
3218
3348
  }
3219
3349
  });
3220
3350
  if (S || e !== O) {
@@ -3222,7 +3352,7 @@ function Nn(e, t) {
3222
3352
  return;
3223
3353
  }
3224
3354
  n.on("close", () => {
3225
- S || ke();
3355
+ S || K();
3226
3356
  });
3227
3357
  } catch (n) {
3228
3358
  if (S || e !== O) return;
@@ -3231,43 +3361,43 @@ function Nn(e, t) {
3231
3361
  t.onError?.(r), console.error("[ExperienceWidget] warm prefetch failed", r);
3232
3362
  }
3233
3363
  })();
3234
- }, Pe = () => {
3364
+ }, J = () => {
3235
3365
  if (S || x || !C || $(a.dataset.state)) return;
3236
3366
  if (b && D) {
3237
- Ae();
3367
+ Ne();
3238
3368
  return;
3239
3369
  }
3240
3370
  if (b && E) {
3241
- je();
3371
+ Pe();
3242
3372
  return;
3243
3373
  }
3244
3374
  let e = ++O;
3245
3375
  x = !0, w = !1, T = !1, E = !1, D = !1, delete a.dataset.warm, delete a.dataset.live, l.hidden = !0, l.replaceChildren(), b &&= (b.destroy(), null), (async () => {
3246
3376
  try {
3247
- J();
3248
- let t = await dn.startSession(Ce());
3377
+ we();
3378
+ let t = await Cn.startSession(Se());
3249
3379
  if (S || e !== O) {
3250
3380
  t.destroy();
3251
3381
  return;
3252
3382
  }
3253
- b = t, Ee(t);
3383
+ b = t, Oe(t);
3254
3384
  let n = await t.attach({
3255
3385
  container: v,
3256
- ...we(),
3386
+ ...Ce(),
3257
3387
  onWidgetAudioSettings: (e) => {
3258
- S || Le(e);
3388
+ S || ze(e);
3259
3389
  },
3260
3390
  onWidgetDragStart: (e) => {
3261
- S || ue(e);
3391
+ S || de(e);
3262
3392
  },
3263
3393
  onWidgetDragMove: (e) => {
3264
- S || de(e);
3394
+ S || fe(e);
3265
3395
  },
3266
3396
  onWidgetDragEnd: (e) => {
3267
- S || U(e);
3397
+ S || pe(e);
3268
3398
  },
3269
3399
  onPlayerStatusChange: (e) => {
3270
- S || (e === "error" ? K("Could not load the experience.") : $(a.dataset.state) && K(null));
3400
+ S || (e === "error" ? G("Could not load the experience.") : $(a.dataset.state) && G(null));
3271
3401
  }
3272
3402
  });
3273
3403
  if (S || e !== O) {
@@ -3275,101 +3405,101 @@ function Nn(e, t) {
3275
3405
  return;
3276
3406
  }
3277
3407
  E = !0, t.setWidgetChrome("expanded"), n.on("close", () => {
3278
- S || ke();
3408
+ S || K();
3279
3409
  });
3280
3410
  } catch (n) {
3281
3411
  if (S || e !== O) return;
3282
3412
  let r = n instanceof Error ? n : Error(String(n));
3283
- K(r.message), t.onError?.(r), console.error("[ExperienceWidget]", r);
3413
+ G(r.message), t.onError?.(r), console.error("[ExperienceWidget]", r);
3284
3414
  } finally {
3285
3415
  e === O && (x = !1);
3286
3416
  }
3287
3417
  })();
3288
- }, Fe = () => {
3418
+ }, Le = () => {
3289
3419
  if (!(S || $(a.dataset.state))) {
3290
3420
  if (b && D) {
3291
- Ae();
3421
+ Ne();
3292
3422
  return;
3293
3423
  }
3294
3424
  if (b && E) {
3295
- je();
3425
+ Pe();
3296
3426
  return;
3297
3427
  }
3298
3428
  if (T || b) {
3299
- J();
3429
+ we();
3300
3430
  return;
3301
3431
  }
3302
- Pe();
3432
+ J();
3303
3433
  }
3304
- }, Ie = (e) => {
3434
+ }, Re = (e) => {
3305
3435
  if (e.stopPropagation(), R() === "expanded") {
3306
- Y();
3436
+ je();
3307
3437
  return;
3308
3438
  }
3309
- R() === "docked" && X();
3310
- }, Le = (e) => {
3311
- g.setAttribute("aria-pressed", e ? "true" : "false");
3312
- }, Re = (e) => {
3313
- e.stopPropagation(), $(a.dataset.state) && b?.toggleAudioSettings();
3439
+ R() === "docked" && q();
3314
3440
  }, ze = (e) => {
3315
- R() === "docked" && Cn() && (e.target?.closest("button") || (e.preventDefault(), le(e.clientX, e.clientY, e.pointerId)));
3441
+ g.setAttribute("aria-pressed", e ? "true" : "false");
3316
3442
  }, Be = (e) => {
3317
- e.key === "Escape" && $(a.dataset.state) && (e.preventDefault(), ke());
3318
- }, Ve = () => {
3443
+ e.stopPropagation(), $(a.dataset.state) && b?.toggleAudioSettings();
3444
+ }, Ve = (e) => {
3445
+ R() === "docked" && Fn() && (e.target?.closest("button") || (e.preventDefault(), ue(e.clientX, e.clientY, e.pointerId)));
3446
+ }, Y = (e) => {
3447
+ e.key === "Escape" && $(a.dataset.state) && (e.preventDefault(), K());
3448
+ }, X = () => {
3319
3449
  if (!S) {
3320
3450
  if (R() === "docked") {
3321
- if (!Cn()) {
3322
- X();
3451
+ if (!Fn()) {
3452
+ q();
3323
3453
  return;
3324
3454
  }
3325
- D ? G(() => {
3326
- fe(!0);
3327
- }) : fe(!0);
3455
+ D ? W(() => {
3456
+ me(!0);
3457
+ }) : me(!0);
3328
3458
  return;
3329
3459
  }
3330
- W();
3460
+ H();
3331
3461
  }
3332
- }, He = typeof window < "u" ? window.matchMedia(pn) : null, Ue = () => {
3462
+ }, He = typeof window < "u" ? window.matchMedia(Tn) : null, Ue = () => {
3333
3463
  if (!S) {
3334
- if (R() === "docked" && !Cn()) {
3335
- X();
3464
+ if (R() === "docked" && !Fn()) {
3465
+ q();
3336
3466
  return;
3337
3467
  }
3338
- W();
3468
+ H();
3339
3469
  }
3340
3470
  };
3341
- return o.addEventListener("click", Fe), d.addEventListener("click", ke), _.addEventListener("click", (e) => {
3342
- e.stopPropagation(), ke();
3343
- }), h.addEventListener("click", Ie), g.addEventListener("click", Re), p.addEventListener("pointerdown", ze), window.addEventListener("keydown", Be), window.addEventListener("resize", Ve), He?.addEventListener("change", Ue), Se(), W(), r === "eager" ? queueMicrotask(() => {
3344
- S || Ne();
3345
- }) : r === "idle" && (ee = Mn(() => {
3346
- S || Ne();
3471
+ return o.addEventListener("click", Le), d.addEventListener("click", K), _.addEventListener("click", (e) => {
3472
+ e.stopPropagation(), K();
3473
+ }), h.addEventListener("click", Re), g.addEventListener("click", Be), p.addEventListener("pointerdown", Ve), window.addEventListener("keydown", Y), window.addEventListener("resize", X), He?.addEventListener("change", Ue), xe(), H(), r === "eager" ? queueMicrotask(() => {
3474
+ S || Ie();
3475
+ }) : r === "idle" && (j = Wn(() => {
3476
+ S || Ie();
3347
3477
  })), {
3348
3478
  root: a,
3349
- expand: Fe,
3350
- collapse: ke,
3351
- dock: Y,
3352
- maximize: X,
3479
+ expand: Le,
3480
+ collapse: K,
3481
+ dock: je,
3482
+ maximize: q,
3353
3483
  prefetch() {
3354
3484
  if (r === "onExpand") {
3355
- Ne();
3485
+ Ie();
3356
3486
  return;
3357
3487
  }
3358
- Ne();
3488
+ Ie();
3359
3489
  },
3360
3490
  destroy() {
3361
- S || (S = !0, H(), ee?.(), ee = null, re.abort(), A?.(), A = null, window.removeEventListener("keydown", Be), window.removeEventListener("resize", Ve), He?.removeEventListener("change", Ue), Oe(), De(), e.replaceChildren());
3491
+ S || (S = !0, V(), j?.(), j = null, re.abort(), A?.(), A = null, window.removeEventListener("keydown", Y), window.removeEventListener("resize", X), He?.removeEventListener("change", Ue), Ae(), ke(), e.replaceChildren());
3362
3492
  }
3363
3493
  };
3364
3494
  }
3365
3495
  //#endregion
3366
3496
  //#region src/react/ExperienceWidget.tsx
3367
- function Pn(t) {
3368
- let r = n(null), { experienceId: i, alt: o, galleryThumb: s, avatarImage: c, backgroundImage: l, foregroundImage: u, fallbackImage: d, prefetch: f = "onExpand", parallax: p = !0, position: m = "static", offset: h, sessionEndpoint: g, language: _, mode: v, speechInputMode: y, speechOnly: b, fit: x, embedBaseUrl: S, expandedMaxWidth: C, expandedMaxHeight: w, startButtonLabel: T, startButton: E, showFeedback: D, className: O = "", onExpanded: k, onCollapsed: A, onStarted: ee, onClose: j, onError: M, onPrefetchReady: N, onFeedback: P, onFeedbackFailed: F } = t, te = m === "bottom-right" || m === "bottom-left";
3497
+ function Kn(t) {
3498
+ let r = n(null), { experienceId: i, alt: o, galleryThumb: s, avatarImage: c, backgroundImage: l, foregroundImage: u, fallbackImage: d, prefetch: f = "onExpand", parallax: p = !0, position: m = "static", offset: h, sessionEndpoint: g, locale: _, secondaryLocale: v, learningLocale: y, language: b, mode: x, speechInputMode: S, speechOnly: C, fit: w, embedBaseUrl: T, expandedMaxWidth: E, expandedMaxHeight: D, startButtonLabel: O, startButton: k, showFeedback: A, className: j = "", onExpanded: M, onCollapsed: ee, onStarted: N, onClose: P, onError: F, onPrefetchReady: te, onFeedback: I, onFeedbackFailed: L } = t, ne = m === "bottom-right" || m === "bottom-left";
3369
3499
  return e(() => {
3370
3500
  let e = r.current;
3371
3501
  if (!e || !i.trim()) return;
3372
- let t = Nn(e, {
3502
+ let t = Gn(e, {
3373
3503
  experienceId: i,
3374
3504
  alt: o,
3375
3505
  galleryThumb: s,
@@ -3382,25 +3512,28 @@ function Pn(t) {
3382
3512
  position: m,
3383
3513
  offset: h,
3384
3514
  sessionEndpoint: g,
3385
- language: _,
3386
- mode: v,
3387
- speechInputMode: y,
3388
- speechOnly: b,
3389
- fit: x,
3390
- embedBaseUrl: S,
3391
- expandedMaxWidth: C,
3392
- expandedMaxHeight: w,
3393
- startButtonLabel: T,
3394
- startButton: E,
3395
- showFeedback: D,
3396
- onFeedback: P,
3397
- onFeedbackFailed: F,
3398
- onExpanded: k,
3399
- onCollapsed: A,
3400
- onStarted: ee,
3401
- onClose: j,
3402
- onError: M,
3403
- onPrefetchReady: N
3515
+ locale: _,
3516
+ secondaryLocale: v,
3517
+ learningLocale: y,
3518
+ language: b,
3519
+ mode: x,
3520
+ speechInputMode: S,
3521
+ speechOnly: C,
3522
+ fit: w,
3523
+ embedBaseUrl: T,
3524
+ expandedMaxWidth: E,
3525
+ expandedMaxHeight: D,
3526
+ startButtonLabel: O,
3527
+ startButton: k,
3528
+ showFeedback: A,
3529
+ onFeedback: I,
3530
+ onFeedbackFailed: L,
3531
+ onExpanded: M,
3532
+ onCollapsed: ee,
3533
+ onStarted: N,
3534
+ onClose: P,
3535
+ onError: F,
3536
+ onPrefetchReady: te
3404
3537
  });
3405
3538
  return () => t.destroy();
3406
3539
  }, [
@@ -3427,18 +3560,21 @@ function Pn(t) {
3427
3560
  T,
3428
3561
  E,
3429
3562
  D,
3430
- P,
3431
- F,
3563
+ O,
3432
3564
  k,
3433
3565
  A,
3434
- ee,
3435
- j,
3566
+ I,
3567
+ L,
3436
3568
  M,
3437
- N
3569
+ ee,
3570
+ N,
3571
+ P,
3572
+ F,
3573
+ te
3438
3574
  ]), /* @__PURE__ */ a("div", {
3439
3575
  ref: r,
3440
- className: O,
3441
- style: te ? { display: "contents" } : {
3576
+ className: j,
3577
+ style: ne ? { display: "contents" } : {
3442
3578
  width: "100%",
3443
3579
  height: "100%",
3444
3580
  minHeight: "inherit"
@@ -3447,11 +3583,11 @@ function Pn(t) {
3447
3583
  }
3448
3584
  //#endregion
3449
3585
  //#region src/next/index.ts
3450
- function Fn(e = {}) {
3586
+ function qn(e = {}) {
3451
3587
  let t = v(e);
3452
3588
  return { POST: ({ request: e }) => t(e) };
3453
3589
  }
3454
3590
  //#endregion
3455
- export { pe as ExperienceThumbnail, Pn as ExperienceWidget, v as createLiformaSessionRouteHandler, Fn as createLiformaSvelteKitSessionHandler };
3591
+ export { we as ExperienceThumbnail, Kn as ExperienceWidget, v as createLiformaSessionRouteHandler, qn as createLiformaSvelteKitSessionHandler };
3456
3592
 
3457
3593
  //# sourceMappingURL=index.js.map