@pluno/product-agent-web 0.1.65 → 0.1.67
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 +153 -149
- package/dist/product-agent-widget.js +523 -487
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PlunoProductAgent as qo } from "./product-agent-sdk.js";
|
|
2
|
-
const
|
|
1
|
+
import { PlunoProductAgent as qo, getProductAgentOriginAccessErrorMessage as jo } from "./product-agent-sdk.js";
|
|
2
|
+
const Vo = "#7c3aed", pt = "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", st = "#2c2a1e", fn = [253, 250, 241], wn = 3.5;
|
|
3
3
|
function Kn(e) {
|
|
4
4
|
const t = Yn(e);
|
|
5
5
|
if (bn(Ke(t), fn) >= wn)
|
|
@@ -7,11 +7,11 @@ function Kn(e) {
|
|
|
7
7
|
let o = Ke(t);
|
|
8
8
|
const i = Ke(st);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
10
|
+
if (o = Xo(o, i, 0.22), bn(o, fn) >= wn)
|
|
11
11
|
return Ft(o);
|
|
12
12
|
return Ft(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Ko() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
@@ -19,7 +19,7 @@ function Vo() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Yo(e) {
|
|
23
23
|
const t = Yn(e), n = Ht(Ke(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
@@ -58,7 +58,7 @@ function Ko(e) {
|
|
|
58
58
|
}
|
|
59
59
|
function Yn(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
|
-
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` :
|
|
61
|
+
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Vo;
|
|
62
62
|
}
|
|
63
63
|
function Ke(e) {
|
|
64
64
|
return [
|
|
@@ -82,7 +82,7 @@ function bn(e, t) {
|
|
|
82
82
|
const n = Ht(e), o = Ht(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Xo(e, t, n) {
|
|
86
86
|
const o = Wt(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
@@ -91,17 +91,17 @@ function Yo(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function ne(e, t, n) {
|
|
94
|
-
const [o, i, r] =
|
|
95
|
-
return Ft(
|
|
94
|
+
const [o, i, r] = Zo(Ke(e));
|
|
95
|
+
return Ft(Jo(o, Wt(i + n), Wt(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Zo([e, t, n]) {
|
|
98
98
|
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
101
|
const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
102
|
return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Jo(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
@@ -119,7 +119,7 @@ function Wt(e) {
|
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
121
|
const Xn = "suggest_share_on_socials";
|
|
122
|
-
function
|
|
122
|
+
function Qo(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
125
|
if (n.role !== "tool" || n.toolName !== Xn)
|
|
@@ -136,8 +136,8 @@ function Jo(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function ei(e) {
|
|
140
|
+
const t = await ti(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
@@ -150,50 +150,50 @@ function _n(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function ti(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
156
|
+
const ni = "https://app.pluno.ai", oi = "/api/product-agent/embed/active-users", ii = 1800, ai = 15e3, ri = 250, li = 1e3, pi = 3e4;
|
|
157
|
+
function si(e, t = {}) {
|
|
158
158
|
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
161
|
}, p = (u) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
c();
|
|
164
|
-
},
|
|
164
|
+
}, ui(u)));
|
|
165
165
|
}, d = (u) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
167
|
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const m = o,
|
|
170
|
+
const m = o, k = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const v = Math.min(1, (performance.now() -
|
|
177
|
-
o = Math.round(m + (u - m) *
|
|
178
|
-
},
|
|
176
|
+
const v = Math.min(1, (performance.now() - k) / ii);
|
|
177
|
+
o = Math.round(m + (u - m) * gi(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
|
+
}, ri);
|
|
179
179
|
}, c = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const u = await
|
|
181
|
+
const u = await di(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
184
|
d(u.count), p(u.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(ai);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return c(), () => {
|
|
190
190
|
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function di(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(oi, ci(e.backendUrl ?? ni)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
@@ -207,16 +207,16 @@ async function si(e) {
|
|
|
207
207
|
function xn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function di(e) {
|
|
211
|
-
return e.endsWith("/") ? e : `${e}/`;
|
|
212
|
-
}
|
|
213
210
|
function ci(e) {
|
|
214
|
-
return
|
|
211
|
+
return e.endsWith("/") ? e : `${e}/`;
|
|
215
212
|
}
|
|
216
213
|
function ui(e) {
|
|
214
|
+
return Math.min(pi, Math.max(li, e));
|
|
215
|
+
}
|
|
216
|
+
function gi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const Zn = 100,
|
|
219
|
+
const Zn = 100, hi = 1e4, mi = 5e3, fi = "product-agent:sdk-preview-socket-connect", wi = "product-agent:sdk-preview-socket-send", bi = "product-agent:sdk-preview-socket-close", _i = "product-agent:sdk-preview-socket-open", xi = "product-agent:sdk-preview-socket-message", yi = "product-agent:sdk-preview-socket-error", vi = "product-agent:sdk-preview-socket-closed", yn = "product-agent:sdk-preview-socket-id", Ci = "data-pluno-sdk-preview-channel", Si = "product-agent:preview-diagnostic", Jn = "pluno.productAgent.sharePromptsDisabled", Ei = 3, vn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ki = 400, Li = 5e3, Pi = 500, Cn = "Close the page's popup to chat", Ii = "No recent chats for this page yet.", oe = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const Zn = 100, gi = 1e4, hi = 5e3, mi = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !1,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
},
|
|
227
|
+
}, Ai = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Sn = "pluno-pa-scribble-font", Qn = 190, eo = 41, En = 22, Ni = 1, Ti = 48, Jt = 420, Di = 520, zi = 0.24, Qt = 680, Ri = 800, Mi = 0.76, I = 8, Ce = 50, to = "http://www.w3.org/2000/svg", Gt = 26, $t = 8, Oi = 36, qt = 16, Bi = 4, kn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,12 +261,12 @@ const Zn = 100, gi = 1e4, hi = 5e3, mi = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
],
|
|
264
|
+
], Ui = 11, Fi = 13, jt = 4, no = 10, oo = 40, Hi = "movable-launcher-position-v2", io = "pluno-pa-widget-styles", ao = "data-pluno-pa-widget-styles";
|
|
265
265
|
let Ln = 0;
|
|
266
|
-
function
|
|
266
|
+
function Wi(e) {
|
|
267
267
|
return (t) => new se(t, e);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function Gi(e = {}) {
|
|
270
270
|
const t = {
|
|
271
271
|
launcherLabel: e.launcherLabel ?? oe.launcherLabel,
|
|
272
272
|
accentColor: e.accentColor ?? oe.accentColor,
|
|
@@ -325,7 +325,7 @@ async function $i(e = {}) {
|
|
|
325
325
|
);
|
|
326
326
|
const n = document.createElement("div");
|
|
327
327
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
328
|
-
|
|
328
|
+
Ci,
|
|
329
329
|
t.sdkPreviewChannelId
|
|
330
330
|
);
|
|
331
331
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
@@ -334,14 +334,14 @@ async function $i(e = {}) {
|
|
|
334
334
|
t.accentColor,
|
|
335
335
|
t.scribbleStyle
|
|
336
336
|
);
|
|
337
|
-
|
|
337
|
+
ua(
|
|
338
338
|
i,
|
|
339
339
|
t.launcherLabel,
|
|
340
340
|
r,
|
|
341
341
|
t.movableLauncher,
|
|
342
342
|
t.showLauncherMinimizeButton
|
|
343
343
|
), o.appendChild(i);
|
|
344
|
-
const l =
|
|
344
|
+
const l = pr(t);
|
|
345
345
|
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
346
|
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ve(
|
|
347
347
|
i,
|
|
@@ -356,7 +356,7 @@ async function $i(e = {}) {
|
|
|
356
356
|
fontFamily: t.fontFamily,
|
|
357
357
|
scribbleStyle: t.scribbleStyle
|
|
358
358
|
});
|
|
359
|
-
const m = await
|
|
359
|
+
const m = await lr(), k = m.ownerDocument;
|
|
360
360
|
m.appendChild(n), J(
|
|
361
361
|
"web-sdk.widget",
|
|
362
362
|
"Applied initial widget appearance",
|
|
@@ -369,19 +369,19 @@ async function $i(e = {}) {
|
|
|
369
369
|
);
|
|
370
370
|
const v = i.querySelector(
|
|
371
371
|
".pluno-pa-widget__launcher"
|
|
372
|
-
),
|
|
372
|
+
), R = i.querySelector(
|
|
373
373
|
".pluno-pa-widget__launcher-drag-handle"
|
|
374
|
-
),
|
|
374
|
+
), _ = i.querySelector(
|
|
375
375
|
".pluno-pa-widget__launcher-input"
|
|
376
376
|
), g = i.querySelector(
|
|
377
377
|
".pluno-pa-widget__launcher-minimize"
|
|
378
|
-
),
|
|
378
|
+
), b = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
379
379
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
380
380
|
), P = Array.from(
|
|
381
381
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
382
382
|
), A = i.querySelector(
|
|
383
383
|
".pluno-pa-widget__close"
|
|
384
|
-
),
|
|
384
|
+
), L = i.querySelector(
|
|
385
385
|
".pluno-pa-widget__composer"
|
|
386
386
|
), F = i.querySelector(
|
|
387
387
|
".pluno-pa-widget__attachment-error"
|
|
@@ -391,7 +391,7 @@ async function $i(e = {}) {
|
|
|
391
391
|
".pluno-pa-widget__attachments"
|
|
392
392
|
), Q = i.querySelector(
|
|
393
393
|
".pluno-pa-widget__attachment-input"
|
|
394
|
-
),
|
|
394
|
+
), Re = i.querySelector(
|
|
395
395
|
".pluno-pa-widget__attach"
|
|
396
396
|
), x = i.querySelector(
|
|
397
397
|
".pluno-pa-widget__input"
|
|
@@ -409,7 +409,7 @@ async function $i(e = {}) {
|
|
|
409
409
|
".pluno-pa-widget__history-close"
|
|
410
410
|
), q = i.querySelector(
|
|
411
411
|
".pluno-pa-widget__history-status"
|
|
412
|
-
),
|
|
412
|
+
), z = i.querySelector(
|
|
413
413
|
".pluno-pa-widget__timeline-jump"
|
|
414
414
|
), D = i.querySelector(
|
|
415
415
|
".pluno-pa-widget__active-users-counter"
|
|
@@ -426,19 +426,19 @@ async function $i(e = {}) {
|
|
|
426
426
|
), So = i.querySelector(
|
|
427
427
|
".pluno-pa-widget__notify-suggestion-never"
|
|
428
428
|
);
|
|
429
|
-
if (!v || !
|
|
429
|
+
if (!v || !_ || !b || !A || !L || !F || !H || !$ || !Q || !Re || !x || !de || !Ye || !X || !C || !T || !Se || !q || !z || !D || !N || !ht)
|
|
430
430
|
throw new Error("Failed to mount Pluno widget");
|
|
431
|
-
if (t.movableLauncher && !
|
|
431
|
+
if (t.movableLauncher && !R)
|
|
432
432
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
433
|
-
Mn(
|
|
433
|
+
Mn(_), Mn(x);
|
|
434
434
|
let W = [], le = null;
|
|
435
435
|
const Ee = () => {
|
|
436
|
-
|
|
436
|
+
Na(
|
|
437
437
|
$,
|
|
438
438
|
W,
|
|
439
439
|
(a) => {
|
|
440
440
|
W = W.filter(
|
|
441
|
-
(s,
|
|
441
|
+
(s, w) => w !== a
|
|
442
442
|
), Ee(), G(y.getState()), j();
|
|
443
443
|
}
|
|
444
444
|
);
|
|
@@ -454,8 +454,10 @@ async function $i(e = {}) {
|
|
|
454
454
|
url: location.href
|
|
455
455
|
})
|
|
456
456
|
});
|
|
457
|
-
if (!a.ok)
|
|
458
|
-
|
|
457
|
+
if (!a.ok) {
|
|
458
|
+
const w = await a.text(), S = jo(w);
|
|
459
|
+
throw S ? (console.error(S), new Error(S)) : new Error(`Failed to load Pluno token (${a.status})`);
|
|
460
|
+
}
|
|
459
461
|
const s = await a.json();
|
|
460
462
|
if (!s.token)
|
|
461
463
|
throw new Error("Pluno token endpoint did not return a token");
|
|
@@ -481,15 +483,15 @@ async function $i(e = {}) {
|
|
|
481
483
|
const mt = new Set(l.openToolGroupKeys), ke = new Set(
|
|
482
484
|
l.seenShareCandidateIds
|
|
483
485
|
), Xe = new Set(ke);
|
|
484
|
-
let ft = l.sharePromptsDisabled || await
|
|
486
|
+
let ft = l.sharePromptsDisabled || await sr(t), Z = null, Le = !1, fe = !1, we = {
|
|
485
487
|
enabled: !0
|
|
486
488
|
}, be = 0, nn = "", ce = !1, pe = !1, ue = [], wt = null, Oe = null;
|
|
487
489
|
const ee = (a, s) => {
|
|
488
490
|
we = { enabled: a, reason: s };
|
|
489
491
|
}, te = () => {
|
|
490
|
-
|
|
492
|
+
z.hidden = !0;
|
|
491
493
|
}, Lo = () => {
|
|
492
|
-
|
|
494
|
+
z.hidden = !1;
|
|
493
495
|
}, Po = (a = "jump") => {
|
|
494
496
|
ee(!0, a), te(), Ve(N, () => we.enabled), be = N.scrollTop;
|
|
495
497
|
}, _e = () => {
|
|
@@ -503,15 +505,15 @@ async function $i(e = {}) {
|
|
|
503
505
|
for (const a of ue) {
|
|
504
506
|
const s = document.createElement("button");
|
|
505
507
|
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
const
|
|
509
|
-
|
|
508
|
+
const w = document.createElement("span");
|
|
509
|
+
w.className = "pluno-pa-widget__history-item-title", w.textContent = sa(a);
|
|
510
|
+
const S = document.createElement("time");
|
|
511
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = ca(
|
|
510
512
|
a.lastActiveAt,
|
|
511
513
|
Date.now()
|
|
512
514
|
);
|
|
513
515
|
const M = document.createElement("small");
|
|
514
|
-
M.className = "pluno-pa-widget__history-path", M.textContent =
|
|
516
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = da(a), s.append(w, S, M), s.addEventListener("click", () => {
|
|
515
517
|
ce = !1, Oe = null, _e(), ee(!0, "newSession"), te(), y.loadSession(a.id), G(y.getState());
|
|
516
518
|
}), T.appendChild(s);
|
|
517
519
|
}
|
|
@@ -533,7 +535,7 @@ async function $i(e = {}) {
|
|
|
533
535
|
{
|
|
534
536
|
message: s instanceof Error ? s.message : String(s)
|
|
535
537
|
}
|
|
536
|
-
), Oe =
|
|
538
|
+
), Oe = Ii;
|
|
537
539
|
} finally {
|
|
538
540
|
pe = !1, _e();
|
|
539
541
|
}
|
|
@@ -541,9 +543,9 @@ async function $i(e = {}) {
|
|
|
541
543
|
}, Io = () => {
|
|
542
544
|
!wt || pe || T.scrollHeight - T.scrollTop - T.clientHeight <= 24 && on(wt);
|
|
543
545
|
}, Ao = () => {
|
|
544
|
-
Le || typeof document > "u" || ($n(o, t.accentColor), n.isConnected ||
|
|
546
|
+
Le || typeof document > "u" || ($n(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
|
|
545
547
|
}, an = new MutationObserver(Ao);
|
|
546
|
-
an.observe(
|
|
548
|
+
an.observe(k.documentElement, {
|
|
547
549
|
childList: !0,
|
|
548
550
|
subtree: !0
|
|
549
551
|
});
|
|
@@ -551,7 +553,7 @@ async function $i(e = {}) {
|
|
|
551
553
|
const s = dt(i, a);
|
|
552
554
|
return Vt(
|
|
553
555
|
i,
|
|
554
|
-
p ? ro(p, s) :
|
|
556
|
+
p ? ro(p, s) : Zi(
|
|
555
557
|
i,
|
|
556
558
|
t.position,
|
|
557
559
|
s
|
|
@@ -559,8 +561,12 @@ async function $i(e = {}) {
|
|
|
559
561
|
s
|
|
560
562
|
);
|
|
561
563
|
}, B = () => {
|
|
562
|
-
const a =
|
|
563
|
-
|
|
564
|
+
const a = ia(
|
|
565
|
+
o,
|
|
566
|
+
_,
|
|
567
|
+
x
|
|
568
|
+
);
|
|
569
|
+
cr(t, {
|
|
564
570
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
565
571
|
composerValue: x.value,
|
|
566
572
|
focusedInput: a,
|
|
@@ -580,7 +586,7 @@ async function $i(e = {}) {
|
|
|
580
586
|
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Fe(!1), s && Ze("shown");
|
|
581
587
|
return;
|
|
582
588
|
}
|
|
583
|
-
Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1,
|
|
589
|
+
Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, b.hidden = !0, A.hidden = !0, v.tabIndex = 0, x.value = "", ve(
|
|
584
590
|
i,
|
|
585
591
|
Tt(
|
|
586
592
|
i,
|
|
@@ -589,8 +595,8 @@ async function $i(e = {}) {
|
|
|
589
595
|
)
|
|
590
596
|
), Dn(i), B(), s && Ze("minimized");
|
|
591
597
|
}, xe = (a, s = {}) => {
|
|
592
|
-
|
|
593
|
-
debugVersion:
|
|
598
|
+
oa(a, {
|
|
599
|
+
debugVersion: Hi,
|
|
594
600
|
launcherPosition: p,
|
|
595
601
|
rootClasses: i.className,
|
|
596
602
|
rootStyle: {
|
|
@@ -599,11 +605,11 @@ async function $i(e = {}) {
|
|
|
599
605
|
right: i.style.right,
|
|
600
606
|
bottom: i.style.bottom
|
|
601
607
|
},
|
|
602
|
-
rootRect:
|
|
603
|
-
launcherRect:
|
|
604
|
-
panelRect:
|
|
608
|
+
rootRect: zt(i),
|
|
609
|
+
launcherRect: zt(v),
|
|
610
|
+
panelRect: zt(b),
|
|
605
611
|
viewport: Y(),
|
|
606
|
-
panelHidden:
|
|
612
|
+
panelHidden: b.hidden,
|
|
607
613
|
closeHidden: A.hidden,
|
|
608
614
|
...s
|
|
609
615
|
});
|
|
@@ -619,7 +625,7 @@ async function $i(e = {}) {
|
|
|
619
625
|
Dn(i);
|
|
620
626
|
return;
|
|
621
627
|
}
|
|
622
|
-
|
|
628
|
+
na(i, {
|
|
623
629
|
x: a.x - s.x,
|
|
624
630
|
y: a.y - s.y
|
|
625
631
|
});
|
|
@@ -638,12 +644,9 @@ async function $i(e = {}) {
|
|
|
638
644
|
const a = Fe();
|
|
639
645
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
640
646
|
Nt(i, c);
|
|
641
|
-
const s =
|
|
642
|
-
Mt(
|
|
643
|
-
|
|
644
|
-
s.width
|
|
645
|
-
);
|
|
646
|
-
const _ = lt(
|
|
647
|
+
const s = ze(c);
|
|
648
|
+
Mt(h, s.width);
|
|
649
|
+
const w = lt(
|
|
647
650
|
u ?? Dt(
|
|
648
651
|
i,
|
|
649
652
|
a,
|
|
@@ -652,9 +655,9 @@ async function $i(e = {}) {
|
|
|
652
655
|
),
|
|
653
656
|
s
|
|
654
657
|
);
|
|
655
|
-
u && (u =
|
|
658
|
+
u && (u = w), bt(w, a), xe(
|
|
656
659
|
"Applied open panel position after viewport resize",
|
|
657
|
-
{ openPanelPosition:
|
|
660
|
+
{ openPanelPosition: w }
|
|
658
661
|
);
|
|
659
662
|
} else p && xe(
|
|
660
663
|
"Applied visible launcher position after viewport resize",
|
|
@@ -663,21 +666,21 @@ async function $i(e = {}) {
|
|
|
663
666
|
};
|
|
664
667
|
let ln = () => {
|
|
665
668
|
};
|
|
666
|
-
window.addEventListener("resize", rn), t.movableLauncher &&
|
|
669
|
+
window.addEventListener("resize", rn), t.movableLauncher && R ? (Fe(), ln = Ki({
|
|
667
670
|
root: i,
|
|
668
671
|
launcher: v,
|
|
669
|
-
launcherDragHandle:
|
|
672
|
+
launcherDragHandle: R,
|
|
670
673
|
getPosition: () => Be(),
|
|
671
674
|
setPosition: (a) => {
|
|
672
|
-
const s = a,
|
|
675
|
+
const s = a, w = dt(i), S = Vt(
|
|
673
676
|
i,
|
|
674
677
|
a,
|
|
675
|
-
|
|
678
|
+
w
|
|
676
679
|
);
|
|
677
|
-
p =
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
), ve(i,
|
|
680
|
+
p = Qi(
|
|
681
|
+
S,
|
|
682
|
+
w
|
|
683
|
+
), ve(i, S), xe("Dragging closed launcher", {
|
|
681
684
|
requestedPosition: s
|
|
682
685
|
});
|
|
683
686
|
},
|
|
@@ -686,7 +689,7 @@ async function $i(e = {}) {
|
|
|
686
689
|
}
|
|
687
690
|
})) : ve(i, null), Nt(i, c);
|
|
688
691
|
const No = () => {
|
|
689
|
-
const a =
|
|
692
|
+
const a = ze(c), s = Be();
|
|
690
693
|
return {
|
|
691
694
|
position: lt(
|
|
692
695
|
u ?? Dt(
|
|
@@ -702,14 +705,14 @@ async function $i(e = {}) {
|
|
|
702
705
|
}, To = (a) => {
|
|
703
706
|
c = ut(a.size), Nt(i, c), Mt(
|
|
704
707
|
h,
|
|
705
|
-
|
|
708
|
+
ze(c).width
|
|
706
709
|
), u = lt(
|
|
707
710
|
a.position,
|
|
708
|
-
|
|
711
|
+
ze(c)
|
|
709
712
|
);
|
|
710
713
|
const s = Be();
|
|
711
714
|
bt(u, s);
|
|
712
|
-
}, Do = P.length > 0 ?
|
|
715
|
+
}, Do = P.length > 0 ? Yi({
|
|
713
716
|
root: i,
|
|
714
717
|
handles: P,
|
|
715
718
|
getBounds: No,
|
|
@@ -737,19 +740,19 @@ async function $i(e = {}) {
|
|
|
737
740
|
}
|
|
738
741
|
}
|
|
739
742
|
}, ge = (a = "", s = !0) => {
|
|
740
|
-
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1),
|
|
743
|
+
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1), b.hidden = !1, A.hidden = !1, Mt(
|
|
741
744
|
h,
|
|
742
|
-
|
|
745
|
+
ze(c).width
|
|
743
746
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
744
|
-
const
|
|
747
|
+
const w = Fe(), S = Dt(
|
|
745
748
|
i,
|
|
746
|
-
|
|
749
|
+
w,
|
|
747
750
|
t.position,
|
|
748
751
|
c
|
|
749
752
|
);
|
|
750
|
-
if (bt(
|
|
751
|
-
openPanelPosition:
|
|
752
|
-
visibleLauncherPosition:
|
|
753
|
+
if (bt(S, w), xe("Opening launcher at clamped open panel position", {
|
|
754
|
+
openPanelPosition: S,
|
|
755
|
+
visibleLauncherPosition: w
|
|
753
756
|
}), ee(!0, "open"), te(), !s) {
|
|
754
757
|
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (x.value = a, je(x)), Ve(N, () => we.enabled), be = N.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), B(), Ze("shown"), t.onPanelOpenChange?.(!0);
|
|
755
758
|
return;
|
|
@@ -759,36 +762,36 @@ async function $i(e = {}) {
|
|
|
759
762
|
v.hidden = !0, Ve(N, () => we.enabled), be = N.scrollTop;
|
|
760
763
|
}, 220);
|
|
761
764
|
});
|
|
762
|
-
},
|
|
765
|
+
}, zo = () => {
|
|
763
766
|
Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (Fe(!1), xe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
|
|
764
|
-
|
|
767
|
+
b.hidden = !0, A.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
765
768
|
}, 220);
|
|
766
769
|
};
|
|
767
770
|
v.addEventListener("submit", (a) => {
|
|
768
|
-
a.preventDefault(), ge(
|
|
769
|
-
}),
|
|
771
|
+
a.preventDefault(), ge(_.value), _.value = "";
|
|
772
|
+
}), R?.addEventListener("click", (a) => {
|
|
770
773
|
a.preventDefault(), a.stopPropagation();
|
|
771
774
|
}), v.addEventListener("click", (a) => {
|
|
772
|
-
a.target ===
|
|
773
|
-
}),
|
|
774
|
-
ge(
|
|
775
|
-
}),
|
|
776
|
-
if (!
|
|
775
|
+
a.target === _ && !R || (ge(_.value), _.value = "");
|
|
776
|
+
}), _.addEventListener("focus", () => {
|
|
777
|
+
ge(_.value), _.value = "";
|
|
778
|
+
}), _.addEventListener("input", () => {
|
|
779
|
+
if (!_.value)
|
|
777
780
|
return;
|
|
778
|
-
const a =
|
|
779
|
-
ge(a),
|
|
781
|
+
const a = _.value;
|
|
782
|
+
ge(a), _.value = "";
|
|
780
783
|
});
|
|
781
784
|
let xt = null, Je = null, ye = null;
|
|
782
|
-
const sn = (a) => a ===
|
|
785
|
+
const sn = (a) => a === _ || a === x, Ro = (a) => {
|
|
783
786
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
784
787
|
return null;
|
|
785
788
|
let s = a;
|
|
786
789
|
for (; s; ) {
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
789
|
-
return
|
|
790
|
-
const
|
|
791
|
-
s =
|
|
790
|
+
const w = s.closest(vn);
|
|
791
|
+
if (w)
|
|
792
|
+
return w;
|
|
793
|
+
const S = s.getRootNode();
|
|
794
|
+
s = S instanceof ShadowRoot ? S.host : null;
|
|
792
795
|
}
|
|
793
796
|
return null;
|
|
794
797
|
}, Mo = (a) => {
|
|
@@ -803,10 +806,13 @@ async function $i(e = {}) {
|
|
|
803
806
|
const s = window.getComputedStyle(a);
|
|
804
807
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
805
808
|
}, dn = (a) => {
|
|
806
|
-
He !== a && (He = a, i.classList.toggle(
|
|
809
|
+
He !== a && (He = a, i.classList.toggle(
|
|
810
|
+
"pluno-pa-widget--host-modal-conflict",
|
|
811
|
+
a !== null
|
|
812
|
+
), et(), a !== null ? ye = window.setInterval(() => {
|
|
807
813
|
const s = He;
|
|
808
814
|
(!s || !Mo(s)) && dn(null);
|
|
809
|
-
},
|
|
815
|
+
}, Pi) : ye !== null && (window.clearInterval(ye), ye = null, Je = null));
|
|
810
816
|
}, Oo = () => {
|
|
811
817
|
ye !== null && (window.clearInterval(ye), ye = null);
|
|
812
818
|
};
|
|
@@ -816,26 +822,26 @@ async function $i(e = {}) {
|
|
|
816
822
|
if (!sn(a.target) || He !== null)
|
|
817
823
|
return;
|
|
818
824
|
const s = xt;
|
|
819
|
-
if (xt = null, s === null || Date.now() - s >
|
|
825
|
+
if (xt = null, s === null || Date.now() - s > ki)
|
|
820
826
|
return;
|
|
821
|
-
const
|
|
822
|
-
if (!
|
|
827
|
+
const w = Ro(a.relatedTarget);
|
|
828
|
+
if (!w)
|
|
823
829
|
return;
|
|
824
|
-
const
|
|
825
|
-
if (Je !== null &&
|
|
826
|
-
dn(
|
|
830
|
+
const S = Date.now();
|
|
831
|
+
if (Je !== null && S - Je <= Li) {
|
|
832
|
+
dn(w);
|
|
827
833
|
return;
|
|
828
834
|
}
|
|
829
|
-
Je =
|
|
835
|
+
Je = S;
|
|
830
836
|
}), v.addEventListener("keydown", (a) => {
|
|
831
837
|
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), ge());
|
|
832
838
|
}), g?.addEventListener("pointerdown", (a) => {
|
|
833
839
|
a.stopPropagation();
|
|
834
840
|
}), g?.addEventListener("click", (a) => {
|
|
835
841
|
a.preventDefault(), a.stopPropagation(), Ue("minimized");
|
|
836
|
-
}), A.addEventListener("click",
|
|
842
|
+
}), A.addEventListener("click", zo), N.addEventListener("scroll", () => {
|
|
837
843
|
N.scrollTop < be - 1 && ee(!1, "userScroll"), be = N.scrollTop;
|
|
838
|
-
}),
|
|
844
|
+
}), z.addEventListener("click", () => {
|
|
839
845
|
Po();
|
|
840
846
|
});
|
|
841
847
|
const cn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
@@ -849,9 +855,9 @@ async function $i(e = {}) {
|
|
|
849
855
|
let He = null, We = !1;
|
|
850
856
|
const et = () => {
|
|
851
857
|
const a = Qe(), s = He !== null;
|
|
852
|
-
|
|
858
|
+
_.readOnly = a || s, x.readOnly = s, _.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : We ? "New update" : t.launcherLabel, x.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, L.hidden = a;
|
|
853
859
|
}, j = () => {
|
|
854
|
-
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0,
|
|
860
|
+
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, Re.disabled = Qe() || ae(t.billingStatus);
|
|
855
861
|
};
|
|
856
862
|
et();
|
|
857
863
|
const yt = () => {
|
|
@@ -861,7 +867,7 @@ async function $i(e = {}) {
|
|
|
861
867
|
!a && We
|
|
862
868
|
), et();
|
|
863
869
|
};
|
|
864
|
-
yt(),
|
|
870
|
+
yt(), L.addEventListener("submit", (a) => {
|
|
865
871
|
if (a.preventDefault(), t.loginRequired) {
|
|
866
872
|
t.onLoginClick?.();
|
|
867
873
|
return;
|
|
@@ -870,7 +876,7 @@ async function $i(e = {}) {
|
|
|
870
876
|
t.onSignupClick?.();
|
|
871
877
|
return;
|
|
872
878
|
}
|
|
873
|
-
ae(t.billingStatus) || (fe = !0, ee(!0, "send"), te(), W =
|
|
879
|
+
ae(t.billingStatus) || (fe = !0, ee(!0, "send"), te(), W = Rt(
|
|
874
880
|
y,
|
|
875
881
|
x,
|
|
876
882
|
W
|
|
@@ -891,7 +897,7 @@ async function $i(e = {}) {
|
|
|
891
897
|
const s = za(y, a);
|
|
892
898
|
W = [...W, ...s], Ee(), Uo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || ge();
|
|
893
899
|
};
|
|
894
|
-
|
|
900
|
+
Re.addEventListener("click", () => {
|
|
895
901
|
t.loginRequired || ae(t.billingStatus) || Q.click();
|
|
896
902
|
}), Q.addEventListener("change", () => {
|
|
897
903
|
const a = Array.from(Q.files ?? []);
|
|
@@ -911,20 +917,20 @@ async function $i(e = {}) {
|
|
|
911
917
|
it(a.dataTransfer) && (a.stopPropagation(), Ge = Math.max(0, Ge - 1), Ge === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
912
918
|
}), i.addEventListener("drop", (a) => {
|
|
913
919
|
const s = a.dataTransfer;
|
|
914
|
-
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Bo(), Ct(s.files).catch((
|
|
920
|
+
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Bo(), Ct(s.files).catch((w) => {
|
|
915
921
|
vt(
|
|
916
|
-
|
|
922
|
+
w instanceof Error ? w.message : "Failed to attach file"
|
|
917
923
|
), J("web-sdk.widget", "Attachment failed", {
|
|
918
|
-
message:
|
|
924
|
+
message: w instanceof Error ? w.message : String(w)
|
|
919
925
|
});
|
|
920
926
|
}));
|
|
921
927
|
}), i.addEventListener("paste", (a) => {
|
|
922
|
-
const s = a.clipboardData,
|
|
923
|
-
|
|
928
|
+
const s = a.clipboardData, w = Array.from(s?.files ?? []);
|
|
929
|
+
w.length === 0 || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Ct(w).catch((S) => {
|
|
924
930
|
vt(
|
|
925
|
-
|
|
931
|
+
S instanceof Error ? S.message : "Failed to attach file"
|
|
926
932
|
), J("web-sdk.widget", "Attachment failed", {
|
|
927
|
-
message:
|
|
933
|
+
message: S instanceof Error ? S.message : String(S)
|
|
928
934
|
});
|
|
929
935
|
}));
|
|
930
936
|
}), de.addEventListener("click", () => {
|
|
@@ -936,7 +942,7 @@ async function $i(e = {}) {
|
|
|
936
942
|
y.stop();
|
|
937
943
|
return;
|
|
938
944
|
}
|
|
939
|
-
fe = !0, ee(!0, "send"), te(), W =
|
|
945
|
+
fe = !0, ee(!0, "send"), te(), W = Rt(
|
|
940
946
|
y,
|
|
941
947
|
x,
|
|
942
948
|
W
|
|
@@ -953,7 +959,7 @@ async function $i(e = {}) {
|
|
|
953
959
|
t.onLoginClick?.();
|
|
954
960
|
return;
|
|
955
961
|
}
|
|
956
|
-
fe = !0, ee(!0, "send"), te(), W =
|
|
962
|
+
fe = !0, ee(!0, "send"), te(), W = Rt(
|
|
957
963
|
y,
|
|
958
964
|
x,
|
|
959
965
|
W
|
|
@@ -961,7 +967,7 @@ async function $i(e = {}) {
|
|
|
961
967
|
}
|
|
962
968
|
}), i.addEventListener("click", (a) => {
|
|
963
969
|
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
964
|
-
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1),
|
|
970
|
+
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1), aa(l, i, _, x);
|
|
965
971
|
const tt = () => r;
|
|
966
972
|
let St = y.getState().appearance !== null, nt = null, $e = null, Pe = null, un = y.getState().isThinking, Ie = null;
|
|
967
973
|
const qe = t.taskNotifications;
|
|
@@ -1007,7 +1013,7 @@ async function $i(e = {}) {
|
|
|
1007
1013
|
De || (De = gt(
|
|
1008
1014
|
"pluno-pa-widget__new-chat",
|
|
1009
1015
|
"New chat",
|
|
1010
|
-
|
|
1016
|
+
Ca(),
|
|
1011
1017
|
!1
|
|
1012
1018
|
), De.addEventListener("click", Go), Ye.insertBefore(De, X));
|
|
1013
1019
|
}, G = (a) => {
|
|
@@ -1041,10 +1047,10 @@ async function $i(e = {}) {
|
|
|
1041
1047
|
);
|
|
1042
1048
|
return;
|
|
1043
1049
|
}
|
|
1044
|
-
const s =
|
|
1050
|
+
const s = la(a), w = s !== nn;
|
|
1045
1051
|
nn = s;
|
|
1046
|
-
const
|
|
1047
|
-
fe = !1,
|
|
1052
|
+
const S = fe || we.enabled;
|
|
1053
|
+
fe = !1, Ha(
|
|
1048
1054
|
N,
|
|
1049
1055
|
ht,
|
|
1050
1056
|
de,
|
|
@@ -1053,7 +1059,7 @@ async function $i(e = {}) {
|
|
|
1053
1059
|
a,
|
|
1054
1060
|
Te,
|
|
1055
1061
|
Te !== null && Ut(a, kt()),
|
|
1056
|
-
|
|
1062
|
+
S,
|
|
1057
1063
|
() => we.enabled,
|
|
1058
1064
|
mt,
|
|
1059
1065
|
Et,
|
|
@@ -1077,12 +1083,12 @@ async function $i(e = {}) {
|
|
|
1077
1083
|
ke.add(M.id), Xe.add(M.id), B(), $e = null, G(y.getState());
|
|
1078
1084
|
},
|
|
1079
1085
|
onDisable: (M) => {
|
|
1080
|
-
ft = !0, ke.add(M.id), Xe.add(M.id), B(),
|
|
1086
|
+
ft = !0, ke.add(M.id), Xe.add(M.id), B(), dr(t, !0), $e = null, G(y.getState());
|
|
1081
1087
|
}
|
|
1082
1088
|
} : void 0
|
|
1083
|
-
),
|
|
1089
|
+
), S ? (be = N.scrollTop, te()) : w && pa(a) && Lo();
|
|
1084
1090
|
};
|
|
1085
|
-
return mn =
|
|
1091
|
+
return mn = si(
|
|
1086
1092
|
(a) => {
|
|
1087
1093
|
Te = a, !Le && Ut(y.getState(), kt()) && G(y.getState());
|
|
1088
1094
|
},
|
|
@@ -1095,7 +1101,7 @@ async function $i(e = {}) {
|
|
|
1095
1101
|
const s = un && !a.isThinking;
|
|
1096
1102
|
un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && qe && !Ne && Ae === null && Me?.hidden !== !1 && (Ae = window.setTimeout(() => {
|
|
1097
1103
|
Ae = null, Fo();
|
|
1098
|
-
},
|
|
1104
|
+
}, hi)), (!a.isThinking || a.assistantDraft.trim()) && (gn(), ot()), s && !i.classList.contains("pluno-pa-widget--open") && (We = !0), yt(), a.appearance ? (St = !0, J(
|
|
1099
1105
|
"web-sdk.widget",
|
|
1100
1106
|
"Agent state supplied appearance",
|
|
1101
1107
|
{
|
|
@@ -1129,12 +1135,12 @@ async function $i(e = {}) {
|
|
|
1129
1135
|
},
|
|
1130
1136
|
updateAuthGate: (a) => {
|
|
1131
1137
|
const s = Qe();
|
|
1132
|
-
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), et(), G(y.getState()), j(), s && !Qe() && y.connect().catch((
|
|
1138
|
+
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), et(), G(y.getState()), j(), s && !Qe() && y.connect().catch((w) => {
|
|
1133
1139
|
J(
|
|
1134
1140
|
"web-sdk.widget",
|
|
1135
1141
|
"Failed to connect after auth gate cleared",
|
|
1136
1142
|
{
|
|
1137
|
-
message:
|
|
1143
|
+
message: w instanceof Error ? w.message : String(w)
|
|
1138
1144
|
}
|
|
1139
1145
|
);
|
|
1140
1146
|
});
|
|
@@ -1162,7 +1168,7 @@ async function $i(e = {}) {
|
|
|
1162
1168
|
const s = await t.socialPostDraftHandler(a);
|
|
1163
1169
|
if (!s.linkedinPost || !s.xPost)
|
|
1164
1170
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1165
|
-
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe =
|
|
1171
|
+
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe = Ya(s, {
|
|
1166
1172
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1167
1173
|
onClose: () => {
|
|
1168
1174
|
Pe?.remove(), Pe = null;
|
|
@@ -1176,20 +1182,20 @@ async function $i(e = {}) {
|
|
|
1176
1182
|
}
|
|
1177
1183
|
}
|
|
1178
1184
|
function Pt(a, s) {
|
|
1179
|
-
const
|
|
1185
|
+
const w = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, It = a.scribbleStyle ?? t.scribbleStyle;
|
|
1180
1186
|
r = Pn(
|
|
1181
|
-
|
|
1187
|
+
w,
|
|
1182
1188
|
It
|
|
1183
1189
|
), In(i, r, {
|
|
1184
|
-
accentColor:
|
|
1185
|
-
colorScheme:
|
|
1190
|
+
accentColor: w,
|
|
1191
|
+
colorScheme: S,
|
|
1186
1192
|
fontFamily: M,
|
|
1187
1193
|
scribbleStyle: It
|
|
1188
1194
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1189
1195
|
source: s,
|
|
1190
1196
|
inputAppearance: a,
|
|
1191
|
-
appliedAccentColor:
|
|
1192
|
-
appliedColorScheme:
|
|
1197
|
+
appliedAccentColor: w,
|
|
1198
|
+
appliedColorScheme: S,
|
|
1193
1199
|
appliedFontFamily: M,
|
|
1194
1200
|
appliedScribbleStyle: It,
|
|
1195
1201
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
@@ -1199,11 +1205,11 @@ async function $i(e = {}) {
|
|
|
1199
1205
|
function Pn(e, t) {
|
|
1200
1206
|
return { accentColor: e, scribbleStyle: t };
|
|
1201
1207
|
}
|
|
1202
|
-
function
|
|
1203
|
-
const t =
|
|
1204
|
-
return t === null ? "#fafafa" :
|
|
1208
|
+
function $i(e) {
|
|
1209
|
+
const t = qi(e);
|
|
1210
|
+
return t === null ? "#fafafa" : ji(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1205
1211
|
}
|
|
1206
|
-
function
|
|
1212
|
+
function qi(e) {
|
|
1207
1213
|
const t = e.trim();
|
|
1208
1214
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1209
1215
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1215,7 +1221,7 @@ function ji(e) {
|
|
|
1215
1221
|
Number.parseInt(t[3] + t[3], 16)
|
|
1216
1222
|
] : null;
|
|
1217
1223
|
}
|
|
1218
|
-
function
|
|
1224
|
+
function ji([e, t, n]) {
|
|
1219
1225
|
const o = (i) => {
|
|
1220
1226
|
const r = i / 255;
|
|
1221
1227
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
@@ -1233,8 +1239,8 @@ function In(e, t, n) {
|
|
|
1233
1239
|
const o = n.scribbleStyle ? Kn(n.accentColor) : n.accentColor;
|
|
1234
1240
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1235
1241
|
"--pluno-pa-accent-contrast",
|
|
1236
|
-
|
|
1237
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1242
|
+
$i(o)
|
|
1243
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ai : n.fontFamily, n.scribbleStyle && Vi(e.ownerDocument);
|
|
1238
1244
|
const i = Array.from(
|
|
1239
1245
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1240
1246
|
);
|
|
@@ -1246,7 +1252,7 @@ function In(e, t, n) {
|
|
|
1246
1252
|
)
|
|
1247
1253
|
);
|
|
1248
1254
|
}
|
|
1249
|
-
function
|
|
1255
|
+
function Vi(e) {
|
|
1250
1256
|
if (e.getElementById(Sn))
|
|
1251
1257
|
return;
|
|
1252
1258
|
const t = e.createElement("style");
|
|
@@ -1258,7 +1264,7 @@ function Ki(e) {
|
|
|
1258
1264
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1259
1265
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1260
1266
|
}
|
|
1261
|
-
function
|
|
1267
|
+
function Ki({
|
|
1262
1268
|
root: e,
|
|
1263
1269
|
launcher: t,
|
|
1264
1270
|
launcherDragHandle: n,
|
|
@@ -1269,7 +1275,7 @@ function Yi({
|
|
|
1269
1275
|
let l = null, p = null, d = null, c = !1, u = null;
|
|
1270
1276
|
const m = () => {
|
|
1271
1277
|
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1272
|
-
},
|
|
1278
|
+
}, k = (h) => {
|
|
1273
1279
|
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d = o(), c = !1, t.setPointerCapture?.(h.pointerId));
|
|
1274
1280
|
}, v = (h) => {
|
|
1275
1281
|
if (l !== h.pointerId || !p || !d)
|
|
@@ -1277,9 +1283,9 @@ function Yi({
|
|
|
1277
1283
|
h.preventDefault();
|
|
1278
1284
|
const P = h.clientX - p.x, A = h.clientY - p.y;
|
|
1279
1285
|
!c && Math.hypot(P, A) < jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + P, y: d.y + A }));
|
|
1280
|
-
},
|
|
1286
|
+
}, R = (h) => {
|
|
1281
1287
|
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1282
|
-
},
|
|
1288
|
+
}, _ = (h) => {
|
|
1283
1289
|
l === h.pointerId && (h.preventDefault(), m());
|
|
1284
1290
|
}, g = (h) => {
|
|
1285
1291
|
if (!u)
|
|
@@ -1289,18 +1295,18 @@ function Yi({
|
|
|
1289
1295
|
h.clientY - u.y
|
|
1290
1296
|
) <= jt;
|
|
1291
1297
|
u = null, P && (h.preventDefault(), h.stopPropagation());
|
|
1292
|
-
},
|
|
1298
|
+
}, b = (h) => {
|
|
1293
1299
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1294
1300
|
return;
|
|
1295
1301
|
const P = h.shiftKey ? oo : no, A = o();
|
|
1296
|
-
let
|
|
1297
|
-
h.key === "ArrowUp" ?
|
|
1302
|
+
let L = null;
|
|
1303
|
+
h.key === "ArrowUp" ? L = { x: A.x, y: A.y - P } : h.key === "ArrowDown" ? L = { x: A.x, y: A.y + P } : h.key === "ArrowLeft" ? L = { x: A.x - P, y: A.y } : h.key === "ArrowRight" && (L = { x: A.x + P, y: A.y }), L && (h.preventDefault(), h.stopPropagation(), i(L), r());
|
|
1298
1304
|
};
|
|
1299
|
-
return t.addEventListener("pointerdown",
|
|
1300
|
-
t.removeEventListener("pointerdown",
|
|
1305
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", R), t.addEventListener("pointercancel", _), t.addEventListener("click", g, !0), n.addEventListener("keydown", b), () => {
|
|
1306
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", R), t.removeEventListener("pointercancel", _), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", b);
|
|
1301
1307
|
};
|
|
1302
1308
|
}
|
|
1303
|
-
function
|
|
1309
|
+
function Yi({
|
|
1304
1310
|
root: e,
|
|
1305
1311
|
handles: t,
|
|
1306
1312
|
getBounds: n,
|
|
@@ -1311,30 +1317,30 @@ function Xi({
|
|
|
1311
1317
|
const u = () => {
|
|
1312
1318
|
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1313
1319
|
}, m = (g) => {
|
|
1314
|
-
const
|
|
1315
|
-
!e.classList.contains("pluno-pa-widget--open") || !An(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1,
|
|
1316
|
-
},
|
|
1320
|
+
const b = g.currentTarget, h = b.dataset.resizeDirection;
|
|
1321
|
+
!e.classList.contains("pluno-pa-widget--open") || !An(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, b.setPointerCapture?.(g.pointerId));
|
|
1322
|
+
}, k = (g) => {
|
|
1317
1323
|
if (r !== g.pointerId || !l || !p || !d)
|
|
1318
1324
|
return;
|
|
1319
1325
|
g.preventDefault(), g.stopPropagation();
|
|
1320
|
-
const
|
|
1321
|
-
!c && Math.hypot(
|
|
1322
|
-
Nn(d, l,
|
|
1326
|
+
const b = g.clientX - p.x, h = g.clientY - p.y;
|
|
1327
|
+
!c && Math.hypot(b, h) < jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1328
|
+
Nn(d, l, b, h)
|
|
1323
1329
|
));
|
|
1324
1330
|
}, v = (g) => {
|
|
1325
1331
|
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1326
|
-
},
|
|
1332
|
+
}, R = (g) => {
|
|
1327
1333
|
r === g.pointerId && (g.preventDefault(), u());
|
|
1328
|
-
},
|
|
1334
|
+
}, _ = (g) => {
|
|
1329
1335
|
const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? oo : no, A = n();
|
|
1330
|
-
let
|
|
1331
|
-
An(h) && (g.key === "ArrowLeft" ?
|
|
1336
|
+
let L = 0, F = 0;
|
|
1337
|
+
An(h) && (g.key === "ArrowLeft" ? L = -P : g.key === "ArrowRight" ? L = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(L === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(Nn(A, h, L, F)), i()));
|
|
1332
1338
|
};
|
|
1333
1339
|
for (const g of t)
|
|
1334
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove",
|
|
1340
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", R), g.addEventListener("keydown", _);
|
|
1335
1341
|
return () => {
|
|
1336
1342
|
for (const g of t)
|
|
1337
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove",
|
|
1343
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", R), g.removeEventListener("keydown", _);
|
|
1338
1344
|
};
|
|
1339
1345
|
}
|
|
1340
1346
|
function An(e) {
|
|
@@ -1385,7 +1391,11 @@ function Tn({
|
|
|
1385
1391
|
if (o) {
|
|
1386
1392
|
const c = e + n;
|
|
1387
1393
|
if (c >= r) {
|
|
1388
|
-
const m = K(
|
|
1394
|
+
const m = K(
|
|
1395
|
+
c,
|
|
1396
|
+
r,
|
|
1397
|
+
d - p
|
|
1398
|
+
);
|
|
1389
1399
|
return { leading: m, length: d - m };
|
|
1390
1400
|
}
|
|
1391
1401
|
const u = K(
|
|
@@ -1417,39 +1427,36 @@ function Tn({
|
|
|
1417
1427
|
function dt(e, t = !0) {
|
|
1418
1428
|
const n = Y();
|
|
1419
1429
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1420
|
-
return
|
|
1421
|
-
width: Ai,
|
|
1422
|
-
height: Ni
|
|
1423
|
-
} : { width: En, height: En };
|
|
1430
|
+
return { width: En, height: En };
|
|
1424
1431
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1425
1432
|
return {
|
|
1426
1433
|
width: t && i && o.width > 0 ? o.width : Math.min(Qn, n.width - 36),
|
|
1427
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1434
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Ti : eo
|
|
1428
1435
|
};
|
|
1429
1436
|
}
|
|
1430
|
-
function
|
|
1437
|
+
function Xi() {
|
|
1431
1438
|
const e = Y();
|
|
1432
1439
|
return {
|
|
1433
1440
|
width: Math.min(
|
|
1434
1441
|
K(
|
|
1435
1442
|
e.width * zi,
|
|
1436
1443
|
Jt,
|
|
1437
|
-
|
|
1444
|
+
Di
|
|
1438
1445
|
),
|
|
1439
1446
|
e.width - I * 2
|
|
1440
1447
|
),
|
|
1441
1448
|
height: Math.min(
|
|
1442
1449
|
K(
|
|
1443
|
-
e.height *
|
|
1450
|
+
e.height * Mi,
|
|
1444
1451
|
Qt,
|
|
1445
|
-
|
|
1452
|
+
Ri
|
|
1446
1453
|
),
|
|
1447
1454
|
e.height - Ce - I
|
|
1448
1455
|
)
|
|
1449
1456
|
};
|
|
1450
1457
|
}
|
|
1451
|
-
function
|
|
1452
|
-
return e ? ut(e) :
|
|
1458
|
+
function ze(e = null) {
|
|
1459
|
+
return e ? ut(e) : Xi();
|
|
1453
1460
|
}
|
|
1454
1461
|
function ut(e) {
|
|
1455
1462
|
const t = Y();
|
|
@@ -1486,7 +1493,7 @@ function Nt(e, t) {
|
|
|
1486
1493
|
const n = ut(t);
|
|
1487
1494
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1488
1495
|
}
|
|
1489
|
-
function
|
|
1496
|
+
function Zi(e, t, n) {
|
|
1490
1497
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1491
1498
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1492
1499
|
return { x: o, y: i };
|
|
@@ -1505,9 +1512,9 @@ function Tt(e, t, n) {
|
|
|
1505
1512
|
e,
|
|
1506
1513
|
ro(t, o),
|
|
1507
1514
|
o
|
|
1508
|
-
) :
|
|
1515
|
+
) : Ji(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Ni);
|
|
1509
1516
|
}
|
|
1510
|
-
function
|
|
1517
|
+
function Ji(e, t, n) {
|
|
1511
1518
|
const o = Y();
|
|
1512
1519
|
return {
|
|
1513
1520
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
@@ -1515,7 +1522,7 @@ function Qi(e, t, n) {
|
|
|
1515
1522
|
};
|
|
1516
1523
|
}
|
|
1517
1524
|
function Vt(e, t, n) {
|
|
1518
|
-
const o = Y(), i = I +
|
|
1525
|
+
const o = Y(), i = I + ta(e);
|
|
1519
1526
|
return {
|
|
1520
1527
|
x: K(
|
|
1521
1528
|
t.x,
|
|
@@ -1542,23 +1549,23 @@ function ro(e, t) {
|
|
|
1542
1549
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1543
1550
|
};
|
|
1544
1551
|
}
|
|
1545
|
-
function
|
|
1546
|
-
const n =
|
|
1552
|
+
function Qi(e, t) {
|
|
1553
|
+
const n = ea(e, t), o = Y();
|
|
1547
1554
|
return {
|
|
1548
1555
|
anchor: n,
|
|
1549
1556
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1550
1557
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1551
1558
|
};
|
|
1552
1559
|
}
|
|
1553
|
-
function
|
|
1560
|
+
function ea(e, t) {
|
|
1554
1561
|
const n = Y(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1555
1562
|
return `${r}-${l}`;
|
|
1556
1563
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1564
|
+
function ta(e) {
|
|
1565
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Fi : Ui;
|
|
1559
1566
|
}
|
|
1560
1567
|
function Dt(e, t, n, o = null) {
|
|
1561
|
-
const i = dt(e), r =
|
|
1568
|
+
const i = dt(e), r = ze(o), l = {
|
|
1562
1569
|
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1563
1570
|
y: t.y + i.height - r.height
|
|
1564
1571
|
};
|
|
@@ -1592,7 +1599,7 @@ function ve(e, t) {
|
|
|
1592
1599
|
}
|
|
1593
1600
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1594
1601
|
}
|
|
1595
|
-
function
|
|
1602
|
+
function na(e, t) {
|
|
1596
1603
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1597
1604
|
}
|
|
1598
1605
|
function Dn(e) {
|
|
@@ -1604,7 +1611,7 @@ function Y() {
|
|
|
1604
1611
|
height: window.innerHeight || document.documentElement.clientHeight || eo + I * 2
|
|
1605
1612
|
};
|
|
1606
1613
|
}
|
|
1607
|
-
function
|
|
1614
|
+
function zt(e) {
|
|
1608
1615
|
const t = e.getBoundingClientRect();
|
|
1609
1616
|
return {
|
|
1610
1617
|
x: Math.round(t.x),
|
|
@@ -1626,31 +1633,31 @@ function J(e, t, n) {
|
|
|
1626
1633
|
details: n
|
|
1627
1634
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1628
1635
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1629
|
-
new CustomEvent(
|
|
1636
|
+
new CustomEvent(Si, { detail: i })
|
|
1630
1637
|
);
|
|
1631
1638
|
}
|
|
1632
|
-
function
|
|
1639
|
+
function oa(e, t) {
|
|
1633
1640
|
J("web-sdk.widget.position", e, t);
|
|
1634
1641
|
}
|
|
1635
|
-
function
|
|
1642
|
+
function Rt(e, t, n) {
|
|
1636
1643
|
const o = t.value.trim();
|
|
1637
1644
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1638
|
-
attachments: n.length > 0 ? n.map(
|
|
1645
|
+
attachments: n.length > 0 ? n.map(ra) : void 0
|
|
1639
1646
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1640
1647
|
}
|
|
1641
|
-
function
|
|
1648
|
+
function ia(e, t, n) {
|
|
1642
1649
|
const o = e.activeElement;
|
|
1643
1650
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1644
1651
|
}
|
|
1645
|
-
function
|
|
1646
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1652
|
+
function aa(e, t, n, o) {
|
|
1653
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > mi)
|
|
1647
1654
|
return;
|
|
1648
1655
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1649
1656
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1650
1657
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1651
1658
|
});
|
|
1652
1659
|
}
|
|
1653
|
-
function
|
|
1660
|
+
function ra(e) {
|
|
1654
1661
|
return e;
|
|
1655
1662
|
}
|
|
1656
1663
|
function je(e) {
|
|
@@ -1663,7 +1670,7 @@ function Ve(e, t = () => !0) {
|
|
|
1663
1670
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1664
1671
|
});
|
|
1665
1672
|
}
|
|
1666
|
-
function
|
|
1673
|
+
function la(e) {
|
|
1667
1674
|
const t = e.messages[e.messages.length - 1];
|
|
1668
1675
|
return [
|
|
1669
1676
|
e.messages.length,
|
|
@@ -1674,13 +1681,13 @@ function pa(e) {
|
|
|
1674
1681
|
e.lastError ?? ""
|
|
1675
1682
|
].join(":");
|
|
1676
1683
|
}
|
|
1677
|
-
function
|
|
1684
|
+
function pa(e) {
|
|
1678
1685
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1679
1686
|
}
|
|
1680
|
-
function
|
|
1687
|
+
function sa(e) {
|
|
1681
1688
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1682
1689
|
}
|
|
1683
|
-
function
|
|
1690
|
+
function da(e) {
|
|
1684
1691
|
const t = e.currentPage;
|
|
1685
1692
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1686
1693
|
try {
|
|
@@ -1691,7 +1698,7 @@ function ca(e) {
|
|
|
1691
1698
|
}
|
|
1692
1699
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1693
1700
|
}
|
|
1694
|
-
function
|
|
1701
|
+
function ca(e, t) {
|
|
1695
1702
|
const n = new Date(e).getTime();
|
|
1696
1703
|
if (!Number.isFinite(n))
|
|
1697
1704
|
return "now";
|
|
@@ -1707,9 +1714,9 @@ function ua(e, t) {
|
|
|
1707
1714
|
}
|
|
1708
1715
|
return "now";
|
|
1709
1716
|
}
|
|
1710
|
-
function
|
|
1711
|
-
e.appendChild(
|
|
1712
|
-
|
|
1717
|
+
function ua(e, t, n, o, i) {
|
|
1718
|
+
e.appendChild(ya()), e.appendChild(
|
|
1719
|
+
ga(
|
|
1713
1720
|
t,
|
|
1714
1721
|
n,
|
|
1715
1722
|
o,
|
|
@@ -1719,12 +1726,12 @@ function ga(e, t, n, o, i) {
|
|
|
1719
1726
|
gt(
|
|
1720
1727
|
"pluno-pa-widget__close",
|
|
1721
1728
|
"Close",
|
|
1722
|
-
|
|
1729
|
+
va(16),
|
|
1723
1730
|
!0
|
|
1724
1731
|
)
|
|
1725
|
-
), e.appendChild(
|
|
1732
|
+
), e.appendChild(ha(n));
|
|
1726
1733
|
}
|
|
1727
|
-
function
|
|
1734
|
+
function ga(e, t, n, o) {
|
|
1728
1735
|
const i = document.createElement("form");
|
|
1729
1736
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1730
1737
|
const d = document.createElement("button");
|
|
@@ -1752,7 +1759,7 @@ function ha(e, t, n, o) {
|
|
|
1752
1759
|
}
|
|
1753
1760
|
return i;
|
|
1754
1761
|
}
|
|
1755
|
-
function
|
|
1762
|
+
function ha(e) {
|
|
1756
1763
|
const t = document.createElement("section");
|
|
1757
1764
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1758
1765
|
co("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
@@ -1760,7 +1767,7 @@ function ma(e) {
|
|
|
1760
1767
|
const n = document.createElement("div");
|
|
1761
1768
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1762
1769
|
const o = document.createElement("main");
|
|
1763
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1770
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(ba(e));
|
|
1764
1771
|
const i = document.createElement("div");
|
|
1765
1772
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1766
1773
|
const r = document.createElement("div");
|
|
@@ -1772,10 +1779,10 @@ function ma(e) {
|
|
|
1772
1779
|
gt(
|
|
1773
1780
|
"pluno-pa-widget__history",
|
|
1774
1781
|
Kt(),
|
|
1775
|
-
|
|
1782
|
+
Sa(),
|
|
1776
1783
|
!0
|
|
1777
1784
|
)
|
|
1778
|
-
), n.appendChild(p), n.appendChild(
|
|
1785
|
+
), n.appendChild(p), n.appendChild(wa()), t.appendChild(n), t.appendChild(ma()), t.appendChild(fa()), t.appendChild(he("left", "Resize Pluno from left")), t.appendChild(
|
|
1779
1786
|
he("right", "Resize Pluno from right")
|
|
1780
1787
|
), t.appendChild(he("top", "Resize Pluno from top")), t.appendChild(
|
|
1781
1788
|
he("bottom", "Resize Pluno from bottom")
|
|
@@ -1796,7 +1803,7 @@ function he(e, t) {
|
|
|
1796
1803
|
`pluno-pa-widget__resize-handle--${e}`
|
|
1797
1804
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1798
1805
|
}
|
|
1799
|
-
function
|
|
1806
|
+
function ma() {
|
|
1800
1807
|
const e = document.createElement("div");
|
|
1801
1808
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1802
1809
|
const t = document.createElement("span");
|
|
@@ -1810,7 +1817,7 @@ function fa() {
|
|
|
1810
1817
|
const r = document.createElement("button");
|
|
1811
1818
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1812
1819
|
}
|
|
1813
|
-
function
|
|
1820
|
+
function fa() {
|
|
1814
1821
|
const e = document.createElement("form");
|
|
1815
1822
|
e.className = "pluno-pa-widget__composer";
|
|
1816
1823
|
const t = document.createElement("div");
|
|
@@ -1824,7 +1831,7 @@ function wa() {
|
|
|
1824
1831
|
const r = document.createElement("input");
|
|
1825
1832
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1826
1833
|
const l = document.createElement("button");
|
|
1827
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1834
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(ka()), l.appendChild(La()), i.appendChild(l);
|
|
1828
1835
|
const p = document.createElement("textarea");
|
|
1829
1836
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1830
1837
|
const d = document.createElement("button");
|
|
@@ -1839,7 +1846,7 @@ function wa() {
|
|
|
1839
1846
|
function Kt() {
|
|
1840
1847
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1841
1848
|
}
|
|
1842
|
-
function
|
|
1849
|
+
function wa() {
|
|
1843
1850
|
const e = document.createElement("section");
|
|
1844
1851
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Kt());
|
|
1845
1852
|
const t = document.createElement("div");
|
|
@@ -1849,7 +1856,7 @@ function ba() {
|
|
|
1849
1856
|
const o = gt(
|
|
1850
1857
|
"pluno-pa-widget__history-close",
|
|
1851
1858
|
"Close recent chats",
|
|
1852
|
-
|
|
1859
|
+
Ea(),
|
|
1853
1860
|
!1
|
|
1854
1861
|
);
|
|
1855
1862
|
t.append(n, o);
|
|
@@ -1858,7 +1865,7 @@ function ba() {
|
|
|
1858
1865
|
const r = document.createElement("p");
|
|
1859
1866
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1860
1867
|
}
|
|
1861
|
-
function
|
|
1868
|
+
function ba(e) {
|
|
1862
1869
|
const t = document.createElement("div");
|
|
1863
1870
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1864
1871
|
me(
|
|
@@ -1886,14 +1893,14 @@ function po(e, t) {
|
|
|
1886
1893
|
function me(e, t) {
|
|
1887
1894
|
const n = `pluno-pa-character-${Ln}`;
|
|
1888
1895
|
Ln += 1;
|
|
1889
|
-
const o = t.scribbleStyle ?
|
|
1896
|
+
const o = t.scribbleStyle ? xa(t.accentColor, n) : _a(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1890
1897
|
return o.setAttribute(
|
|
1891
1898
|
"class",
|
|
1892
1899
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1893
1900
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1894
1901
|
}
|
|
1895
|
-
function
|
|
1896
|
-
const n =
|
|
1902
|
+
function _a(e, t) {
|
|
1903
|
+
const n = Yo(e), o = {
|
|
1897
1904
|
boltFill: `${t}-boltFill`,
|
|
1898
1905
|
boltEdge: `${t}-boltEdge`,
|
|
1899
1906
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1958,7 +1965,7 @@ function xa(e, t) {
|
|
|
1958
1965
|
"flood-color": n.shadow,
|
|
1959
1966
|
"flood-opacity": "0.24"
|
|
1960
1967
|
});
|
|
1961
|
-
const
|
|
1968
|
+
const k = f(r, "filter", {
|
|
1962
1969
|
id: o.innerDepth,
|
|
1963
1970
|
x: "-8%",
|
|
1964
1971
|
y: "-8%",
|
|
@@ -1966,27 +1973,27 @@ function xa(e, t) {
|
|
|
1966
1973
|
height: "116%",
|
|
1967
1974
|
"color-interpolation-filters": "sRGB"
|
|
1968
1975
|
});
|
|
1969
|
-
f(
|
|
1976
|
+
f(k, "feGaussianBlur", {
|
|
1970
1977
|
in: "SourceAlpha",
|
|
1971
1978
|
stdDeviation: "8",
|
|
1972
1979
|
result: "blur"
|
|
1973
|
-
}), f(
|
|
1980
|
+
}), f(k, "feOffset", {
|
|
1974
1981
|
dx: "-7",
|
|
1975
1982
|
dy: "-9",
|
|
1976
1983
|
result: "topLeft"
|
|
1977
|
-
}), f(
|
|
1984
|
+
}), f(k, "feComposite", {
|
|
1978
1985
|
in: "topLeft",
|
|
1979
1986
|
in2: "SourceAlpha",
|
|
1980
1987
|
operator: "arithmetic",
|
|
1981
1988
|
k2: "-1",
|
|
1982
1989
|
k3: "1",
|
|
1983
1990
|
result: "innerShadow"
|
|
1984
|
-
}), f(
|
|
1991
|
+
}), f(k, "feColorMatrix", {
|
|
1985
1992
|
in: "innerShadow",
|
|
1986
1993
|
type: "matrix",
|
|
1987
1994
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1988
1995
|
result: "innerLight"
|
|
1989
|
-
}), f(
|
|
1996
|
+
}), f(k, "feBlend", {
|
|
1990
1997
|
in: "SourceGraphic",
|
|
1991
1998
|
in2: "innerLight",
|
|
1992
1999
|
mode: "screen"
|
|
@@ -2006,7 +2013,7 @@ function xa(e, t) {
|
|
|
2006
2013
|
"flood-color": n.shadow,
|
|
2007
2014
|
"flood-opacity": "0.3"
|
|
2008
2015
|
});
|
|
2009
|
-
const
|
|
2016
|
+
const R = f(r, "filter", {
|
|
2010
2017
|
id: o.pupilGloss,
|
|
2011
2018
|
x: "-15%",
|
|
2012
2019
|
y: "-15%",
|
|
@@ -2014,15 +2021,15 @@ function xa(e, t) {
|
|
|
2014
2021
|
height: "130%",
|
|
2015
2022
|
"color-interpolation-filters": "sRGB"
|
|
2016
2023
|
});
|
|
2017
|
-
f(
|
|
2024
|
+
f(R, "feDropShadow", {
|
|
2018
2025
|
dx: "0",
|
|
2019
2026
|
dy: "3",
|
|
2020
2027
|
stdDeviation: "3",
|
|
2021
2028
|
"flood-color": "#000000",
|
|
2022
2029
|
"flood-opacity": "0.22"
|
|
2023
2030
|
});
|
|
2024
|
-
const
|
|
2025
|
-
f(
|
|
2031
|
+
const _ = f(r, "clipPath", { id: o.boltClip });
|
|
2032
|
+
f(_, "path", { d: pt });
|
|
2026
2033
|
const g = f(i, "g", {
|
|
2027
2034
|
filter: V(o.softDropShadow)
|
|
2028
2035
|
});
|
|
@@ -2030,13 +2037,13 @@ function xa(e, t) {
|
|
|
2030
2037
|
d: pt,
|
|
2031
2038
|
fill: V(o.boltEdge)
|
|
2032
2039
|
});
|
|
2033
|
-
const
|
|
2040
|
+
const b = "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";
|
|
2034
2041
|
f(g, "path", {
|
|
2035
|
-
d:
|
|
2042
|
+
d: b,
|
|
2036
2043
|
fill: V(o.boltFill),
|
|
2037
2044
|
filter: V(o.innerDepth)
|
|
2038
2045
|
}), f(g, "path", {
|
|
2039
|
-
d:
|
|
2046
|
+
d: b,
|
|
2040
2047
|
fill: V(o.boltGlow),
|
|
2041
2048
|
opacity: "0.74"
|
|
2042
2049
|
});
|
|
@@ -2067,7 +2074,7 @@ function xa(e, t) {
|
|
|
2067
2074
|
opacity: "0.48"
|
|
2068
2075
|
});
|
|
2069
2076
|
const P = f(i, "g", { filter: V(o.eyeShadow) });
|
|
2070
|
-
return
|
|
2077
|
+
return zn(
|
|
2071
2078
|
P,
|
|
2072
2079
|
"rotate(-2 528 463)",
|
|
2073
2080
|
"528",
|
|
@@ -2077,7 +2084,7 @@ function xa(e, t) {
|
|
|
2077
2084
|
"557",
|
|
2078
2085
|
"447",
|
|
2079
2086
|
o
|
|
2080
|
-
),
|
|
2087
|
+
), zn(
|
|
2081
2088
|
P,
|
|
2082
2089
|
"rotate(2 717 462)",
|
|
2083
2090
|
"717",
|
|
@@ -2089,7 +2096,7 @@ function xa(e, t) {
|
|
|
2089
2096
|
o
|
|
2090
2097
|
), i;
|
|
2091
2098
|
}
|
|
2092
|
-
function
|
|
2099
|
+
function xa(e, t) {
|
|
2093
2100
|
const n = Kn(e), o = {
|
|
2094
2101
|
clip: `${t}-scribbleBoltClip`,
|
|
2095
2102
|
wobble: `${t}-scribbleBoltWobble`
|
|
@@ -2120,7 +2127,7 @@ function ya(e, t) {
|
|
|
2120
2127
|
"clip-path": V(o.clip)
|
|
2121
2128
|
});
|
|
2122
2129
|
return f(c, "path", {
|
|
2123
|
-
d:
|
|
2130
|
+
d: Ko(),
|
|
2124
2131
|
fill: "none",
|
|
2125
2132
|
stroke: n,
|
|
2126
2133
|
"stroke-width": "56",
|
|
@@ -2134,7 +2141,7 @@ function ya(e, t) {
|
|
|
2134
2141
|
stroke: st,
|
|
2135
2142
|
"stroke-width": "18",
|
|
2136
2143
|
"stroke-linejoin": "round"
|
|
2137
|
-
}),
|
|
2144
|
+
}), Rn(
|
|
2138
2145
|
d,
|
|
2139
2146
|
"rotate(-2 528 463)",
|
|
2140
2147
|
"528",
|
|
@@ -2143,7 +2150,7 @@ function ya(e, t) {
|
|
|
2143
2150
|
"473",
|
|
2144
2151
|
"557",
|
|
2145
2152
|
"447"
|
|
2146
|
-
),
|
|
2153
|
+
), Rn(
|
|
2147
2154
|
d,
|
|
2148
2155
|
"rotate(2 717 462)",
|
|
2149
2156
|
"717",
|
|
@@ -2155,12 +2162,12 @@ function ya(e, t) {
|
|
|
2155
2162
|
), i;
|
|
2156
2163
|
}
|
|
2157
2164
|
function so() {
|
|
2158
|
-
return
|
|
2165
|
+
return E("svg", {
|
|
2159
2166
|
xmlns: to,
|
|
2160
2167
|
viewBox: "0 0 1254 1254"
|
|
2161
2168
|
});
|
|
2162
2169
|
}
|
|
2163
|
-
function
|
|
2170
|
+
function zn(e, t, n, o, i, r, l, p, d) {
|
|
2164
2171
|
const c = f(e, "g", { transform: t });
|
|
2165
2172
|
f(c, "ellipse", {
|
|
2166
2173
|
cx: n,
|
|
@@ -2182,7 +2189,7 @@ function Rn(e, t, n, o, i, r, l, p, d) {
|
|
|
2182
2189
|
fill: "#ffffff"
|
|
2183
2190
|
});
|
|
2184
2191
|
}
|
|
2185
|
-
function
|
|
2192
|
+
function Rn(e, t, n, o, i, r, l, p) {
|
|
2186
2193
|
const d = f(e, "g", { transform: t });
|
|
2187
2194
|
f(d, "ellipse", {
|
|
2188
2195
|
cx: n,
|
|
@@ -2206,7 +2213,7 @@ function zn(e, t, n, o, i, r, l, p) {
|
|
|
2206
2213
|
});
|
|
2207
2214
|
}
|
|
2208
2215
|
function f(e, t, n = {}) {
|
|
2209
|
-
const o =
|
|
2216
|
+
const o = E(t, n);
|
|
2210
2217
|
return e.appendChild(o), o;
|
|
2211
2218
|
}
|
|
2212
2219
|
function O(e, t, n, o) {
|
|
@@ -2220,14 +2227,14 @@ function gt(e, t, n, o) {
|
|
|
2220
2227
|
const i = document.createElement("button");
|
|
2221
2228
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2222
2229
|
}
|
|
2223
|
-
function
|
|
2224
|
-
const e =
|
|
2230
|
+
function ya() {
|
|
2231
|
+
const e = E("svg", {
|
|
2225
2232
|
class: "pluno-pa-widget__scribble-defs",
|
|
2226
2233
|
"aria-hidden": "true",
|
|
2227
2234
|
focusable: "false",
|
|
2228
2235
|
width: "0",
|
|
2229
2236
|
height: "0"
|
|
2230
|
-
}), t =
|
|
2237
|
+
}), t = E("defs");
|
|
2231
2238
|
return t.appendChild(Ot("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2232
2239
|
Ot("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2233
2240
|
), t.appendChild(
|
|
@@ -2235,7 +2242,7 @@ function va() {
|
|
|
2235
2242
|
), e.appendChild(t), e;
|
|
2236
2243
|
}
|
|
2237
2244
|
function co(e, t) {
|
|
2238
|
-
const n =
|
|
2245
|
+
const n = E("svg", {
|
|
2239
2246
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2240
2247
|
preserveAspectRatio: "xMidYMid meet",
|
|
2241
2248
|
"aria-hidden": "true",
|
|
@@ -2250,7 +2257,7 @@ function Mt(e, t) {
|
|
|
2250
2257
|
0,
|
|
2251
2258
|
t - qt * 2
|
|
2252
2259
|
), o = Math.max(
|
|
2253
|
-
|
|
2260
|
+
Bi,
|
|
2254
2261
|
Math.floor(
|
|
2255
2262
|
(n - $t * 2) / Gt
|
|
2256
2263
|
)
|
|
@@ -2263,14 +2270,14 @@ function uo(e, t) {
|
|
|
2263
2270
|
const n = t * Gt + $t * 2;
|
|
2264
2271
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2265
2272
|
"viewBox",
|
|
2266
|
-
`0 0 ${n} ${
|
|
2273
|
+
`0 0 ${n} ${Oi}`
|
|
2267
2274
|
), e.replaceChildren();
|
|
2268
2275
|
for (let o = 0; o < t; o += 1) {
|
|
2269
|
-
const i = kn[o % kn.length], r =
|
|
2276
|
+
const i = kn[o % kn.length], r = E("g", {
|
|
2270
2277
|
transform: `translate(${$t + o * Gt} 0)`
|
|
2271
2278
|
});
|
|
2272
2279
|
r.appendChild(
|
|
2273
|
-
|
|
2280
|
+
E("ellipse", {
|
|
2274
2281
|
cx: i.ellipseCx,
|
|
2275
2282
|
cy: i.ellipseCy,
|
|
2276
2283
|
rx: i.ellipseRx,
|
|
@@ -2281,7 +2288,7 @@ function uo(e, t) {
|
|
|
2281
2288
|
opacity: "0.8"
|
|
2282
2289
|
})
|
|
2283
2290
|
), r.appendChild(
|
|
2284
|
-
|
|
2291
|
+
E("path", {
|
|
2285
2292
|
d: i.path,
|
|
2286
2293
|
fill: "none",
|
|
2287
2294
|
stroke: "#2c2a1e",
|
|
@@ -2292,7 +2299,7 @@ function uo(e, t) {
|
|
|
2292
2299
|
}
|
|
2293
2300
|
}
|
|
2294
2301
|
function Ot(e, t, n) {
|
|
2295
|
-
const o =
|
|
2302
|
+
const o = E("filter", {
|
|
2296
2303
|
id: e,
|
|
2297
2304
|
x: "-8%",
|
|
2298
2305
|
y: "-8%",
|
|
@@ -2300,7 +2307,7 @@ function Ot(e, t, n) {
|
|
|
2300
2307
|
height: "116%"
|
|
2301
2308
|
});
|
|
2302
2309
|
return o.appendChild(
|
|
2303
|
-
|
|
2310
|
+
E("feTurbulence", {
|
|
2304
2311
|
type: "fractalNoise",
|
|
2305
2312
|
baseFrequency: "0.012 0.028",
|
|
2306
2313
|
numOctaves: "3",
|
|
@@ -2308,7 +2315,7 @@ function Ot(e, t, n) {
|
|
|
2308
2315
|
result: "stroke-noise"
|
|
2309
2316
|
})
|
|
2310
2317
|
), o.appendChild(
|
|
2311
|
-
|
|
2318
|
+
E("feDisplacementMap", {
|
|
2312
2319
|
in: "SourceGraphic",
|
|
2313
2320
|
in2: "stroke-noise",
|
|
2314
2321
|
scale: "3.5",
|
|
@@ -2317,7 +2324,7 @@ function Ot(e, t, n) {
|
|
|
2317
2324
|
result: "warped"
|
|
2318
2325
|
})
|
|
2319
2326
|
), o.appendChild(
|
|
2320
|
-
|
|
2327
|
+
E("feTurbulence", {
|
|
2321
2328
|
type: "fractalNoise",
|
|
2322
2329
|
baseFrequency: "0.7",
|
|
2323
2330
|
numOctaves: "1",
|
|
@@ -2325,7 +2332,7 @@ function Ot(e, t, n) {
|
|
|
2325
2332
|
result: "ink-noise"
|
|
2326
2333
|
})
|
|
2327
2334
|
), o.appendChild(
|
|
2328
|
-
|
|
2335
|
+
E("feDisplacementMap", {
|
|
2329
2336
|
in: "warped",
|
|
2330
2337
|
in2: "ink-noise",
|
|
2331
2338
|
scale: "0.9",
|
|
@@ -2334,7 +2341,7 @@ function Ot(e, t, n) {
|
|
|
2334
2341
|
})
|
|
2335
2342
|
), o;
|
|
2336
2343
|
}
|
|
2337
|
-
function
|
|
2344
|
+
function va(e) {
|
|
2338
2345
|
const t = re(
|
|
2339
2346
|
"0 0 24 24",
|
|
2340
2347
|
e,
|
|
@@ -2343,9 +2350,9 @@ function Ca(e) {
|
|
|
2343
2350
|
"currentColor",
|
|
2344
2351
|
"2.25"
|
|
2345
2352
|
);
|
|
2346
|
-
return t.appendChild(
|
|
2353
|
+
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2347
2354
|
}
|
|
2348
|
-
function
|
|
2355
|
+
function Ca() {
|
|
2349
2356
|
const e = re(
|
|
2350
2357
|
"0 0 24 24",
|
|
2351
2358
|
17,
|
|
@@ -2355,16 +2362,16 @@ function Sa() {
|
|
|
2355
2362
|
"2.25"
|
|
2356
2363
|
);
|
|
2357
2364
|
return e.appendChild(
|
|
2358
|
-
|
|
2365
|
+
E("path", {
|
|
2359
2366
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2360
2367
|
})
|
|
2361
2368
|
), e.appendChild(
|
|
2362
|
-
|
|
2369
|
+
E("path", {
|
|
2363
2370
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2364
2371
|
})
|
|
2365
2372
|
), e;
|
|
2366
2373
|
}
|
|
2367
|
-
function
|
|
2374
|
+
function Sa() {
|
|
2368
2375
|
const e = re(
|
|
2369
2376
|
"0 0 24 24",
|
|
2370
2377
|
17,
|
|
@@ -2373,9 +2380,9 @@ function Ea() {
|
|
|
2373
2380
|
"currentColor",
|
|
2374
2381
|
"2.25"
|
|
2375
2382
|
);
|
|
2376
|
-
return e.appendChild(
|
|
2383
|
+
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2377
2384
|
}
|
|
2378
|
-
function
|
|
2385
|
+
function Ea() {
|
|
2379
2386
|
const e = re(
|
|
2380
2387
|
"0 0 24 24",
|
|
2381
2388
|
15,
|
|
@@ -2384,7 +2391,7 @@ function ka() {
|
|
|
2384
2391
|
"currentColor",
|
|
2385
2392
|
"2.4"
|
|
2386
2393
|
);
|
|
2387
|
-
return e.appendChild(
|
|
2394
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2388
2395
|
}
|
|
2389
2396
|
function go() {
|
|
2390
2397
|
const e = re(
|
|
@@ -2396,10 +2403,10 @@ function go() {
|
|
|
2396
2403
|
"2.75"
|
|
2397
2404
|
);
|
|
2398
2405
|
return e.appendChild(
|
|
2399
|
-
|
|
2400
|
-
), e.appendChild(
|
|
2406
|
+
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2407
|
+
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2401
2408
|
}
|
|
2402
|
-
function
|
|
2409
|
+
function ka() {
|
|
2403
2410
|
const e = re(
|
|
2404
2411
|
"0 0 24 24",
|
|
2405
2412
|
16,
|
|
@@ -2412,18 +2419,18 @@ function La() {
|
|
|
2412
2419
|
"class",
|
|
2413
2420
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2414
2421
|
), e.appendChild(
|
|
2415
|
-
|
|
2422
|
+
E("path", {
|
|
2416
2423
|
d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
|
|
2417
2424
|
})
|
|
2418
2425
|
), e;
|
|
2419
2426
|
}
|
|
2420
|
-
function
|
|
2427
|
+
function La() {
|
|
2421
2428
|
const e = re("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2422
2429
|
return e.setAttribute(
|
|
2423
2430
|
"class",
|
|
2424
2431
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2425
2432
|
), e.appendChild(
|
|
2426
|
-
|
|
2433
|
+
E("path", {
|
|
2427
2434
|
d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
|
|
2428
2435
|
stroke: "currentColor",
|
|
2429
2436
|
"stroke-width": "2",
|
|
@@ -2432,10 +2439,10 @@ function Pa() {
|
|
|
2432
2439
|
})
|
|
2433
2440
|
), e;
|
|
2434
2441
|
}
|
|
2435
|
-
function
|
|
2442
|
+
function Pa() {
|
|
2436
2443
|
const e = re("0 0 24 24", 18, 18, "currentColor");
|
|
2437
2444
|
return e.appendChild(
|
|
2438
|
-
|
|
2445
|
+
E("rect", {
|
|
2439
2446
|
x: "6",
|
|
2440
2447
|
y: "6",
|
|
2441
2448
|
width: "12",
|
|
@@ -2444,7 +2451,7 @@ function Ia() {
|
|
|
2444
2451
|
})
|
|
2445
2452
|
), e;
|
|
2446
2453
|
}
|
|
2447
|
-
function
|
|
2454
|
+
function Ia() {
|
|
2448
2455
|
const e = re(
|
|
2449
2456
|
"0 0 24 24",
|
|
2450
2457
|
12,
|
|
@@ -2453,9 +2460,9 @@ function Aa() {
|
|
|
2453
2460
|
"currentColor",
|
|
2454
2461
|
"2.4"
|
|
2455
2462
|
);
|
|
2456
|
-
return e.appendChild(
|
|
2463
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2457
2464
|
}
|
|
2458
|
-
function
|
|
2465
|
+
function Aa() {
|
|
2459
2466
|
const e = re(
|
|
2460
2467
|
"0 0 24 24",
|
|
2461
2468
|
13,
|
|
@@ -2465,7 +2472,7 @@ function Na() {
|
|
|
2465
2472
|
"2.25"
|
|
2466
2473
|
);
|
|
2467
2474
|
return e.appendChild(
|
|
2468
|
-
|
|
2475
|
+
E("rect", {
|
|
2469
2476
|
width: "14",
|
|
2470
2477
|
height: "14",
|
|
2471
2478
|
x: "8",
|
|
@@ -2474,7 +2481,7 @@ function Na() {
|
|
|
2474
2481
|
ry: "2"
|
|
2475
2482
|
})
|
|
2476
2483
|
), e.appendChild(
|
|
2477
|
-
|
|
2484
|
+
E("path", {
|
|
2478
2485
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2479
2486
|
})
|
|
2480
2487
|
), e;
|
|
@@ -2487,9 +2494,9 @@ function re(e, t, n, o, i, r) {
|
|
|
2487
2494
|
fill: o,
|
|
2488
2495
|
"aria-hidden": "true"
|
|
2489
2496
|
};
|
|
2490
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2497
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2491
2498
|
}
|
|
2492
|
-
function
|
|
2499
|
+
function E(e, t = {}) {
|
|
2493
2500
|
const n = document.createElementNS(to, e);
|
|
2494
2501
|
for (const [o, i] of Object.entries(t))
|
|
2495
2502
|
n.setAttribute(o, i);
|
|
@@ -2501,42 +2508,65 @@ function Mn(e) {
|
|
|
2501
2508
|
n.stopPropagation();
|
|
2502
2509
|
});
|
|
2503
2510
|
}
|
|
2504
|
-
function
|
|
2511
|
+
function Na(e, t, n) {
|
|
2505
2512
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2506
2513
|
for (const [o, i] of t.entries()) {
|
|
2507
2514
|
const r = document.createElement("div");
|
|
2508
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2515
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Ta(i));
|
|
2509
2516
|
const l = document.createElement("span");
|
|
2510
2517
|
l.textContent = i.name, r.appendChild(l);
|
|
2511
2518
|
const p = document.createElement("button");
|
|
2512
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2519
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ia()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2513
2520
|
}
|
|
2514
2521
|
}
|
|
2515
|
-
function
|
|
2522
|
+
function Ta(e) {
|
|
2516
2523
|
const t = en(e), n = ho(e);
|
|
2517
2524
|
if (t === "image" && n) {
|
|
2518
2525
|
const o = document.createElement("img");
|
|
2519
|
-
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2526
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2527
|
+
"error",
|
|
2528
|
+
() => o.replaceWith(ie(e))
|
|
2529
|
+
), o;
|
|
2520
2530
|
}
|
|
2521
2531
|
if (t === "video" && n) {
|
|
2522
2532
|
const o = document.createElement("video");
|
|
2523
|
-
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2533
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2534
|
+
"error",
|
|
2535
|
+
() => o.replaceWith(ie(e))
|
|
2536
|
+
), o.addEventListener(
|
|
2537
|
+
"stalled",
|
|
2538
|
+
() => o.replaceWith(ie(e))
|
|
2539
|
+
), o;
|
|
2524
2540
|
}
|
|
2525
2541
|
return ie(e);
|
|
2526
2542
|
}
|
|
2527
|
-
function
|
|
2543
|
+
function Da(e) {
|
|
2528
2544
|
const t = en(e), n = ho(e);
|
|
2529
2545
|
if (t === "image" && n) {
|
|
2530
2546
|
const o = document.createElement("img");
|
|
2531
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener(
|
|
2547
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener(
|
|
2548
|
+
"error",
|
|
2549
|
+
() => o.replaceWith(ie(e, "message"))
|
|
2550
|
+
), o;
|
|
2532
2551
|
}
|
|
2533
2552
|
if (t === "pdf" && n) {
|
|
2534
2553
|
const o = document.createElement("object");
|
|
2535
|
-
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener(
|
|
2554
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener(
|
|
2555
|
+
"error",
|
|
2556
|
+
() => o.replaceWith(
|
|
2557
|
+
ie(e, "message")
|
|
2558
|
+
)
|
|
2559
|
+
), o.appendChild(ie(e, "message")), o;
|
|
2536
2560
|
}
|
|
2537
2561
|
if (t === "video" && n) {
|
|
2538
2562
|
const o = document.createElement("video");
|
|
2539
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener(
|
|
2563
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener(
|
|
2564
|
+
"error",
|
|
2565
|
+
() => o.replaceWith(ie(e, "message"))
|
|
2566
|
+
), o.addEventListener(
|
|
2567
|
+
"stalled",
|
|
2568
|
+
() => o.replaceWith(ie(e, "message"))
|
|
2569
|
+
), o;
|
|
2540
2570
|
}
|
|
2541
2571
|
return ie(e, "message");
|
|
2542
2572
|
}
|
|
@@ -2565,10 +2595,10 @@ function On(e) {
|
|
|
2565
2595
|
function za(e, t) {
|
|
2566
2596
|
return t ? Array.from(t).map((o) => ({
|
|
2567
2597
|
...e.createLocalAttachment(o),
|
|
2568
|
-
previewUrl:
|
|
2598
|
+
previewUrl: Ra(o)
|
|
2569
2599
|
})) : [];
|
|
2570
2600
|
}
|
|
2571
|
-
function
|
|
2601
|
+
function Ra(e) {
|
|
2572
2602
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2573
2603
|
}
|
|
2574
2604
|
function it(e) {
|
|
@@ -2580,10 +2610,10 @@ function Bt(e, t, n = null) {
|
|
|
2580
2610
|
return;
|
|
2581
2611
|
}
|
|
2582
2612
|
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || tn(n) ? e.appendChild(
|
|
2583
|
-
|
|
2584
|
-
) : mo(t) && e.appendChild(
|
|
2613
|
+
Ma(t, n)
|
|
2614
|
+
) : mo(t) && e.appendChild(Oa(t));
|
|
2585
2615
|
}
|
|
2586
|
-
function
|
|
2616
|
+
function Ma(e, t) {
|
|
2587
2617
|
const n = document.createElement("div");
|
|
2588
2618
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2589
2619
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
@@ -2597,13 +2627,13 @@ function Oa(e, t) {
|
|
|
2597
2627
|
)
|
|
2598
2628
|
), n;
|
|
2599
2629
|
}
|
|
2600
|
-
function
|
|
2630
|
+
function Oa(e) {
|
|
2601
2631
|
const t = document.createElement("div");
|
|
2602
2632
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2603
2633
|
const n = document.createElement("strong");
|
|
2604
2634
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2605
2635
|
const o = document.createElement("span");
|
|
2606
|
-
return o.textContent =
|
|
2636
|
+
return o.textContent = Ua(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2607
2637
|
fo(
|
|
2608
2638
|
e,
|
|
2609
2639
|
"Upgrade",
|
|
@@ -2615,9 +2645,9 @@ function Yt(e, t) {
|
|
|
2615
2645
|
return e !== null && (ae(e) || mo(e) || tn(t));
|
|
2616
2646
|
}
|
|
2617
2647
|
function Bn(e, t, n) {
|
|
2618
|
-
return Yt(t, n) ||
|
|
2648
|
+
return Yt(t, n) || Ba(t) ? !0 : !Yt(e, n);
|
|
2619
2649
|
}
|
|
2620
|
-
function
|
|
2650
|
+
function Ba(e) {
|
|
2621
2651
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
|
|
2622
2652
|
}
|
|
2623
2653
|
function ae(e) {
|
|
@@ -2629,10 +2659,10 @@ function tn(e) {
|
|
|
2629
2659
|
function mo(e) {
|
|
2630
2660
|
return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2631
2661
|
}
|
|
2632
|
-
function
|
|
2633
|
-
return e.creditsRemaining === null ? null : `${
|
|
2662
|
+
function Ua(e) {
|
|
2663
|
+
return e.creditsRemaining === null ? null : `${Fa(e.creditsRemaining)} credits left`;
|
|
2634
2664
|
}
|
|
2635
|
-
function
|
|
2665
|
+
function Fa(e) {
|
|
2636
2666
|
return new Intl.NumberFormat("en-US", {
|
|
2637
2667
|
maximumFractionDigits: 0
|
|
2638
2668
|
}).format(Math.ceil(e));
|
|
@@ -2661,15 +2691,15 @@ function Ut(e, t) {
|
|
|
2661
2691
|
(o) => !wo(o)
|
|
2662
2692
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2663
2693
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const g =
|
|
2694
|
+
function Ha(e, t, n, o, i, r, l, p, d, c, u, m, k, v, R, _) {
|
|
2695
|
+
const g = qa(r), b = g.filter(
|
|
2666
2696
|
(C) => !wo(C)
|
|
2667
|
-
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(),
|
|
2697
|
+
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(), L = (C) => {
|
|
2668
2698
|
P.push(C);
|
|
2669
2699
|
};
|
|
2670
2700
|
_o(n, r.isThinking), i.hidden = !p, p && l !== null && po(i, l);
|
|
2671
|
-
const F =
|
|
2672
|
-
if (o(F),
|
|
2701
|
+
const F = b.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2702
|
+
if (o(F), b.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2673
2703
|
const C = document.createElement("div");
|
|
2674
2704
|
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2675
2705
|
const T = document.createElement("div");
|
|
@@ -2681,37 +2711,37 @@ function Wa(e, t, n, o, i, r, l, p, d, c, u, m, E, v, z, b) {
|
|
|
2681
2711
|
T.appendChild(Se), C.appendChild(T), C.appendChild(lo());
|
|
2682
2712
|
const q = document.createElement("div");
|
|
2683
2713
|
if (q.className = r.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", r.starterPrompts.length === 0 && !r.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), r.starterPrompts.length > 0)
|
|
2684
|
-
for (const
|
|
2714
|
+
for (const z of r.starterPrompts) {
|
|
2685
2715
|
const D = document.createElement("button");
|
|
2686
|
-
D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${
|
|
2687
|
-
z
|
|
2716
|
+
D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${z}"`, D.addEventListener("click", () => {
|
|
2717
|
+
R(z);
|
|
2688
2718
|
}), q.appendChild(D);
|
|
2689
2719
|
}
|
|
2690
2720
|
else if (r.starterPromptsLoading) {
|
|
2691
|
-
const
|
|
2692
|
-
|
|
2721
|
+
const z = document.createElement("button");
|
|
2722
|
+
z.type = "button", z.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", z.disabled = !0, z.tabIndex = -1, z.textContent = "Generating example tasks...", q.appendChild(z);
|
|
2693
2723
|
} else
|
|
2694
|
-
for (let
|
|
2724
|
+
for (let z = 0; z < Ei; z += 1) {
|
|
2695
2725
|
const D = document.createElement("button");
|
|
2696
2726
|
D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
|
|
2697
2727
|
}
|
|
2698
|
-
C.appendChild(q), m.clear(),
|
|
2728
|
+
C.appendChild(q), m.clear(), L(C), L(t), Fn(e, P);
|
|
2699
2729
|
return;
|
|
2700
2730
|
}
|
|
2701
2731
|
let H = null, $ = null, Q = [];
|
|
2702
|
-
const
|
|
2732
|
+
const Re = b.some(Xt), x = () => {
|
|
2703
2733
|
if (Q.length === 0)
|
|
2704
2734
|
return !1;
|
|
2705
|
-
const C =
|
|
2735
|
+
const C = tr(
|
|
2706
2736
|
Q,
|
|
2707
2737
|
u,
|
|
2708
|
-
|
|
2738
|
+
k,
|
|
2709
2739
|
v()
|
|
2710
2740
|
);
|
|
2711
|
-
return
|
|
2741
|
+
return L(C), H = null, $ = C, Q = [], !0;
|
|
2712
2742
|
};
|
|
2713
|
-
for (let C = 0; C <
|
|
2714
|
-
const T =
|
|
2743
|
+
for (let C = 0; C < b.length; C += 1) {
|
|
2744
|
+
const T = b[C];
|
|
2715
2745
|
if (T.role === "tool") {
|
|
2716
2746
|
Q.push(T);
|
|
2717
2747
|
continue;
|
|
@@ -2719,60 +2749,74 @@ function Wa(e, t, n, o, i, r, l, p, d, c, u, m, E, v, z, b) {
|
|
|
2719
2749
|
if (Xt(T)) {
|
|
2720
2750
|
if (x()) {
|
|
2721
2751
|
const N = ct();
|
|
2722
|
-
|
|
2752
|
+
L(N), H = null, $ = N;
|
|
2723
2753
|
} else {
|
|
2724
2754
|
const N = Gn(v());
|
|
2725
|
-
|
|
2755
|
+
L(N), H = null, $ = N;
|
|
2726
2756
|
}
|
|
2727
2757
|
continue;
|
|
2728
2758
|
}
|
|
2729
2759
|
if (T.role === "system")
|
|
2730
2760
|
continue;
|
|
2731
|
-
const Se = x(), q =
|
|
2761
|
+
const Se = x(), q = er(T.content);
|
|
2732
2762
|
if (T.role === "assistant" && !Se) {
|
|
2733
2763
|
const D = bo(v());
|
|
2734
|
-
|
|
2764
|
+
L(D), H = null, $ = D;
|
|
2735
2765
|
}
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2766
|
+
const z = Wa(
|
|
2767
|
+
T,
|
|
2768
|
+
q,
|
|
2769
|
+
m,
|
|
2770
|
+
A
|
|
2771
|
+
);
|
|
2772
|
+
L(z), H = z, $ = null;
|
|
2738
2773
|
}
|
|
2739
|
-
const de = x(), Ye =
|
|
2740
|
-
if (r.isThinking && !Ye && !
|
|
2774
|
+
const de = x(), Ye = b[b.length - 1]?.id === "assistant-draft";
|
|
2775
|
+
if (r.isThinking && !Ye && !Re)
|
|
2741
2776
|
if (de) {
|
|
2742
2777
|
const C = ct();
|
|
2743
|
-
|
|
2778
|
+
L(C), H = null, $ = C;
|
|
2744
2779
|
} else {
|
|
2745
2780
|
const C = Gn(v());
|
|
2746
|
-
|
|
2781
|
+
L(C), H = null, $ = C;
|
|
2747
2782
|
}
|
|
2748
2783
|
if (r.lastError) {
|
|
2749
2784
|
const C = document.createElement("div");
|
|
2750
|
-
C.className = "pluno-pa-widget__error", C.textContent = r.lastError,
|
|
2785
|
+
C.className = "pluno-pa-widget__error", C.textContent = r.lastError, L(C), H = C, $ = null;
|
|
2751
2786
|
}
|
|
2752
|
-
const X =
|
|
2753
|
-
if (
|
|
2754
|
-
const C =
|
|
2755
|
-
isDrafting:
|
|
2756
|
-
error:
|
|
2757
|
-
characterIconOptions:
|
|
2758
|
-
onDraft:
|
|
2759
|
-
onDismiss:
|
|
2760
|
-
onDisable:
|
|
2787
|
+
const X = _ && !r.isThinking ? Qo(g) : null;
|
|
2788
|
+
if (_ && X && !_.dismissedCandidateIds.has(X.id)) {
|
|
2789
|
+
const C = Ka(X, {
|
|
2790
|
+
isDrafting: _.draftingCandidateId === X.id,
|
|
2791
|
+
error: _.error,
|
|
2792
|
+
characterIconOptions: _.characterIconOptions,
|
|
2793
|
+
onDraft: _.onDraft,
|
|
2794
|
+
onDismiss: _.onDismiss,
|
|
2795
|
+
onDisable: _.onDisable
|
|
2761
2796
|
});
|
|
2762
|
-
|
|
2797
|
+
L(C), _.onSeen(X), H = null, $ = C;
|
|
2763
2798
|
}
|
|
2764
|
-
H?.classList.add(
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2799
|
+
H?.classList.add(
|
|
2800
|
+
"pluno-pa-widget__message--bottom-reserve"
|
|
2801
|
+
), $?.classList.add(
|
|
2802
|
+
"pluno-pa-widget__bottom-reserve-compact"
|
|
2803
|
+
), L(t), $a(
|
|
2804
|
+
m,
|
|
2805
|
+
A
|
|
2806
|
+
), Fn(e, P), d ? Ve(e, c) : e.scrollTop = h;
|
|
2807
|
+
}
|
|
2808
|
+
function Wa(e, t, n, o) {
|
|
2809
|
+
const i = Ga(e, t), r = i ? n.get(i) : void 0;
|
|
2768
2810
|
if (i && r)
|
|
2769
|
-
return r.classList.remove(
|
|
2811
|
+
return r.classList.remove(
|
|
2812
|
+
"pluno-pa-widget__message--bottom-reserve"
|
|
2813
|
+
), o.add(i), r;
|
|
2770
2814
|
const l = document.createElement("div");
|
|
2771
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2815
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? or(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(ja(e.attachments));
|
|
2772
2816
|
const p = document.createElement("div");
|
|
2773
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2817
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Va(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2774
2818
|
}
|
|
2775
|
-
function
|
|
2819
|
+
function Ga(e, t) {
|
|
2776
2820
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2777
2821
|
id: e.id,
|
|
2778
2822
|
content: t,
|
|
@@ -2790,7 +2834,7 @@ function $a(e, t) {
|
|
|
2790
2834
|
})
|
|
2791
2835
|
});
|
|
2792
2836
|
}
|
|
2793
|
-
function
|
|
2837
|
+
function $a(e, t) {
|
|
2794
2838
|
for (const n of e.keys())
|
|
2795
2839
|
t.has(n) || e.delete(n);
|
|
2796
2840
|
}
|
|
@@ -2808,7 +2852,7 @@ function Fn(e, t) {
|
|
|
2808
2852
|
n = n.nextSibling, e.removeChild(o);
|
|
2809
2853
|
}
|
|
2810
2854
|
}
|
|
2811
|
-
function
|
|
2855
|
+
function qa(e) {
|
|
2812
2856
|
if (!e.assistantDraft)
|
|
2813
2857
|
return [...e.messages];
|
|
2814
2858
|
const t = {
|
|
@@ -2870,20 +2914,20 @@ function Wn(e, t, n, o, i, r, l, p) {
|
|
|
2870
2914
|
}
|
|
2871
2915
|
e.appendChild(d);
|
|
2872
2916
|
}
|
|
2873
|
-
function
|
|
2917
|
+
function ja(e) {
|
|
2874
2918
|
const t = document.createElement("div");
|
|
2875
2919
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2876
2920
|
for (const n of e)
|
|
2877
|
-
t.appendChild(
|
|
2921
|
+
t.appendChild(Da(n));
|
|
2878
2922
|
return t;
|
|
2879
2923
|
}
|
|
2880
|
-
function
|
|
2924
|
+
function Va(e) {
|
|
2881
2925
|
const t = document.createElement("button");
|
|
2882
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2926
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Aa()), t.addEventListener("click", (n) => {
|
|
2883
2927
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2884
2928
|
}), t;
|
|
2885
2929
|
}
|
|
2886
|
-
function
|
|
2930
|
+
function Ka(e, t) {
|
|
2887
2931
|
const n = document.createElement("article");
|
|
2888
2932
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2889
2933
|
const o = document.createElement("div");
|
|
@@ -2924,7 +2968,7 @@ function Ya(e, t) {
|
|
|
2924
2968
|
}
|
|
2925
2969
|
return o.appendChild(p), n.appendChild(o), n;
|
|
2926
2970
|
}
|
|
2927
|
-
function
|
|
2971
|
+
function Ya(e, t) {
|
|
2928
2972
|
const n = document.createElement("div");
|
|
2929
2973
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
|
|
2930
2974
|
g.target === n && t.onClose();
|
|
@@ -2943,11 +2987,11 @@ function Xa(e, t) {
|
|
|
2943
2987
|
c.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2944
2988
|
const u = document.createElement("strong");
|
|
2945
2989
|
u.textContent = "1) Copy Screenshot", c.appendChild(u);
|
|
2946
|
-
const m =
|
|
2990
|
+
const m = Xa(
|
|
2947
2991
|
"Copy Screenshot",
|
|
2948
2992
|
async () => {
|
|
2949
2993
|
try {
|
|
2950
|
-
return await
|
|
2994
|
+
return await ei(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2951
2995
|
} catch {
|
|
2952
2996
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2953
2997
|
}
|
|
@@ -2956,39 +3000,39 @@ function Xa(e, t) {
|
|
|
2956
3000
|
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2957
3001
|
const g = document.createElement("div");
|
|
2958
3002
|
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2959
|
-
const
|
|
2960
|
-
|
|
3003
|
+
const b = document.createElement("img");
|
|
3004
|
+
b.src = e.screenshotDataUrl, b.alt = "Product page with Pluno open", g.appendChild(b), d.appendChild(g);
|
|
2961
3005
|
}
|
|
2962
3006
|
o.appendChild(d), o.appendChild(p);
|
|
2963
|
-
const
|
|
2964
|
-
|
|
3007
|
+
const k = document.createElement("div");
|
|
3008
|
+
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2965
3009
|
const v = document.createElement("strong");
|
|
2966
|
-
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on",
|
|
2967
|
-
const
|
|
2968
|
-
|
|
2969
|
-
const
|
|
2970
|
-
|
|
2971
|
-
for (const g of
|
|
2972
|
-
const
|
|
2973
|
-
|
|
3010
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
3011
|
+
const R = document.createElement("p");
|
|
3012
|
+
R.className = "pluno-pa-widget__share-dialog-hint", R.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(R);
|
|
3013
|
+
const _ = document.createElement("footer");
|
|
3014
|
+
_.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3015
|
+
for (const g of Za(e)) {
|
|
3016
|
+
const b = document.createElement("a");
|
|
3017
|
+
b.href = g.href, b.target = "_blank", b.rel = "noopener noreferrer", b.title = g.label, b.setAttribute("aria-label", `Open ${g.label}`), b.appendChild(Ja(g.id)), _.appendChild(b);
|
|
2974
3018
|
}
|
|
2975
|
-
if (
|
|
3019
|
+
if (k.appendChild(_), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2976
3020
|
const g = document.createElement("div");
|
|
2977
3021
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2978
|
-
const
|
|
2979
|
-
|
|
3022
|
+
const b = document.createElement("strong");
|
|
3023
|
+
b.className = "pluno-pa-widget__share-dialog-step-title", b.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(b);
|
|
2980
3024
|
const h = document.createElement("a");
|
|
2981
|
-
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(
|
|
3025
|
+
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(Qa()), g.appendChild(h), o.appendChild(g);
|
|
2982
3026
|
}
|
|
2983
3027
|
return n.appendChild(o), n;
|
|
2984
3028
|
}
|
|
2985
|
-
function
|
|
3029
|
+
function Xa(e, t) {
|
|
2986
3030
|
const n = document.createElement("button");
|
|
2987
3031
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
2988
3032
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
2989
3033
|
}), n;
|
|
2990
3034
|
}
|
|
2991
|
-
function
|
|
3035
|
+
function Za(e) {
|
|
2992
3036
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
2993
3037
|
return [
|
|
2994
3038
|
{
|
|
@@ -3008,7 +3052,7 @@ function Ja(e) {
|
|
|
3008
3052
|
}
|
|
3009
3053
|
];
|
|
3010
3054
|
}
|
|
3011
|
-
function
|
|
3055
|
+
function Ja(e) {
|
|
3012
3056
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3013
3057
|
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (U(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), U(
|
|
3014
3058
|
t,
|
|
@@ -3035,7 +3079,7 @@ function U(e, t, n) {
|
|
|
3035
3079
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3036
3080
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3037
3081
|
}
|
|
3038
|
-
function
|
|
3082
|
+
function Qa() {
|
|
3039
3083
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3040
3084
|
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), U(e, "M14 5h5v5"), U(e, "M19 5l-8 8"), U(
|
|
3041
3085
|
e,
|
|
@@ -3045,10 +3089,10 @@ function er() {
|
|
|
3045
3089
|
function wo(e) {
|
|
3046
3090
|
return e.role === "tool" && e.toolName === Xn;
|
|
3047
3091
|
}
|
|
3048
|
-
function
|
|
3092
|
+
function er(e) {
|
|
3049
3093
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3050
3094
|
}
|
|
3051
|
-
function
|
|
3095
|
+
function tr(e, t, n, o) {
|
|
3052
3096
|
const i = document.createElement("article");
|
|
3053
3097
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3054
3098
|
e[e.length - 1].createdAt
|
|
@@ -3058,7 +3102,7 @@ function nr(e, t, n, o) {
|
|
|
3058
3102
|
o
|
|
3059
3103
|
)
|
|
3060
3104
|
);
|
|
3061
|
-
const r = document.createElement("details"), l =
|
|
3105
|
+
const r = document.createElement("details"), l = nr(e);
|
|
3062
3106
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3063
3107
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3064
3108
|
});
|
|
@@ -3069,10 +3113,10 @@ function nr(e, t, n, o) {
|
|
|
3069
3113
|
const u = document.createElement("div");
|
|
3070
3114
|
u.className = "pluno-pa-widget__tool-lines";
|
|
3071
3115
|
for (const m of e) {
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3116
|
+
const k = document.createElement("div");
|
|
3117
|
+
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(Zt());
|
|
3074
3118
|
const v = document.createElement("span");
|
|
3075
|
-
v.textContent = m.content || "Run tool",
|
|
3119
|
+
v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
|
|
3076
3120
|
}
|
|
3077
3121
|
r.appendChild(u);
|
|
3078
3122
|
}
|
|
@@ -3099,7 +3143,7 @@ function ct(e = "Thinking...") {
|
|
|
3099
3143
|
const o = document.createElement("span");
|
|
3100
3144
|
return o.textContent = e, t.appendChild(o), t;
|
|
3101
3145
|
}
|
|
3102
|
-
function
|
|
3146
|
+
function nr(e) {
|
|
3103
3147
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3104
3148
|
}
|
|
3105
3149
|
function Zt() {
|
|
@@ -3107,9 +3151,9 @@ function Zt() {
|
|
|
3107
3151
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3108
3152
|
}
|
|
3109
3153
|
function _o(e, t) {
|
|
3110
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3154
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Pa() : go());
|
|
3111
3155
|
}
|
|
3112
|
-
function
|
|
3156
|
+
function or(e, t) {
|
|
3113
3157
|
const n = t.replace(/\r\n/g, `
|
|
3114
3158
|
`).split(`
|
|
3115
3159
|
`);
|
|
@@ -3183,7 +3227,7 @@ function at(e, t) {
|
|
|
3183
3227
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3184
3228
|
} else {
|
|
3185
3229
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3186
|
-
if (p &&
|
|
3230
|
+
if (p && ir(p[2])) {
|
|
3187
3231
|
const d = document.createElement("a");
|
|
3188
3232
|
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
3189
3233
|
} else
|
|
@@ -3193,7 +3237,7 @@ function at(e, t) {
|
|
|
3193
3237
|
}
|
|
3194
3238
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3195
3239
|
}
|
|
3196
|
-
function
|
|
3240
|
+
function ir(e) {
|
|
3197
3241
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3198
3242
|
return !0;
|
|
3199
3243
|
try {
|
|
@@ -3204,7 +3248,7 @@ function ar(e) {
|
|
|
3204
3248
|
}
|
|
3205
3249
|
}
|
|
3206
3250
|
function $n(e, t) {
|
|
3207
|
-
if (
|
|
3251
|
+
if (ar(e))
|
|
3208
3252
|
return;
|
|
3209
3253
|
const n = `
|
|
3210
3254
|
:host {
|
|
@@ -3247,6 +3291,9 @@ function $n(e, t) {
|
|
|
3247
3291
|
--pluno-pa-faint: #8e8e95;
|
|
3248
3292
|
--pluno-pa-divider: rgba(24, 24, 27, 0.08);
|
|
3249
3293
|
--pluno-pa-launcher-hairline: rgba(24, 24, 27, 0.06);
|
|
3294
|
+
--pluno-pa-minimized-launcher-paper: #fffdf6;
|
|
3295
|
+
--pluno-pa-minimized-launcher-ink: #2c2a1e;
|
|
3296
|
+
--pluno-pa-scribble-grid-line: rgba(96, 138, 188, 0.22);
|
|
3250
3297
|
--pluno-pa-launcher-width: min(190px, calc(100vw - 36px));
|
|
3251
3298
|
--pluno-pa-launcher-height: 41px;
|
|
3252
3299
|
--pluno-pa-panel-width: min(clamp(420px, 24vw, 520px), calc(100vw - 16px));
|
|
@@ -3470,12 +3517,15 @@ function $n(e, t) {
|
|
|
3470
3517
|
.pluno-pa-widget--thinking:not(.pluno-pa-widget--open):not(.pluno-pa-widget--minimized):not(.pluno-pa-widget--host-modal-conflict) .pluno-pa-widget__launcher-input {
|
|
3471
3518
|
display: none;
|
|
3472
3519
|
}
|
|
3473
|
-
.pluno-pa-widget--minimized {
|
|
3520
|
+
.pluno-pa-widget.pluno-pa-widget--minimized {
|
|
3474
3521
|
--pluno-pa-launcher-width: 22px;
|
|
3475
3522
|
--pluno-pa-launcher-height: 22px;
|
|
3476
3523
|
pointer-events: none;
|
|
3477
3524
|
}
|
|
3478
|
-
.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
3525
|
+
.pluno-pa-widget.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
3526
|
+
/* The scribble circle gives the bolt a recognizable silhouette on host
|
|
3527
|
+
pages whose background colors are outside the widget's control. */
|
|
3528
|
+
isolation: isolate;
|
|
3479
3529
|
border: 0;
|
|
3480
3530
|
border-radius: 999px;
|
|
3481
3531
|
background: transparent;
|
|
@@ -3489,16 +3539,31 @@ function $n(e, t) {
|
|
|
3489
3539
|
overflow: visible;
|
|
3490
3540
|
pointer-events: auto;
|
|
3491
3541
|
}
|
|
3542
|
+
.pluno-pa-widget.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before {
|
|
3543
|
+
content: "";
|
|
3544
|
+
position: absolute;
|
|
3545
|
+
inset: 0;
|
|
3546
|
+
z-index: -1;
|
|
3547
|
+
border: 1.5px solid var(--pluno-pa-minimized-launcher-ink);
|
|
3548
|
+
border-radius: inherit;
|
|
3549
|
+
background-color: var(--pluno-pa-minimized-launcher-paper);
|
|
3550
|
+
background-image:
|
|
3551
|
+
linear-gradient(var(--pluno-pa-scribble-grid-line) 1px, transparent 1px),
|
|
3552
|
+
linear-gradient(90deg, var(--pluno-pa-scribble-grid-line) 1px, transparent 1px);
|
|
3553
|
+
background-size: 12px 12px;
|
|
3554
|
+
pointer-events: none;
|
|
3555
|
+
}
|
|
3492
3556
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-input,
|
|
3493
3557
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-drag-handle,
|
|
3494
3558
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-minimize,
|
|
3495
3559
|
.pluno-pa-widget--minimized .pluno-pa-widget__scribble-spirals--launcher {
|
|
3496
3560
|
display: none;
|
|
3497
3561
|
}
|
|
3498
|
-
.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
3499
|
-
left:
|
|
3500
|
-
width:
|
|
3501
|
-
height:
|
|
3562
|
+
.pluno-pa-widget.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
3563
|
+
left: 3px;
|
|
3564
|
+
width: 16px;
|
|
3565
|
+
height: 16px;
|
|
3566
|
+
margin-top: 0;
|
|
3502
3567
|
}
|
|
3503
3568
|
.pluno-pa-widget--bottom-left .pluno-pa-widget__launcher {
|
|
3504
3569
|
left: 0;
|
|
@@ -5215,20 +5280,6 @@ function $n(e, t) {
|
|
|
5215
5280
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-panel {
|
|
5216
5281
|
border-radius: var(--pluno-pa-scribble-wobble);
|
|
5217
5282
|
}
|
|
5218
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized {
|
|
5219
|
-
--pluno-pa-launcher-width: 16px;
|
|
5220
|
-
--pluno-pa-launcher-height: 24px;
|
|
5221
|
-
}
|
|
5222
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
5223
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
5224
|
-
content: none;
|
|
5225
|
-
}
|
|
5226
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
5227
|
-
left: -3px;
|
|
5228
|
-
width: 22px;
|
|
5229
|
-
height: 22px;
|
|
5230
|
-
margin-top: 0;
|
|
5231
|
-
}
|
|
5232
5283
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize {
|
|
5233
5284
|
color: var(--pluno-pa-text);
|
|
5234
5285
|
font-size: 18px;
|
|
@@ -5364,21 +5415,6 @@ function $n(e, t) {
|
|
|
5364
5415
|
opacity: 0.6;
|
|
5365
5416
|
transform: rotate(5deg);
|
|
5366
5417
|
}
|
|
5367
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
5368
|
-
border: 0;
|
|
5369
|
-
width: var(--pluno-pa-launcher-width);
|
|
5370
|
-
min-width: 0;
|
|
5371
|
-
height: var(--pluno-pa-launcher-height);
|
|
5372
|
-
min-height: 0;
|
|
5373
|
-
padding: 0;
|
|
5374
|
-
}
|
|
5375
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
5376
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
5377
|
-
content: none;
|
|
5378
|
-
}
|
|
5379
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__scribble-spirals {
|
|
5380
|
-
display: none;
|
|
5381
|
-
}
|
|
5382
5418
|
.pluno-pa-widget--scribble .pluno-pa-widget__attach:hover:not(:disabled),
|
|
5383
5419
|
.pluno-pa-widget--scribble .pluno-pa-widget__attach:focus-visible {
|
|
5384
5420
|
background: transparent;
|
|
@@ -5473,18 +5509,18 @@ function $n(e, t) {
|
|
|
5473
5509
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5474
5510
|
}
|
|
5475
5511
|
`;
|
|
5476
|
-
if (
|
|
5512
|
+
if (rr(e, n))
|
|
5477
5513
|
return;
|
|
5478
5514
|
const o = e.ownerDocument.createElement("style");
|
|
5479
5515
|
o.id = io, o.textContent = n, e.appendChild(o), xo(e);
|
|
5480
5516
|
}
|
|
5481
|
-
function
|
|
5517
|
+
function ar(e) {
|
|
5482
5518
|
return e.getElementById(io) !== null || e.host instanceof HTMLElement && e.host.getAttribute(ao) === "true";
|
|
5483
5519
|
}
|
|
5484
5520
|
function xo(e) {
|
|
5485
5521
|
e.host instanceof HTMLElement && e.host.setAttribute(ao, "true");
|
|
5486
5522
|
}
|
|
5487
|
-
function
|
|
5523
|
+
function rr(e, t) {
|
|
5488
5524
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5489
5525
|
return !1;
|
|
5490
5526
|
try {
|
|
@@ -5494,7 +5530,7 @@ function lr(e, t) {
|
|
|
5494
5530
|
return !1;
|
|
5495
5531
|
}
|
|
5496
5532
|
}
|
|
5497
|
-
async function
|
|
5533
|
+
async function lr() {
|
|
5498
5534
|
return document.body ? document.body : await new Promise((e) => {
|
|
5499
5535
|
const t = new MutationObserver(() => {
|
|
5500
5536
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5505,7 +5541,7 @@ async function pr() {
|
|
|
5505
5541
|
function yo(e) {
|
|
5506
5542
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5507
5543
|
}
|
|
5508
|
-
function
|
|
5544
|
+
function pr(e) {
|
|
5509
5545
|
try {
|
|
5510
5546
|
const t = window.localStorage.getItem(yo(e));
|
|
5511
5547
|
if (!t)
|
|
@@ -5519,8 +5555,8 @@ function sr(e) {
|
|
|
5519
5555
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5520
5556
|
(o) => typeof o == "string"
|
|
5521
5557
|
) : [],
|
|
5522
|
-
launcherPosition:
|
|
5523
|
-
panelSize:
|
|
5558
|
+
launcherPosition: ur(n.launcherPosition) ? n.launcherPosition : null,
|
|
5559
|
+
panelSize: gr(n.panelSize) ? ut(n.panelSize) : null,
|
|
5524
5560
|
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Zn) : [],
|
|
5525
5561
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5526
5562
|
};
|
|
@@ -5528,7 +5564,7 @@ function sr(e) {
|
|
|
5528
5564
|
return qn();
|
|
5529
5565
|
}
|
|
5530
5566
|
}
|
|
5531
|
-
async function
|
|
5567
|
+
async function sr(e) {
|
|
5532
5568
|
if (e.loadSharePromptsDisabled)
|
|
5533
5569
|
return e.loadSharePromptsDisabled();
|
|
5534
5570
|
try {
|
|
@@ -5537,7 +5573,7 @@ async function dr(e) {
|
|
|
5537
5573
|
return !1;
|
|
5538
5574
|
}
|
|
5539
5575
|
}
|
|
5540
|
-
function
|
|
5576
|
+
function dr(e, t) {
|
|
5541
5577
|
if (e.persistSharePromptsDisabled) {
|
|
5542
5578
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5543
5579
|
() => {
|
|
@@ -5564,7 +5600,7 @@ function qn() {
|
|
|
5564
5600
|
sharePromptsDisabled: !1
|
|
5565
5601
|
};
|
|
5566
5602
|
}
|
|
5567
|
-
function
|
|
5603
|
+
function cr(e, t) {
|
|
5568
5604
|
try {
|
|
5569
5605
|
window.localStorage.setItem(
|
|
5570
5606
|
yo(e),
|
|
@@ -5574,42 +5610,42 @@ function ur(e, t) {
|
|
|
5574
5610
|
return;
|
|
5575
5611
|
}
|
|
5576
5612
|
}
|
|
5577
|
-
function
|
|
5613
|
+
function ur(e) {
|
|
5578
5614
|
if (!e || typeof e != "object")
|
|
5579
5615
|
return !1;
|
|
5580
5616
|
const t = e;
|
|
5581
5617
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
5582
5618
|
}
|
|
5583
|
-
function
|
|
5619
|
+
function gr(e) {
|
|
5584
5620
|
if (!e || typeof e != "object")
|
|
5585
5621
|
return !1;
|
|
5586
5622
|
const t = e;
|
|
5587
5623
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5588
5624
|
}
|
|
5589
5625
|
const jn = /* @__PURE__ */ new WeakSet();
|
|
5590
|
-
function
|
|
5626
|
+
function hr(e) {
|
|
5591
5627
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5592
5628
|
}
|
|
5593
5629
|
function Vn(e) {
|
|
5594
5630
|
const t = e.pathname.split("/");
|
|
5595
5631
|
return t[t.length - 1] ?? "";
|
|
5596
5632
|
}
|
|
5597
|
-
function
|
|
5633
|
+
function mr(e, t) {
|
|
5598
5634
|
const n = new URL(e.src, document.baseURI);
|
|
5599
5635
|
return n.href === t.href || n.pathname === t.pathname ? !0 : Vn(n) === Vn(t);
|
|
5600
5636
|
}
|
|
5601
5637
|
class se extends EventTarget {
|
|
5602
5638
|
constructor(t, n) {
|
|
5603
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
5639
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(_i, () => {
|
|
5604
5640
|
this.readyState = se.OPEN, this.dispatchEvent(new Event("open"));
|
|
5605
|
-
}), this.addPreviewListener(
|
|
5641
|
+
}), this.addPreviewListener(xi, (o) => {
|
|
5606
5642
|
const i = o;
|
|
5607
5643
|
this.dispatchEvent(
|
|
5608
5644
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5609
5645
|
);
|
|
5610
|
-
}), this.addPreviewListener(
|
|
5646
|
+
}), this.addPreviewListener(yi, () => {
|
|
5611
5647
|
this.readyState = se.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5612
|
-
}), this.addPreviewListener(
|
|
5648
|
+
}), this.addPreviewListener(vi, (o) => {
|
|
5613
5649
|
const i = o;
|
|
5614
5650
|
this.readyState = se.CLOSED, this.dispatchEvent(
|
|
5615
5651
|
new CloseEvent("close", {
|
|
@@ -5621,7 +5657,7 @@ class se extends EventTarget {
|
|
|
5621
5657
|
}), window.dispatchEvent(
|
|
5622
5658
|
new CustomEvent(
|
|
5623
5659
|
rt(
|
|
5624
|
-
|
|
5660
|
+
fi,
|
|
5625
5661
|
this.channelId
|
|
5626
5662
|
),
|
|
5627
5663
|
{
|
|
@@ -5641,7 +5677,7 @@ class se extends EventTarget {
|
|
|
5641
5677
|
binaryType = "blob";
|
|
5642
5678
|
bufferedAmount = 0;
|
|
5643
5679
|
readyState = se.CONNECTING;
|
|
5644
|
-
socketId =
|
|
5680
|
+
socketId = fr();
|
|
5645
5681
|
listeners = /* @__PURE__ */ new Map();
|
|
5646
5682
|
send(t) {
|
|
5647
5683
|
if (this.readyState !== se.OPEN)
|
|
@@ -5651,7 +5687,7 @@ class se extends EventTarget {
|
|
|
5651
5687
|
);
|
|
5652
5688
|
window.dispatchEvent(
|
|
5653
5689
|
new CustomEvent(
|
|
5654
|
-
rt(
|
|
5690
|
+
rt(wi, this.channelId),
|
|
5655
5691
|
{
|
|
5656
5692
|
detail: {
|
|
5657
5693
|
socketId: this.socketId,
|
|
@@ -5664,7 +5700,7 @@ class se extends EventTarget {
|
|
|
5664
5700
|
close(t, n) {
|
|
5665
5701
|
this.readyState !== se.CLOSED && (this.readyState = se.CLOSING, window.dispatchEvent(
|
|
5666
5702
|
new CustomEvent(
|
|
5667
|
-
rt(
|
|
5703
|
+
rt(bi, this.channelId),
|
|
5668
5704
|
{
|
|
5669
5705
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5670
5706
|
}
|
|
@@ -5686,7 +5722,7 @@ class se extends EventTarget {
|
|
|
5686
5722
|
this.listeners.clear();
|
|
5687
5723
|
}
|
|
5688
5724
|
}
|
|
5689
|
-
function
|
|
5725
|
+
function fr() {
|
|
5690
5726
|
const e = window.sessionStorage.getItem(
|
|
5691
5727
|
yn
|
|
5692
5728
|
);
|
|
@@ -5698,7 +5734,7 @@ function wr() {
|
|
|
5698
5734
|
function rt(e, t) {
|
|
5699
5735
|
return `${e}:${t}`;
|
|
5700
5736
|
}
|
|
5701
|
-
function
|
|
5737
|
+
function wr(e) {
|
|
5702
5738
|
const t = document.currentScript;
|
|
5703
5739
|
if (t instanceof HTMLScriptElement)
|
|
5704
5740
|
return [t];
|
|
@@ -5706,20 +5742,20 @@ function br(e) {
|
|
|
5706
5742
|
return Array.from(
|
|
5707
5743
|
document.querySelectorAll("script[type='module'][src]")
|
|
5708
5744
|
).filter(
|
|
5709
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5745
|
+
(i) => i instanceof HTMLScriptElement && hr(i) && mr(i, o)
|
|
5710
5746
|
);
|
|
5711
5747
|
}
|
|
5712
|
-
function
|
|
5713
|
-
for (const t of
|
|
5748
|
+
function br(e) {
|
|
5749
|
+
for (const t of wr(e)) {
|
|
5714
5750
|
if (jn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
5715
5751
|
continue;
|
|
5716
5752
|
jn.add(t);
|
|
5717
5753
|
const n = t.dataset.plunoPreviewChannel;
|
|
5718
|
-
|
|
5754
|
+
Gi({
|
|
5719
5755
|
token: t.dataset.plunoToken,
|
|
5720
5756
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
5721
5757
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
5722
|
-
webSocketFactory: n ?
|
|
5758
|
+
webSocketFactory: n ? Wi(n) : void 0,
|
|
5723
5759
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5724
5760
|
accentColor: t.dataset.plunoAccentColor,
|
|
5725
5761
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5731,8 +5767,8 @@ function _r(e) {
|
|
|
5731
5767
|
});
|
|
5732
5768
|
}
|
|
5733
5769
|
}
|
|
5734
|
-
|
|
5770
|
+
br(import.meta.url);
|
|
5735
5771
|
export {
|
|
5736
|
-
|
|
5737
|
-
|
|
5772
|
+
Wi as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5773
|
+
Gi as mountPlunoProductAgentWidget
|
|
5738
5774
|
};
|