@pluno/product-agent-web 0.1.53 → 0.1.55

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,27 +1,27 @@
1
- import { PlunoProductAgent as Vn } from "./product-agent-sdk.js";
2
- const Yn = "#7c3aed", He = "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", Ge = "#2c2a1e", Nt = [253, 250, 241], Dt = 3.5;
3
- function dn(e) {
4
- const t = cn(e);
5
- if (Rt(Te(t), Nt) >= Dt)
1
+ import { PlunoProductAgent as Jn } from "./product-agent-sdk.js";
2
+ const Qn = "#7c3aed", $e = "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", qe = "#2c2a1e", zt = [253, 250, 241], Bt = 3.5;
3
+ function hn(e) {
4
+ const t = mn(e);
5
+ if (Ut(De(t), zt) >= Bt)
6
6
  return t;
7
- let o = Te(t);
8
- const i = Te(Ge);
7
+ let n = De(t);
8
+ const i = De(qe);
9
9
  for (let a = 0; a < 6; a += 1)
10
- if (o = Zn(o, i, 0.22), Rt(o, Nt) >= Dt)
11
- return st(o);
12
- return st(o);
10
+ if (n = no(n, i, 0.22), Ut(n, zt) >= Bt)
11
+ return ut(n);
12
+ return ut(n);
13
13
  }
14
- function Kn() {
15
- let n = "M 280 120", o = !1, i = 0;
14
+ function eo() {
15
+ let o = "M 280 120", n = !1, i = 0;
16
16
  for (let a = 150; a <= 1170; a += 62) {
17
- const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
18
- n += ` L ${p} ${a}`, o = !o, i += 1;
17
+ const l = (i % 3 - 1) * 18, p = n ? 280 - l : 1020 + l;
18
+ o += ` L ${p} ${a}`, n = !n, i += 1;
19
19
  }
20
- return n;
20
+ return o;
21
21
  }
22
- function Xn(e) {
23
- const t = cn(e), n = dt(Te(t));
24
- return n > 0.86 ? {
22
+ function to(e) {
23
+ const t = mn(e), o = gt(De(t));
24
+ return o > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
27
27
  bottom: "#e7e7e7",
@@ -32,7 +32,7 @@ function Xn(e) {
32
32
  highlight: "#ffffff",
33
33
  inner: "#f4f4f4",
34
34
  shadow: "#9d9d9d"
35
- } : n < 0.05 ? {
35
+ } : o < 0.05 ? {
36
36
  top: "#3d3d3d",
37
37
  middle: "#171717",
38
38
  bottom: "#030303",
@@ -44,187 +44,179 @@ function Xn(e) {
44
44
  inner: "#4b4b4b",
45
45
  shadow: "#000000"
46
46
  } : {
47
- top: K(t, 0.28, -0.03),
48
- middle: K(t, 0.08, 0.04),
49
- bottom: K(t, -0.1, 0.02),
50
- edgeStart: K(t, 0.08, 0.08),
51
- edgeMiddle: K(t, -0.08, 0.08),
52
- edgeEnd: K(t, -0.18, 0.05),
53
- glow: K(t, 0.32, -0.12),
54
- highlight: K(t, 0.38, -0.18),
55
- inner: K(t, 0.24, -0.1),
56
- shadow: K(t, -0.25, -0.08)
47
+ top: Z(t, 0.28, -0.03),
48
+ middle: Z(t, 0.08, 0.04),
49
+ bottom: Z(t, -0.1, 0.02),
50
+ edgeStart: Z(t, 0.08, 0.08),
51
+ edgeMiddle: Z(t, -0.08, 0.08),
52
+ edgeEnd: Z(t, -0.18, 0.05),
53
+ glow: Z(t, 0.32, -0.12),
54
+ highlight: Z(t, 0.38, -0.18),
55
+ inner: Z(t, 0.24, -0.1),
56
+ shadow: Z(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
- function cn(e) {
59
+ function mn(e) {
60
60
  const t = e.trim();
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()}` : Yn;
61
+ return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((o) => o + o).join("").toLowerCase()}` : Qn;
62
62
  }
63
- function Te(e) {
63
+ function De(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 st([e, t, n]) {
71
- const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
72
- return `#${o(e)}${o(t)}${o(n)}`;
70
+ function ut([e, t, o]) {
71
+ const n = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
72
+ return `#${n(e)}${n(t)}${n(o)}`;
73
73
  }
74
- function dt([e, t, n]) {
75
- const o = (i) => {
74
+ function gt([e, t, o]) {
75
+ const n = (i) => {
76
76
  const a = i / 255;
77
77
  return a <= 0.04045 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4;
78
78
  };
79
- return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
79
+ return 0.2126 * n(e) + 0.7152 * n(t) + 0.0722 * n(o);
80
80
  }
81
- function Rt(e, t) {
82
- const n = dt(e), o = dt(t), [i, a] = n > o ? [n, o] : [o, n];
81
+ function Ut(e, t) {
82
+ const o = gt(e), n = gt(t), [i, a] = o > n ? [o, n] : [n, o];
83
83
  return (i + 0.05) / (a + 0.05);
84
84
  }
85
- function Zn(e, t, n) {
86
- const o = ct(n);
85
+ function no(e, t, o) {
86
+ const n = ht(o);
87
87
  return [
88
- e[0] + (t[0] - e[0]) * o,
89
- e[1] + (t[1] - e[1]) * o,
90
- e[2] + (t[2] - e[2]) * o
88
+ e[0] + (t[0] - e[0]) * n,
89
+ e[1] + (t[1] - e[1]) * n,
90
+ e[2] + (t[2] - e[2]) * n
91
91
  ];
92
92
  }
93
- function K(e, t, n) {
94
- const [o, i, a] = Jn(Te(e));
95
- return st(Qn(o, ct(i + n), ct(a + t)));
93
+ function Z(e, t, o) {
94
+ const [n, i, a] = oo(De(e));
95
+ return ut(io(n, ht(i + o), ht(a + t)));
96
96
  }
97
- function Jn([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), c = (l + p) / 2;
97
+ function oo([e, t, o]) {
98
+ const n = e / 255, i = t / 255, a = o / 255, l = Math.max(n, i, a), p = Math.min(n, i, a), c = (l + p) / 2;
99
99
  if (l === p)
100
100
  return [0, 0, c];
101
101
  const u = l - p, d = c > 0.5 ? u / (2 - l - p) : u / (l + p);
102
- return [(l === o ? (i - a) / u + (i < a ? 6 : 0) : l === i ? (a - o) / u + 2 : (o - i) / u + 4) / 6, d, c];
102
+ return [(l === n ? (i - a) / u + (i < a ? 6 : 0) : l === i ? (a - n) / u + 2 : (n - i) / u + 4) / 6, d, c];
103
103
  }
104
- function Qn(e, t, n) {
104
+ function io(e, t, o) {
105
105
  if (t === 0)
106
- return [n * 255, n * 255, n * 255];
107
- const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
106
+ return [o * 255, o * 255, o * 255];
107
+ const n = o < 0.5 ? o * (1 + t) : o + t - o * t, i = 2 * o - n;
108
108
  return [
109
- ot(i, o, e + 1 / 3) * 255,
110
- ot(i, o, e) * 255,
111
- ot(i, o, e - 1 / 3) * 255
109
+ at(i, n, e + 1 / 3) * 255,
110
+ at(i, n, e) * 255,
111
+ at(i, n, e - 1 / 3) * 255
112
112
  ];
113
113
  }
114
- function ot(e, t, n) {
115
- let o = n;
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;
114
+ function at(e, t, o) {
115
+ let n = o;
116
+ return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
117
117
  }
118
- function ct(e) {
118
+ function ht(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
- const un = "suggest_share_on_socials";
122
- function eo(e) {
121
+ const bn = "suggest_share_on_socials";
122
+ function ao(e) {
123
123
  for (let t = e.length - 1; t >= 0; t -= 1) {
124
- const n = e[t];
125
- if (n.role !== "tool" || n.toolName !== un)
124
+ const o = e[t];
125
+ if (o.role !== "tool" || o.toolName !== bn)
126
126
  continue;
127
- const o = Mt(e, t, "assistant");
128
- if (!o)
127
+ const n = Ot(e, t, "assistant");
128
+ if (!n)
129
129
  return null;
130
- const i = Mt(e, o.index, "user");
130
+ const i = Ot(e, n.index, "user");
131
131
  return i ? {
132
- id: `share:${n.callId ?? n.id}`,
132
+ id: `share:${o.callId ?? o.id}`,
133
133
  userPrompt: i.content,
134
- assistantAnswer: o.content
134
+ assistantAnswer: n.content
135
135
  } : null;
136
136
  }
137
137
  return null;
138
138
  }
139
- async function to(e) {
140
- const t = await no(e);
139
+ async function ro(e) {
140
+ const t = await lo(e);
141
141
  if (!navigator.clipboard || typeof ClipboardItem > "u")
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 Mt(e, t, n) {
146
- for (let o = t - 1; o >= 0; o -= 1) {
147
- const i = e[o];
148
- if (i.role === n && i.content.trim())
149
- return { index: o, content: i.content.trim() };
145
+ function Ot(e, t, o) {
146
+ for (let n = t - 1; n >= 0; n -= 1) {
147
+ const i = e[n];
148
+ if (i.role === o && i.content.trim())
149
+ return { index: n, content: i.content.trim() };
150
150
  }
151
151
  return null;
152
152
  }
153
- async function no(e) {
153
+ async function lo(e) {
154
154
  return await (await fetch(e)).blob();
155
155
  }
156
- const oo = "https://app.pluno.ai", io = "/api/product-agent/embed/active-users", ao = 1800, ro = 15e3, lo = 250, po = 1e3, so = 3e4;
157
- function co(e, t = {}) {
158
- let n = !1, o = null, i = null, a = null;
156
+ const po = "https://app.pluno.ai", so = "/api/product-agent/embed/active-users", co = 1800, uo = 15e3, go = 250, ho = 1e3, mo = 3e4;
157
+ function bo(e, t = {}) {
158
+ let o = !1, n = null, i = null, a = null;
159
159
  const l = () => {
160
160
  a !== null && (window.clearInterval(a), a = null);
161
161
  }, p = (d) => {
162
- n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
162
+ o || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
163
163
  u();
164
- }, ho(d)));
164
+ }, _o(d)));
165
165
  }, c = (d) => {
166
- if (l(), o === null) {
167
- o = d, e(d);
166
+ if (l(), n === null) {
167
+ n = d, e(d);
168
168
  return;
169
169
  }
170
- const h = o, x = performance.now();
170
+ const g = n, S = performance.now();
171
171
  a = window.setInterval(() => {
172
- if (n) {
172
+ if (o) {
173
173
  l();
174
174
  return;
175
175
  }
176
- const y = Math.min(1, (performance.now() - x) / ao);
177
- o = Math.round(h + (d - h) * mo(y)), e(o), y >= 1 && (o = d, e(d), l());
178
- }, lo);
176
+ const f = Math.min(1, (performance.now() - S) / co);
177
+ n = Math.round(g + (d - g) * xo(f)), e(n), f >= 1 && (n = d, e(d), l());
178
+ }, go);
179
179
  }, u = async () => {
180
180
  try {
181
- const d = await uo(t);
182
- if (n)
181
+ const d = await fo(t);
182
+ if (o)
183
183
  return;
184
184
  c(d.count), p(d.refreshAfterMs);
185
185
  } catch {
186
- p(ro);
186
+ p(uo);
187
187
  }
188
188
  };
189
189
  return u(), () => {
190
- n = !0, i !== null && window.clearTimeout(i), l();
190
+ o = !0, i !== null && window.clearTimeout(i), l();
191
191
  };
192
192
  }
193
- async function uo(e) {
193
+ async function fo(e) {
194
194
  if (e.loader)
195
195
  return e.loader();
196
- const n = await (e.fetcher ?? fetch)(new URL(io, go(e.backendUrl ?? oo)).toString(), {
196
+ const o = await (e.fetcher ?? fetch)(new URL(so, wo(e.backendUrl ?? po)).toString(), {
197
197
  cache: "no-store",
198
198
  credentials: "omit"
199
199
  });
200
- if (!n.ok)
200
+ if (!o.ok)
201
201
  throw new Error("Failed to load active users");
202
- const o = await n.json(), i = zt(o.count), a = zt(o.refreshAfterMs ?? o.refresh_after_ms);
202
+ const n = await o.json(), i = Ft(n.count), a = Ft(n.refreshAfterMs ?? n.refresh_after_ms);
203
203
  if (i === null || a === null)
204
204
  throw new Error("Invalid active users response");
205
205
  return { count: i, refreshAfterMs: a };
206
206
  }
207
- function zt(e) {
207
+ function Ft(e) {
208
208
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
209
209
  }
210
- function go(e) {
210
+ function wo(e) {
211
211
  return e.endsWith("/") ? e : `${e}/`;
212
212
  }
213
- function ho(e) {
214
- return Math.min(so, Math.max(po, e));
213
+ function _o(e) {
214
+ return Math.min(mo, Math.max(ho, e));
215
215
  }
216
- function mo(e) {
216
+ function xo(e) {
217
217
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
218
218
  }
219
- const gn = 100, bo = "product-agent:sdk-preview-socket-connect", fo = "product-agent:sdk-preview-socket-send", wo = "product-agent:sdk-preview-socket-close", _o = "product-agent:sdk-preview-socket-open", xo = "product-agent:sdk-preview-socket-message", yo = "product-agent:sdk-preview-socket-error", vo = "product-agent:sdk-preview-socket-closed", Bt = "product-agent:sdk-preview-socket-id", Co = "data-pluno-sdk-preview-channel", Eo = "product-agent:preview-diagnostic", hn = "pluno.productAgent.sharePromptsDisabled", We = 10, So = 10 * 1024 * 1024, mn = /* @__PURE__ */ new Set([
220
- "image/png",
221
- "image/jpeg",
222
- "image/webp",
223
- "image/gif",
224
- "application/pdf"
225
- ]), ko = Array.from(
226
- mn
227
- ).join(","), Lo = 3, Po = "No recent chats for this page yet.", Z = {
219
+ const fn = 100, vo = "product-agent:sdk-preview-socket-connect", yo = "product-agent:sdk-preview-socket-send", Co = "product-agent:sdk-preview-socket-close", So = "product-agent:sdk-preview-socket-open", Eo = "product-agent:sdk-preview-socket-message", ko = "product-agent:sdk-preview-socket-error", Lo = "product-agent:sdk-preview-socket-closed", Ht = "product-agent:sdk-preview-socket-id", Io = "data-pluno-sdk-preview-channel", Po = "product-agent:preview-diagnostic", wn = "pluno.productAgent.sharePromptsDisabled", Ao = 3, No = "No recent chats for this page yet.", Q = {
228
220
  launcherLabel: "Ask for anything...",
229
221
  accentColor: "#7c3aed",
230
222
  colorScheme: "light",
@@ -232,7 +224,7 @@ const gn = 100, bo = "product-agent:sdk-preview-socket-connect", fo = "product-a
232
224
  scribbleStyle: !1,
233
225
  position: "bottom-right",
234
226
  movableLauncher: !1
235
- }, Ao = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Ot = "pluno-pa-scribble-font", bn = 190, fn = 41, Ut = 22, Io = 16, To = 24, No = 1, Do = 48, Ro = 420, Mo = 520, zo = 0.24, Bo = 680, Oo = 800, Uo = 0.76, W = 8, ut = 50, wn = "http://www.w3.org/2000/svg", Ft = 26, Ht = 8, Fo = 36, Gt = [
227
+ }, To = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Wt = "pluno-pa-scribble-font", _n = 190, xn = 41, Gt = 22, Do = 16, Ro = 24, Mo = 1, zo = 48, Bo = 420, Uo = 520, Oo = 0.24, Fo = 680, Ho = 800, Wo = 0.76, H = 8, mt = 50, vn = "http://www.w3.org/2000/svg", $t = 26, qt = 8, Go = 36, jt = [
236
228
  {
237
229
  ellipseCx: "17.5",
238
230
  ellipseCy: "24.5",
@@ -269,20 +261,20 @@ const gn = 100, bo = "product-agent:sdk-preview-socket-connect", fo = "product-a
269
261
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
270
262
  pathStrokeWidth: "2.45"
271
263
  }
272
- ], Ho = 11, Go = 13, Wt = 4, Wo = 10, $o = 40, qo = "movable-launcher-position-v2", _n = "pluno-pa-widget-styles", xn = "data-pluno-pa-widget-styles";
273
- let $t = 0;
274
- function jo(e) {
275
- return (t) => new oe(t, e);
264
+ ], $o = 11, qo = 13, Vt = 4, jo = 10, Vo = 40, Ko = "movable-launcher-position-v2", yn = "pluno-pa-widget-styles", Cn = "data-pluno-pa-widget-styles";
265
+ let Kt = 0;
266
+ function Yo(e) {
267
+ return (t) => new ae(t, e);
276
268
  }
277
- async function Vo(e = {}) {
269
+ async function Xo(e = {}) {
278
270
  const t = {
279
- launcherLabel: e.launcherLabel ?? Z.launcherLabel,
280
- accentColor: e.accentColor ?? Z.accentColor,
281
- colorScheme: e.colorScheme ?? Z.colorScheme,
282
- fontFamily: e.fontFamily ?? Z.fontFamily,
283
- scribbleStyle: e.scribbleStyle ?? Z.scribbleStyle,
284
- position: e.position ?? Z.position,
285
- movableLauncher: e.movableLauncher ?? Z.movableLauncher,
271
+ launcherLabel: e.launcherLabel ?? Q.launcherLabel,
272
+ accentColor: e.accentColor ?? Q.accentColor,
273
+ colorScheme: e.colorScheme ?? Q.colorScheme,
274
+ fontFamily: e.fontFamily ?? Q.fontFamily,
275
+ scribbleStyle: e.scribbleStyle ?? Q.scribbleStyle,
276
+ position: e.position ?? Q.position,
277
+ movableLauncher: e.movableLauncher ?? Q.movableLauncher,
286
278
  token: e.token,
287
279
  tokenProvider: e.tokenProvider,
288
280
  tokenEndpoint: e.tokenEndpoint,
@@ -293,6 +285,7 @@ async function Vo(e = {}) {
293
285
  restorePersistedState: e.restorePersistedState,
294
286
  expectedPersistedSessionId: e.expectedPersistedSessionId,
295
287
  webSocketFactory: e.webSocketFactory,
288
+ prepareAttachmentUpload: e.prepareAttachmentUpload,
296
289
  loginRequired: e.loginRequired === !0,
297
290
  loginButtonLabel: e.loginButtonLabel ?? "Log in to Pluno",
298
291
  loginUrl: e.loginUrl,
@@ -314,7 +307,7 @@ async function Vo(e = {}) {
314
307
  onPanelOpenChange: e.onPanelOpenChange,
315
308
  showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0
316
309
  };
317
- X(
310
+ J(
318
311
  "web-sdk.widget",
319
312
  "Mounting widget with merged options",
320
313
  {
@@ -329,41 +322,41 @@ async function Vo(e = {}) {
329
322
  initialStarterPromptCount: t.initialStarterPrompts?.length ?? 0
330
323
  }
331
324
  );
332
- const n = document.createElement("div");
333
- n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
334
- Co,
325
+ const o = document.createElement("div");
326
+ o.className = "pluno-pa-widget-host", o.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && o.setAttribute(
327
+ Io,
335
328
  t.sdkPreviewChannelId
336
329
  );
337
- const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
330
+ const n = o.attachShadow({ mode: "open" }), i = document.createElement("div");
338
331
  i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
339
- let a = qt(
332
+ let a = Yt(
340
333
  t.accentColor,
341
334
  t.scribbleStyle
342
335
  );
343
- ui(
336
+ bi(
344
337
  i,
345
338
  t.launcherLabel,
346
339
  a,
347
340
  t.movableLauncher,
348
341
  t.showLauncherMinimizeButton
349
- ), o.appendChild(i);
342
+ ), n.appendChild(i);
350
343
  const l = ca(t);
351
344
  let p = t.movableLauncher ? l.launcherPosition : null, c = p !== null;
352
- 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"), me(
345
+ 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"), fe(
353
346
  i,
354
- it(
347
+ rt(
355
348
  i,
356
349
  p,
357
350
  t.position
358
351
  )
359
- )), rn(o, t.accentColor), jt(i, a, {
352
+ )), dn(n, t.accentColor), Xt(i, a, {
360
353
  accentColor: t.accentColor,
361
354
  colorScheme: t.colorScheme,
362
355
  fontFamily: t.fontFamily,
363
356
  scribbleStyle: t.scribbleStyle
364
357
  });
365
358
  const u = await da(), d = u.ownerDocument;
366
- u.appendChild(n), X(
359
+ u.appendChild(o), J(
367
360
  "web-sdk.widget",
368
361
  "Applied initial widget appearance",
369
362
  {
@@ -373,70 +366,70 @@ async function Vo(e = {}) {
373
366
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
374
367
  }
375
368
  );
376
- const h = i.querySelector(
369
+ const g = i.querySelector(
377
370
  ".pluno-pa-widget__launcher"
378
- ), x = i.querySelector(
371
+ ), S = i.querySelector(
379
372
  ".pluno-pa-widget__launcher-drag-handle"
380
- ), y = i.querySelector(
373
+ ), f = i.querySelector(
381
374
  ".pluno-pa-widget__launcher-input"
382
- ), A = i.querySelector(
375
+ ), O = i.querySelector(
383
376
  ".pluno-pa-widget__launcher-minimize"
384
- ), T = i.querySelector(".pluno-pa-widget__panel"), f = i.querySelector(
377
+ ), k = i.querySelector(".pluno-pa-widget__panel"), x = i.querySelector(
385
378
  ".pluno-pa-widget__close"
386
- ), E = i.querySelector(
379
+ ), v = i.querySelector(
387
380
  ".pluno-pa-widget__composer"
388
- ), g = i.querySelector(
381
+ ), h = i.querySelector(
389
382
  ".pluno-pa-widget__attachment-error"
390
- ), S = i.querySelector(
383
+ ), A = i.querySelector(
391
384
  ".pluno-pa-widget__billing-status"
392
- ), k = i.querySelector(
385
+ ), T = i.querySelector(
393
386
  ".pluno-pa-widget__attachments"
394
- ), R = i.querySelector(
387
+ ), I = i.querySelector(
395
388
  ".pluno-pa-widget__attachment-input"
396
- ), Ce = i.querySelector(
389
+ ), Ee = i.querySelector(
397
390
  ".pluno-pa-widget__attach"
398
391
  ), b = i.querySelector(
399
392
  ".pluno-pa-widget__input"
400
- ), ie = i.querySelector(
393
+ ), D = i.querySelector(
401
394
  ".pluno-pa-widget__send"
402
- ), ae = i.querySelector(
395
+ ), de = i.querySelector(
403
396
  ".pluno-pa-widget__top-actions"
404
- ), _ = i.querySelector(
397
+ ), ce = i.querySelector(
405
398
  ".pluno-pa-widget__history"
406
- ), N = i.querySelector(
399
+ ), we = i.querySelector(
407
400
  ".pluno-pa-widget__history-panel"
408
- ), F = i.querySelector(
401
+ ), W = i.querySelector(
409
402
  ".pluno-pa-widget__history-list"
410
- ), H = i.querySelector(
403
+ ), Re = i.querySelector(
411
404
  ".pluno-pa-widget__history-close"
412
- ), L = i.querySelector(
405
+ ), K = i.querySelector(
413
406
  ".pluno-pa-widget__history-status"
414
- ), I = i.querySelector(
407
+ ), _ = i.querySelector(
415
408
  ".pluno-pa-widget__timeline-jump"
416
- ), be = i.querySelector(
409
+ ), M = i.querySelector(
417
410
  ".pluno-pa-widget__active-users-counter"
418
411
  ), P = i.querySelector(
419
412
  ".pluno-pa-widget__timeline"
420
- ), je = i.querySelector(
413
+ ), G = i.querySelector(
421
414
  ".pluno-pa-widget__timeline-bottom-sentinel"
422
415
  );
423
- if (!h || !y || !T || !f || !E || !g || !S || !k || !R || !Ce || !b || !ie || !ae || !_ || !N || !F || !H || !L || !I || !be || !P || !je)
416
+ if (!g || !f || !k || !x || !v || !h || !A || !T || !I || !Ee || !b || !D || !de || !ce || !we || !W || !Re || !K || !_ || !M || !P || !G)
424
417
  throw new Error("Failed to mount Pluno widget");
425
- if (t.movableLauncher && !x)
418
+ if (t.movableLauncher && !S)
426
419
  throw new Error("Failed to mount Pluno widget drag handle");
427
- Zt(y), Zt(b);
428
- let z = [], te = null;
429
- const fe = () => {
430
- Ti(
431
- k,
432
- z,
420
+ tn(f), tn(b);
421
+ let C = [], L = null;
422
+ const $ = () => {
423
+ Ri(
424
+ T,
425
+ C,
433
426
  (r) => {
434
- z = z.filter(
435
- (s, C) => C !== r
436
- ), fe(), O(w.getState()), $();
427
+ C = C.filter(
428
+ (s, E) => E !== r
429
+ ), $(), U(w.getState()), q();
437
430
  }
438
431
  );
439
- }, Mn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
432
+ }, On = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
440
433
  if (!t.tokenEndpoint)
441
434
  throw new Error("Pluno widget requires token or tokenEndpoint");
442
435
  const r = await fetch(t.tokenEndpoint, {
@@ -454,11 +447,11 @@ async function Vo(e = {}) {
454
447
  if (!s.token)
455
448
  throw new Error("Pluno token endpoint did not return a token");
456
449
  return s.token;
457
- }), zn = window.fetch.bind(window);
450
+ }), Fn = window.fetch.bind(window);
458
451
  let w;
459
- w = await Vn.init({
452
+ w = await Jn.init({
460
453
  token: t.token,
461
- tokenProvider: Mn,
454
+ tokenProvider: On,
462
455
  backendUrl: t.backendUrl,
463
456
  metadata: () => ({
464
457
  ...t.metadata ?? {},
@@ -469,117 +462,118 @@ async function Vo(e = {}) {
469
462
  restorePersistedState: t.restorePersistedState,
470
463
  expectedPersistedSessionId: t.expectedPersistedSessionId,
471
464
  webSocketFactory: t.webSocketFactory,
465
+ prepareAttachmentUpload: t.prepareAttachmentUpload,
472
466
  autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0
473
467
  });
474
- const Ve = new Set(l.openToolGroupKeys), we = new Set(
468
+ const Ke = new Set(l.openToolGroupKeys), _e = new Set(
475
469
  l.seenShareCandidateIds
476
- ), Ne = new Set(we);
477
- let Ye = l.sharePromptsDisabled || await ua(t), j = null, De = !1, de = !1, ce = {
470
+ ), Me = new Set(_e);
471
+ let Ye = l.sharePromptsDisabled || await ua(t), V = null, ze = !1, ue = !1, ge = {
478
472
  enabled: !0
479
- }, ue = 0, _t = "", re = !1, ne = !1, le = [], Ke = null, Ee = null;
480
- const V = (r, s) => {
481
- ce = { enabled: r, reason: s };
482
- }, Y = () => {
483
- I.hidden = !0;
484
- }, Bn = () => {
485
- I.hidden = !1;
486
- }, On = (r = "jump") => {
487
- V(!0, r), Y(), Ie(P, () => ce.enabled), ue = P.scrollTop;
488
- }, ge = () => {
489
- if (_.hidden = t.loginRequired, N.hidden = !re, _.setAttribute("aria-expanded", String(re)), F.classList.toggle(
473
+ }, he = 0, Ct = "", re = !1, ie = !1, le = [], Xe = null, ke = null;
474
+ const Y = (r, s) => {
475
+ ge = { enabled: r, reason: s };
476
+ }, X = () => {
477
+ _.hidden = !0;
478
+ }, Hn = () => {
479
+ _.hidden = !1;
480
+ }, Wn = (r = "jump") => {
481
+ Y(!0, r), X(), Te(P, () => ge.enabled), he = P.scrollTop;
482
+ }, me = () => {
483
+ if (ce.hidden = t.loginRequired, we.hidden = !re, ce.setAttribute("aria-expanded", String(re)), W.classList.toggle(
490
484
  "pluno-pa-widget__history-list--center",
491
- ne && le.length === 0
492
- ), F.replaceChildren(), ne && le.length === 0) {
485
+ ie && le.length === 0
486
+ ), W.replaceChildren(), ie && le.length === 0) {
493
487
  const r = document.createElement("p");
494
- r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", F.appendChild(r);
488
+ r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", W.appendChild(r);
495
489
  }
496
490
  for (const r of le) {
497
491
  const s = document.createElement("button");
498
- s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = ne;
499
- const C = document.createElement("span");
500
- C.className = "pluno-pa-widget__history-item-title", C.textContent = si(r);
501
- const B = document.createElement("time");
502
- B.className = "pluno-pa-widget__history-time", B.dateTime = r.lastActiveAt, B.textContent = ci(
492
+ s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = ie;
493
+ const E = document.createElement("span");
494
+ E.className = "pluno-pa-widget__history-item-title", E.textContent = gi(r);
495
+ const z = document.createElement("time");
496
+ z.className = "pluno-pa-widget__history-time", z.dateTime = r.lastActiveAt, z.textContent = mi(
503
497
  r.lastActiveAt,
504
498
  Date.now()
505
499
  );
506
- const D = document.createElement("small");
507
- D.className = "pluno-pa-widget__history-path", D.textContent = di(r), s.append(C, B, D), s.addEventListener("click", () => {
508
- re = !1, Ee = null, ge(), V(!0, "newSession"), Y(), w.loadSession(r.id), O(w.getState());
509
- }), F.appendChild(s);
500
+ const N = document.createElement("small");
501
+ N.className = "pluno-pa-widget__history-path", N.textContent = hi(r), s.append(E, z, N), s.addEventListener("click", () => {
502
+ re = !1, ke = null, me(), Y(!0, "newSession"), X(), w.loadSession(r.id), U(w.getState());
503
+ }), W.appendChild(s);
510
504
  }
511
- if (ne && le.length > 0) {
505
+ if (ie && le.length > 0) {
512
506
  const r = document.createElement("p");
513
- r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...", F.appendChild(r);
507
+ r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...", W.appendChild(r);
514
508
  }
515
- L.textContent = Ee ?? (!ne && le.length === 0 ? "No recent chats for this page yet." : ""), L.hidden = L.textContent.length === 0;
516
- }, xt = async (r) => {
517
- if (!ne) {
518
- ne = !0, Ee = null, ge();
509
+ K.textContent = ke ?? (!ie && le.length === 0 ? "No recent chats for this page yet." : ""), K.hidden = K.textContent.length === 0;
510
+ }, St = async (r) => {
511
+ if (!ie) {
512
+ ie = !0, ke = null, me();
519
513
  try {
520
514
  const s = await w.listSessions({ cursor: r, limit: 20 });
521
- le = r ? [...le, ...s.sessions] : s.sessions, Ke = s.nextCursor;
515
+ le = r ? [...le, ...s.sessions] : s.sessions, Xe = s.nextCursor;
522
516
  } catch (s) {
523
- X(
517
+ J(
524
518
  "web-sdk.widget",
525
519
  "Failed to load session history",
526
520
  {
527
521
  message: s instanceof Error ? s.message : String(s)
528
522
  }
529
- ), Ee = Po;
523
+ ), ke = No;
530
524
  } finally {
531
- ne = !1, ge();
525
+ ie = !1, me();
532
526
  }
533
527
  }
534
- }, Un = () => {
535
- !Ke || ne || F.scrollHeight - F.scrollTop - F.clientHeight <= 24 && xt(Ke);
536
- }, Fn = () => {
537
- De || typeof document > "u" || (rn(o, t.accentColor), n.isConnected || d.body?.appendChild(n));
538
- }, yt = new MutationObserver(Fn);
539
- yt.observe(d.documentElement, {
528
+ }, Gn = () => {
529
+ !Xe || ie || W.scrollHeight - W.scrollTop - W.clientHeight <= 24 && St(Xe);
530
+ }, $n = () => {
531
+ ze || typeof document > "u" || (dn(n, t.accentColor), o.isConnected || d.body?.appendChild(o));
532
+ }, Et = new MutationObserver($n);
533
+ Et.observe(d.documentElement, {
540
534
  childList: !0,
541
535
  subtree: !0
542
536
  });
543
- const Xe = (r = !0) => {
544
- const s = $e(i, r);
545
- return gt(
537
+ const Ze = (r = !0) => {
538
+ const s = je(i, r);
539
+ return bt(
546
540
  i,
547
- p ? vn(p, s) : Qo(
541
+ p ? En(p, s) : ni(
548
542
  i,
549
543
  t.position,
550
544
  s
551
545
  ),
552
546
  s
553
547
  );
554
- }, G = () => {
548
+ }, F = () => {
555
549
  ha(t, {
556
550
  isOpen: i.classList.contains("pluno-pa-widget--open"),
557
551
  composerValue: b.value,
558
- openToolGroupKeys: [...Ve],
552
+ openToolGroupKeys: [...Ke],
559
553
  launcherPosition: c ? p : null,
560
- seenShareCandidateIds: [...we].slice(
561
- -gn
554
+ seenShareCandidateIds: [..._e].slice(
555
+ -fn
562
556
  ),
563
557
  sharePromptsDisabled: Ye
564
558
  });
565
- }, Re = (r) => {
559
+ }, Be = (r) => {
566
560
  t.onDisplayStateChange?.(r);
567
- }, Se = (r, s = !0) => {
561
+ }, Le = (r, s = !0) => {
568
562
  if (r === "shown") {
569
- i.classList.remove("pluno-pa-widget--minimized"), h.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && ke(!1), s && Re("shown");
563
+ i.classList.remove("pluno-pa-widget--minimized"), g.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Ie(!1), s && Be("shown");
570
564
  return;
571
565
  }
572
- j !== null && (window.clearTimeout(j), j = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), h.hidden = !1, T.hidden = !0, f.hidden = !0, h.tabIndex = 0, b.value = "", me(
566
+ V !== null && (window.clearTimeout(V), V = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), g.hidden = !1, k.hidden = !0, x.hidden = !0, g.tabIndex = 0, b.value = "", fe(
573
567
  i,
574
- it(
568
+ rt(
575
569
  i,
576
570
  p,
577
571
  t.position
578
572
  )
579
- ), Yt(i), G(), s && Re("minimized");
580
- }, he = (r, s = {}) => {
581
- ri(r, {
582
- debugVersion: qo,
573
+ ), Jt(i), F(), s && Be("minimized");
574
+ }, be = (r, s = {}) => {
575
+ si(r, {
576
+ debugVersion: Ko,
583
577
  launcherPosition: p,
584
578
  rootClasses: i.className,
585
579
  rootStyle: {
@@ -588,35 +582,35 @@ async function Vo(e = {}) {
588
582
  right: i.style.right,
589
583
  bottom: i.style.bottom
590
584
  },
591
- rootRect: at(i),
592
- launcherRect: at(h),
593
- panelRect: at(T),
594
- viewport: Q(),
595
- panelHidden: T.hidden,
596
- closeHidden: f.hidden,
585
+ rootRect: lt(i),
586
+ launcherRect: lt(g),
587
+ panelRect: lt(k),
588
+ viewport: ne(),
589
+ panelHidden: k.hidden,
590
+ closeHidden: x.hidden,
597
591
  ...s
598
592
  });
599
- }, ke = (r = !0) => {
593
+ }, Ie = (r = !0) => {
600
594
  if (!p)
601
- return me(i, null), Xe(r);
602
- const s = Xe(r);
603
- return me(i, s), he("Applied stored closed launcher position", {
595
+ return fe(i, null), Ze(r);
596
+ const s = Ze(r);
597
+ return fe(i, s), be("Applied stored closed launcher position", {
604
598
  visibleLauncherPosition: s
605
599
  }), s;
606
- }, vt = (r, s) => {
600
+ }, kt = (r, s) => {
607
601
  if (!r || !s) {
608
- Yt(i);
602
+ Jt(i);
609
603
  return;
610
604
  }
611
- ai(i, {
605
+ pi(i, {
612
606
  x: r.x - s.x,
613
607
  y: r.y - s.y
614
608
  });
615
- }, Ct = () => {
609
+ }, Lt = () => {
616
610
  if (i.classList.contains("pluno-pa-widget--minimized")) {
617
- me(
611
+ fe(
618
612
  i,
619
- it(
613
+ rt(
620
614
  i,
621
615
  p,
622
616
  t.position
@@ -624,127 +618,127 @@ async function Vo(e = {}) {
624
618
  );
625
619
  return;
626
620
  }
627
- const r = ke();
621
+ const r = Ie();
628
622
  if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
629
- const s = Vt(
623
+ const s = Zt(
630
624
  i,
631
625
  r,
632
626
  t.position
633
627
  );
634
- vt(s, r), he(
628
+ kt(s, r), be(
635
629
  "Applied open panel position after viewport resize",
636
630
  { openPanelPosition: s }
637
631
  );
638
- } else p && he(
632
+ } else p && be(
639
633
  "Applied visible launcher position after viewport resize",
640
634
  { visibleLauncherPosition: r }
641
635
  );
642
636
  };
643
- let Et = () => {
637
+ let It = () => {
644
638
  };
645
- window.addEventListener("resize", Ct), t.movableLauncher && x ? (ke(), Et = Jo({
639
+ window.addEventListener("resize", Lt), t.movableLauncher && S ? (Ie(), It = ti({
646
640
  root: i,
647
- launcher: h,
648
- launcherDragHandle: x,
649
- getPosition: () => Xe(),
641
+ launcher: g,
642
+ launcherDragHandle: S,
643
+ getPosition: () => Ze(),
650
644
  setPosition: (r) => {
651
- const s = r, C = $e(i), B = gt(
645
+ const s = r, E = je(i), z = bt(
652
646
  i,
653
647
  r,
654
- C
648
+ E
655
649
  );
656
- p = ti(
657
- B,
658
- C
659
- ), me(i, B), he("Dragging closed launcher", {
650
+ p = ii(
651
+ z,
652
+ E
653
+ ), fe(i, z), be("Dragging closed launcher", {
660
654
  requestedPosition: s
661
655
  });
662
656
  },
663
657
  persist: () => {
664
- c = !0, G(), he("Persisted closed launcher drag position");
658
+ c = !0, F(), be("Persisted closed launcher drag position");
665
659
  }
666
- })) : me(i, null);
667
- let Ze = !1;
668
- const St = async () => {
669
- if (!(!t.billingStatusLoader || Ze)) {
670
- Ze = !0;
660
+ })) : fe(i, null);
661
+ let Je = !1;
662
+ const Pt = async () => {
663
+ if (!(!t.billingStatusLoader || Je)) {
664
+ Je = !0;
671
665
  try {
672
666
  const r = await t.billingStatusLoader();
673
- Qt(
667
+ on(
674
668
  t.billingStatus,
675
669
  r,
676
670
  w.getState().lastErrorCode
677
- ) && (t.billingStatus = r, pt(
678
- S,
671
+ ) && (t.billingStatus = r, dt(
672
+ A,
679
673
  t.billingStatus,
680
674
  w.getState().lastErrorCode
681
- ), $());
675
+ ), q());
682
676
  } finally {
683
- Ze = !1;
677
+ Je = !1;
684
678
  }
685
679
  }
686
680
  }, pe = (r = "", s = !0) => {
687
- St(), j !== null && (window.clearTimeout(j), j = null), Se("shown", !1), T.hidden = !1, f.hidden = !1, i.classList.remove("pluno-pa-widget--closing");
688
- const C = ke(), B = Vt(
681
+ Pt(), V !== null && (window.clearTimeout(V), V = null), Le("shown", !1), k.hidden = !1, x.hidden = !1, i.classList.remove("pluno-pa-widget--closing");
682
+ const E = Ie(), z = Zt(
689
683
  i,
690
- C,
684
+ E,
691
685
  t.position
692
686
  );
693
- if (vt(B, C), he("Opening launcher at clamped open panel position", {
694
- openPanelPosition: B,
695
- visibleLauncherPosition: C
696
- }), V(!0, "open"), Y(), !s) {
697
- i.classList.add("pluno-pa-widget--open"), h.hidden = !0, r && (b.value = r, Ae(b)), Ie(P, () => ce.enabled), ue = P.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), G(), Re("shown"), t.onPanelOpenChange?.(!0);
687
+ if (kt(z, E), be("Opening launcher at clamped open panel position", {
688
+ openPanelPosition: z,
689
+ visibleLauncherPosition: E
690
+ }), Y(!0, "open"), X(), !s) {
691
+ i.classList.add("pluno-pa-widget--open"), g.hidden = !0, r && (b.value = r, Ne(b)), Te(P, () => ge.enabled), he = P.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), F(), Be("shown"), t.onPanelOpenChange?.(!0);
698
692
  return;
699
693
  }
700
694
  window.requestAnimationFrame(() => {
701
- i.classList.add("pluno-pa-widget--open"), r && (b.value = r, Ae(b)), Ie(P, () => ce.enabled), ue = P.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), G(), Re("shown"), t.onPanelOpenChange?.(!0), j = window.setTimeout(() => {
702
- h.hidden = !0, Ie(P, () => ce.enabled), ue = P.scrollTop;
695
+ i.classList.add("pluno-pa-widget--open"), r && (b.value = r, Ne(b)), Te(P, () => ge.enabled), he = P.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), F(), Be("shown"), t.onPanelOpenChange?.(!0), V = window.setTimeout(() => {
696
+ g.hidden = !0, Te(P, () => ge.enabled), he = P.scrollTop;
703
697
  }, 220);
704
698
  });
705
- }, Hn = () => {
706
- j !== null && (window.clearTimeout(j), j = null), h.hidden = !1, p && (ke(!1), he("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), G(), t.onPanelOpenChange?.(!1), j = window.setTimeout(() => {
707
- T.hidden = !0, f.hidden = !0, i.classList.remove("pluno-pa-widget--closing");
699
+ }, qn = () => {
700
+ V !== null && (window.clearTimeout(V), V = null), g.hidden = !1, p && (Ie(!1), be("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), F(), t.onPanelOpenChange?.(!1), V = window.setTimeout(() => {
701
+ k.hidden = !0, x.hidden = !0, i.classList.remove("pluno-pa-widget--closing");
708
702
  }, 220);
709
703
  };
710
- h.addEventListener("submit", (r) => {
711
- r.preventDefault(), pe(y.value), y.value = "";
712
- }), x?.addEventListener("click", (r) => {
704
+ g.addEventListener("submit", (r) => {
705
+ r.preventDefault(), pe(f.value), f.value = "";
706
+ }), S?.addEventListener("click", (r) => {
713
707
  r.preventDefault(), r.stopPropagation();
714
- }), h.addEventListener("click", (r) => {
715
- r.target === y && !x || (pe(y.value), y.value = "");
716
- }), y.addEventListener("focus", () => {
717
- pe(y.value), y.value = "";
718
- }), y.addEventListener("input", () => {
719
- if (!y.value)
708
+ }), g.addEventListener("click", (r) => {
709
+ r.target === f && !S || (pe(f.value), f.value = "");
710
+ }), f.addEventListener("focus", () => {
711
+ pe(f.value), f.value = "";
712
+ }), f.addEventListener("input", () => {
713
+ if (!f.value)
720
714
  return;
721
- const r = y.value;
722
- pe(r), y.value = "";
723
- }), h.addEventListener("keydown", (r) => {
715
+ const r = f.value;
716
+ pe(r), f.value = "";
717
+ }), g.addEventListener("keydown", (r) => {
724
718
  !i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(), pe());
725
- }), A?.addEventListener("pointerdown", (r) => {
719
+ }), O?.addEventListener("pointerdown", (r) => {
726
720
  r.stopPropagation();
727
- }), A?.addEventListener("click", (r) => {
728
- r.preventDefault(), r.stopPropagation(), Se("minimized");
729
- }), f.addEventListener("click", Hn), P.addEventListener("scroll", () => {
730
- P.scrollTop < ue - 1 && V(!1, "userScroll"), ue = P.scrollTop;
731
- }), I.addEventListener("click", () => {
732
- On();
721
+ }), O?.addEventListener("click", (r) => {
722
+ r.preventDefault(), r.stopPropagation(), Le("minimized");
723
+ }), x.addEventListener("click", qn), P.addEventListener("scroll", () => {
724
+ P.scrollTop < he - 1 && Y(!1, "userScroll"), he = P.scrollTop;
725
+ }), _.addEventListener("click", () => {
726
+ Wn();
733
727
  });
734
- const kt = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
728
+ const At = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
735
729
  ([r]) => {
736
- r?.isIntersecting && (V(!0, "bottom"), Y());
730
+ r?.isIntersecting && (Y(!0, "bottom"), X());
737
731
  },
738
732
  { root: P, threshold: 0 }
739
733
  );
740
- kt?.observe(je);
741
- const Me = () => t.loginRequired || t.signupRequired, Lt = () => {
742
- const r = Me();
743
- y.readOnly = r, y.placeholder = r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : t.launcherLabel, b.placeholder = r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Z.launcherLabel, E.hidden = r;
744
- }, $ = () => {
745
- ie.disabled = J(t.billingStatus) || !w.getState().isThinking && b.value.trim().length === 0 && z.length === 0, Ce.disabled = Me() || J(t.billingStatus);
734
+ At?.observe(G);
735
+ const Ue = () => t.loginRequired || t.signupRequired, Nt = () => {
736
+ const r = Ue();
737
+ f.readOnly = r, f.placeholder = r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : t.launcherLabel, b.placeholder = r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Q.launcherLabel, v.hidden = r;
738
+ }, q = () => {
739
+ D.disabled = te(t.billingStatus) || !w.getState().isThinking && b.value.trim().length === 0 && C.length === 0, Ee.disabled = Ue() || te(t.billingStatus);
746
740
  };
747
- Lt(), E.addEventListener("submit", (r) => {
741
+ Nt(), v.addEventListener("submit", (r) => {
748
742
  if (r.preventDefault(), t.loginRequired) {
749
743
  t.onLoginClick?.();
750
744
  return;
@@ -753,59 +747,55 @@ async function Vo(e = {}) {
753
747
  t.onSignupClick?.();
754
748
  return;
755
749
  }
756
- J(t.billingStatus) || (de = !0, V(!0, "send"), Y(), z = rt(
750
+ te(t.billingStatus) || (ue = !0, Y(!0, "send"), X(), C = pt(
757
751
  w,
758
752
  b,
759
- z
760
- ), fe(), $());
753
+ C
754
+ ), $(), q());
761
755
  });
762
- let Le = 0;
763
- const Gn = () => {
764
- Le = 0, i.classList.remove("pluno-pa-widget--drag-over");
765
- }, Pt = (r) => {
766
- te !== null && window.clearTimeout(te), g.textContent = r, g.hidden = !1, te = window.setTimeout(() => {
767
- g.textContent = "", g.hidden = !0, te = null;
756
+ let Pe = 0;
757
+ const jn = () => {
758
+ Pe = 0, i.classList.remove("pluno-pa-widget--drag-over");
759
+ }, Tt = (r) => {
760
+ L !== null && window.clearTimeout(L), h.textContent = r, h.hidden = !1, L = window.setTimeout(() => {
761
+ h.textContent = "", h.hidden = !0, L = null;
768
762
  }, 3e3);
769
- }, Wn = () => {
770
- te !== null && (window.clearTimeout(te), te = null), g.textContent = "", g.hidden = !0;
771
- }, At = async (r) => {
763
+ }, Vn = () => {
764
+ L !== null && (window.clearTimeout(L), L = null), h.textContent = "", h.hidden = !0;
765
+ }, Dt = async (r) => {
772
766
  if (r.length === 0)
773
767
  return;
774
- const s = await Mi(r);
775
- if (z.length + s.length > We)
776
- throw new Error(
777
- `Attach up to ${We} files per message.`
778
- );
779
- z = [...z, ...s], fe(), Wn(), $(), O(w.getState()), i.classList.contains("pluno-pa-widget--open") || pe();
768
+ const s = Bi(w, r);
769
+ C = [...C, ...s], $(), Vn(), q(), U(w.getState()), i.classList.contains("pluno-pa-widget--open") || pe();
780
770
  };
781
- Ce.addEventListener("click", () => {
782
- t.loginRequired || J(t.billingStatus) || R.click();
783
- }), R.addEventListener("change", () => {
784
- const r = Array.from(R.files ?? []);
785
- R.value = "", At(r).catch((s) => {
786
- Pt(
771
+ Ee.addEventListener("click", () => {
772
+ t.loginRequired || te(t.billingStatus) || I.click();
773
+ }), I.addEventListener("change", () => {
774
+ const r = Array.from(I.files ?? []);
775
+ I.value = "", Dt(r).catch((s) => {
776
+ Tt(
787
777
  s instanceof Error ? s.message : "Failed to attach file"
788
- ), X("web-sdk.widget", "Attachment failed", {
778
+ ), J("web-sdk.widget", "Attachment failed", {
789
779
  message: s instanceof Error ? s.message : String(s)
790
780
  });
791
781
  });
792
782
  }), i.addEventListener("dragenter", (r) => {
793
- !Oe(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Le += 1, i.classList.add("pluno-pa-widget--drag-over"));
783
+ !He(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Pe += 1, i.classList.add("pluno-pa-widget--drag-over"));
794
784
  }), i.addEventListener("dragover", (r) => {
795
785
  const s = r.dataTransfer;
796
- !Oe(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
786
+ !He(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
797
787
  }), i.addEventListener("dragleave", (r) => {
798
- Oe(r.dataTransfer) && (r.stopPropagation(), Le = Math.max(0, Le - 1), Le === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
788
+ He(r.dataTransfer) && (r.stopPropagation(), Pe = Math.max(0, Pe - 1), Pe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
799
789
  }), i.addEventListener("drop", (r) => {
800
790
  const s = r.dataTransfer;
801
- !Oe(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Gn(), At(s.files).catch((C) => {
802
- Pt(
803
- C instanceof Error ? C.message : "Failed to attach file"
804
- ), X("web-sdk.widget", "Attachment failed", {
805
- message: C instanceof Error ? C.message : String(C)
791
+ !He(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), jn(), Dt(s.files).catch((E) => {
792
+ Tt(
793
+ E instanceof Error ? E.message : "Failed to attach file"
794
+ ), J("web-sdk.widget", "Attachment failed", {
795
+ message: E instanceof Error ? E.message : String(E)
806
796
  });
807
797
  }));
808
- }), ie.addEventListener("click", () => {
798
+ }), D.addEventListener("click", () => {
809
799
  if (t.loginRequired) {
810
800
  t.onLoginClick?.();
811
801
  return;
@@ -814,61 +804,64 @@ async function Vo(e = {}) {
814
804
  w.stop();
815
805
  return;
816
806
  }
817
- de = !0, V(!0, "send"), Y(), z = rt(
807
+ ue = !0, Y(!0, "send"), X(), C = pt(
818
808
  w,
819
809
  b,
820
- z
821
- ), fe(), $(), O(w.getState());
822
- }), _.addEventListener("click", () => {
823
- re = !re, Ee = null, ge(), re && le.length === 0 && xt(null);
824
- }), H.addEventListener("click", () => {
825
- re = !1, ge();
826
- }), F.addEventListener("scroll", Un), b.addEventListener("input", () => {
827
- Ae(b), G(), $(), O(w.getState());
810
+ C
811
+ ), $(), q(), U(w.getState());
812
+ }), ce.addEventListener("click", () => {
813
+ re = !re, ke = null, me(), re && le.length === 0 && St(null);
814
+ }), Re.addEventListener("click", () => {
815
+ re = !1, me();
816
+ }), W.addEventListener("scroll", Gn), b.addEventListener("input", () => {
817
+ Ne(b), F(), q(), Yn();
828
818
  }), b.addEventListener("keydown", (r) => {
829
819
  if (!(r.key !== "Enter" || r.shiftKey)) {
830
820
  if (r.preventDefault(), t.loginRequired) {
831
821
  t.onLoginClick?.();
832
822
  return;
833
823
  }
834
- de = !0, V(!0, "send"), Y(), z = rt(
824
+ ue = !0, Y(!0, "send"), X(), C = pt(
835
825
  w,
836
826
  b,
837
- z
838
- ), fe(), $(), O(w.getState());
827
+ C
828
+ ), $(), q(), U(w.getState());
839
829
  }
840
830
  }), i.addEventListener("click", (r) => {
841
- (r.target instanceof Element ? r.target : null)?.closest("a[href]") && G();
842
- }), l.composerValue && (b.value = l.composerValue, Ae(b)), t.initialDisplayState === "minimized" ? Se("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && pe(b.value, !1);
843
- const ze = () => a;
844
- let Je = w.getState().appearance !== null, Be = null, Pe = null, _e = null, It = w.getState().isThinking, xe = null, Qe = null, Tt = () => {
831
+ (r.target instanceof Element ? r.target : null)?.closest("a[href]") && F();
832
+ }), l.composerValue && (b.value = l.composerValue, Ne(b)), t.initialDisplayState === "minimized" ? Le("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && pe(b.value, !1);
833
+ const Oe = () => a;
834
+ let Qe = w.getState().appearance !== null, Fe = null, Ae = null, xe = null, Rt = w.getState().isThinking, ve = null, ye = null, Mt = () => {
835
+ };
836
+ const Kn = !!t.socialPostDraftHandler, et = /* @__PURE__ */ new Map(), tt = () => b.value.trim().length > 0 || C.length > 0, Yn = () => {
837
+ const r = ye !== null && ct(w.getState(), tt());
838
+ M.hidden = !r, r && ye !== null && Ln(M, ye);
845
839
  };
846
- const $n = !!t.socialPostDraftHandler;
847
- let ye = null;
848
- const qn = () => {
849
- de = !0, V(!0, "newSession"), Y(), re = !1, ge(), w.startNewSession(), Ve.clear(), b.value = "", z = [], fe(), Ae(b), G(), $(), b.focus(), O(w.getState());
850
- }, et = (r) => {
840
+ let Ce = null;
841
+ const Xn = () => {
842
+ ue = !0, Y(!0, "newSession"), X(), re = !1, me(), w.startNewSession(), Ke.clear(), b.value = "", C = [], $(), Ne(b), F(), q(), b.focus(), U(w.getState());
843
+ }, nt = (r) => {
851
844
  if (!r) {
852
- ye?.remove(), ye = null;
845
+ Ce?.remove(), Ce = null;
853
846
  return;
854
847
  }
855
- ye || (ye = qe(
848
+ Ce || (Ce = Ve(
856
849
  "pluno-pa-widget__new-chat",
857
850
  "New chat",
858
- Ci(),
851
+ ki(),
859
852
  !1
860
- ), ye.addEventListener("click", qn), ae.insertBefore(ye, _));
861
- }, O = (r) => {
862
- if (ge(), wt(r.lastErrorCode) ? xe = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !J(t.billingStatus) && (xe = null), pt(
863
- S,
853
+ ), Ce.addEventListener("click", Xn), de.insertBefore(Ce, ce));
854
+ }, U = (r) => {
855
+ if (me(), yt(r.lastErrorCode) ? ve = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !te(t.billingStatus) && (ve = null), dt(
856
+ A,
864
857
  t.billingStatus,
865
- xe
858
+ ve
866
859
  ), t.loginRequired) {
867
- on(
860
+ et.clear(), pn(
868
861
  P,
869
- ie,
870
- et,
871
- ze,
862
+ D,
863
+ nt,
864
+ Oe,
872
865
  "Log in to use Pluno on this page.",
873
866
  t.loginButtonLabel,
874
867
  t.loginUrl,
@@ -877,11 +870,11 @@ async function Vo(e = {}) {
877
870
  return;
878
871
  }
879
872
  if (t.signupRequired) {
880
- on(
873
+ et.clear(), pn(
881
874
  P,
882
- ie,
883
- et,
884
- ze,
875
+ D,
876
+ nt,
877
+ Oe,
885
878
  "Complete signup to unlock your free trial credits.",
886
879
  t.signupButtonLabel,
887
880
  t.signupUrl,
@@ -889,70 +882,65 @@ async function Vo(e = {}) {
889
882
  );
890
883
  return;
891
884
  }
892
- const s = li(r), C = s !== _t;
893
- _t = s;
894
- const B = de || ce.enabled;
895
- de = !1, Vi(
885
+ const s = ci(r), E = s !== Ct;
886
+ Ct = s;
887
+ const z = ue || ge.enabled;
888
+ ue = !1, $i(
896
889
  P,
897
- je,
898
- ie,
899
- et,
900
- be,
901
- r,
902
- Qe,
903
- Qe !== null && tn(
904
- r,
905
- b.value.trim().length > 0 || z.length > 0
906
- ),
907
- B,
908
- () => ce.enabled,
909
- Ve,
910
890
  G,
911
- ze,
912
- (D) => {
913
- de = !0, V(!0, "send"), Y(), w.sendMessage(D);
891
+ D,
892
+ nt,
893
+ M,
894
+ r,
895
+ ye,
896
+ ye !== null && ct(r, tt()),
897
+ z,
898
+ () => ge.enabled,
899
+ Ke,
900
+ et,
901
+ F,
902
+ Oe,
903
+ (N) => {
904
+ ue = !0, Y(!0, "send"), X(), w.sendMessage(N);
914
905
  },
915
- $n && !Ye ? {
916
- dismissedCandidateIds: Ne,
917
- draftingCandidateId: Be,
918
- error: Pe,
919
- characterIconOptions: ze(),
920
- onSeen: (D) => {
921
- we.add(D.id), G();
906
+ Kn && !Ye ? {
907
+ dismissedCandidateIds: Me,
908
+ draftingCandidateId: Fe,
909
+ error: Ae,
910
+ characterIconOptions: Oe(),
911
+ onSeen: (N) => {
912
+ _e.add(N.id), F();
922
913
  },
923
- onDraft: (D) => {
924
- jn(D);
914
+ onDraft: (N) => {
915
+ Zn(N);
925
916
  },
926
- onDismiss: (D) => {
927
- we.add(D.id), Ne.add(D.id), G(), Pe = null, O(w.getState());
917
+ onDismiss: (N) => {
918
+ _e.add(N.id), Me.add(N.id), F(), Ae = null, U(w.getState());
928
919
  },
929
- onDisable: (D) => {
930
- Ye = !0, we.add(D.id), Ne.add(D.id), G(), ga(t, !0), Pe = null, O(w.getState());
920
+ onDisable: (N) => {
921
+ Ye = !0, _e.add(N.id), Me.add(N.id), F(), ga(t, !0), Ae = null, U(w.getState());
931
922
  }
932
923
  } : void 0
933
- ), B ? (ue = P.scrollTop, Y()) : C && pi(r) && Bn();
924
+ ), z ? (he = P.scrollTop, X()) : E && ui(r) && Hn();
934
925
  };
935
- return Tt = co(
926
+ return Mt = bo(
936
927
  (r) => {
937
- Qe = r, !De && tn(
938
- w.getState(),
939
- b.value.trim().length > 0 || z.length > 0
940
- ) && O(w.getState());
928
+ ye = r, !ze && ct(w.getState(), tt()) && U(w.getState());
941
929
  },
942
930
  {
943
931
  backendUrl: t.backendUrl,
944
- fetcher: zn,
932
+ fetcher: Fn,
945
933
  loader: t.activeUsersLoader
946
934
  }
947
935
  ), w.on("state", (r) => {
948
- const s = It && !r.isThinking;
949
- It = r.isThinking, r.appearance ? (Je = !0, X(
936
+ const s = Rt && !r.isThinking;
937
+ Rt = r.isThinking, r.appearance ? (Qe = !0, J(
950
938
  "web-sdk.widget",
951
939
  "Agent state supplied appearance",
952
940
  {
953
941
  appearance: r.appearance
954
942
  }
955
- ), tt(r.appearance, "agent.state.appearance")) : Je && (Je = !1, X(
943
+ ), ot(r.appearance, "agent.state.appearance")) : Qe && (Qe = !1, J(
956
944
  "web-sdk.widget",
957
945
  "Agent state cleared appearance; reverting to configured widget options",
958
946
  {
@@ -960,32 +948,32 @@ async function Vo(e = {}) {
960
948
  fallbackColorScheme: t.colorScheme,
961
949
  fallbackFontFamily: t.fontFamily
962
950
  }
963
- ), tt({}, "agent.state.appearance-cleared")), O(r), $(), s && St();
964
- }), O(w.getState()), $(), {
951
+ ), ot({}, "agent.state.appearance-cleared")), U(r), q(), s && Pt();
952
+ }), U(w.getState()), q(), {
965
953
  agent: w,
966
954
  updateAppearance: (r) => {
967
- r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), tt(r, "widgetHandle.updateAppearance");
955
+ r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), ot(r, "widgetHandle.updateAppearance");
968
956
  },
969
957
  updateBillingStatus: (r) => {
970
958
  const s = r ?? null;
971
- Qt(
959
+ on(
972
960
  t.billingStatus,
973
961
  s,
974
- xe
975
- ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !J(t.billingStatus) && (xe = null), pt(
962
+ ve
963
+ ) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !te(t.billingStatus) && (ve = null), dt(
976
964
  i.querySelector(".pluno-pa-widget__billing-status"),
977
965
  t.billingStatus,
978
- xe
979
- ), $());
966
+ ve
967
+ ), q());
980
968
  },
981
969
  updateAuthGate: (r) => {
982
- const s = Me();
983
- 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), Lt(), O(w.getState()), $(), s && !Me() && w.connect().catch((C) => {
984
- X(
970
+ const s = Ue();
971
+ t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl), Nt(), U(w.getState()), q(), s && !Ue() && w.connect().catch((E) => {
972
+ J(
985
973
  "web-sdk.widget",
986
974
  "Failed to connect after auth gate cleared",
987
975
  {
988
- message: C instanceof Error ? C.message : String(C)
976
+ message: E instanceof Error ? E.message : String(E)
989
977
  }
990
978
  );
991
979
  });
@@ -995,66 +983,66 @@ async function Vo(e = {}) {
995
983
  },
996
984
  updateDisplayState: (r) => {
997
985
  if (r === "shown") {
998
- Se("shown", !1);
986
+ Le("shown", !1);
999
987
  return;
1000
988
  }
1001
- Se("minimized", !1);
989
+ Le("minimized", !1);
1002
990
  },
1003
991
  destroy: () => {
1004
- De || (De = !0, yt.disconnect(), kt?.disconnect(), window.removeEventListener("resize", Ct), Et(), te !== null && window.clearTimeout(te), Tt(), _e?.remove(), w.destroy(), n.remove());
992
+ ze || (ze = !0, Et.disconnect(), At?.disconnect(), window.removeEventListener("resize", Lt), It(), L !== null && window.clearTimeout(L), Mt(), xe?.remove(), w.destroy(), o.remove());
1005
993
  }
1006
994
  };
1007
- async function jn(r) {
1008
- if (!Be) {
1009
- Be = r.id, Pe = null, O(w.getState());
995
+ async function Zn(r) {
996
+ if (!Fe) {
997
+ Fe = r.id, Ae = null, U(w.getState());
1010
998
  try {
1011
999
  if (!t.socialPostDraftHandler)
1012
1000
  throw new Error("Social post drafting is not available here.");
1013
1001
  const s = await t.socialPostDraftHandler(r);
1014
1002
  if (!s.linkedinPost || !s.xPost)
1015
1003
  throw new Error("Pluno did not return a complete social post draft.");
1016
- we.add(r.id), Ne.add(r.id), G(), _e?.remove(), _e = Ji(s, {
1004
+ _e.add(r.id), Me.add(r.id), F(), xe?.remove(), xe = Ji(s, {
1017
1005
  socialPostRewardsUrl: t.socialPostRewardsUrl,
1018
1006
  onClose: () => {
1019
- _e?.remove(), _e = null;
1007
+ xe?.remove(), xe = null;
1020
1008
  }
1021
- }), i.appendChild(_e);
1009
+ }), i.appendChild(xe);
1022
1010
  } catch (s) {
1023
- Pe = s instanceof Error ? s.message : "Could not draft social post.";
1011
+ Ae = s instanceof Error ? s.message : "Could not draft social post.";
1024
1012
  } finally {
1025
- Be = null, O(w.getState());
1013
+ Fe = null, U(w.getState());
1026
1014
  }
1027
1015
  }
1028
1016
  }
1029
- function tt(r, s) {
1030
- const C = r.accentColor ?? t.accentColor, B = r.colorScheme ?? t.colorScheme, D = r.fontFamily ?? t.fontFamily, nt = r.scribbleStyle ?? t.scribbleStyle;
1031
- a = qt(
1032
- C,
1033
- nt
1034
- ), jt(i, a, {
1035
- accentColor: C,
1036
- colorScheme: B,
1037
- fontFamily: D,
1038
- scribbleStyle: nt
1039
- }), X("web-sdk.widget", "Updated widget appearance", {
1017
+ function ot(r, s) {
1018
+ const E = r.accentColor ?? t.accentColor, z = r.colorScheme ?? t.colorScheme, N = r.fontFamily ?? t.fontFamily, it = r.scribbleStyle ?? t.scribbleStyle;
1019
+ a = Yt(
1020
+ E,
1021
+ it
1022
+ ), Xt(i, a, {
1023
+ accentColor: E,
1024
+ colorScheme: z,
1025
+ fontFamily: N,
1026
+ scribbleStyle: it
1027
+ }), J("web-sdk.widget", "Updated widget appearance", {
1040
1028
  source: s,
1041
1029
  inputAppearance: r,
1042
- appliedAccentColor: C,
1043
- appliedColorScheme: B,
1044
- appliedFontFamily: D,
1045
- appliedScribbleStyle: nt,
1030
+ appliedAccentColor: E,
1031
+ appliedColorScheme: z,
1032
+ appliedFontFamily: N,
1033
+ appliedScribbleStyle: it,
1046
1034
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
1047
1035
  });
1048
1036
  }
1049
1037
  }
1050
- function qt(e, t) {
1038
+ function Yt(e, t) {
1051
1039
  return { accentColor: e, scribbleStyle: t };
1052
1040
  }
1053
- function Yo(e) {
1054
- const t = Ko(e);
1055
- return t === null ? "#fafafa" : Xo(t) > 0.5 ? "#18181b" : "#fafaf9";
1041
+ function Zo(e) {
1042
+ const t = Jo(e);
1043
+ return t === null ? "#fafafa" : Qo(t) > 0.5 ? "#18181b" : "#fafaf9";
1056
1044
  }
1057
- function Ko(e) {
1045
+ function Jo(e) {
1058
1046
  const t = e.trim();
1059
1047
  return /^#[0-9a-f]{6}$/i.test(t) ? [
1060
1048
  Number.parseInt(t.slice(1, 3), 16),
@@ -1066,26 +1054,26 @@ function Ko(e) {
1066
1054
  Number.parseInt(t[3] + t[3], 16)
1067
1055
  ] : null;
1068
1056
  }
1069
- function Xo([e, t, n]) {
1070
- const o = (i) => {
1057
+ function Qo([e, t, o]) {
1058
+ const n = (i) => {
1071
1059
  const a = i / 255;
1072
1060
  return a <= 0.03928 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4;
1073
1061
  };
1074
- return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
1062
+ return 0.2126 * n(e) + 0.7152 * n(t) + 0.0722 * n(o);
1075
1063
  }
1076
- function jt(e, t, n) {
1064
+ function Xt(e, t, o) {
1077
1065
  e.classList.toggle(
1078
1066
  "pluno-pa-widget--dark",
1079
- n.colorScheme === "dark"
1067
+ o.colorScheme === "dark"
1080
1068
  ), e.classList.toggle(
1081
1069
  "pluno-pa-widget--light",
1082
- n.colorScheme !== "dark"
1083
- ), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
1084
- const o = n.scribbleStyle ? dn(n.accentColor) : n.accentColor;
1085
- e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
1070
+ o.colorScheme !== "dark"
1071
+ ), e.classList.toggle("pluno-pa-widget--scribble", o.scribbleStyle);
1072
+ const n = o.scribbleStyle ? hn(o.accentColor) : o.accentColor;
1073
+ e.style.setProperty("--pluno-pa-accent", n), o.scribbleStyle ? e.style.setProperty(
1086
1074
  "--pluno-pa-accent-contrast",
1087
- Yo(o)
1088
- ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ao : n.fontFamily, n.scribbleStyle && Zo(e.ownerDocument);
1075
+ Zo(n)
1076
+ ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = o.scribbleStyle ? To : o.fontFamily, o.scribbleStyle && ei(e.ownerDocument);
1089
1077
  const i = Array.from(
1090
1078
  e.querySelectorAll(".pluno-pa-widget__character")
1091
1079
  );
@@ -1097,11 +1085,11 @@ function jt(e, t, n) {
1097
1085
  )
1098
1086
  );
1099
1087
  }
1100
- function Zo(e) {
1101
- if (e.getElementById(Ot))
1088
+ function ei(e) {
1089
+ if (e.getElementById(Wt))
1102
1090
  return;
1103
1091
  const t = e.createElement("style");
1104
- t.id = Ot, t.textContent = `@font-face {
1092
+ t.id = Wt, t.textContent = `@font-face {
1105
1093
  font-family: "Architects Daughter";
1106
1094
  font-style: normal;
1107
1095
  font-weight: 400;
@@ -1109,201 +1097,201 @@ function Zo(e) {
1109
1097
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
1110
1098
  }`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
1111
1099
  }
1112
- function Jo({
1100
+ function ti({
1113
1101
  root: e,
1114
1102
  launcher: t,
1115
- launcherDragHandle: n,
1116
- getPosition: o,
1103
+ launcherDragHandle: o,
1104
+ getPosition: n,
1117
1105
  setPosition: i,
1118
1106
  persist: a
1119
1107
  }) {
1120
1108
  let l = null, p = null, c = null, u = !1, d = null;
1121
- const h = () => {
1109
+ const g = () => {
1122
1110
  l = null, p = null, c = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
1123
- }, x = (g) => {
1124
- e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (g.preventDefault(), g.stopPropagation(), l = g.pointerId, p = { x: g.clientX, y: g.clientY }, c = o(), u = !1, t.setPointerCapture?.(g.pointerId));
1125
- }, y = (g) => {
1126
- if (l !== g.pointerId || !p || !c)
1111
+ }, S = (h) => {
1112
+ 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 }, c = n(), u = !1, t.setPointerCapture?.(h.pointerId));
1113
+ }, f = (h) => {
1114
+ if (l !== h.pointerId || !p || !c)
1127
1115
  return;
1128
- g.preventDefault();
1129
- const S = g.clientX - p.x, k = g.clientY - p.y;
1130
- !u && Math.hypot(S, k) < Wt || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: c.x + S, y: c.y + k }));
1131
- }, A = (g) => {
1132
- l === g.pointerId && (g.preventDefault(), g.stopPropagation(), u && (d = { x: g.clientX, y: g.clientY }, a()), h());
1133
- }, T = (g) => {
1134
- l === g.pointerId && (g.preventDefault(), h());
1135
- }, f = (g) => {
1116
+ h.preventDefault();
1117
+ const A = h.clientX - p.x, T = h.clientY - p.y;
1118
+ !u && Math.hypot(A, T) < Vt || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: c.x + A, y: c.y + T }));
1119
+ }, O = (h) => {
1120
+ l === h.pointerId && (h.preventDefault(), h.stopPropagation(), u && (d = { x: h.clientX, y: h.clientY }, a()), g());
1121
+ }, k = (h) => {
1122
+ l === h.pointerId && (h.preventDefault(), g());
1123
+ }, x = (h) => {
1136
1124
  if (!d)
1137
1125
  return;
1138
- const S = Math.hypot(
1139
- g.clientX - d.x,
1140
- g.clientY - d.y
1141
- ) <= Wt;
1142
- d = null, S && (g.preventDefault(), g.stopPropagation());
1143
- }, E = (g) => {
1126
+ const A = Math.hypot(
1127
+ h.clientX - d.x,
1128
+ h.clientY - d.y
1129
+ ) <= Vt;
1130
+ d = null, A && (h.preventDefault(), h.stopPropagation());
1131
+ }, v = (h) => {
1144
1132
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1145
1133
  return;
1146
- const S = g.shiftKey ? $o : Wo, k = o();
1147
- let R = null;
1148
- g.key === "ArrowUp" ? R = { x: k.x, y: k.y - S } : g.key === "ArrowDown" ? R = { x: k.x, y: k.y + S } : g.key === "ArrowLeft" ? R = { x: k.x - S, y: k.y } : g.key === "ArrowRight" && (R = { x: k.x + S, y: k.y }), R && (g.preventDefault(), g.stopPropagation(), i(R), a());
1134
+ const A = h.shiftKey ? Vo : jo, T = n();
1135
+ let I = null;
1136
+ h.key === "ArrowUp" ? I = { x: T.x, y: T.y - A } : h.key === "ArrowDown" ? I = { x: T.x, y: T.y + A } : h.key === "ArrowLeft" ? I = { x: T.x - A, y: T.y } : h.key === "ArrowRight" && (I = { x: T.x + A, y: T.y }), I && (h.preventDefault(), h.stopPropagation(), i(I), a());
1149
1137
  };
1150
- return t.addEventListener("pointerdown", x), t.addEventListener("pointermove", y), t.addEventListener("pointerup", A), t.addEventListener("pointercancel", T), t.addEventListener("click", f, !0), n.addEventListener("keydown", E), () => {
1151
- t.removeEventListener("pointerdown", x), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup", A), t.removeEventListener("pointercancel", T), t.removeEventListener("click", f, !0), n.removeEventListener("keydown", E);
1138
+ return t.addEventListener("pointerdown", S), t.addEventListener("pointermove", f), t.addEventListener("pointerup", O), t.addEventListener("pointercancel", k), t.addEventListener("click", x, !0), o.addEventListener("keydown", v), () => {
1139
+ t.removeEventListener("pointerdown", S), t.removeEventListener("pointermove", f), t.removeEventListener("pointerup", O), t.removeEventListener("pointercancel", k), t.removeEventListener("click", x, !0), o.removeEventListener("keydown", v);
1152
1140
  };
1153
1141
  }
1154
- function $e(e, t = !0) {
1155
- const n = Q();
1142
+ function je(e, t = !0) {
1143
+ const o = ne();
1156
1144
  if (e.classList.contains("pluno-pa-widget--minimized"))
1157
1145
  return e.classList.contains("pluno-pa-widget--scribble") ? {
1158
- width: Io,
1159
- height: To
1160
- } : { width: Ut, height: Ut };
1161
- const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1146
+ width: Do,
1147
+ height: Ro
1148
+ } : { width: Gt, height: Gt };
1149
+ const n = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1162
1150
  return {
1163
- width: t && i && o.width > 0 ? o.width : Math.min(bn, n.width - 36),
1164
- height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Do : fn
1151
+ width: t && i && n.width > 0 ? n.width : Math.min(_n, o.width - 36),
1152
+ height: t && i && n.height > 0 ? n.height : e.classList.contains("pluno-pa-widget--scribble") ? zo : xn
1165
1153
  };
1166
1154
  }
1167
- function yn() {
1168
- const e = Q();
1155
+ function Sn() {
1156
+ const e = ne();
1169
1157
  return {
1170
1158
  width: Math.min(
1171
- ve(
1172
- e.width * zo,
1173
- Ro,
1174
- Mo
1159
+ Se(
1160
+ e.width * Oo,
1161
+ Bo,
1162
+ Uo
1175
1163
  ),
1176
- e.width - W * 2
1164
+ e.width - H * 2
1177
1165
  ),
1178
1166
  height: Math.min(
1179
- ve(
1180
- e.height * Uo,
1181
- Bo,
1182
- Oo
1167
+ Se(
1168
+ e.height * Wo,
1169
+ Fo,
1170
+ Ho
1183
1171
  ),
1184
- e.height - ut - W
1172
+ e.height - mt - H
1185
1173
  )
1186
1174
  };
1187
1175
  }
1188
- function Qo(e, t, n) {
1189
- const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
1190
- if (Number.isFinite(o) && Number.isFinite(i))
1191
- return { x: o, y: i };
1176
+ function ni(e, t, o) {
1177
+ const n = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
1178
+ if (Number.isFinite(n) && Number.isFinite(i))
1179
+ return { x: n, y: i };
1192
1180
  const a = e.getBoundingClientRect();
1193
1181
  if (a.width > 0 || a.height > 0)
1194
1182
  return { x: a.left, y: a.top };
1195
- const l = Q();
1183
+ const l = ne();
1196
1184
  return {
1197
- x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
1198
- y: l.height - 24 - n.height
1185
+ x: t === "bottom-left" ? 26 : l.width - 26 - o.width,
1186
+ y: l.height - 24 - o.height
1199
1187
  };
1200
1188
  }
1201
- function it(e, t, n) {
1202
- const o = $e(e, !1);
1203
- return t ? gt(
1189
+ function rt(e, t, o) {
1190
+ const n = je(e, !1);
1191
+ return t ? bt(
1204
1192
  e,
1205
- vn(t, o),
1206
- o
1207
- ) : ei(n === "bottom-left" ? "bottom-left" : "bottom-right", o, No);
1193
+ En(t, n),
1194
+ n
1195
+ ) : oi(o === "bottom-left" ? "bottom-left" : "bottom-right", n, Mo);
1208
1196
  }
1209
- function ei(e, t, n) {
1210
- const o = Q();
1197
+ function oi(e, t, o) {
1198
+ const n = ne();
1211
1199
  return {
1212
- x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
1213
- y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
1200
+ x: e.endsWith("right") ? Math.max(0, n.width - t.width - o) : o,
1201
+ y: e.startsWith("bottom") ? Math.max(0, n.height - t.height - o) : o
1214
1202
  };
1215
1203
  }
1216
- function gt(e, t, n) {
1217
- const o = Q(), i = W + oi(e);
1204
+ function bt(e, t, o) {
1205
+ const n = ne(), i = H + ri(e);
1218
1206
  return {
1219
- x: ve(
1207
+ x: Se(
1220
1208
  t.x,
1221
- W,
1209
+ H,
1222
1210
  Math.max(
1223
- W,
1224
- o.width - n.width - W
1211
+ H,
1212
+ n.width - o.width - H
1225
1213
  )
1226
1214
  ),
1227
- y: ve(
1215
+ y: Se(
1228
1216
  t.y,
1229
1217
  i,
1230
1218
  Math.max(
1231
1219
  i,
1232
- o.height - n.height - W
1220
+ n.height - o.height - H
1233
1221
  )
1234
1222
  )
1235
1223
  };
1236
1224
  }
1237
- function vn(e, t) {
1238
- const n = Q();
1225
+ function En(e, t) {
1226
+ const o = ne();
1239
1227
  return {
1240
- x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
1241
- y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
1228
+ x: e.anchor.endsWith("right") ? o.width - t.width - e.x : e.x,
1229
+ y: e.anchor.startsWith("bottom") ? o.height - t.height - e.y : e.y
1242
1230
  };
1243
1231
  }
1244
- function ti(e, t) {
1245
- const n = ni(e, t), o = Q();
1232
+ function ii(e, t) {
1233
+ const o = ai(e, t), n = ne();
1246
1234
  return {
1247
- anchor: n,
1248
- x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
1249
- y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
1235
+ anchor: o,
1236
+ x: o.endsWith("right") ? n.width - e.x - t.width : e.x,
1237
+ y: o.startsWith("bottom") ? n.height - e.y - t.height : e.y
1250
1238
  };
1251
1239
  }
1252
- function ni(e, t) {
1253
- const n = Q(), o = e.x + t.width / 2, a = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
1240
+ function ai(e, t) {
1241
+ const o = ne(), n = e.x + t.width / 2, a = e.y + t.height / 2 <= o.height / 2 ? "top" : "bottom", l = n <= o.width / 2 ? "left" : "right";
1254
1242
  return `${a}-${l}`;
1255
1243
  }
1256
- function oi(e) {
1257
- return e.classList.contains("pluno-pa-widget--scribble") ? Go : Ho;
1244
+ function ri(e) {
1245
+ return e.classList.contains("pluno-pa-widget--scribble") ? qo : $o;
1258
1246
  }
1259
- function Vt(e, t, n) {
1260
- const o = $e(e), i = yn(), a = {
1261
- x: n === "bottom-left" ? t.x : t.x + o.width - i.width,
1262
- y: t.y + o.height - i.height
1247
+ function Zt(e, t, o) {
1248
+ const n = je(e), i = Sn(), a = {
1249
+ x: o === "bottom-left" ? t.x : t.x + n.width - i.width,
1250
+ y: t.y + n.height - i.height
1263
1251
  };
1264
- return ii(a);
1252
+ return li(a);
1265
1253
  }
1266
- function ii(e) {
1267
- const t = Q(), n = yn();
1254
+ function li(e) {
1255
+ const t = ne(), o = Sn();
1268
1256
  return {
1269
- x: ve(
1257
+ x: Se(
1270
1258
  e.x,
1271
- W,
1259
+ H,
1272
1260
  Math.max(
1273
- W,
1274
- t.width - n.width - W
1261
+ H,
1262
+ t.width - o.width - H
1275
1263
  )
1276
1264
  ),
1277
- y: ve(
1265
+ y: Se(
1278
1266
  e.y,
1279
- ut,
1267
+ mt,
1280
1268
  Math.max(
1281
- ut,
1282
- t.height - n.height - W
1269
+ mt,
1270
+ t.height - o.height - H
1283
1271
  )
1284
1272
  )
1285
1273
  };
1286
1274
  }
1287
- function me(e, t) {
1275
+ function fe(e, t) {
1288
1276
  if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
1289
1277
  e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
1290
1278
  return;
1291
1279
  }
1292
1280
  e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
1293
1281
  }
1294
- function ai(e, t) {
1282
+ function pi(e, t) {
1295
1283
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1296
1284
  }
1297
- function Yt(e) {
1285
+ function Jt(e) {
1298
1286
  e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
1299
1287
  }
1300
- function Q() {
1288
+ function ne() {
1301
1289
  return {
1302
- width: window.innerWidth || document.documentElement.clientWidth || bn + W * 2,
1303
- height: window.innerHeight || document.documentElement.clientHeight || fn + W * 2
1290
+ width: window.innerWidth || document.documentElement.clientWidth || _n + H * 2,
1291
+ height: window.innerHeight || document.documentElement.clientHeight || xn + H * 2
1304
1292
  };
1305
1293
  }
1306
- function at(e) {
1294
+ function lt(e) {
1307
1295
  const t = e.getBoundingClientRect();
1308
1296
  return {
1309
1297
  x: Math.round(t.x),
@@ -1312,42 +1300,45 @@ function at(e) {
1312
1300
  height: Math.round(t.height)
1313
1301
  };
1314
1302
  }
1315
- function ve(e, t, n) {
1316
- return Math.min(Math.max(e, t), n);
1303
+ function Se(e, t, o) {
1304
+ return Math.min(Math.max(e, t), o);
1317
1305
  }
1318
- function X(e, t, n) {
1306
+ function J(e, t, o) {
1319
1307
  if (typeof window > "u")
1320
1308
  return;
1321
- const o = window, i = {
1309
+ const n = window, i = {
1322
1310
  at: (/* @__PURE__ */ new Date()).toISOString(),
1323
1311
  source: e,
1324
1312
  message: t,
1325
- details: n
1326
- }, a = o.__plunoProductAgentDiagnostics__ ?? [];
1327
- a.push(i), a.length > 120 && a.splice(0, a.length - 120), o.__plunoProductAgentDiagnostics__ = a, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...a], window.dispatchEvent(
1328
- new CustomEvent(Eo, { detail: i })
1313
+ details: o
1314
+ }, a = n.__plunoProductAgentDiagnostics__ ?? [];
1315
+ a.push(i), a.length > 120 && a.splice(0, a.length - 120), n.__plunoProductAgentDiagnostics__ = a, n.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...a], window.dispatchEvent(
1316
+ new CustomEvent(Po, { detail: i })
1329
1317
  );
1330
1318
  }
1331
- function ri(e, t) {
1332
- X("web-sdk.widget.position", e, t);
1319
+ function si(e, t) {
1320
+ J("web-sdk.widget.position", e, t);
1333
1321
  }
1334
- function rt(e, t, n) {
1335
- const o = t.value.trim();
1336
- return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
1337
- attachments: n.length > 0 ? n : void 0
1322
+ function pt(e, t, o) {
1323
+ const n = t.value.trim();
1324
+ return !n && o.length === 0 ? o : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(n, {
1325
+ attachments: o.length > 0 ? o.map(di) : void 0
1338
1326
  }), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
1339
1327
  }
1340
- function Ae(e) {
1328
+ function di(e) {
1329
+ return e;
1330
+ }
1331
+ function Ne(e) {
1341
1332
  e.style.height = "0px";
1342
1333
  const t = Math.max(22, Math.min(e.scrollHeight, 140));
1343
1334
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
1344
1335
  }
1345
- function Ie(e, t = () => !0) {
1336
+ function Te(e, t = () => !0) {
1346
1337
  e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
1347
1338
  t() && (e.scrollTop = e.scrollHeight);
1348
1339
  });
1349
1340
  }
1350
- function li(e) {
1341
+ function ci(e) {
1351
1342
  const t = e.messages[e.messages.length - 1];
1352
1343
  return [
1353
1344
  e.messages.length,
@@ -1358,64 +1349,64 @@ function li(e) {
1358
1349
  e.lastError ?? ""
1359
1350
  ].join(":");
1360
1351
  }
1361
- function pi(e) {
1352
+ function ui(e) {
1362
1353
  return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
1363
1354
  }
1364
- function si(e) {
1355
+ function gi(e) {
1365
1356
  return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
1366
1357
  }
1367
- function di(e) {
1358
+ function hi(e) {
1368
1359
  const t = e.currentPage;
1369
1360
  if (typeof t?.url == "string" && t.url.trim())
1370
1361
  try {
1371
- const n = new URL(t.url);
1372
- return `${n.pathname || "/"}${n.search}`;
1362
+ const o = new URL(t.url);
1363
+ return `${o.pathname || "/"}${o.search}`;
1373
1364
  } catch {
1374
1365
  return t.url;
1375
1366
  }
1376
1367
  return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
1377
1368
  }
1378
- function ci(e, t) {
1379
- const n = new Date(e).getTime();
1380
- if (!Number.isFinite(n))
1369
+ function mi(e, t) {
1370
+ const o = new Date(e).getTime();
1371
+ if (!Number.isFinite(o))
1381
1372
  return "now";
1382
- const o = Math.max(0, t - n), i = [
1373
+ const n = Math.max(0, t - o), i = [
1383
1374
  ["day", 864e5],
1384
1375
  ["hour", 36e5],
1385
1376
  ["min", 6e4]
1386
1377
  ];
1387
1378
  for (const [a, l] of i)
1388
- if (o >= l) {
1389
- const p = Math.max(1, Math.floor(o / l));
1379
+ if (n >= l) {
1380
+ const p = Math.max(1, Math.floor(n / l));
1390
1381
  return a === "min" ? `${p} min` : `${p} ${a}${p === 1 ? "" : "s"}`;
1391
1382
  }
1392
1383
  return "now";
1393
1384
  }
1394
- function ui(e, t, n, o, i) {
1395
- e.appendChild(yi()), e.appendChild(
1396
- gi(
1385
+ function bi(e, t, o, n, i) {
1386
+ e.appendChild(Si()), e.appendChild(
1387
+ fi(
1397
1388
  t,
1398
- n,
1399
1389
  o,
1390
+ n,
1400
1391
  i
1401
1392
  )
1402
1393
  ), e.appendChild(
1403
- qe(
1394
+ Ve(
1404
1395
  "pluno-pa-widget__close",
1405
1396
  "Close",
1406
- vi(16),
1397
+ Ei(16),
1407
1398
  !0
1408
1399
  )
1409
- ), e.appendChild(hi(n));
1400
+ ), e.appendChild(wi(o));
1410
1401
  }
1411
- function gi(e, t, n, o) {
1402
+ function fi(e, t, o, n) {
1412
1403
  const i = document.createElement("form");
1413
- if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
1404
+ if (i.className = "pluno-pa-widget__launcher", n && i.classList.add("pluno-pa-widget__launcher--minimizable"), o) {
1414
1405
  const l = document.createElement("button");
1415
1406
  l.type = "button", l.className = "pluno-pa-widget__launcher-drag-handle", l.setAttribute("aria-label", "Move Pluno launcher"), l.title = "Move Pluno launcher", i.appendChild(l);
1416
1407
  }
1417
1408
  i.appendChild(
1418
- Sn(
1409
+ Pn(
1419
1410
  "pluno-pa-widget__scribble-spirals--launcher",
1420
1411
  10
1421
1412
  )
@@ -1426,118 +1417,118 @@ function gi(e, t, n, o) {
1426
1417
  )
1427
1418
  );
1428
1419
  const a = document.createElement("input");
1429
- if (a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder = e, a.setAttribute("aria-label", e), i.appendChild(a), o) {
1420
+ if (a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder = e, a.setAttribute("aria-label", e), i.appendChild(a), n) {
1430
1421
  const l = document.createElement("button");
1431
1422
  l.type = "button", l.className = "pluno-pa-widget__launcher-minimize", l.textContent = "-", l.setAttribute("aria-label", "Minimize Pluno on this site"), l.title = "Minimize Pluno on this site", i.appendChild(l);
1432
1423
  }
1433
1424
  return i;
1434
1425
  }
1435
- function hi(e) {
1426
+ function wi(e) {
1436
1427
  const t = document.createElement("section");
1437
1428
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
1438
- Sn("pluno-pa-widget__scribble-spirals--panel", 16)
1429
+ Pn("pluno-pa-widget__scribble-spirals--panel", 16)
1439
1430
  );
1440
- const n = document.createElement("div");
1441
- n.className = "pluno-pa-widget__timeline-wrap";
1442
- const o = document.createElement("main");
1443
- o.className = "pluno-pa-widget__timeline", o.appendChild(fi(e));
1431
+ const o = document.createElement("div");
1432
+ o.className = "pluno-pa-widget__timeline-wrap";
1433
+ const n = document.createElement("main");
1434
+ n.className = "pluno-pa-widget__timeline", n.appendChild(vi(e));
1444
1435
  const i = document.createElement("div");
1445
- i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
1436
+ i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), n.appendChild(i), o.appendChild(n);
1446
1437
  const a = document.createElement("div");
1447
- a.className = "pluno-pa-widget__active-users-counter", a.hidden = !0, n.appendChild(a);
1438
+ a.className = "pluno-pa-widget__active-users-counter", a.hidden = !0, o.appendChild(a);
1448
1439
  const l = document.createElement("button");
1449
- l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
1440
+ l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, o.appendChild(l);
1450
1441
  const p = document.createElement("div");
1451
1442
  return p.className = "pluno-pa-widget__top-actions", p.appendChild(
1452
- qe(
1443
+ Ve(
1453
1444
  "pluno-pa-widget__history",
1454
1445
  "Recent chats",
1455
- Ei(),
1446
+ Li(),
1456
1447
  !0
1457
1448
  )
1458
- ), n.appendChild(p), n.appendChild(bi()), t.appendChild(n), t.appendChild(mi()), t;
1449
+ ), o.appendChild(p), o.appendChild(xi()), t.appendChild(o), t.appendChild(_i()), t;
1459
1450
  }
1460
- function mi() {
1451
+ function _i() {
1461
1452
  const e = document.createElement("form");
1462
1453
  e.className = "pluno-pa-widget__composer";
1463
1454
  const t = document.createElement("div");
1464
1455
  t.className = "pluno-pa-widget__billing-status", t.hidden = !0, e.appendChild(t);
1465
- const n = document.createElement("div");
1466
- n.className = "pluno-pa-widget__attachment-error", n.hidden = !0, e.appendChild(n);
1467
1456
  const o = document.createElement("div");
1468
- o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
1457
+ o.className = "pluno-pa-widget__attachment-error", o.hidden = !0, e.appendChild(o);
1458
+ const n = document.createElement("div");
1459
+ n.className = "pluno-pa-widget__attachments", n.hidden = !0, e.appendChild(n);
1469
1460
  const i = document.createElement("div");
1470
1461
  i.className = "pluno-pa-widget__composer-inner";
1471
1462
  const a = document.createElement("input");
1472
- a.className = "pluno-pa-widget__attachment-input", a.type = "file", a.accept = ko, a.multiple = !0, a.tabIndex = -1, a.setAttribute("aria-hidden", "true"), i.appendChild(a);
1463
+ a.className = "pluno-pa-widget__attachment-input", a.type = "file", a.multiple = !0, a.tabIndex = -1, a.setAttribute("aria-hidden", "true"), i.appendChild(a);
1473
1464
  const l = document.createElement("button");
1474
- l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(ki()), l.appendChild(Li()), i.appendChild(l);
1465
+ l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Pi()), l.appendChild(Ai()), i.appendChild(l);
1475
1466
  const p = document.createElement("textarea");
1476
1467
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
1477
1468
  const c = document.createElement("button");
1478
- c.type = "button", c.className = "pluno-pa-widget__send", c.setAttribute("aria-label", "Send"), c.appendChild(kn()), i.appendChild(c), e.appendChild(i);
1469
+ c.type = "button", c.className = "pluno-pa-widget__send", c.setAttribute("aria-label", "Send"), c.appendChild(An()), i.appendChild(c), e.appendChild(i);
1479
1470
  const u = document.createElement("div");
1480
1471
  u.className = "pluno-pa-widget__composer-meta";
1481
1472
  const d = document.createElement("a");
1482
1473
  d.className = "pluno-pa-widget__powered-by", d.href = "https://pluno.ai", d.target = "_blank", d.rel = "noopener noreferrer", d.textContent = "Powered by Pluno.ai.", u.appendChild(d);
1483
- const h = document.createElement("span");
1484
- return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(h), e.appendChild(u), e;
1474
+ const g = document.createElement("span");
1475
+ return g.className = "pluno-pa-widget__ai-disclaimer", g.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(g), e.appendChild(u), e;
1485
1476
  }
1486
- function bi() {
1477
+ function xi() {
1487
1478
  const e = document.createElement("section");
1488
1479
  e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", "Recent chats");
1489
1480
  const t = document.createElement("div");
1490
1481
  t.className = "pluno-pa-widget__history-header";
1491
- const n = document.createElement("strong");
1492
- n.textContent = "Recent chats";
1493
- const o = qe(
1482
+ const o = document.createElement("strong");
1483
+ o.textContent = "Recent chats";
1484
+ const n = Ve(
1494
1485
  "pluno-pa-widget__history-close",
1495
1486
  "Close recent chats",
1496
- Si(),
1487
+ Ii(),
1497
1488
  !1
1498
1489
  );
1499
- t.append(n, o);
1490
+ t.append(o, n);
1500
1491
  const i = document.createElement("div");
1501
1492
  i.className = "pluno-pa-widget__history-list";
1502
1493
  const a = document.createElement("p");
1503
1494
  return a.className = "pluno-pa-widget__history-status", a.hidden = !0, e.append(t, i, a), e;
1504
1495
  }
1505
- function fi(e) {
1496
+ function vi(e) {
1506
1497
  const t = document.createElement("div");
1507
1498
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
1508
1499
  se(
1509
1500
  "pluno-pa-widget__character--empty",
1510
1501
  e
1511
1502
  )
1512
- ), t.appendChild(Cn()), t;
1503
+ ), t.appendChild(kn()), t;
1513
1504
  }
1514
- function Cn() {
1505
+ function kn() {
1515
1506
  const e = document.createElement("div");
1516
1507
  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;
1517
1508
  }
1518
- function wi(e, t) {
1509
+ function Ln(e, t) {
1519
1510
  e.replaceChildren(), e.setAttribute(
1520
1511
  "aria-label",
1521
1512
  `${t.toLocaleString("en-US")} users currently active`
1522
1513
  );
1523
- const n = document.createElement("span");
1524
- n.className = "pluno-pa-widget__active-users-counter-dot", n.setAttribute("aria-hidden", "true"), e.appendChild(n), e.appendChild(
1514
+ const o = document.createElement("span");
1515
+ o.className = "pluno-pa-widget__active-users-counter-dot", o.setAttribute("aria-hidden", "true"), e.appendChild(o), e.appendChild(
1525
1516
  document.createTextNode(
1526
1517
  `${t.toLocaleString("en-US")} users currently active`
1527
1518
  )
1528
1519
  );
1529
1520
  }
1530
1521
  function se(e, t) {
1531
- const n = `pluno-pa-character-${$t}`;
1532
- $t += 1;
1533
- const o = t.scribbleStyle ? xi(t.accentColor, n) : _i(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1534
- return o.setAttribute(
1522
+ const o = `pluno-pa-character-${Kt}`;
1523
+ Kt += 1;
1524
+ const n = t.scribbleStyle ? Ci(t.accentColor, o) : yi(t.accentColor, o), i = e.split(/\s+/).filter(Boolean);
1525
+ return n.setAttribute(
1535
1526
  "class",
1536
1527
  i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
1537
- ), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
1528
+ ), n.setAttribute("aria-hidden", "true"), n.setAttribute("focusable", "false"), n.removeAttribute("role"), n.removeAttribute("aria-label"), n;
1538
1529
  }
1539
- function _i(e, t) {
1540
- const n = Xn(e), o = {
1530
+ function yi(e, t) {
1531
+ const o = to(e), n = {
1541
1532
  boltFill: `${t}-boltFill`,
1542
1533
  boltEdge: `${t}-boltEdge`,
1543
1534
  boltGlow: `${t}-boltGlow`,
@@ -1548,171 +1539,171 @@ function _i(e, t) {
1548
1539
  eyeShadow: `${t}-eyeShadow`,
1549
1540
  pupilGloss: `${t}-pupilGloss`,
1550
1541
  boltClip: `${t}-boltClip`
1551
- }, i = En(), a = m(i, "defs"), l = m(a, "linearGradient", {
1552
- id: o.boltFill,
1542
+ }, i = In(), a = m(i, "defs"), l = m(a, "linearGradient", {
1543
+ id: n.boltFill,
1553
1544
  x1: "420",
1554
1545
  y1: "180",
1555
1546
  x2: "790",
1556
1547
  y2: "1040",
1557
1548
  gradientUnits: "userSpaceOnUse"
1558
1549
  });
1559
- M(l, "0", n.top), M(l, "0.36", n.middle), M(l, "0.72", n.bottom), M(l, "1", n.bottom);
1550
+ R(l, "0", o.top), R(l, "0.36", o.middle), R(l, "0.72", o.bottom), R(l, "1", o.bottom);
1560
1551
  const p = m(a, "linearGradient", {
1561
- id: o.boltEdge,
1552
+ id: n.boltEdge,
1562
1553
  x1: "470",
1563
1554
  y1: "145",
1564
1555
  x2: "900",
1565
1556
  y2: "980",
1566
1557
  gradientUnits: "userSpaceOnUse"
1567
1558
  });
1568
- M(p, "0", n.edgeStart), M(p, "0.32", n.edgeMiddle), M(p, "0.78", n.edgeEnd), M(p, "1", n.edgeEnd);
1559
+ R(p, "0", o.edgeStart), R(p, "0.32", o.edgeMiddle), R(p, "0.78", o.edgeEnd), R(p, "1", o.edgeEnd);
1569
1560
  const c = m(a, "radialGradient", {
1570
- id: o.boltGlow,
1561
+ id: n.boltGlow,
1571
1562
  cx: "50%",
1572
1563
  cy: "22%",
1573
1564
  r: "82%"
1574
1565
  });
1575
- M(c, "0", n.glow, "0.72"), M(c, "0.5", n.middle, "0.44"), M(c, "1", n.bottom, "0");
1566
+ R(c, "0", o.glow, "0.72"), R(c, "0.5", o.middle, "0.44"), R(c, "1", o.bottom, "0");
1576
1567
  const u = m(a, "radialGradient", {
1577
- id: o.eyeWhite,
1568
+ id: n.eyeWhite,
1578
1569
  cx: "35%",
1579
1570
  cy: "25%",
1580
1571
  r: "70%"
1581
1572
  });
1582
- M(u, "0", "#ffffff"), M(u, "0.72", "#ffffff"), M(u, "1", "#e5e5e5");
1573
+ R(u, "0", "#ffffff"), R(u, "0.72", "#ffffff"), R(u, "1", "#e5e5e5");
1583
1574
  const d = m(a, "radialGradient", {
1584
- id: o.pupil,
1575
+ id: n.pupil,
1585
1576
  cx: "42%",
1586
1577
  cy: "38%",
1587
1578
  r: "65%"
1588
1579
  });
1589
- M(d, "0", "#2a1f10"), M(d, "0.52", "#080604"), M(d, "1", "#000000");
1590
- const h = m(a, "filter", {
1591
- id: o.softDropShadow,
1580
+ R(d, "0", "#2a1f10"), R(d, "0.52", "#080604"), R(d, "1", "#000000");
1581
+ const g = m(a, "filter", {
1582
+ id: n.softDropShadow,
1592
1583
  x: "-18%",
1593
1584
  y: "-12%",
1594
1585
  width: "136%",
1595
1586
  height: "136%",
1596
1587
  "color-interpolation-filters": "sRGB"
1597
1588
  });
1598
- m(h, "feDropShadow", {
1589
+ m(g, "feDropShadow", {
1599
1590
  dx: "0",
1600
1591
  dy: "12",
1601
1592
  stdDeviation: "18",
1602
- "flood-color": n.shadow,
1593
+ "flood-color": o.shadow,
1603
1594
  "flood-opacity": "0.24"
1604
1595
  });
1605
- const x = m(a, "filter", {
1606
- id: o.innerDepth,
1596
+ const S = m(a, "filter", {
1597
+ id: n.innerDepth,
1607
1598
  x: "-8%",
1608
1599
  y: "-8%",
1609
1600
  width: "116%",
1610
1601
  height: "116%",
1611
1602
  "color-interpolation-filters": "sRGB"
1612
1603
  });
1613
- m(x, "feGaussianBlur", {
1604
+ m(S, "feGaussianBlur", {
1614
1605
  in: "SourceAlpha",
1615
1606
  stdDeviation: "8",
1616
1607
  result: "blur"
1617
- }), m(x, "feOffset", {
1608
+ }), m(S, "feOffset", {
1618
1609
  dx: "-7",
1619
1610
  dy: "-9",
1620
1611
  result: "topLeft"
1621
- }), m(x, "feComposite", {
1612
+ }), m(S, "feComposite", {
1622
1613
  in: "topLeft",
1623
1614
  in2: "SourceAlpha",
1624
1615
  operator: "arithmetic",
1625
1616
  k2: "-1",
1626
1617
  k3: "1",
1627
1618
  result: "innerShadow"
1628
- }), m(x, "feColorMatrix", {
1619
+ }), m(S, "feColorMatrix", {
1629
1620
  in: "innerShadow",
1630
1621
  type: "matrix",
1631
1622
  values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
1632
1623
  result: "innerLight"
1633
- }), m(x, "feBlend", {
1624
+ }), m(S, "feBlend", {
1634
1625
  in: "SourceGraphic",
1635
1626
  in2: "innerLight",
1636
1627
  mode: "screen"
1637
1628
  });
1638
- const y = m(a, "filter", {
1639
- id: o.eyeShadow,
1629
+ const f = m(a, "filter", {
1630
+ id: n.eyeShadow,
1640
1631
  x: "-24%",
1641
1632
  y: "-20%",
1642
1633
  width: "148%",
1643
1634
  height: "148%",
1644
1635
  "color-interpolation-filters": "sRGB"
1645
1636
  });
1646
- m(y, "feDropShadow", {
1637
+ m(f, "feDropShadow", {
1647
1638
  dx: "0",
1648
1639
  dy: "8",
1649
1640
  stdDeviation: "5",
1650
- "flood-color": n.shadow,
1641
+ "flood-color": o.shadow,
1651
1642
  "flood-opacity": "0.3"
1652
1643
  });
1653
- const A = m(a, "filter", {
1654
- id: o.pupilGloss,
1644
+ const O = m(a, "filter", {
1645
+ id: n.pupilGloss,
1655
1646
  x: "-15%",
1656
1647
  y: "-15%",
1657
1648
  width: "130%",
1658
1649
  height: "130%",
1659
1650
  "color-interpolation-filters": "sRGB"
1660
1651
  });
1661
- m(A, "feDropShadow", {
1652
+ m(O, "feDropShadow", {
1662
1653
  dx: "0",
1663
1654
  dy: "3",
1664
1655
  stdDeviation: "3",
1665
1656
  "flood-color": "#000000",
1666
1657
  "flood-opacity": "0.22"
1667
1658
  });
1668
- const T = m(a, "clipPath", { id: o.boltClip });
1669
- m(T, "path", { d: He });
1670
- const f = m(i, "g", {
1671
- filter: q(o.softDropShadow)
1659
+ const k = m(a, "clipPath", { id: n.boltClip });
1660
+ m(k, "path", { d: $e });
1661
+ const x = m(i, "g", {
1662
+ filter: j(n.softDropShadow)
1672
1663
  });
1673
- m(f, "path", {
1674
- d: He,
1675
- fill: q(o.boltEdge)
1664
+ m(x, "path", {
1665
+ d: $e,
1666
+ fill: j(n.boltEdge)
1676
1667
  });
1677
- const E = "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";
1678
- m(f, "path", {
1679
- d: E,
1680
- fill: q(o.boltFill),
1681
- filter: q(o.innerDepth)
1682
- }), m(f, "path", {
1683
- d: E,
1684
- fill: q(o.boltGlow),
1668
+ const v = "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";
1669
+ m(x, "path", {
1670
+ d: v,
1671
+ fill: j(n.boltFill),
1672
+ filter: j(n.innerDepth)
1673
+ }), m(x, "path", {
1674
+ d: v,
1675
+ fill: j(n.boltGlow),
1685
1676
  opacity: "0.74"
1686
1677
  });
1687
- const g = m(f, "g", {
1688
- "clip-path": q(o.boltClip),
1678
+ const h = m(x, "g", {
1679
+ "clip-path": j(n.boltClip),
1689
1680
  opacity: "0.42"
1690
1681
  });
1691
- m(g, "path", {
1682
+ m(h, "path", {
1692
1683
  d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
1693
1684
  fill: "none",
1694
- stroke: n.highlight,
1685
+ stroke: o.highlight,
1695
1686
  "stroke-width": "22",
1696
1687
  "stroke-linecap": "round",
1697
1688
  opacity: "0.65"
1698
- }), m(g, "path", {
1689
+ }), m(h, "path", {
1699
1690
  d: "M556 685 L501 994",
1700
1691
  fill: "none",
1701
- stroke: n.highlight,
1692
+ stroke: o.highlight,
1702
1693
  "stroke-width": "20",
1703
1694
  "stroke-linecap": "round",
1704
1695
  opacity: "0.55"
1705
- }), m(g, "path", {
1696
+ }), m(h, "path", {
1706
1697
  d: "M858 160 C882 166 893 181 883 204",
1707
1698
  fill: "none",
1708
- stroke: n.inner,
1699
+ stroke: o.inner,
1709
1700
  "stroke-width": "18",
1710
1701
  "stroke-linecap": "round",
1711
1702
  opacity: "0.48"
1712
1703
  });
1713
- const S = m(i, "g", { filter: q(o.eyeShadow) });
1714
- return Kt(
1715
- S,
1704
+ const A = m(i, "g", { filter: j(n.eyeShadow) });
1705
+ return Qt(
1706
+ A,
1716
1707
  "rotate(-2 528 463)",
1717
1708
  "528",
1718
1709
  "463",
@@ -1720,9 +1711,9 @@ function _i(e, t) {
1720
1711
  "473",
1721
1712
  "557",
1722
1713
  "447",
1723
- o
1724
- ), Kt(
1725
- S,
1714
+ n
1715
+ ), Qt(
1716
+ A,
1726
1717
  "rotate(2 717 462)",
1727
1718
  "717",
1728
1719
  "462",
@@ -1730,17 +1721,17 @@ function _i(e, t) {
1730
1721
  "473",
1731
1722
  "728",
1732
1723
  "447",
1733
- o
1724
+ n
1734
1725
  ), i;
1735
1726
  }
1736
- function xi(e, t) {
1737
- const n = dn(e), o = {
1727
+ function Ci(e, t) {
1728
+ const o = hn(e), n = {
1738
1729
  clip: `${t}-scribbleBoltClip`,
1739
1730
  wobble: `${t}-scribbleBoltWobble`
1740
- }, i = En(), a = m(i, "defs"), l = m(a, "clipPath", { id: o.clip });
1741
- m(l, "path", { d: He });
1731
+ }, i = In(), a = m(i, "defs"), l = m(a, "clipPath", { id: n.clip });
1732
+ m(l, "path", { d: $e });
1742
1733
  const p = m(a, "filter", {
1743
- id: o.wobble,
1734
+ id: n.wobble,
1744
1735
  x: "-10%",
1745
1736
  y: "-10%",
1746
1737
  width: "120%",
@@ -1760,25 +1751,25 @@ function xi(e, t) {
1760
1751
  xChannelSelector: "R",
1761
1752
  yChannelSelector: "G"
1762
1753
  });
1763
- const c = m(i, "g", { filter: q(o.wobble) }), u = m(c, "g", {
1764
- "clip-path": q(o.clip)
1754
+ const c = m(i, "g", { filter: j(n.wobble) }), u = m(c, "g", {
1755
+ "clip-path": j(n.clip)
1765
1756
  });
1766
1757
  return m(u, "path", {
1767
- d: Kn(),
1758
+ d: eo(),
1768
1759
  fill: "none",
1769
- stroke: n,
1760
+ stroke: o,
1770
1761
  "stroke-width": "56",
1771
1762
  "stroke-linecap": "round",
1772
1763
  "stroke-linejoin": "round",
1773
1764
  opacity: "0.9",
1774
1765
  transform: "rotate(-14 627 600)"
1775
1766
  }), m(c, "path", {
1776
- d: He,
1767
+ d: $e,
1777
1768
  fill: "none",
1778
- stroke: Ge,
1769
+ stroke: qe,
1779
1770
  "stroke-width": "18",
1780
1771
  "stroke-linejoin": "round"
1781
- }), Xt(
1772
+ }), en(
1782
1773
  c,
1783
1774
  "rotate(-2 528 463)",
1784
1775
  "528",
@@ -1787,7 +1778,7 @@ function xi(e, t) {
1787
1778
  "473",
1788
1779
  "557",
1789
1780
  "447"
1790
- ), Xt(
1781
+ ), en(
1791
1782
  c,
1792
1783
  "rotate(2 717 462)",
1793
1784
  "717",
@@ -1798,27 +1789,27 @@ function xi(e, t) {
1798
1789
  "447"
1799
1790
  ), i;
1800
1791
  }
1801
- function En() {
1802
- return v("svg", {
1803
- xmlns: wn,
1792
+ function In() {
1793
+ return y("svg", {
1794
+ xmlns: vn,
1804
1795
  viewBox: "0 0 1254 1254"
1805
1796
  });
1806
1797
  }
1807
- function Kt(e, t, n, o, i, a, l, p, c) {
1798
+ function Qt(e, t, o, n, i, a, l, p, c) {
1808
1799
  const u = m(e, "g", { transform: t });
1809
1800
  m(u, "ellipse", {
1810
- cx: n,
1811
- cy: o,
1801
+ cx: o,
1802
+ cy: n,
1812
1803
  rx: "73",
1813
1804
  ry: "80",
1814
- fill: q(c.eyeWhite)
1805
+ fill: j(c.eyeWhite)
1815
1806
  }), m(u, "ellipse", {
1816
1807
  cx: i,
1817
1808
  cy: a,
1818
1809
  rx: "49",
1819
1810
  ry: "57",
1820
- fill: q(c.pupil),
1821
- filter: q(c.pupilGloss)
1811
+ fill: j(c.pupil),
1812
+ filter: j(c.pupilGloss)
1822
1813
  }), m(u, "circle", {
1823
1814
  cx: l,
1824
1815
  cy: p,
@@ -1826,22 +1817,22 @@ function Kt(e, t, n, o, i, a, l, p, c) {
1826
1817
  fill: "#ffffff"
1827
1818
  });
1828
1819
  }
1829
- function Xt(e, t, n, o, i, a, l, p) {
1820
+ function en(e, t, o, n, i, a, l, p) {
1830
1821
  const c = m(e, "g", { transform: t });
1831
1822
  m(c, "ellipse", {
1832
- cx: n,
1833
- cy: o,
1823
+ cx: o,
1824
+ cy: n,
1834
1825
  rx: "73",
1835
1826
  ry: "80",
1836
1827
  fill: "#ffffff",
1837
- stroke: Ge,
1828
+ stroke: qe,
1838
1829
  "stroke-width": "13"
1839
1830
  }), m(c, "ellipse", {
1840
1831
  cx: i,
1841
1832
  cy: a,
1842
1833
  rx: "45",
1843
1834
  ry: "53",
1844
- fill: Ge
1835
+ fill: qe
1845
1836
  }), m(c, "circle", {
1846
1837
  cx: l,
1847
1838
  cy: p,
@@ -1849,49 +1840,49 @@ function Xt(e, t, n, o, i, a, l, p) {
1849
1840
  fill: "#ffffff"
1850
1841
  });
1851
1842
  }
1852
- function m(e, t, n = {}) {
1853
- const o = v(t, n);
1854
- return e.appendChild(o), o;
1843
+ function m(e, t, o = {}) {
1844
+ const n = y(t, o);
1845
+ return e.appendChild(n), n;
1855
1846
  }
1856
- function M(e, t, n, o) {
1857
- const i = { offset: t, "stop-color": n };
1858
- o !== void 0 && (i["stop-opacity"] = o), m(e, "stop", i);
1847
+ function R(e, t, o, n) {
1848
+ const i = { offset: t, "stop-color": o };
1849
+ n !== void 0 && (i["stop-opacity"] = n), m(e, "stop", i);
1859
1850
  }
1860
- function q(e) {
1851
+ function j(e) {
1861
1852
  return `url(#${e})`;
1862
1853
  }
1863
- function qe(e, t, n, o) {
1854
+ function Ve(e, t, o, n) {
1864
1855
  const i = document.createElement("button");
1865
- return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
1856
+ return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = n, i.appendChild(o), i;
1866
1857
  }
1867
- function yi() {
1868
- const e = v("svg", {
1858
+ function Si() {
1859
+ const e = y("svg", {
1869
1860
  class: "pluno-pa-widget__scribble-defs",
1870
1861
  "aria-hidden": "true",
1871
1862
  focusable: "false",
1872
1863
  width: "0",
1873
1864
  height: "0"
1874
- }), t = v("defs");
1875
- return t.appendChild(lt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
1876
- lt("pluno-pa-scribble-wobble-2", "5", "15")
1865
+ }), t = y("defs");
1866
+ return t.appendChild(st("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
1867
+ st("pluno-pa-scribble-wobble-2", "5", "15")
1877
1868
  ), t.appendChild(
1878
- lt("pluno-pa-scribble-wobble-3", "9", "19")
1869
+ st("pluno-pa-scribble-wobble-3", "9", "19")
1879
1870
  ), e.appendChild(t), e;
1880
1871
  }
1881
- function Sn(e, t) {
1882
- const n = t * Ft + Ht * 2, o = v("svg", {
1872
+ function Pn(e, t) {
1873
+ const o = t * $t + qt * 2, n = y("svg", {
1883
1874
  class: `pluno-pa-widget__scribble-spirals ${e}`,
1884
- viewBox: `0 0 ${n} ${Fo}`,
1875
+ viewBox: `0 0 ${o} ${Go}`,
1885
1876
  preserveAspectRatio: "xMidYMid meet",
1886
1877
  "aria-hidden": "true",
1887
1878
  focusable: "false"
1888
1879
  });
1889
1880
  for (let i = 0; i < t; i += 1) {
1890
- const a = Gt[i % Gt.length], l = v("g", {
1891
- transform: `translate(${Ht + i * Ft} 0)`
1881
+ const a = jt[i % jt.length], l = y("g", {
1882
+ transform: `translate(${qt + i * $t} 0)`
1892
1883
  });
1893
1884
  l.appendChild(
1894
- v("ellipse", {
1885
+ y("ellipse", {
1895
1886
  cx: a.ellipseCx,
1896
1887
  cy: a.ellipseCy,
1897
1888
  rx: a.ellipseRx,
@@ -1902,35 +1893,35 @@ function Sn(e, t) {
1902
1893
  opacity: "0.8"
1903
1894
  })
1904
1895
  ), l.appendChild(
1905
- v("path", {
1896
+ y("path", {
1906
1897
  d: a.path,
1907
1898
  fill: "none",
1908
1899
  stroke: "#2c2a1e",
1909
1900
  "stroke-width": a.pathStrokeWidth,
1910
1901
  "stroke-linecap": "round"
1911
1902
  })
1912
- ), o.appendChild(l);
1903
+ ), n.appendChild(l);
1913
1904
  }
1914
- return o;
1905
+ return n;
1915
1906
  }
1916
- function lt(e, t, n) {
1917
- const o = v("filter", {
1907
+ function st(e, t, o) {
1908
+ const n = y("filter", {
1918
1909
  id: e,
1919
1910
  x: "-8%",
1920
1911
  y: "-8%",
1921
1912
  width: "116%",
1922
1913
  height: "116%"
1923
1914
  });
1924
- return o.appendChild(
1925
- v("feTurbulence", {
1915
+ return n.appendChild(
1916
+ y("feTurbulence", {
1926
1917
  type: "fractalNoise",
1927
1918
  baseFrequency: "0.012 0.028",
1928
1919
  numOctaves: "3",
1929
1920
  seed: t,
1930
1921
  result: "stroke-noise"
1931
1922
  })
1932
- ), o.appendChild(
1933
- v("feDisplacementMap", {
1923
+ ), n.appendChild(
1924
+ y("feDisplacementMap", {
1934
1925
  in: "SourceGraphic",
1935
1926
  in2: "stroke-noise",
1936
1927
  scale: "3.5",
@@ -1938,26 +1929,26 @@ function lt(e, t, n) {
1938
1929
  yChannelSelector: "G",
1939
1930
  result: "warped"
1940
1931
  })
1941
- ), o.appendChild(
1942
- v("feTurbulence", {
1932
+ ), n.appendChild(
1933
+ y("feTurbulence", {
1943
1934
  type: "fractalNoise",
1944
1935
  baseFrequency: "0.7",
1945
1936
  numOctaves: "1",
1946
- seed: n,
1937
+ seed: o,
1947
1938
  result: "ink-noise"
1948
1939
  })
1949
- ), o.appendChild(
1950
- v("feDisplacementMap", {
1940
+ ), n.appendChild(
1941
+ y("feDisplacementMap", {
1951
1942
  in: "warped",
1952
1943
  in2: "ink-noise",
1953
1944
  scale: "0.9",
1954
1945
  xChannelSelector: "R",
1955
1946
  yChannelSelector: "G"
1956
1947
  })
1957
- ), o;
1948
+ ), n;
1958
1949
  }
1959
- function vi(e) {
1960
- const t = ee(
1950
+ function Ei(e) {
1951
+ const t = oe(
1961
1952
  "0 0 24 24",
1962
1953
  e,
1963
1954
  e,
@@ -1965,10 +1956,10 @@ function vi(e) {
1965
1956
  "currentColor",
1966
1957
  "2.25"
1967
1958
  );
1968
- return t.appendChild(v("path", { d: "m6 9 6 6 6-6" })), t;
1959
+ return t.appendChild(y("path", { d: "m6 9 6 6 6-6" })), t;
1969
1960
  }
1970
- function Ci() {
1971
- const e = ee(
1961
+ function ki() {
1962
+ const e = oe(
1972
1963
  "0 0 24 24",
1973
1964
  17,
1974
1965
  17,
@@ -1977,17 +1968,17 @@ function Ci() {
1977
1968
  "2.25"
1978
1969
  );
1979
1970
  return e.appendChild(
1980
- v("path", {
1971
+ y("path", {
1981
1972
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
1982
1973
  })
1983
1974
  ), e.appendChild(
1984
- v("path", {
1975
+ y("path", {
1985
1976
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
1986
1977
  })
1987
1978
  ), e;
1988
1979
  }
1989
- function Ei() {
1990
- const e = ee(
1980
+ function Li() {
1981
+ const e = oe(
1991
1982
  "0 0 24 24",
1992
1983
  17,
1993
1984
  17,
@@ -1995,10 +1986,10 @@ function Ei() {
1995
1986
  "currentColor",
1996
1987
  "2.25"
1997
1988
  );
1998
- return e.appendChild(v("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(v("path", { d: "M3 4v5h5" })), e.appendChild(v("path", { d: "M12 7v5l3 2" })), e;
1989
+ return e.appendChild(y("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(y("path", { d: "M3 4v5h5" })), e.appendChild(y("path", { d: "M12 7v5l3 2" })), e;
1999
1990
  }
2000
- function Si() {
2001
- const e = ee(
1991
+ function Ii() {
1992
+ const e = oe(
2002
1993
  "0 0 24 24",
2003
1994
  15,
2004
1995
  15,
@@ -2006,10 +1997,10 @@ function Si() {
2006
1997
  "currentColor",
2007
1998
  "2.4"
2008
1999
  );
2009
- return e.appendChild(v("path", { d: "M18 6 6 18" })), e.appendChild(v("path", { d: "m6 6 12 12" })), e;
2000
+ return e.appendChild(y("path", { d: "M18 6 6 18" })), e.appendChild(y("path", { d: "m6 6 12 12" })), e;
2010
2001
  }
2011
- function kn() {
2012
- const e = ee(
2002
+ function An() {
2003
+ const e = oe(
2013
2004
  "0 0 24 24",
2014
2005
  14,
2015
2006
  14,
@@ -2018,11 +2009,11 @@ function kn() {
2018
2009
  "2.75"
2019
2010
  );
2020
2011
  return e.appendChild(
2021
- v("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2022
- ), e.appendChild(v("polyline", { points: "5 12 12 5 19 12" })), e;
2012
+ y("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2013
+ ), e.appendChild(y("polyline", { points: "5 12 12 5 19 12" })), e;
2023
2014
  }
2024
- function ki() {
2025
- const e = ee(
2015
+ function Pi() {
2016
+ const e = oe(
2026
2017
  "0 0 24 24",
2027
2018
  16,
2028
2019
  16,
@@ -2034,18 +2025,18 @@ function ki() {
2034
2025
  "class",
2035
2026
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2036
2027
  ), e.appendChild(
2037
- v("path", {
2028
+ y("path", {
2038
2029
  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"
2039
2030
  })
2040
2031
  ), e;
2041
2032
  }
2042
- function Li() {
2043
- const e = ee("0 0 24 24", 19, 19, "none", "currentColor");
2033
+ function Ai() {
2034
+ const e = oe("0 0 24 24", 19, 19, "none", "currentColor");
2044
2035
  return e.setAttribute(
2045
2036
  "class",
2046
2037
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2047
2038
  ), e.appendChild(
2048
- v("path", {
2039
+ y("path", {
2049
2040
  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",
2050
2041
  stroke: "currentColor",
2051
2042
  "stroke-width": "2",
@@ -2054,10 +2045,10 @@ function Li() {
2054
2045
  })
2055
2046
  ), e;
2056
2047
  }
2057
- function Pi() {
2058
- const e = ee("0 0 24 24", 18, 18, "currentColor");
2048
+ function Ni() {
2049
+ const e = oe("0 0 24 24", 18, 18, "currentColor");
2059
2050
  return e.appendChild(
2060
- v("rect", {
2051
+ y("rect", {
2061
2052
  x: "6",
2062
2053
  y: "6",
2063
2054
  width: "12",
@@ -2066,8 +2057,8 @@ function Pi() {
2066
2057
  })
2067
2058
  ), e;
2068
2059
  }
2069
- function Ai() {
2070
- const e = ee(
2060
+ function Ti() {
2061
+ const e = oe(
2071
2062
  "0 0 24 24",
2072
2063
  12,
2073
2064
  12,
@@ -2075,10 +2066,10 @@ function Ai() {
2075
2066
  "currentColor",
2076
2067
  "2.4"
2077
2068
  );
2078
- return e.appendChild(v("path", { d: "M18 6 6 18" })), e.appendChild(v("path", { d: "m6 6 12 12" })), e;
2069
+ return e.appendChild(y("path", { d: "M18 6 6 18" })), e.appendChild(y("path", { d: "m6 6 12 12" })), e;
2079
2070
  }
2080
- function Ii() {
2081
- const e = ee(
2071
+ function Di() {
2072
+ const e = oe(
2082
2073
  "0 0 24 24",
2083
2074
  13,
2084
2075
  13,
@@ -2087,7 +2078,7 @@ function Ii() {
2087
2078
  "2.25"
2088
2079
  );
2089
2080
  return e.appendChild(
2090
- v("rect", {
2081
+ y("rect", {
2091
2082
  width: "14",
2092
2083
  height: "14",
2093
2084
  x: "8",
@@ -2096,379 +2087,341 @@ function Ii() {
2096
2087
  ry: "2"
2097
2088
  })
2098
2089
  ), e.appendChild(
2099
- v("path", {
2090
+ y("path", {
2100
2091
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2101
2092
  })
2102
2093
  ), e;
2103
2094
  }
2104
- function ee(e, t, n, o, i, a) {
2095
+ function oe(e, t, o, n, i, a) {
2105
2096
  const l = {
2106
2097
  viewBox: e,
2107
2098
  width: String(t),
2108
- height: String(n),
2109
- fill: o,
2099
+ height: String(o),
2100
+ fill: n,
2110
2101
  "aria-hidden": "true"
2111
2102
  };
2112
- return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), v("svg", l);
2103
+ return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), y("svg", l);
2113
2104
  }
2114
- function v(e, t = {}) {
2115
- const n = document.createElementNS(wn, e);
2116
- for (const [o, i] of Object.entries(t))
2117
- n.setAttribute(o, i);
2118
- return n;
2105
+ function y(e, t = {}) {
2106
+ const o = document.createElementNS(vn, e);
2107
+ for (const [n, i] of Object.entries(t))
2108
+ o.setAttribute(n, i);
2109
+ return o;
2119
2110
  }
2120
- function Zt(e) {
2111
+ function tn(e) {
2121
2112
  for (const t of ["keydown", "keypress", "keyup"])
2122
- e.addEventListener(t, (n) => {
2123
- n.stopPropagation();
2113
+ e.addEventListener(t, (o) => {
2114
+ o.stopPropagation();
2124
2115
  });
2125
2116
  }
2126
- function Ti(e, t, n) {
2117
+ function Ri(e, t, o) {
2127
2118
  e.replaceChildren(), e.hidden = t.length === 0;
2128
- for (const [o, i] of t.entries()) {
2119
+ for (const [n, i] of t.entries()) {
2129
2120
  const a = document.createElement("div");
2130
- a.className = "pluno-pa-widget__attachment", a.appendChild(Ni(i));
2121
+ a.className = "pluno-pa-widget__attachment", a.appendChild(Mi(i));
2131
2122
  const l = document.createElement("span");
2132
2123
  l.textContent = i.name, a.appendChild(l);
2133
2124
  const p = document.createElement("button");
2134
- p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ai()), p.addEventListener("click", () => n(o)), a.appendChild(p), e.appendChild(a);
2125
+ p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ti()), p.addEventListener("click", () => o(n)), a.appendChild(p), e.appendChild(a);
2135
2126
  }
2136
2127
  }
2137
- function Ni(e) {
2138
- if (Ln(e)) {
2128
+ function Mi(e) {
2129
+ const t = vt(e), o = Nn(e);
2130
+ if (t === "image" && o) {
2139
2131
  const n = document.createElement("img");
2140
- return n.src = e.dataUrl, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
2132
+ return n.src = o, n.alt = "", n.setAttribute("aria-hidden", "true"), n.addEventListener("error", () => n.replaceWith(ee(e))), n;
2141
2133
  }
2142
- const t = document.createElement("span");
2143
- return t.className = "pluno-pa-widget__attachment-file", t.textContent = "PDF", t;
2134
+ if (t === "video" && o) {
2135
+ const n = document.createElement("video");
2136
+ return n.src = o, n.muted = !0, n.preload = "metadata", n.setAttribute("aria-hidden", "true"), n.addEventListener("error", () => n.replaceWith(ee(e))), n.addEventListener("stalled", () => n.replaceWith(ee(e))), n;
2137
+ }
2138
+ return ee(e);
2144
2139
  }
2145
- function Di(e) {
2146
- if (Ln(e)) {
2147
- const i = document.createElement("img");
2148
- return i.src = e.dataUrl, i.alt = e.name, i;
2140
+ function zi(e) {
2141
+ const t = vt(e), o = Nn(e);
2142
+ if (t === "image" && o) {
2143
+ const n = document.createElement("img");
2144
+ return n.className = "pluno-pa-widget__message-attachment-preview", n.src = o, n.alt = e.name, n.addEventListener("error", () => n.replaceWith(ee(e, "message"))), n;
2149
2145
  }
2150
- const t = document.createElement("div");
2151
- t.className = "pluno-pa-widget__message-attachment-file";
2152
- const n = document.createElement("span");
2153
- n.textContent = "PDF";
2154
- const o = document.createElement("strong");
2155
- return o.textContent = e.name, t.append(n, o), t;
2146
+ if (t === "pdf" && o) {
2147
+ const n = document.createElement("object");
2148
+ return n.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", n.data = o, n.type = "application/pdf", n.setAttribute("aria-label", e.name), n.addEventListener("error", () => n.replaceWith(ee(e, "message"))), n.appendChild(ee(e, "message")), n;
2149
+ }
2150
+ if (t === "video" && o) {
2151
+ const n = document.createElement("video");
2152
+ return n.className = "pluno-pa-widget__message-attachment-preview", n.src = o, n.muted = !0, n.preload = "metadata", n.addEventListener("error", () => n.replaceWith(ee(e, "message"))), n.addEventListener("stalled", () => n.replaceWith(ee(e, "message"))), n;
2153
+ }
2154
+ return ee(e, "message");
2156
2155
  }
2157
- function Ln(e) {
2158
- return e.mimeType.startsWith("image/");
2156
+ function ee(e, t = "composer") {
2157
+ if (t === "composer") {
2158
+ const a = document.createElement("span");
2159
+ return a.className = "pluno-pa-widget__attachment-file", a.textContent = nn(e), a;
2160
+ }
2161
+ const o = document.createElement("div");
2162
+ o.className = "pluno-pa-widget__message-attachment-file";
2163
+ const n = document.createElement("span");
2164
+ n.textContent = nn(e);
2165
+ const i = document.createElement("strong");
2166
+ return i.textContent = e.name, o.append(n, i), o;
2159
2167
  }
2160
- function Ri(e) {
2161
- return e === "application/pdf" ? "document.pdf" : "image";
2168
+ function vt(e) {
2169
+ return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
2162
2170
  }
2163
- async function Mi(e) {
2164
- if (!e)
2165
- return [];
2166
- const t = Array.from(e);
2167
- if (t.length > We)
2168
- throw new Error(
2169
- `Attach up to ${We} files per message.`
2170
- );
2171
- return Promise.all(
2172
- t.map(async (n) => {
2173
- const o = zi(n);
2174
- if (!o)
2175
- throw new Error(
2176
- "Pluno supports PNG, JPEG, WebP, non-animated GIF, and PDF files."
2177
- );
2178
- if (n.size > So)
2179
- throw new Error("Each Pluno attachment can be up to 10 MB.");
2180
- if (o === "image/gif") {
2181
- const i = new Uint8Array(await qi(n));
2182
- if (Oi(i))
2183
- throw new Error("Pluno supports non-animated GIF images.");
2184
- }
2185
- return {
2186
- name: n.name || Ri(o),
2187
- mimeType: o,
2188
- sizeBytes: n.size,
2189
- dataUrl: Bi(
2190
- await ji(n),
2191
- o
2192
- )
2193
- };
2194
- })
2195
- );
2171
+ function Nn(e) {
2172
+ return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2196
2173
  }
2197
- function zi(e) {
2198
- if (mn.has(e.type))
2199
- return e.type;
2200
- const t = e.name.toLowerCase();
2201
- return t.endsWith(".png") ? "image/png" : t.endsWith(".jpg") || t.endsWith(".jpeg") ? "image/jpeg" : t.endsWith(".webp") ? "image/webp" : t.endsWith(".gif") ? "image/gif" : t.endsWith(".pdf") ? "application/pdf" : null;
2174
+ function nn(e) {
2175
+ const t = vt(e);
2176
+ return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2202
2177
  }
2203
2178
  function Bi(e, t) {
2204
- const n = `data:${t};base64,`;
2205
- return e.startsWith(n) ? e : e.replace(/^data:[^;]*;base64,/, n);
2206
- }
2207
- function Oi(e) {
2208
- if (e.length < 14 || !Ui(e))
2209
- return !1;
2210
- const t = e[10];
2211
- let n = 13;
2212
- t & 128 && (n += 3 * 2 ** ((t & 7) + 1));
2213
- let o = 0;
2214
- for (; n < e.length; ) {
2215
- const i = e[n];
2216
- if (n += 1, i === 59)
2217
- return !1;
2218
- if (i === 33) {
2219
- n += 1, n = Jt(e, n);
2220
- continue;
2221
- }
2222
- if (i !== 44)
2223
- return !1;
2224
- if (o += 1, o > 1)
2225
- return !0;
2226
- if (n + 9 >= e.length)
2227
- return !1;
2228
- const a = e[n + 8];
2229
- if (n += 9, a & 128 && (n += 3 * 2 ** ((a & 7) + 1)), n >= e.length)
2230
- return !1;
2231
- n += 1, n = Jt(e, n);
2232
- }
2233
- return !1;
2179
+ return t ? Array.from(t).map((n) => ({
2180
+ ...e.createLocalAttachment(n),
2181
+ previewUrl: Ui(n)
2182
+ })) : [];
2234
2183
  }
2235
2184
  function Ui(e) {
2236
- return e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97;
2237
- }
2238
- function Jt(e, t) {
2239
- for (; t < e.length; ) {
2240
- const n = e[t];
2241
- if (t += 1, n === 0)
2242
- return t;
2243
- t += n;
2244
- }
2245
- return t;
2185
+ return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2246
2186
  }
2247
- function Oe(e) {
2187
+ function He(e) {
2248
2188
  return !!(e && Array.from(e.types).includes("Files"));
2249
2189
  }
2250
- function pt(e, t, n = null) {
2251
- if (!e || !ht(t, n)) {
2190
+ function dt(e, t, o = null) {
2191
+ if (!e || !ft(t, o)) {
2252
2192
  e && (e.hidden = !0, e.replaceChildren());
2253
2193
  return;
2254
2194
  }
2255
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", J(t) || wt(n) ? e.appendChild(
2256
- Fi(t, n)
2257
- ) : Pn(t) && e.appendChild(Hi(t));
2195
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", te(t) || yt(o) ? e.appendChild(
2196
+ Oi(t, o)
2197
+ ) : Tn(t) && e.appendChild(Fi(t));
2258
2198
  }
2259
- function Fi(e, t) {
2260
- const n = document.createElement("div");
2261
- n.className = "pluno-pa-widget__billing-action-card";
2262
- const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
2263
- i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
2199
+ function Oi(e, t) {
2200
+ const o = document.createElement("div");
2201
+ o.className = "pluno-pa-widget__billing-action-card";
2202
+ const n = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
2203
+ i.textContent = n ? "Credits used up" : "Billing needs attention", o.appendChild(i);
2264
2204
  const a = document.createElement("span");
2265
- 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(
2266
- An(
2205
+ return a.textContent = n ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", o.appendChild(a), o.appendChild(
2206
+ Dn(
2267
2207
  e,
2268
2208
  "Upgrade plan",
2269
2209
  "pluno-pa-widget__billing-action-card-actions"
2270
2210
  )
2271
- ), n;
2211
+ ), o;
2272
2212
  }
2273
- function Hi(e) {
2213
+ function Fi(e) {
2274
2214
  const t = document.createElement("div");
2275
2215
  t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
2276
- const n = document.createElement("strong");
2277
- n.textContent = "Credits running low", t.appendChild(n);
2278
- const o = document.createElement("span");
2279
- return o.textContent = Wi(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2280
- An(
2216
+ const o = document.createElement("strong");
2217
+ o.textContent = "Credits running low", t.appendChild(o);
2218
+ const n = document.createElement("span");
2219
+ return n.textContent = Wi(e) ?? "Credits are running low for this period.", t.appendChild(n), t.appendChild(
2220
+ Dn(
2281
2221
  e,
2282
2222
  "Upgrade",
2283
2223
  "pluno-pa-widget__billing-action-card-actions"
2284
2224
  )
2285
2225
  ), t;
2286
2226
  }
2287
- function ht(e, t) {
2288
- return e !== null && (J(e) || Pn(e) || wt(t));
2227
+ function ft(e, t) {
2228
+ return e !== null && (te(e) || Tn(e) || yt(t));
2289
2229
  }
2290
- function Qt(e, t, n) {
2291
- return ht(t, n) || Gi(t) ? !0 : !ht(e, n);
2230
+ function on(e, t, o) {
2231
+ return ft(t, o) || Hi(t) ? !0 : !ft(e, o);
2292
2232
  }
2293
- function Gi(e) {
2294
- return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || J(e));
2233
+ function Hi(e) {
2234
+ return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || te(e));
2295
2235
  }
2296
- function J(e) {
2236
+ function te(e) {
2297
2237
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
2298
2238
  }
2299
- function wt(e) {
2239
+ function yt(e) {
2300
2240
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2301
2241
  }
2302
- function Pn(e) {
2303
- return !J(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2242
+ function Tn(e) {
2243
+ return !te(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2304
2244
  }
2305
2245
  function Wi(e) {
2306
- return e.creditsRemaining === null ? null : `${$i(e.creditsRemaining)} credits left`;
2246
+ return e.creditsRemaining === null ? null : `${Gi(e.creditsRemaining)} credits left`;
2307
2247
  }
2308
- function $i(e) {
2248
+ function Gi(e) {
2309
2249
  return new Intl.NumberFormat("en-US", {
2310
2250
  maximumFractionDigits: 0
2311
2251
  }).format(Math.ceil(e));
2312
2252
  }
2313
- function An(e, t, n) {
2314
- const o = document.createElement("div");
2315
- return o.className = n, o.appendChild(
2316
- en(t, e.pricingUrl)
2317
- ), o.appendChild(
2318
- en("Earn credits", e.earnCreditsUrl)
2319
- ), o;
2253
+ function Dn(e, t, o) {
2254
+ const n = document.createElement("div");
2255
+ return n.className = o, n.appendChild(
2256
+ an(t, e.pricingUrl)
2257
+ ), n.appendChild(
2258
+ an("Earn credits", e.earnCreditsUrl)
2259
+ ), n;
2320
2260
  }
2321
- function en(e, t) {
2322
- const n = document.createElement("button");
2323
- if (n.type = "button", e === "Earn credits") {
2324
- const o = document.createElement("span");
2325
- o.className = "pluno-pa-widget__billing-action-card-earn-credits-label", o.textContent = e, n.appendChild(o);
2261
+ function an(e, t) {
2262
+ const o = document.createElement("button");
2263
+ if (o.type = "button", e === "Earn credits") {
2264
+ const n = document.createElement("span");
2265
+ n.className = "pluno-pa-widget__billing-action-card-earn-credits-label", n.textContent = e, o.appendChild(n);
2326
2266
  } else
2327
- n.textContent = e;
2328
- return n.disabled = t.trim().length === 0, n.addEventListener("click", () => {
2267
+ o.textContent = e;
2268
+ return o.disabled = t.trim().length === 0, o.addEventListener("click", () => {
2329
2269
  t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
2330
- }), n;
2331
- }
2332
- function qi(e) {
2333
- return new Promise((t, n) => {
2334
- const o = new FileReader();
2335
- o.addEventListener("load", () => {
2336
- if (o.result instanceof ArrayBuffer) {
2337
- t(o.result);
2338
- return;
2339
- }
2340
- n(new Error("Failed to read file"));
2341
- }), o.addEventListener("error", () => {
2342
- n(o.error ?? new Error("Failed to read file"));
2343
- }), o.readAsArrayBuffer(e);
2344
- });
2270
+ }), o;
2345
2271
  }
2346
- function ji(e) {
2347
- return new Promise((t, n) => {
2348
- const o = new FileReader();
2349
- o.addEventListener("load", () => {
2350
- if (typeof o.result == "string") {
2351
- t(o.result);
2352
- return;
2353
- }
2354
- n(new Error("Failed to read file"));
2355
- }), o.addEventListener("error", () => {
2356
- n(o.error ?? new Error("Failed to read file"));
2357
- }), o.readAsDataURL(e);
2358
- });
2359
- }
2360
- function tn(e, t) {
2272
+ function ct(e, t) {
2361
2273
  return e.messages.filter(
2362
- (o) => !In(o)
2274
+ (n) => !Rn(n)
2363
2275
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2364
2276
  }
2365
- function Vi(e, t, n, o, i, a, l, p, c, u, d, h, x, y, A) {
2366
- const T = Yi(a), f = T.filter(
2367
- (_) => !In(_)
2368
- ), E = e.scrollTop;
2369
- e.replaceChildren(), Nn(n, a.isThinking), i.hidden = !p, p && l !== null && wi(i, l);
2370
- const g = f.length > 0 || !!a.assistantDraft || a.isThinking;
2371
- if (o(g), f.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
2277
+ function $i(e, t, o, n, i, a, l, p, c, u, d, g, S, f, O, k) {
2278
+ const x = Ki(a), v = x.filter(
2279
+ (_) => !Rn(_)
2280
+ ), h = e.scrollTop, A = [], T = /* @__PURE__ */ new Set(), I = (_) => {
2281
+ A.push(_);
2282
+ };
2283
+ zn(o, a.isThinking), i.hidden = !p, p && l !== null && Ln(i, l);
2284
+ const Ee = v.length > 0 || !!a.assistantDraft || a.isThinking;
2285
+ if (n(Ee), v.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
2372
2286
  const _ = document.createElement("div");
2373
2287
  _.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2374
- const N = document.createElement("div");
2375
- N.className = "pluno-pa-widget__empty-hero";
2376
- const F = se(
2288
+ const M = document.createElement("div");
2289
+ M.className = "pluno-pa-widget__empty-hero";
2290
+ const P = se(
2377
2291
  "pluno-pa-widget__character--empty",
2378
- x()
2292
+ f()
2379
2293
  );
2380
- N.appendChild(F), _.appendChild(N), _.appendChild(Cn());
2381
- const H = document.createElement("div");
2382
- if (H.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 && H.setAttribute("aria-hidden", "true"), a.starterPrompts.length > 0)
2383
- for (const L of a.starterPrompts) {
2384
- const I = document.createElement("button");
2385
- I.type = "button", I.className = "pluno-pa-widget__starter-prompt", I.textContent = `"${L}"`, I.addEventListener("click", () => {
2386
- y(L);
2387
- }), H.appendChild(I);
2294
+ M.appendChild(P), _.appendChild(M), _.appendChild(kn());
2295
+ const G = document.createElement("div");
2296
+ if (G.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 && G.setAttribute("aria-hidden", "true"), a.starterPrompts.length > 0)
2297
+ for (const C of a.starterPrompts) {
2298
+ const L = document.createElement("button");
2299
+ L.type = "button", L.className = "pluno-pa-widget__starter-prompt", L.textContent = `"${C}"`, L.addEventListener("click", () => {
2300
+ O(C);
2301
+ }), G.appendChild(L);
2388
2302
  }
2389
2303
  else if (a.starterPromptsLoading) {
2390
- const L = document.createElement("button");
2391
- L.type = "button", L.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", L.disabled = !0, L.tabIndex = -1, L.textContent = "Generating example tasks...", H.appendChild(L);
2304
+ const C = document.createElement("button");
2305
+ C.type = "button", C.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", C.disabled = !0, C.tabIndex = -1, C.textContent = "Generating example tasks...", G.appendChild(C);
2392
2306
  } else
2393
- for (let L = 0; L < Lo; L += 1) {
2394
- const I = document.createElement("button");
2395
- I.type = "button", I.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", I.disabled = !0, I.tabIndex = -1, I.textContent = "", H.appendChild(I);
2307
+ for (let C = 0; C < Ao; C += 1) {
2308
+ const L = document.createElement("button");
2309
+ L.type = "button", L.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", L.disabled = !0, L.tabIndex = -1, L.textContent = "", G.appendChild(L);
2396
2310
  }
2397
- _.appendChild(H), e.appendChild(_), e.appendChild(t);
2311
+ _.appendChild(G), g.clear(), I(_), I(t), rn(e, A);
2398
2312
  return;
2399
2313
  }
2400
- let S = null, k = null, R = [];
2401
- const Ce = f.some(mt), b = () => {
2402
- if (R.length === 0)
2314
+ let b = null, D = null, de = [];
2315
+ const ce = v.some(wt), we = () => {
2316
+ if (de.length === 0)
2403
2317
  return !1;
2404
2318
  const _ = ia(
2405
- R,
2319
+ de,
2406
2320
  d,
2407
- h,
2408
- x()
2321
+ S,
2322
+ f()
2409
2323
  );
2410
- return e.appendChild(_), S = null, k = _, R = [], !0;
2324
+ return I(_), b = null, D = _, de = [], !0;
2411
2325
  };
2412
- for (let _ = 0; _ < f.length; _ += 1) {
2413
- const N = f[_];
2414
- if (N.role === "tool") {
2415
- R.push(N);
2326
+ for (let _ = 0; _ < v.length; _ += 1) {
2327
+ const M = v[_];
2328
+ if (M.role === "tool") {
2329
+ de.push(M);
2416
2330
  continue;
2417
2331
  }
2418
- if (mt(N)) {
2419
- if (b()) {
2420
- const P = bt();
2421
- e.appendChild(P), S = null, k = P;
2332
+ if (wt(M)) {
2333
+ if (we()) {
2334
+ const $ = _t();
2335
+ I($), b = null, D = $;
2422
2336
  } else {
2423
- const P = an(x());
2424
- e.appendChild(P), S = null, k = P;
2337
+ const $ = sn(f());
2338
+ I($), b = null, D = $;
2425
2339
  }
2426
2340
  continue;
2427
2341
  }
2428
- if (N.role === "system")
2342
+ if (M.role === "system")
2429
2343
  continue;
2430
- const F = b(), H = oa(N.content);
2431
- if (N.role === "assistant" && !F) {
2432
- const be = Tn(x());
2433
- e.appendChild(be), S = null, k = be;
2434
- }
2435
- const L = document.createElement("div");
2436
- L.className = `pluno-pa-widget__message pluno-pa-widget__message--${N.role}`, N.role === "assistant" ? ra(L, H) : L.textContent = H, N.role === "user" && N.attachments?.length && L.appendChild(Ki(N.attachments));
2437
- const I = document.createElement("div");
2438
- I.className = "pluno-pa-widget__message-actions", I.appendChild(Xi(H)), L.appendChild(I), e.appendChild(L), S = L, k = null;
2344
+ const P = we(), G = oa(M.content);
2345
+ if (M.role === "assistant" && !P) {
2346
+ const L = Mn(f());
2347
+ I(L), b = null, D = L;
2348
+ }
2349
+ const C = qi(M, G, g, T);
2350
+ I(C), b = C, D = null;
2439
2351
  }
2440
- const ie = b();
2441
- if (a.isThinking && !a.assistantDraft && !Ce)
2442
- if (ie) {
2443
- const _ = bt();
2444
- e.appendChild(_), S = null, k = _;
2352
+ const W = we(), Re = v[v.length - 1]?.id === "assistant-draft";
2353
+ if (a.isThinking && !Re && !ce)
2354
+ if (W) {
2355
+ const _ = _t();
2356
+ I(_), b = null, D = _;
2445
2357
  } else {
2446
- const _ = an(x());
2447
- e.appendChild(_), S = null, k = _;
2358
+ const _ = sn(f());
2359
+ I(_), b = null, D = _;
2448
2360
  }
2449
2361
  if (a.lastError) {
2450
2362
  const _ = document.createElement("div");
2451
- _.className = "pluno-pa-widget__error", _.textContent = a.lastError, e.appendChild(_), S = _, k = null;
2363
+ _.className = "pluno-pa-widget__error", _.textContent = a.lastError, I(_), b = _, D = null;
2452
2364
  }
2453
- const ae = A && !a.isThinking ? eo(T) : null;
2454
- if (A && ae && !A.dismissedCandidateIds.has(ae.id)) {
2455
- const _ = Zi(ae, {
2456
- isDrafting: A.draftingCandidateId === ae.id,
2457
- error: A.error,
2458
- characterIconOptions: A.characterIconOptions,
2459
- onDraft: A.onDraft,
2460
- onDismiss: A.onDismiss,
2461
- onDisable: A.onDisable
2365
+ const K = k && !a.isThinking ? ao(x) : null;
2366
+ if (k && K && !k.dismissedCandidateIds.has(K.id)) {
2367
+ const _ = Zi(K, {
2368
+ isDrafting: k.draftingCandidateId === K.id,
2369
+ error: k.error,
2370
+ characterIconOptions: k.characterIconOptions,
2371
+ onDraft: k.onDraft,
2372
+ onDismiss: k.onDismiss,
2373
+ onDisable: k.onDisable
2462
2374
  });
2463
- e.appendChild(_), A.onSeen(ae), S = null, k = _;
2375
+ I(_), k.onSeen(K), b = null, D = _;
2464
2376
  }
2465
- S?.classList.add(
2466
- "pluno-pa-widget__message--bottom-reserve"
2467
- ), k?.classList.add(
2468
- "pluno-pa-widget__bottom-reserve-compact"
2469
- ), e.appendChild(t), c ? Ie(e, u) : e.scrollTop = E;
2377
+ b?.classList.add("pluno-pa-widget__message--bottom-reserve"), D?.classList.add("pluno-pa-widget__bottom-reserve-compact"), I(t), Vi(g, T), rn(e, A), c ? Te(e, u) : e.scrollTop = h;
2378
+ }
2379
+ function qi(e, t, o, n) {
2380
+ const i = ji(e, t), a = i ? o.get(i) : void 0;
2381
+ if (i && a)
2382
+ return a.classList.remove("pluno-pa-widget__message--bottom-reserve"), n.add(i), a;
2383
+ const l = document.createElement("div");
2384
+ l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? ra(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(Yi(e.attachments));
2385
+ const p = document.createElement("div");
2386
+ return p.className = "pluno-pa-widget__message-actions", p.appendChild(Xi(t)), l.appendChild(p), i && (o.set(i, l), n.add(i)), l;
2387
+ }
2388
+ function ji(e, t) {
2389
+ return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
2390
+ id: e.id,
2391
+ content: t,
2392
+ attachments: e.attachments.map((o) => {
2393
+ const { previewUrl: n } = o;
2394
+ return {
2395
+ id: o.id ?? null,
2396
+ name: o.name,
2397
+ mimeType: o.mimeType,
2398
+ sizeBytes: o.sizeBytes,
2399
+ previewUrl: n ?? null,
2400
+ fileUrl: o.fileUrl ?? null,
2401
+ gcsPath: o.gcsPath ?? null
2402
+ };
2403
+ })
2404
+ });
2470
2405
  }
2471
- function Yi(e) {
2406
+ function Vi(e, t) {
2407
+ for (const o of e.keys())
2408
+ t.has(o) || e.delete(o);
2409
+ }
2410
+ function rn(e, t) {
2411
+ let o = e.firstChild;
2412
+ for (const n of t) {
2413
+ if (n === o) {
2414
+ o = o.nextSibling;
2415
+ continue;
2416
+ }
2417
+ e.insertBefore(n, o);
2418
+ }
2419
+ for (; o; ) {
2420
+ const n = o;
2421
+ o = o.nextSibling, e.removeChild(n);
2422
+ }
2423
+ }
2424
+ function Ki(e) {
2472
2425
  if (!e.assistantDraft)
2473
2426
  return [...e.messages];
2474
2427
  const t = {
@@ -2482,22 +2435,22 @@ function Yi(e) {
2482
2435
  };
2483
2436
  if (!t.respondsToUserMessageId)
2484
2437
  return [...e.messages, t];
2485
- const n = e.messages.findIndex(
2438
+ const o = e.messages.findIndex(
2486
2439
  (a) => a.role === "user" && a.id === t.respondsToUserMessageId
2487
2440
  );
2488
- if (n === -1)
2441
+ if (o === -1)
2489
2442
  return [...e.messages, t];
2490
- const o = e.messages.findIndex(
2491
- (a, l) => l > n && a.role !== "user" && a.respondsToUserMessageId === t.respondsToUserMessageId && nn(a, t) && mt(a)
2443
+ const n = e.messages.findIndex(
2444
+ (a, l) => l > o && a.role !== "user" && a.respondsToUserMessageId === t.respondsToUserMessageId && ln(a, t) && wt(a)
2492
2445
  );
2493
- if (o !== -1)
2446
+ if (n !== -1)
2494
2447
  return [
2495
- ...e.messages.slice(0, o),
2448
+ ...e.messages.slice(0, n),
2496
2449
  t,
2497
- ...e.messages.slice(o + 1)
2450
+ ...e.messages.slice(n + 1)
2498
2451
  ];
2499
- let i = n + 1;
2500
- for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && nn(e.messages[i], t); )
2452
+ let i = o + 1;
2453
+ for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && ln(e.messages[i], t); )
2501
2454
  i += 1;
2502
2455
  return [
2503
2456
  ...e.messages.slice(0, i),
@@ -2505,49 +2458,49 @@ function Yi(e) {
2505
2458
  ...e.messages.slice(i)
2506
2459
  ];
2507
2460
  }
2508
- function mt(e) {
2461
+ function wt(e) {
2509
2462
  return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
2510
2463
  }
2511
- function nn(e, t) {
2464
+ function ln(e, t) {
2512
2465
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
2513
2466
  }
2514
- function on(e, t, n, o, i, a, l, p) {
2515
- e.replaceChildren(), Nn(t, !1), t.disabled = !0, n(!1);
2467
+ function pn(e, t, o, n, i, a, l, p) {
2468
+ e.replaceChildren(), zn(t, !1), t.disabled = !0, o(!1);
2516
2469
  const c = document.createElement("div");
2517
2470
  c.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2518
2471
  const u = se(
2519
2472
  "pluno-pa-widget__character--empty",
2520
- o()
2473
+ n()
2521
2474
  );
2522
2475
  c.appendChild(u);
2523
2476
  const d = document.createElement("div");
2524
2477
  if (d.className = "pluno-pa-widget__empty", d.textContent = i, c.appendChild(d), l) {
2525
- const h = document.createElement("a");
2526
- h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = a, c.appendChild(h);
2478
+ const g = document.createElement("a");
2479
+ g.className = "pluno-pa-widget__login", g.href = l, g.target = "_blank", g.rel = "noopener noreferrer", g.textContent = a, c.appendChild(g);
2527
2480
  } else {
2528
- const h = document.createElement("button");
2529
- h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = a, h.addEventListener("click", () => p?.()), c.appendChild(h);
2481
+ const g = document.createElement("button");
2482
+ g.type = "button", g.className = "pluno-pa-widget__login", g.textContent = a, g.addEventListener("click", () => p?.()), c.appendChild(g);
2530
2483
  }
2531
2484
  e.appendChild(c);
2532
2485
  }
2533
- function Ki(e) {
2486
+ function Yi(e) {
2534
2487
  const t = document.createElement("div");
2535
2488
  t.className = "pluno-pa-widget__message-attachments";
2536
- for (const n of e)
2537
- t.appendChild(Di(n));
2489
+ for (const o of e)
2490
+ t.appendChild(zi(o));
2538
2491
  return t;
2539
2492
  }
2540
2493
  function Xi(e) {
2541
2494
  const t = document.createElement("button");
2542
- return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Ii()), t.addEventListener("click", (n) => {
2543
- n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
2495
+ return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Di()), t.addEventListener("click", (o) => {
2496
+ o.preventDefault(), o.stopPropagation(), navigator.clipboard.writeText(e);
2544
2497
  }), t;
2545
2498
  }
2546
2499
  function Zi(e, t) {
2547
- const n = document.createElement("article");
2548
- n.className = "pluno-pa-widget__share-prompt";
2549
- const o = document.createElement("div");
2550
- o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
2500
+ const o = document.createElement("article");
2501
+ o.className = "pluno-pa-widget__share-prompt";
2502
+ const n = document.createElement("div");
2503
+ n.className = "pluno-pa-widget__share-prompt-body", n.appendChild(
2551
2504
  se(
2552
2505
  "pluno-pa-widget__share-prompt-icon",
2553
2506
  t.characterIconOptions
@@ -2562,7 +2515,7 @@ function Zi(e, t) {
2562
2515
  const d = document.createElement("span");
2563
2516
  d.className = "pluno-pa-widget__share-prompt-error", d.textContent = t.error, i.appendChild(d);
2564
2517
  }
2565
- o.appendChild(i);
2518
+ n.appendChild(i);
2566
2519
  const p = document.createElement("div");
2567
2520
  p.className = "pluno-pa-widget__share-prompt-actions";
2568
2521
  const c = document.createElement("div");
@@ -2570,31 +2523,31 @@ function Zi(e, t) {
2570
2523
  const u = document.createElement("button");
2571
2524
  if (u.type = "button", u.disabled = t.isDrafting, u.addEventListener("click", () => {
2572
2525
  t.onDraft(e);
2573
- }), t.isDrafting ? (u.appendChild(ft()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", c.appendChild(u), t.isDrafting)
2526
+ }), t.isDrafting ? (u.appendChild(xt()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", c.appendChild(u), t.isDrafting)
2574
2527
  p.appendChild(c);
2575
2528
  else {
2576
2529
  const d = document.createElement("button");
2577
2530
  d.type = "button", d.className = "pluno-pa-widget__share-prompt-dismiss", d.setAttribute("aria-label", "Dismiss share prompt"), d.title = "Dismiss", d.textContent = "Dismiss", d.addEventListener("click", () => {
2578
2531
  t.onDismiss(e);
2579
2532
  }), c.appendChild(d), p.appendChild(c);
2580
- const h = document.createElement("button");
2581
- h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => {
2533
+ const g = document.createElement("button");
2534
+ g.type = "button", g.className = "pluno-pa-widget__share-prompt-disable", g.textContent = "Don't ask again", g.addEventListener("click", () => {
2582
2535
  t.onDisable(e);
2583
- }), p.appendChild(h);
2536
+ }), p.appendChild(g);
2584
2537
  }
2585
- return o.appendChild(p), n.appendChild(o), n;
2538
+ return n.appendChild(p), o.appendChild(n), o;
2586
2539
  }
2587
2540
  function Ji(e, t) {
2588
- const n = document.createElement("div");
2589
- n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (f) => {
2590
- f.target === n && t.onClose();
2541
+ const o = document.createElement("div");
2542
+ o.className = "pluno-pa-widget__share-dialog-backdrop", o.addEventListener("click", (x) => {
2543
+ x.target === o && t.onClose();
2591
2544
  });
2592
- const o = document.createElement("section");
2593
- o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
2545
+ const n = document.createElement("section");
2546
+ n.className = "pluno-pa-widget__share-dialog", n.setAttribute("role", "dialog"), n.setAttribute("aria-modal", "true"), n.setAttribute("aria-label", "Draft a social post");
2594
2547
  const i = document.createElement("header"), a = document.createElement("strong");
2595
2548
  a.textContent = "Share this win", i.appendChild(a);
2596
2549
  const l = document.createElement("button");
2597
- l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
2550
+ l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), n.appendChild(i);
2598
2551
  const p = document.createElement("p");
2599
2552
  p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
2600
2553
  const c = document.createElement("div");
@@ -2603,53 +2556,53 @@ function Ji(e, t) {
2603
2556
  u.className = "pluno-pa-widget__share-dialog-step-header";
2604
2557
  const d = document.createElement("strong");
2605
2558
  d.textContent = "1) Copy Screenshot", u.appendChild(d);
2606
- const h = Qi(
2559
+ const g = Qi(
2607
2560
  "Copy Screenshot",
2608
2561
  async () => {
2609
2562
  try {
2610
- return await to(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
2563
+ return await ro(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
2611
2564
  } catch {
2612
2565
  return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
2613
2566
  }
2614
2567
  }
2615
2568
  );
2616
- if (u.appendChild(h), c.appendChild(u), e.screenshotDataUrl) {
2617
- const f = document.createElement("div");
2618
- f.className = "pluno-pa-widget__share-dialog-screenshot";
2619
- const E = document.createElement("img");
2620
- E.src = e.screenshotDataUrl, E.alt = "Product page with Pluno open", f.appendChild(E), c.appendChild(f);
2569
+ if (u.appendChild(g), c.appendChild(u), e.screenshotDataUrl) {
2570
+ const x = document.createElement("div");
2571
+ x.className = "pluno-pa-widget__share-dialog-screenshot";
2572
+ const v = document.createElement("img");
2573
+ v.src = e.screenshotDataUrl, v.alt = "Product page with Pluno open", x.appendChild(v), c.appendChild(x);
2621
2574
  }
2622
- o.appendChild(c), o.appendChild(p);
2623
- const x = document.createElement("div");
2624
- x.className = "pluno-pa-widget__share-dialog-step";
2625
- const y = document.createElement("strong");
2626
- y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "2) Share on", x.appendChild(y);
2627
- const A = document.createElement("p");
2628
- A.className = "pluno-pa-widget__share-dialog-hint", A.textContent = "Post draft opens prefilled on supported platforms.", x.appendChild(A);
2629
- const T = document.createElement("footer");
2630
- T.className = "pluno-pa-widget__share-dialog-platforms";
2631
- for (const f of ea(e)) {
2632
- const E = document.createElement("a");
2633
- E.href = f.href, E.target = "_blank", E.rel = "noopener noreferrer", E.title = f.label, E.setAttribute("aria-label", `Open ${f.label}`), E.appendChild(ta(f.id)), T.appendChild(E);
2575
+ n.appendChild(c), n.appendChild(p);
2576
+ const S = document.createElement("div");
2577
+ S.className = "pluno-pa-widget__share-dialog-step";
2578
+ const f = document.createElement("strong");
2579
+ f.className = "pluno-pa-widget__share-dialog-step-title", f.textContent = "2) Share on", S.appendChild(f);
2580
+ const O = document.createElement("p");
2581
+ O.className = "pluno-pa-widget__share-dialog-hint", O.textContent = "Post draft opens prefilled on supported platforms.", S.appendChild(O);
2582
+ const k = document.createElement("footer");
2583
+ k.className = "pluno-pa-widget__share-dialog-platforms";
2584
+ for (const x of ea(e)) {
2585
+ const v = document.createElement("a");
2586
+ v.href = x.href, v.target = "_blank", v.rel = "noopener noreferrer", v.title = x.label, v.setAttribute("aria-label", `Open ${x.label}`), v.appendChild(ta(x.id)), k.appendChild(v);
2634
2587
  }
2635
- if (x.appendChild(T), o.appendChild(x), t.socialPostRewardsUrl) {
2636
- const f = document.createElement("div");
2637
- f.className = "pluno-pa-widget__share-dialog-step";
2638
- const E = document.createElement("strong");
2639
- E.className = "pluno-pa-widget__share-dialog-step-title", E.textContent = "3) Submit post to get 2000 free credits!", f.appendChild(E);
2640
- const g = document.createElement("a");
2641
- g.className = "pluno-pa-widget__share-dialog-reward-link", g.href = t.socialPostRewardsUrl, g.target = "_blank", g.rel = "noopener noreferrer", g.appendChild(document.createTextNode("Submit post URL")), g.appendChild(na()), f.appendChild(g), o.appendChild(f);
2588
+ if (S.appendChild(k), n.appendChild(S), t.socialPostRewardsUrl) {
2589
+ const x = document.createElement("div");
2590
+ x.className = "pluno-pa-widget__share-dialog-step";
2591
+ const v = document.createElement("strong");
2592
+ v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "3) Submit post to get 2000 free credits!", x.appendChild(v);
2593
+ const h = document.createElement("a");
2594
+ 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(na()), x.appendChild(h), n.appendChild(x);
2642
2595
  }
2643
- return n.appendChild(o), n;
2596
+ return o.appendChild(n), o;
2644
2597
  }
2645
2598
  function Qi(e, t) {
2646
- const n = document.createElement("button");
2647
- return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
2648
- o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
2649
- }), n;
2599
+ const o = document.createElement("button");
2600
+ return o.type = "button", o.className = "pluno-pa-widget__share-dialog-copy", o.textContent = e, o.addEventListener("click", async (n) => {
2601
+ n.preventDefault(), n.stopPropagation(), await t() && (o.textContent = "Copied ✓");
2602
+ }), o;
2650
2603
  }
2651
2604
  function ea(e) {
2652
- const t = e.linkedinPost.trim(), n = e.xPost.trim();
2605
+ const t = e.linkedinPost.trim(), o = e.xPost.trim();
2653
2606
  return [
2654
2607
  {
2655
2608
  id: "linkedin",
@@ -2659,7 +2612,7 @@ function ea(e) {
2659
2612
  {
2660
2613
  id: "x",
2661
2614
  label: "X",
2662
- href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(n)}`
2615
+ href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(o)}`
2663
2616
  },
2664
2617
  {
2665
2618
  id: "instagram",
@@ -2670,75 +2623,75 @@ function ea(e) {
2670
2623
  }
2671
2624
  function ta(e) {
2672
2625
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
2673
- 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" ? (U(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), U(
2626
+ 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(
2674
2627
  t,
2675
2628
  "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"
2676
- ), U(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), U(
2629
+ ), B(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), B(
2677
2630
  t,
2678
2631
  "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"
2679
- ), U(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (U(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), U(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), U(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (U(
2632
+ ), 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(
2680
2633
  t,
2681
2634
  "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"
2682
- ), U(
2635
+ ), B(
2683
2636
  t,
2684
2637
  "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",
2685
2638
  "0.48"
2686
- ), U(
2639
+ ), B(
2687
2640
  t,
2688
2641
  "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"
2689
- ), U(
2642
+ ), B(
2690
2643
  t,
2691
2644
  "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"
2692
2645
  ), t);
2693
2646
  }
2694
- function U(e, t, n) {
2695
- const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
2696
- o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
2647
+ function B(e, t, o) {
2648
+ const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
2649
+ n.setAttribute("d", t), o && n.setAttribute("opacity", o), e.appendChild(n);
2697
2650
  }
2698
2651
  function na() {
2699
2652
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
2700
- return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), U(e, "M14 5h5v5"), U(e, "M19 5l-8 8"), U(
2653
+ 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(
2701
2654
  e,
2702
2655
  "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
2703
2656
  ), e;
2704
2657
  }
2705
- function In(e) {
2706
- return e.role === "tool" && e.toolName === un;
2658
+ function Rn(e) {
2659
+ return e.role === "tool" && e.toolName === bn;
2707
2660
  }
2708
2661
  function oa(e) {
2709
2662
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
2710
2663
  }
2711
- function ia(e, t, n, o) {
2664
+ function ia(e, t, o, n) {
2712
2665
  const i = document.createElement("article");
2713
2666
  i.className = "pluno-pa-widget__tool-group", i.title = new Date(
2714
2667
  e[e.length - 1].createdAt
2715
2668
  ).toLocaleString(), i.appendChild(
2716
2669
  se(
2717
2670
  "pluno-pa-widget__character--tool-group",
2718
- o
2671
+ n
2719
2672
  )
2720
2673
  );
2721
2674
  const a = document.createElement("details"), l = aa(e);
2722
2675
  a.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.addEventListener("toggle", () => {
2723
- i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.open ? t.add(l) : t.delete(l), n();
2676
+ i.classList.toggle("pluno-pa-widget__tool-group--open", a.open), a.open ? t.add(l) : t.delete(l), o();
2724
2677
  });
2725
2678
  const p = document.createElement("summary");
2726
- p.className = "pluno-pa-widget__tool-summary", e.some((d) => d.loading) && p.appendChild(ft());
2679
+ p.className = "pluno-pa-widget__tool-summary", e.some((d) => d.loading) && p.appendChild(xt());
2727
2680
  const u = document.createElement("span");
2728
2681
  if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u), a.appendChild(p), e.length > 0) {
2729
2682
  const d = document.createElement("div");
2730
2683
  d.className = "pluno-pa-widget__tool-lines";
2731
- for (const h of e) {
2732
- const x = document.createElement("div");
2733
- x.className = "pluno-pa-widget__tool-line", h.loading && x.appendChild(ft());
2734
- const y = document.createElement("span");
2735
- y.textContent = h.content || "Run tool", x.appendChild(y), d.appendChild(x);
2684
+ for (const g of e) {
2685
+ const S = document.createElement("div");
2686
+ S.className = "pluno-pa-widget__tool-line", g.loading && S.appendChild(xt());
2687
+ const f = document.createElement("span");
2688
+ f.textContent = g.content || "Run tool", S.appendChild(f), d.appendChild(S);
2736
2689
  }
2737
2690
  a.appendChild(d);
2738
2691
  }
2739
2692
  return i.appendChild(a), i;
2740
2693
  }
2741
- function Tn(e) {
2694
+ function Mn(e) {
2742
2695
  const t = document.createElement("article");
2743
2696
  return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
2744
2697
  se(
@@ -2747,89 +2700,89 @@ function Tn(e) {
2747
2700
  )
2748
2701
  ), t;
2749
2702
  }
2750
- function an(e) {
2751
- const t = Tn(e);
2752
- return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(bt()), t;
2703
+ function sn(e) {
2704
+ const t = Mn(e);
2705
+ return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(_t()), t;
2753
2706
  }
2754
- function bt() {
2707
+ function _t() {
2755
2708
  const e = document.createElement("div");
2756
2709
  e.className = "pluno-pa-widget__status";
2757
2710
  const t = document.createElement("span");
2758
2711
  t.className = "pluno-pa-widget__thinking-dot", t.setAttribute("aria-hidden", "true"), e.appendChild(t);
2759
- const n = document.createElement("span");
2760
- return n.textContent = "Thinking...", e.appendChild(n), e;
2712
+ const o = document.createElement("span");
2713
+ return o.textContent = "Thinking...", e.appendChild(o), e;
2761
2714
  }
2762
2715
  function aa(e) {
2763
2716
  return `tools:${e[0]?.id ?? ""}`;
2764
2717
  }
2765
- function ft() {
2718
+ function xt() {
2766
2719
  const e = document.createElement("span");
2767
2720
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
2768
2721
  }
2769
- function Nn(e, t) {
2770
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Pi() : kn());
2722
+ function zn(e, t) {
2723
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ni() : An());
2771
2724
  }
2772
2725
  function ra(e, t) {
2773
- const n = t.replace(/\r\n/g, `
2726
+ const o = t.replace(/\r\n/g, `
2774
2727
  `).split(`
2775
2728
  `);
2776
- let o = 0;
2777
- for (; o < n.length; ) {
2778
- const i = n[o];
2729
+ let n = 0;
2730
+ for (; n < o.length; ) {
2731
+ const i = o[n];
2779
2732
  if (!i.trim()) {
2780
- o += 1;
2733
+ n += 1;
2781
2734
  continue;
2782
2735
  }
2783
2736
  if (i.match(/^```(\w+)?\s*$/)) {
2784
2737
  const u = [];
2785
- for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
2786
- u.push(n[o]), o += 1;
2787
- o += o < n.length ? 1 : 0;
2788
- const d = document.createElement("pre"), h = document.createElement("code");
2789
- h.textContent = u.join(`
2790
- `), d.appendChild(h), e.appendChild(d);
2738
+ for (n += 1; n < o.length && !/^```\s*$/.test(o[n]); )
2739
+ u.push(o[n]), n += 1;
2740
+ n += n < o.length ? 1 : 0;
2741
+ const d = document.createElement("pre"), g = document.createElement("code");
2742
+ g.textContent = u.join(`
2743
+ `), d.appendChild(g), e.appendChild(d);
2791
2744
  continue;
2792
2745
  }
2793
2746
  const l = i.match(/^(#{1,3})\s+(.+)$/);
2794
2747
  if (l) {
2795
2748
  const u = document.createElement(`h${l[1].length + 2}`);
2796
- Ue(u, l[2]), e.appendChild(u), o += 1;
2749
+ We(u, l[2]), e.appendChild(u), n += 1;
2797
2750
  continue;
2798
2751
  }
2799
2752
  if (/^\s*[-*+]\s+/.test(i)) {
2800
2753
  const u = document.createElement("ul");
2801
- for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
2754
+ for (; n < o.length && /^\s*[-*+]\s+/.test(o[n]); ) {
2802
2755
  const d = document.createElement("li");
2803
- Ue(d, n[o].replace(/^\s*[-*+]\s+/, "")), u.appendChild(d), o += 1;
2756
+ We(d, o[n].replace(/^\s*[-*+]\s+/, "")), u.appendChild(d), n += 1;
2804
2757
  }
2805
2758
  e.appendChild(u);
2806
2759
  continue;
2807
2760
  }
2808
2761
  if (/^\s*\d+\.\s+/.test(i)) {
2809
2762
  const u = document.createElement("ol");
2810
- for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
2763
+ for (; n < o.length && /^\s*\d+\.\s+/.test(o[n]); ) {
2811
2764
  const d = document.createElement("li");
2812
- Ue(d, n[o].replace(/^\s*\d+\.\s+/, "")), u.appendChild(d), o += 1;
2765
+ We(d, o[n].replace(/^\s*\d+\.\s+/, "")), u.appendChild(d), n += 1;
2813
2766
  }
2814
2767
  e.appendChild(u);
2815
2768
  continue;
2816
2769
  }
2817
2770
  const p = [i];
2818
- for (o += 1; o < n.length && n[o].trim() && !/^```/.test(n[o]) && !/^(#{1,3})\s+/.test(n[o]) && !/^\s*[-*+]\s+/.test(n[o]) && !/^\s*\d+\.\s+/.test(n[o]); )
2819
- p.push(n[o]), o += 1;
2771
+ for (n += 1; n < o.length && o[n].trim() && !/^```/.test(o[n]) && !/^(#{1,3})\s+/.test(o[n]) && !/^\s*[-*+]\s+/.test(o[n]) && !/^\s*\d+\.\s+/.test(o[n]); )
2772
+ p.push(o[n]), n += 1;
2820
2773
  const c = document.createElement("p");
2821
2774
  p.forEach((u, d) => {
2822
- d > 0 && c.appendChild(document.createElement("br")), Ue(c, u);
2775
+ d > 0 && c.appendChild(document.createElement("br")), We(c, u);
2823
2776
  }), e.appendChild(c);
2824
2777
  }
2825
2778
  }
2826
- function Ue(e, t) {
2827
- const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
2828
- let o = 0;
2829
- for (const i of t.matchAll(n)) {
2779
+ function We(e, t) {
2780
+ const o = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
2781
+ let n = 0;
2782
+ for (const i of t.matchAll(o)) {
2830
2783
  const a = i.index ?? 0;
2831
- a > o && e.appendChild(
2832
- document.createTextNode(t.slice(o, a))
2784
+ a > n && e.appendChild(
2785
+ document.createTextNode(t.slice(n, a))
2833
2786
  );
2834
2787
  const l = i[0];
2835
2788
  if (l.startsWith("`")) {
@@ -2849,9 +2802,9 @@ function Ue(e, t) {
2849
2802
  } else
2850
2803
  e.appendChild(document.createTextNode(l));
2851
2804
  }
2852
- o = a + l.length;
2805
+ n = a + l.length;
2853
2806
  }
2854
- o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
2807
+ n < t.length && e.appendChild(document.createTextNode(t.slice(n)));
2855
2808
  }
2856
2809
  function la(e) {
2857
2810
  if (e.startsWith("/") || e.startsWith("#"))
@@ -2863,10 +2816,10 @@ function la(e) {
2863
2816
  return !1;
2864
2817
  }
2865
2818
  }
2866
- function rn(e, t) {
2819
+ function dn(e, t) {
2867
2820
  if (pa(e))
2868
2821
  return;
2869
- const n = `
2822
+ const o = `
2870
2823
  :host {
2871
2824
  all: initial;
2872
2825
  color-scheme: light;
@@ -2917,7 +2870,7 @@ function rn(e, t) {
2917
2870
  --pluno-pa-accent-contrast: #fafafa;
2918
2871
  position: fixed;
2919
2872
  z-index: 2147483645;
2920
- font-family: ${Z.fontFamily};
2873
+ font-family: ${Q.fontFamily};
2921
2874
  font-size: 14px;
2922
2875
  color: var(--pluno-pa-text);
2923
2876
  width: var(--pluno-pa-launcher-width);
@@ -3509,12 +3462,14 @@ function rn(e, t) {
3509
3462
  margin-top: 8px;
3510
3463
  max-width: 220px;
3511
3464
  }
3512
- .pluno-pa-widget__message-attachments img {
3465
+ .pluno-pa-widget__message-attachment-preview {
3513
3466
  width: 100%;
3514
3467
  aspect-ratio: 1;
3515
3468
  border-radius: 8px;
3516
3469
  object-fit: cover;
3517
3470
  border: 1px solid var(--pluno-pa-divider);
3471
+ background: var(--pluno-pa-surface);
3472
+ overflow: hidden;
3518
3473
  }
3519
3474
  .pluno-pa-widget__message-attachment-file {
3520
3475
  min-width: 0;
@@ -3884,7 +3839,7 @@ function rn(e, t) {
3884
3839
  place-items: center;
3885
3840
  padding: 18px;
3886
3841
  background: rgba(24, 24, 27, 0.28);
3887
- font-family: var(--pluno-pa-font, ${Z.fontFamily});
3842
+ font-family: var(--pluno-pa-font, ${Q.fontFamily});
3888
3843
  color: var(--pluno-pa-text);
3889
3844
  }
3890
3845
  .pluno-pa-widget__share-dialog {
@@ -4200,7 +4155,8 @@ function rn(e, t) {
4200
4155
  padding: 3px 5px 3px 3px;
4201
4156
  font-size: 12px;
4202
4157
  }
4203
- .pluno-pa-widget__attachment img {
4158
+ .pluno-pa-widget__attachment img,
4159
+ .pluno-pa-widget__attachment video {
4204
4160
  width: 22px;
4205
4161
  height: 22px;
4206
4162
  border-radius: 5px;
@@ -4969,23 +4925,23 @@ function rn(e, t) {
4969
4925
  filter: url(#pluno-pa-scribble-wobble-2);
4970
4926
  }
4971
4927
  `;
4972
- if (sa(e, n))
4928
+ if (sa(e, o))
4973
4929
  return;
4974
- const o = e.ownerDocument.createElement("style");
4975
- o.id = _n, o.textContent = n, e.appendChild(o), Dn(e);
4930
+ const n = e.ownerDocument.createElement("style");
4931
+ n.id = yn, n.textContent = o, e.appendChild(n), Bn(e);
4976
4932
  }
4977
4933
  function pa(e) {
4978
- return e.getElementById(_n) !== null || e.host instanceof HTMLElement && e.host.getAttribute(xn) === "true";
4934
+ return e.getElementById(yn) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Cn) === "true";
4979
4935
  }
4980
- function Dn(e) {
4981
- e.host instanceof HTMLElement && e.host.setAttribute(xn, "true");
4936
+ function Bn(e) {
4937
+ e.host instanceof HTMLElement && e.host.setAttribute(Cn, "true");
4982
4938
  }
4983
4939
  function sa(e, t) {
4984
4940
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
4985
4941
  return !1;
4986
4942
  try {
4987
- const n = new CSSStyleSheet();
4988
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Dn(e), !0;
4943
+ const o = new CSSStyleSheet();
4944
+ return o.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, o], Bn(e), !0;
4989
4945
  } catch {
4990
4946
  return !1;
4991
4947
  }
@@ -4998,34 +4954,34 @@ async function da() {
4998
4954
  t.observe(document.documentElement, { childList: !0 });
4999
4955
  });
5000
4956
  }
5001
- function Rn(e) {
4957
+ function Un(e) {
5002
4958
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
5003
4959
  }
5004
4960
  function ca(e) {
5005
4961
  try {
5006
- const t = window.localStorage.getItem(Rn(e));
4962
+ const t = window.localStorage.getItem(Un(e));
5007
4963
  if (!t)
5008
- return ln();
5009
- const n = JSON.parse(t);
4964
+ return cn();
4965
+ const o = JSON.parse(t);
5010
4966
  return {
5011
- isOpen: n.isOpen === !0,
5012
- composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
5013
- openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
5014
- (o) => typeof o == "string"
4967
+ isOpen: o.isOpen === !0,
4968
+ composerValue: typeof o.composerValue == "string" ? o.composerValue : "",
4969
+ openToolGroupKeys: Array.isArray(o.openToolGroupKeys) ? o.openToolGroupKeys.filter(
4970
+ (n) => typeof n == "string"
5015
4971
  ) : [],
5016
- launcherPosition: ma(n.launcherPosition) ? n.launcherPosition : null,
5017
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-gn) : [],
5018
- sharePromptsDisabled: n.sharePromptsDisabled === !0
4972
+ launcherPosition: ma(o.launcherPosition) ? o.launcherPosition : null,
4973
+ seenShareCandidateIds: Array.isArray(o.seenShareCandidateIds) ? o.seenShareCandidateIds.filter((n) => typeof n == "string").slice(-fn) : [],
4974
+ sharePromptsDisabled: o.sharePromptsDisabled === !0
5019
4975
  };
5020
4976
  } catch {
5021
- return ln();
4977
+ return cn();
5022
4978
  }
5023
4979
  }
5024
4980
  async function ua(e) {
5025
4981
  if (e.loadSharePromptsDisabled)
5026
4982
  return e.loadSharePromptsDisabled();
5027
4983
  try {
5028
- return window.localStorage.getItem(hn) === "true";
4984
+ return window.localStorage.getItem(wn) === "true";
5029
4985
  } catch {
5030
4986
  return !1;
5031
4987
  }
@@ -5039,12 +4995,12 @@ function ga(e, t) {
5039
4995
  return;
5040
4996
  }
5041
4997
  try {
5042
- t && window.localStorage.setItem(hn, "true");
4998
+ t && window.localStorage.setItem(wn, "true");
5043
4999
  } catch {
5044
5000
  return;
5045
5001
  }
5046
5002
  }
5047
- function ln() {
5003
+ function cn() {
5048
5004
  return {
5049
5005
  isOpen: !1,
5050
5006
  composerValue: "",
@@ -5057,7 +5013,7 @@ function ln() {
5057
5013
  function ha(e, t) {
5058
5014
  try {
5059
5015
  window.localStorage.setItem(
5060
- Rn(e),
5016
+ Un(e),
5061
5017
  JSON.stringify(t)
5062
5018
  );
5063
5019
  } catch {
@@ -5070,32 +5026,32 @@ function ma(e) {
5070
5026
  const t = e;
5071
5027
  return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
5072
5028
  }
5073
- const pn = /* @__PURE__ */ new WeakSet();
5029
+ const un = /* @__PURE__ */ new WeakSet();
5074
5030
  function ba(e) {
5075
5031
  return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
5076
5032
  }
5077
- function sn(e) {
5033
+ function gn(e) {
5078
5034
  const t = e.pathname.split("/");
5079
5035
  return t[t.length - 1] ?? "";
5080
5036
  }
5081
5037
  function fa(e, t) {
5082
- const n = new URL(e.src, document.baseURI);
5083
- return n.href === t.href || n.pathname === t.pathname ? !0 : sn(n) === sn(t);
5084
- }
5085
- class oe extends EventTarget {
5086
- constructor(t, n) {
5087
- super(), this.channelId = n, this.url = t, this.addPreviewListener(_o, () => {
5088
- this.readyState = oe.OPEN, this.dispatchEvent(new Event("open"));
5089
- }), this.addPreviewListener(xo, (o) => {
5090
- const i = o;
5038
+ const o = new URL(e.src, document.baseURI);
5039
+ return o.href === t.href || o.pathname === t.pathname ? !0 : gn(o) === gn(t);
5040
+ }
5041
+ class ae extends EventTarget {
5042
+ constructor(t, o) {
5043
+ super(), this.channelId = o, this.url = t, this.addPreviewListener(So, () => {
5044
+ this.readyState = ae.OPEN, this.dispatchEvent(new Event("open"));
5045
+ }), this.addPreviewListener(Eo, (n) => {
5046
+ const i = n;
5091
5047
  this.dispatchEvent(
5092
5048
  new MessageEvent("message", { data: i.detail?.data ?? "" })
5093
5049
  );
5094
- }), this.addPreviewListener(yo, () => {
5095
- this.readyState = oe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5096
- }), this.addPreviewListener(vo, (o) => {
5097
- const i = o;
5098
- this.readyState = oe.CLOSED, this.dispatchEvent(
5050
+ }), this.addPreviewListener(ko, () => {
5051
+ this.readyState = ae.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5052
+ }), this.addPreviewListener(Lo, (n) => {
5053
+ const i = n;
5054
+ this.readyState = ae.CLOSED, this.dispatchEvent(
5099
5055
  new CloseEvent("close", {
5100
5056
  code: i.detail?.code ?? 1e3,
5101
5057
  reason: i.detail?.reason ?? "",
@@ -5104,8 +5060,8 @@ class oe extends EventTarget {
5104
5060
  ), this.cleanup();
5105
5061
  }), window.dispatchEvent(
5106
5062
  new CustomEvent(
5107
- Fe(
5108
- bo,
5063
+ Ge(
5064
+ vo,
5109
5065
  this.channelId
5110
5066
  ),
5111
5067
  {
@@ -5124,18 +5080,18 @@ class oe extends EventTarget {
5124
5080
  extensions = "";
5125
5081
  binaryType = "blob";
5126
5082
  bufferedAmount = 0;
5127
- readyState = oe.CONNECTING;
5083
+ readyState = ae.CONNECTING;
5128
5084
  socketId = wa();
5129
5085
  listeners = /* @__PURE__ */ new Map();
5130
5086
  send(t) {
5131
- if (this.readyState !== oe.OPEN)
5087
+ if (this.readyState !== ae.OPEN)
5132
5088
  throw new DOMException(
5133
5089
  "Pluno preview websocket is not open",
5134
5090
  "InvalidStateError"
5135
5091
  );
5136
5092
  window.dispatchEvent(
5137
5093
  new CustomEvent(
5138
- Fe(fo, this.channelId),
5094
+ Ge(yo, this.channelId),
5139
5095
  {
5140
5096
  detail: {
5141
5097
  socketId: this.socketId,
@@ -5145,78 +5101,78 @@ class oe extends EventTarget {
5145
5101
  )
5146
5102
  );
5147
5103
  }
5148
- close(t, n) {
5149
- this.readyState !== oe.CLOSED && (this.readyState = oe.CLOSING, window.dispatchEvent(
5104
+ close(t, o) {
5105
+ this.readyState !== ae.CLOSED && (this.readyState = ae.CLOSING, window.dispatchEvent(
5150
5106
  new CustomEvent(
5151
- Fe(wo, this.channelId),
5107
+ Ge(Co, this.channelId),
5152
5108
  {
5153
- detail: { socketId: this.socketId, code: t, reason: n }
5109
+ detail: { socketId: this.socketId, code: t, reason: o }
5154
5110
  }
5155
5111
  )
5156
5112
  ), this.cleanup());
5157
5113
  }
5158
- addPreviewListener(t, n) {
5159
- const o = Fe(
5114
+ addPreviewListener(t, o) {
5115
+ const n = Ge(
5160
5116
  t,
5161
5117
  this.channelId
5162
5118
  ), i = (a) => {
5163
- a.detail?.socketId === this.socketId && n(a);
5119
+ a.detail?.socketId === this.socketId && o(a);
5164
5120
  };
5165
- this.listeners.set(o, i), window.addEventListener(o, i);
5121
+ this.listeners.set(n, i), window.addEventListener(n, i);
5166
5122
  }
5167
5123
  cleanup() {
5168
- for (const [t, n] of this.listeners.entries())
5169
- window.removeEventListener(t, n);
5124
+ for (const [t, o] of this.listeners.entries())
5125
+ window.removeEventListener(t, o);
5170
5126
  this.listeners.clear();
5171
5127
  }
5172
5128
  }
5173
5129
  function wa() {
5174
5130
  const e = window.sessionStorage.getItem(
5175
- Bt
5131
+ Ht
5176
5132
  );
5177
5133
  if (e)
5178
5134
  return e;
5179
5135
  const t = crypto.randomUUID();
5180
- return window.sessionStorage.setItem(Bt, t), t;
5136
+ return window.sessionStorage.setItem(Ht, t), t;
5181
5137
  }
5182
- function Fe(e, t) {
5138
+ function Ge(e, t) {
5183
5139
  return `${e}:${t}`;
5184
5140
  }
5185
5141
  function _a(e) {
5186
5142
  const t = document.currentScript;
5187
5143
  if (t instanceof HTMLScriptElement)
5188
5144
  return [t];
5189
- const n = new URL(e, document.baseURI).href, o = new URL(n);
5145
+ const o = new URL(e, document.baseURI).href, n = new URL(o);
5190
5146
  return Array.from(
5191
5147
  document.querySelectorAll("script[type='module'][src]")
5192
5148
  ).filter(
5193
- (i) => i instanceof HTMLScriptElement && ba(i) && fa(i, o)
5149
+ (i) => i instanceof HTMLScriptElement && ba(i) && fa(i, n)
5194
5150
  );
5195
5151
  }
5196
5152
  function xa(e) {
5197
5153
  for (const t of _a(e)) {
5198
- if (pn.has(t) || t.dataset.plunoAutoMount === "false")
5154
+ if (un.has(t) || t.dataset.plunoAutoMount === "false")
5199
5155
  continue;
5200
- pn.add(t);
5201
- const n = t.dataset.plunoPreviewChannel;
5202
- Vo({
5156
+ un.add(t);
5157
+ const o = t.dataset.plunoPreviewChannel;
5158
+ Xo({
5203
5159
  token: t.dataset.plunoToken,
5204
5160
  tokenEndpoint: t.dataset.plunoTokenEndpoint,
5205
5161
  backendUrl: t.dataset.plunoBackendUrl,
5206
- webSocketFactory: n ? jo(n) : void 0,
5162
+ webSocketFactory: o ? Yo(o) : void 0,
5207
5163
  launcherLabel: t.dataset.plunoLauncherLabel,
5208
5164
  accentColor: t.dataset.plunoAccentColor,
5209
5165
  colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
5210
5166
  fontFamily: t.dataset.plunoFontFamily,
5211
5167
  scribbleStyle: t.dataset.plunoScribbleStyle === "true",
5212
5168
  position: t.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
5213
- }).catch((o) => {
5214
- console.error("Failed to mount Pluno widget", o);
5169
+ }).catch((n) => {
5170
+ console.error("Failed to mount Pluno widget", n);
5215
5171
  });
5216
5172
  }
5217
5173
  }
5218
5174
  xa(import.meta.url);
5219
5175
  export {
5220
- jo as createProductAgentPreviewBridgeWebSocketFactory,
5221
- Vo as mountPlunoProductAgentWidget
5176
+ Yo as createProductAgentPreviewBridgeWebSocketFactory,
5177
+ Xo as mountPlunoProductAgentWidget
5222
5178
  };