@pluno/product-agent-web 0.1.184 → 0.1.185
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/index.d.ts +1 -0
- package/dist/product-agent-sdk.js +328 -327
- package/dist/product-agent-widget.js +834 -833
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const Ll = "pluno-product-agent-attachments";
|
|
2
|
-
const
|
|
2
|
+
const As = "files";
|
|
3
3
|
async function Dl(t) {
|
|
4
|
-
const e = await
|
|
4
|
+
const e = await Ys();
|
|
5
5
|
await Ol(e, "readwrite", (n) => n.put(t));
|
|
6
6
|
}
|
|
7
7
|
async function Ul(t, e) {
|
|
8
|
-
const n = await
|
|
9
|
-
await
|
|
10
|
-
const s = await
|
|
8
|
+
const n = await Ys();
|
|
9
|
+
await Xs(n, "readwrite", async (i) => {
|
|
10
|
+
const s = await Js(
|
|
11
11
|
i.get(t)
|
|
12
12
|
);
|
|
13
13
|
s && i.put({
|
|
@@ -17,27 +17,27 @@ async function Ul(t, e) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async function Nl(t = 864e5) {
|
|
20
|
-
const e = await
|
|
21
|
-
await
|
|
20
|
+
const e = await Ys(), n = Date.now() - t;
|
|
21
|
+
await Xs(e, "readwrite", async (i) => {
|
|
22
22
|
const s = i.index("lastUsedAt");
|
|
23
|
-
(await
|
|
23
|
+
(await Js(s.getAllKeys(IDBKeyRange.upperBound(n)))).forEach((r) => i.delete(r));
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Ys() {
|
|
27
27
|
return typeof indexedDB > "u" ? Promise.reject(new Error("Product Agent attachment storage is unavailable")) : new Promise((t, e) => {
|
|
28
28
|
const n = indexedDB.open(Ll, 1);
|
|
29
29
|
n.onupgradeneeded = () => {
|
|
30
|
-
const s = n.result.createObjectStore(
|
|
30
|
+
const s = n.result.createObjectStore(As, { keyPath: "attachmentId" });
|
|
31
31
|
s.createIndex("lastUsedAt", "lastUsedAt", { unique: !1 }), s.createIndex("sessionId", "sessionId", { unique: !1 }), s.createIndex("origin", "origin", { unique: !1 });
|
|
32
32
|
}, n.onsuccess = () => t(n.result), n.onerror = () => e(n.error ?? new Error("Failed to open Product Agent attachment storage"));
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
async function Ol(t, e, n) {
|
|
36
|
-
return await
|
|
36
|
+
return await Xs(t, e, async (i) => await Js(n(i)));
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Xs(t, e, n) {
|
|
39
39
|
return new Promise((i, s) => {
|
|
40
|
-
const o = t.transaction(
|
|
40
|
+
const o = t.transaction(As, e), r = o.objectStore(As);
|
|
41
41
|
let l, d = !1;
|
|
42
42
|
n(r).then((c) => {
|
|
43
43
|
l = c;
|
|
@@ -57,7 +57,7 @@ function Ys(t, e, n) {
|
|
|
57
57
|
};
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Js(t) {
|
|
61
61
|
return new Promise((e, n) => {
|
|
62
62
|
t.onsuccess = () => e(t.result), t.onerror = () => n(t.error ?? new Error("Product Agent attachment storage request failed"));
|
|
63
63
|
});
|
|
@@ -65,7 +65,7 @@ function Xs(t) {
|
|
|
65
65
|
function ql(t) {
|
|
66
66
|
return t !== null && (typeof t == "object" || typeof t == "function");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function ta(t, e, n) {
|
|
69
69
|
const i = Reflect.get(t, "pluno"), s = ql(i) ? i : {};
|
|
70
70
|
if (s !== i && !Reflect.set(t, "pluno", s))
|
|
71
71
|
return null;
|
|
@@ -97,7 +97,7 @@ function Hl(t, e) {
|
|
|
97
97
|
return !1;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function na(t) {
|
|
101
101
|
let e = "", n = "", i = null;
|
|
102
102
|
for (const s of t.split(new RegExp("(?<=\\n)"))) {
|
|
103
103
|
if (i) {
|
|
@@ -108,7 +108,7 @@ function ta(t) {
|
|
|
108
108
|
}
|
|
109
109
|
const o = s.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
110
110
|
if (o) {
|
|
111
|
-
e +=
|
|
111
|
+
e += $o(n) + s, n = "", i = {
|
|
112
112
|
marker: o[1][0],
|
|
113
113
|
length: o[1].length
|
|
114
114
|
};
|
|
@@ -116,22 +116,22 @@ function ta(t) {
|
|
|
116
116
|
}
|
|
117
117
|
n += s;
|
|
118
118
|
}
|
|
119
|
-
return e +
|
|
119
|
+
return e + $o(n);
|
|
120
120
|
}
|
|
121
121
|
function $l(t) {
|
|
122
|
-
return
|
|
122
|
+
return na(t).replace(/(```|~~~)[^\n]*\n?([\s\S]*?)\1/g, "$2").replace(/!\[([^\]]*)\]\([^)\s]+\)/g, "$1").replace(/\[([^\]]+)\]\([^)\s]+\)/g, "$1").replace(/^[ \t]{0,3}(?:#{1,6}|>|[-*+]|\d+[.)])[ \t]+/gm, "").replace(/^(?:\|?[ \t]*:?-+:?[ \t]*\|)+[ \t]*$/gm, "").replace(/(\*\*|__|~~)(.*?)\1/g, "$2").replace(/([*_])(.*?)\1/g, "$2").replace(/`([^`]+)`/g, "$1").replace(/[ \t]*\n+[ \t]*/g, " ").trim();
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function $o(t) {
|
|
125
125
|
let e = "", n = 0;
|
|
126
126
|
for (const i of t.matchAll(zl)) {
|
|
127
127
|
const s = i.index ?? 0;
|
|
128
|
-
e +=
|
|
128
|
+
e += jo(
|
|
129
129
|
t.slice(n, s)
|
|
130
130
|
), e += i[0], n = s + i[0].length;
|
|
131
131
|
}
|
|
132
|
-
return e +
|
|
132
|
+
return e + jo(t.slice(n));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function jo(t) {
|
|
135
135
|
return t.replace(
|
|
136
136
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
137
137
|
(e, n, i, s, o) => o[s - 1] === "!" || jl(o, s) || Gl(o, s, n) ? e : `[${n}](${i})`
|
|
@@ -152,18 +152,18 @@ function Gl(t, e, n) {
|
|
|
152
152
|
t.slice(i, e)
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const Zs = "suggest_share_on_socials";
|
|
156
156
|
function Kl(t) {
|
|
157
157
|
for (let e = t.length - 1; e >= 0; e -= 1) {
|
|
158
158
|
const n = t[e];
|
|
159
|
-
if (n.role !== "tool" || n.toolName !==
|
|
159
|
+
if (n.role !== "tool" || n.toolName !== Zs || n.sharePromptAllowed !== void 0)
|
|
160
160
|
continue;
|
|
161
161
|
if (Yl(t, e, n.callId) !== !0)
|
|
162
162
|
return null;
|
|
163
|
-
const i =
|
|
163
|
+
const i = Go(t, e, "assistant");
|
|
164
164
|
if (!i)
|
|
165
165
|
return null;
|
|
166
|
-
const s =
|
|
166
|
+
const s = Go(t, i.index, "user");
|
|
167
167
|
return s ? {
|
|
168
168
|
id: `share:${n.callId ?? n.id}`,
|
|
169
169
|
userPrompt: s.content,
|
|
@@ -199,7 +199,7 @@ function Xl(t) {
|
|
|
199
199
|
e ^= n.charCodeAt(0), e = Math.imul(e, 16777619);
|
|
200
200
|
return (e >>> 0) % 2 === 0 ? "referral" : "social";
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function Go(t, e, n) {
|
|
203
203
|
for (let i = e - 1; i >= 0; i -= 1) {
|
|
204
204
|
const s = t[i];
|
|
205
205
|
if (s.role === n && s.content.trim())
|
|
@@ -220,33 +220,33 @@ function ed(t, e, n) {
|
|
|
220
220
|
({ identity: b }) => b.isActivity && !b.isTransient ? b.activityKeys ?? [] : []
|
|
221
221
|
)
|
|
222
222
|
), o = i.filter(
|
|
223
|
-
({ identity: b }) => !(b.isTransient && b.activityKeys?.some((
|
|
224
|
-
), r = new Map(o.map(({ item: b, identity:
|
|
223
|
+
({ identity: b }) => !(b.isTransient && b.activityKeys?.some((f) => s.has(f)))
|
|
224
|
+
), r = new Map(o.map(({ item: b, identity: f }) => [f.id, b])), l = new Map(
|
|
225
225
|
o.flatMap(
|
|
226
|
-
({ item: b, identity:
|
|
226
|
+
({ item: b, identity: f }) => f.optimisticKey ? [[f.optimisticKey, b]] : []
|
|
227
227
|
)
|
|
228
228
|
), d = new Map(
|
|
229
229
|
o.flatMap(
|
|
230
|
-
({ item: b, identity:
|
|
230
|
+
({ item: b, identity: f }) => f.assistantDraftKey ? [[f.assistantDraftKey, b]] : []
|
|
231
231
|
)
|
|
232
232
|
), c = /* @__PURE__ */ new Map();
|
|
233
|
-
for (const { item: b, identity:
|
|
234
|
-
for (const
|
|
235
|
-
const x = c.get(
|
|
236
|
-
(!x || n(x).isTransient) && c.set(
|
|
233
|
+
for (const { item: b, identity: f } of o)
|
|
234
|
+
for (const m of f.activityKeys ?? []) {
|
|
235
|
+
const x = c.get(m);
|
|
236
|
+
(!x || n(x).isTransient) && c.set(m, b);
|
|
237
237
|
}
|
|
238
238
|
const u = new Set(o.map(({ identity: b }) => b.id)), p = new Set(
|
|
239
239
|
o.flatMap(({ identity: b }) => b.runId ? [b.runId] : [])
|
|
240
240
|
), h = /* @__PURE__ */ new Set(), y = [];
|
|
241
241
|
for (const b of t) {
|
|
242
|
-
const
|
|
243
|
-
let
|
|
244
|
-
if (
|
|
245
|
-
y.push(
|
|
242
|
+
const f = n(b);
|
|
243
|
+
let m = r.get(f.id);
|
|
244
|
+
if (f.isOptimistic && f.optimisticKey ? m = l.get(f.optimisticKey) : f.isAssistantDraft && f.assistantDraftKey ? m = d.get(f.assistantDraftKey) : f.isActivity && (m = f.activityKeys?.map((_) => c.get(_)).find((_) => _ !== void 0) ?? m), m && !h.has(m)) {
|
|
245
|
+
y.push(m), h.add(m);
|
|
246
246
|
continue;
|
|
247
247
|
}
|
|
248
|
-
const x =
|
|
249
|
-
(
|
|
248
|
+
const x = f.respondsToUserMessageId !== void 0 && u.has(f.respondsToUserMessageId) || f.runId !== void 0 && p.has(f.runId);
|
|
249
|
+
(f.isOptimistic || (f.isAssistantDraft || f.isActivity) && x) && y.push(b);
|
|
250
250
|
}
|
|
251
251
|
for (const { item: b } of o)
|
|
252
252
|
h.has(b) || y.push(b);
|
|
@@ -258,11 +258,11 @@ function td(t, e, n, i) {
|
|
|
258
258
|
return !o.isActivity || !o.isTransient ? !0 : e !== null && o.respondsToUserMessageId !== void 0 ? o.respondsToUserMessageId !== e : n === null || o.runId !== n;
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
-
const
|
|
261
|
+
const ds = "pluno.productAgent.transportId", nd = "pluno.productAgent.transportIdentity", ps = "pluno.productAgent.transportIdentity.event", id = 50, sd = globalThis.setTimeout.bind(globalThis);
|
|
262
262
|
let wn = null;
|
|
263
|
-
const ci = /* @__PURE__ */ new Set(),
|
|
264
|
-
async function od(t =
|
|
265
|
-
const e = t.randomUUID(), n = t.storage.getItem(
|
|
263
|
+
const ci = /* @__PURE__ */ new Set(), cs = /* @__PURE__ */ new Map();
|
|
264
|
+
async function od(t = ia()) {
|
|
265
|
+
const e = t.randomUUID(), n = t.storage.getItem(ds);
|
|
266
266
|
let i = n ?? t.randomUUID(), s = !1, o = !1;
|
|
267
267
|
const r = t.channel.subscribe((d) => {
|
|
268
268
|
if (!(d.senderId === e || d.transportId !== i)) {
|
|
@@ -280,7 +280,7 @@ async function od(t = na()) {
|
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
if (!n)
|
|
283
|
-
t.storage.setItem(
|
|
283
|
+
t.storage.setItem(ds, i), s = !0;
|
|
284
284
|
else if (t.skipStoredIdentityCollisionCheck)
|
|
285
285
|
s = !0;
|
|
286
286
|
else
|
|
@@ -289,7 +289,7 @@ async function od(t = na()) {
|
|
|
289
289
|
s = !0;
|
|
290
290
|
break;
|
|
291
291
|
}
|
|
292
|
-
i = t.randomUUID(), t.storage.setItem(
|
|
292
|
+
i = t.randomUUID(), t.storage.setItem(ds, i);
|
|
293
293
|
}
|
|
294
294
|
let l = !1;
|
|
295
295
|
return {
|
|
@@ -301,7 +301,7 @@ async function od(t = na()) {
|
|
|
301
301
|
}
|
|
302
302
|
async function rd(t = !1) {
|
|
303
303
|
wn || (wn = od({
|
|
304
|
-
...
|
|
304
|
+
...ia(),
|
|
305
305
|
skipStoredIdentityCollisionCheck: t
|
|
306
306
|
}), wn.then((s) => {
|
|
307
307
|
const o = (r) => {
|
|
@@ -326,7 +326,7 @@ function ad() {
|
|
|
326
326
|
t += 1;
|
|
327
327
|
return t;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function ia() {
|
|
330
330
|
return {
|
|
331
331
|
storage: ld(),
|
|
332
332
|
channel: dd(),
|
|
@@ -338,13 +338,13 @@ function ld() {
|
|
|
338
338
|
return {
|
|
339
339
|
getItem: (t) => {
|
|
340
340
|
try {
|
|
341
|
-
return window.sessionStorage?.getItem(t) ??
|
|
341
|
+
return window.sessionStorage?.getItem(t) ?? cs.get(t) ?? null;
|
|
342
342
|
} catch {
|
|
343
|
-
return
|
|
343
|
+
return cs.get(t) ?? null;
|
|
344
344
|
}
|
|
345
345
|
},
|
|
346
346
|
setItem: (t, e) => {
|
|
347
|
-
|
|
347
|
+
cs.set(t, e);
|
|
348
348
|
try {
|
|
349
349
|
window.sessionStorage?.setItem(t, e);
|
|
350
350
|
} catch {
|
|
@@ -368,7 +368,7 @@ function dd() {
|
|
|
368
368
|
}
|
|
369
369
|
function pd() {
|
|
370
370
|
const t = /* @__PURE__ */ new Set(), e = (n) => {
|
|
371
|
-
if (n.key !==
|
|
371
|
+
if (n.key !== ps || !n.newValue)
|
|
372
372
|
return;
|
|
373
373
|
const i = JSON.parse(n.newValue);
|
|
374
374
|
for (const s of t)
|
|
@@ -377,9 +377,9 @@ function pd() {
|
|
|
377
377
|
return window.addEventListener("storage", e), {
|
|
378
378
|
postMessage: (n) => {
|
|
379
379
|
window.localStorage.setItem(
|
|
380
|
-
|
|
380
|
+
ps,
|
|
381
381
|
JSON.stringify({ ...n, eventId: crypto.randomUUID() })
|
|
382
|
-
), window.localStorage.removeItem(
|
|
382
|
+
), window.localStorage.removeItem(ps);
|
|
383
383
|
},
|
|
384
384
|
subscribe: (n) => (t.add(n), () => t.delete(n)),
|
|
385
385
|
close: () => {
|
|
@@ -387,7 +387,7 @@ function pd() {
|
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const sa = "schedule_follow_up", cd = [
|
|
391
391
|
"M8 2.2c3.4-.2 5.8 2.4 5.7 5.8-.1 3.5-2.5 5.8-5.8 5.8-3.4 0-5.9-2.3-5.7-5.8.1-3.3 2.3-5.5 5.8-5.8Z",
|
|
392
392
|
"M8.1 2.8c3-.1 5 2 5 5.1 0 3-2.1 5.1-5.1 5.2"
|
|
393
393
|
];
|
|
@@ -397,15 +397,15 @@ function ud(t) {
|
|
|
397
397
|
return [];
|
|
398
398
|
const n = e.getMinutes(), i = n / 60 * Math.PI * 2, s = (e.getHours() % 12 + n / 60) / 12 * Math.PI * 2;
|
|
399
399
|
return [
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
Ko(s, 2.3),
|
|
401
|
+
Ko(i, 3.2)
|
|
402
402
|
];
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
const n =
|
|
404
|
+
function Ko(t, e) {
|
|
405
|
+
const n = Vo(8 + Math.sin(t) * e), i = Vo(8 - Math.cos(t) * e);
|
|
406
406
|
return `M8 8L${n} ${i}`;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Vo(t) {
|
|
409
409
|
const e = Math.round(t * 10) / 10;
|
|
410
410
|
return String(Object.is(e, -0) ? 0 : e);
|
|
411
411
|
}
|
|
@@ -420,9 +420,9 @@ function gd(t) {
|
|
|
420
420
|
if (!e || typeof e != "object")
|
|
421
421
|
return null;
|
|
422
422
|
const n = e;
|
|
423
|
-
return n.ok !== !0 || n.toolName !==
|
|
423
|
+
return n.ok !== !0 || n.toolName !== sa || typeof n.dueAt != "string" || Number.isNaN(Date.parse(n.dueAt)) ? null : n.dueAt;
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function yi(t, e = /* @__PURE__ */ new Date()) {
|
|
426
426
|
const n = new Date(t), i = n.getTime() - e.getTime();
|
|
427
427
|
if (!Number.isFinite(i) || i <= 0)
|
|
428
428
|
return null;
|
|
@@ -444,32 +444,32 @@ function bi(t, e = /* @__PURE__ */ new Date()) {
|
|
|
444
444
|
})} ${o}`;
|
|
445
445
|
}
|
|
446
446
|
function hd(t, e = /* @__PURE__ */ new Date()) {
|
|
447
|
-
const n =
|
|
447
|
+
const n = yi(t, e), i = Date.parse(t) - e.getTime();
|
|
448
448
|
if (!n || !Number.isFinite(i) || i <= 0)
|
|
449
449
|
return null;
|
|
450
450
|
let s = 1, o = 0, r = Math.ceil(i);
|
|
451
451
|
for (; s < r; ) {
|
|
452
452
|
const l = Math.floor((s + r) / 2);
|
|
453
|
-
|
|
453
|
+
yi(
|
|
454
454
|
t,
|
|
455
455
|
new Date(e.getTime() + l)
|
|
456
456
|
) === n ? (o = l, s = l + 1) : r = l;
|
|
457
457
|
}
|
|
458
458
|
return Math.max(1, o + 1);
|
|
459
459
|
}
|
|
460
|
-
const
|
|
460
|
+
const _i = [
|
|
461
461
|
{ value: "gpt-5.6-sol", label: "gpt-5.6-sol" },
|
|
462
462
|
{ value: "anthropic/claude-sonnet-5", label: "Claude Sonnet 5" },
|
|
463
463
|
{ value: "deepseek/deepseek-v4-flash", label: "DeepSeek V4 Flash" }
|
|
464
|
-
],
|
|
464
|
+
], oa = [
|
|
465
465
|
{ value: "anthropic/claude-opus-5", label: "Claude Opus 5" },
|
|
466
466
|
{ value: "gpt-5.6-terra", label: "gpt-5.6-terra" }
|
|
467
467
|
], ui = [
|
|
468
|
-
...
|
|
469
|
-
...
|
|
470
|
-
],
|
|
468
|
+
..._i,
|
|
469
|
+
...oa
|
|
470
|
+
], gi = (t) => ui.some((e) => e.value === t), fd = globalThis.fetch.bind(globalThis), Ms = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', md = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', wd = ".pluno-pa-widget__panel", bd = ".pluno-pa-widget__timeline", Yo = `${Ms}[data-pluno-sdk-preview-channel]`;
|
|
471
471
|
let yd = 0;
|
|
472
|
-
function
|
|
472
|
+
function Xo(t) {
|
|
473
473
|
const e = {};
|
|
474
474
|
for (const r of [
|
|
475
475
|
"type",
|
|
@@ -507,7 +507,7 @@ function Yo(t) {
|
|
|
507
507
|
}
|
|
508
508
|
return e;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function us(t, e, n) {
|
|
511
511
|
if (typeof window > "u")
|
|
512
512
|
return;
|
|
513
513
|
const i = window.__PLUNO_PRODUCT_AGENT_TRACE_ID__;
|
|
@@ -531,22 +531,22 @@ class ii extends Error {
|
|
|
531
531
|
function _d(t) {
|
|
532
532
|
return t === 408 || t === 425 || t === 429 || t >= 500;
|
|
533
533
|
}
|
|
534
|
-
const Sd = "https://app.pluno.ai", vd = 2e4, xd = 1e4, Id = 1e4, Td = 1e4, Cd = 1e4, kd = 3e3, Ed = 3e4, Ad = 1e3,
|
|
534
|
+
const Sd = "https://app.pluno.ai", vd = 2e4, xd = 1e4, Id = 1e4, Td = 1e4, Cd = 1e4, kd = 3e3, Ed = 3e4, Ad = 1e3, Jo = 3e4, Zo = 0.2, Qo = 6e4, er = 15e3, bn = 8, tr = "Browser connection was interrupted.", nr = 15e3, Md = "Pluno could not send this message. Try it again.", ir = 2e3, Pd = 1e3, Rd = 100, sr = 8e3, or = 3, Ld = [300, 1e3], ra = 50 * 1024 * 1024, Dd = /* @__PURE__ */ new Set([
|
|
535
535
|
".jpeg:image/jpeg",
|
|
536
536
|
".jpg:image/jpeg",
|
|
537
537
|
".pdf:application/pdf",
|
|
538
538
|
".png:image/png",
|
|
539
539
|
".webp:image/webp"
|
|
540
|
-
]), Ud = ".pdf,.png,.jpg,.jpeg,.webp",
|
|
540
|
+
]), Ud = ".pdf,.png,.jpg,.jpeg,.webp", Qs = 64e3, gs = 4e3, eo = 30, Nd = 2e3, Od = 1e3, aa = "Image is too large for model vision input.", qd = 100, la = "pluno.productAgent.state.", Ps = "pluno.productAgent.pendingEvents.", Ri = "pluno.productAgent.activeToolCalls.", zd = 100;
|
|
541
541
|
function yn(t, e = 0) {
|
|
542
542
|
const n = t === 0 ? 0 : Math.min(3e4, 1e3 * 2 ** (t - 1));
|
|
543
543
|
return Math.max(e, n);
|
|
544
544
|
}
|
|
545
|
-
const
|
|
545
|
+
const hi = /* @__PURE__ */ new Set();
|
|
546
546
|
let si = null;
|
|
547
547
|
function Bd(t, e = Math.random) {
|
|
548
|
-
const n = Math.min(
|
|
549
|
-
return Math.min(
|
|
548
|
+
const n = Math.min(Jo, Ad * 2 ** t), i = 1 - Zo + e() * Zo * 2;
|
|
549
|
+
return Math.min(Jo, Math.round(n * i));
|
|
550
550
|
}
|
|
551
551
|
function Wd(t, e, n) {
|
|
552
552
|
return new Promise((i, s) => {
|
|
@@ -561,9 +561,9 @@ function Wd(t, e, n) {
|
|
|
561
561
|
);
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
-
class
|
|
564
|
+
class to {
|
|
565
565
|
constructor(e, n) {
|
|
566
|
-
this.options = e, this.transportIdentity = n, this.state = {
|
|
566
|
+
this.options = e, this.transportIdentity = n, this.personalModelSelectionOverride = e.productVariant === "personal" && gi(e.model) ? e.model : null, this.state = {
|
|
567
567
|
...this.state,
|
|
568
568
|
starterPrompts: yp(e.initialStarterPrompts)
|
|
569
569
|
};
|
|
@@ -590,7 +590,7 @@ class eo {
|
|
|
590
590
|
lastError: null
|
|
591
591
|
}), this.queuedClientEvents = bc(
|
|
592
592
|
hc(e.clientId),
|
|
593
|
-
|
|
593
|
+
fc(e.clientId)
|
|
594
594
|
);
|
|
595
595
|
const s = [...this.queuedClientEvents].reverse().find(
|
|
596
596
|
(o) => o.type === "chat.user_message" && typeof o.clientMessageId == "string"
|
|
@@ -649,6 +649,7 @@ class eo {
|
|
|
649
649
|
pendingClientMessageId = null;
|
|
650
650
|
pendingUserMessageEvent = null;
|
|
651
651
|
failedUserMessageEvent = null;
|
|
652
|
+
personalModelSelectionOverride = null;
|
|
652
653
|
activeClientMessageId = null;
|
|
653
654
|
activeResponseUserMessageId = null;
|
|
654
655
|
activeResponseRunId = null;
|
|
@@ -697,7 +698,7 @@ class eo {
|
|
|
697
698
|
static async init(e) {
|
|
698
699
|
const n = e, i = await rd(
|
|
699
700
|
n.skipStoredTransportIdentityCollisionCheck === !0
|
|
700
|
-
), s = new
|
|
701
|
+
), s = new to({
|
|
701
702
|
...e,
|
|
702
703
|
backendUrl: op(e.backendUrl ?? Sd),
|
|
703
704
|
clientId: e.clientId ?? Ip(),
|
|
@@ -841,7 +842,7 @@ class eo {
|
|
|
841
842
|
0
|
|
842
843
|
) > ra))
|
|
843
844
|
throw new Error("Embedded attachments must total at most 50 MB per message");
|
|
844
|
-
let o = s.map(
|
|
845
|
+
let o = s.map(xi);
|
|
845
846
|
if (!i && o.length === 0)
|
|
846
847
|
return null;
|
|
847
848
|
if (this.pendingClientMessageId)
|
|
@@ -852,7 +853,7 @@ class eo {
|
|
|
852
853
|
content: i,
|
|
853
854
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
854
855
|
...s.length > 0 ? { attachments: s } : {}
|
|
855
|
-
}, c = this.state.messages.some((T) => T.id === d.id || T.clientMessageId === l), u = this.state.isThinking, p = this.state.taskStatus, h = this.state.pendingMessageStatus, y = this.state.turnPhase, b = this.state.messages,
|
|
856
|
+
}, c = this.state.messages.some((T) => T.id === d.id || T.clientMessageId === l), u = this.state.isThinking, p = this.state.taskStatus, h = this.state.pendingMessageStatus, y = this.state.turnPhase, b = this.state.messages, f = c ? this.state.messages : [...this.state.messages, d], m = {
|
|
856
857
|
assistantDraft: this.state.assistantDraft,
|
|
857
858
|
assistantDraftItemId: this.state.assistantDraftItemId,
|
|
858
859
|
assistantDraftPhase: this.state.assistantDraftPhase,
|
|
@@ -861,7 +862,7 @@ class eo {
|
|
|
861
862
|
lastError: this.state.lastError
|
|
862
863
|
};
|
|
863
864
|
this.setState({
|
|
864
|
-
messages:
|
|
865
|
+
messages: f,
|
|
865
866
|
...u ? {} : {
|
|
866
867
|
assistantDraft: "",
|
|
867
868
|
assistantDraftItemId: null,
|
|
@@ -892,7 +893,7 @@ class eo {
|
|
|
892
893
|
} catch (T) {
|
|
893
894
|
throw this.setState({
|
|
894
895
|
...c ? {} : { messages: b },
|
|
895
|
-
...u ? {} : { ...
|
|
896
|
+
...u ? {} : { ...m, isThinking: !1 },
|
|
896
897
|
pendingMessageStatus: h,
|
|
897
898
|
turnPhase: y,
|
|
898
899
|
taskStatus: p
|
|
@@ -907,11 +908,11 @@ class eo {
|
|
|
907
908
|
invocation: ap(n.invocation ?? n.initiatedBy),
|
|
908
909
|
entrySurface: this.options.entrySurface,
|
|
909
910
|
content: i,
|
|
910
|
-
pageContent: x &&
|
|
911
|
-
attachments: o.length > 0 ? o.map(
|
|
911
|
+
pageContent: x && no() || void 0,
|
|
912
|
+
attachments: o.length > 0 ? o.map(xi) : void 0,
|
|
912
913
|
page: r,
|
|
913
914
|
model: this.options.model,
|
|
914
|
-
metadata:
|
|
915
|
+
metadata: rr(this.options.metadata)
|
|
915
916
|
};
|
|
916
917
|
return n.initiatedBy || (this.lastUserMessagePageUrl = r.url), this.pendingClientMessageId = l, this.pendingUserMessageEvent = _, this.send(_), this.schedulePendingDeliveryAck(l), l;
|
|
917
918
|
}
|
|
@@ -919,7 +920,7 @@ class eo {
|
|
|
919
920
|
return this.options.model;
|
|
920
921
|
}
|
|
921
922
|
setModel(e) {
|
|
922
|
-
this.options.model = e;
|
|
923
|
+
this.options.model = e, this.options.productVariant === "personal" && gi(e) && (this.personalModelSelectionOverride = e);
|
|
923
924
|
}
|
|
924
925
|
retryLastMessage() {
|
|
925
926
|
const e = this.state.sessionId, n = this.retryableClientMessageId;
|
|
@@ -941,7 +942,7 @@ class eo {
|
|
|
941
942
|
const n = tt(), i = {
|
|
942
943
|
id: n,
|
|
943
944
|
name: e.name || "attachment",
|
|
944
|
-
mimeType:
|
|
945
|
+
mimeType: Ns(e),
|
|
945
946
|
sizeBytes: e.size
|
|
946
947
|
};
|
|
947
948
|
this.attachmentFiles.set(n, e);
|
|
@@ -975,7 +976,7 @@ class eo {
|
|
|
975
976
|
file: e,
|
|
976
977
|
attachment: n
|
|
977
978
|
}) {
|
|
978
|
-
const i = this.state.sessionId, s =
|
|
979
|
+
const i = this.state.sessionId, s = Ns(e), o = {
|
|
979
980
|
sessionId: i ?? void 0,
|
|
980
981
|
attachmentId: n.id,
|
|
981
982
|
clientId: this.options.clientId,
|
|
@@ -985,7 +986,7 @@ class eo {
|
|
|
985
986
|
sizeBytes: e.size,
|
|
986
987
|
page: we(),
|
|
987
988
|
model: this.options.model,
|
|
988
|
-
metadata:
|
|
989
|
+
metadata: rr(this.options.metadata),
|
|
989
990
|
entrySurface: this.options.entrySurface
|
|
990
991
|
};
|
|
991
992
|
let r;
|
|
@@ -1091,8 +1092,8 @@ class eo {
|
|
|
1091
1092
|
}), this.stoppedTurns.splice(0, Math.max(0, this.stoppedTurns.length - 20));
|
|
1092
1093
|
for (const [n, i] of this.activeBrowserToolCalls)
|
|
1093
1094
|
i.event.sessionId === this.state.sessionId && this.activeBrowserToolCalls.delete(n);
|
|
1094
|
-
|
|
1095
|
-
messages:
|
|
1095
|
+
wr(this.options.clientId, this.activeBrowserToolCalls.values()), this.setState({
|
|
1096
|
+
messages: fr(
|
|
1096
1097
|
this.state.messages,
|
|
1097
1098
|
e.clientMessageId,
|
|
1098
1099
|
e.runId
|
|
@@ -1108,7 +1109,7 @@ class eo {
|
|
|
1108
1109
|
}
|
|
1109
1110
|
startNewSession(e = {}) {
|
|
1110
1111
|
const n = e.notifyTransport !== !1, i = this.activeComposerWarmupId;
|
|
1111
|
-
!this.options.keepRunsActiveOnSessionNavigation && n && this.state.sessionId && (this.state.isThinking || this.state.pendingMessageStatus !== null) && this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "new_chat" }), this.rememberCurrentRunAsBackground(), this.clearPendingComposerWarmup(), this.cleanupSessionBrowserApis(), this.queuedClientEvents = this.queuedClientEvents.filter((s) => s.type !== "chat.user_message"), this.clearThinkingWatchdog(), this.clearPendingDeliveryTimers(), this.pendingClientMessageId = null, this.pendingUserMessageEvent = null, this.failedUserMessageEvent = null, this.retryableClientMessageId = null, this.lastUserMessagePageUrl = null, this.clearSessionLoadRequest(), this.sessionActivityRequestId = null, this.retryAttemptsByClientMessageId = {}, this.thinkingWatchdogResyncAttemptsByClientMessageId = {}, this.nonTranscriptToolCallIds.clear(), this.options.productVariant === "personal" && (this.options.model = void 0), n && this.send({
|
|
1112
|
+
!this.options.keepRunsActiveOnSessionNavigation && n && this.state.sessionId && (this.state.isThinking || this.state.pendingMessageStatus !== null) && this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "new_chat" }), this.rememberCurrentRunAsBackground(), this.clearPendingComposerWarmup(), this.cleanupSessionBrowserApis(), this.queuedClientEvents = this.queuedClientEvents.filter((s) => s.type !== "chat.user_message"), this.clearThinkingWatchdog(), this.clearPendingDeliveryTimers(), this.pendingClientMessageId = null, this.pendingUserMessageEvent = null, this.failedUserMessageEvent = null, this.retryableClientMessageId = null, this.lastUserMessagePageUrl = null, this.clearSessionLoadRequest(), this.sessionActivityRequestId = null, this.retryAttemptsByClientMessageId = {}, this.thinkingWatchdogResyncAttemptsByClientMessageId = {}, this.nonTranscriptToolCallIds.clear(), this.options.productVariant === "personal" && (this.personalModelSelectionOverride = null, this.options.model = void 0), n && this.send({
|
|
1112
1113
|
type: "session.reset",
|
|
1113
1114
|
sessionId: this.state.sessionId ?? void 0,
|
|
1114
1115
|
warmupId: i ?? void 0,
|
|
@@ -1134,7 +1135,7 @@ class eo {
|
|
|
1134
1135
|
const n = tt(), i = new Promise((o, r) => {
|
|
1135
1136
|
const l = window.setTimeout(() => {
|
|
1136
1137
|
this.pendingSessionHistoryRequests.delete(n), r(new Error("Session history did not respond in time"));
|
|
1137
|
-
},
|
|
1138
|
+
}, sr);
|
|
1138
1139
|
this.pendingSessionHistoryRequests.set(n, { resolve: o, reject: r, timeout: l });
|
|
1139
1140
|
}), s = {
|
|
1140
1141
|
type: "sessions.list",
|
|
@@ -1170,7 +1171,7 @@ class eo {
|
|
|
1170
1171
|
type: "session.reset",
|
|
1171
1172
|
warmupId: i,
|
|
1172
1173
|
page: we()
|
|
1173
|
-
}), this.clearThinkingWatchdog(), this.clearPendingDeliveryTimers(), this.pendingClientMessageId = null, this.pendingUserMessageEvent = null, this.failedUserMessageEvent = null, this.lastUserMessagePageUrl = null, this.clearSessionLoadRequest(), this.sessionLoadRequestId = n, this.sessionActivityRequestId = null, this.setState({
|
|
1174
|
+
}), this.clearThinkingWatchdog(), this.clearPendingDeliveryTimers(), this.pendingClientMessageId = null, this.pendingUserMessageEvent = null, this.failedUserMessageEvent = null, this.lastUserMessagePageUrl = null, this.options.productVariant === "personal" && this.state.sessionId !== e && (this.personalModelSelectionOverride = null, this.options.model = void 0), this.clearSessionLoadRequest(), this.sessionLoadRequestId = n, this.sessionActivityRequestId = null, this.setState({
|
|
1174
1175
|
sessionId: e,
|
|
1175
1176
|
messages: [],
|
|
1176
1177
|
isLoadingSession: !0,
|
|
@@ -1339,7 +1340,7 @@ class eo {
|
|
|
1339
1340
|
return !1;
|
|
1340
1341
|
const n = this.socket;
|
|
1341
1342
|
try {
|
|
1342
|
-
return n.send(JSON.stringify(e)),
|
|
1343
|
+
return n.send(JSON.stringify(e)), us("client_event", e.type, Xo(e)), !0;
|
|
1343
1344
|
} catch (i) {
|
|
1344
1345
|
return J("web-sdk.agent", "Pluno socket send failed; scheduling reconnect", {
|
|
1345
1346
|
message: i instanceof Error ? i.message : String(i),
|
|
@@ -1468,7 +1469,7 @@ class eo {
|
|
|
1468
1469
|
);
|
|
1469
1470
|
}
|
|
1470
1471
|
rememberDurablyStoppedTurn(e, n, i) {
|
|
1471
|
-
if (!e || !n || !
|
|
1472
|
+
if (!e || !n || !fi(n) || this.findStoppedTurn(e, n))
|
|
1472
1473
|
return;
|
|
1473
1474
|
const s = Fe(n), o = ae(n), r = typeof n.clientMessageId == "string" ? n.clientMessageId : s ? this.clientMessageIdsByUserMessageItemId.get(s) ?? null : null;
|
|
1474
1475
|
this.stoppedTurns.push({
|
|
@@ -1490,12 +1491,12 @@ class eo {
|
|
|
1490
1491
|
const i = typeof e.callId == "string" ? e.callId : null;
|
|
1491
1492
|
return !!(i && this.stoppedTurns.some((s) => s.toolCallIds.has(i)));
|
|
1492
1493
|
}
|
|
1493
|
-
return this.findStoppedTurnForEvent(e) ? e.type === "session.item" ? !
|
|
1494
|
+
return this.findStoppedTurnForEvent(e) ? e.type === "session.item" ? !fi(ve(e.item)) : e.type !== "conversation.state" : !1;
|
|
1494
1495
|
}
|
|
1495
1496
|
filterStoppedSnapshotItems(e, n) {
|
|
1496
1497
|
return e.filter((i) => {
|
|
1497
1498
|
const s = ve(i), o = s ? this.findStoppedTurn(n, s) : null;
|
|
1498
|
-
if (!o || s?.type === "message" && s.role === "user" ||
|
|
1499
|
+
if (!o || s?.type === "message" && s.role === "user" || fi(s))
|
|
1499
1500
|
return !0;
|
|
1500
1501
|
if (o.stoppedCausalSequence !== null) {
|
|
1501
1502
|
const r = s ? Me(s) : null;
|
|
@@ -1509,7 +1510,7 @@ class eo {
|
|
|
1509
1510
|
});
|
|
1510
1511
|
}
|
|
1511
1512
|
handleServerEvent(e) {
|
|
1512
|
-
if (
|
|
1513
|
+
if (us("server_event", e.type, Xo(e)), e.type === "session.subscribed") {
|
|
1513
1514
|
const n = typeof e.requestId == "string" ? e.requestId : null, i = typeof e.sessionId == "string" ? e.sessionId : null;
|
|
1514
1515
|
if (n && i && n === this.pendingSessionSubscription?.requestId && i === this.pendingSessionSubscription.sessionId) {
|
|
1515
1516
|
const s = this.pendingSessionSubscription;
|
|
@@ -1522,7 +1523,7 @@ class eo {
|
|
|
1522
1523
|
this.pendingSessionSubscription = null, n.resolve(!1), i && (this.sessionHistoryHydration = null, this.handleServerEvent({ ...e, requestId: i.requestId }));
|
|
1523
1524
|
return;
|
|
1524
1525
|
}
|
|
1525
|
-
if (this.sessionHistoryHydration &&
|
|
1526
|
+
if (this.sessionHistoryHydration && ar(e) && _n(e) === this.sessionHistoryHydration.sessionId) {
|
|
1526
1527
|
this.sessionHistoryHydration.bufferedEvents.push(e);
|
|
1527
1528
|
return;
|
|
1528
1529
|
}
|
|
@@ -1575,7 +1576,7 @@ class eo {
|
|
|
1575
1576
|
rawAppearance: e.appearance,
|
|
1576
1577
|
normalizedAppearance: i
|
|
1577
1578
|
}), this.runtimeHelperJavascript = Sp(e.runtimeHelpers)?.javascript ?? null;
|
|
1578
|
-
const o =
|
|
1579
|
+
const o = pr(e, "starterPrompts"), r = Object.prototype.hasOwnProperty.call(e, "starterPrompts"), l = e.starterPromptsLoading === !0, d = {
|
|
1579
1580
|
user: n,
|
|
1580
1581
|
status: "connected",
|
|
1581
1582
|
...this.state.lastErrorCode === "connection_failed" ? { lastError: null, lastErrorCode: null } : {}
|
|
@@ -1590,7 +1591,7 @@ class eo {
|
|
|
1590
1591
|
}
|
|
1591
1592
|
if (e.type === "starterPrompts.updated") {
|
|
1592
1593
|
this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !0, this.setState({
|
|
1593
|
-
starterPrompts:
|
|
1594
|
+
starterPrompts: pr(e, "starterPrompts"),
|
|
1594
1595
|
starterPromptsLoading: !1
|
|
1595
1596
|
});
|
|
1596
1597
|
return;
|
|
@@ -1612,14 +1613,14 @@ class eo {
|
|
|
1612
1613
|
runId: d?.runId
|
|
1613
1614
|
}), u = this.filterStoppedSnapshotItems(n, i), p = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, h = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, y = e.isRetrying === !0, b = e.turnPhase === "sending" || e.turnPhase === "starting" || e.turnPhase === "thinking" ? e.turnPhase : null;
|
|
1614
1615
|
p && h && (this.pendingClientMessageId = h);
|
|
1615
|
-
let
|
|
1616
|
+
let f = Lp(
|
|
1616
1617
|
e.assistantDraft
|
|
1617
1618
|
);
|
|
1618
|
-
|
|
1619
|
-
respondsToUserMessageId:
|
|
1620
|
-
runId:
|
|
1621
|
-
}) && (
|
|
1622
|
-
const
|
|
1619
|
+
f && this.findStoppedTurn(i, {
|
|
1620
|
+
respondsToUserMessageId: f.respondsToUserMessageId,
|
|
1621
|
+
runId: f.runId
|
|
1622
|
+
}) && (f = void 0);
|
|
1623
|
+
const m = f !== void 0;
|
|
1623
1624
|
this.rememberUserMessageClientMessageIds(u);
|
|
1624
1625
|
const x = Xp(u);
|
|
1625
1626
|
if (x) {
|
|
@@ -1631,12 +1632,12 @@ class eo {
|
|
|
1631
1632
|
}
|
|
1632
1633
|
const _ = u.filter((X) => {
|
|
1633
1634
|
const F = ve(X);
|
|
1634
|
-
return
|
|
1635
|
-
}), R =
|
|
1635
|
+
return gr(F) ? !1 : !F || !x || !vi(F) ? !0 : Ds(u, F) !== x;
|
|
1636
|
+
}), R = fa(
|
|
1636
1637
|
this.state.messages,
|
|
1637
|
-
|
|
1638
|
-
), L =
|
|
1639
|
-
(X, F) =>
|
|
1638
|
+
cr(_, this.options.backendUrl)
|
|
1639
|
+
), L = ur(R), B = m ? f?.content ?? "" : this.state.assistantDraft, $ = m ? f?.itemId ?? null : this.state.assistantDraftItemId, q = m ? f?.respondsToUserMessageId ?? null : this.state.assistantDraftRespondsToUserMessageId, W = m ? f?.runId ?? null : this.state.assistantDraftRunId, Q = u.some(
|
|
1640
|
+
(X, F) => hr(
|
|
1640
1641
|
ve(X),
|
|
1641
1642
|
B,
|
|
1642
1643
|
$,
|
|
@@ -1644,11 +1645,11 @@ class eo {
|
|
|
1644
1645
|
W,
|
|
1645
1646
|
Zp(u, F)
|
|
1646
1647
|
)
|
|
1647
|
-
), ne =
|
|
1648
|
+
), ne = m ? f?.content ?? "" : this.state.assistantDraft, K = !!f?.content && !Q, pe = L && (!ne || Q), ie = Kp(R), C = pe && ie ? "completed" : c ? "stopped" : pe ? "failed" : null;
|
|
1648
1649
|
if (!L && Yp(this.state.messages, u))
|
|
1649
1650
|
return;
|
|
1650
1651
|
this.lastUserMessagePageUrl = Vp(u);
|
|
1651
|
-
const M = pe || c ? null :
|
|
1652
|
+
const M = pe || c ? null : Ls(u);
|
|
1652
1653
|
if (this.latestRecoverableClientMessageId = M, ie && this.clearRetryTimers(), this.setState({
|
|
1653
1654
|
sessionId: Z(e.session, "id") ?? this.state.sessionId,
|
|
1654
1655
|
messages: R,
|
|
@@ -1663,12 +1664,12 @@ class eo {
|
|
|
1663
1664
|
assistantDraftPhase: null,
|
|
1664
1665
|
assistantDraftRespondsToUserMessageId: null,
|
|
1665
1666
|
assistantDraftRunId: null
|
|
1666
|
-
} :
|
|
1667
|
-
assistantDraft:
|
|
1668
|
-
assistantDraftItemId:
|
|
1669
|
-
assistantDraftPhase:
|
|
1670
|
-
assistantDraftRespondsToUserMessageId:
|
|
1671
|
-
assistantDraftRunId:
|
|
1667
|
+
} : m ? {
|
|
1668
|
+
assistantDraft: f?.content ?? "",
|
|
1669
|
+
assistantDraftItemId: f?.itemId ?? null,
|
|
1670
|
+
assistantDraftPhase: f?.phase ?? null,
|
|
1671
|
+
assistantDraftRespondsToUserMessageId: f?.respondsToUserMessageId ?? null,
|
|
1672
|
+
assistantDraftRunId: f?.runId ?? null
|
|
1672
1673
|
} : {},
|
|
1673
1674
|
...K ? {
|
|
1674
1675
|
isThinking: !0,
|
|
@@ -1708,7 +1709,7 @@ class eo {
|
|
|
1708
1709
|
const n = typeof e.requestId == "string" ? e.requestId : null, i = typeof e.sessionId == "string" ? e.sessionId : null;
|
|
1709
1710
|
if (!n || i !== this.state.sessionId)
|
|
1710
1711
|
return;
|
|
1711
|
-
const s =
|
|
1712
|
+
const s = cr(
|
|
1712
1713
|
Array.isArray(e.items) ? e.items : [],
|
|
1713
1714
|
this.options.backendUrl
|
|
1714
1715
|
);
|
|
@@ -1747,7 +1748,7 @@ class eo {
|
|
|
1747
1748
|
if (e.type === "session.item") {
|
|
1748
1749
|
this.rememberUserMessageClientMessageIds([e.item]);
|
|
1749
1750
|
const n = ve(e.item);
|
|
1750
|
-
if (
|
|
1751
|
+
if (vi(n)) {
|
|
1751
1752
|
typeof n?.runId == "string" && this.retryableFailureRunIdsAwaitingDone.add(n.runId);
|
|
1752
1753
|
const s = Z(e.item, "sessionId") ?? this.state.sessionId, o = n ? Fe(n) : null, r = o ? this.clientMessageIdsByUserMessageItemId.get(o) : null, l = typeof n?.clientMessageId == "string" ? n.clientMessageId : r ?? (o ? null : this.activeClientMessageId ?? this.latestRecoverableClientMessageId);
|
|
1753
1754
|
if (s && l) {
|
|
@@ -1759,13 +1760,13 @@ class eo {
|
|
|
1759
1760
|
return;
|
|
1760
1761
|
}
|
|
1761
1762
|
}
|
|
1762
|
-
if (
|
|
1763
|
+
if (gr(n))
|
|
1763
1764
|
return;
|
|
1764
1765
|
const i = ha(e.item, this.options.backendUrl);
|
|
1765
1766
|
if (i) {
|
|
1766
1767
|
const s = ic(n, i), o = i.callId ? this.pendingToolLoadingByCallId.get(i.callId) : void 0;
|
|
1767
1768
|
i.callId && o !== void 0 && (i.loading = o, this.pendingToolLoadingByCallId.delete(i.callId)), rt(i) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()), ec(n) && this.clearRunAckResyncRetryTimer();
|
|
1768
|
-
const r =
|
|
1769
|
+
const r = Rs(this.state.messages, i), l = ur(r), d = hr(
|
|
1769
1770
|
n,
|
|
1770
1771
|
this.state.assistantDraft,
|
|
1771
1772
|
this.state.assistantDraftItemId,
|
|
@@ -1775,7 +1776,7 @@ class eo {
|
|
|
1775
1776
|
r,
|
|
1776
1777
|
r.findIndex((p) => p.id === i.id)
|
|
1777
1778
|
)
|
|
1778
|
-
), c = l && (!this.state.assistantDraft || d), u =
|
|
1779
|
+
), c = l && (!this.state.assistantDraft || d), u = Si(i) && (c || rt(i) && !this.state.isThinking && this.activeClientMessageId === null);
|
|
1779
1780
|
this.setState({
|
|
1780
1781
|
messages: r,
|
|
1781
1782
|
...d ? {
|
|
@@ -1804,7 +1805,7 @@ class eo {
|
|
|
1804
1805
|
this.clearRunAckResyncRetryTimer();
|
|
1805
1806
|
const n = typeof e.delta == "string" ? e.delta : "", i = typeof e.itemId == "string" ? e.itemId : null, s = i !== null && this.state.assistantDraftItemId !== i, o = `${s ? "" : this.state.assistantDraft}${n}`, r = i ?? this.state.assistantDraftItemId ?? "assistant-draft", l = this.state.messages.find((p) => p.id === r), d = e.phase === "commentary" || e.phase === "final_answer" ? e.phase : s ? null : this.state.assistantDraftPhase, c = typeof e.respondsToUserMessageId == "string" ? e.respondsToUserMessageId : this.state.assistantDraftRespondsToUserMessageId, u = typeof e.runId == "string" ? e.runId : this.state.assistantDraftRunId;
|
|
1806
1807
|
this.activeClientMessageId && (this.activeResponseUserMessageId = c, this.activeResponseRunId = u), this.setState({
|
|
1807
|
-
messages:
|
|
1808
|
+
messages: Rs(this.state.messages, {
|
|
1808
1809
|
id: r,
|
|
1809
1810
|
role: "assistant",
|
|
1810
1811
|
content: o,
|
|
@@ -1843,7 +1844,7 @@ class eo {
|
|
|
1843
1844
|
),
|
|
1844
1845
|
i,
|
|
1845
1846
|
s,
|
|
1846
|
-
|
|
1847
|
+
ma
|
|
1847
1848
|
);
|
|
1848
1849
|
this.setState({
|
|
1849
1850
|
sessionId: n,
|
|
@@ -1935,7 +1936,7 @@ class eo {
|
|
|
1935
1936
|
r && s && o && (this.retryableClientMessageId = o);
|
|
1936
1937
|
const l = new Error(typeof e.message == "string" ? e.message : "Pluno error"), d = da(l.message);
|
|
1937
1938
|
d && console.error(d);
|
|
1938
|
-
const c = o ?? this.activeClientMessageId, u = typeof e.runId == "string" ? e.runId : null, p =
|
|
1939
|
+
const c = o ?? this.activeClientMessageId, u = typeof e.runId == "string" ? e.runId : null, p = fr(
|
|
1939
1940
|
this.state.messages,
|
|
1940
1941
|
c,
|
|
1941
1942
|
u
|
|
@@ -1964,13 +1965,13 @@ class eo {
|
|
|
1964
1965
|
}
|
|
1965
1966
|
}
|
|
1966
1967
|
updatePersonalModelFromSession(e) {
|
|
1967
|
-
if (this.options.productVariant !== "personal" || !e || typeof e != "object")
|
|
1968
|
+
if (this.options.productVariant !== "personal" || !e || typeof e != "object" || this.personalModelSelectionOverride !== null)
|
|
1968
1969
|
return;
|
|
1969
1970
|
const n = e.metadata, i = n && typeof n == "object" ? n.model : void 0;
|
|
1970
|
-
this.options.model =
|
|
1971
|
+
this.options.model = gi(i) ? i : "gpt-5.6-sol";
|
|
1971
1972
|
}
|
|
1972
1973
|
shouldIgnoreBackgroundSessionEvent(e) {
|
|
1973
|
-
if (!this.options.keepRunsActiveOnSessionNavigation || !
|
|
1974
|
+
if (!this.options.keepRunsActiveOnSessionNavigation || !ar(e))
|
|
1974
1975
|
return !1;
|
|
1975
1976
|
const n = _n(e);
|
|
1976
1977
|
return n ? this.deferredSessionUpdatedSessionIds.has(n) ? !0 : this.state.sessionId ? n !== this.state.sessionId : this.backgroundSessionIds.has(n) : !1;
|
|
@@ -2029,7 +2030,7 @@ class eo {
|
|
|
2029
2030
|
}, yn(i));
|
|
2030
2031
|
}
|
|
2031
2032
|
requestSessionRecoveryExhaustion(e, n) {
|
|
2032
|
-
this.retryableClientMessageId = n, this.setState({ status: "connected", isThinking: !0, lastError: null, lastErrorCode: null }), this.recoveryExhaustionRequestedClientMessageIds.has(n) ? this.resyncThinkingSession() : (this.recoveryExhaustionRequestedClientMessageIds.add(n), this.send({ type: "chat.retry_last_user_message", sessionId: e, clientMessageId: n, automatic: !0 })), this.scheduleThinkingWatchdog(
|
|
2033
|
+
this.retryableClientMessageId = n, this.setState({ status: "connected", isThinking: !0, lastError: null, lastErrorCode: null }), this.recoveryExhaustionRequestedClientMessageIds.has(n) ? this.resyncThinkingSession() : (this.recoveryExhaustionRequestedClientMessageIds.add(n), this.send({ type: "chat.retry_last_user_message", sessionId: e, clientMessageId: n, automatic: !0 })), this.scheduleThinkingWatchdog(er);
|
|
2033
2034
|
}
|
|
2034
2035
|
clearRetryTimers() {
|
|
2035
2036
|
for (const e of Object.values(this.retryTimersByClientMessageId))
|
|
@@ -2060,7 +2061,7 @@ class eo {
|
|
|
2060
2061
|
const s = new Promise((o, r) => {
|
|
2061
2062
|
const l = window.setTimeout(() => {
|
|
2062
2063
|
e.delete(n.requestId), r(new Error(i));
|
|
2063
|
-
},
|
|
2064
|
+
}, sr);
|
|
2064
2065
|
e.set(n.requestId, { resolve: o, reject: r, timeout: l });
|
|
2065
2066
|
});
|
|
2066
2067
|
if (!this.sendNow(n)) {
|
|
@@ -2083,7 +2084,7 @@ class eo {
|
|
|
2083
2084
|
e.clear();
|
|
2084
2085
|
}
|
|
2085
2086
|
markThinkingProgress() {
|
|
2086
|
-
!this.state.isThinking || this.state.status === "closed" || (this.scheduleThinkingWatchdog(
|
|
2087
|
+
!this.state.isThinking || this.state.status === "closed" || (this.scheduleThinkingWatchdog(Qo), this.activeClientMessageId && this.scheduleRunAckWatchdog(this.activeClientMessageId));
|
|
2087
2088
|
}
|
|
2088
2089
|
scheduleThinkingWatchdog(e) {
|
|
2089
2090
|
this.thinkingWatchdogTimer !== null && window.clearTimeout(this.thinkingWatchdogTimer), this.thinkingWatchdogTimer = window.setTimeout(() => {
|
|
@@ -2129,7 +2130,7 @@ class eo {
|
|
|
2129
2130
|
schedulePendingDeliveryAck(e) {
|
|
2130
2131
|
this.clearPendingDeliveryTimers(), !oi() && (this.pendingDeliveryAckTimer = window.setTimeout(() => {
|
|
2131
2132
|
this.pendingDeliveryAckTimer = null, this.retryPendingDelivery(e);
|
|
2132
|
-
},
|
|
2133
|
+
}, nr));
|
|
2133
2134
|
}
|
|
2134
2135
|
retryPendingDelivery(e) {
|
|
2135
2136
|
if (this.state.status === "closed" || this.pendingClientMessageId !== e || !this.pendingUserMessageEvent)
|
|
@@ -2141,7 +2142,7 @@ class eo {
|
|
|
2141
2142
|
}
|
|
2142
2143
|
n === 0 && this.reportHealthSignal("run_ack_missed", { clientMessageId: e }), this.retryAttemptsByClientMessageId[e] = n + 1, this.setState({ pendingMessageStatus: "reconnecting" }), this.pendingDeliveryRetryTimer = window.setTimeout(() => {
|
|
2143
2144
|
this.pendingDeliveryRetryTimer = null, !(this.pendingClientMessageId !== e || !this.pendingUserMessageEvent) && (this.send(this.pendingUserMessageEvent), this.setState({ pendingMessageStatus: "sending" }), this.schedulePendingDeliveryAck(e));
|
|
2144
|
-
}, yn(n,
|
|
2145
|
+
}, yn(n, ir));
|
|
2145
2146
|
}
|
|
2146
2147
|
failPendingDelivery(e) {
|
|
2147
2148
|
if (this.pendingClientMessageId !== e)
|
|
@@ -2177,7 +2178,7 @@ class eo {
|
|
|
2177
2178
|
scheduleRunAckWatchdog(e) {
|
|
2178
2179
|
this.runAckWatchdogTimer !== null && window.clearTimeout(this.runAckWatchdogTimer), this.runAckWatchdogTimer = window.setTimeout(() => {
|
|
2179
2180
|
this.runAckWatchdogTimer = null, this.recoverMissedRunAck(e);
|
|
2180
|
-
},
|
|
2181
|
+
}, nr);
|
|
2181
2182
|
}
|
|
2182
2183
|
recoverMissedRunAck(e) {
|
|
2183
2184
|
!this.state.isThinking || this.state.status === "closed" || this.activeClientMessageId !== e || (J("web-sdk.agent", "Pluno run ack missed; resyncing session", {
|
|
@@ -2201,8 +2202,8 @@ class eo {
|
|
|
2201
2202
|
sessionId: this.state.sessionId,
|
|
2202
2203
|
clientMessageId: e,
|
|
2203
2204
|
automatic: !0
|
|
2204
|
-
}) : this.activeUserMessageEvent && this.send(this.activeUserMessageEvent), this.scheduleThinkingWatchdog(
|
|
2205
|
-
}, yn(n,
|
|
2205
|
+
}) : this.activeUserMessageEvent && this.send(this.activeUserMessageEvent), this.scheduleThinkingWatchdog(Qo)));
|
|
2206
|
+
}, yn(n, ir)));
|
|
2206
2207
|
}
|
|
2207
2208
|
clearRunAckResyncRetryTimer() {
|
|
2208
2209
|
this.runAckResyncRetryTimer !== null && (window.clearTimeout(this.runAckResyncRetryTimer), this.runAckResyncRetryTimer = null);
|
|
@@ -2225,7 +2226,7 @@ class eo {
|
|
|
2225
2226
|
),
|
|
2226
2227
|
isThinking: !1,
|
|
2227
2228
|
taskStatus: "failed",
|
|
2228
|
-
lastError:
|
|
2229
|
+
lastError: tr,
|
|
2229
2230
|
lastErrorCode: "run_recovery_exhausted"
|
|
2230
2231
|
}), this.clearThinkingWatchdog();
|
|
2231
2232
|
return;
|
|
@@ -2238,7 +2239,7 @@ class eo {
|
|
|
2238
2239
|
}), this.state.sessionId ? this.requestSessionRecoveryExhaustion(this.state.sessionId, e) : (this.setState({
|
|
2239
2240
|
isThinking: !1,
|
|
2240
2241
|
taskStatus: "failed",
|
|
2241
|
-
lastError:
|
|
2242
|
+
lastError: tr,
|
|
2242
2243
|
lastErrorCode: "connection_failed"
|
|
2243
2244
|
}), this.clearThinkingWatchdog());
|
|
2244
2245
|
return;
|
|
@@ -2248,7 +2249,7 @@ class eo {
|
|
|
2248
2249
|
sessionId: this.state.sessionId,
|
|
2249
2250
|
clientMessageId: e,
|
|
2250
2251
|
resyncAttempts: n + 1
|
|
2251
|
-
}), this.resyncThinkingSession(), this.scheduleThinkingWatchdog(
|
|
2252
|
+
}), this.resyncThinkingSession(), this.scheduleThinkingWatchdog(er);
|
|
2252
2253
|
return;
|
|
2253
2254
|
}
|
|
2254
2255
|
this.setState({
|
|
@@ -2330,7 +2331,7 @@ class eo {
|
|
|
2330
2331
|
startedAtOrigin: location.origin
|
|
2331
2332
|
}), this.installSessionBrowserApis();
|
|
2332
2333
|
let c = null, u;
|
|
2333
|
-
c = await this.executeRuntimeHelper(), u = await
|
|
2334
|
+
c = await this.executeRuntimeHelper(), u = await lr(
|
|
2334
2335
|
r,
|
|
2335
2336
|
ip(e.runtimeContext, this.options.backendUrl)
|
|
2336
2337
|
).catch((p) => ({
|
|
@@ -2346,7 +2347,7 @@ class eo {
|
|
|
2346
2347
|
summary: r.summary,
|
|
2347
2348
|
rawInput: We(r),
|
|
2348
2349
|
rawOutput: We(vp(u, c))
|
|
2349
|
-
}),
|
|
2350
|
+
}), wr(this.options.clientId, this.activeBrowserToolCalls.values()));
|
|
2350
2351
|
}
|
|
2351
2352
|
setToolMessageLoading(e, n) {
|
|
2352
2353
|
const i = qp(
|
|
@@ -2375,7 +2376,7 @@ class eo {
|
|
|
2375
2376
|
async executeRuntimeHelper() {
|
|
2376
2377
|
if (!this.runtimeHelperJavascript?.trim())
|
|
2377
2378
|
return null;
|
|
2378
|
-
const e = await
|
|
2379
|
+
const e = await lr({
|
|
2379
2380
|
javascript: this.runtimeHelperJavascript
|
|
2380
2381
|
});
|
|
2381
2382
|
return e.ok === !1 ? xp(e) : null;
|
|
@@ -2455,7 +2456,7 @@ class eo {
|
|
|
2455
2456
|
...e.lastError === null && e.lastErrorCode === void 0 ? { lastErrorCode: null } : {},
|
|
2456
2457
|
...e.lastError !== void 0 && e.lastErrorSecuritySettingsUrl === void 0 ? { lastErrorSecuritySettingsUrl: null } : {}
|
|
2457
2458
|
};
|
|
2458
|
-
this.state = r, gc(this.options.clientId, this.state), this.emit("state", this.getState()),
|
|
2459
|
+
this.state = r, gc(this.options.clientId, this.state), this.emit("state", this.getState()), us("state", this.state.status, {
|
|
2459
2460
|
status: this.state.status,
|
|
2460
2461
|
sessionId: this.state.sessionId,
|
|
2461
2462
|
messageCount: this.state.messages.length,
|
|
@@ -2477,7 +2478,7 @@ class eo {
|
|
|
2477
2478
|
this.listeners[e]?.forEach((s) => s(n));
|
|
2478
2479
|
}
|
|
2479
2480
|
}
|
|
2480
|
-
const
|
|
2481
|
+
const hs = /* @__PURE__ */ new WeakMap();
|
|
2481
2482
|
function Fd(t) {
|
|
2482
2483
|
const e = window.__plunoProductAgentNetworkCapture ?? Hd();
|
|
2483
2484
|
return e.subscribers.add(t), () => {
|
|
@@ -2493,10 +2494,10 @@ function Hd() {
|
|
|
2493
2494
|
}
|
|
2494
2495
|
});
|
|
2495
2496
|
}, n = window.fetch, i = XMLHttpRequest.prototype.open, s = XMLHttpRequest.prototype.setRequestHeader, o = XMLHttpRequest.prototype.send, r = function(y, b) {
|
|
2496
|
-
const
|
|
2497
|
-
let
|
|
2497
|
+
const f = Date.now();
|
|
2498
|
+
let m;
|
|
2498
2499
|
try {
|
|
2499
|
-
|
|
2500
|
+
m = n.call(this, y, b);
|
|
2500
2501
|
} catch (x) {
|
|
2501
2502
|
throw x;
|
|
2502
2503
|
}
|
|
@@ -2504,21 +2505,21 @@ function Hd() {
|
|
|
2504
2505
|
const x = y instanceof Request ? y : null, _ = Tc(y, x), T = Ea(b?.headers ?? x?.headers);
|
|
2505
2506
|
if (!Kt(_, T, b?.body)) {
|
|
2506
2507
|
const L = {
|
|
2507
|
-
requestId:
|
|
2508
|
-
url: ot(_,
|
|
2508
|
+
requestId: ws("fetch"),
|
|
2509
|
+
url: ot(_, gs),
|
|
2509
2510
|
method: (b?.method ?? x?.method ?? "GET").toUpperCase(),
|
|
2510
2511
|
requestHeaders: T,
|
|
2511
|
-
requestBody:
|
|
2512
|
+
requestBody: yr(b?.body),
|
|
2512
2513
|
resourceType: "fetch",
|
|
2513
|
-
startedAt: new Date(
|
|
2514
|
+
startedAt: new Date(f).toISOString()
|
|
2514
2515
|
};
|
|
2515
|
-
|
|
2516
|
+
m.then(
|
|
2516
2517
|
(B) => {
|
|
2517
|
-
Cc(B, L,
|
|
2518
|
+
Cc(B, L, f, e).catch(() => {
|
|
2518
2519
|
e({
|
|
2519
2520
|
...L,
|
|
2520
2521
|
responseStatus: B.status,
|
|
2521
|
-
durationMs: Date.now() -
|
|
2522
|
+
durationMs: Date.now() - f
|
|
2522
2523
|
});
|
|
2523
2524
|
});
|
|
2524
2525
|
},
|
|
@@ -2526,37 +2527,37 @@ function Hd() {
|
|
|
2526
2527
|
e({
|
|
2527
2528
|
...L,
|
|
2528
2529
|
errorText: ot(B instanceof Error ? B.message : String(B)),
|
|
2529
|
-
durationMs: Date.now() -
|
|
2530
|
+
durationMs: Date.now() - f
|
|
2530
2531
|
});
|
|
2531
2532
|
}
|
|
2532
2533
|
);
|
|
2533
2534
|
}
|
|
2534
2535
|
} catch {
|
|
2535
2536
|
}
|
|
2536
|
-
return
|
|
2537
|
-
}, l = function(y, b,
|
|
2538
|
-
const _ = i.call(this, y, b,
|
|
2539
|
-
return
|
|
2540
|
-
requestId:
|
|
2537
|
+
return m;
|
|
2538
|
+
}, l = function(y, b, f, m, x) {
|
|
2539
|
+
const _ = i.call(this, y, b, f ?? !0, m ?? void 0, x ?? void 0), T = typeof b == "string" ? b : b.toString();
|
|
2540
|
+
return hs.set(this, {
|
|
2541
|
+
requestId: ws("xhr"),
|
|
2541
2542
|
method: String(y ?? "GET").toUpperCase(),
|
|
2542
|
-
url: ot(T,
|
|
2543
|
+
url: ot(T, gs),
|
|
2543
2544
|
requestHeaders: {},
|
|
2544
2545
|
startedAtMs: Date.now(),
|
|
2545
2546
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2546
2547
|
excluded: Kt(T)
|
|
2547
2548
|
}), _;
|
|
2548
2549
|
}, d = function(y, b) {
|
|
2549
|
-
const
|
|
2550
|
-
return
|
|
2550
|
+
const f = s.call(this, y, b), m = hs.get(this);
|
|
2551
|
+
return m && Object.keys(m.requestHeaders).length < eo && (m.requestHeaders[y] = so(y, b), m.excluded = m.excluded || Kt(m.url, m.requestHeaders)), f;
|
|
2551
2552
|
}, c = function(y) {
|
|
2552
2553
|
try {
|
|
2553
|
-
const b =
|
|
2554
|
-
b && (b.excluded = b.excluded || Kt(b.url, b.requestHeaders, y), b.requestBody =
|
|
2554
|
+
const b = hs.get(this);
|
|
2555
|
+
b && (b.excluded = b.excluded || Kt(b.url, b.requestHeaders, y), b.requestBody = yr(y), b.excluded || this.addEventListener(
|
|
2555
2556
|
"loadend",
|
|
2556
2557
|
() => {
|
|
2557
2558
|
queueMicrotask(() => {
|
|
2558
2559
|
try {
|
|
2559
|
-
const
|
|
2560
|
+
const f = Rc(this.getAllResponseHeaders());
|
|
2560
2561
|
e({
|
|
2561
2562
|
requestId: b.requestId,
|
|
2562
2563
|
url: b.url,
|
|
@@ -2565,8 +2566,8 @@ function Hd() {
|
|
|
2565
2566
|
requestBody: b.requestBody,
|
|
2566
2567
|
resourceType: "xhr",
|
|
2567
2568
|
responseStatus: this.status,
|
|
2568
|
-
responseHeaders:
|
|
2569
|
-
responseBody: Ec(this,
|
|
2569
|
+
responseHeaders: f,
|
|
2570
|
+
responseBody: Ec(this, f),
|
|
2570
2571
|
errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
|
|
2571
2572
|
startedAt: b.startedAt,
|
|
2572
2573
|
durationMs: Date.now() - b.startedAtMs
|
|
@@ -2605,14 +2606,14 @@ function Hd() {
|
|
|
2605
2606
|
const b = y;
|
|
2606
2607
|
if (b.initiatorType === "fetch" || b.initiatorType === "xmlhttprequest" || Kt(b.name))
|
|
2607
2608
|
continue;
|
|
2608
|
-
const
|
|
2609
|
+
const f = performance.timeOrigin + b.startTime;
|
|
2609
2610
|
e({
|
|
2610
|
-
requestId:
|
|
2611
|
-
url: ot(b.name,
|
|
2611
|
+
requestId: ws("resource"),
|
|
2612
|
+
url: ot(b.name, gs),
|
|
2612
2613
|
method: "GET",
|
|
2613
2614
|
resourceType: "resource",
|
|
2614
2615
|
responseStatus: b.responseStatus,
|
|
2615
|
-
startedAt: new Date(
|
|
2616
|
+
startedAt: new Date(f).toISOString(),
|
|
2616
2617
|
durationMs: b.duration
|
|
2617
2618
|
});
|
|
2618
2619
|
}
|
|
@@ -2658,14 +2659,14 @@ function J(t, e, n) {
|
|
|
2658
2659
|
}, o = i.__plunoProductAgentDiagnostics__ ?? [];
|
|
2659
2660
|
o.push(s), o.length > 120 && o.splice(0, o.length - 120), i.__plunoProductAgentDiagnostics__ = o, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...o], window.dispatchEvent(new CustomEvent("product-agent:preview-diagnostic", { detail: s }));
|
|
2660
2661
|
}
|
|
2661
|
-
function
|
|
2662
|
+
function rr(t) {
|
|
2662
2663
|
const e = typeof t == "function" ? t() : t;
|
|
2663
2664
|
return e && Object.keys(e).length > 0 ? e : void 0;
|
|
2664
2665
|
}
|
|
2665
2666
|
function $d(t) {
|
|
2666
2667
|
return t.type === "run.model_started" || t.type === "conversation.state" || t.type === "session.updated" || t.type === "session.item" || t.type === "chat.assistant_delta" || t.type === "chat.assistant_done" || t.type === "tool.call";
|
|
2667
2668
|
}
|
|
2668
|
-
function
|
|
2669
|
+
function ar(t) {
|
|
2669
2670
|
return t.type === "run.steered" || t.type === "run.ack" || t.type === "run.model_started" || t.type === "conversation.state" || t.type === "session.updated" || t.type === "session.item" || t.type === "chat.assistant_delta" || t.type === "chat.assistant_done" || t.type === "tool.call" || t.type === "tool.status" || t.type === "error" && typeof t.requestId != "string";
|
|
2670
2671
|
}
|
|
2671
2672
|
function _n(t) {
|
|
@@ -2695,10 +2696,10 @@ function Kd() {
|
|
|
2695
2696
|
};
|
|
2696
2697
|
}
|
|
2697
2698
|
function Vd() {
|
|
2698
|
-
return
|
|
2699
|
+
return ta(globalThis, "getPageSnapshot", async () => no());
|
|
2699
2700
|
}
|
|
2700
2701
|
function Yd() {
|
|
2701
|
-
return
|
|
2702
|
+
return ta(globalThis, "pageImages", {
|
|
2702
2703
|
inspectImage: async (e, n) => await Xd(e, n)
|
|
2703
2704
|
});
|
|
2704
2705
|
}
|
|
@@ -2775,7 +2776,7 @@ function np(t) {
|
|
|
2775
2776
|
}, i.onerror = () => n(i.error ?? new Error("Failed to read page image")), i.readAsDataURL(t);
|
|
2776
2777
|
});
|
|
2777
2778
|
}
|
|
2778
|
-
async function
|
|
2779
|
+
async function lr(t, e) {
|
|
2779
2780
|
const n = Object.getPrototypeOf(async function() {
|
|
2780
2781
|
}).constructor, i = t.timeoutMs ?? jd, s = Date.now(), o = [];
|
|
2781
2782
|
let r;
|
|
@@ -2834,7 +2835,7 @@ function ip(t, e) {
|
|
|
2834
2835
|
const s = () => {
|
|
2835
2836
|
if (!i)
|
|
2836
2837
|
throw new Error("sandboxFiles is only available during browser-code execution");
|
|
2837
|
-
}, o = async (l, d) => await
|
|
2838
|
+
}, o = async (l, d) => await fd(`${e.replace(/\/$/, "")}${l}`, d);
|
|
2838
2839
|
return {
|
|
2839
2840
|
value: Object.freeze({
|
|
2840
2841
|
upload: async (l) => {
|
|
@@ -2920,17 +2921,17 @@ function dp() {
|
|
|
2920
2921
|
return {
|
|
2921
2922
|
pageUrl: location.href,
|
|
2922
2923
|
pageTitle: document.title,
|
|
2923
|
-
htmlContent:
|
|
2924
|
+
htmlContent: no()
|
|
2924
2925
|
};
|
|
2925
2926
|
}
|
|
2926
2927
|
function pp(t) {
|
|
2927
|
-
return
|
|
2928
|
-
|
|
2928
|
+
return hi.add(t), si || (si = cp()), () => {
|
|
2929
|
+
hi.delete(t), hi.size === 0 && (si?.(), si = null);
|
|
2929
2930
|
};
|
|
2930
2931
|
}
|
|
2931
2932
|
function cp() {
|
|
2932
2933
|
const t = () => {
|
|
2933
|
-
for (const o of Array.from(
|
|
2934
|
+
for (const o of Array.from(hi))
|
|
2934
2935
|
o();
|
|
2935
2936
|
}, e = window.history.pushState.bind(window.history), n = window.history.replaceState.bind(window.history), i = ((...o) => {
|
|
2936
2937
|
const r = e(...o);
|
|
@@ -2946,23 +2947,23 @@ function cp() {
|
|
|
2946
2947
|
function oi() {
|
|
2947
2948
|
return ga()?.surface === "browser_extension_sdk_preview";
|
|
2948
2949
|
}
|
|
2949
|
-
function
|
|
2950
|
+
function no() {
|
|
2950
2951
|
if (!document.body)
|
|
2951
2952
|
return "";
|
|
2952
|
-
const t = [], e = [], n = (
|
|
2953
|
-
const x = Yt(
|
|
2954
|
-
!x || e.includes(x) || (t.push([
|
|
2953
|
+
const t = [], e = [], n = (f, m) => {
|
|
2954
|
+
const x = Yt(m);
|
|
2955
|
+
!x || e.includes(x) || (t.push([f, x]), e.push(x));
|
|
2955
2956
|
};
|
|
2956
2957
|
n("Selected text", window.getSelection()?.toString() ?? "");
|
|
2957
2958
|
const i = "[role='dialog'], [role='alertdialog'], dialog[open], [aria-modal='true']", s = Array.from(document.querySelectorAll(i)).filter(
|
|
2958
|
-
(
|
|
2959
|
+
(f) => pa(f) && !f.parentElement?.closest(i)
|
|
2959
2960
|
);
|
|
2960
|
-
for (const
|
|
2961
|
-
n("Active overlay",
|
|
2962
|
-
const o = up(), r = o ?
|
|
2963
|
-
n("Main page content", r), n("Additional visible page text",
|
|
2964
|
-
const l = t.map(([
|
|
2965
|
-
${
|
|
2961
|
+
for (const f of s.slice(0, 3))
|
|
2962
|
+
n("Active overlay", fs(Tn(f), e));
|
|
2963
|
+
const o = up(), r = o ? fs(Tn(o), e) : "";
|
|
2964
|
+
n("Main page content", r), n("Additional visible page text", fs(Tn(document.body), e));
|
|
2965
|
+
const l = t.map(([f, m]) => `${f}:
|
|
2966
|
+
${m}`).join(`
|
|
2966
2967
|
|
|
2967
2968
|
`).trim().slice(0, 12e3), d = gp(s, o).trim(), c = `Simplified DOM outline:
|
|
2968
2969
|
`, u = `
|
|
@@ -2982,7 +2983,7 @@ function Yt(t) {
|
|
|
2982
2983
|
|
|
2983
2984
|
`).trim();
|
|
2984
2985
|
}
|
|
2985
|
-
function
|
|
2986
|
+
function fs(t, e) {
|
|
2986
2987
|
let n = Yt(t);
|
|
2987
2988
|
for (const i of e)
|
|
2988
2989
|
n = n.replace(i, "");
|
|
@@ -3081,10 +3082,10 @@ function gp(t, e) {
|
|
|
3081
3082
|
const b = (T) => {
|
|
3082
3083
|
const R = T.getAttribute("role");
|
|
3083
3084
|
return R && !r.has(R) ? R : "";
|
|
3084
|
-
},
|
|
3085
|
+
}, f = (T) => {
|
|
3085
3086
|
const R = T.getAttribute("data-testid") || T.getAttribute("data-test") || T.getAttribute("data-qa") || T.getAttribute("data-cy") || "";
|
|
3086
3087
|
return `${T.tagName.toLowerCase()}|${b(T)}|${R}`;
|
|
3087
|
-
},
|
|
3088
|
+
}, m = (T, R, L) => {
|
|
3088
3089
|
const B = ($, q) => {
|
|
3089
3090
|
const W = $.tagName.toLowerCase(), Q = window.getComputedStyle($), ne = u.has($);
|
|
3090
3091
|
if (y >= 1e3 && !ne || L.has($) || o.has(W) || $.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || Q.display === "none" || Q.visibility === "hidden")
|
|
@@ -3092,29 +3093,29 @@ function gp(t, e) {
|
|
|
3092
3093
|
y += 1;
|
|
3093
3094
|
const K = b($), pe = ua($), ie = l.has(K) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(W) || W === "a" && $.hasAttribute("href"), xe = Array.from($.children).filter((S) => S instanceof HTMLElement), C = /* @__PURE__ */ new Map();
|
|
3094
3095
|
for (const S of xe) {
|
|
3095
|
-
const z =
|
|
3096
|
+
const z = f(S);
|
|
3096
3097
|
C.set(z, (C.get(z) ?? 0) + 1);
|
|
3097
3098
|
}
|
|
3098
3099
|
const M = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
|
|
3099
3100
|
for (const S of xe) {
|
|
3100
|
-
const z =
|
|
3101
|
+
const z = f(S), E = X.get(z) ?? 0;
|
|
3101
3102
|
X.set(z, E + 1), (C.get(z) ?? 0) > 8 && E >= 6 && !u.has(S) && M.set(z, (M.get(z) ?? 0) + 1);
|
|
3102
3103
|
}
|
|
3103
|
-
const F = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set(), he = [],
|
|
3104
|
+
const F = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set(), he = [], fe = [];
|
|
3104
3105
|
for (const S of xe) {
|
|
3105
|
-
const z =
|
|
3106
|
+
const z = f(S), E = C.get(z) ?? 0, Je = F.get(z) ?? 0;
|
|
3106
3107
|
if (F.set(z, Je + 1), E > 8 && Je >= 6 && !u.has(S)) {
|
|
3107
3108
|
V.has(z) || (he.push([`… ${M.get(z) ?? 0} similar siblings omitted`]), V.add(z));
|
|
3108
3109
|
continue;
|
|
3109
3110
|
}
|
|
3110
3111
|
const ce = B(S, q);
|
|
3111
|
-
|
|
3112
|
+
fe.push(ce), he.push(ce.lines);
|
|
3112
3113
|
}
|
|
3113
3114
|
const Ye = [];
|
|
3114
3115
|
if ($.shadowRoot)
|
|
3115
3116
|
for (const S of Array.from($.shadowRoot.children))
|
|
3116
3117
|
S instanceof HTMLElement && Ye.push(B(S, q + 1));
|
|
3117
|
-
const se = [...
|
|
3118
|
+
const se = [...fe, ...Ye], Ue = pe.length > 0 || ie || se.some((S) => S.hasUsefulContent), Ie = Yt(
|
|
3118
3119
|
[pe, ...se.map((S) => S.textPreview)].filter(Boolean).join(" ")
|
|
3119
3120
|
).slice(0, 180), ye = $.hasAttribute("contenteditable") && (pe.length > 0 || !$.querySelector("[contenteditable]")), Te = c.some((S) => $.hasAttribute(S)) || !!K || ye, O = ($.getClientRects().length > 0 || Q.display === "contents") && (n.has(W) || Te || ne) && (Ue || ne) && (!s.has(W) || Ue || Te || ne), Xe = O ? 1 : 0, oe = [];
|
|
3120
3121
|
if (O) {
|
|
@@ -3145,12 +3146,12 @@ function gp(t, e) {
|
|
|
3145
3146
|
`);
|
|
3146
3147
|
}, x = [], _ = Yt(window.getSelection()?.toString() ?? "");
|
|
3147
3148
|
_ && x.push(`--- selected text ---
|
|
3148
|
-
${JSON.stringify(_)}`), p.length > 0 && x.push(
|
|
3149
|
+
${JSON.stringify(_)}`), p.length > 0 && x.push(fp(p, n, d, r));
|
|
3149
3150
|
for (const T of t.slice(0, 3))
|
|
3150
|
-
x.push(
|
|
3151
|
-
if (e && x.push(
|
|
3151
|
+
x.push(m(T, "active overlay DOM", /* @__PURE__ */ new Set()));
|
|
3152
|
+
if (e && x.push(m(e, "main DOM", /* @__PURE__ */ new Set())), document.body) {
|
|
3152
3153
|
const T = e || t.length ? "other visible DOM" : "visible DOM";
|
|
3153
|
-
x.push(
|
|
3154
|
+
x.push(m(document.body, T, h));
|
|
3154
3155
|
}
|
|
3155
3156
|
return x.join(`
|
|
3156
3157
|
|
|
@@ -3160,7 +3161,7 @@ function ca(t, e, n, i) {
|
|
|
3160
3161
|
const s = t.tagName.toLowerCase();
|
|
3161
3162
|
let o = s;
|
|
3162
3163
|
const r = t.getAttribute("id");
|
|
3163
|
-
r &&
|
|
3164
|
+
r && mp(r) && (o += `#${r}`);
|
|
3164
3165
|
for (const l of e) {
|
|
3165
3166
|
const d = t.getAttribute(l);
|
|
3166
3167
|
d && d.length <= 160 && (l !== "role" || !n.has(d)) && (o += `[${l}=${JSON.stringify(d)}]`);
|
|
@@ -3194,7 +3195,7 @@ function hp() {
|
|
|
3194
3195
|
i = i.shadowRoot.activeElement;
|
|
3195
3196
|
i !== document.body && i !== document.documentElement && n(i, "focused");
|
|
3196
3197
|
const s = window.getSelection();
|
|
3197
|
-
s && !s.isCollapsed && (n(
|
|
3198
|
+
s && !s.isCollapsed && (n(dr(s.anchorNode), "selected text"), n(dr(s.focusNode), "selected text"));
|
|
3198
3199
|
const o = [
|
|
3199
3200
|
["[aria-selected='true']", "selected"],
|
|
3200
3201
|
["[aria-current]:not([aria-current='false'])", "current"],
|
|
@@ -3216,7 +3217,7 @@ function hp() {
|
|
|
3216
3217
|
priorityTargets: Array.from(e, ([l, d]) => ({ element: l, labels: Array.from(d) }))
|
|
3217
3218
|
};
|
|
3218
3219
|
}
|
|
3219
|
-
function
|
|
3220
|
+
function fp(t, e, n, i) {
|
|
3220
3221
|
const s = ["--- active/current elements ---"];
|
|
3221
3222
|
for (const o of t) {
|
|
3222
3223
|
const r = [];
|
|
@@ -3238,7 +3239,7 @@ function mp(t, e, n, i) {
|
|
|
3238
3239
|
return s.join(`
|
|
3239
3240
|
`);
|
|
3240
3241
|
}
|
|
3241
|
-
function
|
|
3242
|
+
function dr(t) {
|
|
3242
3243
|
return t instanceof HTMLElement ? t : t?.parentElement instanceof HTMLElement ? t.parentElement : null;
|
|
3243
3244
|
}
|
|
3244
3245
|
function ri(t, e) {
|
|
@@ -3252,12 +3253,12 @@ function ua(t) {
|
|
|
3252
3253
|
Array.from(t.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
|
|
3253
3254
|
);
|
|
3254
3255
|
}
|
|
3255
|
-
function
|
|
3256
|
+
function mp(t) {
|
|
3256
3257
|
return t.length <= 64 && /^[A-Za-z_][A-Za-z0-9_:.-]*$/.test(t) && !/[a-f0-9]{12,}/i.test(t) && !/:r[0-9a-z]+:/i.test(t);
|
|
3257
3258
|
}
|
|
3258
3259
|
function ga() {
|
|
3259
|
-
const t = document.querySelector(
|
|
3260
|
-
if (!(t ?? document.querySelector(
|
|
3260
|
+
const t = document.querySelector(Yo);
|
|
3261
|
+
if (!(t ?? document.querySelector(Ms)))
|
|
3261
3262
|
return;
|
|
3262
3263
|
const n = t ? "browser_extension_sdk_preview" : "embedded_widget";
|
|
3263
3264
|
return {
|
|
@@ -3266,12 +3267,12 @@ function ga() {
|
|
|
3266
3267
|
selectors: [
|
|
3267
3268
|
{
|
|
3268
3269
|
name: "widget_host",
|
|
3269
|
-
selector: n === "browser_extension_sdk_preview" ?
|
|
3270
|
+
selector: n === "browser_extension_sdk_preview" ? Yo : Ms,
|
|
3270
3271
|
description: "Finds Pluno's shadow-host element in the host page DOM."
|
|
3271
3272
|
},
|
|
3272
3273
|
{
|
|
3273
3274
|
name: "widget_root",
|
|
3274
|
-
selector:
|
|
3275
|
+
selector: md,
|
|
3275
3276
|
description: "Finds Pluno's widget root inside the widget host shadow root."
|
|
3276
3277
|
},
|
|
3277
3278
|
{
|
|
@@ -3305,7 +3306,7 @@ function bp(t) {
|
|
|
3305
3306
|
return null;
|
|
3306
3307
|
}
|
|
3307
3308
|
}
|
|
3308
|
-
function
|
|
3309
|
+
function pr(t, e) {
|
|
3309
3310
|
if (!t || typeof t != "object")
|
|
3310
3311
|
return [];
|
|
3311
3312
|
const n = t[e];
|
|
@@ -3368,8 +3369,8 @@ function Tp(t) {
|
|
|
3368
3369
|
avatarUrl: typeof e.avatarUrl == "string" ? e.avatarUrl : null
|
|
3369
3370
|
} : null;
|
|
3370
3371
|
}
|
|
3371
|
-
function
|
|
3372
|
-
return Array.isArray(t) ?
|
|
3372
|
+
function cr(t, e) {
|
|
3373
|
+
return Array.isArray(t) ? Us(
|
|
3373
3374
|
t.map((n) => ha(n, e)).filter((n) => n !== null)
|
|
3374
3375
|
) : [];
|
|
3375
3376
|
}
|
|
@@ -3437,7 +3438,7 @@ function ha(t, e) {
|
|
|
3437
3438
|
respondsToUserMessageId: Fe(s) ?? void 0,
|
|
3438
3439
|
...ae(s) ? { runId: ae(s) } : {},
|
|
3439
3440
|
dataType: "function_call_output",
|
|
3440
|
-
toolName:
|
|
3441
|
+
toolName: Zs,
|
|
3441
3442
|
callId: Sn(s) ?? void 0,
|
|
3442
3443
|
sharePromptAllowed: o
|
|
3443
3444
|
};
|
|
@@ -3451,7 +3452,7 @@ function ha(t, e) {
|
|
|
3451
3452
|
respondsToUserMessageId: Fe(s) ?? void 0,
|
|
3452
3453
|
...ae(s) ? { runId: ae(s) } : {},
|
|
3453
3454
|
dataType: "scheduled_check_in",
|
|
3454
|
-
toolName:
|
|
3455
|
+
toolName: sa,
|
|
3455
3456
|
callId: Sn(s) ?? void 0,
|
|
3456
3457
|
scheduledCheckInAt: r
|
|
3457
3458
|
};
|
|
@@ -3609,7 +3610,7 @@ function Dp(t) {
|
|
|
3609
3610
|
return typeof n.text == "string" ? n.text : typeof n.content == "string" ? n.content : "";
|
|
3610
3611
|
}).filter(Boolean).join("") : "";
|
|
3611
3612
|
}
|
|
3612
|
-
function
|
|
3613
|
+
function Rs(t, e) {
|
|
3613
3614
|
const n = wa(t, e), i = Bp(
|
|
3614
3615
|
Up(
|
|
3615
3616
|
jp(t, e),
|
|
@@ -3618,11 +3619,11 @@ function Ps(t, e) {
|
|
|
3618
3619
|
n
|
|
3619
3620
|
), s = i.findIndex((r) => r.id === n.id);
|
|
3620
3621
|
if (s === -1)
|
|
3621
|
-
return
|
|
3622
|
+
return Us(
|
|
3622
3623
|
[...i, n]
|
|
3623
3624
|
);
|
|
3624
3625
|
const o = [...i];
|
|
3625
|
-
return o[s] = n,
|
|
3626
|
+
return o[s] = n, Us(o);
|
|
3626
3627
|
}
|
|
3627
3628
|
function Up(t, e) {
|
|
3628
3629
|
const n = e.assistantDraftItemId;
|
|
@@ -3655,7 +3656,7 @@ function Op(t, e) {
|
|
|
3655
3656
|
(s) => !s.id.startsWith("transient-activity:") && s.callId === e.callId
|
|
3656
3657
|
);
|
|
3657
3658
|
if (n === -1)
|
|
3658
|
-
return
|
|
3659
|
+
return Rs(t, e);
|
|
3659
3660
|
const i = [...t];
|
|
3660
3661
|
return i[n] = {
|
|
3661
3662
|
...i[n],
|
|
@@ -3701,20 +3702,20 @@ function Bp(t, e) {
|
|
|
3701
3702
|
const i = (o) => o.id === `transient-activity:${e.callId}` && o.callId === e.callId || n && o.id.startsWith("transient-activity:") && o.toolName === "browser_tabs" && !!o.runId && o.runId === e.runId, s = t.findIndex(i);
|
|
3702
3703
|
return s === -1 ? t : t.flatMap((o, r) => i(o) ? r === s ? [e] : [] : o.id === e.id ? [] : [o]);
|
|
3703
3704
|
}
|
|
3704
|
-
function
|
|
3705
|
+
function fa(t, e) {
|
|
3705
3706
|
return ed(
|
|
3706
3707
|
t,
|
|
3707
3708
|
e.map(
|
|
3708
3709
|
(n) => wa(t, n)
|
|
3709
3710
|
),
|
|
3710
|
-
|
|
3711
|
+
ma
|
|
3711
3712
|
);
|
|
3712
3713
|
}
|
|
3713
3714
|
function Wp(t, e) {
|
|
3714
3715
|
const n = new Map(t.map((i) => [i.id, i]));
|
|
3715
3716
|
for (const i of e)
|
|
3716
3717
|
n.set(i.id, i);
|
|
3717
|
-
return
|
|
3718
|
+
return fa(
|
|
3718
3719
|
t,
|
|
3719
3720
|
[...n.values()]
|
|
3720
3721
|
).sort(Fp);
|
|
@@ -3725,7 +3726,7 @@ function Fp(t, e) {
|
|
|
3725
3726
|
const i = Date.parse(t.createdAt) - Date.parse(e.createdAt);
|
|
3726
3727
|
return Number.isNaN(i) ? 0 : i;
|
|
3727
3728
|
}
|
|
3728
|
-
function
|
|
3729
|
+
function ma(t) {
|
|
3729
3730
|
const e = Dt(t) ?? void 0, n = t.assistantDraftItemId, i = [
|
|
3730
3731
|
...t.callId ? [`call:${t.callId}`] : [],
|
|
3731
3732
|
...t.runId && (t.toolName === "browser_tabs" || t.toolName === "tab_lifecycle") ? [`tab-lifecycle:${t.runId}`] : []
|
|
@@ -3737,7 +3738,7 @@ function fa(t) {
|
|
|
3737
3738
|
...i.length > 0 ? { activityKeys: i } : {},
|
|
3738
3739
|
...t.respondsToUserMessageId ? { respondsToUserMessageId: t.respondsToUserMessageId } : {},
|
|
3739
3740
|
...t.runId ? { runId: t.runId } : {},
|
|
3740
|
-
isOptimistic:
|
|
3741
|
+
isOptimistic: Li(t),
|
|
3741
3742
|
isAssistantDraft: t.dataType === "assistant_draft",
|
|
3742
3743
|
isActivity: t.role === "tool" || t.phase === "commentary" || t.dataType === "assistant_draft",
|
|
3743
3744
|
isTransient: t.id.startsWith("transient-activity:") || t.dataType === "assistant_draft"
|
|
@@ -3747,7 +3748,7 @@ function wa(t, e) {
|
|
|
3747
3748
|
if (e.role !== "user" || !e.attachments?.length)
|
|
3748
3749
|
return e;
|
|
3749
3750
|
const n = t.find(
|
|
3750
|
-
(r) => r.role === "user" && (r.id === e.id ||
|
|
3751
|
+
(r) => r.role === "user" && (r.id === e.id || Li(r) && ba(r, e))
|
|
3751
3752
|
);
|
|
3752
3753
|
if (!n?.attachments?.length)
|
|
3753
3754
|
return e;
|
|
@@ -3771,7 +3772,7 @@ function jp(t, e) {
|
|
|
3771
3772
|
if (e.role !== "user")
|
|
3772
3773
|
return t;
|
|
3773
3774
|
const n = t.findIndex(
|
|
3774
|
-
(s) =>
|
|
3775
|
+
(s) => Li(s) && ba(s, e)
|
|
3775
3776
|
);
|
|
3776
3777
|
if (n === -1)
|
|
3777
3778
|
return t;
|
|
@@ -3782,7 +3783,7 @@ function ba(t, e) {
|
|
|
3782
3783
|
const n = Dt(t), i = Dt(e);
|
|
3783
3784
|
return n && i ? n === i : t.content === e.content;
|
|
3784
3785
|
}
|
|
3785
|
-
function
|
|
3786
|
+
function Li(t) {
|
|
3786
3787
|
return t.role === "user" && (t.id.startsWith("local-") || t.id.startsWith("optimistic-user-message:"));
|
|
3787
3788
|
}
|
|
3788
3789
|
function Dt(t) {
|
|
@@ -3794,13 +3795,13 @@ function Dt(t) {
|
|
|
3794
3795
|
);
|
|
3795
3796
|
return i ? t.id.slice(i.length) : null;
|
|
3796
3797
|
}
|
|
3797
|
-
function
|
|
3798
|
+
function ur(t) {
|
|
3798
3799
|
const e = ya(t);
|
|
3799
3800
|
if (e === null)
|
|
3800
3801
|
return !1;
|
|
3801
3802
|
const n = t[e].id;
|
|
3802
3803
|
if (t.some(
|
|
3803
|
-
(s) => s.respondsToUserMessageId === n &&
|
|
3804
|
+
(s) => s.respondsToUserMessageId === n && Si(s)
|
|
3804
3805
|
))
|
|
3805
3806
|
return !0;
|
|
3806
3807
|
for (let s = t.length - 1; s > e; s -= 1) {
|
|
@@ -3849,11 +3850,11 @@ function Kp(t) {
|
|
|
3849
3850
|
}
|
|
3850
3851
|
function ya(t) {
|
|
3851
3852
|
for (let e = t.length - 1; e >= 0; e -= 1)
|
|
3852
|
-
if (t[e].role === "user" && !
|
|
3853
|
+
if (t[e].role === "user" && !Li(t[e]))
|
|
3853
3854
|
return e;
|
|
3854
3855
|
return null;
|
|
3855
3856
|
}
|
|
3856
|
-
function
|
|
3857
|
+
function Si(t) {
|
|
3857
3858
|
return rt(t) ? !0 : t.role !== "system" ? !1 : t.dataType === "run_error" ? !0 : t.dataType === "run_status" && t.loading !== !0;
|
|
3858
3859
|
}
|
|
3859
3860
|
function Xt(t) {
|
|
@@ -3886,10 +3887,10 @@ function ve(t) {
|
|
|
3886
3887
|
const e = t.data;
|
|
3887
3888
|
return e && typeof e == "object" ? e : null;
|
|
3888
3889
|
}
|
|
3889
|
-
function
|
|
3890
|
+
function vi(t) {
|
|
3890
3891
|
return t?.retryable !== !0 ? !1 : t.type === "run_error" ? !0 : t.type === "run_status" && t.status === "interrupted";
|
|
3891
3892
|
}
|
|
3892
|
-
function
|
|
3893
|
+
function gr(t) {
|
|
3893
3894
|
return t?.type === "run_status" && t.status === "interrupted" && t.reason === "backend_restart";
|
|
3894
3895
|
}
|
|
3895
3896
|
function Yp(t, e) {
|
|
@@ -3901,10 +3902,10 @@ function Yp(t, e) {
|
|
|
3901
3902
|
return !1;
|
|
3902
3903
|
const o = t.findIndex((r) => r.role === "user" && r.id === s);
|
|
3903
3904
|
return o === -1 ? !1 : t.some((r) => r.respondsToUserMessageId === s) ? t.some(
|
|
3904
|
-
(r) => r.respondsToUserMessageId === s &&
|
|
3905
|
-
) : t.slice(o + 1).some(
|
|
3905
|
+
(r) => r.respondsToUserMessageId === s && Si(r)
|
|
3906
|
+
) : t.slice(o + 1).some(Si);
|
|
3906
3907
|
}
|
|
3907
|
-
function
|
|
3908
|
+
function Ls(t) {
|
|
3908
3909
|
const e = Xt(t);
|
|
3909
3910
|
if (e === null)
|
|
3910
3911
|
return null;
|
|
@@ -3932,13 +3933,13 @@ function Xp(t) {
|
|
|
3932
3933
|
if (o.type === "message" && o.role === "assistant")
|
|
3933
3934
|
return null;
|
|
3934
3935
|
if (o.type === "run_error")
|
|
3935
|
-
return o.retryable !== !0 ? null :
|
|
3936
|
+
return o.retryable !== !0 ? null : Ds(t, o) ?? Ls(t);
|
|
3936
3937
|
if (o.type === "run_status")
|
|
3937
|
-
return o.status === "interrupted" && o.retryable === !0 ?
|
|
3938
|
+
return o.status === "interrupted" && o.retryable === !0 ? Ds(t, o) ?? Ls(t) : null;
|
|
3938
3939
|
}
|
|
3939
3940
|
return null;
|
|
3940
3941
|
}
|
|
3941
|
-
function
|
|
3942
|
+
function Ds(t, e) {
|
|
3942
3943
|
if (typeof e.clientMessageId == "string")
|
|
3943
3944
|
return e.clientMessageId;
|
|
3944
3945
|
const n = Fe(e);
|
|
@@ -3960,11 +3961,11 @@ function Jp(t, e) {
|
|
|
3960
3961
|
}
|
|
3961
3962
|
return n;
|
|
3962
3963
|
}
|
|
3963
|
-
function
|
|
3964
|
+
function hr(t, e, n, i, s, o) {
|
|
3964
3965
|
if (!e || !Qp(t))
|
|
3965
3966
|
return !1;
|
|
3966
3967
|
const r = t;
|
|
3967
|
-
if (
|
|
3968
|
+
if (vi(r) || n !== null && typeof r.id == "string" && r.id !== n)
|
|
3968
3969
|
return !1;
|
|
3969
3970
|
const l = Fe(r);
|
|
3970
3971
|
return i !== null ? l !== null ? l === i : s !== null && ae(r) === s && o === i : s === null || ae(r) === s;
|
|
@@ -3998,7 +3999,7 @@ function ec(t) {
|
|
|
3998
3999
|
const e = t;
|
|
3999
4000
|
return e.type === "message" && e.role === "user" ? !1 : e.type === "message" || e.type === "function_call" || e.type === "function_call_output" || e.type === "run_error" || e.type === "run_status";
|
|
4000
4001
|
}
|
|
4001
|
-
function
|
|
4002
|
+
function Us(t) {
|
|
4002
4003
|
return t.filter((e, n) => Nt(e) ? !cc(t, n) && !Sa(t, n) && !dc(t, n) && !pc(t, n) : tc(e) ? e.retryable === !0 && lc(t, n) ? !1 : !ac(t, n) : !0);
|
|
4003
4004
|
}
|
|
4004
4005
|
function tc(t) {
|
|
@@ -4019,13 +4020,13 @@ function nc(t, e, n, i) {
|
|
|
4019
4020
|
runId: n ?? o?.runId ?? null
|
|
4020
4021
|
};
|
|
4021
4022
|
}
|
|
4022
|
-
function
|
|
4023
|
+
function fi(t) {
|
|
4023
4024
|
return t?.type === "run_status" && t.status === "stopped";
|
|
4024
4025
|
}
|
|
4025
4026
|
function ic(t, e) {
|
|
4026
|
-
return rt(e) ? "completed" :
|
|
4027
|
+
return rt(e) ? "completed" : fi(t) ? "stopped" : !vi(t) && (t?.type === "run_error" || t?.type === "run_status" && (t.status === "failed" || t.status === "interrupted")) ? "failed" : null;
|
|
4027
4028
|
}
|
|
4028
|
-
function
|
|
4029
|
+
function fr(t, e, n) {
|
|
4029
4030
|
const i = new Set(
|
|
4030
4031
|
t.filter(
|
|
4031
4032
|
(s) => s.role === "user" && e !== null && Dt(s) === e
|
|
@@ -4156,24 +4157,24 @@ function gc(t, e) {
|
|
|
4156
4157
|
}
|
|
4157
4158
|
function hc(t) {
|
|
4158
4159
|
try {
|
|
4159
|
-
const e = window.localStorage.getItem(`${
|
|
4160
|
+
const e = window.localStorage.getItem(`${Ps}${t}`);
|
|
4160
4161
|
if (!e)
|
|
4161
4162
|
return [];
|
|
4162
4163
|
const n = JSON.parse(e);
|
|
4163
|
-
return Array.isArray(n) ? n.filter(
|
|
4164
|
+
return Array.isArray(n) ? n.filter(io) : [];
|
|
4164
4165
|
} catch {
|
|
4165
4166
|
return [];
|
|
4166
4167
|
}
|
|
4167
4168
|
}
|
|
4168
4169
|
function Pt(t, e) {
|
|
4169
4170
|
try {
|
|
4170
|
-
const n = e.filter(
|
|
4171
|
+
const n = e.filter(io);
|
|
4171
4172
|
if (n.length === 0) {
|
|
4172
|
-
window.localStorage.removeItem(`${
|
|
4173
|
+
window.localStorage.removeItem(`${Ps}${t}`);
|
|
4173
4174
|
return;
|
|
4174
4175
|
}
|
|
4175
4176
|
window.localStorage.setItem(
|
|
4176
|
-
`${
|
|
4177
|
+
`${Ps}${t}`,
|
|
4177
4178
|
JSON.stringify(n.slice(-25))
|
|
4178
4179
|
);
|
|
4179
4180
|
} catch {
|
|
@@ -4182,7 +4183,7 @@ function Pt(t, e) {
|
|
|
4182
4183
|
}
|
|
4183
4184
|
function xa(t, e) {
|
|
4184
4185
|
try {
|
|
4185
|
-
const n = `${
|
|
4186
|
+
const n = `${Ri}${t}`, i = location.href, s = location.origin, o = Array.from(e, (r) => ({
|
|
4186
4187
|
...r,
|
|
4187
4188
|
storedAt: Date.now(),
|
|
4188
4189
|
unloadUrl: i,
|
|
@@ -4196,18 +4197,18 @@ function xa(t, e) {
|
|
|
4196
4197
|
} catch {
|
|
4197
4198
|
}
|
|
4198
4199
|
}
|
|
4199
|
-
function
|
|
4200
|
+
function wr(t, e) {
|
|
4200
4201
|
try {
|
|
4201
|
-
if (window.sessionStorage.getItem(`${
|
|
4202
|
+
if (window.sessionStorage.getItem(`${Ri}${t}`) === null)
|
|
4202
4203
|
return;
|
|
4203
4204
|
} catch {
|
|
4204
4205
|
return;
|
|
4205
4206
|
}
|
|
4206
4207
|
xa(t, e);
|
|
4207
4208
|
}
|
|
4208
|
-
function
|
|
4209
|
+
function fc(t) {
|
|
4209
4210
|
try {
|
|
4210
|
-
const e = `${
|
|
4211
|
+
const e = `${Ri}${t}`, n = window.sessionStorage.getItem(e);
|
|
4211
4212
|
if (window.sessionStorage.removeItem(e), !n)
|
|
4212
4213
|
return [];
|
|
4213
4214
|
const i = JSON.parse(n);
|
|
@@ -4217,7 +4218,7 @@ function mc(t) {
|
|
|
4217
4218
|
rawOutput: {
|
|
4218
4219
|
pageContextRestarted: !0,
|
|
4219
4220
|
outcome: "unknown",
|
|
4220
|
-
message:
|
|
4221
|
+
message: mc(location.href),
|
|
4221
4222
|
currentUrl: location.href,
|
|
4222
4223
|
console: [],
|
|
4223
4224
|
metadata: {
|
|
@@ -4234,7 +4235,7 @@ function mc(t) {
|
|
|
4234
4235
|
return [];
|
|
4235
4236
|
}
|
|
4236
4237
|
}
|
|
4237
|
-
function
|
|
4238
|
+
function mc(t) {
|
|
4238
4239
|
return `The page context restarted. This is expected when the action included page navigation. Otherwise, it's unknown whether the action completed.
|
|
4239
4240
|
Current URL: ${t}`;
|
|
4240
4241
|
}
|
|
@@ -4242,7 +4243,7 @@ function wc(t) {
|
|
|
4242
4243
|
if (!t || typeof t != "object")
|
|
4243
4244
|
return !1;
|
|
4244
4245
|
const e = t, n = e.event;
|
|
4245
|
-
return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" &&
|
|
4246
|
+
return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" && io(n) && n.type === "tool.result";
|
|
4246
4247
|
}
|
|
4247
4248
|
function bc(t, e) {
|
|
4248
4249
|
const n = new Set(
|
|
@@ -4255,18 +4256,18 @@ function bc(t, e) {
|
|
|
4255
4256
|
}
|
|
4256
4257
|
function yc(t) {
|
|
4257
4258
|
try {
|
|
4258
|
-
window.sessionStorage.removeItem(`${
|
|
4259
|
+
window.sessionStorage.removeItem(`${Ri}${t}`);
|
|
4259
4260
|
} catch {
|
|
4260
4261
|
return;
|
|
4261
4262
|
}
|
|
4262
4263
|
}
|
|
4263
|
-
function
|
|
4264
|
+
function io(t) {
|
|
4264
4265
|
if (!t || typeof t != "object")
|
|
4265
4266
|
return !1;
|
|
4266
4267
|
const e = t;
|
|
4267
|
-
return e.type === "chat.user_message" ? typeof e.content == "string" &&
|
|
4268
|
+
return e.type === "chat.user_message" ? typeof e.content == "string" && br(e.page) : e.type === "page.upsert" || e.type === "session.reset" || e.type === "network.batch" ? br(e.page) : e.type === "tool.result" ? typeof e.sessionId == "string" && typeof e.callId == "string" && (e.toolName === "execute_code" || e.toolName === "execute_code_in_browser_tab") : e.type === "chat.retry_last_user_message" ? typeof e.sessionId == "string" && typeof e.clientMessageId == "string" : e.type === "run.stop" ? typeof e.sessionId == "string" && (e.reason === "user_requested" || e.reason === "new_chat" || e.reason === "session_switch") : !1;
|
|
4268
4269
|
}
|
|
4269
|
-
function
|
|
4270
|
+
function br(t) {
|
|
4270
4271
|
if (!t || typeof t != "object")
|
|
4271
4272
|
return !1;
|
|
4272
4273
|
const e = t;
|
|
@@ -4289,13 +4290,13 @@ function Ta(t, e) {
|
|
|
4289
4290
|
fileUrl: new URL(t.fileUrl, e).toString()
|
|
4290
4291
|
} : t;
|
|
4291
4292
|
}
|
|
4292
|
-
function
|
|
4293
|
+
function Ns(t) {
|
|
4293
4294
|
return t.type || Sc(t.name) || "application/octet-stream";
|
|
4294
4295
|
}
|
|
4295
4296
|
function Ca(t) {
|
|
4296
4297
|
ka({
|
|
4297
4298
|
name: t.name,
|
|
4298
|
-
mimeType:
|
|
4299
|
+
mimeType: Ns(t),
|
|
4299
4300
|
sizeBytes: t.size
|
|
4300
4301
|
});
|
|
4301
4302
|
}
|
|
@@ -4331,17 +4332,17 @@ function vc(t) {
|
|
|
4331
4332
|
dataType: typeof e.dataType == "string" ? e.dataType : void 0,
|
|
4332
4333
|
scheduledCheckInAt: typeof e.scheduledCheckInAt == "string" ? e.scheduledCheckInAt : void 0,
|
|
4333
4334
|
securitySettingsUrl: typeof e.securitySettingsUrl == "string" ? e.securitySettingsUrl : void 0,
|
|
4334
|
-
attachments: Ia(e.attachments)?.map(
|
|
4335
|
+
attachments: Ia(e.attachments)?.map(xi),
|
|
4335
4336
|
loading: typeof e.loading == "boolean" ? e.loading : void 0
|
|
4336
4337
|
};
|
|
4337
4338
|
}
|
|
4338
4339
|
function xc(t) {
|
|
4339
4340
|
return t.attachments?.length ? {
|
|
4340
4341
|
...t,
|
|
4341
|
-
attachments: t.attachments.map(
|
|
4342
|
+
attachments: t.attachments.map(xi)
|
|
4342
4343
|
} : t;
|
|
4343
4344
|
}
|
|
4344
|
-
function
|
|
4345
|
+
function xi(t) {
|
|
4345
4346
|
const {
|
|
4346
4347
|
dataUrl: e,
|
|
4347
4348
|
objectUrl: n,
|
|
@@ -4367,15 +4368,15 @@ function Ea(t) {
|
|
|
4367
4368
|
const e = {};
|
|
4368
4369
|
try {
|
|
4369
4370
|
new Headers(t).forEach((n, i) => {
|
|
4370
|
-
Object.keys(e).length <
|
|
4371
|
+
Object.keys(e).length < eo && (e[i] = so(i, n));
|
|
4371
4372
|
});
|
|
4372
4373
|
} catch {
|
|
4373
4374
|
return {};
|
|
4374
4375
|
}
|
|
4375
4376
|
return e;
|
|
4376
4377
|
}
|
|
4377
|
-
function
|
|
4378
|
-
return Da(t) ?
|
|
4378
|
+
function so(t, e) {
|
|
4379
|
+
return Da(t) ? Di : ot(Ti(e), Nd);
|
|
4379
4380
|
}
|
|
4380
4381
|
function Tc(t, e) {
|
|
4381
4382
|
return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
|
|
@@ -4410,7 +4411,7 @@ async function kc(t) {
|
|
|
4410
4411
|
const { done: d, value: c } = l;
|
|
4411
4412
|
if (d)
|
|
4412
4413
|
return ot(o + s.decode());
|
|
4413
|
-
const u =
|
|
4414
|
+
const u = Qs - r;
|
|
4414
4415
|
if (c.byteLength > u)
|
|
4415
4416
|
return o += s.decode(c.subarray(0, Math.max(u, 0)), { stream: !0 }), e.cancel(), `${ot(o)}... [truncated]`;
|
|
4416
4417
|
r += c.byteLength, o += s.decode(c, { stream: !0 });
|
|
@@ -4430,34 +4431,34 @@ function Ec(t, e) {
|
|
|
4430
4431
|
return;
|
|
4431
4432
|
}
|
|
4432
4433
|
}
|
|
4433
|
-
function
|
|
4434
|
+
function yr(t) {
|
|
4434
4435
|
if (typeof t == "string")
|
|
4435
4436
|
return ot(t);
|
|
4436
4437
|
}
|
|
4437
4438
|
function Ac(t) {
|
|
4438
4439
|
return We({
|
|
4439
4440
|
...t,
|
|
4440
|
-
requestBody:
|
|
4441
|
-
responseBody:
|
|
4441
|
+
requestBody: _r(t.requestBody),
|
|
4442
|
+
responseBody: _r(t.responseBody)
|
|
4442
4443
|
});
|
|
4443
4444
|
}
|
|
4444
|
-
function
|
|
4445
|
+
function _r(t) {
|
|
4445
4446
|
if (typeof t != "string")
|
|
4446
4447
|
return t;
|
|
4447
4448
|
const e = t.trim();
|
|
4448
4449
|
if (!e.startsWith("{") && !e.startsWith("["))
|
|
4449
|
-
return
|
|
4450
|
+
return Ti(t);
|
|
4450
4451
|
try {
|
|
4451
4452
|
return JSON.stringify(We(JSON.parse(t)));
|
|
4452
4453
|
} catch {
|
|
4453
|
-
return
|
|
4454
|
+
return Ti(t);
|
|
4454
4455
|
}
|
|
4455
4456
|
}
|
|
4456
4457
|
function Aa(t) {
|
|
4457
4458
|
if (!t)
|
|
4458
4459
|
return !1;
|
|
4459
4460
|
const e = t.get("content-type")?.toLowerCase() ?? "", n = t.get("content-length"), i = Number(n);
|
|
4460
|
-
return n !== null && Number.isInteger(i) && i >= 0 && i <=
|
|
4461
|
+
return n !== null && Number.isInteger(i) && i >= 0 && i <= Qs && (e.startsWith("text/") || e.includes("json") || e.includes("javascript"));
|
|
4461
4462
|
}
|
|
4462
4463
|
function Kt(t, e = {}, n) {
|
|
4463
4464
|
if (Pc(n))
|
|
@@ -4494,17 +4495,17 @@ function Rc(t) {
|
|
|
4494
4495
|
const i = n.indexOf(":");
|
|
4495
4496
|
if (i <= 0)
|
|
4496
4497
|
continue;
|
|
4497
|
-
if (Object.keys(e).length >=
|
|
4498
|
+
if (Object.keys(e).length >= eo)
|
|
4498
4499
|
break;
|
|
4499
4500
|
const s = n.slice(0, i).trim();
|
|
4500
|
-
e[s] =
|
|
4501
|
+
e[s] = so(s, n.slice(i + 1).trim());
|
|
4501
4502
|
}
|
|
4502
4503
|
return e;
|
|
4503
4504
|
}
|
|
4504
|
-
function ot(t, e =
|
|
4505
|
+
function ot(t, e = Qs) {
|
|
4505
4506
|
return t.length <= e ? t : `${t.slice(0, e)}... [truncated ${t.length - e} chars]`;
|
|
4506
4507
|
}
|
|
4507
|
-
function
|
|
4508
|
+
function ws(t) {
|
|
4508
4509
|
return `${t}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
4509
4510
|
}
|
|
4510
4511
|
class mi extends Error {
|
|
@@ -4515,11 +4516,11 @@ class mi extends Error {
|
|
|
4515
4516
|
}
|
|
4516
4517
|
async function ai(t, e) {
|
|
4517
4518
|
let n = null;
|
|
4518
|
-
for (let i = 0; i <
|
|
4519
|
+
for (let i = 0; i < or; i += 1)
|
|
4519
4520
|
try {
|
|
4520
4521
|
return await t();
|
|
4521
4522
|
} catch (s) {
|
|
4522
|
-
if (n = s, i >=
|
|
4523
|
+
if (n = s, i >= or - 1 || !Dc(s))
|
|
4523
4524
|
throw s;
|
|
4524
4525
|
await Lc(i);
|
|
4525
4526
|
}
|
|
@@ -4539,13 +4540,13 @@ function Uc(t) {
|
|
|
4539
4540
|
function Nc(t) {
|
|
4540
4541
|
return t === 401 || t === 403;
|
|
4541
4542
|
}
|
|
4542
|
-
const
|
|
4543
|
+
const Di = "[REDACTED_SECRET]", at = "[REDACTED_TOKEN]", Oc = "[REDACTED_SIGNED_URL]", qc = 20, zc = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, Ma = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Pa = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Ra = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, La = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, Bc = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Wc = /\bhttps?:\/\/[^\s"'<>]+/gi, Fc = /[),.;\]]+$/;
|
|
4543
4544
|
function We(t) {
|
|
4544
|
-
return
|
|
4545
|
+
return Ii(t, 0, /* @__PURE__ */ new WeakSet());
|
|
4545
4546
|
}
|
|
4546
|
-
function
|
|
4547
|
+
function Ii(t, e, n) {
|
|
4547
4548
|
if (typeof t == "string")
|
|
4548
|
-
return t.startsWith("data:image/") || t.startsWith("data:application/pdf;") ? t :
|
|
4549
|
+
return t.startsWith("data:image/") || t.startsWith("data:application/pdf;") ? t : Ti(t);
|
|
4549
4550
|
if (t === null || typeof t != "object")
|
|
4550
4551
|
return t;
|
|
4551
4552
|
if (e >= qc)
|
|
@@ -4553,10 +4554,10 @@ function xi(t, e, n) {
|
|
|
4553
4554
|
if (n.has(t))
|
|
4554
4555
|
return "[REDACTED_CIRCULAR]";
|
|
4555
4556
|
if (n.add(t), Array.isArray(t))
|
|
4556
|
-
return t.map((s) =>
|
|
4557
|
+
return t.map((s) => Ii(s, e + 1, n));
|
|
4557
4558
|
const i = {};
|
|
4558
4559
|
for (const [s, o] of Object.entries(t))
|
|
4559
|
-
s === "pageContent" ? i[s] = o : Da(s) ? i[s] =
|
|
4560
|
+
s === "pageContent" ? i[s] = o : Da(s) ? i[s] = Di : i[s] = s.toLowerCase() === "url" ? Hc(o) : Ii(o, e + 1, n);
|
|
4560
4561
|
return i;
|
|
4561
4562
|
}
|
|
4562
4563
|
function Da(t) {
|
|
@@ -4564,7 +4565,7 @@ function Da(t) {
|
|
|
4564
4565
|
return e.includes("authorization") || e.includes("cookie") || e.includes("password") || e.includes("passwd") || e === "pwd" || e.includes("secret") || e === "token" || e.endsWith("token") || e.includes("apikey") || e.includes("csrf") || e.includes("xsrf") || e === "jwt" || e === "session" || e === "signature" || e.includes("privatekey");
|
|
4565
4566
|
}
|
|
4566
4567
|
function Hc(t) {
|
|
4567
|
-
return typeof t == "string" ? Ua(t) :
|
|
4568
|
+
return typeof t == "string" ? Ua(t) : Ii(t, 0, /* @__PURE__ */ new WeakSet());
|
|
4568
4569
|
}
|
|
4569
4570
|
function Ua(t) {
|
|
4570
4571
|
try {
|
|
@@ -4576,27 +4577,27 @@ function Ua(t) {
|
|
|
4576
4577
|
return $c(t);
|
|
4577
4578
|
}
|
|
4578
4579
|
}
|
|
4579
|
-
function
|
|
4580
|
-
return t.replace(Bc, Oc).replace(Wc, jc).replace(Ma, `Bearer ${at}`).replace(Pa, `Basic ${at}`).replace(Ra, at).replace(La, (e, n) => `${n}: ${
|
|
4580
|
+
function Ti(t) {
|
|
4581
|
+
return t.replace(Bc, Oc).replace(Wc, jc).replace(Ma, `Bearer ${at}`).replace(Pa, `Basic ${at}`).replace(Ra, at).replace(La, (e, n) => `${n}: ${Di}`);
|
|
4581
4582
|
}
|
|
4582
4583
|
function $c(t) {
|
|
4583
|
-
return t.replace(Ma, `Bearer ${at}`).replace(Pa, `Basic ${at}`).replace(Ra, at).replace(La, (e, n) => `${n}: ${
|
|
4584
|
+
return t.replace(Ma, `Bearer ${at}`).replace(Pa, `Basic ${at}`).replace(Ra, at).replace(La, (e, n) => `${n}: ${Di}`);
|
|
4584
4585
|
}
|
|
4585
4586
|
function jc(t) {
|
|
4586
4587
|
const e = t.match(Fc)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
|
|
4587
4588
|
return `${Ua(n)}${e}`;
|
|
4588
4589
|
}
|
|
4589
|
-
const Gc = "#7c3aed",
|
|
4590
|
+
const Gc = "#7c3aed", Ci = "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", ki = "#2c2a1e", Sr = [253, 250, 241], vr = 3.5;
|
|
4590
4591
|
function Na(t) {
|
|
4591
4592
|
const e = Oa(t);
|
|
4592
|
-
if (
|
|
4593
|
+
if (xr(Cn(e), Sr) >= vr)
|
|
4593
4594
|
return e;
|
|
4594
4595
|
let i = Cn(e);
|
|
4595
|
-
const s = Cn(
|
|
4596
|
+
const s = Cn(ki);
|
|
4596
4597
|
for (let o = 0; o < 6; o += 1)
|
|
4597
|
-
if (i = Yc(i, s, 0.22),
|
|
4598
|
-
return
|
|
4599
|
-
return
|
|
4598
|
+
if (i = Yc(i, s, 0.22), xr(i, Sr) >= vr)
|
|
4599
|
+
return Os(i);
|
|
4600
|
+
return Os(i);
|
|
4600
4601
|
}
|
|
4601
4602
|
function Kc() {
|
|
4602
4603
|
let n = "M 280 120", i = !1, s = 0;
|
|
@@ -4607,7 +4608,7 @@ function Kc() {
|
|
|
4607
4608
|
return n;
|
|
4608
4609
|
}
|
|
4609
4610
|
function Vc(t) {
|
|
4610
|
-
const e = Oa(t), n =
|
|
4611
|
+
const e = Oa(t), n = qs(Cn(e));
|
|
4611
4612
|
return n > 0.86 ? {
|
|
4612
4613
|
top: "#ffffff",
|
|
4613
4614
|
middle: "#f6f6f6",
|
|
@@ -4654,23 +4655,23 @@ function Cn(t) {
|
|
|
4654
4655
|
Number.parseInt(t.slice(5, 7), 16)
|
|
4655
4656
|
];
|
|
4656
4657
|
}
|
|
4657
|
-
function
|
|
4658
|
+
function Os([t, e, n]) {
|
|
4658
4659
|
const i = (s) => Math.max(0, Math.min(255, Math.round(s))).toString(16).padStart(2, "0");
|
|
4659
4660
|
return `#${i(t)}${i(e)}${i(n)}`;
|
|
4660
4661
|
}
|
|
4661
|
-
function
|
|
4662
|
+
function qs([t, e, n]) {
|
|
4662
4663
|
const i = (s) => {
|
|
4663
4664
|
const o = s / 255;
|
|
4664
4665
|
return o <= 0.04045 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4;
|
|
4665
4666
|
};
|
|
4666
4667
|
return 0.2126 * i(t) + 0.7152 * i(e) + 0.0722 * i(n);
|
|
4667
4668
|
}
|
|
4668
|
-
function
|
|
4669
|
-
const n =
|
|
4669
|
+
function xr(t, e) {
|
|
4670
|
+
const n = qs(t), i = qs(e), [s, o] = n > i ? [n, i] : [i, n];
|
|
4670
4671
|
return (s + 0.05) / (o + 0.05);
|
|
4671
4672
|
}
|
|
4672
4673
|
function Yc(t, e, n) {
|
|
4673
|
-
const i =
|
|
4674
|
+
const i = zs(n);
|
|
4674
4675
|
return [
|
|
4675
4676
|
t[0] + (e[0] - t[0]) * i,
|
|
4676
4677
|
t[1] + (e[1] - t[1]) * i,
|
|
@@ -4679,7 +4680,7 @@ function Yc(t, e, n) {
|
|
|
4679
4680
|
}
|
|
4680
4681
|
function Ve(t, e, n) {
|
|
4681
4682
|
const [i, s, o] = Xc(Cn(t));
|
|
4682
|
-
return
|
|
4683
|
+
return Os(Jc(i, zs(s + n), zs(o + e)));
|
|
4683
4684
|
}
|
|
4684
4685
|
function Xc([t, e, n]) {
|
|
4685
4686
|
const i = t / 255, s = e / 255, o = n / 255, r = Math.max(i, s, o), l = Math.min(i, s, o), d = (r + l) / 2;
|
|
@@ -4693,16 +4694,16 @@ function Jc(t, e, n) {
|
|
|
4693
4694
|
return [n * 255, n * 255, n * 255];
|
|
4694
4695
|
const i = n < 0.5 ? n * (1 + e) : n + e - n * e, s = 2 * n - i;
|
|
4695
4696
|
return [
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4697
|
+
bs(s, i, t + 1 / 3) * 255,
|
|
4698
|
+
bs(s, i, t) * 255,
|
|
4699
|
+
bs(s, i, t - 1 / 3) * 255
|
|
4699
4700
|
];
|
|
4700
4701
|
}
|
|
4701
|
-
function
|
|
4702
|
+
function bs(t, e, n) {
|
|
4702
4703
|
let i = n;
|
|
4703
4704
|
return i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? t + (e - t) * 6 * i : i < 1 / 2 ? e : i < 2 / 3 ? t + (e - t) * (2 / 3 - i) * 6 : t;
|
|
4704
4705
|
}
|
|
4705
|
-
function
|
|
4706
|
+
function zs(t) {
|
|
4706
4707
|
return Math.max(0, Math.min(1, t));
|
|
4707
4708
|
}
|
|
4708
4709
|
const Zc = "https://app.pluno.ai", Qc = "/api/product-agent/embed/active-users", eu = 1800, tu = 15e3, nu = 250, iu = 1e3, su = 3e4;
|
|
@@ -4751,12 +4752,12 @@ async function ru(t) {
|
|
|
4751
4752
|
});
|
|
4752
4753
|
if (!n.ok)
|
|
4753
4754
|
throw new Error("Failed to load active users");
|
|
4754
|
-
const i = await n.json(), s =
|
|
4755
|
+
const i = await n.json(), s = Ir(i.count), o = Ir(i.refreshAfterMs ?? i.refresh_after_ms);
|
|
4755
4756
|
if (s === null || o === null)
|
|
4756
4757
|
throw new Error("Invalid active users response");
|
|
4757
4758
|
return { count: s, refreshAfterMs: o };
|
|
4758
4759
|
}
|
|
4759
|
-
function
|
|
4760
|
+
function Ir(t) {
|
|
4760
4761
|
return typeof t != "number" || !Number.isFinite(t) || t < 0 ? null : Math.round(t);
|
|
4761
4762
|
}
|
|
4762
4763
|
function au(t) {
|
|
@@ -4805,7 +4806,7 @@ function uu(t, e, n) {
|
|
|
4805
4806
|
function gu(t, e, n) {
|
|
4806
4807
|
return t instanceof Node && e !== null && !e.contains(t) && !n?.contains(t);
|
|
4807
4808
|
}
|
|
4808
|
-
function
|
|
4809
|
+
function Tr(t, e) {
|
|
4809
4810
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
4810
4811
|
}
|
|
4811
4812
|
function hu(t, e = Date.now(), n) {
|
|
@@ -4814,10 +4815,10 @@ function hu(t, e = Date.now(), n) {
|
|
|
4814
4815
|
minute: "2-digit",
|
|
4815
4816
|
hourCycle: "h23"
|
|
4816
4817
|
}).formatToParts(i), r = o.find((p) => p.type === "hour")?.value, l = o.find((p) => p.type === "minute")?.value, d = `${r}.${l}`;
|
|
4817
|
-
if (
|
|
4818
|
+
if (Tr(i, s))
|
|
4818
4819
|
return d;
|
|
4819
4820
|
const c = new Date(s);
|
|
4820
|
-
if (c.setDate(s.getDate() - 1),
|
|
4821
|
+
if (c.setDate(s.getDate() - 1), Tr(i, c)) {
|
|
4821
4822
|
const p = new Intl.RelativeTimeFormat(n, {
|
|
4822
4823
|
numeric: "auto"
|
|
4823
4824
|
}).format(
|
|
@@ -4832,12 +4833,12 @@ function hu(t, e = Date.now(), n) {
|
|
|
4832
4833
|
year: "numeric"
|
|
4833
4834
|
}).format(i)}, ${d}`;
|
|
4834
4835
|
}
|
|
4835
|
-
const
|
|
4836
|
+
const fu = {
|
|
4836
4837
|
working: "⏳",
|
|
4837
4838
|
completed: "✅",
|
|
4838
4839
|
failed: "❗",
|
|
4839
4840
|
stopped: "⏹️"
|
|
4840
|
-
},
|
|
4841
|
+
}, mu = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
|
|
4841
4842
|
class wu {
|
|
4842
4843
|
constructor(e) {
|
|
4843
4844
|
this.titleDocument = e;
|
|
@@ -4860,10 +4861,10 @@ class wu {
|
|
|
4860
4861
|
}
|
|
4861
4862
|
applyStatus(e) {
|
|
4862
4863
|
const n = this.titleDocument.getTitle();
|
|
4863
|
-
n !== this.lastAppliedTitle && (this.baseTitle =
|
|
4864
|
+
n !== this.lastAppliedTitle && (this.baseTitle = Cr(n)), this.status = e, this.stopObserving || (this.stopObserving = this.titleDocument.observeTitle(() => this.handleTitleChanged())), this.applyTitle();
|
|
4864
4865
|
}
|
|
4865
4866
|
applyClear() {
|
|
4866
|
-
const e = this.titleDocument.getTitle(), n = this.lastAppliedTitle !== null && e === this.lastAppliedTitle, i = this.lastAppliedTitle === null ?
|
|
4867
|
+
const e = this.titleDocument.getTitle(), n = this.lastAppliedTitle !== null && e === this.lastAppliedTitle, i = this.lastAppliedTitle === null ? Cr(e) : e;
|
|
4867
4868
|
this.status = null, this.lastAppliedTitle = null, this.stopObserving?.(), this.stopObserving = null, n ? this.titleDocument.setTitle(this.baseTitle) : i !== e && this.titleDocument.setTitle(i);
|
|
4868
4869
|
}
|
|
4869
4870
|
handleTitleChanged() {
|
|
@@ -4872,7 +4873,7 @@ class wu {
|
|
|
4872
4873
|
applyTitle() {
|
|
4873
4874
|
if (!this.status)
|
|
4874
4875
|
return;
|
|
4875
|
-
const e = `${
|
|
4876
|
+
const e = `${fu[this.status]} Pluno`, n = this.baseTitle ? `${e}: ${this.baseTitle}` : e;
|
|
4876
4877
|
this.lastAppliedTitle = n, this.titleDocument.getTitle() !== n && this.titleDocument.setTitle(n);
|
|
4877
4878
|
}
|
|
4878
4879
|
}
|
|
@@ -4892,15 +4893,15 @@ function bu(t) {
|
|
|
4892
4893
|
}
|
|
4893
4894
|
};
|
|
4894
4895
|
}
|
|
4895
|
-
function
|
|
4896
|
-
return t.replace(
|
|
4896
|
+
function Cr(t) {
|
|
4897
|
+
return t.replace(mu, "");
|
|
4897
4898
|
}
|
|
4898
4899
|
function yu(t) {
|
|
4899
4900
|
return t === "sending" ? "Reading your message..." : "Thinking...";
|
|
4900
4901
|
}
|
|
4901
4902
|
const _u = 6e4, Su = [100, 500, 1500, 4e3], qa = 100, vu = 1e4, xu = 5e3;
|
|
4902
4903
|
let Iu = 0;
|
|
4903
|
-
const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-preview-socket-send", ku = "product-agent:sdk-preview-socket-close", Eu = "product-agent:sdk-preview-socket-open", Au = "product-agent:sdk-preview-socket-message", Mu = "product-agent:sdk-preview-socket-error", Pu = "product-agent:sdk-preview-socket-closed",
|
|
4904
|
+
const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-preview-socket-send", ku = "product-agent:sdk-preview-socket-close", Eu = "product-agent:sdk-preview-socket-open", Au = "product-agent:sdk-preview-socket-message", Mu = "product-agent:sdk-preview-socket-error", Pu = "product-agent:sdk-preview-socket-closed", kr = "product-agent:sdk-preview-socket-id", Ru = "data-pluno-sdk-preview-channel", za = "data-pluno-auto-mounted", nt = "__plunoProductAgentAutoMountOwner", Lu = 1e4, Du = "Failed to load Pluno widget token", Er = "Timed out loading Pluno widget token", Uu = "pluno.productAgent.widgetClientId.", ys = /* @__PURE__ */ new Set(), Nu = "product-agent:preview-diagnostic", Ba = "pluno.productAgent.sharePromptsDisabled", Ou = 3, Ar = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mr = 1500, qu = 5e3, zu = 500, Bu = "No recent chats for this page yet.", it = {
|
|
4904
4905
|
launcherLabel: "Ask for anything...",
|
|
4905
4906
|
accentColor: "#7c3aed",
|
|
4906
4907
|
colorScheme: "light",
|
|
@@ -4908,7 +4909,7 @@ const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-p
|
|
|
4908
4909
|
scribbleStyle: !0,
|
|
4909
4910
|
position: "bottom-right",
|
|
4910
4911
|
movableLauncher: !0
|
|
4911
|
-
}, Wu = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive',
|
|
4912
|
+
}, Wu = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Pr = "pluno-pa-scribble-font", Wa = 190, Fa = 41, Fu = 22, Hu = 32, $u = 1, ju = 48, oo = 420, Gu = 520, Ku = 0.24, ro = 680, Vu = 800, Yu = 0.76, G = 8, Ut = 50, Bs = 12, Ha = "http://www.w3.org/2000/svg", Ws = 26, Fs = 8, Xu = 36, Hs = 16, Ju = 4, Rr = [
|
|
4912
4913
|
{
|
|
4913
4914
|
ellipseCx: "17.5",
|
|
4914
4915
|
ellipseCy: "24.5",
|
|
@@ -4945,8 +4946,8 @@ const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-p
|
|
|
4945
4946
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
4946
4947
|
pathStrokeWidth: "2.45"
|
|
4947
4948
|
}
|
|
4948
|
-
], Zu = 11, Qu = 13,
|
|
4949
|
-
let
|
|
4949
|
+
], Zu = 11, Qu = 13, Ei = 4, ao = 10, lo = 40, eg = "movable-launcher-position-v2", $a = "pluno-pa-widget-styles", ja = "data-pluno-pa-widget-styles";
|
|
4950
|
+
let Lr = 0;
|
|
4950
4951
|
function tg(t) {
|
|
4951
4952
|
return (e) => new st(e, t);
|
|
4952
4953
|
}
|
|
@@ -5043,7 +5044,7 @@ async function ng(t = {}) {
|
|
|
5043
5044
|
);
|
|
5044
5045
|
const o = s.attachShadow({ mode: "open" }), r = document.createElement("div");
|
|
5045
5046
|
r.className = `pluno-pa-widget pluno-pa-widget--${e.position}`, r.classList.add(`pluno-pa-widget--layout-${e.layout}`), r.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
5046
|
-
let l =
|
|
5047
|
+
let l = Dr(
|
|
5047
5048
|
e.accentColor,
|
|
5048
5049
|
e.scribbleStyle
|
|
5049
5050
|
);
|
|
@@ -5055,25 +5056,25 @@ async function ng(t = {}) {
|
|
|
5055
5056
|
e.showLauncherMinimizeButton
|
|
5056
5057
|
), o.appendChild(r);
|
|
5057
5058
|
const d = $h(e), c = e.layout === "floating" ? e.initialDisplayState ?? Fh(e) : "shown";
|
|
5058
|
-
|
|
5059
|
+
Jr(e, c);
|
|
5059
5060
|
let u = e.movableLauncher ? d.launcherPosition : null, p = u !== null, h = d.panelSize, y = null;
|
|
5060
5061
|
r.style.setProperty(
|
|
5061
5062
|
"--pluno-pa-mobile-panel-top-offset",
|
|
5062
5063
|
`${e.mobilePanelTopOffset}px`
|
|
5063
5064
|
), r.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && r.classList.add("pluno-pa-widget--scribble"), c === "minimized" && (r.classList.add("pluno-pa-widget--minimized"), wt(
|
|
5064
5065
|
r,
|
|
5065
|
-
|
|
5066
|
+
Ss(
|
|
5066
5067
|
r,
|
|
5067
5068
|
u,
|
|
5068
5069
|
e.position
|
|
5069
5070
|
)
|
|
5070
|
-
)),
|
|
5071
|
+
)), Xr(o, e.accentColor), Ur(r, l, {
|
|
5071
5072
|
accentColor: e.accentColor,
|
|
5072
5073
|
colorScheme: e.colorScheme,
|
|
5073
5074
|
fontFamily: e.fontFamily,
|
|
5074
5075
|
scribbleStyle: e.scribbleStyle
|
|
5075
5076
|
});
|
|
5076
|
-
const b = e.mountTarget ?? await Wh(),
|
|
5077
|
+
const b = e.mountTarget ?? await Wh(), f = b.ownerDocument, m = r.querySelector(
|
|
5077
5078
|
".pluno-pa-widget__launcher"
|
|
5078
5079
|
), x = r.querySelector(
|
|
5079
5080
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -5115,7 +5116,7 @@ async function ng(t = {}) {
|
|
|
5115
5116
|
".pluno-pa-widget__send"
|
|
5116
5117
|
), he = r.querySelector(
|
|
5117
5118
|
".pluno-pa-widget__top-actions"
|
|
5118
|
-
),
|
|
5119
|
+
), fe = r.querySelector(
|
|
5119
5120
|
".pluno-pa-widget__history"
|
|
5120
5121
|
), Ye = r.querySelector(
|
|
5121
5122
|
".pluno-pa-widget__history-panel"
|
|
@@ -5155,13 +5156,13 @@ async function ng(t = {}) {
|
|
|
5155
5156
|
".pluno-pa-widget__proactive-suggestion-run"
|
|
5156
5157
|
), Ot = r.querySelector(
|
|
5157
5158
|
".pluno-pa-widget__proactive-suggestion-edit"
|
|
5158
|
-
),
|
|
5159
|
+
), me = r.querySelector(
|
|
5159
5160
|
".pluno-pa-widget__proactive-suggestion-dismiss"
|
|
5160
5161
|
), cl = r.querySelector(
|
|
5161
5162
|
".pluno-pa-widget__proactive-suggestion-never-show"
|
|
5162
|
-
), go = r.querySelector(
|
|
5163
|
-
".pluno-pa-widget__proactive-suggestion-actions"
|
|
5164
5163
|
), ho = r.querySelector(
|
|
5164
|
+
".pluno-pa-widget__proactive-suggestion-actions"
|
|
5165
|
+
), fo = r.querySelector(
|
|
5165
5166
|
".pluno-pa-widget__proactive-suggestion-feedback"
|
|
5166
5167
|
), Ce = r.querySelector(
|
|
5167
5168
|
".pluno-pa-widget__proactive-suggestion-feedback-input"
|
|
@@ -5170,7 +5171,7 @@ async function ng(t = {}) {
|
|
|
5170
5171
|
), Pn = r.querySelector(
|
|
5171
5172
|
".pluno-pa-widget__proactive-suggestion-feedback-status"
|
|
5172
5173
|
);
|
|
5173
|
-
if (!
|
|
5174
|
+
if (!m || !_ || !L || !W || !Q || !ne || !K || !pe || !ie || !xe || !C || !M || !X || !V || !he || !fe || !Ye || !se || !Ue || !Ie || !ye || !Te || !O || !Xe)
|
|
5174
5175
|
throw new Error("Failed to mount Pluno widget");
|
|
5175
5176
|
if (e.movableLauncher && !x)
|
|
5176
5177
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
@@ -5185,12 +5186,12 @@ async function ng(t = {}) {
|
|
|
5185
5186
|
r.classList.toggle(
|
|
5186
5187
|
"pluno-pa-widget--proactive-suggestion-below",
|
|
5187
5188
|
gg(
|
|
5188
|
-
|
|
5189
|
+
m.getBoundingClientRect(),
|
|
5189
5190
|
D.getBoundingClientRect().height
|
|
5190
5191
|
)
|
|
5191
5192
|
);
|
|
5192
5193
|
}, ke = () => {
|
|
5193
|
-
if (!D || !j || !
|
|
5194
|
+
if (!D || !j || !ho || !fo || !Ce || !Jt || !Pn)
|
|
5194
5195
|
return;
|
|
5195
5196
|
const a = e.proactiveSuggestion ?? He, g = a !== null && !I.getState().isThinking, w = O.querySelector(
|
|
5196
5197
|
".pluno-pa-widget__proactive-suggestion-slot"
|
|
@@ -5198,7 +5199,7 @@ async function ng(t = {}) {
|
|
|
5198
5199
|
P ? w.appendChild(D) : D.parentElement !== r && r.insertBefore(D, W), D.hidden = !g, r.classList.toggle("pluno-pa-widget--proactive-suggestion", g), r.classList.toggle(
|
|
5199
5200
|
"pluno-pa-widget--proactive-suggestion-in-panel",
|
|
5200
5201
|
P
|
|
5201
|
-
), j.textContent = a?.suggestedQuery ?? "",
|
|
5202
|
+
), j.textContent = a?.suggestedQuery ?? "", ho.hidden = e.proactiveSuggestion === null, fo.hidden = He === null;
|
|
5202
5203
|
const H = ue === "success";
|
|
5203
5204
|
Ce.hidden = H, Jt.hidden = H, Jt.disabled = ue === "submitting" || Ce.value.trim().length === 0, Jt.textContent = ue === "submitting" ? "Sending…" : "Send feedback", Pn.textContent = ue === "success" ? "Thanks — this helps improve your suggestions." : ue === "error" ? "Couldn’t send feedback. Please try again." : "Tell Pluno what made this suggestion miss the mark.", Pn.classList.toggle(
|
|
5204
5205
|
"pluno-pa-widget__proactive-suggestion-feedback-status--success",
|
|
@@ -5208,28 +5209,28 @@ async function ng(t = {}) {
|
|
|
5208
5209
|
ue === "error"
|
|
5209
5210
|
), Rn();
|
|
5210
5211
|
};
|
|
5211
|
-
let
|
|
5212
|
+
let qi = !1, zi = !1;
|
|
5212
5213
|
const Zt = (a) => {
|
|
5213
|
-
|
|
5214
|
+
Mi(e.billingStatus) || (qi = !1), e.billingStatus?.usingPaidCreditFallback !== !0 && (zi = !1), th(
|
|
5214
5215
|
K,
|
|
5215
5216
|
e.billingStatus,
|
|
5216
5217
|
a,
|
|
5217
|
-
Oi,
|
|
5218
|
-
() => {
|
|
5219
|
-
Oi = !0, Zt(a);
|
|
5220
|
-
},
|
|
5221
5218
|
qi,
|
|
5222
5219
|
() => {
|
|
5223
5220
|
qi = !0, Zt(a);
|
|
5221
|
+
},
|
|
5222
|
+
zi,
|
|
5223
|
+
() => {
|
|
5224
|
+
zi = !0, Zt(a);
|
|
5224
5225
|
}
|
|
5225
5226
|
);
|
|
5226
5227
|
};
|
|
5227
|
-
xe.hidden = !e.attachmentsEnabled, ie.disabled = !e.attachmentsEnabled, ie.accept = e.productVariant === "personal" ? "" : Ud,
|
|
5228
|
+
xe.hidden = !e.attachmentsEnabled, ie.disabled = !e.attachmentsEnabled, ie.accept = e.productVariant === "personal" ? "" : Ud, Hr(_), Hr(C);
|
|
5228
5229
|
let ge = [], Ln = !1, Qt = null, Ze = null;
|
|
5229
|
-
const
|
|
5230
|
-
const v = li(
|
|
5230
|
+
const Bi = (a) => a === C ? "widget_composer" : a === _ ? "widget_launcher" : a && o.contains(a) ? "widget_control" : a === f.body ? "body" : a === f.documentElement ? "document" : a ? "host_page" : "none", pt = (a, g, w = {}) => {
|
|
5231
|
+
const v = li(f), P = w.skipIfAlreadyFocused === !0 && v === a;
|
|
5231
5232
|
P || (w.preventScroll ? a.focus({ preventScroll: !0 }) : a.focus());
|
|
5232
|
-
const H = li(
|
|
5233
|
+
const H = li(f);
|
|
5233
5234
|
return Se(
|
|
5234
5235
|
"web-sdk.widget.focus",
|
|
5235
5236
|
"Programmatic widget focus",
|
|
@@ -5239,9 +5240,9 @@ async function ng(t = {}) {
|
|
|
5239
5240
|
widgetAgeMs: Date.now() - i,
|
|
5240
5241
|
scheduledDelayMs: w.scheduledAt === void 0 ? null : Date.now() - w.scheduledAt,
|
|
5241
5242
|
persistedFocusAgeMs: w.persistedFocusAgeMs ?? null,
|
|
5242
|
-
previousFocus:
|
|
5243
|
-
requestedFocus:
|
|
5244
|
-
resultingFocus:
|
|
5243
|
+
previousFocus: Bi(v),
|
|
5244
|
+
requestedFocus: Bi(a),
|
|
5245
|
+
resultingFocus: Bi(H),
|
|
5245
5246
|
focusSkipped: P,
|
|
5246
5247
|
focusSucceeded: H === a,
|
|
5247
5248
|
hostConnected: s.isConnected,
|
|
@@ -5268,7 +5269,7 @@ async function ng(t = {}) {
|
|
|
5268
5269
|
}, mo = e.loginRequired || e.signupRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async () => dl(e.tokenEndpoint) : void 0);
|
|
5269
5270
|
if (!e.loginRequired && !e.signupRequired && !e.token && !mo && !e.webSocketFactory)
|
|
5270
5271
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
5271
|
-
const ul = window.fetch.bind(window),
|
|
5272
|
+
const ul = window.fetch.bind(window), Wi = Hh(e.clientId);
|
|
5272
5273
|
let I;
|
|
5273
5274
|
try {
|
|
5274
5275
|
const a = {
|
|
@@ -5283,7 +5284,7 @@ async function ng(t = {}) {
|
|
|
5283
5284
|
}),
|
|
5284
5285
|
entrySurface: e.entrySurface ?? (e.sdkPreviewChannelId ? "extension_widget" : "embedded_widget"),
|
|
5285
5286
|
initialStarterPrompts: e.initialStarterPrompts,
|
|
5286
|
-
clientId:
|
|
5287
|
+
clientId: Wi.clientId,
|
|
5287
5288
|
restorePersistedState: e.restorePersistedState,
|
|
5288
5289
|
expectedPersistedSessionId: e.expectedPersistedSessionId,
|
|
5289
5290
|
runtimeCommunityId: e.runtimeCommunityId,
|
|
@@ -5301,15 +5302,15 @@ async function ng(t = {}) {
|
|
|
5301
5302
|
// cross-tab collision timer because a host-page startup long task can stretch that timer into seconds.
|
|
5302
5303
|
skipStoredTransportIdentityCollisionCheck: !!e.sdkPreviewChannelId
|
|
5303
5304
|
};
|
|
5304
|
-
I = await
|
|
5305
|
+
I = await to.init(a);
|
|
5305
5306
|
} catch (a) {
|
|
5306
|
-
throw
|
|
5307
|
+
throw Wi.release(), s.remove(), a;
|
|
5307
5308
|
}
|
|
5308
5309
|
let $e = ui.find(
|
|
5309
5310
|
(a) => a.value === e.model
|
|
5310
|
-
)?.value ??
|
|
5311
|
-
const
|
|
5312
|
-
M.hidden = !
|
|
5311
|
+
)?.value ?? _i[0].value, tn = !1;
|
|
5312
|
+
const wo = e.productVariant === "personal" && e.onModelChange !== void 0;
|
|
5313
|
+
M.hidden = !wo;
|
|
5313
5314
|
const qt = () => {
|
|
5314
5315
|
const a = ui.find((w) => w.value === $e), g = tn;
|
|
5315
5316
|
X.textContent = a?.label ?? $e, M.dataset.loading = String(g), M.setAttribute("aria-disabled", String(g));
|
|
@@ -5317,16 +5318,16 @@ async function ng(t = {}) {
|
|
|
5317
5318
|
const v = w.dataset.model === $e;
|
|
5318
5319
|
w.classList.toggle("is-selected", v), w.setAttribute("aria-selected", String(v)), w.disabled = g;
|
|
5319
5320
|
}
|
|
5320
|
-
},
|
|
5321
|
+
}, bo = (a) => {
|
|
5321
5322
|
$e = a, I.setModel(a), qt();
|
|
5322
5323
|
};
|
|
5323
5324
|
qt(), M.addEventListener("toggle", () => {
|
|
5324
5325
|
M.open && tn && (M.open = !1), M.open || M.querySelector(".pluno-pa-widget__model-more")?.removeAttribute("open");
|
|
5325
5326
|
});
|
|
5326
|
-
const
|
|
5327
|
+
const yo = (a) => {
|
|
5327
5328
|
M.open && !a.composedPath().includes(M) && (M.open = !1);
|
|
5328
5329
|
};
|
|
5329
|
-
|
|
5330
|
+
f.addEventListener("pointerdown", yo, !0);
|
|
5330
5331
|
for (const a of F)
|
|
5331
5332
|
a.addEventListener("click", () => {
|
|
5332
5333
|
const g = ui.find((v) => v.value === a.dataset.model);
|
|
@@ -5335,7 +5336,7 @@ async function ng(t = {}) {
|
|
|
5335
5336
|
return;
|
|
5336
5337
|
}
|
|
5337
5338
|
const w = $e;
|
|
5338
|
-
$e = g.value, tn = !0, M.open = !1, M.title = "", qt(), Promise.resolve(e.onModelChange?.(g.value)).then(() =>
|
|
5339
|
+
$e = g.value, tn = !0, M.open = !1, M.title = "", qt(), Promise.resolve(e.onModelChange?.(g.value)).then(() => bo(g.value)).catch(() => {
|
|
5339
5340
|
$e = w, M.title = "Could not change model";
|
|
5340
5341
|
}).finally(() => {
|
|
5341
5342
|
tn = !1, qt();
|
|
@@ -5343,7 +5344,7 @@ async function ng(t = {}) {
|
|
|
5343
5344
|
});
|
|
5344
5345
|
b.appendChild(s);
|
|
5345
5346
|
const Dn = e.manageTaskPageTitle && e.productVariant === "personal" && e.entrySurface === "main_web_chat" ? new wu(
|
|
5346
|
-
bu(
|
|
5347
|
+
bu(f)
|
|
5347
5348
|
) : null;
|
|
5348
5349
|
Se(
|
|
5349
5350
|
"web-sdk.widget",
|
|
@@ -5355,12 +5356,12 @@ async function ng(t = {}) {
|
|
|
5355
5356
|
cssAccent: r.style.getPropertyValue("--pluno-pa-accent")
|
|
5356
5357
|
}
|
|
5357
5358
|
);
|
|
5358
|
-
const
|
|
5359
|
+
const Fi = new Set(d.openToolGroupKeys), vt = new Set(
|
|
5359
5360
|
d.seenShareCandidateIds
|
|
5360
5361
|
), nn = new Set(vt);
|
|
5361
5362
|
let sn = d.sharePromptsDisabled, Ne = null, ut = null, ee = !1, on = !(e.loginRequired || e.signupRequired), gt = !1, xt = {
|
|
5362
5363
|
enabled: !0
|
|
5363
|
-
}, It = 0,
|
|
5364
|
+
}, It = 0, Hi = null, Tt = null, Ct = null, Un = null, _o = "", _e = !1, Ee = !1, je = [], rn = null, kt = null, Nn = !1, Et = 0, Ae = null, So = location.origin, vo = I.getState().sessionId, xo = I.getState().user?.id ?? null, $i = I.getState().status;
|
|
5364
5365
|
const Oe = (a, g) => {
|
|
5365
5366
|
xt = { enabled: a, reason: g };
|
|
5366
5367
|
}, qe = () => {
|
|
@@ -5370,11 +5371,11 @@ async function ng(t = {}) {
|
|
|
5370
5371
|
}, hl = (a = "jump") => {
|
|
5371
5372
|
Oe(!0, a), qe(), In(O, () => xt.enabled), It = O.scrollTop;
|
|
5372
5373
|
}, On = (a) => {
|
|
5373
|
-
|
|
5374
|
-
|
|
5374
|
+
Hi = a, Tt !== null && window.clearTimeout(Tt), Tt = window.setTimeout(() => {
|
|
5375
|
+
Hi = null, Tt = null;
|
|
5375
5376
|
}, 500);
|
|
5376
5377
|
}, ze = () => {
|
|
5377
|
-
if (
|
|
5378
|
+
if (fe.hidden = e.layout === "page" || e.loginRequired, Ye.hidden = !_e, fe.setAttribute("aria-expanded", String(_e)), se.classList.toggle(
|
|
5378
5379
|
"pluno-pa-widget__history-list--center",
|
|
5379
5380
|
Ee && je.length === 0
|
|
5380
5381
|
), se.replaceChildren(), Ee && je.length === 0) {
|
|
@@ -5401,7 +5402,7 @@ async function ng(t = {}) {
|
|
|
5401
5402
|
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", se.appendChild(a);
|
|
5402
5403
|
}
|
|
5403
5404
|
Ie.textContent = kt ?? (!Ee && je.length === 0 ? "No recent chats for this page yet." : ""), Ie.hidden = Ie.textContent.length === 0;
|
|
5404
|
-
},
|
|
5405
|
+
}, Io = async (a, g = Et) => {
|
|
5405
5406
|
if (!Ee) {
|
|
5406
5407
|
Ee = !0, kt = null, ze();
|
|
5407
5408
|
try {
|
|
@@ -5425,26 +5426,26 @@ async function ng(t = {}) {
|
|
|
5425
5426
|
Ee = !1, ze();
|
|
5426
5427
|
}
|
|
5427
5428
|
}
|
|
5428
|
-
},
|
|
5429
|
-
Ae !== null && (window.clearTimeout(Ae), Ae = null), Et += 1, Ee = !1, je = [], rn = null, kt = null, Nn = !1, ze(), !(e.layout === "page" || e.loginRequired || e.signupRequired) &&
|
|
5429
|
+
}, To = () => {
|
|
5430
|
+
Ae !== null && (window.clearTimeout(Ae), Ae = null), Et += 1, Ee = !1, je = [], rn = null, kt = null, Nn = !1, ze(), !(e.layout === "page" || e.loginRequired || e.signupRequired) && Io(null, Et);
|
|
5430
5431
|
}, qn = () => {
|
|
5431
5432
|
Ae === null && (Ae = window.setTimeout(() => {
|
|
5432
|
-
Ae = null, !(ee || !r.classList.contains("pluno-pa-widget--open")) &&
|
|
5433
|
+
Ae = null, !(ee || !r.classList.contains("pluno-pa-widget--open")) && To();
|
|
5433
5434
|
}, 0));
|
|
5434
|
-
},
|
|
5435
|
-
!rn || Ee || se.scrollHeight - se.scrollTop - se.clientHeight <= 24 &&
|
|
5436
|
-
},
|
|
5437
|
-
ee || typeof document > "u" || (
|
|
5438
|
-
},
|
|
5439
|
-
|
|
5435
|
+
}, fl = () => {
|
|
5436
|
+
!rn || Ee || se.scrollHeight - se.scrollTop - se.clientHeight <= 24 && Io(rn);
|
|
5437
|
+
}, Co = () => {
|
|
5438
|
+
ee || typeof document > "u" || (Xr(o, e.accentColor), s.isConnected || (e.mountTarget?.isConnected ? e.mountTarget.appendChild(s) : e.mountTarget || f.body?.appendChild(s)));
|
|
5439
|
+
}, ko = new MutationObserver(Co);
|
|
5440
|
+
ko.observe(f.documentElement, {
|
|
5440
5441
|
childList: !0,
|
|
5441
5442
|
subtree: !0
|
|
5442
|
-
}),
|
|
5443
|
+
}), Co();
|
|
5443
5444
|
const an = (a = !0) => {
|
|
5444
5445
|
const g = kn(r, a);
|
|
5445
|
-
return
|
|
5446
|
+
return wi(
|
|
5446
5447
|
r,
|
|
5447
|
-
u ?
|
|
5448
|
+
u ? bi(u, g) : cg(
|
|
5448
5449
|
r,
|
|
5449
5450
|
e.position,
|
|
5450
5451
|
g
|
|
@@ -5462,7 +5463,7 @@ async function ng(t = {}) {
|
|
|
5462
5463
|
composerValue: C.value,
|
|
5463
5464
|
focusedInput: a,
|
|
5464
5465
|
focusedInputAt: a ? Date.now() : null,
|
|
5465
|
-
openToolGroupKeys: [...
|
|
5466
|
+
openToolGroupKeys: [...Fi],
|
|
5466
5467
|
launcherPosition: p ? u : null,
|
|
5467
5468
|
panelSize: h,
|
|
5468
5469
|
seenShareCandidateIds: [...vt].slice(
|
|
@@ -5474,18 +5475,18 @@ async function ng(t = {}) {
|
|
|
5474
5475
|
e.onDisplayStateChange?.(a, g);
|
|
5475
5476
|
}, ln = (a, g = !0, w = "external_request") => {
|
|
5476
5477
|
const v = r.classList.contains("pluno-pa-widget--minimized");
|
|
5477
|
-
if (
|
|
5478
|
-
r.classList.remove("pluno-pa-widget--minimized"),
|
|
5478
|
+
if (Jr(e, a), a === "shown") {
|
|
5479
|
+
r.classList.remove("pluno-pa-widget--minimized"), m.removeAttribute("tabindex"), m.removeAttribute("role"), m.removeAttribute("aria-label"), !r.classList.contains("pluno-pa-widget--open") && !r.classList.contains("pluno-pa-widget--closing") && dn(!1), g && zn("shown", w);
|
|
5479
5480
|
return;
|
|
5480
5481
|
}
|
|
5481
|
-
Ne !== null && (window.clearTimeout(Ne), Ne = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"),
|
|
5482
|
+
Ne !== null && (window.clearTimeout(Ne), Ne = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), m.hidden = !1, m.setAttribute("role", "button"), m.setAttribute("aria-label", "Open Pluno"), L.hidden = !0, W.hidden = !0, m.tabIndex = 0, C.value = "", ke(), wt(
|
|
5482
5483
|
r,
|
|
5483
|
-
|
|
5484
|
+
Ss(
|
|
5484
5485
|
r,
|
|
5485
5486
|
u,
|
|
5486
5487
|
e.position
|
|
5487
5488
|
)
|
|
5488
|
-
),
|
|
5489
|
+
), zr(r), te(), !v && e.layout === "floating" && I.recordWidgetLifecycle("minimized", w), g && zn("minimized", w);
|
|
5489
5490
|
}, At = (a, g = {}) => {
|
|
5490
5491
|
bg(a, {
|
|
5491
5492
|
debugVersion: eg,
|
|
@@ -5497,9 +5498,9 @@ async function ng(t = {}) {
|
|
|
5497
5498
|
right: r.style.right,
|
|
5498
5499
|
bottom: r.style.bottom
|
|
5499
5500
|
},
|
|
5500
|
-
rootRect:
|
|
5501
|
-
launcherRect:
|
|
5502
|
-
panelRect:
|
|
5501
|
+
rootRect: Is(r),
|
|
5502
|
+
launcherRect: Is(m),
|
|
5503
|
+
panelRect: Is(L),
|
|
5503
5504
|
viewport: be(),
|
|
5504
5505
|
panelHidden: L.hidden,
|
|
5505
5506
|
closeHidden: W.hidden,
|
|
@@ -5517,21 +5518,21 @@ async function ng(t = {}) {
|
|
|
5517
5518
|
}), g;
|
|
5518
5519
|
}, Bn = (a, g) => {
|
|
5519
5520
|
if (!a || !g) {
|
|
5520
|
-
|
|
5521
|
+
zr(r);
|
|
5521
5522
|
return;
|
|
5522
5523
|
}
|
|
5523
5524
|
wg(r, {
|
|
5524
5525
|
x: a.x - g.x,
|
|
5525
5526
|
y: a.y - g.y
|
|
5526
5527
|
});
|
|
5527
|
-
},
|
|
5528
|
+
}, ji = () => {
|
|
5528
5529
|
const a = Rt(h).width;
|
|
5529
5530
|
return L.getBoundingClientRect().width || a;
|
|
5530
|
-
},
|
|
5531
|
+
}, Eo = () => {
|
|
5531
5532
|
if (r.classList.contains("pluno-pa-widget--minimized")) {
|
|
5532
5533
|
wt(
|
|
5533
5534
|
r,
|
|
5534
|
-
|
|
5535
|
+
Ss(
|
|
5535
5536
|
r,
|
|
5536
5537
|
u,
|
|
5537
5538
|
e.position
|
|
@@ -5541,14 +5542,14 @@ async function ng(t = {}) {
|
|
|
5541
5542
|
}
|
|
5542
5543
|
const a = dn();
|
|
5543
5544
|
if (r.classList.contains("pluno-pa-widget--open") || r.classList.contains("pluno-pa-widget--closing")) {
|
|
5544
|
-
|
|
5545
|
+
_s(r, h);
|
|
5545
5546
|
const g = Rt(h);
|
|
5546
|
-
|
|
5547
|
+
Ts(
|
|
5547
5548
|
$,
|
|
5548
|
-
|
|
5549
|
+
ji()
|
|
5549
5550
|
);
|
|
5550
5551
|
const w = xn(
|
|
5551
|
-
y ?
|
|
5552
|
+
y ? bi(y, g) : xs(
|
|
5552
5553
|
r,
|
|
5553
5554
|
a,
|
|
5554
5555
|
e.position,
|
|
@@ -5565,20 +5566,20 @@ async function ng(t = {}) {
|
|
|
5565
5566
|
{ visibleLauncherPosition: a }
|
|
5566
5567
|
);
|
|
5567
5568
|
};
|
|
5568
|
-
let
|
|
5569
|
+
let Ao = () => {
|
|
5569
5570
|
};
|
|
5570
|
-
window.addEventListener("resize",
|
|
5571
|
+
window.addEventListener("resize", Eo), e.movableLauncher && x ? (dn(), Ao = ag({
|
|
5571
5572
|
root: r,
|
|
5572
|
-
launcher:
|
|
5573
|
+
launcher: m,
|
|
5573
5574
|
launcherDragHandle: x,
|
|
5574
5575
|
getPosition: () => an(),
|
|
5575
5576
|
setPosition: (a) => {
|
|
5576
|
-
const g = a, w = kn(r), v =
|
|
5577
|
+
const g = a, w = kn(r), v = wi(
|
|
5577
5578
|
r,
|
|
5578
5579
|
a,
|
|
5579
5580
|
w
|
|
5580
5581
|
);
|
|
5581
|
-
u =
|
|
5582
|
+
u = vs(
|
|
5582
5583
|
v,
|
|
5583
5584
|
w
|
|
5584
5585
|
), y = null, wt(r, v), Rn(), At("Dragging closed launcher", {
|
|
@@ -5588,12 +5589,12 @@ async function ng(t = {}) {
|
|
|
5588
5589
|
persist: () => {
|
|
5589
5590
|
p = !0, te(), At("Persisted closed launcher drag position");
|
|
5590
5591
|
}
|
|
5591
|
-
})) : wt(r, null),
|
|
5592
|
-
const
|
|
5592
|
+
})) : wt(r, null), _s(r, h);
|
|
5593
|
+
const Mo = () => {
|
|
5593
5594
|
const a = Rt(h), g = an();
|
|
5594
5595
|
return {
|
|
5595
5596
|
position: xn(
|
|
5596
|
-
y ?
|
|
5597
|
+
y ? bi(y, a) : xs(
|
|
5597
5598
|
r,
|
|
5598
5599
|
g,
|
|
5599
5600
|
e.position,
|
|
@@ -5603,16 +5604,16 @@ async function ng(t = {}) {
|
|
|
5603
5604
|
),
|
|
5604
5605
|
size: a
|
|
5605
5606
|
};
|
|
5606
|
-
},
|
|
5607
|
-
h =
|
|
5607
|
+
}, ml = (a) => {
|
|
5608
|
+
h = Ui(a.size), _s(r, h), Ts(
|
|
5608
5609
|
$,
|
|
5609
|
-
|
|
5610
|
+
ji()
|
|
5610
5611
|
);
|
|
5611
5612
|
const g = xn(
|
|
5612
5613
|
a.position,
|
|
5613
5614
|
Rt(h)
|
|
5614
5615
|
);
|
|
5615
|
-
y =
|
|
5616
|
+
y = vs(
|
|
5616
5617
|
g,
|
|
5617
5618
|
Rt(h)
|
|
5618
5619
|
);
|
|
@@ -5622,9 +5623,9 @@ async function ng(t = {}) {
|
|
|
5622
5623
|
const g = Rt(h), w = xn(
|
|
5623
5624
|
a,
|
|
5624
5625
|
g
|
|
5625
|
-
), v = kn(r), P =
|
|
5626
|
+
), v = kn(r), P = wi(
|
|
5626
5627
|
r,
|
|
5627
|
-
|
|
5628
|
+
mg(
|
|
5628
5629
|
w,
|
|
5629
5630
|
g,
|
|
5630
5631
|
v,
|
|
@@ -5632,34 +5633,34 @@ async function ng(t = {}) {
|
|
|
5632
5633
|
),
|
|
5633
5634
|
v
|
|
5634
5635
|
);
|
|
5635
|
-
u =
|
|
5636
|
+
u = vs(
|
|
5636
5637
|
P,
|
|
5637
5638
|
v
|
|
5638
5639
|
), p = !0, y = null, wt(r, P), Bn(w, P);
|
|
5639
5640
|
}, bl = e.movableLauncher && B ? lg({
|
|
5640
5641
|
root: r,
|
|
5641
5642
|
handle: B,
|
|
5642
|
-
getPosition: () =>
|
|
5643
|
+
getPosition: () => Mo().position,
|
|
5643
5644
|
setPosition: wl,
|
|
5644
5645
|
persist: te
|
|
5645
5646
|
}) : () => {
|
|
5646
5647
|
}, yl = q.length > 0 ? dg({
|
|
5647
5648
|
root: r,
|
|
5648
5649
|
handles: q,
|
|
5649
|
-
getBounds:
|
|
5650
|
-
setBounds:
|
|
5650
|
+
getBounds: Mo,
|
|
5651
|
+
setBounds: ml,
|
|
5651
5652
|
persist: te
|
|
5652
5653
|
}) : () => {
|
|
5653
5654
|
};
|
|
5654
|
-
let
|
|
5655
|
-
const
|
|
5656
|
-
if (!(!e.billingStatusLoader ||
|
|
5657
|
-
|
|
5655
|
+
let Gi = !1;
|
|
5656
|
+
const Po = async () => {
|
|
5657
|
+
if (!(!e.billingStatusLoader || Gi)) {
|
|
5658
|
+
Gi = !0;
|
|
5658
5659
|
try {
|
|
5659
5660
|
const a = await e.billingStatusLoader();
|
|
5660
5661
|
if (ee)
|
|
5661
5662
|
return;
|
|
5662
|
-
|
|
5663
|
+
jr(
|
|
5663
5664
|
e.billingStatus,
|
|
5664
5665
|
a,
|
|
5665
5666
|
I.getState().lastErrorCode
|
|
@@ -5671,21 +5672,21 @@ async function ng(t = {}) {
|
|
|
5671
5672
|
{ message: a instanceof Error ? a.message : String(a) }
|
|
5672
5673
|
);
|
|
5673
5674
|
} finally {
|
|
5674
|
-
|
|
5675
|
+
Gi = !1;
|
|
5675
5676
|
}
|
|
5676
5677
|
}
|
|
5677
5678
|
};
|
|
5678
5679
|
let pn = null;
|
|
5679
|
-
const
|
|
5680
|
+
const Ro = (a) => {
|
|
5680
5681
|
const g = Date.now(), w = window.location.href;
|
|
5681
5682
|
a === "composer_input" && pn?.scope === w && g - pn.requestedAt < _u || (a === "composer_input" && (pn = { scope: w, requestedAt: g }), I.warmup(a));
|
|
5682
5683
|
}, Be = (a = "", g = !0, w = !0, v = !0, P = "external_request") => {
|
|
5683
5684
|
const H = r.classList.contains("pluno-pa-widget--open") || !L.hidden && !r.classList.contains("pluno-pa-widget--closing");
|
|
5684
|
-
!H && v &&
|
|
5685
|
+
!H && v && Ro("panel_open"), Po(), gn && (gn = !1, Qi()), r.classList.contains("pluno-pa-widget--open") || (y = null), Ne !== null && (window.clearTimeout(Ne), Ne = null), ln("shown", !1), L.hidden = !1, W.hidden = !1, Ts(
|
|
5685
5686
|
$,
|
|
5686
|
-
|
|
5687
|
+
ji()
|
|
5687
5688
|
), r.classList.remove("pluno-pa-widget--closing"), ke();
|
|
5688
|
-
const U = dn(), Ke =
|
|
5689
|
+
const U = dn(), Ke = xs(
|
|
5689
5690
|
r,
|
|
5690
5691
|
U,
|
|
5691
5692
|
e.position,
|
|
@@ -5695,7 +5696,7 @@ async function ng(t = {}) {
|
|
|
5695
5696
|
openPanelPosition: Ke,
|
|
5696
5697
|
visibleLauncherPosition: U
|
|
5697
5698
|
}), Oe(!0, "open"), qe(), !H && e.layout === "floating" && I.recordWidgetLifecycle("opened", P), !g) {
|
|
5698
|
-
r.classList.add("pluno-pa-widget--open"), H || qn(),
|
|
5699
|
+
r.classList.add("pluno-pa-widget--open"), H || qn(), m.hidden = !0, a && (C.value = a, vn(C)), In(O, () => xt.enabled), It = O.scrollTop, w && (pt(C, "panel_open_immediate"), C.setSelectionRange(C.value.length, C.value.length)), te(), zn("shown", P), e.onPanelOpenChange?.(!0, P);
|
|
5699
5700
|
return;
|
|
5700
5701
|
}
|
|
5701
5702
|
const Rl = Date.now();
|
|
@@ -5703,33 +5704,33 @@ async function ng(t = {}) {
|
|
|
5703
5704
|
r.classList.add("pluno-pa-widget--open"), H || qn(), a && (C.value = a, vn(C)), In(O, () => xt.enabled), It = O.scrollTop, w && (pt(C, "panel_open_animation", {
|
|
5704
5705
|
scheduledAt: Rl
|
|
5705
5706
|
}), C.setSelectionRange(C.value.length, C.value.length)), te(), zn("shown", P), e.onPanelOpenChange?.(!0, P), Ne = window.setTimeout(() => {
|
|
5706
|
-
|
|
5707
|
+
m.hidden = !0, In(O, () => xt.enabled), It = O.scrollTop;
|
|
5707
5708
|
}, 220);
|
|
5708
5709
|
});
|
|
5709
|
-
},
|
|
5710
|
+
}, Ki = (a = "external_request") => {
|
|
5710
5711
|
const g = r.classList.contains("pluno-pa-widget--open") || !L.hidden && !r.classList.contains("pluno-pa-widget--closing");
|
|
5711
|
-
Ne !== null && (window.clearTimeout(Ne), Ne = null),
|
|
5712
|
+
Ne !== null && (window.clearTimeout(Ne), Ne = null), m.hidden = !1, u && (dn(!1), At("Closing launcher at stored position")), r.classList.remove("pluno-pa-widget--open"), r.classList.add("pluno-pa-widget--closing"), ke(), te(), g && e.layout === "floating" && I.recordWidgetLifecycle("closed", a), e.onPanelOpenChange?.(!1, a), Ne = window.setTimeout(() => {
|
|
5712
5713
|
L.hidden = !0, W.hidden = !0, y = null, r.classList.remove("pluno-pa-widget--closing");
|
|
5713
5714
|
}, 220);
|
|
5714
5715
|
};
|
|
5715
|
-
|
|
5716
|
+
m.addEventListener("submit", (a) => {
|
|
5716
5717
|
a.preventDefault(), Be(_.value, !0, !0, !0, "launcher_input"), _.value = "";
|
|
5717
5718
|
}), x?.addEventListener("click", (a) => {
|
|
5718
5719
|
a.preventDefault(), a.stopPropagation();
|
|
5719
|
-
}),
|
|
5720
|
+
}), m.addEventListener("click", (a) => {
|
|
5720
5721
|
a.target === _ && !x || (Be(_.value, !0, !0, !0, "launcher_click"), _.value = "");
|
|
5721
5722
|
});
|
|
5722
|
-
const
|
|
5723
|
+
const Lo = () => {
|
|
5723
5724
|
Be(_.value, !0, !0, !0, "launcher_focus"), _.value = "";
|
|
5724
5725
|
};
|
|
5725
|
-
_.addEventListener("focus",
|
|
5726
|
+
_.addEventListener("focus", Lo), _.addEventListener("input", () => {
|
|
5726
5727
|
if (!_.value)
|
|
5727
5728
|
return;
|
|
5728
5729
|
const a = _.value;
|
|
5729
5730
|
Be(a, !0, !0, !0, "launcher_input"), _.value = "";
|
|
5730
5731
|
});
|
|
5731
5732
|
let cn = null, ht = null, Wn = null, Mt = null, Ge = null, le = null;
|
|
5732
|
-
const Fn = (a) => a === _ || a === C,
|
|
5733
|
+
const Fn = (a) => a === _ || a === C, Do = (a) => a.composedPath().find(Fn) ?? null, _l = (a) => {
|
|
5733
5734
|
let g = a;
|
|
5734
5735
|
for (; g; ) {
|
|
5735
5736
|
if (g.assignedSlot)
|
|
@@ -5737,12 +5738,12 @@ async function ng(t = {}) {
|
|
|
5737
5738
|
g = g.parentElement;
|
|
5738
5739
|
}
|
|
5739
5740
|
return null;
|
|
5740
|
-
},
|
|
5741
|
+
}, Vi = (a) => {
|
|
5741
5742
|
if (!(a instanceof Element) || a.getRootNode() === r.getRootNode())
|
|
5742
5743
|
return null;
|
|
5743
5744
|
let g = a;
|
|
5744
5745
|
for (; g; ) {
|
|
5745
|
-
const w = g.closest(
|
|
5746
|
+
const w = g.closest(Ar);
|
|
5746
5747
|
if (w)
|
|
5747
5748
|
return w;
|
|
5748
5749
|
const v = _l(g);
|
|
@@ -5754,8 +5755,8 @@ async function ng(t = {}) {
|
|
|
5754
5755
|
g = P instanceof ShadowRoot ? P.host : null;
|
|
5755
5756
|
}
|
|
5756
5757
|
return null;
|
|
5757
|
-
},
|
|
5758
|
-
if (!a.isConnected || !a.matches(
|
|
5758
|
+
}, Yi = () => li(f), Sl = (a) => {
|
|
5759
|
+
if (!a.isConnected || !a.matches(Ar))
|
|
5759
5760
|
return !1;
|
|
5760
5761
|
if (!(a instanceof HTMLElement))
|
|
5761
5762
|
return !0;
|
|
@@ -5765,7 +5766,7 @@ async function ng(t = {}) {
|
|
|
5765
5766
|
return a.checkVisibility();
|
|
5766
5767
|
const g = window.getComputedStyle(a);
|
|
5767
5768
|
return g.display !== "none" && g.visibility !== "hidden";
|
|
5768
|
-
},
|
|
5769
|
+
}, Xi = (a, g) => {
|
|
5769
5770
|
if (!g)
|
|
5770
5771
|
return;
|
|
5771
5772
|
Ge !== null && window.clearTimeout(Ge);
|
|
@@ -5778,50 +5779,50 @@ async function ng(t = {}) {
|
|
|
5778
5779
|
}, 0);
|
|
5779
5780
|
}, un = (a, g = null) => {
|
|
5780
5781
|
if (Qe === a) {
|
|
5781
|
-
a &&
|
|
5782
|
+
a && Xi(a, g);
|
|
5782
5783
|
return;
|
|
5783
5784
|
}
|
|
5784
|
-
Qe = a, a !== null ? (
|
|
5785
|
+
Qe = a, a !== null ? (Xi(a, g), Mt = window.setInterval(() => {
|
|
5785
5786
|
const w = Qe;
|
|
5786
5787
|
if (!w || !Sl(w)) {
|
|
5787
5788
|
un(null);
|
|
5788
5789
|
return;
|
|
5789
5790
|
}
|
|
5790
|
-
|
|
5791
|
+
Xi(w, null);
|
|
5791
5792
|
}, zu)) : (Mt !== null && (window.clearInterval(Mt), Mt = null), Ge !== null && (window.clearTimeout(Ge), Ge = null), Wn = null);
|
|
5792
5793
|
}, vl = () => {
|
|
5793
5794
|
Mt !== null && (window.clearInterval(Mt), Mt = null), Ge !== null && (window.clearTimeout(Ge), Ge = null), le !== null && (window.clearTimeout(le), le = null);
|
|
5794
|
-
},
|
|
5795
|
-
const g =
|
|
5795
|
+
}, Uo = (a) => {
|
|
5796
|
+
const g = Do(a);
|
|
5796
5797
|
if (!g)
|
|
5797
5798
|
return;
|
|
5798
5799
|
const w = Date.now();
|
|
5799
5800
|
ht = w, cn = w, le !== null && window.clearTimeout(le);
|
|
5800
|
-
const v = Qe ??
|
|
5801
|
+
const v = Qe ?? Vi(Yi());
|
|
5801
5802
|
v && (un(v, g), a.stopImmediatePropagation()), le = window.setTimeout(() => {
|
|
5802
5803
|
if (le = null, ht !== w)
|
|
5803
5804
|
return;
|
|
5804
|
-
const P =
|
|
5805
|
+
const P = Yi();
|
|
5805
5806
|
if (P === g) {
|
|
5806
5807
|
ht = null;
|
|
5807
5808
|
return;
|
|
5808
5809
|
}
|
|
5809
|
-
const H =
|
|
5810
|
+
const H = Vi(P);
|
|
5810
5811
|
H && un(H, g);
|
|
5811
5812
|
}, 0);
|
|
5812
5813
|
}, Hn = (a) => {
|
|
5813
|
-
const g =
|
|
5814
|
-
g && (cn = Date.now(), Qe !== null && (a.stopImmediatePropagation(), ht = null, le !== null && (window.clearTimeout(le), le = null), te(), a.type === "focus" && g === _ &&
|
|
5814
|
+
const g = Do(a);
|
|
5815
|
+
g && (cn = Date.now(), Qe !== null && (a.stopImmediatePropagation(), ht = null, le !== null && (window.clearTimeout(le), le = null), te(), a.type === "focus" && g === _ && Lo()));
|
|
5815
5816
|
};
|
|
5816
|
-
|
|
5817
|
+
f.defaultView?.addEventListener(
|
|
5817
5818
|
"pointerdown",
|
|
5818
|
-
|
|
5819
|
+
Uo,
|
|
5819
5820
|
!0
|
|
5820
|
-
),
|
|
5821
|
+
), f.defaultView?.addEventListener(
|
|
5821
5822
|
"focus",
|
|
5822
5823
|
Hn,
|
|
5823
5824
|
!0
|
|
5824
|
-
),
|
|
5825
|
+
), f.defaultView?.addEventListener(
|
|
5825
5826
|
"focusin",
|
|
5826
5827
|
Hn,
|
|
5827
5828
|
!0
|
|
@@ -5833,12 +5834,12 @@ async function ng(t = {}) {
|
|
|
5833
5834
|
if (!Fn(a.target) || Qe !== null)
|
|
5834
5835
|
return;
|
|
5835
5836
|
const g = cn;
|
|
5836
|
-
if (cn = null, g === null || Date.now() - g >
|
|
5837
|
+
if (cn = null, g === null || Date.now() - g > Mr)
|
|
5837
5838
|
return;
|
|
5838
|
-
const w = a.target, v = ht !== null && Date.now() - ht <=
|
|
5839
|
+
const w = a.target, v = ht !== null && Date.now() - ht <= Mr;
|
|
5839
5840
|
ht = null, le !== null && (window.clearTimeout(le), le = null);
|
|
5840
5841
|
const P = (H) => {
|
|
5841
|
-
const U =
|
|
5842
|
+
const U = Vi(H);
|
|
5842
5843
|
if (!U)
|
|
5843
5844
|
return !1;
|
|
5844
5845
|
if (v)
|
|
@@ -5847,15 +5848,15 @@ async function ng(t = {}) {
|
|
|
5847
5848
|
return Wn !== null && Ke - Wn <= qu ? (un(U, w), !0) : (Wn = Ke, !0);
|
|
5848
5849
|
};
|
|
5849
5850
|
P(a.relatedTarget) || window.setTimeout(() => {
|
|
5850
|
-
Qe === null && w.isConnected && P(
|
|
5851
|
+
Qe === null && w.isConnected && P(Yi());
|
|
5851
5852
|
}, 0);
|
|
5852
|
-
}),
|
|
5853
|
+
}), m.addEventListener("keydown", (a) => {
|
|
5853
5854
|
!r.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), Be("", !0, !0, !0, "minimized_launcher"));
|
|
5854
5855
|
}), R?.addEventListener("pointerdown", (a) => {
|
|
5855
5856
|
a.stopPropagation();
|
|
5856
5857
|
}), R?.addEventListener("click", (a) => {
|
|
5857
5858
|
a.preventDefault(), a.stopPropagation(), ln("minimized", !0, "minimize_button");
|
|
5858
|
-
}), W.addEventListener("click", () =>
|
|
5859
|
+
}), W.addEventListener("click", () => Ki("close_button")), O.addEventListener("wheel", (a) => {
|
|
5859
5860
|
On(a.deltaY < 0 ? "up" : null);
|
|
5860
5861
|
}), O.addEventListener("pointerdown", (a) => {
|
|
5861
5862
|
Ct = a.target === O ? a.clientY : null;
|
|
@@ -5873,42 +5874,42 @@ async function ng(t = {}) {
|
|
|
5873
5874
|
}), O.addEventListener("keydown", (a) => {
|
|
5874
5875
|
(a.key === "ArrowUp" || a.key === "PageUp" || a.key === "Home") && On("up");
|
|
5875
5876
|
}), O.addEventListener("scroll", () => {
|
|
5876
|
-
O.scrollTop < It - 1 &&
|
|
5877
|
+
O.scrollTop < It - 1 && Hi === "up" && Oe(!1, "userScroll"), It = O.scrollTop;
|
|
5877
5878
|
}), ye.addEventListener("click", () => {
|
|
5878
5879
|
hl();
|
|
5879
5880
|
});
|
|
5880
|
-
const
|
|
5881
|
+
const No = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
5881
5882
|
([a]) => {
|
|
5882
5883
|
a?.isIntersecting && (Oe(!0, "bottom"), qe());
|
|
5883
5884
|
},
|
|
5884
5885
|
{ root: O, threshold: 0 }
|
|
5885
5886
|
);
|
|
5886
|
-
|
|
5887
|
+
No?.observe(Xe);
|
|
5887
5888
|
const zt = () => e.loginRequired || e.signupRequired;
|
|
5888
|
-
let Qe = null, gn = !1,
|
|
5889
|
-
const
|
|
5889
|
+
let Qe = null, gn = !1, Ji = I.getState().status === "connected";
|
|
5890
|
+
const Zi = () => {
|
|
5890
5891
|
const a = I.getState().status;
|
|
5891
|
-
return !
|
|
5892
|
-
},
|
|
5892
|
+
return !Ji && (on || a === "idle" || a === "connecting" || a === "reconnecting");
|
|
5893
|
+
}, ft = () => on || I.getState().status !== "connected", $n = () => {
|
|
5893
5894
|
const a = I.getState().status;
|
|
5894
|
-
return
|
|
5895
|
+
return Zi() ? !1 : a !== "connected" && !(Ji && a === "reconnecting");
|
|
5895
5896
|
}, Bt = () => {
|
|
5896
5897
|
const a = zt(), g = I.getState(), w = !g.isThinking && !g.pendingMessageStatus && !!g.lastError;
|
|
5897
5898
|
_.readOnly = !1, C.readOnly = !1, _.placeholder = a ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : w ? "Needs attention" : gn ? "New update" : e.launcherLabel, C.placeholder = a ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : it.launcherLabel, Q.hidden = a;
|
|
5898
5899
|
}, de = () => {
|
|
5899
5900
|
const a = I.getState(), g = a.isThinking;
|
|
5900
|
-
V.disabled = $n() || Pe(e.billingStatus) || a.pendingMessageStatus !== null || Ln && !g || !g && C.value.trim().length === 0 && ge.length === 0, xe.disabled = zt() ||
|
|
5901
|
+
V.disabled = $n() || Pe(e.billingStatus) || a.pendingMessageStatus !== null || Ln && !g || !g && C.value.trim().length === 0 && ge.length === 0, xe.disabled = zt() || ft() || Pe(e.billingStatus);
|
|
5901
5902
|
};
|
|
5902
5903
|
Bt();
|
|
5903
|
-
const
|
|
5904
|
+
const Qi = () => {
|
|
5904
5905
|
const a = I.getState(), g = a.isThinking, w = a.turnPhase !== null, v = a.turnPhase === "sending", P = T?.lastElementChild;
|
|
5905
5906
|
P && (P.textContent = "Working..."), r.classList.toggle("pluno-pa-widget--thinking", g), r.classList.toggle("pluno-pa-widget--sending", v), r.classList.toggle(
|
|
5906
5907
|
"pluno-pa-widget--unread",
|
|
5907
5908
|
!w && (gn || !!a.lastError)
|
|
5908
5909
|
), Bt();
|
|
5909
5910
|
};
|
|
5910
|
-
|
|
5911
|
-
const
|
|
5911
|
+
Qi();
|
|
5912
|
+
const es = () => {
|
|
5912
5913
|
zt() || ee || (on = !0, Bt(), de(), I.connect().then(
|
|
5913
5914
|
() => {
|
|
5914
5915
|
ee || (on = !1, Bt(), de());
|
|
@@ -5927,12 +5928,12 @@ async function ng(t = {}) {
|
|
|
5927
5928
|
Ze !== null && window.clearTimeout(Ze), ne.textContent = a, ne.hidden = !1, Ze = window.setTimeout(() => {
|
|
5928
5929
|
ne.textContent = "", ne.hidden = !0, Ze = null;
|
|
5929
5930
|
}, 3e3);
|
|
5930
|
-
},
|
|
5931
|
+
}, Oo = (a) => {
|
|
5931
5932
|
yg(
|
|
5932
5933
|
I,
|
|
5933
5934
|
a.value,
|
|
5934
5935
|
a.attachments,
|
|
5935
|
-
|
|
5936
|
+
Wo
|
|
5936
5937
|
).catch((g) => {
|
|
5937
5938
|
const w = new Set(ge.map((v) => v.id));
|
|
5938
5939
|
ge = [
|
|
@@ -5948,8 +5949,8 @@ async function ng(t = {}) {
|
|
|
5948
5949
|
if (ee || !Qt || I.getState().status !== "connected" || zt() || Pe(e.billingStatus))
|
|
5949
5950
|
return;
|
|
5950
5951
|
const a = Qt;
|
|
5951
|
-
Qt = null,
|
|
5952
|
-
},
|
|
5952
|
+
Qt = null, Oo(a);
|
|
5953
|
+
}, ts = () => {
|
|
5953
5954
|
const a = C.value, g = a.trim(), w = [...ge];
|
|
5954
5955
|
if (Ln || !g && w.length === 0)
|
|
5955
5956
|
return;
|
|
@@ -5963,11 +5964,11 @@ async function ng(t = {}) {
|
|
|
5963
5964
|
value: g,
|
|
5964
5965
|
attachments: w
|
|
5965
5966
|
};
|
|
5966
|
-
if (
|
|
5967
|
+
if (Zi()) {
|
|
5967
5968
|
Qt = P;
|
|
5968
5969
|
return;
|
|
5969
5970
|
}
|
|
5970
|
-
|
|
5971
|
+
Oo(P);
|
|
5971
5972
|
};
|
|
5972
5973
|
Q.addEventListener("submit", (a) => {
|
|
5973
5974
|
if (a.preventDefault(), e.loginRequired) {
|
|
@@ -5978,14 +5979,14 @@ async function ng(t = {}) {
|
|
|
5978
5979
|
e.onSignupClick?.();
|
|
5979
5980
|
return;
|
|
5980
5981
|
}
|
|
5981
|
-
$n() || Pe(e.billingStatus) || (gt = !0, Oe(!0, "send"), qe(),
|
|
5982
|
+
$n() || Pe(e.billingStatus) || (gt = !0, Oe(!0, "send"), qe(), ts());
|
|
5982
5983
|
});
|
|
5983
5984
|
let hn = 0;
|
|
5984
|
-
const
|
|
5985
|
+
const mt = () => {
|
|
5985
5986
|
hn = 0, r.classList.remove("pluno-pa-widget--drag-over");
|
|
5986
5987
|
}, xl = () => {
|
|
5987
5988
|
Ze !== null && (window.clearTimeout(Ze), Ze = null), ne.textContent = "", ne.hidden = !0;
|
|
5988
|
-
},
|
|
5989
|
+
}, ns = async (a) => {
|
|
5989
5990
|
if (!e.attachmentsEnabled || a.length === 0)
|
|
5990
5991
|
return;
|
|
5991
5992
|
const g = Qg(
|
|
@@ -5999,10 +6000,10 @@ async function ng(t = {}) {
|
|
|
5999
6000
|
}
|
|
6000
6001
|
ct("attachment_added");
|
|
6001
6002
|
}, Il = async (a) => {
|
|
6002
|
-
await
|
|
6003
|
+
await ns(a), !(a.length === 0 || Qe !== null) && pt(C, "attachment_picker_completed");
|
|
6003
6004
|
};
|
|
6004
6005
|
xe.addEventListener("click", () => {
|
|
6005
|
-
e.loginRequired ||
|
|
6006
|
+
e.loginRequired || ft() || Pe(e.billingStatus) || ie.click();
|
|
6006
6007
|
}), ie.addEventListener("change", () => {
|
|
6007
6008
|
const a = Array.from(ie.files ?? []);
|
|
6008
6009
|
ie.value = "", Il(a).catch((g) => {
|
|
@@ -6013,23 +6014,23 @@ async function ng(t = {}) {
|
|
|
6013
6014
|
});
|
|
6014
6015
|
});
|
|
6015
6016
|
}), r.addEventListener("dragenter", (a) => {
|
|
6016
|
-
!e.attachmentsEnabled || !di(a.dataTransfer) || e.loginRequired ||
|
|
6017
|
+
!e.attachmentsEnabled || !di(a.dataTransfer) || e.loginRequired || ft() || (a.preventDefault(), a.stopPropagation(), hn += 1, r.classList.add("pluno-pa-widget--drag-over"));
|
|
6017
6018
|
}), r.addEventListener("dragover", (a) => {
|
|
6018
6019
|
const g = a.dataTransfer;
|
|
6019
|
-
!e.attachmentsEnabled || !di(g) || e.loginRequired ||
|
|
6020
|
+
!e.attachmentsEnabled || !di(g) || e.loginRequired || ft() || (a.preventDefault(), a.stopPropagation(), g.dropEffect = "copy");
|
|
6020
6021
|
}), r.addEventListener("dragleave", (a) => {
|
|
6021
6022
|
di(a.dataTransfer) && (a.stopPropagation(), hn = Math.max(0, hn - 1), hn === 0 && r.classList.remove("pluno-pa-widget--drag-over"));
|
|
6022
6023
|
});
|
|
6023
|
-
const
|
|
6024
|
-
r.classList.contains("pluno-pa-widget--drag-over") && !a.composedPath().includes(r) &&
|
|
6024
|
+
const qo = (a) => {
|
|
6025
|
+
r.classList.contains("pluno-pa-widget--drag-over") && !a.composedPath().includes(r) && mt();
|
|
6025
6026
|
};
|
|
6026
|
-
|
|
6027
|
+
f.addEventListener(
|
|
6027
6028
|
"dragover",
|
|
6028
|
-
|
|
6029
|
+
qo,
|
|
6029
6030
|
!0
|
|
6030
|
-
),
|
|
6031
|
+
), f.addEventListener("drop", mt, !0), f.addEventListener("dragend", mt, !0), f.defaultView?.addEventListener("blur", mt), r.addEventListener("drop", (a) => {
|
|
6031
6032
|
const g = a.dataTransfer;
|
|
6032
|
-
!e.attachmentsEnabled || !di(g) || e.loginRequired ||
|
|
6033
|
+
!e.attachmentsEnabled || !di(g) || e.loginRequired || ft() || (a.preventDefault(), a.stopPropagation(), mt(), ns(g.files).catch((w) => {
|
|
6033
6034
|
jn(
|
|
6034
6035
|
w instanceof Error ? w.message : "Failed to attach file"
|
|
6035
6036
|
), Se("web-sdk.widget", "Attachment failed", {
|
|
@@ -6039,7 +6040,7 @@ async function ng(t = {}) {
|
|
|
6039
6040
|
}), r.addEventListener("paste", (a) => {
|
|
6040
6041
|
a.stopPropagation();
|
|
6041
6042
|
const g = a.clipboardData, w = Array.from(g?.files ?? []);
|
|
6042
|
-
!e.attachmentsEnabled || w.length === 0 || e.loginRequired ||
|
|
6043
|
+
!e.attachmentsEnabled || w.length === 0 || e.loginRequired || ft() || (a.preventDefault(), ns(w).catch((v) => {
|
|
6043
6044
|
jn(
|
|
6044
6045
|
v instanceof Error ? v.message : "Failed to attach file"
|
|
6045
6046
|
), Se("web-sdk.widget", "Attachment failed", {
|
|
@@ -6058,24 +6059,24 @@ async function ng(t = {}) {
|
|
|
6058
6059
|
if (I.getState().pendingMessageStatus || $n())
|
|
6059
6060
|
return;
|
|
6060
6061
|
const a = C.value.trim().length > 0 || ge.length > 0;
|
|
6061
|
-
gt = !0, Oe(!0, "send"), qe(),
|
|
6062
|
-
}),
|
|
6063
|
-
_e = !_e, kt = null, ze(), _e && je.length === 0 && !Ee && !Nn &&
|
|
6062
|
+
gt = !0, Oe(!0, "send"), qe(), ts(), Y(I.getState()), de(), a && ct("send_button_submit");
|
|
6063
|
+
}), fe.addEventListener("click", () => {
|
|
6064
|
+
_e = !_e, kt = null, ze(), _e && je.length === 0 && !Ee && !Nn && To(), _e || ct("history_closed");
|
|
6064
6065
|
}), Ue.addEventListener("click", () => {
|
|
6065
6066
|
_e = !1, ze(), ct("history_closed");
|
|
6066
|
-
}), se.addEventListener("scroll",
|
|
6067
|
-
C.value.trim() &&
|
|
6067
|
+
}), se.addEventListener("scroll", fl), C.addEventListener("input", () => {
|
|
6068
|
+
C.value.trim() && Ro("composer_input"), vn(C), te(), de(), kl();
|
|
6068
6069
|
}), C.addEventListener("keydown", (a) => {
|
|
6069
6070
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
6070
6071
|
if (a.preventDefault(), e.loginRequired) {
|
|
6071
6072
|
e.onLoginClick?.();
|
|
6072
6073
|
return;
|
|
6073
6074
|
}
|
|
6074
|
-
$n() || (gt = !0, Oe(!0, "send"), qe(),
|
|
6075
|
+
$n() || (gt = !0, Oe(!0, "send"), qe(), ts(), Y(I.getState()), de());
|
|
6075
6076
|
}
|
|
6076
6077
|
}), r.addEventListener("click", (a) => {
|
|
6077
6078
|
const g = a.target instanceof Element ? a.target : null;
|
|
6078
|
-
g?.closest("a[href]") && te(), _e && gu(g, Ye,
|
|
6079
|
+
g?.closest("a[href]") && te(), _e && gu(g, Ye, fe) && (_e = !1, ze());
|
|
6079
6080
|
const v = window.getSelection(), P = !!(v && !v.isCollapsed && v.anchorNode && r.contains(v.anchorNode));
|
|
6080
6081
|
cu(a.target, a.detail, P) && ct("passive_surface_click");
|
|
6081
6082
|
}), r.addEventListener("copy", (a) => {
|
|
@@ -6117,10 +6118,10 @@ async function ng(t = {}) {
|
|
|
6117
6118
|
}
|
|
6118
6119
|
);
|
|
6119
6120
|
const Kn = () => l;
|
|
6120
|
-
let
|
|
6121
|
-
const
|
|
6121
|
+
let is = I.getState().appearance !== null, Vn = null, fn = null, ss = I.getState().isThinking, Wt = null;
|
|
6122
|
+
const mn = e.taskNotifications;
|
|
6122
6123
|
let Ft = null, Ht = !1;
|
|
6123
|
-
const
|
|
6124
|
+
const zo = () => {
|
|
6124
6125
|
Ft !== null && (window.clearTimeout(Ft), Ft = null);
|
|
6125
6126
|
}, Yn = () => {
|
|
6126
6127
|
oe && (oe.hidden = !0);
|
|
@@ -6128,23 +6129,23 @@ async function ng(t = {}) {
|
|
|
6128
6129
|
const a = I.getState();
|
|
6129
6130
|
return a.assistantDraft.trim().length > 0 && a.assistantDraftPhase !== "commentary";
|
|
6130
6131
|
}, Tl = async () => {
|
|
6131
|
-
if (!
|
|
6132
|
+
if (!mn || !oe || Ht || ee || !I.getState().isThinking || Xn())
|
|
6132
6133
|
return;
|
|
6133
6134
|
let a;
|
|
6134
6135
|
try {
|
|
6135
|
-
a = await
|
|
6136
|
+
a = await mn.getState();
|
|
6136
6137
|
} catch {
|
|
6137
6138
|
return;
|
|
6138
6139
|
}
|
|
6139
6140
|
a.enabled || a.neverSuggest || !I.getState().isThinking || Xn() || Ht || ee || (oe.hidden = !1);
|
|
6140
6141
|
};
|
|
6141
6142
|
k?.addEventListener("click", () => {
|
|
6142
|
-
Ht = !0, Yn(),
|
|
6143
|
+
Ht = !0, Yn(), mn?.enable().catch(() => {
|
|
6143
6144
|
});
|
|
6144
6145
|
}), S?.addEventListener("click", () => {
|
|
6145
6146
|
Ht = !0, Yn();
|
|
6146
6147
|
}), z?.addEventListener("click", () => {
|
|
6147
|
-
Ht = !0, Yn(),
|
|
6148
|
+
Ht = !0, Yn(), mn?.dismissForever().catch(() => {
|
|
6148
6149
|
});
|
|
6149
6150
|
});
|
|
6150
6151
|
const Jn = e.tabGroups;
|
|
@@ -6166,10 +6167,10 @@ async function ng(t = {}) {
|
|
|
6166
6167
|
$t = !1, Zn();
|
|
6167
6168
|
});
|
|
6168
6169
|
}), Zn();
|
|
6169
|
-
let jt = null,
|
|
6170
|
+
let jt = null, Bo = () => {
|
|
6170
6171
|
};
|
|
6171
|
-
const Cl = !!(e.referralLinkLoader && (e.sdkPreviewChannelId || e.productVariant === "personal" && (e.entrySurface === "main_web_chat" || e.entrySurface === "automation"))), Qn = /* @__PURE__ */ new Map(),
|
|
6172
|
-
const a = jt !== null &&
|
|
6172
|
+
const Cl = !!(e.referralLinkLoader && (e.sdkPreviewChannelId || e.productVariant === "personal" && (e.entrySurface === "main_web_chat" || e.entrySurface === "automation"))), Qn = /* @__PURE__ */ new Map(), os = /* @__PURE__ */ new Map(), rs = () => C.value.trim().length > 0 || ge.length > 0, kl = () => {
|
|
6173
|
+
const a = jt !== null && ks(I.getState(), rs());
|
|
6173
6174
|
Te.hidden = !a, a && jt !== null && Ka(Te, jt);
|
|
6174
6175
|
};
|
|
6175
6176
|
let Gt = null;
|
|
@@ -6189,12 +6190,12 @@ async function ng(t = {}) {
|
|
|
6189
6190
|
}, Al = async (a) => {
|
|
6190
6191
|
await e.personalChannelConnectionHandler?.(a);
|
|
6191
6192
|
}, ti = (a = {}) => {
|
|
6192
|
-
gt = !0, Oe(!0, "newSession"), qe(), _e = !1, ze(), I.startNewSession(a), pn = null,
|
|
6193
|
+
gt = !0, Oe(!0, "newSession"), qe(), _e = !1, ze(), I.startNewSession(a), pn = null, Fi.clear(), et.clear(), ei.clear(), C.value = "", ge = [], en(), vn(C), te(), de(), pt(C, "new_chat"), Y(I.getState());
|
|
6193
6194
|
};
|
|
6194
6195
|
dt?.addEventListener("click", () => {
|
|
6195
6196
|
const a = e.proactiveSuggestion;
|
|
6196
|
-
!a ||
|
|
6197
|
-
}),
|
|
6197
|
+
!a || ft() || (He = null, e.proactiveSuggestion = null, e.onProactiveSuggestionTaskStart?.(a.id), ti(), Be("", !0, !1, !0, "proactive_suggestion"), I.sendMessage(a.suggestedQuery));
|
|
6198
|
+
}), me?.addEventListener("click", () => {
|
|
6198
6199
|
const a = e.proactiveSuggestion ?? He;
|
|
6199
6200
|
if (!a)
|
|
6200
6201
|
return;
|
|
@@ -6226,25 +6227,25 @@ async function ng(t = {}) {
|
|
|
6226
6227
|
ke();
|
|
6227
6228
|
}
|
|
6228
6229
|
});
|
|
6229
|
-
const
|
|
6230
|
+
const Wo = () => {
|
|
6230
6231
|
e.morningReport !== null && (e.morningReport = null, e.onMorningReportTaskStart?.(), ti());
|
|
6231
|
-
},
|
|
6232
|
+
}, as = (a) => {
|
|
6232
6233
|
if (!a || e.layout === "page") {
|
|
6233
6234
|
Gt?.remove(), Gt = null;
|
|
6234
6235
|
return;
|
|
6235
6236
|
}
|
|
6236
|
-
Gt || (Gt =
|
|
6237
|
+
Gt || (Gt = Ni(
|
|
6237
6238
|
"pluno-pa-widget__new-chat",
|
|
6238
6239
|
"New chat",
|
|
6239
6240
|
Bg(),
|
|
6240
6241
|
!1
|
|
6241
|
-
), Gt.addEventListener("click", () => ti()), he.insertBefore(Gt,
|
|
6242
|
+
), Gt.addEventListener("click", () => ti()), he.insertBefore(Gt, fe));
|
|
6242
6243
|
}, Y = (a) => {
|
|
6243
|
-
if (qt(), ut !== null && (window.clearTimeout(ut), ut = null), ze(), ke(),
|
|
6244
|
-
Qn.clear(),
|
|
6244
|
+
if (qt(), ut !== null && (window.clearTimeout(ut), ut = null), ze(), ke(), co(a.lastErrorCode) ? Wt = a.lastErrorCode : e.billingStatus?.creditsUsed !== null && !Pe(e.billingStatus) && (Wt = null), Zt(Wt), e.loginRequired) {
|
|
6245
|
+
Qn.clear(), os.clear(), Vr(
|
|
6245
6246
|
O,
|
|
6246
6247
|
V,
|
|
6247
|
-
|
|
6248
|
+
as,
|
|
6248
6249
|
Kn,
|
|
6249
6250
|
"Log in to use Pluno on this page.",
|
|
6250
6251
|
e.loginButtonLabel,
|
|
@@ -6254,10 +6255,10 @@ async function ng(t = {}) {
|
|
|
6254
6255
|
return;
|
|
6255
6256
|
}
|
|
6256
6257
|
if (e.signupRequired) {
|
|
6257
|
-
Qn.clear(),
|
|
6258
|
+
Qn.clear(), os.clear(), Vr(
|
|
6258
6259
|
O,
|
|
6259
6260
|
V,
|
|
6260
|
-
|
|
6261
|
+
as,
|
|
6261
6262
|
Kn,
|
|
6262
6263
|
"Complete signup to unlock your free trial credits.",
|
|
6263
6264
|
e.signupButtonLabel,
|
|
@@ -6266,37 +6267,37 @@ async function ng(t = {}) {
|
|
|
6266
6267
|
);
|
|
6267
6268
|
return;
|
|
6268
6269
|
}
|
|
6269
|
-
const g = xg(a), w = g !==
|
|
6270
|
-
|
|
6270
|
+
const g = xg(a), w = g !== _o;
|
|
6271
|
+
_o = g;
|
|
6271
6272
|
const v = gt || xt.enabled;
|
|
6272
6273
|
gt = !1, lh(
|
|
6273
6274
|
O,
|
|
6274
6275
|
Xe,
|
|
6275
6276
|
V,
|
|
6276
|
-
|
|
6277
|
+
as,
|
|
6277
6278
|
Te,
|
|
6278
6279
|
a,
|
|
6279
|
-
|
|
6280
|
+
Zi(),
|
|
6280
6281
|
jt,
|
|
6281
|
-
jt !== null &&
|
|
6282
|
+
jt !== null && ks(a, rs()),
|
|
6282
6283
|
v,
|
|
6283
6284
|
() => xt.enabled,
|
|
6284
|
-
|
|
6285
|
+
Fi,
|
|
6285
6286
|
Qn,
|
|
6286
|
-
|
|
6287
|
+
os,
|
|
6287
6288
|
te,
|
|
6288
6289
|
Kn,
|
|
6289
6290
|
(U) => {
|
|
6290
|
-
|
|
6291
|
+
ft() || (Wo(), gt = !0, Oe(!0, "send"), qe(), I.sendMessage(U));
|
|
6291
6292
|
},
|
|
6292
6293
|
() => {
|
|
6293
6294
|
gt = !0, Oe(!0, "send"), qe(), I.retryLastMessage();
|
|
6294
6295
|
},
|
|
6295
6296
|
e.morningReport,
|
|
6296
6297
|
() => {
|
|
6297
|
-
e.morningReport = null, e.onMorningReportSnooze?.(),
|
|
6298
|
+
e.morningReport = null, e.onMorningReportSnooze?.(), Ki("morning_report_snooze"), Y(I.getState());
|
|
6298
6299
|
},
|
|
6299
|
-
|
|
6300
|
+
es,
|
|
6300
6301
|
e.attachmentPreviewUrlResolver,
|
|
6301
6302
|
e.integrationAuthHandler ? {
|
|
6302
6303
|
states: et,
|
|
@@ -6313,7 +6314,7 @@ async function ng(t = {}) {
|
|
|
6313
6314
|
Cl && !sn ? {
|
|
6314
6315
|
dismissedCandidateIds: nn,
|
|
6315
6316
|
actionCandidate: Vn,
|
|
6316
|
-
error:
|
|
6317
|
+
error: fn,
|
|
6317
6318
|
characterIconOptions: Kn(),
|
|
6318
6319
|
socialPostRewardsUrl: e.socialPostRewardsUrl,
|
|
6319
6320
|
onSeen: (U) => {
|
|
@@ -6326,29 +6327,29 @@ async function ng(t = {}) {
|
|
|
6326
6327
|
vt.add(U.id), nn.add(U.id), te();
|
|
6327
6328
|
},
|
|
6328
6329
|
onDismiss: (U) => {
|
|
6329
|
-
vt.add(U.id), nn.add(U.id), te(),
|
|
6330
|
+
vt.add(U.id), nn.add(U.id), te(), fn = null, Y(I.getState());
|
|
6330
6331
|
},
|
|
6331
6332
|
onDisable: (U) => {
|
|
6332
|
-
sn = !0, vt.add(U.id), nn.add(U.id), te(), Gh(e, !0),
|
|
6333
|
+
sn = !0, vt.add(U.id), nn.add(U.id), te(), Gh(e, !0), fn = null, Y(I.getState());
|
|
6333
6334
|
}
|
|
6334
6335
|
} : void 0,
|
|
6335
6336
|
e.proactiveSuggestion !== null || He !== null
|
|
6336
6337
|
), ke();
|
|
6337
|
-
const P = a.messages.map((U) => U.scheduledCheckInAt).filter((U) => !!U).filter((U) =>
|
|
6338
|
+
const P = a.messages.map((U) => U.scheduledCheckInAt).filter((U) => !!U).filter((U) => yi(U) !== null).sort((U, Ke) => Date.parse(U) - Date.parse(Ke))[0] ?? null, H = P ? hd(P) : null;
|
|
6338
6339
|
H !== null && (ut = window.setTimeout(
|
|
6339
6340
|
() => {
|
|
6340
6341
|
ut = null, ee || Y(I.getState());
|
|
6341
6342
|
},
|
|
6342
6343
|
Math.min(H, 2147483647)
|
|
6343
6344
|
)), v ? (It = O.scrollTop, qe()) : w && Ig(a) && gl();
|
|
6344
|
-
},
|
|
6345
|
-
|
|
6345
|
+
}, Fo = () => {
|
|
6346
|
+
f.getSelection()?.isCollapsed !== !1 && wh(Qn) && Y(I.getState());
|
|
6346
6347
|
};
|
|
6347
|
-
|
|
6348
|
+
f.addEventListener(
|
|
6348
6349
|
"selectionchange",
|
|
6349
|
-
|
|
6350
|
+
Fo
|
|
6350
6351
|
);
|
|
6351
|
-
const
|
|
6352
|
+
const Ho = async (a) => {
|
|
6352
6353
|
if (!e.integrationAuthStatusLoader)
|
|
6353
6354
|
return;
|
|
6354
6355
|
const g = a.messages.map((w) => w.integrationAuthRequest).filter(
|
|
@@ -6376,9 +6377,9 @@ async function ng(t = {}) {
|
|
|
6376
6377
|
})
|
|
6377
6378
|
);
|
|
6378
6379
|
};
|
|
6379
|
-
|
|
6380
|
+
Bo = ou(
|
|
6380
6381
|
(a) => {
|
|
6381
|
-
jt = a, !ee &&
|
|
6382
|
+
jt = a, !ee && ks(I.getState(), rs()) && Y(I.getState());
|
|
6382
6383
|
},
|
|
6383
6384
|
{
|
|
6384
6385
|
backendUrl: e.backendUrl,
|
|
@@ -6386,23 +6387,23 @@ async function ng(t = {}) {
|
|
|
6386
6387
|
loader: e.activeUsersLoader
|
|
6387
6388
|
}
|
|
6388
6389
|
), I.on("state", (a) => {
|
|
6389
|
-
if (
|
|
6390
|
-
const U = I.getModel(), Ke =
|
|
6390
|
+
if (wo) {
|
|
6391
|
+
const U = I.getModel(), Ke = gi(U) ? U : _i[0].value;
|
|
6391
6392
|
Ke !== $e && ($e = Ke, qt());
|
|
6392
6393
|
}
|
|
6393
|
-
a.taskStatus ? Dn?.setStatus(a.taskStatus) : Dn?.clear(), a.status === "connected" && (
|
|
6394
|
+
a.taskStatus ? Dn?.setStatus(a.taskStatus) : Dn?.clear(), a.status === "connected" && (Ji = !0, Qt && queueMicrotask(() => {
|
|
6394
6395
|
Gn();
|
|
6395
6396
|
})), Zn();
|
|
6396
|
-
const g =
|
|
6397
|
-
|
|
6397
|
+
const g = ss && !a.isThinking, w = So !== location.origin || vo !== a.sessionId || xo !== (a.user?.id ?? null), v = ss !== a.isThinking, P = $i !== "connected" && a.status === "connected", H = $i === "connected" && a.status !== "connected";
|
|
6398
|
+
So = location.origin, vo = a.sessionId, xo = a.user?.id ?? null, $i = a.status, ss = a.isThinking, H && (Ae !== null && (window.clearTimeout(Ae), Ae = null), Et += 1, Ee = !1, je = [], rn = null, kt = null, Nn = !1, ze()), r.classList.contains("pluno-pa-widget--open") && a.status === "connected" && (w || v || P) && qn(), a.isThinking && !Xn() && mn && !Ht && Ft === null && oe?.hidden !== !1 && (Ft = window.setTimeout(() => {
|
|
6398
6399
|
Ft = null, Tl();
|
|
6399
|
-
}, vu)), (!a.isThinking || Xn()) && (
|
|
6400
|
+
}, vu)), (!a.isThinking || Xn()) && (zo(), Yn()), g && !r.classList.contains("pluno-pa-widget--open") && (gn = !0), Qi(), a.appearance ? (is = !0, Se(
|
|
6400
6401
|
"web-sdk.widget",
|
|
6401
6402
|
"Agent state supplied appearance",
|
|
6402
6403
|
{
|
|
6403
6404
|
appearance: a.appearance
|
|
6404
6405
|
}
|
|
6405
|
-
),
|
|
6406
|
+
), ls(a.appearance, "agent.state.appearance")) : is && (is = !1, Se(
|
|
6406
6407
|
"web-sdk.widget",
|
|
6407
6408
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
6408
6409
|
{
|
|
@@ -6410,37 +6411,37 @@ async function ng(t = {}) {
|
|
|
6410
6411
|
fallbackColorScheme: e.colorScheme,
|
|
6411
6412
|
fallbackFontFamily: e.fontFamily
|
|
6412
6413
|
}
|
|
6413
|
-
),
|
|
6414
|
+
), ls({}, "agent.state.appearance-cleared")), Y(a), Ho(a), de(), g && Po();
|
|
6414
6415
|
});
|
|
6415
6416
|
const ni = I.getState();
|
|
6416
6417
|
return ni.taskStatus && Dn?.setStatus(ni.taskStatus), Y(ni), sn || Promise.resolve(jh(e)).then((a) => {
|
|
6417
6418
|
!a || ee || (sn = !0, te(), Y(I.getState()));
|
|
6418
6419
|
}).catch(() => {
|
|
6419
|
-
}),
|
|
6420
|
+
}), Ho(ni), de(), es(), {
|
|
6420
6421
|
agent: I,
|
|
6421
6422
|
startNewChat: ti,
|
|
6422
6423
|
host: s,
|
|
6423
6424
|
updateAppearance: (a) => {
|
|
6424
|
-
a.scribbleStyle !== void 0 && (e.scribbleStyle = a.scribbleStyle),
|
|
6425
|
+
a.scribbleStyle !== void 0 && (e.scribbleStyle = a.scribbleStyle), ls(a, "widgetHandle.updateAppearance");
|
|
6425
6426
|
},
|
|
6426
6427
|
updateBillingStatus: (a) => {
|
|
6427
6428
|
const g = a ?? null;
|
|
6428
|
-
|
|
6429
|
+
jr(
|
|
6429
6430
|
e.billingStatus,
|
|
6430
6431
|
g,
|
|
6431
6432
|
Wt
|
|
6432
6433
|
) && (e.billingStatus = g, e.billingStatus?.creditsUsed !== null && !Pe(e.billingStatus) && (Wt = null), Zt(Wt), de(), Gn());
|
|
6433
6434
|
},
|
|
6434
|
-
updateModel:
|
|
6435
|
+
updateModel: bo,
|
|
6435
6436
|
updateAuthGate: (a) => {
|
|
6436
6437
|
const g = zt();
|
|
6437
|
-
e.loginRequired = a.loginRequired === !0, e.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (e.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (e.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (e.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (e.signupUrl = a.signupUrl), Bt(), Y(I.getState()), de(), Gn(), r.classList.contains("pluno-pa-widget--open") && qn(), g && !zt() &&
|
|
6438
|
+
e.loginRequired = a.loginRequired === !0, e.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (e.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (e.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (e.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (e.signupUrl = a.signupUrl), Bt(), Y(I.getState()), de(), Gn(), r.classList.contains("pluno-pa-widget--open") && qn(), g && !zt() && es();
|
|
6438
6439
|
},
|
|
6439
6440
|
openPanel: (a) => {
|
|
6440
6441
|
const g = typeof a == "string" ? a : C.value, w = typeof a == "object" ? a.focusComposer !== !1 : !0, v = typeof a == "object" ? a.trigger ?? "external_request" : "external_request";
|
|
6441
6442
|
Be(g, !1, w, !0, v);
|
|
6442
6443
|
},
|
|
6443
|
-
closePanel:
|
|
6444
|
+
closePanel: Ki,
|
|
6444
6445
|
updateDisplayState: (a) => {
|
|
6445
6446
|
if (a === "shown") {
|
|
6446
6447
|
ln("shown", !1);
|
|
@@ -6455,34 +6456,34 @@ async function ng(t = {}) {
|
|
|
6455
6456
|
a && (He = null, ue = "idle", Ce && (Ce.value = "")), e.proactiveSuggestion = a ?? null, ke();
|
|
6456
6457
|
},
|
|
6457
6458
|
destroy: () => {
|
|
6458
|
-
ee || (te(), ee = !0,
|
|
6459
|
+
ee || (te(), ee = !0, ko.disconnect(), f.removeEventListener(
|
|
6459
6460
|
"selectionchange",
|
|
6460
|
-
|
|
6461
|
-
),
|
|
6461
|
+
Fo
|
|
6462
|
+
), f.removeEventListener("pointerdown", yo, !0), No?.disconnect(), vl(), f.defaultView?.removeEventListener(
|
|
6462
6463
|
"pointerdown",
|
|
6463
|
-
|
|
6464
|
+
Uo,
|
|
6464
6465
|
!0
|
|
6465
|
-
),
|
|
6466
|
+
), f.defaultView?.removeEventListener(
|
|
6466
6467
|
"focus",
|
|
6467
6468
|
Hn,
|
|
6468
6469
|
!0
|
|
6469
|
-
),
|
|
6470
|
+
), f.defaultView?.removeEventListener(
|
|
6470
6471
|
"focusin",
|
|
6471
6472
|
Hn,
|
|
6472
6473
|
!0
|
|
6473
|
-
),
|
|
6474
|
+
), f.removeEventListener(
|
|
6474
6475
|
"dragover",
|
|
6475
|
-
|
|
6476
|
+
qo,
|
|
6476
6477
|
!0
|
|
6477
|
-
),
|
|
6478
|
+
), f.removeEventListener("drop", mt, !0), f.removeEventListener("dragend", mt, !0), f.defaultView?.removeEventListener(
|
|
6478
6479
|
"blur",
|
|
6479
|
-
|
|
6480
|
-
), window.removeEventListener("resize",
|
|
6480
|
+
mt
|
|
6481
|
+
), window.removeEventListener("resize", Eo), Ao(), bl(), yl(), Ze !== null && window.clearTimeout(Ze), Ae !== null && (window.clearTimeout(Ae), Ae = null), Tt !== null && (window.clearTimeout(Tt), Tt = null), ut !== null && (window.clearTimeout(ut), ut = null), zo(), Bo(), Dn?.clear(), I.destroy(), Wi.release(), s.remove());
|
|
6481
6482
|
}
|
|
6482
6483
|
};
|
|
6483
6484
|
async function Ml(a) {
|
|
6484
6485
|
if (!Vn) {
|
|
6485
|
-
Vn = a,
|
|
6486
|
+
Vn = a, fn = null, Y(I.getState());
|
|
6486
6487
|
try {
|
|
6487
6488
|
if (!e.referralLinkLoader)
|
|
6488
6489
|
throw new Error("Referral sharing is not available here.");
|
|
@@ -6491,7 +6492,7 @@ async function ng(t = {}) {
|
|
|
6491
6492
|
throw new Error("Pluno did not return a referral link.");
|
|
6492
6493
|
await Pl(g), vt.add(a.id), nn.add(a.id), te();
|
|
6493
6494
|
} catch (g) {
|
|
6494
|
-
|
|
6495
|
+
fn = g instanceof Error ? g.message : "Could not copy referral link.";
|
|
6495
6496
|
} finally {
|
|
6496
6497
|
Vn = null, Y(I.getState());
|
|
6497
6498
|
}
|
|
@@ -6504,7 +6505,7 @@ async function ng(t = {}) {
|
|
|
6504
6505
|
return;
|
|
6505
6506
|
} catch {
|
|
6506
6507
|
}
|
|
6507
|
-
const g = li(
|
|
6508
|
+
const g = li(f), w = g instanceof HTMLElement ? g : null, v = document.createElement("textarea");
|
|
6508
6509
|
v.value = a, v.readOnly = !0, v.setAttribute("aria-hidden", "true"), v.style.position = "fixed", v.style.left = "-9999px", v.style.opacity = "0", document.body.appendChild(v);
|
|
6509
6510
|
try {
|
|
6510
6511
|
if (v.select(), v.setSelectionRange(0, a.length), !document.execCommand("copy"))
|
|
@@ -6515,12 +6516,12 @@ async function ng(t = {}) {
|
|
|
6515
6516
|
});
|
|
6516
6517
|
}
|
|
6517
6518
|
}
|
|
6518
|
-
function
|
|
6519
|
+
function ls(a, g) {
|
|
6519
6520
|
const w = a.accentColor ?? e.accentColor, v = a.colorScheme ?? e.colorScheme, P = a.fontFamily ?? e.fontFamily, H = a.scribbleStyle ?? e.scribbleStyle;
|
|
6520
|
-
l =
|
|
6521
|
+
l = Dr(
|
|
6521
6522
|
w,
|
|
6522
6523
|
H
|
|
6523
|
-
),
|
|
6524
|
+
), Ur(r, l, {
|
|
6524
6525
|
accentColor: w,
|
|
6525
6526
|
colorScheme: v,
|
|
6526
6527
|
fontFamily: P,
|
|
@@ -6536,7 +6537,7 @@ async function ng(t = {}) {
|
|
|
6536
6537
|
});
|
|
6537
6538
|
}
|
|
6538
6539
|
}
|
|
6539
|
-
function
|
|
6540
|
+
function Dr(t, e) {
|
|
6540
6541
|
return { accentColor: t, scribbleStyle: e };
|
|
6541
6542
|
}
|
|
6542
6543
|
function ig(t) {
|
|
@@ -6562,7 +6563,7 @@ function og([t, e, n]) {
|
|
|
6562
6563
|
};
|
|
6563
6564
|
return 0.2126 * i(t) + 0.7152 * i(e) + 0.0722 * i(n);
|
|
6564
6565
|
}
|
|
6565
|
-
function
|
|
6566
|
+
function Ur(t, e, n) {
|
|
6566
6567
|
t.classList.toggle(
|
|
6567
6568
|
"pluno-pa-widget--dark",
|
|
6568
6569
|
n.colorScheme === "dark"
|
|
@@ -6587,10 +6588,10 @@ function Dr(t, e, n) {
|
|
|
6587
6588
|
);
|
|
6588
6589
|
}
|
|
6589
6590
|
function rg(t) {
|
|
6590
|
-
if (t.getElementById(
|
|
6591
|
+
if (t.getElementById(Pr))
|
|
6591
6592
|
return;
|
|
6592
6593
|
const e = t.createElement("style");
|
|
6593
|
-
e.id =
|
|
6594
|
+
e.id = Pr, e.textContent = `@font-face {
|
|
6594
6595
|
font-family: "Architects Daughter";
|
|
6595
6596
|
font-style: normal;
|
|
6596
6597
|
font-weight: 400;
|
|
@@ -6616,28 +6617,28 @@ function ag({
|
|
|
6616
6617
|
return;
|
|
6617
6618
|
_.preventDefault();
|
|
6618
6619
|
const T = _.clientX - l.x, R = _.clientY - l.y;
|
|
6619
|
-
!c && Math.hypot(T, R) <
|
|
6620
|
+
!c && Math.hypot(T, R) < Ei || (c = !0, t.classList.add("pluno-pa-widget--dragging"), s({ x: d.x + T, y: d.y + R }));
|
|
6620
6621
|
}, b = (_) => {
|
|
6621
6622
|
r === _.pointerId && (_.preventDefault(), _.stopPropagation(), c && (u = { x: _.clientX, y: _.clientY }, o()), p());
|
|
6622
|
-
}, m = (_) => {
|
|
6623
|
-
r === _.pointerId && (_.preventDefault(), p());
|
|
6624
6623
|
}, f = (_) => {
|
|
6624
|
+
r === _.pointerId && (_.preventDefault(), p());
|
|
6625
|
+
}, m = (_) => {
|
|
6625
6626
|
if (!u)
|
|
6626
6627
|
return;
|
|
6627
6628
|
const T = Math.hypot(
|
|
6628
6629
|
_.clientX - u.x,
|
|
6629
6630
|
_.clientY - u.y
|
|
6630
|
-
) <=
|
|
6631
|
+
) <= Ei;
|
|
6631
6632
|
u = null, T && (_.preventDefault(), _.stopPropagation());
|
|
6632
6633
|
}, x = (_) => {
|
|
6633
6634
|
if (t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing"))
|
|
6634
6635
|
return;
|
|
6635
|
-
const T = _.shiftKey ?
|
|
6636
|
+
const T = _.shiftKey ? lo : ao, R = i();
|
|
6636
6637
|
let L = null;
|
|
6637
6638
|
_.key === "ArrowUp" ? L = { x: R.x, y: R.y - T } : _.key === "ArrowDown" ? L = { x: R.x, y: R.y + T } : _.key === "ArrowLeft" ? L = { x: R.x - T, y: R.y } : _.key === "ArrowRight" && (L = { x: R.x + T, y: R.y }), L && (_.preventDefault(), _.stopPropagation(), s(L), o());
|
|
6638
6639
|
};
|
|
6639
|
-
return e.addEventListener("pointerdown", h), e.addEventListener("pointermove", y), e.addEventListener("pointerup", b), e.addEventListener("pointercancel",
|
|
6640
|
-
e.removeEventListener("pointerdown", h), e.removeEventListener("pointermove", y), e.removeEventListener("pointerup", b), e.removeEventListener("pointercancel",
|
|
6640
|
+
return e.addEventListener("pointerdown", h), e.addEventListener("pointermove", y), e.addEventListener("pointerup", b), e.addEventListener("pointercancel", f), e.addEventListener("click", m, !0), n.addEventListener("keydown", x), () => {
|
|
6641
|
+
e.removeEventListener("pointerdown", h), e.removeEventListener("pointermove", y), e.removeEventListener("pointerup", b), e.removeEventListener("pointercancel", f), e.removeEventListener("click", m, !0), n.removeEventListener("keydown", x);
|
|
6641
6642
|
};
|
|
6642
6643
|
}
|
|
6643
6644
|
function lg({
|
|
@@ -6650,22 +6651,22 @@ function lg({
|
|
|
6650
6651
|
let o = null, r = null, l = null, d = !1;
|
|
6651
6652
|
const c = () => {
|
|
6652
6653
|
o = null, r = null, l = null, d = !1, t.classList.remove("pluno-pa-widget--panel-dragging");
|
|
6653
|
-
}, u = (
|
|
6654
|
-
t.classList.contains("pluno-pa-widget--open") && (
|
|
6655
|
-
}, p = (
|
|
6656
|
-
if (o !==
|
|
6654
|
+
}, u = (f) => {
|
|
6655
|
+
t.classList.contains("pluno-pa-widget--open") && (f.preventDefault(), f.stopPropagation(), o = f.pointerId, r = { x: f.clientX, y: f.clientY }, l = n(), d = !1, e.setPointerCapture?.(f.pointerId));
|
|
6656
|
+
}, p = (f) => {
|
|
6657
|
+
if (o !== f.pointerId || !r || !l)
|
|
6657
6658
|
return;
|
|
6658
|
-
|
|
6659
|
-
const
|
|
6660
|
-
!d && Math.hypot(
|
|
6661
|
-
}, h = (
|
|
6662
|
-
o ===
|
|
6663
|
-
}, y = (
|
|
6664
|
-
o ===
|
|
6665
|
-
}, b = (
|
|
6666
|
-
const
|
|
6659
|
+
f.preventDefault(), f.stopPropagation();
|
|
6660
|
+
const m = f.clientX - r.x, x = f.clientY - r.y;
|
|
6661
|
+
!d && Math.hypot(m, x) < Ei || (d = !0, t.classList.add("pluno-pa-widget--panel-dragging"), i({ x: l.x + m, y: l.y + x }));
|
|
6662
|
+
}, h = (f) => {
|
|
6663
|
+
o === f.pointerId && (f.preventDefault(), f.stopPropagation(), d && s(), c());
|
|
6664
|
+
}, y = (f) => {
|
|
6665
|
+
o === f.pointerId && (f.preventDefault(), c());
|
|
6666
|
+
}, b = (f) => {
|
|
6667
|
+
const m = f.shiftKey ? lo : ao, x = n();
|
|
6667
6668
|
let _ = null;
|
|
6668
|
-
|
|
6669
|
+
f.key === "ArrowUp" ? _ = { x: x.x, y: x.y - m } : f.key === "ArrowDown" ? _ = { x: x.x, y: x.y + m } : f.key === "ArrowLeft" ? _ = { x: x.x - m, y: x.y } : f.key === "ArrowRight" && (_ = { x: x.x + m, y: x.y }), _ && (f.preventDefault(), f.stopPropagation(), i(_), s());
|
|
6669
6670
|
};
|
|
6670
6671
|
return e.addEventListener("pointerdown", u), e.addEventListener("pointermove", p), e.addEventListener("pointerup", h), e.addEventListener("pointercancel", y), e.addEventListener("keydown", b), () => {
|
|
6671
6672
|
e.removeEventListener("pointerdown", u), e.removeEventListener("pointermove", p), e.removeEventListener("pointerup", h), e.removeEventListener("pointercancel", y), e.removeEventListener("keydown", b);
|
|
@@ -6681,38 +6682,38 @@ function dg({
|
|
|
6681
6682
|
let o = null, r = null, l = null, d = null, c = !1;
|
|
6682
6683
|
const u = () => {
|
|
6683
6684
|
o = null, r = null, l = null, d = null, c = !1, t.classList.remove("pluno-pa-widget--resizing");
|
|
6684
|
-
}, p = (
|
|
6685
|
-
const x =
|
|
6686
|
-
!t.classList.contains("pluno-pa-widget--open") || !
|
|
6687
|
-
}, h = (
|
|
6688
|
-
if (o !==
|
|
6685
|
+
}, p = (m) => {
|
|
6686
|
+
const x = m.currentTarget, _ = x.dataset.resizeDirection;
|
|
6687
|
+
!t.classList.contains("pluno-pa-widget--open") || !Nr(_) || (m.preventDefault(), m.stopPropagation(), o = m.pointerId, r = _, l = { x: m.clientX, y: m.clientY }, d = n(), c = !1, x.setPointerCapture?.(m.pointerId));
|
|
6688
|
+
}, h = (m) => {
|
|
6689
|
+
if (o !== m.pointerId || !r || !l || !d)
|
|
6689
6690
|
return;
|
|
6690
|
-
|
|
6691
|
-
const x =
|
|
6692
|
-
!c && Math.hypot(x, _) <
|
|
6693
|
-
|
|
6691
|
+
m.preventDefault(), m.stopPropagation();
|
|
6692
|
+
const x = m.clientX - l.x, _ = m.clientY - l.y;
|
|
6693
|
+
!c && Math.hypot(x, _) < Ei || (c = !0, t.classList.add("pluno-pa-widget--resizing"), i(
|
|
6694
|
+
Or(d, r, x, _)
|
|
6694
6695
|
));
|
|
6695
|
-
}, y = (
|
|
6696
|
-
o ===
|
|
6697
|
-
}, b = (
|
|
6698
|
-
o ===
|
|
6699
|
-
},
|
|
6700
|
-
const _ =
|
|
6696
|
+
}, y = (m) => {
|
|
6697
|
+
o === m.pointerId && (m.preventDefault(), m.stopPropagation(), c && s(), u());
|
|
6698
|
+
}, b = (m) => {
|
|
6699
|
+
o === m.pointerId && (m.preventDefault(), u());
|
|
6700
|
+
}, f = (m) => {
|
|
6701
|
+
const _ = m.currentTarget.dataset.resizeDirection, T = m.shiftKey ? lo : ao, R = n();
|
|
6701
6702
|
let L = 0, B = 0;
|
|
6702
|
-
|
|
6703
|
+
Nr(_) && (m.key === "ArrowLeft" ? L = -T : m.key === "ArrowRight" ? L = T : m.key === "ArrowUp" ? B = -T : m.key === "ArrowDown" && (B = T), !(L === 0 && B === 0) && (m.preventDefault(), m.stopPropagation(), i(Or(R, _, L, B)), s()));
|
|
6703
6704
|
};
|
|
6704
|
-
for (const
|
|
6705
|
-
|
|
6705
|
+
for (const m of e)
|
|
6706
|
+
m.addEventListener("pointerdown", p), m.addEventListener("pointermove", h), m.addEventListener("pointerup", y), m.addEventListener("pointercancel", b), m.addEventListener("keydown", f);
|
|
6706
6707
|
return () => {
|
|
6707
|
-
for (const
|
|
6708
|
-
|
|
6708
|
+
for (const m of e)
|
|
6709
|
+
m.removeEventListener("pointerdown", p), m.removeEventListener("pointermove", h), m.removeEventListener("pointerup", y), m.removeEventListener("pointercancel", b), m.removeEventListener("keydown", f);
|
|
6709
6710
|
};
|
|
6710
6711
|
}
|
|
6711
|
-
function
|
|
6712
|
+
function Nr(t) {
|
|
6712
6713
|
return t === "left" || t === "right" || t === "top" || t === "bottom" || t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right";
|
|
6713
6714
|
}
|
|
6714
|
-
function
|
|
6715
|
-
const s = be(), o =
|
|
6715
|
+
function Or(t, e, n, i) {
|
|
6716
|
+
const s = be(), o = qr({
|
|
6716
6717
|
leading: t.position.x,
|
|
6717
6718
|
length: t.size.width,
|
|
6718
6719
|
delta: n,
|
|
@@ -6721,10 +6722,10 @@ function Nr(t, e, n, i) {
|
|
|
6721
6722
|
minLeading: G,
|
|
6722
6723
|
maxTrailing: s.width - G,
|
|
6723
6724
|
minLength: Math.min(
|
|
6724
|
-
|
|
6725
|
+
oo,
|
|
6725
6726
|
s.width - G * 2
|
|
6726
6727
|
)
|
|
6727
|
-
}), r =
|
|
6728
|
+
}), r = qr({
|
|
6728
6729
|
leading: t.position.y,
|
|
6729
6730
|
length: t.size.height,
|
|
6730
6731
|
delta: i,
|
|
@@ -6733,7 +6734,7 @@ function Nr(t, e, n, i) {
|
|
|
6733
6734
|
minLeading: Ut,
|
|
6734
6735
|
maxTrailing: s.height - G,
|
|
6735
6736
|
minLength: Math.min(
|
|
6736
|
-
|
|
6737
|
+
ro,
|
|
6737
6738
|
s.height - Ut - G
|
|
6738
6739
|
)
|
|
6739
6740
|
});
|
|
@@ -6742,7 +6743,7 @@ function Nr(t, e, n, i) {
|
|
|
6742
6743
|
size: { width: o.length, height: r.length }
|
|
6743
6744
|
};
|
|
6744
6745
|
}
|
|
6745
|
-
function
|
|
6746
|
+
function qr({
|
|
6746
6747
|
leading: t,
|
|
6747
6748
|
length: e,
|
|
6748
6749
|
delta: n,
|
|
@@ -6807,7 +6808,7 @@ function pg() {
|
|
|
6807
6808
|
width: Math.min(
|
|
6808
6809
|
Le(
|
|
6809
6810
|
t.width * Ku,
|
|
6810
|
-
|
|
6811
|
+
oo,
|
|
6811
6812
|
Gu
|
|
6812
6813
|
),
|
|
6813
6814
|
t.width - G * 2
|
|
@@ -6815,7 +6816,7 @@ function pg() {
|
|
|
6815
6816
|
height: Math.min(
|
|
6816
6817
|
Le(
|
|
6817
6818
|
t.height * Yu,
|
|
6818
|
-
|
|
6819
|
+
ro,
|
|
6819
6820
|
Vu
|
|
6820
6821
|
),
|
|
6821
6822
|
t.height - Ut - G
|
|
@@ -6823,15 +6824,15 @@ function pg() {
|
|
|
6823
6824
|
};
|
|
6824
6825
|
}
|
|
6825
6826
|
function Rt(t = null) {
|
|
6826
|
-
return t ?
|
|
6827
|
+
return t ? Ui(t) : pg();
|
|
6827
6828
|
}
|
|
6828
|
-
function
|
|
6829
|
+
function Ui(t) {
|
|
6829
6830
|
const e = be();
|
|
6830
6831
|
return {
|
|
6831
6832
|
width: Le(
|
|
6832
6833
|
t.width,
|
|
6833
6834
|
Math.min(
|
|
6834
|
-
|
|
6835
|
+
oo,
|
|
6835
6836
|
e.width - G * 2
|
|
6836
6837
|
),
|
|
6837
6838
|
Math.max(
|
|
@@ -6842,7 +6843,7 @@ function Di(t) {
|
|
|
6842
6843
|
height: Le(
|
|
6843
6844
|
t.height,
|
|
6844
6845
|
Math.min(
|
|
6845
|
-
|
|
6846
|
+
ro,
|
|
6846
6847
|
e.height - Ut - G
|
|
6847
6848
|
),
|
|
6848
6849
|
Math.max(
|
|
@@ -6852,12 +6853,12 @@ function Di(t) {
|
|
|
6852
6853
|
)
|
|
6853
6854
|
};
|
|
6854
6855
|
}
|
|
6855
|
-
function
|
|
6856
|
+
function _s(t, e) {
|
|
6856
6857
|
if (!e) {
|
|
6857
6858
|
t.style.removeProperty("--pluno-pa-panel-width"), t.style.removeProperty("--pluno-pa-panel-height");
|
|
6858
6859
|
return;
|
|
6859
6860
|
}
|
|
6860
|
-
const n =
|
|
6861
|
+
const n = Ui(e);
|
|
6861
6862
|
t.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), t.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
6862
6863
|
}
|
|
6863
6864
|
function cg(t, e, n) {
|
|
@@ -6873,11 +6874,11 @@ function cg(t, e, n) {
|
|
|
6873
6874
|
y: r.height - 24 - n.height
|
|
6874
6875
|
};
|
|
6875
6876
|
}
|
|
6876
|
-
function
|
|
6877
|
+
function Ss(t, e, n) {
|
|
6877
6878
|
const i = kn(t, !1);
|
|
6878
|
-
return e ?
|
|
6879
|
+
return e ? wi(
|
|
6879
6880
|
t,
|
|
6880
|
-
|
|
6881
|
+
bi(e, i),
|
|
6881
6882
|
i
|
|
6882
6883
|
) : ug(n === "bottom-left" ? "bottom-left" : "bottom-right", i, $u);
|
|
6883
6884
|
}
|
|
@@ -6888,8 +6889,8 @@ function ug(t, e, n) {
|
|
|
6888
6889
|
y: t.startsWith("bottom") ? Math.max(0, i.height - e.height - n) : n
|
|
6889
6890
|
};
|
|
6890
6891
|
}
|
|
6891
|
-
function
|
|
6892
|
-
const i = be(), s = G +
|
|
6892
|
+
function wi(t, e, n) {
|
|
6893
|
+
const i = be(), s = G + fg(t);
|
|
6893
6894
|
return {
|
|
6894
6895
|
x: Le(
|
|
6895
6896
|
e.x,
|
|
@@ -6912,17 +6913,17 @@ function fi(t, e, n) {
|
|
|
6912
6913
|
function gg(t, e) {
|
|
6913
6914
|
if (e <= 0)
|
|
6914
6915
|
return !1;
|
|
6915
|
-
const n = be(), i = t.top - G -
|
|
6916
|
+
const n = be(), i = t.top - G - Bs, s = n.height - t.bottom - G - Bs;
|
|
6916
6917
|
return i < e && s >= e;
|
|
6917
6918
|
}
|
|
6918
|
-
function
|
|
6919
|
+
function bi(t, e) {
|
|
6919
6920
|
const n = be();
|
|
6920
6921
|
return {
|
|
6921
6922
|
x: t.anchor.endsWith("right") ? n.width - e.width - t.x : t.x,
|
|
6922
6923
|
y: t.anchor.startsWith("bottom") ? n.height - e.height - t.y : t.y
|
|
6923
6924
|
};
|
|
6924
6925
|
}
|
|
6925
|
-
function
|
|
6926
|
+
function vs(t, e) {
|
|
6926
6927
|
const n = hg(t, e), i = be();
|
|
6927
6928
|
return {
|
|
6928
6929
|
anchor: n,
|
|
@@ -6934,17 +6935,17 @@ function hg(t, e) {
|
|
|
6934
6935
|
const n = be(), i = t.x + e.width / 2, o = t.y + e.height / 2 <= n.height / 2 ? "top" : "bottom", r = i <= n.width / 2 ? "left" : "right";
|
|
6935
6936
|
return `${o}-${r}`;
|
|
6936
6937
|
}
|
|
6937
|
-
function
|
|
6938
|
+
function fg(t) {
|
|
6938
6939
|
return t.classList.contains("pluno-pa-widget--scribble") ? Qu : Zu;
|
|
6939
6940
|
}
|
|
6940
|
-
function
|
|
6941
|
+
function xs(t, e, n, i = null) {
|
|
6941
6942
|
const s = kn(t), o = Rt(i), r = {
|
|
6942
6943
|
x: n === "bottom-left" ? e.x : e.x + s.width - o.width,
|
|
6943
6944
|
y: e.y + s.height - o.height
|
|
6944
6945
|
};
|
|
6945
6946
|
return xn(r, o);
|
|
6946
6947
|
}
|
|
6947
|
-
function
|
|
6948
|
+
function mg(t, e, n, i) {
|
|
6948
6949
|
return {
|
|
6949
6950
|
x: i === "bottom-left" ? t.x : t.x + e.width - n.width,
|
|
6950
6951
|
y: t.y + e.height - n.height
|
|
@@ -6984,7 +6985,7 @@ function wt(t, e) {
|
|
|
6984
6985
|
function wg(t, e) {
|
|
6985
6986
|
t.style.setProperty("--pluno-pa-panel-offset-x", `${e.x}px`), t.style.setProperty("--pluno-pa-panel-offset-y", `${e.y}px`);
|
|
6986
6987
|
}
|
|
6987
|
-
function
|
|
6988
|
+
function zr(t) {
|
|
6988
6989
|
t.style.removeProperty("--pluno-pa-panel-offset-x"), t.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
6989
6990
|
}
|
|
6990
6991
|
function be() {
|
|
@@ -6993,7 +6994,7 @@ function be() {
|
|
|
6993
6994
|
height: window.innerHeight || document.documentElement.clientHeight || Fa + G * 2
|
|
6994
6995
|
};
|
|
6995
6996
|
}
|
|
6996
|
-
function
|
|
6997
|
+
function Is(t) {
|
|
6997
6998
|
const e = t.getBoundingClientRect();
|
|
6998
6999
|
return {
|
|
6999
7000
|
x: Math.round(e.x),
|
|
@@ -7113,7 +7114,7 @@ function Eg(t, e, n, i, s) {
|
|
|
7113
7114
|
s
|
|
7114
7115
|
)
|
|
7115
7116
|
), t.appendChild(Lg()), t.appendChild(
|
|
7116
|
-
|
|
7117
|
+
Ni(
|
|
7117
7118
|
"pluno-pa-widget__close",
|
|
7118
7119
|
"Close",
|
|
7119
7120
|
Ja(16),
|
|
@@ -7172,9 +7173,9 @@ function Mg(t, e) {
|
|
|
7172
7173
|
d.type = "button", d.className = "pluno-pa-widget__timeline-jump", d.textContent = "New messages ↓", d.hidden = !0, s.appendChild(d);
|
|
7173
7174
|
const c = document.createElement("div");
|
|
7174
7175
|
return c.className = "pluno-pa-widget__top-actions", c.appendChild(
|
|
7175
|
-
|
|
7176
|
+
Ni(
|
|
7176
7177
|
"pluno-pa-widget__history",
|
|
7177
|
-
|
|
7178
|
+
$s(),
|
|
7178
7179
|
Fg(),
|
|
7179
7180
|
!0
|
|
7180
7181
|
)
|
|
@@ -7229,7 +7230,7 @@ function Lg() {
|
|
|
7229
7230
|
const t = document.createElement("aside");
|
|
7230
7231
|
t.className = "pluno-pa-widget__proactive-suggestion", t.hidden = !0;
|
|
7231
7232
|
const e = document.createElement("button");
|
|
7232
|
-
e.type = "button", e.className = "pluno-pa-widget__proactive-suggestion-dismiss", e.setAttribute("aria-label", "Dismiss suggestion"), e.title = "Dismiss", e.appendChild(
|
|
7233
|
+
e.type = "button", e.className = "pluno-pa-widget__proactive-suggestion-dismiss", e.setAttribute("aria-label", "Dismiss suggestion"), e.title = "Dismiss", e.appendChild(Oi());
|
|
7233
7234
|
const n = document.createElement("span");
|
|
7234
7235
|
n.className = "pluno-pa-widget__proactive-suggestion-label", n.textContent = "Pluno spotted a shortcut";
|
|
7235
7236
|
const i = document.createElement("p");
|
|
@@ -7282,40 +7283,40 @@ function Dg() {
|
|
|
7282
7283
|
p.append(h, Ja(12)), u.appendChild(p);
|
|
7283
7284
|
const y = document.createElement("div");
|
|
7284
7285
|
y.className = "pluno-pa-widget__model-menu";
|
|
7285
|
-
for (const T of
|
|
7286
|
-
y.appendChild(
|
|
7286
|
+
for (const T of _i)
|
|
7287
|
+
y.appendChild(Br(T));
|
|
7287
7288
|
const b = document.createElement("details");
|
|
7288
7289
|
b.className = "pluno-pa-widget__model-more";
|
|
7289
|
-
const
|
|
7290
|
-
|
|
7291
|
-
for (const T of
|
|
7292
|
-
b.appendChild(
|
|
7290
|
+
const f = document.createElement("summary");
|
|
7291
|
+
f.textContent = "More", b.appendChild(f);
|
|
7292
|
+
for (const T of oa)
|
|
7293
|
+
b.appendChild(Br(T));
|
|
7293
7294
|
y.appendChild(b), u.appendChild(y), c.appendChild(u);
|
|
7294
|
-
const
|
|
7295
|
-
|
|
7295
|
+
const m = document.createElement("div");
|
|
7296
|
+
m.className = "pluno-pa-widget__composer-meta";
|
|
7296
7297
|
const x = document.createElement("a");
|
|
7297
|
-
x.className = "pluno-pa-widget__powered-by", x.href = "https://pluno.ai", x.target = "_blank", x.rel = "noopener noreferrer", x.textContent = "Powered by Pluno.ai.",
|
|
7298
|
+
x.className = "pluno-pa-widget__powered-by", x.href = "https://pluno.ai", x.target = "_blank", x.rel = "noopener noreferrer", x.textContent = "Powered by Pluno.ai.", m.appendChild(x);
|
|
7298
7299
|
const _ = document.createElement("span");
|
|
7299
|
-
return _.className = "pluno-pa-widget__ai-disclaimer", _.textContent = "AI can make mistakes. Verify outputs.",
|
|
7300
|
+
return _.className = "pluno-pa-widget__ai-disclaimer", _.textContent = "AI can make mistakes. Verify outputs.", m.appendChild(_), c.appendChild(m), t.appendChild(c), t;
|
|
7300
7301
|
}
|
|
7301
|
-
function
|
|
7302
|
+
function Br(t) {
|
|
7302
7303
|
const e = document.createElement("button");
|
|
7303
7304
|
return e.type = "button", e.className = "pluno-pa-widget__model-option", e.dataset.model = t.value, e.textContent = t.label, e.setAttribute("role", "option"), e;
|
|
7304
7305
|
}
|
|
7305
|
-
function
|
|
7306
|
+
function $s() {
|
|
7306
7307
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
7307
7308
|
}
|
|
7308
7309
|
function Ug() {
|
|
7309
7310
|
const t = document.createElement("section");
|
|
7310
|
-
t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label",
|
|
7311
|
+
t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label", $s());
|
|
7311
7312
|
const e = document.createElement("div");
|
|
7312
7313
|
e.className = "pluno-pa-widget__history-header";
|
|
7313
7314
|
const n = document.createElement("strong");
|
|
7314
|
-
n.textContent =
|
|
7315
|
-
const i =
|
|
7315
|
+
n.textContent = $s();
|
|
7316
|
+
const i = Ni(
|
|
7316
7317
|
"pluno-pa-widget__history-close",
|
|
7317
7318
|
"Close recent chats",
|
|
7318
|
-
|
|
7319
|
+
Oi(),
|
|
7319
7320
|
!1
|
|
7320
7321
|
);
|
|
7321
7322
|
e.append(n, i);
|
|
@@ -7350,8 +7351,8 @@ function Ka(t, e) {
|
|
|
7350
7351
|
);
|
|
7351
7352
|
}
|
|
7352
7353
|
function lt(t, e) {
|
|
7353
|
-
const n = `pluno-pa-character-${
|
|
7354
|
-
|
|
7354
|
+
const n = `pluno-pa-character-${Lr}`;
|
|
7355
|
+
Lr += 1;
|
|
7355
7356
|
const i = e.scribbleStyle ? qg(e.accentColor, n) : Og(e.accentColor, n), s = t.split(/\s+/).filter(Boolean);
|
|
7356
7357
|
return i.setAttribute(
|
|
7357
7358
|
"class",
|
|
@@ -7487,26 +7488,26 @@ function Og(t, e) {
|
|
|
7487
7488
|
"flood-color": "#000000",
|
|
7488
7489
|
"flood-opacity": "0.22"
|
|
7489
7490
|
});
|
|
7490
|
-
const
|
|
7491
|
-
A(
|
|
7492
|
-
const
|
|
7491
|
+
const f = A(o, "clipPath", { id: i.boltClip });
|
|
7492
|
+
A(f, "path", { d: Ci });
|
|
7493
|
+
const m = A(s, "g", {
|
|
7493
7494
|
filter: Re(i.softDropShadow)
|
|
7494
7495
|
});
|
|
7495
|
-
A(
|
|
7496
|
-
d:
|
|
7496
|
+
A(m, "path", {
|
|
7497
|
+
d: Ci,
|
|
7497
7498
|
fill: Re(i.boltEdge)
|
|
7498
7499
|
});
|
|
7499
7500
|
const x = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
7500
|
-
A(
|
|
7501
|
+
A(m, "path", {
|
|
7501
7502
|
d: x,
|
|
7502
7503
|
fill: Re(i.boltFill),
|
|
7503
7504
|
filter: Re(i.innerDepth)
|
|
7504
|
-
}), A(
|
|
7505
|
+
}), A(m, "path", {
|
|
7505
7506
|
d: x,
|
|
7506
7507
|
fill: Re(i.boltGlow),
|
|
7507
7508
|
opacity: "0.74"
|
|
7508
7509
|
});
|
|
7509
|
-
const _ = A(
|
|
7510
|
+
const _ = A(m, "g", {
|
|
7510
7511
|
"clip-path": Re(i.boltClip),
|
|
7511
7512
|
opacity: "0.42"
|
|
7512
7513
|
});
|
|
@@ -7533,7 +7534,7 @@ function Og(t, e) {
|
|
|
7533
7534
|
opacity: "0.48"
|
|
7534
7535
|
});
|
|
7535
7536
|
const T = A(s, "g", { filter: Re(i.eyeShadow) });
|
|
7536
|
-
return
|
|
7537
|
+
return Wr(
|
|
7537
7538
|
T,
|
|
7538
7539
|
"rotate(-2 528 463)",
|
|
7539
7540
|
"528",
|
|
@@ -7543,7 +7544,7 @@ function Og(t, e) {
|
|
|
7543
7544
|
"557",
|
|
7544
7545
|
"447",
|
|
7545
7546
|
i
|
|
7546
|
-
),
|
|
7547
|
+
), Wr(
|
|
7547
7548
|
T,
|
|
7548
7549
|
"rotate(2 717 462)",
|
|
7549
7550
|
"717",
|
|
@@ -7560,7 +7561,7 @@ function qg(t, e) {
|
|
|
7560
7561
|
clip: `${e}-scribbleBoltClip`,
|
|
7561
7562
|
wobble: `${e}-scribbleBoltWobble`
|
|
7562
7563
|
}, s = Va(), o = A(s, "defs"), r = A(o, "clipPath", { id: i.clip });
|
|
7563
|
-
A(r, "path", { d:
|
|
7564
|
+
A(r, "path", { d: Ci });
|
|
7564
7565
|
const l = A(o, "filter", {
|
|
7565
7566
|
id: i.wobble,
|
|
7566
7567
|
x: "-10%",
|
|
@@ -7595,12 +7596,12 @@ function qg(t, e) {
|
|
|
7595
7596
|
opacity: "0.9",
|
|
7596
7597
|
transform: "rotate(-14 627 600)"
|
|
7597
7598
|
}), A(d, "path", {
|
|
7598
|
-
d:
|
|
7599
|
+
d: Ci,
|
|
7599
7600
|
fill: "none",
|
|
7600
|
-
stroke:
|
|
7601
|
+
stroke: ki,
|
|
7601
7602
|
"stroke-width": "18",
|
|
7602
7603
|
"stroke-linejoin": "round"
|
|
7603
|
-
}),
|
|
7604
|
+
}), Fr(
|
|
7604
7605
|
d,
|
|
7605
7606
|
"rotate(-2 528 463)",
|
|
7606
7607
|
"528",
|
|
@@ -7609,7 +7610,7 @@ function qg(t, e) {
|
|
|
7609
7610
|
"473",
|
|
7610
7611
|
"557",
|
|
7611
7612
|
"447"
|
|
7612
|
-
),
|
|
7613
|
+
), Fr(
|
|
7613
7614
|
d,
|
|
7614
7615
|
"rotate(2 717 462)",
|
|
7615
7616
|
"717",
|
|
@@ -7626,7 +7627,7 @@ function Va() {
|
|
|
7626
7627
|
viewBox: "0 0 1254 1254"
|
|
7627
7628
|
});
|
|
7628
7629
|
}
|
|
7629
|
-
function
|
|
7630
|
+
function Wr(t, e, n, i, s, o, r, l, d) {
|
|
7630
7631
|
const c = A(t, "g", { transform: e });
|
|
7631
7632
|
A(c, "ellipse", {
|
|
7632
7633
|
cx: n,
|
|
@@ -7648,7 +7649,7 @@ function Br(t, e, n, i, s, o, r, l, d) {
|
|
|
7648
7649
|
fill: "#ffffff"
|
|
7649
7650
|
});
|
|
7650
7651
|
}
|
|
7651
|
-
function
|
|
7652
|
+
function Fr(t, e, n, i, s, o, r, l) {
|
|
7652
7653
|
const d = A(t, "g", { transform: e });
|
|
7653
7654
|
A(d, "ellipse", {
|
|
7654
7655
|
cx: n,
|
|
@@ -7656,14 +7657,14 @@ function Wr(t, e, n, i, s, o, r, l) {
|
|
|
7656
7657
|
rx: "73",
|
|
7657
7658
|
ry: "80",
|
|
7658
7659
|
fill: "#ffffff",
|
|
7659
|
-
stroke:
|
|
7660
|
+
stroke: ki,
|
|
7660
7661
|
"stroke-width": "13"
|
|
7661
7662
|
}), A(d, "ellipse", {
|
|
7662
7663
|
cx: s,
|
|
7663
7664
|
cy: o,
|
|
7664
7665
|
rx: "45",
|
|
7665
7666
|
ry: "53",
|
|
7666
|
-
fill:
|
|
7667
|
+
fill: ki
|
|
7667
7668
|
}), A(d, "circle", {
|
|
7668
7669
|
cx: r,
|
|
7669
7670
|
cy: l,
|
|
@@ -7682,7 +7683,7 @@ function re(t, e, n, i) {
|
|
|
7682
7683
|
function Re(t) {
|
|
7683
7684
|
return `url(#${t})`;
|
|
7684
7685
|
}
|
|
7685
|
-
function
|
|
7686
|
+
function Ni(t, e, n, i) {
|
|
7686
7687
|
const s = document.createElement("button");
|
|
7687
7688
|
return s.type = "button", s.className = t, s.setAttribute("aria-label", e), s.title = e, s.hidden = i, s.appendChild(n), s;
|
|
7688
7689
|
}
|
|
@@ -7694,10 +7695,10 @@ function zg() {
|
|
|
7694
7695
|
width: "0",
|
|
7695
7696
|
height: "0"
|
|
7696
7697
|
}), e = N("defs");
|
|
7697
|
-
return e.appendChild(
|
|
7698
|
-
|
|
7698
|
+
return e.appendChild(Cs("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(
|
|
7699
|
+
Cs("pluno-pa-scribble-wobble-2", "5", "15")
|
|
7699
7700
|
), e.appendChild(
|
|
7700
|
-
|
|
7701
|
+
Cs("pluno-pa-scribble-wobble-3", "9", "19")
|
|
7701
7702
|
), t.appendChild(e), t;
|
|
7702
7703
|
}
|
|
7703
7704
|
function Ya(t, e) {
|
|
@@ -7709,16 +7710,16 @@ function Ya(t, e) {
|
|
|
7709
7710
|
});
|
|
7710
7711
|
return Xa(n, e), n;
|
|
7711
7712
|
}
|
|
7712
|
-
function
|
|
7713
|
+
function Ts(t, e) {
|
|
7713
7714
|
if (!t)
|
|
7714
7715
|
return;
|
|
7715
7716
|
const n = Math.max(
|
|
7716
7717
|
0,
|
|
7717
|
-
e -
|
|
7718
|
+
e - Hs * 2
|
|
7718
7719
|
), i = Math.max(
|
|
7719
7720
|
Ju,
|
|
7720
7721
|
Math.floor(
|
|
7721
|
-
(n -
|
|
7722
|
+
(n - Fs * 2) / Ws
|
|
7722
7723
|
)
|
|
7723
7724
|
);
|
|
7724
7725
|
Xa(t, i);
|
|
@@ -7726,14 +7727,14 @@ function Is(t, e) {
|
|
|
7726
7727
|
function Xa(t, e) {
|
|
7727
7728
|
if (t.dataset.spiralCount === `${e}`)
|
|
7728
7729
|
return;
|
|
7729
|
-
const n = e *
|
|
7730
|
+
const n = e * Ws + Fs * 2;
|
|
7730
7731
|
t.dataset.spiralCount = `${e}`, t.setAttribute(
|
|
7731
7732
|
"viewBox",
|
|
7732
7733
|
`0 0 ${n} ${Xu}`
|
|
7733
7734
|
), t.replaceChildren();
|
|
7734
7735
|
for (let i = 0; i < e; i += 1) {
|
|
7735
|
-
const s =
|
|
7736
|
-
transform: `translate(${
|
|
7736
|
+
const s = Rr[i % Rr.length], o = N("g", {
|
|
7737
|
+
transform: `translate(${Fs + i * Ws} 0)`
|
|
7737
7738
|
});
|
|
7738
7739
|
o.appendChild(
|
|
7739
7740
|
N("ellipse", {
|
|
@@ -7757,7 +7758,7 @@ function Xa(t, e) {
|
|
|
7757
7758
|
), t.appendChild(o);
|
|
7758
7759
|
}
|
|
7759
7760
|
}
|
|
7760
|
-
function
|
|
7761
|
+
function Cs(t, e, n) {
|
|
7761
7762
|
const i = N("filter", {
|
|
7762
7763
|
id: t,
|
|
7763
7764
|
x: "-8%",
|
|
@@ -7873,7 +7874,7 @@ function Hg(t) {
|
|
|
7873
7874
|
e.appendChild(N("path", { d: n }));
|
|
7874
7875
|
return e;
|
|
7875
7876
|
}
|
|
7876
|
-
function
|
|
7877
|
+
function Oi() {
|
|
7877
7878
|
const t = De(
|
|
7878
7879
|
"0 0 24 24",
|
|
7879
7880
|
15,
|
|
@@ -7993,7 +7994,7 @@ function N(t, e = {}) {
|
|
|
7993
7994
|
n.setAttribute(i, s);
|
|
7994
7995
|
return n;
|
|
7995
7996
|
}
|
|
7996
|
-
function
|
|
7997
|
+
function Hr(t) {
|
|
7997
7998
|
for (const e of ["keydown", "keypress", "keyup"])
|
|
7998
7999
|
t.addEventListener(e, (n) => {
|
|
7999
8000
|
n instanceof KeyboardEvent && (e === "keydown" && (n.metaKey || n.ctrlKey) && n.key.toLowerCase() === "x" && tl(n), n.stopPropagation());
|
|
@@ -8040,7 +8041,7 @@ function Yg(t, e, n) {
|
|
|
8040
8041
|
}
|
|
8041
8042
|
}
|
|
8042
8043
|
function Xg(t) {
|
|
8043
|
-
const e =
|
|
8044
|
+
const e = po(t), n = Ai(t);
|
|
8044
8045
|
if (e === "image" && n) {
|
|
8045
8046
|
const i = document.createElement("img");
|
|
8046
8047
|
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
|
|
@@ -8061,7 +8062,7 @@ function Xg(t) {
|
|
|
8061
8062
|
return Lt(t);
|
|
8062
8063
|
}
|
|
8063
8064
|
function Jg(t, e) {
|
|
8064
|
-
const n =
|
|
8065
|
+
const n = po(t), i = Ai(t);
|
|
8065
8066
|
if (n === "image" && i) {
|
|
8066
8067
|
const s = document.createElement("img");
|
|
8067
8068
|
s.className = "pluno-pa-widget__message-attachment-preview", s.alt = t.name;
|
|
@@ -8088,7 +8089,7 @@ function Jg(t, e) {
|
|
|
8088
8089
|
};
|
|
8089
8090
|
let r = i;
|
|
8090
8091
|
const l = () => {
|
|
8091
|
-
const d =
|
|
8092
|
+
const d = Ai(o);
|
|
8092
8093
|
if (d && d !== r) {
|
|
8093
8094
|
r = d, s.src = d;
|
|
8094
8095
|
return;
|
|
@@ -8108,7 +8109,7 @@ function Zg(t, e, n, i, s, o) {
|
|
|
8108
8109
|
Lt(e(), "message")
|
|
8109
8110
|
);
|
|
8110
8111
|
}, c = () => {
|
|
8111
|
-
const y =
|
|
8112
|
+
const y = Ai(e());
|
|
8112
8113
|
if (y && y !== r) {
|
|
8113
8114
|
r = y, t.addEventListener("error", c, {
|
|
8114
8115
|
once: !0
|
|
@@ -8153,23 +8154,23 @@ function Zg(t, e, n, i, s, o) {
|
|
|
8153
8154
|
function Lt(t, e = "composer") {
|
|
8154
8155
|
if (e === "composer") {
|
|
8155
8156
|
const o = document.createElement("span");
|
|
8156
|
-
return o.className = "pluno-pa-widget__attachment-file", o.textContent =
|
|
8157
|
+
return o.className = "pluno-pa-widget__attachment-file", o.textContent = $r(t), o;
|
|
8157
8158
|
}
|
|
8158
8159
|
const n = document.createElement("div");
|
|
8159
8160
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
8160
8161
|
const i = document.createElement("span");
|
|
8161
|
-
i.textContent =
|
|
8162
|
+
i.textContent = $r(t);
|
|
8162
8163
|
const s = document.createElement("strong");
|
|
8163
8164
|
return s.textContent = t.name, n.append(i, s), n;
|
|
8164
8165
|
}
|
|
8165
|
-
function
|
|
8166
|
+
function po(t) {
|
|
8166
8167
|
return t.mimeType.startsWith("image/") ? "image" : t.mimeType === "application/pdf" ? "pdf" : t.mimeType.startsWith("video/") ? "video" : "file";
|
|
8167
8168
|
}
|
|
8168
|
-
function
|
|
8169
|
+
function Ai(t) {
|
|
8169
8170
|
return "previewUrl" in t && t.previewUrl ? t.previewUrl : t.fileUrl ?? "";
|
|
8170
8171
|
}
|
|
8171
|
-
function
|
|
8172
|
-
const e =
|
|
8172
|
+
function $r(t) {
|
|
8173
|
+
const e = po(t);
|
|
8173
8174
|
return e === "image" ? "IMG" : e === "pdf" ? "PDF" : e === "video" ? "VID" : "FILE";
|
|
8174
8175
|
}
|
|
8175
8176
|
function Qg(t, e, n) {
|
|
@@ -8191,8 +8192,8 @@ function th(t, e, n = null, i = !1, s, o = !1, r) {
|
|
|
8191
8192
|
const l = Pe(
|
|
8192
8193
|
e,
|
|
8193
8194
|
n
|
|
8194
|
-
), d = e?.usingPaidCreditFallback === !0, c = !l && i &&
|
|
8195
|
-
if (!t ||
|
|
8195
|
+
), d = e?.usingPaidCreditFallback === !0, c = !l && i && Mi(e), u = !l && d && o;
|
|
8196
|
+
if (!t || !js(e, n) || c || u) {
|
|
8196
8197
|
t && (t.hidden = !0, t.replaceChildren());
|
|
8197
8198
|
return;
|
|
8198
8199
|
}
|
|
@@ -8203,7 +8204,7 @@ function th(t, e, n = null, i = !1, s, o = !1, r) {
|
|
|
8203
8204
|
e,
|
|
8204
8205
|
r
|
|
8205
8206
|
)
|
|
8206
|
-
) :
|
|
8207
|
+
) : Mi(e) && t.appendChild(
|
|
8207
8208
|
sh(e, s)
|
|
8208
8209
|
);
|
|
8209
8210
|
}
|
|
@@ -8211,7 +8212,7 @@ function nh(t, e) {
|
|
|
8211
8212
|
const n = document.createElement("div");
|
|
8212
8213
|
if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--fallback", e) {
|
|
8213
8214
|
const o = document.createElement("button");
|
|
8214
|
-
o.type = "button", o.className = "pluno-pa-widget__billing-action-card-dismiss", o.setAttribute("aria-label", "Dismiss cheaper model notice"), o.title = "Dismiss", o.appendChild(
|
|
8215
|
+
o.type = "button", o.className = "pluno-pa-widget__billing-action-card-dismiss", o.setAttribute("aria-label", "Dismiss cheaper model notice"), o.title = "Dismiss", o.appendChild(Oi()), o.addEventListener("click", e), n.appendChild(o);
|
|
8215
8216
|
}
|
|
8216
8217
|
const i = document.createElement("span");
|
|
8217
8218
|
i.append("Using cheaper model - ");
|
|
@@ -8227,7 +8228,7 @@ function ih(t, e) {
|
|
|
8227
8228
|
if (r.textContent = s ? "Complete onboarding to unlock credits and start using Pluno." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : t.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), s) {
|
|
8228
8229
|
const l = document.createElement("div");
|
|
8229
8230
|
l.className = "pluno-pa-widget__billing-action-card-actions", l.appendChild(
|
|
8230
|
-
|
|
8231
|
+
Gs("Complete onboarding", t.onboardingUrl ?? "")
|
|
8231
8232
|
), n.appendChild(l);
|
|
8232
8233
|
} else
|
|
8233
8234
|
n.appendChild(
|
|
@@ -8243,7 +8244,7 @@ function sh(t, e) {
|
|
|
8243
8244
|
const n = document.createElement("div");
|
|
8244
8245
|
if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low", e) {
|
|
8245
8246
|
const o = document.createElement("button");
|
|
8246
|
-
o.type = "button", o.className = "pluno-pa-widget__billing-action-card-dismiss", o.setAttribute("aria-label", "Dismiss low credits warning"), o.title = "Dismiss", o.appendChild(
|
|
8247
|
+
o.type = "button", o.className = "pluno-pa-widget__billing-action-card-dismiss", o.setAttribute("aria-label", "Dismiss low credits warning"), o.title = "Dismiss", o.appendChild(Oi()), o.addEventListener("click", e), n.appendChild(o);
|
|
8247
8248
|
}
|
|
8248
8249
|
const i = document.createElement("strong");
|
|
8249
8250
|
i.textContent = "Credits running low", n.appendChild(i);
|
|
@@ -8256,22 +8257,22 @@ function sh(t, e) {
|
|
|
8256
8257
|
)
|
|
8257
8258
|
), n;
|
|
8258
8259
|
}
|
|
8259
|
-
function
|
|
8260
|
-
return t !== null && (t.usingPaidCreditFallback === !0 || Pe(t, e) ||
|
|
8260
|
+
function js(t, e) {
|
|
8261
|
+
return t !== null && (t.usingPaidCreditFallback === !0 || Pe(t, e) || Mi(t) || co(e));
|
|
8261
8262
|
}
|
|
8262
|
-
function
|
|
8263
|
-
return
|
|
8263
|
+
function jr(t, e, n) {
|
|
8264
|
+
return js(e, n) || oh(e) ? !0 : !js(t, n);
|
|
8264
8265
|
}
|
|
8265
8266
|
function oh(t) {
|
|
8266
8267
|
return t != null && (t.creditsUsed !== null || t.creditLimit !== null || t.creditsRemaining !== null || t.usingPaidCreditFallback === !0 || Pe(t));
|
|
8267
8268
|
}
|
|
8268
8269
|
function Pe(t, e = null) {
|
|
8269
|
-
return t?.paymentIssue ||
|
|
8270
|
+
return t?.paymentIssue || co(e) && e !== "limit_exceeded" ? !0 : t?.usingPaidCreditFallback === !0 ? !1 : t?.limitExceeded === !0 || e === "limit_exceeded";
|
|
8270
8271
|
}
|
|
8271
|
-
function
|
|
8272
|
+
function co(t) {
|
|
8272
8273
|
return t === "limit_exceeded" || t === "subscription_required" || t === "subscription_inactive" || t === "payment_issue" || t === "subscription_invalid" || t === "payment_required";
|
|
8273
8274
|
}
|
|
8274
|
-
function
|
|
8275
|
+
function Mi(t) {
|
|
8275
8276
|
return t != null && t.usingPaidCreditFallback !== !0 && !Pe(t) && t.creditLimit !== null && t.creditLimit > 0 && t.creditsRemaining !== null && t.creditsRemaining > 0 && t.creditsRemaining / t.creditLimit <= 0.2;
|
|
8276
8277
|
}
|
|
8277
8278
|
function rh(t) {
|
|
@@ -8285,12 +8286,12 @@ function ah(t) {
|
|
|
8285
8286
|
function nl(t, e, n) {
|
|
8286
8287
|
const i = document.createElement("div");
|
|
8287
8288
|
return i.className = n, i.appendChild(
|
|
8288
|
-
|
|
8289
|
+
Gs(e, t.pricingUrl)
|
|
8289
8290
|
), i.appendChild(
|
|
8290
|
-
|
|
8291
|
+
Gs("Earn credits", t.earnCreditsUrl)
|
|
8291
8292
|
), i;
|
|
8292
8293
|
}
|
|
8293
|
-
function
|
|
8294
|
+
function Gs(t, e) {
|
|
8294
8295
|
const n = document.createElement("button");
|
|
8295
8296
|
if (n.type = "button", t === "Earn credits") {
|
|
8296
8297
|
const i = document.createElement("span");
|
|
@@ -8301,14 +8302,14 @@ function js(t, e) {
|
|
|
8301
8302
|
e.trim().length !== 0 && window.open(e, "_blank", "noopener,noreferrer");
|
|
8302
8303
|
}), n;
|
|
8303
8304
|
}
|
|
8304
|
-
function
|
|
8305
|
+
function ks(t, e) {
|
|
8305
8306
|
return t.messages.filter(
|
|
8306
8307
|
(i) => !il(i)
|
|
8307
8308
|
).length === 0 && !t.assistantDraft && !t.lastError && !t.isThinking && !e;
|
|
8308
8309
|
}
|
|
8309
|
-
function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b,
|
|
8310
|
+
function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, x, _, T, R, L, B, $, q, W = !1) {
|
|
8310
8311
|
const Q = _h(o), ne = Q.flatMap((k) => {
|
|
8311
|
-
const S = k.scheduledCheckInAt ?
|
|
8312
|
+
const S = k.scheduledCheckInAt ? yi(k.scheduledCheckInAt) : null;
|
|
8312
8313
|
return S && k.scheduledCheckInAt ? [{ dueAt: k.scheduledCheckInAt, label: S }] : [];
|
|
8313
8314
|
}).sort((k, S) => Date.parse(k.dueAt) - Date.parse(S.dueAt)), K = Sh(
|
|
8314
8315
|
Q.filter(
|
|
@@ -8331,7 +8332,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8331
8332
|
S.className = "pluno-pa-widget__empty-hero";
|
|
8332
8333
|
const z = lt(
|
|
8333
8334
|
"pluno-pa-widget__character--empty",
|
|
8334
|
-
|
|
8335
|
+
f()
|
|
8335
8336
|
);
|
|
8336
8337
|
if (S.appendChild(z), k.appendChild(S), _) {
|
|
8337
8338
|
const E = document.createElement("h2");
|
|
@@ -8347,7 +8348,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8347
8348
|
for (const D of E) {
|
|
8348
8349
|
const j = document.createElement("button");
|
|
8349
8350
|
j.type = "button", j.className = "pluno-pa-widget__starter-prompt", j.textContent = `"${D}"`, j.addEventListener("click", () => {
|
|
8350
|
-
|
|
8351
|
+
m(D);
|
|
8351
8352
|
}), ce.appendChild(j);
|
|
8352
8353
|
}
|
|
8353
8354
|
else if (Je) {
|
|
@@ -8370,16 +8371,16 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8370
8371
|
h.clear(), y.clear(), M(k), M(e), yt(t, ie);
|
|
8371
8372
|
return;
|
|
8372
8373
|
}
|
|
8373
|
-
let F = null, V = null, he = [],
|
|
8374
|
-
const Ye = K.some(
|
|
8375
|
-
(k) => k.role === "tool" &&
|
|
8374
|
+
let F = null, V = null, he = [], fe = [];
|
|
8375
|
+
const Ye = K.some(Vs), se = K.some(
|
|
8376
|
+
(k) => k.role === "tool" && Kr(k, K, o.lastError === null)
|
|
8376
8377
|
), Ue = o.turnPhase ? yu(o.turnPhase) : "Thinking...";
|
|
8377
8378
|
let Ie = !1;
|
|
8378
8379
|
const ye = () => {
|
|
8379
8380
|
if (he.length === 0)
|
|
8380
8381
|
return Ie = !1, !1;
|
|
8381
8382
|
const k = he.some(
|
|
8382
|
-
(z) =>
|
|
8383
|
+
(z) => Kr(z, K, o.lastError === null)
|
|
8383
8384
|
), S = Mh(
|
|
8384
8385
|
he,
|
|
8385
8386
|
k,
|
|
@@ -8387,13 +8388,13 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8387
8388
|
y,
|
|
8388
8389
|
C,
|
|
8389
8390
|
b,
|
|
8390
|
-
|
|
8391
|
+
f()
|
|
8391
8392
|
);
|
|
8392
8393
|
return M(S), F = null, V = S, he = [], Ie = k, !0;
|
|
8393
8394
|
}, Te = () => {
|
|
8394
|
-
for (const k of
|
|
8395
|
+
for (const k of fe)
|
|
8395
8396
|
M(k), F = null, V = k;
|
|
8396
|
-
|
|
8397
|
+
fe = [];
|
|
8397
8398
|
};
|
|
8398
8399
|
for (let k = 0; k < K.length; k += 1) {
|
|
8399
8400
|
const S = K[k];
|
|
@@ -8407,11 +8408,11 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8407
8408
|
},
|
|
8408
8409
|
B.onConnect
|
|
8409
8410
|
);
|
|
8410
|
-
|
|
8411
|
+
fe.push(D);
|
|
8411
8412
|
continue;
|
|
8412
8413
|
}
|
|
8413
8414
|
if (S.role === "tool" && S.personalChannelConnectionRequest && $) {
|
|
8414
|
-
|
|
8415
|
+
fe.push(
|
|
8415
8416
|
ph(
|
|
8416
8417
|
S.personalChannelConnectionRequest,
|
|
8417
8418
|
$.onConnect
|
|
@@ -8425,12 +8426,12 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8425
8426
|
}
|
|
8426
8427
|
if (S.role === "system" && S.dataType === "run_status" && S.steered === !0) {
|
|
8427
8428
|
if (!ye()) {
|
|
8428
|
-
const j = Lh(
|
|
8429
|
+
const j = Lh(f());
|
|
8429
8430
|
M(j), F = null, V = j;
|
|
8430
8431
|
}
|
|
8431
8432
|
continue;
|
|
8432
8433
|
}
|
|
8433
|
-
if (
|
|
8434
|
+
if (Vs(S)) {
|
|
8434
8435
|
if (o.lastError)
|
|
8435
8436
|
continue;
|
|
8436
8437
|
if (ye()) {
|
|
@@ -8439,8 +8440,8 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8439
8440
|
M(j), F = null, V = j;
|
|
8440
8441
|
}
|
|
8441
8442
|
} else {
|
|
8442
|
-
const j =
|
|
8443
|
-
|
|
8443
|
+
const j = Yr(
|
|
8444
|
+
f(),
|
|
8444
8445
|
Ue
|
|
8445
8446
|
);
|
|
8446
8447
|
M(j), F = null, V = j;
|
|
@@ -8450,29 +8451,29 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8450
8451
|
if (S.role === "system") {
|
|
8451
8452
|
if (S.dataType === "run_error" || S.dataType === "run_status") {
|
|
8452
8453
|
const D = ye(), j = K.some(
|
|
8453
|
-
(
|
|
8454
|
+
(me) => me.role === "tool" && St(me, S)
|
|
8454
8455
|
);
|
|
8455
8456
|
if (!D && !j) {
|
|
8456
|
-
const
|
|
8457
|
-
|
|
8457
|
+
const me = En(f());
|
|
8458
|
+
me.classList.add("pluno-pa-widget__terminal-marker"), M(me);
|
|
8458
8459
|
}
|
|
8459
8460
|
const dt = document.createElement("div"), Ot = S.dataType === "run_error";
|
|
8460
|
-
if (dt.className = Ot ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", dt.textContent =
|
|
8461
|
+
if (dt.className = Ot ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", dt.textContent = Pi(
|
|
8461
8462
|
S.content
|
|
8462
8463
|
), Ot && S.securitySettingsUrl) {
|
|
8463
|
-
const
|
|
8464
|
-
|
|
8464
|
+
const me = document.createElement("a");
|
|
8465
|
+
me.className = "pluno-pa-widget__error-retry", me.href = S.securitySettingsUrl, me.target = "_blank", me.rel = "noreferrer", me.textContent = "Security settings", dt.appendChild(me);
|
|
8465
8466
|
}
|
|
8466
8467
|
M(dt), F = Ot ? dt : null, V = Ot ? null : dt, Te();
|
|
8467
8468
|
}
|
|
8468
8469
|
continue;
|
|
8469
8470
|
}
|
|
8470
8471
|
S.role === "user" && Te();
|
|
8471
|
-
const z = ye(), E =
|
|
8472
|
+
const z = ye(), E = Pi(S.content), Je = S.role === "assistant" && K.some(
|
|
8472
8473
|
(D) => D.role === "tool" && St(D, S)
|
|
8473
8474
|
);
|
|
8474
8475
|
if (S.role === "assistant" && !z && !Je) {
|
|
8475
|
-
const D = En(
|
|
8476
|
+
const D = En(f());
|
|
8476
8477
|
M(D), F = null, V = D;
|
|
8477
8478
|
}
|
|
8478
8479
|
const ce = ch(
|
|
@@ -8492,11 +8493,11 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, m, f, x, _, T, R, L, B,
|
|
|
8492
8493
|
M(k), F = null, V = k;
|
|
8493
8494
|
}
|
|
8494
8495
|
} else {
|
|
8495
|
-
const k =
|
|
8496
|
+
const k = Yr(f(), Ue);
|
|
8496
8497
|
M(k), F = null, V = k;
|
|
8497
8498
|
}
|
|
8498
8499
|
if (o.lastError) {
|
|
8499
|
-
const k = En(
|
|
8500
|
+
const k = En(f());
|
|
8500
8501
|
k.classList.add("pluno-pa-widget__terminal-marker");
|
|
8501
8502
|
const S = document.createElement("div");
|
|
8502
8503
|
S.className = "pluno-pa-widget__error";
|
|
@@ -8579,7 +8580,7 @@ function ph(t, e) {
|
|
|
8579
8580
|
return l.type = "button", l.className = "pluno-pa-widget__integration-auth-button", l.textContent = "Pair WhatsApp", l.addEventListener("click", () => e(t)), n.appendChild(l), n;
|
|
8580
8581
|
}
|
|
8581
8582
|
function ch(t, e, n, i, s) {
|
|
8582
|
-
const o = gh(t), r =
|
|
8583
|
+
const o = gh(t), r = fh(
|
|
8583
8584
|
t,
|
|
8584
8585
|
e
|
|
8585
8586
|
), l = n.get(o);
|
|
@@ -8589,14 +8590,14 @@ function ch(t, e, n, i, s) {
|
|
|
8589
8590
|
t.attachments ?? []
|
|
8590
8591
|
), l.node.classList.remove(
|
|
8591
8592
|
"pluno-pa-widget__message--bottom-reserve"
|
|
8592
|
-
), i.add(o), l.renderSignature === r ? (l.renderDeferred = !1, l.node) :
|
|
8593
|
+
), i.add(o), l.renderSignature === r ? (l.renderDeferred = !1, l.node) : mh(l.node) ? (l.renderDeferred = !0, l.node) : (Gr(
|
|
8593
8594
|
l.node,
|
|
8594
8595
|
t,
|
|
8595
8596
|
e,
|
|
8596
8597
|
s
|
|
8597
8598
|
), l.renderSignature = r, l.renderDeferred = !1, l.node);
|
|
8598
8599
|
const d = document.createElement("div");
|
|
8599
|
-
return
|
|
8600
|
+
return Gr(
|
|
8600
8601
|
d,
|
|
8601
8602
|
t,
|
|
8602
8603
|
e,
|
|
@@ -8606,8 +8607,8 @@ function ch(t, e, n, i, s) {
|
|
|
8606
8607
|
renderSignature: r
|
|
8607
8608
|
}), i.add(o), d;
|
|
8608
8609
|
}
|
|
8609
|
-
function
|
|
8610
|
-
if (t.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, t.removeAttribute("data-phase"), e.role === "assistant" ? (e.phase && (t.dataset.phase = e.phase), t.replaceChildren(),
|
|
8610
|
+
function Gr(t, e, n, i) {
|
|
8611
|
+
if (t.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, t.removeAttribute("data-phase"), e.role === "assistant" ? (e.phase && (t.dataset.phase = e.phase), t.replaceChildren(), uo(t, n)) : t.textContent = n, e.role === "user" && e.attachments?.length && t.appendChild(
|
|
8611
8612
|
Ih(
|
|
8612
8613
|
e.attachments,
|
|
8613
8614
|
i
|
|
@@ -8640,7 +8641,7 @@ function hh(t) {
|
|
|
8640
8641
|
);
|
|
8641
8642
|
return n ? t.id.slice(n.length) : null;
|
|
8642
8643
|
}
|
|
8643
|
-
function
|
|
8644
|
+
function fh(t, e) {
|
|
8644
8645
|
return JSON.stringify({
|
|
8645
8646
|
role: t.role,
|
|
8646
8647
|
content: e,
|
|
@@ -8662,7 +8663,7 @@ function mh(t, e) {
|
|
|
8662
8663
|
})
|
|
8663
8664
|
});
|
|
8664
8665
|
}
|
|
8665
|
-
function
|
|
8666
|
+
function mh(t) {
|
|
8666
8667
|
const e = t.ownerDocument.getSelection();
|
|
8667
8668
|
if (!e || e.isCollapsed)
|
|
8668
8669
|
return !1;
|
|
@@ -8718,7 +8719,7 @@ function _h(t) {
|
|
|
8718
8719
|
if (!e.respondsToUserMessageId)
|
|
8719
8720
|
return [...t.messages, e];
|
|
8720
8721
|
const n = t.messages.findIndex(
|
|
8721
|
-
(o) => St(o, e) &&
|
|
8722
|
+
(o) => St(o, e) && Vs(o)
|
|
8722
8723
|
);
|
|
8723
8724
|
if (n !== -1)
|
|
8724
8725
|
return [
|
|
@@ -8771,12 +8772,12 @@ function Sh(t) {
|
|
|
8771
8772
|
), d = /* @__PURE__ */ new Map();
|
|
8772
8773
|
for (let p = 0; p < r.length; p += 1) {
|
|
8773
8774
|
const h = r[p], y = h.role === "tool" && l.some(
|
|
8774
|
-
(
|
|
8775
|
+
(m) => St(h, m)
|
|
8775
8776
|
) ? { ...h, steered: !0 } : h;
|
|
8776
8777
|
if (y.role !== "tool" || y.integrationAuthRequest || y.personalChannelConnectionRequest)
|
|
8777
8778
|
continue;
|
|
8778
|
-
const b =
|
|
8779
|
-
|
|
8779
|
+
const b = Ks(y), f = d.get(b) ?? [];
|
|
8780
|
+
f.push(y), d.set(b, f);
|
|
8780
8781
|
}
|
|
8781
8782
|
const c = /* @__PURE__ */ new Set(), u = [];
|
|
8782
8783
|
for (const p of r) {
|
|
@@ -8790,12 +8791,12 @@ function Sh(t) {
|
|
|
8790
8791
|
u.push(p);
|
|
8791
8792
|
continue;
|
|
8792
8793
|
}
|
|
8793
|
-
const h =
|
|
8794
|
+
const h = Ks(p);
|
|
8794
8795
|
c.has(h) || (c.add(h), u.push(...d.get(h) ?? [p]));
|
|
8795
8796
|
}
|
|
8796
8797
|
return u;
|
|
8797
8798
|
}
|
|
8798
|
-
function
|
|
8799
|
+
function Kr(t, e, n) {
|
|
8799
8800
|
return !n || !t.respondsToUserMessageId || t.steered === !0 ? !1 : !e.some(
|
|
8800
8801
|
(i) => (vh(i) || xh(i)) && St(t, i)
|
|
8801
8802
|
);
|
|
@@ -8809,13 +8810,13 @@ function xh(t) {
|
|
|
8809
8810
|
function St(t, e) {
|
|
8810
8811
|
return t.respondsToUserMessageId && e.respondsToUserMessageId ? t.respondsToUserMessageId === e.respondsToUserMessageId : !!(t.runId && t.runId === e.runId);
|
|
8811
8812
|
}
|
|
8812
|
-
function
|
|
8813
|
+
function Ks(t) {
|
|
8813
8814
|
return t.respondsToUserMessageId ? `response:${t.respondsToUserMessageId}` : `message:${t.id}`;
|
|
8814
8815
|
}
|
|
8815
|
-
function
|
|
8816
|
+
function Vs(t) {
|
|
8816
8817
|
return t.role === "system" && t.dataType === "run_status" && t.loading === !0;
|
|
8817
8818
|
}
|
|
8818
|
-
function
|
|
8819
|
+
function Vr(t, e, n, i, s, o, r, l) {
|
|
8819
8820
|
t.replaceChildren(), rl(e, !1), e.disabled = !0, n(!1);
|
|
8820
8821
|
const d = document.createElement("div");
|
|
8821
8822
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
@@ -8935,9 +8936,9 @@ function Ah(t) {
|
|
|
8935
8936
|
return t === "linkedin" ? (n("M6.7 13.2c.4 4.1.2 8.1.1 12.3"), n("M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"), n("M14.4 13.3c.1 3.8.1 7.8 0 11.9"), n("M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"), n("M20 18c.1 2.2.1 4.7 0 7.2"), e) : t === "x" ? (n("M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), n("M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), n("M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), e) : (n("M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"), n("M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1", "0.48"), n("M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"), n("M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"), e);
|
|
8936
8937
|
}
|
|
8937
8938
|
function il(t) {
|
|
8938
|
-
return t.role === "tool" && t.toolName ===
|
|
8939
|
+
return t.role === "tool" && t.toolName === Zs;
|
|
8939
8940
|
}
|
|
8940
|
-
function
|
|
8941
|
+
function Pi(t) {
|
|
8941
8942
|
return t.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
8942
8943
|
}
|
|
8943
8944
|
function Mh(t, e, n, i, s, o, r) {
|
|
@@ -9003,12 +9004,12 @@ function Mh(t, e, n, i, s, o, r) {
|
|
|
9003
9004
|
}
|
|
9004
9005
|
const b = u.details;
|
|
9005
9006
|
b.open = n.has(d), h.classList.toggle("pluno-pa-widget__tool-group--open", b.open);
|
|
9006
|
-
const
|
|
9007
|
-
|
|
9008
|
-
).trim(), x =
|
|
9007
|
+
const f = t[t.length - 1], m = Pi(
|
|
9008
|
+
f.content
|
|
9009
|
+
).trim(), x = f.phase === "commentary", _ = m ? x ? m : ol(m) : l ? "Steered" : "Thinking...";
|
|
9009
9010
|
return h.dataset.collapsedActivityTitle = _, u.summaryTitle.replaceChildren(), u.summaryTitle.classList.add(
|
|
9010
9011
|
"pluno-pa-widget__tool-summary-markdown"
|
|
9011
|
-
),
|
|
9012
|
+
), uo(
|
|
9012
9013
|
u.summaryTitle,
|
|
9013
9014
|
b.open ? "Activity" : _
|
|
9014
9015
|
), yt(b, [u.summary, y]), yt(h, [u.character, b]), h;
|
|
@@ -9022,8 +9023,8 @@ function Ph(t, e, n, i) {
|
|
|
9022
9023
|
i.set(d, c), c.className = "pluno-pa-widget__tool-line", c.dataset.eventType = l.phase === "commentary" ? "commentary" : "tool", l.phase === "commentary" ? delete c.dataset.toolCallKey : c.dataset.toolCallKey = d;
|
|
9023
9024
|
const u = c.querySelector(".pluno-pa-widget__tool-line-text") ?? document.createElement("div");
|
|
9024
9025
|
u.className = "pluno-pa-widget__tool-line-text";
|
|
9025
|
-
const p =
|
|
9026
|
-
e && l === s && l.loading !== !1 && (u.classList.add("pluno-pa-widget__tool-line-text--loading"), u.dataset.loadingText = $l(h)), u.classList.add("pluno-pa-widget__tool-line-markdown"), u.replaceChildren(),
|
|
9026
|
+
const p = Pi(l.content) || (l.phase === "commentary" ? "" : "Run tool"), h = l.phase === "commentary" ? p : ol(p);
|
|
9027
|
+
e && l === s && l.loading !== !1 && (u.classList.add("pluno-pa-widget__tool-line-text--loading"), u.dataset.loadingText = $l(h)), u.classList.add("pluno-pa-widget__tool-line-markdown"), u.replaceChildren(), uo(u, h), c.replaceChildren(u), o.push(c);
|
|
9027
9028
|
}
|
|
9028
9029
|
for (const l of i.keys())
|
|
9029
9030
|
r.has(l) || i.delete(l);
|
|
@@ -9062,7 +9063,7 @@ function En(t) {
|
|
|
9062
9063
|
)
|
|
9063
9064
|
), e;
|
|
9064
9065
|
}
|
|
9065
|
-
function
|
|
9066
|
+
function Yr(t, e = "Thinking...") {
|
|
9066
9067
|
const n = En(t);
|
|
9067
9068
|
return n.classList.add("pluno-pa-widget__thinking-marker"), n.appendChild(An(e)), n;
|
|
9068
9069
|
}
|
|
@@ -9080,7 +9081,7 @@ function An(t = "Thinking...") {
|
|
|
9080
9081
|
}
|
|
9081
9082
|
function Dh(t) {
|
|
9082
9083
|
const e = t[0];
|
|
9083
|
-
return e ? `tools:${
|
|
9084
|
+
return e ? `tools:${Ks(e)}` : "tools:empty";
|
|
9084
9085
|
}
|
|
9085
9086
|
function Uh() {
|
|
9086
9087
|
const t = document.createElement("span");
|
|
@@ -9089,7 +9090,7 @@ function Uh() {
|
|
|
9089
9090
|
function rl(t, e) {
|
|
9090
9091
|
t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? Gg() : Za());
|
|
9091
9092
|
}
|
|
9092
|
-
function
|
|
9093
|
+
function Es(t) {
|
|
9093
9094
|
let e = t.trim();
|
|
9094
9095
|
if (!e.includes("|"))
|
|
9095
9096
|
return null;
|
|
@@ -9108,7 +9109,7 @@ function Nh(t) {
|
|
|
9108
9109
|
return e.startsWith(":") && e.endsWith(":") ? "center" : e.endsWith(":") ? "right" : e.startsWith(":") ? "left" : null;
|
|
9109
9110
|
}
|
|
9110
9111
|
function Oh(t, e) {
|
|
9111
|
-
const n =
|
|
9112
|
+
const n = Es(t[e] ?? ""), i = Es(t[e + 1] ?? "");
|
|
9112
9113
|
if (!n || !i || n.length !== i.length)
|
|
9113
9114
|
return null;
|
|
9114
9115
|
const s = [];
|
|
@@ -9128,19 +9129,19 @@ function Oh(t, e) {
|
|
|
9128
9129
|
const c = document.createElement("tbody");
|
|
9129
9130
|
let u = e + 2;
|
|
9130
9131
|
for (; u < t.length && t[u].trim(); ) {
|
|
9131
|
-
const p =
|
|
9132
|
+
const p = Es(t[u]);
|
|
9132
9133
|
if (!p)
|
|
9133
9134
|
break;
|
|
9134
9135
|
const h = document.createElement("tr");
|
|
9135
9136
|
n.forEach((y, b) => {
|
|
9136
|
-
const
|
|
9137
|
-
|
|
9137
|
+
const f = document.createElement("td"), m = s[b];
|
|
9138
|
+
m && f.classList.add(`pluno-pa-widget__table-cell--${m}`), _t(f, p[b] ?? ""), h.appendChild(f);
|
|
9138
9139
|
}), c.appendChild(h), u += 1;
|
|
9139
9140
|
}
|
|
9140
9141
|
return r.appendChild(c), o.appendChild(r), { element: o, nextIndex: u };
|
|
9141
9142
|
}
|
|
9142
|
-
function
|
|
9143
|
-
const n =
|
|
9143
|
+
function uo(t, e) {
|
|
9144
|
+
const n = na(e).replace(/\r\n/g, `
|
|
9144
9145
|
`).split(`
|
|
9145
9146
|
`);
|
|
9146
9147
|
let i = 0;
|
|
@@ -9239,7 +9240,7 @@ function qh(t) {
|
|
|
9239
9240
|
return !1;
|
|
9240
9241
|
}
|
|
9241
9242
|
}
|
|
9242
|
-
function
|
|
9243
|
+
function Xr(t, e) {
|
|
9243
9244
|
if (zh(t))
|
|
9244
9245
|
return;
|
|
9245
9246
|
const n = `
|
|
@@ -10868,7 +10869,7 @@ function Yr(t, e) {
|
|
|
10868
10869
|
left: 0;
|
|
10869
10870
|
}
|
|
10870
10871
|
.pluno-pa-widget--proactive-suggestion-below .pluno-pa-widget__proactive-suggestion {
|
|
10871
|
-
top: calc(var(--pluno-pa-launcher-height) + ${
|
|
10872
|
+
top: calc(var(--pluno-pa-launcher-height) + ${Bs}px);
|
|
10872
10873
|
bottom: auto;
|
|
10873
10874
|
}
|
|
10874
10875
|
.pluno-pa-widget__proactive-suggestion-slot {
|
|
@@ -11869,8 +11870,8 @@ function Yr(t, e) {
|
|
|
11869
11870
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
11870
11871
|
position: absolute;
|
|
11871
11872
|
top: -16px;
|
|
11872
|
-
left: ${
|
|
11873
|
-
width: calc(100% - ${
|
|
11873
|
+
left: ${Hs}px;
|
|
11874
|
+
width: calc(100% - ${Hs * 2}px);
|
|
11874
11875
|
height: 36px;
|
|
11875
11876
|
z-index: 3;
|
|
11876
11877
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -12400,11 +12401,11 @@ async function Wh() {
|
|
|
12400
12401
|
e.observe(document.documentElement, { childList: !0 });
|
|
12401
12402
|
});
|
|
12402
12403
|
}
|
|
12403
|
-
function
|
|
12404
|
+
function go(t) {
|
|
12404
12405
|
return `pluno.productAgent.widgetState.${location.origin}.${t.backendUrl ?? ""}.${t.tokenEndpoint ?? ""}.${t.position ?? ""}`;
|
|
12405
12406
|
}
|
|
12406
12407
|
function ll(t) {
|
|
12407
|
-
return `${
|
|
12408
|
+
return `${go(t)}.displayState`;
|
|
12408
12409
|
}
|
|
12409
12410
|
function Fh(t) {
|
|
12410
12411
|
try {
|
|
@@ -12415,7 +12416,7 @@ function Fh(t) {
|
|
|
12415
12416
|
return "shown";
|
|
12416
12417
|
}
|
|
12417
12418
|
}
|
|
12418
|
-
function
|
|
12419
|
+
function Jr(t, e) {
|
|
12419
12420
|
if (t.layout === "floating")
|
|
12420
12421
|
try {
|
|
12421
12422
|
const n = ll(t);
|
|
@@ -12433,9 +12434,9 @@ function Hh(t) {
|
|
|
12433
12434
|
return { clientId: t, release: () => {
|
|
12434
12435
|
} };
|
|
12435
12436
|
let e = 0;
|
|
12436
|
-
for (;
|
|
12437
|
+
for (; ys.has(e); )
|
|
12437
12438
|
e += 1;
|
|
12438
|
-
|
|
12439
|
+
ys.add(e);
|
|
12439
12440
|
const n = `${Uu}${e}`;
|
|
12440
12441
|
let i = crypto.randomUUID();
|
|
12441
12442
|
try {
|
|
@@ -12446,15 +12447,15 @@ function Hh(t) {
|
|
|
12446
12447
|
return {
|
|
12447
12448
|
clientId: i,
|
|
12448
12449
|
release: () => {
|
|
12449
|
-
s || (s = !0,
|
|
12450
|
+
s || (s = !0, ys.delete(e));
|
|
12450
12451
|
}
|
|
12451
12452
|
};
|
|
12452
12453
|
}
|
|
12453
12454
|
function $h(t) {
|
|
12454
12455
|
try {
|
|
12455
|
-
const e = window.localStorage.getItem(
|
|
12456
|
+
const e = window.localStorage.getItem(go(t));
|
|
12456
12457
|
if (!e)
|
|
12457
|
-
return
|
|
12458
|
+
return Zr();
|
|
12458
12459
|
const n = JSON.parse(e);
|
|
12459
12460
|
return {
|
|
12460
12461
|
isOpen: n.isOpen === !0,
|
|
@@ -12465,12 +12466,12 @@ function $h(t) {
|
|
|
12465
12466
|
(i) => typeof i == "string"
|
|
12466
12467
|
) : [],
|
|
12467
12468
|
launcherPosition: Vh(n.launcherPosition) ? n.launcherPosition : null,
|
|
12468
|
-
panelSize: Yh(n.panelSize) ?
|
|
12469
|
+
panelSize: Yh(n.panelSize) ? Ui(n.panelSize) : null,
|
|
12469
12470
|
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-qa) : [],
|
|
12470
12471
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
12471
12472
|
};
|
|
12472
12473
|
} catch {
|
|
12473
|
-
return
|
|
12474
|
+
return Zr();
|
|
12474
12475
|
}
|
|
12475
12476
|
}
|
|
12476
12477
|
async function jh(t) {
|
|
@@ -12496,7 +12497,7 @@ function Gh(t, e) {
|
|
|
12496
12497
|
return;
|
|
12497
12498
|
}
|
|
12498
12499
|
}
|
|
12499
|
-
function
|
|
12500
|
+
function Zr() {
|
|
12500
12501
|
return {
|
|
12501
12502
|
isOpen: !1,
|
|
12502
12503
|
composerValue: "",
|
|
@@ -12512,7 +12513,7 @@ function Jr() {
|
|
|
12512
12513
|
function Kh(t, e) {
|
|
12513
12514
|
try {
|
|
12514
12515
|
window.localStorage.setItem(
|
|
12515
|
-
|
|
12516
|
+
go(t),
|
|
12516
12517
|
JSON.stringify(e)
|
|
12517
12518
|
);
|
|
12518
12519
|
} catch {
|
|
@@ -12558,7 +12559,7 @@ function Xh(t) {
|
|
|
12558
12559
|
let o = !1;
|
|
12559
12560
|
const r = new Promise((l, d) => {
|
|
12560
12561
|
const c = window.setTimeout(() => {
|
|
12561
|
-
o = !0, s.abort(), d(new Error(
|
|
12562
|
+
o = !0, s.abort(), d(new Error(Er));
|
|
12562
12563
|
}, Lu);
|
|
12563
12564
|
s.signal.addEventListener(
|
|
12564
12565
|
"abort",
|
|
@@ -12573,7 +12574,7 @@ function Xh(t) {
|
|
|
12573
12574
|
]);
|
|
12574
12575
|
return s.abort(), l;
|
|
12575
12576
|
} catch (l) {
|
|
12576
|
-
throw s.abort(), o ? new Error(
|
|
12577
|
+
throw s.abort(), o ? new Error(Er) : l instanceof Error && l.message.startsWith("Pluno widget blocked on ") ? l : new Error(Du);
|
|
12577
12578
|
}
|
|
12578
12579
|
};
|
|
12579
12580
|
return {
|
|
@@ -12596,17 +12597,17 @@ function Xh(t) {
|
|
|
12596
12597
|
}
|
|
12597
12598
|
};
|
|
12598
12599
|
}
|
|
12599
|
-
const
|
|
12600
|
+
const Qr = /* @__PURE__ */ new WeakSet();
|
|
12600
12601
|
function Jh(t) {
|
|
12601
12602
|
return Object.keys(t.dataset).some((e) => e.startsWith("pluno"));
|
|
12602
12603
|
}
|
|
12603
|
-
function
|
|
12604
|
+
function ea(t) {
|
|
12604
12605
|
const e = t.pathname.split("/");
|
|
12605
12606
|
return e[e.length - 1] ?? "";
|
|
12606
12607
|
}
|
|
12607
12608
|
function Zh(t, e) {
|
|
12608
12609
|
const n = new URL(t.src, document.baseURI);
|
|
12609
|
-
return n.href === e.href || n.pathname === e.pathname ? !0 :
|
|
12610
|
+
return n.href === e.href || n.pathname === e.pathname ? !0 : ea(n) === ea(e);
|
|
12610
12611
|
}
|
|
12611
12612
|
class st extends EventTarget {
|
|
12612
12613
|
constructor(e, n) {
|
|
@@ -12698,17 +12699,17 @@ class st extends EventTarget {
|
|
|
12698
12699
|
}
|
|
12699
12700
|
function Qh() {
|
|
12700
12701
|
const t = window.sessionStorage.getItem(
|
|
12701
|
-
|
|
12702
|
+
kr
|
|
12702
12703
|
);
|
|
12703
12704
|
if (t)
|
|
12704
12705
|
return t;
|
|
12705
12706
|
const e = crypto.randomUUID();
|
|
12706
|
-
return window.sessionStorage.setItem(
|
|
12707
|
+
return window.sessionStorage.setItem(kr, e), e;
|
|
12707
12708
|
}
|
|
12708
12709
|
function pi(t, e) {
|
|
12709
12710
|
return `${t}:${e}`;
|
|
12710
12711
|
}
|
|
12711
|
-
function
|
|
12712
|
+
function ef(t) {
|
|
12712
12713
|
const e = document.currentScript;
|
|
12713
12714
|
if (e instanceof HTMLScriptElement)
|
|
12714
12715
|
return [e];
|
|
@@ -12719,9 +12720,9 @@ function em(t) {
|
|
|
12719
12720
|
(s) => s instanceof HTMLScriptElement && Jh(s) && Zh(s, i)
|
|
12720
12721
|
);
|
|
12721
12722
|
}
|
|
12722
|
-
function
|
|
12723
|
-
for (const e of
|
|
12724
|
-
|
|
12723
|
+
function tf(t) {
|
|
12724
|
+
for (const e of ef(t))
|
|
12725
|
+
Qr.has(e) || e.dataset.plunoAutoMount === "false" || (Qr.add(e), pl(e).catch((n) => {
|
|
12725
12726
|
console.error("Failed to mount Pluno widget", n);
|
|
12726
12727
|
}));
|
|
12727
12728
|
}
|
|
@@ -12733,7 +12734,7 @@ function pl(t) {
|
|
|
12733
12734
|
const d = e[nt];
|
|
12734
12735
|
return d ? d.mountPromise : pl(t);
|
|
12735
12736
|
});
|
|
12736
|
-
if (
|
|
12737
|
+
if (nf(n.host))
|
|
12737
12738
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
12738
12739
|
n.destroy?.(), delete e[nt];
|
|
12739
12740
|
}
|
|
@@ -12770,10 +12771,10 @@ function pl(t) {
|
|
|
12770
12771
|
retryPendingTokenFailureOnce: o?.retryPendingFailureOnce ?? null
|
|
12771
12772
|
}, e[nt] = r, l;
|
|
12772
12773
|
}
|
|
12773
|
-
function
|
|
12774
|
+
function nf(t) {
|
|
12774
12775
|
return t.isConnected && t.getAttribute(za) === "true" && !!t.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!t.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
12775
12776
|
}
|
|
12776
|
-
|
|
12777
|
+
tf(import.meta.url);
|
|
12777
12778
|
export {
|
|
12778
12779
|
tg as createProductAgentPreviewBridgeWebSocketFactory,
|
|
12779
12780
|
ng as mountPlunoProductAgentWidget
|