@pluno/product-agent-web 0.1.71 → 0.1.72

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.
@@ -1,11 +1,11 @@
1
1
  import { PlunoProductAgent as Jo, getProductAgentOriginAccessErrorMessage as Qo } from "./product-agent-sdk.js";
2
- const ei = "#7c3aed", st = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", dt = "#2c2a1e", yn = [253, 250, 241], vn = 3.5;
2
+ const ei = "#7c3aed", dt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", ct = "#2c2a1e", yn = [253, 250, 241], vn = 3.5;
3
3
  function eo(e) {
4
4
  const t = to(e);
5
- if (Cn(Ye(t), yn) >= vn)
5
+ if (Cn(Xe(t), yn) >= vn)
6
6
  return t;
7
- let o = Ye(t);
8
- const i = Ye(dt);
7
+ let o = Xe(t);
8
+ const i = Xe(ct);
9
9
  for (let a = 0; a < 6; a += 1)
10
10
  if (o = oi(o, i, 0.22), Cn(o, yn) >= vn)
11
11
  return Gt(o);
@@ -20,7 +20,7 @@ function ti() {
20
20
  return n;
21
21
  }
22
22
  function ni(e) {
23
- const t = to(e), n = $t(Ye(t));
23
+ const t = to(e), n = $t(Xe(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
@@ -44,23 +44,23 @@ function ni(e) {
44
44
  inner: "#4b4b4b",
45
45
  shadow: "#000000"
46
46
  } : {
47
- top: ne(t, 0.28, -0.03),
48
- middle: ne(t, 0.08, 0.04),
49
- bottom: ne(t, -0.1, 0.02),
50
- edgeStart: ne(t, 0.08, 0.08),
51
- edgeMiddle: ne(t, -0.08, 0.08),
52
- edgeEnd: ne(t, -0.18, 0.05),
53
- glow: ne(t, 0.32, -0.12),
54
- highlight: ne(t, 0.38, -0.18),
55
- inner: ne(t, 0.24, -0.1),
56
- shadow: ne(t, -0.25, -0.08)
47
+ top: te(t, 0.28, -0.03),
48
+ middle: te(t, 0.08, 0.04),
49
+ bottom: te(t, -0.1, 0.02),
50
+ edgeStart: te(t, 0.08, 0.08),
51
+ edgeMiddle: te(t, -0.08, 0.08),
52
+ edgeEnd: te(t, -0.18, 0.05),
53
+ glow: te(t, 0.32, -0.12),
54
+ highlight: te(t, 0.38, -0.18),
55
+ inner: te(t, 0.24, -0.1),
56
+ shadow: te(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
59
  function to(e) {
60
60
  const t = e.trim();
61
61
  return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : ei;
62
62
  }
63
- function Ye(e) {
63
+ function Xe(e) {
64
64
  return [
65
65
  Number.parseInt(e.slice(1, 3), 16),
66
66
  Number.parseInt(e.slice(3, 5), 16),
@@ -90,8 +90,8 @@ function oi(e, t, n) {
90
90
  e[2] + (t[2] - e[2]) * o
91
91
  ];
92
92
  }
93
- function ne(e, t, n) {
94
- const [o, i, a] = ii(Ye(e));
93
+ function te(e, t, n) {
94
+ const [o, i, a] = ii(Xe(e));
95
95
  return Gt(ai(o, qt(i + n), qt(a + t)));
96
96
  }
97
97
  function ii([e, t, n]) {
@@ -167,13 +167,13 @@ function fi(e, t = {}) {
167
167
  o = u, e(u);
168
168
  return;
169
169
  }
170
- const m = o, E = performance.now();
170
+ const m = o, k = performance.now();
171
171
  a = window.setInterval(() => {
172
172
  if (n) {
173
173
  l();
174
174
  return;
175
175
  }
176
- const v = Math.min(1, (performance.now() - E) / ci);
176
+ const v = Math.min(1, (performance.now() - k) / ci);
177
177
  o = Math.round(m + (u - m) * xi(v)), e(o), v >= 1 && (o = u, e(u), l());
178
178
  }, gi);
179
179
  }, c = async () => {
@@ -216,7 +216,7 @@ function _i(e) {
216
216
  function xi(e) {
217
217
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
218
218
  }
219
- const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Pi = "product-agent:sdk-preview-socket-error", Ii = "product-agent:sdk-preview-socket-closed", kn = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", io = "data-pluno-auto-mounted", se = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Ln = "Timed out loading Pluno widget token", Di = "pluno.productAgent.widgetClientId.", Dt = /* @__PURE__ */ new Set(), Ri = "product-agent:preview-diagnostic", ao = "pluno.productAgent.sharePromptsDisabled", zi = 3, Pn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mi = 400, Oi = 5e3, Ui = 500, In = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", oe = {
219
+ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Pi = "product-agent:sdk-preview-socket-error", Ii = "product-agent:sdk-preview-socket-closed", kn = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", io = "data-pluno-auto-mounted", se = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Ln = "Timed out loading Pluno widget token", Di = "pluno.productAgent.widgetClientId.", Dt = /* @__PURE__ */ new Set(), Ri = "product-agent:preview-diagnostic", ao = "pluno.productAgent.sharePromptsDisabled", Mi = 3, Pn = 'dialog[open], [aria-modal="true"], [role="dialog"]', zi = 400, Oi = 5e3, Ui = 500, In = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", ne = {
220
220
  launcherLabel: "Ask for anything...",
221
221
  accentColor: "#7c3aed",
222
222
  colorScheme: "light",
@@ -224,7 +224,7 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
224
224
  scribbleStyle: !0,
225
225
  position: "bottom-right",
226
226
  movableLauncher: !1
227
- }, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Tn = "pluno-pa-scribble-font", ro = 190, lo = 41, An = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, tn = 420, qi = 520, ji = 0.24, nn = 680, Vi = 800, Ki = 0.76, I = 8, Se = 50, po = "http://www.w3.org/2000/svg", jt = 26, Vt = 8, Yi = 36, Kt = 16, Xi = 4, Nn = [
227
+ }, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Tn = "pluno-pa-scribble-font", ro = 190, lo = 41, An = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, tn = 420, qi = 520, ji = 0.24, nn = 680, Vi = 800, Ki = 0.76, T = 8, ke = 50, po = "http://www.w3.org/2000/svg", jt = 26, Vt = 8, Yi = 36, Kt = 16, Xi = 4, Nn = [
228
228
  {
229
229
  ellipseCx: "17.5",
230
230
  ellipseCy: "24.5",
@@ -268,13 +268,13 @@ function ea(e) {
268
268
  }
269
269
  async function ta(e = {}) {
270
270
  const t = {
271
- launcherLabel: e.launcherLabel ?? oe.launcherLabel,
272
- accentColor: e.accentColor ?? oe.accentColor,
273
- colorScheme: e.colorScheme ?? oe.colorScheme,
274
- fontFamily: e.fontFamily ?? oe.fontFamily,
275
- scribbleStyle: e.scribbleStyle ?? oe.scribbleStyle,
276
- position: e.position ?? oe.position,
277
- movableLauncher: e.movableLauncher ?? oe.movableLauncher,
271
+ launcherLabel: e.launcherLabel ?? ne.launcherLabel,
272
+ accentColor: e.accentColor ?? ne.accentColor,
273
+ colorScheme: e.colorScheme ?? ne.colorScheme,
274
+ fontFamily: e.fontFamily ?? ne.fontFamily,
275
+ scribbleStyle: e.scribbleStyle ?? ne.scribbleStyle,
276
+ position: e.position ?? ne.position,
277
+ movableLauncher: e.movableLauncher ?? ne.movableLauncher,
278
278
  token: e.token,
279
279
  tokenProvider: e.tokenProvider,
280
280
  tokenEndpoint: e.tokenEndpoint,
@@ -308,7 +308,7 @@ async function ta(e = {}) {
308
308
  showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
309
309
  taskNotifications: e.taskNotifications
310
310
  };
311
- J(
311
+ Q(
312
312
  "web-sdk.widget",
313
313
  "Mounting widget with merged options",
314
314
  {
@@ -343,70 +343,70 @@ async function ta(e = {}) {
343
343
  ), o.appendChild(i);
344
344
  const l = yr(t);
345
345
  let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
346
- i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Ce(
346
+ i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Ee(
347
347
  i,
348
- zt(
348
+ Mt(
349
349
  i,
350
350
  p,
351
351
  t.position
352
352
  )
353
- )), Xn(o, t.accentColor), zn(i, a, {
353
+ )), Xn(o, t.accentColor), Mn(i, a, {
354
354
  accentColor: t.accentColor,
355
355
  colorScheme: t.colorScheme,
356
356
  fontFamily: t.fontFamily,
357
357
  scribbleStyle: t.scribbleStyle
358
358
  });
359
- const m = await _r(), E = m.ownerDocument, v = i.querySelector(
359
+ const m = await _r(), k = m.ownerDocument, v = i.querySelector(
360
360
  ".pluno-pa-widget__launcher"
361
- ), z = i.querySelector(
361
+ ), D = i.querySelector(
362
362
  ".pluno-pa-widget__launcher-drag-handle"
363
- ), b = i.querySelector(
363
+ ), S = i.querySelector(
364
364
  ".pluno-pa-widget__launcher-input"
365
365
  ), g = i.querySelector(
366
366
  ".pluno-pa-widget__launcher-minimize"
367
- ), w = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
367
+ ), x = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
368
368
  ".pluno-pa-widget__scribble-spirals--panel"
369
- ), P = Array.from(
369
+ ), A = Array.from(
370
370
  i.querySelectorAll(".pluno-pa-widget__resize-handle")
371
- ), T = i.querySelector(
371
+ ), I = i.querySelector(
372
372
  ".pluno-pa-widget__close"
373
- ), k = i.querySelector(
373
+ ), R = i.querySelector(
374
374
  ".pluno-pa-widget__composer"
375
- ), F = i.querySelector(
375
+ ), P = i.querySelector(
376
376
  ".pluno-pa-widget__attachment-error"
377
- ), H = i.querySelector(
377
+ ), Oe = i.querySelector(
378
378
  ".pluno-pa-widget__billing-status"
379
379
  ), $ = i.querySelector(
380
380
  ".pluno-pa-widget__attachments"
381
- ), Q = i.querySelector(
381
+ ), U = i.querySelector(
382
382
  ".pluno-pa-widget__attachment-input"
383
- ), Me = i.querySelector(
383
+ ), ce = i.querySelector(
384
384
  ".pluno-pa-widget__attach"
385
- ), x = i.querySelector(
385
+ ), y = i.querySelector(
386
386
  ".pluno-pa-widget__input"
387
- ), ce = i.querySelector(
387
+ ), ee = i.querySelector(
388
388
  ".pluno-pa-widget__send"
389
- ), Xe = i.querySelector(
389
+ ), Ze = i.querySelector(
390
390
  ".pluno-pa-widget__top-actions"
391
- ), X = i.querySelector(
391
+ ), _e = i.querySelector(
392
392
  ".pluno-pa-widget__history"
393
- ), C = i.querySelector(
393
+ ), ue = i.querySelector(
394
394
  ".pluno-pa-widget__history-panel"
395
- ), N = i.querySelector(
395
+ ), w = i.querySelector(
396
396
  ".pluno-pa-widget__history-list"
397
- ), Ee = i.querySelector(
397
+ ), z = i.querySelector(
398
398
  ".pluno-pa-widget__history-close"
399
- ), q = i.querySelector(
399
+ ), H = i.querySelector(
400
400
  ".pluno-pa-widget__history-status"
401
- ), R = i.querySelector(
401
+ ), q = i.querySelector(
402
402
  ".pluno-pa-widget__timeline-jump"
403
- ), D = i.querySelector(
403
+ ), N = i.querySelector(
404
404
  ".pluno-pa-widget__active-users-counter"
405
- ), A = i.querySelector(
405
+ ), C = i.querySelector(
406
406
  ".pluno-pa-widget__timeline"
407
- ), mt = i.querySelector(
407
+ ), re = i.querySelector(
408
408
  ".pluno-pa-widget__timeline-bottom-sentinel"
409
- ), Oe = i.querySelector(
409
+ ), Ue = i.querySelector(
410
410
  ".pluno-pa-widget__notify-suggestion"
411
411
  ), Ao = i.querySelector(
412
412
  ".pluno-pa-widget__notify-suggestion-enable"
@@ -415,28 +415,28 @@ async function ta(e = {}) {
415
415
  ), Do = i.querySelector(
416
416
  ".pluno-pa-widget__notify-suggestion-never"
417
417
  );
418
- if (!v || !b || !w || !T || !k || !F || !H || !$ || !Q || !Me || !x || !ce || !Xe || !X || !C || !N || !Ee || !q || !R || !D || !A || !mt)
418
+ if (!v || !S || !x || !I || !R || !P || !Oe || !$ || !U || !ce || !y || !ee || !Ze || !_e || !ue || !w || !z || !H || !q || !N || !C || !re)
419
419
  throw new Error("Failed to mount Pluno widget");
420
- if (t.movableLauncher && !z)
420
+ if (t.movableLauncher && !D)
421
421
  throw new Error("Failed to mount Pluno widget drag handle");
422
- Wn(b), Wn(x);
422
+ Wn(S), Wn(y);
423
423
  let W = [], le = null;
424
- const ke = () => {
424
+ const Le = () => {
425
425
  Ga(
426
426
  $,
427
427
  W,
428
428
  (r) => {
429
429
  W = W.filter(
430
- (s, _) => _ !== r
431
- ), ke(), G(y.getState()), j();
430
+ (s, b) => b !== r
431
+ ), Le(), G(_.getState()), j();
432
432
  }
433
433
  );
434
434
  }, Ro = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
435
435
  if (!t.tokenEndpoint)
436
436
  throw new Error("Pluno widget requires token or tokenEndpoint");
437
437
  return Io(t.tokenEndpoint);
438
- }), zo = window.fetch.bind(window), ft = xr(t.clientId);
439
- let y;
438
+ }), Mo = window.fetch.bind(window), ft = xr(t.clientId);
439
+ let _;
440
440
  try {
441
441
  const r = {
442
442
  token: t.token,
@@ -444,7 +444,7 @@ async function ta(e = {}) {
444
444
  backendUrl: t.backendUrl,
445
445
  metadata: () => ({
446
446
  ...t.metadata ?? {},
447
- ...!y.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
447
+ ...!_.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
448
448
  }),
449
449
  initialStarterPrompts: t.initialStarterPrompts,
450
450
  clientId: ft.clientId,
@@ -455,11 +455,11 @@ async function ta(e = {}) {
455
455
  autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0,
456
456
  disableNetworkCapture: !!t.sdkPreviewChannelId
457
457
  };
458
- y = await Jo.init(r);
458
+ _ = await Jo.init(r);
459
459
  } catch (r) {
460
460
  throw ft.release(), n.remove(), r;
461
461
  }
462
- m.appendChild(n), J(
462
+ m.appendChild(n), Q(
463
463
  "web-sdk.widget",
464
464
  "Applied initial widget appearance",
465
465
  {
@@ -469,77 +469,77 @@ async function ta(e = {}) {
469
469
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
470
470
  }
471
471
  );
472
- const wt = new Set(l.openToolGroupKeys), Le = new Set(
472
+ const wt = new Set(l.openToolGroupKeys), Pe = new Set(
473
473
  l.seenShareCandidateIds
474
- ), Ze = new Set(Le);
475
- let bt = l.sharePromptsDisabled || await vr(t), Z = null, Pe = !1, we = !1, be = {
474
+ ), Je = new Set(Pe);
475
+ let bt = l.sharePromptsDisabled || await vr(t), X = null, Ie = !1, ge = !1, xe = {
476
476
  enabled: !0
477
- }, _e = 0, rn = "", ue = !1, pe = !1, ge = [], _t = null, Ue = null;
478
- const ee = (r, s) => {
479
- be = { enabled: r, reason: s };
480
- }, te = () => {
481
- R.hidden = !0;
482
- }, Mo = () => {
483
- R.hidden = !1;
477
+ }, ye = 0, rn = "", he = !1, pe = !1, me = [], _t = null, Be = null;
478
+ const Z = (r, s) => {
479
+ xe = { enabled: r, reason: s };
480
+ }, J = () => {
481
+ q.hidden = !0;
482
+ }, zo = () => {
483
+ q.hidden = !1;
484
484
  }, Oo = (r = "jump") => {
485
- ee(!0, r), te(), Ke(A, () => be.enabled), _e = A.scrollTop;
486
- }, xe = () => {
487
- if (X.hidden = t.loginRequired, C.hidden = !ue, X.setAttribute("aria-expanded", String(ue)), N.classList.toggle(
485
+ Z(!0, r), J(), Ye(C, () => xe.enabled), ye = C.scrollTop;
486
+ }, ve = () => {
487
+ if (_e.hidden = t.loginRequired, ue.hidden = !he, _e.setAttribute("aria-expanded", String(he)), w.classList.toggle(
488
488
  "pluno-pa-widget__history-list--center",
489
- pe && ge.length === 0
490
- ), N.replaceChildren(), pe && ge.length === 0) {
489
+ pe && me.length === 0
490
+ ), w.replaceChildren(), pe && me.length === 0) {
491
491
  const r = document.createElement("p");
492
- r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", N.appendChild(r);
492
+ r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", w.appendChild(r);
493
493
  }
494
- for (const r of ge) {
494
+ for (const r of me) {
495
495
  const s = document.createElement("button");
496
496
  s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
497
- const _ = document.createElement("span");
498
- _.className = "pluno-pa-widget__history-item-title", _.textContent = ya(r);
497
+ const b = document.createElement("span");
498
+ b.className = "pluno-pa-widget__history-item-title", b.textContent = ya(r);
499
499
  const L = document.createElement("time");
500
500
  L.className = "pluno-pa-widget__history-time", L.dateTime = r.lastActiveAt, L.textContent = Ca(
501
501
  r.lastActiveAt,
502
502
  Date.now()
503
503
  );
504
504
  const M = document.createElement("small");
505
- M.className = "pluno-pa-widget__history-path", M.textContent = va(r), s.append(_, L, M), s.addEventListener("click", () => {
506
- ue = !1, Ue = null, xe(), ee(!0, "newSession"), te(), y.loadSession(r.id), G(y.getState());
507
- }), N.appendChild(s);
505
+ M.className = "pluno-pa-widget__history-path", M.textContent = va(r), s.append(b, L, M), s.addEventListener("click", () => {
506
+ he = !1, Be = null, ve(), Z(!0, "newSession"), J(), _.loadSession(r.id), G(_.getState());
507
+ }), w.appendChild(s);
508
508
  }
509
- if (pe && ge.length > 0) {
509
+ if (pe && me.length > 0) {
510
510
  const r = document.createElement("p");
511
- r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...", N.appendChild(r);
511
+ r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...", w.appendChild(r);
512
512
  }
513
- q.textContent = Ue ?? (!pe && ge.length === 0 ? "No recent chats for this page yet." : ""), q.hidden = q.textContent.length === 0;
513
+ H.textContent = Be ?? (!pe && me.length === 0 ? "No recent chats for this page yet." : ""), H.hidden = H.textContent.length === 0;
514
514
  }, ln = async (r) => {
515
515
  if (!pe) {
516
- pe = !0, Ue = null, xe();
516
+ pe = !0, Be = null, ve();
517
517
  try {
518
- const s = await y.listSessions({ cursor: r, limit: 20 });
519
- ge = r ? [...ge, ...s.sessions] : s.sessions, _t = s.nextCursor;
518
+ const s = await _.listSessions({ cursor: r, limit: 20 });
519
+ me = r ? [...me, ...s.sessions] : s.sessions, _t = s.nextCursor;
520
520
  } catch (s) {
521
- J(
521
+ Q(
522
522
  "web-sdk.widget",
523
523
  "Failed to load session history",
524
524
  {
525
525
  message: s instanceof Error ? s.message : String(s)
526
526
  }
527
- ), Ue = Bi;
527
+ ), Be = Bi;
528
528
  } finally {
529
- pe = !1, xe();
529
+ pe = !1, ve();
530
530
  }
531
531
  }
532
532
  }, Uo = () => {
533
- !_t || pe || N.scrollHeight - N.scrollTop - N.clientHeight <= 24 && ln(_t);
533
+ !_t || pe || w.scrollHeight - w.scrollTop - w.clientHeight <= 24 && ln(_t);
534
534
  }, pn = () => {
535
- Pe || typeof document > "u" || (Xn(o, t.accentColor), n.isConnected || E.body?.appendChild(n));
535
+ Ie || typeof document > "u" || (Xn(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
536
536
  }, sn = new MutationObserver(pn);
537
- sn.observe(E.documentElement, {
537
+ sn.observe(k.documentElement, {
538
538
  childList: !0,
539
539
  subtree: !0
540
540
  }), pn();
541
- const Be = (r = !0) => {
542
- const s = ct(i, r);
541
+ const Fe = (r = !0) => {
542
+ const s = ut(i, r);
543
543
  return Xt(
544
544
  i,
545
545
  p ? ho(p, s) : sa(
@@ -549,37 +549,37 @@ async function ta(e = {}) {
549
549
  ),
550
550
  s
551
551
  );
552
- }, U = () => {
553
- const r = fa(o, b, x);
552
+ }, B = () => {
553
+ const r = fa(o, S, y);
554
554
  Sr(t, {
555
555
  isOpen: i.classList.contains("pluno-pa-widget--open"),
556
- composerValue: x.value,
556
+ composerValue: y.value,
557
557
  focusedInput: r,
558
558
  focusedInputAt: r ? Date.now() : null,
559
559
  openToolGroupKeys: [...wt],
560
560
  launcherPosition: d ? p : null,
561
561
  panelSize: c,
562
- seenShareCandidateIds: [...Le].slice(
562
+ seenShareCandidateIds: [...Pe].slice(
563
563
  -oo
564
564
  ),
565
565
  sharePromptsDisabled: bt
566
566
  });
567
- }, Je = (r) => {
567
+ }, Qe = (r) => {
568
568
  t.onDisplayStateChange?.(r);
569
- }, Fe = (r, s = !0) => {
569
+ }, He = (r, s = !0) => {
570
570
  if (r === "shown") {
571
- i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && He(!1), s && Je("shown");
571
+ i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && We(!1), s && Qe("shown");
572
572
  return;
573
573
  }
574
- Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, w.hidden = !0, T.hidden = !0, v.tabIndex = 0, x.value = "", Ce(
574
+ X !== null && (window.clearTimeout(X), X = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, x.hidden = !0, I.hidden = !0, v.tabIndex = 0, y.value = "", Ee(
575
575
  i,
576
- zt(
576
+ Mt(
577
577
  i,
578
578
  p,
579
579
  t.position
580
580
  )
581
- ), Bn(i), U(), s && Je("minimized");
582
- }, ye = (r, s = {}) => {
581
+ ), Bn(i), B(), s && Qe("minimized");
582
+ }, Ce = (r, s = {}) => {
583
583
  ma(r, {
584
584
  debugVersion: Qi,
585
585
  launcherPosition: p,
@@ -592,17 +592,17 @@ async function ta(e = {}) {
592
592
  },
593
593
  rootRect: Ot(i),
594
594
  launcherRect: Ot(v),
595
- panelRect: Ot(w),
595
+ panelRect: Ot(x),
596
596
  viewport: Y(),
597
- panelHidden: w.hidden,
598
- closeHidden: T.hidden,
597
+ panelHidden: x.hidden,
598
+ closeHidden: I.hidden,
599
599
  ...s
600
600
  });
601
- }, He = (r = !0) => {
601
+ }, We = (r = !0) => {
602
602
  if (!p)
603
- return Ce(i, null), Be(r);
604
- const s = Be(r);
605
- return Ce(i, s), ye("Applied stored closed launcher position", {
603
+ return Ee(i, null), Fe(r);
604
+ const s = Fe(r);
605
+ return Ee(i, s), Ce("Applied stored closed launcher position", {
606
606
  visibleLauncherPosition: s
607
607
  }), s;
608
608
  }, xt = (r, s) => {
@@ -616,9 +616,9 @@ async function ta(e = {}) {
616
616
  });
617
617
  }, dn = () => {
618
618
  if (i.classList.contains("pluno-pa-widget--minimized")) {
619
- Ce(
619
+ Ee(
620
620
  i,
621
- zt(
621
+ Mt(
622
622
  i,
623
623
  p,
624
624
  t.position
@@ -626,7 +626,7 @@ async function ta(e = {}) {
626
626
  );
627
627
  return;
628
628
  }
629
- const r = He();
629
+ const r = We();
630
630
  if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
631
631
  Rt(i, c);
632
632
  const s = ze(c);
@@ -634,8 +634,8 @@ async function ta(e = {}) {
634
634
  h,
635
635
  s.width
636
636
  );
637
- const _ = pt(
638
- u ?? Mt(
637
+ const b = st(
638
+ u ?? zt(
639
639
  i,
640
640
  r,
641
641
  t.position,
@@ -643,44 +643,44 @@ async function ta(e = {}) {
643
643
  ),
644
644
  s
645
645
  );
646
- u && (u = _), xt(_, r), ye(
646
+ u && (u = b), xt(b, r), Ce(
647
647
  "Applied open panel position after viewport resize",
648
- { openPanelPosition: _ }
648
+ { openPanelPosition: b }
649
649
  );
650
- } else p && ye(
650
+ } else p && Ce(
651
651
  "Applied visible launcher position after viewport resize",
652
652
  { visibleLauncherPosition: r }
653
653
  );
654
654
  };
655
655
  let cn = () => {
656
656
  };
657
- window.addEventListener("resize", dn), t.movableLauncher && z ? (He(), cn = ra({
657
+ window.addEventListener("resize", dn), t.movableLauncher && D ? (We(), cn = ra({
658
658
  root: i,
659
659
  launcher: v,
660
- launcherDragHandle: z,
661
- getPosition: () => Be(),
660
+ launcherDragHandle: D,
661
+ getPosition: () => Fe(),
662
662
  setPosition: (r) => {
663
- const s = r, _ = ct(i), L = Xt(
663
+ const s = r, b = ut(i), L = Xt(
664
664
  i,
665
665
  r,
666
- _
666
+ b
667
667
  );
668
668
  p = ca(
669
669
  L,
670
- _
671
- ), Ce(i, L), ye("Dragging closed launcher", {
670
+ b
671
+ ), Ee(i, L), Ce("Dragging closed launcher", {
672
672
  requestedPosition: s
673
673
  });
674
674
  },
675
675
  persist: () => {
676
- d = !0, U(), ye("Persisted closed launcher drag position");
676
+ d = !0, B(), Ce("Persisted closed launcher drag position");
677
677
  }
678
- })) : Ce(i, null), Rt(i, c);
678
+ })) : Ee(i, null), Rt(i, c);
679
679
  const Bo = () => {
680
- const r = ze(c), s = Be();
680
+ const r = ze(c), s = Fe();
681
681
  return {
682
- position: pt(
683
- u ?? Mt(
682
+ position: st(
683
+ u ?? zt(
684
684
  i,
685
685
  s,
686
686
  t.position,
@@ -691,21 +691,21 @@ async function ta(e = {}) {
691
691
  size: r
692
692
  };
693
693
  }, Fo = (r) => {
694
- c = gt(r.size), Rt(i, c), Bt(
694
+ c = ht(r.size), Rt(i, c), Bt(
695
695
  h,
696
696
  ze(c).width
697
- ), u = pt(
697
+ ), u = st(
698
698
  r.position,
699
699
  ze(c)
700
700
  );
701
- const s = Be();
701
+ const s = Fe();
702
702
  xt(u, s);
703
- }, Ho = P.length > 0 ? la({
703
+ }, Ho = A.length > 0 ? la({
704
704
  root: i,
705
- handles: P,
705
+ handles: A,
706
706
  getBounds: Bo,
707
707
  setBounds: Fo,
708
- persist: U
708
+ persist: B
709
709
  }) : () => {
710
710
  };
711
711
  let yt = !1;
@@ -717,67 +717,67 @@ async function ta(e = {}) {
717
717
  $n(
718
718
  t.billingStatus,
719
719
  r,
720
- y.getState().lastErrorCode
720
+ _.getState().lastErrorCode
721
721
  ) && (t.billingStatus = r, Ht(
722
- H,
722
+ Oe,
723
723
  t.billingStatus,
724
- y.getState().lastErrorCode
724
+ _.getState().lastErrorCode
725
725
  ), j());
726
726
  } finally {
727
727
  yt = !1;
728
728
  }
729
729
  }
730
- }, he = (r = "", s = !0) => {
731
- un(), Ge && (Ge = !1, Ct()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Fe("shown", !1), w.hidden = !1, T.hidden = !1, Bt(
730
+ }, fe = (r = "", s = !0) => {
731
+ un(), $e && ($e = !1, Ct()), i.classList.contains("pluno-pa-widget--open") || (u = null), X !== null && (window.clearTimeout(X), X = null), He("shown", !1), x.hidden = !1, I.hidden = !1, Bt(
732
732
  h,
733
733
  ze(c).width
734
734
  ), i.classList.remove("pluno-pa-widget--closing");
735
- const _ = He(), L = Mt(
735
+ const b = We(), L = zt(
736
736
  i,
737
- _,
737
+ b,
738
738
  t.position,
739
739
  c
740
740
  );
741
- if (xt(L, _), ye("Opening launcher at clamped open panel position", {
741
+ if (xt(L, b), Ce("Opening launcher at clamped open panel position", {
742
742
  openPanelPosition: L,
743
- visibleLauncherPosition: _
744
- }), ee(!0, "open"), te(), !s) {
745
- i.classList.add("pluno-pa-widget--open"), v.hidden = !0, r && (x.value = r, Ve(x)), Ke(A, () => be.enabled), _e = A.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), U(), Je("shown"), t.onPanelOpenChange?.(!0);
743
+ visibleLauncherPosition: b
744
+ }), Z(!0, "open"), J(), !s) {
745
+ i.classList.add("pluno-pa-widget--open"), v.hidden = !0, r && (y.value = r, Ke(y)), Ye(C, () => xe.enabled), ye = C.scrollTop, y.focus(), y.setSelectionRange(y.value.length, y.value.length), B(), Qe("shown"), t.onPanelOpenChange?.(!0);
746
746
  return;
747
747
  }
748
748
  window.requestAnimationFrame(() => {
749
- i.classList.add("pluno-pa-widget--open"), r && (x.value = r, Ve(x)), Ke(A, () => be.enabled), _e = A.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), U(), Je("shown"), t.onPanelOpenChange?.(!0), Z = window.setTimeout(() => {
750
- v.hidden = !0, Ke(A, () => be.enabled), _e = A.scrollTop;
749
+ i.classList.add("pluno-pa-widget--open"), r && (y.value = r, Ke(y)), Ye(C, () => xe.enabled), ye = C.scrollTop, y.focus(), y.setSelectionRange(y.value.length, y.value.length), B(), Qe("shown"), t.onPanelOpenChange?.(!0), X = window.setTimeout(() => {
750
+ v.hidden = !0, Ye(C, () => xe.enabled), ye = C.scrollTop;
751
751
  }, 220);
752
752
  });
753
753
  }, Wo = () => {
754
- Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (He(!1), ye("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), U(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
755
- w.hidden = !0, T.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
754
+ X !== null && (window.clearTimeout(X), X = null), v.hidden = !1, p && (We(!1), Ce("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), X = window.setTimeout(() => {
755
+ x.hidden = !0, I.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
756
756
  }, 220);
757
757
  };
758
758
  v.addEventListener("submit", (r) => {
759
- r.preventDefault(), he(b.value), b.value = "";
760
- }), z?.addEventListener("click", (r) => {
759
+ r.preventDefault(), fe(S.value), S.value = "";
760
+ }), D?.addEventListener("click", (r) => {
761
761
  r.preventDefault(), r.stopPropagation();
762
762
  }), v.addEventListener("click", (r) => {
763
- r.target === b && !z || (he(b.value), b.value = "");
764
- }), b.addEventListener("focus", () => {
765
- he(b.value), b.value = "";
766
- }), b.addEventListener("input", () => {
767
- if (!b.value)
763
+ r.target === S && !D || (fe(S.value), S.value = "");
764
+ }), S.addEventListener("focus", () => {
765
+ fe(S.value), S.value = "";
766
+ }), S.addEventListener("input", () => {
767
+ if (!S.value)
768
768
  return;
769
- const r = b.value;
770
- he(r), b.value = "";
769
+ const r = S.value;
770
+ fe(r), S.value = "";
771
771
  });
772
- let vt = null, Qe = null, ve = null;
773
- const gn = (r) => r === b || r === x, Go = (r) => {
772
+ let vt = null, et = null, Se = null;
773
+ const gn = (r) => r === S || r === y, Go = (r) => {
774
774
  if (!(r instanceof Element) || r.getRootNode() === i.getRootNode())
775
775
  return null;
776
776
  let s = r;
777
777
  for (; s; ) {
778
- const _ = s.closest(Pn);
779
- if (_)
780
- return _;
778
+ const b = s.closest(Pn);
779
+ if (b)
780
+ return b;
781
781
  const L = s.getRootNode();
782
782
  s = L instanceof ShadowRoot ? L.host : null;
783
783
  }
@@ -794,65 +794,65 @@ async function ta(e = {}) {
794
794
  const s = window.getComputedStyle(r);
795
795
  return s.display !== "none" && s.visibility !== "hidden";
796
796
  }, hn = (r) => {
797
- We !== r && (We = r, i.classList.toggle("pluno-pa-widget--host-modal-conflict", r !== null), tt(), r !== null ? ve = window.setInterval(() => {
798
- const s = We;
797
+ Ge !== r && (Ge = r, i.classList.toggle("pluno-pa-widget--host-modal-conflict", r !== null), nt(), r !== null ? Se = window.setInterval(() => {
798
+ const s = Ge;
799
799
  (!s || !$o(s)) && hn(null);
800
- }, Ui) : ve !== null && (window.clearInterval(ve), ve = null, Qe = null));
800
+ }, Ui) : Se !== null && (window.clearInterval(Se), Se = null, et = null));
801
801
  }, qo = () => {
802
- ve !== null && (window.clearInterval(ve), ve = null);
802
+ Se !== null && (window.clearInterval(Se), Se = null);
803
803
  };
804
804
  i.addEventListener("focusin", (r) => {
805
- gn(r.target) && (vt = Date.now(), U());
805
+ gn(r.target) && (vt = Date.now(), B());
806
806
  }), i.addEventListener("focusout", (r) => {
807
- if (!gn(r.target) || We !== null)
807
+ if (!gn(r.target) || Ge !== null)
808
808
  return;
809
809
  const s = vt;
810
- if (vt = null, s === null || Date.now() - s > Mi)
810
+ if (vt = null, s === null || Date.now() - s > zi)
811
811
  return;
812
- const _ = Go(r.relatedTarget);
813
- if (!_)
812
+ const b = Go(r.relatedTarget);
813
+ if (!b)
814
814
  return;
815
815
  const L = Date.now();
816
- if (Qe !== null && L - Qe <= Oi) {
817
- hn(_);
816
+ if (et !== null && L - et <= Oi) {
817
+ hn(b);
818
818
  return;
819
819
  }
820
- Qe = L;
820
+ et = L;
821
821
  }), v.addEventListener("keydown", (r) => {
822
- !i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(), he());
822
+ !i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(), fe());
823
823
  }), g?.addEventListener("pointerdown", (r) => {
824
824
  r.stopPropagation();
825
825
  }), g?.addEventListener("click", (r) => {
826
- r.preventDefault(), r.stopPropagation(), Fe("minimized");
827
- }), T.addEventListener("click", Wo), A.addEventListener("scroll", () => {
828
- A.scrollTop < _e - 1 && ee(!1, "userScroll"), _e = A.scrollTop;
829
- }), R.addEventListener("click", () => {
826
+ r.preventDefault(), r.stopPropagation(), He("minimized");
827
+ }), I.addEventListener("click", Wo), C.addEventListener("scroll", () => {
828
+ C.scrollTop < ye - 1 && Z(!1, "userScroll"), ye = C.scrollTop;
829
+ }), q.addEventListener("click", () => {
830
830
  Oo();
831
831
  });
832
832
  const mn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
833
833
  ([r]) => {
834
- r?.isIntersecting && (ee(!0, "bottom"), te());
834
+ r?.isIntersecting && (Z(!0, "bottom"), J());
835
835
  },
836
- { root: A, threshold: 0 }
836
+ { root: C, threshold: 0 }
837
837
  );
838
- mn?.observe(mt);
839
- const et = () => t.loginRequired || t.signupRequired;
840
- let We = null, Ge = !1;
841
- const tt = () => {
842
- const r = et(), s = We !== null;
843
- b.readOnly = r || s, x.readOnly = s, b.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ge ? "New update" : t.launcherLabel, x.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, k.hidden = r;
838
+ mn?.observe(re);
839
+ const tt = () => t.loginRequired || t.signupRequired;
840
+ let Ge = null, $e = !1;
841
+ const nt = () => {
842
+ const r = tt(), s = Ge !== null;
843
+ S.readOnly = r || s, y.readOnly = s, S.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : $e ? "New update" : t.launcherLabel, y.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ne.launcherLabel, R.hidden = r;
844
844
  }, j = () => {
845
- ce.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, Me.disabled = et() || ae(t.billingStatus);
845
+ ee.disabled = ie(t.billingStatus) || !_.getState().isThinking && y.value.trim().length === 0 && W.length === 0, ce.disabled = tt() || ie(t.billingStatus);
846
846
  };
847
- tt();
847
+ nt();
848
848
  const Ct = () => {
849
- const r = y.getState().isThinking;
849
+ const r = _.getState().isThinking;
850
850
  i.classList.toggle("pluno-pa-widget--thinking", r), i.classList.toggle(
851
851
  "pluno-pa-widget--unread",
852
- !r && Ge
853
- ), tt();
852
+ !r && $e
853
+ ), nt();
854
854
  };
855
- Ct(), k.addEventListener("submit", (r) => {
855
+ Ct(), R.addEventListener("submit", (r) => {
856
856
  if (r.preventDefault(), t.loginRequired) {
857
857
  t.onLoginClick?.();
858
858
  return;
@@ -861,158 +861,158 @@ async function ta(e = {}) {
861
861
  t.onSignupClick?.();
862
862
  return;
863
863
  }
864
- ae(t.billingStatus) || (we = !0, ee(!0, "send"), te(), W = Ut(
864
+ ie(t.billingStatus) || (ge = !0, Z(!0, "send"), J(), W = Ut(
865
+ _,
865
866
  y,
866
- x,
867
867
  W
868
- ), ke(), j());
868
+ ), Le(), j());
869
869
  });
870
- let $e = 0;
870
+ let qe = 0;
871
871
  const jo = () => {
872
- $e = 0, i.classList.remove("pluno-pa-widget--drag-over");
872
+ qe = 0, i.classList.remove("pluno-pa-widget--drag-over");
873
873
  }, St = (r) => {
874
- le !== null && window.clearTimeout(le), F.textContent = r, F.hidden = !1, le = window.setTimeout(() => {
875
- F.textContent = "", F.hidden = !0, le = null;
874
+ le !== null && window.clearTimeout(le), P.textContent = r, P.hidden = !1, le = window.setTimeout(() => {
875
+ P.textContent = "", P.hidden = !0, le = null;
876
876
  }, 3e3);
877
877
  }, Vo = () => {
878
- le !== null && (window.clearTimeout(le), le = null), F.textContent = "", F.hidden = !0;
878
+ le !== null && (window.clearTimeout(le), le = null), P.textContent = "", P.hidden = !0;
879
879
  }, Et = async (r) => {
880
880
  if (r.length === 0)
881
881
  return;
882
- const s = ja(y, r);
883
- W = [...W, ...s], ke(), Vo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || he();
882
+ const s = ja(_, r);
883
+ W = [...W, ...s], Le(), Vo(), j(), G(_.getState()), i.classList.contains("pluno-pa-widget--open") || fe();
884
884
  };
885
- Me.addEventListener("click", () => {
886
- t.loginRequired || ae(t.billingStatus) || Q.click();
887
- }), Q.addEventListener("change", () => {
888
- const r = Array.from(Q.files ?? []);
889
- Q.value = "", Et(r).catch((s) => {
885
+ ce.addEventListener("click", () => {
886
+ t.loginRequired || ie(t.billingStatus) || U.click();
887
+ }), U.addEventListener("change", () => {
888
+ const r = Array.from(U.files ?? []);
889
+ U.value = "", Et(r).catch((s) => {
890
890
  St(
891
891
  s instanceof Error ? s.message : "Failed to attach file"
892
- ), J("web-sdk.widget", "Attachment failed", {
892
+ ), Q("web-sdk.widget", "Attachment failed", {
893
893
  message: s instanceof Error ? s.message : String(s)
894
894
  });
895
895
  });
896
896
  }), i.addEventListener("dragenter", (r) => {
897
- !at(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), $e += 1, i.classList.add("pluno-pa-widget--drag-over"));
897
+ !rt(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), qe += 1, i.classList.add("pluno-pa-widget--drag-over"));
898
898
  }), i.addEventListener("dragover", (r) => {
899
899
  const s = r.dataTransfer;
900
- !at(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
900
+ !rt(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
901
901
  }), i.addEventListener("dragleave", (r) => {
902
- at(r.dataTransfer) && (r.stopPropagation(), $e = Math.max(0, $e - 1), $e === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
902
+ rt(r.dataTransfer) && (r.stopPropagation(), qe = Math.max(0, qe - 1), qe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
903
903
  }), i.addEventListener("drop", (r) => {
904
904
  const s = r.dataTransfer;
905
- !at(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), jo(), Et(s.files).catch((_) => {
905
+ !rt(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), jo(), Et(s.files).catch((b) => {
906
906
  St(
907
- _ instanceof Error ? _.message : "Failed to attach file"
908
- ), J("web-sdk.widget", "Attachment failed", {
909
- message: _ instanceof Error ? _.message : String(_)
907
+ b instanceof Error ? b.message : "Failed to attach file"
908
+ ), Q("web-sdk.widget", "Attachment failed", {
909
+ message: b instanceof Error ? b.message : String(b)
910
910
  });
911
911
  }));
912
912
  }), i.addEventListener("paste", (r) => {
913
913
  r.stopPropagation();
914
- const s = r.clipboardData, _ = Array.from(s?.files ?? []);
915
- _.length === 0 || t.loginRequired || (r.preventDefault(), Et(_).catch((L) => {
914
+ const s = r.clipboardData, b = Array.from(s?.files ?? []);
915
+ b.length === 0 || t.loginRequired || (r.preventDefault(), Et(b).catch((L) => {
916
916
  St(
917
917
  L instanceof Error ? L.message : "Failed to attach file"
918
- ), J("web-sdk.widget", "Attachment failed", {
918
+ ), Q("web-sdk.widget", "Attachment failed", {
919
919
  message: L instanceof Error ? L.message : String(L)
920
920
  });
921
921
  }));
922
- }), ce.addEventListener("click", () => {
922
+ }), ee.addEventListener("click", () => {
923
923
  if (t.loginRequired) {
924
924
  t.onLoginClick?.();
925
925
  return;
926
926
  }
927
- if (y.getState().isThinking) {
928
- y.stop();
927
+ if (_.getState().isThinking) {
928
+ _.stop();
929
929
  return;
930
930
  }
931
- we = !0, ee(!0, "send"), te(), W = Ut(
931
+ ge = !0, Z(!0, "send"), J(), W = Ut(
932
+ _,
932
933
  y,
933
- x,
934
934
  W
935
- ), ke(), j(), G(y.getState());
936
- }), X.addEventListener("click", () => {
937
- ue = !ue, Ue = null, xe(), ue && ge.length === 0 && ln(null);
938
- }), Ee.addEventListener("click", () => {
939
- ue = !1, xe();
940
- }), N.addEventListener("scroll", Uo), x.addEventListener("input", () => {
941
- Ve(x), U(), j(), Xo();
942
- }), x.addEventListener("keydown", (r) => {
935
+ ), Le(), j(), G(_.getState());
936
+ }), _e.addEventListener("click", () => {
937
+ he = !he, Be = null, ve(), he && me.length === 0 && ln(null);
938
+ }), z.addEventListener("click", () => {
939
+ he = !1, ve();
940
+ }), w.addEventListener("scroll", Uo), y.addEventListener("input", () => {
941
+ Ke(y), B(), j(), Xo();
942
+ }), y.addEventListener("keydown", (r) => {
943
943
  if (!(r.key !== "Enter" || r.shiftKey)) {
944
944
  if (r.preventDefault(), t.loginRequired) {
945
945
  t.onLoginClick?.();
946
946
  return;
947
947
  }
948
- we = !0, ee(!0, "send"), te(), W = Ut(
948
+ ge = !0, Z(!0, "send"), J(), W = Ut(
949
+ _,
949
950
  y,
950
- x,
951
951
  W
952
- ), ke(), j(), G(y.getState());
952
+ ), Le(), j(), G(_.getState());
953
953
  }
954
954
  }), i.addEventListener("click", (r) => {
955
- (r.target instanceof Element ? r.target : null)?.closest("a[href]") && U();
956
- }), l.composerValue && (x.value = l.composerValue, Ve(x)), t.initialDisplayState === "minimized" ? Fe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && he(x.value, !1), wa(l, i, b, x);
957
- const nt = () => a;
958
- let kt = y.getState().appearance !== null, ot = null, qe = null, Ie = null, fn = y.getState().isThinking, Te = null;
959
- const je = t.taskNotifications;
960
- let Ae = null, Ne = !1;
955
+ (r.target instanceof Element ? r.target : null)?.closest("a[href]") && B();
956
+ }), l.composerValue && (y.value = l.composerValue, Ke(y)), t.initialDisplayState === "minimized" ? He("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(y.value, !1), wa(l, i, S, y);
957
+ const ot = () => a;
958
+ let kt = _.getState().appearance !== null, it = null, je = null, Te = null, fn = _.getState().isThinking, Ae = null;
959
+ const Ve = t.taskNotifications;
960
+ let Ne = null, De = !1;
961
961
  const wn = () => {
962
- Ae !== null && (window.clearTimeout(Ae), Ae = null);
963
- }, it = () => {
964
- Oe && (Oe.hidden = !0);
965
- }, bn = () => y.getState().assistantDraft.trim().length > 0, Ko = async () => {
966
- if (!je || !Oe || Ne || Pe || !y.getState().isThinking || bn())
962
+ Ne !== null && (window.clearTimeout(Ne), Ne = null);
963
+ }, at = () => {
964
+ Ue && (Ue.hidden = !0);
965
+ }, bn = () => _.getState().assistantDraft.trim().length > 0, Ko = async () => {
966
+ if (!Ve || !Ue || De || Ie || !_.getState().isThinking || bn())
967
967
  return;
968
968
  let r;
969
969
  try {
970
- r = await je.getState();
970
+ r = await Ve.getState();
971
971
  } catch {
972
972
  return;
973
973
  }
974
- r.enabled || r.neverSuggest || !y.getState().isThinking || bn() || Ne || Pe || (Oe.hidden = !1);
974
+ r.enabled || r.neverSuggest || !_.getState().isThinking || bn() || De || Ie || (Ue.hidden = !1);
975
975
  };
976
976
  Ao?.addEventListener("click", () => {
977
- Ne = !0, it(), je?.enable().catch(() => {
977
+ De = !0, at(), Ve?.enable().catch(() => {
978
978
  });
979
979
  }), No?.addEventListener("click", () => {
980
- Ne = !0, it();
980
+ De = !0, at();
981
981
  }), Do?.addEventListener("click", () => {
982
- Ne = !0, it(), je?.dismissForever().catch(() => {
982
+ De = !0, at(), Ve?.dismissForever().catch(() => {
983
983
  });
984
984
  });
985
- let De = null, _n = () => {
985
+ let Re = null, _n = () => {
986
986
  };
987
- const Yo = !!t.socialPostDraftHandler, Lt = /* @__PURE__ */ new Map(), Pt = () => x.value.trim().length > 0 || W.length > 0, Xo = () => {
988
- const r = De !== null && Wt(y.getState(), Pt());
989
- D.hidden = !r, r && De !== null && fo(D, De);
987
+ const Yo = !!t.socialPostDraftHandler, Lt = /* @__PURE__ */ new Map(), Pt = () => y.value.trim().length > 0 || W.length > 0, Xo = () => {
988
+ const r = Re !== null && Wt(_.getState(), Pt());
989
+ N.hidden = !r, r && Re !== null && fo(N, Re);
990
990
  };
991
- let Re = null;
991
+ let Me = null;
992
992
  const xn = (r = {}) => {
993
- we = !0, ee(!0, "newSession"), te(), ue = !1, xe(), y.startNewSession(r), wt.clear(), x.value = "", W = [], ke(), Ve(x), U(), j(), x.focus(), G(y.getState());
993
+ ge = !0, Z(!0, "newSession"), J(), he = !1, ve(), _.startNewSession(r), wt.clear(), y.value = "", W = [], Le(), Ke(y), B(), j(), y.focus(), G(_.getState());
994
994
  }, It = (r) => {
995
995
  if (!r) {
996
- Re?.remove(), Re = null;
996
+ Me?.remove(), Me = null;
997
997
  return;
998
998
  }
999
- Re || (Re = ht(
999
+ Me || (Me = mt(
1000
1000
  "pluno-pa-widget__new-chat",
1001
1001
  "New chat",
1002
- za(),
1002
+ Ma(),
1003
1003
  !1
1004
- ), Re.addEventListener("click", () => xn()), Xe.insertBefore(Re, X));
1004
+ ), Me.addEventListener("click", () => xn()), Ze.insertBefore(Me, _e));
1005
1005
  }, G = (r) => {
1006
- if (xe(), an(r.lastErrorCode) ? Te = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Te = null), Ht(
1007
- H,
1006
+ if (ve(), an(r.lastErrorCode) ? Ae = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ie(t.billingStatus) && (Ae = null), Ht(
1007
+ Oe,
1008
1008
  t.billingStatus,
1009
- Te
1009
+ Ae
1010
1010
  ), t.loginRequired) {
1011
1011
  Lt.clear(), Kn(
1012
- A,
1013
- ce,
1012
+ C,
1013
+ ee,
1014
1014
  It,
1015
- nt,
1015
+ ot,
1016
1016
  "Log in to use Pluno on this page.",
1017
1017
  t.loginButtonLabel,
1018
1018
  t.loginUrl,
@@ -1022,10 +1022,10 @@ async function ta(e = {}) {
1022
1022
  }
1023
1023
  if (t.signupRequired) {
1024
1024
  Lt.clear(), Kn(
1025
- A,
1026
- ce,
1025
+ C,
1026
+ ee,
1027
1027
  It,
1028
- nt,
1028
+ ot,
1029
1029
  "Complete signup to unlock your free trial credits.",
1030
1030
  t.signupButtonLabel,
1031
1031
  t.signupUrl,
@@ -1033,67 +1033,70 @@ async function ta(e = {}) {
1033
1033
  );
1034
1034
  return;
1035
1035
  }
1036
- const s = _a(r), _ = s !== rn;
1036
+ const s = _a(r), b = s !== rn;
1037
1037
  rn = s;
1038
- const L = we || be.enabled;
1039
- we = !1, Qa(
1040
- A,
1041
- mt,
1042
- ce,
1038
+ const L = ge || xe.enabled;
1039
+ ge = !1, Qa(
1040
+ C,
1041
+ re,
1042
+ ee,
1043
1043
  It,
1044
- D,
1044
+ N,
1045
1045
  r,
1046
- De,
1047
- De !== null && Wt(r, Pt()),
1046
+ Re,
1047
+ Re !== null && Wt(r, Pt()),
1048
1048
  L,
1049
- () => be.enabled,
1049
+ () => xe.enabled,
1050
1050
  wt,
1051
1051
  Lt,
1052
- U,
1053
- nt,
1052
+ B,
1053
+ ot,
1054
1054
  (M) => {
1055
- we = !0, ee(!0, "send"), te(), y.sendMessage(M);
1055
+ ge = !0, Z(!0, "send"), J(), _.sendMessage(M);
1056
+ },
1057
+ () => {
1058
+ ge = !0, Z(!0, "send"), J(), _.retryLastMessage();
1056
1059
  },
1057
1060
  Yo && !bt ? {
1058
- dismissedCandidateIds: Ze,
1059
- draftingCandidateId: ot,
1060
- error: qe,
1061
- characterIconOptions: nt(),
1061
+ dismissedCandidateIds: Je,
1062
+ draftingCandidateId: it,
1063
+ error: je,
1064
+ characterIconOptions: ot(),
1062
1065
  onSeen: (M) => {
1063
- Le.add(M.id), U();
1066
+ Pe.add(M.id), B();
1064
1067
  },
1065
1068
  onDraft: (M) => {
1066
1069
  Zo(M);
1067
1070
  },
1068
1071
  onDismiss: (M) => {
1069
- Le.add(M.id), Ze.add(M.id), U(), qe = null, G(y.getState());
1072
+ Pe.add(M.id), Je.add(M.id), B(), je = null, G(_.getState());
1070
1073
  },
1071
1074
  onDisable: (M) => {
1072
- bt = !0, Le.add(M.id), Ze.add(M.id), U(), Cr(t, !0), qe = null, G(y.getState());
1075
+ bt = !0, Pe.add(M.id), Je.add(M.id), B(), Cr(t, !0), je = null, G(_.getState());
1073
1076
  }
1074
1077
  } : void 0
1075
- ), L ? (_e = A.scrollTop, te()) : _ && xa(r) && Mo();
1078
+ ), L ? (ye = C.scrollTop, J()) : b && xa(r) && zo();
1076
1079
  };
1077
1080
  return _n = fi(
1078
1081
  (r) => {
1079
- De = r, !Pe && Wt(y.getState(), Pt()) && G(y.getState());
1082
+ Re = r, !Ie && Wt(_.getState(), Pt()) && G(_.getState());
1080
1083
  },
1081
1084
  {
1082
1085
  backendUrl: t.backendUrl,
1083
- fetcher: zo,
1086
+ fetcher: Mo,
1084
1087
  loader: t.activeUsersLoader
1085
1088
  }
1086
- ), y.on("state", (r) => {
1089
+ ), _.on("state", (r) => {
1087
1090
  const s = fn && !r.isThinking;
1088
- fn = r.isThinking, r.isThinking && !r.assistantDraft.trim() && je && !Ne && Ae === null && Oe?.hidden !== !1 && (Ae = window.setTimeout(() => {
1089
- Ae = null, Ko();
1090
- }, yi)), (!r.isThinking || r.assistantDraft.trim()) && (wn(), it()), s && !i.classList.contains("pluno-pa-widget--open") && (Ge = !0), Ct(), r.appearance ? (kt = !0, J(
1091
+ fn = r.isThinking, r.isThinking && !r.assistantDraft.trim() && Ve && !De && Ne === null && Ue?.hidden !== !1 && (Ne = window.setTimeout(() => {
1092
+ Ne = null, Ko();
1093
+ }, yi)), (!r.isThinking || r.assistantDraft.trim()) && (wn(), at()), s && !i.classList.contains("pluno-pa-widget--open") && ($e = !0), Ct(), r.appearance ? (kt = !0, Q(
1091
1094
  "web-sdk.widget",
1092
1095
  "Agent state supplied appearance",
1093
1096
  {
1094
1097
  appearance: r.appearance
1095
1098
  }
1096
- ), Tt(r.appearance, "agent.state.appearance")) : kt && (kt = !1, J(
1099
+ ), Tt(r.appearance, "agent.state.appearance")) : kt && (kt = !1, Q(
1097
1100
  "web-sdk.widget",
1098
1101
  "Agent state cleared appearance; reverting to configured widget options",
1099
1102
  {
@@ -1102,8 +1105,8 @@ async function ta(e = {}) {
1102
1105
  fallbackFontFamily: t.fontFamily
1103
1106
  }
1104
1107
  ), Tt({}, "agent.state.appearance-cleared")), G(r), j(), s && un();
1105
- }), G(y.getState()), j(), {
1106
- agent: y,
1108
+ }), G(_.getState()), j(), {
1109
+ agent: _,
1107
1110
  startNewChat: xn,
1108
1111
  host: n,
1109
1112
  updateAppearance: (r) => {
@@ -1114,75 +1117,75 @@ async function ta(e = {}) {
1114
1117
  $n(
1115
1118
  t.billingStatus,
1116
1119
  s,
1117
- Te
1118
- ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Te = null), Ht(
1120
+ Ae
1121
+ ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !ie(t.billingStatus) && (Ae = null), Ht(
1119
1122
  i.querySelector(".pluno-pa-widget__billing-status"),
1120
1123
  t.billingStatus,
1121
- Te
1124
+ Ae
1122
1125
  ), j());
1123
1126
  },
1124
1127
  updateAuthGate: (r) => {
1125
- const s = et();
1126
- t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl), tt(), G(y.getState()), j(), s && !et() && y.connect().catch((_) => {
1127
- J(
1128
+ const s = tt();
1129
+ t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl), nt(), G(_.getState()), j(), s && !tt() && _.connect().catch((b) => {
1130
+ Q(
1128
1131
  "web-sdk.widget",
1129
1132
  "Failed to connect after auth gate cleared",
1130
1133
  {
1131
- message: _ instanceof Error ? _.message : String(_)
1134
+ message: b instanceof Error ? b.message : String(b)
1132
1135
  }
1133
1136
  );
1134
1137
  });
1135
1138
  },
1136
1139
  openPanel: () => {
1137
- he(x.value, !1);
1140
+ fe(y.value, !1);
1138
1141
  },
1139
1142
  updateDisplayState: (r) => {
1140
1143
  if (r === "shown") {
1141
- Fe("shown", !1);
1144
+ He("shown", !1);
1142
1145
  return;
1143
1146
  }
1144
- Fe("minimized", !1);
1147
+ He("minimized", !1);
1145
1148
  },
1146
1149
  destroy: () => {
1147
- Pe || (U(), Pe = !0, sn.disconnect(), mn?.disconnect(), qo(), window.removeEventListener("resize", dn), cn(), Ho(), le !== null && window.clearTimeout(le), wn(), _n(), Ie?.remove(), y.destroy(), ft.release(), n.remove());
1150
+ Ie || (B(), Ie = !0, sn.disconnect(), mn?.disconnect(), qo(), window.removeEventListener("resize", dn), cn(), Ho(), le !== null && window.clearTimeout(le), wn(), _n(), Te?.remove(), _.destroy(), ft.release(), n.remove());
1148
1151
  }
1149
1152
  };
1150
1153
  async function Zo(r) {
1151
- if (!ot) {
1152
- ot = r.id, qe = null, G(y.getState());
1154
+ if (!it) {
1155
+ it = r.id, je = null, G(_.getState());
1153
1156
  try {
1154
1157
  if (!t.socialPostDraftHandler)
1155
1158
  throw new Error("Social post drafting is not available here.");
1156
1159
  const s = await t.socialPostDraftHandler(r);
1157
1160
  if (!s.linkedinPost || !s.xPost)
1158
1161
  throw new Error("Pluno did not return a complete social post draft.");
1159
- Le.add(r.id), Ze.add(r.id), U(), Ie?.remove(), Ie = lr(s, {
1162
+ Pe.add(r.id), Je.add(r.id), B(), Te?.remove(), Te = lr(s, {
1160
1163
  socialPostRewardsUrl: t.socialPostRewardsUrl,
1161
1164
  onClose: () => {
1162
- Ie?.remove(), Ie = null;
1165
+ Te?.remove(), Te = null;
1163
1166
  }
1164
- }), i.appendChild(Ie);
1167
+ }), i.appendChild(Te);
1165
1168
  } catch (s) {
1166
- qe = s instanceof Error ? s.message : "Could not draft social post.";
1169
+ je = s instanceof Error ? s.message : "Could not draft social post.";
1167
1170
  } finally {
1168
- ot = null, G(y.getState());
1171
+ it = null, G(_.getState());
1169
1172
  }
1170
1173
  }
1171
1174
  }
1172
1175
  function Tt(r, s) {
1173
- const _ = r.accentColor ?? t.accentColor, L = r.colorScheme ?? t.colorScheme, M = r.fontFamily ?? t.fontFamily, At = r.scribbleStyle ?? t.scribbleStyle;
1176
+ const b = r.accentColor ?? t.accentColor, L = r.colorScheme ?? t.colorScheme, M = r.fontFamily ?? t.fontFamily, At = r.scribbleStyle ?? t.scribbleStyle;
1174
1177
  a = Rn(
1175
- _,
1178
+ b,
1176
1179
  At
1177
- ), zn(i, a, {
1178
- accentColor: _,
1180
+ ), Mn(i, a, {
1181
+ accentColor: b,
1179
1182
  colorScheme: L,
1180
1183
  fontFamily: M,
1181
1184
  scribbleStyle: At
1182
- }), J("web-sdk.widget", "Updated widget appearance", {
1185
+ }), Q("web-sdk.widget", "Updated widget appearance", {
1183
1186
  source: s,
1184
1187
  inputAppearance: r,
1185
- appliedAccentColor: _,
1188
+ appliedAccentColor: b,
1186
1189
  appliedColorScheme: L,
1187
1190
  appliedFontFamily: M,
1188
1191
  appliedScribbleStyle: At,
@@ -1216,7 +1219,7 @@ function ia([e, t, n]) {
1216
1219
  };
1217
1220
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
1218
1221
  }
1219
- function zn(e, t, n) {
1222
+ function Mn(e, t, n) {
1220
1223
  e.classList.toggle(
1221
1224
  "pluno-pa-widget--dark",
1222
1225
  n.colorScheme === "dark"
@@ -1234,7 +1237,7 @@ function zn(e, t, n) {
1234
1237
  );
1235
1238
  for (const a of i)
1236
1239
  a.replaceWith(
1237
- fe(
1240
+ be(
1238
1241
  Array.from(a.classList).join(" "),
1239
1242
  t
1240
1243
  )
@@ -1263,35 +1266,35 @@ function ra({
1263
1266
  let l = null, p = null, d = null, c = !1, u = null;
1264
1267
  const m = () => {
1265
1268
  l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1266
- }, E = (h) => {
1269
+ }, k = (h) => {
1267
1270
  e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d = o(), c = !1, t.setPointerCapture?.(h.pointerId));
1268
1271
  }, v = (h) => {
1269
1272
  if (l !== h.pointerId || !p || !d)
1270
1273
  return;
1271
1274
  h.preventDefault();
1272
- const P = h.clientX - p.x, T = h.clientY - p.y;
1273
- !c && Math.hypot(P, T) < Yt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + P, y: d.y + T }));
1274
- }, z = (h) => {
1275
+ const A = h.clientX - p.x, I = h.clientY - p.y;
1276
+ !c && Math.hypot(A, I) < Yt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + A, y: d.y + I }));
1277
+ }, D = (h) => {
1275
1278
  l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, a()), m());
1276
- }, b = (h) => {
1279
+ }, S = (h) => {
1277
1280
  l === h.pointerId && (h.preventDefault(), m());
1278
1281
  }, g = (h) => {
1279
1282
  if (!u)
1280
1283
  return;
1281
- const P = Math.hypot(
1284
+ const A = Math.hypot(
1282
1285
  h.clientX - u.x,
1283
1286
  h.clientY - u.y
1284
1287
  ) <= Yt;
1285
- u = null, P && (h.preventDefault(), h.stopPropagation());
1286
- }, w = (h) => {
1288
+ u = null, A && (h.preventDefault(), h.stopPropagation());
1289
+ }, x = (h) => {
1287
1290
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1288
1291
  return;
1289
- const P = h.shiftKey ? co : so, T = o();
1290
- let k = null;
1291
- h.key === "ArrowUp" ? k = { x: T.x, y: T.y - P } : h.key === "ArrowDown" ? k = { x: T.x, y: T.y + P } : h.key === "ArrowLeft" ? k = { x: T.x - P, y: T.y } : h.key === "ArrowRight" && (k = { x: T.x + P, y: T.y }), k && (h.preventDefault(), h.stopPropagation(), i(k), a());
1292
+ const A = h.shiftKey ? co : so, I = o();
1293
+ let R = null;
1294
+ h.key === "ArrowUp" ? R = { x: I.x, y: I.y - A } : h.key === "ArrowDown" ? R = { x: I.x, y: I.y + A } : h.key === "ArrowLeft" ? R = { x: I.x - A, y: I.y } : h.key === "ArrowRight" && (R = { x: I.x + A, y: I.y }), R && (h.preventDefault(), h.stopPropagation(), i(R), a());
1292
1295
  };
1293
- return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", v), t.addEventListener("pointerup", z), t.addEventListener("pointercancel", b), t.addEventListener("click", g, !0), n.addEventListener("keydown", w), () => {
1294
- t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", z), t.removeEventListener("pointercancel", b), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", w);
1296
+ return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", D), t.addEventListener("pointercancel", S), t.addEventListener("click", g, !0), n.addEventListener("keydown", x), () => {
1297
+ t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", D), t.removeEventListener("pointercancel", S), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", x);
1295
1298
  };
1296
1299
  }
1297
1300
  function la({
@@ -1305,33 +1308,33 @@ function la({
1305
1308
  const u = () => {
1306
1309
  a = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1307
1310
  }, m = (g) => {
1308
- const w = g.currentTarget, h = w.dataset.resizeDirection;
1309
- !e.classList.contains("pluno-pa-widget--open") || !Mn(h) || (g.preventDefault(), g.stopPropagation(), a = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, w.setPointerCapture?.(g.pointerId));
1310
- }, E = (g) => {
1311
+ const x = g.currentTarget, h = x.dataset.resizeDirection;
1312
+ !e.classList.contains("pluno-pa-widget--open") || !zn(h) || (g.preventDefault(), g.stopPropagation(), a = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, x.setPointerCapture?.(g.pointerId));
1313
+ }, k = (g) => {
1311
1314
  if (a !== g.pointerId || !l || !p || !d)
1312
1315
  return;
1313
1316
  g.preventDefault(), g.stopPropagation();
1314
- const w = g.clientX - p.x, h = g.clientY - p.y;
1315
- !c && Math.hypot(w, h) < Yt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1316
- On(d, l, w, h)
1317
+ const x = g.clientX - p.x, h = g.clientY - p.y;
1318
+ !c && Math.hypot(x, h) < Yt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1319
+ On(d, l, x, h)
1317
1320
  ));
1318
1321
  }, v = (g) => {
1319
1322
  a === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
1320
- }, z = (g) => {
1323
+ }, D = (g) => {
1321
1324
  a === g.pointerId && (g.preventDefault(), u());
1322
- }, b = (g) => {
1323
- const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? co : so, T = n();
1324
- let k = 0, F = 0;
1325
- Mn(h) && (g.key === "ArrowLeft" ? k = -P : g.key === "ArrowRight" ? k = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(k === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(On(T, h, k, F)), i()));
1325
+ }, S = (g) => {
1326
+ const h = g.currentTarget.dataset.resizeDirection, A = g.shiftKey ? co : so, I = n();
1327
+ let R = 0, P = 0;
1328
+ zn(h) && (g.key === "ArrowLeft" ? R = -A : g.key === "ArrowRight" ? R = A : g.key === "ArrowUp" ? P = -A : g.key === "ArrowDown" && (P = A), !(R === 0 && P === 0) && (g.preventDefault(), g.stopPropagation(), o(On(I, h, R, P)), i()));
1326
1329
  };
1327
1330
  for (const g of t)
1328
- g.addEventListener("pointerdown", m), g.addEventListener("pointermove", E), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", z), g.addEventListener("keydown", b);
1331
+ g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", D), g.addEventListener("keydown", S);
1329
1332
  return () => {
1330
1333
  for (const g of t)
1331
- g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", E), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", z), g.removeEventListener("keydown", b);
1334
+ g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", D), g.removeEventListener("keydown", S);
1332
1335
  };
1333
1336
  }
1334
- function Mn(e) {
1337
+ function zn(e) {
1335
1338
  return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
1336
1339
  }
1337
1340
  function On(e, t, n, o) {
@@ -1341,11 +1344,11 @@ function On(e, t, n, o) {
1341
1344
  delta: n,
1342
1345
  resizeLeading: t.endsWith("left") || t === "left",
1343
1346
  resizeTrailing: t.endsWith("right") || t === "right",
1344
- minLeading: I,
1345
- maxTrailing: i.width - I,
1347
+ minLeading: T,
1348
+ maxTrailing: i.width - T,
1346
1349
  minLength: Math.min(
1347
1350
  tn,
1348
- i.width - I * 2
1351
+ i.width - T * 2
1349
1352
  )
1350
1353
  }), l = Un({
1351
1354
  leading: e.position.y,
@@ -1353,11 +1356,11 @@ function On(e, t, n, o) {
1353
1356
  delta: o,
1354
1357
  resizeLeading: t.startsWith("top") || t === "top",
1355
1358
  resizeTrailing: t.startsWith("bottom") || t === "bottom",
1356
- minLeading: Se,
1357
- maxTrailing: i.height - I,
1359
+ minLeading: ke,
1360
+ maxTrailing: i.height - T,
1358
1361
  minLength: Math.min(
1359
1362
  nn,
1360
- i.height - Se - I
1363
+ i.height - ke - T
1361
1364
  )
1362
1365
  });
1363
1366
  return {
@@ -1408,7 +1411,7 @@ function Un({
1408
1411
  }
1409
1412
  return { leading: e, length: t };
1410
1413
  }
1411
- function ct(e, t = !0) {
1414
+ function ut(e, t = !0) {
1412
1415
  const n = Y();
1413
1416
  if (e.classList.contains("pluno-pa-widget--minimized"))
1414
1417
  return e.classList.contains("pluno-pa-widget--scribble") ? {
@@ -1430,7 +1433,7 @@ function pa() {
1430
1433
  tn,
1431
1434
  qi
1432
1435
  ),
1433
- e.width - I * 2
1436
+ e.width - T * 2
1434
1437
  ),
1435
1438
  height: Math.min(
1436
1439
  K(
@@ -1438,36 +1441,36 @@ function pa() {
1438
1441
  nn,
1439
1442
  Vi
1440
1443
  ),
1441
- e.height - Se - I
1444
+ e.height - ke - T
1442
1445
  )
1443
1446
  };
1444
1447
  }
1445
1448
  function ze(e = null) {
1446
- return e ? gt(e) : pa();
1449
+ return e ? ht(e) : pa();
1447
1450
  }
1448
- function gt(e) {
1451
+ function ht(e) {
1449
1452
  const t = Y();
1450
1453
  return {
1451
1454
  width: K(
1452
1455
  e.width,
1453
1456
  Math.min(
1454
1457
  tn,
1455
- t.width - I * 2
1458
+ t.width - T * 2
1456
1459
  ),
1457
1460
  Math.max(
1458
- I,
1459
- t.width - I * 2
1461
+ T,
1462
+ t.width - T * 2
1460
1463
  )
1461
1464
  ),
1462
1465
  height: K(
1463
1466
  e.height,
1464
1467
  Math.min(
1465
1468
  nn,
1466
- t.height - Se - I
1469
+ t.height - ke - T
1467
1470
  ),
1468
1471
  Math.max(
1469
- I,
1470
- t.height - Se - I
1472
+ T,
1473
+ t.height - ke - T
1471
1474
  )
1472
1475
  )
1473
1476
  };
@@ -1477,7 +1480,7 @@ function Rt(e, t) {
1477
1480
  e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
1478
1481
  return;
1479
1482
  }
1480
- const n = gt(t);
1483
+ const n = ht(t);
1481
1484
  e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
1482
1485
  }
1483
1486
  function sa(e, t, n) {
@@ -1493,8 +1496,8 @@ function sa(e, t, n) {
1493
1496
  y: l.height - 24 - n.height
1494
1497
  };
1495
1498
  }
1496
- function zt(e, t, n) {
1497
- const o = ct(e, !1);
1499
+ function Mt(e, t, n) {
1500
+ const o = ut(e, !1);
1498
1501
  return t ? Xt(
1499
1502
  e,
1500
1503
  ho(t, o),
@@ -1509,14 +1512,14 @@ function da(e, t, n) {
1509
1512
  };
1510
1513
  }
1511
1514
  function Xt(e, t, n) {
1512
- const o = Y(), i = I + ga(e);
1515
+ const o = Y(), i = T + ga(e);
1513
1516
  return {
1514
1517
  x: K(
1515
1518
  t.x,
1516
- I,
1519
+ T,
1517
1520
  Math.max(
1518
- I,
1519
- o.width - n.width - I
1521
+ T,
1522
+ o.width - n.width - T
1520
1523
  )
1521
1524
  ),
1522
1525
  y: K(
@@ -1524,7 +1527,7 @@ function Xt(e, t, n) {
1524
1527
  i,
1525
1528
  Math.max(
1526
1529
  i,
1527
- o.height - n.height - I
1530
+ o.height - n.height - T
1528
1531
  )
1529
1532
  )
1530
1533
  };
@@ -1551,35 +1554,35 @@ function ua(e, t) {
1551
1554
  function ga(e) {
1552
1555
  return e.classList.contains("pluno-pa-widget--scribble") ? Ji : Zi;
1553
1556
  }
1554
- function Mt(e, t, n, o = null) {
1555
- const i = ct(e), a = ze(o), l = {
1557
+ function zt(e, t, n, o = null) {
1558
+ const i = ut(e), a = ze(o), l = {
1556
1559
  x: n === "bottom-left" ? t.x : t.x + i.width - a.width,
1557
1560
  y: t.y + i.height - a.height
1558
1561
  };
1559
- return pt(l, a);
1562
+ return st(l, a);
1560
1563
  }
1561
- function pt(e, t) {
1564
+ function st(e, t) {
1562
1565
  const n = Y();
1563
1566
  return {
1564
1567
  x: K(
1565
1568
  e.x,
1566
- I,
1569
+ T,
1567
1570
  Math.max(
1568
- I,
1569
- n.width - t.width - I
1571
+ T,
1572
+ n.width - t.width - T
1570
1573
  )
1571
1574
  ),
1572
1575
  y: K(
1573
1576
  e.y,
1574
- Se,
1577
+ ke,
1575
1578
  Math.max(
1576
- Se,
1577
- n.height - t.height - I
1579
+ ke,
1580
+ n.height - t.height - T
1578
1581
  )
1579
1582
  )
1580
1583
  };
1581
1584
  }
1582
- function Ce(e, t) {
1585
+ function Ee(e, t) {
1583
1586
  if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
1584
1587
  e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
1585
1588
  return;
@@ -1594,8 +1597,8 @@ function Bn(e) {
1594
1597
  }
1595
1598
  function Y() {
1596
1599
  return {
1597
- width: window.innerWidth || document.documentElement.clientWidth || ro + I * 2,
1598
- height: window.innerHeight || document.documentElement.clientHeight || lo + I * 2
1600
+ width: window.innerWidth || document.documentElement.clientWidth || ro + T * 2,
1601
+ height: window.innerHeight || document.documentElement.clientHeight || lo + T * 2
1599
1602
  };
1600
1603
  }
1601
1604
  function Ot(e) {
@@ -1610,7 +1613,7 @@ function Ot(e) {
1610
1613
  function K(e, t, n) {
1611
1614
  return Math.min(Math.max(e, t), n);
1612
1615
  }
1613
- function J(e, t, n) {
1616
+ function Q(e, t, n) {
1614
1617
  if (typeof window > "u")
1615
1618
  return;
1616
1619
  const o = window, i = {
@@ -1624,7 +1627,7 @@ function J(e, t, n) {
1624
1627
  );
1625
1628
  }
1626
1629
  function ma(e, t) {
1627
- J("web-sdk.widget.position", e, t);
1630
+ Q("web-sdk.widget.position", e, t);
1628
1631
  }
1629
1632
  function Ut(e, t, n) {
1630
1633
  const o = t.value.trim();
@@ -1647,12 +1650,12 @@ function wa(e, t, n, o) {
1647
1650
  function ba(e) {
1648
1651
  return e;
1649
1652
  }
1650
- function Ve(e) {
1653
+ function Ke(e) {
1651
1654
  e.style.height = "0px";
1652
1655
  const t = Math.max(22, Math.min(e.scrollHeight, 140));
1653
1656
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
1654
1657
  }
1655
- function Ke(e, t = () => !0) {
1658
+ function Ye(e, t = () => !0) {
1656
1659
  e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
1657
1660
  t() && (e.scrollTop = e.scrollHeight);
1658
1661
  });
@@ -1710,7 +1713,7 @@ function Sa(e, t, n, o, i) {
1710
1713
  i
1711
1714
  )
1712
1715
  ), e.appendChild(
1713
- ht(
1716
+ mt(
1714
1717
  "pluno-pa-widget__close",
1715
1718
  "Close",
1716
1719
  Ra(16),
@@ -1730,7 +1733,7 @@ function Ea(e, t, n, o) {
1730
1733
  10
1731
1734
  )
1732
1735
  ), i.appendChild(
1733
- fe(
1736
+ be(
1734
1737
  "pluno-pa-widget__character--launcher",
1735
1738
  t
1736
1739
  )
@@ -1739,7 +1742,7 @@ function Ea(e, t, n, o) {
1739
1742
  a.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(a);
1740
1743
  const l = document.createElement("input");
1741
1744
  l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
1742
- const p = ut("Working...");
1745
+ const p = gt("Working...");
1743
1746
  if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
1744
1747
  const d = document.createElement("button");
1745
1748
  d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", i.appendChild(d);
@@ -1763,27 +1766,27 @@ function ka(e) {
1763
1766
  l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
1764
1767
  const p = document.createElement("div");
1765
1768
  return p.className = "pluno-pa-widget__top-actions", p.appendChild(
1766
- ht(
1769
+ mt(
1767
1770
  "pluno-pa-widget__history",
1768
1771
  Zt(),
1769
- Ma(),
1772
+ za(),
1770
1773
  !0
1771
1774
  )
1772
- ), n.appendChild(p), n.appendChild(Ia()), t.appendChild(n), t.appendChild(La()), t.appendChild(Pa()), t.appendChild(me("left", "Resize Pluno from left")), t.appendChild(
1773
- me("right", "Resize Pluno from right")
1774
- ), t.appendChild(me("top", "Resize Pluno from top")), t.appendChild(
1775
- me("bottom", "Resize Pluno from bottom")
1775
+ ), n.appendChild(p), n.appendChild(Ia()), t.appendChild(n), t.appendChild(La()), t.appendChild(Pa()), t.appendChild(we("left", "Resize Pluno from left")), t.appendChild(
1776
+ we("right", "Resize Pluno from right")
1777
+ ), t.appendChild(we("top", "Resize Pluno from top")), t.appendChild(
1778
+ we("bottom", "Resize Pluno from bottom")
1776
1779
  ), t.appendChild(
1777
- me("top-left", "Resize Pluno from top left")
1780
+ we("top-left", "Resize Pluno from top left")
1778
1781
  ), t.appendChild(
1779
- me("top-right", "Resize Pluno from top right")
1782
+ we("top-right", "Resize Pluno from top right")
1780
1783
  ), t.appendChild(
1781
- me("bottom-left", "Resize Pluno from bottom left")
1784
+ we("bottom-left", "Resize Pluno from bottom left")
1782
1785
  ), t.appendChild(
1783
- me("bottom-right", "Resize Pluno from bottom right")
1786
+ we("bottom-right", "Resize Pluno from bottom right")
1784
1787
  ), t;
1785
1788
  }
1786
- function me(e, t) {
1789
+ function we(e, t) {
1787
1790
  const n = document.createElement("button");
1788
1791
  return n.type = "button", n.className = [
1789
1792
  "pluno-pa-widget__resize-handle",
@@ -1840,7 +1843,7 @@ function Ia() {
1840
1843
  t.className = "pluno-pa-widget__history-header";
1841
1844
  const n = document.createElement("strong");
1842
1845
  n.textContent = Zt();
1843
- const o = ht(
1846
+ const o = mt(
1844
1847
  "pluno-pa-widget__history-close",
1845
1848
  "Close recent chats",
1846
1849
  Oa(),
@@ -1855,7 +1858,7 @@ function Ia() {
1855
1858
  function Ta(e) {
1856
1859
  const t = document.createElement("div");
1857
1860
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
1858
- fe(
1861
+ be(
1859
1862
  "pluno-pa-widget__character--empty",
1860
1863
  e
1861
1864
  )
@@ -1877,7 +1880,7 @@ function fo(e, t) {
1877
1880
  )
1878
1881
  );
1879
1882
  }
1880
- function fe(e, t) {
1883
+ function be(e, t) {
1881
1884
  const n = `pluno-pa-character-${Dn}`;
1882
1885
  Dn += 1;
1883
1886
  const o = t.scribbleStyle ? Na(t.accentColor, n) : Aa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
@@ -1952,7 +1955,7 @@ function Aa(e, t) {
1952
1955
  "flood-color": n.shadow,
1953
1956
  "flood-opacity": "0.24"
1954
1957
  });
1955
- const E = f(a, "filter", {
1958
+ const k = f(a, "filter", {
1956
1959
  id: o.innerDepth,
1957
1960
  x: "-8%",
1958
1961
  y: "-8%",
@@ -1960,27 +1963,27 @@ function Aa(e, t) {
1960
1963
  height: "116%",
1961
1964
  "color-interpolation-filters": "sRGB"
1962
1965
  });
1963
- f(E, "feGaussianBlur", {
1966
+ f(k, "feGaussianBlur", {
1964
1967
  in: "SourceAlpha",
1965
1968
  stdDeviation: "8",
1966
1969
  result: "blur"
1967
- }), f(E, "feOffset", {
1970
+ }), f(k, "feOffset", {
1968
1971
  dx: "-7",
1969
1972
  dy: "-9",
1970
1973
  result: "topLeft"
1971
- }), f(E, "feComposite", {
1974
+ }), f(k, "feComposite", {
1972
1975
  in: "topLeft",
1973
1976
  in2: "SourceAlpha",
1974
1977
  operator: "arithmetic",
1975
1978
  k2: "-1",
1976
1979
  k3: "1",
1977
1980
  result: "innerShadow"
1978
- }), f(E, "feColorMatrix", {
1981
+ }), f(k, "feColorMatrix", {
1979
1982
  in: "innerShadow",
1980
1983
  type: "matrix",
1981
1984
  values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
1982
1985
  result: "innerLight"
1983
- }), f(E, "feBlend", {
1986
+ }), f(k, "feBlend", {
1984
1987
  in: "SourceGraphic",
1985
1988
  in2: "innerLight",
1986
1989
  mode: "screen"
@@ -2000,7 +2003,7 @@ function Aa(e, t) {
2000
2003
  "flood-color": n.shadow,
2001
2004
  "flood-opacity": "0.3"
2002
2005
  });
2003
- const z = f(a, "filter", {
2006
+ const D = f(a, "filter", {
2004
2007
  id: o.pupilGloss,
2005
2008
  x: "-15%",
2006
2009
  y: "-15%",
@@ -2008,29 +2011,29 @@ function Aa(e, t) {
2008
2011
  height: "130%",
2009
2012
  "color-interpolation-filters": "sRGB"
2010
2013
  });
2011
- f(z, "feDropShadow", {
2014
+ f(D, "feDropShadow", {
2012
2015
  dx: "0",
2013
2016
  dy: "3",
2014
2017
  stdDeviation: "3",
2015
2018
  "flood-color": "#000000",
2016
2019
  "flood-opacity": "0.22"
2017
2020
  });
2018
- const b = f(a, "clipPath", { id: o.boltClip });
2019
- f(b, "path", { d: st });
2021
+ const S = f(a, "clipPath", { id: o.boltClip });
2022
+ f(S, "path", { d: dt });
2020
2023
  const g = f(i, "g", {
2021
2024
  filter: V(o.softDropShadow)
2022
2025
  });
2023
2026
  f(g, "path", {
2024
- d: st,
2027
+ d: dt,
2025
2028
  fill: V(o.boltEdge)
2026
2029
  });
2027
- const w = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
2030
+ const x = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
2028
2031
  f(g, "path", {
2029
- d: w,
2032
+ d: x,
2030
2033
  fill: V(o.boltFill),
2031
2034
  filter: V(o.innerDepth)
2032
2035
  }), f(g, "path", {
2033
- d: w,
2036
+ d: x,
2034
2037
  fill: V(o.boltGlow),
2035
2038
  opacity: "0.74"
2036
2039
  });
@@ -2060,9 +2063,9 @@ function Aa(e, t) {
2060
2063
  "stroke-linecap": "round",
2061
2064
  opacity: "0.48"
2062
2065
  });
2063
- const P = f(i, "g", { filter: V(o.eyeShadow) });
2066
+ const A = f(i, "g", { filter: V(o.eyeShadow) });
2064
2067
  return Fn(
2065
- P,
2068
+ A,
2066
2069
  "rotate(-2 528 463)",
2067
2070
  "528",
2068
2071
  "463",
@@ -2072,7 +2075,7 @@ function Aa(e, t) {
2072
2075
  "447",
2073
2076
  o
2074
2077
  ), Fn(
2075
- P,
2078
+ A,
2076
2079
  "rotate(2 717 462)",
2077
2080
  "717",
2078
2081
  "462",
@@ -2088,7 +2091,7 @@ function Na(e, t) {
2088
2091
  clip: `${t}-scribbleBoltClip`,
2089
2092
  wobble: `${t}-scribbleBoltWobble`
2090
2093
  }, i = wo(), a = f(i, "defs"), l = f(a, "clipPath", { id: o.clip });
2091
- f(l, "path", { d: st });
2094
+ f(l, "path", { d: dt });
2092
2095
  const p = f(a, "filter", {
2093
2096
  id: o.wobble,
2094
2097
  x: "-10%",
@@ -2123,9 +2126,9 @@ function Na(e, t) {
2123
2126
  opacity: "0.9",
2124
2127
  transform: "rotate(-14 627 600)"
2125
2128
  }), f(d, "path", {
2126
- d: st,
2129
+ d: dt,
2127
2130
  fill: "none",
2128
- stroke: dt,
2131
+ stroke: ct,
2129
2132
  "stroke-width": "18",
2130
2133
  "stroke-linejoin": "round"
2131
2134
  }), Hn(
@@ -2149,7 +2152,7 @@ function Na(e, t) {
2149
2152
  ), i;
2150
2153
  }
2151
2154
  function wo() {
2152
- return S("svg", {
2155
+ return E("svg", {
2153
2156
  xmlns: po,
2154
2157
  viewBox: "0 0 1254 1254"
2155
2158
  });
@@ -2184,14 +2187,14 @@ function Hn(e, t, n, o, i, a, l, p) {
2184
2187
  rx: "73",
2185
2188
  ry: "80",
2186
2189
  fill: "#ffffff",
2187
- stroke: dt,
2190
+ stroke: ct,
2188
2191
  "stroke-width": "13"
2189
2192
  }), f(d, "ellipse", {
2190
2193
  cx: i,
2191
2194
  cy: a,
2192
2195
  rx: "45",
2193
2196
  ry: "53",
2194
- fill: dt
2197
+ fill: ct
2195
2198
  }), f(d, "circle", {
2196
2199
  cx: l,
2197
2200
  cy: p,
@@ -2200,7 +2203,7 @@ function Hn(e, t, n, o, i, a, l, p) {
2200
2203
  });
2201
2204
  }
2202
2205
  function f(e, t, n = {}) {
2203
- const o = S(t, n);
2206
+ const o = E(t, n);
2204
2207
  return e.appendChild(o), o;
2205
2208
  }
2206
2209
  function O(e, t, n, o) {
@@ -2210,18 +2213,18 @@ function O(e, t, n, o) {
2210
2213
  function V(e) {
2211
2214
  return `url(#${e})`;
2212
2215
  }
2213
- function ht(e, t, n, o) {
2216
+ function mt(e, t, n, o) {
2214
2217
  const i = document.createElement("button");
2215
2218
  return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
2216
2219
  }
2217
2220
  function Da() {
2218
- const e = S("svg", {
2221
+ const e = E("svg", {
2219
2222
  class: "pluno-pa-widget__scribble-defs",
2220
2223
  "aria-hidden": "true",
2221
2224
  focusable: "false",
2222
2225
  width: "0",
2223
2226
  height: "0"
2224
- }), t = S("defs");
2227
+ }), t = E("defs");
2225
2228
  return t.appendChild(Ft("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2226
2229
  Ft("pluno-pa-scribble-wobble-2", "5", "15")
2227
2230
  ), t.appendChild(
@@ -2229,7 +2232,7 @@ function Da() {
2229
2232
  ), e.appendChild(t), e;
2230
2233
  }
2231
2234
  function bo(e, t) {
2232
- const n = S("svg", {
2235
+ const n = E("svg", {
2233
2236
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2234
2237
  preserveAspectRatio: "xMidYMid meet",
2235
2238
  "aria-hidden": "true",
@@ -2260,11 +2263,11 @@ function _o(e, t) {
2260
2263
  `0 0 ${n} ${Yi}`
2261
2264
  ), e.replaceChildren();
2262
2265
  for (let o = 0; o < t; o += 1) {
2263
- const i = Nn[o % Nn.length], a = S("g", {
2266
+ const i = Nn[o % Nn.length], a = E("g", {
2264
2267
  transform: `translate(${Vt + o * jt} 0)`
2265
2268
  });
2266
2269
  a.appendChild(
2267
- S("ellipse", {
2270
+ E("ellipse", {
2268
2271
  cx: i.ellipseCx,
2269
2272
  cy: i.ellipseCy,
2270
2273
  rx: i.ellipseRx,
@@ -2275,7 +2278,7 @@ function _o(e, t) {
2275
2278
  opacity: "0.8"
2276
2279
  })
2277
2280
  ), a.appendChild(
2278
- S("path", {
2281
+ E("path", {
2279
2282
  d: i.path,
2280
2283
  fill: "none",
2281
2284
  stroke: "#2c2a1e",
@@ -2286,7 +2289,7 @@ function _o(e, t) {
2286
2289
  }
2287
2290
  }
2288
2291
  function Ft(e, t, n) {
2289
- const o = S("filter", {
2292
+ const o = E("filter", {
2290
2293
  id: e,
2291
2294
  x: "-8%",
2292
2295
  y: "-8%",
@@ -2294,7 +2297,7 @@ function Ft(e, t, n) {
2294
2297
  height: "116%"
2295
2298
  });
2296
2299
  return o.appendChild(
2297
- S("feTurbulence", {
2300
+ E("feTurbulence", {
2298
2301
  type: "fractalNoise",
2299
2302
  baseFrequency: "0.012 0.028",
2300
2303
  numOctaves: "3",
@@ -2302,7 +2305,7 @@ function Ft(e, t, n) {
2302
2305
  result: "stroke-noise"
2303
2306
  })
2304
2307
  ), o.appendChild(
2305
- S("feDisplacementMap", {
2308
+ E("feDisplacementMap", {
2306
2309
  in: "SourceGraphic",
2307
2310
  in2: "stroke-noise",
2308
2311
  scale: "3.5",
@@ -2311,7 +2314,7 @@ function Ft(e, t, n) {
2311
2314
  result: "warped"
2312
2315
  })
2313
2316
  ), o.appendChild(
2314
- S("feTurbulence", {
2317
+ E("feTurbulence", {
2315
2318
  type: "fractalNoise",
2316
2319
  baseFrequency: "0.7",
2317
2320
  numOctaves: "1",
@@ -2319,7 +2322,7 @@ function Ft(e, t, n) {
2319
2322
  result: "ink-noise"
2320
2323
  })
2321
2324
  ), o.appendChild(
2322
- S("feDisplacementMap", {
2325
+ E("feDisplacementMap", {
2323
2326
  in: "warped",
2324
2327
  in2: "ink-noise",
2325
2328
  scale: "0.9",
@@ -2329,7 +2332,7 @@ function Ft(e, t, n) {
2329
2332
  ), o;
2330
2333
  }
2331
2334
  function Ra(e) {
2332
- const t = re(
2335
+ const t = ae(
2333
2336
  "0 0 24 24",
2334
2337
  e,
2335
2338
  e,
@@ -2337,10 +2340,10 @@ function Ra(e) {
2337
2340
  "currentColor",
2338
2341
  "2.25"
2339
2342
  );
2340
- return t.appendChild(S("path", { d: "m6 9 6 6 6-6" })), t;
2343
+ return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
2341
2344
  }
2342
- function za() {
2343
- const e = re(
2345
+ function Ma() {
2346
+ const e = ae(
2344
2347
  "0 0 24 24",
2345
2348
  17,
2346
2349
  17,
@@ -2349,17 +2352,17 @@ function za() {
2349
2352
  "2.25"
2350
2353
  );
2351
2354
  return e.appendChild(
2352
- S("path", {
2355
+ E("path", {
2353
2356
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2354
2357
  })
2355
2358
  ), e.appendChild(
2356
- S("path", {
2359
+ E("path", {
2357
2360
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2358
2361
  })
2359
2362
  ), e;
2360
2363
  }
2361
- function Ma() {
2362
- const e = re(
2364
+ function za() {
2365
+ const e = ae(
2363
2366
  "0 0 24 24",
2364
2367
  17,
2365
2368
  17,
@@ -2367,10 +2370,10 @@ function Ma() {
2367
2370
  "currentColor",
2368
2371
  "2.25"
2369
2372
  );
2370
- return e.appendChild(S("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(S("path", { d: "M3 4v5h5" })), e.appendChild(S("path", { d: "M12 7v5l3 2" })), e;
2373
+ return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
2371
2374
  }
2372
2375
  function Oa() {
2373
- const e = re(
2376
+ const e = ae(
2374
2377
  "0 0 24 24",
2375
2378
  15,
2376
2379
  15,
@@ -2378,10 +2381,10 @@ function Oa() {
2378
2381
  "currentColor",
2379
2382
  "2.4"
2380
2383
  );
2381
- return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
2384
+ return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
2382
2385
  }
2383
2386
  function xo() {
2384
- const e = re(
2387
+ const e = ae(
2385
2388
  "0 0 24 24",
2386
2389
  14,
2387
2390
  14,
@@ -2390,11 +2393,11 @@ function xo() {
2390
2393
  "2.75"
2391
2394
  );
2392
2395
  return e.appendChild(
2393
- S("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2394
- ), e.appendChild(S("polyline", { points: "5 12 12 5 19 12" })), e;
2396
+ E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2397
+ ), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
2395
2398
  }
2396
2399
  function Ua() {
2397
- const e = re(
2400
+ const e = ae(
2398
2401
  "0 0 24 24",
2399
2402
  16,
2400
2403
  16,
@@ -2406,18 +2409,18 @@ function Ua() {
2406
2409
  "class",
2407
2410
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2408
2411
  ), e.appendChild(
2409
- S("path", {
2412
+ E("path", {
2410
2413
  d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
2411
2414
  })
2412
2415
  ), e;
2413
2416
  }
2414
2417
  function Ba() {
2415
- const e = re("0 0 24 24", 19, 19, "none", "currentColor");
2418
+ const e = ae("0 0 24 24", 19, 19, "none", "currentColor");
2416
2419
  return e.setAttribute(
2417
2420
  "class",
2418
2421
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2419
2422
  ), e.appendChild(
2420
- S("path", {
2423
+ E("path", {
2421
2424
  d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
2422
2425
  stroke: "currentColor",
2423
2426
  "stroke-width": "2",
@@ -2427,9 +2430,9 @@ function Ba() {
2427
2430
  ), e;
2428
2431
  }
2429
2432
  function Fa() {
2430
- const e = re("0 0 24 24", 18, 18, "currentColor");
2433
+ const e = ae("0 0 24 24", 18, 18, "currentColor");
2431
2434
  return e.appendChild(
2432
- S("rect", {
2435
+ E("rect", {
2433
2436
  x: "6",
2434
2437
  y: "6",
2435
2438
  width: "12",
@@ -2439,7 +2442,7 @@ function Fa() {
2439
2442
  ), e;
2440
2443
  }
2441
2444
  function Ha() {
2442
- const e = re(
2445
+ const e = ae(
2443
2446
  "0 0 24 24",
2444
2447
  12,
2445
2448
  12,
@@ -2447,10 +2450,10 @@ function Ha() {
2447
2450
  "currentColor",
2448
2451
  "2.4"
2449
2452
  );
2450
- return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
2453
+ return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
2451
2454
  }
2452
2455
  function Wa() {
2453
- const e = re(
2456
+ const e = ae(
2454
2457
  "0 0 24 24",
2455
2458
  13,
2456
2459
  13,
@@ -2459,7 +2462,7 @@ function Wa() {
2459
2462
  "2.25"
2460
2463
  );
2461
2464
  return e.appendChild(
2462
- S("rect", {
2465
+ E("rect", {
2463
2466
  width: "14",
2464
2467
  height: "14",
2465
2468
  x: "8",
@@ -2468,12 +2471,12 @@ function Wa() {
2468
2471
  ry: "2"
2469
2472
  })
2470
2473
  ), e.appendChild(
2471
- S("path", {
2474
+ E("path", {
2472
2475
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2473
2476
  })
2474
2477
  ), e;
2475
2478
  }
2476
- function re(e, t, n, o, i, a) {
2479
+ function ae(e, t, n, o, i, a) {
2477
2480
  const l = {
2478
2481
  viewBox: e,
2479
2482
  width: String(t),
@@ -2481,9 +2484,9 @@ function re(e, t, n, o, i, a) {
2481
2484
  fill: o,
2482
2485
  "aria-hidden": "true"
2483
2486
  };
2484
- return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), S("svg", l);
2487
+ return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), E("svg", l);
2485
2488
  }
2486
- function S(e, t = {}) {
2489
+ function E(e, t = {}) {
2487
2490
  const n = document.createElementNS(po, e);
2488
2491
  for (const [o, i] of Object.entries(t))
2489
2492
  n.setAttribute(o, i);
@@ -2510,31 +2513,31 @@ function $a(e) {
2510
2513
  const t = on(e), n = yo(e);
2511
2514
  if (t === "image" && n) {
2512
2515
  const o = document.createElement("img");
2513
- return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o;
2516
+ return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(oe(e))), o;
2514
2517
  }
2515
2518
  if (t === "video" && n) {
2516
2519
  const o = document.createElement("video");
2517
- return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o.addEventListener("stalled", () => o.replaceWith(ie(e))), o;
2520
+ return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(oe(e))), o.addEventListener("stalled", () => o.replaceWith(oe(e))), o;
2518
2521
  }
2519
- return ie(e);
2522
+ return oe(e);
2520
2523
  }
2521
2524
  function qa(e) {
2522
2525
  const t = on(e), n = yo(e);
2523
2526
  if (t === "image" && n) {
2524
2527
  const o = document.createElement("img");
2525
- return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o;
2528
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(oe(e, "message"))), o;
2526
2529
  }
2527
2530
  if (t === "pdf" && n) {
2528
2531
  const o = document.createElement("object");
2529
- return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o.appendChild(ie(e, "message")), o;
2532
+ return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(oe(e, "message"))), o.appendChild(oe(e, "message")), o;
2530
2533
  }
2531
2534
  if (t === "video" && n) {
2532
2535
  const o = document.createElement("video");
2533
- return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ie(e, "message"))), o;
2536
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(oe(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(oe(e, "message"))), o;
2534
2537
  }
2535
- return ie(e, "message");
2538
+ return oe(e, "message");
2536
2539
  }
2537
- function ie(e, t = "composer") {
2540
+ function oe(e, t = "composer") {
2538
2541
  if (t === "composer") {
2539
2542
  const a = document.createElement("span");
2540
2543
  return a.className = "pluno-pa-widget__attachment-file", a.textContent = Gn(e), a;
@@ -2565,7 +2568,7 @@ function ja(e, t) {
2565
2568
  function Va(e) {
2566
2569
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2567
2570
  }
2568
- function at(e) {
2571
+ function rt(e) {
2569
2572
  return !!(e && Array.from(e.types).includes("Files"));
2570
2573
  }
2571
2574
  function Ht(e, t, n = null) {
@@ -2573,7 +2576,7 @@ function Ht(e, t, n = null) {
2573
2576
  e && (e.hidden = !0, e.replaceChildren());
2574
2577
  return;
2575
2578
  }
2576
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || an(n) ? e.appendChild(
2579
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ie(t) || an(n) ? e.appendChild(
2577
2580
  Ka(t, n)
2578
2581
  ) : vo(t) && e.appendChild(Ya(t));
2579
2582
  }
@@ -2606,22 +2609,22 @@ function Ya(e) {
2606
2609
  ), t;
2607
2610
  }
2608
2611
  function Jt(e, t) {
2609
- return e !== null && (ae(e) || vo(e) || an(t));
2612
+ return e !== null && (ie(e) || vo(e) || an(t));
2610
2613
  }
2611
2614
  function $n(e, t, n) {
2612
2615
  return Jt(t, n) || Xa(t) ? !0 : !Jt(e, n);
2613
2616
  }
2614
2617
  function Xa(e) {
2615
- return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
2618
+ return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ie(e));
2616
2619
  }
2617
- function ae(e) {
2620
+ function ie(e) {
2618
2621
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
2619
2622
  }
2620
2623
  function an(e) {
2621
2624
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2622
2625
  }
2623
2626
  function vo(e) {
2624
- return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2627
+ return !ie(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2625
2628
  }
2626
2629
  function Za(e) {
2627
2630
  return e.creditsRemaining === null ? null : `${Ja(e.creditsRemaining)} credits left`;
@@ -2655,107 +2658,113 @@ function Wt(e, t) {
2655
2658
  (o) => !So(o)
2656
2659
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2657
2660
  }
2658
- function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2659
- const g = or(a), w = g.filter(
2660
- (C) => !So(C)
2661
- ), h = e.scrollTop, P = [], T = /* @__PURE__ */ new Set(), k = (C) => {
2662
- P.push(C);
2661
+ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, k, v, D, S, g) {
2662
+ const x = or(a), h = x.filter(
2663
+ (w) => !So(w)
2664
+ ), A = e.scrollTop, I = [], R = /* @__PURE__ */ new Set(), P = (w) => {
2665
+ I.push(w);
2663
2666
  };
2664
2667
  ko(n, a.isThinking), i.hidden = !p, p && l !== null && fo(i, l);
2665
- const F = w.length > 0 || !!a.assistantDraft || a.isThinking;
2666
- if (o(F), w.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
2667
- const C = document.createElement("div");
2668
- C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2669
- const N = document.createElement("div");
2670
- N.className = "pluno-pa-widget__empty-hero";
2671
- const Ee = fe(
2668
+ const Oe = h.length > 0 || !!a.assistantDraft || a.isThinking;
2669
+ if (o(Oe), h.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
2670
+ const w = document.createElement("div");
2671
+ w.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2672
+ const z = document.createElement("div");
2673
+ z.className = "pluno-pa-widget__empty-hero";
2674
+ const H = be(
2672
2675
  "pluno-pa-widget__character--empty",
2673
2676
  v()
2674
2677
  );
2675
- N.appendChild(Ee), C.appendChild(N), C.appendChild(mo());
2678
+ z.appendChild(H), w.appendChild(z), w.appendChild(mo());
2676
2679
  const q = document.createElement("div");
2677
2680
  if (q.className = a.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", a.starterPrompts.length === 0 && !a.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), a.starterPrompts.length > 0)
2678
- for (const R of a.starterPrompts) {
2679
- const D = document.createElement("button");
2680
- D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${R}"`, D.addEventListener("click", () => {
2681
- z(R);
2682
- }), q.appendChild(D);
2681
+ for (const N of a.starterPrompts) {
2682
+ const C = document.createElement("button");
2683
+ C.type = "button", C.className = "pluno-pa-widget__starter-prompt", C.textContent = `"${N}"`, C.addEventListener("click", () => {
2684
+ D(N);
2685
+ }), q.appendChild(C);
2683
2686
  }
2684
2687
  else if (a.starterPromptsLoading) {
2685
- const R = document.createElement("button");
2686
- R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", R.disabled = !0, R.tabIndex = -1, R.textContent = "Generating example tasks...", q.appendChild(R);
2688
+ const N = document.createElement("button");
2689
+ N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", N.disabled = !0, N.tabIndex = -1, N.textContent = "Generating example tasks...", q.appendChild(N);
2687
2690
  } else
2688
- for (let R = 0; R < zi; R += 1) {
2689
- const D = document.createElement("button");
2690
- D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
2691
+ for (let N = 0; N < Mi; N += 1) {
2692
+ const C = document.createElement("button");
2693
+ C.type = "button", C.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", C.disabled = !0, C.tabIndex = -1, C.textContent = "", q.appendChild(C);
2691
2694
  }
2692
- C.appendChild(q), m.clear(), k(C), k(t), jn(e, P);
2695
+ w.appendChild(q), m.clear(), P(w), P(t), jn(e, I);
2693
2696
  return;
2694
2697
  }
2695
- let H = null, $ = null, Q = [];
2696
- const Me = w.some(Qt), x = () => {
2697
- if (Q.length === 0)
2698
+ let $ = null, U = null, ce = [];
2699
+ const y = h.some(Qt), ee = () => {
2700
+ if (ce.length === 0)
2698
2701
  return !1;
2699
- const C = gr(
2700
- Q,
2702
+ const w = gr(
2703
+ ce,
2701
2704
  u,
2702
- E,
2705
+ k,
2703
2706
  v()
2704
2707
  );
2705
- return k(C), H = null, $ = C, Q = [], !0;
2708
+ return P(w), $ = null, U = w, ce = [], !0;
2706
2709
  };
2707
- for (let C = 0; C < w.length; C += 1) {
2708
- const N = w[C];
2709
- if (N.role === "tool") {
2710
- Q.push(N);
2710
+ for (let w = 0; w < h.length; w += 1) {
2711
+ const z = h[w];
2712
+ if (z.role === "tool") {
2713
+ ce.push(z);
2711
2714
  continue;
2712
2715
  }
2713
- if (Qt(N)) {
2714
- if (x()) {
2715
- const A = ut();
2716
- k(A), H = null, $ = A;
2716
+ if (Qt(z)) {
2717
+ if (ee()) {
2718
+ const re = gt();
2719
+ P(re), $ = null, U = re;
2717
2720
  } else {
2718
- const A = Yn(v());
2719
- k(A), H = null, $ = A;
2721
+ const re = Yn(v());
2722
+ P(re), $ = null, U = re;
2720
2723
  }
2721
2724
  continue;
2722
2725
  }
2723
- if (N.role === "system")
2726
+ if (z.role === "system")
2724
2727
  continue;
2725
- const Ee = x(), q = ur(N.content);
2726
- if (N.role === "assistant" && !Ee) {
2727
- const D = Eo(v());
2728
- k(D), H = null, $ = D;
2728
+ const H = ee(), q = ur(z.content);
2729
+ if (z.role === "assistant" && !H) {
2730
+ const C = Eo(v());
2731
+ P(C), $ = null, U = C;
2729
2732
  }
2730
- const R = er(N, q, m, T);
2731
- k(R), H = R, $ = null;
2733
+ const N = er(z, q, m, R);
2734
+ P(N), $ = N, U = null;
2732
2735
  }
2733
- const ce = x(), Xe = w[w.length - 1]?.id === "assistant-draft";
2734
- if (a.isThinking && !Xe && !Me)
2735
- if (ce) {
2736
- const C = ut();
2737
- k(C), H = null, $ = C;
2736
+ const Ze = ee(), _e = h[h.length - 1]?.id === "assistant-draft";
2737
+ if (a.isThinking && !_e && !y)
2738
+ if (Ze) {
2739
+ const w = gt();
2740
+ P(w), $ = null, U = w;
2738
2741
  } else {
2739
- const C = Yn(v());
2740
- k(C), H = null, $ = C;
2742
+ const w = Yn(v());
2743
+ P(w), $ = null, U = w;
2741
2744
  }
2742
2745
  if (a.lastError) {
2743
- const C = document.createElement("div");
2744
- C.className = "pluno-pa-widget__error", C.textContent = a.lastError, k(C), H = C, $ = null;
2746
+ const w = document.createElement("div");
2747
+ w.className = "pluno-pa-widget__error";
2748
+ const z = document.createElement("span");
2749
+ if (z.textContent = a.lastError, w.appendChild(z), a.lastErrorCode === "run_recovery_exhausted" || a.lastErrorCode === "transient_model_error" || a.lastErrorCode === "run_still_active") {
2750
+ const H = document.createElement("button");
2751
+ H.type = "button", H.className = "pluno-pa-widget__error-retry", H.textContent = "Try again", H.addEventListener("click", S), w.appendChild(H);
2752
+ }
2753
+ P(w), $ = w, U = null;
2745
2754
  }
2746
- const X = b && !a.isThinking ? ri(g) : null;
2747
- if (b && X && !b.dismissedCandidateIds.has(X.id)) {
2748
- const C = rr(X, {
2749
- isDrafting: b.draftingCandidateId === X.id,
2750
- error: b.error,
2751
- characterIconOptions: b.characterIconOptions,
2752
- onDraft: b.onDraft,
2753
- onDismiss: b.onDismiss,
2754
- onDisable: b.onDisable
2755
+ const ue = g && !a.isThinking ? ri(x) : null;
2756
+ if (g && ue && !g.dismissedCandidateIds.has(ue.id)) {
2757
+ const w = rr(ue, {
2758
+ isDrafting: g.draftingCandidateId === ue.id,
2759
+ error: g.error,
2760
+ characterIconOptions: g.characterIconOptions,
2761
+ onDraft: g.onDraft,
2762
+ onDismiss: g.onDismiss,
2763
+ onDisable: g.onDisable
2755
2764
  });
2756
- k(C), b.onSeen(X), H = null, $ = C;
2765
+ P(w), g.onSeen(ue), $ = null, U = w;
2757
2766
  }
2758
- H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"), k(t), nr(m, T), jn(e, P), d ? Ke(e, c) : e.scrollTop = h;
2767
+ $?.classList.add("pluno-pa-widget__message--bottom-reserve"), U?.classList.add("pluno-pa-widget__bottom-reserve-compact"), P(t), nr(m, R), jn(e, I), d ? Ye(e, c) : e.scrollTop = A;
2759
2768
  }
2760
2769
  function er(e, t, n, o) {
2761
2770
  const i = tr(e, t), a = i ? n.get(i) : void 0;
@@ -2849,7 +2858,7 @@ function Kn(e, t, n, o, i, a, l, p) {
2849
2858
  e.replaceChildren(), ko(t, !1), t.disabled = !0, n(!1);
2850
2859
  const d = document.createElement("div");
2851
2860
  d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2852
- const c = fe(
2861
+ const c = be(
2853
2862
  "pluno-pa-widget__character--empty",
2854
2863
  o()
2855
2864
  );
@@ -2882,7 +2891,7 @@ function rr(e, t) {
2882
2891
  n.className = "pluno-pa-widget__share-prompt";
2883
2892
  const o = document.createElement("div");
2884
2893
  o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
2885
- fe(
2894
+ be(
2886
2895
  "pluno-pa-widget__share-prompt-icon",
2887
2896
  t.characterIconOptions
2888
2897
  )
@@ -2950,27 +2959,27 @@ function lr(e, t) {
2950
2959
  if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
2951
2960
  const g = document.createElement("div");
2952
2961
  g.className = "pluno-pa-widget__share-dialog-screenshot";
2953
- const w = document.createElement("img");
2954
- w.src = e.screenshotDataUrl, w.alt = "Product page with Pluno open", g.appendChild(w), d.appendChild(g);
2962
+ const x = document.createElement("img");
2963
+ x.src = e.screenshotDataUrl, x.alt = "Product page with Pluno open", g.appendChild(x), d.appendChild(g);
2955
2964
  }
2956
2965
  o.appendChild(d), o.appendChild(p);
2957
- const E = document.createElement("div");
2958
- E.className = "pluno-pa-widget__share-dialog-step";
2966
+ const k = document.createElement("div");
2967
+ k.className = "pluno-pa-widget__share-dialog-step";
2959
2968
  const v = document.createElement("strong");
2960
- v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", E.appendChild(v);
2961
- const z = document.createElement("p");
2962
- z.className = "pluno-pa-widget__share-dialog-hint", z.textContent = "Post draft opens prefilled on supported platforms.", E.appendChild(z);
2963
- const b = document.createElement("footer");
2964
- b.className = "pluno-pa-widget__share-dialog-platforms";
2969
+ v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
2970
+ const D = document.createElement("p");
2971
+ D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(D);
2972
+ const S = document.createElement("footer");
2973
+ S.className = "pluno-pa-widget__share-dialog-platforms";
2965
2974
  for (const g of sr(e)) {
2966
- const w = document.createElement("a");
2967
- w.href = g.href, w.target = "_blank", w.rel = "noopener noreferrer", w.title = g.label, w.setAttribute("aria-label", `Open ${g.label}`), w.appendChild(dr(g.id)), b.appendChild(w);
2975
+ const x = document.createElement("a");
2976
+ x.href = g.href, x.target = "_blank", x.rel = "noopener noreferrer", x.title = g.label, x.setAttribute("aria-label", `Open ${g.label}`), x.appendChild(dr(g.id)), S.appendChild(x);
2968
2977
  }
2969
- if (E.appendChild(b), o.appendChild(E), t.socialPostRewardsUrl) {
2978
+ if (k.appendChild(S), o.appendChild(k), t.socialPostRewardsUrl) {
2970
2979
  const g = document.createElement("div");
2971
2980
  g.className = "pluno-pa-widget__share-dialog-step";
2972
- const w = document.createElement("strong");
2973
- w.className = "pluno-pa-widget__share-dialog-step-title", w.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(w);
2981
+ const x = document.createElement("strong");
2982
+ x.className = "pluno-pa-widget__share-dialog-step-title", x.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(x);
2974
2983
  const h = document.createElement("a");
2975
2984
  h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(cr()), g.appendChild(h), o.appendChild(g);
2976
2985
  }
@@ -3004,34 +3013,34 @@ function sr(e) {
3004
3013
  }
3005
3014
  function dr(e) {
3006
3015
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3007
- return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (B(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), B(
3016
+ return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (F(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), F(
3008
3017
  t,
3009
3018
  "M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"
3010
- ), B(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), B(
3019
+ ), F(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), F(
3011
3020
  t,
3012
3021
  "M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"
3013
- ), B(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (B(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), B(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), B(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (B(
3022
+ ), F(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (F(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), F(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), F(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (F(
3014
3023
  t,
3015
3024
  "M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"
3016
- ), B(
3025
+ ), F(
3017
3026
  t,
3018
3027
  "M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1",
3019
3028
  "0.48"
3020
- ), B(
3029
+ ), F(
3021
3030
  t,
3022
3031
  "M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"
3023
- ), B(
3032
+ ), F(
3024
3033
  t,
3025
3034
  "M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"
3026
3035
  ), t);
3027
3036
  }
3028
- function B(e, t, n) {
3037
+ function F(e, t, n) {
3029
3038
  const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
3030
3039
  o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
3031
3040
  }
3032
3041
  function cr() {
3033
3042
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3034
- return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), B(e, "M14 5h5v5"), B(e, "M19 5l-8 8"), B(
3043
+ return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), F(e, "M14 5h5v5"), F(e, "M19 5l-8 8"), F(
3035
3044
  e,
3036
3045
  "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
3037
3046
  ), e;
@@ -3047,7 +3056,7 @@ function gr(e, t, n, o) {
3047
3056
  i.className = "pluno-pa-widget__tool-group", i.title = new Date(
3048
3057
  e[e.length - 1].createdAt
3049
3058
  ).toLocaleString(), i.appendChild(
3050
- fe(
3059
+ be(
3051
3060
  "pluno-pa-widget__character--tool-group",
3052
3061
  o
3053
3062
  )
@@ -3063,10 +3072,10 @@ function gr(e, t, n, o) {
3063
3072
  const u = document.createElement("div");
3064
3073
  u.className = "pluno-pa-widget__tool-lines";
3065
3074
  for (const m of e) {
3066
- const E = document.createElement("div");
3067
- E.className = "pluno-pa-widget__tool-line", m.loading && E.appendChild(en());
3075
+ const k = document.createElement("div");
3076
+ k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(en());
3068
3077
  const v = document.createElement("span");
3069
- v.textContent = m.content || "Run tool", E.appendChild(v), u.appendChild(E);
3078
+ v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
3070
3079
  }
3071
3080
  a.appendChild(u);
3072
3081
  }
@@ -3075,7 +3084,7 @@ function gr(e, t, n, o) {
3075
3084
  function Eo(e) {
3076
3085
  const t = document.createElement("article");
3077
3086
  return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
3078
- fe(
3087
+ be(
3079
3088
  "pluno-pa-widget__character--tool-group",
3080
3089
  e
3081
3090
  )
@@ -3083,9 +3092,9 @@ function Eo(e) {
3083
3092
  }
3084
3093
  function Yn(e) {
3085
3094
  const t = Eo(e);
3086
- return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ut()), t;
3095
+ return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(gt()), t;
3087
3096
  }
3088
- function ut(e = "Thinking...") {
3097
+ function gt(e = "Thinking...") {
3089
3098
  const t = document.createElement("div");
3090
3099
  t.className = "pluno-pa-widget__status";
3091
3100
  const n = document.createElement("span");
@@ -3127,14 +3136,14 @@ function mr(e, t) {
3127
3136
  const l = i.match(/^(#{1,3})\s+(.+)$/);
3128
3137
  if (l) {
3129
3138
  const c = document.createElement(`h${l[1].length + 2}`);
3130
- rt(c, l[2]), e.appendChild(c), o += 1;
3139
+ lt(c, l[2]), e.appendChild(c), o += 1;
3131
3140
  continue;
3132
3141
  }
3133
3142
  if (/^\s*[-*+]\s+/.test(i)) {
3134
3143
  const c = document.createElement("ul");
3135
3144
  for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
3136
3145
  const u = document.createElement("li");
3137
- rt(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
3146
+ lt(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
3138
3147
  }
3139
3148
  e.appendChild(c);
3140
3149
  continue;
@@ -3143,7 +3152,7 @@ function mr(e, t) {
3143
3152
  const c = document.createElement("ol");
3144
3153
  for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
3145
3154
  const u = document.createElement("li");
3146
- rt(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
3155
+ lt(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
3147
3156
  }
3148
3157
  e.appendChild(c);
3149
3158
  continue;
@@ -3153,11 +3162,11 @@ function mr(e, t) {
3153
3162
  p.push(n[o]), o += 1;
3154
3163
  const d = document.createElement("p");
3155
3164
  p.forEach((c, u) => {
3156
- u > 0 && d.appendChild(document.createElement("br")), rt(d, c);
3165
+ u > 0 && d.appendChild(document.createElement("br")), lt(d, c);
3157
3166
  }), e.appendChild(d);
3158
3167
  }
3159
3168
  }
3160
- function rt(e, t) {
3169
+ function lt(e, t) {
3161
3170
  const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
3162
3171
  let o = 0;
3163
3172
  for (const i of t.matchAll(n)) {
@@ -3251,7 +3260,7 @@ function Xn(e, t) {
3251
3260
  --pluno-pa-accent-contrast: #fafafa;
3252
3261
  position: fixed;
3253
3262
  z-index: 2147483645;
3254
- font-family: ${oe.fontFamily};
3263
+ font-family: ${ne.fontFamily};
3255
3264
  font-size: 14px;
3256
3265
  color: var(--pluno-pa-text);
3257
3266
  width: var(--pluno-pa-launcher-width);
@@ -4330,7 +4339,7 @@ function Xn(e, t) {
4330
4339
  place-items: center;
4331
4340
  padding: 18px;
4332
4341
  background: rgba(24, 24, 27, 0.28);
4333
- font-family: var(--pluno-pa-font, ${oe.fontFamily});
4342
+ font-family: var(--pluno-pa-font, ${ne.fontFamily});
4334
4343
  color: var(--pluno-pa-text);
4335
4344
  }
4336
4345
  .pluno-pa-widget__share-dialog {
@@ -4901,6 +4910,18 @@ function Xn(e, t) {
4901
4910
  padding: 36px 4px calc(var(--pluno-pa-starter-edge-gap) - 12px);
4902
4911
  text-align: left;
4903
4912
  }
4913
+ .pluno-pa-widget__error-retry {
4914
+ display: block;
4915
+ margin-top: 6px;
4916
+ padding: 0;
4917
+ border: 0;
4918
+ background: transparent;
4919
+ color: inherit;
4920
+ font: inherit;
4921
+ font-weight: 700;
4922
+ text-decoration: underline;
4923
+ cursor: pointer;
4924
+ }
4904
4925
  .pluno-pa-widget__empty-state--starter .pluno-pa-widget__empty {
4905
4926
  color: var(--pluno-pa-text);
4906
4927
  font-size: 24px;
@@ -5536,7 +5557,7 @@ function yr(e) {
5536
5557
  (o) => typeof o == "string"
5537
5558
  ) : [],
5538
5559
  launcherPosition: Er(n.launcherPosition) ? n.launcherPosition : null,
5539
- panelSize: kr(n.panelSize) ? gt(n.panelSize) : null,
5560
+ panelSize: kr(n.panelSize) ? ht(n.panelSize) : null,
5540
5561
  seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-oo) : [],
5541
5562
  sharePromptsDisabled: n.sharePromptsDisabled === !0
5542
5563
  };
@@ -5681,7 +5702,7 @@ class de extends EventTarget {
5681
5702
  ), this.cleanup();
5682
5703
  }), window.dispatchEvent(
5683
5704
  new CustomEvent(
5684
- lt(
5705
+ pt(
5685
5706
  Ci,
5686
5707
  this.channelId
5687
5708
  ),
@@ -5712,7 +5733,7 @@ class de extends EventTarget {
5712
5733
  );
5713
5734
  window.dispatchEvent(
5714
5735
  new CustomEvent(
5715
- lt(Si, this.channelId),
5736
+ pt(Si, this.channelId),
5716
5737
  {
5717
5738
  detail: {
5718
5739
  socketId: this.socketId,
@@ -5725,7 +5746,7 @@ class de extends EventTarget {
5725
5746
  close(t, n) {
5726
5747
  this.readyState !== de.CLOSED && (this.readyState = de.CLOSING, window.dispatchEvent(
5727
5748
  new CustomEvent(
5728
- lt(Ei, this.channelId),
5749
+ pt(Ei, this.channelId),
5729
5750
  {
5730
5751
  detail: { socketId: this.socketId, code: t, reason: n }
5731
5752
  }
@@ -5733,7 +5754,7 @@ class de extends EventTarget {
5733
5754
  ), this.cleanup());
5734
5755
  }
5735
5756
  addPreviewListener(t, n) {
5736
- const o = lt(
5757
+ const o = pt(
5737
5758
  t,
5738
5759
  this.channelId
5739
5760
  ), i = (a) => {
@@ -5756,7 +5777,7 @@ function Tr() {
5756
5777
  const t = crypto.randomUUID();
5757
5778
  return window.sessionStorage.setItem(kn, t), t;
5758
5779
  }
5759
- function lt(e, t) {
5780
+ function pt(e, t) {
5760
5781
  return `${e}:${t}`;
5761
5782
  }
5762
5783
  function Ar(e) {