@pluno/product-agent-web 0.1.50 → 0.1.52

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