@pluno/product-agent-web 0.1.83 → 0.1.85

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,17 +1,17 @@
1
- import { PlunoProductAgent as oi, getProductAgentOriginAccessErrorMessage as ii } from "./product-agent-sdk.js";
2
- const ai = "#7c3aed", ft = "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", wt = "#2c2a1e", Tn = [253, 250, 241], In = 3.5;
3
- function co(e) {
4
- const t = uo(e);
5
- if (An(nt(t), Tn) >= In)
1
+ import { PlunoProductAgent as pi, getProductAgentOriginAccessErrorMessage as si } from "./product-agent-sdk.js";
2
+ const di = "#7c3aed", ft = "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", wt = "#2c2a1e", An = [253, 250, 241], Nn = 3.5;
3
+ function mo(e) {
4
+ const t = fo(e);
5
+ if (Rn(ot(t), An) >= Nn)
6
6
  return t;
7
- let o = nt(t);
8
- const i = nt(wt);
7
+ let o = ot(t);
8
+ const i = ot(wt);
9
9
  for (let r = 0; r < 6; r += 1)
10
- if (o = pi(o, i, 0.22), An(o, Tn) >= In)
11
- return Zt(o);
12
- return Zt(o);
10
+ if (o = gi(o, i, 0.22), Rn(o, An) >= Nn)
11
+ return Jt(o);
12
+ return Jt(o);
13
13
  }
14
- function ri() {
14
+ function ci() {
15
15
  let n = "M 280 120", o = !1, i = 0;
16
16
  for (let r = 150; r <= 1170; r += 62) {
17
17
  const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
@@ -19,8 +19,8 @@ function ri() {
19
19
  }
20
20
  return n;
21
21
  }
22
- function li(e) {
23
- const t = uo(e), n = Jt(nt(t));
22
+ function ui(e) {
23
+ const t = fo(e), n = Qt(ot(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
@@ -44,90 +44,90 @@ function li(e) {
44
44
  inner: "#4b4b4b",
45
45
  shadow: "#000000"
46
46
  } : {
47
- top: ie(t, 0.28, -0.03),
48
- middle: ie(t, 0.08, 0.04),
49
- bottom: ie(t, -0.1, 0.02),
50
- edgeStart: ie(t, 0.08, 0.08),
51
- edgeMiddle: ie(t, -0.08, 0.08),
52
- edgeEnd: ie(t, -0.18, 0.05),
53
- glow: ie(t, 0.32, -0.12),
54
- highlight: ie(t, 0.38, -0.18),
55
- inner: ie(t, 0.24, -0.1),
56
- shadow: ie(t, -0.25, -0.08)
47
+ top: le(t, 0.28, -0.03),
48
+ middle: le(t, 0.08, 0.04),
49
+ bottom: le(t, -0.1, 0.02),
50
+ edgeStart: le(t, 0.08, 0.08),
51
+ edgeMiddle: le(t, -0.08, 0.08),
52
+ edgeEnd: le(t, -0.18, 0.05),
53
+ glow: le(t, 0.32, -0.12),
54
+ highlight: le(t, 0.38, -0.18),
55
+ inner: le(t, 0.24, -0.1),
56
+ shadow: le(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
- function uo(e) {
59
+ function fo(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()}` : ai;
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()}` : di;
62
62
  }
63
- function nt(e) {
63
+ function ot(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 Zt([e, t, n]) {
70
+ function Jt([e, t, n]) {
71
71
  const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
72
72
  return `#${o(e)}${o(t)}${o(n)}`;
73
73
  }
74
- function Jt([e, t, n]) {
74
+ function Qt([e, t, n]) {
75
75
  const o = (i) => {
76
76
  const r = i / 255;
77
77
  return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
78
78
  };
79
79
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
80
80
  }
81
- function An(e, t) {
82
- const n = Jt(e), o = Jt(t), [i, r] = n > o ? [n, o] : [o, n];
81
+ function Rn(e, t) {
82
+ const n = Qt(e), o = Qt(t), [i, r] = n > o ? [n, o] : [o, n];
83
83
  return (i + 0.05) / (r + 0.05);
84
84
  }
85
- function pi(e, t, n) {
86
- const o = Qt(n);
85
+ function gi(e, t, n) {
86
+ const o = en(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 ie(e, t, n) {
94
- const [o, i, r] = si(nt(e));
95
- return Zt(di(o, Qt(i + n), Qt(r + t)));
93
+ function le(e, t, n) {
94
+ const [o, i, r] = hi(ot(e));
95
+ return Jt(mi(o, en(i + n), en(r + t)));
96
96
  }
97
- function si([e, t, n]) {
97
+ function hi([e, t, n]) {
98
98
  const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), s = (l + p) / 2;
99
99
  if (l === p)
100
100
  return [0, 0, s];
101
- const u = l - p, c = s > 0.5 ? u / (2 - l - p) : u / (l + p);
102
- return [(l === o ? (i - r) / u + (i < r ? 6 : 0) : l === i ? (r - o) / u + 2 : (o - i) / u + 4) / 6, c, s];
101
+ const g = l - p, c = s > 0.5 ? g / (2 - l - p) : g / (l + p);
102
+ return [(l === o ? (i - r) / g + (i < r ? 6 : 0) : l === i ? (r - o) / g + 2 : (o - i) / g + 4) / 6, c, s];
103
103
  }
104
- function di(e, t, n) {
104
+ function mi(e, t, n) {
105
105
  if (t === 0)
106
106
  return [n * 255, n * 255, n * 255];
107
107
  const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
108
108
  return [
109
- Ft(i, o, e + 1 / 3) * 255,
110
- Ft(i, o, e) * 255,
111
- Ft(i, o, e - 1 / 3) * 255
109
+ Wt(i, o, e + 1 / 3) * 255,
110
+ Wt(i, o, e) * 255,
111
+ Wt(i, o, e - 1 / 3) * 255
112
112
  ];
113
113
  }
114
- function Ft(e, t, n) {
114
+ function Wt(e, t, n) {
115
115
  let o = n;
116
116
  return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
117
117
  }
118
- function Qt(e) {
118
+ function en(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
- const go = "suggest_share_on_socials";
122
- function ci(e) {
121
+ const wo = "suggest_share_on_socials";
122
+ function fi(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 !== go)
125
+ if (n.role !== "tool" || n.toolName !== wo)
126
126
  continue;
127
- const o = Nn(e, t, "assistant");
127
+ const o = Dn(e, t, "assistant");
128
128
  if (!o)
129
129
  return null;
130
- const i = Nn(e, o.index, "user");
130
+ const i = Dn(e, o.index, "user");
131
131
  return i ? {
132
132
  id: `share:${n.callId ?? n.id}`,
133
133
  userPrompt: i.content,
@@ -136,13 +136,13 @@ function ci(e) {
136
136
  }
137
137
  return null;
138
138
  }
139
- async function ui(e) {
140
- const t = await gi(e);
139
+ async function wi(e) {
140
+ const t = await bi(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 Nn(e, t, n) {
145
+ function Dn(e, t, n) {
146
146
  for (let o = t - 1; o >= 0; o -= 1) {
147
147
  const i = e[o];
148
148
  if (i.role === n && i.content.trim())
@@ -150,74 +150,74 @@ function Nn(e, t, n) {
150
150
  }
151
151
  return null;
152
152
  }
153
- async function gi(e) {
153
+ async function bi(e) {
154
154
  return await (await fetch(e)).blob();
155
155
  }
156
- const hi = "https://app.pluno.ai", mi = "/api/product-agent/embed/active-users", fi = 1800, wi = 15e3, bi = 250, _i = 1e3, xi = 3e4;
157
- function yi(e, t = {}) {
156
+ const _i = "https://app.pluno.ai", xi = "/api/product-agent/embed/active-users", yi = 1800, vi = 15e3, Ci = 250, Si = 1e3, Ei = 3e4;
157
+ function ki(e, t = {}) {
158
158
  let n = !1, o = null, i = null, r = null;
159
159
  const l = () => {
160
160
  r !== null && (window.clearInterval(r), r = null);
161
161
  }, p = (c) => {
162
162
  n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
163
- u();
164
- }, Si(c)));
163
+ g();
164
+ }, Ti(c)));
165
165
  }, s = (c) => {
166
166
  if (l(), o === null) {
167
167
  o = c, e(c);
168
168
  return;
169
169
  }
170
- const h = o, S = performance.now();
170
+ const h = o, C = performance.now();
171
171
  r = window.setInterval(() => {
172
172
  if (n) {
173
173
  l();
174
174
  return;
175
175
  }
176
- const v = Math.min(1, (performance.now() - S) / fi);
177
- o = Math.round(h + (c - h) * Ei(v)), e(o), v >= 1 && (o = c, e(c), l());
178
- }, bi);
179
- }, u = async () => {
176
+ const T = Math.min(1, (performance.now() - C) / yi);
177
+ o = Math.round(h + (c - h) * Ii(T)), e(o), T >= 1 && (o = c, e(c), l());
178
+ }, Ci);
179
+ }, g = async () => {
180
180
  try {
181
- const c = await vi(t);
181
+ const c = await Li(t);
182
182
  if (n)
183
183
  return;
184
184
  s(c.count), p(c.refreshAfterMs);
185
185
  } catch {
186
- p(wi);
186
+ p(vi);
187
187
  }
188
188
  };
189
- return u(), () => {
189
+ return g(), () => {
190
190
  n = !0, i !== null && window.clearTimeout(i), l();
191
191
  };
192
192
  }
193
- async function vi(e) {
193
+ async function Li(e) {
194
194
  if (e.loader)
195
195
  return e.loader();
196
- const n = await (e.fetcher ?? fetch)(new URL(mi, Ci(e.backendUrl ?? hi)).toString(), {
196
+ const n = await (e.fetcher ?? fetch)(new URL(xi, Pi(e.backendUrl ?? _i)).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(), i = Rn(o.count), r = Rn(o.refreshAfterMs ?? o.refresh_after_ms);
202
+ const o = await n.json(), i = zn(o.count), r = zn(o.refreshAfterMs ?? o.refresh_after_ms);
203
203
  if (i === null || r === null)
204
204
  throw new Error("Invalid active users response");
205
205
  return { count: i, refreshAfterMs: r };
206
206
  }
207
- function Rn(e) {
207
+ function zn(e) {
208
208
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
209
209
  }
210
- function Ci(e) {
210
+ function Pi(e) {
211
211
  return e.endsWith("/") ? e : `${e}/`;
212
212
  }
213
- function Si(e) {
214
- return Math.min(xi, Math.max(_i, e));
213
+ function Ti(e) {
214
+ return Math.min(Ei, Math.max(Si, e));
215
215
  }
216
- function Ei(e) {
216
+ function Ii(e) {
217
217
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
218
218
  }
219
- const ki = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
220
- function Li(e) {
219
+ const Ai = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
220
+ function Ni(e) {
221
221
  let t = "", n = "", o = null;
222
222
  for (const i of e.split(new RegExp("(?<=\\n)"))) {
223
223
  if (o) {
@@ -228,7 +228,7 @@ function Li(e) {
228
228
  }
229
229
  const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
230
230
  if (r) {
231
- t += Dn(n) + i, n = "", o = {
231
+ t += Mn(n) + i, n = "", o = {
232
232
  marker: r[1][0],
233
233
  length: r[1].length
234
234
  };
@@ -236,31 +236,31 @@ function Li(e) {
236
236
  }
237
237
  n += i;
238
238
  }
239
- return t + Dn(n);
239
+ return t + Mn(n);
240
240
  }
241
- function Dn(e) {
241
+ function Mn(e) {
242
242
  let t = "", n = 0;
243
- for (const o of e.matchAll(ki)) {
243
+ for (const o of e.matchAll(Ai)) {
244
244
  const i = o.index ?? 0;
245
- t += zn(
245
+ t += On(
246
246
  e.slice(n, i)
247
247
  ), t += o[0], n = i + o[0].length;
248
248
  }
249
- return t + zn(e.slice(n));
249
+ return t + On(e.slice(n));
250
250
  }
251
- function zn(e) {
251
+ function On(e) {
252
252
  return e.replace(
253
253
  /\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
254
- (t, n, o, i, r) => r[i - 1] === "!" || Pi(r, i) || Ti(r, i, n) ? t : `[${n}](${o})`
254
+ (t, n, o, i, r) => r[i - 1] === "!" || Ri(r, i) || Di(r, i, n) ? t : `[${n}](${o})`
255
255
  );
256
256
  }
257
- function Pi(e, t) {
257
+ function Ri(e, t) {
258
258
  let n = 0;
259
259
  for (let o = t - 1; e[o] === "\\"; o -= 1)
260
260
  n += 1;
261
261
  return n % 2 === 1;
262
262
  }
263
- function Ti(e, t, n) {
263
+ function Di(e, t, n) {
264
264
  if (n !== "x" && n !== "X")
265
265
  return !1;
266
266
  const o = e.lastIndexOf(`
@@ -269,7 +269,7 @@ function Ti(e, t, n) {
269
269
  e.slice(o, t)
270
270
  );
271
271
  }
272
- const ho = 100, Ii = 1e4, Ai = 5e3, Ni = "product-agent:sdk-preview-socket-connect", Ri = "product-agent:sdk-preview-socket-send", Di = "product-agent:sdk-preview-socket-close", zi = "product-agent:sdk-preview-socket-open", Mi = "product-agent:sdk-preview-socket-message", Oi = "product-agent:sdk-preview-socket-error", Ui = "product-agent:sdk-preview-socket-closed", Mn = "product-agent:sdk-preview-socket-id", Bi = "data-pluno-sdk-preview-channel", mo = "data-pluno-auto-mounted", ge = "__plunoProductAgentAutoMountOwner", Fi = 1e4, Hi = "Failed to load Pluno widget token", On = "Timed out loading Pluno widget token", Wi = "pluno.productAgent.widgetClientId.", Ht = /* @__PURE__ */ new Set(), Gi = "product-agent:preview-diagnostic", fo = "pluno.productAgent.sharePromptsDisabled", $i = 3, Un = 'dialog[open], [aria-modal="true"], [role="dialog"]', qi = 400, ji = 5e3, Vi = 500, Bn = "Close the page's popup to chat", Ki = "No recent chats for this page yet.", ae = {
272
+ const bo = 100, zi = 1e4, Mi = 5e3, Oi = "product-agent:sdk-preview-socket-connect", Ui = "product-agent:sdk-preview-socket-send", Bi = "product-agent:sdk-preview-socket-close", Fi = "product-agent:sdk-preview-socket-open", Wi = "product-agent:sdk-preview-socket-message", Hi = "product-agent:sdk-preview-socket-error", $i = "product-agent:sdk-preview-socket-closed", Un = "product-agent:sdk-preview-socket-id", Gi = "data-pluno-sdk-preview-channel", _o = "data-pluno-auto-mounted", me = "__plunoProductAgentAutoMountOwner", qi = 1e4, ji = "Failed to load Pluno widget token", Bn = "Timed out loading Pluno widget token", Vi = "pluno.productAgent.widgetClientId.", Ht = /* @__PURE__ */ new Set(), Ki = "product-agent:preview-diagnostic", xo = "pluno.productAgent.sharePromptsDisabled", Yi = 3, Fn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Xi = 400, Zi = 5e3, Ji = 500, Wn = "Close the page's popup to chat", Qi = "No recent chats for this page yet.", pe = {
273
273
  launcherLabel: "Ask for anything...",
274
274
  accentColor: "#7c3aed",
275
275
  colorScheme: "light",
@@ -277,7 +277,7 @@ const ho = 100, Ii = 1e4, Ai = 5e3, Ni = "product-agent:sdk-preview-socket-conne
277
277
  scribbleStyle: !0,
278
278
  position: "bottom-right",
279
279
  movableLauncher: !0
280
- }, Yi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Fn = "pluno-pa-scribble-font", wo = 190, bo = 41, Hn = 22, Xi = 16, Zi = 24, Ji = 1, Qi = 48, dn = 420, ea = 520, ta = 0.24, cn = 680, na = 800, oa = 0.76, A = 8, Ie = 50, _o = "http://www.w3.org/2000/svg", en = 26, tn = 8, ia = 36, nn = 16, aa = 4, Wn = [
280
+ }, ea = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Hn = "pluno-pa-scribble-font", yo = 190, vo = 41, $n = 22, ta = 1, na = 48, cn = 420, oa = 520, ia = 0.24, un = 680, aa = 800, ra = 0.76, A = 8, Ne = 50, Co = "http://www.w3.org/2000/svg", tn = 26, nn = 8, la = 36, on = 16, pa = 4, Gn = [
281
281
  {
282
282
  ellipseCx: "17.5",
283
283
  ellipseCy: "24.5",
@@ -314,20 +314,22 @@ const ho = 100, Ii = 1e4, Ai = 5e3, Ni = "product-agent:sdk-preview-socket-conne
314
314
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
315
315
  pathStrokeWidth: "2.45"
316
316
  }
317
- ], ra = 11, la = 13, on = 4, xo = 10, yo = 40, pa = "movable-launcher-position-v2", vo = "pluno-pa-widget-styles", Co = "data-pluno-pa-widget-styles";
318
- let Gn = 0;
319
- function sa(e) {
320
- return (t) => new he(t, e);
317
+ ], sa = 11, da = 13, an = 4, So = 10, Eo = 40, ca = "movable-launcher-position-v2", ko = "pluno-pa-widget-styles", Lo = "data-pluno-pa-widget-styles";
318
+ let qn = 0;
319
+ function ua(e) {
320
+ return (t) => new fe(t, e);
321
321
  }
322
- async function da(e = {}) {
322
+ async function ga(e = {}) {
323
323
  const t = {
324
- launcherLabel: e.launcherLabel ?? ae.launcherLabel,
325
- accentColor: e.accentColor ?? ae.accentColor,
326
- colorScheme: e.colorScheme ?? ae.colorScheme,
327
- fontFamily: e.fontFamily ?? ae.fontFamily,
328
- scribbleStyle: e.scribbleStyle ?? ae.scribbleStyle,
329
- position: e.position ?? ae.position,
330
- movableLauncher: e.movableLauncher ?? ae.movableLauncher,
324
+ layout: e.layout ?? "floating",
325
+ mountTarget: e.mountTarget,
326
+ launcherLabel: e.launcherLabel ?? pe.launcherLabel,
327
+ accentColor: e.accentColor ?? pe.accentColor,
328
+ colorScheme: e.colorScheme ?? pe.colorScheme,
329
+ fontFamily: e.fontFamily ?? pe.fontFamily,
330
+ scribbleStyle: e.scribbleStyle ?? pe.scribbleStyle,
331
+ position: e.position ?? pe.position,
332
+ movableLauncher: e.movableLauncher ?? pe.movableLauncher,
331
333
  token: e.token,
332
334
  tokenProvider: e.tokenProvider,
333
335
  tokenEndpoint: e.tokenEndpoint,
@@ -337,8 +339,10 @@ async function da(e = {}) {
337
339
  clientId: e.clientId,
338
340
  restorePersistedState: e.restorePersistedState,
339
341
  expectedPersistedSessionId: e.expectedPersistedSessionId,
342
+ keepRunsActiveOnSessionNavigation: e.keepRunsActiveOnSessionNavigation === !0,
340
343
  webSocketFactory: e.webSocketFactory,
341
344
  prepareAttachmentUpload: e.prepareAttachmentUpload,
345
+ attachmentsEnabled: e.attachmentsEnabled !== !1,
342
346
  loginRequired: e.loginRequired === !0,
343
347
  loginButtonLabel: e.loginButtonLabel ?? "Log in to Pluno",
344
348
  loginUrl: e.loginUrl,
@@ -358,13 +362,15 @@ async function da(e = {}) {
358
362
  initialDisplayState: e.initialDisplayState,
359
363
  onDisplayStateChange: e.onDisplayStateChange,
360
364
  onPanelOpenChange: e.onPanelOpenChange,
361
- showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
365
+ // Customer-embedded floating widgets should offer the same compact launcher state as the
366
+ // extension preview, while programmatic integrations can still opt out explicitly.
367
+ showLauncherMinimizeButton: e.showLauncherMinimizeButton !== !1,
362
368
  morningReport: e.morningReport ?? null,
363
369
  onMorningReportSnooze: e.onMorningReportSnooze,
364
370
  onMorningReportTaskStart: e.onMorningReportTaskStart,
365
371
  taskNotifications: e.taskNotifications
366
372
  };
367
- ne(
373
+ K(
368
374
  "web-sdk.widget",
369
375
  "Mounting widget with merged options",
370
376
  {
@@ -380,122 +386,123 @@ async function da(e = {}) {
380
386
  }
381
387
  );
382
388
  const n = document.createElement("div");
383
- n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
384
- Bi,
389
+ n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", t.layout), t.sdkPreviewChannelId && n.setAttribute(
390
+ Gi,
385
391
  t.sdkPreviewChannelId
386
392
  );
387
393
  const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
388
- i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
389
- let r = $n(
394
+ i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.classList.add(`pluno-pa-widget--layout-${t.layout}`), i.setAttribute("data-pluno-product-agent-ui-root", "widget");
395
+ let r = jn(
390
396
  t.accentColor,
391
397
  t.scribbleStyle
392
398
  );
393
- Ra(
399
+ Ma(
394
400
  i,
395
401
  t.launcherLabel,
396
402
  r,
397
403
  t.movableLauncher,
398
404
  t.showLauncherMinimizeButton
399
405
  ), o.appendChild(i);
400
- const l = Ir(t);
401
- let p = t.movableLauncher ? l.launcherPosition : null, s = p !== null, u = l.panelSize, c = null;
402
- 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"), Te(
406
+ const l = Rr(t), p = t.layout === "floating" ? t.initialDisplayState ?? Ar(t) : "shown";
407
+ co(t, p);
408
+ let s = t.movableLauncher ? l.launcherPosition : null, g = s !== null, c = l.panelSize, h = null;
409
+ i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Ae(
403
410
  i,
404
411
  Gt(
405
412
  i,
406
- p,
413
+ s,
407
414
  t.position
408
415
  )
409
- )), ro(o, t.accentColor), qn(i, r, {
416
+ )), so(o, t.accentColor), Vn(i, r, {
410
417
  accentColor: t.accentColor,
411
418
  colorScheme: t.colorScheme,
412
419
  fontFamily: t.fontFamily,
413
420
  scribbleStyle: t.scribbleStyle
414
421
  });
415
- const h = await Pr(), S = h.ownerDocument, v = i.querySelector(
422
+ const C = t.mountTarget ?? await Ir(), T = C.ownerDocument, I = i.querySelector(
416
423
  ".pluno-pa-widget__launcher"
417
424
  ), D = i.querySelector(
418
425
  ".pluno-pa-widget__launcher-drag-handle"
419
- ), C = i.querySelector(
426
+ ), u = i.querySelector(
420
427
  ".pluno-pa-widget__launcher-input"
421
- ), g = i.querySelector(
428
+ ), y = i.querySelector(
422
429
  ".pluno-pa-widget__launcher-minimize"
423
- ), y = i.querySelector(".pluno-pa-widget__panel"), m = i.querySelector(
430
+ ), m = i.querySelector(".pluno-pa-widget__panel"), S = i.querySelector(
424
431
  ".pluno-pa-widget__scribble-spirals--panel"
425
- ), k = Array.from(
432
+ ), z = Array.from(
426
433
  i.querySelectorAll(".pluno-pa-widget__resize-handle")
427
- ), N = i.querySelector(
434
+ ), L = i.querySelector(
428
435
  ".pluno-pa-widget__close"
429
- ), I = i.querySelector(
436
+ ), oe = i.querySelector(
430
437
  ".pluno-pa-widget__composer"
431
- ), G = i.querySelector(
438
+ ), J = i.querySelector(
432
439
  ".pluno-pa-widget__attachment-error"
433
- ), ye = i.querySelector(
440
+ ), Re = i.querySelector(
434
441
  ".pluno-pa-widget__billing-status"
435
- ), He = i.querySelector(
442
+ ), U = i.querySelector(
436
443
  ".pluno-pa-widget__attachments"
437
- ), z = i.querySelector(
444
+ ), we = i.querySelector(
438
445
  ".pluno-pa-widget__attachment-input"
439
- ), We = i.querySelector(
446
+ ), B = i.querySelector(
440
447
  ".pluno-pa-widget__attach"
441
- ), w = i.querySelector(
448
+ ), f = i.querySelector(
442
449
  ".pluno-pa-widget__input"
443
- ), O = i.querySelector(
450
+ ), Q = i.querySelector(
444
451
  ".pluno-pa-widget__send"
445
- ), ve = i.querySelector(
452
+ ), De = i.querySelector(
446
453
  ".pluno-pa-widget__top-actions"
447
- ), se = i.querySelector(
454
+ ), Ce = i.querySelector(
448
455
  ".pluno-pa-widget__history"
449
- ), ot = i.querySelector(
456
+ ), Se = i.querySelector(
450
457
  ".pluno-pa-widget__history-panel"
451
- ), $ = i.querySelector(
458
+ ), j = i.querySelector(
452
459
  ".pluno-pa-widget__history-list"
453
460
  ), it = i.querySelector(
454
461
  ".pluno-pa-widget__history-close"
455
- ), Ae = i.querySelector(
462
+ ), ie = i.querySelector(
456
463
  ".pluno-pa-widget__history-status"
457
- ), oe = i.querySelector(
458
- ".pluno-pa-widget__timeline-jump"
459
464
  ), x = i.querySelector(
465
+ ".pluno-pa-widget__timeline-jump"
466
+ ), N = i.querySelector(
460
467
  ".pluno-pa-widget__active-users-counter"
461
- ), E = i.querySelector(
468
+ ), P = i.querySelector(
462
469
  ".pluno-pa-widget__timeline"
463
- ), j = i.querySelector(
470
+ ), ae = i.querySelector(
464
471
  ".pluno-pa-widget__timeline-bottom-sentinel"
465
- ), V = i.querySelector(
472
+ ), H = i.querySelector(
466
473
  ".pluno-pa-widget__notify-suggestion"
467
- ), J = i.querySelector(
474
+ ), v = i.querySelector(
468
475
  ".pluno-pa-widget__notify-suggestion-enable"
469
- ), P = i.querySelector(
470
- ".pluno-pa-widget__notify-suggestion-later"
471
476
  ), R = i.querySelector(
477
+ ".pluno-pa-widget__notify-suggestion-later"
478
+ ), qo = i.querySelector(
472
479
  ".pluno-pa-widget__notify-suggestion-never"
473
480
  );
474
- if (!v || !C || !y || !N || !I || !G || !ye || !He || !z || !We || !w || !O || !ve || !se || !ot || !$ || !it || !Ae || !oe || !x || !E || !j)
481
+ if (!I || !u || !m || !L || !oe || !J || !Re || !U || !we || !B || !f || !Q || !De || !Ce || !Se || !j || !it || !ie || !x || !N || !P || !ae)
475
482
  throw new Error("Failed to mount Pluno widget");
476
483
  if (t.movableLauncher && !D)
477
484
  throw new Error("Failed to mount Pluno widget drag handle");
478
- Jn(C), Jn(w);
479
- let q = [], de = null;
480
- const Ne = () => {
481
- Ja(
482
- He,
485
+ B.hidden = !t.attachmentsEnabled, we.disabled = !t.attachmentsEnabled, eo(u), eo(f);
486
+ let q = [], ue = null;
487
+ const ze = () => {
488
+ tr(
489
+ U,
483
490
  q,
484
491
  (a) => {
485
492
  q = q.filter(
486
493
  (d, _) => _ !== a
487
- ), Ne(), F(b.getState()), H();
494
+ ), ze(), W(b.getState()), $();
488
495
  }
489
496
  );
490
- }, hn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Bo(t.tokenEndpoint) : void 0);
491
- if (!t.loginRequired && !t.signupRequired && !t.token && !hn && !t.webSocketFactory)
497
+ }, fn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => $o(t.tokenEndpoint) : void 0);
498
+ if (!t.loginRequired && !t.signupRequired && !t.token && !fn && !t.webSocketFactory)
492
499
  throw new Error("Pluno widget requires token or tokenEndpoint");
493
- const Ho = window.fetch.bind(window), vt = Tr(t.clientId);
500
+ const jo = window.fetch.bind(window), vt = Nr(t.clientId);
494
501
  let b;
495
502
  try {
496
503
  const a = {
497
504
  token: t.token,
498
- tokenProvider: hn,
505
+ tokenProvider: fn,
499
506
  backendUrl: t.backendUrl,
500
507
  metadata: () => ({
501
508
  ...t.metadata ?? {},
@@ -505,6 +512,7 @@ async function da(e = {}) {
505
512
  clientId: vt.clientId,
506
513
  restorePersistedState: t.restorePersistedState,
507
514
  expectedPersistedSessionId: t.expectedPersistedSessionId,
515
+ keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
508
516
  webSocketFactory: t.webSocketFactory,
509
517
  prepareAttachmentUpload: t.prepareAttachmentUpload,
510
518
  // The launcher is useful before a customer token endpoint responds. The widget owns connection
@@ -512,11 +520,11 @@ async function da(e = {}) {
512
520
  autoConnect: !1,
513
521
  disableNetworkCapture: !!t.sdkPreviewChannelId
514
522
  };
515
- b = await oi.init(a);
523
+ b = await pi.init(a);
516
524
  } catch (a) {
517
525
  throw vt.release(), n.remove(), a;
518
526
  }
519
- h.appendChild(n), ne(
527
+ C.appendChild(n), K(
520
528
  "web-sdk.widget",
521
529
  "Applied initial widget appearance",
522
530
  {
@@ -526,120 +534,120 @@ async function da(e = {}) {
526
534
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
527
535
  }
528
536
  );
529
- const Ct = new Set(l.openToolGroupKeys), Re = new Set(
537
+ const Ct = new Set(l.openToolGroupKeys), Me = new Set(
530
538
  l.seenShareCandidateIds
531
- ), at = new Set(Re);
532
- let St = l.sharePromptsDisabled || await Ar(t), Q = null, ce = !1, rt = !(t.loginRequired || t.signupRequired), me = !1, Ce = {
539
+ ), at = new Set(Me);
540
+ let St = l.sharePromptsDisabled || await Dr(t), ee = null, re = !1, rt = !(t.loginRequired || t.signupRequired), be = !1, Ee = {
533
541
  enabled: !0
534
- }, Se = 0, mn = "", fe = !1, ue = !1, we = [], Et = null, Ge = null;
535
- const ee = (a, d) => {
536
- Ce = { enabled: a, reason: d };
537
- }, te = () => {
538
- oe.hidden = !0;
539
- }, Wo = () => {
540
- oe.hidden = !1;
541
- }, Go = (a = "jump") => {
542
- ee(!0, a), te(), tt(E, () => Ce.enabled), Se = E.scrollTop;
543
- }, Ee = () => {
544
- if (se.hidden = t.loginRequired, ot.hidden = !fe, se.setAttribute("aria-expanded", String(fe)), $.classList.toggle(
542
+ }, ke = 0, wn = "", _e = !1, ge = !1, xe = [], Et = null, $e = null;
543
+ const te = (a, d) => {
544
+ Ee = { enabled: a, reason: d };
545
+ }, ne = () => {
546
+ x.hidden = !0;
547
+ }, Vo = () => {
548
+ x.hidden = !1;
549
+ }, Ko = (a = "jump") => {
550
+ te(!0, a), ne(), nt(P, () => Ee.enabled), ke = P.scrollTop;
551
+ }, Le = () => {
552
+ if (Ce.hidden = t.layout === "page" || t.loginRequired, Se.hidden = !_e, Ce.setAttribute("aria-expanded", String(_e)), j.classList.toggle(
545
553
  "pluno-pa-widget__history-list--center",
546
- ue && we.length === 0
547
- ), $.replaceChildren(), ue && we.length === 0) {
554
+ ge && xe.length === 0
555
+ ), j.replaceChildren(), ge && xe.length === 0) {
548
556
  const a = document.createElement("p");
549
- a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", $.appendChild(a);
557
+ a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", j.appendChild(a);
550
558
  }
551
- for (const a of we) {
559
+ for (const a of xe) {
552
560
  const d = document.createElement("button");
553
- d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ue;
561
+ d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ge;
554
562
  const _ = document.createElement("span");
555
- _.className = "pluno-pa-widget__history-item-title", _.textContent = Ia(a);
556
- const T = document.createElement("time");
557
- T.className = "pluno-pa-widget__history-time", T.dateTime = a.lastActiveAt, T.textContent = Na(
563
+ _.className = "pluno-pa-widget__history-item-title", _.textContent = Ra(a);
564
+ const k = document.createElement("time");
565
+ k.className = "pluno-pa-widget__history-time", k.dateTime = a.lastActiveAt, k.textContent = za(
558
566
  a.lastActiveAt,
559
567
  Date.now()
560
568
  );
561
569
  const M = document.createElement("small");
562
- M.className = "pluno-pa-widget__history-path", M.textContent = Aa(a), d.append(_, T, M), d.addEventListener("click", () => {
563
- fe = !1, Ge = null, Ee(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
564
- }), $.appendChild(d);
570
+ M.className = "pluno-pa-widget__history-path", M.textContent = Da(a), d.append(_, k, M), d.addEventListener("click", () => {
571
+ _e = !1, $e = null, Le(), te(!0, "newSession"), ne(), b.loadSession(a.id), W(b.getState());
572
+ }), j.appendChild(d);
565
573
  }
566
- if (ue && we.length > 0) {
574
+ if (ge && xe.length > 0) {
567
575
  const a = document.createElement("p");
568
- a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", $.appendChild(a);
576
+ a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", j.appendChild(a);
569
577
  }
570
- Ae.textContent = Ge ?? (!ue && we.length === 0 ? "No recent chats for this page yet." : ""), Ae.hidden = Ae.textContent.length === 0;
571
- }, fn = async (a) => {
572
- if (!ue) {
573
- ue = !0, Ge = null, Ee();
578
+ ie.textContent = $e ?? (!ge && xe.length === 0 ? "No recent chats for this page yet." : ""), ie.hidden = ie.textContent.length === 0;
579
+ }, bn = async (a) => {
580
+ if (!ge) {
581
+ ge = !0, $e = null, Le();
574
582
  try {
575
583
  const d = await b.listSessions({ cursor: a, limit: 20 });
576
- we = a ? [...we, ...d.sessions] : d.sessions, Et = d.nextCursor;
584
+ xe = a ? [...xe, ...d.sessions] : d.sessions, Et = d.nextCursor;
577
585
  } catch (d) {
578
- ne(
586
+ K(
579
587
  "web-sdk.widget",
580
588
  "Failed to load session history",
581
589
  {
582
590
  message: d instanceof Error ? d.message : String(d)
583
591
  }
584
- ), Ge = Ki;
592
+ ), $e = Qi;
585
593
  } finally {
586
- ue = !1, Ee();
594
+ ge = !1, Le();
587
595
  }
588
596
  }
589
- }, $o = () => {
590
- !Et || ue || $.scrollHeight - $.scrollTop - $.clientHeight <= 24 && fn(Et);
591
- }, wn = () => {
592
- ce || typeof document > "u" || (ro(o, t.accentColor), n.isConnected || S.body?.appendChild(n));
593
- }, bn = new MutationObserver(wn);
594
- bn.observe(S.documentElement, {
597
+ }, Yo = () => {
598
+ !Et || ge || j.scrollHeight - j.scrollTop - j.clientHeight <= 24 && bn(Et);
599
+ }, _n = () => {
600
+ re || typeof document > "u" || (so(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || T.body?.appendChild(n)));
601
+ }, xn = new MutationObserver(_n);
602
+ xn.observe(T.documentElement, {
595
603
  childList: !0,
596
604
  subtree: !0
597
- }), wn();
598
- const $e = (a = !0) => {
605
+ }), _n();
606
+ const Ge = (a = !0) => {
599
607
  const d = bt(i, a);
600
- return an(
608
+ return rn(
601
609
  i,
602
- p ? So(p, d) : ba(
610
+ s ? Po(s, d) : ya(
603
611
  i,
604
612
  t.position,
605
613
  d
606
614
  ),
607
615
  d
608
616
  );
609
- }, B = () => {
610
- const a = Ea(o, C, w);
611
- Rr(t, {
617
+ }, F = () => {
618
+ const a = Pa(o, u, f);
619
+ Mr(t, {
612
620
  isOpen: i.classList.contains("pluno-pa-widget--open"),
613
- composerValue: w.value,
621
+ composerValue: f.value,
614
622
  focusedInput: a,
615
623
  focusedInputAt: a ? Date.now() : null,
616
624
  openToolGroupKeys: [...Ct],
617
- launcherPosition: s ? p : null,
618
- panelSize: u,
619
- seenShareCandidateIds: [...Re].slice(
620
- -ho
625
+ launcherPosition: g ? s : null,
626
+ panelSize: c,
627
+ seenShareCandidateIds: [...Me].slice(
628
+ -bo
621
629
  ),
622
630
  sharePromptsDisabled: St
623
631
  });
624
632
  }, lt = (a) => {
625
633
  t.onDisplayStateChange?.(a);
626
634
  }, qe = (a, d = !0) => {
627
- if (a === "shown") {
628
- i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && je(!1), d && lt("shown");
635
+ if (co(t, a), a === "shown") {
636
+ i.classList.remove("pluno-pa-widget--minimized"), I.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && je(!1), d && lt("shown");
629
637
  return;
630
638
  }
631
- Q !== null && (window.clearTimeout(Q), Q = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, y.hidden = !0, N.hidden = !0, v.tabIndex = 0, w.value = "", Te(
639
+ ee !== null && (window.clearTimeout(ee), ee = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), I.hidden = !1, m.hidden = !0, L.hidden = !0, I.tabIndex = 0, f.value = "", Ae(
632
640
  i,
633
641
  Gt(
634
642
  i,
635
- p,
643
+ s,
636
644
  t.position
637
645
  )
638
- ), Yn(i), B(), d && lt("minimized");
639
- }, ke = (a, d = {}) => {
640
- Sa(a, {
641
- debugVersion: pa,
642
- launcherPosition: p,
646
+ ), Zn(i), F(), d && lt("minimized");
647
+ }, Pe = (a, d = {}) => {
648
+ La(a, {
649
+ debugVersion: ca,
650
+ launcherPosition: s,
643
651
  rootClasses: i.className,
644
652
  rootStyle: {
645
653
  left: i.style.left,
@@ -647,37 +655,40 @@ async function da(e = {}) {
647
655
  right: i.style.right,
648
656
  bottom: i.style.bottom
649
657
  },
650
- rootRect: qt(i),
651
- launcherRect: qt(v),
652
- panelRect: qt(y),
658
+ rootRect: jt(i),
659
+ launcherRect: jt(I),
660
+ panelRect: jt(m),
653
661
  viewport: Z(),
654
- panelHidden: y.hidden,
655
- closeHidden: N.hidden,
662
+ panelHidden: m.hidden,
663
+ closeHidden: L.hidden,
656
664
  ...d
657
665
  });
658
666
  }, je = (a = !0) => {
659
- if (!p)
660
- return Te(i, null), $e(a);
661
- const d = $e(a);
662
- return Te(i, d), ke("Applied stored closed launcher position", {
667
+ if (!s)
668
+ return Ae(i, null), Ge(a);
669
+ const d = Ge(a);
670
+ return Ae(i, d), Pe("Applied stored closed launcher position", {
663
671
  visibleLauncherPosition: d
664
672
  }), d;
665
673
  }, kt = (a, d) => {
666
674
  if (!a || !d) {
667
- Yn(i);
675
+ Zn(i);
668
676
  return;
669
677
  }
670
- Ca(i, {
678
+ ka(i, {
671
679
  x: a.x - d.x,
672
680
  y: a.y - d.y
673
681
  });
674
- }, _n = () => {
682
+ }, Lt = () => {
683
+ const a = tt(c).width;
684
+ return t.layout === "page" && m.getBoundingClientRect().width || a;
685
+ }, yn = () => {
675
686
  if (i.classList.contains("pluno-pa-widget--minimized")) {
676
- Te(
687
+ Ae(
677
688
  i,
678
689
  Gt(
679
690
  i,
680
- p,
691
+ s,
681
692
  t.position
682
693
  )
683
694
  );
@@ -685,162 +696,170 @@ async function da(e = {}) {
685
696
  }
686
697
  const a = je();
687
698
  if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
688
- Wt(i, u);
689
- const d = Fe(u);
690
- Vt(
691
- m,
692
- d.width
699
+ $t(i, c);
700
+ const d = tt(c);
701
+ Kt(
702
+ S,
703
+ Lt()
693
704
  );
694
705
  const _ = mt(
695
- c ?? $t(
706
+ h ?? qt(
696
707
  i,
697
708
  a,
698
709
  t.position,
699
- u
710
+ c
700
711
  ),
701
712
  d
702
713
  );
703
- c && (c = _), kt(_, a), ke(
714
+ h && (h = _), kt(_, a), Pe(
704
715
  "Applied open panel position after viewport resize",
705
716
  { openPanelPosition: _ }
706
717
  );
707
- } else p && ke(
718
+ } else s && Pe(
708
719
  "Applied visible launcher position after viewport resize",
709
720
  { visibleLauncherPosition: a }
710
721
  );
711
722
  };
712
- let xn = () => {
723
+ let vn = () => {
713
724
  };
714
- window.addEventListener("resize", _n), t.movableLauncher && D ? (je(), xn = ma({
725
+ window.addEventListener("resize", yn), t.movableLauncher && D ? (je(), vn = ba({
715
726
  root: i,
716
- launcher: v,
727
+ launcher: I,
717
728
  launcherDragHandle: D,
718
- getPosition: () => $e(),
729
+ getPosition: () => Ge(),
719
730
  setPosition: (a) => {
720
- const d = a, _ = bt(i), T = an(
731
+ const d = a, _ = bt(i), k = rn(
721
732
  i,
722
733
  a,
723
734
  _
724
735
  );
725
- p = xa(
726
- T,
736
+ s = Ca(
737
+ k,
727
738
  _
728
- ), Te(i, T), ke("Dragging closed launcher", {
739
+ ), Ae(i, k), Pe("Dragging closed launcher", {
729
740
  requestedPosition: d
730
741
  });
731
742
  },
732
743
  persist: () => {
733
- s = !0, B(), ke("Persisted closed launcher drag position");
744
+ g = !0, F(), Pe("Persisted closed launcher drag position");
734
745
  }
735
- })) : Te(i, null), Wt(i, u);
736
- const qo = () => {
737
- const a = Fe(u), d = $e();
746
+ })) : Ae(i, null), $t(i, c);
747
+ const Xo = () => {
748
+ const a = tt(c), d = Ge();
738
749
  return {
739
750
  position: mt(
740
- c ?? $t(
751
+ h ?? qt(
741
752
  i,
742
753
  d,
743
754
  t.position,
744
- u
755
+ c
745
756
  ),
746
757
  a
747
758
  ),
748
759
  size: a
749
760
  };
750
- }, jo = (a) => {
751
- u = xt(a.size), Wt(i, u), Vt(
752
- m,
753
- Fe(u).width
754
- ), c = mt(
761
+ }, Zo = (a) => {
762
+ c = xt(a.size), $t(i, c), Kt(
763
+ S,
764
+ Lt()
765
+ ), h = mt(
755
766
  a.position,
756
- Fe(u)
767
+ tt(c)
757
768
  );
758
- const d = $e();
759
- kt(c, d);
760
- }, Vo = k.length > 0 ? fa({
769
+ const d = Ge();
770
+ kt(h, d);
771
+ }, Jo = z.length > 0 ? _a({
761
772
  root: i,
762
- handles: k,
763
- getBounds: qo,
764
- setBounds: jo,
765
- persist: B
773
+ handles: z,
774
+ getBounds: Xo,
775
+ setBounds: Zo,
776
+ persist: F
766
777
  }) : () => {
767
778
  };
768
- let Lt = !1;
769
- const yn = async () => {
770
- if (!(!t.billingStatusLoader || Lt)) {
771
- Lt = !0;
779
+ let Pt = !1;
780
+ const Cn = async () => {
781
+ if (!(!t.billingStatusLoader || Pt)) {
782
+ Pt = !0;
772
783
  try {
773
784
  const a = await t.billingStatusLoader();
774
- eo(
785
+ if (re)
786
+ return;
787
+ no(
775
788
  t.billingStatus,
776
789
  a,
777
790
  b.getState().lastErrorCode
778
- ) && (t.billingStatus = a, Yt(
779
- ye,
791
+ ) && (t.billingStatus = a, Xt(
792
+ Re,
780
793
  t.billingStatus,
781
794
  b.getState().lastErrorCode
782
- ), H());
795
+ ), $());
796
+ } catch (a) {
797
+ K(
798
+ "web-sdk.widget",
799
+ "Failed to refresh billing status",
800
+ { message: a instanceof Error ? a.message : String(a) }
801
+ );
783
802
  } finally {
784
- Lt = !1;
803
+ Pt = !1;
785
804
  }
786
805
  }
787
- }, be = (a = "", d = !0) => {
788
- yn(), Ye && (Ye = !1, It()), i.classList.contains("pluno-pa-widget--open") || (c = null), Q !== null && (window.clearTimeout(Q), Q = null), qe("shown", !1), y.hidden = !1, N.hidden = !1, Vt(
789
- m,
790
- Fe(u).width
806
+ }, he = (a = "", d = !0) => {
807
+ Cn(), Ye && (Ye = !1, At()), i.classList.contains("pluno-pa-widget--open") || (h = null), ee !== null && (window.clearTimeout(ee), ee = null), qe("shown", !1), m.hidden = !1, L.hidden = !1, Kt(
808
+ S,
809
+ Lt()
791
810
  ), i.classList.remove("pluno-pa-widget--closing");
792
- const _ = je(), T = $t(
811
+ const _ = je(), k = qt(
793
812
  i,
794
813
  _,
795
814
  t.position,
796
- u
815
+ c
797
816
  );
798
- if (kt(T, _), ke("Opening launcher at clamped open panel position", {
799
- openPanelPosition: T,
817
+ if (kt(k, _), Pe("Opening launcher at clamped open panel position", {
818
+ openPanelPosition: k,
800
819
  visibleLauncherPosition: _
801
- }), ee(!0, "open"), te(), !d) {
802
- i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, et(w)), tt(E, () => Ce.enabled), Se = E.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0);
820
+ }), te(!0, "open"), ne(), !d) {
821
+ i.classList.add("pluno-pa-widget--open"), I.hidden = !0, a && (f.value = a, et(f)), nt(P, () => Ee.enabled), ke = P.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), lt("shown"), t.onPanelOpenChange?.(!0);
803
822
  return;
804
823
  }
805
824
  window.requestAnimationFrame(() => {
806
- i.classList.add("pluno-pa-widget--open"), a && (w.value = a, et(w)), tt(E, () => Ce.enabled), Se = E.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0), Q = window.setTimeout(() => {
807
- v.hidden = !0, tt(E, () => Ce.enabled), Se = E.scrollTop;
825
+ i.classList.add("pluno-pa-widget--open"), a && (f.value = a, et(f)), nt(P, () => Ee.enabled), ke = P.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), lt("shown"), t.onPanelOpenChange?.(!0), ee = window.setTimeout(() => {
826
+ I.hidden = !0, nt(P, () => Ee.enabled), ke = P.scrollTop;
808
827
  }, 220);
809
828
  });
810
- }, Pt = () => {
811
- Q !== null && (window.clearTimeout(Q), Q = null), v.hidden = !1, p && (je(!1), ke("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Q = window.setTimeout(() => {
812
- y.hidden = !0, N.hidden = !0, c = null, i.classList.remove("pluno-pa-widget--closing");
829
+ }, Tt = () => {
830
+ ee !== null && (window.clearTimeout(ee), ee = null), I.hidden = !1, s && (je(!1), Pe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), F(), t.onPanelOpenChange?.(!1), ee = window.setTimeout(() => {
831
+ m.hidden = !0, L.hidden = !0, h = null, i.classList.remove("pluno-pa-widget--closing");
813
832
  }, 220);
814
833
  };
815
- v.addEventListener("submit", (a) => {
816
- a.preventDefault(), be(C.value), C.value = "";
834
+ I.addEventListener("submit", (a) => {
835
+ a.preventDefault(), he(u.value), u.value = "";
817
836
  }), D?.addEventListener("click", (a) => {
818
837
  a.preventDefault(), a.stopPropagation();
819
- }), v.addEventListener("click", (a) => {
820
- a.target === C && !D || (be(C.value), C.value = "");
821
- }), C.addEventListener("focus", () => {
822
- be(C.value), C.value = "";
823
- }), C.addEventListener("input", () => {
824
- if (!C.value)
838
+ }), I.addEventListener("click", (a) => {
839
+ a.target === u && !D || (he(u.value), u.value = "");
840
+ }), u.addEventListener("focus", () => {
841
+ he(u.value), u.value = "";
842
+ }), u.addEventListener("input", () => {
843
+ if (!u.value)
825
844
  return;
826
- const a = C.value;
827
- be(a), C.value = "";
845
+ const a = u.value;
846
+ he(a), u.value = "";
828
847
  });
829
- let Tt = null, pt = null, Le = null;
830
- const vn = (a) => a === C || a === w, Ko = (a) => {
848
+ let It = null, pt = null, Te = null;
849
+ const Sn = (a) => a === u || a === f, Qo = (a) => {
831
850
  if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
832
851
  return null;
833
852
  let d = a;
834
853
  for (; d; ) {
835
- const _ = d.closest(Un);
854
+ const _ = d.closest(Fn);
836
855
  if (_)
837
856
  return _;
838
- const T = d.getRootNode();
839
- d = T instanceof ShadowRoot ? T.host : null;
857
+ const k = d.getRootNode();
858
+ d = k instanceof ShadowRoot ? k.host : null;
840
859
  }
841
860
  return null;
842
- }, Yo = (a) => {
843
- if (!a.isConnected || !a.matches(Un))
861
+ }, ei = (a) => {
862
+ if (!a.isConnected || !a.matches(Fn))
844
863
  return !1;
845
864
  if (!(a instanceof HTMLElement))
846
865
  return !0;
@@ -850,73 +869,73 @@ async function da(e = {}) {
850
869
  return a.checkVisibility();
851
870
  const d = window.getComputedStyle(a);
852
871
  return d.display !== "none" && d.visibility !== "hidden";
853
- }, Cn = (a) => {
854
- Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Pe(), a !== null ? Le = window.setInterval(() => {
872
+ }, En = (a) => {
873
+ Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ie(), a !== null ? Te = window.setInterval(() => {
855
874
  const d = Ke;
856
- (!d || !Yo(d)) && Cn(null);
857
- }, Vi) : Le !== null && (window.clearInterval(Le), Le = null, pt = null));
858
- }, Xo = () => {
859
- Le !== null && (window.clearInterval(Le), Le = null);
875
+ (!d || !ei(d)) && En(null);
876
+ }, Ji) : Te !== null && (window.clearInterval(Te), Te = null, pt = null));
877
+ }, ti = () => {
878
+ Te !== null && (window.clearInterval(Te), Te = null);
860
879
  };
861
880
  i.addEventListener("focusin", (a) => {
862
- vn(a.target) && (Tt = Date.now(), B());
881
+ Sn(a.target) && (It = Date.now(), F());
863
882
  }), i.addEventListener("focusout", (a) => {
864
- if (!vn(a.target) || Ke !== null)
883
+ if (!Sn(a.target) || Ke !== null)
865
884
  return;
866
- const d = Tt;
867
- if (Tt = null, d === null || Date.now() - d > qi)
885
+ const d = It;
886
+ if (It = null, d === null || Date.now() - d > Xi)
868
887
  return;
869
- const _ = Ko(a.relatedTarget);
888
+ const _ = Qo(a.relatedTarget);
870
889
  if (!_)
871
890
  return;
872
- const T = Date.now();
873
- if (pt !== null && T - pt <= ji) {
874
- Cn(_);
891
+ const k = Date.now();
892
+ if (pt !== null && k - pt <= Zi) {
893
+ En(_);
875
894
  return;
876
895
  }
877
- pt = T;
878
- }), v.addEventListener("keydown", (a) => {
879
- !i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), be());
880
- }), g?.addEventListener("pointerdown", (a) => {
896
+ pt = k;
897
+ }), I.addEventListener("keydown", (a) => {
898
+ !i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), he());
899
+ }), y?.addEventListener("pointerdown", (a) => {
881
900
  a.stopPropagation();
882
- }), g?.addEventListener("click", (a) => {
901
+ }), y?.addEventListener("click", (a) => {
883
902
  a.preventDefault(), a.stopPropagation(), qe("minimized");
884
- }), N.addEventListener("click", Pt), E.addEventListener("scroll", () => {
885
- E.scrollTop < Se - 1 && ee(!1, "userScroll"), Se = E.scrollTop;
886
- }), oe.addEventListener("click", () => {
887
- Go();
903
+ }), L.addEventListener("click", Tt), P.addEventListener("scroll", () => {
904
+ P.scrollTop < ke - 1 && te(!1, "userScroll"), ke = P.scrollTop;
905
+ }), x.addEventListener("click", () => {
906
+ Ko();
888
907
  });
889
- const Sn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
908
+ const kn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
890
909
  ([a]) => {
891
- a?.isIntersecting && (ee(!0, "bottom"), te());
910
+ a?.isIntersecting && (te(!0, "bottom"), ne());
892
911
  },
893
- { root: E, threshold: 0 }
912
+ { root: P, threshold: 0 }
894
913
  );
895
- Sn?.observe(j);
914
+ kn?.observe(ae);
896
915
  const Ve = () => t.loginRequired || t.signupRequired;
897
916
  let Ke = null, Ye = !1;
898
- const K = () => rt || b.getState().status !== "connected", Pe = () => {
899
- const a = Ve(), d = Ke !== null, _ = !a && K();
900
- C.readOnly = a || d || _, w.readOnly = d || _, C.placeholder = d ? Bn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ye ? "New update" : t.launcherLabel, w.placeholder = d ? Bn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ae.launcherLabel, I.hidden = a;
901
- }, H = () => {
902
- O.disabled = K() || le(t.billingStatus) || !b.getState().isThinking && w.value.trim().length === 0 && q.length === 0, We.disabled = Ve() || K() || le(t.billingStatus);
917
+ const V = () => rt || b.getState().status !== "connected", Ie = () => {
918
+ const a = Ve(), d = Ke !== null, _ = !a && V();
919
+ u.readOnly = a || d || _, f.readOnly = d || _, u.placeholder = d ? Wn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ye ? "New update" : t.launcherLabel, f.placeholder = d ? Wn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : pe.launcherLabel, oe.hidden = a;
920
+ }, $ = () => {
921
+ Q.disabled = V() || de(t.billingStatus) || !b.getState().isThinking && f.value.trim().length === 0 && q.length === 0, B.disabled = Ve() || V() || de(t.billingStatus);
903
922
  };
904
- Pe();
905
- const It = () => {
923
+ Ie();
924
+ const At = () => {
906
925
  const a = b.getState().isThinking;
907
926
  i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
908
927
  "pluno-pa-widget--unread",
909
928
  !a && Ye
910
- ), Pe();
929
+ ), Ie();
911
930
  };
912
- It();
913
- const At = () => {
914
- Ve() || ce || (rt = !0, Pe(), H(), b.connect().then(
931
+ At();
932
+ const Nt = () => {
933
+ Ve() || re || (rt = !0, Ie(), $(), b.connect().then(
915
934
  () => {
916
- ce || (rt = !1, Pe(), H());
935
+ re || (rt = !1, Ie(), $());
917
936
  },
918
937
  (a) => {
919
- ce || (rt = !1, Pe(), H(), ne(
938
+ re || (rt = !1, Ie(), $(), K(
920
939
  "web-sdk.widget",
921
940
  "Failed to connect Product Agent widget",
922
941
  {
@@ -926,7 +945,7 @@ async function da(e = {}) {
926
945
  }
927
946
  ));
928
947
  };
929
- I.addEventListener("submit", (a) => {
948
+ oe.addEventListener("submit", (a) => {
930
949
  if (a.preventDefault(), t.loginRequired) {
931
950
  t.onLoginClick?.();
932
951
  return;
@@ -935,65 +954,65 @@ async function da(e = {}) {
935
954
  t.onSignupClick?.();
936
955
  return;
937
956
  }
938
- K() || le(t.billingStatus) || (me = !0, ee(!0, "send"), te(), q = jt(
957
+ V() || de(t.billingStatus) || (be = !0, te(!0, "send"), ne(), q = Vt(
939
958
  b,
940
- w,
959
+ f,
941
960
  q
942
- ), Ne(), H());
961
+ ), ze(), $());
943
962
  });
944
963
  let Xe = 0;
945
- const Zo = () => {
964
+ const ni = () => {
946
965
  Xe = 0, i.classList.remove("pluno-pa-widget--drag-over");
947
- }, Nt = (a) => {
948
- de !== null && window.clearTimeout(de), G.textContent = a, G.hidden = !1, de = window.setTimeout(() => {
949
- G.textContent = "", G.hidden = !0, de = null;
966
+ }, Rt = (a) => {
967
+ ue !== null && window.clearTimeout(ue), J.textContent = a, J.hidden = !1, ue = window.setTimeout(() => {
968
+ J.textContent = "", J.hidden = !0, ue = null;
950
969
  }, 3e3);
951
- }, Jo = () => {
952
- de !== null && (window.clearTimeout(de), de = null), G.textContent = "", G.hidden = !0;
953
- }, Rt = async (a) => {
954
- if (a.length === 0)
970
+ }, oi = () => {
971
+ ue !== null && (window.clearTimeout(ue), ue = null), J.textContent = "", J.hidden = !0;
972
+ }, Dt = async (a) => {
973
+ if (!t.attachmentsEnabled || a.length === 0)
955
974
  return;
956
- const d = tr(b, a);
957
- q = [...q, ...d], Ne(), Jo(), H(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || be();
975
+ const d = ir(b, a);
976
+ q = [...q, ...d], ze(), oi(), $(), W(b.getState()), i.classList.contains("pluno-pa-widget--open") || he();
958
977
  };
959
- We.addEventListener("click", () => {
960
- t.loginRequired || K() || le(t.billingStatus) || z.click();
961
- }), z.addEventListener("change", () => {
962
- const a = Array.from(z.files ?? []);
963
- z.value = "", Rt(a).catch((d) => {
964
- Nt(
978
+ B.addEventListener("click", () => {
979
+ t.loginRequired || V() || de(t.billingStatus) || we.click();
980
+ }), we.addEventListener("change", () => {
981
+ const a = Array.from(we.files ?? []);
982
+ we.value = "", Dt(a).catch((d) => {
983
+ Rt(
965
984
  d instanceof Error ? d.message : "Failed to attach file"
966
- ), ne("web-sdk.widget", "Attachment failed", {
985
+ ), K("web-sdk.widget", "Attachment failed", {
967
986
  message: d instanceof Error ? d.message : String(d)
968
987
  });
969
988
  });
970
989
  }), i.addEventListener("dragenter", (a) => {
971
- !ut(a.dataTransfer) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Xe += 1, i.classList.add("pluno-pa-widget--drag-over"));
990
+ !t.attachmentsEnabled || !ut(a.dataTransfer) || t.loginRequired || V() || (a.preventDefault(), a.stopPropagation(), Xe += 1, i.classList.add("pluno-pa-widget--drag-over"));
972
991
  }), i.addEventListener("dragover", (a) => {
973
992
  const d = a.dataTransfer;
974
- !ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
993
+ !t.attachmentsEnabled || !ut(d) || t.loginRequired || V() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
975
994
  }), i.addEventListener("dragleave", (a) => {
976
995
  ut(a.dataTransfer) && (a.stopPropagation(), Xe = Math.max(0, Xe - 1), Xe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
977
996
  }), i.addEventListener("drop", (a) => {
978
997
  const d = a.dataTransfer;
979
- !ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Zo(), Rt(d.files).catch((_) => {
980
- Nt(
998
+ !t.attachmentsEnabled || !ut(d) || t.loginRequired || V() || (a.preventDefault(), a.stopPropagation(), ni(), Dt(d.files).catch((_) => {
999
+ Rt(
981
1000
  _ instanceof Error ? _.message : "Failed to attach file"
982
- ), ne("web-sdk.widget", "Attachment failed", {
1001
+ ), K("web-sdk.widget", "Attachment failed", {
983
1002
  message: _ instanceof Error ? _.message : String(_)
984
1003
  });
985
1004
  }));
986
1005
  }), i.addEventListener("paste", (a) => {
987
1006
  a.stopPropagation();
988
1007
  const d = a.clipboardData, _ = Array.from(d?.files ?? []);
989
- _.length === 0 || t.loginRequired || K() || (a.preventDefault(), Rt(_).catch((T) => {
990
- Nt(
991
- T instanceof Error ? T.message : "Failed to attach file"
992
- ), ne("web-sdk.widget", "Attachment failed", {
993
- message: T instanceof Error ? T.message : String(T)
1008
+ !t.attachmentsEnabled || _.length === 0 || t.loginRequired || V() || (a.preventDefault(), Dt(_).catch((k) => {
1009
+ Rt(
1010
+ k instanceof Error ? k.message : "Failed to attach file"
1011
+ ), K("web-sdk.widget", "Attachment failed", {
1012
+ message: k instanceof Error ? k.message : String(k)
994
1013
  });
995
1014
  }));
996
- }), O.addEventListener("click", () => {
1015
+ }), Q.addEventListener("click", () => {
997
1016
  if (t.loginRequired) {
998
1017
  t.onLoginClick?.();
999
1018
  return;
@@ -1002,42 +1021,42 @@ async function da(e = {}) {
1002
1021
  b.stop();
1003
1022
  return;
1004
1023
  }
1005
- K() || (me = !0, ee(!0, "send"), te(), q = jt(
1024
+ V() || (be = !0, te(!0, "send"), ne(), q = Vt(
1006
1025
  b,
1007
- w,
1026
+ f,
1008
1027
  q
1009
- ), Ne(), H(), F(b.getState()));
1010
- }), se.addEventListener("click", () => {
1011
- fe = !fe, Ge = null, Ee(), fe && we.length === 0 && fn(null);
1028
+ ), ze(), $(), W(b.getState()));
1029
+ }), Ce.addEventListener("click", () => {
1030
+ _e = !_e, $e = null, Le(), _e && xe.length === 0 && bn(null);
1012
1031
  }), it.addEventListener("click", () => {
1013
- fe = !1, Ee();
1014
- }), $.addEventListener("scroll", $o), w.addEventListener("input", () => {
1015
- et(w), B(), H(), ti();
1016
- }), w.addEventListener("keydown", (a) => {
1032
+ _e = !1, Le();
1033
+ }), j.addEventListener("scroll", Yo), f.addEventListener("input", () => {
1034
+ et(f), F(), $(), ri();
1035
+ }), f.addEventListener("keydown", (a) => {
1017
1036
  if (!(a.key !== "Enter" || a.shiftKey)) {
1018
1037
  if (a.preventDefault(), t.loginRequired) {
1019
1038
  t.onLoginClick?.();
1020
1039
  return;
1021
1040
  }
1022
- K() || (me = !0, ee(!0, "send"), te(), q = jt(
1041
+ V() || (be = !0, te(!0, "send"), ne(), q = Vt(
1023
1042
  b,
1024
- w,
1043
+ f,
1025
1044
  q
1026
- ), Ne(), H(), F(b.getState()));
1045
+ ), ze(), $(), W(b.getState()));
1027
1046
  }
1028
1047
  }), i.addEventListener("click", (a) => {
1029
- (a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
1030
- }), l.composerValue && (w.value = l.composerValue, et(w)), t.initialDisplayState === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(w.value, !1), ka(l, i, C, w);
1048
+ (a.target instanceof Element ? a.target : null)?.closest("a[href]") && F();
1049
+ }), l.composerValue && (f.value = l.composerValue, et(f)), t.layout === "page" ? he(f.value, !1) : p === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && he(f.value, !1), Ta(l, i, u, f);
1031
1050
  const st = () => r;
1032
- let Dt = b.getState().appearance !== null, dt = null, Ze = null, De = null, En = b.getState().isThinking, ze = null;
1051
+ let zt = b.getState().appearance !== null, dt = null, Ze = null, Oe = null, Ln = b.getState().isThinking, Ue = null;
1033
1052
  const Je = t.taskNotifications;
1034
- let Me = null, Oe = !1;
1035
- const kn = () => {
1036
- Me !== null && (window.clearTimeout(Me), Me = null);
1053
+ let Be = null, Fe = !1;
1054
+ const Pn = () => {
1055
+ Be !== null && (window.clearTimeout(Be), Be = null);
1037
1056
  }, ct = () => {
1038
- V && (V.hidden = !0);
1039
- }, Ln = () => b.getState().assistantDraft.trim().length > 0, Qo = async () => {
1040
- if (!Je || !V || Oe || ce || !b.getState().isThinking || Ln())
1057
+ H && (H.hidden = !0);
1058
+ }, Tn = () => b.getState().assistantDraft.trim().length > 0, ii = async () => {
1059
+ if (!Je || !H || Fe || re || !b.getState().isThinking || Tn())
1041
1060
  return;
1042
1061
  let a;
1043
1062
  try {
@@ -1045,47 +1064,47 @@ async function da(e = {}) {
1045
1064
  } catch {
1046
1065
  return;
1047
1066
  }
1048
- a.enabled || a.neverSuggest || !b.getState().isThinking || Ln() || Oe || ce || (V.hidden = !1);
1067
+ a.enabled || a.neverSuggest || !b.getState().isThinking || Tn() || Fe || re || (H.hidden = !1);
1049
1068
  };
1050
- J?.addEventListener("click", () => {
1051
- Oe = !0, ct(), Je?.enable().catch(() => {
1069
+ v?.addEventListener("click", () => {
1070
+ Fe = !0, ct(), Je?.enable().catch(() => {
1052
1071
  });
1053
- }), P?.addEventListener("click", () => {
1054
- Oe = !0, ct();
1055
1072
  }), R?.addEventListener("click", () => {
1056
- Oe = !0, ct(), Je?.dismissForever().catch(() => {
1073
+ Fe = !0, ct();
1074
+ }), qo?.addEventListener("click", () => {
1075
+ Fe = !0, ct(), Je?.dismissForever().catch(() => {
1057
1076
  });
1058
1077
  });
1059
- let Ue = null, Pn = () => {
1078
+ let We = null, In = () => {
1060
1079
  };
1061
- const ei = !!t.socialPostDraftHandler, zt = /* @__PURE__ */ new Map(), Mt = () => w.value.trim().length > 0 || q.length > 0, ti = () => {
1062
- const a = Ue !== null && Xt(b.getState(), Mt());
1063
- x.hidden = !a, a && Ue !== null && ko(x, Ue);
1080
+ const ai = !!t.socialPostDraftHandler, Mt = /* @__PURE__ */ new Map(), Ot = () => f.value.trim().length > 0 || q.length > 0, ri = () => {
1081
+ const a = We !== null && Zt(b.getState(), Ot());
1082
+ N.hidden = !a, a && We !== null && Io(N, We);
1064
1083
  };
1065
- let Be = null;
1066
- const Ot = (a = {}) => {
1067
- me = !0, ee(!0, "newSession"), te(), fe = !1, Ee(), b.startNewSession(a), Ct.clear(), w.value = "", q = [], Ne(), et(w), B(), H(), w.focus(), F(b.getState());
1068
- }, Ut = (a) => {
1069
- if (!a) {
1070
- Be?.remove(), Be = null;
1084
+ let He = null;
1085
+ const Ut = (a = {}) => {
1086
+ be = !0, te(!0, "newSession"), ne(), _e = !1, Le(), b.startNewSession(a), Ct.clear(), f.value = "", q = [], ze(), et(f), F(), $(), f.focus(), W(b.getState());
1087
+ }, Bt = (a) => {
1088
+ if (!a || t.layout === "page") {
1089
+ He?.remove(), He = null;
1071
1090
  return;
1072
1091
  }
1073
- Be || (Be = yt(
1092
+ He || (He = yt(
1074
1093
  "pluno-pa-widget__new-chat",
1075
1094
  "New chat",
1076
- $a(),
1095
+ Va(),
1077
1096
  !1
1078
- ), Be.addEventListener("click", () => Ot()), ve.insertBefore(Be, se));
1079
- }, F = (a) => {
1080
- if (Ee(), gn(a.lastErrorCode) ? ze = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (ze = null), Yt(
1081
- ye,
1097
+ ), He.addEventListener("click", () => Ut()), De.insertBefore(He, Ce));
1098
+ }, W = (a) => {
1099
+ if (Le(), hn(a.lastErrorCode) ? Ue = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (Ue = null), Xt(
1100
+ Re,
1082
1101
  t.billingStatus,
1083
- ze
1102
+ Ue
1084
1103
  ), t.loginRequired) {
1085
- zt.clear(), io(
1086
- E,
1087
- O,
1088
- Ut,
1104
+ Mt.clear(), ro(
1105
+ P,
1106
+ Q,
1107
+ Bt,
1089
1108
  st,
1090
1109
  "Log in to use Pluno on this page.",
1091
1110
  t.loginButtonLabel,
@@ -1095,10 +1114,10 @@ async function da(e = {}) {
1095
1114
  return;
1096
1115
  }
1097
1116
  if (t.signupRequired) {
1098
- zt.clear(), io(
1099
- E,
1100
- O,
1101
- Ut,
1117
+ Mt.clear(), ro(
1118
+ P,
1119
+ Q,
1120
+ Bt,
1102
1121
  st,
1103
1122
  "Complete signup to unlock your free trial credits.",
1104
1123
  t.signupButtonLabel,
@@ -1107,78 +1126,78 @@ async function da(e = {}) {
1107
1126
  );
1108
1127
  return;
1109
1128
  }
1110
- const d = Pa(a), _ = d !== mn;
1111
- mn = d;
1112
- const T = me || Ce.enabled;
1113
- me = !1, pr(
1114
- E,
1115
- j,
1116
- O,
1117
- Ut,
1118
- x,
1129
+ const d = Aa(a), _ = d !== wn;
1130
+ wn = d;
1131
+ const k = be || Ee.enabled;
1132
+ be = !1, cr(
1133
+ P,
1134
+ ae,
1135
+ Q,
1136
+ Bt,
1137
+ N,
1119
1138
  a,
1120
- Ue,
1121
- Ue !== null && Xt(a, Mt()),
1122
- T,
1123
- () => Ce.enabled,
1139
+ We,
1140
+ We !== null && Zt(a, Ot()),
1141
+ k,
1142
+ () => Ee.enabled,
1124
1143
  Ct,
1125
- zt,
1126
- B,
1144
+ Mt,
1145
+ F,
1127
1146
  st,
1128
1147
  (M) => {
1129
- if (K())
1148
+ if (V())
1130
1149
  return;
1131
1150
  const Qe = t.morningReport !== null;
1132
- t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ot()), me = !0, ee(!0, "send"), te(), b.sendMessage(M);
1151
+ t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ut()), be = !0, te(!0, "send"), ne(), b.sendMessage(M);
1133
1152
  },
1134
1153
  () => {
1135
- me = !0, ee(!0, "send"), te(), b.retryLastMessage();
1154
+ be = !0, te(!0, "send"), ne(), b.retryLastMessage();
1136
1155
  },
1137
1156
  t.morningReport,
1138
1157
  () => {
1139
- t.morningReport = null, t.onMorningReportSnooze?.(), Pt(), F(b.getState());
1158
+ t.morningReport = null, t.onMorningReportSnooze?.(), Tt(), W(b.getState());
1140
1159
  },
1141
- At,
1142
- ei && !St ? {
1160
+ Nt,
1161
+ ai && !St ? {
1143
1162
  dismissedCandidateIds: at,
1144
1163
  draftingCandidateId: dt,
1145
1164
  error: Ze,
1146
1165
  characterIconOptions: st(),
1147
1166
  onSeen: (M) => {
1148
- Re.add(M.id), B();
1167
+ Me.add(M.id), F();
1149
1168
  },
1150
1169
  onDraft: (M) => {
1151
- ni(M);
1170
+ li(M);
1152
1171
  },
1153
1172
  onDismiss: (M) => {
1154
- Re.add(M.id), at.add(M.id), B(), Ze = null, F(b.getState());
1173
+ Me.add(M.id), at.add(M.id), F(), Ze = null, W(b.getState());
1155
1174
  },
1156
1175
  onDisable: (M) => {
1157
- St = !0, Re.add(M.id), at.add(M.id), B(), Nr(t, !0), Ze = null, F(b.getState());
1176
+ St = !0, Me.add(M.id), at.add(M.id), F(), zr(t, !0), Ze = null, W(b.getState());
1158
1177
  }
1159
1178
  } : void 0
1160
- ), T ? (Se = E.scrollTop, te()) : _ && Ta(a) && Wo();
1179
+ ), k ? (ke = P.scrollTop, ne()) : _ && Na(a) && Vo();
1161
1180
  };
1162
- return Pn = yi(
1181
+ return In = ki(
1163
1182
  (a) => {
1164
- Ue = a, !ce && Xt(b.getState(), Mt()) && F(b.getState());
1183
+ We = a, !re && Zt(b.getState(), Ot()) && W(b.getState());
1165
1184
  },
1166
1185
  {
1167
1186
  backendUrl: t.backendUrl,
1168
- fetcher: Ho,
1187
+ fetcher: jo,
1169
1188
  loader: t.activeUsersLoader
1170
1189
  }
1171
1190
  ), b.on("state", (a) => {
1172
- const d = En && !a.isThinking;
1173
- En = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Oe && Me === null && V?.hidden !== !1 && (Me = window.setTimeout(() => {
1174
- Me = null, Qo();
1175
- }, Ii)), (!a.isThinking || a.assistantDraft.trim()) && (kn(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ye = !0), It(), a.appearance ? (Dt = !0, ne(
1191
+ const d = Ln && !a.isThinking;
1192
+ Ln = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Fe && Be === null && H?.hidden !== !1 && (Be = window.setTimeout(() => {
1193
+ Be = null, ii();
1194
+ }, zi)), (!a.isThinking || a.assistantDraft.trim()) && (Pn(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ye = !0), At(), a.appearance ? (zt = !0, K(
1176
1195
  "web-sdk.widget",
1177
1196
  "Agent state supplied appearance",
1178
1197
  {
1179
1198
  appearance: a.appearance
1180
1199
  }
1181
- ), Bt(a.appearance, "agent.state.appearance")) : Dt && (Dt = !1, ne(
1200
+ ), Ft(a.appearance, "agent.state.appearance")) : zt && (zt = !1, K(
1182
1201
  "web-sdk.widget",
1183
1202
  "Agent state cleared appearance; reverting to configured widget options",
1184
1203
  {
@@ -1186,34 +1205,34 @@ async function da(e = {}) {
1186
1205
  fallbackColorScheme: t.colorScheme,
1187
1206
  fallbackFontFamily: t.fontFamily
1188
1207
  }
1189
- ), Bt({}, "agent.state.appearance-cleared")), F(a), H(), d && yn();
1190
- }), F(b.getState()), H(), At(), {
1208
+ ), Ft({}, "agent.state.appearance-cleared")), W(a), $(), d && Cn();
1209
+ }), W(b.getState()), $(), Nt(), {
1191
1210
  agent: b,
1192
- startNewChat: Ot,
1211
+ startNewChat: Ut,
1193
1212
  host: n,
1194
1213
  updateAppearance: (a) => {
1195
- a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Bt(a, "widgetHandle.updateAppearance");
1214
+ a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Ft(a, "widgetHandle.updateAppearance");
1196
1215
  },
1197
1216
  updateBillingStatus: (a) => {
1198
1217
  const d = a ?? null;
1199
- eo(
1218
+ no(
1200
1219
  t.billingStatus,
1201
1220
  d,
1202
- ze
1203
- ) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (ze = null), Yt(
1221
+ Ue
1222
+ ) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (Ue = null), Xt(
1204
1223
  i.querySelector(".pluno-pa-widget__billing-status"),
1205
1224
  t.billingStatus,
1206
- ze
1207
- ), H());
1225
+ Ue
1226
+ ), $());
1208
1227
  },
1209
1228
  updateAuthGate: (a) => {
1210
1229
  const d = Ve();
1211
- t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), Pe(), F(b.getState()), H(), d && !Ve() && At();
1230
+ t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), Ie(), W(b.getState()), $(), d && !Ve() && Nt();
1212
1231
  },
1213
1232
  openPanel: () => {
1214
- be(w.value, !1);
1233
+ he(f.value, !1);
1215
1234
  },
1216
- closePanel: Pt,
1235
+ closePanel: Tt,
1217
1236
  updateDisplayState: (a) => {
1218
1237
  if (a === "shown") {
1219
1238
  qe("shown", !1);
@@ -1222,63 +1241,63 @@ async function da(e = {}) {
1222
1241
  qe("minimized", !1);
1223
1242
  },
1224
1243
  updateMorningReport: (a) => {
1225
- t.morningReport = a ?? null, F(b.getState());
1244
+ t.morningReport = a ?? null, W(b.getState());
1226
1245
  },
1227
1246
  destroy: () => {
1228
- ce || (B(), ce = !0, bn.disconnect(), Sn?.disconnect(), Xo(), window.removeEventListener("resize", _n), xn(), Vo(), de !== null && window.clearTimeout(de), kn(), Pn(), De?.remove(), b.destroy(), vt.release(), n.remove());
1247
+ re || (F(), re = !0, xn.disconnect(), kn?.disconnect(), ti(), window.removeEventListener("resize", yn), vn(), Jo(), ue !== null && window.clearTimeout(ue), Pn(), In(), Oe?.remove(), b.destroy(), vt.release(), n.remove());
1229
1248
  }
1230
1249
  };
1231
- async function ni(a) {
1250
+ async function li(a) {
1232
1251
  if (!dt) {
1233
- dt = a.id, Ze = null, F(b.getState());
1252
+ dt = a.id, Ze = null, W(b.getState());
1234
1253
  try {
1235
1254
  if (!t.socialPostDraftHandler)
1236
1255
  throw new Error("Social post drafting is not available here.");
1237
1256
  const d = await t.socialPostDraftHandler(a);
1238
1257
  if (!d.linkedinPost || !d.xPost)
1239
1258
  throw new Error("Pluno did not return a complete social post draft.");
1240
- Re.add(a.id), at.add(a.id), B(), De?.remove(), De = fr(d, {
1259
+ Me.add(a.id), at.add(a.id), F(), Oe?.remove(), Oe = _r(d, {
1241
1260
  socialPostRewardsUrl: t.socialPostRewardsUrl,
1242
1261
  onClose: () => {
1243
- De?.remove(), De = null;
1262
+ Oe?.remove(), Oe = null;
1244
1263
  }
1245
- }), i.appendChild(De);
1264
+ }), i.appendChild(Oe);
1246
1265
  } catch (d) {
1247
1266
  Ze = d instanceof Error ? d.message : "Could not draft social post.";
1248
1267
  } finally {
1249
- dt = null, F(b.getState());
1268
+ dt = null, W(b.getState());
1250
1269
  }
1251
1270
  }
1252
1271
  }
1253
- function Bt(a, d) {
1254
- const _ = a.accentColor ?? t.accentColor, T = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, Qe = a.scribbleStyle ?? t.scribbleStyle;
1255
- r = $n(
1272
+ function Ft(a, d) {
1273
+ const _ = a.accentColor ?? t.accentColor, k = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, Qe = a.scribbleStyle ?? t.scribbleStyle;
1274
+ r = jn(
1256
1275
  _,
1257
1276
  Qe
1258
- ), qn(i, r, {
1277
+ ), Vn(i, r, {
1259
1278
  accentColor: _,
1260
- colorScheme: T,
1279
+ colorScheme: k,
1261
1280
  fontFamily: M,
1262
1281
  scribbleStyle: Qe
1263
- }), ne("web-sdk.widget", "Updated widget appearance", {
1282
+ }), K("web-sdk.widget", "Updated widget appearance", {
1264
1283
  source: d,
1265
1284
  inputAppearance: a,
1266
1285
  appliedAccentColor: _,
1267
- appliedColorScheme: T,
1286
+ appliedColorScheme: k,
1268
1287
  appliedFontFamily: M,
1269
1288
  appliedScribbleStyle: Qe,
1270
1289
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
1271
1290
  });
1272
1291
  }
1273
1292
  }
1274
- function $n(e, t) {
1293
+ function jn(e, t) {
1275
1294
  return { accentColor: e, scribbleStyle: t };
1276
1295
  }
1277
- function ca(e) {
1278
- const t = ua(e);
1279
- return t === null ? "#fafafa" : ga(t) > 0.5 ? "#18181b" : "#fafaf9";
1296
+ function ha(e) {
1297
+ const t = ma(e);
1298
+ return t === null ? "#fafafa" : fa(t) > 0.5 ? "#18181b" : "#fafaf9";
1280
1299
  }
1281
- function ua(e) {
1300
+ function ma(e) {
1282
1301
  const t = e.trim();
1283
1302
  return /^#[0-9a-f]{6}$/i.test(t) ? [
1284
1303
  Number.parseInt(t.slice(1, 3), 16),
@@ -1290,14 +1309,14 @@ function ua(e) {
1290
1309
  Number.parseInt(t[3] + t[3], 16)
1291
1310
  ] : null;
1292
1311
  }
1293
- function ga([e, t, n]) {
1312
+ function fa([e, t, n]) {
1294
1313
  const o = (i) => {
1295
1314
  const r = i / 255;
1296
1315
  return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
1297
1316
  };
1298
1317
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
1299
1318
  }
1300
- function qn(e, t, n) {
1319
+ function Vn(e, t, n) {
1301
1320
  e.classList.toggle(
1302
1321
  "pluno-pa-widget--dark",
1303
1322
  n.colorScheme === "dark"
@@ -1305,27 +1324,27 @@ function qn(e, t, n) {
1305
1324
  "pluno-pa-widget--light",
1306
1325
  n.colorScheme !== "dark"
1307
1326
  ), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
1308
- const o = n.scribbleStyle ? co(n.accentColor) : n.accentColor;
1327
+ const o = n.scribbleStyle ? mo(n.accentColor) : n.accentColor;
1309
1328
  e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
1310
1329
  "--pluno-pa-accent-contrast",
1311
- ca(o)
1312
- ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Yi : n.fontFamily, n.scribbleStyle && ha(e.ownerDocument);
1330
+ ha(o)
1331
+ ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ea : n.fontFamily, n.scribbleStyle && wa(e.ownerDocument);
1313
1332
  const i = Array.from(
1314
1333
  e.querySelectorAll(".pluno-pa-widget__character")
1315
1334
  );
1316
1335
  for (const r of i)
1317
1336
  r.replaceWith(
1318
- xe(
1337
+ ve(
1319
1338
  Array.from(r.classList).join(" "),
1320
1339
  t
1321
1340
  )
1322
1341
  );
1323
1342
  }
1324
- function ha(e) {
1325
- if (e.getElementById(Fn))
1343
+ function wa(e) {
1344
+ if (e.getElementById(Hn))
1326
1345
  return;
1327
1346
  const t = e.createElement("style");
1328
- t.id = Fn, t.textContent = `@font-face {
1347
+ t.id = Hn, t.textContent = `@font-face {
1329
1348
  font-family: "Architects Daughter";
1330
1349
  font-style: normal;
1331
1350
  font-weight: 400;
@@ -1333,7 +1352,7 @@ function ha(e) {
1333
1352
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
1334
1353
  }`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
1335
1354
  }
1336
- function ma({
1355
+ function ba({
1337
1356
  root: e,
1338
1357
  launcher: t,
1339
1358
  launcherDragHandle: n,
@@ -1341,82 +1360,82 @@ function ma({
1341
1360
  setPosition: i,
1342
1361
  persist: r
1343
1362
  }) {
1344
- let l = null, p = null, s = null, u = !1, c = null;
1363
+ let l = null, p = null, s = null, g = !1, c = null;
1345
1364
  const h = () => {
1346
- l = null, p = null, s = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
1347
- }, S = (m) => {
1348
- e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(), u = !1, t.setPointerCapture?.(m.pointerId));
1349
- }, v = (m) => {
1365
+ l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--dragging");
1366
+ }, C = (m) => {
1367
+ e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(), g = !1, t.setPointerCapture?.(m.pointerId));
1368
+ }, T = (m) => {
1350
1369
  if (l !== m.pointerId || !p || !s)
1351
1370
  return;
1352
1371
  m.preventDefault();
1353
- const k = m.clientX - p.x, N = m.clientY - p.y;
1354
- !u && Math.hypot(k, N) < on || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + k, y: s.y + N }));
1372
+ const S = m.clientX - p.x, z = m.clientY - p.y;
1373
+ !g && Math.hypot(S, z) < an || (g = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + S, y: s.y + z }));
1374
+ }, I = (m) => {
1375
+ l === m.pointerId && (m.preventDefault(), m.stopPropagation(), g && (c = { x: m.clientX, y: m.clientY }, r()), h());
1355
1376
  }, D = (m) => {
1356
- l === m.pointerId && (m.preventDefault(), m.stopPropagation(), u && (c = { x: m.clientX, y: m.clientY }, r()), h());
1357
- }, C = (m) => {
1358
1377
  l === m.pointerId && (m.preventDefault(), h());
1359
- }, g = (m) => {
1378
+ }, u = (m) => {
1360
1379
  if (!c)
1361
1380
  return;
1362
- const k = Math.hypot(
1381
+ const S = Math.hypot(
1363
1382
  m.clientX - c.x,
1364
1383
  m.clientY - c.y
1365
- ) <= on;
1366
- c = null, k && (m.preventDefault(), m.stopPropagation());
1384
+ ) <= an;
1385
+ c = null, S && (m.preventDefault(), m.stopPropagation());
1367
1386
  }, y = (m) => {
1368
1387
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1369
1388
  return;
1370
- const k = m.shiftKey ? yo : xo, N = o();
1371
- let I = null;
1372
- m.key === "ArrowUp" ? I = { x: N.x, y: N.y - k } : m.key === "ArrowDown" ? I = { x: N.x, y: N.y + k } : m.key === "ArrowLeft" ? I = { x: N.x - k, y: N.y } : m.key === "ArrowRight" && (I = { x: N.x + k, y: N.y }), I && (m.preventDefault(), m.stopPropagation(), i(I), r());
1389
+ const S = m.shiftKey ? Eo : So, z = o();
1390
+ let L = null;
1391
+ m.key === "ArrowUp" ? L = { x: z.x, y: z.y - S } : m.key === "ArrowDown" ? L = { x: z.x, y: z.y + S } : m.key === "ArrowLeft" ? L = { x: z.x - S, y: z.y } : m.key === "ArrowRight" && (L = { x: z.x + S, y: z.y }), L && (m.preventDefault(), m.stopPropagation(), i(L), r());
1373
1392
  };
1374
- return t.addEventListener("pointerdown", S), t.addEventListener("pointermove", v), t.addEventListener("pointerup", D), t.addEventListener("pointercancel", C), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
1375
- t.removeEventListener("pointerdown", S), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", D), t.removeEventListener("pointercancel", C), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
1393
+ return t.addEventListener("pointerdown", C), t.addEventListener("pointermove", T), t.addEventListener("pointerup", I), t.addEventListener("pointercancel", D), t.addEventListener("click", u, !0), n.addEventListener("keydown", y), () => {
1394
+ t.removeEventListener("pointerdown", C), t.removeEventListener("pointermove", T), t.removeEventListener("pointerup", I), t.removeEventListener("pointercancel", D), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", y);
1376
1395
  };
1377
1396
  }
1378
- function fa({
1397
+ function _a({
1379
1398
  root: e,
1380
1399
  handles: t,
1381
1400
  getBounds: n,
1382
1401
  setBounds: o,
1383
1402
  persist: i
1384
1403
  }) {
1385
- let r = null, l = null, p = null, s = null, u = !1;
1404
+ let r = null, l = null, p = null, s = null, g = !1;
1386
1405
  const c = () => {
1387
- r = null, l = null, p = null, s = null, u = !1, e.classList.remove("pluno-pa-widget--resizing");
1388
- }, h = (g) => {
1389
- const y = g.currentTarget, m = y.dataset.resizeDirection;
1390
- !e.classList.contains("pluno-pa-widget--open") || !jn(m) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = m, p = { x: g.clientX, y: g.clientY }, s = n(), u = !1, y.setPointerCapture?.(g.pointerId));
1391
- }, S = (g) => {
1392
- if (r !== g.pointerId || !l || !p || !s)
1406
+ r = null, l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--resizing");
1407
+ }, h = (u) => {
1408
+ const y = u.currentTarget, m = y.dataset.resizeDirection;
1409
+ !e.classList.contains("pluno-pa-widget--open") || !Kn(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, p = { x: u.clientX, y: u.clientY }, s = n(), g = !1, y.setPointerCapture?.(u.pointerId));
1410
+ }, C = (u) => {
1411
+ if (r !== u.pointerId || !l || !p || !s)
1393
1412
  return;
1394
- g.preventDefault(), g.stopPropagation();
1395
- const y = g.clientX - p.x, m = g.clientY - p.y;
1396
- !u && Math.hypot(y, m) < on || (u = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1397
- Vn(s, l, y, m)
1413
+ u.preventDefault(), u.stopPropagation();
1414
+ const y = u.clientX - p.x, m = u.clientY - p.y;
1415
+ !g && Math.hypot(y, m) < an || (g = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1416
+ Yn(s, l, y, m)
1398
1417
  ));
1399
- }, v = (g) => {
1400
- r === g.pointerId && (g.preventDefault(), g.stopPropagation(), u && i(), c());
1401
- }, D = (g) => {
1402
- r === g.pointerId && (g.preventDefault(), c());
1403
- }, C = (g) => {
1404
- const m = g.currentTarget.dataset.resizeDirection, k = g.shiftKey ? yo : xo, N = n();
1405
- let I = 0, G = 0;
1406
- jn(m) && (g.key === "ArrowLeft" ? I = -k : g.key === "ArrowRight" ? I = k : g.key === "ArrowUp" ? G = -k : g.key === "ArrowDown" && (G = k), !(I === 0 && G === 0) && (g.preventDefault(), g.stopPropagation(), o(Vn(N, m, I, G)), i()));
1418
+ }, T = (u) => {
1419
+ r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && i(), c());
1420
+ }, I = (u) => {
1421
+ r === u.pointerId && (u.preventDefault(), c());
1422
+ }, D = (u) => {
1423
+ const m = u.currentTarget.dataset.resizeDirection, S = u.shiftKey ? Eo : So, z = n();
1424
+ let L = 0, oe = 0;
1425
+ Kn(m) && (u.key === "ArrowLeft" ? L = -S : u.key === "ArrowRight" ? L = S : u.key === "ArrowUp" ? oe = -S : u.key === "ArrowDown" && (oe = S), !(L === 0 && oe === 0) && (u.preventDefault(), u.stopPropagation(), o(Yn(z, m, L, oe)), i()));
1407
1426
  };
1408
- for (const g of t)
1409
- g.addEventListener("pointerdown", h), g.addEventListener("pointermove", S), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", D), g.addEventListener("keydown", C);
1427
+ for (const u of t)
1428
+ u.addEventListener("pointerdown", h), u.addEventListener("pointermove", C), u.addEventListener("pointerup", T), u.addEventListener("pointercancel", I), u.addEventListener("keydown", D);
1410
1429
  return () => {
1411
- for (const g of t)
1412
- g.removeEventListener("pointerdown", h), g.removeEventListener("pointermove", S), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", D), g.removeEventListener("keydown", C);
1430
+ for (const u of t)
1431
+ u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", C), u.removeEventListener("pointerup", T), u.removeEventListener("pointercancel", I), u.removeEventListener("keydown", D);
1413
1432
  };
1414
1433
  }
1415
- function jn(e) {
1434
+ function Kn(e) {
1416
1435
  return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
1417
1436
  }
1418
- function Vn(e, t, n, o) {
1419
- const i = Z(), r = Kn({
1437
+ function Yn(e, t, n, o) {
1438
+ const i = Z(), r = Xn({
1420
1439
  leading: e.position.x,
1421
1440
  length: e.size.width,
1422
1441
  delta: n,
@@ -1425,20 +1444,20 @@ function Vn(e, t, n, o) {
1425
1444
  minLeading: A,
1426
1445
  maxTrailing: i.width - A,
1427
1446
  minLength: Math.min(
1428
- dn,
1447
+ cn,
1429
1448
  i.width - A * 2
1430
1449
  )
1431
- }), l = Kn({
1450
+ }), l = Xn({
1432
1451
  leading: e.position.y,
1433
1452
  length: e.size.height,
1434
1453
  delta: o,
1435
1454
  resizeLeading: t.startsWith("top") || t === "top",
1436
1455
  resizeTrailing: t.startsWith("bottom") || t === "bottom",
1437
- minLeading: Ie,
1456
+ minLeading: Ne,
1438
1457
  maxTrailing: i.height - A,
1439
1458
  minLength: Math.min(
1440
- cn,
1441
- i.height - Ie - A
1459
+ un,
1460
+ i.height - Ne - A
1442
1461
  )
1443
1462
  });
1444
1463
  return {
@@ -1446,7 +1465,7 @@ function Vn(e, t, n, o) {
1446
1465
  size: { width: r.length, height: l.length }
1447
1466
  };
1448
1467
  }
1449
- function Kn({
1468
+ function Xn({
1450
1469
  leading: e,
1451
1470
  length: t,
1452
1471
  delta: n,
@@ -1458,30 +1477,30 @@ function Kn({
1458
1477
  }) {
1459
1478
  const s = e + t;
1460
1479
  if (o) {
1461
- const u = e + n;
1462
- if (u >= r) {
1463
- const h = X(u, r, s - p);
1480
+ const g = e + n;
1481
+ if (g >= r) {
1482
+ const h = X(g, r, s - p);
1464
1483
  return { leading: h, length: s - h };
1465
1484
  }
1466
1485
  const c = X(
1467
- s + r - u,
1486
+ s + r - g,
1468
1487
  s,
1469
1488
  l
1470
1489
  );
1471
1490
  return { leading: r, length: c - r };
1472
1491
  }
1473
1492
  if (i) {
1474
- const u = s + n;
1475
- if (u <= l) {
1493
+ const g = s + n;
1494
+ if (g <= l) {
1476
1495
  const h = X(
1477
- u,
1496
+ g,
1478
1497
  e + p,
1479
1498
  l
1480
1499
  );
1481
1500
  return { leading: e, length: h - e };
1482
1501
  }
1483
1502
  const c = X(
1484
- e - (u - l),
1503
+ e - (g - l),
1485
1504
  r,
1486
1505
  e
1487
1506
  );
@@ -1492,39 +1511,36 @@ function Kn({
1492
1511
  function bt(e, t = !0) {
1493
1512
  const n = Z();
1494
1513
  if (e.classList.contains("pluno-pa-widget--minimized"))
1495
- return e.classList.contains("pluno-pa-widget--scribble") ? {
1496
- width: Xi,
1497
- height: Zi
1498
- } : { width: Hn, height: Hn };
1514
+ return { width: $n, height: $n };
1499
1515
  const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1500
1516
  return {
1501
- width: t && i && o.width > 0 ? o.width : Math.min(wo, n.width - 36),
1502
- height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Qi : bo
1517
+ width: t && i && o.width > 0 ? o.width : Math.min(yo, n.width - 36),
1518
+ height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? na : vo
1503
1519
  };
1504
1520
  }
1505
- function wa() {
1521
+ function xa() {
1506
1522
  const e = Z();
1507
1523
  return {
1508
1524
  width: Math.min(
1509
1525
  X(
1510
- e.width * ta,
1511
- dn,
1512
- ea
1526
+ e.width * ia,
1527
+ cn,
1528
+ oa
1513
1529
  ),
1514
1530
  e.width - A * 2
1515
1531
  ),
1516
1532
  height: Math.min(
1517
1533
  X(
1518
- e.height * oa,
1519
- cn,
1520
- na
1534
+ e.height * ra,
1535
+ un,
1536
+ aa
1521
1537
  ),
1522
- e.height - Ie - A
1538
+ e.height - Ne - A
1523
1539
  )
1524
1540
  };
1525
1541
  }
1526
- function Fe(e = null) {
1527
- return e ? xt(e) : wa();
1542
+ function tt(e = null) {
1543
+ return e ? xt(e) : xa();
1528
1544
  }
1529
1545
  function xt(e) {
1530
1546
  const t = Z();
@@ -1532,7 +1548,7 @@ function xt(e) {
1532
1548
  width: X(
1533
1549
  e.width,
1534
1550
  Math.min(
1535
- dn,
1551
+ cn,
1536
1552
  t.width - A * 2
1537
1553
  ),
1538
1554
  Math.max(
@@ -1543,17 +1559,17 @@ function xt(e) {
1543
1559
  height: X(
1544
1560
  e.height,
1545
1561
  Math.min(
1546
- cn,
1547
- t.height - Ie - A
1562
+ un,
1563
+ t.height - Ne - A
1548
1564
  ),
1549
1565
  Math.max(
1550
1566
  A,
1551
- t.height - Ie - A
1567
+ t.height - Ne - A
1552
1568
  )
1553
1569
  )
1554
1570
  };
1555
1571
  }
1556
- function Wt(e, t) {
1572
+ function $t(e, t) {
1557
1573
  if (!t) {
1558
1574
  e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
1559
1575
  return;
@@ -1561,7 +1577,7 @@ function Wt(e, t) {
1561
1577
  const n = xt(t);
1562
1578
  e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
1563
1579
  }
1564
- function ba(e, t, n) {
1580
+ function ya(e, t, n) {
1565
1581
  const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
1566
1582
  if (Number.isFinite(o) && Number.isFinite(i))
1567
1583
  return { x: o, y: i };
@@ -1576,21 +1592,21 @@ function ba(e, t, n) {
1576
1592
  }
1577
1593
  function Gt(e, t, n) {
1578
1594
  const o = bt(e, !1);
1579
- return t ? an(
1595
+ return t ? rn(
1580
1596
  e,
1581
- So(t, o),
1597
+ Po(t, o),
1582
1598
  o
1583
- ) : _a(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Ji);
1599
+ ) : va(n === "bottom-left" ? "bottom-left" : "bottom-right", o, ta);
1584
1600
  }
1585
- function _a(e, t, n) {
1601
+ function va(e, t, n) {
1586
1602
  const o = Z();
1587
1603
  return {
1588
1604
  x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
1589
1605
  y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
1590
1606
  };
1591
1607
  }
1592
- function an(e, t, n) {
1593
- const o = Z(), i = A + va(e);
1608
+ function rn(e, t, n) {
1609
+ const o = Z(), i = A + Ea(e);
1594
1610
  return {
1595
1611
  x: X(
1596
1612
  t.x,
@@ -1610,30 +1626,30 @@ function an(e, t, n) {
1610
1626
  )
1611
1627
  };
1612
1628
  }
1613
- function So(e, t) {
1629
+ function Po(e, t) {
1614
1630
  const n = Z();
1615
1631
  return {
1616
1632
  x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
1617
1633
  y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
1618
1634
  };
1619
1635
  }
1620
- function xa(e, t) {
1621
- const n = ya(e, t), o = Z();
1636
+ function Ca(e, t) {
1637
+ const n = Sa(e, t), o = Z();
1622
1638
  return {
1623
1639
  anchor: n,
1624
1640
  x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
1625
1641
  y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
1626
1642
  };
1627
1643
  }
1628
- function ya(e, t) {
1644
+ function Sa(e, t) {
1629
1645
  const n = Z(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
1630
1646
  return `${r}-${l}`;
1631
1647
  }
1632
- function va(e) {
1633
- return e.classList.contains("pluno-pa-widget--scribble") ? la : ra;
1648
+ function Ea(e) {
1649
+ return e.classList.contains("pluno-pa-widget--scribble") ? da : sa;
1634
1650
  }
1635
- function $t(e, t, n, o = null) {
1636
- const i = bt(e), r = Fe(o), l = {
1651
+ function qt(e, t, n, o = null) {
1652
+ const i = bt(e), r = tt(o), l = {
1637
1653
  x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
1638
1654
  y: t.y + i.height - r.height
1639
1655
  };
@@ -1652,34 +1668,34 @@ function mt(e, t) {
1652
1668
  ),
1653
1669
  y: X(
1654
1670
  e.y,
1655
- Ie,
1671
+ Ne,
1656
1672
  Math.max(
1657
- Ie,
1673
+ Ne,
1658
1674
  n.height - t.height - A
1659
1675
  )
1660
1676
  )
1661
1677
  };
1662
1678
  }
1663
- function Te(e, t) {
1679
+ function Ae(e, t) {
1664
1680
  if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
1665
1681
  e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
1666
1682
  return;
1667
1683
  }
1668
1684
  e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
1669
1685
  }
1670
- function Ca(e, t) {
1686
+ function ka(e, t) {
1671
1687
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1672
1688
  }
1673
- function Yn(e) {
1689
+ function Zn(e) {
1674
1690
  e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
1675
1691
  }
1676
1692
  function Z() {
1677
1693
  return {
1678
- width: window.innerWidth || document.documentElement.clientWidth || wo + A * 2,
1679
- height: window.innerHeight || document.documentElement.clientHeight || bo + A * 2
1694
+ width: window.innerWidth || document.documentElement.clientWidth || yo + A * 2,
1695
+ height: window.innerHeight || document.documentElement.clientHeight || vo + A * 2
1680
1696
  };
1681
1697
  }
1682
- function qt(e) {
1698
+ function jt(e) {
1683
1699
  const t = e.getBoundingClientRect();
1684
1700
  return {
1685
1701
  x: Math.round(t.x),
@@ -1691,7 +1707,7 @@ function qt(e) {
1691
1707
  function X(e, t, n) {
1692
1708
  return Math.min(Math.max(e, t), n);
1693
1709
  }
1694
- function ne(e, t, n) {
1710
+ function K(e, t, n) {
1695
1711
  if (typeof window > "u")
1696
1712
  return;
1697
1713
  const o = window, i = {
@@ -1701,31 +1717,31 @@ function ne(e, t, n) {
1701
1717
  details: n
1702
1718
  }, r = o.__plunoProductAgentDiagnostics__ ?? [];
1703
1719
  r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
1704
- new CustomEvent(Gi, { detail: i })
1720
+ new CustomEvent(Ki, { detail: i })
1705
1721
  );
1706
1722
  }
1707
- function Sa(e, t) {
1708
- ne("web-sdk.widget.position", e, t);
1723
+ function La(e, t) {
1724
+ K("web-sdk.widget.position", e, t);
1709
1725
  }
1710
- function jt(e, t, n) {
1726
+ function Vt(e, t, n) {
1711
1727
  const o = t.value.trim();
1712
1728
  return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
1713
- attachments: n.length > 0 ? n.map(La) : void 0
1729
+ attachments: n.length > 0 ? n.map(Ia) : void 0
1714
1730
  }), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
1715
1731
  }
1716
- function Ea(e, t, n) {
1732
+ function Pa(e, t, n) {
1717
1733
  const o = e.activeElement;
1718
1734
  return o === n ? "composer" : o === t ? "launcher" : null;
1719
1735
  }
1720
- function ka(e, t, n, o) {
1721
- if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Ai)
1736
+ function Ta(e, t, n, o) {
1737
+ if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Mi)
1722
1738
  return;
1723
1739
  const i = e.focusedInput === "composer" ? o : n;
1724
1740
  i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
1725
1741
  !i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
1726
1742
  });
1727
1743
  }
1728
- function La(e) {
1744
+ function Ia(e) {
1729
1745
  return e;
1730
1746
  }
1731
1747
  function et(e) {
@@ -1733,12 +1749,12 @@ function et(e) {
1733
1749
  const t = Math.max(22, Math.min(e.scrollHeight, 140));
1734
1750
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
1735
1751
  }
1736
- function tt(e, t = () => !0) {
1752
+ function nt(e, t = () => !0) {
1737
1753
  e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
1738
1754
  t() && (e.scrollTop = e.scrollHeight);
1739
1755
  });
1740
1756
  }
1741
- function Pa(e) {
1757
+ function Aa(e) {
1742
1758
  const t = e.messages[e.messages.length - 1];
1743
1759
  return [
1744
1760
  e.messages.length,
@@ -1749,13 +1765,13 @@ function Pa(e) {
1749
1765
  e.lastError ?? ""
1750
1766
  ].join(":");
1751
1767
  }
1752
- function Ta(e) {
1768
+ function Na(e) {
1753
1769
  return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
1754
1770
  }
1755
- function Ia(e) {
1771
+ function Ra(e) {
1756
1772
  return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
1757
1773
  }
1758
- function Aa(e) {
1774
+ function Da(e) {
1759
1775
  const t = e.currentPage;
1760
1776
  if (typeof t?.url == "string" && t.url.trim())
1761
1777
  try {
@@ -1766,7 +1782,7 @@ function Aa(e) {
1766
1782
  }
1767
1783
  return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
1768
1784
  }
1769
- function Na(e, t) {
1785
+ function za(e, t) {
1770
1786
  const n = new Date(e).getTime();
1771
1787
  if (!Number.isFinite(n))
1772
1788
  return "now";
@@ -1782,9 +1798,9 @@ function Na(e, t) {
1782
1798
  }
1783
1799
  return "now";
1784
1800
  }
1785
- function Ra(e, t, n, o, i) {
1786
- e.appendChild(Wa()), e.appendChild(
1787
- Da(
1801
+ function Ma(e, t, n, o, i) {
1802
+ e.appendChild(qa()), e.appendChild(
1803
+ Oa(
1788
1804
  t,
1789
1805
  n,
1790
1806
  o,
@@ -1794,24 +1810,24 @@ function Ra(e, t, n, o, i) {
1794
1810
  yt(
1795
1811
  "pluno-pa-widget__close",
1796
1812
  "Close",
1797
- Ga(16),
1813
+ ja(16),
1798
1814
  !0
1799
1815
  )
1800
- ), e.appendChild(za(n));
1816
+ ), e.appendChild(Ua(n));
1801
1817
  }
1802
- function Da(e, t, n, o) {
1818
+ function Oa(e, t, n, o) {
1803
1819
  const i = document.createElement("form");
1804
1820
  if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
1805
1821
  const s = document.createElement("button");
1806
1822
  s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", i.appendChild(s);
1807
1823
  }
1808
1824
  i.appendChild(
1809
- Po(
1825
+ No(
1810
1826
  "pluno-pa-widget__scribble-spirals--launcher",
1811
1827
  10
1812
1828
  )
1813
1829
  ), i.appendChild(
1814
- xe(
1830
+ ve(
1815
1831
  "pluno-pa-widget__character--launcher",
1816
1832
  t
1817
1833
  )
@@ -1827,15 +1843,15 @@ function Da(e, t, n, o) {
1827
1843
  }
1828
1844
  return i;
1829
1845
  }
1830
- function za(e) {
1846
+ function Ua(e) {
1831
1847
  const t = document.createElement("section");
1832
1848
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
1833
- Po("pluno-pa-widget__scribble-spirals--panel", 16)
1849
+ No("pluno-pa-widget__scribble-spirals--panel", 16)
1834
1850
  );
1835
1851
  const n = document.createElement("div");
1836
1852
  n.className = "pluno-pa-widget__timeline-wrap";
1837
1853
  const o = document.createElement("main");
1838
- o.className = "pluno-pa-widget__timeline", o.appendChild(Ba(e));
1854
+ o.className = "pluno-pa-widget__timeline", o.appendChild(Ha(e));
1839
1855
  const i = document.createElement("div");
1840
1856
  i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
1841
1857
  const r = document.createElement("div");
@@ -1846,32 +1862,32 @@ function za(e) {
1846
1862
  return p.className = "pluno-pa-widget__top-actions", p.appendChild(
1847
1863
  yt(
1848
1864
  "pluno-pa-widget__history",
1849
- rn(),
1850
- qa(),
1865
+ ln(),
1866
+ Ka(),
1851
1867
  !0
1852
1868
  )
1853
- ), n.appendChild(p), n.appendChild(Ua()), t.appendChild(n), t.appendChild(Ma()), t.appendChild(Oa()), t.appendChild(_e("left", "Resize Pluno from left")), t.appendChild(
1854
- _e("right", "Resize Pluno from right")
1855
- ), t.appendChild(_e("top", "Resize Pluno from top")), t.appendChild(
1856
- _e("bottom", "Resize Pluno from bottom")
1869
+ ), n.appendChild(p), n.appendChild(Wa()), t.appendChild(n), t.appendChild(Ba()), t.appendChild(Fa()), t.appendChild(ye("left", "Resize Pluno from left")), t.appendChild(
1870
+ ye("right", "Resize Pluno from right")
1871
+ ), t.appendChild(ye("top", "Resize Pluno from top")), t.appendChild(
1872
+ ye("bottom", "Resize Pluno from bottom")
1857
1873
  ), t.appendChild(
1858
- _e("top-left", "Resize Pluno from top left")
1874
+ ye("top-left", "Resize Pluno from top left")
1859
1875
  ), t.appendChild(
1860
- _e("top-right", "Resize Pluno from top right")
1876
+ ye("top-right", "Resize Pluno from top right")
1861
1877
  ), t.appendChild(
1862
- _e("bottom-left", "Resize Pluno from bottom left")
1878
+ ye("bottom-left", "Resize Pluno from bottom left")
1863
1879
  ), t.appendChild(
1864
- _e("bottom-right", "Resize Pluno from bottom right")
1880
+ ye("bottom-right", "Resize Pluno from bottom right")
1865
1881
  ), t;
1866
1882
  }
1867
- function _e(e, t) {
1883
+ function ye(e, t) {
1868
1884
  const n = document.createElement("button");
1869
1885
  return n.type = "button", n.className = [
1870
1886
  "pluno-pa-widget__resize-handle",
1871
1887
  `pluno-pa-widget__resize-handle--${e}`
1872
1888
  ].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
1873
1889
  }
1874
- function Ma() {
1890
+ function Ba() {
1875
1891
  const e = document.createElement("div");
1876
1892
  e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
1877
1893
  const t = document.createElement("span");
@@ -1885,7 +1901,7 @@ function Ma() {
1885
1901
  const r = document.createElement("button");
1886
1902
  return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
1887
1903
  }
1888
- function Oa() {
1904
+ function Fa() {
1889
1905
  const e = document.createElement("form");
1890
1906
  e.className = "pluno-pa-widget__composer";
1891
1907
  const t = document.createElement("div");
@@ -1899,32 +1915,32 @@ function Oa() {
1899
1915
  const r = document.createElement("input");
1900
1916
  r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
1901
1917
  const l = document.createElement("button");
1902
- l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Va()), l.appendChild(Ka()), i.appendChild(l);
1918
+ l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Xa()), l.appendChild(Za()), i.appendChild(l);
1903
1919
  const p = document.createElement("textarea");
1904
1920
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
1905
1921
  const s = document.createElement("button");
1906
- s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(Io()), i.appendChild(s), e.appendChild(i);
1907
- const u = document.createElement("div");
1908
- u.className = "pluno-pa-widget__composer-meta";
1922
+ s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(Do()), i.appendChild(s), e.appendChild(i);
1923
+ const g = document.createElement("div");
1924
+ g.className = "pluno-pa-widget__composer-meta";
1909
1925
  const c = document.createElement("a");
1910
- c.className = "pluno-pa-widget__powered-by", c.href = "https://pluno.ai", c.target = "_blank", c.rel = "noopener noreferrer", c.textContent = "Powered by Pluno.ai.", u.appendChild(c);
1926
+ c.className = "pluno-pa-widget__powered-by", c.href = "https://pluno.ai", c.target = "_blank", c.rel = "noopener noreferrer", c.textContent = "Powered by Pluno.ai.", g.appendChild(c);
1911
1927
  const h = document.createElement("span");
1912
- return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(h), e.appendChild(u), e;
1928
+ return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", g.appendChild(h), e.appendChild(g), e;
1913
1929
  }
1914
- function rn() {
1930
+ function ln() {
1915
1931
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
1916
1932
  }
1917
- function Ua() {
1933
+ function Wa() {
1918
1934
  const e = document.createElement("section");
1919
- e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", rn());
1935
+ e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", ln());
1920
1936
  const t = document.createElement("div");
1921
1937
  t.className = "pluno-pa-widget__history-header";
1922
1938
  const n = document.createElement("strong");
1923
- n.textContent = rn();
1939
+ n.textContent = ln();
1924
1940
  const o = yt(
1925
1941
  "pluno-pa-widget__history-close",
1926
1942
  "Close recent chats",
1927
- ja(),
1943
+ Ya(),
1928
1944
  !1
1929
1945
  );
1930
1946
  t.append(n, o);
@@ -1933,20 +1949,20 @@ function Ua() {
1933
1949
  const r = document.createElement("p");
1934
1950
  return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
1935
1951
  }
1936
- function Ba(e) {
1952
+ function Ha(e) {
1937
1953
  const t = document.createElement("div");
1938
1954
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
1939
- xe(
1955
+ ve(
1940
1956
  "pluno-pa-widget__character--empty",
1941
1957
  e
1942
1958
  )
1943
- ), t.appendChild(Eo()), t;
1959
+ ), t.appendChild(To()), t;
1944
1960
  }
1945
- function Eo() {
1961
+ function To() {
1946
1962
  const e = document.createElement("div");
1947
1963
  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;
1948
1964
  }
1949
- function ko(e, t) {
1965
+ function Io(e, t) {
1950
1966
  e.replaceChildren(), e.setAttribute(
1951
1967
  "aria-label",
1952
1968
  `${t.toLocaleString("en-US")} users currently active`
@@ -1958,17 +1974,17 @@ function ko(e, t) {
1958
1974
  )
1959
1975
  );
1960
1976
  }
1961
- function xe(e, t) {
1962
- const n = `pluno-pa-character-${Gn}`;
1963
- Gn += 1;
1964
- const o = t.scribbleStyle ? Ha(t.accentColor, n) : Fa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1977
+ function ve(e, t) {
1978
+ const n = `pluno-pa-character-${qn}`;
1979
+ qn += 1;
1980
+ const o = t.scribbleStyle ? Ga(t.accentColor, n) : $a(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1965
1981
  return o.setAttribute(
1966
1982
  "class",
1967
1983
  i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
1968
1984
  ), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
1969
1985
  }
1970
- function Fa(e, t) {
1971
- const n = li(e), o = {
1986
+ function $a(e, t) {
1987
+ const n = ui(e), o = {
1972
1988
  boltFill: `${t}-boltFill`,
1973
1989
  boltEdge: `${t}-boltEdge`,
1974
1990
  boltGlow: `${t}-boltGlow`,
@@ -1979,7 +1995,7 @@ function Fa(e, t) {
1979
1995
  eyeShadow: `${t}-eyeShadow`,
1980
1996
  pupilGloss: `${t}-pupilGloss`,
1981
1997
  boltClip: `${t}-boltClip`
1982
- }, i = Lo(), r = f(i, "defs"), l = f(r, "linearGradient", {
1998
+ }, i = Ao(), r = w(i, "defs"), l = w(r, "linearGradient", {
1983
1999
  id: o.boltFill,
1984
2000
  x1: "420",
1985
2001
  y1: "180",
@@ -1987,8 +2003,8 @@ function Fa(e, t) {
1987
2003
  y2: "1040",
1988
2004
  gradientUnits: "userSpaceOnUse"
1989
2005
  });
1990
- U(l, "0", n.top), U(l, "0.36", n.middle), U(l, "0.72", n.bottom), U(l, "1", n.bottom);
1991
- const p = f(r, "linearGradient", {
2006
+ O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
2007
+ const p = w(r, "linearGradient", {
1992
2008
  id: o.boltEdge,
1993
2009
  x1: "470",
1994
2010
  y1: "145",
@@ -1996,29 +2012,29 @@ function Fa(e, t) {
1996
2012
  y2: "980",
1997
2013
  gradientUnits: "userSpaceOnUse"
1998
2014
  });
1999
- U(p, "0", n.edgeStart), U(p, "0.32", n.edgeMiddle), U(p, "0.78", n.edgeEnd), U(p, "1", n.edgeEnd);
2000
- const s = f(r, "radialGradient", {
2015
+ O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
2016
+ const s = w(r, "radialGradient", {
2001
2017
  id: o.boltGlow,
2002
2018
  cx: "50%",
2003
2019
  cy: "22%",
2004
2020
  r: "82%"
2005
2021
  });
2006
- U(s, "0", n.glow, "0.72"), U(s, "0.5", n.middle, "0.44"), U(s, "1", n.bottom, "0");
2007
- const u = f(r, "radialGradient", {
2022
+ O(s, "0", n.glow, "0.72"), O(s, "0.5", n.middle, "0.44"), O(s, "1", n.bottom, "0");
2023
+ const g = w(r, "radialGradient", {
2008
2024
  id: o.eyeWhite,
2009
2025
  cx: "35%",
2010
2026
  cy: "25%",
2011
2027
  r: "70%"
2012
2028
  });
2013
- U(u, "0", "#ffffff"), U(u, "0.72", "#ffffff"), U(u, "1", "#e5e5e5");
2014
- const c = f(r, "radialGradient", {
2029
+ O(g, "0", "#ffffff"), O(g, "0.72", "#ffffff"), O(g, "1", "#e5e5e5");
2030
+ const c = w(r, "radialGradient", {
2015
2031
  id: o.pupil,
2016
2032
  cx: "42%",
2017
2033
  cy: "38%",
2018
2034
  r: "65%"
2019
2035
  });
2020
- U(c, "0", "#2a1f10"), U(c, "0.52", "#080604"), U(c, "1", "#000000");
2021
- const h = f(r, "filter", {
2036
+ O(c, "0", "#2a1f10"), O(c, "0.52", "#080604"), O(c, "1", "#000000");
2037
+ const h = w(r, "filter", {
2022
2038
  id: o.softDropShadow,
2023
2039
  x: "-18%",
2024
2040
  y: "-12%",
@@ -2026,14 +2042,14 @@ function Fa(e, t) {
2026
2042
  height: "136%",
2027
2043
  "color-interpolation-filters": "sRGB"
2028
2044
  });
2029
- f(h, "feDropShadow", {
2045
+ w(h, "feDropShadow", {
2030
2046
  dx: "0",
2031
2047
  dy: "12",
2032
2048
  stdDeviation: "18",
2033
2049
  "flood-color": n.shadow,
2034
2050
  "flood-opacity": "0.24"
2035
2051
  });
2036
- const S = f(r, "filter", {
2052
+ const C = w(r, "filter", {
2037
2053
  id: o.innerDepth,
2038
2054
  x: "-8%",
2039
2055
  y: "-8%",
@@ -2041,32 +2057,32 @@ function Fa(e, t) {
2041
2057
  height: "116%",
2042
2058
  "color-interpolation-filters": "sRGB"
2043
2059
  });
2044
- f(S, "feGaussianBlur", {
2060
+ w(C, "feGaussianBlur", {
2045
2061
  in: "SourceAlpha",
2046
2062
  stdDeviation: "8",
2047
2063
  result: "blur"
2048
- }), f(S, "feOffset", {
2064
+ }), w(C, "feOffset", {
2049
2065
  dx: "-7",
2050
2066
  dy: "-9",
2051
2067
  result: "topLeft"
2052
- }), f(S, "feComposite", {
2068
+ }), w(C, "feComposite", {
2053
2069
  in: "topLeft",
2054
2070
  in2: "SourceAlpha",
2055
2071
  operator: "arithmetic",
2056
2072
  k2: "-1",
2057
2073
  k3: "1",
2058
2074
  result: "innerShadow"
2059
- }), f(S, "feColorMatrix", {
2075
+ }), w(C, "feColorMatrix", {
2060
2076
  in: "innerShadow",
2061
2077
  type: "matrix",
2062
2078
  values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
2063
2079
  result: "innerLight"
2064
- }), f(S, "feBlend", {
2080
+ }), w(C, "feBlend", {
2065
2081
  in: "SourceGraphic",
2066
2082
  in2: "innerLight",
2067
2083
  mode: "screen"
2068
2084
  });
2069
- const v = f(r, "filter", {
2085
+ const T = w(r, "filter", {
2070
2086
  id: o.eyeShadow,
2071
2087
  x: "-24%",
2072
2088
  y: "-20%",
@@ -2074,14 +2090,14 @@ function Fa(e, t) {
2074
2090
  height: "148%",
2075
2091
  "color-interpolation-filters": "sRGB"
2076
2092
  });
2077
- f(v, "feDropShadow", {
2093
+ w(T, "feDropShadow", {
2078
2094
  dx: "0",
2079
2095
  dy: "8",
2080
2096
  stdDeviation: "5",
2081
2097
  "flood-color": n.shadow,
2082
2098
  "flood-opacity": "0.3"
2083
2099
  });
2084
- const D = f(r, "filter", {
2100
+ const I = w(r, "filter", {
2085
2101
  id: o.pupilGloss,
2086
2102
  x: "-15%",
2087
2103
  y: "-15%",
@@ -2089,51 +2105,51 @@ function Fa(e, t) {
2089
2105
  height: "130%",
2090
2106
  "color-interpolation-filters": "sRGB"
2091
2107
  });
2092
- f(D, "feDropShadow", {
2108
+ w(I, "feDropShadow", {
2093
2109
  dx: "0",
2094
2110
  dy: "3",
2095
2111
  stdDeviation: "3",
2096
2112
  "flood-color": "#000000",
2097
2113
  "flood-opacity": "0.22"
2098
2114
  });
2099
- const C = f(r, "clipPath", { id: o.boltClip });
2100
- f(C, "path", { d: ft });
2101
- const g = f(i, "g", {
2115
+ const D = w(r, "clipPath", { id: o.boltClip });
2116
+ w(D, "path", { d: ft });
2117
+ const u = w(i, "g", {
2102
2118
  filter: Y(o.softDropShadow)
2103
2119
  });
2104
- f(g, "path", {
2120
+ w(u, "path", {
2105
2121
  d: ft,
2106
2122
  fill: Y(o.boltEdge)
2107
2123
  });
2108
2124
  const y = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
2109
- f(g, "path", {
2125
+ w(u, "path", {
2110
2126
  d: y,
2111
2127
  fill: Y(o.boltFill),
2112
2128
  filter: Y(o.innerDepth)
2113
- }), f(g, "path", {
2129
+ }), w(u, "path", {
2114
2130
  d: y,
2115
2131
  fill: Y(o.boltGlow),
2116
2132
  opacity: "0.74"
2117
2133
  });
2118
- const m = f(g, "g", {
2134
+ const m = w(u, "g", {
2119
2135
  "clip-path": Y(o.boltClip),
2120
2136
  opacity: "0.42"
2121
2137
  });
2122
- f(m, "path", {
2138
+ w(m, "path", {
2123
2139
  d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
2124
2140
  fill: "none",
2125
2141
  stroke: n.highlight,
2126
2142
  "stroke-width": "22",
2127
2143
  "stroke-linecap": "round",
2128
2144
  opacity: "0.65"
2129
- }), f(m, "path", {
2145
+ }), w(m, "path", {
2130
2146
  d: "M556 685 L501 994",
2131
2147
  fill: "none",
2132
2148
  stroke: n.highlight,
2133
2149
  "stroke-width": "20",
2134
2150
  "stroke-linecap": "round",
2135
2151
  opacity: "0.55"
2136
- }), f(m, "path", {
2152
+ }), w(m, "path", {
2137
2153
  d: "M858 160 C882 166 893 181 883 204",
2138
2154
  fill: "none",
2139
2155
  stroke: n.inner,
@@ -2141,9 +2157,9 @@ function Fa(e, t) {
2141
2157
  "stroke-linecap": "round",
2142
2158
  opacity: "0.48"
2143
2159
  });
2144
- const k = f(i, "g", { filter: Y(o.eyeShadow) });
2145
- return Xn(
2146
- k,
2160
+ const S = w(i, "g", { filter: Y(o.eyeShadow) });
2161
+ return Jn(
2162
+ S,
2147
2163
  "rotate(-2 528 463)",
2148
2164
  "528",
2149
2165
  "463",
@@ -2152,8 +2168,8 @@ function Fa(e, t) {
2152
2168
  "557",
2153
2169
  "447",
2154
2170
  o
2155
- ), Xn(
2156
- k,
2171
+ ), Jn(
2172
+ S,
2157
2173
  "rotate(2 717 462)",
2158
2174
  "717",
2159
2175
  "462",
@@ -2164,13 +2180,13 @@ function Fa(e, t) {
2164
2180
  o
2165
2181
  ), i;
2166
2182
  }
2167
- function Ha(e, t) {
2168
- const n = co(e), o = {
2183
+ function Ga(e, t) {
2184
+ const n = mo(e), o = {
2169
2185
  clip: `${t}-scribbleBoltClip`,
2170
2186
  wobble: `${t}-scribbleBoltWobble`
2171
- }, i = Lo(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
2172
- f(l, "path", { d: ft });
2173
- const p = f(r, "filter", {
2187
+ }, i = Ao(), r = w(i, "defs"), l = w(r, "clipPath", { id: o.clip });
2188
+ w(l, "path", { d: ft });
2189
+ const p = w(r, "filter", {
2174
2190
  id: o.wobble,
2175
2191
  x: "-10%",
2176
2192
  y: "-10%",
@@ -2178,24 +2194,24 @@ function Ha(e, t) {
2178
2194
  height: "120%",
2179
2195
  "color-interpolation-filters": "sRGB"
2180
2196
  });
2181
- f(p, "feTurbulence", {
2197
+ w(p, "feTurbulence", {
2182
2198
  type: "fractalNoise",
2183
2199
  baseFrequency: "0.011",
2184
2200
  numOctaves: "3",
2185
2201
  seed: "7",
2186
2202
  result: "noise"
2187
- }), f(p, "feDisplacementMap", {
2203
+ }), w(p, "feDisplacementMap", {
2188
2204
  in: "SourceGraphic",
2189
2205
  in2: "noise",
2190
2206
  scale: "16",
2191
2207
  xChannelSelector: "R",
2192
2208
  yChannelSelector: "G"
2193
2209
  });
2194
- const s = f(i, "g", { filter: Y(o.wobble) }), u = f(s, "g", {
2210
+ const s = w(i, "g", { filter: Y(o.wobble) }), g = w(s, "g", {
2195
2211
  "clip-path": Y(o.clip)
2196
2212
  });
2197
- return f(u, "path", {
2198
- d: ri(),
2213
+ return w(g, "path", {
2214
+ d: ci(),
2199
2215
  fill: "none",
2200
2216
  stroke: n,
2201
2217
  "stroke-width": "56",
@@ -2203,13 +2219,13 @@ function Ha(e, t) {
2203
2219
  "stroke-linejoin": "round",
2204
2220
  opacity: "0.9",
2205
2221
  transform: "rotate(-14 627 600)"
2206
- }), f(s, "path", {
2222
+ }), w(s, "path", {
2207
2223
  d: ft,
2208
2224
  fill: "none",
2209
2225
  stroke: wt,
2210
2226
  "stroke-width": "18",
2211
2227
  "stroke-linejoin": "round"
2212
- }), Zn(
2228
+ }), Qn(
2213
2229
  s,
2214
2230
  "rotate(-2 528 463)",
2215
2231
  "528",
@@ -2218,7 +2234,7 @@ function Ha(e, t) {
2218
2234
  "473",
2219
2235
  "557",
2220
2236
  "447"
2221
- ), Zn(
2237
+ ), Qn(
2222
2238
  s,
2223
2239
  "rotate(2 717 462)",
2224
2240
  "717",
@@ -2229,37 +2245,37 @@ function Ha(e, t) {
2229
2245
  "447"
2230
2246
  ), i;
2231
2247
  }
2232
- function Lo() {
2233
- return L("svg", {
2234
- xmlns: _o,
2248
+ function Ao() {
2249
+ return E("svg", {
2250
+ xmlns: Co,
2235
2251
  viewBox: "0 0 1254 1254"
2236
2252
  });
2237
2253
  }
2238
- function Xn(e, t, n, o, i, r, l, p, s) {
2239
- const u = f(e, "g", { transform: t });
2240
- f(u, "ellipse", {
2254
+ function Jn(e, t, n, o, i, r, l, p, s) {
2255
+ const g = w(e, "g", { transform: t });
2256
+ w(g, "ellipse", {
2241
2257
  cx: n,
2242
2258
  cy: o,
2243
2259
  rx: "73",
2244
2260
  ry: "80",
2245
2261
  fill: Y(s.eyeWhite)
2246
- }), f(u, "ellipse", {
2262
+ }), w(g, "ellipse", {
2247
2263
  cx: i,
2248
2264
  cy: r,
2249
2265
  rx: "49",
2250
2266
  ry: "57",
2251
2267
  fill: Y(s.pupil),
2252
2268
  filter: Y(s.pupilGloss)
2253
- }), f(u, "circle", {
2269
+ }), w(g, "circle", {
2254
2270
  cx: l,
2255
2271
  cy: p,
2256
2272
  r: "18",
2257
2273
  fill: "#ffffff"
2258
2274
  });
2259
2275
  }
2260
- function Zn(e, t, n, o, i, r, l, p) {
2261
- const s = f(e, "g", { transform: t });
2262
- f(s, "ellipse", {
2276
+ function Qn(e, t, n, o, i, r, l, p) {
2277
+ const s = w(e, "g", { transform: t });
2278
+ w(s, "ellipse", {
2263
2279
  cx: n,
2264
2280
  cy: o,
2265
2281
  rx: "73",
@@ -2267,26 +2283,26 @@ function Zn(e, t, n, o, i, r, l, p) {
2267
2283
  fill: "#ffffff",
2268
2284
  stroke: wt,
2269
2285
  "stroke-width": "13"
2270
- }), f(s, "ellipse", {
2286
+ }), w(s, "ellipse", {
2271
2287
  cx: i,
2272
2288
  cy: r,
2273
2289
  rx: "45",
2274
2290
  ry: "53",
2275
2291
  fill: wt
2276
- }), f(s, "circle", {
2292
+ }), w(s, "circle", {
2277
2293
  cx: l,
2278
2294
  cy: p,
2279
2295
  r: "16",
2280
2296
  fill: "#ffffff"
2281
2297
  });
2282
2298
  }
2283
- function f(e, t, n = {}) {
2284
- const o = L(t, n);
2299
+ function w(e, t, n = {}) {
2300
+ const o = E(t, n);
2285
2301
  return e.appendChild(o), o;
2286
2302
  }
2287
- function U(e, t, n, o) {
2303
+ function O(e, t, n, o) {
2288
2304
  const i = { offset: t, "stop-color": n };
2289
- o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
2305
+ o !== void 0 && (i["stop-opacity"] = o), w(e, "stop", i);
2290
2306
  }
2291
2307
  function Y(e) {
2292
2308
  return `url(#${e})`;
@@ -2295,57 +2311,57 @@ function yt(e, t, n, o) {
2295
2311
  const i = document.createElement("button");
2296
2312
  return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
2297
2313
  }
2298
- function Wa() {
2299
- const e = L("svg", {
2314
+ function qa() {
2315
+ const e = E("svg", {
2300
2316
  class: "pluno-pa-widget__scribble-defs",
2301
2317
  "aria-hidden": "true",
2302
2318
  focusable: "false",
2303
2319
  width: "0",
2304
2320
  height: "0"
2305
- }), t = L("defs");
2306
- return t.appendChild(Kt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2307
- Kt("pluno-pa-scribble-wobble-2", "5", "15")
2321
+ }), t = E("defs");
2322
+ return t.appendChild(Yt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2323
+ Yt("pluno-pa-scribble-wobble-2", "5", "15")
2308
2324
  ), t.appendChild(
2309
- Kt("pluno-pa-scribble-wobble-3", "9", "19")
2325
+ Yt("pluno-pa-scribble-wobble-3", "9", "19")
2310
2326
  ), e.appendChild(t), e;
2311
2327
  }
2312
- function Po(e, t) {
2313
- const n = L("svg", {
2328
+ function No(e, t) {
2329
+ const n = E("svg", {
2314
2330
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2315
2331
  preserveAspectRatio: "xMidYMid meet",
2316
2332
  "aria-hidden": "true",
2317
2333
  focusable: "false"
2318
2334
  });
2319
- return To(n, t), n;
2335
+ return Ro(n, t), n;
2320
2336
  }
2321
- function Vt(e, t) {
2337
+ function Kt(e, t) {
2322
2338
  if (!e)
2323
2339
  return;
2324
2340
  const n = Math.max(
2325
2341
  0,
2326
- t - nn * 2
2342
+ t - on * 2
2327
2343
  ), o = Math.max(
2328
- aa,
2344
+ pa,
2329
2345
  Math.floor(
2330
- (n - tn * 2) / en
2346
+ (n - nn * 2) / tn
2331
2347
  )
2332
2348
  );
2333
- To(e, o);
2349
+ Ro(e, o);
2334
2350
  }
2335
- function To(e, t) {
2351
+ function Ro(e, t) {
2336
2352
  if (e.dataset.spiralCount === `${t}`)
2337
2353
  return;
2338
- const n = t * en + tn * 2;
2354
+ const n = t * tn + nn * 2;
2339
2355
  e.dataset.spiralCount = `${t}`, e.setAttribute(
2340
2356
  "viewBox",
2341
- `0 0 ${n} ${ia}`
2357
+ `0 0 ${n} ${la}`
2342
2358
  ), e.replaceChildren();
2343
2359
  for (let o = 0; o < t; o += 1) {
2344
- const i = Wn[o % Wn.length], r = L("g", {
2345
- transform: `translate(${tn + o * en} 0)`
2360
+ const i = Gn[o % Gn.length], r = E("g", {
2361
+ transform: `translate(${nn + o * tn} 0)`
2346
2362
  });
2347
2363
  r.appendChild(
2348
- L("ellipse", {
2364
+ E("ellipse", {
2349
2365
  cx: i.ellipseCx,
2350
2366
  cy: i.ellipseCy,
2351
2367
  rx: i.ellipseRx,
@@ -2356,7 +2372,7 @@ function To(e, t) {
2356
2372
  opacity: "0.8"
2357
2373
  })
2358
2374
  ), r.appendChild(
2359
- L("path", {
2375
+ E("path", {
2360
2376
  d: i.path,
2361
2377
  fill: "none",
2362
2378
  stroke: "#2c2a1e",
@@ -2366,8 +2382,8 @@ function To(e, t) {
2366
2382
  ), e.appendChild(r);
2367
2383
  }
2368
2384
  }
2369
- function Kt(e, t, n) {
2370
- const o = L("filter", {
2385
+ function Yt(e, t, n) {
2386
+ const o = E("filter", {
2371
2387
  id: e,
2372
2388
  x: "-8%",
2373
2389
  y: "-8%",
@@ -2375,7 +2391,7 @@ function Kt(e, t, n) {
2375
2391
  height: "116%"
2376
2392
  });
2377
2393
  return o.appendChild(
2378
- L("feTurbulence", {
2394
+ E("feTurbulence", {
2379
2395
  type: "fractalNoise",
2380
2396
  baseFrequency: "0.012 0.028",
2381
2397
  numOctaves: "3",
@@ -2383,7 +2399,7 @@ function Kt(e, t, n) {
2383
2399
  result: "stroke-noise"
2384
2400
  })
2385
2401
  ), o.appendChild(
2386
- L("feDisplacementMap", {
2402
+ E("feDisplacementMap", {
2387
2403
  in: "SourceGraphic",
2388
2404
  in2: "stroke-noise",
2389
2405
  scale: "3.5",
@@ -2392,7 +2408,7 @@ function Kt(e, t, n) {
2392
2408
  result: "warped"
2393
2409
  })
2394
2410
  ), o.appendChild(
2395
- L("feTurbulence", {
2411
+ E("feTurbulence", {
2396
2412
  type: "fractalNoise",
2397
2413
  baseFrequency: "0.7",
2398
2414
  numOctaves: "1",
@@ -2400,7 +2416,7 @@ function Kt(e, t, n) {
2400
2416
  result: "ink-noise"
2401
2417
  })
2402
2418
  ), o.appendChild(
2403
- L("feDisplacementMap", {
2419
+ E("feDisplacementMap", {
2404
2420
  in: "warped",
2405
2421
  in2: "ink-noise",
2406
2422
  scale: "0.9",
@@ -2409,8 +2425,8 @@ function Kt(e, t, n) {
2409
2425
  })
2410
2426
  ), o;
2411
2427
  }
2412
- function Ga(e) {
2413
- const t = pe(
2428
+ function ja(e) {
2429
+ const t = ce(
2414
2430
  "0 0 24 24",
2415
2431
  e,
2416
2432
  e,
@@ -2418,10 +2434,10 @@ function Ga(e) {
2418
2434
  "currentColor",
2419
2435
  "2.25"
2420
2436
  );
2421
- return t.appendChild(L("path", { d: "m6 9 6 6 6-6" })), t;
2437
+ return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
2422
2438
  }
2423
- function $a() {
2424
- const e = pe(
2439
+ function Va() {
2440
+ const e = ce(
2425
2441
  "0 0 24 24",
2426
2442
  17,
2427
2443
  17,
@@ -2430,17 +2446,17 @@ function $a() {
2430
2446
  "2.25"
2431
2447
  );
2432
2448
  return e.appendChild(
2433
- L("path", {
2449
+ E("path", {
2434
2450
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2435
2451
  })
2436
2452
  ), e.appendChild(
2437
- L("path", {
2453
+ E("path", {
2438
2454
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2439
2455
  })
2440
2456
  ), e;
2441
2457
  }
2442
- function qa() {
2443
- const e = pe(
2458
+ function Ka() {
2459
+ const e = ce(
2444
2460
  "0 0 24 24",
2445
2461
  17,
2446
2462
  17,
@@ -2448,10 +2464,10 @@ function qa() {
2448
2464
  "currentColor",
2449
2465
  "2.25"
2450
2466
  );
2451
- return e.appendChild(L("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(L("path", { d: "M3 4v5h5" })), e.appendChild(L("path", { d: "M12 7v5l3 2" })), e;
2467
+ return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
2452
2468
  }
2453
- function ja() {
2454
- const e = pe(
2469
+ function Ya() {
2470
+ const e = ce(
2455
2471
  "0 0 24 24",
2456
2472
  15,
2457
2473
  15,
@@ -2459,10 +2475,10 @@ function ja() {
2459
2475
  "currentColor",
2460
2476
  "2.4"
2461
2477
  );
2462
- return e.appendChild(L("path", { d: "M18 6 6 18" })), e.appendChild(L("path", { d: "m6 6 12 12" })), e;
2478
+ return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
2463
2479
  }
2464
- function Io() {
2465
- const e = pe(
2480
+ function Do() {
2481
+ const e = ce(
2466
2482
  "0 0 24 24",
2467
2483
  14,
2468
2484
  14,
@@ -2471,11 +2487,11 @@ function Io() {
2471
2487
  "2.75"
2472
2488
  );
2473
2489
  return e.appendChild(
2474
- L("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2475
- ), e.appendChild(L("polyline", { points: "5 12 12 5 19 12" })), e;
2490
+ E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2491
+ ), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
2476
2492
  }
2477
- function Va() {
2478
- const e = pe(
2493
+ function Xa() {
2494
+ const e = ce(
2479
2495
  "0 0 24 24",
2480
2496
  16,
2481
2497
  16,
@@ -2487,18 +2503,18 @@ function Va() {
2487
2503
  "class",
2488
2504
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2489
2505
  ), e.appendChild(
2490
- L("path", {
2506
+ E("path", {
2491
2507
  d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
2492
2508
  })
2493
2509
  ), e;
2494
2510
  }
2495
- function Ka() {
2496
- const e = pe("0 0 24 24", 19, 19, "none", "currentColor");
2511
+ function Za() {
2512
+ const e = ce("0 0 24 24", 19, 19, "none", "currentColor");
2497
2513
  return e.setAttribute(
2498
2514
  "class",
2499
2515
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2500
2516
  ), e.appendChild(
2501
- L("path", {
2517
+ E("path", {
2502
2518
  d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
2503
2519
  stroke: "currentColor",
2504
2520
  "stroke-width": "2",
@@ -2507,10 +2523,10 @@ function Ka() {
2507
2523
  })
2508
2524
  ), e;
2509
2525
  }
2510
- function Ya() {
2511
- const e = pe("0 0 24 24", 18, 18, "currentColor");
2526
+ function Ja() {
2527
+ const e = ce("0 0 24 24", 18, 18, "currentColor");
2512
2528
  return e.appendChild(
2513
- L("rect", {
2529
+ E("rect", {
2514
2530
  x: "6",
2515
2531
  y: "6",
2516
2532
  width: "12",
@@ -2519,8 +2535,8 @@ function Ya() {
2519
2535
  })
2520
2536
  ), e;
2521
2537
  }
2522
- function Xa() {
2523
- const e = pe(
2538
+ function Qa() {
2539
+ const e = ce(
2524
2540
  "0 0 24 24",
2525
2541
  12,
2526
2542
  12,
@@ -2528,10 +2544,10 @@ function Xa() {
2528
2544
  "currentColor",
2529
2545
  "2.4"
2530
2546
  );
2531
- return e.appendChild(L("path", { d: "M18 6 6 18" })), e.appendChild(L("path", { d: "m6 6 12 12" })), e;
2547
+ return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
2532
2548
  }
2533
- function Za() {
2534
- const e = pe(
2549
+ function er() {
2550
+ const e = ce(
2535
2551
  "0 0 24 24",
2536
2552
  13,
2537
2553
  13,
@@ -2540,7 +2556,7 @@ function Za() {
2540
2556
  "2.25"
2541
2557
  );
2542
2558
  return e.appendChild(
2543
- L("rect", {
2559
+ E("rect", {
2544
2560
  width: "14",
2545
2561
  height: "14",
2546
2562
  x: "8",
@@ -2549,12 +2565,12 @@ function Za() {
2549
2565
  ry: "2"
2550
2566
  })
2551
2567
  ), e.appendChild(
2552
- L("path", {
2568
+ E("path", {
2553
2569
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2554
2570
  })
2555
2571
  ), e;
2556
2572
  }
2557
- function pe(e, t, n, o, i, r) {
2573
+ function ce(e, t, n, o, i, r) {
2558
2574
  const l = {
2559
2575
  viewBox: e,
2560
2576
  width: String(t),
@@ -2562,165 +2578,165 @@ function pe(e, t, n, o, i, r) {
2562
2578
  fill: o,
2563
2579
  "aria-hidden": "true"
2564
2580
  };
2565
- return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), L("svg", l);
2581
+ return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
2566
2582
  }
2567
- function L(e, t = {}) {
2568
- const n = document.createElementNS(_o, e);
2583
+ function E(e, t = {}) {
2584
+ const n = document.createElementNS(Co, e);
2569
2585
  for (const [o, i] of Object.entries(t))
2570
2586
  n.setAttribute(o, i);
2571
2587
  return n;
2572
2588
  }
2573
- function Jn(e) {
2589
+ function eo(e) {
2574
2590
  for (const t of ["keydown", "keypress", "keyup"])
2575
2591
  e.addEventListener(t, (n) => {
2576
2592
  n.stopPropagation();
2577
2593
  });
2578
2594
  }
2579
- function Ja(e, t, n) {
2595
+ function tr(e, t, n) {
2580
2596
  e.replaceChildren(), e.hidden = t.length === 0;
2581
2597
  for (const [o, i] of t.entries()) {
2582
2598
  const r = document.createElement("div");
2583
- r.className = "pluno-pa-widget__attachment", r.appendChild(Qa(i));
2599
+ r.className = "pluno-pa-widget__attachment", r.appendChild(nr(i));
2584
2600
  const l = document.createElement("span");
2585
2601
  l.textContent = i.name, r.appendChild(l);
2586
2602
  const p = document.createElement("button");
2587
- p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Xa()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
2603
+ p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Qa()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
2588
2604
  }
2589
2605
  }
2590
- function Qa(e) {
2591
- const t = un(e), n = Ao(e);
2606
+ function nr(e) {
2607
+ const t = gn(e), n = zo(e);
2592
2608
  if (t === "image" && n) {
2593
2609
  const o = document.createElement("img");
2594
- return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(re(e))), o;
2610
+ return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(se(e))), o;
2595
2611
  }
2596
2612
  if (t === "video" && n) {
2597
2613
  const o = document.createElement("video");
2598
- return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(re(e))), o.addEventListener("stalled", () => o.replaceWith(re(e))), o;
2614
+ return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(se(e))), o.addEventListener("stalled", () => o.replaceWith(se(e))), o;
2599
2615
  }
2600
- return re(e);
2616
+ return se(e);
2601
2617
  }
2602
- function er(e) {
2603
- const t = un(e), n = Ao(e);
2618
+ function or(e) {
2619
+ const t = gn(e), n = zo(e);
2604
2620
  if (t === "image" && n) {
2605
2621
  const o = document.createElement("img");
2606
- return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o;
2622
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(se(e, "message"))), o;
2607
2623
  }
2608
2624
  if (t === "pdf" && n) {
2609
2625
  const o = document.createElement("object");
2610
- return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o.appendChild(re(e, "message")), o;
2626
+ return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(se(e, "message"))), o.appendChild(se(e, "message")), o;
2611
2627
  }
2612
2628
  if (t === "video" && n) {
2613
2629
  const o = document.createElement("video");
2614
- return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(re(e, "message"))), o;
2630
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(se(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(se(e, "message"))), o;
2615
2631
  }
2616
- return re(e, "message");
2632
+ return se(e, "message");
2617
2633
  }
2618
- function re(e, t = "composer") {
2634
+ function se(e, t = "composer") {
2619
2635
  if (t === "composer") {
2620
2636
  const r = document.createElement("span");
2621
- return r.className = "pluno-pa-widget__attachment-file", r.textContent = Qn(e), r;
2637
+ return r.className = "pluno-pa-widget__attachment-file", r.textContent = to(e), r;
2622
2638
  }
2623
2639
  const n = document.createElement("div");
2624
2640
  n.className = "pluno-pa-widget__message-attachment-file";
2625
2641
  const o = document.createElement("span");
2626
- o.textContent = Qn(e);
2642
+ o.textContent = to(e);
2627
2643
  const i = document.createElement("strong");
2628
2644
  return i.textContent = e.name, n.append(o, i), n;
2629
2645
  }
2630
- function un(e) {
2646
+ function gn(e) {
2631
2647
  return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
2632
2648
  }
2633
- function Ao(e) {
2649
+ function zo(e) {
2634
2650
  return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2635
2651
  }
2636
- function Qn(e) {
2637
- const t = un(e);
2652
+ function to(e) {
2653
+ const t = gn(e);
2638
2654
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2639
2655
  }
2640
- function tr(e, t) {
2656
+ function ir(e, t) {
2641
2657
  return t ? Array.from(t).map((o) => ({
2642
2658
  ...e.createLocalAttachment(o),
2643
- previewUrl: nr(o)
2659
+ previewUrl: ar(o)
2644
2660
  })) : [];
2645
2661
  }
2646
- function nr(e) {
2662
+ function ar(e) {
2647
2663
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2648
2664
  }
2649
2665
  function ut(e) {
2650
2666
  return !!(e && Array.from(e.types).includes("Files"));
2651
2667
  }
2652
- function Yt(e, t, n = null) {
2653
- if (!e || !ln(t, n)) {
2668
+ function Xt(e, t, n = null) {
2669
+ if (!e || !pn(t, n)) {
2654
2670
  e && (e.hidden = !0, e.replaceChildren());
2655
2671
  return;
2656
2672
  }
2657
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || gn(n) ? e.appendChild(
2658
- or(t, n)
2659
- ) : No(t) && e.appendChild(ir(t));
2673
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", de(t) || hn(n) ? e.appendChild(
2674
+ rr(t, n)
2675
+ ) : Mo(t) && e.appendChild(lr(t));
2660
2676
  }
2661
- function or(e, t) {
2677
+ function rr(e, t) {
2662
2678
  const n = document.createElement("div");
2663
2679
  n.className = "pluno-pa-widget__billing-action-card";
2664
2680
  const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
2665
2681
  i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
2666
2682
  const r = document.createElement("span");
2667
2683
  return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
2668
- Ro(
2684
+ Oo(
2669
2685
  e,
2670
2686
  "Upgrade plan",
2671
2687
  "pluno-pa-widget__billing-action-card-actions"
2672
2688
  )
2673
2689
  ), n;
2674
2690
  }
2675
- function ir(e) {
2691
+ function lr(e) {
2676
2692
  const t = document.createElement("div");
2677
2693
  t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
2678
2694
  const n = document.createElement("strong");
2679
2695
  n.textContent = "Credits running low", t.appendChild(n);
2680
2696
  const o = document.createElement("span");
2681
- return o.textContent = rr(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2682
- Ro(
2697
+ return o.textContent = sr(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2698
+ Oo(
2683
2699
  e,
2684
2700
  "Upgrade",
2685
2701
  "pluno-pa-widget__billing-action-card-actions"
2686
2702
  )
2687
2703
  ), t;
2688
2704
  }
2689
- function ln(e, t) {
2690
- return e !== null && (le(e) || No(e) || gn(t));
2705
+ function pn(e, t) {
2706
+ return e !== null && (de(e) || Mo(e) || hn(t));
2691
2707
  }
2692
- function eo(e, t, n) {
2693
- return ln(t, n) || ar(t) ? !0 : !ln(e, n);
2708
+ function no(e, t, n) {
2709
+ return pn(t, n) || pr(t) ? !0 : !pn(e, n);
2694
2710
  }
2695
- function ar(e) {
2696
- return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
2711
+ function pr(e) {
2712
+ return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || de(e));
2697
2713
  }
2698
- function le(e) {
2714
+ function de(e) {
2699
2715
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
2700
2716
  }
2701
- function gn(e) {
2717
+ function hn(e) {
2702
2718
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2703
2719
  }
2704
- function No(e) {
2705
- return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2720
+ function Mo(e) {
2721
+ return !de(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2706
2722
  }
2707
- function rr(e) {
2708
- return e.creditsRemaining === null ? null : `${lr(e.creditsRemaining)} credits left`;
2723
+ function sr(e) {
2724
+ return e.creditsRemaining === null ? null : `${dr(e.creditsRemaining)} credits left`;
2709
2725
  }
2710
- function lr(e) {
2726
+ function dr(e) {
2711
2727
  return new Intl.NumberFormat("en-US", {
2712
2728
  maximumFractionDigits: 0
2713
2729
  }).format(Math.ceil(e));
2714
2730
  }
2715
- function Ro(e, t, n) {
2731
+ function Oo(e, t, n) {
2716
2732
  const o = document.createElement("div");
2717
2733
  return o.className = n, o.appendChild(
2718
- to(t, e.pricingUrl)
2734
+ oo(t, e.pricingUrl)
2719
2735
  ), o.appendChild(
2720
- to("Earn credits", e.earnCreditsUrl)
2736
+ oo("Earn credits", e.earnCreditsUrl)
2721
2737
  ), o;
2722
2738
  }
2723
- function to(e, t) {
2739
+ function oo(e, t) {
2724
2740
  const n = document.createElement("button");
2725
2741
  if (n.type = "button", e === "Earn credits") {
2726
2742
  const o = document.createElement("span");
@@ -2731,142 +2747,148 @@ function to(e, t) {
2731
2747
  t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
2732
2748
  }), n;
2733
2749
  }
2734
- function Xt(e, t) {
2750
+ function Zt(e, t) {
2735
2751
  return e.messages.filter(
2736
- (o) => !Do(o)
2752
+ (o) => !Uo(o)
2737
2753
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2738
2754
  }
2739
- function pr(e, t, n, o, i, r, l, p, s, u, c, h, S, v, D, C, g, y, m, k) {
2740
- const N = ur(r), I = N.filter(
2741
- (x) => !Do(x)
2742
- ), G = e.scrollTop, ye = [], He = /* @__PURE__ */ new Set(), z = (x) => {
2743
- ye.push(x);
2755
+ function cr(e, t, n, o, i, r, l, p, s, g, c, h, C, T, I, D, u, y, m, S) {
2756
+ const z = mr(r), L = z.filter(
2757
+ (x) => !Uo(x)
2758
+ ), oe = e.scrollTop, J = [], Re = /* @__PURE__ */ new Set(), U = (x) => {
2759
+ J.push(x);
2744
2760
  };
2745
- Mo(n, r.isThinking), i.hidden = !p, p && l !== null && ko(i, l);
2746
- const We = I.length > 0 || !!r.assistantDraft || r.isThinking;
2747
- if (o(We), g || I.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2761
+ Fo(n, r.isThinking), i.hidden = !p, p && l !== null && Io(i, l);
2762
+ const we = L.length > 0 || !!r.assistantDraft || r.isThinking;
2763
+ if (o(we), u || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2748
2764
  const x = document.createElement("div");
2749
- x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
2750
- const E = document.createElement("div");
2751
- E.className = "pluno-pa-widget__empty-hero";
2752
- const j = xe(
2765
+ x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
2766
+ const N = document.createElement("div");
2767
+ N.className = "pluno-pa-widget__empty-hero";
2768
+ const P = ve(
2753
2769
  "pluno-pa-widget__character--empty",
2754
- v()
2770
+ T()
2755
2771
  );
2756
- if (E.appendChild(j), x.appendChild(E), g) {
2757
- const P = document.createElement("h2");
2758
- P.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", P.textContent = g.opening, x.appendChild(P);
2772
+ if (N.appendChild(P), x.appendChild(N), u) {
2773
+ const v = document.createElement("h2");
2774
+ v.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", v.textContent = u.opening, x.appendChild(v);
2759
2775
  } else
2760
- x.appendChild(Eo());
2761
- const V = g?.prompts ?? r.starterPrompts, J = document.createElement("div");
2762
- if (J.className = V.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", V.length === 0 && !r.starterPromptsLoading && J.setAttribute("aria-hidden", "true"), V.length > 0)
2763
- for (const P of V) {
2776
+ x.appendChild(To());
2777
+ const ae = u?.prompts ?? r.starterPrompts, H = document.createElement("div");
2778
+ if (H.className = ae.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ae.length === 0 && !r.starterPromptsLoading && H.setAttribute("aria-hidden", "true"), ae.length > 0)
2779
+ for (const v of ae) {
2764
2780
  const R = document.createElement("button");
2765
- R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${P}"`, R.addEventListener("click", () => {
2766
- D(P);
2767
- }), J.appendChild(R);
2781
+ R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${v}"`, R.addEventListener("click", () => {
2782
+ I(v);
2783
+ }), H.appendChild(R);
2768
2784
  }
2769
2785
  else if (r.starterPromptsLoading) {
2770
- const P = document.createElement("button");
2771
- P.type = "button", P.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", P.disabled = !0, P.tabIndex = -1, P.textContent = "Generating example tasks...", J.appendChild(P);
2786
+ const v = document.createElement("button");
2787
+ v.type = "button", v.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", v.disabled = !0, v.tabIndex = -1, v.textContent = "Generating example tasks...", H.appendChild(v);
2772
2788
  } else
2773
- for (let P = 0; P < $i; P += 1) {
2789
+ for (let v = 0; v < Yi; v += 1) {
2774
2790
  const R = document.createElement("button");
2775
- R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "", J.appendChild(R);
2791
+ R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "", H.appendChild(R);
2776
2792
  }
2777
- if (x.appendChild(J), g) {
2778
- const P = document.createElement("button");
2779
- P.type = "button", P.className = "pluno-pa-widget__morning-report-snooze", P.textContent = "Snooze morning report", P.addEventListener("click", y), x.appendChild(P);
2793
+ if (x.appendChild(H), u) {
2794
+ const v = document.createElement("button");
2795
+ v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click", y), x.appendChild(v);
2780
2796
  }
2781
- h.clear(), z(x), z(t), no(e, ye);
2797
+ h.clear(), U(x), U(t), io(e, J);
2782
2798
  return;
2783
2799
  }
2784
- let w = null, O = null, ve = [];
2785
- const se = I.length - 1, ot = se >= 0 && pn(I[se]), $ = () => {
2786
- if (ve.length === 0)
2800
+ let B = null, f = null, Q = [];
2801
+ const De = L.length - 1, Ce = De >= 0 && sn(L[De]), Se = () => {
2802
+ if (Q.length === 0)
2787
2803
  return !1;
2788
- const x = vr(
2789
- ve,
2804
+ const x = Sr(
2805
+ Q,
2790
2806
  c,
2791
- S,
2792
- v()
2807
+ C,
2808
+ T()
2793
2809
  );
2794
- return z(x), w = null, O = x, ve = [], !0;
2810
+ return U(x), B = null, f = x, Q = [], !0;
2795
2811
  };
2796
- for (let x = 0; x < I.length; x += 1) {
2797
- const E = I[x];
2798
- if (E.role === "tool") {
2799
- ve.push(E);
2812
+ for (let x = 0; x < L.length; x += 1) {
2813
+ const N = L[x];
2814
+ if (N.role === "tool") {
2815
+ Q.push(N);
2800
2816
  continue;
2801
2817
  }
2802
- if (pn(E)) {
2803
- if (x !== se)
2818
+ if (sn(N)) {
2819
+ if (x !== De)
2804
2820
  continue;
2805
- if ($()) {
2821
+ if (Se()) {
2806
2822
  const R = _t();
2807
- z(R), w = null, O = R;
2823
+ U(R), B = null, f = R;
2808
2824
  } else {
2809
- const R = ao(v());
2810
- z(R), w = null, O = R;
2825
+ const R = po(T());
2826
+ U(R), B = null, f = R;
2811
2827
  }
2812
2828
  continue;
2813
2829
  }
2814
- if (E.role === "system")
2830
+ if (N.role === "system") {
2831
+ if (N.dataType === "run_error" || N.dataType === "run_status") {
2832
+ Se();
2833
+ const v = document.createElement("div");
2834
+ v.className = "pluno-pa-widget__error", v.textContent = lo(N.content), U(v), B = v, f = null;
2835
+ }
2815
2836
  continue;
2816
- const j = $(), V = yr(E.content);
2817
- if (E.role === "assistant" && !j) {
2818
- const P = zo(v());
2819
- z(P), w = null, O = P;
2820
2837
  }
2821
- const J = sr(E, V, h, He);
2822
- z(J), w = J, O = null;
2838
+ const P = Se(), ae = lo(N.content);
2839
+ if (N.role === "assistant" && !P) {
2840
+ const v = Bo(T());
2841
+ U(v), B = null, f = v;
2842
+ }
2843
+ const H = ur(N, ae, h, Re);
2844
+ U(H), B = H, f = null;
2823
2845
  }
2824
- const it = $(), Ae = I[I.length - 1]?.id === "assistant-draft";
2825
- if (r.isThinking && !Ae && !ot)
2826
- if (it) {
2846
+ const j = Se(), it = L[L.length - 1]?.id === "assistant-draft";
2847
+ if (r.isThinking && !it && !Ce)
2848
+ if (j) {
2827
2849
  const x = _t();
2828
- z(x), w = null, O = x;
2850
+ U(x), B = null, f = x;
2829
2851
  } else {
2830
- const x = ao(v());
2831
- z(x), w = null, O = x;
2852
+ const x = po(T());
2853
+ U(x), B = null, f = x;
2832
2854
  }
2833
2855
  if (r.lastError) {
2834
2856
  const x = document.createElement("div");
2835
2857
  x.className = "pluno-pa-widget__error";
2836
- const E = document.createElement("span");
2837
- if (E.textContent = r.lastError, x.appendChild(E), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
2838
- const j = document.createElement("button");
2839
- j.type = "button", j.className = "pluno-pa-widget__error-retry", j.textContent = "Try again", j.addEventListener(
2858
+ const N = document.createElement("span");
2859
+ if (N.textContent = r.lastError, x.appendChild(N), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
2860
+ const P = document.createElement("button");
2861
+ P.type = "button", P.className = "pluno-pa-widget__error-retry", P.textContent = "Try again", P.addEventListener(
2840
2862
  "click",
2841
- r.lastErrorCode === "connection_failed" ? m : C
2842
- ), x.appendChild(j);
2863
+ r.lastErrorCode === "connection_failed" ? m : D
2864
+ ), x.appendChild(P);
2843
2865
  }
2844
- z(x), w = x, O = null;
2866
+ U(x), B = x, f = null;
2845
2867
  }
2846
- const oe = k && !r.isThinking ? ci(N) : null;
2847
- if (k && oe && !k.dismissedCandidateIds.has(oe.id)) {
2848
- const x = mr(oe, {
2849
- isDrafting: k.draftingCandidateId === oe.id,
2850
- error: k.error,
2851
- characterIconOptions: k.characterIconOptions,
2852
- onDraft: k.onDraft,
2853
- onDismiss: k.onDismiss,
2854
- onDisable: k.onDisable
2868
+ const ie = S && !r.isThinking ? fi(z) : null;
2869
+ if (S && ie && !S.dismissedCandidateIds.has(ie.id)) {
2870
+ const x = br(ie, {
2871
+ isDrafting: S.draftingCandidateId === ie.id,
2872
+ error: S.error,
2873
+ characterIconOptions: S.characterIconOptions,
2874
+ onDraft: S.onDraft,
2875
+ onDismiss: S.onDismiss,
2876
+ onDisable: S.onDisable
2855
2877
  });
2856
- z(x), k.onSeen(oe), w = null, O = x;
2878
+ U(x), S.onSeen(ie), B = null, f = x;
2857
2879
  }
2858
- w?.classList.add("pluno-pa-widget__message--bottom-reserve"), O?.classList.add("pluno-pa-widget__bottom-reserve-compact"), z(t), cr(h, He), no(e, ye), s ? tt(e, u) : e.scrollTop = G;
2880
+ B?.classList.add("pluno-pa-widget__message--bottom-reserve"), f?.classList.add("pluno-pa-widget__bottom-reserve-compact"), U(t), hr(h, Re), io(e, J), s ? nt(e, g) : e.scrollTop = oe;
2859
2881
  }
2860
- function sr(e, t, n, o) {
2861
- const i = dr(e, t), r = i ? n.get(i) : void 0;
2882
+ function ur(e, t, n, o) {
2883
+ const i = gr(e, t), r = i ? n.get(i) : void 0;
2862
2884
  if (i && r)
2863
2885
  return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
2864
2886
  const l = document.createElement("div");
2865
- l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? Sr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(gr(e.attachments));
2887
+ l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? kr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(fr(e.attachments));
2866
2888
  const p = document.createElement("div");
2867
- return p.className = "pluno-pa-widget__message-actions", p.appendChild(hr(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
2889
+ return p.className = "pluno-pa-widget__message-actions", p.appendChild(wr(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
2868
2890
  }
2869
- function dr(e, t) {
2891
+ function gr(e, t) {
2870
2892
  return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
2871
2893
  id: e.id,
2872
2894
  content: t,
@@ -2884,11 +2906,11 @@ function dr(e, t) {
2884
2906
  })
2885
2907
  });
2886
2908
  }
2887
- function cr(e, t) {
2909
+ function hr(e, t) {
2888
2910
  for (const n of e.keys())
2889
2911
  t.has(n) || e.delete(n);
2890
2912
  }
2891
- function no(e, t) {
2913
+ function io(e, t) {
2892
2914
  let n = e.firstChild;
2893
2915
  for (const o of t) {
2894
2916
  if (o === n) {
@@ -2902,7 +2924,7 @@ function no(e, t) {
2902
2924
  n = n.nextSibling, e.removeChild(o);
2903
2925
  }
2904
2926
  }
2905
- function ur(e) {
2927
+ function mr(e) {
2906
2928
  if (!e.assistantDraft)
2907
2929
  return [...e.messages];
2908
2930
  const t = {
@@ -2922,7 +2944,7 @@ function ur(e) {
2922
2944
  if (n === -1)
2923
2945
  return [...e.messages, t];
2924
2946
  const o = e.messages.findIndex(
2925
- (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && oo(r, t) && pn(r)
2947
+ (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && ao(r, t) && sn(r)
2926
2948
  );
2927
2949
  if (o !== -1)
2928
2950
  return [
@@ -2931,7 +2953,7 @@ function ur(e) {
2931
2953
  ...e.messages.slice(o + 1)
2932
2954
  ];
2933
2955
  let i = n + 1;
2934
- for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && oo(e.messages[i], t); )
2956
+ for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && ao(e.messages[i], t); )
2935
2957
  i += 1;
2936
2958
  return [
2937
2959
  ...e.messages.slice(0, i),
@@ -2939,21 +2961,21 @@ function ur(e) {
2939
2961
  ...e.messages.slice(i)
2940
2962
  ];
2941
2963
  }
2942
- function pn(e) {
2964
+ function sn(e) {
2943
2965
  return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
2944
2966
  }
2945
- function oo(e, t) {
2967
+ function ao(e, t) {
2946
2968
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
2947
2969
  }
2948
- function io(e, t, n, o, i, r, l, p) {
2949
- e.replaceChildren(), Mo(t, !1), t.disabled = !0, n(!1);
2970
+ function ro(e, t, n, o, i, r, l, p) {
2971
+ e.replaceChildren(), Fo(t, !1), t.disabled = !0, n(!1);
2950
2972
  const s = document.createElement("div");
2951
2973
  s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2952
- const u = xe(
2974
+ const g = ve(
2953
2975
  "pluno-pa-widget__character--empty",
2954
2976
  o()
2955
2977
  );
2956
- s.appendChild(u);
2978
+ s.appendChild(g);
2957
2979
  const c = document.createElement("div");
2958
2980
  if (c.className = "pluno-pa-widget__empty", c.textContent = i, s.appendChild(c), l) {
2959
2981
  const h = document.createElement("a");
@@ -2964,25 +2986,25 @@ function io(e, t, n, o, i, r, l, p) {
2964
2986
  }
2965
2987
  e.appendChild(s);
2966
2988
  }
2967
- function gr(e) {
2989
+ function fr(e) {
2968
2990
  const t = document.createElement("div");
2969
2991
  t.className = "pluno-pa-widget__message-attachments";
2970
2992
  for (const n of e)
2971
- t.appendChild(er(n));
2993
+ t.appendChild(or(n));
2972
2994
  return t;
2973
2995
  }
2974
- function hr(e) {
2996
+ function wr(e) {
2975
2997
  const t = document.createElement("button");
2976
- return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Za()), t.addEventListener("click", (n) => {
2998
+ return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(er()), t.addEventListener("click", (n) => {
2977
2999
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
2978
3000
  }), t;
2979
3001
  }
2980
- function mr(e, t) {
3002
+ function br(e, t) {
2981
3003
  const n = document.createElement("article");
2982
3004
  n.className = "pluno-pa-widget__share-prompt";
2983
3005
  const o = document.createElement("div");
2984
3006
  o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
2985
- xe(
3007
+ ve(
2986
3008
  "pluno-pa-widget__share-prompt-icon",
2987
3009
  t.characterIconOptions
2988
3010
  )
@@ -3001,10 +3023,10 @@ function mr(e, t) {
3001
3023
  p.className = "pluno-pa-widget__share-prompt-actions";
3002
3024
  const s = document.createElement("div");
3003
3025
  s.className = "pluno-pa-widget__share-prompt-primary-actions";
3004
- const u = document.createElement("button");
3005
- if (u.type = "button", u.disabled = t.isDrafting, u.addEventListener("click", () => {
3026
+ const g = document.createElement("button");
3027
+ if (g.type = "button", g.disabled = t.isDrafting, g.addEventListener("click", () => {
3006
3028
  t.onDraft(e);
3007
- }), t.isDrafting ? (u.appendChild(sn()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", s.appendChild(u), t.isDrafting)
3029
+ }), t.isDrafting ? (g.appendChild(dn()), g.appendChild(document.createTextNode("Drafting..."))) : g.textContent = "Draft a social post", s.appendChild(g), t.isDrafting)
3008
3030
  p.appendChild(s);
3009
3031
  else {
3010
3032
  const c = document.createElement("button");
@@ -3018,10 +3040,10 @@ function mr(e, t) {
3018
3040
  }
3019
3041
  return o.appendChild(p), n.appendChild(o), n;
3020
3042
  }
3021
- function fr(e, t) {
3043
+ function _r(e, t) {
3022
3044
  const n = document.createElement("div");
3023
- n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
3024
- g.target === n && t.onClose();
3045
+ n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (u) => {
3046
+ u.target === n && t.onClose();
3025
3047
  });
3026
3048
  const o = document.createElement("section");
3027
3049
  o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
@@ -3033,56 +3055,56 @@ function fr(e, t) {
3033
3055
  p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
3034
3056
  const s = document.createElement("div");
3035
3057
  s.className = "pluno-pa-widget__share-dialog-step";
3036
- const u = document.createElement("div");
3037
- u.className = "pluno-pa-widget__share-dialog-step-header";
3058
+ const g = document.createElement("div");
3059
+ g.className = "pluno-pa-widget__share-dialog-step-header";
3038
3060
  const c = document.createElement("strong");
3039
- c.textContent = "1) Copy Screenshot", u.appendChild(c);
3040
- const h = wr(
3061
+ c.textContent = "1) Copy Screenshot", g.appendChild(c);
3062
+ const h = xr(
3041
3063
  "Copy Screenshot",
3042
3064
  async () => {
3043
3065
  try {
3044
- return await ui(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
3066
+ return await wi(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
3045
3067
  } catch {
3046
3068
  return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
3047
3069
  }
3048
3070
  }
3049
3071
  );
3050
- if (u.appendChild(h), s.appendChild(u), e.screenshotDataUrl) {
3051
- const g = document.createElement("div");
3052
- g.className = "pluno-pa-widget__share-dialog-screenshot";
3072
+ if (g.appendChild(h), s.appendChild(g), e.screenshotDataUrl) {
3073
+ const u = document.createElement("div");
3074
+ u.className = "pluno-pa-widget__share-dialog-screenshot";
3053
3075
  const y = document.createElement("img");
3054
- y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), s.appendChild(g);
3076
+ y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", u.appendChild(y), s.appendChild(u);
3055
3077
  }
3056
3078
  o.appendChild(s), o.appendChild(p);
3057
- const S = document.createElement("div");
3058
- S.className = "pluno-pa-widget__share-dialog-step";
3059
- const v = document.createElement("strong");
3060
- v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", S.appendChild(v);
3061
- const D = document.createElement("p");
3062
- D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.", S.appendChild(D);
3063
- const C = document.createElement("footer");
3064
- C.className = "pluno-pa-widget__share-dialog-platforms";
3065
- for (const g of br(e)) {
3079
+ const C = document.createElement("div");
3080
+ C.className = "pluno-pa-widget__share-dialog-step";
3081
+ const T = document.createElement("strong");
3082
+ T.className = "pluno-pa-widget__share-dialog-step-title", T.textContent = "2) Share on", C.appendChild(T);
3083
+ const I = document.createElement("p");
3084
+ I.className = "pluno-pa-widget__share-dialog-hint", I.textContent = "Post draft opens prefilled on supported platforms.", C.appendChild(I);
3085
+ const D = document.createElement("footer");
3086
+ D.className = "pluno-pa-widget__share-dialog-platforms";
3087
+ for (const u of yr(e)) {
3066
3088
  const y = document.createElement("a");
3067
- y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(_r(g.id)), C.appendChild(y);
3089
+ y.href = u.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = u.label, y.setAttribute("aria-label", `Open ${u.label}`), y.appendChild(vr(u.id)), D.appendChild(y);
3068
3090
  }
3069
- if (S.appendChild(C), o.appendChild(S), t.socialPostRewardsUrl) {
3070
- const g = document.createElement("div");
3071
- g.className = "pluno-pa-widget__share-dialog-step";
3091
+ if (C.appendChild(D), o.appendChild(C), t.socialPostRewardsUrl) {
3092
+ const u = document.createElement("div");
3093
+ u.className = "pluno-pa-widget__share-dialog-step";
3072
3094
  const y = document.createElement("strong");
3073
- y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(y);
3095
+ y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", u.appendChild(y);
3074
3096
  const m = document.createElement("a");
3075
- m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(xr()), g.appendChild(m), o.appendChild(g);
3097
+ m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Cr()), u.appendChild(m), o.appendChild(u);
3076
3098
  }
3077
3099
  return n.appendChild(o), n;
3078
3100
  }
3079
- function wr(e, t) {
3101
+ function xr(e, t) {
3080
3102
  const n = document.createElement("button");
3081
3103
  return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
3082
3104
  o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
3083
3105
  }), n;
3084
3106
  }
3085
- function br(e) {
3107
+ function yr(e) {
3086
3108
  const t = e.linkedinPost.trim(), n = e.xPost.trim();
3087
3109
  return [
3088
3110
  {
@@ -3102,87 +3124,87 @@ function br(e) {
3102
3124
  }
3103
3125
  ];
3104
3126
  }
3105
- function _r(e) {
3127
+ function vr(e) {
3106
3128
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3107
- return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (W(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), W(
3129
+ 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" ? (G(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), G(
3108
3130
  t,
3109
3131
  "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"
3110
- ), W(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), W(
3132
+ ), G(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), G(
3111
3133
  t,
3112
3134
  "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"
3113
- ), W(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (W(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), W(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), W(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (W(
3135
+ ), G(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (G(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), G(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), G(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (G(
3114
3136
  t,
3115
3137
  "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"
3116
- ), W(
3138
+ ), G(
3117
3139
  t,
3118
3140
  "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",
3119
3141
  "0.48"
3120
- ), W(
3142
+ ), G(
3121
3143
  t,
3122
3144
  "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"
3123
- ), W(
3145
+ ), G(
3124
3146
  t,
3125
3147
  "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"
3126
3148
  ), t);
3127
3149
  }
3128
- function W(e, t, n) {
3150
+ function G(e, t, n) {
3129
3151
  const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
3130
3152
  o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
3131
3153
  }
3132
- function xr() {
3154
+ function Cr() {
3133
3155
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3134
- return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), W(e, "M14 5h5v5"), W(e, "M19 5l-8 8"), W(
3156
+ return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), G(e, "M14 5h5v5"), G(e, "M19 5l-8 8"), G(
3135
3157
  e,
3136
3158
  "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
3137
3159
  ), e;
3138
3160
  }
3139
- function Do(e) {
3140
- return e.role === "tool" && e.toolName === go;
3161
+ function Uo(e) {
3162
+ return e.role === "tool" && e.toolName === wo;
3141
3163
  }
3142
- function yr(e) {
3164
+ function lo(e) {
3143
3165
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
3144
3166
  }
3145
- function vr(e, t, n, o) {
3167
+ function Sr(e, t, n, o) {
3146
3168
  const i = document.createElement("article");
3147
3169
  i.className = "pluno-pa-widget__tool-group", i.title = new Date(
3148
3170
  e[e.length - 1].createdAt
3149
3171
  ).toLocaleString(), i.appendChild(
3150
- xe(
3172
+ ve(
3151
3173
  "pluno-pa-widget__character--tool-group",
3152
3174
  o
3153
3175
  )
3154
3176
  );
3155
- const r = document.createElement("details"), l = Cr(e);
3177
+ const r = document.createElement("details"), l = Er(e);
3156
3178
  r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
3157
3179
  i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
3158
3180
  });
3159
3181
  const p = document.createElement("summary");
3160
- p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(sn());
3161
- const u = document.createElement("span");
3162
- if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u), r.appendChild(p), e.length > 0) {
3182
+ p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(dn());
3183
+ const g = document.createElement("span");
3184
+ if (g.className = "pluno-pa-widget__tool-summary-title", g.textContent = e[e.length - 1].content || "Run tool", p.appendChild(g), r.appendChild(p), e.length > 0) {
3163
3185
  const c = document.createElement("div");
3164
3186
  c.className = "pluno-pa-widget__tool-lines";
3165
3187
  for (const h of e) {
3166
- const S = document.createElement("div");
3167
- S.className = "pluno-pa-widget__tool-line", h.loading && S.appendChild(sn());
3168
- const v = document.createElement("span");
3169
- v.textContent = h.content || "Run tool", S.appendChild(v), c.appendChild(S);
3188
+ const C = document.createElement("div");
3189
+ C.className = "pluno-pa-widget__tool-line", h.loading && C.appendChild(dn());
3190
+ const T = document.createElement("span");
3191
+ T.textContent = h.content || "Run tool", C.appendChild(T), c.appendChild(C);
3170
3192
  }
3171
3193
  r.appendChild(c);
3172
3194
  }
3173
3195
  return i.appendChild(r), i;
3174
3196
  }
3175
- function zo(e) {
3197
+ function Bo(e) {
3176
3198
  const t = document.createElement("article");
3177
3199
  return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
3178
- xe(
3200
+ ve(
3179
3201
  "pluno-pa-widget__character--tool-group",
3180
3202
  e
3181
3203
  )
3182
3204
  ), t;
3183
3205
  }
3184
- function ao(e) {
3185
- const t = zo(e);
3206
+ function po(e) {
3207
+ const t = Bo(e);
3186
3208
  return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(_t()), t;
3187
3209
  }
3188
3210
  function _t(e = "Thinking...") {
@@ -3193,18 +3215,18 @@ function _t(e = "Thinking...") {
3193
3215
  const o = document.createElement("span");
3194
3216
  return o.textContent = e, t.appendChild(o), t;
3195
3217
  }
3196
- function Cr(e) {
3218
+ function Er(e) {
3197
3219
  return `tools:${e[0]?.id ?? ""}`;
3198
3220
  }
3199
- function sn() {
3221
+ function dn() {
3200
3222
  const e = document.createElement("span");
3201
3223
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3202
3224
  }
3203
- function Mo(e, t) {
3204
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ya() : Io());
3225
+ function Fo(e, t) {
3226
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ja() : Do());
3205
3227
  }
3206
- function Sr(e, t) {
3207
- const n = Li(t).replace(/\r\n/g, `
3228
+ function kr(e, t) {
3229
+ const n = Ni(t).replace(/\r\n/g, `
3208
3230
  `).split(`
3209
3231
  `);
3210
3232
  let o = 0;
@@ -3219,9 +3241,9 @@ function Sr(e, t) {
3219
3241
  for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
3220
3242
  c.push(n[o]), o += 1;
3221
3243
  o += o < n.length ? 1 : 0;
3222
- const h = document.createElement("pre"), S = document.createElement("code");
3223
- S.textContent = c.join(`
3224
- `), h.appendChild(S), e.appendChild(h);
3244
+ const h = document.createElement("pre"), C = document.createElement("code");
3245
+ C.textContent = c.join(`
3246
+ `), h.appendChild(C), e.appendChild(h);
3225
3247
  continue;
3226
3248
  }
3227
3249
  const l = i.match(/^(#{1,3})\s+(.+)$/);
@@ -3252,10 +3274,10 @@ function Sr(e, t) {
3252
3274
  const s = [i];
3253
3275
  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]); )
3254
3276
  s.push(n[o]), o += 1;
3255
- const u = document.createElement("p");
3277
+ const g = document.createElement("p");
3256
3278
  s.forEach((c, h) => {
3257
- h > 0 && u.appendChild(document.createElement("br")), gt(u, c);
3258
- }), e.appendChild(u);
3279
+ h > 0 && g.appendChild(document.createElement("br")), gt(g, c);
3280
+ }), e.appendChild(g);
3259
3281
  }
3260
3282
  }
3261
3283
  function gt(e, t) {
@@ -3278,7 +3300,7 @@ function gt(e, t) {
3278
3300
  p.textContent = l.slice(1, -1), e.appendChild(p);
3279
3301
  } else {
3280
3302
  const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
3281
- if (p && Er(p[2])) {
3303
+ if (p && Lr(p[2])) {
3282
3304
  const s = document.createElement("a");
3283
3305
  s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
3284
3306
  } else
@@ -3288,7 +3310,7 @@ function gt(e, t) {
3288
3310
  }
3289
3311
  o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
3290
3312
  }
3291
- function Er(e) {
3313
+ function Lr(e) {
3292
3314
  if (e.startsWith("/") || e.startsWith("#"))
3293
3315
  return !0;
3294
3316
  try {
@@ -3298,14 +3320,20 @@ function Er(e) {
3298
3320
  return !1;
3299
3321
  }
3300
3322
  }
3301
- function ro(e, t) {
3302
- if (kr(e))
3323
+ function so(e, t) {
3324
+ if (Pr(e))
3303
3325
  return;
3304
3326
  const n = `
3305
3327
  :host {
3306
3328
  all: initial;
3307
3329
  color-scheme: light;
3308
3330
  }
3331
+ :host([data-pluno-product-agent-layout="page"]) {
3332
+ display: block;
3333
+ width: 100%;
3334
+ height: 100%;
3335
+ min-height: 0;
3336
+ }
3309
3337
  *,
3310
3338
  *::before,
3311
3339
  *::after {
@@ -3352,7 +3380,7 @@ function ro(e, t) {
3352
3380
  --pluno-pa-accent-contrast: #fafafa;
3353
3381
  position: fixed;
3354
3382
  z-index: 2147483645;
3355
- font-family: ${ae.fontFamily};
3383
+ font-family: ${pe.fontFamily};
3356
3384
  font-size: 14px;
3357
3385
  color: var(--pluno-pa-text);
3358
3386
  width: var(--pluno-pa-launcher-width);
@@ -3370,6 +3398,30 @@ function ro(e, t) {
3370
3398
  --pluno-pa-accent-soft: rgba(245, 245, 244, 0.22);
3371
3399
  --pluno-pa-accent-contrast: #18181b;
3372
3400
  }
3401
+ .pluno-pa-widget--layout-page {
3402
+ position: relative !important;
3403
+ inset: auto !important;
3404
+ width: 100%;
3405
+ height: 100%;
3406
+ min-height: 0;
3407
+ --pluno-pa-panel-width: 100%;
3408
+ --pluno-pa-panel-height: 100%;
3409
+ --pluno-pa-panel-offset-x: 0px;
3410
+ --pluno-pa-panel-offset-y: 0px;
3411
+ }
3412
+ .pluno-pa-widget--layout-page .pluno-pa-widget__launcher,
3413
+ .pluno-pa-widget--layout-page .pluno-pa-widget__close,
3414
+ .pluno-pa-widget--layout-page .pluno-pa-widget__resize-handle {
3415
+ display: none !important;
3416
+ }
3417
+ .pluno-pa-widget--layout-page .pluno-pa-widget__panel {
3418
+ inset: 0 !important;
3419
+ width: 100% !important;
3420
+ height: 100% !important;
3421
+ border-radius: 18px;
3422
+ opacity: 1;
3423
+ transform: none;
3424
+ }
3373
3425
  .pluno-pa-widget [hidden] {
3374
3426
  display: none !important;
3375
3427
  }
@@ -3583,6 +3635,22 @@ function ro(e, t) {
3583
3635
  padding: 0;
3584
3636
  overflow: visible;
3585
3637
  pointer-events: auto;
3638
+ isolation: isolate;
3639
+ }
3640
+ .pluno-pa-widget--minimized .pluno-pa-widget__launcher::before {
3641
+ content: "";
3642
+ position: absolute;
3643
+ inset: 0;
3644
+ z-index: -1;
3645
+ border: 1px solid rgba(40, 36, 20, 0.45);
3646
+ border-radius: 999px;
3647
+ background-color: #fdfaf1;
3648
+ background-image:
3649
+ linear-gradient(rgba(96, 138, 188, 0.22) 1px, transparent 1px),
3650
+ linear-gradient(90deg, rgba(96, 138, 188, 0.22) 1px, transparent 1px);
3651
+ background-size: 22px 22px;
3652
+ filter: url(#pluno-pa-scribble-wobble-3);
3653
+ pointer-events: none;
3586
3654
  }
3587
3655
  .pluno-pa-widget--minimized .pluno-pa-widget__launcher-input,
3588
3656
  .pluno-pa-widget--minimized .pluno-pa-widget__launcher-drag-handle,
@@ -4434,7 +4502,7 @@ function ro(e, t) {
4434
4502
  place-items: center;
4435
4503
  padding: 18px;
4436
4504
  background: rgba(24, 24, 27, 0.28);
4437
- font-family: var(--pluno-pa-font, ${ae.fontFamily});
4505
+ font-family: var(--pluno-pa-font, ${pe.fontFamily});
4438
4506
  color: var(--pluno-pa-text);
4439
4507
  }
4440
4508
  .pluno-pa-widget__share-dialog {
@@ -5102,7 +5170,8 @@ function ro(e, t) {
5102
5170
  .pluno-pa-widget__starter-prompts {
5103
5171
  display: grid;
5104
5172
  gap: 18px;
5105
- width: min(100%, 320px);
5173
+ /* Personalized tasks should use the available chat width instead of wrapping against an arbitrary cap. */
5174
+ width: 100%;
5106
5175
  }
5107
5176
  .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
5108
5177
  gap: 12px;
@@ -5257,8 +5326,8 @@ function ro(e, t) {
5257
5326
  .pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
5258
5327
  position: absolute;
5259
5328
  top: -16px;
5260
- left: ${nn}px;
5261
- width: calc(100% - ${nn * 2}px);
5329
+ left: ${on}px;
5330
+ width: calc(100% - ${on * 2}px);
5262
5331
  height: 36px;
5263
5332
  z-index: 3;
5264
5333
  filter: url(#pluno-pa-scribble-wobble-2);
@@ -5357,18 +5426,10 @@ function ro(e, t) {
5357
5426
  .pluno-pa-widget--scribble .pluno-pa-widget__history-panel {
5358
5427
  border-radius: var(--pluno-pa-scribble-wobble);
5359
5428
  }
5360
- .pluno-pa-widget--scribble.pluno-pa-widget--minimized {
5361
- --pluno-pa-launcher-width: 16px;
5362
- --pluno-pa-launcher-height: 24px;
5363
- }
5364
- .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
5365
- .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
5366
- content: none;
5367
- }
5368
5429
  .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
5369
- left: -3px;
5370
- width: 22px;
5371
- height: 22px;
5430
+ left: 1px;
5431
+ width: 20px;
5432
+ height: 20px;
5372
5433
  margin-top: 0;
5373
5434
  }
5374
5435
  .pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize {
@@ -5508,13 +5569,24 @@ function ro(e, t) {
5508
5569
  }
5509
5570
  .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
5510
5571
  border: 0;
5572
+ border-radius: 999px;
5511
5573
  width: var(--pluno-pa-launcher-width);
5512
5574
  min-width: 0;
5513
5575
  height: var(--pluno-pa-launcher-height);
5514
5576
  min-height: 0;
5515
5577
  padding: 0;
5516
5578
  }
5517
- .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
5579
+ .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before {
5580
+ inset: 0;
5581
+ border: 1px solid var(--pluno-pa-divider);
5582
+ border-radius: 999px;
5583
+ background-color: var(--pluno-pa-bg);
5584
+ background-image:
5585
+ linear-gradient(var(--pluno-pa-scribble-grid-line) 1px, transparent 1px),
5586
+ linear-gradient(90deg, var(--pluno-pa-scribble-grid-line) 1px, transparent 1px);
5587
+ background-size: 22px 22px;
5588
+ filter: url(#pluno-pa-scribble-wobble-3);
5589
+ }
5518
5590
  .pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
5519
5591
  content: none;
5520
5592
  }
@@ -5615,28 +5687,28 @@ function ro(e, t) {
5615
5687
  filter: url(#pluno-pa-scribble-wobble-2);
5616
5688
  }
5617
5689
  `;
5618
- if (Lr(e, n))
5690
+ if (Tr(e, n))
5619
5691
  return;
5620
5692
  const o = e.ownerDocument.createElement("style");
5621
- o.id = vo, o.textContent = n, e.appendChild(o), Oo(e);
5693
+ o.id = ko, o.textContent = n, e.appendChild(o), Wo(e);
5622
5694
  }
5623
- function kr(e) {
5624
- return e.getElementById(vo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Co) === "true";
5695
+ function Pr(e) {
5696
+ return e.getElementById(ko) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Lo) === "true";
5625
5697
  }
5626
- function Oo(e) {
5627
- e.host instanceof HTMLElement && e.host.setAttribute(Co, "true");
5698
+ function Wo(e) {
5699
+ e.host instanceof HTMLElement && e.host.setAttribute(Lo, "true");
5628
5700
  }
5629
- function Lr(e, t) {
5701
+ function Tr(e, t) {
5630
5702
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
5631
5703
  return !1;
5632
5704
  try {
5633
5705
  const n = new CSSStyleSheet();
5634
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Oo(e), !0;
5706
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Wo(e), !0;
5635
5707
  } catch {
5636
5708
  return !1;
5637
5709
  }
5638
5710
  }
5639
- async function Pr() {
5711
+ async function Ir() {
5640
5712
  return document.body ? document.body : await new Promise((e) => {
5641
5713
  const t = new MutationObserver(() => {
5642
5714
  document.body && (t.disconnect(), e(document.body));
@@ -5644,10 +5716,35 @@ async function Pr() {
5644
5716
  t.observe(document.documentElement, { childList: !0 });
5645
5717
  });
5646
5718
  }
5647
- function Uo(e) {
5719
+ function mn(e) {
5648
5720
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
5649
5721
  }
5650
- function Tr(e) {
5722
+ function Ho(e) {
5723
+ return `${mn(e)}.displayState`;
5724
+ }
5725
+ function Ar(e) {
5726
+ try {
5727
+ return window.sessionStorage.getItem(
5728
+ Ho(e)
5729
+ ) === "minimized" ? "minimized" : "shown";
5730
+ } catch {
5731
+ return "shown";
5732
+ }
5733
+ }
5734
+ function co(e, t) {
5735
+ if (e.layout === "floating")
5736
+ try {
5737
+ const n = Ho(e);
5738
+ if (t === "minimized") {
5739
+ window.sessionStorage.setItem(n, t);
5740
+ return;
5741
+ }
5742
+ window.sessionStorage.removeItem(n);
5743
+ } catch {
5744
+ return;
5745
+ }
5746
+ }
5747
+ function Nr(e) {
5651
5748
  if (e)
5652
5749
  return { clientId: e, release: () => {
5653
5750
  } };
@@ -5655,7 +5752,7 @@ function Tr(e) {
5655
5752
  for (; Ht.has(t); )
5656
5753
  t += 1;
5657
5754
  Ht.add(t);
5658
- const n = `${Wi}${t}`;
5755
+ const n = `${Vi}${t}`;
5659
5756
  let o = crypto.randomUUID();
5660
5757
  try {
5661
5758
  o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
@@ -5669,11 +5766,11 @@ function Tr(e) {
5669
5766
  }
5670
5767
  };
5671
5768
  }
5672
- function Ir(e) {
5769
+ function Rr(e) {
5673
5770
  try {
5674
- const t = window.localStorage.getItem(Uo(e));
5771
+ const t = window.localStorage.getItem(mn(e));
5675
5772
  if (!t)
5676
- return lo();
5773
+ return uo();
5677
5774
  const n = JSON.parse(t);
5678
5775
  return {
5679
5776
  isOpen: n.isOpen === !0,
@@ -5683,25 +5780,25 @@ function Ir(e) {
5683
5780
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
5684
5781
  (o) => typeof o == "string"
5685
5782
  ) : [],
5686
- launcherPosition: Dr(n.launcherPosition) ? n.launcherPosition : null,
5687
- panelSize: zr(n.panelSize) ? xt(n.panelSize) : null,
5688
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-ho) : [],
5783
+ launcherPosition: Or(n.launcherPosition) ? n.launcherPosition : null,
5784
+ panelSize: Ur(n.panelSize) ? xt(n.panelSize) : null,
5785
+ seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-bo) : [],
5689
5786
  sharePromptsDisabled: n.sharePromptsDisabled === !0
5690
5787
  };
5691
5788
  } catch {
5692
- return lo();
5789
+ return uo();
5693
5790
  }
5694
5791
  }
5695
- async function Ar(e) {
5792
+ async function Dr(e) {
5696
5793
  if (e.loadSharePromptsDisabled)
5697
5794
  return e.loadSharePromptsDisabled();
5698
5795
  try {
5699
- return window.localStorage.getItem(fo) === "true";
5796
+ return window.localStorage.getItem(xo) === "true";
5700
5797
  } catch {
5701
5798
  return !1;
5702
5799
  }
5703
5800
  }
5704
- function Nr(e, t) {
5801
+ function zr(e, t) {
5705
5802
  if (e.persistSharePromptsDisabled) {
5706
5803
  Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
5707
5804
  () => {
@@ -5710,12 +5807,12 @@ function Nr(e, t) {
5710
5807
  return;
5711
5808
  }
5712
5809
  try {
5713
- t && window.localStorage.setItem(fo, "true");
5810
+ t && window.localStorage.setItem(xo, "true");
5714
5811
  } catch {
5715
5812
  return;
5716
5813
  }
5717
5814
  }
5718
- function lo() {
5815
+ function uo() {
5719
5816
  return {
5720
5817
  isOpen: !1,
5721
5818
  composerValue: "",
@@ -5728,29 +5825,29 @@ function lo() {
5728
5825
  sharePromptsDisabled: !1
5729
5826
  };
5730
5827
  }
5731
- function Rr(e, t) {
5828
+ function Mr(e, t) {
5732
5829
  try {
5733
5830
  window.localStorage.setItem(
5734
- Uo(e),
5831
+ mn(e),
5735
5832
  JSON.stringify(t)
5736
5833
  );
5737
5834
  } catch {
5738
5835
  return;
5739
5836
  }
5740
5837
  }
5741
- function Dr(e) {
5838
+ function Or(e) {
5742
5839
  if (!e || typeof e != "object")
5743
5840
  return !1;
5744
5841
  const t = e;
5745
5842
  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");
5746
5843
  }
5747
- function zr(e) {
5844
+ function Ur(e) {
5748
5845
  if (!e || typeof e != "object")
5749
5846
  return !1;
5750
5847
  const t = e;
5751
5848
  return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
5752
5849
  }
5753
- async function Bo(e, t) {
5850
+ async function $o(e, t) {
5754
5851
  const n = await fetch(e, {
5755
5852
  method: "POST",
5756
5853
  credentials: "include",
@@ -5762,7 +5859,7 @@ async function Bo(e, t) {
5762
5859
  ...t ? { signal: t } : {}
5763
5860
  });
5764
5861
  if (!n.ok) {
5765
- const i = await n.text(), r = ii(i);
5862
+ const i = await n.text(), r = si(i);
5766
5863
  throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
5767
5864
  }
5768
5865
  const o = await n.json();
@@ -5770,29 +5867,29 @@ async function Bo(e, t) {
5770
5867
  throw new Error("Pluno token endpoint did not return a token");
5771
5868
  return o.token;
5772
5869
  }
5773
- function Mr(e) {
5870
+ function Br(e) {
5774
5871
  let t = !1, n = !1;
5775
5872
  const o = async () => {
5776
5873
  const i = new AbortController();
5777
5874
  let r = !1;
5778
5875
  const l = new Promise((p, s) => {
5779
- const u = window.setTimeout(() => {
5780
- r = !0, i.abort(), s(new Error(On));
5781
- }, Fi);
5876
+ const g = window.setTimeout(() => {
5877
+ r = !0, i.abort(), s(new Error(Bn));
5878
+ }, qi);
5782
5879
  i.signal.addEventListener(
5783
5880
  "abort",
5784
- () => window.clearTimeout(u),
5881
+ () => window.clearTimeout(g),
5785
5882
  { once: !0 }
5786
5883
  );
5787
5884
  });
5788
5885
  try {
5789
5886
  const p = await Promise.race([
5790
- Bo(e, i.signal),
5887
+ $o(e, i.signal),
5791
5888
  l
5792
5889
  ]);
5793
5890
  return i.abort(), p;
5794
5891
  } catch (p) {
5795
- throw i.abort(), r ? new Error(On) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(Hi);
5892
+ throw i.abort(), r ? new Error(Bn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ji);
5796
5893
  }
5797
5894
  };
5798
5895
  return {
@@ -5815,32 +5912,32 @@ function Mr(e) {
5815
5912
  }
5816
5913
  };
5817
5914
  }
5818
- const po = /* @__PURE__ */ new WeakSet();
5819
- function Or(e) {
5915
+ const go = /* @__PURE__ */ new WeakSet();
5916
+ function Fr(e) {
5820
5917
  return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
5821
5918
  }
5822
- function so(e) {
5919
+ function ho(e) {
5823
5920
  const t = e.pathname.split("/");
5824
5921
  return t[t.length - 1] ?? "";
5825
5922
  }
5826
- function Ur(e, t) {
5923
+ function Wr(e, t) {
5827
5924
  const n = new URL(e.src, document.baseURI);
5828
- return n.href === t.href || n.pathname === t.pathname ? !0 : so(n) === so(t);
5925
+ return n.href === t.href || n.pathname === t.pathname ? !0 : ho(n) === ho(t);
5829
5926
  }
5830
- class he extends EventTarget {
5927
+ class fe extends EventTarget {
5831
5928
  constructor(t, n) {
5832
- super(), this.channelId = n, this.url = t, this.addPreviewListener(zi, () => {
5833
- this.readyState = he.OPEN, this.dispatchEvent(new Event("open"));
5834
- }), this.addPreviewListener(Mi, (o) => {
5929
+ super(), this.channelId = n, this.url = t, this.addPreviewListener(Fi, () => {
5930
+ this.readyState = fe.OPEN, this.dispatchEvent(new Event("open"));
5931
+ }), this.addPreviewListener(Wi, (o) => {
5835
5932
  const i = o;
5836
5933
  this.dispatchEvent(
5837
5934
  new MessageEvent("message", { data: i.detail?.data ?? "" })
5838
5935
  );
5839
- }), this.addPreviewListener(Oi, () => {
5840
- this.readyState = he.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5841
- }), this.addPreviewListener(Ui, (o) => {
5936
+ }), this.addPreviewListener(Hi, () => {
5937
+ this.readyState = fe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5938
+ }), this.addPreviewListener($i, (o) => {
5842
5939
  const i = o;
5843
- this.readyState = he.CLOSED, this.dispatchEvent(
5940
+ this.readyState = fe.CLOSED, this.dispatchEvent(
5844
5941
  new CloseEvent("close", {
5845
5942
  code: i.detail?.code ?? 1e3,
5846
5943
  reason: i.detail?.reason ?? "",
@@ -5850,7 +5947,7 @@ class he extends EventTarget {
5850
5947
  }), window.dispatchEvent(
5851
5948
  new CustomEvent(
5852
5949
  ht(
5853
- Ni,
5950
+ Oi,
5854
5951
  this.channelId
5855
5952
  ),
5856
5953
  {
@@ -5869,18 +5966,18 @@ class he extends EventTarget {
5869
5966
  extensions = "";
5870
5967
  binaryType = "blob";
5871
5968
  bufferedAmount = 0;
5872
- readyState = he.CONNECTING;
5873
- socketId = Br();
5969
+ readyState = fe.CONNECTING;
5970
+ socketId = Hr();
5874
5971
  listeners = /* @__PURE__ */ new Map();
5875
5972
  send(t) {
5876
- if (this.readyState !== he.OPEN)
5973
+ if (this.readyState !== fe.OPEN)
5877
5974
  throw new DOMException(
5878
5975
  "Pluno preview websocket is not open",
5879
5976
  "InvalidStateError"
5880
5977
  );
5881
5978
  window.dispatchEvent(
5882
5979
  new CustomEvent(
5883
- ht(Ri, this.channelId),
5980
+ ht(Ui, this.channelId),
5884
5981
  {
5885
5982
  detail: {
5886
5983
  socketId: this.socketId,
@@ -5891,9 +5988,9 @@ class he extends EventTarget {
5891
5988
  );
5892
5989
  }
5893
5990
  close(t, n) {
5894
- this.readyState !== he.CLOSED && (this.readyState = he.CLOSING, window.dispatchEvent(
5991
+ this.readyState !== fe.CLOSED && (this.readyState = fe.CLOSING, window.dispatchEvent(
5895
5992
  new CustomEvent(
5896
- ht(Di, this.channelId),
5993
+ ht(Bi, this.channelId),
5897
5994
  {
5898
5995
  detail: { socketId: this.socketId, code: t, reason: n }
5899
5996
  }
@@ -5915,19 +6012,19 @@ class he extends EventTarget {
5915
6012
  this.listeners.clear();
5916
6013
  }
5917
6014
  }
5918
- function Br() {
6015
+ function Hr() {
5919
6016
  const e = window.sessionStorage.getItem(
5920
- Mn
6017
+ Un
5921
6018
  );
5922
6019
  if (e)
5923
6020
  return e;
5924
6021
  const t = crypto.randomUUID();
5925
- return window.sessionStorage.setItem(Mn, t), t;
6022
+ return window.sessionStorage.setItem(Un, t), t;
5926
6023
  }
5927
6024
  function ht(e, t) {
5928
6025
  return `${e}:${t}`;
5929
6026
  }
5930
- function Fr(e) {
6027
+ function $r(e) {
5931
6028
  const t = document.currentScript;
5932
6029
  if (t instanceof HTMLScriptElement)
5933
6030
  return [t];
@@ -5935,35 +6032,35 @@ function Fr(e) {
5935
6032
  return Array.from(
5936
6033
  document.querySelectorAll("script[type='module'][src]")
5937
6034
  ).filter(
5938
- (i) => i instanceof HTMLScriptElement && Or(i) && Ur(i, o)
6035
+ (i) => i instanceof HTMLScriptElement && Fr(i) && Wr(i, o)
5939
6036
  );
5940
6037
  }
5941
- function Hr(e) {
5942
- for (const t of Fr(e))
5943
- po.has(t) || t.dataset.plunoAutoMount === "false" || (po.add(t), Fo(t).catch((n) => {
6038
+ function Gr(e) {
6039
+ for (const t of $r(e))
6040
+ go.has(t) || t.dataset.plunoAutoMount === "false" || (go.add(t), Go(t).catch((n) => {
5944
6041
  console.error("Failed to mount Pluno widget", n);
5945
6042
  }));
5946
6043
  }
5947
- function Fo(e) {
5948
- const t = window, n = t[ge];
6044
+ function Go(e) {
6045
+ const t = window, n = t[me];
5949
6046
  if (n) {
5950
6047
  if (n.host === null)
5951
6048
  return n.mountPromise.catch(() => {
5952
- const s = t[ge];
5953
- return s ? s.mountPromise : Fo(e);
6049
+ const s = t[me];
6050
+ return s ? s.mountPromise : Go(e);
5954
6051
  });
5955
- if (Wr(n.host))
6052
+ if (qr(n.host))
5956
6053
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
5957
- n.destroy?.(), delete t[ge];
6054
+ n.destroy?.(), delete t[me];
5958
6055
  }
5959
- const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Mr(i) : null;
6056
+ const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Br(i) : null;
5960
6057
  let l;
5961
- const p = da({
6058
+ const p = ga({
5962
6059
  token: e.dataset.plunoToken,
5963
6060
  tokenProvider: r?.loadToken,
5964
6061
  tokenEndpoint: i,
5965
6062
  backendUrl: e.dataset.plunoBackendUrl,
5966
- webSocketFactory: o ? sa(o) : void 0,
6063
+ webSocketFactory: o ? ua(o) : void 0,
5967
6064
  launcherLabel: e.dataset.plunoLauncherLabel,
5968
6065
  accentColor: e.dataset.plunoAccentColor,
5969
6066
  colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
@@ -5971,29 +6068,29 @@ function Fo(e) {
5971
6068
  scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
5972
6069
  position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
5973
6070
  }).then((s) => {
5974
- if (t[ge] !== l) {
6071
+ if (t[me] !== l) {
5975
6072
  s.destroy();
5976
6073
  return;
5977
6074
  }
5978
- const u = s.host;
5979
- u.setAttribute(mo, "true"), l.host = u, l.destroy = () => {
5980
- t[ge] === l && delete t[ge], l.host = null, l.destroy = null, s.destroy();
6075
+ const g = s.host;
6076
+ g.setAttribute(_o, "true"), l.host = g, l.destroy = () => {
6077
+ t[me] === l && delete t[me], l.host = null, l.destroy = null, s.destroy();
5981
6078
  };
5982
6079
  }).catch((s) => {
5983
- throw t[ge] === l && delete t[ge], s;
6080
+ throw t[me] === l && delete t[me], s;
5984
6081
  });
5985
6082
  return l = {
5986
6083
  mountPromise: p,
5987
6084
  host: null,
5988
6085
  destroy: null,
5989
6086
  retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
5990
- }, t[ge] = l, p;
6087
+ }, t[me] = l, p;
5991
6088
  }
5992
- function Wr(e) {
5993
- return e.isConnected && e.getAttribute(mo) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
6089
+ function qr(e) {
6090
+ return e.isConnected && e.getAttribute(_o) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
5994
6091
  }
5995
- Hr(import.meta.url);
6092
+ Gr(import.meta.url);
5996
6093
  export {
5997
- sa as createProductAgentPreviewBridgeWebSocketFactory,
5998
- da as mountPlunoProductAgentWidget
6094
+ ua as createProductAgentPreviewBridgeWebSocketFactory,
6095
+ ga as mountPlunoProductAgentWidget
5999
6096
  };