@pluno/product-agent-web 0.1.71 → 0.1.74

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,26 +1,26 @@
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;
3
- function eo(e) {
4
- const t = to(e);
5
- if (Cn(Ye(t), yn) >= vn)
2
+ const ei = "#7c3aed", ut = "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", gt = "#2c2a1e", Cn = [253, 250, 241], Sn = 3.5;
3
+ function no(e) {
4
+ const t = oo(e);
5
+ if (En(Ze(t), Cn) >= Sn)
6
6
  return t;
7
- let o = Ye(t);
8
- const i = Ye(dt);
9
- for (let a = 0; a < 6; a += 1)
10
- if (o = oi(o, i, 0.22), Cn(o, yn) >= vn)
11
- return Gt(o);
12
- return Gt(o);
7
+ let o = Ze(t);
8
+ const i = Ze(gt);
9
+ for (let r = 0; r < 6; r += 1)
10
+ if (o = oi(o, i, 0.22), En(o, Cn) >= Sn)
11
+ return jt(o);
12
+ return jt(o);
13
13
  }
14
14
  function ti() {
15
15
  let n = "M 280 120", o = !1, i = 0;
16
- for (let a = 150; a <= 1170; a += 62) {
16
+ for (let r = 150; r <= 1170; r += 62) {
17
17
  const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
18
- n += ` L ${p} ${a}`, o = !o, i += 1;
18
+ n += ` L ${p} ${r}`, o = !o, i += 1;
19
19
  }
20
20
  return n;
21
21
  }
22
22
  function ni(e) {
23
- const t = to(e), n = $t(Ye(t));
23
+ const t = oo(e), n = Vt(Ze(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
@@ -44,90 +44,90 @@ 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: oe(t, 0.28, -0.03),
48
+ middle: oe(t, 0.08, 0.04),
49
+ bottom: oe(t, -0.1, 0.02),
50
+ edgeStart: oe(t, 0.08, 0.08),
51
+ edgeMiddle: oe(t, -0.08, 0.08),
52
+ edgeEnd: oe(t, -0.18, 0.05),
53
+ glow: oe(t, 0.32, -0.12),
54
+ highlight: oe(t, 0.38, -0.18),
55
+ inner: oe(t, 0.24, -0.1),
56
+ shadow: oe(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
- function to(e) {
59
+ function oo(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 Ze(e) {
64
64
  return [
65
65
  Number.parseInt(e.slice(1, 3), 16),
66
66
  Number.parseInt(e.slice(3, 5), 16),
67
67
  Number.parseInt(e.slice(5, 7), 16)
68
68
  ];
69
69
  }
70
- function Gt([e, t, n]) {
70
+ function jt([e, t, n]) {
71
71
  const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
72
72
  return `#${o(e)}${o(t)}${o(n)}`;
73
73
  }
74
- function $t([e, t, n]) {
74
+ function Vt([e, t, n]) {
75
75
  const o = (i) => {
76
- const a = i / 255;
77
- return a <= 0.04045 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4;
76
+ const r = i / 255;
77
+ return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
78
78
  };
79
79
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
80
80
  }
81
- function Cn(e, t) {
82
- const n = $t(e), o = $t(t), [i, a] = n > o ? [n, o] : [o, n];
83
- return (i + 0.05) / (a + 0.05);
81
+ function En(e, t) {
82
+ const n = Vt(e), o = Vt(t), [i, r] = n > o ? [n, o] : [o, n];
83
+ return (i + 0.05) / (r + 0.05);
84
84
  }
85
85
  function oi(e, t, n) {
86
- const o = qt(n);
86
+ const o = Kt(n);
87
87
  return [
88
88
  e[0] + (t[0] - e[0]) * o,
89
89
  e[1] + (t[1] - e[1]) * o,
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));
95
- return Gt(ai(o, qt(i + n), qt(a + t)));
93
+ function oe(e, t, n) {
94
+ const [o, i, r] = ii(Ze(e));
95
+ return jt(ai(o, Kt(i + n), Kt(r + t)));
96
96
  }
97
97
  function ii([e, t, n]) {
98
- const o = e / 255, i = t / 255, a = n / 255, l = Math.max(o, i, a), p = Math.min(o, i, a), d = (l + p) / 2;
98
+ const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
99
99
  if (l === p)
100
100
  return [0, 0, d];
101
101
  const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
102
- return [(l === o ? (i - a) / c + (i < a ? 6 : 0) : l === i ? (a - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
102
+ return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
103
103
  }
104
104
  function ai(e, t, n) {
105
105
  if (t === 0)
106
106
  return [n * 255, n * 255, n * 255];
107
107
  const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
108
108
  return [
109
- Nt(i, o, e + 1 / 3) * 255,
110
- Nt(i, o, e) * 255,
111
- Nt(i, o, e - 1 / 3) * 255
109
+ zt(i, o, e + 1 / 3) * 255,
110
+ zt(i, o, e) * 255,
111
+ zt(i, o, e - 1 / 3) * 255
112
112
  ];
113
113
  }
114
- function Nt(e, t, n) {
114
+ function zt(e, t, n) {
115
115
  let o = n;
116
116
  return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
117
117
  }
118
- function qt(e) {
118
+ function Kt(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
- const no = "suggest_share_on_socials";
121
+ const io = "suggest_share_on_socials";
122
122
  function ri(e) {
123
123
  for (let t = e.length - 1; t >= 0; t -= 1) {
124
124
  const n = e[t];
125
- if (n.role !== "tool" || n.toolName !== no)
125
+ if (n.role !== "tool" || n.toolName !== io)
126
126
  continue;
127
- const o = Sn(e, t, "assistant");
127
+ const o = kn(e, t, "assistant");
128
128
  if (!o)
129
129
  return null;
130
- const i = Sn(e, o.index, "user");
130
+ const i = kn(e, o.index, "user");
131
131
  return i ? {
132
132
  id: `share:${n.callId ?? n.id}`,
133
133
  userPrompt: i.content,
@@ -142,7 +142,7 @@ async function li(e) {
142
142
  throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
143
143
  await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
144
144
  }
145
- function Sn(e, t, n) {
145
+ function kn(e, t, n) {
146
146
  for (let o = t - 1; o >= 0; o -= 1) {
147
147
  const i = e[o];
148
148
  if (i.role === n && i.content.trim())
@@ -155,9 +155,9 @@ async function pi(e) {
155
155
  }
156
156
  const si = "https://app.pluno.ai", di = "/api/product-agent/embed/active-users", ci = 1800, ui = 15e3, gi = 250, hi = 1e3, mi = 3e4;
157
157
  function fi(e, t = {}) {
158
- let n = !1, o = null, i = null, a = null;
158
+ let n = !1, o = null, i = null, r = null;
159
159
  const l = () => {
160
- a !== null && (window.clearInterval(a), a = null);
160
+ r !== null && (window.clearInterval(r), r = null);
161
161
  }, p = (u) => {
162
162
  n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
163
163
  c();
@@ -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();
171
- a = window.setInterval(() => {
170
+ const m = o, k = performance.now();
171
+ r = 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 () => {
@@ -199,12 +199,12 @@ async function wi(e) {
199
199
  });
200
200
  if (!n.ok)
201
201
  throw new Error("Failed to load active users");
202
- const o = await n.json(), i = En(o.count), a = En(o.refreshAfterMs ?? o.refresh_after_ms);
203
- if (i === null || a === null)
202
+ const o = await n.json(), i = Ln(o.count), r = Ln(o.refreshAfterMs ?? o.refresh_after_ms);
203
+ if (i === null || r === null)
204
204
  throw new Error("Invalid active users response");
205
- return { count: i, refreshAfterMs: a };
205
+ return { count: i, refreshAfterMs: r };
206
206
  }
207
- function En(e) {
207
+ function Ln(e) {
208
208
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
209
209
  }
210
210
  function bi(e) {
@@ -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 ao = 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", Ii = "product-agent:sdk-preview-socket-error", Pi = "product-agent:sdk-preview-socket-closed", In = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", ro = "data-pluno-auto-mounted", ce = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Pn = "Timed out loading Pluno widget token", Ri = "pluno.productAgent.widgetClientId.", Mt = /* @__PURE__ */ new Set(), Di = "product-agent:preview-diagnostic", lo = "pluno.productAgent.sharePromptsDisabled", zi = 3, Tn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mi = 400, Oi = 5e3, Ui = 500, An = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", ie = {
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', Nn = "pluno-pa-scribble-font", po = 190, so = 41, Rn = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, an = 420, qi = 520, ji = 0.24, rn = 680, Vi = 800, Ki = 0.76, T = 8, Le = 50, co = "http://www.w3.org/2000/svg", Yt = 26, Xt = 8, Yi = 36, Zt = 16, Xi = 4, Dn = [
228
228
  {
229
229
  ellipseCx: "17.5",
230
230
  ellipseCy: "24.5",
@@ -261,20 +261,20 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
261
261
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
262
262
  pathStrokeWidth: "2.45"
263
263
  }
264
- ], Zi = 11, Ji = 13, Yt = 4, so = 10, co = 40, Qi = "movable-launcher-position-v2", uo = "pluno-pa-widget-styles", go = "data-pluno-pa-widget-styles";
265
- let Dn = 0;
264
+ ], Zi = 11, Ji = 13, Jt = 4, uo = 10, go = 40, Qi = "movable-launcher-position-v2", ho = "pluno-pa-widget-styles", mo = "data-pluno-pa-widget-styles";
265
+ let zn = 0;
266
266
  function ea(e) {
267
- return (t) => new de(t, e);
267
+ return (t) => new ue(t, 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 ?? ie.launcherLabel,
272
+ accentColor: e.accentColor ?? ie.accentColor,
273
+ colorScheme: e.colorScheme ?? ie.colorScheme,
274
+ fontFamily: e.fontFamily ?? ie.fontFamily,
275
+ scribbleStyle: e.scribbleStyle ?? ie.scribbleStyle,
276
+ position: e.position ?? ie.position,
277
+ movableLauncher: e.movableLauncher ?? ie.movableLauncher,
278
278
  token: e.token,
279
279
  tokenProvider: e.tokenProvider,
280
280
  tokenEndpoint: e.tokenEndpoint,
@@ -306,9 +306,12 @@ async function ta(e = {}) {
306
306
  onDisplayStateChange: e.onDisplayStateChange,
307
307
  onPanelOpenChange: e.onPanelOpenChange,
308
308
  showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
309
+ morningReport: e.morningReport ?? null,
310
+ onMorningReportSnooze: e.onMorningReportSnooze,
311
+ onMorningReportTaskStart: e.onMorningReportTaskStart,
309
312
  taskNotifications: e.taskNotifications
310
313
  };
311
- J(
314
+ ne(
312
315
  "web-sdk.widget",
313
316
  "Mounting widget with merged options",
314
317
  {
@@ -330,124 +333,124 @@ async function ta(e = {}) {
330
333
  );
331
334
  const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
332
335
  i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
333
- let a = Rn(
336
+ let r = Mn(
334
337
  t.accentColor,
335
338
  t.scribbleStyle
336
339
  );
337
340
  Sa(
338
341
  i,
339
342
  t.launcherLabel,
340
- a,
343
+ r,
341
344
  t.movableLauncher,
342
345
  t.showLauncherMinimizeButton
343
346
  ), o.appendChild(i);
344
347
  const l = yr(t);
345
348
  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(
349
+ 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"), ke(
347
350
  i,
348
- zt(
351
+ Ut(
349
352
  i,
350
353
  p,
351
354
  t.position
352
355
  )
353
- )), Xn(o, t.accentColor), zn(i, a, {
356
+ )), Jn(o, t.accentColor), On(i, r, {
354
357
  accentColor: t.accentColor,
355
358
  colorScheme: t.colorScheme,
356
359
  fontFamily: t.fontFamily,
357
360
  scribbleStyle: t.scribbleStyle
358
361
  });
359
- const m = await _r(), E = m.ownerDocument, v = i.querySelector(
362
+ const m = await _r(), k = m.ownerDocument, v = i.querySelector(
360
363
  ".pluno-pa-widget__launcher"
361
- ), z = i.querySelector(
364
+ ), R = i.querySelector(
362
365
  ".pluno-pa-widget__launcher-drag-handle"
363
- ), b = i.querySelector(
366
+ ), C = i.querySelector(
364
367
  ".pluno-pa-widget__launcher-input"
365
368
  ), g = i.querySelector(
366
369
  ".pluno-pa-widget__launcher-minimize"
367
- ), w = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
370
+ ), y = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
368
371
  ".pluno-pa-widget__scribble-spirals--panel"
369
- ), P = Array.from(
372
+ ), A = Array.from(
370
373
  i.querySelectorAll(".pluno-pa-widget__resize-handle")
371
- ), T = i.querySelector(
374
+ ), L = i.querySelector(
372
375
  ".pluno-pa-widget__close"
373
- ), k = i.querySelector(
376
+ ), M = i.querySelector(
374
377
  ".pluno-pa-widget__composer"
375
- ), F = i.querySelector(
378
+ ), U = i.querySelector(
376
379
  ".pluno-pa-widget__attachment-error"
377
- ), H = i.querySelector(
380
+ ), Ie = i.querySelector(
378
381
  ".pluno-pa-widget__billing-status"
379
- ), $ = i.querySelector(
382
+ ), H = i.querySelector(
380
383
  ".pluno-pa-widget__attachments"
381
- ), Q = i.querySelector(
384
+ ), xe = i.querySelector(
382
385
  ".pluno-pa-widget__attachment-input"
383
- ), Me = i.querySelector(
386
+ ), G = i.querySelector(
384
387
  ".pluno-pa-widget__attach"
385
- ), x = i.querySelector(
388
+ ), w = i.querySelector(
386
389
  ".pluno-pa-widget__input"
387
- ), ce = i.querySelector(
390
+ ), J = i.querySelector(
388
391
  ".pluno-pa-widget__send"
389
- ), Xe = i.querySelector(
392
+ ), Je = i.querySelector(
390
393
  ".pluno-pa-widget__top-actions"
391
- ), X = i.querySelector(
394
+ ), pe = i.querySelector(
392
395
  ".pluno-pa-widget__history"
393
- ), C = i.querySelector(
396
+ ), Qe = i.querySelector(
394
397
  ".pluno-pa-widget__history-panel"
395
- ), N = i.querySelector(
398
+ ), V = i.querySelector(
396
399
  ".pluno-pa-widget__history-list"
397
- ), Ee = i.querySelector(
400
+ ), ge = i.querySelector(
398
401
  ".pluno-pa-widget__history-close"
399
- ), q = i.querySelector(
402
+ ), x = i.querySelector(
400
403
  ".pluno-pa-widget__history-status"
401
- ), R = i.querySelector(
402
- ".pluno-pa-widget__timeline-jump"
403
404
  ), D = i.querySelector(
405
+ ".pluno-pa-widget__timeline-jump"
406
+ ), $ = i.querySelector(
404
407
  ".pluno-pa-widget__active-users-counter"
405
- ), A = i.querySelector(
408
+ ), P = i.querySelector(
406
409
  ".pluno-pa-widget__timeline"
407
- ), mt = i.querySelector(
410
+ ), j = i.querySelector(
408
411
  ".pluno-pa-widget__timeline-bottom-sentinel"
409
- ), Oe = i.querySelector(
412
+ ), S = i.querySelector(
410
413
  ".pluno-pa-widget__notify-suggestion"
411
- ), Ao = i.querySelector(
414
+ ), N = i.querySelector(
412
415
  ".pluno-pa-widget__notify-suggestion-enable"
413
- ), No = i.querySelector(
416
+ ), Ro = i.querySelector(
414
417
  ".pluno-pa-widget__notify-suggestion-later"
415
418
  ), Do = i.querySelector(
416
419
  ".pluno-pa-widget__notify-suggestion-never"
417
420
  );
418
- if (!v || !b || !w || !T || !k || !F || !H || !$ || !Q || !Me || !x || !ce || !Xe || !X || !C || !N || !Ee || !q || !R || !D || !A || !mt)
421
+ if (!v || !C || !y || !L || !M || !U || !Ie || !H || !xe || !G || !w || !J || !Je || !pe || !Qe || !V || !ge || !x || !D || !$ || !P || !j)
419
422
  throw new Error("Failed to mount Pluno widget");
420
- if (t.movableLauncher && !z)
423
+ if (t.movableLauncher && !R)
421
424
  throw new Error("Failed to mount Pluno widget drag handle");
422
- Wn(b), Wn(x);
423
- let W = [], le = null;
424
- const ke = () => {
425
+ $n(C), $n(w);
426
+ let q = [], se = null;
427
+ const Pe = () => {
425
428
  Ga(
426
- $,
427
- W,
428
- (r) => {
429
- W = W.filter(
430
- (s, _) => _ !== r
431
- ), ke(), G(y.getState()), j();
429
+ H,
430
+ q,
431
+ (a) => {
432
+ q = q.filter(
433
+ (s, _) => _ !== a
434
+ ), Pe(), F(b.getState()), K();
432
435
  }
433
436
  );
434
- }, Ro = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
437
+ }, zo = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
435
438
  if (!t.tokenEndpoint)
436
439
  throw new Error("Pluno widget requires token or tokenEndpoint");
437
- return Io(t.tokenEndpoint);
438
- }), zo = window.fetch.bind(window), ft = xr(t.clientId);
439
- let y;
440
+ return Ao(t.tokenEndpoint);
441
+ }), Mo = window.fetch.bind(window), bt = xr(t.clientId);
442
+ let b;
440
443
  try {
441
- const r = {
444
+ const a = {
442
445
  token: t.token,
443
- tokenProvider: Ro,
446
+ tokenProvider: zo,
444
447
  backendUrl: t.backendUrl,
445
448
  metadata: () => ({
446
449
  ...t.metadata ?? {},
447
- ...!y.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
450
+ ...!b.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
448
451
  }),
449
452
  initialStarterPrompts: t.initialStarterPrompts,
450
- clientId: ft.clientId,
453
+ clientId: bt.clientId,
451
454
  restorePersistedState: t.restorePersistedState,
452
455
  expectedPersistedSessionId: t.expectedPersistedSessionId,
453
456
  webSocketFactory: t.webSocketFactory,
@@ -455,11 +458,11 @@ async function ta(e = {}) {
455
458
  autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0,
456
459
  disableNetworkCapture: !!t.sdkPreviewChannelId
457
460
  };
458
- y = await Jo.init(r);
459
- } catch (r) {
460
- throw ft.release(), n.remove(), r;
461
+ b = await Jo.init(a);
462
+ } catch (a) {
463
+ throw bt.release(), n.remove(), a;
461
464
  }
462
- m.appendChild(n), J(
465
+ m.appendChild(n), ne(
463
466
  "web-sdk.widget",
464
467
  "Applied initial widget appearance",
465
468
  {
@@ -469,118 +472,118 @@ async function ta(e = {}) {
469
472
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
470
473
  }
471
474
  );
472
- const wt = new Set(l.openToolGroupKeys), Le = new Set(
475
+ const _t = new Set(l.openToolGroupKeys), Te = new Set(
473
476
  l.seenShareCandidateIds
474
- ), Ze = new Set(Le);
475
- let bt = l.sharePromptsDisabled || await vr(t), Z = null, Pe = !1, we = !1, be = {
477
+ ), et = new Set(Te);
478
+ let xt = l.sharePromptsDisabled || await vr(t), Q = null, Ae = !1, he = !1, ye = {
476
479
  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
+ }, ve = 0, sn = "", me = !1, de = !1, fe = [], yt = null, Be = null;
481
+ const ee = (a, s) => {
482
+ ye = { enabled: a, reason: s };
480
483
  }, te = () => {
481
- R.hidden = !0;
482
- }, Mo = () => {
483
- R.hidden = !1;
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(
484
+ D.hidden = !0;
485
+ }, Oo = () => {
486
+ D.hidden = !1;
487
+ }, Uo = (a = "jump") => {
488
+ ee(!0, a), te(), Xe(P, () => ye.enabled), ve = P.scrollTop;
489
+ }, Ce = () => {
490
+ if (pe.hidden = t.loginRequired, Qe.hidden = !me, pe.setAttribute("aria-expanded", String(me)), V.classList.toggle(
488
491
  "pluno-pa-widget__history-list--center",
489
- pe && ge.length === 0
490
- ), N.replaceChildren(), pe && ge.length === 0) {
491
- const r = document.createElement("p");
492
- r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", N.appendChild(r);
492
+ de && fe.length === 0
493
+ ), V.replaceChildren(), de && fe.length === 0) {
494
+ const a = document.createElement("p");
495
+ a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", V.appendChild(a);
493
496
  }
494
- for (const r of ge) {
497
+ for (const a of fe) {
495
498
  const s = document.createElement("button");
496
- s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
499
+ s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = de;
497
500
  const _ = document.createElement("span");
498
- _.className = "pluno-pa-widget__history-item-title", _.textContent = ya(r);
499
- const L = document.createElement("time");
500
- L.className = "pluno-pa-widget__history-time", L.dateTime = r.lastActiveAt, L.textContent = Ca(
501
- r.lastActiveAt,
501
+ _.className = "pluno-pa-widget__history-item-title", _.textContent = ya(a);
502
+ const I = document.createElement("time");
503
+ I.className = "pluno-pa-widget__history-time", I.dateTime = a.lastActiveAt, I.textContent = Ca(
504
+ a.lastActiveAt,
502
505
  Date.now()
503
506
  );
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);
508
- }
509
- if (pe && ge.length > 0) {
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);
512
- }
513
- q.textContent = Ue ?? (!pe && ge.length === 0 ? "No recent chats for this page yet." : ""), q.hidden = q.textContent.length === 0;
514
- }, ln = async (r) => {
515
- if (!pe) {
516
- pe = !0, Ue = null, xe();
507
+ const z = document.createElement("small");
508
+ z.className = "pluno-pa-widget__history-path", z.textContent = va(a), s.append(_, I, z), s.addEventListener("click", () => {
509
+ me = !1, Be = null, Ce(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
510
+ }), V.appendChild(s);
511
+ }
512
+ if (de && fe.length > 0) {
513
+ const a = document.createElement("p");
514
+ a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", V.appendChild(a);
515
+ }
516
+ x.textContent = Be ?? (!de && fe.length === 0 ? "No recent chats for this page yet." : ""), x.hidden = x.textContent.length === 0;
517
+ }, dn = async (a) => {
518
+ if (!de) {
519
+ de = !0, Be = null, Ce();
517
520
  try {
518
- const s = await y.listSessions({ cursor: r, limit: 20 });
519
- ge = r ? [...ge, ...s.sessions] : s.sessions, _t = s.nextCursor;
521
+ const s = await b.listSessions({ cursor: a, limit: 20 });
522
+ fe = a ? [...fe, ...s.sessions] : s.sessions, yt = s.nextCursor;
520
523
  } catch (s) {
521
- J(
524
+ ne(
522
525
  "web-sdk.widget",
523
526
  "Failed to load session history",
524
527
  {
525
528
  message: s instanceof Error ? s.message : String(s)
526
529
  }
527
- ), Ue = Bi;
530
+ ), Be = Bi;
528
531
  } finally {
529
- pe = !1, xe();
532
+ de = !1, Ce();
530
533
  }
531
534
  }
532
- }, Uo = () => {
533
- !_t || pe || N.scrollHeight - N.scrollTop - N.clientHeight <= 24 && ln(_t);
534
- }, pn = () => {
535
- Pe || typeof document > "u" || (Xn(o, t.accentColor), n.isConnected || E.body?.appendChild(n));
536
- }, sn = new MutationObserver(pn);
537
- sn.observe(E.documentElement, {
535
+ }, Bo = () => {
536
+ !yt || de || V.scrollHeight - V.scrollTop - V.clientHeight <= 24 && dn(yt);
537
+ }, cn = () => {
538
+ Ae || typeof document > "u" || (Jn(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
539
+ }, un = new MutationObserver(cn);
540
+ un.observe(k.documentElement, {
538
541
  childList: !0,
539
542
  subtree: !0
540
- }), pn();
541
- const Be = (r = !0) => {
542
- const s = ct(i, r);
543
- return Xt(
543
+ }), cn();
544
+ const Fe = (a = !0) => {
545
+ const s = ht(i, a);
546
+ return Qt(
544
547
  i,
545
- p ? ho(p, s) : sa(
548
+ p ? fo(p, s) : sa(
546
549
  i,
547
550
  t.position,
548
551
  s
549
552
  ),
550
553
  s
551
554
  );
552
- }, U = () => {
553
- const r = fa(o, b, x);
555
+ }, B = () => {
556
+ const a = fa(o, C, w);
554
557
  Sr(t, {
555
558
  isOpen: i.classList.contains("pluno-pa-widget--open"),
556
- composerValue: x.value,
557
- focusedInput: r,
558
- focusedInputAt: r ? Date.now() : null,
559
- openToolGroupKeys: [...wt],
559
+ composerValue: w.value,
560
+ focusedInput: a,
561
+ focusedInputAt: a ? Date.now() : null,
562
+ openToolGroupKeys: [..._t],
560
563
  launcherPosition: d ? p : null,
561
564
  panelSize: c,
562
- seenShareCandidateIds: [...Le].slice(
563
- -oo
565
+ seenShareCandidateIds: [...Te].slice(
566
+ -ao
564
567
  ),
565
- sharePromptsDisabled: bt
568
+ sharePromptsDisabled: xt
566
569
  });
567
- }, Je = (r) => {
568
- t.onDisplayStateChange?.(r);
569
- }, Fe = (r, s = !0) => {
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");
570
+ }, tt = (a) => {
571
+ t.onDisplayStateChange?.(a);
572
+ }, He = (a, s = !0) => {
573
+ if (a === "shown") {
574
+ 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 && tt("shown");
572
575
  return;
573
576
  }
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(
577
+ Q !== null && (window.clearTimeout(Q), Q = 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, y.hidden = !0, L.hidden = !0, v.tabIndex = 0, w.value = "", ke(
575
578
  i,
576
- zt(
579
+ Ut(
577
580
  i,
578
581
  p,
579
582
  t.position
580
583
  )
581
- ), Bn(i), U(), s && Je("minimized");
582
- }, ye = (r, s = {}) => {
583
- ma(r, {
584
+ ), Hn(i), B(), s && tt("minimized");
585
+ }, Se = (a, s = {}) => {
586
+ ma(a, {
584
587
  debugVersion: Qi,
585
588
  launcherPosition: p,
586
589
  rootClasses: i.className,
@@ -590,35 +593,35 @@ async function ta(e = {}) {
590
593
  right: i.style.right,
591
594
  bottom: i.style.bottom
592
595
  },
593
- rootRect: Ot(i),
594
- launcherRect: Ot(v),
595
- panelRect: Ot(w),
596
- viewport: Y(),
597
- panelHidden: w.hidden,
598
- closeHidden: T.hidden,
596
+ rootRect: Ft(i),
597
+ launcherRect: Ft(v),
598
+ panelRect: Ft(y),
599
+ viewport: Z(),
600
+ panelHidden: y.hidden,
601
+ closeHidden: L.hidden,
599
602
  ...s
600
603
  });
601
- }, He = (r = !0) => {
604
+ }, We = (a = !0) => {
602
605
  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", {
606
+ return ke(i, null), Fe(a);
607
+ const s = Fe(a);
608
+ return ke(i, s), Se("Applied stored closed launcher position", {
606
609
  visibleLauncherPosition: s
607
610
  }), s;
608
- }, xt = (r, s) => {
609
- if (!r || !s) {
610
- Bn(i);
611
+ }, vt = (a, s) => {
612
+ if (!a || !s) {
613
+ Hn(i);
611
614
  return;
612
615
  }
613
616
  ha(i, {
614
- x: r.x - s.x,
615
- y: r.y - s.y
617
+ x: a.x - s.x,
618
+ y: a.y - s.y
616
619
  });
617
- }, dn = () => {
620
+ }, gn = () => {
618
621
  if (i.classList.contains("pluno-pa-widget--minimized")) {
619
- Ce(
622
+ ke(
620
623
  i,
621
- zt(
624
+ Ut(
622
625
  i,
623
626
  p,
624
627
  t.position
@@ -626,234 +629,234 @@ async function ta(e = {}) {
626
629
  );
627
630
  return;
628
631
  }
629
- const r = He();
632
+ const a = We();
630
633
  if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
631
- Rt(i, c);
632
- const s = ze(c);
633
- Bt(
634
+ Ot(i, c);
635
+ const s = Ue(c);
636
+ Wt(
634
637
  h,
635
638
  s.width
636
639
  );
637
- const _ = pt(
638
- u ?? Mt(
640
+ const _ = ct(
641
+ u ?? Bt(
639
642
  i,
640
- r,
643
+ a,
641
644
  t.position,
642
645
  c
643
646
  ),
644
647
  s
645
648
  );
646
- u && (u = _), xt(_, r), ye(
649
+ u && (u = _), vt(_, a), Se(
647
650
  "Applied open panel position after viewport resize",
648
651
  { openPanelPosition: _ }
649
652
  );
650
- } else p && ye(
653
+ } else p && Se(
651
654
  "Applied visible launcher position after viewport resize",
652
- { visibleLauncherPosition: r }
655
+ { visibleLauncherPosition: a }
653
656
  );
654
657
  };
655
- let cn = () => {
658
+ let hn = () => {
656
659
  };
657
- window.addEventListener("resize", dn), t.movableLauncher && z ? (He(), cn = ra({
660
+ window.addEventListener("resize", gn), t.movableLauncher && R ? (We(), hn = ra({
658
661
  root: i,
659
662
  launcher: v,
660
- launcherDragHandle: z,
661
- getPosition: () => Be(),
662
- setPosition: (r) => {
663
- const s = r, _ = ct(i), L = Xt(
663
+ launcherDragHandle: R,
664
+ getPosition: () => Fe(),
665
+ setPosition: (a) => {
666
+ const s = a, _ = ht(i), I = Qt(
664
667
  i,
665
- r,
668
+ a,
666
669
  _
667
670
  );
668
671
  p = ca(
669
- L,
672
+ I,
670
673
  _
671
- ), Ce(i, L), ye("Dragging closed launcher", {
674
+ ), ke(i, I), Se("Dragging closed launcher", {
672
675
  requestedPosition: s
673
676
  });
674
677
  },
675
678
  persist: () => {
676
- d = !0, U(), ye("Persisted closed launcher drag position");
679
+ d = !0, B(), Se("Persisted closed launcher drag position");
677
680
  }
678
- })) : Ce(i, null), Rt(i, c);
679
- const Bo = () => {
680
- const r = ze(c), s = Be();
681
+ })) : ke(i, null), Ot(i, c);
682
+ const Fo = () => {
683
+ const a = Ue(c), s = Fe();
681
684
  return {
682
- position: pt(
683
- u ?? Mt(
685
+ position: ct(
686
+ u ?? Bt(
684
687
  i,
685
688
  s,
686
689
  t.position,
687
690
  c
688
691
  ),
689
- r
692
+ a
690
693
  ),
691
- size: r
694
+ size: a
692
695
  };
693
- }, Fo = (r) => {
694
- c = gt(r.size), Rt(i, c), Bt(
696
+ }, Ho = (a) => {
697
+ c = ft(a.size), Ot(i, c), Wt(
695
698
  h,
696
- ze(c).width
697
- ), u = pt(
698
- r.position,
699
- ze(c)
699
+ Ue(c).width
700
+ ), u = ct(
701
+ a.position,
702
+ Ue(c)
700
703
  );
701
- const s = Be();
702
- xt(u, s);
703
- }, Ho = P.length > 0 ? la({
704
+ const s = Fe();
705
+ vt(u, s);
706
+ }, Wo = A.length > 0 ? la({
704
707
  root: i,
705
- handles: P,
706
- getBounds: Bo,
707
- setBounds: Fo,
708
- persist: U
708
+ handles: A,
709
+ getBounds: Fo,
710
+ setBounds: Ho,
711
+ persist: B
709
712
  }) : () => {
710
713
  };
711
- let yt = !1;
712
- const un = async () => {
713
- if (!(!t.billingStatusLoader || yt)) {
714
- yt = !0;
714
+ let Ct = !1;
715
+ const mn = async () => {
716
+ if (!(!t.billingStatusLoader || Ct)) {
717
+ Ct = !0;
715
718
  try {
716
- const r = await t.billingStatusLoader();
717
- $n(
719
+ const a = await t.billingStatusLoader();
720
+ jn(
718
721
  t.billingStatus,
719
- r,
720
- y.getState().lastErrorCode
721
- ) && (t.billingStatus = r, Ht(
722
- H,
722
+ a,
723
+ b.getState().lastErrorCode
724
+ ) && (t.billingStatus = a, $t(
725
+ Ie,
723
726
  t.billingStatus,
724
- y.getState().lastErrorCode
725
- ), j());
727
+ b.getState().lastErrorCode
728
+ ), K());
726
729
  } finally {
727
- yt = !1;
730
+ Ct = !1;
728
731
  }
729
732
  }
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(
733
+ }, we = (a = "", s = !0) => {
734
+ mn(), $e && ($e = !1, kt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Q !== null && (window.clearTimeout(Q), Q = null), He("shown", !1), y.hidden = !1, L.hidden = !1, Wt(
732
735
  h,
733
- ze(c).width
736
+ Ue(c).width
734
737
  ), i.classList.remove("pluno-pa-widget--closing");
735
- const _ = He(), L = Mt(
738
+ const _ = We(), I = Bt(
736
739
  i,
737
740
  _,
738
741
  t.position,
739
742
  c
740
743
  );
741
- if (xt(L, _), ye("Opening launcher at clamped open panel position", {
742
- openPanelPosition: L,
744
+ if (vt(I, _), Se("Opening launcher at clamped open panel position", {
745
+ openPanelPosition: I,
743
746
  visibleLauncherPosition: _
744
747
  }), 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);
748
+ i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, Ye(w)), Xe(P, () => ye.enabled), ve = P.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), tt("shown"), t.onPanelOpenChange?.(!0);
746
749
  return;
747
750
  }
748
751
  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;
752
+ i.classList.add("pluno-pa-widget--open"), a && (w.value = a, Ye(w)), Xe(P, () => ye.enabled), ve = P.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), tt("shown"), t.onPanelOpenChange?.(!0), Q = window.setTimeout(() => {
753
+ v.hidden = !0, Xe(P, () => ye.enabled), ve = P.scrollTop;
751
754
  }, 220);
752
755
  });
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");
756
+ }, St = () => {
757
+ Q !== null && (window.clearTimeout(Q), Q = null), v.hidden = !1, p && (We(!1), Se("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Q = window.setTimeout(() => {
758
+ y.hidden = !0, L.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
756
759
  }, 220);
757
760
  };
758
- v.addEventListener("submit", (r) => {
759
- r.preventDefault(), he(b.value), b.value = "";
760
- }), z?.addEventListener("click", (r) => {
761
- r.preventDefault(), r.stopPropagation();
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)
761
+ v.addEventListener("submit", (a) => {
762
+ a.preventDefault(), we(C.value), C.value = "";
763
+ }), R?.addEventListener("click", (a) => {
764
+ a.preventDefault(), a.stopPropagation();
765
+ }), v.addEventListener("click", (a) => {
766
+ a.target === C && !R || (we(C.value), C.value = "");
767
+ }), C.addEventListener("focus", () => {
768
+ we(C.value), C.value = "";
769
+ }), C.addEventListener("input", () => {
770
+ if (!C.value)
768
771
  return;
769
- const r = b.value;
770
- he(r), b.value = "";
772
+ const a = C.value;
773
+ we(a), C.value = "";
771
774
  });
772
- let vt = null, Qe = null, ve = null;
773
- const gn = (r) => r === b || r === x, Go = (r) => {
774
- if (!(r instanceof Element) || r.getRootNode() === i.getRootNode())
775
+ let Et = null, nt = null, Ee = null;
776
+ const fn = (a) => a === C || a === w, Go = (a) => {
777
+ if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
775
778
  return null;
776
- let s = r;
779
+ let s = a;
777
780
  for (; s; ) {
778
- const _ = s.closest(Pn);
781
+ const _ = s.closest(Tn);
779
782
  if (_)
780
783
  return _;
781
- const L = s.getRootNode();
782
- s = L instanceof ShadowRoot ? L.host : null;
784
+ const I = s.getRootNode();
785
+ s = I instanceof ShadowRoot ? I.host : null;
783
786
  }
784
787
  return null;
785
- }, $o = (r) => {
786
- if (!r.isConnected || !r.matches(Pn))
788
+ }, $o = (a) => {
789
+ if (!a.isConnected || !a.matches(Tn))
787
790
  return !1;
788
- if (!(r instanceof HTMLElement))
791
+ if (!(a instanceof HTMLElement))
789
792
  return !0;
790
- if (r.hidden)
793
+ if (a.hidden)
791
794
  return !1;
792
- if (typeof r.checkVisibility == "function")
793
- return r.checkVisibility();
794
- const s = window.getComputedStyle(r);
795
+ if (typeof a.checkVisibility == "function")
796
+ return a.checkVisibility();
797
+ const s = window.getComputedStyle(a);
795
798
  return s.display !== "none" && s.visibility !== "hidden";
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;
799
- (!s || !$o(s)) && hn(null);
800
- }, Ui) : ve !== null && (window.clearInterval(ve), ve = null, Qe = null));
799
+ }, wn = (a) => {
800
+ Ge !== a && (Ge = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), it(), a !== null ? Ee = window.setInterval(() => {
801
+ const s = Ge;
802
+ (!s || !$o(s)) && wn(null);
803
+ }, Ui) : Ee !== null && (window.clearInterval(Ee), Ee = null, nt = null));
801
804
  }, qo = () => {
802
- ve !== null && (window.clearInterval(ve), ve = null);
805
+ Ee !== null && (window.clearInterval(Ee), Ee = null);
803
806
  };
804
- i.addEventListener("focusin", (r) => {
805
- gn(r.target) && (vt = Date.now(), U());
806
- }), i.addEventListener("focusout", (r) => {
807
- if (!gn(r.target) || We !== null)
807
+ i.addEventListener("focusin", (a) => {
808
+ fn(a.target) && (Et = Date.now(), B());
809
+ }), i.addEventListener("focusout", (a) => {
810
+ if (!fn(a.target) || Ge !== null)
808
811
  return;
809
- const s = vt;
810
- if (vt = null, s === null || Date.now() - s > Mi)
812
+ const s = Et;
813
+ if (Et = null, s === null || Date.now() - s > Mi)
811
814
  return;
812
- const _ = Go(r.relatedTarget);
815
+ const _ = Go(a.relatedTarget);
813
816
  if (!_)
814
817
  return;
815
- const L = Date.now();
816
- if (Qe !== null && L - Qe <= Oi) {
817
- hn(_);
818
+ const I = Date.now();
819
+ if (nt !== null && I - nt <= Oi) {
820
+ wn(_);
818
821
  return;
819
822
  }
820
- Qe = L;
821
- }), v.addEventListener("keydown", (r) => {
822
- !i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(), he());
823
- }), g?.addEventListener("pointerdown", (r) => {
824
- r.stopPropagation();
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", () => {
830
- Oo();
823
+ nt = I;
824
+ }), v.addEventListener("keydown", (a) => {
825
+ !i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), we());
826
+ }), g?.addEventListener("pointerdown", (a) => {
827
+ a.stopPropagation();
828
+ }), g?.addEventListener("click", (a) => {
829
+ a.preventDefault(), a.stopPropagation(), He("minimized");
830
+ }), L.addEventListener("click", St), P.addEventListener("scroll", () => {
831
+ P.scrollTop < ve - 1 && ee(!1, "userScroll"), ve = P.scrollTop;
832
+ }), D.addEventListener("click", () => {
833
+ Uo();
831
834
  });
832
- const mn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
833
- ([r]) => {
834
- r?.isIntersecting && (ee(!0, "bottom"), te());
835
+ const bn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
836
+ ([a]) => {
837
+ a?.isIntersecting && (ee(!0, "bottom"), te());
835
838
  },
836
- { root: A, threshold: 0 }
839
+ { root: P, threshold: 0 }
837
840
  );
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;
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);
841
+ bn?.observe(j);
842
+ const ot = () => t.loginRequired || t.signupRequired;
843
+ let Ge = null, $e = !1;
844
+ const it = () => {
845
+ const a = ot(), s = Ge !== null;
846
+ C.readOnly = a || s, w.readOnly = s, C.placeholder = s ? An : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : $e ? "New update" : t.launcherLabel, w.placeholder = s ? An : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ie.launcherLabel, M.hidden = a;
847
+ }, K = () => {
848
+ J.disabled = re(t.billingStatus) || !b.getState().isThinking && w.value.trim().length === 0 && q.length === 0, G.disabled = ot() || re(t.billingStatus);
846
849
  };
847
- tt();
848
- const Ct = () => {
849
- const r = y.getState().isThinking;
850
- i.classList.toggle("pluno-pa-widget--thinking", r), i.classList.toggle(
850
+ it();
851
+ const kt = () => {
852
+ const a = b.getState().isThinking;
853
+ i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
851
854
  "pluno-pa-widget--unread",
852
- !r && Ge
853
- ), tt();
855
+ !a && $e
856
+ ), it();
854
857
  };
855
- Ct(), k.addEventListener("submit", (r) => {
856
- if (r.preventDefault(), t.loginRequired) {
858
+ kt(), M.addEventListener("submit", (a) => {
859
+ if (a.preventDefault(), t.loginRequired) {
857
860
  t.onLoginClick?.();
858
861
  return;
859
862
  }
@@ -861,158 +864,158 @@ async function ta(e = {}) {
861
864
  t.onSignupClick?.();
862
865
  return;
863
866
  }
864
- ae(t.billingStatus) || (we = !0, ee(!0, "send"), te(), W = Ut(
865
- y,
866
- x,
867
- W
868
- ), ke(), j());
867
+ re(t.billingStatus) || (he = !0, ee(!0, "send"), te(), q = Ht(
868
+ b,
869
+ w,
870
+ q
871
+ ), Pe(), K());
869
872
  });
870
- let $e = 0;
873
+ let qe = 0;
871
874
  const jo = () => {
872
- $e = 0, i.classList.remove("pluno-pa-widget--drag-over");
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;
875
+ qe = 0, i.classList.remove("pluno-pa-widget--drag-over");
876
+ }, Lt = (a) => {
877
+ se !== null && window.clearTimeout(se), U.textContent = a, U.hidden = !1, se = window.setTimeout(() => {
878
+ U.textContent = "", U.hidden = !0, se = null;
876
879
  }, 3e3);
877
880
  }, Vo = () => {
878
- le !== null && (window.clearTimeout(le), le = null), F.textContent = "", F.hidden = !0;
879
- }, Et = async (r) => {
880
- if (r.length === 0)
881
+ se !== null && (window.clearTimeout(se), se = null), U.textContent = "", U.hidden = !0;
882
+ }, It = async (a) => {
883
+ if (a.length === 0)
881
884
  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();
885
+ const s = ja(b, a);
886
+ q = [...q, ...s], Pe(), Vo(), K(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || we();
884
887
  };
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) => {
890
- St(
888
+ G.addEventListener("click", () => {
889
+ t.loginRequired || re(t.billingStatus) || xe.click();
890
+ }), xe.addEventListener("change", () => {
891
+ const a = Array.from(xe.files ?? []);
892
+ xe.value = "", It(a).catch((s) => {
893
+ Lt(
891
894
  s instanceof Error ? s.message : "Failed to attach file"
892
- ), J("web-sdk.widget", "Attachment failed", {
895
+ ), ne("web-sdk.widget", "Attachment failed", {
893
896
  message: s instanceof Error ? s.message : String(s)
894
897
  });
895
898
  });
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"));
898
- }), i.addEventListener("dragover", (r) => {
899
- const s = r.dataTransfer;
900
- !at(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
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"));
903
- }), i.addEventListener("drop", (r) => {
904
- const s = r.dataTransfer;
905
- !at(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), jo(), Et(s.files).catch((_) => {
906
- St(
899
+ }), i.addEventListener("dragenter", (a) => {
900
+ !pt(a.dataTransfer) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), qe += 1, i.classList.add("pluno-pa-widget--drag-over"));
901
+ }), i.addEventListener("dragover", (a) => {
902
+ const s = a.dataTransfer;
903
+ !pt(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
904
+ }), i.addEventListener("dragleave", (a) => {
905
+ pt(a.dataTransfer) && (a.stopPropagation(), qe = Math.max(0, qe - 1), qe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
906
+ }), i.addEventListener("drop", (a) => {
907
+ const s = a.dataTransfer;
908
+ !pt(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), jo(), It(s.files).catch((_) => {
909
+ Lt(
907
910
  _ instanceof Error ? _.message : "Failed to attach file"
908
- ), J("web-sdk.widget", "Attachment failed", {
911
+ ), ne("web-sdk.widget", "Attachment failed", {
909
912
  message: _ instanceof Error ? _.message : String(_)
910
913
  });
911
914
  }));
912
- }), i.addEventListener("paste", (r) => {
913
- r.stopPropagation();
914
- const s = r.clipboardData, _ = Array.from(s?.files ?? []);
915
- _.length === 0 || t.loginRequired || (r.preventDefault(), Et(_).catch((L) => {
916
- St(
917
- L instanceof Error ? L.message : "Failed to attach file"
918
- ), J("web-sdk.widget", "Attachment failed", {
919
- message: L instanceof Error ? L.message : String(L)
915
+ }), i.addEventListener("paste", (a) => {
916
+ a.stopPropagation();
917
+ const s = a.clipboardData, _ = Array.from(s?.files ?? []);
918
+ _.length === 0 || t.loginRequired || (a.preventDefault(), It(_).catch((I) => {
919
+ Lt(
920
+ I instanceof Error ? I.message : "Failed to attach file"
921
+ ), ne("web-sdk.widget", "Attachment failed", {
922
+ message: I instanceof Error ? I.message : String(I)
920
923
  });
921
924
  }));
922
- }), ce.addEventListener("click", () => {
925
+ }), J.addEventListener("click", () => {
923
926
  if (t.loginRequired) {
924
927
  t.onLoginClick?.();
925
928
  return;
926
929
  }
927
- if (y.getState().isThinking) {
928
- y.stop();
930
+ if (b.getState().isThinking) {
931
+ b.stop();
929
932
  return;
930
933
  }
931
- we = !0, ee(!0, "send"), te(), W = Ut(
932
- y,
933
- x,
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) => {
943
- if (!(r.key !== "Enter" || r.shiftKey)) {
944
- if (r.preventDefault(), t.loginRequired) {
934
+ he = !0, ee(!0, "send"), te(), q = Ht(
935
+ b,
936
+ w,
937
+ q
938
+ ), Pe(), K(), F(b.getState());
939
+ }), pe.addEventListener("click", () => {
940
+ me = !me, Be = null, Ce(), me && fe.length === 0 && dn(null);
941
+ }), ge.addEventListener("click", () => {
942
+ me = !1, Ce();
943
+ }), V.addEventListener("scroll", Bo), w.addEventListener("input", () => {
944
+ Ye(w), B(), K(), Xo();
945
+ }), w.addEventListener("keydown", (a) => {
946
+ if (!(a.key !== "Enter" || a.shiftKey)) {
947
+ if (a.preventDefault(), t.loginRequired) {
945
948
  t.onLoginClick?.();
946
949
  return;
947
950
  }
948
- we = !0, ee(!0, "send"), te(), W = Ut(
949
- y,
950
- x,
951
- W
952
- ), ke(), j(), G(y.getState());
953
- }
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;
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())
951
+ he = !0, ee(!0, "send"), te(), q = Ht(
952
+ b,
953
+ w,
954
+ q
955
+ ), Pe(), K(), F(b.getState());
956
+ }
957
+ }), i.addEventListener("click", (a) => {
958
+ (a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
959
+ }), l.composerValue && (w.value = l.composerValue, Ye(w)), t.initialDisplayState === "minimized" ? He("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && we(w.value, !1), wa(l, i, C, w);
960
+ const at = () => r;
961
+ let Pt = b.getState().appearance !== null, rt = null, je = null, Ne = null, _n = b.getState().isThinking, Re = null;
962
+ const Ve = t.taskNotifications;
963
+ let De = null, ze = !1;
964
+ const xn = () => {
965
+ De !== null && (window.clearTimeout(De), De = null);
966
+ }, lt = () => {
967
+ S && (S.hidden = !0);
968
+ }, yn = () => b.getState().assistantDraft.trim().length > 0, Ko = async () => {
969
+ if (!Ve || !S || ze || Ae || !b.getState().isThinking || yn())
967
970
  return;
968
- let r;
971
+ let a;
969
972
  try {
970
- r = await je.getState();
973
+ a = await Ve.getState();
971
974
  } catch {
972
975
  return;
973
976
  }
974
- r.enabled || r.neverSuggest || !y.getState().isThinking || bn() || Ne || Pe || (Oe.hidden = !1);
977
+ a.enabled || a.neverSuggest || !b.getState().isThinking || yn() || ze || Ae || (S.hidden = !1);
975
978
  };
976
- Ao?.addEventListener("click", () => {
977
- Ne = !0, it(), je?.enable().catch(() => {
979
+ N?.addEventListener("click", () => {
980
+ ze = !0, lt(), Ve?.enable().catch(() => {
978
981
  });
979
- }), No?.addEventListener("click", () => {
980
- Ne = !0, it();
982
+ }), Ro?.addEventListener("click", () => {
983
+ ze = !0, lt();
981
984
  }), Do?.addEventListener("click", () => {
982
- Ne = !0, it(), je?.dismissForever().catch(() => {
985
+ ze = !0, lt(), Ve?.dismissForever().catch(() => {
983
986
  });
984
987
  });
985
- let De = null, _n = () => {
988
+ let Me = null, vn = () => {
986
989
  };
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);
990
+ const Yo = !!t.socialPostDraftHandler, Tt = /* @__PURE__ */ new Map(), At = () => w.value.trim().length > 0 || q.length > 0, Xo = () => {
991
+ const a = Me !== null && qt(b.getState(), At());
992
+ $.hidden = !a, a && Me !== null && bo($, Me);
990
993
  };
991
- let Re = null;
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());
994
- }, It = (r) => {
995
- if (!r) {
996
- Re?.remove(), Re = null;
994
+ let Oe = null;
995
+ const Nt = (a = {}) => {
996
+ he = !0, ee(!0, "newSession"), te(), me = !1, Ce(), b.startNewSession(a), _t.clear(), w.value = "", q = [], Pe(), Ye(w), B(), K(), w.focus(), F(b.getState());
997
+ }, Rt = (a) => {
998
+ if (!a) {
999
+ Oe?.remove(), Oe = null;
997
1000
  return;
998
1001
  }
999
- Re || (Re = ht(
1002
+ Oe || (Oe = wt(
1000
1003
  "pluno-pa-widget__new-chat",
1001
1004
  "New chat",
1002
1005
  za(),
1003
1006
  !1
1004
- ), Re.addEventListener("click", () => xn()), Xe.insertBefore(Re, X));
1005
- }, G = (r) => {
1006
- if (xe(), an(r.lastErrorCode) ? Te = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Te = null), Ht(
1007
- H,
1007
+ ), Oe.addEventListener("click", () => Nt()), Je.insertBefore(Oe, pe));
1008
+ }, F = (a) => {
1009
+ if (Ce(), pn(a.lastErrorCode) ? Re = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Re = null), $t(
1010
+ Ie,
1008
1011
  t.billingStatus,
1009
- Te
1012
+ Re
1010
1013
  ), t.loginRequired) {
1011
- Lt.clear(), Kn(
1012
- A,
1013
- ce,
1014
- It,
1015
- nt,
1014
+ Tt.clear(), Xn(
1015
+ P,
1016
+ J,
1017
+ Rt,
1018
+ at,
1016
1019
  "Log in to use Pluno on this page.",
1017
1020
  t.loginButtonLabel,
1018
1021
  t.loginUrl,
@@ -1021,11 +1024,11 @@ async function ta(e = {}) {
1021
1024
  return;
1022
1025
  }
1023
1026
  if (t.signupRequired) {
1024
- Lt.clear(), Kn(
1025
- A,
1026
- ce,
1027
- It,
1028
- nt,
1027
+ Tt.clear(), Xn(
1028
+ P,
1029
+ J,
1030
+ Rt,
1031
+ at,
1029
1032
  "Complete signup to unlock your free trial credits.",
1030
1033
  t.signupButtonLabel,
1031
1034
  t.signupUrl,
@@ -1033,67 +1036,75 @@ async function ta(e = {}) {
1033
1036
  );
1034
1037
  return;
1035
1038
  }
1036
- const s = _a(r), _ = s !== rn;
1037
- rn = s;
1038
- const L = we || be.enabled;
1039
- we = !1, Qa(
1040
- A,
1041
- mt,
1042
- ce,
1043
- It,
1044
- D,
1045
- r,
1046
- De,
1047
- De !== null && Wt(r, Pt()),
1048
- L,
1049
- () => be.enabled,
1050
- wt,
1051
- Lt,
1052
- U,
1053
- nt,
1054
- (M) => {
1055
- we = !0, ee(!0, "send"), te(), y.sendMessage(M);
1039
+ const s = _a(a), _ = s !== sn;
1040
+ sn = s;
1041
+ const I = he || ye.enabled;
1042
+ he = !1, Qa(
1043
+ P,
1044
+ j,
1045
+ J,
1046
+ Rt,
1047
+ $,
1048
+ a,
1049
+ Me,
1050
+ Me !== null && qt(a, At()),
1051
+ I,
1052
+ () => ye.enabled,
1053
+ _t,
1054
+ Tt,
1055
+ B,
1056
+ at,
1057
+ (z) => {
1058
+ const Ke = t.morningReport !== null;
1059
+ t.morningReport = null, Ke && (t.onMorningReportTaskStart?.(), Nt()), he = !0, ee(!0, "send"), te(), b.sendMessage(z);
1060
+ },
1061
+ () => {
1062
+ he = !0, ee(!0, "send"), te(), b.retryLastMessage();
1056
1063
  },
1057
- Yo && !bt ? {
1058
- dismissedCandidateIds: Ze,
1059
- draftingCandidateId: ot,
1060
- error: qe,
1061
- characterIconOptions: nt(),
1062
- onSeen: (M) => {
1063
- Le.add(M.id), U();
1064
+ t.morningReport,
1065
+ () => {
1066
+ t.morningReport = null, t.onMorningReportSnooze?.(), St(), F(b.getState());
1067
+ },
1068
+ Yo && !xt ? {
1069
+ dismissedCandidateIds: et,
1070
+ draftingCandidateId: rt,
1071
+ error: je,
1072
+ characterIconOptions: at(),
1073
+ onSeen: (z) => {
1074
+ Te.add(z.id), B();
1064
1075
  },
1065
- onDraft: (M) => {
1066
- Zo(M);
1076
+ onDraft: (z) => {
1077
+ Zo(z);
1067
1078
  },
1068
- onDismiss: (M) => {
1069
- Le.add(M.id), Ze.add(M.id), U(), qe = null, G(y.getState());
1079
+ onDismiss: (z) => {
1080
+ Te.add(z.id), et.add(z.id), B(), je = null, F(b.getState());
1070
1081
  },
1071
- onDisable: (M) => {
1072
- bt = !0, Le.add(M.id), Ze.add(M.id), U(), Cr(t, !0), qe = null, G(y.getState());
1082
+ onDisable: (z) => {
1083
+ xt = !0, Te.add(z.id), et.add(z.id), B(), Cr(t, !0), je = null, F(b.getState());
1073
1084
  }
1074
1085
  } : void 0
1075
- ), L ? (_e = A.scrollTop, te()) : _ && xa(r) && Mo();
1086
+ ), I ? (ve = P.scrollTop, te()) : _ && xa(a) && Oo();
1076
1087
  };
1077
- return _n = fi(
1078
- (r) => {
1079
- De = r, !Pe && Wt(y.getState(), Pt()) && G(y.getState());
1088
+ return vn = fi(
1089
+ (a) => {
1090
+ Me = a, !Ae && qt(b.getState(), At()) && F(b.getState());
1080
1091
  },
1081
1092
  {
1082
1093
  backendUrl: t.backendUrl,
1083
- fetcher: zo,
1094
+ fetcher: Mo,
1084
1095
  loader: t.activeUsersLoader
1085
1096
  }
1086
- ), y.on("state", (r) => {
1087
- 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(
1097
+ ), b.on("state", (a) => {
1098
+ const s = _n && !a.isThinking;
1099
+ _n = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Ve && !ze && De === null && S?.hidden !== !1 && (De = window.setTimeout(() => {
1100
+ De = null, Ko();
1101
+ }, yi)), (!a.isThinking || a.assistantDraft.trim()) && (xn(), lt()), s && !i.classList.contains("pluno-pa-widget--open") && ($e = !0), kt(), a.appearance ? (Pt = !0, ne(
1091
1102
  "web-sdk.widget",
1092
1103
  "Agent state supplied appearance",
1093
1104
  {
1094
- appearance: r.appearance
1105
+ appearance: a.appearance
1095
1106
  }
1096
- ), Tt(r.appearance, "agent.state.appearance")) : kt && (kt = !1, J(
1107
+ ), Dt(a.appearance, "agent.state.appearance")) : Pt && (Pt = !1, ne(
1097
1108
  "web-sdk.widget",
1098
1109
  "Agent state cleared appearance; reverting to configured widget options",
1099
1110
  {
@@ -1101,30 +1112,30 @@ async function ta(e = {}) {
1101
1112
  fallbackColorScheme: t.colorScheme,
1102
1113
  fallbackFontFamily: t.fontFamily
1103
1114
  }
1104
- ), Tt({}, "agent.state.appearance-cleared")), G(r), j(), s && un();
1105
- }), G(y.getState()), j(), {
1106
- agent: y,
1107
- startNewChat: xn,
1115
+ ), Dt({}, "agent.state.appearance-cleared")), F(a), K(), s && mn();
1116
+ }), F(b.getState()), K(), {
1117
+ agent: b,
1118
+ startNewChat: Nt,
1108
1119
  host: n,
1109
- updateAppearance: (r) => {
1110
- r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), Tt(r, "widgetHandle.updateAppearance");
1120
+ updateAppearance: (a) => {
1121
+ a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Dt(a, "widgetHandle.updateAppearance");
1111
1122
  },
1112
- updateBillingStatus: (r) => {
1113
- const s = r ?? null;
1114
- $n(
1123
+ updateBillingStatus: (a) => {
1124
+ const s = a ?? null;
1125
+ jn(
1115
1126
  t.billingStatus,
1116
1127
  s,
1117
- Te
1118
- ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Te = null), Ht(
1128
+ Re
1129
+ ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Re = null), $t(
1119
1130
  i.querySelector(".pluno-pa-widget__billing-status"),
1120
1131
  t.billingStatus,
1121
- Te
1122
- ), j());
1132
+ Re
1133
+ ), K());
1123
1134
  },
1124
- 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(
1135
+ updateAuthGate: (a) => {
1136
+ const s = ot();
1137
+ t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), it(), F(b.getState()), K(), s && !ot() && b.connect().catch((_) => {
1138
+ ne(
1128
1139
  "web-sdk.widget",
1129
1140
  "Failed to connect after auth gate cleared",
1130
1141
  {
@@ -1134,63 +1145,67 @@ async function ta(e = {}) {
1134
1145
  });
1135
1146
  },
1136
1147
  openPanel: () => {
1137
- he(x.value, !1);
1148
+ we(w.value, !1);
1138
1149
  },
1139
- updateDisplayState: (r) => {
1140
- if (r === "shown") {
1141
- Fe("shown", !1);
1150
+ closePanel: St,
1151
+ updateDisplayState: (a) => {
1152
+ if (a === "shown") {
1153
+ He("shown", !1);
1142
1154
  return;
1143
1155
  }
1144
- Fe("minimized", !1);
1156
+ He("minimized", !1);
1157
+ },
1158
+ updateMorningReport: (a) => {
1159
+ t.morningReport = a ?? null, F(b.getState());
1145
1160
  },
1146
1161
  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());
1162
+ Ae || (B(), Ae = !0, un.disconnect(), bn?.disconnect(), qo(), window.removeEventListener("resize", gn), hn(), Wo(), se !== null && window.clearTimeout(se), xn(), vn(), Ne?.remove(), b.destroy(), bt.release(), n.remove());
1148
1163
  }
1149
1164
  };
1150
- async function Zo(r) {
1151
- if (!ot) {
1152
- ot = r.id, qe = null, G(y.getState());
1165
+ async function Zo(a) {
1166
+ if (!rt) {
1167
+ rt = a.id, je = null, F(b.getState());
1153
1168
  try {
1154
1169
  if (!t.socialPostDraftHandler)
1155
1170
  throw new Error("Social post drafting is not available here.");
1156
- const s = await t.socialPostDraftHandler(r);
1171
+ const s = await t.socialPostDraftHandler(a);
1157
1172
  if (!s.linkedinPost || !s.xPost)
1158
1173
  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, {
1174
+ Te.add(a.id), et.add(a.id), B(), Ne?.remove(), Ne = lr(s, {
1160
1175
  socialPostRewardsUrl: t.socialPostRewardsUrl,
1161
1176
  onClose: () => {
1162
- Ie?.remove(), Ie = null;
1177
+ Ne?.remove(), Ne = null;
1163
1178
  }
1164
- }), i.appendChild(Ie);
1179
+ }), i.appendChild(Ne);
1165
1180
  } catch (s) {
1166
- qe = s instanceof Error ? s.message : "Could not draft social post.";
1181
+ je = s instanceof Error ? s.message : "Could not draft social post.";
1167
1182
  } finally {
1168
- ot = null, G(y.getState());
1183
+ rt = null, F(b.getState());
1169
1184
  }
1170
1185
  }
1171
1186
  }
1172
- 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;
1174
- a = Rn(
1187
+ function Dt(a, s) {
1188
+ const _ = a.accentColor ?? t.accentColor, I = a.colorScheme ?? t.colorScheme, z = a.fontFamily ?? t.fontFamily, Ke = a.scribbleStyle ?? t.scribbleStyle;
1189
+ r = Mn(
1175
1190
  _,
1176
- At
1177
- ), zn(i, a, {
1191
+ Ke
1192
+ ), On(i, r, {
1178
1193
  accentColor: _,
1179
- colorScheme: L,
1180
- fontFamily: M,
1181
- scribbleStyle: At
1182
- }), J("web-sdk.widget", "Updated widget appearance", {
1194
+ colorScheme: I,
1195
+ fontFamily: z,
1196
+ scribbleStyle: Ke
1197
+ }), ne("web-sdk.widget", "Updated widget appearance", {
1183
1198
  source: s,
1184
- inputAppearance: r,
1199
+ inputAppearance: a,
1185
1200
  appliedAccentColor: _,
1186
- appliedColorScheme: L,
1187
- appliedFontFamily: M,
1188
- appliedScribbleStyle: At,
1201
+ appliedColorScheme: I,
1202
+ appliedFontFamily: z,
1203
+ appliedScribbleStyle: Ke,
1189
1204
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
1190
1205
  });
1191
1206
  }
1192
1207
  }
1193
- function Rn(e, t) {
1208
+ function Mn(e, t) {
1194
1209
  return { accentColor: e, scribbleStyle: t };
1195
1210
  }
1196
1211
  function na(e) {
@@ -1211,12 +1226,12 @@ function oa(e) {
1211
1226
  }
1212
1227
  function ia([e, t, n]) {
1213
1228
  const o = (i) => {
1214
- const a = i / 255;
1215
- return a <= 0.03928 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4;
1229
+ const r = i / 255;
1230
+ return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
1216
1231
  };
1217
1232
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
1218
1233
  }
1219
- function zn(e, t, n) {
1234
+ function On(e, t, n) {
1220
1235
  e.classList.toggle(
1221
1236
  "pluno-pa-widget--dark",
1222
1237
  n.colorScheme === "dark"
@@ -1224,7 +1239,7 @@ function zn(e, t, n) {
1224
1239
  "pluno-pa-widget--light",
1225
1240
  n.colorScheme !== "dark"
1226
1241
  ), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
1227
- const o = n.scribbleStyle ? eo(n.accentColor) : n.accentColor;
1242
+ const o = n.scribbleStyle ? no(n.accentColor) : n.accentColor;
1228
1243
  e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
1229
1244
  "--pluno-pa-accent-contrast",
1230
1245
  na(o)
@@ -1232,19 +1247,19 @@ function zn(e, t, n) {
1232
1247
  const i = Array.from(
1233
1248
  e.querySelectorAll(".pluno-pa-widget__character")
1234
1249
  );
1235
- for (const a of i)
1236
- a.replaceWith(
1237
- fe(
1238
- Array.from(a.classList).join(" "),
1250
+ for (const r of i)
1251
+ r.replaceWith(
1252
+ _e(
1253
+ Array.from(r.classList).join(" "),
1239
1254
  t
1240
1255
  )
1241
1256
  );
1242
1257
  }
1243
1258
  function aa(e) {
1244
- if (e.getElementById(Tn))
1259
+ if (e.getElementById(Nn))
1245
1260
  return;
1246
1261
  const t = e.createElement("style");
1247
- t.id = Tn, t.textContent = `@font-face {
1262
+ t.id = Nn, t.textContent = `@font-face {
1248
1263
  font-family: "Architects Daughter";
1249
1264
  font-style: normal;
1250
1265
  font-weight: 400;
@@ -1258,40 +1273,40 @@ function ra({
1258
1273
  launcherDragHandle: n,
1259
1274
  getPosition: o,
1260
1275
  setPosition: i,
1261
- persist: a
1276
+ persist: r
1262
1277
  }) {
1263
1278
  let l = null, p = null, d = null, c = !1, u = null;
1264
1279
  const m = () => {
1265
1280
  l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1266
- }, E = (h) => {
1281
+ }, k = (h) => {
1267
1282
  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
1283
  }, v = (h) => {
1269
1284
  if (l !== h.pointerId || !p || !d)
1270
1285
  return;
1271
1286
  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
- l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, a()), m());
1276
- }, b = (h) => {
1287
+ const A = h.clientX - p.x, L = h.clientY - p.y;
1288
+ !c && Math.hypot(A, L) < Jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + A, y: d.y + L }));
1289
+ }, R = (h) => {
1290
+ l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
1291
+ }, C = (h) => {
1277
1292
  l === h.pointerId && (h.preventDefault(), m());
1278
1293
  }, g = (h) => {
1279
1294
  if (!u)
1280
1295
  return;
1281
- const P = Math.hypot(
1296
+ const A = Math.hypot(
1282
1297
  h.clientX - u.x,
1283
1298
  h.clientY - u.y
1284
- ) <= Yt;
1285
- u = null, P && (h.preventDefault(), h.stopPropagation());
1286
- }, w = (h) => {
1299
+ ) <= Jt;
1300
+ u = null, A && (h.preventDefault(), h.stopPropagation());
1301
+ }, y = (h) => {
1287
1302
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1288
1303
  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());
1304
+ const A = h.shiftKey ? go : uo, L = o();
1305
+ let M = null;
1306
+ h.key === "ArrowUp" ? M = { x: L.x, y: L.y - A } : h.key === "ArrowDown" ? M = { x: L.x, y: L.y + A } : h.key === "ArrowLeft" ? M = { x: L.x - A, y: L.y } : h.key === "ArrowRight" && (M = { x: L.x + A, y: L.y }), M && (h.preventDefault(), h.stopPropagation(), i(M), r());
1292
1307
  };
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);
1308
+ return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", R), t.addEventListener("pointercancel", C), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
1309
+ t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", R), t.removeEventListener("pointercancel", C), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
1295
1310
  };
1296
1311
  }
1297
1312
  function la({
@@ -1301,243 +1316,243 @@ function la({
1301
1316
  setBounds: o,
1302
1317
  persist: i
1303
1318
  }) {
1304
- let a = null, l = null, p = null, d = null, c = !1;
1319
+ let r = null, l = null, p = null, d = null, c = !1;
1305
1320
  const u = () => {
1306
- a = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1321
+ r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1307
1322
  }, 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
- if (a !== g.pointerId || !l || !p || !d)
1323
+ const y = g.currentTarget, h = y.dataset.resizeDirection;
1324
+ !e.classList.contains("pluno-pa-widget--open") || !Un(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, y.setPointerCapture?.(g.pointerId));
1325
+ }, k = (g) => {
1326
+ if (r !== g.pointerId || !l || !p || !d)
1312
1327
  return;
1313
1328
  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)
1329
+ const y = g.clientX - p.x, h = g.clientY - p.y;
1330
+ !c && Math.hypot(y, h) < Jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1331
+ Bn(d, l, y, h)
1317
1332
  ));
1318
1333
  }, v = (g) => {
1319
- a === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
1320
- }, z = (g) => {
1321
- 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()));
1334
+ r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
1335
+ }, R = (g) => {
1336
+ r === g.pointerId && (g.preventDefault(), u());
1337
+ }, C = (g) => {
1338
+ const h = g.currentTarget.dataset.resizeDirection, A = g.shiftKey ? go : uo, L = n();
1339
+ let M = 0, U = 0;
1340
+ Un(h) && (g.key === "ArrowLeft" ? M = -A : g.key === "ArrowRight" ? M = A : g.key === "ArrowUp" ? U = -A : g.key === "ArrowDown" && (U = A), !(M === 0 && U === 0) && (g.preventDefault(), g.stopPropagation(), o(Bn(L, h, M, U)), i()));
1326
1341
  };
1327
1342
  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);
1343
+ g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", R), g.addEventListener("keydown", C);
1329
1344
  return () => {
1330
1345
  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);
1346
+ g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", R), g.removeEventListener("keydown", C);
1332
1347
  };
1333
1348
  }
1334
- function Mn(e) {
1349
+ function Un(e) {
1335
1350
  return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
1336
1351
  }
1337
- function On(e, t, n, o) {
1338
- const i = Y(), a = Un({
1352
+ function Bn(e, t, n, o) {
1353
+ const i = Z(), r = Fn({
1339
1354
  leading: e.position.x,
1340
1355
  length: e.size.width,
1341
1356
  delta: n,
1342
1357
  resizeLeading: t.endsWith("left") || t === "left",
1343
1358
  resizeTrailing: t.endsWith("right") || t === "right",
1344
- minLeading: I,
1345
- maxTrailing: i.width - I,
1359
+ minLeading: T,
1360
+ maxTrailing: i.width - T,
1346
1361
  minLength: Math.min(
1347
- tn,
1348
- i.width - I * 2
1362
+ an,
1363
+ i.width - T * 2
1349
1364
  )
1350
- }), l = Un({
1365
+ }), l = Fn({
1351
1366
  leading: e.position.y,
1352
1367
  length: e.size.height,
1353
1368
  delta: o,
1354
1369
  resizeLeading: t.startsWith("top") || t === "top",
1355
1370
  resizeTrailing: t.startsWith("bottom") || t === "bottom",
1356
- minLeading: Se,
1357
- maxTrailing: i.height - I,
1371
+ minLeading: Le,
1372
+ maxTrailing: i.height - T,
1358
1373
  minLength: Math.min(
1359
- nn,
1360
- i.height - Se - I
1374
+ rn,
1375
+ i.height - Le - T
1361
1376
  )
1362
1377
  });
1363
1378
  return {
1364
- position: { x: a.leading, y: l.leading },
1365
- size: { width: a.length, height: l.length }
1379
+ position: { x: r.leading, y: l.leading },
1380
+ size: { width: r.length, height: l.length }
1366
1381
  };
1367
1382
  }
1368
- function Un({
1383
+ function Fn({
1369
1384
  leading: e,
1370
1385
  length: t,
1371
1386
  delta: n,
1372
1387
  resizeLeading: o,
1373
1388
  resizeTrailing: i,
1374
- minLeading: a,
1389
+ minLeading: r,
1375
1390
  maxTrailing: l,
1376
1391
  minLength: p
1377
1392
  }) {
1378
1393
  const d = e + t;
1379
1394
  if (o) {
1380
1395
  const c = e + n;
1381
- if (c >= a) {
1382
- const m = K(c, a, d - p);
1396
+ if (c >= r) {
1397
+ const m = X(c, r, d - p);
1383
1398
  return { leading: m, length: d - m };
1384
1399
  }
1385
- const u = K(
1386
- d + a - c,
1400
+ const u = X(
1401
+ d + r - c,
1387
1402
  d,
1388
1403
  l
1389
1404
  );
1390
- return { leading: a, length: u - a };
1405
+ return { leading: r, length: u - r };
1391
1406
  }
1392
1407
  if (i) {
1393
1408
  const c = d + n;
1394
1409
  if (c <= l) {
1395
- const m = K(
1410
+ const m = X(
1396
1411
  c,
1397
1412
  e + p,
1398
1413
  l
1399
1414
  );
1400
1415
  return { leading: e, length: m - e };
1401
1416
  }
1402
- const u = K(
1417
+ const u = X(
1403
1418
  e - (c - l),
1404
- a,
1419
+ r,
1405
1420
  e
1406
1421
  );
1407
1422
  return { leading: u, length: l - u };
1408
1423
  }
1409
1424
  return { leading: e, length: t };
1410
1425
  }
1411
- function ct(e, t = !0) {
1412
- const n = Y();
1426
+ function ht(e, t = !0) {
1427
+ const n = Z();
1413
1428
  if (e.classList.contains("pluno-pa-widget--minimized"))
1414
1429
  return e.classList.contains("pluno-pa-widget--scribble") ? {
1415
1430
  width: Hi,
1416
1431
  height: Wi
1417
- } : { width: An, height: An };
1432
+ } : { width: Rn, height: Rn };
1418
1433
  const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1419
1434
  return {
1420
- width: t && i && o.width > 0 ? o.width : Math.min(ro, n.width - 36),
1421
- height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i : lo
1435
+ width: t && i && o.width > 0 ? o.width : Math.min(po, n.width - 36),
1436
+ height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i : so
1422
1437
  };
1423
1438
  }
1424
1439
  function pa() {
1425
- const e = Y();
1440
+ const e = Z();
1426
1441
  return {
1427
1442
  width: Math.min(
1428
- K(
1443
+ X(
1429
1444
  e.width * ji,
1430
- tn,
1445
+ an,
1431
1446
  qi
1432
1447
  ),
1433
- e.width - I * 2
1448
+ e.width - T * 2
1434
1449
  ),
1435
1450
  height: Math.min(
1436
- K(
1451
+ X(
1437
1452
  e.height * Ki,
1438
- nn,
1453
+ rn,
1439
1454
  Vi
1440
1455
  ),
1441
- e.height - Se - I
1456
+ e.height - Le - T
1442
1457
  )
1443
1458
  };
1444
1459
  }
1445
- function ze(e = null) {
1446
- return e ? gt(e) : pa();
1460
+ function Ue(e = null) {
1461
+ return e ? ft(e) : pa();
1447
1462
  }
1448
- function gt(e) {
1449
- const t = Y();
1463
+ function ft(e) {
1464
+ const t = Z();
1450
1465
  return {
1451
- width: K(
1466
+ width: X(
1452
1467
  e.width,
1453
1468
  Math.min(
1454
- tn,
1455
- t.width - I * 2
1469
+ an,
1470
+ t.width - T * 2
1456
1471
  ),
1457
1472
  Math.max(
1458
- I,
1459
- t.width - I * 2
1473
+ T,
1474
+ t.width - T * 2
1460
1475
  )
1461
1476
  ),
1462
- height: K(
1477
+ height: X(
1463
1478
  e.height,
1464
1479
  Math.min(
1465
- nn,
1466
- t.height - Se - I
1480
+ rn,
1481
+ t.height - Le - T
1467
1482
  ),
1468
1483
  Math.max(
1469
- I,
1470
- t.height - Se - I
1484
+ T,
1485
+ t.height - Le - T
1471
1486
  )
1472
1487
  )
1473
1488
  };
1474
1489
  }
1475
- function Rt(e, t) {
1490
+ function Ot(e, t) {
1476
1491
  if (!t) {
1477
1492
  e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
1478
1493
  return;
1479
1494
  }
1480
- const n = gt(t);
1495
+ const n = ft(t);
1481
1496
  e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
1482
1497
  }
1483
1498
  function sa(e, t, n) {
1484
1499
  const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
1485
1500
  if (Number.isFinite(o) && Number.isFinite(i))
1486
1501
  return { x: o, y: i };
1487
- const a = e.getBoundingClientRect();
1488
- if (a.width > 0 || a.height > 0)
1489
- return { x: a.left, y: a.top };
1490
- const l = Y();
1502
+ const r = e.getBoundingClientRect();
1503
+ if (r.width > 0 || r.height > 0)
1504
+ return { x: r.left, y: r.top };
1505
+ const l = Z();
1491
1506
  return {
1492
1507
  x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
1493
1508
  y: l.height - 24 - n.height
1494
1509
  };
1495
1510
  }
1496
- function zt(e, t, n) {
1497
- const o = ct(e, !1);
1498
- return t ? Xt(
1511
+ function Ut(e, t, n) {
1512
+ const o = ht(e, !1);
1513
+ return t ? Qt(
1499
1514
  e,
1500
- ho(t, o),
1515
+ fo(t, o),
1501
1516
  o
1502
1517
  ) : da(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Gi);
1503
1518
  }
1504
1519
  function da(e, t, n) {
1505
- const o = Y();
1520
+ const o = Z();
1506
1521
  return {
1507
1522
  x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
1508
1523
  y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
1509
1524
  };
1510
1525
  }
1511
- function Xt(e, t, n) {
1512
- const o = Y(), i = I + ga(e);
1526
+ function Qt(e, t, n) {
1527
+ const o = Z(), i = T + ga(e);
1513
1528
  return {
1514
- x: K(
1529
+ x: X(
1515
1530
  t.x,
1516
- I,
1531
+ T,
1517
1532
  Math.max(
1518
- I,
1519
- o.width - n.width - I
1533
+ T,
1534
+ o.width - n.width - T
1520
1535
  )
1521
1536
  ),
1522
- y: K(
1537
+ y: X(
1523
1538
  t.y,
1524
1539
  i,
1525
1540
  Math.max(
1526
1541
  i,
1527
- o.height - n.height - I
1542
+ o.height - n.height - T
1528
1543
  )
1529
1544
  )
1530
1545
  };
1531
1546
  }
1532
- function ho(e, t) {
1533
- const n = Y();
1547
+ function fo(e, t) {
1548
+ const n = Z();
1534
1549
  return {
1535
1550
  x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
1536
1551
  y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
1537
1552
  };
1538
1553
  }
1539
1554
  function ca(e, t) {
1540
- const n = ua(e, t), o = Y();
1555
+ const n = ua(e, t), o = Z();
1541
1556
  return {
1542
1557
  anchor: n,
1543
1558
  x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
@@ -1545,41 +1560,41 @@ function ca(e, t) {
1545
1560
  };
1546
1561
  }
1547
1562
  function ua(e, t) {
1548
- const n = Y(), o = e.x + t.width / 2, a = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
1549
- return `${a}-${l}`;
1563
+ const n = Z(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
1564
+ return `${r}-${l}`;
1550
1565
  }
1551
1566
  function ga(e) {
1552
1567
  return e.classList.contains("pluno-pa-widget--scribble") ? Ji : Zi;
1553
1568
  }
1554
- function Mt(e, t, n, o = null) {
1555
- const i = ct(e), a = ze(o), l = {
1556
- x: n === "bottom-left" ? t.x : t.x + i.width - a.width,
1557
- y: t.y + i.height - a.height
1569
+ function Bt(e, t, n, o = null) {
1570
+ const i = ht(e), r = Ue(o), l = {
1571
+ x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
1572
+ y: t.y + i.height - r.height
1558
1573
  };
1559
- return pt(l, a);
1574
+ return ct(l, r);
1560
1575
  }
1561
- function pt(e, t) {
1562
- const n = Y();
1576
+ function ct(e, t) {
1577
+ const n = Z();
1563
1578
  return {
1564
- x: K(
1579
+ x: X(
1565
1580
  e.x,
1566
- I,
1581
+ T,
1567
1582
  Math.max(
1568
- I,
1569
- n.width - t.width - I
1583
+ T,
1584
+ n.width - t.width - T
1570
1585
  )
1571
1586
  ),
1572
- y: K(
1587
+ y: X(
1573
1588
  e.y,
1574
- Se,
1589
+ Le,
1575
1590
  Math.max(
1576
- Se,
1577
- n.height - t.height - I
1591
+ Le,
1592
+ n.height - t.height - T
1578
1593
  )
1579
1594
  )
1580
1595
  };
1581
1596
  }
1582
- function Ce(e, t) {
1597
+ function ke(e, t) {
1583
1598
  if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
1584
1599
  e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
1585
1600
  return;
@@ -1589,16 +1604,16 @@ function Ce(e, t) {
1589
1604
  function ha(e, t) {
1590
1605
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1591
1606
  }
1592
- function Bn(e) {
1607
+ function Hn(e) {
1593
1608
  e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
1594
1609
  }
1595
- function Y() {
1610
+ function Z() {
1596
1611
  return {
1597
- width: window.innerWidth || document.documentElement.clientWidth || ro + I * 2,
1598
- height: window.innerHeight || document.documentElement.clientHeight || lo + I * 2
1612
+ width: window.innerWidth || document.documentElement.clientWidth || po + T * 2,
1613
+ height: window.innerHeight || document.documentElement.clientHeight || so + T * 2
1599
1614
  };
1600
1615
  }
1601
- function Ot(e) {
1616
+ function Ft(e) {
1602
1617
  const t = e.getBoundingClientRect();
1603
1618
  return {
1604
1619
  x: Math.round(t.x),
@@ -1607,10 +1622,10 @@ function Ot(e) {
1607
1622
  height: Math.round(t.height)
1608
1623
  };
1609
1624
  }
1610
- function K(e, t, n) {
1625
+ function X(e, t, n) {
1611
1626
  return Math.min(Math.max(e, t), n);
1612
1627
  }
1613
- function J(e, t, n) {
1628
+ function ne(e, t, n) {
1614
1629
  if (typeof window > "u")
1615
1630
  return;
1616
1631
  const o = window, i = {
@@ -1618,15 +1633,15 @@ function J(e, t, n) {
1618
1633
  source: e,
1619
1634
  message: t,
1620
1635
  details: n
1621
- }, a = o.__plunoProductAgentDiagnostics__ ?? [];
1622
- a.push(i), a.length > 120 && a.splice(0, a.length - 120), o.__plunoProductAgentDiagnostics__ = a, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...a], window.dispatchEvent(
1623
- new CustomEvent(Ri, { detail: i })
1636
+ }, r = o.__plunoProductAgentDiagnostics__ ?? [];
1637
+ r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
1638
+ new CustomEvent(Di, { detail: i })
1624
1639
  );
1625
1640
  }
1626
1641
  function ma(e, t) {
1627
- J("web-sdk.widget.position", e, t);
1642
+ ne("web-sdk.widget.position", e, t);
1628
1643
  }
1629
- function Ut(e, t, n) {
1644
+ function Ht(e, t, n) {
1630
1645
  const o = t.value.trim();
1631
1646
  return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
1632
1647
  attachments: n.length > 0 ? n.map(ba) : void 0
@@ -1647,12 +1662,12 @@ function wa(e, t, n, o) {
1647
1662
  function ba(e) {
1648
1663
  return e;
1649
1664
  }
1650
- function Ve(e) {
1665
+ function Ye(e) {
1651
1666
  e.style.height = "0px";
1652
1667
  const t = Math.max(22, Math.min(e.scrollHeight, 140));
1653
1668
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
1654
1669
  }
1655
- function Ke(e, t = () => !0) {
1670
+ function Xe(e, t = () => !0) {
1656
1671
  e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
1657
1672
  t() && (e.scrollTop = e.scrollHeight);
1658
1673
  });
@@ -1694,15 +1709,15 @@ function Ca(e, t) {
1694
1709
  ["hour", 36e5],
1695
1710
  ["min", 6e4]
1696
1711
  ];
1697
- for (const [a, l] of i)
1712
+ for (const [r, l] of i)
1698
1713
  if (o >= l) {
1699
1714
  const p = Math.max(1, Math.floor(o / l));
1700
- return a === "min" ? `${p} min` : `${p} ${a}${p === 1 ? "" : "s"}`;
1715
+ return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
1701
1716
  }
1702
1717
  return "now";
1703
1718
  }
1704
1719
  function Sa(e, t, n, o, i) {
1705
- e.appendChild(Da()), e.appendChild(
1720
+ e.appendChild(Ra()), e.appendChild(
1706
1721
  Ea(
1707
1722
  t,
1708
1723
  n,
@@ -1710,10 +1725,10 @@ function Sa(e, t, n, o, i) {
1710
1725
  i
1711
1726
  )
1712
1727
  ), e.appendChild(
1713
- ht(
1728
+ wt(
1714
1729
  "pluno-pa-widget__close",
1715
1730
  "Close",
1716
- Ra(16),
1731
+ Da(16),
1717
1732
  !0
1718
1733
  )
1719
1734
  ), e.appendChild(ka(n));
@@ -1725,21 +1740,21 @@ function Ea(e, t, n, o) {
1725
1740
  d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", i.appendChild(d);
1726
1741
  }
1727
1742
  i.appendChild(
1728
- bo(
1743
+ xo(
1729
1744
  "pluno-pa-widget__scribble-spirals--launcher",
1730
1745
  10
1731
1746
  )
1732
1747
  ), i.appendChild(
1733
- fe(
1748
+ _e(
1734
1749
  "pluno-pa-widget__character--launcher",
1735
1750
  t
1736
1751
  )
1737
1752
  );
1738
- const a = document.createElement("span");
1739
- a.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(a);
1753
+ const r = document.createElement("span");
1754
+ r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
1740
1755
  const l = document.createElement("input");
1741
1756
  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...");
1757
+ const p = mt("Working...");
1743
1758
  if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
1744
1759
  const d = document.createElement("button");
1745
1760
  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);
@@ -1749,7 +1764,7 @@ function Ea(e, t, n, o) {
1749
1764
  function ka(e) {
1750
1765
  const t = document.createElement("section");
1751
1766
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
1752
- bo("pluno-pa-widget__scribble-spirals--panel", 16)
1767
+ xo("pluno-pa-widget__scribble-spirals--panel", 16)
1753
1768
  );
1754
1769
  const n = document.createElement("div");
1755
1770
  n.className = "pluno-pa-widget__timeline-wrap";
@@ -1757,33 +1772,33 @@ function ka(e) {
1757
1772
  o.className = "pluno-pa-widget__timeline", o.appendChild(Ta(e));
1758
1773
  const i = document.createElement("div");
1759
1774
  i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
1760
- const a = document.createElement("div");
1761
- a.className = "pluno-pa-widget__active-users-counter", a.hidden = !0, n.appendChild(a);
1775
+ const r = document.createElement("div");
1776
+ r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
1762
1777
  const l = document.createElement("button");
1763
1778
  l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
1764
1779
  const p = document.createElement("div");
1765
1780
  return p.className = "pluno-pa-widget__top-actions", p.appendChild(
1766
- ht(
1781
+ wt(
1767
1782
  "pluno-pa-widget__history",
1768
- Zt(),
1783
+ en(),
1769
1784
  Ma(),
1770
1785
  !0
1771
1786
  )
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")
1787
+ ), n.appendChild(p), n.appendChild(Pa()), t.appendChild(n), t.appendChild(La()), t.appendChild(Ia()), t.appendChild(be("left", "Resize Pluno from left")), t.appendChild(
1788
+ be("right", "Resize Pluno from right")
1789
+ ), t.appendChild(be("top", "Resize Pluno from top")), t.appendChild(
1790
+ be("bottom", "Resize Pluno from bottom")
1776
1791
  ), t.appendChild(
1777
- me("top-left", "Resize Pluno from top left")
1792
+ be("top-left", "Resize Pluno from top left")
1778
1793
  ), t.appendChild(
1779
- me("top-right", "Resize Pluno from top right")
1794
+ be("top-right", "Resize Pluno from top right")
1780
1795
  ), t.appendChild(
1781
- me("bottom-left", "Resize Pluno from bottom left")
1796
+ be("bottom-left", "Resize Pluno from bottom left")
1782
1797
  ), t.appendChild(
1783
- me("bottom-right", "Resize Pluno from bottom right")
1798
+ be("bottom-right", "Resize Pluno from bottom right")
1784
1799
  ), t;
1785
1800
  }
1786
- function me(e, t) {
1801
+ function be(e, t) {
1787
1802
  const n = document.createElement("button");
1788
1803
  return n.type = "button", n.className = [
1789
1804
  "pluno-pa-widget__resize-handle",
@@ -1801,10 +1816,10 @@ function La() {
1801
1816
  o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-enable", o.textContent = "Notify me";
1802
1817
  const i = document.createElement("button");
1803
1818
  i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later", i.textContent = "Later";
1804
- const a = document.createElement("button");
1805
- return a.type = "button", a.className = "pluno-pa-widget__notify-suggestion-never", a.textContent = "Never", n.append(o, i, a), e.append(t, n), e;
1819
+ const r = document.createElement("button");
1820
+ return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
1806
1821
  }
1807
- function Pa() {
1822
+ function Ia() {
1808
1823
  const e = document.createElement("form");
1809
1824
  e.className = "pluno-pa-widget__composer";
1810
1825
  const t = document.createElement("div");
@@ -1815,14 +1830,14 @@ function Pa() {
1815
1830
  o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
1816
1831
  const i = document.createElement("div");
1817
1832
  i.className = "pluno-pa-widget__composer-inner";
1818
- const a = document.createElement("input");
1819
- a.className = "pluno-pa-widget__attachment-input", a.type = "file", a.multiple = !0, a.tabIndex = -1, a.setAttribute("aria-hidden", "true"), i.appendChild(a);
1833
+ const r = document.createElement("input");
1834
+ r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
1820
1835
  const l = document.createElement("button");
1821
1836
  l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Ua()), l.appendChild(Ba()), i.appendChild(l);
1822
1837
  const p = document.createElement("textarea");
1823
1838
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
1824
1839
  const d = document.createElement("button");
1825
- d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(xo()), i.appendChild(d), e.appendChild(i);
1840
+ d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(vo()), i.appendChild(d), e.appendChild(i);
1826
1841
  const c = document.createElement("div");
1827
1842
  c.className = "pluno-pa-widget__composer-meta";
1828
1843
  const u = document.createElement("a");
@@ -1830,17 +1845,17 @@ function Pa() {
1830
1845
  const m = document.createElement("span");
1831
1846
  return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
1832
1847
  }
1833
- function Zt() {
1848
+ function en() {
1834
1849
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
1835
1850
  }
1836
- function Ia() {
1851
+ function Pa() {
1837
1852
  const e = document.createElement("section");
1838
- e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Zt());
1853
+ e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", en());
1839
1854
  const t = document.createElement("div");
1840
1855
  t.className = "pluno-pa-widget__history-header";
1841
1856
  const n = document.createElement("strong");
1842
- n.textContent = Zt();
1843
- const o = ht(
1857
+ n.textContent = en();
1858
+ const o = wt(
1844
1859
  "pluno-pa-widget__history-close",
1845
1860
  "Close recent chats",
1846
1861
  Oa(),
@@ -1849,23 +1864,23 @@ function Ia() {
1849
1864
  t.append(n, o);
1850
1865
  const i = document.createElement("div");
1851
1866
  i.className = "pluno-pa-widget__history-list";
1852
- const a = document.createElement("p");
1853
- return a.className = "pluno-pa-widget__history-status", a.hidden = !0, e.append(t, i, a), e;
1867
+ const r = document.createElement("p");
1868
+ return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
1854
1869
  }
1855
1870
  function Ta(e) {
1856
1871
  const t = document.createElement("div");
1857
1872
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
1858
- fe(
1873
+ _e(
1859
1874
  "pluno-pa-widget__character--empty",
1860
1875
  e
1861
1876
  )
1862
- ), t.appendChild(mo()), t;
1877
+ ), t.appendChild(wo()), t;
1863
1878
  }
1864
- function mo() {
1879
+ function wo() {
1865
1880
  const e = document.createElement("div");
1866
1881
  return e.className = "pluno-pa-widget__empty", e.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), e.appendChild(document.createElement("br")), e.appendChild(document.createTextNode("What do you want to do today?")), e;
1867
1882
  }
1868
- function fo(e, t) {
1883
+ function bo(e, t) {
1869
1884
  e.replaceChildren(), e.setAttribute(
1870
1885
  "aria-label",
1871
1886
  `${t.toLocaleString("en-US")} users currently active`
@@ -1877,9 +1892,9 @@ function fo(e, t) {
1877
1892
  )
1878
1893
  );
1879
1894
  }
1880
- function fe(e, t) {
1881
- const n = `pluno-pa-character-${Dn}`;
1882
- Dn += 1;
1895
+ function _e(e, t) {
1896
+ const n = `pluno-pa-character-${zn}`;
1897
+ zn += 1;
1883
1898
  const o = t.scribbleStyle ? Na(t.accentColor, n) : Aa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1884
1899
  return o.setAttribute(
1885
1900
  "class",
@@ -1898,7 +1913,7 @@ function Aa(e, t) {
1898
1913
  eyeShadow: `${t}-eyeShadow`,
1899
1914
  pupilGloss: `${t}-pupilGloss`,
1900
1915
  boltClip: `${t}-boltClip`
1901
- }, i = wo(), a = f(i, "defs"), l = f(a, "linearGradient", {
1916
+ }, i = _o(), r = f(i, "defs"), l = f(r, "linearGradient", {
1902
1917
  id: o.boltFill,
1903
1918
  x1: "420",
1904
1919
  y1: "180",
@@ -1907,7 +1922,7 @@ function Aa(e, t) {
1907
1922
  gradientUnits: "userSpaceOnUse"
1908
1923
  });
1909
1924
  O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
1910
- const p = f(a, "linearGradient", {
1925
+ const p = f(r, "linearGradient", {
1911
1926
  id: o.boltEdge,
1912
1927
  x1: "470",
1913
1928
  y1: "145",
@@ -1916,28 +1931,28 @@ function Aa(e, t) {
1916
1931
  gradientUnits: "userSpaceOnUse"
1917
1932
  });
1918
1933
  O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
1919
- const d = f(a, "radialGradient", {
1934
+ const d = f(r, "radialGradient", {
1920
1935
  id: o.boltGlow,
1921
1936
  cx: "50%",
1922
1937
  cy: "22%",
1923
1938
  r: "82%"
1924
1939
  });
1925
1940
  O(d, "0", n.glow, "0.72"), O(d, "0.5", n.middle, "0.44"), O(d, "1", n.bottom, "0");
1926
- const c = f(a, "radialGradient", {
1941
+ const c = f(r, "radialGradient", {
1927
1942
  id: o.eyeWhite,
1928
1943
  cx: "35%",
1929
1944
  cy: "25%",
1930
1945
  r: "70%"
1931
1946
  });
1932
1947
  O(c, "0", "#ffffff"), O(c, "0.72", "#ffffff"), O(c, "1", "#e5e5e5");
1933
- const u = f(a, "radialGradient", {
1948
+ const u = f(r, "radialGradient", {
1934
1949
  id: o.pupil,
1935
1950
  cx: "42%",
1936
1951
  cy: "38%",
1937
1952
  r: "65%"
1938
1953
  });
1939
1954
  O(u, "0", "#2a1f10"), O(u, "0.52", "#080604"), O(u, "1", "#000000");
1940
- const m = f(a, "filter", {
1955
+ const m = f(r, "filter", {
1941
1956
  id: o.softDropShadow,
1942
1957
  x: "-18%",
1943
1958
  y: "-12%",
@@ -1952,7 +1967,7 @@ function Aa(e, t) {
1952
1967
  "flood-color": n.shadow,
1953
1968
  "flood-opacity": "0.24"
1954
1969
  });
1955
- const E = f(a, "filter", {
1970
+ const k = f(r, "filter", {
1956
1971
  id: o.innerDepth,
1957
1972
  x: "-8%",
1958
1973
  y: "-8%",
@@ -1960,32 +1975,32 @@ function Aa(e, t) {
1960
1975
  height: "116%",
1961
1976
  "color-interpolation-filters": "sRGB"
1962
1977
  });
1963
- f(E, "feGaussianBlur", {
1978
+ f(k, "feGaussianBlur", {
1964
1979
  in: "SourceAlpha",
1965
1980
  stdDeviation: "8",
1966
1981
  result: "blur"
1967
- }), f(E, "feOffset", {
1982
+ }), f(k, "feOffset", {
1968
1983
  dx: "-7",
1969
1984
  dy: "-9",
1970
1985
  result: "topLeft"
1971
- }), f(E, "feComposite", {
1986
+ }), f(k, "feComposite", {
1972
1987
  in: "topLeft",
1973
1988
  in2: "SourceAlpha",
1974
1989
  operator: "arithmetic",
1975
1990
  k2: "-1",
1976
1991
  k3: "1",
1977
1992
  result: "innerShadow"
1978
- }), f(E, "feColorMatrix", {
1993
+ }), f(k, "feColorMatrix", {
1979
1994
  in: "innerShadow",
1980
1995
  type: "matrix",
1981
1996
  values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
1982
1997
  result: "innerLight"
1983
- }), f(E, "feBlend", {
1998
+ }), f(k, "feBlend", {
1984
1999
  in: "SourceGraphic",
1985
2000
  in2: "innerLight",
1986
2001
  mode: "screen"
1987
2002
  });
1988
- const v = f(a, "filter", {
2003
+ const v = f(r, "filter", {
1989
2004
  id: o.eyeShadow,
1990
2005
  x: "-24%",
1991
2006
  y: "-20%",
@@ -2000,7 +2015,7 @@ function Aa(e, t) {
2000
2015
  "flood-color": n.shadow,
2001
2016
  "flood-opacity": "0.3"
2002
2017
  });
2003
- const z = f(a, "filter", {
2018
+ const R = f(r, "filter", {
2004
2019
  id: o.pupilGloss,
2005
2020
  x: "-15%",
2006
2021
  y: "-15%",
@@ -2008,34 +2023,34 @@ function Aa(e, t) {
2008
2023
  height: "130%",
2009
2024
  "color-interpolation-filters": "sRGB"
2010
2025
  });
2011
- f(z, "feDropShadow", {
2026
+ f(R, "feDropShadow", {
2012
2027
  dx: "0",
2013
2028
  dy: "3",
2014
2029
  stdDeviation: "3",
2015
2030
  "flood-color": "#000000",
2016
2031
  "flood-opacity": "0.22"
2017
2032
  });
2018
- const b = f(a, "clipPath", { id: o.boltClip });
2019
- f(b, "path", { d: st });
2033
+ const C = f(r, "clipPath", { id: o.boltClip });
2034
+ f(C, "path", { d: ut });
2020
2035
  const g = f(i, "g", {
2021
- filter: V(o.softDropShadow)
2036
+ filter: Y(o.softDropShadow)
2022
2037
  });
2023
2038
  f(g, "path", {
2024
- d: st,
2025
- fill: V(o.boltEdge)
2039
+ d: ut,
2040
+ fill: Y(o.boltEdge)
2026
2041
  });
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";
2042
+ const y = "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
2043
  f(g, "path", {
2029
- d: w,
2030
- fill: V(o.boltFill),
2031
- filter: V(o.innerDepth)
2044
+ d: y,
2045
+ fill: Y(o.boltFill),
2046
+ filter: Y(o.innerDepth)
2032
2047
  }), f(g, "path", {
2033
- d: w,
2034
- fill: V(o.boltGlow),
2048
+ d: y,
2049
+ fill: Y(o.boltGlow),
2035
2050
  opacity: "0.74"
2036
2051
  });
2037
2052
  const h = f(g, "g", {
2038
- "clip-path": V(o.boltClip),
2053
+ "clip-path": Y(o.boltClip),
2039
2054
  opacity: "0.42"
2040
2055
  });
2041
2056
  f(h, "path", {
@@ -2060,9 +2075,9 @@ function Aa(e, t) {
2060
2075
  "stroke-linecap": "round",
2061
2076
  opacity: "0.48"
2062
2077
  });
2063
- const P = f(i, "g", { filter: V(o.eyeShadow) });
2064
- return Fn(
2065
- P,
2078
+ const A = f(i, "g", { filter: Y(o.eyeShadow) });
2079
+ return Wn(
2080
+ A,
2066
2081
  "rotate(-2 528 463)",
2067
2082
  "528",
2068
2083
  "463",
@@ -2071,8 +2086,8 @@ function Aa(e, t) {
2071
2086
  "557",
2072
2087
  "447",
2073
2088
  o
2074
- ), Fn(
2075
- P,
2089
+ ), Wn(
2090
+ A,
2076
2091
  "rotate(2 717 462)",
2077
2092
  "717",
2078
2093
  "462",
@@ -2084,12 +2099,12 @@ function Aa(e, t) {
2084
2099
  ), i;
2085
2100
  }
2086
2101
  function Na(e, t) {
2087
- const n = eo(e), o = {
2102
+ const n = no(e), o = {
2088
2103
  clip: `${t}-scribbleBoltClip`,
2089
2104
  wobble: `${t}-scribbleBoltWobble`
2090
- }, i = wo(), a = f(i, "defs"), l = f(a, "clipPath", { id: o.clip });
2091
- f(l, "path", { d: st });
2092
- const p = f(a, "filter", {
2105
+ }, i = _o(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
2106
+ f(l, "path", { d: ut });
2107
+ const p = f(r, "filter", {
2093
2108
  id: o.wobble,
2094
2109
  x: "-10%",
2095
2110
  y: "-10%",
@@ -2110,8 +2125,8 @@ function Na(e, t) {
2110
2125
  xChannelSelector: "R",
2111
2126
  yChannelSelector: "G"
2112
2127
  });
2113
- const d = f(i, "g", { filter: V(o.wobble) }), c = f(d, "g", {
2114
- "clip-path": V(o.clip)
2128
+ const d = f(i, "g", { filter: Y(o.wobble) }), c = f(d, "g", {
2129
+ "clip-path": Y(o.clip)
2115
2130
  });
2116
2131
  return f(c, "path", {
2117
2132
  d: ti(),
@@ -2123,12 +2138,12 @@ function Na(e, t) {
2123
2138
  opacity: "0.9",
2124
2139
  transform: "rotate(-14 627 600)"
2125
2140
  }), f(d, "path", {
2126
- d: st,
2141
+ d: ut,
2127
2142
  fill: "none",
2128
- stroke: dt,
2143
+ stroke: gt,
2129
2144
  "stroke-width": "18",
2130
2145
  "stroke-linejoin": "round"
2131
- }), Hn(
2146
+ }), Gn(
2132
2147
  d,
2133
2148
  "rotate(-2 528 463)",
2134
2149
  "528",
@@ -2137,7 +2152,7 @@ function Na(e, t) {
2137
2152
  "473",
2138
2153
  "557",
2139
2154
  "447"
2140
- ), Hn(
2155
+ ), Gn(
2141
2156
  d,
2142
2157
  "rotate(2 717 462)",
2143
2158
  "717",
@@ -2148,27 +2163,27 @@ function Na(e, t) {
2148
2163
  "447"
2149
2164
  ), i;
2150
2165
  }
2151
- function wo() {
2152
- return S("svg", {
2153
- xmlns: po,
2166
+ function _o() {
2167
+ return E("svg", {
2168
+ xmlns: co,
2154
2169
  viewBox: "0 0 1254 1254"
2155
2170
  });
2156
2171
  }
2157
- function Fn(e, t, n, o, i, a, l, p, d) {
2172
+ function Wn(e, t, n, o, i, r, l, p, d) {
2158
2173
  const c = f(e, "g", { transform: t });
2159
2174
  f(c, "ellipse", {
2160
2175
  cx: n,
2161
2176
  cy: o,
2162
2177
  rx: "73",
2163
2178
  ry: "80",
2164
- fill: V(d.eyeWhite)
2179
+ fill: Y(d.eyeWhite)
2165
2180
  }), f(c, "ellipse", {
2166
2181
  cx: i,
2167
- cy: a,
2182
+ cy: r,
2168
2183
  rx: "49",
2169
2184
  ry: "57",
2170
- fill: V(d.pupil),
2171
- filter: V(d.pupilGloss)
2185
+ fill: Y(d.pupil),
2186
+ filter: Y(d.pupilGloss)
2172
2187
  }), f(c, "circle", {
2173
2188
  cx: l,
2174
2189
  cy: p,
@@ -2176,7 +2191,7 @@ function Fn(e, t, n, o, i, a, l, p, d) {
2176
2191
  fill: "#ffffff"
2177
2192
  });
2178
2193
  }
2179
- function Hn(e, t, n, o, i, a, l, p) {
2194
+ function Gn(e, t, n, o, i, r, l, p) {
2180
2195
  const d = f(e, "g", { transform: t });
2181
2196
  f(d, "ellipse", {
2182
2197
  cx: n,
@@ -2184,14 +2199,14 @@ function Hn(e, t, n, o, i, a, l, p) {
2184
2199
  rx: "73",
2185
2200
  ry: "80",
2186
2201
  fill: "#ffffff",
2187
- stroke: dt,
2202
+ stroke: gt,
2188
2203
  "stroke-width": "13"
2189
2204
  }), f(d, "ellipse", {
2190
2205
  cx: i,
2191
- cy: a,
2206
+ cy: r,
2192
2207
  rx: "45",
2193
2208
  ry: "53",
2194
- fill: dt
2209
+ fill: gt
2195
2210
  }), f(d, "circle", {
2196
2211
  cx: l,
2197
2212
  cy: p,
@@ -2200,71 +2215,71 @@ function Hn(e, t, n, o, i, a, l, p) {
2200
2215
  });
2201
2216
  }
2202
2217
  function f(e, t, n = {}) {
2203
- const o = S(t, n);
2218
+ const o = E(t, n);
2204
2219
  return e.appendChild(o), o;
2205
2220
  }
2206
2221
  function O(e, t, n, o) {
2207
2222
  const i = { offset: t, "stop-color": n };
2208
2223
  o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
2209
2224
  }
2210
- function V(e) {
2225
+ function Y(e) {
2211
2226
  return `url(#${e})`;
2212
2227
  }
2213
- function ht(e, t, n, o) {
2228
+ function wt(e, t, n, o) {
2214
2229
  const i = document.createElement("button");
2215
2230
  return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
2216
2231
  }
2217
- function Da() {
2218
- const e = S("svg", {
2232
+ function Ra() {
2233
+ const e = E("svg", {
2219
2234
  class: "pluno-pa-widget__scribble-defs",
2220
2235
  "aria-hidden": "true",
2221
2236
  focusable: "false",
2222
2237
  width: "0",
2223
2238
  height: "0"
2224
- }), t = S("defs");
2225
- return t.appendChild(Ft("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2226
- Ft("pluno-pa-scribble-wobble-2", "5", "15")
2239
+ }), t = E("defs");
2240
+ return t.appendChild(Gt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2241
+ Gt("pluno-pa-scribble-wobble-2", "5", "15")
2227
2242
  ), t.appendChild(
2228
- Ft("pluno-pa-scribble-wobble-3", "9", "19")
2243
+ Gt("pluno-pa-scribble-wobble-3", "9", "19")
2229
2244
  ), e.appendChild(t), e;
2230
2245
  }
2231
- function bo(e, t) {
2232
- const n = S("svg", {
2246
+ function xo(e, t) {
2247
+ const n = E("svg", {
2233
2248
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2234
2249
  preserveAspectRatio: "xMidYMid meet",
2235
2250
  "aria-hidden": "true",
2236
2251
  focusable: "false"
2237
2252
  });
2238
- return _o(n, t), n;
2253
+ return yo(n, t), n;
2239
2254
  }
2240
- function Bt(e, t) {
2255
+ function Wt(e, t) {
2241
2256
  if (!e)
2242
2257
  return;
2243
2258
  const n = Math.max(
2244
2259
  0,
2245
- t - Kt * 2
2260
+ t - Zt * 2
2246
2261
  ), o = Math.max(
2247
2262
  Xi,
2248
2263
  Math.floor(
2249
- (n - Vt * 2) / jt
2264
+ (n - Xt * 2) / Yt
2250
2265
  )
2251
2266
  );
2252
- _o(e, o);
2267
+ yo(e, o);
2253
2268
  }
2254
- function _o(e, t) {
2269
+ function yo(e, t) {
2255
2270
  if (e.dataset.spiralCount === `${t}`)
2256
2271
  return;
2257
- const n = t * jt + Vt * 2;
2272
+ const n = t * Yt + Xt * 2;
2258
2273
  e.dataset.spiralCount = `${t}`, e.setAttribute(
2259
2274
  "viewBox",
2260
2275
  `0 0 ${n} ${Yi}`
2261
2276
  ), e.replaceChildren();
2262
2277
  for (let o = 0; o < t; o += 1) {
2263
- const i = Nn[o % Nn.length], a = S("g", {
2264
- transform: `translate(${Vt + o * jt} 0)`
2278
+ const i = Dn[o % Dn.length], r = E("g", {
2279
+ transform: `translate(${Xt + o * Yt} 0)`
2265
2280
  });
2266
- a.appendChild(
2267
- S("ellipse", {
2281
+ r.appendChild(
2282
+ E("ellipse", {
2268
2283
  cx: i.ellipseCx,
2269
2284
  cy: i.ellipseCy,
2270
2285
  rx: i.ellipseRx,
@@ -2274,19 +2289,19 @@ function _o(e, t) {
2274
2289
  "stroke-width": i.strokeWidth,
2275
2290
  opacity: "0.8"
2276
2291
  })
2277
- ), a.appendChild(
2278
- S("path", {
2292
+ ), r.appendChild(
2293
+ E("path", {
2279
2294
  d: i.path,
2280
2295
  fill: "none",
2281
2296
  stroke: "#2c2a1e",
2282
2297
  "stroke-width": i.pathStrokeWidth,
2283
2298
  "stroke-linecap": "round"
2284
2299
  })
2285
- ), e.appendChild(a);
2300
+ ), e.appendChild(r);
2286
2301
  }
2287
2302
  }
2288
- function Ft(e, t, n) {
2289
- const o = S("filter", {
2303
+ function Gt(e, t, n) {
2304
+ const o = E("filter", {
2290
2305
  id: e,
2291
2306
  x: "-8%",
2292
2307
  y: "-8%",
@@ -2294,7 +2309,7 @@ function Ft(e, t, n) {
2294
2309
  height: "116%"
2295
2310
  });
2296
2311
  return o.appendChild(
2297
- S("feTurbulence", {
2312
+ E("feTurbulence", {
2298
2313
  type: "fractalNoise",
2299
2314
  baseFrequency: "0.012 0.028",
2300
2315
  numOctaves: "3",
@@ -2302,7 +2317,7 @@ function Ft(e, t, n) {
2302
2317
  result: "stroke-noise"
2303
2318
  })
2304
2319
  ), o.appendChild(
2305
- S("feDisplacementMap", {
2320
+ E("feDisplacementMap", {
2306
2321
  in: "SourceGraphic",
2307
2322
  in2: "stroke-noise",
2308
2323
  scale: "3.5",
@@ -2311,7 +2326,7 @@ function Ft(e, t, n) {
2311
2326
  result: "warped"
2312
2327
  })
2313
2328
  ), o.appendChild(
2314
- S("feTurbulence", {
2329
+ E("feTurbulence", {
2315
2330
  type: "fractalNoise",
2316
2331
  baseFrequency: "0.7",
2317
2332
  numOctaves: "1",
@@ -2319,7 +2334,7 @@ function Ft(e, t, n) {
2319
2334
  result: "ink-noise"
2320
2335
  })
2321
2336
  ), o.appendChild(
2322
- S("feDisplacementMap", {
2337
+ E("feDisplacementMap", {
2323
2338
  in: "warped",
2324
2339
  in2: "ink-noise",
2325
2340
  scale: "0.9",
@@ -2328,8 +2343,8 @@ function Ft(e, t, n) {
2328
2343
  })
2329
2344
  ), o;
2330
2345
  }
2331
- function Ra(e) {
2332
- const t = re(
2346
+ function Da(e) {
2347
+ const t = le(
2333
2348
  "0 0 24 24",
2334
2349
  e,
2335
2350
  e,
@@ -2337,10 +2352,10 @@ function Ra(e) {
2337
2352
  "currentColor",
2338
2353
  "2.25"
2339
2354
  );
2340
- return t.appendChild(S("path", { d: "m6 9 6 6 6-6" })), t;
2355
+ return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
2341
2356
  }
2342
2357
  function za() {
2343
- const e = re(
2358
+ const e = le(
2344
2359
  "0 0 24 24",
2345
2360
  17,
2346
2361
  17,
@@ -2349,17 +2364,17 @@ function za() {
2349
2364
  "2.25"
2350
2365
  );
2351
2366
  return e.appendChild(
2352
- S("path", {
2367
+ E("path", {
2353
2368
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2354
2369
  })
2355
2370
  ), e.appendChild(
2356
- S("path", {
2371
+ E("path", {
2357
2372
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2358
2373
  })
2359
2374
  ), e;
2360
2375
  }
2361
2376
  function Ma() {
2362
- const e = re(
2377
+ const e = le(
2363
2378
  "0 0 24 24",
2364
2379
  17,
2365
2380
  17,
@@ -2367,10 +2382,10 @@ function Ma() {
2367
2382
  "currentColor",
2368
2383
  "2.25"
2369
2384
  );
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;
2385
+ 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
2386
  }
2372
2387
  function Oa() {
2373
- const e = re(
2388
+ const e = le(
2374
2389
  "0 0 24 24",
2375
2390
  15,
2376
2391
  15,
@@ -2378,10 +2393,10 @@ function Oa() {
2378
2393
  "currentColor",
2379
2394
  "2.4"
2380
2395
  );
2381
- return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
2396
+ return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
2382
2397
  }
2383
- function xo() {
2384
- const e = re(
2398
+ function vo() {
2399
+ const e = le(
2385
2400
  "0 0 24 24",
2386
2401
  14,
2387
2402
  14,
@@ -2390,11 +2405,11 @@ function xo() {
2390
2405
  "2.75"
2391
2406
  );
2392
2407
  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;
2408
+ E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2409
+ ), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
2395
2410
  }
2396
2411
  function Ua() {
2397
- const e = re(
2412
+ const e = le(
2398
2413
  "0 0 24 24",
2399
2414
  16,
2400
2415
  16,
@@ -2406,18 +2421,18 @@ function Ua() {
2406
2421
  "class",
2407
2422
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2408
2423
  ), e.appendChild(
2409
- S("path", {
2424
+ E("path", {
2410
2425
  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
2426
  })
2412
2427
  ), e;
2413
2428
  }
2414
2429
  function Ba() {
2415
- const e = re("0 0 24 24", 19, 19, "none", "currentColor");
2430
+ const e = le("0 0 24 24", 19, 19, "none", "currentColor");
2416
2431
  return e.setAttribute(
2417
2432
  "class",
2418
2433
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2419
2434
  ), e.appendChild(
2420
- S("path", {
2435
+ E("path", {
2421
2436
  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
2437
  stroke: "currentColor",
2423
2438
  "stroke-width": "2",
@@ -2427,9 +2442,9 @@ function Ba() {
2427
2442
  ), e;
2428
2443
  }
2429
2444
  function Fa() {
2430
- const e = re("0 0 24 24", 18, 18, "currentColor");
2445
+ const e = le("0 0 24 24", 18, 18, "currentColor");
2431
2446
  return e.appendChild(
2432
- S("rect", {
2447
+ E("rect", {
2433
2448
  x: "6",
2434
2449
  y: "6",
2435
2450
  width: "12",
@@ -2439,7 +2454,7 @@ function Fa() {
2439
2454
  ), e;
2440
2455
  }
2441
2456
  function Ha() {
2442
- const e = re(
2457
+ const e = le(
2443
2458
  "0 0 24 24",
2444
2459
  12,
2445
2460
  12,
@@ -2447,10 +2462,10 @@ function Ha() {
2447
2462
  "currentColor",
2448
2463
  "2.4"
2449
2464
  );
2450
- return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
2465
+ return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
2451
2466
  }
2452
2467
  function Wa() {
2453
- const e = re(
2468
+ const e = le(
2454
2469
  "0 0 24 24",
2455
2470
  13,
2456
2471
  13,
@@ -2459,7 +2474,7 @@ function Wa() {
2459
2474
  "2.25"
2460
2475
  );
2461
2476
  return e.appendChild(
2462
- S("rect", {
2477
+ E("rect", {
2463
2478
  width: "14",
2464
2479
  height: "14",
2465
2480
  x: "8",
@@ -2468,12 +2483,12 @@ function Wa() {
2468
2483
  ry: "2"
2469
2484
  })
2470
2485
  ), e.appendChild(
2471
- S("path", {
2486
+ E("path", {
2472
2487
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2473
2488
  })
2474
2489
  ), e;
2475
2490
  }
2476
- function re(e, t, n, o, i, a) {
2491
+ function le(e, t, n, o, i, r) {
2477
2492
  const l = {
2478
2493
  viewBox: e,
2479
2494
  width: String(t),
@@ -2481,15 +2496,15 @@ function re(e, t, n, o, i, a) {
2481
2496
  fill: o,
2482
2497
  "aria-hidden": "true"
2483
2498
  };
2484
- return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), S("svg", l);
2499
+ return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
2485
2500
  }
2486
- function S(e, t = {}) {
2487
- const n = document.createElementNS(po, e);
2501
+ function E(e, t = {}) {
2502
+ const n = document.createElementNS(co, e);
2488
2503
  for (const [o, i] of Object.entries(t))
2489
2504
  n.setAttribute(o, i);
2490
2505
  return n;
2491
2506
  }
2492
- function Wn(e) {
2507
+ function $n(e) {
2493
2508
  for (const t of ["keydown", "keypress", "keyup"])
2494
2509
  e.addEventListener(t, (n) => {
2495
2510
  n.stopPropagation();
@@ -2498,62 +2513,62 @@ function Wn(e) {
2498
2513
  function Ga(e, t, n) {
2499
2514
  e.replaceChildren(), e.hidden = t.length === 0;
2500
2515
  for (const [o, i] of t.entries()) {
2501
- const a = document.createElement("div");
2502
- a.className = "pluno-pa-widget__attachment", a.appendChild($a(i));
2516
+ const r = document.createElement("div");
2517
+ r.className = "pluno-pa-widget__attachment", r.appendChild($a(i));
2503
2518
  const l = document.createElement("span");
2504
- l.textContent = i.name, a.appendChild(l);
2519
+ l.textContent = i.name, r.appendChild(l);
2505
2520
  const p = document.createElement("button");
2506
- p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ha()), p.addEventListener("click", () => n(o)), a.appendChild(p), e.appendChild(a);
2521
+ p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ha()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
2507
2522
  }
2508
2523
  }
2509
2524
  function $a(e) {
2510
- const t = on(e), n = yo(e);
2525
+ const t = ln(e), n = Co(e);
2511
2526
  if (t === "image" && n) {
2512
2527
  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;
2528
+ return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ae(e))), o;
2514
2529
  }
2515
2530
  if (t === "video" && n) {
2516
2531
  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;
2532
+ return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ae(e))), o.addEventListener("stalled", () => o.replaceWith(ae(e))), o;
2518
2533
  }
2519
- return ie(e);
2534
+ return ae(e);
2520
2535
  }
2521
2536
  function qa(e) {
2522
- const t = on(e), n = yo(e);
2537
+ const t = ln(e), n = Co(e);
2523
2538
  if (t === "image" && n) {
2524
2539
  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;
2540
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o;
2526
2541
  }
2527
2542
  if (t === "pdf" && n) {
2528
2543
  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;
2544
+ 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(ae(e, "message"))), o.appendChild(ae(e, "message")), o;
2530
2545
  }
2531
2546
  if (t === "video" && n) {
2532
2547
  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;
2548
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ae(e, "message"))), o;
2534
2549
  }
2535
- return ie(e, "message");
2550
+ return ae(e, "message");
2536
2551
  }
2537
- function ie(e, t = "composer") {
2552
+ function ae(e, t = "composer") {
2538
2553
  if (t === "composer") {
2539
- const a = document.createElement("span");
2540
- return a.className = "pluno-pa-widget__attachment-file", a.textContent = Gn(e), a;
2554
+ const r = document.createElement("span");
2555
+ return r.className = "pluno-pa-widget__attachment-file", r.textContent = qn(e), r;
2541
2556
  }
2542
2557
  const n = document.createElement("div");
2543
2558
  n.className = "pluno-pa-widget__message-attachment-file";
2544
2559
  const o = document.createElement("span");
2545
- o.textContent = Gn(e);
2560
+ o.textContent = qn(e);
2546
2561
  const i = document.createElement("strong");
2547
2562
  return i.textContent = e.name, n.append(o, i), n;
2548
2563
  }
2549
- function on(e) {
2564
+ function ln(e) {
2550
2565
  return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
2551
2566
  }
2552
- function yo(e) {
2567
+ function Co(e) {
2553
2568
  return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2554
2569
  }
2555
- function Gn(e) {
2556
- const t = on(e);
2570
+ function qn(e) {
2571
+ const t = ln(e);
2557
2572
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2558
2573
  }
2559
2574
  function ja(e, t) {
@@ -2565,26 +2580,26 @@ function ja(e, t) {
2565
2580
  function Va(e) {
2566
2581
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2567
2582
  }
2568
- function at(e) {
2583
+ function pt(e) {
2569
2584
  return !!(e && Array.from(e.types).includes("Files"));
2570
2585
  }
2571
- function Ht(e, t, n = null) {
2572
- if (!e || !Jt(t, n)) {
2586
+ function $t(e, t, n = null) {
2587
+ if (!e || !tn(t, n)) {
2573
2588
  e && (e.hidden = !0, e.replaceChildren());
2574
2589
  return;
2575
2590
  }
2576
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || an(n) ? e.appendChild(
2591
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", re(t) || pn(n) ? e.appendChild(
2577
2592
  Ka(t, n)
2578
- ) : vo(t) && e.appendChild(Ya(t));
2593
+ ) : So(t) && e.appendChild(Ya(t));
2579
2594
  }
2580
2595
  function Ka(e, t) {
2581
2596
  const n = document.createElement("div");
2582
2597
  n.className = "pluno-pa-widget__billing-action-card";
2583
2598
  const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
2584
2599
  i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
2585
- const a = document.createElement("span");
2586
- return a.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(a), n.appendChild(
2587
- Co(
2600
+ const r = document.createElement("span");
2601
+ return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
2602
+ Eo(
2588
2603
  e,
2589
2604
  "Upgrade plan",
2590
2605
  "pluno-pa-widget__billing-action-card-actions"
@@ -2598,30 +2613,30 @@ function Ya(e) {
2598
2613
  n.textContent = "Credits running low", t.appendChild(n);
2599
2614
  const o = document.createElement("span");
2600
2615
  return o.textContent = Za(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2601
- Co(
2616
+ Eo(
2602
2617
  e,
2603
2618
  "Upgrade",
2604
2619
  "pluno-pa-widget__billing-action-card-actions"
2605
2620
  )
2606
2621
  ), t;
2607
2622
  }
2608
- function Jt(e, t) {
2609
- return e !== null && (ae(e) || vo(e) || an(t));
2623
+ function tn(e, t) {
2624
+ return e !== null && (re(e) || So(e) || pn(t));
2610
2625
  }
2611
- function $n(e, t, n) {
2612
- return Jt(t, n) || Xa(t) ? !0 : !Jt(e, n);
2626
+ function jn(e, t, n) {
2627
+ return tn(t, n) || Xa(t) ? !0 : !tn(e, n);
2613
2628
  }
2614
2629
  function Xa(e) {
2615
- return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
2630
+ return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || re(e));
2616
2631
  }
2617
- function ae(e) {
2632
+ function re(e) {
2618
2633
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
2619
2634
  }
2620
- function an(e) {
2635
+ function pn(e) {
2621
2636
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2622
2637
  }
2623
- 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;
2638
+ function So(e) {
2639
+ return !re(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2625
2640
  }
2626
2641
  function Za(e) {
2627
2642
  return e.creditsRemaining === null ? null : `${Ja(e.creditsRemaining)} credits left`;
@@ -2631,15 +2646,15 @@ function Ja(e) {
2631
2646
  maximumFractionDigits: 0
2632
2647
  }).format(Math.ceil(e));
2633
2648
  }
2634
- function Co(e, t, n) {
2649
+ function Eo(e, t, n) {
2635
2650
  const o = document.createElement("div");
2636
2651
  return o.className = n, o.appendChild(
2637
- qn(t, e.pricingUrl)
2652
+ Vn(t, e.pricingUrl)
2638
2653
  ), o.appendChild(
2639
- qn("Earn credits", e.earnCreditsUrl)
2654
+ Vn("Earn credits", e.earnCreditsUrl)
2640
2655
  ), o;
2641
2656
  }
2642
- function qn(e, t) {
2657
+ function Vn(e, t) {
2643
2658
  const n = document.createElement("button");
2644
2659
  if (n.type = "button", e === "Earn credits") {
2645
2660
  const o = document.createElement("span");
@@ -2650,117 +2665,131 @@ function qn(e, t) {
2650
2665
  t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
2651
2666
  }), n;
2652
2667
  }
2653
- function Wt(e, t) {
2668
+ function qt(e, t) {
2654
2669
  return e.messages.filter(
2655
- (o) => !So(o)
2670
+ (o) => !ko(o)
2656
2671
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2657
2672
  }
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);
2673
+ function Qa(e, t, n, o, i, r, l, p, d, c, u, m, k, v, R, C, g, y, h) {
2674
+ const A = or(r), L = A.filter(
2675
+ (x) => !ko(x)
2676
+ ), M = e.scrollTop, U = [], Ie = /* @__PURE__ */ new Set(), H = (x) => {
2677
+ U.push(x);
2663
2678
  };
2664
- 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(
2679
+ Io(n, r.isThinking), i.hidden = !p, p && l !== null && bo(i, l);
2680
+ const xe = L.length > 0 || !!r.assistantDraft || r.isThinking;
2681
+ if (o(xe), g || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2682
+ const x = document.createElement("div");
2683
+ x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
2684
+ const D = document.createElement("div");
2685
+ D.className = "pluno-pa-widget__empty-hero";
2686
+ const $ = _e(
2672
2687
  "pluno-pa-widget__character--empty",
2673
2688
  v()
2674
2689
  );
2675
- N.appendChild(Ee), C.appendChild(N), C.appendChild(mo());
2676
- const q = document.createElement("div");
2677
- 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);
2690
+ if (D.appendChild($), x.appendChild(D), g) {
2691
+ const S = document.createElement("h2");
2692
+ S.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", S.textContent = g.opening, x.appendChild(S);
2693
+ } else
2694
+ x.appendChild(wo());
2695
+ const P = g?.prompts ?? r.starterPrompts, j = document.createElement("div");
2696
+ if (j.className = P.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", P.length === 0 && !r.starterPromptsLoading && j.setAttribute("aria-hidden", "true"), P.length > 0)
2697
+ for (const S of P) {
2698
+ const N = document.createElement("button");
2699
+ N.type = "button", N.className = "pluno-pa-widget__starter-prompt", N.textContent = `"${S}"`, N.addEventListener("click", () => {
2700
+ R(S);
2701
+ }), j.appendChild(N);
2683
2702
  }
2684
- 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);
2703
+ else if (r.starterPromptsLoading) {
2704
+ const S = document.createElement("button");
2705
+ S.type = "button", S.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", S.disabled = !0, S.tabIndex = -1, S.textContent = "Generating example tasks...", j.appendChild(S);
2687
2706
  } 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);
2707
+ for (let S = 0; S < zi; S += 1) {
2708
+ const N = document.createElement("button");
2709
+ N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", N.disabled = !0, N.tabIndex = -1, N.textContent = "", j.appendChild(N);
2691
2710
  }
2692
- C.appendChild(q), m.clear(), k(C), k(t), jn(e, P);
2711
+ if (x.appendChild(j), g) {
2712
+ const S = document.createElement("button");
2713
+ S.type = "button", S.className = "pluno-pa-widget__morning-report-snooze", S.textContent = "Snooze morning report", S.addEventListener("click", y), x.appendChild(S);
2714
+ }
2715
+ m.clear(), H(x), H(t), Kn(e, U);
2693
2716
  return;
2694
2717
  }
2695
- let H = null, $ = null, Q = [];
2696
- const Me = w.some(Qt), x = () => {
2697
- if (Q.length === 0)
2718
+ let G = null, w = null, J = [];
2719
+ const Je = L.some(nn), pe = () => {
2720
+ if (J.length === 0)
2698
2721
  return !1;
2699
- const C = gr(
2700
- Q,
2722
+ const x = gr(
2723
+ J,
2701
2724
  u,
2702
- E,
2725
+ k,
2703
2726
  v()
2704
2727
  );
2705
- return k(C), H = null, $ = C, Q = [], !0;
2728
+ return H(x), G = null, w = x, J = [], !0;
2706
2729
  };
2707
- for (let C = 0; C < w.length; C += 1) {
2708
- const N = w[C];
2709
- if (N.role === "tool") {
2710
- Q.push(N);
2730
+ for (let x = 0; x < L.length; x += 1) {
2731
+ const D = L[x];
2732
+ if (D.role === "tool") {
2733
+ J.push(D);
2711
2734
  continue;
2712
2735
  }
2713
- if (Qt(N)) {
2714
- if (x()) {
2715
- const A = ut();
2716
- k(A), H = null, $ = A;
2736
+ if (nn(D)) {
2737
+ if (pe()) {
2738
+ const N = mt();
2739
+ H(N), G = null, w = N;
2717
2740
  } else {
2718
- const A = Yn(v());
2719
- k(A), H = null, $ = A;
2741
+ const N = Zn(v());
2742
+ H(N), G = null, w = N;
2720
2743
  }
2721
2744
  continue;
2722
2745
  }
2723
- if (N.role === "system")
2746
+ if (D.role === "system")
2724
2747
  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;
2748
+ const $ = pe(), P = ur(D.content);
2749
+ if (D.role === "assistant" && !$) {
2750
+ const S = Lo(v());
2751
+ H(S), G = null, w = S;
2729
2752
  }
2730
- const R = er(N, q, m, T);
2731
- k(R), H = R, $ = null;
2753
+ const j = er(D, P, m, Ie);
2754
+ H(j), G = j, w = null;
2732
2755
  }
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;
2756
+ const Qe = pe(), V = L[L.length - 1]?.id === "assistant-draft";
2757
+ if (r.isThinking && !V && !Je)
2758
+ if (Qe) {
2759
+ const x = mt();
2760
+ H(x), G = null, w = x;
2738
2761
  } else {
2739
- const C = Yn(v());
2740
- k(C), H = null, $ = C;
2741
- }
2742
- 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;
2762
+ const x = Zn(v());
2763
+ H(x), G = null, w = x;
2764
+ }
2765
+ if (r.lastError) {
2766
+ const x = document.createElement("div");
2767
+ x.className = "pluno-pa-widget__error";
2768
+ const D = document.createElement("span");
2769
+ if (D.textContent = r.lastError, x.appendChild(D), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active") {
2770
+ const $ = document.createElement("button");
2771
+ $.type = "button", $.className = "pluno-pa-widget__error-retry", $.textContent = "Try again", $.addEventListener("click", C), x.appendChild($);
2772
+ }
2773
+ H(x), G = x, w = null;
2745
2774
  }
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
2775
+ const ge = h && !r.isThinking ? ri(A) : null;
2776
+ if (h && ge && !h.dismissedCandidateIds.has(ge.id)) {
2777
+ const x = rr(ge, {
2778
+ isDrafting: h.draftingCandidateId === ge.id,
2779
+ error: h.error,
2780
+ characterIconOptions: h.characterIconOptions,
2781
+ onDraft: h.onDraft,
2782
+ onDismiss: h.onDismiss,
2783
+ onDisable: h.onDisable
2755
2784
  });
2756
- k(C), b.onSeen(X), H = null, $ = C;
2785
+ H(x), h.onSeen(ge), G = null, w = x;
2757
2786
  }
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;
2787
+ G?.classList.add("pluno-pa-widget__message--bottom-reserve"), w?.classList.add("pluno-pa-widget__bottom-reserve-compact"), H(t), nr(m, Ie), Kn(e, U), d ? Xe(e, c) : e.scrollTop = M;
2759
2788
  }
2760
2789
  function er(e, t, n, o) {
2761
- const i = tr(e, t), a = i ? n.get(i) : void 0;
2762
- if (i && a)
2763
- return a.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), a;
2790
+ const i = tr(e, t), r = i ? n.get(i) : void 0;
2791
+ if (i && r)
2792
+ return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
2764
2793
  const l = document.createElement("div");
2765
2794
  l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? mr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(ir(e.attachments));
2766
2795
  const p = document.createElement("div");
@@ -2788,7 +2817,7 @@ function nr(e, t) {
2788
2817
  for (const n of e.keys())
2789
2818
  t.has(n) || e.delete(n);
2790
2819
  }
2791
- function jn(e, t) {
2820
+ function Kn(e, t) {
2792
2821
  let n = e.firstChild;
2793
2822
  for (const o of t) {
2794
2823
  if (o === n) {
@@ -2817,12 +2846,12 @@ function or(e) {
2817
2846
  if (!t.respondsToUserMessageId)
2818
2847
  return [...e.messages, t];
2819
2848
  const n = e.messages.findIndex(
2820
- (a) => a.role === "user" && a.id === t.respondsToUserMessageId
2849
+ (r) => r.role === "user" && r.id === t.respondsToUserMessageId
2821
2850
  );
2822
2851
  if (n === -1)
2823
2852
  return [...e.messages, t];
2824
2853
  const o = e.messages.findIndex(
2825
- (a, l) => l > n && a.role !== "user" && a.respondsToUserMessageId === t.respondsToUserMessageId && Vn(a, t) && Qt(a)
2854
+ (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && Yn(r, t) && nn(r)
2826
2855
  );
2827
2856
  if (o !== -1)
2828
2857
  return [
@@ -2831,7 +2860,7 @@ function or(e) {
2831
2860
  ...e.messages.slice(o + 1)
2832
2861
  ];
2833
2862
  let i = n + 1;
2834
- for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Vn(e.messages[i], t); )
2863
+ for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Yn(e.messages[i], t); )
2835
2864
  i += 1;
2836
2865
  return [
2837
2866
  ...e.messages.slice(0, i),
@@ -2839,17 +2868,17 @@ function or(e) {
2839
2868
  ...e.messages.slice(i)
2840
2869
  ];
2841
2870
  }
2842
- function Qt(e) {
2871
+ function nn(e) {
2843
2872
  return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
2844
2873
  }
2845
- function Vn(e, t) {
2874
+ function Yn(e, t) {
2846
2875
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
2847
2876
  }
2848
- function Kn(e, t, n, o, i, a, l, p) {
2849
- e.replaceChildren(), ko(t, !1), t.disabled = !0, n(!1);
2877
+ function Xn(e, t, n, o, i, r, l, p) {
2878
+ e.replaceChildren(), Io(t, !1), t.disabled = !0, n(!1);
2850
2879
  const d = document.createElement("div");
2851
2880
  d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2852
- const c = fe(
2881
+ const c = _e(
2853
2882
  "pluno-pa-widget__character--empty",
2854
2883
  o()
2855
2884
  );
@@ -2857,10 +2886,10 @@ function Kn(e, t, n, o, i, a, l, p) {
2857
2886
  const u = document.createElement("div");
2858
2887
  if (u.className = "pluno-pa-widget__empty", u.textContent = i, d.appendChild(u), l) {
2859
2888
  const m = document.createElement("a");
2860
- m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = a, d.appendChild(m);
2889
+ m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = r, d.appendChild(m);
2861
2890
  } else {
2862
2891
  const m = document.createElement("button");
2863
- m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = a, m.addEventListener("click", () => p?.()), d.appendChild(m);
2892
+ m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = r, m.addEventListener("click", () => p?.()), d.appendChild(m);
2864
2893
  }
2865
2894
  e.appendChild(d);
2866
2895
  }
@@ -2882,15 +2911,15 @@ function rr(e, t) {
2882
2911
  n.className = "pluno-pa-widget__share-prompt";
2883
2912
  const o = document.createElement("div");
2884
2913
  o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
2885
- fe(
2914
+ _e(
2886
2915
  "pluno-pa-widget__share-prompt-icon",
2887
2916
  t.characterIconOptions
2888
2917
  )
2889
2918
  );
2890
2919
  const i = document.createElement("div");
2891
2920
  i.className = "pluno-pa-widget__share-prompt-copy";
2892
- const a = document.createElement("strong");
2893
- a.textContent = "Share this win?", i.appendChild(a);
2921
+ const r = document.createElement("strong");
2922
+ r.textContent = "Share this win?", i.appendChild(r);
2894
2923
  const l = document.createElement("span");
2895
2924
  if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
2896
2925
  const u = document.createElement("span");
@@ -2904,7 +2933,7 @@ function rr(e, t) {
2904
2933
  const c = document.createElement("button");
2905
2934
  if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
2906
2935
  t.onDraft(e);
2907
- }), t.isDrafting ? (c.appendChild(en()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", d.appendChild(c), t.isDrafting)
2936
+ }), t.isDrafting ? (c.appendChild(on()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", d.appendChild(c), t.isDrafting)
2908
2937
  p.appendChild(d);
2909
2938
  else {
2910
2939
  const u = document.createElement("button");
@@ -2925,8 +2954,8 @@ function lr(e, t) {
2925
2954
  });
2926
2955
  const o = document.createElement("section");
2927
2956
  o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
2928
- const i = document.createElement("header"), a = document.createElement("strong");
2929
- a.textContent = "Share this win", i.appendChild(a);
2957
+ const i = document.createElement("header"), r = document.createElement("strong");
2958
+ r.textContent = "Share this win", i.appendChild(r);
2930
2959
  const l = document.createElement("button");
2931
2960
  l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
2932
2961
  const p = document.createElement("p");
@@ -2950,27 +2979,27 @@ function lr(e, t) {
2950
2979
  if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
2951
2980
  const g = document.createElement("div");
2952
2981
  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);
2982
+ const y = document.createElement("img");
2983
+ y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), d.appendChild(g);
2955
2984
  }
2956
2985
  o.appendChild(d), o.appendChild(p);
2957
- const E = document.createElement("div");
2958
- E.className = "pluno-pa-widget__share-dialog-step";
2986
+ const k = document.createElement("div");
2987
+ k.className = "pluno-pa-widget__share-dialog-step";
2959
2988
  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";
2989
+ v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
2990
+ const R = document.createElement("p");
2991
+ R.className = "pluno-pa-widget__share-dialog-hint", R.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(R);
2992
+ const C = document.createElement("footer");
2993
+ C.className = "pluno-pa-widget__share-dialog-platforms";
2965
2994
  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);
2995
+ const y = document.createElement("a");
2996
+ y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(dr(g.id)), C.appendChild(y);
2968
2997
  }
2969
- if (E.appendChild(b), o.appendChild(E), t.socialPostRewardsUrl) {
2998
+ if (k.appendChild(C), o.appendChild(k), t.socialPostRewardsUrl) {
2970
2999
  const g = document.createElement("div");
2971
3000
  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);
3001
+ const y = document.createElement("strong");
3002
+ y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(y);
2974
3003
  const h = document.createElement("a");
2975
3004
  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
3005
  }
@@ -3004,40 +3033,40 @@ function sr(e) {
3004
3033
  }
3005
3034
  function dr(e) {
3006
3035
  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(
3036
+ 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" ? (W(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), W(
3008
3037
  t,
3009
3038
  "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(
3039
+ ), W(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), W(
3011
3040
  t,
3012
3041
  "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(
3042
+ ), W(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (W(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), W(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), W(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (W(
3014
3043
  t,
3015
3044
  "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(
3045
+ ), W(
3017
3046
  t,
3018
3047
  "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
3048
  "0.48"
3020
- ), B(
3049
+ ), W(
3021
3050
  t,
3022
3051
  "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(
3052
+ ), W(
3024
3053
  t,
3025
3054
  "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
3055
  ), t);
3027
3056
  }
3028
- function B(e, t, n) {
3057
+ function W(e, t, n) {
3029
3058
  const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
3030
3059
  o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
3031
3060
  }
3032
3061
  function cr() {
3033
3062
  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(
3063
+ return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), W(e, "M14 5h5v5"), W(e, "M19 5l-8 8"), W(
3035
3064
  e,
3036
3065
  "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
3037
3066
  ), e;
3038
3067
  }
3039
- function So(e) {
3040
- return e.role === "tool" && e.toolName === no;
3068
+ function ko(e) {
3069
+ return e.role === "tool" && e.toolName === io;
3041
3070
  }
3042
3071
  function ur(e) {
3043
3072
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
@@ -3047,45 +3076,45 @@ function gr(e, t, n, o) {
3047
3076
  i.className = "pluno-pa-widget__tool-group", i.title = new Date(
3048
3077
  e[e.length - 1].createdAt
3049
3078
  ).toLocaleString(), i.appendChild(
3050
- fe(
3079
+ _e(
3051
3080
  "pluno-pa-widget__character--tool-group",
3052
3081
  o
3053
3082
  )
3054
3083
  );
3055
- const a = document.createElement("details"), l = hr(e);
3056
- a.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.addEventListener("toggle", () => {
3057
- i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.open ? t.add(l) : t.delete(l), n();
3084
+ const r = document.createElement("details"), l = hr(e);
3085
+ r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
3086
+ i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
3058
3087
  });
3059
3088
  const p = document.createElement("summary");
3060
- p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(en());
3089
+ p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(on());
3061
3090
  const c = document.createElement("span");
3062
- if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), a.appendChild(p), e.length > 0) {
3091
+ if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
3063
3092
  const u = document.createElement("div");
3064
3093
  u.className = "pluno-pa-widget__tool-lines";
3065
3094
  for (const m of e) {
3066
- const E = document.createElement("div");
3067
- E.className = "pluno-pa-widget__tool-line", m.loading && E.appendChild(en());
3095
+ const k = document.createElement("div");
3096
+ k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(on());
3068
3097
  const v = document.createElement("span");
3069
- v.textContent = m.content || "Run tool", E.appendChild(v), u.appendChild(E);
3098
+ v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
3070
3099
  }
3071
- a.appendChild(u);
3100
+ r.appendChild(u);
3072
3101
  }
3073
- return i.appendChild(a), i;
3102
+ return i.appendChild(r), i;
3074
3103
  }
3075
- function Eo(e) {
3104
+ function Lo(e) {
3076
3105
  const t = document.createElement("article");
3077
3106
  return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
3078
- fe(
3107
+ _e(
3079
3108
  "pluno-pa-widget__character--tool-group",
3080
3109
  e
3081
3110
  )
3082
3111
  ), t;
3083
3112
  }
3084
- function Yn(e) {
3085
- const t = Eo(e);
3086
- return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ut()), t;
3113
+ function Zn(e) {
3114
+ const t = Lo(e);
3115
+ return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(mt()), t;
3087
3116
  }
3088
- function ut(e = "Thinking...") {
3117
+ function mt(e = "Thinking...") {
3089
3118
  const t = document.createElement("div");
3090
3119
  t.className = "pluno-pa-widget__status";
3091
3120
  const n = document.createElement("span");
@@ -3096,12 +3125,12 @@ function ut(e = "Thinking...") {
3096
3125
  function hr(e) {
3097
3126
  return `tools:${e[0]?.id ?? ""}`;
3098
3127
  }
3099
- function en() {
3128
+ function on() {
3100
3129
  const e = document.createElement("span");
3101
3130
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3102
3131
  }
3103
- function ko(e, t) {
3104
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() : xo());
3132
+ function Io(e, t) {
3133
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() : vo());
3105
3134
  }
3106
3135
  function mr(e, t) {
3107
3136
  const n = t.replace(/\r\n/g, `
@@ -3127,14 +3156,14 @@ function mr(e, t) {
3127
3156
  const l = i.match(/^(#{1,3})\s+(.+)$/);
3128
3157
  if (l) {
3129
3158
  const c = document.createElement(`h${l[1].length + 2}`);
3130
- rt(c, l[2]), e.appendChild(c), o += 1;
3159
+ st(c, l[2]), e.appendChild(c), o += 1;
3131
3160
  continue;
3132
3161
  }
3133
3162
  if (/^\s*[-*+]\s+/.test(i)) {
3134
3163
  const c = document.createElement("ul");
3135
3164
  for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
3136
3165
  const u = document.createElement("li");
3137
- rt(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
3166
+ st(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
3138
3167
  }
3139
3168
  e.appendChild(c);
3140
3169
  continue;
@@ -3143,7 +3172,7 @@ function mr(e, t) {
3143
3172
  const c = document.createElement("ol");
3144
3173
  for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
3145
3174
  const u = document.createElement("li");
3146
- rt(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
3175
+ st(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
3147
3176
  }
3148
3177
  e.appendChild(c);
3149
3178
  continue;
@@ -3153,17 +3182,17 @@ function mr(e, t) {
3153
3182
  p.push(n[o]), o += 1;
3154
3183
  const d = document.createElement("p");
3155
3184
  p.forEach((c, u) => {
3156
- u > 0 && d.appendChild(document.createElement("br")), rt(d, c);
3185
+ u > 0 && d.appendChild(document.createElement("br")), st(d, c);
3157
3186
  }), e.appendChild(d);
3158
3187
  }
3159
3188
  }
3160
- function rt(e, t) {
3189
+ function st(e, t) {
3161
3190
  const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
3162
3191
  let o = 0;
3163
3192
  for (const i of t.matchAll(n)) {
3164
- const a = i.index ?? 0;
3165
- a > o && e.appendChild(
3166
- document.createTextNode(t.slice(o, a))
3193
+ const r = i.index ?? 0;
3194
+ r > o && e.appendChild(
3195
+ document.createTextNode(t.slice(o, r))
3167
3196
  );
3168
3197
  const l = i[0];
3169
3198
  if (l.startsWith("`")) {
@@ -3183,7 +3212,7 @@ function rt(e, t) {
3183
3212
  } else
3184
3213
  e.appendChild(document.createTextNode(l));
3185
3214
  }
3186
- o = a + l.length;
3215
+ o = r + l.length;
3187
3216
  }
3188
3217
  o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
3189
3218
  }
@@ -3197,7 +3226,7 @@ function fr(e) {
3197
3226
  return !1;
3198
3227
  }
3199
3228
  }
3200
- function Xn(e, t) {
3229
+ function Jn(e, t) {
3201
3230
  if (wr(e))
3202
3231
  return;
3203
3232
  const n = `
@@ -3251,7 +3280,7 @@ function Xn(e, t) {
3251
3280
  --pluno-pa-accent-contrast: #fafafa;
3252
3281
  position: fixed;
3253
3282
  z-index: 2147483645;
3254
- font-family: ${oe.fontFamily};
3283
+ font-family: ${ie.fontFamily};
3255
3284
  font-size: 14px;
3256
3285
  color: var(--pluno-pa-text);
3257
3286
  width: var(--pluno-pa-launcher-width);
@@ -4330,7 +4359,7 @@ function Xn(e, t) {
4330
4359
  place-items: center;
4331
4360
  padding: 18px;
4332
4361
  background: rgba(24, 24, 27, 0.28);
4333
- font-family: var(--pluno-pa-font, ${oe.fontFamily});
4362
+ font-family: var(--pluno-pa-font, ${ie.fontFamily});
4334
4363
  color: var(--pluno-pa-text);
4335
4364
  }
4336
4365
  .pluno-pa-widget__share-dialog {
@@ -4901,6 +4930,23 @@ function Xn(e, t) {
4901
4930
  padding: 36px 4px calc(var(--pluno-pa-starter-edge-gap) - 12px);
4902
4931
  text-align: left;
4903
4932
  }
4933
+ .pluno-pa-widget__empty-state--morning-report {
4934
+ --pluno-pa-starter-edge-gap: 18px;
4935
+ margin: auto 0;
4936
+ padding: 12px 4px;
4937
+ }
4938
+ .pluno-pa-widget__error-retry {
4939
+ display: block;
4940
+ margin-top: 6px;
4941
+ padding: 0;
4942
+ border: 0;
4943
+ background: transparent;
4944
+ color: inherit;
4945
+ font: inherit;
4946
+ font-weight: 700;
4947
+ text-decoration: underline;
4948
+ cursor: pointer;
4949
+ }
4904
4950
  .pluno-pa-widget__empty-state--starter .pluno-pa-widget__empty {
4905
4951
  color: var(--pluno-pa-text);
4906
4952
  font-size: 24px;
@@ -4908,6 +4954,21 @@ function Xn(e, t) {
4908
4954
  line-height: 1.34;
4909
4955
  text-align: left;
4910
4956
  }
4957
+ .pluno-pa-widget__morning-report-snooze {
4958
+ justify-self: end;
4959
+ margin-top: calc(var(--pluno-pa-starter-edge-gap) * -0.55);
4960
+ padding: 4px 8px;
4961
+ border: 0;
4962
+ background: transparent;
4963
+ color: var(--pluno-pa-muted);
4964
+ font: inherit;
4965
+ font-size: 12px;
4966
+ text-decoration: underline;
4967
+ cursor: pointer;
4968
+ }
4969
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__morning-report-snooze {
4970
+ margin-top: -6px;
4971
+ }
4911
4972
  .pluno-pa-widget__empty-hero {
4912
4973
  display: inline-flex;
4913
4974
  align-items: center;
@@ -4968,6 +5029,9 @@ function Xn(e, t) {
4968
5029
  gap: 18px;
4969
5030
  width: min(100%, 320px);
4970
5031
  }
5032
+ .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
5033
+ gap: 12px;
5034
+ }
4971
5035
  .pluno-pa-widget__starter-prompts--empty {
4972
5036
  pointer-events: none;
4973
5037
  }
@@ -5118,8 +5182,8 @@ function Xn(e, t) {
5118
5182
  .pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
5119
5183
  position: absolute;
5120
5184
  top: -16px;
5121
- left: ${Kt}px;
5122
- width: calc(100% - ${Kt * 2}px);
5185
+ left: ${Zt}px;
5186
+ width: calc(100% - ${Zt * 2}px);
5123
5187
  height: 36px;
5124
5188
  z-index: 3;
5125
5189
  filter: url(#pluno-pa-scribble-wobble-2);
@@ -5163,6 +5227,10 @@ function Xn(e, t) {
5163
5227
  .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--starter .pluno-pa-widget__character--empty {
5164
5228
  margin-bottom: 0;
5165
5229
  }
5230
+ .pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__character--empty {
5231
+ width: 96px;
5232
+ height: 96px;
5233
+ }
5166
5234
  .pluno-pa-widget--scribble .pluno-pa-widget__character--tool-group {
5167
5235
  width: 60px;
5168
5236
  height: 60px;
@@ -5470,20 +5538,20 @@ function Xn(e, t) {
5470
5538
  if (br(e, n))
5471
5539
  return;
5472
5540
  const o = e.ownerDocument.createElement("style");
5473
- o.id = uo, o.textContent = n, e.appendChild(o), Lo(e);
5541
+ o.id = ho, o.textContent = n, e.appendChild(o), Po(e);
5474
5542
  }
5475
5543
  function wr(e) {
5476
- return e.getElementById(uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(go) === "true";
5544
+ return e.getElementById(ho) !== null || e.host instanceof HTMLElement && e.host.getAttribute(mo) === "true";
5477
5545
  }
5478
- function Lo(e) {
5479
- e.host instanceof HTMLElement && e.host.setAttribute(go, "true");
5546
+ function Po(e) {
5547
+ e.host instanceof HTMLElement && e.host.setAttribute(mo, "true");
5480
5548
  }
5481
5549
  function br(e, t) {
5482
5550
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
5483
5551
  return !1;
5484
5552
  try {
5485
5553
  const n = new CSSStyleSheet();
5486
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Lo(e), !0;
5554
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Po(e), !0;
5487
5555
  } catch {
5488
5556
  return !1;
5489
5557
  }
@@ -5496,7 +5564,7 @@ async function _r() {
5496
5564
  t.observe(document.documentElement, { childList: !0 });
5497
5565
  });
5498
5566
  }
5499
- function Po(e) {
5567
+ function To(e) {
5500
5568
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
5501
5569
  }
5502
5570
  function xr(e) {
@@ -5504,10 +5572,10 @@ function xr(e) {
5504
5572
  return { clientId: e, release: () => {
5505
5573
  } };
5506
5574
  let t = 0;
5507
- for (; Dt.has(t); )
5575
+ for (; Mt.has(t); )
5508
5576
  t += 1;
5509
- Dt.add(t);
5510
- const n = `${Di}${t}`;
5577
+ Mt.add(t);
5578
+ const n = `${Ri}${t}`;
5511
5579
  let o = crypto.randomUUID();
5512
5580
  try {
5513
5581
  o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
@@ -5517,15 +5585,15 @@ function xr(e) {
5517
5585
  return {
5518
5586
  clientId: o,
5519
5587
  release: () => {
5520
- i || (i = !0, Dt.delete(t));
5588
+ i || (i = !0, Mt.delete(t));
5521
5589
  }
5522
5590
  };
5523
5591
  }
5524
5592
  function yr(e) {
5525
5593
  try {
5526
- const t = window.localStorage.getItem(Po(e));
5594
+ const t = window.localStorage.getItem(To(e));
5527
5595
  if (!t)
5528
- return Zn();
5596
+ return Qn();
5529
5597
  const n = JSON.parse(t);
5530
5598
  return {
5531
5599
  isOpen: n.isOpen === !0,
@@ -5536,19 +5604,19 @@ function yr(e) {
5536
5604
  (o) => typeof o == "string"
5537
5605
  ) : [],
5538
5606
  launcherPosition: Er(n.launcherPosition) ? n.launcherPosition : null,
5539
- panelSize: kr(n.panelSize) ? gt(n.panelSize) : null,
5540
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-oo) : [],
5607
+ panelSize: kr(n.panelSize) ? ft(n.panelSize) : null,
5608
+ seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-ao) : [],
5541
5609
  sharePromptsDisabled: n.sharePromptsDisabled === !0
5542
5610
  };
5543
5611
  } catch {
5544
- return Zn();
5612
+ return Qn();
5545
5613
  }
5546
5614
  }
5547
5615
  async function vr(e) {
5548
5616
  if (e.loadSharePromptsDisabled)
5549
5617
  return e.loadSharePromptsDisabled();
5550
5618
  try {
5551
- return window.localStorage.getItem(ao) === "true";
5619
+ return window.localStorage.getItem(lo) === "true";
5552
5620
  } catch {
5553
5621
  return !1;
5554
5622
  }
@@ -5562,12 +5630,12 @@ function Cr(e, t) {
5562
5630
  return;
5563
5631
  }
5564
5632
  try {
5565
- t && window.localStorage.setItem(ao, "true");
5633
+ t && window.localStorage.setItem(lo, "true");
5566
5634
  } catch {
5567
5635
  return;
5568
5636
  }
5569
5637
  }
5570
- function Zn() {
5638
+ function Qn() {
5571
5639
  return {
5572
5640
  isOpen: !1,
5573
5641
  composerValue: "",
@@ -5583,7 +5651,7 @@ function Zn() {
5583
5651
  function Sr(e, t) {
5584
5652
  try {
5585
5653
  window.localStorage.setItem(
5586
- Po(e),
5654
+ To(e),
5587
5655
  JSON.stringify(t)
5588
5656
  );
5589
5657
  } catch {
@@ -5602,7 +5670,7 @@ function kr(e) {
5602
5670
  const t = e;
5603
5671
  return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
5604
5672
  }
5605
- async function Io(e, t) {
5673
+ async function Ao(e, t) {
5606
5674
  const n = await fetch(e, {
5607
5675
  method: "POST",
5608
5676
  credentials: "include",
@@ -5614,8 +5682,8 @@ async function Io(e, t) {
5614
5682
  ...t ? { signal: t } : {}
5615
5683
  });
5616
5684
  if (!n.ok) {
5617
- const i = await n.text(), a = Qo(i);
5618
- throw a ? (console.error(a), new Error(a)) : new Error(`Failed to load Pluno token (${n.status})`);
5685
+ const i = await n.text(), r = Qo(i);
5686
+ throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
5619
5687
  }
5620
5688
  const o = await n.json();
5621
5689
  if (!o.token)
@@ -5626,9 +5694,9 @@ function Lr(e) {
5626
5694
  return async () => {
5627
5695
  const t = new AbortController();
5628
5696
  let n = !1;
5629
- const o = new Promise((i, a) => {
5697
+ const o = new Promise((i, r) => {
5630
5698
  const l = window.setTimeout(() => {
5631
- n = !0, t.abort(), a(new Error(Ln));
5699
+ n = !0, t.abort(), r(new Error(Pn));
5632
5700
  }, Ai);
5633
5701
  t.signal.addEventListener(
5634
5702
  "abort",
@@ -5638,41 +5706,41 @@ function Lr(e) {
5638
5706
  });
5639
5707
  try {
5640
5708
  const i = await Promise.race([
5641
- Io(e, t.signal),
5709
+ Ao(e, t.signal),
5642
5710
  o
5643
5711
  ]);
5644
5712
  return t.abort(), i;
5645
5713
  } catch (i) {
5646
- throw t.abort(), n ? new Error(Ln) : i instanceof Error && i.message.startsWith("Pluno widget blocked on ") ? i : new Error(Ni);
5714
+ throw t.abort(), n ? new Error(Pn) : i instanceof Error && i.message.startsWith("Pluno widget blocked on ") ? i : new Error(Ni);
5647
5715
  }
5648
5716
  };
5649
5717
  }
5650
- const Jn = /* @__PURE__ */ new WeakSet();
5651
- function Pr(e) {
5718
+ const eo = /* @__PURE__ */ new WeakSet();
5719
+ function Ir(e) {
5652
5720
  return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
5653
5721
  }
5654
- function Qn(e) {
5722
+ function to(e) {
5655
5723
  const t = e.pathname.split("/");
5656
5724
  return t[t.length - 1] ?? "";
5657
5725
  }
5658
- function Ir(e, t) {
5726
+ function Pr(e, t) {
5659
5727
  const n = new URL(e.src, document.baseURI);
5660
- return n.href === t.href || n.pathname === t.pathname ? !0 : Qn(n) === Qn(t);
5728
+ return n.href === t.href || n.pathname === t.pathname ? !0 : to(n) === to(t);
5661
5729
  }
5662
- class de extends EventTarget {
5730
+ class ue extends EventTarget {
5663
5731
  constructor(t, n) {
5664
5732
  super(), this.channelId = n, this.url = t, this.addPreviewListener(ki, () => {
5665
- this.readyState = de.OPEN, this.dispatchEvent(new Event("open"));
5733
+ this.readyState = ue.OPEN, this.dispatchEvent(new Event("open"));
5666
5734
  }), this.addPreviewListener(Li, (o) => {
5667
5735
  const i = o;
5668
5736
  this.dispatchEvent(
5669
5737
  new MessageEvent("message", { data: i.detail?.data ?? "" })
5670
5738
  );
5671
- }), this.addPreviewListener(Pi, () => {
5672
- this.readyState = de.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5673
- }), this.addPreviewListener(Ii, (o) => {
5739
+ }), this.addPreviewListener(Ii, () => {
5740
+ this.readyState = ue.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5741
+ }), this.addPreviewListener(Pi, (o) => {
5674
5742
  const i = o;
5675
- this.readyState = de.CLOSED, this.dispatchEvent(
5743
+ this.readyState = ue.CLOSED, this.dispatchEvent(
5676
5744
  new CloseEvent("close", {
5677
5745
  code: i.detail?.code ?? 1e3,
5678
5746
  reason: i.detail?.reason ?? "",
@@ -5681,7 +5749,7 @@ class de extends EventTarget {
5681
5749
  ), this.cleanup();
5682
5750
  }), window.dispatchEvent(
5683
5751
  new CustomEvent(
5684
- lt(
5752
+ dt(
5685
5753
  Ci,
5686
5754
  this.channelId
5687
5755
  ),
@@ -5701,18 +5769,18 @@ class de extends EventTarget {
5701
5769
  extensions = "";
5702
5770
  binaryType = "blob";
5703
5771
  bufferedAmount = 0;
5704
- readyState = de.CONNECTING;
5772
+ readyState = ue.CONNECTING;
5705
5773
  socketId = Tr();
5706
5774
  listeners = /* @__PURE__ */ new Map();
5707
5775
  send(t) {
5708
- if (this.readyState !== de.OPEN)
5776
+ if (this.readyState !== ue.OPEN)
5709
5777
  throw new DOMException(
5710
5778
  "Pluno preview websocket is not open",
5711
5779
  "InvalidStateError"
5712
5780
  );
5713
5781
  window.dispatchEvent(
5714
5782
  new CustomEvent(
5715
- lt(Si, this.channelId),
5783
+ dt(Si, this.channelId),
5716
5784
  {
5717
5785
  detail: {
5718
5786
  socketId: this.socketId,
@@ -5723,9 +5791,9 @@ class de extends EventTarget {
5723
5791
  );
5724
5792
  }
5725
5793
  close(t, n) {
5726
- this.readyState !== de.CLOSED && (this.readyState = de.CLOSING, window.dispatchEvent(
5794
+ this.readyState !== ue.CLOSED && (this.readyState = ue.CLOSING, window.dispatchEvent(
5727
5795
  new CustomEvent(
5728
- lt(Ei, this.channelId),
5796
+ dt(Ei, this.channelId),
5729
5797
  {
5730
5798
  detail: { socketId: this.socketId, code: t, reason: n }
5731
5799
  }
@@ -5733,11 +5801,11 @@ class de extends EventTarget {
5733
5801
  ), this.cleanup());
5734
5802
  }
5735
5803
  addPreviewListener(t, n) {
5736
- const o = lt(
5804
+ const o = dt(
5737
5805
  t,
5738
5806
  this.channelId
5739
- ), i = (a) => {
5740
- a.detail?.socketId === this.socketId && n(a);
5807
+ ), i = (r) => {
5808
+ r.detail?.socketId === this.socketId && n(r);
5741
5809
  };
5742
5810
  this.listeners.set(o, i), window.addEventListener(o, i);
5743
5811
  }
@@ -5749,14 +5817,14 @@ class de extends EventTarget {
5749
5817
  }
5750
5818
  function Tr() {
5751
5819
  const e = window.sessionStorage.getItem(
5752
- kn
5820
+ In
5753
5821
  );
5754
5822
  if (e)
5755
5823
  return e;
5756
5824
  const t = crypto.randomUUID();
5757
- return window.sessionStorage.setItem(kn, t), t;
5825
+ return window.sessionStorage.setItem(In, t), t;
5758
5826
  }
5759
- function lt(e, t) {
5827
+ function dt(e, t) {
5760
5828
  return `${e}:${t}`;
5761
5829
  }
5762
5830
  function Ar(e) {
@@ -5767,29 +5835,29 @@ function Ar(e) {
5767
5835
  return Array.from(
5768
5836
  document.querySelectorAll("script[type='module'][src]")
5769
5837
  ).filter(
5770
- (i) => i instanceof HTMLScriptElement && Pr(i) && Ir(i, o)
5838
+ (i) => i instanceof HTMLScriptElement && Ir(i) && Pr(i, o)
5771
5839
  );
5772
5840
  }
5773
5841
  function Nr(e) {
5774
5842
  for (const t of Ar(e))
5775
- Jn.has(t) || t.dataset.plunoAutoMount === "false" || (Jn.add(t), To(t).catch((n) => {
5843
+ eo.has(t) || t.dataset.plunoAutoMount === "false" || (eo.add(t), No(t).catch((n) => {
5776
5844
  console.error("Failed to mount Pluno widget", n);
5777
5845
  }));
5778
5846
  }
5779
- function To(e) {
5780
- const t = window, n = t[se];
5847
+ function No(e) {
5848
+ const t = window, n = t[ce];
5781
5849
  if (n) {
5782
5850
  if (n.host === null)
5783
5851
  return n.mountPromise.catch(() => {
5784
- const p = t[se];
5785
- return p ? p.mountPromise : To(e);
5852
+ const p = t[ce];
5853
+ return p ? p.mountPromise : No(e);
5786
5854
  });
5787
- if (Dr(n.host))
5855
+ if (Rr(n.host))
5788
5856
  return n.mountPromise;
5789
- n.destroy?.(), delete t[se];
5857
+ n.destroy?.(), delete t[ce];
5790
5858
  }
5791
5859
  const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint;
5792
- let a;
5860
+ let r;
5793
5861
  const l = ta({
5794
5862
  token: e.dataset.plunoToken,
5795
5863
  tokenProvider: !e.dataset.plunoToken && !o && i ? Lr(i) : void 0,
@@ -5803,25 +5871,25 @@ function To(e) {
5803
5871
  scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
5804
5872
  position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
5805
5873
  }).then((p) => {
5806
- if (t[se] !== a) {
5874
+ if (t[ce] !== r) {
5807
5875
  p.destroy();
5808
5876
  return;
5809
5877
  }
5810
5878
  const d = p.host;
5811
- d.setAttribute(io, "true"), a.host = d, a.destroy = () => {
5812
- t[se] === a && delete t[se], a.host = null, a.destroy = null, p.destroy();
5879
+ d.setAttribute(ro, "true"), r.host = d, r.destroy = () => {
5880
+ t[ce] === r && delete t[ce], r.host = null, r.destroy = null, p.destroy();
5813
5881
  };
5814
5882
  }).catch((p) => {
5815
- throw t[se] === a && delete t[se], p;
5883
+ throw t[ce] === r && delete t[ce], p;
5816
5884
  });
5817
- return a = {
5885
+ return r = {
5818
5886
  mountPromise: l,
5819
5887
  host: null,
5820
5888
  destroy: null
5821
- }, t[se] = a, l;
5889
+ }, t[ce] = r, l;
5822
5890
  }
5823
- function Dr(e) {
5824
- return e.isConnected && e.getAttribute(io) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
5891
+ function Rr(e) {
5892
+ return e.isConnected && e.getAttribute(ro) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
5825
5893
  }
5826
5894
  Nr(import.meta.url);
5827
5895
  export {