@pluno/product-agent-web 0.1.82 → 0.1.83
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.
- package/dist/markdown.d.ts +1 -0
- package/dist/product-agent-widget.js +746 -684
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
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
5
|
if (An(nt(t), Tn) >= In)
|
|
6
6
|
return t;
|
|
7
7
|
let o = nt(t);
|
|
8
8
|
const i = nt(wt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
10
|
+
if (o = pi(o, i, 0.22), An(o, Tn) >= In)
|
|
11
11
|
return Zt(o);
|
|
12
12
|
return Zt(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ri() {
|
|
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 ii() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function li(e) {
|
|
23
|
+
const t = uo(e), n = Jt(nt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,9 +56,9 @@ function ai(e) {
|
|
|
56
56
|
shadow: ie(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function uo(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()}` :
|
|
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;
|
|
62
62
|
}
|
|
63
63
|
function nt(e) {
|
|
64
64
|
return [
|
|
@@ -82,7 +82,7 @@ function An(e, t) {
|
|
|
82
82
|
const n = Jt(e), o = Jt(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function pi(e, t, n) {
|
|
86
86
|
const o = Qt(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
@@ -91,17 +91,17 @@ function ri(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function ie(e, t, n) {
|
|
94
|
-
const [o, i, r] =
|
|
95
|
-
return Zt(
|
|
94
|
+
const [o, i, r] = si(nt(e));
|
|
95
|
+
return Zt(di(o, Qt(i + n), Qt(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function si([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
|
|
102
|
-
return [(l === o ? (i - r) /
|
|
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];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function di(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;
|
|
@@ -118,11 +118,11 @@ function Ft(e, t, n) {
|
|
|
118
118
|
function Qt(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const go = "suggest_share_on_socials";
|
|
122
|
+
function ci(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 !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== go)
|
|
126
126
|
continue;
|
|
127
127
|
const o = Nn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
@@ -136,8 +136,8 @@ function si(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function ui(e) {
|
|
140
|
+
const t = await gi(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 })]);
|
|
@@ -150,50 +150,50 @@ function Nn(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function gi(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
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 = {}) {
|
|
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
|
-
}, p = (
|
|
161
|
+
}, p = (c) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
}, s = (
|
|
163
|
+
u();
|
|
164
|
+
}, Si(c)));
|
|
165
|
+
}, s = (c) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
|
-
o =
|
|
167
|
+
o = c, e(c);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const h = o, S = 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() -
|
|
177
|
-
o = Math.round(
|
|
178
|
-
},
|
|
179
|
-
},
|
|
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 () => {
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
181
|
+
const c = await vi(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
|
-
s(
|
|
184
|
+
s(c.count), p(c.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(wi);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
return
|
|
189
|
+
return u(), () => {
|
|
190
190
|
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function vi(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(mi, Ci(e.backendUrl ?? hi)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
@@ -207,16 +207,69 @@ async function xi(e) {
|
|
|
207
207
|
function Rn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ci(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function Si(e) {
|
|
214
|
+
return Math.min(xi, Math.max(_i, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Ei(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const ki = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
220
|
+
function Li(e) {
|
|
221
|
+
let t = "", n = "", o = null;
|
|
222
|
+
for (const i of e.split(new RegExp("(?<=\\n)"))) {
|
|
223
|
+
if (o) {
|
|
224
|
+
t += i;
|
|
225
|
+
const l = i.replace(/\r?\n$/, "").match(/^[ \t]{0,3}(`+|~+)[ \t]*$/);
|
|
226
|
+
l?.[1][0] === o.marker && l[1].length >= o.length && (o = null);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
230
|
+
if (r) {
|
|
231
|
+
t += Dn(n) + i, n = "", o = {
|
|
232
|
+
marker: r[1][0],
|
|
233
|
+
length: r[1].length
|
|
234
|
+
};
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
n += i;
|
|
238
|
+
}
|
|
239
|
+
return t + Dn(n);
|
|
240
|
+
}
|
|
241
|
+
function Dn(e) {
|
|
242
|
+
let t = "", n = 0;
|
|
243
|
+
for (const o of e.matchAll(ki)) {
|
|
244
|
+
const i = o.index ?? 0;
|
|
245
|
+
t += zn(
|
|
246
|
+
e.slice(n, i)
|
|
247
|
+
), t += o[0], n = i + o[0].length;
|
|
248
|
+
}
|
|
249
|
+
return t + zn(e.slice(n));
|
|
250
|
+
}
|
|
251
|
+
function zn(e) {
|
|
252
|
+
return e.replace(
|
|
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})`
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
function Pi(e, t) {
|
|
258
|
+
let n = 0;
|
|
259
|
+
for (let o = t - 1; e[o] === "\\"; o -= 1)
|
|
260
|
+
n += 1;
|
|
261
|
+
return n % 2 === 1;
|
|
262
|
+
}
|
|
263
|
+
function Ti(e, t, n) {
|
|
264
|
+
if (n !== "x" && n !== "X")
|
|
265
|
+
return !1;
|
|
266
|
+
const o = e.lastIndexOf(`
|
|
267
|
+
`, t - 1) + 1;
|
|
268
|
+
return /^[ \t]*(?:>[ \t]*)*(?:[-*+]|\d+[.)])[ \t]+$/.test(
|
|
269
|
+
e.slice(o, t)
|
|
270
|
+
);
|
|
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 = {
|
|
220
273
|
launcherLabel: "Ask for anything...",
|
|
221
274
|
accentColor: "#7c3aed",
|
|
222
275
|
colorScheme: "light",
|
|
@@ -224,7 +277,7 @@ const uo = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-conne
|
|
|
224
277
|
scribbleStyle: !0,
|
|
225
278
|
position: "bottom-right",
|
|
226
279
|
movableLauncher: !0
|
|
227
|
-
},
|
|
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 = [
|
|
228
281
|
{
|
|
229
282
|
ellipseCx: "17.5",
|
|
230
283
|
ellipseCy: "24.5",
|
|
@@ -261,12 +314,12 @@ const uo = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-conne
|
|
|
261
314
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
315
|
pathStrokeWidth: "2.45"
|
|
263
316
|
}
|
|
264
|
-
],
|
|
265
|
-
let
|
|
266
|
-
function
|
|
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) {
|
|
267
320
|
return (t) => new he(t, e);
|
|
268
321
|
}
|
|
269
|
-
async function
|
|
322
|
+
async function da(e = {}) {
|
|
270
323
|
const t = {
|
|
271
324
|
launcherLabel: e.launcherLabel ?? ae.launcherLabel,
|
|
272
325
|
accentColor: e.accentColor ?? ae.accentColor,
|
|
@@ -328,24 +381,24 @@ async function ia(e = {}) {
|
|
|
328
381
|
);
|
|
329
382
|
const n = document.createElement("div");
|
|
330
383
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
331
|
-
|
|
384
|
+
Bi,
|
|
332
385
|
t.sdkPreviewChannelId
|
|
333
386
|
);
|
|
334
387
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
335
388
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
336
|
-
let r =
|
|
389
|
+
let r = $n(
|
|
337
390
|
t.accentColor,
|
|
338
391
|
t.scribbleStyle
|
|
339
392
|
);
|
|
340
|
-
|
|
393
|
+
Ra(
|
|
341
394
|
i,
|
|
342
395
|
t.launcherLabel,
|
|
343
396
|
r,
|
|
344
397
|
t.movableLauncher,
|
|
345
398
|
t.showLauncherMinimizeButton
|
|
346
399
|
), o.appendChild(i);
|
|
347
|
-
const l =
|
|
348
|
-
let p = t.movableLauncher ? l.launcherPosition : null, s = p !== null,
|
|
400
|
+
const l = Ir(t);
|
|
401
|
+
let p = t.movableLauncher ? l.launcherPosition : null, s = p !== null, u = l.panelSize, c = null;
|
|
349
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(
|
|
350
403
|
i,
|
|
351
404
|
Gt(
|
|
@@ -353,13 +406,13 @@ async function ia(e = {}) {
|
|
|
353
406
|
p,
|
|
354
407
|
t.position
|
|
355
408
|
)
|
|
356
|
-
)),
|
|
409
|
+
)), ro(o, t.accentColor), qn(i, r, {
|
|
357
410
|
accentColor: t.accentColor,
|
|
358
411
|
colorScheme: t.colorScheme,
|
|
359
412
|
fontFamily: t.fontFamily,
|
|
360
413
|
scribbleStyle: t.scribbleStyle
|
|
361
414
|
});
|
|
362
|
-
const
|
|
415
|
+
const h = await Pr(), S = h.ownerDocument, v = i.querySelector(
|
|
363
416
|
".pluno-pa-widget__launcher"
|
|
364
417
|
), D = i.querySelector(
|
|
365
418
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -367,9 +420,9 @@ async function ia(e = {}) {
|
|
|
367
420
|
".pluno-pa-widget__launcher-input"
|
|
368
421
|
), g = i.querySelector(
|
|
369
422
|
".pluno-pa-widget__launcher-minimize"
|
|
370
|
-
), y = i.querySelector(".pluno-pa-widget__panel"),
|
|
423
|
+
), y = i.querySelector(".pluno-pa-widget__panel"), m = i.querySelector(
|
|
371
424
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
372
|
-
),
|
|
425
|
+
), k = Array.from(
|
|
373
426
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
374
427
|
), N = i.querySelector(
|
|
375
428
|
".pluno-pa-widget__close"
|
|
@@ -381,7 +434,7 @@ async function ia(e = {}) {
|
|
|
381
434
|
".pluno-pa-widget__billing-status"
|
|
382
435
|
), He = i.querySelector(
|
|
383
436
|
".pluno-pa-widget__attachments"
|
|
384
|
-
),
|
|
437
|
+
), z = i.querySelector(
|
|
385
438
|
".pluno-pa-widget__attachment-input"
|
|
386
439
|
), We = i.querySelector(
|
|
387
440
|
".pluno-pa-widget__attach"
|
|
@@ -405,7 +458,7 @@ async function ia(e = {}) {
|
|
|
405
458
|
".pluno-pa-widget__timeline-jump"
|
|
406
459
|
), x = i.querySelector(
|
|
407
460
|
".pluno-pa-widget__active-users-counter"
|
|
408
|
-
),
|
|
461
|
+
), E = i.querySelector(
|
|
409
462
|
".pluno-pa-widget__timeline"
|
|
410
463
|
), j = i.querySelector(
|
|
411
464
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
@@ -418,14 +471,14 @@ async function ia(e = {}) {
|
|
|
418
471
|
), R = i.querySelector(
|
|
419
472
|
".pluno-pa-widget__notify-suggestion-never"
|
|
420
473
|
);
|
|
421
|
-
if (!v || !C || !y || !N || !I || !G || !ye || !He || !
|
|
474
|
+
if (!v || !C || !y || !N || !I || !G || !ye || !He || !z || !We || !w || !O || !ve || !se || !ot || !$ || !it || !Ae || !oe || !x || !E || !j)
|
|
422
475
|
throw new Error("Failed to mount Pluno widget");
|
|
423
476
|
if (t.movableLauncher && !D)
|
|
424
477
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
425
|
-
|
|
478
|
+
Jn(C), Jn(w);
|
|
426
479
|
let q = [], de = null;
|
|
427
480
|
const Ne = () => {
|
|
428
|
-
|
|
481
|
+
Ja(
|
|
429
482
|
He,
|
|
430
483
|
q,
|
|
431
484
|
(a) => {
|
|
@@ -434,10 +487,10 @@ async function ia(e = {}) {
|
|
|
434
487
|
), Ne(), F(b.getState()), H();
|
|
435
488
|
}
|
|
436
489
|
);
|
|
437
|
-
}, hn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () =>
|
|
490
|
+
}, hn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Bo(t.tokenEndpoint) : void 0);
|
|
438
491
|
if (!t.loginRequired && !t.signupRequired && !t.token && !hn && !t.webSocketFactory)
|
|
439
492
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
440
|
-
const
|
|
493
|
+
const Ho = window.fetch.bind(window), vt = Tr(t.clientId);
|
|
441
494
|
let b;
|
|
442
495
|
try {
|
|
443
496
|
const a = {
|
|
@@ -459,11 +512,11 @@ async function ia(e = {}) {
|
|
|
459
512
|
autoConnect: !1,
|
|
460
513
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
461
514
|
};
|
|
462
|
-
b = await
|
|
515
|
+
b = await oi.init(a);
|
|
463
516
|
} catch (a) {
|
|
464
517
|
throw vt.release(), n.remove(), a;
|
|
465
518
|
}
|
|
466
|
-
|
|
519
|
+
h.appendChild(n), ne(
|
|
467
520
|
"web-sdk.widget",
|
|
468
521
|
"Applied initial widget appearance",
|
|
469
522
|
{
|
|
@@ -476,17 +529,17 @@ async function ia(e = {}) {
|
|
|
476
529
|
const Ct = new Set(l.openToolGroupKeys), Re = new Set(
|
|
477
530
|
l.seenShareCandidateIds
|
|
478
531
|
), at = new Set(Re);
|
|
479
|
-
let St = l.sharePromptsDisabled || await
|
|
532
|
+
let St = l.sharePromptsDisabled || await Ar(t), Q = null, ce = !1, rt = !(t.loginRequired || t.signupRequired), me = !1, Ce = {
|
|
480
533
|
enabled: !0
|
|
481
534
|
}, Se = 0, mn = "", fe = !1, ue = !1, we = [], Et = null, Ge = null;
|
|
482
535
|
const ee = (a, d) => {
|
|
483
536
|
Ce = { enabled: a, reason: d };
|
|
484
537
|
}, te = () => {
|
|
485
538
|
oe.hidden = !0;
|
|
486
|
-
},
|
|
539
|
+
}, Wo = () => {
|
|
487
540
|
oe.hidden = !1;
|
|
488
|
-
},
|
|
489
|
-
ee(!0, a), te(), tt(
|
|
541
|
+
}, Go = (a = "jump") => {
|
|
542
|
+
ee(!0, a), te(), tt(E, () => Ce.enabled), Se = E.scrollTop;
|
|
490
543
|
}, Ee = () => {
|
|
491
544
|
if (se.hidden = t.loginRequired, ot.hidden = !fe, se.setAttribute("aria-expanded", String(fe)), $.classList.toggle(
|
|
492
545
|
"pluno-pa-widget__history-list--center",
|
|
@@ -499,14 +552,14 @@ async function ia(e = {}) {
|
|
|
499
552
|
const d = document.createElement("button");
|
|
500
553
|
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ue;
|
|
501
554
|
const _ = document.createElement("span");
|
|
502
|
-
_.className = "pluno-pa-widget__history-item-title", _.textContent =
|
|
555
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = Ia(a);
|
|
503
556
|
const T = document.createElement("time");
|
|
504
|
-
T.className = "pluno-pa-widget__history-time", T.dateTime = a.lastActiveAt, T.textContent =
|
|
557
|
+
T.className = "pluno-pa-widget__history-time", T.dateTime = a.lastActiveAt, T.textContent = Na(
|
|
505
558
|
a.lastActiveAt,
|
|
506
559
|
Date.now()
|
|
507
560
|
);
|
|
508
|
-
const
|
|
509
|
-
|
|
561
|
+
const M = document.createElement("small");
|
|
562
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = Aa(a), d.append(_, T, M), d.addEventListener("click", () => {
|
|
510
563
|
fe = !1, Ge = null, Ee(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
|
|
511
564
|
}), $.appendChild(d);
|
|
512
565
|
}
|
|
@@ -528,17 +581,17 @@ async function ia(e = {}) {
|
|
|
528
581
|
{
|
|
529
582
|
message: d instanceof Error ? d.message : String(d)
|
|
530
583
|
}
|
|
531
|
-
), Ge =
|
|
584
|
+
), Ge = Ki;
|
|
532
585
|
} finally {
|
|
533
586
|
ue = !1, Ee();
|
|
534
587
|
}
|
|
535
588
|
}
|
|
536
|
-
},
|
|
589
|
+
}, $o = () => {
|
|
537
590
|
!Et || ue || $.scrollHeight - $.scrollTop - $.clientHeight <= 24 && fn(Et);
|
|
538
591
|
}, wn = () => {
|
|
539
|
-
ce || typeof document > "u" || (
|
|
592
|
+
ce || typeof document > "u" || (ro(o, t.accentColor), n.isConnected || S.body?.appendChild(n));
|
|
540
593
|
}, bn = new MutationObserver(wn);
|
|
541
|
-
bn.observe(
|
|
594
|
+
bn.observe(S.documentElement, {
|
|
542
595
|
childList: !0,
|
|
543
596
|
subtree: !0
|
|
544
597
|
}), wn();
|
|
@@ -546,7 +599,7 @@ async function ia(e = {}) {
|
|
|
546
599
|
const d = bt(i, a);
|
|
547
600
|
return an(
|
|
548
601
|
i,
|
|
549
|
-
p ?
|
|
602
|
+
p ? So(p, d) : ba(
|
|
550
603
|
i,
|
|
551
604
|
t.position,
|
|
552
605
|
d
|
|
@@ -554,17 +607,17 @@ async function ia(e = {}) {
|
|
|
554
607
|
d
|
|
555
608
|
);
|
|
556
609
|
}, B = () => {
|
|
557
|
-
const a =
|
|
558
|
-
|
|
610
|
+
const a = Ea(o, C, w);
|
|
611
|
+
Rr(t, {
|
|
559
612
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
560
613
|
composerValue: w.value,
|
|
561
614
|
focusedInput: a,
|
|
562
615
|
focusedInputAt: a ? Date.now() : null,
|
|
563
616
|
openToolGroupKeys: [...Ct],
|
|
564
617
|
launcherPosition: s ? p : null,
|
|
565
|
-
panelSize:
|
|
618
|
+
panelSize: u,
|
|
566
619
|
seenShareCandidateIds: [...Re].slice(
|
|
567
|
-
-
|
|
620
|
+
-ho
|
|
568
621
|
),
|
|
569
622
|
sharePromptsDisabled: St
|
|
570
623
|
});
|
|
@@ -582,10 +635,10 @@ async function ia(e = {}) {
|
|
|
582
635
|
p,
|
|
583
636
|
t.position
|
|
584
637
|
)
|
|
585
|
-
),
|
|
638
|
+
), Yn(i), B(), d && lt("minimized");
|
|
586
639
|
}, ke = (a, d = {}) => {
|
|
587
|
-
|
|
588
|
-
debugVersion:
|
|
640
|
+
Sa(a, {
|
|
641
|
+
debugVersion: pa,
|
|
589
642
|
launcherPosition: p,
|
|
590
643
|
rootClasses: i.className,
|
|
591
644
|
rootStyle: {
|
|
@@ -611,10 +664,10 @@ async function ia(e = {}) {
|
|
|
611
664
|
}), d;
|
|
612
665
|
}, kt = (a, d) => {
|
|
613
666
|
if (!a || !d) {
|
|
614
|
-
|
|
667
|
+
Yn(i);
|
|
615
668
|
return;
|
|
616
669
|
}
|
|
617
|
-
|
|
670
|
+
Ca(i, {
|
|
618
671
|
x: a.x - d.x,
|
|
619
672
|
y: a.y - d.y
|
|
620
673
|
});
|
|
@@ -632,22 +685,22 @@ async function ia(e = {}) {
|
|
|
632
685
|
}
|
|
633
686
|
const a = je();
|
|
634
687
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
635
|
-
Wt(i,
|
|
636
|
-
const d = Fe(
|
|
688
|
+
Wt(i, u);
|
|
689
|
+
const d = Fe(u);
|
|
637
690
|
Vt(
|
|
638
|
-
|
|
691
|
+
m,
|
|
639
692
|
d.width
|
|
640
693
|
);
|
|
641
694
|
const _ = mt(
|
|
642
|
-
|
|
695
|
+
c ?? $t(
|
|
643
696
|
i,
|
|
644
697
|
a,
|
|
645
698
|
t.position,
|
|
646
|
-
|
|
699
|
+
u
|
|
647
700
|
),
|
|
648
701
|
d
|
|
649
702
|
);
|
|
650
|
-
|
|
703
|
+
c && (c = _), kt(_, a), ke(
|
|
651
704
|
"Applied open panel position after viewport resize",
|
|
652
705
|
{ openPanelPosition: _ }
|
|
653
706
|
);
|
|
@@ -658,7 +711,7 @@ async function ia(e = {}) {
|
|
|
658
711
|
};
|
|
659
712
|
let xn = () => {
|
|
660
713
|
};
|
|
661
|
-
window.addEventListener("resize", _n), t.movableLauncher && D ? (je(), xn =
|
|
714
|
+
window.addEventListener("resize", _n), t.movableLauncher && D ? (je(), xn = ma({
|
|
662
715
|
root: i,
|
|
663
716
|
launcher: v,
|
|
664
717
|
launcherDragHandle: D,
|
|
@@ -669,7 +722,7 @@ async function ia(e = {}) {
|
|
|
669
722
|
a,
|
|
670
723
|
_
|
|
671
724
|
);
|
|
672
|
-
p =
|
|
725
|
+
p = xa(
|
|
673
726
|
T,
|
|
674
727
|
_
|
|
675
728
|
), Te(i, T), ke("Dragging closed launcher", {
|
|
@@ -679,36 +732,36 @@ async function ia(e = {}) {
|
|
|
679
732
|
persist: () => {
|
|
680
733
|
s = !0, B(), ke("Persisted closed launcher drag position");
|
|
681
734
|
}
|
|
682
|
-
})) : Te(i, null), Wt(i,
|
|
683
|
-
const
|
|
684
|
-
const a = Fe(
|
|
735
|
+
})) : Te(i, null), Wt(i, u);
|
|
736
|
+
const qo = () => {
|
|
737
|
+
const a = Fe(u), d = $e();
|
|
685
738
|
return {
|
|
686
739
|
position: mt(
|
|
687
|
-
|
|
740
|
+
c ?? $t(
|
|
688
741
|
i,
|
|
689
742
|
d,
|
|
690
743
|
t.position,
|
|
691
|
-
|
|
744
|
+
u
|
|
692
745
|
),
|
|
693
746
|
a
|
|
694
747
|
),
|
|
695
748
|
size: a
|
|
696
749
|
};
|
|
697
|
-
},
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
Fe(
|
|
701
|
-
),
|
|
750
|
+
}, jo = (a) => {
|
|
751
|
+
u = xt(a.size), Wt(i, u), Vt(
|
|
752
|
+
m,
|
|
753
|
+
Fe(u).width
|
|
754
|
+
), c = mt(
|
|
702
755
|
a.position,
|
|
703
|
-
Fe(
|
|
756
|
+
Fe(u)
|
|
704
757
|
);
|
|
705
758
|
const d = $e();
|
|
706
|
-
kt(
|
|
707
|
-
},
|
|
759
|
+
kt(c, d);
|
|
760
|
+
}, Vo = k.length > 0 ? fa({
|
|
708
761
|
root: i,
|
|
709
|
-
handles:
|
|
710
|
-
getBounds:
|
|
711
|
-
setBounds:
|
|
762
|
+
handles: k,
|
|
763
|
+
getBounds: qo,
|
|
764
|
+
setBounds: jo,
|
|
712
765
|
persist: B
|
|
713
766
|
}) : () => {
|
|
714
767
|
};
|
|
@@ -718,7 +771,7 @@ async function ia(e = {}) {
|
|
|
718
771
|
Lt = !0;
|
|
719
772
|
try {
|
|
720
773
|
const a = await t.billingStatusLoader();
|
|
721
|
-
|
|
774
|
+
eo(
|
|
722
775
|
t.billingStatus,
|
|
723
776
|
a,
|
|
724
777
|
b.getState().lastErrorCode
|
|
@@ -732,31 +785,31 @@ async function ia(e = {}) {
|
|
|
732
785
|
}
|
|
733
786
|
}
|
|
734
787
|
}, be = (a = "", d = !0) => {
|
|
735
|
-
yn(), Ye && (Ye = !1, It()), i.classList.contains("pluno-pa-widget--open") || (
|
|
736
|
-
|
|
737
|
-
Fe(
|
|
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
|
|
738
791
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
739
792
|
const _ = je(), T = $t(
|
|
740
793
|
i,
|
|
741
794
|
_,
|
|
742
795
|
t.position,
|
|
743
|
-
|
|
796
|
+
u
|
|
744
797
|
);
|
|
745
798
|
if (kt(T, _), ke("Opening launcher at clamped open panel position", {
|
|
746
799
|
openPanelPosition: T,
|
|
747
800
|
visibleLauncherPosition: _
|
|
748
801
|
}), ee(!0, "open"), te(), !d) {
|
|
749
|
-
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, et(w)), tt(
|
|
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);
|
|
750
803
|
return;
|
|
751
804
|
}
|
|
752
805
|
window.requestAnimationFrame(() => {
|
|
753
|
-
i.classList.add("pluno-pa-widget--open"), a && (w.value = a, et(w)), tt(
|
|
754
|
-
v.hidden = !0, tt(
|
|
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;
|
|
755
808
|
}, 220);
|
|
756
809
|
});
|
|
757
810
|
}, Pt = () => {
|
|
758
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(() => {
|
|
759
|
-
y.hidden = !0, N.hidden = !0,
|
|
812
|
+
y.hidden = !0, N.hidden = !0, c = null, i.classList.remove("pluno-pa-widget--closing");
|
|
760
813
|
}, 220);
|
|
761
814
|
};
|
|
762
815
|
v.addEventListener("submit", (a) => {
|
|
@@ -774,20 +827,20 @@ async function ia(e = {}) {
|
|
|
774
827
|
be(a), C.value = "";
|
|
775
828
|
});
|
|
776
829
|
let Tt = null, pt = null, Le = null;
|
|
777
|
-
const vn = (a) => a === C || a === w,
|
|
830
|
+
const vn = (a) => a === C || a === w, Ko = (a) => {
|
|
778
831
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
779
832
|
return null;
|
|
780
833
|
let d = a;
|
|
781
834
|
for (; d; ) {
|
|
782
|
-
const _ = d.closest(
|
|
835
|
+
const _ = d.closest(Un);
|
|
783
836
|
if (_)
|
|
784
837
|
return _;
|
|
785
838
|
const T = d.getRootNode();
|
|
786
839
|
d = T instanceof ShadowRoot ? T.host : null;
|
|
787
840
|
}
|
|
788
841
|
return null;
|
|
789
|
-
},
|
|
790
|
-
if (!a.isConnected || !a.matches(
|
|
842
|
+
}, Yo = (a) => {
|
|
843
|
+
if (!a.isConnected || !a.matches(Un))
|
|
791
844
|
return !1;
|
|
792
845
|
if (!(a instanceof HTMLElement))
|
|
793
846
|
return !0;
|
|
@@ -800,9 +853,9 @@ async function ia(e = {}) {
|
|
|
800
853
|
}, Cn = (a) => {
|
|
801
854
|
Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Pe(), a !== null ? Le = window.setInterval(() => {
|
|
802
855
|
const d = Ke;
|
|
803
|
-
(!d || !
|
|
804
|
-
},
|
|
805
|
-
},
|
|
856
|
+
(!d || !Yo(d)) && Cn(null);
|
|
857
|
+
}, Vi) : Le !== null && (window.clearInterval(Le), Le = null, pt = null));
|
|
858
|
+
}, Xo = () => {
|
|
806
859
|
Le !== null && (window.clearInterval(Le), Le = null);
|
|
807
860
|
};
|
|
808
861
|
i.addEventListener("focusin", (a) => {
|
|
@@ -811,13 +864,13 @@ async function ia(e = {}) {
|
|
|
811
864
|
if (!vn(a.target) || Ke !== null)
|
|
812
865
|
return;
|
|
813
866
|
const d = Tt;
|
|
814
|
-
if (Tt = null, d === null || Date.now() - d >
|
|
867
|
+
if (Tt = null, d === null || Date.now() - d > qi)
|
|
815
868
|
return;
|
|
816
|
-
const _ =
|
|
869
|
+
const _ = Ko(a.relatedTarget);
|
|
817
870
|
if (!_)
|
|
818
871
|
return;
|
|
819
872
|
const T = Date.now();
|
|
820
|
-
if (pt !== null && T - pt <=
|
|
873
|
+
if (pt !== null && T - pt <= ji) {
|
|
821
874
|
Cn(_);
|
|
822
875
|
return;
|
|
823
876
|
}
|
|
@@ -828,23 +881,23 @@ async function ia(e = {}) {
|
|
|
828
881
|
a.stopPropagation();
|
|
829
882
|
}), g?.addEventListener("click", (a) => {
|
|
830
883
|
a.preventDefault(), a.stopPropagation(), qe("minimized");
|
|
831
|
-
}), N.addEventListener("click", Pt),
|
|
832
|
-
|
|
884
|
+
}), N.addEventListener("click", Pt), E.addEventListener("scroll", () => {
|
|
885
|
+
E.scrollTop < Se - 1 && ee(!1, "userScroll"), Se = E.scrollTop;
|
|
833
886
|
}), oe.addEventListener("click", () => {
|
|
834
|
-
|
|
887
|
+
Go();
|
|
835
888
|
});
|
|
836
889
|
const Sn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
837
890
|
([a]) => {
|
|
838
891
|
a?.isIntersecting && (ee(!0, "bottom"), te());
|
|
839
892
|
},
|
|
840
|
-
{ root:
|
|
893
|
+
{ root: E, threshold: 0 }
|
|
841
894
|
);
|
|
842
895
|
Sn?.observe(j);
|
|
843
896
|
const Ve = () => t.loginRequired || t.signupRequired;
|
|
844
897
|
let Ke = null, Ye = !1;
|
|
845
898
|
const K = () => rt || b.getState().status !== "connected", Pe = () => {
|
|
846
899
|
const a = Ve(), d = Ke !== null, _ = !a && K();
|
|
847
|
-
C.readOnly = a || d || _, w.readOnly = d || _, C.placeholder = d ?
|
|
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;
|
|
848
901
|
}, H = () => {
|
|
849
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);
|
|
850
903
|
};
|
|
@@ -889,25 +942,25 @@ async function ia(e = {}) {
|
|
|
889
942
|
), Ne(), H());
|
|
890
943
|
});
|
|
891
944
|
let Xe = 0;
|
|
892
|
-
const
|
|
945
|
+
const Zo = () => {
|
|
893
946
|
Xe = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
894
947
|
}, Nt = (a) => {
|
|
895
948
|
de !== null && window.clearTimeout(de), G.textContent = a, G.hidden = !1, de = window.setTimeout(() => {
|
|
896
949
|
G.textContent = "", G.hidden = !0, de = null;
|
|
897
950
|
}, 3e3);
|
|
898
|
-
},
|
|
951
|
+
}, Jo = () => {
|
|
899
952
|
de !== null && (window.clearTimeout(de), de = null), G.textContent = "", G.hidden = !0;
|
|
900
953
|
}, Rt = async (a) => {
|
|
901
954
|
if (a.length === 0)
|
|
902
955
|
return;
|
|
903
|
-
const d =
|
|
904
|
-
q = [...q, ...d], Ne(),
|
|
956
|
+
const d = tr(b, a);
|
|
957
|
+
q = [...q, ...d], Ne(), Jo(), H(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || be();
|
|
905
958
|
};
|
|
906
959
|
We.addEventListener("click", () => {
|
|
907
|
-
t.loginRequired || K() || le(t.billingStatus) ||
|
|
908
|
-
}),
|
|
909
|
-
const a = Array.from(
|
|
910
|
-
|
|
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) => {
|
|
911
964
|
Nt(
|
|
912
965
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
913
966
|
), ne("web-sdk.widget", "Attachment failed", {
|
|
@@ -923,7 +976,7 @@ async function ia(e = {}) {
|
|
|
923
976
|
ut(a.dataTransfer) && (a.stopPropagation(), Xe = Math.max(0, Xe - 1), Xe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
924
977
|
}), i.addEventListener("drop", (a) => {
|
|
925
978
|
const d = a.dataTransfer;
|
|
926
|
-
!ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(),
|
|
979
|
+
!ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Zo(), Rt(d.files).catch((_) => {
|
|
927
980
|
Nt(
|
|
928
981
|
_ instanceof Error ? _.message : "Failed to attach file"
|
|
929
982
|
), ne("web-sdk.widget", "Attachment failed", {
|
|
@@ -958,8 +1011,8 @@ async function ia(e = {}) {
|
|
|
958
1011
|
fe = !fe, Ge = null, Ee(), fe && we.length === 0 && fn(null);
|
|
959
1012
|
}), it.addEventListener("click", () => {
|
|
960
1013
|
fe = !1, Ee();
|
|
961
|
-
}), $.addEventListener("scroll",
|
|
962
|
-
et(w), B(), H(),
|
|
1014
|
+
}), $.addEventListener("scroll", $o), w.addEventListener("input", () => {
|
|
1015
|
+
et(w), B(), H(), ti();
|
|
963
1016
|
}), w.addEventListener("keydown", (a) => {
|
|
964
1017
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
965
1018
|
if (a.preventDefault(), t.loginRequired) {
|
|
@@ -974,16 +1027,16 @@ async function ia(e = {}) {
|
|
|
974
1027
|
}
|
|
975
1028
|
}), i.addEventListener("click", (a) => {
|
|
976
1029
|
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
977
|
-
}), l.composerValue && (w.value = l.composerValue, et(w)), t.initialDisplayState === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(w.value, !1),
|
|
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);
|
|
978
1031
|
const st = () => r;
|
|
979
|
-
let Dt = b.getState().appearance !== null, dt = null, Ze = null, De = null, En = b.getState().isThinking,
|
|
1032
|
+
let Dt = b.getState().appearance !== null, dt = null, Ze = null, De = null, En = b.getState().isThinking, ze = null;
|
|
980
1033
|
const Je = t.taskNotifications;
|
|
981
|
-
let
|
|
1034
|
+
let Me = null, Oe = !1;
|
|
982
1035
|
const kn = () => {
|
|
983
|
-
|
|
1036
|
+
Me !== null && (window.clearTimeout(Me), Me = null);
|
|
984
1037
|
}, ct = () => {
|
|
985
1038
|
V && (V.hidden = !0);
|
|
986
|
-
}, Ln = () => b.getState().assistantDraft.trim().length > 0,
|
|
1039
|
+
}, Ln = () => b.getState().assistantDraft.trim().length > 0, Qo = async () => {
|
|
987
1040
|
if (!Je || !V || Oe || ce || !b.getState().isThinking || Ln())
|
|
988
1041
|
return;
|
|
989
1042
|
let a;
|
|
@@ -1005,9 +1058,9 @@ async function ia(e = {}) {
|
|
|
1005
1058
|
});
|
|
1006
1059
|
let Ue = null, Pn = () => {
|
|
1007
1060
|
};
|
|
1008
|
-
const
|
|
1009
|
-
const a = Ue !== null && Xt(b.getState(),
|
|
1010
|
-
x.hidden = !a, a && Ue !== null &&
|
|
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);
|
|
1011
1064
|
};
|
|
1012
1065
|
let Be = null;
|
|
1013
1066
|
const Ot = (a = {}) => {
|
|
@@ -1020,17 +1073,17 @@ async function ia(e = {}) {
|
|
|
1020
1073
|
Be || (Be = yt(
|
|
1021
1074
|
"pluno-pa-widget__new-chat",
|
|
1022
1075
|
"New chat",
|
|
1023
|
-
|
|
1076
|
+
$a(),
|
|
1024
1077
|
!1
|
|
1025
1078
|
), Be.addEventListener("click", () => Ot()), ve.insertBefore(Be, se));
|
|
1026
1079
|
}, F = (a) => {
|
|
1027
|
-
if (Ee(), gn(a.lastErrorCode) ?
|
|
1080
|
+
if (Ee(), gn(a.lastErrorCode) ? ze = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (ze = null), Yt(
|
|
1028
1081
|
ye,
|
|
1029
1082
|
t.billingStatus,
|
|
1030
|
-
|
|
1083
|
+
ze
|
|
1031
1084
|
), t.loginRequired) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1085
|
+
zt.clear(), io(
|
|
1086
|
+
E,
|
|
1034
1087
|
O,
|
|
1035
1088
|
Ut,
|
|
1036
1089
|
st,
|
|
@@ -1042,8 +1095,8 @@ async function ia(e = {}) {
|
|
|
1042
1095
|
return;
|
|
1043
1096
|
}
|
|
1044
1097
|
if (t.signupRequired) {
|
|
1045
|
-
|
|
1046
|
-
|
|
1098
|
+
zt.clear(), io(
|
|
1099
|
+
E,
|
|
1047
1100
|
O,
|
|
1048
1101
|
Ut,
|
|
1049
1102
|
st,
|
|
@@ -1054,29 +1107,29 @@ async function ia(e = {}) {
|
|
|
1054
1107
|
);
|
|
1055
1108
|
return;
|
|
1056
1109
|
}
|
|
1057
|
-
const d =
|
|
1110
|
+
const d = Pa(a), _ = d !== mn;
|
|
1058
1111
|
mn = d;
|
|
1059
1112
|
const T = me || Ce.enabled;
|
|
1060
|
-
me = !1,
|
|
1061
|
-
|
|
1113
|
+
me = !1, pr(
|
|
1114
|
+
E,
|
|
1062
1115
|
j,
|
|
1063
1116
|
O,
|
|
1064
1117
|
Ut,
|
|
1065
1118
|
x,
|
|
1066
1119
|
a,
|
|
1067
1120
|
Ue,
|
|
1068
|
-
Ue !== null && Xt(a,
|
|
1121
|
+
Ue !== null && Xt(a, Mt()),
|
|
1069
1122
|
T,
|
|
1070
1123
|
() => Ce.enabled,
|
|
1071
1124
|
Ct,
|
|
1072
|
-
|
|
1125
|
+
zt,
|
|
1073
1126
|
B,
|
|
1074
1127
|
st,
|
|
1075
|
-
(
|
|
1128
|
+
(M) => {
|
|
1076
1129
|
if (K())
|
|
1077
1130
|
return;
|
|
1078
1131
|
const Qe = t.morningReport !== null;
|
|
1079
|
-
t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ot()), me = !0, ee(!0, "send"), te(), b.sendMessage(
|
|
1132
|
+
t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ot()), me = !0, ee(!0, "send"), te(), b.sendMessage(M);
|
|
1080
1133
|
},
|
|
1081
1134
|
() => {
|
|
1082
1135
|
me = !0, ee(!0, "send"), te(), b.retryLastMessage();
|
|
@@ -1086,40 +1139,40 @@ async function ia(e = {}) {
|
|
|
1086
1139
|
t.morningReport = null, t.onMorningReportSnooze?.(), Pt(), F(b.getState());
|
|
1087
1140
|
},
|
|
1088
1141
|
At,
|
|
1089
|
-
|
|
1142
|
+
ei && !St ? {
|
|
1090
1143
|
dismissedCandidateIds: at,
|
|
1091
1144
|
draftingCandidateId: dt,
|
|
1092
1145
|
error: Ze,
|
|
1093
1146
|
characterIconOptions: st(),
|
|
1094
|
-
onSeen: (
|
|
1095
|
-
Re.add(
|
|
1147
|
+
onSeen: (M) => {
|
|
1148
|
+
Re.add(M.id), B();
|
|
1096
1149
|
},
|
|
1097
|
-
onDraft: (
|
|
1098
|
-
|
|
1150
|
+
onDraft: (M) => {
|
|
1151
|
+
ni(M);
|
|
1099
1152
|
},
|
|
1100
|
-
onDismiss: (
|
|
1101
|
-
Re.add(
|
|
1153
|
+
onDismiss: (M) => {
|
|
1154
|
+
Re.add(M.id), at.add(M.id), B(), Ze = null, F(b.getState());
|
|
1102
1155
|
},
|
|
1103
|
-
onDisable: (
|
|
1104
|
-
St = !0, Re.add(
|
|
1156
|
+
onDisable: (M) => {
|
|
1157
|
+
St = !0, Re.add(M.id), at.add(M.id), B(), Nr(t, !0), Ze = null, F(b.getState());
|
|
1105
1158
|
}
|
|
1106
1159
|
} : void 0
|
|
1107
|
-
), T ? (Se =
|
|
1160
|
+
), T ? (Se = E.scrollTop, te()) : _ && Ta(a) && Wo();
|
|
1108
1161
|
};
|
|
1109
|
-
return Pn =
|
|
1162
|
+
return Pn = yi(
|
|
1110
1163
|
(a) => {
|
|
1111
|
-
Ue = a, !ce && Xt(b.getState(),
|
|
1164
|
+
Ue = a, !ce && Xt(b.getState(), Mt()) && F(b.getState());
|
|
1112
1165
|
},
|
|
1113
1166
|
{
|
|
1114
1167
|
backendUrl: t.backendUrl,
|
|
1115
|
-
fetcher:
|
|
1168
|
+
fetcher: Ho,
|
|
1116
1169
|
loader: t.activeUsersLoader
|
|
1117
1170
|
}
|
|
1118
1171
|
), b.on("state", (a) => {
|
|
1119
1172
|
const d = En && !a.isThinking;
|
|
1120
|
-
En = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Oe &&
|
|
1121
|
-
|
|
1122
|
-
},
|
|
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(
|
|
1123
1176
|
"web-sdk.widget",
|
|
1124
1177
|
"Agent state supplied appearance",
|
|
1125
1178
|
{
|
|
@@ -1143,14 +1196,14 @@ async function ia(e = {}) {
|
|
|
1143
1196
|
},
|
|
1144
1197
|
updateBillingStatus: (a) => {
|
|
1145
1198
|
const d = a ?? null;
|
|
1146
|
-
|
|
1199
|
+
eo(
|
|
1147
1200
|
t.billingStatus,
|
|
1148
1201
|
d,
|
|
1149
|
-
|
|
1150
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (
|
|
1202
|
+
ze
|
|
1203
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (ze = null), Yt(
|
|
1151
1204
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1152
1205
|
t.billingStatus,
|
|
1153
|
-
|
|
1206
|
+
ze
|
|
1154
1207
|
), H());
|
|
1155
1208
|
},
|
|
1156
1209
|
updateAuthGate: (a) => {
|
|
@@ -1172,10 +1225,10 @@ async function ia(e = {}) {
|
|
|
1172
1225
|
t.morningReport = a ?? null, F(b.getState());
|
|
1173
1226
|
},
|
|
1174
1227
|
destroy: () => {
|
|
1175
|
-
ce || (B(), ce = !0, bn.disconnect(), Sn?.disconnect(),
|
|
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());
|
|
1176
1229
|
}
|
|
1177
1230
|
};
|
|
1178
|
-
async function
|
|
1231
|
+
async function ni(a) {
|
|
1179
1232
|
if (!dt) {
|
|
1180
1233
|
dt = a.id, Ze = null, F(b.getState());
|
|
1181
1234
|
try {
|
|
@@ -1184,7 +1237,7 @@ async function ia(e = {}) {
|
|
|
1184
1237
|
const d = await t.socialPostDraftHandler(a);
|
|
1185
1238
|
if (!d.linkedinPost || !d.xPost)
|
|
1186
1239
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1187
|
-
Re.add(a.id), at.add(a.id), B(), De?.remove(), De =
|
|
1240
|
+
Re.add(a.id), at.add(a.id), B(), De?.remove(), De = fr(d, {
|
|
1188
1241
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1189
1242
|
onClose: () => {
|
|
1190
1243
|
De?.remove(), De = null;
|
|
@@ -1198,34 +1251,34 @@ async function ia(e = {}) {
|
|
|
1198
1251
|
}
|
|
1199
1252
|
}
|
|
1200
1253
|
function Bt(a, d) {
|
|
1201
|
-
const _ = a.accentColor ?? t.accentColor, T = a.colorScheme ?? t.colorScheme,
|
|
1202
|
-
r =
|
|
1254
|
+
const _ = a.accentColor ?? t.accentColor, T = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, Qe = a.scribbleStyle ?? t.scribbleStyle;
|
|
1255
|
+
r = $n(
|
|
1203
1256
|
_,
|
|
1204
1257
|
Qe
|
|
1205
|
-
),
|
|
1258
|
+
), qn(i, r, {
|
|
1206
1259
|
accentColor: _,
|
|
1207
1260
|
colorScheme: T,
|
|
1208
|
-
fontFamily:
|
|
1261
|
+
fontFamily: M,
|
|
1209
1262
|
scribbleStyle: Qe
|
|
1210
1263
|
}), ne("web-sdk.widget", "Updated widget appearance", {
|
|
1211
1264
|
source: d,
|
|
1212
1265
|
inputAppearance: a,
|
|
1213
1266
|
appliedAccentColor: _,
|
|
1214
1267
|
appliedColorScheme: T,
|
|
1215
|
-
appliedFontFamily:
|
|
1268
|
+
appliedFontFamily: M,
|
|
1216
1269
|
appliedScribbleStyle: Qe,
|
|
1217
1270
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1218
1271
|
});
|
|
1219
1272
|
}
|
|
1220
1273
|
}
|
|
1221
|
-
function
|
|
1274
|
+
function $n(e, t) {
|
|
1222
1275
|
return { accentColor: e, scribbleStyle: t };
|
|
1223
1276
|
}
|
|
1224
|
-
function
|
|
1225
|
-
const t =
|
|
1226
|
-
return t === null ? "#fafafa" :
|
|
1277
|
+
function ca(e) {
|
|
1278
|
+
const t = ua(e);
|
|
1279
|
+
return t === null ? "#fafafa" : ga(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1227
1280
|
}
|
|
1228
|
-
function
|
|
1281
|
+
function ua(e) {
|
|
1229
1282
|
const t = e.trim();
|
|
1230
1283
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1231
1284
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1237,14 +1290,14 @@ function ra(e) {
|
|
|
1237
1290
|
Number.parseInt(t[3] + t[3], 16)
|
|
1238
1291
|
] : null;
|
|
1239
1292
|
}
|
|
1240
|
-
function
|
|
1293
|
+
function ga([e, t, n]) {
|
|
1241
1294
|
const o = (i) => {
|
|
1242
1295
|
const r = i / 255;
|
|
1243
1296
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1244
1297
|
};
|
|
1245
1298
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1246
1299
|
}
|
|
1247
|
-
function
|
|
1300
|
+
function qn(e, t, n) {
|
|
1248
1301
|
e.classList.toggle(
|
|
1249
1302
|
"pluno-pa-widget--dark",
|
|
1250
1303
|
n.colorScheme === "dark"
|
|
@@ -1252,11 +1305,11 @@ function Gn(e, t, n) {
|
|
|
1252
1305
|
"pluno-pa-widget--light",
|
|
1253
1306
|
n.colorScheme !== "dark"
|
|
1254
1307
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1255
|
-
const o = n.scribbleStyle ?
|
|
1308
|
+
const o = n.scribbleStyle ? co(n.accentColor) : n.accentColor;
|
|
1256
1309
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1257
1310
|
"--pluno-pa-accent-contrast",
|
|
1258
|
-
|
|
1259
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1311
|
+
ca(o)
|
|
1312
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Yi : n.fontFamily, n.scribbleStyle && ha(e.ownerDocument);
|
|
1260
1313
|
const i = Array.from(
|
|
1261
1314
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1262
1315
|
);
|
|
@@ -1268,11 +1321,11 @@ function Gn(e, t, n) {
|
|
|
1268
1321
|
)
|
|
1269
1322
|
);
|
|
1270
1323
|
}
|
|
1271
|
-
function
|
|
1272
|
-
if (e.getElementById(
|
|
1324
|
+
function ha(e) {
|
|
1325
|
+
if (e.getElementById(Fn))
|
|
1273
1326
|
return;
|
|
1274
1327
|
const t = e.createElement("style");
|
|
1275
|
-
t.id =
|
|
1328
|
+
t.id = Fn, t.textContent = `@font-face {
|
|
1276
1329
|
font-family: "Architects Daughter";
|
|
1277
1330
|
font-style: normal;
|
|
1278
1331
|
font-weight: 400;
|
|
@@ -1280,7 +1333,7 @@ function pa(e) {
|
|
|
1280
1333
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1281
1334
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1282
1335
|
}
|
|
1283
|
-
function
|
|
1336
|
+
function ma({
|
|
1284
1337
|
root: e,
|
|
1285
1338
|
launcher: t,
|
|
1286
1339
|
launcherDragHandle: n,
|
|
@@ -1288,82 +1341,82 @@ function sa({
|
|
|
1288
1341
|
setPosition: i,
|
|
1289
1342
|
persist: r
|
|
1290
1343
|
}) {
|
|
1291
|
-
let l = null, p = null, s = null,
|
|
1292
|
-
const
|
|
1293
|
-
l = null, p = null, s = null,
|
|
1294
|
-
},
|
|
1295
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (
|
|
1296
|
-
}, v = (
|
|
1297
|
-
if (l !==
|
|
1344
|
+
let l = null, p = null, s = null, u = !1, c = null;
|
|
1345
|
+
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) => {
|
|
1350
|
+
if (l !== m.pointerId || !p || !s)
|
|
1298
1351
|
return;
|
|
1299
|
-
|
|
1300
|
-
const
|
|
1301
|
-
!
|
|
1302
|
-
}, D = (
|
|
1303
|
-
l ===
|
|
1304
|
-
}, C = (
|
|
1305
|
-
l ===
|
|
1306
|
-
}, g = (
|
|
1307
|
-
if (!
|
|
1352
|
+
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 }));
|
|
1355
|
+
}, D = (m) => {
|
|
1356
|
+
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), u && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1357
|
+
}, C = (m) => {
|
|
1358
|
+
l === m.pointerId && (m.preventDefault(), h());
|
|
1359
|
+
}, g = (m) => {
|
|
1360
|
+
if (!c)
|
|
1308
1361
|
return;
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
|
|
1362
|
+
const k = Math.hypot(
|
|
1363
|
+
m.clientX - c.x,
|
|
1364
|
+
m.clientY - c.y
|
|
1312
1365
|
) <= on;
|
|
1313
|
-
|
|
1314
|
-
}, y = (
|
|
1366
|
+
c = null, k && (m.preventDefault(), m.stopPropagation());
|
|
1367
|
+
}, y = (m) => {
|
|
1315
1368
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1316
1369
|
return;
|
|
1317
|
-
const
|
|
1370
|
+
const k = m.shiftKey ? yo : xo, N = o();
|
|
1318
1371
|
let I = null;
|
|
1319
|
-
|
|
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());
|
|
1320
1373
|
};
|
|
1321
|
-
return t.addEventListener("pointerdown",
|
|
1322
|
-
t.removeEventListener("pointerdown",
|
|
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);
|
|
1323
1376
|
};
|
|
1324
1377
|
}
|
|
1325
|
-
function
|
|
1378
|
+
function fa({
|
|
1326
1379
|
root: e,
|
|
1327
1380
|
handles: t,
|
|
1328
1381
|
getBounds: n,
|
|
1329
1382
|
setBounds: o,
|
|
1330
1383
|
persist: i
|
|
1331
1384
|
}) {
|
|
1332
|
-
let r = null, l = null, p = null, s = null,
|
|
1333
|
-
const
|
|
1334
|
-
r = null, l = null, p = null, s = null,
|
|
1335
|
-
},
|
|
1336
|
-
const y = g.currentTarget,
|
|
1337
|
-
!e.classList.contains("pluno-pa-widget--open") ||
|
|
1338
|
-
},
|
|
1385
|
+
let r = null, l = null, p = null, s = null, u = !1;
|
|
1386
|
+
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) => {
|
|
1339
1392
|
if (r !== g.pointerId || !l || !p || !s)
|
|
1340
1393
|
return;
|
|
1341
1394
|
g.preventDefault(), g.stopPropagation();
|
|
1342
|
-
const y = g.clientX - p.x,
|
|
1343
|
-
!
|
|
1344
|
-
|
|
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)
|
|
1345
1398
|
));
|
|
1346
1399
|
}, v = (g) => {
|
|
1347
|
-
r === g.pointerId && (g.preventDefault(), g.stopPropagation(),
|
|
1400
|
+
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), u && i(), c());
|
|
1348
1401
|
}, D = (g) => {
|
|
1349
|
-
r === g.pointerId && (g.preventDefault(),
|
|
1402
|
+
r === g.pointerId && (g.preventDefault(), c());
|
|
1350
1403
|
}, C = (g) => {
|
|
1351
|
-
const
|
|
1404
|
+
const m = g.currentTarget.dataset.resizeDirection, k = g.shiftKey ? yo : xo, N = n();
|
|
1352
1405
|
let I = 0, G = 0;
|
|
1353
|
-
|
|
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()));
|
|
1354
1407
|
};
|
|
1355
1408
|
for (const g of t)
|
|
1356
|
-
g.addEventListener("pointerdown",
|
|
1409
|
+
g.addEventListener("pointerdown", h), g.addEventListener("pointermove", S), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", D), g.addEventListener("keydown", C);
|
|
1357
1410
|
return () => {
|
|
1358
1411
|
for (const g of t)
|
|
1359
|
-
g.removeEventListener("pointerdown",
|
|
1412
|
+
g.removeEventListener("pointerdown", h), g.removeEventListener("pointermove", S), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", D), g.removeEventListener("keydown", C);
|
|
1360
1413
|
};
|
|
1361
1414
|
}
|
|
1362
|
-
function
|
|
1415
|
+
function jn(e) {
|
|
1363
1416
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1364
1417
|
}
|
|
1365
|
-
function
|
|
1366
|
-
const i = Z(), r =
|
|
1418
|
+
function Vn(e, t, n, o) {
|
|
1419
|
+
const i = Z(), r = Kn({
|
|
1367
1420
|
leading: e.position.x,
|
|
1368
1421
|
length: e.size.width,
|
|
1369
1422
|
delta: n,
|
|
@@ -1375,7 +1428,7 @@ function qn(e, t, n, o) {
|
|
|
1375
1428
|
dn,
|
|
1376
1429
|
i.width - A * 2
|
|
1377
1430
|
)
|
|
1378
|
-
}), l =
|
|
1431
|
+
}), l = Kn({
|
|
1379
1432
|
leading: e.position.y,
|
|
1380
1433
|
length: e.size.height,
|
|
1381
1434
|
delta: o,
|
|
@@ -1393,7 +1446,7 @@ function qn(e, t, n, o) {
|
|
|
1393
1446
|
size: { width: r.length, height: l.length }
|
|
1394
1447
|
};
|
|
1395
1448
|
}
|
|
1396
|
-
function
|
|
1449
|
+
function Kn({
|
|
1397
1450
|
leading: e,
|
|
1398
1451
|
length: t,
|
|
1399
1452
|
delta: n,
|
|
@@ -1405,34 +1458,34 @@ function jn({
|
|
|
1405
1458
|
}) {
|
|
1406
1459
|
const s = e + t;
|
|
1407
1460
|
if (o) {
|
|
1408
|
-
const
|
|
1409
|
-
if (
|
|
1410
|
-
const
|
|
1411
|
-
return { leading:
|
|
1461
|
+
const u = e + n;
|
|
1462
|
+
if (u >= r) {
|
|
1463
|
+
const h = X(u, r, s - p);
|
|
1464
|
+
return { leading: h, length: s - h };
|
|
1412
1465
|
}
|
|
1413
|
-
const
|
|
1414
|
-
s + r -
|
|
1466
|
+
const c = X(
|
|
1467
|
+
s + r - u,
|
|
1415
1468
|
s,
|
|
1416
1469
|
l
|
|
1417
1470
|
);
|
|
1418
|
-
return { leading: r, length:
|
|
1471
|
+
return { leading: r, length: c - r };
|
|
1419
1472
|
}
|
|
1420
1473
|
if (i) {
|
|
1421
|
-
const
|
|
1422
|
-
if (
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1474
|
+
const u = s + n;
|
|
1475
|
+
if (u <= l) {
|
|
1476
|
+
const h = X(
|
|
1477
|
+
u,
|
|
1425
1478
|
e + p,
|
|
1426
1479
|
l
|
|
1427
1480
|
);
|
|
1428
|
-
return { leading: e, length:
|
|
1481
|
+
return { leading: e, length: h - e };
|
|
1429
1482
|
}
|
|
1430
|
-
const
|
|
1431
|
-
e - (
|
|
1483
|
+
const c = X(
|
|
1484
|
+
e - (u - l),
|
|
1432
1485
|
r,
|
|
1433
1486
|
e
|
|
1434
1487
|
);
|
|
1435
|
-
return { leading:
|
|
1488
|
+
return { leading: c, length: l - c };
|
|
1436
1489
|
}
|
|
1437
1490
|
return { leading: e, length: t };
|
|
1438
1491
|
}
|
|
@@ -1440,38 +1493,38 @@ function bt(e, t = !0) {
|
|
|
1440
1493
|
const n = Z();
|
|
1441
1494
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1442
1495
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1443
|
-
width:
|
|
1444
|
-
height:
|
|
1445
|
-
} : { width:
|
|
1496
|
+
width: Xi,
|
|
1497
|
+
height: Zi
|
|
1498
|
+
} : { width: Hn, height: Hn };
|
|
1446
1499
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1447
1500
|
return {
|
|
1448
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1449
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
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
|
|
1450
1503
|
};
|
|
1451
1504
|
}
|
|
1452
|
-
function
|
|
1505
|
+
function wa() {
|
|
1453
1506
|
const e = Z();
|
|
1454
1507
|
return {
|
|
1455
1508
|
width: Math.min(
|
|
1456
1509
|
X(
|
|
1457
|
-
e.width *
|
|
1510
|
+
e.width * ta,
|
|
1458
1511
|
dn,
|
|
1459
|
-
|
|
1512
|
+
ea
|
|
1460
1513
|
),
|
|
1461
1514
|
e.width - A * 2
|
|
1462
1515
|
),
|
|
1463
1516
|
height: Math.min(
|
|
1464
1517
|
X(
|
|
1465
|
-
e.height *
|
|
1518
|
+
e.height * oa,
|
|
1466
1519
|
cn,
|
|
1467
|
-
|
|
1520
|
+
na
|
|
1468
1521
|
),
|
|
1469
1522
|
e.height - Ie - A
|
|
1470
1523
|
)
|
|
1471
1524
|
};
|
|
1472
1525
|
}
|
|
1473
1526
|
function Fe(e = null) {
|
|
1474
|
-
return e ? xt(e) :
|
|
1527
|
+
return e ? xt(e) : wa();
|
|
1475
1528
|
}
|
|
1476
1529
|
function xt(e) {
|
|
1477
1530
|
const t = Z();
|
|
@@ -1508,7 +1561,7 @@ function Wt(e, t) {
|
|
|
1508
1561
|
const n = xt(t);
|
|
1509
1562
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1510
1563
|
}
|
|
1511
|
-
function
|
|
1564
|
+
function ba(e, t, n) {
|
|
1512
1565
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1513
1566
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1514
1567
|
return { x: o, y: i };
|
|
@@ -1525,11 +1578,11 @@ function Gt(e, t, n) {
|
|
|
1525
1578
|
const o = bt(e, !1);
|
|
1526
1579
|
return t ? an(
|
|
1527
1580
|
e,
|
|
1528
|
-
|
|
1581
|
+
So(t, o),
|
|
1529
1582
|
o
|
|
1530
|
-
) :
|
|
1583
|
+
) : _a(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Ji);
|
|
1531
1584
|
}
|
|
1532
|
-
function
|
|
1585
|
+
function _a(e, t, n) {
|
|
1533
1586
|
const o = Z();
|
|
1534
1587
|
return {
|
|
1535
1588
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
@@ -1537,7 +1590,7 @@ function ga(e, t, n) {
|
|
|
1537
1590
|
};
|
|
1538
1591
|
}
|
|
1539
1592
|
function an(e, t, n) {
|
|
1540
|
-
const o = Z(), i = A +
|
|
1593
|
+
const o = Z(), i = A + va(e);
|
|
1541
1594
|
return {
|
|
1542
1595
|
x: X(
|
|
1543
1596
|
t.x,
|
|
@@ -1557,27 +1610,27 @@ function an(e, t, n) {
|
|
|
1557
1610
|
)
|
|
1558
1611
|
};
|
|
1559
1612
|
}
|
|
1560
|
-
function
|
|
1613
|
+
function So(e, t) {
|
|
1561
1614
|
const n = Z();
|
|
1562
1615
|
return {
|
|
1563
1616
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1564
1617
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1565
1618
|
};
|
|
1566
1619
|
}
|
|
1567
|
-
function
|
|
1568
|
-
const n =
|
|
1620
|
+
function xa(e, t) {
|
|
1621
|
+
const n = ya(e, t), o = Z();
|
|
1569
1622
|
return {
|
|
1570
1623
|
anchor: n,
|
|
1571
1624
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1572
1625
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1573
1626
|
};
|
|
1574
1627
|
}
|
|
1575
|
-
function
|
|
1628
|
+
function ya(e, t) {
|
|
1576
1629
|
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";
|
|
1577
1630
|
return `${r}-${l}`;
|
|
1578
1631
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1632
|
+
function va(e) {
|
|
1633
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? la : ra;
|
|
1581
1634
|
}
|
|
1582
1635
|
function $t(e, t, n, o = null) {
|
|
1583
1636
|
const i = bt(e), r = Fe(o), l = {
|
|
@@ -1614,16 +1667,16 @@ function Te(e, t) {
|
|
|
1614
1667
|
}
|
|
1615
1668
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1616
1669
|
}
|
|
1617
|
-
function
|
|
1670
|
+
function Ca(e, t) {
|
|
1618
1671
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1619
1672
|
}
|
|
1620
|
-
function
|
|
1673
|
+
function Yn(e) {
|
|
1621
1674
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1622
1675
|
}
|
|
1623
1676
|
function Z() {
|
|
1624
1677
|
return {
|
|
1625
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1626
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1678
|
+
width: window.innerWidth || document.documentElement.clientWidth || wo + A * 2,
|
|
1679
|
+
height: window.innerHeight || document.documentElement.clientHeight || bo + A * 2
|
|
1627
1680
|
};
|
|
1628
1681
|
}
|
|
1629
1682
|
function qt(e) {
|
|
@@ -1648,31 +1701,31 @@ function ne(e, t, n) {
|
|
|
1648
1701
|
details: n
|
|
1649
1702
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1650
1703
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1651
|
-
new CustomEvent(
|
|
1704
|
+
new CustomEvent(Gi, { detail: i })
|
|
1652
1705
|
);
|
|
1653
1706
|
}
|
|
1654
|
-
function
|
|
1707
|
+
function Sa(e, t) {
|
|
1655
1708
|
ne("web-sdk.widget.position", e, t);
|
|
1656
1709
|
}
|
|
1657
1710
|
function jt(e, t, n) {
|
|
1658
1711
|
const o = t.value.trim();
|
|
1659
1712
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1660
|
-
attachments: n.length > 0 ? n.map(
|
|
1713
|
+
attachments: n.length > 0 ? n.map(La) : void 0
|
|
1661
1714
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1662
1715
|
}
|
|
1663
|
-
function
|
|
1716
|
+
function Ea(e, t, n) {
|
|
1664
1717
|
const o = e.activeElement;
|
|
1665
1718
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1666
1719
|
}
|
|
1667
|
-
function
|
|
1668
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1720
|
+
function ka(e, t, n, o) {
|
|
1721
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Ai)
|
|
1669
1722
|
return;
|
|
1670
1723
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1671
1724
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1672
1725
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1673
1726
|
});
|
|
1674
1727
|
}
|
|
1675
|
-
function
|
|
1728
|
+
function La(e) {
|
|
1676
1729
|
return e;
|
|
1677
1730
|
}
|
|
1678
1731
|
function et(e) {
|
|
@@ -1685,7 +1738,7 @@ function tt(e, t = () => !0) {
|
|
|
1685
1738
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1686
1739
|
});
|
|
1687
1740
|
}
|
|
1688
|
-
function
|
|
1741
|
+
function Pa(e) {
|
|
1689
1742
|
const t = e.messages[e.messages.length - 1];
|
|
1690
1743
|
return [
|
|
1691
1744
|
e.messages.length,
|
|
@@ -1696,13 +1749,13 @@ function va(e) {
|
|
|
1696
1749
|
e.lastError ?? ""
|
|
1697
1750
|
].join(":");
|
|
1698
1751
|
}
|
|
1699
|
-
function
|
|
1752
|
+
function Ta(e) {
|
|
1700
1753
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1701
1754
|
}
|
|
1702
|
-
function
|
|
1755
|
+
function Ia(e) {
|
|
1703
1756
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1704
1757
|
}
|
|
1705
|
-
function
|
|
1758
|
+
function Aa(e) {
|
|
1706
1759
|
const t = e.currentPage;
|
|
1707
1760
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1708
1761
|
try {
|
|
@@ -1713,7 +1766,7 @@ function Ea(e) {
|
|
|
1713
1766
|
}
|
|
1714
1767
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1715
1768
|
}
|
|
1716
|
-
function
|
|
1769
|
+
function Na(e, t) {
|
|
1717
1770
|
const n = new Date(e).getTime();
|
|
1718
1771
|
if (!Number.isFinite(n))
|
|
1719
1772
|
return "now";
|
|
@@ -1729,9 +1782,9 @@ function ka(e, t) {
|
|
|
1729
1782
|
}
|
|
1730
1783
|
return "now";
|
|
1731
1784
|
}
|
|
1732
|
-
function
|
|
1733
|
-
e.appendChild(
|
|
1734
|
-
|
|
1785
|
+
function Ra(e, t, n, o, i) {
|
|
1786
|
+
e.appendChild(Wa()), e.appendChild(
|
|
1787
|
+
Da(
|
|
1735
1788
|
t,
|
|
1736
1789
|
n,
|
|
1737
1790
|
o,
|
|
@@ -1741,19 +1794,19 @@ function La(e, t, n, o, i) {
|
|
|
1741
1794
|
yt(
|
|
1742
1795
|
"pluno-pa-widget__close",
|
|
1743
1796
|
"Close",
|
|
1744
|
-
|
|
1797
|
+
Ga(16),
|
|
1745
1798
|
!0
|
|
1746
1799
|
)
|
|
1747
|
-
), e.appendChild(
|
|
1800
|
+
), e.appendChild(za(n));
|
|
1748
1801
|
}
|
|
1749
|
-
function
|
|
1802
|
+
function Da(e, t, n, o) {
|
|
1750
1803
|
const i = document.createElement("form");
|
|
1751
1804
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1752
1805
|
const s = document.createElement("button");
|
|
1753
1806
|
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);
|
|
1754
1807
|
}
|
|
1755
1808
|
i.appendChild(
|
|
1756
|
-
|
|
1809
|
+
Po(
|
|
1757
1810
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1758
1811
|
10
|
|
1759
1812
|
)
|
|
@@ -1774,15 +1827,15 @@ function Pa(e, t, n, o) {
|
|
|
1774
1827
|
}
|
|
1775
1828
|
return i;
|
|
1776
1829
|
}
|
|
1777
|
-
function
|
|
1830
|
+
function za(e) {
|
|
1778
1831
|
const t = document.createElement("section");
|
|
1779
1832
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1780
|
-
|
|
1833
|
+
Po("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1781
1834
|
);
|
|
1782
1835
|
const n = document.createElement("div");
|
|
1783
1836
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1784
1837
|
const o = document.createElement("main");
|
|
1785
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1838
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(Ba(e));
|
|
1786
1839
|
const i = document.createElement("div");
|
|
1787
1840
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1788
1841
|
const r = document.createElement("div");
|
|
@@ -1794,10 +1847,10 @@ function Ta(e) {
|
|
|
1794
1847
|
yt(
|
|
1795
1848
|
"pluno-pa-widget__history",
|
|
1796
1849
|
rn(),
|
|
1797
|
-
|
|
1850
|
+
qa(),
|
|
1798
1851
|
!0
|
|
1799
1852
|
)
|
|
1800
|
-
), n.appendChild(p), n.appendChild(
|
|
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(
|
|
1801
1854
|
_e("right", "Resize Pluno from right")
|
|
1802
1855
|
), t.appendChild(_e("top", "Resize Pluno from top")), t.appendChild(
|
|
1803
1856
|
_e("bottom", "Resize Pluno from bottom")
|
|
@@ -1818,7 +1871,7 @@ function _e(e, t) {
|
|
|
1818
1871
|
`pluno-pa-widget__resize-handle--${e}`
|
|
1819
1872
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1820
1873
|
}
|
|
1821
|
-
function
|
|
1874
|
+
function Ma() {
|
|
1822
1875
|
const e = document.createElement("div");
|
|
1823
1876
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1824
1877
|
const t = document.createElement("span");
|
|
@@ -1832,7 +1885,7 @@ function Ia() {
|
|
|
1832
1885
|
const r = document.createElement("button");
|
|
1833
1886
|
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;
|
|
1834
1887
|
}
|
|
1835
|
-
function
|
|
1888
|
+
function Oa() {
|
|
1836
1889
|
const e = document.createElement("form");
|
|
1837
1890
|
e.className = "pluno-pa-widget__composer";
|
|
1838
1891
|
const t = document.createElement("div");
|
|
@@ -1846,22 +1899,22 @@ function Aa() {
|
|
|
1846
1899
|
const r = document.createElement("input");
|
|
1847
1900
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1848
1901
|
const l = document.createElement("button");
|
|
1849
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
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);
|
|
1850
1903
|
const p = document.createElement("textarea");
|
|
1851
1904
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1852
1905
|
const s = document.createElement("button");
|
|
1853
|
-
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(
|
|
1854
|
-
const
|
|
1855
|
-
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1859
|
-
return
|
|
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";
|
|
1909
|
+
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);
|
|
1911
|
+
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;
|
|
1860
1913
|
}
|
|
1861
1914
|
function rn() {
|
|
1862
1915
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1863
1916
|
}
|
|
1864
|
-
function
|
|
1917
|
+
function Ua() {
|
|
1865
1918
|
const e = document.createElement("section");
|
|
1866
1919
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", rn());
|
|
1867
1920
|
const t = document.createElement("div");
|
|
@@ -1871,7 +1924,7 @@ function Na() {
|
|
|
1871
1924
|
const o = yt(
|
|
1872
1925
|
"pluno-pa-widget__history-close",
|
|
1873
1926
|
"Close recent chats",
|
|
1874
|
-
|
|
1927
|
+
ja(),
|
|
1875
1928
|
!1
|
|
1876
1929
|
);
|
|
1877
1930
|
t.append(n, o);
|
|
@@ -1880,20 +1933,20 @@ function Na() {
|
|
|
1880
1933
|
const r = document.createElement("p");
|
|
1881
1934
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1882
1935
|
}
|
|
1883
|
-
function
|
|
1936
|
+
function Ba(e) {
|
|
1884
1937
|
const t = document.createElement("div");
|
|
1885
1938
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1886
1939
|
xe(
|
|
1887
1940
|
"pluno-pa-widget__character--empty",
|
|
1888
1941
|
e
|
|
1889
1942
|
)
|
|
1890
|
-
), t.appendChild(
|
|
1943
|
+
), t.appendChild(Eo()), t;
|
|
1891
1944
|
}
|
|
1892
|
-
function
|
|
1945
|
+
function Eo() {
|
|
1893
1946
|
const e = document.createElement("div");
|
|
1894
1947
|
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;
|
|
1895
1948
|
}
|
|
1896
|
-
function
|
|
1949
|
+
function ko(e, t) {
|
|
1897
1950
|
e.replaceChildren(), e.setAttribute(
|
|
1898
1951
|
"aria-label",
|
|
1899
1952
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1906,16 +1959,16 @@ function So(e, t) {
|
|
|
1906
1959
|
);
|
|
1907
1960
|
}
|
|
1908
1961
|
function xe(e, t) {
|
|
1909
|
-
const n = `pluno-pa-character-${
|
|
1910
|
-
|
|
1911
|
-
const o = t.scribbleStyle ?
|
|
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);
|
|
1912
1965
|
return o.setAttribute(
|
|
1913
1966
|
"class",
|
|
1914
1967
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1915
1968
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1916
1969
|
}
|
|
1917
|
-
function
|
|
1918
|
-
const n =
|
|
1970
|
+
function Fa(e, t) {
|
|
1971
|
+
const n = li(e), o = {
|
|
1919
1972
|
boltFill: `${t}-boltFill`,
|
|
1920
1973
|
boltEdge: `${t}-boltEdge`,
|
|
1921
1974
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1926,7 +1979,7 @@ function Da(e, t) {
|
|
|
1926
1979
|
eyeShadow: `${t}-eyeShadow`,
|
|
1927
1980
|
pupilGloss: `${t}-pupilGloss`,
|
|
1928
1981
|
boltClip: `${t}-boltClip`
|
|
1929
|
-
}, i =
|
|
1982
|
+
}, i = Lo(), r = f(i, "defs"), l = f(r, "linearGradient", {
|
|
1930
1983
|
id: o.boltFill,
|
|
1931
1984
|
x1: "420",
|
|
1932
1985
|
y1: "180",
|
|
@@ -1951,21 +2004,21 @@ function Da(e, t) {
|
|
|
1951
2004
|
r: "82%"
|
|
1952
2005
|
});
|
|
1953
2006
|
U(s, "0", n.glow, "0.72"), U(s, "0.5", n.middle, "0.44"), U(s, "1", n.bottom, "0");
|
|
1954
|
-
const
|
|
2007
|
+
const u = f(r, "radialGradient", {
|
|
1955
2008
|
id: o.eyeWhite,
|
|
1956
2009
|
cx: "35%",
|
|
1957
2010
|
cy: "25%",
|
|
1958
2011
|
r: "70%"
|
|
1959
2012
|
});
|
|
1960
|
-
U(
|
|
1961
|
-
const
|
|
2013
|
+
U(u, "0", "#ffffff"), U(u, "0.72", "#ffffff"), U(u, "1", "#e5e5e5");
|
|
2014
|
+
const c = f(r, "radialGradient", {
|
|
1962
2015
|
id: o.pupil,
|
|
1963
2016
|
cx: "42%",
|
|
1964
2017
|
cy: "38%",
|
|
1965
2018
|
r: "65%"
|
|
1966
2019
|
});
|
|
1967
|
-
U(
|
|
1968
|
-
const
|
|
2020
|
+
U(c, "0", "#2a1f10"), U(c, "0.52", "#080604"), U(c, "1", "#000000");
|
|
2021
|
+
const h = f(r, "filter", {
|
|
1969
2022
|
id: o.softDropShadow,
|
|
1970
2023
|
x: "-18%",
|
|
1971
2024
|
y: "-12%",
|
|
@@ -1973,14 +2026,14 @@ function Da(e, t) {
|
|
|
1973
2026
|
height: "136%",
|
|
1974
2027
|
"color-interpolation-filters": "sRGB"
|
|
1975
2028
|
});
|
|
1976
|
-
f(
|
|
2029
|
+
f(h, "feDropShadow", {
|
|
1977
2030
|
dx: "0",
|
|
1978
2031
|
dy: "12",
|
|
1979
2032
|
stdDeviation: "18",
|
|
1980
2033
|
"flood-color": n.shadow,
|
|
1981
2034
|
"flood-opacity": "0.24"
|
|
1982
2035
|
});
|
|
1983
|
-
const
|
|
2036
|
+
const S = f(r, "filter", {
|
|
1984
2037
|
id: o.innerDepth,
|
|
1985
2038
|
x: "-8%",
|
|
1986
2039
|
y: "-8%",
|
|
@@ -1988,27 +2041,27 @@ function Da(e, t) {
|
|
|
1988
2041
|
height: "116%",
|
|
1989
2042
|
"color-interpolation-filters": "sRGB"
|
|
1990
2043
|
});
|
|
1991
|
-
f(
|
|
2044
|
+
f(S, "feGaussianBlur", {
|
|
1992
2045
|
in: "SourceAlpha",
|
|
1993
2046
|
stdDeviation: "8",
|
|
1994
2047
|
result: "blur"
|
|
1995
|
-
}), f(
|
|
2048
|
+
}), f(S, "feOffset", {
|
|
1996
2049
|
dx: "-7",
|
|
1997
2050
|
dy: "-9",
|
|
1998
2051
|
result: "topLeft"
|
|
1999
|
-
}), f(
|
|
2052
|
+
}), f(S, "feComposite", {
|
|
2000
2053
|
in: "topLeft",
|
|
2001
2054
|
in2: "SourceAlpha",
|
|
2002
2055
|
operator: "arithmetic",
|
|
2003
2056
|
k2: "-1",
|
|
2004
2057
|
k3: "1",
|
|
2005
2058
|
result: "innerShadow"
|
|
2006
|
-
}), f(
|
|
2059
|
+
}), f(S, "feColorMatrix", {
|
|
2007
2060
|
in: "innerShadow",
|
|
2008
2061
|
type: "matrix",
|
|
2009
2062
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2010
2063
|
result: "innerLight"
|
|
2011
|
-
}), f(
|
|
2064
|
+
}), f(S, "feBlend", {
|
|
2012
2065
|
in: "SourceGraphic",
|
|
2013
2066
|
in2: "innerLight",
|
|
2014
2067
|
mode: "screen"
|
|
@@ -2062,25 +2115,25 @@ function Da(e, t) {
|
|
|
2062
2115
|
fill: Y(o.boltGlow),
|
|
2063
2116
|
opacity: "0.74"
|
|
2064
2117
|
});
|
|
2065
|
-
const
|
|
2118
|
+
const m = f(g, "g", {
|
|
2066
2119
|
"clip-path": Y(o.boltClip),
|
|
2067
2120
|
opacity: "0.42"
|
|
2068
2121
|
});
|
|
2069
|
-
f(
|
|
2122
|
+
f(m, "path", {
|
|
2070
2123
|
d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
|
|
2071
2124
|
fill: "none",
|
|
2072
2125
|
stroke: n.highlight,
|
|
2073
2126
|
"stroke-width": "22",
|
|
2074
2127
|
"stroke-linecap": "round",
|
|
2075
2128
|
opacity: "0.65"
|
|
2076
|
-
}), f(
|
|
2129
|
+
}), f(m, "path", {
|
|
2077
2130
|
d: "M556 685 L501 994",
|
|
2078
2131
|
fill: "none",
|
|
2079
2132
|
stroke: n.highlight,
|
|
2080
2133
|
"stroke-width": "20",
|
|
2081
2134
|
"stroke-linecap": "round",
|
|
2082
2135
|
opacity: "0.55"
|
|
2083
|
-
}), f(
|
|
2136
|
+
}), f(m, "path", {
|
|
2084
2137
|
d: "M858 160 C882 166 893 181 883 204",
|
|
2085
2138
|
fill: "none",
|
|
2086
2139
|
stroke: n.inner,
|
|
@@ -2088,9 +2141,9 @@ function Da(e, t) {
|
|
|
2088
2141
|
"stroke-linecap": "round",
|
|
2089
2142
|
opacity: "0.48"
|
|
2090
2143
|
});
|
|
2091
|
-
const
|
|
2092
|
-
return
|
|
2093
|
-
|
|
2144
|
+
const k = f(i, "g", { filter: Y(o.eyeShadow) });
|
|
2145
|
+
return Xn(
|
|
2146
|
+
k,
|
|
2094
2147
|
"rotate(-2 528 463)",
|
|
2095
2148
|
"528",
|
|
2096
2149
|
"463",
|
|
@@ -2099,8 +2152,8 @@ function Da(e, t) {
|
|
|
2099
2152
|
"557",
|
|
2100
2153
|
"447",
|
|
2101
2154
|
o
|
|
2102
|
-
),
|
|
2103
|
-
|
|
2155
|
+
), Xn(
|
|
2156
|
+
k,
|
|
2104
2157
|
"rotate(2 717 462)",
|
|
2105
2158
|
"717",
|
|
2106
2159
|
"462",
|
|
@@ -2111,11 +2164,11 @@ function Da(e, t) {
|
|
|
2111
2164
|
o
|
|
2112
2165
|
), i;
|
|
2113
2166
|
}
|
|
2114
|
-
function
|
|
2115
|
-
const n =
|
|
2167
|
+
function Ha(e, t) {
|
|
2168
|
+
const n = co(e), o = {
|
|
2116
2169
|
clip: `${t}-scribbleBoltClip`,
|
|
2117
2170
|
wobble: `${t}-scribbleBoltWobble`
|
|
2118
|
-
}, i =
|
|
2171
|
+
}, i = Lo(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
|
|
2119
2172
|
f(l, "path", { d: ft });
|
|
2120
2173
|
const p = f(r, "filter", {
|
|
2121
2174
|
id: o.wobble,
|
|
@@ -2138,11 +2191,11 @@ function Ma(e, t) {
|
|
|
2138
2191
|
xChannelSelector: "R",
|
|
2139
2192
|
yChannelSelector: "G"
|
|
2140
2193
|
});
|
|
2141
|
-
const s = f(i, "g", { filter: Y(o.wobble) }),
|
|
2194
|
+
const s = f(i, "g", { filter: Y(o.wobble) }), u = f(s, "g", {
|
|
2142
2195
|
"clip-path": Y(o.clip)
|
|
2143
2196
|
});
|
|
2144
|
-
return f(
|
|
2145
|
-
d:
|
|
2197
|
+
return f(u, "path", {
|
|
2198
|
+
d: ri(),
|
|
2146
2199
|
fill: "none",
|
|
2147
2200
|
stroke: n,
|
|
2148
2201
|
"stroke-width": "56",
|
|
@@ -2156,7 +2209,7 @@ function Ma(e, t) {
|
|
|
2156
2209
|
stroke: wt,
|
|
2157
2210
|
"stroke-width": "18",
|
|
2158
2211
|
"stroke-linejoin": "round"
|
|
2159
|
-
}),
|
|
2212
|
+
}), Zn(
|
|
2160
2213
|
s,
|
|
2161
2214
|
"rotate(-2 528 463)",
|
|
2162
2215
|
"528",
|
|
@@ -2165,7 +2218,7 @@ function Ma(e, t) {
|
|
|
2165
2218
|
"473",
|
|
2166
2219
|
"557",
|
|
2167
2220
|
"447"
|
|
2168
|
-
),
|
|
2221
|
+
), Zn(
|
|
2169
2222
|
s,
|
|
2170
2223
|
"rotate(2 717 462)",
|
|
2171
2224
|
"717",
|
|
@@ -2176,35 +2229,35 @@ function Ma(e, t) {
|
|
|
2176
2229
|
"447"
|
|
2177
2230
|
), i;
|
|
2178
2231
|
}
|
|
2179
|
-
function
|
|
2180
|
-
return
|
|
2181
|
-
xmlns:
|
|
2232
|
+
function Lo() {
|
|
2233
|
+
return L("svg", {
|
|
2234
|
+
xmlns: _o,
|
|
2182
2235
|
viewBox: "0 0 1254 1254"
|
|
2183
2236
|
});
|
|
2184
2237
|
}
|
|
2185
|
-
function
|
|
2186
|
-
const
|
|
2187
|
-
f(
|
|
2238
|
+
function Xn(e, t, n, o, i, r, l, p, s) {
|
|
2239
|
+
const u = f(e, "g", { transform: t });
|
|
2240
|
+
f(u, "ellipse", {
|
|
2188
2241
|
cx: n,
|
|
2189
2242
|
cy: o,
|
|
2190
2243
|
rx: "73",
|
|
2191
2244
|
ry: "80",
|
|
2192
2245
|
fill: Y(s.eyeWhite)
|
|
2193
|
-
}), f(
|
|
2246
|
+
}), f(u, "ellipse", {
|
|
2194
2247
|
cx: i,
|
|
2195
2248
|
cy: r,
|
|
2196
2249
|
rx: "49",
|
|
2197
2250
|
ry: "57",
|
|
2198
2251
|
fill: Y(s.pupil),
|
|
2199
2252
|
filter: Y(s.pupilGloss)
|
|
2200
|
-
}), f(
|
|
2253
|
+
}), f(u, "circle", {
|
|
2201
2254
|
cx: l,
|
|
2202
2255
|
cy: p,
|
|
2203
2256
|
r: "18",
|
|
2204
2257
|
fill: "#ffffff"
|
|
2205
2258
|
});
|
|
2206
2259
|
}
|
|
2207
|
-
function
|
|
2260
|
+
function Zn(e, t, n, o, i, r, l, p) {
|
|
2208
2261
|
const s = f(e, "g", { transform: t });
|
|
2209
2262
|
f(s, "ellipse", {
|
|
2210
2263
|
cx: n,
|
|
@@ -2228,7 +2281,7 @@ function Yn(e, t, n, o, i, r, l, p) {
|
|
|
2228
2281
|
});
|
|
2229
2282
|
}
|
|
2230
2283
|
function f(e, t, n = {}) {
|
|
2231
|
-
const o =
|
|
2284
|
+
const o = L(t, n);
|
|
2232
2285
|
return e.appendChild(o), o;
|
|
2233
2286
|
}
|
|
2234
2287
|
function U(e, t, n, o) {
|
|
@@ -2242,28 +2295,28 @@ function yt(e, t, n, o) {
|
|
|
2242
2295
|
const i = document.createElement("button");
|
|
2243
2296
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2244
2297
|
}
|
|
2245
|
-
function
|
|
2246
|
-
const e =
|
|
2298
|
+
function Wa() {
|
|
2299
|
+
const e = L("svg", {
|
|
2247
2300
|
class: "pluno-pa-widget__scribble-defs",
|
|
2248
2301
|
"aria-hidden": "true",
|
|
2249
2302
|
focusable: "false",
|
|
2250
2303
|
width: "0",
|
|
2251
2304
|
height: "0"
|
|
2252
|
-
}), t =
|
|
2305
|
+
}), t = L("defs");
|
|
2253
2306
|
return t.appendChild(Kt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2254
2307
|
Kt("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2255
2308
|
), t.appendChild(
|
|
2256
2309
|
Kt("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2257
2310
|
), e.appendChild(t), e;
|
|
2258
2311
|
}
|
|
2259
|
-
function
|
|
2260
|
-
const n =
|
|
2312
|
+
function Po(e, t) {
|
|
2313
|
+
const n = L("svg", {
|
|
2261
2314
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2262
2315
|
preserveAspectRatio: "xMidYMid meet",
|
|
2263
2316
|
"aria-hidden": "true",
|
|
2264
2317
|
focusable: "false"
|
|
2265
2318
|
});
|
|
2266
|
-
return
|
|
2319
|
+
return To(n, t), n;
|
|
2267
2320
|
}
|
|
2268
2321
|
function Vt(e, t) {
|
|
2269
2322
|
if (!e)
|
|
@@ -2272,27 +2325,27 @@ function Vt(e, t) {
|
|
|
2272
2325
|
0,
|
|
2273
2326
|
t - nn * 2
|
|
2274
2327
|
), o = Math.max(
|
|
2275
|
-
|
|
2328
|
+
aa,
|
|
2276
2329
|
Math.floor(
|
|
2277
2330
|
(n - tn * 2) / en
|
|
2278
2331
|
)
|
|
2279
2332
|
);
|
|
2280
|
-
|
|
2333
|
+
To(e, o);
|
|
2281
2334
|
}
|
|
2282
|
-
function
|
|
2335
|
+
function To(e, t) {
|
|
2283
2336
|
if (e.dataset.spiralCount === `${t}`)
|
|
2284
2337
|
return;
|
|
2285
2338
|
const n = t * en + tn * 2;
|
|
2286
2339
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2287
2340
|
"viewBox",
|
|
2288
|
-
`0 0 ${n} ${
|
|
2341
|
+
`0 0 ${n} ${ia}`
|
|
2289
2342
|
), e.replaceChildren();
|
|
2290
2343
|
for (let o = 0; o < t; o += 1) {
|
|
2291
|
-
const i =
|
|
2344
|
+
const i = Wn[o % Wn.length], r = L("g", {
|
|
2292
2345
|
transform: `translate(${tn + o * en} 0)`
|
|
2293
2346
|
});
|
|
2294
2347
|
r.appendChild(
|
|
2295
|
-
|
|
2348
|
+
L("ellipse", {
|
|
2296
2349
|
cx: i.ellipseCx,
|
|
2297
2350
|
cy: i.ellipseCy,
|
|
2298
2351
|
rx: i.ellipseRx,
|
|
@@ -2303,7 +2356,7 @@ function Lo(e, t) {
|
|
|
2303
2356
|
opacity: "0.8"
|
|
2304
2357
|
})
|
|
2305
2358
|
), r.appendChild(
|
|
2306
|
-
|
|
2359
|
+
L("path", {
|
|
2307
2360
|
d: i.path,
|
|
2308
2361
|
fill: "none",
|
|
2309
2362
|
stroke: "#2c2a1e",
|
|
@@ -2314,7 +2367,7 @@ function Lo(e, t) {
|
|
|
2314
2367
|
}
|
|
2315
2368
|
}
|
|
2316
2369
|
function Kt(e, t, n) {
|
|
2317
|
-
const o =
|
|
2370
|
+
const o = L("filter", {
|
|
2318
2371
|
id: e,
|
|
2319
2372
|
x: "-8%",
|
|
2320
2373
|
y: "-8%",
|
|
@@ -2322,7 +2375,7 @@ function Kt(e, t, n) {
|
|
|
2322
2375
|
height: "116%"
|
|
2323
2376
|
});
|
|
2324
2377
|
return o.appendChild(
|
|
2325
|
-
|
|
2378
|
+
L("feTurbulence", {
|
|
2326
2379
|
type: "fractalNoise",
|
|
2327
2380
|
baseFrequency: "0.012 0.028",
|
|
2328
2381
|
numOctaves: "3",
|
|
@@ -2330,7 +2383,7 @@ function Kt(e, t, n) {
|
|
|
2330
2383
|
result: "stroke-noise"
|
|
2331
2384
|
})
|
|
2332
2385
|
), o.appendChild(
|
|
2333
|
-
|
|
2386
|
+
L("feDisplacementMap", {
|
|
2334
2387
|
in: "SourceGraphic",
|
|
2335
2388
|
in2: "stroke-noise",
|
|
2336
2389
|
scale: "3.5",
|
|
@@ -2339,7 +2392,7 @@ function Kt(e, t, n) {
|
|
|
2339
2392
|
result: "warped"
|
|
2340
2393
|
})
|
|
2341
2394
|
), o.appendChild(
|
|
2342
|
-
|
|
2395
|
+
L("feTurbulence", {
|
|
2343
2396
|
type: "fractalNoise",
|
|
2344
2397
|
baseFrequency: "0.7",
|
|
2345
2398
|
numOctaves: "1",
|
|
@@ -2347,7 +2400,7 @@ function Kt(e, t, n) {
|
|
|
2347
2400
|
result: "ink-noise"
|
|
2348
2401
|
})
|
|
2349
2402
|
), o.appendChild(
|
|
2350
|
-
|
|
2403
|
+
L("feDisplacementMap", {
|
|
2351
2404
|
in: "warped",
|
|
2352
2405
|
in2: "ink-noise",
|
|
2353
2406
|
scale: "0.9",
|
|
@@ -2356,7 +2409,7 @@ function Kt(e, t, n) {
|
|
|
2356
2409
|
})
|
|
2357
2410
|
), o;
|
|
2358
2411
|
}
|
|
2359
|
-
function
|
|
2412
|
+
function Ga(e) {
|
|
2360
2413
|
const t = pe(
|
|
2361
2414
|
"0 0 24 24",
|
|
2362
2415
|
e,
|
|
@@ -2365,9 +2418,9 @@ function Oa(e) {
|
|
|
2365
2418
|
"currentColor",
|
|
2366
2419
|
"2.25"
|
|
2367
2420
|
);
|
|
2368
|
-
return t.appendChild(
|
|
2421
|
+
return t.appendChild(L("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2369
2422
|
}
|
|
2370
|
-
function
|
|
2423
|
+
function $a() {
|
|
2371
2424
|
const e = pe(
|
|
2372
2425
|
"0 0 24 24",
|
|
2373
2426
|
17,
|
|
@@ -2377,16 +2430,16 @@ function Ua() {
|
|
|
2377
2430
|
"2.25"
|
|
2378
2431
|
);
|
|
2379
2432
|
return e.appendChild(
|
|
2380
|
-
|
|
2433
|
+
L("path", {
|
|
2381
2434
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2382
2435
|
})
|
|
2383
2436
|
), e.appendChild(
|
|
2384
|
-
|
|
2437
|
+
L("path", {
|
|
2385
2438
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2386
2439
|
})
|
|
2387
2440
|
), e;
|
|
2388
2441
|
}
|
|
2389
|
-
function
|
|
2442
|
+
function qa() {
|
|
2390
2443
|
const e = pe(
|
|
2391
2444
|
"0 0 24 24",
|
|
2392
2445
|
17,
|
|
@@ -2395,9 +2448,9 @@ function Ba() {
|
|
|
2395
2448
|
"currentColor",
|
|
2396
2449
|
"2.25"
|
|
2397
2450
|
);
|
|
2398
|
-
return e.appendChild(
|
|
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;
|
|
2399
2452
|
}
|
|
2400
|
-
function
|
|
2453
|
+
function ja() {
|
|
2401
2454
|
const e = pe(
|
|
2402
2455
|
"0 0 24 24",
|
|
2403
2456
|
15,
|
|
@@ -2406,9 +2459,9 @@ function Fa() {
|
|
|
2406
2459
|
"currentColor",
|
|
2407
2460
|
"2.4"
|
|
2408
2461
|
);
|
|
2409
|
-
return e.appendChild(
|
|
2462
|
+
return e.appendChild(L("path", { d: "M18 6 6 18" })), e.appendChild(L("path", { d: "m6 6 12 12" })), e;
|
|
2410
2463
|
}
|
|
2411
|
-
function
|
|
2464
|
+
function Io() {
|
|
2412
2465
|
const e = pe(
|
|
2413
2466
|
"0 0 24 24",
|
|
2414
2467
|
14,
|
|
@@ -2418,10 +2471,10 @@ function Po() {
|
|
|
2418
2471
|
"2.75"
|
|
2419
2472
|
);
|
|
2420
2473
|
return e.appendChild(
|
|
2421
|
-
|
|
2422
|
-
), 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;
|
|
2423
2476
|
}
|
|
2424
|
-
function
|
|
2477
|
+
function Va() {
|
|
2425
2478
|
const e = pe(
|
|
2426
2479
|
"0 0 24 24",
|
|
2427
2480
|
16,
|
|
@@ -2434,18 +2487,18 @@ function Ha() {
|
|
|
2434
2487
|
"class",
|
|
2435
2488
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2436
2489
|
), e.appendChild(
|
|
2437
|
-
|
|
2490
|
+
L("path", {
|
|
2438
2491
|
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"
|
|
2439
2492
|
})
|
|
2440
2493
|
), e;
|
|
2441
2494
|
}
|
|
2442
|
-
function
|
|
2495
|
+
function Ka() {
|
|
2443
2496
|
const e = pe("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2444
2497
|
return e.setAttribute(
|
|
2445
2498
|
"class",
|
|
2446
2499
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2447
2500
|
), e.appendChild(
|
|
2448
|
-
|
|
2501
|
+
L("path", {
|
|
2449
2502
|
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",
|
|
2450
2503
|
stroke: "currentColor",
|
|
2451
2504
|
"stroke-width": "2",
|
|
@@ -2454,10 +2507,10 @@ function Wa() {
|
|
|
2454
2507
|
})
|
|
2455
2508
|
), e;
|
|
2456
2509
|
}
|
|
2457
|
-
function
|
|
2510
|
+
function Ya() {
|
|
2458
2511
|
const e = pe("0 0 24 24", 18, 18, "currentColor");
|
|
2459
2512
|
return e.appendChild(
|
|
2460
|
-
|
|
2513
|
+
L("rect", {
|
|
2461
2514
|
x: "6",
|
|
2462
2515
|
y: "6",
|
|
2463
2516
|
width: "12",
|
|
@@ -2466,7 +2519,7 @@ function Ga() {
|
|
|
2466
2519
|
})
|
|
2467
2520
|
), e;
|
|
2468
2521
|
}
|
|
2469
|
-
function
|
|
2522
|
+
function Xa() {
|
|
2470
2523
|
const e = pe(
|
|
2471
2524
|
"0 0 24 24",
|
|
2472
2525
|
12,
|
|
@@ -2475,9 +2528,9 @@ function $a() {
|
|
|
2475
2528
|
"currentColor",
|
|
2476
2529
|
"2.4"
|
|
2477
2530
|
);
|
|
2478
|
-
return e.appendChild(
|
|
2531
|
+
return e.appendChild(L("path", { d: "M18 6 6 18" })), e.appendChild(L("path", { d: "m6 6 12 12" })), e;
|
|
2479
2532
|
}
|
|
2480
|
-
function
|
|
2533
|
+
function Za() {
|
|
2481
2534
|
const e = pe(
|
|
2482
2535
|
"0 0 24 24",
|
|
2483
2536
|
13,
|
|
@@ -2487,7 +2540,7 @@ function qa() {
|
|
|
2487
2540
|
"2.25"
|
|
2488
2541
|
);
|
|
2489
2542
|
return e.appendChild(
|
|
2490
|
-
|
|
2543
|
+
L("rect", {
|
|
2491
2544
|
width: "14",
|
|
2492
2545
|
height: "14",
|
|
2493
2546
|
x: "8",
|
|
@@ -2496,7 +2549,7 @@ function qa() {
|
|
|
2496
2549
|
ry: "2"
|
|
2497
2550
|
})
|
|
2498
2551
|
), e.appendChild(
|
|
2499
|
-
|
|
2552
|
+
L("path", {
|
|
2500
2553
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2501
2554
|
})
|
|
2502
2555
|
), e;
|
|
@@ -2509,33 +2562,33 @@ function pe(e, t, n, o, i, r) {
|
|
|
2509
2562
|
fill: o,
|
|
2510
2563
|
"aria-hidden": "true"
|
|
2511
2564
|
};
|
|
2512
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2565
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), L("svg", l);
|
|
2513
2566
|
}
|
|
2514
|
-
function
|
|
2515
|
-
const n = document.createElementNS(
|
|
2567
|
+
function L(e, t = {}) {
|
|
2568
|
+
const n = document.createElementNS(_o, e);
|
|
2516
2569
|
for (const [o, i] of Object.entries(t))
|
|
2517
2570
|
n.setAttribute(o, i);
|
|
2518
2571
|
return n;
|
|
2519
2572
|
}
|
|
2520
|
-
function
|
|
2573
|
+
function Jn(e) {
|
|
2521
2574
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2522
2575
|
e.addEventListener(t, (n) => {
|
|
2523
2576
|
n.stopPropagation();
|
|
2524
2577
|
});
|
|
2525
2578
|
}
|
|
2526
|
-
function
|
|
2579
|
+
function Ja(e, t, n) {
|
|
2527
2580
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2528
2581
|
for (const [o, i] of t.entries()) {
|
|
2529
2582
|
const r = document.createElement("div");
|
|
2530
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2583
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Qa(i));
|
|
2531
2584
|
const l = document.createElement("span");
|
|
2532
2585
|
l.textContent = i.name, r.appendChild(l);
|
|
2533
2586
|
const p = document.createElement("button");
|
|
2534
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
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);
|
|
2535
2588
|
}
|
|
2536
2589
|
}
|
|
2537
|
-
function
|
|
2538
|
-
const t = un(e), n =
|
|
2590
|
+
function Qa(e) {
|
|
2591
|
+
const t = un(e), n = Ao(e);
|
|
2539
2592
|
if (t === "image" && n) {
|
|
2540
2593
|
const o = document.createElement("img");
|
|
2541
2594
|
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(re(e))), o;
|
|
@@ -2546,8 +2599,8 @@ function Va(e) {
|
|
|
2546
2599
|
}
|
|
2547
2600
|
return re(e);
|
|
2548
2601
|
}
|
|
2549
|
-
function
|
|
2550
|
-
const t = un(e), n =
|
|
2602
|
+
function er(e) {
|
|
2603
|
+
const t = un(e), n = Ao(e);
|
|
2551
2604
|
if (t === "image" && n) {
|
|
2552
2605
|
const o = document.createElement("img");
|
|
2553
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;
|
|
@@ -2565,32 +2618,32 @@ function Ka(e) {
|
|
|
2565
2618
|
function re(e, t = "composer") {
|
|
2566
2619
|
if (t === "composer") {
|
|
2567
2620
|
const r = document.createElement("span");
|
|
2568
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2621
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = Qn(e), r;
|
|
2569
2622
|
}
|
|
2570
2623
|
const n = document.createElement("div");
|
|
2571
2624
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2572
2625
|
const o = document.createElement("span");
|
|
2573
|
-
o.textContent =
|
|
2626
|
+
o.textContent = Qn(e);
|
|
2574
2627
|
const i = document.createElement("strong");
|
|
2575
2628
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2576
2629
|
}
|
|
2577
2630
|
function un(e) {
|
|
2578
2631
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2579
2632
|
}
|
|
2580
|
-
function
|
|
2633
|
+
function Ao(e) {
|
|
2581
2634
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2582
2635
|
}
|
|
2583
|
-
function
|
|
2636
|
+
function Qn(e) {
|
|
2584
2637
|
const t = un(e);
|
|
2585
2638
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2586
2639
|
}
|
|
2587
|
-
function
|
|
2640
|
+
function tr(e, t) {
|
|
2588
2641
|
return t ? Array.from(t).map((o) => ({
|
|
2589
2642
|
...e.createLocalAttachment(o),
|
|
2590
|
-
previewUrl:
|
|
2643
|
+
previewUrl: nr(o)
|
|
2591
2644
|
})) : [];
|
|
2592
2645
|
}
|
|
2593
|
-
function
|
|
2646
|
+
function nr(e) {
|
|
2594
2647
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2595
2648
|
}
|
|
2596
2649
|
function ut(e) {
|
|
@@ -2602,31 +2655,31 @@ function Yt(e, t, n = null) {
|
|
|
2602
2655
|
return;
|
|
2603
2656
|
}
|
|
2604
2657
|
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || gn(n) ? e.appendChild(
|
|
2605
|
-
|
|
2606
|
-
) :
|
|
2658
|
+
or(t, n)
|
|
2659
|
+
) : No(t) && e.appendChild(ir(t));
|
|
2607
2660
|
}
|
|
2608
|
-
function
|
|
2661
|
+
function or(e, t) {
|
|
2609
2662
|
const n = document.createElement("div");
|
|
2610
2663
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2611
2664
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2612
2665
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2613
2666
|
const r = document.createElement("span");
|
|
2614
2667
|
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(
|
|
2615
|
-
|
|
2668
|
+
Ro(
|
|
2616
2669
|
e,
|
|
2617
2670
|
"Upgrade plan",
|
|
2618
2671
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2619
2672
|
)
|
|
2620
2673
|
), n;
|
|
2621
2674
|
}
|
|
2622
|
-
function
|
|
2675
|
+
function ir(e) {
|
|
2623
2676
|
const t = document.createElement("div");
|
|
2624
2677
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2625
2678
|
const n = document.createElement("strong");
|
|
2626
2679
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2627
2680
|
const o = document.createElement("span");
|
|
2628
|
-
return o.textContent =
|
|
2629
|
-
|
|
2681
|
+
return o.textContent = rr(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2682
|
+
Ro(
|
|
2630
2683
|
e,
|
|
2631
2684
|
"Upgrade",
|
|
2632
2685
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -2634,12 +2687,12 @@ function Ja(e) {
|
|
|
2634
2687
|
), t;
|
|
2635
2688
|
}
|
|
2636
2689
|
function ln(e, t) {
|
|
2637
|
-
return e !== null && (le(e) ||
|
|
2690
|
+
return e !== null && (le(e) || No(e) || gn(t));
|
|
2638
2691
|
}
|
|
2639
|
-
function
|
|
2640
|
-
return ln(t, n) ||
|
|
2692
|
+
function eo(e, t, n) {
|
|
2693
|
+
return ln(t, n) || ar(t) ? !0 : !ln(e, n);
|
|
2641
2694
|
}
|
|
2642
|
-
function
|
|
2695
|
+
function ar(e) {
|
|
2643
2696
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
|
|
2644
2697
|
}
|
|
2645
2698
|
function le(e) {
|
|
@@ -2648,26 +2701,26 @@ function le(e) {
|
|
|
2648
2701
|
function gn(e) {
|
|
2649
2702
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2650
2703
|
}
|
|
2651
|
-
function
|
|
2704
|
+
function No(e) {
|
|
2652
2705
|
return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2653
2706
|
}
|
|
2654
|
-
function
|
|
2655
|
-
return e.creditsRemaining === null ? null : `${
|
|
2707
|
+
function rr(e) {
|
|
2708
|
+
return e.creditsRemaining === null ? null : `${lr(e.creditsRemaining)} credits left`;
|
|
2656
2709
|
}
|
|
2657
|
-
function
|
|
2710
|
+
function lr(e) {
|
|
2658
2711
|
return new Intl.NumberFormat("en-US", {
|
|
2659
2712
|
maximumFractionDigits: 0
|
|
2660
2713
|
}).format(Math.ceil(e));
|
|
2661
2714
|
}
|
|
2662
|
-
function
|
|
2715
|
+
function Ro(e, t, n) {
|
|
2663
2716
|
const o = document.createElement("div");
|
|
2664
2717
|
return o.className = n, o.appendChild(
|
|
2665
|
-
|
|
2718
|
+
to(t, e.pricingUrl)
|
|
2666
2719
|
), o.appendChild(
|
|
2667
|
-
|
|
2720
|
+
to("Earn credits", e.earnCreditsUrl)
|
|
2668
2721
|
), o;
|
|
2669
2722
|
}
|
|
2670
|
-
function
|
|
2723
|
+
function to(e, t) {
|
|
2671
2724
|
const n = document.createElement("button");
|
|
2672
2725
|
if (n.type = "button", e === "Earn credits") {
|
|
2673
2726
|
const o = document.createElement("span");
|
|
@@ -2680,31 +2733,31 @@ function Qn(e, t) {
|
|
|
2680
2733
|
}
|
|
2681
2734
|
function Xt(e, t) {
|
|
2682
2735
|
return e.messages.filter(
|
|
2683
|
-
(o) => !
|
|
2736
|
+
(o) => !Do(o)
|
|
2684
2737
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2685
2738
|
}
|
|
2686
|
-
function
|
|
2687
|
-
const N =
|
|
2688
|
-
(x) => !
|
|
2689
|
-
), G = e.scrollTop, ye = [], He = /* @__PURE__ */ new Set(),
|
|
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) => {
|
|
2690
2743
|
ye.push(x);
|
|
2691
2744
|
};
|
|
2692
|
-
|
|
2745
|
+
Mo(n, r.isThinking), i.hidden = !p, p && l !== null && ko(i, l);
|
|
2693
2746
|
const We = I.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2694
2747
|
if (o(We), g || I.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2695
2748
|
const x = document.createElement("div");
|
|
2696
2749
|
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2750
|
+
const E = document.createElement("div");
|
|
2751
|
+
E.className = "pluno-pa-widget__empty-hero";
|
|
2699
2752
|
const j = xe(
|
|
2700
2753
|
"pluno-pa-widget__character--empty",
|
|
2701
2754
|
v()
|
|
2702
2755
|
);
|
|
2703
|
-
if (
|
|
2756
|
+
if (E.appendChild(j), x.appendChild(E), g) {
|
|
2704
2757
|
const P = document.createElement("h2");
|
|
2705
2758
|
P.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", P.textContent = g.opening, x.appendChild(P);
|
|
2706
2759
|
} else
|
|
2707
|
-
x.appendChild(
|
|
2760
|
+
x.appendChild(Eo());
|
|
2708
2761
|
const V = g?.prompts ?? r.starterPrompts, J = document.createElement("div");
|
|
2709
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)
|
|
2710
2763
|
for (const P of V) {
|
|
@@ -2717,7 +2770,7 @@ function nr(e, t, n, o, i, r, l, p, s, c, u, m, L, v, D, C, g, y, h, E) {
|
|
|
2717
2770
|
const P = document.createElement("button");
|
|
2718
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);
|
|
2719
2772
|
} else
|
|
2720
|
-
for (let P = 0; P <
|
|
2773
|
+
for (let P = 0; P < $i; P += 1) {
|
|
2721
2774
|
const R = document.createElement("button");
|
|
2722
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);
|
|
2723
2776
|
}
|
|
@@ -2725,95 +2778,95 @@ function nr(e, t, n, o, i, r, l, p, s, c, u, m, L, v, D, C, g, y, h, E) {
|
|
|
2725
2778
|
const P = document.createElement("button");
|
|
2726
2779
|
P.type = "button", P.className = "pluno-pa-widget__morning-report-snooze", P.textContent = "Snooze morning report", P.addEventListener("click", y), x.appendChild(P);
|
|
2727
2780
|
}
|
|
2728
|
-
|
|
2781
|
+
h.clear(), z(x), z(t), no(e, ye);
|
|
2729
2782
|
return;
|
|
2730
2783
|
}
|
|
2731
2784
|
let w = null, O = null, ve = [];
|
|
2732
2785
|
const se = I.length - 1, ot = se >= 0 && pn(I[se]), $ = () => {
|
|
2733
2786
|
if (ve.length === 0)
|
|
2734
2787
|
return !1;
|
|
2735
|
-
const x =
|
|
2788
|
+
const x = vr(
|
|
2736
2789
|
ve,
|
|
2737
|
-
|
|
2738
|
-
|
|
2790
|
+
c,
|
|
2791
|
+
S,
|
|
2739
2792
|
v()
|
|
2740
2793
|
);
|
|
2741
|
-
return
|
|
2794
|
+
return z(x), w = null, O = x, ve = [], !0;
|
|
2742
2795
|
};
|
|
2743
2796
|
for (let x = 0; x < I.length; x += 1) {
|
|
2744
|
-
const
|
|
2745
|
-
if (
|
|
2746
|
-
ve.push(
|
|
2797
|
+
const E = I[x];
|
|
2798
|
+
if (E.role === "tool") {
|
|
2799
|
+
ve.push(E);
|
|
2747
2800
|
continue;
|
|
2748
2801
|
}
|
|
2749
|
-
if (pn(
|
|
2802
|
+
if (pn(E)) {
|
|
2750
2803
|
if (x !== se)
|
|
2751
2804
|
continue;
|
|
2752
2805
|
if ($()) {
|
|
2753
2806
|
const R = _t();
|
|
2754
|
-
|
|
2807
|
+
z(R), w = null, O = R;
|
|
2755
2808
|
} else {
|
|
2756
|
-
const R =
|
|
2757
|
-
|
|
2809
|
+
const R = ao(v());
|
|
2810
|
+
z(R), w = null, O = R;
|
|
2758
2811
|
}
|
|
2759
2812
|
continue;
|
|
2760
2813
|
}
|
|
2761
|
-
if (
|
|
2814
|
+
if (E.role === "system")
|
|
2762
2815
|
continue;
|
|
2763
|
-
const j = $(), V =
|
|
2764
|
-
if (
|
|
2765
|
-
const P =
|
|
2766
|
-
|
|
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;
|
|
2767
2820
|
}
|
|
2768
|
-
const J =
|
|
2769
|
-
|
|
2821
|
+
const J = sr(E, V, h, He);
|
|
2822
|
+
z(J), w = J, O = null;
|
|
2770
2823
|
}
|
|
2771
2824
|
const it = $(), Ae = I[I.length - 1]?.id === "assistant-draft";
|
|
2772
2825
|
if (r.isThinking && !Ae && !ot)
|
|
2773
2826
|
if (it) {
|
|
2774
2827
|
const x = _t();
|
|
2775
|
-
|
|
2828
|
+
z(x), w = null, O = x;
|
|
2776
2829
|
} else {
|
|
2777
|
-
const x =
|
|
2778
|
-
|
|
2830
|
+
const x = ao(v());
|
|
2831
|
+
z(x), w = null, O = x;
|
|
2779
2832
|
}
|
|
2780
2833
|
if (r.lastError) {
|
|
2781
2834
|
const x = document.createElement("div");
|
|
2782
2835
|
x.className = "pluno-pa-widget__error";
|
|
2783
|
-
const
|
|
2784
|
-
if (
|
|
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") {
|
|
2785
2838
|
const j = document.createElement("button");
|
|
2786
2839
|
j.type = "button", j.className = "pluno-pa-widget__error-retry", j.textContent = "Try again", j.addEventListener(
|
|
2787
2840
|
"click",
|
|
2788
|
-
r.lastErrorCode === "connection_failed" ?
|
|
2841
|
+
r.lastErrorCode === "connection_failed" ? m : C
|
|
2789
2842
|
), x.appendChild(j);
|
|
2790
2843
|
}
|
|
2791
|
-
|
|
2844
|
+
z(x), w = x, O = null;
|
|
2792
2845
|
}
|
|
2793
|
-
const oe =
|
|
2794
|
-
if (
|
|
2795
|
-
const x =
|
|
2796
|
-
isDrafting:
|
|
2797
|
-
error:
|
|
2798
|
-
characterIconOptions:
|
|
2799
|
-
onDraft:
|
|
2800
|
-
onDismiss:
|
|
2801
|
-
onDisable:
|
|
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
|
|
2802
2855
|
});
|
|
2803
|
-
|
|
2856
|
+
z(x), k.onSeen(oe), w = null, O = x;
|
|
2804
2857
|
}
|
|
2805
|
-
w?.classList.add("pluno-pa-widget__message--bottom-reserve"), O?.classList.add("pluno-pa-widget__bottom-reserve-compact"),
|
|
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;
|
|
2806
2859
|
}
|
|
2807
|
-
function
|
|
2808
|
-
const i =
|
|
2860
|
+
function sr(e, t, n, o) {
|
|
2861
|
+
const i = dr(e, t), r = i ? n.get(i) : void 0;
|
|
2809
2862
|
if (i && r)
|
|
2810
2863
|
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2811
2864
|
const l = document.createElement("div");
|
|
2812
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
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));
|
|
2813
2866
|
const p = document.createElement("div");
|
|
2814
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
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;
|
|
2815
2868
|
}
|
|
2816
|
-
function
|
|
2869
|
+
function dr(e, t) {
|
|
2817
2870
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2818
2871
|
id: e.id,
|
|
2819
2872
|
content: t,
|
|
@@ -2831,11 +2884,11 @@ function ir(e, t) {
|
|
|
2831
2884
|
})
|
|
2832
2885
|
});
|
|
2833
2886
|
}
|
|
2834
|
-
function
|
|
2887
|
+
function cr(e, t) {
|
|
2835
2888
|
for (const n of e.keys())
|
|
2836
2889
|
t.has(n) || e.delete(n);
|
|
2837
2890
|
}
|
|
2838
|
-
function
|
|
2891
|
+
function no(e, t) {
|
|
2839
2892
|
let n = e.firstChild;
|
|
2840
2893
|
for (const o of t) {
|
|
2841
2894
|
if (o === n) {
|
|
@@ -2849,7 +2902,7 @@ function eo(e, t) {
|
|
|
2849
2902
|
n = n.nextSibling, e.removeChild(o);
|
|
2850
2903
|
}
|
|
2851
2904
|
}
|
|
2852
|
-
function
|
|
2905
|
+
function ur(e) {
|
|
2853
2906
|
if (!e.assistantDraft)
|
|
2854
2907
|
return [...e.messages];
|
|
2855
2908
|
const t = {
|
|
@@ -2869,7 +2922,7 @@ function rr(e) {
|
|
|
2869
2922
|
if (n === -1)
|
|
2870
2923
|
return [...e.messages, t];
|
|
2871
2924
|
const o = e.messages.findIndex(
|
|
2872
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2925
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && oo(r, t) && pn(r)
|
|
2873
2926
|
);
|
|
2874
2927
|
if (o !== -1)
|
|
2875
2928
|
return [
|
|
@@ -2878,7 +2931,7 @@ function rr(e) {
|
|
|
2878
2931
|
...e.messages.slice(o + 1)
|
|
2879
2932
|
];
|
|
2880
2933
|
let i = n + 1;
|
|
2881
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2934
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && oo(e.messages[i], t); )
|
|
2882
2935
|
i += 1;
|
|
2883
2936
|
return [
|
|
2884
2937
|
...e.messages.slice(0, i),
|
|
@@ -2889,42 +2942,42 @@ function rr(e) {
|
|
|
2889
2942
|
function pn(e) {
|
|
2890
2943
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2891
2944
|
}
|
|
2892
|
-
function
|
|
2945
|
+
function oo(e, t) {
|
|
2893
2946
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2894
2947
|
}
|
|
2895
|
-
function
|
|
2896
|
-
e.replaceChildren(),
|
|
2948
|
+
function io(e, t, n, o, i, r, l, p) {
|
|
2949
|
+
e.replaceChildren(), Mo(t, !1), t.disabled = !0, n(!1);
|
|
2897
2950
|
const s = document.createElement("div");
|
|
2898
2951
|
s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2899
|
-
const
|
|
2952
|
+
const u = xe(
|
|
2900
2953
|
"pluno-pa-widget__character--empty",
|
|
2901
2954
|
o()
|
|
2902
2955
|
);
|
|
2903
|
-
s.appendChild(
|
|
2904
|
-
const
|
|
2905
|
-
if (
|
|
2906
|
-
const
|
|
2907
|
-
|
|
2956
|
+
s.appendChild(u);
|
|
2957
|
+
const c = document.createElement("div");
|
|
2958
|
+
if (c.className = "pluno-pa-widget__empty", c.textContent = i, s.appendChild(c), l) {
|
|
2959
|
+
const h = document.createElement("a");
|
|
2960
|
+
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, s.appendChild(h);
|
|
2908
2961
|
} else {
|
|
2909
|
-
const
|
|
2910
|
-
|
|
2962
|
+
const h = document.createElement("button");
|
|
2963
|
+
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => p?.()), s.appendChild(h);
|
|
2911
2964
|
}
|
|
2912
2965
|
e.appendChild(s);
|
|
2913
2966
|
}
|
|
2914
|
-
function
|
|
2967
|
+
function gr(e) {
|
|
2915
2968
|
const t = document.createElement("div");
|
|
2916
2969
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2917
2970
|
for (const n of e)
|
|
2918
|
-
t.appendChild(
|
|
2971
|
+
t.appendChild(er(n));
|
|
2919
2972
|
return t;
|
|
2920
2973
|
}
|
|
2921
|
-
function
|
|
2974
|
+
function hr(e) {
|
|
2922
2975
|
const t = document.createElement("button");
|
|
2923
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
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) => {
|
|
2924
2977
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2925
2978
|
}), t;
|
|
2926
2979
|
}
|
|
2927
|
-
function
|
|
2980
|
+
function mr(e, t) {
|
|
2928
2981
|
const n = document.createElement("article");
|
|
2929
2982
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2930
2983
|
const o = document.createElement("div");
|
|
@@ -2940,32 +2993,32 @@ function sr(e, t) {
|
|
|
2940
2993
|
r.textContent = "Share this win?", i.appendChild(r);
|
|
2941
2994
|
const l = document.createElement("span");
|
|
2942
2995
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2943
|
-
const
|
|
2944
|
-
|
|
2996
|
+
const c = document.createElement("span");
|
|
2997
|
+
c.className = "pluno-pa-widget__share-prompt-error", c.textContent = t.error, i.appendChild(c);
|
|
2945
2998
|
}
|
|
2946
2999
|
o.appendChild(i);
|
|
2947
3000
|
const p = document.createElement("div");
|
|
2948
3001
|
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
2949
3002
|
const s = document.createElement("div");
|
|
2950
3003
|
s.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
2951
|
-
const
|
|
2952
|
-
if (
|
|
3004
|
+
const u = document.createElement("button");
|
|
3005
|
+
if (u.type = "button", u.disabled = t.isDrafting, u.addEventListener("click", () => {
|
|
2953
3006
|
t.onDraft(e);
|
|
2954
|
-
}), t.isDrafting ? (
|
|
3007
|
+
}), t.isDrafting ? (u.appendChild(sn()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", s.appendChild(u), t.isDrafting)
|
|
2955
3008
|
p.appendChild(s);
|
|
2956
3009
|
else {
|
|
2957
|
-
const
|
|
2958
|
-
|
|
3010
|
+
const c = document.createElement("button");
|
|
3011
|
+
c.type = "button", c.className = "pluno-pa-widget__share-prompt-dismiss", c.setAttribute("aria-label", "Dismiss share prompt"), c.title = "Dismiss", c.textContent = "Dismiss", c.addEventListener("click", () => {
|
|
2959
3012
|
t.onDismiss(e);
|
|
2960
|
-
}), s.appendChild(
|
|
2961
|
-
const
|
|
2962
|
-
|
|
3013
|
+
}), s.appendChild(c), p.appendChild(s);
|
|
3014
|
+
const h = document.createElement("button");
|
|
3015
|
+
h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => {
|
|
2963
3016
|
t.onDisable(e);
|
|
2964
|
-
}), p.appendChild(
|
|
3017
|
+
}), p.appendChild(h);
|
|
2965
3018
|
}
|
|
2966
3019
|
return o.appendChild(p), n.appendChild(o), n;
|
|
2967
3020
|
}
|
|
2968
|
-
function
|
|
3021
|
+
function fr(e, t) {
|
|
2969
3022
|
const n = document.createElement("div");
|
|
2970
3023
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
|
|
2971
3024
|
g.target === n && t.onClose();
|
|
@@ -2980,56 +3033,56 @@ function dr(e, t) {
|
|
|
2980
3033
|
p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
|
|
2981
3034
|
const s = document.createElement("div");
|
|
2982
3035
|
s.className = "pluno-pa-widget__share-dialog-step";
|
|
2983
|
-
const
|
|
2984
|
-
|
|
2985
|
-
const
|
|
2986
|
-
|
|
2987
|
-
const
|
|
3036
|
+
const u = document.createElement("div");
|
|
3037
|
+
u.className = "pluno-pa-widget__share-dialog-step-header";
|
|
3038
|
+
const c = document.createElement("strong");
|
|
3039
|
+
c.textContent = "1) Copy Screenshot", u.appendChild(c);
|
|
3040
|
+
const h = wr(
|
|
2988
3041
|
"Copy Screenshot",
|
|
2989
3042
|
async () => {
|
|
2990
3043
|
try {
|
|
2991
|
-
return await
|
|
3044
|
+
return await ui(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2992
3045
|
} catch {
|
|
2993
3046
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2994
3047
|
}
|
|
2995
3048
|
}
|
|
2996
3049
|
);
|
|
2997
|
-
if (
|
|
3050
|
+
if (u.appendChild(h), s.appendChild(u), e.screenshotDataUrl) {
|
|
2998
3051
|
const g = document.createElement("div");
|
|
2999
3052
|
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3000
3053
|
const y = document.createElement("img");
|
|
3001
3054
|
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), s.appendChild(g);
|
|
3002
3055
|
}
|
|
3003
3056
|
o.appendChild(s), o.appendChild(p);
|
|
3004
|
-
const
|
|
3005
|
-
|
|
3057
|
+
const S = document.createElement("div");
|
|
3058
|
+
S.className = "pluno-pa-widget__share-dialog-step";
|
|
3006
3059
|
const v = document.createElement("strong");
|
|
3007
|
-
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on",
|
|
3060
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", S.appendChild(v);
|
|
3008
3061
|
const D = document.createElement("p");
|
|
3009
|
-
D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.",
|
|
3062
|
+
D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.", S.appendChild(D);
|
|
3010
3063
|
const C = document.createElement("footer");
|
|
3011
3064
|
C.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3012
|
-
for (const g of
|
|
3065
|
+
for (const g of br(e)) {
|
|
3013
3066
|
const y = document.createElement("a");
|
|
3014
|
-
y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(
|
|
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);
|
|
3015
3068
|
}
|
|
3016
|
-
if (
|
|
3069
|
+
if (S.appendChild(C), o.appendChild(S), t.socialPostRewardsUrl) {
|
|
3017
3070
|
const g = document.createElement("div");
|
|
3018
3071
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
3019
3072
|
const y = document.createElement("strong");
|
|
3020
3073
|
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(y);
|
|
3021
|
-
const
|
|
3022
|
-
|
|
3074
|
+
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);
|
|
3023
3076
|
}
|
|
3024
3077
|
return n.appendChild(o), n;
|
|
3025
3078
|
}
|
|
3026
|
-
function
|
|
3079
|
+
function wr(e, t) {
|
|
3027
3080
|
const n = document.createElement("button");
|
|
3028
3081
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
3029
3082
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
3030
3083
|
}), n;
|
|
3031
3084
|
}
|
|
3032
|
-
function
|
|
3085
|
+
function br(e) {
|
|
3033
3086
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
3034
3087
|
return [
|
|
3035
3088
|
{
|
|
@@ -3049,7 +3102,7 @@ function ur(e) {
|
|
|
3049
3102
|
}
|
|
3050
3103
|
];
|
|
3051
3104
|
}
|
|
3052
|
-
function
|
|
3105
|
+
function _r(e) {
|
|
3053
3106
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3054
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(
|
|
3055
3108
|
t,
|
|
@@ -3076,20 +3129,20 @@ function W(e, t, n) {
|
|
|
3076
3129
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3077
3130
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3078
3131
|
}
|
|
3079
|
-
function
|
|
3132
|
+
function xr() {
|
|
3080
3133
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3081
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(
|
|
3082
3135
|
e,
|
|
3083
3136
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3084
3137
|
), e;
|
|
3085
3138
|
}
|
|
3086
|
-
function
|
|
3087
|
-
return e.role === "tool" && e.toolName ===
|
|
3139
|
+
function Do(e) {
|
|
3140
|
+
return e.role === "tool" && e.toolName === go;
|
|
3088
3141
|
}
|
|
3089
|
-
function
|
|
3142
|
+
function yr(e) {
|
|
3090
3143
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3091
3144
|
}
|
|
3092
|
-
function
|
|
3145
|
+
function vr(e, t, n, o) {
|
|
3093
3146
|
const i = document.createElement("article");
|
|
3094
3147
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3095
3148
|
e[e.length - 1].createdAt
|
|
@@ -3099,27 +3152,27 @@ function fr(e, t, n, o) {
|
|
|
3099
3152
|
o
|
|
3100
3153
|
)
|
|
3101
3154
|
);
|
|
3102
|
-
const r = document.createElement("details"), l =
|
|
3155
|
+
const r = document.createElement("details"), l = Cr(e);
|
|
3103
3156
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3104
3157
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3105
3158
|
});
|
|
3106
3159
|
const p = document.createElement("summary");
|
|
3107
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((
|
|
3108
|
-
const
|
|
3109
|
-
if (
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3112
|
-
for (const
|
|
3113
|
-
const
|
|
3114
|
-
|
|
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) {
|
|
3163
|
+
const c = document.createElement("div");
|
|
3164
|
+
c.className = "pluno-pa-widget__tool-lines";
|
|
3165
|
+
for (const h of e) {
|
|
3166
|
+
const S = document.createElement("div");
|
|
3167
|
+
S.className = "pluno-pa-widget__tool-line", h.loading && S.appendChild(sn());
|
|
3115
3168
|
const v = document.createElement("span");
|
|
3116
|
-
v.textContent =
|
|
3169
|
+
v.textContent = h.content || "Run tool", S.appendChild(v), c.appendChild(S);
|
|
3117
3170
|
}
|
|
3118
|
-
r.appendChild(
|
|
3171
|
+
r.appendChild(c);
|
|
3119
3172
|
}
|
|
3120
3173
|
return i.appendChild(r), i;
|
|
3121
3174
|
}
|
|
3122
|
-
function
|
|
3175
|
+
function zo(e) {
|
|
3123
3176
|
const t = document.createElement("article");
|
|
3124
3177
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3125
3178
|
xe(
|
|
@@ -3128,8 +3181,8 @@ function Ro(e) {
|
|
|
3128
3181
|
)
|
|
3129
3182
|
), t;
|
|
3130
3183
|
}
|
|
3131
|
-
function
|
|
3132
|
-
const t =
|
|
3184
|
+
function ao(e) {
|
|
3185
|
+
const t = zo(e);
|
|
3133
3186
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(_t()), t;
|
|
3134
3187
|
}
|
|
3135
3188
|
function _t(e = "Thinking...") {
|
|
@@ -3140,18 +3193,18 @@ function _t(e = "Thinking...") {
|
|
|
3140
3193
|
const o = document.createElement("span");
|
|
3141
3194
|
return o.textContent = e, t.appendChild(o), t;
|
|
3142
3195
|
}
|
|
3143
|
-
function
|
|
3196
|
+
function Cr(e) {
|
|
3144
3197
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3145
3198
|
}
|
|
3146
3199
|
function sn() {
|
|
3147
3200
|
const e = document.createElement("span");
|
|
3148
3201
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3149
3202
|
}
|
|
3150
|
-
function
|
|
3151
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
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());
|
|
3152
3205
|
}
|
|
3153
|
-
function
|
|
3154
|
-
const n = t.replace(/\r\n/g, `
|
|
3206
|
+
function Sr(e, t) {
|
|
3207
|
+
const n = Li(t).replace(/\r\n/g, `
|
|
3155
3208
|
`).split(`
|
|
3156
3209
|
`);
|
|
3157
3210
|
let o = 0;
|
|
@@ -3166,9 +3219,9 @@ function br(e, t) {
|
|
|
3166
3219
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3167
3220
|
c.push(n[o]), o += 1;
|
|
3168
3221
|
o += o < n.length ? 1 : 0;
|
|
3169
|
-
const
|
|
3170
|
-
|
|
3171
|
-
`),
|
|
3222
|
+
const h = document.createElement("pre"), S = document.createElement("code");
|
|
3223
|
+
S.textContent = c.join(`
|
|
3224
|
+
`), h.appendChild(S), e.appendChild(h);
|
|
3172
3225
|
continue;
|
|
3173
3226
|
}
|
|
3174
3227
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
@@ -3180,28 +3233,29 @@ function br(e, t) {
|
|
|
3180
3233
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3181
3234
|
const c = document.createElement("ul");
|
|
3182
3235
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3183
|
-
const
|
|
3184
|
-
gt(
|
|
3236
|
+
const h = document.createElement("li");
|
|
3237
|
+
gt(h, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(h), o += 1;
|
|
3185
3238
|
}
|
|
3186
3239
|
e.appendChild(c);
|
|
3187
3240
|
continue;
|
|
3188
3241
|
}
|
|
3189
|
-
|
|
3242
|
+
const p = i.match(/^\s*(\d+)\.\s+/);
|
|
3243
|
+
if (p) {
|
|
3190
3244
|
const c = document.createElement("ol");
|
|
3191
|
-
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3192
|
-
const
|
|
3193
|
-
gt(
|
|
3245
|
+
for (c.start = Number(p[1]); o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3246
|
+
const h = document.createElement("li");
|
|
3247
|
+
gt(h, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(h), o += 1;
|
|
3194
3248
|
}
|
|
3195
3249
|
e.appendChild(c);
|
|
3196
3250
|
continue;
|
|
3197
3251
|
}
|
|
3198
|
-
const
|
|
3252
|
+
const s = [i];
|
|
3199
3253
|
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]); )
|
|
3200
|
-
|
|
3201
|
-
const
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
}), e.appendChild(
|
|
3254
|
+
s.push(n[o]), o += 1;
|
|
3255
|
+
const u = document.createElement("p");
|
|
3256
|
+
s.forEach((c, h) => {
|
|
3257
|
+
h > 0 && u.appendChild(document.createElement("br")), gt(u, c);
|
|
3258
|
+
}), e.appendChild(u);
|
|
3205
3259
|
}
|
|
3206
3260
|
}
|
|
3207
3261
|
function gt(e, t) {
|
|
@@ -3224,7 +3278,7 @@ function gt(e, t) {
|
|
|
3224
3278
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3225
3279
|
} else {
|
|
3226
3280
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3227
|
-
if (p &&
|
|
3281
|
+
if (p && Er(p[2])) {
|
|
3228
3282
|
const s = document.createElement("a");
|
|
3229
3283
|
s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
|
|
3230
3284
|
} else
|
|
@@ -3234,7 +3288,7 @@ function gt(e, t) {
|
|
|
3234
3288
|
}
|
|
3235
3289
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3236
3290
|
}
|
|
3237
|
-
function
|
|
3291
|
+
function Er(e) {
|
|
3238
3292
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3239
3293
|
return !0;
|
|
3240
3294
|
try {
|
|
@@ -3244,8 +3298,8 @@ function _r(e) {
|
|
|
3244
3298
|
return !1;
|
|
3245
3299
|
}
|
|
3246
3300
|
}
|
|
3247
|
-
function
|
|
3248
|
-
if (
|
|
3301
|
+
function ro(e, t) {
|
|
3302
|
+
if (kr(e))
|
|
3249
3303
|
return;
|
|
3250
3304
|
const n = `
|
|
3251
3305
|
:host {
|
|
@@ -4142,6 +4196,9 @@ function io(e, t) {
|
|
|
4142
4196
|
line-height: 1.35;
|
|
4143
4197
|
font-weight: 650;
|
|
4144
4198
|
}
|
|
4199
|
+
.pluno-pa-widget__message--assistant strong {
|
|
4200
|
+
font-weight: 1000;
|
|
4201
|
+
}
|
|
4145
4202
|
.pluno-pa-widget__message--assistant ul,
|
|
4146
4203
|
.pluno-pa-widget__message--assistant ol {
|
|
4147
4204
|
padding-left: 20px;
|
|
@@ -5219,6 +5276,11 @@ function io(e, t) {
|
|
|
5219
5276
|
.pluno-pa-widget--scribble .pluno-pa-widget__message--assistant pre {
|
|
5220
5277
|
font-family: inherit;
|
|
5221
5278
|
}
|
|
5279
|
+
/* Architects Daughter only ships one weight, so a small stroke makes
|
|
5280
|
+
markdown bold visibly heavier instead of relying on synthetic weight. */
|
|
5281
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__message--assistant strong {
|
|
5282
|
+
-webkit-text-stroke: 0.45px currentColor;
|
|
5283
|
+
}
|
|
5222
5284
|
.pluno-pa-widget--scribble .pluno-pa-widget__message {
|
|
5223
5285
|
font-size: 17px;
|
|
5224
5286
|
}
|
|
@@ -5553,28 +5615,28 @@ function io(e, t) {
|
|
|
5553
5615
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5554
5616
|
}
|
|
5555
5617
|
`;
|
|
5556
|
-
if (
|
|
5618
|
+
if (Lr(e, n))
|
|
5557
5619
|
return;
|
|
5558
5620
|
const o = e.ownerDocument.createElement("style");
|
|
5559
|
-
o.id =
|
|
5621
|
+
o.id = vo, o.textContent = n, e.appendChild(o), Oo(e);
|
|
5560
5622
|
}
|
|
5561
|
-
function
|
|
5562
|
-
return e.getElementById(
|
|
5623
|
+
function kr(e) {
|
|
5624
|
+
return e.getElementById(vo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Co) === "true";
|
|
5563
5625
|
}
|
|
5564
|
-
function
|
|
5565
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5626
|
+
function Oo(e) {
|
|
5627
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Co, "true");
|
|
5566
5628
|
}
|
|
5567
|
-
function
|
|
5629
|
+
function Lr(e, t) {
|
|
5568
5630
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5569
5631
|
return !1;
|
|
5570
5632
|
try {
|
|
5571
5633
|
const n = new CSSStyleSheet();
|
|
5572
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
5634
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Oo(e), !0;
|
|
5573
5635
|
} catch {
|
|
5574
5636
|
return !1;
|
|
5575
5637
|
}
|
|
5576
5638
|
}
|
|
5577
|
-
async function
|
|
5639
|
+
async function Pr() {
|
|
5578
5640
|
return document.body ? document.body : await new Promise((e) => {
|
|
5579
5641
|
const t = new MutationObserver(() => {
|
|
5580
5642
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5582,10 +5644,10 @@ async function vr() {
|
|
|
5582
5644
|
t.observe(document.documentElement, { childList: !0 });
|
|
5583
5645
|
});
|
|
5584
5646
|
}
|
|
5585
|
-
function
|
|
5647
|
+
function Uo(e) {
|
|
5586
5648
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5587
5649
|
}
|
|
5588
|
-
function
|
|
5650
|
+
function Tr(e) {
|
|
5589
5651
|
if (e)
|
|
5590
5652
|
return { clientId: e, release: () => {
|
|
5591
5653
|
} };
|
|
@@ -5593,7 +5655,7 @@ function Cr(e) {
|
|
|
5593
5655
|
for (; Ht.has(t); )
|
|
5594
5656
|
t += 1;
|
|
5595
5657
|
Ht.add(t);
|
|
5596
|
-
const n = `${
|
|
5658
|
+
const n = `${Wi}${t}`;
|
|
5597
5659
|
let o = crypto.randomUUID();
|
|
5598
5660
|
try {
|
|
5599
5661
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -5607,11 +5669,11 @@ function Cr(e) {
|
|
|
5607
5669
|
}
|
|
5608
5670
|
};
|
|
5609
5671
|
}
|
|
5610
|
-
function
|
|
5672
|
+
function Ir(e) {
|
|
5611
5673
|
try {
|
|
5612
|
-
const t = window.localStorage.getItem(
|
|
5674
|
+
const t = window.localStorage.getItem(Uo(e));
|
|
5613
5675
|
if (!t)
|
|
5614
|
-
return
|
|
5676
|
+
return lo();
|
|
5615
5677
|
const n = JSON.parse(t);
|
|
5616
5678
|
return {
|
|
5617
5679
|
isOpen: n.isOpen === !0,
|
|
@@ -5621,25 +5683,25 @@ function Sr(e) {
|
|
|
5621
5683
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5622
5684
|
(o) => typeof o == "string"
|
|
5623
5685
|
) : [],
|
|
5624
|
-
launcherPosition:
|
|
5625
|
-
panelSize:
|
|
5626
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
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) : [],
|
|
5627
5689
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5628
5690
|
};
|
|
5629
5691
|
} catch {
|
|
5630
|
-
return
|
|
5692
|
+
return lo();
|
|
5631
5693
|
}
|
|
5632
5694
|
}
|
|
5633
|
-
async function
|
|
5695
|
+
async function Ar(e) {
|
|
5634
5696
|
if (e.loadSharePromptsDisabled)
|
|
5635
5697
|
return e.loadSharePromptsDisabled();
|
|
5636
5698
|
try {
|
|
5637
|
-
return window.localStorage.getItem(
|
|
5699
|
+
return window.localStorage.getItem(fo) === "true";
|
|
5638
5700
|
} catch {
|
|
5639
5701
|
return !1;
|
|
5640
5702
|
}
|
|
5641
5703
|
}
|
|
5642
|
-
function
|
|
5704
|
+
function Nr(e, t) {
|
|
5643
5705
|
if (e.persistSharePromptsDisabled) {
|
|
5644
5706
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5645
5707
|
() => {
|
|
@@ -5648,12 +5710,12 @@ function kr(e, t) {
|
|
|
5648
5710
|
return;
|
|
5649
5711
|
}
|
|
5650
5712
|
try {
|
|
5651
|
-
t && window.localStorage.setItem(
|
|
5713
|
+
t && window.localStorage.setItem(fo, "true");
|
|
5652
5714
|
} catch {
|
|
5653
5715
|
return;
|
|
5654
5716
|
}
|
|
5655
5717
|
}
|
|
5656
|
-
function
|
|
5718
|
+
function lo() {
|
|
5657
5719
|
return {
|
|
5658
5720
|
isOpen: !1,
|
|
5659
5721
|
composerValue: "",
|
|
@@ -5666,29 +5728,29 @@ function ao() {
|
|
|
5666
5728
|
sharePromptsDisabled: !1
|
|
5667
5729
|
};
|
|
5668
5730
|
}
|
|
5669
|
-
function
|
|
5731
|
+
function Rr(e, t) {
|
|
5670
5732
|
try {
|
|
5671
5733
|
window.localStorage.setItem(
|
|
5672
|
-
|
|
5734
|
+
Uo(e),
|
|
5673
5735
|
JSON.stringify(t)
|
|
5674
5736
|
);
|
|
5675
5737
|
} catch {
|
|
5676
5738
|
return;
|
|
5677
5739
|
}
|
|
5678
5740
|
}
|
|
5679
|
-
function
|
|
5741
|
+
function Dr(e) {
|
|
5680
5742
|
if (!e || typeof e != "object")
|
|
5681
5743
|
return !1;
|
|
5682
5744
|
const t = e;
|
|
5683
5745
|
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");
|
|
5684
5746
|
}
|
|
5685
|
-
function
|
|
5747
|
+
function zr(e) {
|
|
5686
5748
|
if (!e || typeof e != "object")
|
|
5687
5749
|
return !1;
|
|
5688
5750
|
const t = e;
|
|
5689
5751
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5690
5752
|
}
|
|
5691
|
-
async function
|
|
5753
|
+
async function Bo(e, t) {
|
|
5692
5754
|
const n = await fetch(e, {
|
|
5693
5755
|
method: "POST",
|
|
5694
5756
|
credentials: "include",
|
|
@@ -5700,7 +5762,7 @@ async function Oo(e, t) {
|
|
|
5700
5762
|
...t ? { signal: t } : {}
|
|
5701
5763
|
});
|
|
5702
5764
|
if (!n.ok) {
|
|
5703
|
-
const i = await n.text(), r =
|
|
5765
|
+
const i = await n.text(), r = ii(i);
|
|
5704
5766
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
5705
5767
|
}
|
|
5706
5768
|
const o = await n.json();
|
|
@@ -5708,29 +5770,29 @@ async function Oo(e, t) {
|
|
|
5708
5770
|
throw new Error("Pluno token endpoint did not return a token");
|
|
5709
5771
|
return o.token;
|
|
5710
5772
|
}
|
|
5711
|
-
function
|
|
5773
|
+
function Mr(e) {
|
|
5712
5774
|
let t = !1, n = !1;
|
|
5713
5775
|
const o = async () => {
|
|
5714
5776
|
const i = new AbortController();
|
|
5715
5777
|
let r = !1;
|
|
5716
5778
|
const l = new Promise((p, s) => {
|
|
5717
|
-
const
|
|
5718
|
-
r = !0, i.abort(), s(new Error(
|
|
5719
|
-
},
|
|
5779
|
+
const u = window.setTimeout(() => {
|
|
5780
|
+
r = !0, i.abort(), s(new Error(On));
|
|
5781
|
+
}, Fi);
|
|
5720
5782
|
i.signal.addEventListener(
|
|
5721
5783
|
"abort",
|
|
5722
|
-
() => window.clearTimeout(
|
|
5784
|
+
() => window.clearTimeout(u),
|
|
5723
5785
|
{ once: !0 }
|
|
5724
5786
|
);
|
|
5725
5787
|
});
|
|
5726
5788
|
try {
|
|
5727
5789
|
const p = await Promise.race([
|
|
5728
|
-
|
|
5790
|
+
Bo(e, i.signal),
|
|
5729
5791
|
l
|
|
5730
5792
|
]);
|
|
5731
5793
|
return i.abort(), p;
|
|
5732
5794
|
} catch (p) {
|
|
5733
|
-
throw i.abort(), r ? new Error(
|
|
5795
|
+
throw i.abort(), r ? new Error(On) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(Hi);
|
|
5734
5796
|
}
|
|
5735
5797
|
};
|
|
5736
5798
|
return {
|
|
@@ -5753,30 +5815,30 @@ function Ir(e) {
|
|
|
5753
5815
|
}
|
|
5754
5816
|
};
|
|
5755
5817
|
}
|
|
5756
|
-
const
|
|
5757
|
-
function
|
|
5818
|
+
const po = /* @__PURE__ */ new WeakSet();
|
|
5819
|
+
function Or(e) {
|
|
5758
5820
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5759
5821
|
}
|
|
5760
|
-
function
|
|
5822
|
+
function so(e) {
|
|
5761
5823
|
const t = e.pathname.split("/");
|
|
5762
5824
|
return t[t.length - 1] ?? "";
|
|
5763
5825
|
}
|
|
5764
|
-
function
|
|
5826
|
+
function Ur(e, t) {
|
|
5765
5827
|
const n = new URL(e.src, document.baseURI);
|
|
5766
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5828
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : so(n) === so(t);
|
|
5767
5829
|
}
|
|
5768
5830
|
class he extends EventTarget {
|
|
5769
5831
|
constructor(t, n) {
|
|
5770
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
5832
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(zi, () => {
|
|
5771
5833
|
this.readyState = he.OPEN, this.dispatchEvent(new Event("open"));
|
|
5772
|
-
}), this.addPreviewListener(
|
|
5834
|
+
}), this.addPreviewListener(Mi, (o) => {
|
|
5773
5835
|
const i = o;
|
|
5774
5836
|
this.dispatchEvent(
|
|
5775
5837
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5776
5838
|
);
|
|
5777
|
-
}), this.addPreviewListener(
|
|
5839
|
+
}), this.addPreviewListener(Oi, () => {
|
|
5778
5840
|
this.readyState = he.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5779
|
-
}), this.addPreviewListener(
|
|
5841
|
+
}), this.addPreviewListener(Ui, (o) => {
|
|
5780
5842
|
const i = o;
|
|
5781
5843
|
this.readyState = he.CLOSED, this.dispatchEvent(
|
|
5782
5844
|
new CloseEvent("close", {
|
|
@@ -5788,7 +5850,7 @@ class he extends EventTarget {
|
|
|
5788
5850
|
}), window.dispatchEvent(
|
|
5789
5851
|
new CustomEvent(
|
|
5790
5852
|
ht(
|
|
5791
|
-
|
|
5853
|
+
Ni,
|
|
5792
5854
|
this.channelId
|
|
5793
5855
|
),
|
|
5794
5856
|
{
|
|
@@ -5808,7 +5870,7 @@ class he extends EventTarget {
|
|
|
5808
5870
|
binaryType = "blob";
|
|
5809
5871
|
bufferedAmount = 0;
|
|
5810
5872
|
readyState = he.CONNECTING;
|
|
5811
|
-
socketId =
|
|
5873
|
+
socketId = Br();
|
|
5812
5874
|
listeners = /* @__PURE__ */ new Map();
|
|
5813
5875
|
send(t) {
|
|
5814
5876
|
if (this.readyState !== he.OPEN)
|
|
@@ -5818,7 +5880,7 @@ class he extends EventTarget {
|
|
|
5818
5880
|
);
|
|
5819
5881
|
window.dispatchEvent(
|
|
5820
5882
|
new CustomEvent(
|
|
5821
|
-
ht(
|
|
5883
|
+
ht(Ri, this.channelId),
|
|
5822
5884
|
{
|
|
5823
5885
|
detail: {
|
|
5824
5886
|
socketId: this.socketId,
|
|
@@ -5831,7 +5893,7 @@ class he extends EventTarget {
|
|
|
5831
5893
|
close(t, n) {
|
|
5832
5894
|
this.readyState !== he.CLOSED && (this.readyState = he.CLOSING, window.dispatchEvent(
|
|
5833
5895
|
new CustomEvent(
|
|
5834
|
-
ht(
|
|
5896
|
+
ht(Di, this.channelId),
|
|
5835
5897
|
{
|
|
5836
5898
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5837
5899
|
}
|
|
@@ -5853,19 +5915,19 @@ class he extends EventTarget {
|
|
|
5853
5915
|
this.listeners.clear();
|
|
5854
5916
|
}
|
|
5855
5917
|
}
|
|
5856
|
-
function
|
|
5918
|
+
function Br() {
|
|
5857
5919
|
const e = window.sessionStorage.getItem(
|
|
5858
|
-
|
|
5920
|
+
Mn
|
|
5859
5921
|
);
|
|
5860
5922
|
if (e)
|
|
5861
5923
|
return e;
|
|
5862
5924
|
const t = crypto.randomUUID();
|
|
5863
|
-
return window.sessionStorage.setItem(
|
|
5925
|
+
return window.sessionStorage.setItem(Mn, t), t;
|
|
5864
5926
|
}
|
|
5865
5927
|
function ht(e, t) {
|
|
5866
5928
|
return `${e}:${t}`;
|
|
5867
5929
|
}
|
|
5868
|
-
function
|
|
5930
|
+
function Fr(e) {
|
|
5869
5931
|
const t = document.currentScript;
|
|
5870
5932
|
if (t instanceof HTMLScriptElement)
|
|
5871
5933
|
return [t];
|
|
@@ -5873,35 +5935,35 @@ function Dr(e) {
|
|
|
5873
5935
|
return Array.from(
|
|
5874
5936
|
document.querySelectorAll("script[type='module'][src]")
|
|
5875
5937
|
).filter(
|
|
5876
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5938
|
+
(i) => i instanceof HTMLScriptElement && Or(i) && Ur(i, o)
|
|
5877
5939
|
);
|
|
5878
5940
|
}
|
|
5879
|
-
function
|
|
5880
|
-
for (const t of
|
|
5881
|
-
|
|
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) => {
|
|
5882
5944
|
console.error("Failed to mount Pluno widget", n);
|
|
5883
5945
|
}));
|
|
5884
5946
|
}
|
|
5885
|
-
function
|
|
5947
|
+
function Fo(e) {
|
|
5886
5948
|
const t = window, n = t[ge];
|
|
5887
5949
|
if (n) {
|
|
5888
5950
|
if (n.host === null)
|
|
5889
5951
|
return n.mountPromise.catch(() => {
|
|
5890
5952
|
const s = t[ge];
|
|
5891
|
-
return s ? s.mountPromise :
|
|
5953
|
+
return s ? s.mountPromise : Fo(e);
|
|
5892
5954
|
});
|
|
5893
|
-
if (
|
|
5955
|
+
if (Wr(n.host))
|
|
5894
5956
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
5895
5957
|
n.destroy?.(), delete t[ge];
|
|
5896
5958
|
}
|
|
5897
|
-
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ?
|
|
5959
|
+
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Mr(i) : null;
|
|
5898
5960
|
let l;
|
|
5899
|
-
const p =
|
|
5961
|
+
const p = da({
|
|
5900
5962
|
token: e.dataset.plunoToken,
|
|
5901
5963
|
tokenProvider: r?.loadToken,
|
|
5902
5964
|
tokenEndpoint: i,
|
|
5903
5965
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
5904
|
-
webSocketFactory: o ?
|
|
5966
|
+
webSocketFactory: o ? sa(o) : void 0,
|
|
5905
5967
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
5906
5968
|
accentColor: e.dataset.plunoAccentColor,
|
|
5907
5969
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5913,8 +5975,8 @@ function Uo(e) {
|
|
|
5913
5975
|
s.destroy();
|
|
5914
5976
|
return;
|
|
5915
5977
|
}
|
|
5916
|
-
const
|
|
5917
|
-
|
|
5978
|
+
const u = s.host;
|
|
5979
|
+
u.setAttribute(mo, "true"), l.host = u, l.destroy = () => {
|
|
5918
5980
|
t[ge] === l && delete t[ge], l.host = null, l.destroy = null, s.destroy();
|
|
5919
5981
|
};
|
|
5920
5982
|
}).catch((s) => {
|
|
@@ -5927,11 +5989,11 @@ function Uo(e) {
|
|
|
5927
5989
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
5928
5990
|
}, t[ge] = l, p;
|
|
5929
5991
|
}
|
|
5930
|
-
function
|
|
5931
|
-
return e.isConnected && e.getAttribute(
|
|
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");
|
|
5932
5994
|
}
|
|
5933
|
-
|
|
5995
|
+
Hr(import.meta.url);
|
|
5934
5996
|
export {
|
|
5935
|
-
|
|
5936
|
-
|
|
5997
|
+
sa as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5998
|
+
da as mountPlunoProductAgentWidget
|
|
5937
5999
|
};
|