@pluno/product-agent-web 0.1.26 → 0.1.27

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,7 +1,7 @@
1
- import { PlunoProductAgent as jt } from "./product-agent-sdk.js";
2
- const qt = "#7c3aed";
3
- function Kt(e) {
4
- const t = Qt(e);
1
+ import { PlunoProductAgent as qt } from "./product-agent-sdk.js";
2
+ const Kt = "#7c3aed";
3
+ function Yt(e) {
4
+ const t = en(e);
5
5
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 1254" role="img" aria-label="Pluno">
6
6
  <defs>
7
7
  <linearGradient id="boltFill" x1="420" y1="180" x2="790" y2="1040" gradientUnits="userSpaceOnUse">
@@ -75,23 +75,23 @@ function Kt(e) {
75
75
  </g>
76
76
  </svg>`;
77
77
  }
78
- function Yt(e) {
79
- return `data:image/svg+xml,${encodeURIComponent(Kt(e))}`;
78
+ function Xt(e) {
79
+ return `data:image/svg+xml,${encodeURIComponent(Yt(e))}`;
80
80
  }
81
81
  const X = "#2c2a1e", je = [253, 250, 241], qe = 3.5;
82
- function ft(e) {
83
- const t = bt(e);
82
+ function bt(e) {
83
+ const t = wt(e);
84
84
  if (Ke(ae(t), je) >= qe)
85
85
  return t;
86
86
  let o = ae(t);
87
87
  const a = ae(X);
88
88
  for (let i = 0; i < 6; i += 1)
89
- if (o = en(o, a, 0.22), Ke(o, je) >= qe)
89
+ if (o = tn(o, a, 0.22), Ke(o, je) >= qe)
90
90
  return Le(o);
91
91
  return Le(o);
92
92
  }
93
- function Xt(e) {
94
- const t = ft(e), n = "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";
93
+ function Zt(e) {
94
+ const t = bt(e), n = "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";
95
95
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 1254" role="img" aria-label="Pluno">
96
96
  <defs>
97
97
  <clipPath id="scribbleBoltClip">
@@ -104,7 +104,7 @@ function Xt(e) {
104
104
  </defs>
105
105
  <g filter="url(#scribbleBoltWobble)">
106
106
  <g clip-path="url(#scribbleBoltClip)">
107
- <path d="${Jt()}" fill="none" stroke="${t}" stroke-width="56" stroke-linecap="round" stroke-linejoin="round" opacity="0.9" transform="rotate(-14 627 600)"/>
107
+ <path d="${Qt()}" fill="none" stroke="${t}" stroke-width="56" stroke-linecap="round" stroke-linejoin="round" opacity="0.9" transform="rotate(-14 627 600)"/>
108
108
  </g>
109
109
  <path d="${n}" fill="none" stroke="${X}" stroke-width="18" stroke-linejoin="round"/>
110
110
  <g transform="rotate(-2 528 463)">
@@ -120,10 +120,10 @@ function Xt(e) {
120
120
  </g>
121
121
  </svg>`;
122
122
  }
123
- function Zt(e) {
124
- return `data:image/svg+xml,${encodeURIComponent(Xt(e))}`;
123
+ function Jt(e) {
124
+ return `data:image/svg+xml,${encodeURIComponent(Zt(e))}`;
125
125
  }
126
- function Jt() {
126
+ function Qt() {
127
127
  let n = "M 280 120", o = !1, a = 0;
128
128
  for (let i = 150; i <= 1170; i += 62) {
129
129
  const l = (a % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
@@ -131,8 +131,8 @@ function Jt() {
131
131
  }
132
132
  return n;
133
133
  }
134
- function Qt(e) {
135
- const t = bt(e), n = Pe(ae(t));
134
+ function en(e) {
135
+ const t = wt(e), n = Pe(ae(t));
136
136
  return n > 0.86 ? {
137
137
  top: "#ffffff",
138
138
  middle: "#f6f6f6",
@@ -156,21 +156,21 @@ function Qt(e) {
156
156
  inner: "#4b4b4b",
157
157
  shadow: "#000000"
158
158
  } : {
159
- top: R(t, 0.28, -0.03),
160
- middle: R(t, 0.08, 0.04),
161
- bottom: R(t, -0.1, 0.02),
162
- edgeStart: R(t, 0.08, 0.08),
163
- edgeMiddle: R(t, -0.08, 0.08),
164
- edgeEnd: R(t, -0.18, 0.05),
165
- glow: R(t, 0.32, -0.12),
166
- highlight: R(t, 0.38, -0.18),
167
- inner: R(t, 0.24, -0.1),
168
- shadow: R(t, -0.25, -0.08)
159
+ top: B(t, 0.28, -0.03),
160
+ middle: B(t, 0.08, 0.04),
161
+ bottom: B(t, -0.1, 0.02),
162
+ edgeStart: B(t, 0.08, 0.08),
163
+ edgeMiddle: B(t, -0.08, 0.08),
164
+ edgeEnd: B(t, -0.18, 0.05),
165
+ glow: B(t, 0.32, -0.12),
166
+ highlight: B(t, 0.38, -0.18),
167
+ inner: B(t, 0.24, -0.1),
168
+ shadow: B(t, -0.25, -0.08)
169
169
  };
170
170
  }
171
- function bt(e) {
171
+ function wt(e) {
172
172
  const t = e.trim();
173
- 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()}` : qt;
173
+ 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()}` : Kt;
174
174
  }
175
175
  function ae(e) {
176
176
  return [
@@ -194,7 +194,7 @@ function Ke(e, t) {
194
194
  const n = Pe(e), o = Pe(t), [a, i] = n > o ? [n, o] : [o, n];
195
195
  return (a + 0.05) / (i + 0.05);
196
196
  }
197
- function en(e, t, n) {
197
+ function tn(e, t, n) {
198
198
  const o = Ae(n);
199
199
  return [
200
200
  e[0] + (t[0] - e[0]) * o,
@@ -202,18 +202,18 @@ function en(e, t, n) {
202
202
  e[2] + (t[2] - e[2]) * o
203
203
  ];
204
204
  }
205
- function R(e, t, n) {
206
- const [o, a, i] = tn(ae(e));
207
- return Le(nn(o, Ae(a + n), Ae(i + t)));
205
+ function B(e, t, n) {
206
+ const [o, a, i] = nn(ae(e));
207
+ return Le(on(o, Ae(a + n), Ae(i + t)));
208
208
  }
209
- function tn([e, t, n]) {
210
- const o = e / 255, a = t / 255, i = n / 255, l = Math.max(o, a, i), p = Math.min(o, a, i), g = (l + p) / 2;
209
+ function nn([e, t, n]) {
210
+ const o = e / 255, a = t / 255, i = n / 255, l = Math.max(o, a, i), p = Math.min(o, a, i), c = (l + p) / 2;
211
211
  if (l === p)
212
- return [0, 0, g];
213
- const c = l - p, d = g > 0.5 ? c / (2 - l - p) : c / (l + p);
214
- return [(l === o ? (a - i) / c + (a < i ? 6 : 0) : l === a ? (i - o) / c + 2 : (o - a) / c + 4) / 6, d, g];
212
+ return [0, 0, c];
213
+ const d = l - p, s = c > 0.5 ? d / (2 - l - p) : d / (l + p);
214
+ return [(l === o ? (a - i) / d + (a < i ? 6 : 0) : l === a ? (i - o) / d + 2 : (o - a) / d + 4) / 6, s, c];
215
215
  }
216
- function nn(e, t, n) {
216
+ function on(e, t, n) {
217
217
  if (t === 0)
218
218
  return [n * 255, n * 255, n * 255];
219
219
  const o = n < 0.5 ? n * (1 + t) : n + t - n * t, a = 2 * n - o;
@@ -230,11 +230,11 @@ function ye(e, t, n) {
230
230
  function Ae(e) {
231
231
  return Math.max(0, Math.min(1, e));
232
232
  }
233
- const wt = "suggest_share_on_socials";
234
- function on(e) {
233
+ const _t = "suggest_share_on_socials";
234
+ function an(e) {
235
235
  for (let t = e.length - 1; t >= 0; t -= 1) {
236
236
  const n = e[t];
237
- if (n.role !== "tool" || n.toolName !== wt)
237
+ if (n.role !== "tool" || n.toolName !== _t)
238
238
  continue;
239
239
  const o = Ye(e, t, "assistant");
240
240
  if (!o)
@@ -248,8 +248,8 @@ function on(e) {
248
248
  }
249
249
  return null;
250
250
  }
251
- async function an(e) {
252
- const t = await rn(e);
251
+ async function rn(e) {
252
+ const t = await ln(e);
253
253
  if (!navigator.clipboard || typeof ClipboardItem > "u")
254
254
  throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
255
255
  await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
@@ -262,50 +262,50 @@ function Ye(e, t, n) {
262
262
  }
263
263
  return null;
264
264
  }
265
- async function rn(e) {
265
+ async function ln(e) {
266
266
  return await (await fetch(e)).blob();
267
267
  }
268
- const ln = "https://app.pluno.ai", pn = "/api/product-agent/embed/active-users", sn = 1800, dn = 15e3, cn = 250, un = 1e3, gn = 3e4;
269
- function hn(e, t = {}) {
268
+ const pn = "https://app.pluno.ai", sn = "/api/product-agent/embed/active-users", dn = 1800, cn = 15e3, un = 250, gn = 1e3, hn = 3e4;
269
+ function mn(e, t = {}) {
270
270
  let n = !1, o = null, a = null, i = null;
271
271
  const l = () => {
272
272
  i !== null && (window.clearInterval(i), i = null);
273
- }, p = (d) => {
273
+ }, p = (s) => {
274
274
  n || (a !== null && window.clearTimeout(a), a = window.setTimeout(() => {
275
- c();
276
- }, bn(d)));
277
- }, g = (d) => {
275
+ d();
276
+ }, wn(s)));
277
+ }, c = (s) => {
278
278
  if (l(), o === null) {
279
- o = d, e(d);
279
+ o = s, e(s);
280
280
  return;
281
281
  }
282
- const f = o, y = performance.now();
282
+ const f = o, v = performance.now();
283
283
  i = window.setInterval(() => {
284
284
  if (n) {
285
285
  l();
286
286
  return;
287
287
  }
288
- const x = Math.min(1, (performance.now() - y) / sn);
289
- o = Math.round(f + (d - f) * wn(x)), e(o), x >= 1 && (o = d, e(d), l());
290
- }, cn);
291
- }, c = async () => {
288
+ const x = Math.min(1, (performance.now() - v) / dn);
289
+ o = Math.round(f + (s - f) * _n(x)), e(o), x >= 1 && (o = s, e(s), l());
290
+ }, un);
291
+ }, d = async () => {
292
292
  try {
293
- const d = await mn(t);
293
+ const s = await fn(t);
294
294
  if (n)
295
295
  return;
296
- g(d.count), p(d.refreshAfterMs);
296
+ c(s.count), p(s.refreshAfterMs);
297
297
  } catch {
298
- p(dn);
298
+ p(cn);
299
299
  }
300
300
  };
301
- return c(), () => {
301
+ return d(), () => {
302
302
  n = !0, a !== null && window.clearTimeout(a), l();
303
303
  };
304
304
  }
305
- async function mn(e) {
305
+ async function fn(e) {
306
306
  if (e.loader)
307
307
  return e.loader();
308
- const n = await (e.fetcher ?? fetch)(new URL(pn, fn(e.backendUrl ?? ln)).toString(), {
308
+ const n = await (e.fetcher ?? fetch)(new URL(sn, bn(e.backendUrl ?? pn)).toString(), {
309
309
  cache: "no-store",
310
310
  credentials: "omit"
311
311
  });
@@ -319,16 +319,16 @@ async function mn(e) {
319
319
  function Xe(e) {
320
320
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
321
321
  }
322
- function fn(e) {
323
- return e.endsWith("/") ? e : `${e}/`;
324
- }
325
322
  function bn(e) {
326
- return Math.min(gn, Math.max(un, e));
323
+ return e.endsWith("/") ? e : `${e}/`;
327
324
  }
328
325
  function wn(e) {
326
+ return Math.min(hn, Math.max(gn, e));
327
+ }
328
+ function _n(e) {
329
329
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
330
330
  }
331
- const _t = 100, _n = "product-agent:sdk-preview-socket-connect", xn = "product-agent:sdk-preview-socket-send", vn = "product-agent:sdk-preview-socket-close", yn = "product-agent:sdk-preview-socket-open", Cn = "product-agent:sdk-preview-socket-message", En = "product-agent:sdk-preview-socket-error", Sn = "product-agent:sdk-preview-socket-closed", Ze = "product-agent:sdk-preview-socket-id", kn = "product-agent:preview-diagnostic", xt = "pluno.productAgent.sharePromptsDisabled", ue = 10, Ln = 10 * 1024 * 1024, Pn = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif", "application/pdf"]), B = {
331
+ const xt = 100, xn = "product-agent:sdk-preview-socket-connect", vn = "product-agent:sdk-preview-socket-send", yn = "product-agent:sdk-preview-socket-close", Cn = "product-agent:sdk-preview-socket-open", En = "product-agent:sdk-preview-socket-message", Sn = "product-agent:sdk-preview-socket-error", kn = "product-agent:sdk-preview-socket-closed", Ze = "product-agent:sdk-preview-socket-id", Ln = "product-agent:preview-diagnostic", vt = "pluno.productAgent.sharePromptsDisabled", ue = 10, Pn = 10 * 1024 * 1024, An = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif", "application/pdf"]), U = {
332
332
  launcherLabel: "Ask for anything...",
333
333
  accentColor: "#7c3aed",
334
334
  colorScheme: "light",
@@ -336,19 +336,19 @@ const _t = 100, _n = "product-agent:sdk-preview-socket-connect", xn = "product-a
336
336
  scribbleStyle: !1,
337
337
  position: "bottom-right",
338
338
  movableLauncher: !1
339
- }, Je = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 36"><g><ellipse cx="17.5" cy="24.5" rx="2.4" ry="3" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.5 27 C20.5 12, 7.5 2.5, 6 18.5" fill="none" stroke="%232c2a1e" stroke-width="2.5" stroke-linecap="round"/></g><g transform="translate(26 0)"><ellipse cx="17.9" cy="24.1" rx="2.5" ry="2.8" fill="none" stroke="%232c2a1e" stroke-width="1.5" opacity="0.8"/><path d="M18.9 26.4 C21.2 13, 8.6 3.6, 6.9 17.4" fill="none" stroke="%232c2a1e" stroke-width="2.35" stroke-linecap="round"/></g><g transform="translate(52 0)"><ellipse cx="17.1" cy="24.9" rx="2.2" ry="3.1" fill="none" stroke="%232c2a1e" stroke-width="1.7" opacity="0.8"/><path d="M18.1 27.5 C19.9 10.4, 6.4 2, 5.6 19.2" fill="none" stroke="%232c2a1e" stroke-width="2.6" stroke-linecap="round"/></g><g transform="translate(78 0)"><ellipse cx="17.6" cy="24.4" rx="2.4" ry="2.9" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1" fill="none" stroke="%232c2a1e" stroke-width="2.45" stroke-linecap="round"/></g></svg>', An = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Qe = "pluno-pa-scribble-font", vt = 190, yt = 41, Nn = 48, Tn = 420, In = 520, Dn = 0.24, Mn = 680, Rn = 800, On = 0.76, N = 8, Ne = 50, Bn = "http://www.w3.org/2000/svg", Fn = 11, Un = 13, zn = 4, Gn = 10, $n = 40, Hn = "movable-launcher-position-v2", Ct = "pluno-pa-widget-styles", Et = "data-pluno-pa-widget-styles";
339
+ }, Je = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 36"><g><ellipse cx="17.5" cy="24.5" rx="2.4" ry="3" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.5 27 C20.5 12, 7.5 2.5, 6 18.5" fill="none" stroke="%232c2a1e" stroke-width="2.5" stroke-linecap="round"/></g><g transform="translate(26 0)"><ellipse cx="17.9" cy="24.1" rx="2.5" ry="2.8" fill="none" stroke="%232c2a1e" stroke-width="1.5" opacity="0.8"/><path d="M18.9 26.4 C21.2 13, 8.6 3.6, 6.9 17.4" fill="none" stroke="%232c2a1e" stroke-width="2.35" stroke-linecap="round"/></g><g transform="translate(52 0)"><ellipse cx="17.1" cy="24.9" rx="2.2" ry="3.1" fill="none" stroke="%232c2a1e" stroke-width="1.7" opacity="0.8"/><path d="M18.1 27.5 C19.9 10.4, 6.4 2, 5.6 19.2" fill="none" stroke="%232c2a1e" stroke-width="2.6" stroke-linecap="round"/></g><g transform="translate(78 0)"><ellipse cx="17.6" cy="24.4" rx="2.4" ry="2.9" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1" fill="none" stroke="%232c2a1e" stroke-width="2.45" stroke-linecap="round"/></g></svg>', Nn = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Qe = "pluno-pa-scribble-font", yt = 190, Ct = 41, Tn = 48, Dn = 420, In = 520, Mn = 0.24, Rn = 680, On = 800, Bn = 0.76, D = 8, Ne = 50, Fn = "http://www.w3.org/2000/svg", Un = 11, zn = 13, et = 4, Gn = 10, $n = 40, Hn = "movable-launcher-position-v2", Et = "pluno-pa-widget-styles", St = "data-pluno-pa-widget-styles";
340
340
  function Wn(e) {
341
- return (t) => new F(t, e);
341
+ return (t) => new z(t, e);
342
342
  }
343
343
  async function Vn(e = {}) {
344
344
  const t = {
345
- launcherLabel: e.launcherLabel ?? B.launcherLabel,
346
- accentColor: e.accentColor ?? B.accentColor,
347
- colorScheme: e.colorScheme ?? B.colorScheme,
348
- fontFamily: e.fontFamily ?? B.fontFamily,
349
- scribbleStyle: e.scribbleStyle ?? B.scribbleStyle,
350
- position: e.position ?? B.position,
351
- movableLauncher: e.movableLauncher ?? B.movableLauncher,
345
+ launcherLabel: e.launcherLabel ?? U.launcherLabel,
346
+ accentColor: e.accentColor ?? U.accentColor,
347
+ colorScheme: e.colorScheme ?? U.colorScheme,
348
+ fontFamily: e.fontFamily ?? U.fontFamily,
349
+ scribbleStyle: e.scribbleStyle ?? U.scribbleStyle,
350
+ position: e.position ?? U.position,
351
+ movableLauncher: e.movableLauncher ?? U.movableLauncher,
352
352
  token: e.token,
353
353
  tokenProvider: e.tokenProvider,
354
354
  tokenEndpoint: e.tokenEndpoint,
@@ -385,10 +385,10 @@ async function Vn(e = {}) {
385
385
  n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget");
386
386
  const o = n.attachShadow({ mode: "open" }), a = document.createElement("div");
387
387
  a.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, a.setAttribute("data-pluno-product-agent-ui-root", "widget");
388
- let i = et(t.accentColor, t.scribbleStyle);
388
+ let i = tt(t.accentColor, t.scribbleStyle);
389
389
  eo(a, t.launcherLabel, i, t.movableLauncher), o.appendChild(a);
390
390
  const l = await Wo(), p = l.ownerDocument;
391
- l.appendChild(n), a.classList.add(`pluno-pa-widget--${t.colorScheme}`), ut(o, t.accentColor), tt(a, i, {
391
+ l.appendChild(n), a.classList.add(`pluno-pa-widget--${t.colorScheme}`), gt(o, t.accentColor), nt(a, i, {
392
392
  accentColor: t.accentColor,
393
393
  colorScheme: t.colorScheme,
394
394
  fontFamily: t.fontFamily,
@@ -399,18 +399,18 @@ async function Vn(e = {}) {
399
399
  fontFamily: t.fontFamily,
400
400
  cssAccent: a.style.getPropertyValue("--pluno-pa-accent")
401
401
  });
402
- const g = a.querySelector(".pluno-pa-widget__launcher"), c = a.querySelector(".pluno-pa-widget__launcher-drag-handle"), d = a.querySelector(".pluno-pa-widget__launcher-input"), f = a.querySelector(".pluno-pa-widget__panel"), y = a.querySelector(".pluno-pa-widget__close"), x = a.querySelector(".pluno-pa-widget__composer"), E = a.querySelector(".pluno-pa-widget__attachment-error"), h = a.querySelector(".pluno-pa-widget__billing-status"), b = a.querySelector(".pluno-pa-widget__attachments"), s = a.querySelector(".pluno-pa-widget__input"), v = a.querySelector(".pluno-pa-widget__send"), $ = a.querySelector(".pluno-pa-widget__new-chat"), U = a.querySelector(".pluno-pa-widget__active-users-counter"), m = a.querySelector(".pluno-pa-widget__timeline");
403
- if (!g || !d || !f || !y || !x || !E || !h || !b || !s || !v || !$ || !U || !m)
402
+ const c = a.querySelector(".pluno-pa-widget__launcher"), d = a.querySelector(".pluno-pa-widget__launcher-drag-handle"), s = a.querySelector(".pluno-pa-widget__launcher-input"), f = a.querySelector(".pluno-pa-widget__panel"), v = a.querySelector(".pluno-pa-widget__close"), x = a.querySelector(".pluno-pa-widget__composer"), S = a.querySelector(".pluno-pa-widget__attachment-error"), y = a.querySelector(".pluno-pa-widget__billing-status"), _ = a.querySelector(".pluno-pa-widget__attachments"), g = a.querySelector(".pluno-pa-widget__input"), h = a.querySelector(".pluno-pa-widget__send"), P = a.querySelector(".pluno-pa-widget__new-chat"), E = a.querySelector(".pluno-pa-widget__active-users-counter"), m = a.querySelector(".pluno-pa-widget__timeline");
403
+ if (!c || !s || !f || !v || !x || !S || !y || !_ || !g || !h || !P || !E || !m)
404
404
  throw new Error("Failed to mount Pluno widget");
405
- if (t.movableLauncher && !c)
405
+ if (t.movableLauncher && !d)
406
406
  throw new Error("Failed to mount Pluno widget drag handle");
407
- at(d), at(s);
408
- let w = [], C = null;
409
- const S = () => {
410
- go(b, w, (r) => {
411
- w = w.filter((u, L) => L !== r), S(), A(_.getState()), M();
407
+ it(s), it(g);
408
+ let b = [], C = null;
409
+ const k = () => {
410
+ go(_, b, (r) => {
411
+ b = b.filter((u, A) => A !== r), k(), T(w.getState()), O();
412
412
  });
413
- }, T = t.loginRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
413
+ }, I = t.loginRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
414
414
  if (!t.tokenEndpoint)
415
415
  throw new Error("Pluno widget requires token or tokenEndpoint");
416
416
  const r = await fetch(t.tokenEndpoint, {
@@ -425,15 +425,15 @@ async function Vn(e = {}) {
425
425
  if (!u.token)
426
426
  throw new Error("Pluno token endpoint did not return a token");
427
427
  return u.token;
428
- }), D = window.fetch.bind(window);
429
- let _;
430
- _ = await jt.init({
428
+ }), R = window.fetch.bind(window);
429
+ let w;
430
+ w = await qt.init({
431
431
  token: t.token,
432
- tokenProvider: T,
432
+ tokenProvider: I,
433
433
  backendUrl: t.backendUrl,
434
434
  metadata: () => ({
435
435
  ...t.metadata ?? {},
436
- ...!_.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
436
+ ...!w.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
437
437
  }),
438
438
  initialStarterPrompts: t.initialStarterPrompts,
439
439
  clientId: t.clientId,
@@ -443,31 +443,31 @@ async function Vn(e = {}) {
443
443
  autoConnect: t.loginRequired ? !1 : void 0
444
444
  });
445
445
  const H = Vo(t), ge = new Set(H.openToolGroupKeys), j = new Set(H.seenShareCandidateIds), ie = new Set(j);
446
- let he = H.sharePromptsDisabled || await jo(t), O = t.movableLauncher ? H.launcherPosition : null, Oe = O !== null, z = null, me = !1;
447
- const Ft = () => {
448
- me || typeof document > "u" || (ut(o, t.accentColor), n.isConnected || p.body?.appendChild(n));
449
- }, Be = new MutationObserver(Ft);
446
+ let he = H.sharePromptsDisabled || await jo(t), F = t.movableLauncher ? H.launcherPosition : null, Oe = F !== null, G = null, me = !1;
447
+ const Ut = () => {
448
+ me || typeof document > "u" || (gt(o, t.accentColor), n.isConnected || p.body?.appendChild(n));
449
+ }, Be = new MutationObserver(Ut);
450
450
  Be.observe(p.documentElement, { childList: !0, subtree: !0 });
451
451
  const fe = (r = !0) => {
452
452
  const u = Te(a, r);
453
- return nt(
453
+ return ot(
454
454
  a,
455
- O ?? Kn(a, t.position, u),
455
+ F ?? Kn(a, t.position, u),
456
456
  u
457
457
  );
458
- }, I = () => {
458
+ }, M = () => {
459
459
  Ko(t, {
460
460
  isOpen: a.classList.contains("pluno-pa-widget--open"),
461
- composerValue: s.value,
461
+ composerValue: g.value,
462
462
  openToolGroupKeys: [...ge],
463
- launcherPosition: Oe ? O : null,
464
- seenShareCandidateIds: [...j].slice(-_t),
463
+ launcherPosition: Oe ? F : null,
464
+ seenShareCandidateIds: [...j].slice(-xt),
465
465
  sharePromptsDisabled: he
466
466
  });
467
467
  }, W = (r, u = {}) => {
468
468
  Qn(r, {
469
469
  debugVersion: Hn,
470
- launcherPosition: O,
470
+ launcherPosition: F,
471
471
  rootClasses: a.className,
472
472
  rootStyle: {
473
473
  left: a.style.left,
@@ -476,15 +476,15 @@ async function Vn(e = {}) {
476
476
  bottom: a.style.bottom
477
477
  },
478
478
  rootRect: Ce(a),
479
- launcherRect: Ce(g),
479
+ launcherRect: Ce(c),
480
480
  panelRect: Ce(f),
481
481
  viewport: J(),
482
482
  panelHidden: f.hidden,
483
- closeHidden: y.hidden,
483
+ closeHidden: v.hidden,
484
484
  ...u
485
485
  });
486
486
  }, re = (r = !0) => {
487
- if (!O)
487
+ if (!F)
488
488
  return pe(a, null), fe(r);
489
489
  const u = fe(r);
490
490
  return pe(a, u), W("Applied stored closed launcher position", { visibleLauncherPosition: u }), u;
@@ -500,22 +500,23 @@ async function Vn(e = {}) {
500
500
  }, Ue = () => {
501
501
  const r = re();
502
502
  if (a.classList.contains("pluno-pa-widget--open") || a.classList.contains("pluno-pa-widget--closing")) {
503
- const u = ot(a, r, t.position);
503
+ const u = at(a, r, t.position);
504
504
  Fe(u, r), W("Applied open panel position after viewport resize", { openPanelPosition: u });
505
- } else O && W("Applied visible launcher position after viewport resize", { visibleLauncherPosition: r });
505
+ } else F && W("Applied visible launcher position after viewport resize", { visibleLauncherPosition: r });
506
506
  };
507
507
  let ze = () => {
508
508
  };
509
- window.addEventListener("resize", Ue), t.movableLauncher && c ? (re(), ze = qn({
509
+ window.addEventListener("resize", Ue), t.movableLauncher && d ? (re(), ze = qn({
510
510
  root: a,
511
- launcherDragHandle: c,
511
+ launcher: c,
512
+ launcherDragHandle: d,
512
513
  getPosition: () => fe(),
513
514
  setPosition: (r) => {
514
515
  const u = r;
515
- O = nt(a, r, Te(a)), pe(a, O), W("Dragging closed launcher", { requestedPosition: u });
516
+ F = ot(a, r, Te(a)), pe(a, F), W("Dragging closed launcher", { requestedPosition: u });
516
517
  },
517
518
  persist: () => {
518
- Oe = !0, I(), W("Persisted closed launcher drag position");
519
+ Oe = !0, M(), W("Persisted closed launcher drag position");
519
520
  }
520
521
  })) : pe(a, null);
521
522
  let be = !1;
@@ -524,68 +525,68 @@ async function Vn(e = {}) {
524
525
  be = !0;
525
526
  try {
526
527
  const r = await t.billingStatusLoader();
527
- rt(t.billingStatus, r, _.getState().lastErrorCode) && (t.billingStatus = r, ke(h, t.billingStatus, _.getState().lastErrorCode), M());
528
+ lt(t.billingStatus, r, w.getState().lastErrorCode) && (t.billingStatus = r, ke(y, t.billingStatus, w.getState().lastErrorCode), O());
528
529
  } finally {
529
530
  be = !1;
530
531
  }
531
532
  }
532
533
  }, q = (r = "", u = !0) => {
533
- Ge(), z !== null && (window.clearTimeout(z), z = null), f.hidden = !1, y.hidden = !1, a.classList.remove("pluno-pa-widget--closing");
534
- const L = re(), ne = ot(a, L, t.position);
535
- if (Fe(ne, L), W("Opening launcher at clamped open panel position", { openPanelPosition: ne, visibleLauncherPosition: L }), !u) {
536
- a.classList.add("pluno-pa-widget--open"), g.hidden = !0, r && (s.value = r, oe(s)), m.scrollTop = m.scrollHeight, s.focus(), s.setSelectionRange(s.value.length, s.value.length), I();
534
+ Ge(), G !== null && (window.clearTimeout(G), G = null), f.hidden = !1, v.hidden = !1, a.classList.remove("pluno-pa-widget--closing");
535
+ const A = re(), ne = at(a, A, t.position);
536
+ if (Fe(ne, A), W("Opening launcher at clamped open panel position", { openPanelPosition: ne, visibleLauncherPosition: A }), !u) {
537
+ a.classList.add("pluno-pa-widget--open"), c.hidden = !0, r && (g.value = r, oe(g)), m.scrollTop = m.scrollHeight, g.focus(), g.setSelectionRange(g.value.length, g.value.length), M();
537
538
  return;
538
539
  }
539
540
  window.requestAnimationFrame(() => {
540
- a.classList.add("pluno-pa-widget--open"), r && (s.value = r, oe(s)), m.scrollTop = m.scrollHeight, s.focus(), s.setSelectionRange(s.value.length, s.value.length), I(), z = window.setTimeout(() => {
541
- g.hidden = !0, m.scrollTop = m.scrollHeight;
541
+ a.classList.add("pluno-pa-widget--open"), r && (g.value = r, oe(g)), m.scrollTop = m.scrollHeight, g.focus(), g.setSelectionRange(g.value.length, g.value.length), M(), G = window.setTimeout(() => {
542
+ c.hidden = !0, m.scrollTop = m.scrollHeight;
542
543
  }, 220);
543
544
  });
544
- }, Ut = () => {
545
- z !== null && (window.clearTimeout(z), z = null), g.hidden = !1, O && (re(!1), W("Closing launcher at stored position")), a.classList.remove("pluno-pa-widget--open"), a.classList.add("pluno-pa-widget--closing"), I(), z = window.setTimeout(() => {
546
- f.hidden = !0, y.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
545
+ }, zt = () => {
546
+ G !== null && (window.clearTimeout(G), G = null), c.hidden = !1, F && (re(!1), W("Closing launcher at stored position")), a.classList.remove("pluno-pa-widget--open"), a.classList.add("pluno-pa-widget--closing"), M(), G = window.setTimeout(() => {
547
+ f.hidden = !0, v.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
547
548
  }, 220);
548
549
  };
549
- g.addEventListener("submit", (r) => {
550
- r.preventDefault(), q(d.value), d.value = "";
551
- }), c?.addEventListener("click", (r) => {
550
+ c.addEventListener("submit", (r) => {
551
+ r.preventDefault(), q(s.value), s.value = "";
552
+ }), d?.addEventListener("click", (r) => {
552
553
  r.preventDefault(), r.stopPropagation();
553
- }), g.addEventListener("click", (r) => {
554
- r.target !== d && (q(d.value), d.value = "");
555
- }), d.addEventListener("focus", () => {
556
- q(d.value), d.value = "";
557
- }), d.addEventListener("input", () => {
558
- if (!d.value)
554
+ }), c.addEventListener("click", (r) => {
555
+ r.target === s && !d || (q(s.value), s.value = "");
556
+ }), s.addEventListener("focus", () => {
557
+ q(s.value), s.value = "";
558
+ }), s.addEventListener("input", () => {
559
+ if (!s.value)
559
560
  return;
560
- const r = d.value;
561
- q(r), d.value = "";
562
- }), y.addEventListener("click", Ut);
563
- const M = () => {
564
- v.disabled = G(t.billingStatus) || !_.getState().isThinking && s.value.trim().length === 0 && w.length === 0;
561
+ const r = s.value;
562
+ q(r), s.value = "";
563
+ }), v.addEventListener("click", zt);
564
+ const O = () => {
565
+ h.disabled = $(t.billingStatus) || !w.getState().isThinking && g.value.trim().length === 0 && b.length === 0;
565
566
  };
566
- t.loginRequired && (d.readOnly = !0, d.placeholder = t.loginButtonLabel, s.placeholder = t.loginButtonLabel, x.hidden = !0), x.addEventListener("submit", (r) => {
567
+ t.loginRequired && (s.readOnly = !0, s.placeholder = t.loginButtonLabel, g.placeholder = t.loginButtonLabel, x.hidden = !0), x.addEventListener("submit", (r) => {
567
568
  if (r.preventDefault(), t.loginRequired) {
568
569
  t.onLoginClick?.();
569
570
  return;
570
571
  }
571
- G(t.billingStatus) || (w = Ee(_, s, w), S(), M());
572
+ $(t.billingStatus) || (b = Ee(w, g, b), k(), O());
572
573
  });
573
574
  let ee = 0;
574
- const zt = () => {
575
+ const Gt = () => {
575
576
  ee = 0, a.classList.remove("pluno-pa-widget--drag-over");
576
- }, Gt = (r) => {
577
- C !== null && window.clearTimeout(C), E.textContent = r, E.hidden = !1, C = window.setTimeout(() => {
578
- E.textContent = "", E.hidden = !0, C = null;
577
+ }, $t = (r) => {
578
+ C !== null && window.clearTimeout(C), S.textContent = r, S.hidden = !1, C = window.setTimeout(() => {
579
+ S.textContent = "", S.hidden = !0, C = null;
579
580
  }, 3e3);
580
- }, $t = () => {
581
- C !== null && (window.clearTimeout(C), C = null), E.textContent = "", E.hidden = !0;
582
- }, Ht = async (r) => {
581
+ }, Ht = () => {
582
+ C !== null && (window.clearTimeout(C), C = null), S.textContent = "", S.hidden = !0;
583
+ }, Wt = async (r) => {
583
584
  if (r.length === 0)
584
585
  return;
585
586
  const u = await bo(r);
586
- if (w.length + u.length > ue)
587
+ if (b.length + u.length > ue)
587
588
  throw new Error(`Attach up to ${ue} files per message.`);
588
- w = [...w, ...u], S(), $t(), M(), A(_.getState());
589
+ b = [...b, ...u], k(), Ht(), O(), T(w.getState());
589
590
  };
590
591
  a.addEventListener("dragenter", (r) => {
591
592
  !se(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), ee += 1, a.classList.add("pluno-pa-widget--drag-over"));
@@ -596,80 +597,80 @@ async function Vn(e = {}) {
596
597
  se(r.dataTransfer) && (r.stopPropagation(), ee = Math.max(0, ee - 1), ee === 0 && a.classList.remove("pluno-pa-widget--drag-over"));
597
598
  }), a.addEventListener("drop", (r) => {
598
599
  const u = r.dataTransfer;
599
- !se(u) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), zt(), Ht(u.files).catch((L) => {
600
- Gt(L instanceof Error ? L.message : "Failed to attach file"), V("web-sdk.widget", "Attachment failed", {
601
- message: L instanceof Error ? L.message : String(L)
600
+ !se(u) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Gt(), Wt(u.files).catch((A) => {
601
+ $t(A instanceof Error ? A.message : "Failed to attach file"), V("web-sdk.widget", "Attachment failed", {
602
+ message: A instanceof Error ? A.message : String(A)
602
603
  });
603
604
  }));
604
- }), v.addEventListener("click", () => {
605
+ }), h.addEventListener("click", () => {
605
606
  if (t.loginRequired) {
606
607
  t.onLoginClick?.();
607
608
  return;
608
609
  }
609
- if (_.getState().isThinking) {
610
- _.stop();
610
+ if (w.getState().isThinking) {
611
+ w.stop();
611
612
  return;
612
613
  }
613
- w = Ee(_, s, w), S(), M(), A(_.getState());
614
- }), $.addEventListener("click", () => {
615
- _.startNewSession(), ge.clear(), s.value = "", w = [], S(), oe(s), I(), M(), s.focus(), A(_.getState());
616
- }), s.addEventListener("input", () => {
617
- oe(s), I(), M(), A(_.getState());
618
- }), s.addEventListener("keydown", (r) => {
614
+ b = Ee(w, g, b), k(), O(), T(w.getState());
615
+ }), P.addEventListener("click", () => {
616
+ w.startNewSession(), ge.clear(), g.value = "", b = [], k(), oe(g), M(), O(), g.focus(), T(w.getState());
617
+ }), g.addEventListener("input", () => {
618
+ oe(g), M(), O(), T(w.getState());
619
+ }), g.addEventListener("keydown", (r) => {
619
620
  if (!(r.key !== "Enter" || r.shiftKey)) {
620
621
  if (r.preventDefault(), t.loginRequired) {
621
622
  t.onLoginClick?.();
622
623
  return;
623
624
  }
624
- w = Ee(_, s, w), S(), M(), A(_.getState());
625
+ b = Ee(w, g, b), k(), O(), T(w.getState());
625
626
  }
626
627
  }), a.addEventListener("click", (r) => {
627
- (r.target instanceof Element ? r.target : null)?.closest("a[href]") && I();
628
- }), H.composerValue && (s.value = H.composerValue, oe(s)), H.isOpen && q(s.value, !1);
628
+ (r.target instanceof Element ? r.target : null)?.closest("a[href]") && M();
629
+ }), H.composerValue && (g.value = H.composerValue, oe(g)), H.isOpen && q(g.value, !1);
629
630
  const $e = () => i;
630
- let we = _.getState().appearance !== null, le = null, te = null, K = null, He = _.getState().isThinking, Y = null, _e = null, We = () => {
631
+ let we = w.getState().appearance !== null, le = null, te = null, K = null, He = w.getState().isThinking, Y = null, _e = null, We = () => {
631
632
  };
632
- const Wt = !!t.socialPostDraftHandler, A = (r) => {
633
- if (Re(r.lastErrorCode) ? Y = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !G(t.billingStatus) && (Y = null), ke(h, t.billingStatus, Y), t.loginRequired) {
634
- No(m, v, $, $e, t.loginButtonLabel, t.onLoginClick);
633
+ const Vt = !!t.socialPostDraftHandler, T = (r) => {
634
+ if (Re(r.lastErrorCode) ? Y = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !$(t.billingStatus) && (Y = null), ke(y, t.billingStatus, Y), t.loginRequired) {
635
+ No(m, h, P, $e, t.loginButtonLabel, t.onLoginClick);
635
636
  return;
636
637
  }
637
638
  Ao(
638
639
  m,
639
- v,
640
- $,
641
- U,
640
+ h,
641
+ P,
642
+ E,
642
643
  r,
643
644
  _e,
644
- _e !== null && pt(r, s.value.trim().length > 0 || w.length > 0),
645
+ _e !== null && st(r, g.value.trim().length > 0 || b.length > 0),
645
646
  ge,
646
- I,
647
+ M,
647
648
  $e,
648
649
  (u) => {
649
- _.sendMessage(u);
650
+ w.sendMessage(u);
650
651
  },
651
- Wt && !he ? {
652
+ Vt && !he ? {
652
653
  dismissedCandidateIds: ie,
653
654
  draftingCandidateId: le,
654
655
  error: te,
655
656
  onSeen: (u) => {
656
- j.add(u.id), I();
657
+ j.add(u.id), M();
657
658
  },
658
659
  onDraft: (u) => {
659
- Vt(u);
660
+ jt(u);
660
661
  },
661
662
  onDismiss: (u) => {
662
- j.add(u.id), ie.add(u.id), I(), te = null, A(_.getState());
663
+ j.add(u.id), ie.add(u.id), M(), te = null, T(w.getState());
663
664
  },
664
665
  onDisable: (u) => {
665
- he = !0, j.add(u.id), ie.add(u.id), I(), qo(t, !0), te = null, A(_.getState());
666
+ he = !0, j.add(u.id), ie.add(u.id), M(), qo(t, !0), te = null, T(w.getState());
666
667
  }
667
668
  } : void 0
668
669
  );
669
670
  };
670
- return We = hn((r) => {
671
- _e = r, !me && pt(_.getState(), s.value.trim().length > 0 || w.length > 0) && A(_.getState());
672
- }, { backendUrl: t.backendUrl, fetcher: D, loader: t.activeUsersLoader }), _.on("state", (r) => {
671
+ return We = mn((r) => {
672
+ _e = r, !me && st(w.getState(), g.value.trim().length > 0 || b.length > 0) && T(w.getState());
673
+ }, { backendUrl: t.backendUrl, fetcher: R, loader: t.activeUsersLoader }), w.on("state", (r) => {
673
674
  const u = He && !r.isThinking;
674
675
  He = r.isThinking, r.appearance ? (we = !0, V("web-sdk.widget", "Agent state supplied appearance", {
675
676
  appearance: r.appearance
@@ -677,37 +678,37 @@ async function Vn(e = {}) {
677
678
  fallbackAccentColor: t.accentColor,
678
679
  fallbackColorScheme: t.colorScheme,
679
680
  fallbackFontFamily: t.fontFamily
680
- }), xe({}, "agent.state.appearance-cleared")), A(r), M(), u && Ge();
681
- }), A(_.getState()), M(), {
682
- agent: _,
681
+ }), xe({}, "agent.state.appearance-cleared")), T(r), O(), u && Ge();
682
+ }), T(w.getState()), O(), {
683
+ agent: w,
683
684
  updateAppearance: (r) => {
684
685
  r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), xe(r, "widgetHandle.updateAppearance");
685
686
  },
686
687
  updateBillingStatus: (r) => {
687
688
  const u = r ?? null;
688
- rt(t.billingStatus, u, Y) && (t.billingStatus = u, t.billingStatus?.creditsUsed !== null && !G(t.billingStatus) && (Y = null), ke(
689
+ lt(t.billingStatus, u, Y) && (t.billingStatus = u, t.billingStatus?.creditsUsed !== null && !$(t.billingStatus) && (Y = null), ke(
689
690
  a.querySelector(".pluno-pa-widget__billing-status"),
690
691
  t.billingStatus,
691
692
  Y
692
- ), M());
693
+ ), O());
693
694
  },
694
695
  openPanel: () => {
695
- q(s.value, !1);
696
+ q(g.value, !1);
696
697
  },
697
698
  destroy: () => {
698
- me = !0, Be.disconnect(), window.removeEventListener("resize", Ue), ze(), C !== null && window.clearTimeout(C), We(), K?.remove(), _.destroy(), n.remove();
699
+ me = !0, Be.disconnect(), window.removeEventListener("resize", Ue), ze(), C !== null && window.clearTimeout(C), We(), K?.remove(), w.destroy(), n.remove();
699
700
  }
700
701
  };
701
- async function Vt(r) {
702
+ async function jt(r) {
702
703
  if (!le) {
703
- le = r.id, te = null, A(_.getState());
704
+ le = r.id, te = null, T(w.getState());
704
705
  try {
705
706
  if (!t.socialPostDraftHandler)
706
707
  throw new Error("Social post drafting is not available here.");
707
708
  const u = await t.socialPostDraftHandler(r);
708
709
  if (!u.linkedinPost || !u.xPost)
709
710
  throw new Error("Pluno did not return a complete social post draft.");
710
- j.add(r.id), ie.add(r.id), I(), K?.remove(), K = Do(u, {
711
+ j.add(r.id), ie.add(r.id), M(), K?.remove(), K = Io(u, {
711
712
  socialPostRewardsUrl: t.socialPostRewardsUrl,
712
713
  onClose: () => {
713
714
  K?.remove(), K = null;
@@ -716,21 +717,21 @@ async function Vn(e = {}) {
716
717
  } catch (u) {
717
718
  te = u instanceof Error ? u.message : "Could not draft social post.";
718
719
  } finally {
719
- le = null, A(_.getState());
720
+ le = null, T(w.getState());
720
721
  }
721
722
  }
722
723
  }
723
724
  function xe(r, u) {
724
- const L = r.accentColor ?? t.accentColor, ne = r.colorScheme ?? t.colorScheme, Ve = r.fontFamily ?? t.fontFamily, ve = r.scribbleStyle ?? t.scribbleStyle;
725
- i = et(L, ve), tt(a, i, {
726
- accentColor: L,
725
+ const A = r.accentColor ?? t.accentColor, ne = r.colorScheme ?? t.colorScheme, Ve = r.fontFamily ?? t.fontFamily, ve = r.scribbleStyle ?? t.scribbleStyle;
726
+ i = tt(A, ve), nt(a, i, {
727
+ accentColor: A,
727
728
  colorScheme: ne,
728
729
  fontFamily: Ve,
729
730
  scribbleStyle: ve
730
731
  }), V("web-sdk.widget", "Updated widget appearance", {
731
732
  source: u,
732
733
  inputAppearance: r,
733
- appliedAccentColor: L,
734
+ appliedAccentColor: A,
734
735
  appliedColorScheme: ne,
735
736
  appliedFontFamily: Ve,
736
737
  appliedScribbleStyle: ve,
@@ -738,13 +739,13 @@ async function Vn(e = {}) {
738
739
  });
739
740
  }
740
741
  }
741
- function et(e, t) {
742
- return t ? Zt(e) : Yt(e);
742
+ function tt(e, t) {
743
+ return t ? Jt(e) : Xt(e);
743
744
  }
744
- function tt(e, t, n) {
745
+ function nt(e, t, n) {
745
746
  e.classList.toggle("pluno-pa-widget--dark", n.colorScheme === "dark"), e.classList.toggle("pluno-pa-widget--light", n.colorScheme !== "dark"), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
746
- const o = n.scribbleStyle ? ft(n.accentColor) : n.accentColor;
747
- e.style.setProperty("--pluno-pa-accent", o), e.style.fontFamily = n.scribbleStyle ? An : n.fontFamily, n.scribbleStyle && jn(e.ownerDocument);
747
+ const o = n.scribbleStyle ? bt(n.accentColor) : n.accentColor;
748
+ e.style.setProperty("--pluno-pa-accent", o), e.style.fontFamily = n.scribbleStyle ? Nn : n.fontFamily, n.scribbleStyle && jn(e.ownerDocument);
748
749
  const a = Array.from(e.querySelectorAll(".pluno-pa-widget__character"));
749
750
  for (const i of a)
750
751
  i.src = t;
@@ -763,54 +764,60 @@ function jn(e) {
763
764
  }
764
765
  function qn({
765
766
  root: e,
766
- launcherDragHandle: t,
767
- getPosition: n,
768
- setPosition: o,
769
- persist: a
767
+ launcher: t,
768
+ launcherDragHandle: n,
769
+ getPosition: o,
770
+ setPosition: a,
771
+ persist: i
770
772
  }) {
771
- let i = null, l = null, p = null, g = !1;
772
- const c = () => {
773
- i = null, l = null, p = null, g = !1, e.classList.remove("pluno-pa-widget--dragging");
774
- }, d = (h) => {
775
- e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), i = h.pointerId, l = { x: h.clientX, y: h.clientY }, p = n(), g = !1, t.setPointerCapture?.(h.pointerId));
776
- }, f = (h) => {
777
- if (i !== h.pointerId || !l || !p)
773
+ let l = null, p = null, c = null, d = !1, s = null;
774
+ const f = () => {
775
+ l = null, p = null, c = null, d = !1, e.classList.remove("pluno-pa-widget--dragging");
776
+ }, v = (h) => {
777
+ 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 = o(), d = !1, t.setPointerCapture?.(h.pointerId));
778
+ }, x = (h) => {
779
+ if (l !== h.pointerId || !p || !c)
778
780
  return;
779
781
  h.preventDefault();
780
- const b = h.clientX - l.x, s = h.clientY - l.y;
781
- !g && Math.hypot(b, s) < zn || (g = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + b, y: p.y + s }));
782
+ const P = h.clientX - p.x, E = h.clientY - p.y;
783
+ !d && Math.hypot(P, E) < et || (d = !0, e.classList.add("pluno-pa-widget--dragging"), a({ x: c.x + P, y: c.y + E }));
784
+ }, S = (h) => {
785
+ l === h.pointerId && (h.preventDefault(), h.stopPropagation(), d && (s = { x: h.clientX, y: h.clientY }, i()), f());
782
786
  }, y = (h) => {
783
- i === h.pointerId && (h.preventDefault(), h.stopPropagation(), g && a(), c());
784
- }, x = (h) => {
785
- i === h.pointerId && (h.preventDefault(), c());
786
- }, E = (h) => {
787
+ l === h.pointerId && (h.preventDefault(), f());
788
+ }, _ = (h) => {
789
+ if (!s)
790
+ return;
791
+ const P = Math.hypot(h.clientX - s.x, h.clientY - s.y) <= et;
792
+ s = null, P && (h.preventDefault(), h.stopPropagation());
793
+ }, g = (h) => {
787
794
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
788
795
  return;
789
- const b = h.shiftKey ? $n : Gn, s = n();
790
- let v = null;
791
- h.key === "ArrowUp" ? v = { x: s.x, y: s.y - b } : h.key === "ArrowDown" ? v = { x: s.x, y: s.y + b } : h.key === "ArrowLeft" ? v = { x: s.x - b, y: s.y } : h.key === "ArrowRight" && (v = { x: s.x + b, y: s.y }), v && (h.preventDefault(), h.stopPropagation(), o(v), a());
796
+ const P = h.shiftKey ? $n : Gn, E = o();
797
+ let m = null;
798
+ h.key === "ArrowUp" ? m = { x: E.x, y: E.y - P } : h.key === "ArrowDown" ? m = { x: E.x, y: E.y + P } : h.key === "ArrowLeft" ? m = { x: E.x - P, y: E.y } : h.key === "ArrowRight" && (m = { x: E.x + P, y: E.y }), m && (h.preventDefault(), h.stopPropagation(), a(m), i());
792
799
  };
793
- return t.addEventListener("pointerdown", d), t.addEventListener("pointermove", f), t.addEventListener("pointerup", y), t.addEventListener("pointercancel", x), t.addEventListener("keydown", E), () => {
794
- t.removeEventListener("pointerdown", d), t.removeEventListener("pointermove", f), t.removeEventListener("pointerup", y), t.removeEventListener("pointercancel", x), t.removeEventListener("keydown", E);
800
+ return t.addEventListener("pointerdown", v), t.addEventListener("pointermove", x), t.addEventListener("pointerup", S), t.addEventListener("pointercancel", y), t.addEventListener("click", _, !0), n.addEventListener("keydown", g), () => {
801
+ t.removeEventListener("pointerdown", v), t.removeEventListener("pointermove", x), t.removeEventListener("pointerup", S), t.removeEventListener("pointercancel", y), t.removeEventListener("click", _, !0), n.removeEventListener("keydown", g);
795
802
  };
796
803
  }
797
804
  function Te(e, t = !0) {
798
805
  const n = J(), o = e.getBoundingClientRect(), a = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
799
806
  return {
800
- width: t && a && o.width > 0 ? o.width : Math.min(vt, n.width - 36),
801
- height: t && a && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Nn : yt
807
+ width: t && a && o.width > 0 ? o.width : Math.min(yt, n.width - 36),
808
+ height: t && a && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Tn : Ct
802
809
  };
803
810
  }
804
- function St() {
811
+ function kt() {
805
812
  const e = J();
806
813
  return {
807
814
  width: Math.min(
808
- Z(e.width * Dn, Tn, In),
809
- e.width - N * 2
815
+ Z(e.width * Mn, Dn, In),
816
+ e.width - D * 2
810
817
  ),
811
818
  height: Math.min(
812
- Z(e.height * On, Mn, Rn),
813
- e.height - Ne - N
819
+ Z(e.height * Bn, Rn, On),
820
+ e.height - Ne - D
814
821
  )
815
822
  };
816
823
  }
@@ -827,31 +834,31 @@ function Kn(e, t, n) {
827
834
  y: l.height - 24 - n.height
828
835
  };
829
836
  }
830
- function nt(e, t, n) {
831
- const o = J(), a = N + Yn(e);
837
+ function ot(e, t, n) {
838
+ const o = J(), a = D + Yn(e);
832
839
  return {
833
- x: Z(t.x, N, Math.max(N, o.width - n.width - N)),
834
- y: Z(t.y, a, Math.max(a, o.height - n.height - N))
840
+ x: Z(t.x, D, Math.max(D, o.width - n.width - D)),
841
+ y: Z(t.y, a, Math.max(a, o.height - n.height - D))
835
842
  };
836
843
  }
837
844
  function Yn(e) {
838
- return e.classList.contains("pluno-pa-widget--scribble") ? Un : Fn;
845
+ return e.classList.contains("pluno-pa-widget--scribble") ? zn : Un;
839
846
  }
840
- function ot(e, t, n) {
841
- const o = Te(e), a = St(), i = {
847
+ function at(e, t, n) {
848
+ const o = Te(e), a = kt(), i = {
842
849
  x: n === "bottom-left" ? t.x : t.x + o.width - a.width,
843
850
  y: t.y + o.height - a.height
844
851
  };
845
852
  return Xn(i);
846
853
  }
847
854
  function Xn(e) {
848
- const t = J(), n = St();
855
+ const t = J(), n = kt();
849
856
  return {
850
- x: Z(e.x, N, Math.max(N, t.width - n.width - N)),
857
+ x: Z(e.x, D, Math.max(D, t.width - n.width - D)),
851
858
  y: Z(
852
859
  e.y,
853
860
  Ne,
854
- Math.max(Ne, t.height - n.height - N)
861
+ Math.max(Ne, t.height - n.height - D)
855
862
  )
856
863
  };
857
864
  }
@@ -870,8 +877,8 @@ function Jn(e) {
870
877
  }
871
878
  function J() {
872
879
  return {
873
- width: window.innerWidth || document.documentElement.clientWidth || vt + N * 2,
874
- height: window.innerHeight || document.documentElement.clientHeight || yt + N * 2
880
+ width: window.innerWidth || document.documentElement.clientWidth || yt + D * 2,
881
+ height: window.innerHeight || document.documentElement.clientHeight || Ct + D * 2
875
882
  };
876
883
  }
877
884
  function Ce(e) {
@@ -895,7 +902,7 @@ function V(e, t, n) {
895
902
  message: t,
896
903
  details: n
897
904
  }, i = o.__plunoProductAgentDiagnostics__ ?? [];
898
- i.push(a), i.length > 120 && i.splice(0, i.length - 120), o.__plunoProductAgentDiagnostics__ = i, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...i], window.dispatchEvent(new CustomEvent(kn, { detail: a }));
905
+ i.push(a), i.length > 120 && i.splice(0, i.length - 120), o.__plunoProductAgentDiagnostics__ = i, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...i], window.dispatchEvent(new CustomEvent(Ln, { detail: a }));
899
906
  }
900
907
  function Qn(e, t) {
901
908
  V("web-sdk.widget.position", e, t);
@@ -910,7 +917,7 @@ function oe(e) {
910
917
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
911
918
  }
912
919
  function eo(e, t, n, o) {
913
- e.appendChild(ro()), e.appendChild(to(t, n, o)), e.appendChild(Pt("pluno-pa-widget__close", "Close", lo(16), !0)), e.appendChild(no(n));
920
+ e.appendChild(ro()), e.appendChild(to(t, n, o)), e.appendChild(At("pluno-pa-widget__close", "Close", lo(16), !0)), e.appendChild(no(n));
914
921
  }
915
922
  function to(e, t, n) {
916
923
  const o = document.createElement("form");
@@ -918,7 +925,7 @@ function to(e, t, n) {
918
925
  const i = document.createElement("button");
919
926
  i.type = "button", i.className = "pluno-pa-widget__launcher-drag-handle", i.setAttribute("aria-label", "Move Pluno launcher"), i.title = "Move Pluno launcher", o.appendChild(i);
920
927
  }
921
- o.appendChild(Lt("pluno-pa-widget__character--launcher", t));
928
+ o.appendChild(Pt("pluno-pa-widget__character--launcher", t));
922
929
  const a = document.createElement("input");
923
930
  return a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder = e, a.setAttribute("aria-label", e), o.appendChild(a), o;
924
931
  }
@@ -930,7 +937,7 @@ function no(e) {
930
937
  const o = document.createElement("main");
931
938
  o.className = "pluno-pa-widget__timeline", o.appendChild(ao(e)), n.appendChild(o);
932
939
  const a = document.createElement("div");
933
- return a.className = "pluno-pa-widget__active-users-counter", a.hidden = !0, n.appendChild(a), n.appendChild(Pt("pluno-pa-widget__new-chat", "New chat", po(), !0)), t.appendChild(n), t.appendChild(oo()), t;
940
+ return a.className = "pluno-pa-widget__active-users-counter", a.hidden = !0, n.appendChild(a), n.appendChild(At("pluno-pa-widget__new-chat", "New chat", po(), !0)), t.appendChild(n), t.appendChild(oo()), t;
934
941
  }
935
942
  function oo() {
936
943
  const e = document.createElement("form");
@@ -946,19 +953,19 @@ function oo() {
946
953
  const i = document.createElement("textarea");
947
954
  i.className = "pluno-pa-widget__input", i.rows = 1, i.placeholder = "Ask for anything...", a.appendChild(i);
948
955
  const l = document.createElement("button");
949
- l.type = "button", l.className = "pluno-pa-widget__send", l.setAttribute("aria-label", "Send"), l.appendChild(At()), a.appendChild(l), e.appendChild(a);
956
+ l.type = "button", l.className = "pluno-pa-widget__send", l.setAttribute("aria-label", "Send"), l.appendChild(Nt()), a.appendChild(l), e.appendChild(a);
950
957
  const p = document.createElement("div");
951
958
  p.className = "pluno-pa-widget__composer-meta";
952
- const g = document.createElement("a");
953
- g.className = "pluno-pa-widget__powered-by", g.href = "https://pluno.ai", g.target = "_blank", g.rel = "noopener noreferrer", g.textContent = "Powered by Pluno.ai.", p.appendChild(g);
954
- const c = document.createElement("span");
955
- return c.className = "pluno-pa-widget__ai-disclaimer", c.textContent = "AI can make mistakes. Verify outputs.", p.appendChild(c), e.appendChild(p), e;
959
+ const c = document.createElement("a");
960
+ c.className = "pluno-pa-widget__powered-by", c.href = "https://pluno.ai", c.target = "_blank", c.rel = "noopener noreferrer", c.textContent = "Powered by Pluno.ai.", p.appendChild(c);
961
+ const d = document.createElement("span");
962
+ return d.className = "pluno-pa-widget__ai-disclaimer", d.textContent = "AI can make mistakes. Verify outputs.", p.appendChild(d), e.appendChild(p), e;
956
963
  }
957
964
  function ao(e) {
958
965
  const t = document.createElement("div");
959
- return t.className = "pluno-pa-widget__empty-state", t.appendChild(Lt("pluno-pa-widget__character--empty", e)), t.appendChild(kt()), t;
966
+ return t.className = "pluno-pa-widget__empty-state", t.appendChild(Pt("pluno-pa-widget__character--empty", e)), t.appendChild(Lt()), t;
960
967
  }
961
- function kt() {
968
+ function Lt() {
962
969
  const e = document.createElement("div");
963
970
  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;
964
971
  }
@@ -967,28 +974,28 @@ function io(e, t) {
967
974
  const n = document.createElement("span");
968
975
  n.className = "pluno-pa-widget__active-users-counter-dot", n.setAttribute("aria-hidden", "true"), e.appendChild(n), e.appendChild(document.createTextNode(`${t.toLocaleString("en-US")} users currently active`));
969
976
  }
970
- function Lt(e, t) {
977
+ function Pt(e, t) {
971
978
  const n = document.createElement("img");
972
979
  return n.className = `pluno-pa-widget__character ${e}`, n.src = t, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
973
980
  }
974
- function Pt(e, t, n, o) {
981
+ function At(e, t, n, o) {
975
982
  const a = document.createElement("button");
976
983
  return a.type = "button", a.className = e, a.setAttribute("aria-label", t), a.title = t, a.hidden = o, a.appendChild(n), a;
977
984
  }
978
985
  function ro() {
979
- const e = k("svg", {
986
+ const e = L("svg", {
980
987
  class: "pluno-pa-widget__scribble-defs",
981
988
  "aria-hidden": "true",
982
989
  focusable: "false",
983
990
  width: "0",
984
991
  height: "0"
985
- }), t = k("defs");
992
+ }), t = L("defs");
986
993
  return t.appendChild(Se("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(Se("pluno-pa-scribble-wobble-2", "5", "15")), t.appendChild(Se("pluno-pa-scribble-wobble-3", "9", "19")), e.appendChild(t), e;
987
994
  }
988
995
  function Se(e, t, n) {
989
- const o = k("filter", { id: e, x: "-8%", y: "-8%", width: "116%", height: "116%" });
996
+ const o = L("filter", { id: e, x: "-8%", y: "-8%", width: "116%", height: "116%" });
990
997
  return o.appendChild(
991
- k("feTurbulence", {
998
+ L("feTurbulence", {
992
999
  type: "fractalNoise",
993
1000
  baseFrequency: "0.012 0.028",
994
1001
  numOctaves: "3",
@@ -996,7 +1003,7 @@ function Se(e, t, n) {
996
1003
  result: "stroke-noise"
997
1004
  })
998
1005
  ), o.appendChild(
999
- k("feDisplacementMap", {
1006
+ L("feDisplacementMap", {
1000
1007
  in: "SourceGraphic",
1001
1008
  in2: "stroke-noise",
1002
1009
  scale: "3.5",
@@ -1005,7 +1012,7 @@ function Se(e, t, n) {
1005
1012
  result: "warped"
1006
1013
  })
1007
1014
  ), o.appendChild(
1008
- k("feTurbulence", {
1015
+ L("feTurbulence", {
1009
1016
  type: "fractalNoise",
1010
1017
  baseFrequency: "0.7",
1011
1018
  numOctaves: "1",
@@ -1013,7 +1020,7 @@ function Se(e, t, n) {
1013
1020
  result: "ink-noise"
1014
1021
  })
1015
1022
  ), o.appendChild(
1016
- k("feDisplacementMap", {
1023
+ L("feDisplacementMap", {
1017
1024
  in: "warped",
1018
1025
  in2: "ink-noise",
1019
1026
  scale: "0.9",
@@ -1024,27 +1031,27 @@ function Se(e, t, n) {
1024
1031
  }
1025
1032
  function lo(e) {
1026
1033
  const t = Q("0 0 24 24", e, e, "none", "currentColor", "2.25");
1027
- return t.appendChild(k("path", { d: "m6 9 6 6 6-6" })), t;
1034
+ return t.appendChild(L("path", { d: "m6 9 6 6 6-6" })), t;
1028
1035
  }
1029
1036
  function po() {
1030
1037
  const e = Q("0 0 24 24", 17, 17, "none", "currentColor", "2.25");
1031
- return e.appendChild(k("path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" })), e.appendChild(k("path", { d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z" })), e;
1038
+ return e.appendChild(L("path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" })), e.appendChild(L("path", { d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z" })), e;
1032
1039
  }
1033
- function At() {
1040
+ function Nt() {
1034
1041
  const e = Q("0 0 24 24", 14, 14, "none", "currentColor", "2.75");
1035
- return e.appendChild(k("line", { x1: "12", y1: "19", x2: "12", y2: "5" })), e.appendChild(k("polyline", { points: "5 12 12 5 19 12" })), e;
1042
+ return e.appendChild(L("line", { x1: "12", y1: "19", x2: "12", y2: "5" })), e.appendChild(L("polyline", { points: "5 12 12 5 19 12" })), e;
1036
1043
  }
1037
1044
  function so() {
1038
1045
  const e = Q("0 0 24 24", 18, 18, "currentColor");
1039
- return e.appendChild(k("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" })), e;
1046
+ return e.appendChild(L("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" })), e;
1040
1047
  }
1041
1048
  function co() {
1042
1049
  const e = Q("0 0 24 24", 12, 12, "none", "currentColor", "2.4");
1043
- return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
1050
+ return e.appendChild(L("path", { d: "M18 6 6 18" })), e.appendChild(L("path", { d: "m6 6 12 12" })), e;
1044
1051
  }
1045
1052
  function uo() {
1046
1053
  const e = Q("0 0 24 24", 13, 13, "none", "currentColor", "2.25");
1047
- return e.appendChild(k("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" })), e.appendChild(k("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })), e;
1054
+ return e.appendChild(L("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" })), e.appendChild(L("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })), e;
1048
1055
  }
1049
1056
  function Q(e, t, n, o, a, i) {
1050
1057
  const l = {
@@ -1054,15 +1061,15 @@ function Q(e, t, n, o, a, i) {
1054
1061
  fill: o,
1055
1062
  "aria-hidden": "true"
1056
1063
  };
1057
- return a && (l.stroke = a, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), i && (l["stroke-width"] = i), k("svg", l);
1064
+ return a && (l.stroke = a, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), i && (l["stroke-width"] = i), L("svg", l);
1058
1065
  }
1059
- function k(e, t = {}) {
1060
- const n = document.createElementNS(Bn, e);
1066
+ function L(e, t = {}) {
1067
+ const n = document.createElementNS(Fn, e);
1061
1068
  for (const [o, a] of Object.entries(t))
1062
1069
  n.setAttribute(o, a);
1063
1070
  return n;
1064
1071
  }
1065
- function at(e) {
1072
+ function it(e) {
1066
1073
  for (const t of ["keydown", "keypress", "keyup"])
1067
1074
  e.addEventListener(t, (n) => {
1068
1075
  n.stopPropagation();
@@ -1080,7 +1087,7 @@ function go(e, t, n) {
1080
1087
  }
1081
1088
  }
1082
1089
  function ho(e) {
1083
- if (Nt(e)) {
1090
+ if (Tt(e)) {
1084
1091
  const n = document.createElement("img");
1085
1092
  return n.src = e.dataUrl, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
1086
1093
  }
@@ -1088,7 +1095,7 @@ function ho(e) {
1088
1095
  return t.className = "pluno-pa-widget__attachment-file", t.textContent = "PDF", t;
1089
1096
  }
1090
1097
  function mo(e) {
1091
- if (Nt(e)) {
1098
+ if (Tt(e)) {
1092
1099
  const a = document.createElement("img");
1093
1100
  return a.src = e.dataUrl, a.alt = e.name, a;
1094
1101
  }
@@ -1099,7 +1106,7 @@ function mo(e) {
1099
1106
  const o = document.createElement("strong");
1100
1107
  return o.textContent = e.name, t.append(n, o), t;
1101
1108
  }
1102
- function Nt(e) {
1109
+ function Tt(e) {
1103
1110
  return e.mimeType.startsWith("image/");
1104
1111
  }
1105
1112
  function fo(e) {
@@ -1116,7 +1123,7 @@ async function bo(e) {
1116
1123
  const o = wo(n);
1117
1124
  if (!o)
1118
1125
  throw new Error("Pluno supports PNG, JPEG, WebP, non-animated GIF, and PDF files.");
1119
- if (n.size > Ln)
1126
+ if (n.size > Pn)
1120
1127
  throw new Error("Each Pluno attachment can be up to 10 MB.");
1121
1128
  if (o === "image/gif") {
1122
1129
  const a = new Uint8Array(await Lo(n));
@@ -1133,7 +1140,7 @@ async function bo(e) {
1133
1140
  );
1134
1141
  }
1135
1142
  function wo(e) {
1136
- if (Pn.has(e.type))
1143
+ if (An.has(e.type))
1137
1144
  return e.type;
1138
1145
  const t = e.name.toLowerCase();
1139
1146
  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;
@@ -1154,7 +1161,7 @@ function xo(e) {
1154
1161
  if (n += 1, a === 59)
1155
1162
  return !1;
1156
1163
  if (a === 33) {
1157
- n += 1, n = it(e, n);
1164
+ n += 1, n = rt(e, n);
1158
1165
  continue;
1159
1166
  }
1160
1167
  if (a !== 44)
@@ -1166,14 +1173,14 @@ function xo(e) {
1166
1173
  const i = e[n + 8];
1167
1174
  if (n += 9, i & 128 && (n += 3 * 2 ** ((i & 7) + 1)), n >= e.length)
1168
1175
  return !1;
1169
- n += 1, n = it(e, n);
1176
+ n += 1, n = rt(e, n);
1170
1177
  }
1171
1178
  return !1;
1172
1179
  }
1173
1180
  function vo(e) {
1174
1181
  return e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97;
1175
1182
  }
1176
- function it(e, t) {
1183
+ function rt(e, t) {
1177
1184
  for (; t < e.length; ) {
1178
1185
  const n = e[t];
1179
1186
  if (t += 1, n === 0)
@@ -1186,11 +1193,11 @@ function se(e) {
1186
1193
  return !!(e && Array.from(e.types).includes("Files"));
1187
1194
  }
1188
1195
  function ke(e, t, n = null) {
1189
- if (!e || !Ie(t, n)) {
1196
+ if (!e || !De(t, n)) {
1190
1197
  e && (e.hidden = !0, e.replaceChildren());
1191
1198
  return;
1192
1199
  }
1193
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", G(t) || Re(n) ? e.appendChild(yo(t, n)) : Tt(t) && e.appendChild(Co(t));
1200
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", $(t) || Re(n) ? e.appendChild(yo(t, n)) : Dt(t) && e.appendChild(Co(t));
1194
1201
  }
1195
1202
  function yo(e, t) {
1196
1203
  const n = document.createElement("div");
@@ -1208,23 +1215,23 @@ function Co(e) {
1208
1215
  const o = document.createElement("span");
1209
1216
  return o.textContent = So(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(It(e, "Upgrade", "pluno-pa-widget__billing-action-card-actions")), t;
1210
1217
  }
1211
- function Ie(e, t) {
1212
- return e !== null && (G(e) || Tt(e) || Re(t));
1218
+ function De(e, t) {
1219
+ return e !== null && ($(e) || Dt(e) || Re(t));
1213
1220
  }
1214
- function rt(e, t, n) {
1215
- return Ie(t, n) || Eo(t) ? !0 : !Ie(e, n);
1221
+ function lt(e, t, n) {
1222
+ return De(t, n) || Eo(t) ? !0 : !De(e, n);
1216
1223
  }
1217
1224
  function Eo(e) {
1218
- return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || G(e));
1225
+ return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || $(e));
1219
1226
  }
1220
- function G(e) {
1227
+ function $(e) {
1221
1228
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
1222
1229
  }
1223
1230
  function Re(e) {
1224
1231
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
1225
1232
  }
1226
- function Tt(e) {
1227
- return !G(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
1233
+ function Dt(e) {
1234
+ return !$(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
1228
1235
  }
1229
1236
  function So(e) {
1230
1237
  return e.creditsRemaining === null ? null : `${ko(e.creditsRemaining)} credits left`;
@@ -1236,9 +1243,9 @@ function ko(e) {
1236
1243
  }
1237
1244
  function It(e, t, n) {
1238
1245
  const o = document.createElement("div");
1239
- return o.className = n, o.appendChild(lt(t, e.pricingUrl)), o.appendChild(lt("Earn credits", e.earnCreditsUrl)), o;
1246
+ return o.className = n, o.appendChild(pt(t, e.pricingUrl)), o.appendChild(pt("Earn credits", e.earnCreditsUrl)), o;
1240
1247
  }
1241
- function lt(e, t) {
1248
+ function pt(e, t) {
1242
1249
  const n = document.createElement("button");
1243
1250
  return n.type = "button", n.textContent = e, n.disabled = t.trim().length === 0, n.addEventListener("click", () => {
1244
1251
  t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
@@ -1272,102 +1279,102 @@ function Po(e) {
1272
1279
  }), o.readAsDataURL(e);
1273
1280
  });
1274
1281
  }
1275
- function pt(e, t) {
1276
- return e.messages.filter((o) => !Dt(o)).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
1282
+ function st(e, t) {
1283
+ return e.messages.filter((o) => !Mt(o)).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
1277
1284
  }
1278
- function Ao(e, t, n, o, a, i, l, p, g, c, d, f) {
1279
- const y = [...a.messages], x = y.filter((m) => !Dt(m));
1280
- e.replaceChildren(), Rt(t, a.isThinking), o.hidden = !l, l && i !== null && io(o, i);
1281
- const E = x.length > 0 || !!a.assistantDraft || a.isThinking;
1282
- if (n.hidden = !E, x.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
1285
+ function Ao(e, t, n, o, a, i, l, p, c, d, s, f) {
1286
+ const v = [...a.messages], x = v.filter((m) => !Mt(m));
1287
+ e.replaceChildren(), Ot(t, a.isThinking), o.hidden = !l, l && i !== null && io(o, i);
1288
+ const S = x.length > 0 || !!a.assistantDraft || a.isThinking;
1289
+ if (n.hidden = !S, x.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
1283
1290
  const m = document.createElement("div");
1284
1291
  m.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
1285
- const w = document.createElement("div");
1286
- w.className = "pluno-pa-widget__empty-hero";
1292
+ const b = document.createElement("div");
1293
+ b.className = "pluno-pa-widget__empty-hero";
1287
1294
  const C = document.createElement("img");
1288
- C.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", C.src = c(), C.alt = "", C.setAttribute("aria-hidden", "true"), w.appendChild(C), m.appendChild(w), m.appendChild(kt());
1289
- const S = document.createElement("div");
1290
- S.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 && S.setAttribute("aria-hidden", "true");
1291
- for (const T of a.starterPrompts) {
1292
- const D = document.createElement("button");
1293
- D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${T}"`, D.addEventListener("click", () => {
1294
- d(T);
1295
- }), S.appendChild(D);
1296
- }
1297
- m.appendChild(S), e.appendChild(m);
1295
+ C.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", C.src = d(), C.alt = "", C.setAttribute("aria-hidden", "true"), b.appendChild(C), m.appendChild(b), m.appendChild(Lt());
1296
+ const k = document.createElement("div");
1297
+ k.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 && k.setAttribute("aria-hidden", "true");
1298
+ for (const I of a.starterPrompts) {
1299
+ const R = document.createElement("button");
1300
+ R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${I}"`, R.addEventListener("click", () => {
1301
+ s(I);
1302
+ }), k.appendChild(R);
1303
+ }
1304
+ m.appendChild(k), e.appendChild(m);
1298
1305
  return;
1299
1306
  }
1300
- let h = null, b = null, s = [];
1301
- const v = () => {
1302
- if (s.length === 0)
1307
+ let y = null, _ = null, g = [];
1308
+ const h = () => {
1309
+ if (g.length === 0)
1303
1310
  return !1;
1304
- const m = Fo(s, p, g, c());
1305
- return e.appendChild(m), h = null, b = m, s = [], !0;
1311
+ const m = Fo(g, p, c, d());
1312
+ return e.appendChild(m), y = null, _ = m, g = [], !0;
1306
1313
  };
1307
1314
  for (let m = 0; m < x.length; m += 1) {
1308
- const w = x[m];
1309
- if (w.role === "tool") {
1310
- s.push(w);
1315
+ const b = x[m];
1316
+ if (b.role === "tool") {
1317
+ g.push(b);
1311
1318
  continue;
1312
1319
  }
1313
- if (w.role === "system")
1320
+ if (b.role === "system")
1314
1321
  continue;
1315
- const C = v(), S = dt(w.content);
1316
- if (w.role === "assistant" && !C) {
1317
- const _ = De(c());
1318
- e.appendChild(_), h = null, b = _;
1319
- }
1320
- const T = document.createElement("div");
1321
- T.className = `pluno-pa-widget__message pluno-pa-widget__message--${w.role}`, w.role === "assistant" ? ct(T, S) : T.textContent = S, w.role === "user" && w.attachments?.length && T.appendChild(To(w.attachments));
1322
- const D = document.createElement("div");
1323
- D.className = "pluno-pa-widget__message-actions", D.appendChild(st(S)), T.appendChild(D), e.appendChild(T), h = T, b = null;
1322
+ const C = h(), k = ct(b.content);
1323
+ if (b.role === "assistant" && !C) {
1324
+ const w = Ie(d());
1325
+ e.appendChild(w), y = null, _ = w;
1326
+ }
1327
+ const I = document.createElement("div");
1328
+ I.className = `pluno-pa-widget__message pluno-pa-widget__message--${b.role}`, b.role === "assistant" ? ut(I, k) : I.textContent = k, b.role === "user" && b.attachments?.length && I.appendChild(To(b.attachments));
1329
+ const R = document.createElement("div");
1330
+ R.className = "pluno-pa-widget__message-actions", R.appendChild(dt(k)), I.appendChild(R), e.appendChild(I), y = I, _ = null;
1324
1331
  }
1325
- const $ = v();
1332
+ const P = h();
1326
1333
  if (a.assistantDraft) {
1327
- if (!$) {
1328
- const S = De(c());
1329
- e.appendChild(S), h = null, b = S;
1334
+ if (!P) {
1335
+ const k = Ie(d());
1336
+ e.appendChild(k), y = null, _ = k;
1330
1337
  }
1331
- const m = dt(a.assistantDraft), w = document.createElement("div");
1332
- w.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", ct(w, m);
1338
+ const m = ct(a.assistantDraft), b = document.createElement("div");
1339
+ b.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", ut(b, m);
1333
1340
  const C = document.createElement("div");
1334
- C.className = "pluno-pa-widget__message-actions", C.appendChild(st(m)), w.appendChild(C), e.appendChild(w), h = w, b = null;
1341
+ C.className = "pluno-pa-widget__message-actions", C.appendChild(dt(m)), b.appendChild(C), e.appendChild(b), y = b, _ = null;
1335
1342
  }
1336
1343
  if (a.isThinking && !a.assistantDraft)
1337
- if ($) {
1338
- const m = Mt();
1339
- e.appendChild(m), h = null, b = m;
1344
+ if (P) {
1345
+ const m = Rt();
1346
+ e.appendChild(m), y = null, _ = m;
1340
1347
  } else {
1341
- const m = Uo(c());
1342
- e.appendChild(m), h = null, b = m;
1348
+ const m = Uo(d());
1349
+ e.appendChild(m), y = null, _ = m;
1343
1350
  }
1344
1351
  if (a.lastError) {
1345
1352
  const m = document.createElement("div");
1346
- m.className = "pluno-pa-widget__error", m.textContent = a.lastError, e.appendChild(m), h = m, b = null;
1353
+ m.className = "pluno-pa-widget__error", m.textContent = a.lastError, e.appendChild(m), y = m, _ = null;
1347
1354
  }
1348
- const U = f && !a.isThinking ? on(y) : null;
1349
- if (f && U && !f.dismissedCandidateIds.has(U.id)) {
1350
- const m = Io(U, {
1351
- isDrafting: f.draftingCandidateId === U.id,
1355
+ const E = f && !a.isThinking ? an(v) : null;
1356
+ if (f && E && !f.dismissedCandidateIds.has(E.id)) {
1357
+ const m = Do(E, {
1358
+ isDrafting: f.draftingCandidateId === E.id,
1352
1359
  error: f.error,
1353
1360
  onDraft: f.onDraft,
1354
1361
  onDismiss: f.onDismiss,
1355
1362
  onDisable: f.onDisable
1356
1363
  });
1357
- e.appendChild(m), f.onSeen(U), h = null, b = m;
1364
+ e.appendChild(m), f.onSeen(E), y = null, _ = m;
1358
1365
  }
1359
- h?.classList.add("pluno-pa-widget__message--bottom-reserve"), b?.classList.add("pluno-pa-widget__bottom-reserve-compact"), e.scrollTop = e.scrollHeight;
1366
+ y?.classList.add("pluno-pa-widget__message--bottom-reserve"), _?.classList.add("pluno-pa-widget__bottom-reserve-compact"), e.scrollTop = e.scrollHeight;
1360
1367
  }
1361
1368
  function No(e, t, n, o, a, i) {
1362
- e.replaceChildren(), Rt(t, !1), t.disabled = !0, n.hidden = !0;
1369
+ e.replaceChildren(), Ot(t, !1), t.disabled = !0, n.hidden = !0;
1363
1370
  const l = document.createElement("div");
1364
1371
  l.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
1365
1372
  const p = document.createElement("img");
1366
1373
  p.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", p.src = o(), p.alt = "", p.setAttribute("aria-hidden", "true"), l.appendChild(p);
1367
- const g = document.createElement("div");
1368
- g.className = "pluno-pa-widget__empty", g.textContent = "Log in to use Pluno on this page.", l.appendChild(g);
1369
- const c = document.createElement("button");
1370
- c.type = "button", c.className = "pluno-pa-widget__login", c.textContent = a, c.addEventListener("click", () => i?.()), l.appendChild(c), e.appendChild(l);
1374
+ const c = document.createElement("div");
1375
+ c.className = "pluno-pa-widget__empty", c.textContent = "Log in to use Pluno on this page.", l.appendChild(c);
1376
+ const d = document.createElement("button");
1377
+ d.type = "button", d.className = "pluno-pa-widget__login", d.textContent = a, d.addEventListener("click", () => i?.()), l.appendChild(d), e.appendChild(l);
1371
1378
  }
1372
1379
  function To(e) {
1373
1380
  const t = document.createElement("div");
@@ -1376,13 +1383,13 @@ function To(e) {
1376
1383
  t.appendChild(mo(n));
1377
1384
  return t;
1378
1385
  }
1379
- function st(e) {
1386
+ function dt(e) {
1380
1387
  const t = document.createElement("button");
1381
1388
  return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(uo()), t.addEventListener("click", (n) => {
1382
1389
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
1383
1390
  }), t;
1384
1391
  }
1385
- function Io(e, t) {
1392
+ function Do(e, t) {
1386
1393
  const n = document.createElement("article");
1387
1394
  n.className = "pluno-pa-widget__share-prompt";
1388
1395
  const o = document.createElement("div");
@@ -1393,24 +1400,24 @@ function Io(e, t) {
1393
1400
  i.textContent = "Share this win?", a.appendChild(i);
1394
1401
  const l = document.createElement("span");
1395
1402
  if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", a.appendChild(l), t.error) {
1396
- const d = document.createElement("span");
1397
- d.className = "pluno-pa-widget__share-prompt-error", d.textContent = t.error, a.appendChild(d);
1403
+ const s = document.createElement("span");
1404
+ s.className = "pluno-pa-widget__share-prompt-error", s.textContent = t.error, a.appendChild(s);
1398
1405
  }
1399
1406
  o.appendChild(a);
1400
1407
  const p = document.createElement("div");
1401
1408
  p.className = "pluno-pa-widget__share-prompt-actions";
1402
- const g = document.createElement("div");
1403
- g.className = "pluno-pa-widget__share-prompt-primary-actions";
1404
- const c = document.createElement("button");
1405
- if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
1409
+ const c = document.createElement("div");
1410
+ c.className = "pluno-pa-widget__share-prompt-primary-actions";
1411
+ const d = document.createElement("button");
1412
+ if (d.type = "button", d.disabled = t.isDrafting, d.addEventListener("click", () => {
1406
1413
  t.onDraft(e);
1407
- }), t.isDrafting ? (c.appendChild(Me()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", g.appendChild(c), t.isDrafting)
1408
- p.appendChild(g);
1414
+ }), t.isDrafting ? (d.appendChild(Me()), d.appendChild(document.createTextNode("Drafting..."))) : d.textContent = "Draft a social post", c.appendChild(d), t.isDrafting)
1415
+ p.appendChild(c);
1409
1416
  else {
1410
- const d = document.createElement("button");
1411
- 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", () => {
1417
+ const s = document.createElement("button");
1418
+ s.type = "button", s.className = "pluno-pa-widget__share-prompt-dismiss", s.setAttribute("aria-label", "Dismiss share prompt"), s.title = "Dismiss", s.textContent = "Dismiss", s.addEventListener("click", () => {
1412
1419
  t.onDismiss(e);
1413
- }), g.appendChild(d), p.appendChild(g);
1420
+ }), c.appendChild(s), p.appendChild(c);
1414
1421
  const f = document.createElement("button");
1415
1422
  f.type = "button", f.className = "pluno-pa-widget__share-prompt-disable", f.textContent = "Don't ask again", f.addEventListener("click", () => {
1416
1423
  t.onDisable(e);
@@ -1418,10 +1425,10 @@ function Io(e, t) {
1418
1425
  }
1419
1426
  return o.appendChild(p), n.appendChild(o), n;
1420
1427
  }
1421
- function Do(e, t) {
1428
+ function Io(e, t) {
1422
1429
  const n = document.createElement("div");
1423
- n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (b) => {
1424
- b.target === n && t.onClose();
1430
+ n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (_) => {
1431
+ _.target === n && t.onClose();
1425
1432
  });
1426
1433
  const o = document.createElement("section");
1427
1434
  o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
@@ -1431,45 +1438,45 @@ function Do(e, t) {
1431
1438
  l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), a.appendChild(l), o.appendChild(a);
1432
1439
  const p = document.createElement("p");
1433
1440
  p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
1434
- const g = document.createElement("div");
1435
- g.className = "pluno-pa-widget__share-dialog-step";
1436
1441
  const c = document.createElement("div");
1437
- c.className = "pluno-pa-widget__share-dialog-step-header";
1438
- const d = document.createElement("strong");
1439
- d.textContent = "1) Copy Screenshot", c.appendChild(d);
1442
+ c.className = "pluno-pa-widget__share-dialog-step";
1443
+ const d = document.createElement("div");
1444
+ d.className = "pluno-pa-widget__share-dialog-step-header";
1445
+ const s = document.createElement("strong");
1446
+ s.textContent = "1) Copy Screenshot", d.appendChild(s);
1440
1447
  const f = Mo("Copy Screenshot", async () => {
1441
1448
  try {
1442
- return await an(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
1449
+ return await rn(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
1443
1450
  } catch {
1444
1451
  return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
1445
1452
  }
1446
1453
  });
1447
- if (c.appendChild(f), g.appendChild(c), e.screenshotDataUrl) {
1448
- const b = document.createElement("div");
1449
- b.className = "pluno-pa-widget__share-dialog-screenshot";
1450
- const s = document.createElement("img");
1451
- s.src = e.screenshotDataUrl, s.alt = "Product page with Pluno open", b.appendChild(s), g.appendChild(b);
1454
+ if (d.appendChild(f), c.appendChild(d), e.screenshotDataUrl) {
1455
+ const _ = document.createElement("div");
1456
+ _.className = "pluno-pa-widget__share-dialog-screenshot";
1457
+ const g = document.createElement("img");
1458
+ g.src = e.screenshotDataUrl, g.alt = "Product page with Pluno open", _.appendChild(g), c.appendChild(_);
1452
1459
  }
1453
- o.appendChild(g), o.appendChild(p);
1454
- const y = document.createElement("div");
1455
- y.className = "pluno-pa-widget__share-dialog-step";
1460
+ o.appendChild(c), o.appendChild(p);
1461
+ const v = document.createElement("div");
1462
+ v.className = "pluno-pa-widget__share-dialog-step";
1456
1463
  const x = document.createElement("strong");
1457
- x.className = "pluno-pa-widget__share-dialog-step-title", x.textContent = "2) Share on", y.appendChild(x);
1458
- const E = document.createElement("p");
1459
- E.className = "pluno-pa-widget__share-dialog-hint", E.textContent = "Post draft opens prefilled on supported platforms.", y.appendChild(E);
1460
- const h = document.createElement("footer");
1461
- h.className = "pluno-pa-widget__share-dialog-platforms";
1462
- for (const b of Ro(e)) {
1463
- const s = document.createElement("a");
1464
- s.href = b.href, s.target = "_blank", s.rel = "noopener noreferrer", s.title = b.label, s.setAttribute("aria-label", `Open ${b.label}`), s.appendChild(Oo(b.id)), h.appendChild(s);
1464
+ x.className = "pluno-pa-widget__share-dialog-step-title", x.textContent = "2) Share on", v.appendChild(x);
1465
+ const S = document.createElement("p");
1466
+ S.className = "pluno-pa-widget__share-dialog-hint", S.textContent = "Post draft opens prefilled on supported platforms.", v.appendChild(S);
1467
+ const y = document.createElement("footer");
1468
+ y.className = "pluno-pa-widget__share-dialog-platforms";
1469
+ for (const _ of Ro(e)) {
1470
+ const g = document.createElement("a");
1471
+ g.href = _.href, g.target = "_blank", g.rel = "noopener noreferrer", g.title = _.label, g.setAttribute("aria-label", `Open ${_.label}`), g.appendChild(Oo(_.id)), y.appendChild(g);
1465
1472
  }
1466
- if (y.appendChild(h), o.appendChild(y), t.socialPostRewardsUrl) {
1467
- const b = document.createElement("div");
1468
- b.className = "pluno-pa-widget__share-dialog-step";
1469
- const s = document.createElement("strong");
1470
- s.className = "pluno-pa-widget__share-dialog-step-title", s.textContent = "3) Submit post to get 2000 free credits!", b.appendChild(s);
1471
- const v = document.createElement("a");
1472
- v.className = "pluno-pa-widget__share-dialog-reward-link", v.href = t.socialPostRewardsUrl, v.target = "_blank", v.rel = "noopener noreferrer", v.appendChild(document.createTextNode("Submit post URL")), v.appendChild(Bo()), b.appendChild(v), o.appendChild(b);
1473
+ if (v.appendChild(y), o.appendChild(v), t.socialPostRewardsUrl) {
1474
+ const _ = document.createElement("div");
1475
+ _.className = "pluno-pa-widget__share-dialog-step";
1476
+ const g = document.createElement("strong");
1477
+ g.className = "pluno-pa-widget__share-dialog-step-title", g.textContent = "3) Submit post to get 2000 free credits!", _.appendChild(g);
1478
+ const h = document.createElement("a");
1479
+ 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(Bo()), _.appendChild(h), o.appendChild(_);
1473
1480
  }
1474
1481
  return n.appendChild(o), n;
1475
1482
  }
@@ -1501,20 +1508,20 @@ function Ro(e) {
1501
1508
  }
1502
1509
  function Oo(e) {
1503
1510
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1504
- 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" ? (P(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), P(t, "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"), P(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), P(t, "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"), P(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (P(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), P(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), P(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (P(t, "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"), P(t, "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", "0.48"), P(t, "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"), P(t, "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"), t);
1511
+ 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" ? (N(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), N(t, "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"), N(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), N(t, "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"), N(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (N(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), N(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), N(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (N(t, "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"), N(t, "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", "0.48"), N(t, "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"), N(t, "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"), t);
1505
1512
  }
1506
- function P(e, t, n) {
1513
+ function N(e, t, n) {
1507
1514
  const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
1508
1515
  o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
1509
1516
  }
1510
1517
  function Bo() {
1511
1518
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1512
- return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), P(e, "M14 5h5v5"), P(e, "M19 5l-8 8"), P(e, "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"), e;
1519
+ return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), N(e, "M14 5h5v5"), N(e, "M19 5l-8 8"), N(e, "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"), e;
1513
1520
  }
1514
- function Dt(e) {
1515
- return e.role === "tool" && e.toolName === wt;
1521
+ function Mt(e) {
1522
+ return e.role === "tool" && e.toolName === _t;
1516
1523
  }
1517
- function dt(e) {
1524
+ function ct(e) {
1518
1525
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
1519
1526
  }
1520
1527
  function Fo(e, t, n, o) {
@@ -1526,33 +1533,33 @@ function Fo(e, t, n, o) {
1526
1533
  l.open = t.has(p), l.addEventListener("toggle", () => {
1527
1534
  l.open ? t.add(p) : t.delete(p), n();
1528
1535
  });
1529
- const g = document.createElement("summary");
1530
- g.className = "pluno-pa-widget__tool-summary", e.some((f) => f.loading) && g.appendChild(Me());
1531
- const d = document.createElement("span");
1532
- if (d.className = "pluno-pa-widget__tool-summary-title", d.textContent = e[e.length - 1].content || "Run tool", g.appendChild(d), l.appendChild(g), e.length > 0) {
1536
+ const c = document.createElement("summary");
1537
+ c.className = "pluno-pa-widget__tool-summary", e.some((f) => f.loading) && c.appendChild(Me());
1538
+ const s = document.createElement("span");
1539
+ if (s.className = "pluno-pa-widget__tool-summary-title", s.textContent = e[e.length - 1].content || "Run tool", c.appendChild(s), l.appendChild(c), e.length > 0) {
1533
1540
  const f = document.createElement("div");
1534
1541
  f.className = "pluno-pa-widget__tool-lines";
1535
- for (const y of e) {
1542
+ for (const v of e) {
1536
1543
  const x = document.createElement("div");
1537
- x.className = "pluno-pa-widget__tool-line", y.loading && x.appendChild(Me());
1538
- const E = document.createElement("span");
1539
- E.textContent = y.content || "Run tool", x.appendChild(E), f.appendChild(x);
1544
+ x.className = "pluno-pa-widget__tool-line", v.loading && x.appendChild(Me());
1545
+ const S = document.createElement("span");
1546
+ S.textContent = v.content || "Run tool", x.appendChild(S), f.appendChild(x);
1540
1547
  }
1541
1548
  l.appendChild(f);
1542
1549
  }
1543
1550
  return a.appendChild(l), a;
1544
1551
  }
1545
- function De(e) {
1552
+ function Ie(e) {
1546
1553
  const t = document.createElement("article");
1547
1554
  t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker";
1548
1555
  const n = document.createElement("img");
1549
1556
  return n.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", n.src = e, n.alt = "", n.setAttribute("aria-hidden", "true"), t.appendChild(n), t;
1550
1557
  }
1551
1558
  function Uo(e) {
1552
- const t = De(e);
1553
- return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(Mt()), t;
1559
+ const t = Ie(e);
1560
+ return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(Rt()), t;
1554
1561
  }
1555
- function Mt() {
1562
+ function Rt() {
1556
1563
  const e = document.createElement("div");
1557
1564
  e.className = "pluno-pa-widget__status";
1558
1565
  const t = document.createElement("span");
@@ -1567,10 +1574,10 @@ function Me() {
1567
1574
  const e = document.createElement("span");
1568
1575
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
1569
1576
  }
1570
- function Rt(e, t) {
1571
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? so() : At());
1577
+ function Ot(e, t) {
1578
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? so() : Nt());
1572
1579
  }
1573
- function ct(e, t) {
1580
+ function ut(e, t) {
1574
1581
  const n = t.replace(/\r\n/g, `
1575
1582
  `).split(`
1576
1583
  `);
@@ -1582,46 +1589,46 @@ function ct(e, t) {
1582
1589
  continue;
1583
1590
  }
1584
1591
  if (a.match(/^```(\w+)?\s*$/)) {
1585
- const c = [];
1592
+ const d = [];
1586
1593
  for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
1587
- c.push(n[o]), o += 1;
1594
+ d.push(n[o]), o += 1;
1588
1595
  o += o < n.length ? 1 : 0;
1589
- const d = document.createElement("pre"), f = document.createElement("code");
1590
- f.textContent = c.join(`
1591
- `), d.appendChild(f), e.appendChild(d);
1596
+ const s = document.createElement("pre"), f = document.createElement("code");
1597
+ f.textContent = d.join(`
1598
+ `), s.appendChild(f), e.appendChild(s);
1592
1599
  continue;
1593
1600
  }
1594
1601
  const l = a.match(/^(#{1,3})\s+(.+)$/);
1595
1602
  if (l) {
1596
- const c = document.createElement(`h${l[1].length + 2}`);
1597
- de(c, l[2]), e.appendChild(c), o += 1;
1603
+ const d = document.createElement(`h${l[1].length + 2}`);
1604
+ de(d, l[2]), e.appendChild(d), o += 1;
1598
1605
  continue;
1599
1606
  }
1600
1607
  if (/^\s*[-*+]\s+/.test(a)) {
1601
- const c = document.createElement("ul");
1608
+ const d = document.createElement("ul");
1602
1609
  for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
1603
- const d = document.createElement("li");
1604
- de(d, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(d), o += 1;
1610
+ const s = document.createElement("li");
1611
+ de(s, n[o].replace(/^\s*[-*+]\s+/, "")), d.appendChild(s), o += 1;
1605
1612
  }
1606
- e.appendChild(c);
1613
+ e.appendChild(d);
1607
1614
  continue;
1608
1615
  }
1609
1616
  if (/^\s*\d+\.\s+/.test(a)) {
1610
- const c = document.createElement("ol");
1617
+ const d = document.createElement("ol");
1611
1618
  for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
1612
- const d = document.createElement("li");
1613
- de(d, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(d), o += 1;
1619
+ const s = document.createElement("li");
1620
+ de(s, n[o].replace(/^\s*\d+\.\s+/, "")), d.appendChild(s), o += 1;
1614
1621
  }
1615
- e.appendChild(c);
1622
+ e.appendChild(d);
1616
1623
  continue;
1617
1624
  }
1618
1625
  const p = [a];
1619
1626
  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]); )
1620
1627
  p.push(n[o]), o += 1;
1621
- const g = document.createElement("p");
1622
- p.forEach((c, d) => {
1623
- d > 0 && g.appendChild(document.createElement("br")), de(g, c);
1624
- }), e.appendChild(g);
1628
+ const c = document.createElement("p");
1629
+ p.forEach((d, s) => {
1630
+ s > 0 && c.appendChild(document.createElement("br")), de(c, d);
1631
+ }), e.appendChild(c);
1625
1632
  }
1626
1633
  }
1627
1634
  function de(e, t) {
@@ -1643,8 +1650,8 @@ function de(e, t) {
1643
1650
  } else {
1644
1651
  const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
1645
1652
  if (p && Go(p[2])) {
1646
- const g = document.createElement("a");
1647
- g.href = p[2], g.target = "_top", g.rel = "noreferrer", g.textContent = p[1], e.appendChild(g);
1653
+ const c = document.createElement("a");
1654
+ c.href = p[2], c.target = "_top", c.rel = "noreferrer", c.textContent = p[1], e.appendChild(c);
1648
1655
  } else
1649
1656
  e.appendChild(document.createTextNode(l));
1650
1657
  }
@@ -1662,7 +1669,7 @@ function Go(e) {
1662
1669
  return !1;
1663
1670
  }
1664
1671
  }
1665
- function ut(e, t) {
1672
+ function gt(e, t) {
1666
1673
  if ($o(e))
1667
1674
  return;
1668
1675
  const n = `
@@ -1716,7 +1723,7 @@ function ut(e, t) {
1716
1723
  --pluno-pa-accent-contrast: #fafafa;
1717
1724
  position: fixed;
1718
1725
  z-index: 2147483645;
1719
- font-family: ${B.fontFamily};
1726
+ font-family: ${U.fontFamily};
1720
1727
  font-size: 14px;
1721
1728
  color: var(--pluno-pa-text);
1722
1729
  width: var(--pluno-pa-launcher-width);
@@ -1812,6 +1819,10 @@ function ut(e, t) {
1812
1819
  .pluno-pa-widget--dragging .pluno-pa-widget__launcher-drag-handle {
1813
1820
  cursor: grabbing;
1814
1821
  }
1822
+ .pluno-pa-widget--dragging .pluno-pa-widget__launcher,
1823
+ .pluno-pa-widget--dragging .pluno-pa-widget__launcher-input {
1824
+ cursor: grabbing;
1825
+ }
1815
1826
  .pluno-pa-widget__launcher-drag-handle:focus-visible {
1816
1827
  outline: 2px solid var(--pluno-pa-accent);
1817
1828
  outline-offset: 2px;
@@ -2418,7 +2429,7 @@ function ut(e, t) {
2418
2429
  place-items: center;
2419
2430
  padding: 18px;
2420
2431
  background: rgba(24, 24, 27, 0.28);
2421
- font-family: var(--pluno-pa-font, ${B.fontFamily});
2432
+ font-family: var(--pluno-pa-font, ${U.fontFamily});
2422
2433
  color: var(--pluno-pa-text);
2423
2434
  }
2424
2435
  .pluno-pa-widget__share-dialog {
@@ -3350,20 +3361,20 @@ function ut(e, t) {
3350
3361
  if (Ho(e, n))
3351
3362
  return;
3352
3363
  const o = e.ownerDocument.createElement("style");
3353
- o.id = Ct, o.textContent = n, e.appendChild(o), Ot(e);
3364
+ o.id = Et, o.textContent = n, e.appendChild(o), Bt(e);
3354
3365
  }
3355
3366
  function $o(e) {
3356
- return e.getElementById(Ct) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Et) === "true";
3367
+ return e.getElementById(Et) !== null || e.host instanceof HTMLElement && e.host.getAttribute(St) === "true";
3357
3368
  }
3358
- function Ot(e) {
3359
- e.host instanceof HTMLElement && e.host.setAttribute(Et, "true");
3369
+ function Bt(e) {
3370
+ e.host instanceof HTMLElement && e.host.setAttribute(St, "true");
3360
3371
  }
3361
3372
  function Ho(e, t) {
3362
3373
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
3363
3374
  return !1;
3364
3375
  try {
3365
3376
  const n = new CSSStyleSheet();
3366
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Ot(e), !0;
3377
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Bt(e), !0;
3367
3378
  } catch {
3368
3379
  return !1;
3369
3380
  }
@@ -3376,32 +3387,32 @@ async function Wo() {
3376
3387
  t.observe(document.documentElement, { childList: !0 });
3377
3388
  });
3378
3389
  }
3379
- function Bt(e) {
3390
+ function Ft(e) {
3380
3391
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
3381
3392
  }
3382
3393
  function Vo(e) {
3383
3394
  try {
3384
- const t = window.localStorage.getItem(Bt(e));
3395
+ const t = window.localStorage.getItem(Ft(e));
3385
3396
  if (!t)
3386
- return gt();
3397
+ return ht();
3387
3398
  const n = JSON.parse(t);
3388
3399
  return {
3389
3400
  isOpen: n.isOpen === !0,
3390
3401
  composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
3391
3402
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter((o) => typeof o == "string") : [],
3392
3403
  launcherPosition: Yo(n.launcherPosition) ? n.launcherPosition : null,
3393
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-_t) : [],
3404
+ seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-xt) : [],
3394
3405
  sharePromptsDisabled: n.sharePromptsDisabled === !0
3395
3406
  };
3396
3407
  } catch {
3397
- return gt();
3408
+ return ht();
3398
3409
  }
3399
3410
  }
3400
3411
  async function jo(e) {
3401
3412
  if (e.loadSharePromptsDisabled)
3402
3413
  return e.loadSharePromptsDisabled();
3403
3414
  try {
3404
- return window.localStorage.getItem(xt) === "true";
3415
+ return window.localStorage.getItem(vt) === "true";
3405
3416
  } catch {
3406
3417
  return !1;
3407
3418
  }
@@ -3413,12 +3424,12 @@ function qo(e, t) {
3413
3424
  return;
3414
3425
  }
3415
3426
  try {
3416
- t && window.localStorage.setItem(xt, "true");
3427
+ t && window.localStorage.setItem(vt, "true");
3417
3428
  } catch {
3418
3429
  return;
3419
3430
  }
3420
3431
  }
3421
- function gt() {
3432
+ function ht() {
3422
3433
  return {
3423
3434
  isOpen: !1,
3424
3435
  composerValue: "",
@@ -3430,7 +3441,7 @@ function gt() {
3430
3441
  }
3431
3442
  function Ko(e, t) {
3432
3443
  try {
3433
- window.localStorage.setItem(Bt(e), JSON.stringify(t));
3444
+ window.localStorage.setItem(Ft(e), JSON.stringify(t));
3434
3445
  } catch {
3435
3446
  return;
3436
3447
  }
@@ -3441,30 +3452,30 @@ function Yo(e) {
3441
3452
  const t = e;
3442
3453
  return Number.isFinite(t.x) && Number.isFinite(t.y);
3443
3454
  }
3444
- const ht = /* @__PURE__ */ new WeakSet();
3455
+ const mt = /* @__PURE__ */ new WeakSet();
3445
3456
  function Xo(e) {
3446
3457
  return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
3447
3458
  }
3448
- function mt(e) {
3459
+ function ft(e) {
3449
3460
  const t = e.pathname.split("/");
3450
3461
  return t[t.length - 1] ?? "";
3451
3462
  }
3452
3463
  function Zo(e, t) {
3453
3464
  const n = new URL(e.src, document.baseURI);
3454
- return n.href === t.href || n.pathname === t.pathname ? !0 : mt(n) === mt(t);
3465
+ return n.href === t.href || n.pathname === t.pathname ? !0 : ft(n) === ft(t);
3455
3466
  }
3456
- class F extends EventTarget {
3467
+ class z extends EventTarget {
3457
3468
  constructor(t, n) {
3458
- super(), this.channelId = n, this.url = t, this.addPreviewListener(yn, () => {
3459
- this.readyState = F.OPEN, this.dispatchEvent(new Event("open"));
3460
- }), this.addPreviewListener(Cn, (o) => {
3469
+ super(), this.channelId = n, this.url = t, this.addPreviewListener(Cn, () => {
3470
+ this.readyState = z.OPEN, this.dispatchEvent(new Event("open"));
3471
+ }), this.addPreviewListener(En, (o) => {
3461
3472
  const a = o;
3462
3473
  this.dispatchEvent(new MessageEvent("message", { data: a.detail?.data ?? "" }));
3463
- }), this.addPreviewListener(En, () => {
3464
- this.readyState = F.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
3465
- }), this.addPreviewListener(Sn, (o) => {
3474
+ }), this.addPreviewListener(Sn, () => {
3475
+ this.readyState = z.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
3476
+ }), this.addPreviewListener(kn, (o) => {
3466
3477
  const a = o;
3467
- this.readyState = F.CLOSED, this.dispatchEvent(
3478
+ this.readyState = z.CLOSED, this.dispatchEvent(
3468
3479
  new CloseEvent("close", {
3469
3480
  code: a.detail?.code ?? 1e3,
3470
3481
  reason: a.detail?.reason ?? "",
@@ -3472,7 +3483,7 @@ class F extends EventTarget {
3472
3483
  })
3473
3484
  ), this.cleanup();
3474
3485
  }), window.dispatchEvent(
3475
- new CustomEvent(ce(_n, this.channelId), {
3486
+ new CustomEvent(ce(xn, this.channelId), {
3476
3487
  detail: { socketId: this.socketId, url: t }
3477
3488
  })
3478
3489
  );
@@ -3487,21 +3498,21 @@ class F extends EventTarget {
3487
3498
  extensions = "";
3488
3499
  binaryType = "blob";
3489
3500
  bufferedAmount = 0;
3490
- readyState = F.CONNECTING;
3501
+ readyState = z.CONNECTING;
3491
3502
  socketId = Jo();
3492
3503
  listeners = /* @__PURE__ */ new Map();
3493
3504
  send(t) {
3494
- if (this.readyState !== F.OPEN)
3505
+ if (this.readyState !== z.OPEN)
3495
3506
  throw new DOMException("Pluno preview websocket is not open", "InvalidStateError");
3496
3507
  window.dispatchEvent(
3497
- new CustomEvent(ce(xn, this.channelId), {
3508
+ new CustomEvent(ce(vn, this.channelId), {
3498
3509
  detail: { socketId: this.socketId, data: typeof t == "string" ? t : String(t) }
3499
3510
  })
3500
3511
  );
3501
3512
  }
3502
3513
  close(t, n) {
3503
- this.readyState !== F.CLOSED && (this.readyState = F.CLOSING, window.dispatchEvent(
3504
- new CustomEvent(ce(vn, this.channelId), {
3514
+ this.readyState !== z.CLOSED && (this.readyState = z.CLOSING, window.dispatchEvent(
3515
+ new CustomEvent(ce(yn, this.channelId), {
3505
3516
  detail: { socketId: this.socketId, code: t, reason: n }
3506
3517
  })
3507
3518
  ), this.cleanup());
@@ -3539,9 +3550,9 @@ function Qo(e) {
3539
3550
  }
3540
3551
  function ea(e) {
3541
3552
  for (const t of Qo(e)) {
3542
- if (ht.has(t) || t.dataset.plunoAutoMount === "false")
3553
+ if (mt.has(t) || t.dataset.plunoAutoMount === "false")
3543
3554
  continue;
3544
- ht.add(t);
3555
+ mt.add(t);
3545
3556
  const n = t.dataset.plunoPreviewChannel;
3546
3557
  Vn({
3547
3558
  token: t.dataset.plunoToken,