@pluno/product-agent-web 0.1.70 → 0.1.72
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 +3 -2
- package/dist/product-agent-sdk.js +669 -557
- package/dist/product-agent-widget.js +639 -617
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PlunoProductAgent as Jo, getProductAgentOriginAccessErrorMessage as Qo } from "./product-agent-sdk.js";
|
|
2
|
-
const ei = "#7c3aed",
|
|
2
|
+
const ei = "#7c3aed", dt = "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", ct = "#2c2a1e", yn = [253, 250, 241], vn = 3.5;
|
|
3
3
|
function eo(e) {
|
|
4
4
|
const t = to(e);
|
|
5
|
-
if (Cn(
|
|
5
|
+
if (Cn(Xe(t), yn) >= vn)
|
|
6
6
|
return t;
|
|
7
|
-
let o =
|
|
8
|
-
const i =
|
|
7
|
+
let o = Xe(t);
|
|
8
|
+
const i = Xe(ct);
|
|
9
9
|
for (let a = 0; a < 6; a += 1)
|
|
10
10
|
if (o = oi(o, i, 0.22), Cn(o, yn) >= vn)
|
|
11
11
|
return Gt(o);
|
|
@@ -20,7 +20,7 @@ function ti() {
|
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
22
|
function ni(e) {
|
|
23
|
-
const t = to(e), n = $t(
|
|
23
|
+
const t = to(e), n = $t(Xe(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -44,23 +44,23 @@ function ni(e) {
|
|
|
44
44
|
inner: "#4b4b4b",
|
|
45
45
|
shadow: "#000000"
|
|
46
46
|
} : {
|
|
47
|
-
top:
|
|
48
|
-
middle:
|
|
49
|
-
bottom:
|
|
50
|
-
edgeStart:
|
|
51
|
-
edgeMiddle:
|
|
52
|
-
edgeEnd:
|
|
53
|
-
glow:
|
|
54
|
-
highlight:
|
|
55
|
-
inner:
|
|
56
|
-
shadow:
|
|
47
|
+
top: te(t, 0.28, -0.03),
|
|
48
|
+
middle: te(t, 0.08, 0.04),
|
|
49
|
+
bottom: te(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: te(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: te(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: te(t, -0.18, 0.05),
|
|
53
|
+
glow: te(t, 0.32, -0.12),
|
|
54
|
+
highlight: te(t, 0.38, -0.18),
|
|
55
|
+
inner: te(t, 0.24, -0.1),
|
|
56
|
+
shadow: te(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
function to(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
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()}` : ei;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Xe(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
@@ -90,8 +90,8 @@ function oi(e, t, n) {
|
|
|
90
90
|
e[2] + (t[2] - e[2]) * o
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [o, i, a] = ii(
|
|
93
|
+
function te(e, t, n) {
|
|
94
|
+
const [o, i, a] = ii(Xe(e));
|
|
95
95
|
return Gt(ai(o, qt(i + n), qt(a + t)));
|
|
96
96
|
}
|
|
97
97
|
function ii([e, t, n]) {
|
|
@@ -167,13 +167,13 @@ function fi(e, t = {}) {
|
|
|
167
167
|
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const m = o,
|
|
170
|
+
const m = o, k = performance.now();
|
|
171
171
|
a = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const v = Math.min(1, (performance.now() -
|
|
176
|
+
const v = Math.min(1, (performance.now() - k) / ci);
|
|
177
177
|
o = Math.round(m + (u - m) * xi(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
178
|
}, gi);
|
|
179
179
|
}, c = async () => {
|
|
@@ -216,7 +216,7 @@ function _i(e) {
|
|
|
216
216
|
function xi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Pi = "product-agent:sdk-preview-socket-error", Ii = "product-agent:sdk-preview-socket-closed", kn = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", io = "data-pluno-auto-mounted", se = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Ln = "Timed out loading Pluno widget token", Di = "pluno.productAgent.widgetClientId.", Dt = /* @__PURE__ */ new Set(), Ri = "product-agent:preview-diagnostic", ao = "pluno.productAgent.sharePromptsDisabled",
|
|
219
|
+
const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Pi = "product-agent:sdk-preview-socket-error", Ii = "product-agent:sdk-preview-socket-closed", kn = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", io = "data-pluno-auto-mounted", se = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Ln = "Timed out loading Pluno widget token", Di = "pluno.productAgent.widgetClientId.", Dt = /* @__PURE__ */ new Set(), Ri = "product-agent:preview-diagnostic", ao = "pluno.productAgent.sharePromptsDisabled", Mi = 3, Pn = 'dialog[open], [aria-modal="true"], [role="dialog"]', zi = 400, Oi = 5e3, Ui = 500, In = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", ne = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !0,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
}, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Tn = "pluno-pa-scribble-font", ro = 190, lo = 41, An = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, tn = 420, qi = 520, ji = 0.24, nn = 680, Vi = 800, Ki = 0.76,
|
|
227
|
+
}, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Tn = "pluno-pa-scribble-font", ro = 190, lo = 41, An = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, tn = 420, qi = 520, ji = 0.24, nn = 680, Vi = 800, Ki = 0.76, T = 8, ke = 50, po = "http://www.w3.org/2000/svg", jt = 26, Vt = 8, Yi = 36, Kt = 16, Xi = 4, Nn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -268,13 +268,13 @@ function ea(e) {
|
|
|
268
268
|
}
|
|
269
269
|
async function ta(e = {}) {
|
|
270
270
|
const t = {
|
|
271
|
-
launcherLabel: e.launcherLabel ??
|
|
272
|
-
accentColor: e.accentColor ??
|
|
273
|
-
colorScheme: e.colorScheme ??
|
|
274
|
-
fontFamily: e.fontFamily ??
|
|
275
|
-
scribbleStyle: e.scribbleStyle ??
|
|
276
|
-
position: e.position ??
|
|
277
|
-
movableLauncher: e.movableLauncher ??
|
|
271
|
+
launcherLabel: e.launcherLabel ?? ne.launcherLabel,
|
|
272
|
+
accentColor: e.accentColor ?? ne.accentColor,
|
|
273
|
+
colorScheme: e.colorScheme ?? ne.colorScheme,
|
|
274
|
+
fontFamily: e.fontFamily ?? ne.fontFamily,
|
|
275
|
+
scribbleStyle: e.scribbleStyle ?? ne.scribbleStyle,
|
|
276
|
+
position: e.position ?? ne.position,
|
|
277
|
+
movableLauncher: e.movableLauncher ?? ne.movableLauncher,
|
|
278
278
|
token: e.token,
|
|
279
279
|
tokenProvider: e.tokenProvider,
|
|
280
280
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -308,7 +308,7 @@ async function ta(e = {}) {
|
|
|
308
308
|
showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
|
|
309
309
|
taskNotifications: e.taskNotifications
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
Q(
|
|
312
312
|
"web-sdk.widget",
|
|
313
313
|
"Mounting widget with merged options",
|
|
314
314
|
{
|
|
@@ -343,70 +343,70 @@ async function ta(e = {}) {
|
|
|
343
343
|
), o.appendChild(i);
|
|
344
344
|
const l = yr(t);
|
|
345
345
|
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
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"),
|
|
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"), Ee(
|
|
347
347
|
i,
|
|
348
|
-
|
|
348
|
+
Mt(
|
|
349
349
|
i,
|
|
350
350
|
p,
|
|
351
351
|
t.position
|
|
352
352
|
)
|
|
353
|
-
)), Xn(o, t.accentColor),
|
|
353
|
+
)), Xn(o, t.accentColor), Mn(i, a, {
|
|
354
354
|
accentColor: t.accentColor,
|
|
355
355
|
colorScheme: t.colorScheme,
|
|
356
356
|
fontFamily: t.fontFamily,
|
|
357
357
|
scribbleStyle: t.scribbleStyle
|
|
358
358
|
});
|
|
359
|
-
const m = await _r(),
|
|
359
|
+
const m = await _r(), k = m.ownerDocument, v = i.querySelector(
|
|
360
360
|
".pluno-pa-widget__launcher"
|
|
361
|
-
),
|
|
361
|
+
), D = i.querySelector(
|
|
362
362
|
".pluno-pa-widget__launcher-drag-handle"
|
|
363
|
-
),
|
|
363
|
+
), S = i.querySelector(
|
|
364
364
|
".pluno-pa-widget__launcher-input"
|
|
365
365
|
), g = i.querySelector(
|
|
366
366
|
".pluno-pa-widget__launcher-minimize"
|
|
367
|
-
),
|
|
367
|
+
), x = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
368
368
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
369
|
-
),
|
|
369
|
+
), A = Array.from(
|
|
370
370
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
371
|
-
),
|
|
371
|
+
), I = i.querySelector(
|
|
372
372
|
".pluno-pa-widget__close"
|
|
373
|
-
),
|
|
373
|
+
), R = i.querySelector(
|
|
374
374
|
".pluno-pa-widget__composer"
|
|
375
|
-
),
|
|
375
|
+
), P = i.querySelector(
|
|
376
376
|
".pluno-pa-widget__attachment-error"
|
|
377
|
-
),
|
|
377
|
+
), Oe = i.querySelector(
|
|
378
378
|
".pluno-pa-widget__billing-status"
|
|
379
379
|
), $ = i.querySelector(
|
|
380
380
|
".pluno-pa-widget__attachments"
|
|
381
|
-
),
|
|
381
|
+
), U = i.querySelector(
|
|
382
382
|
".pluno-pa-widget__attachment-input"
|
|
383
|
-
),
|
|
383
|
+
), ce = i.querySelector(
|
|
384
384
|
".pluno-pa-widget__attach"
|
|
385
|
-
),
|
|
385
|
+
), y = i.querySelector(
|
|
386
386
|
".pluno-pa-widget__input"
|
|
387
|
-
),
|
|
387
|
+
), ee = i.querySelector(
|
|
388
388
|
".pluno-pa-widget__send"
|
|
389
|
-
),
|
|
389
|
+
), Ze = i.querySelector(
|
|
390
390
|
".pluno-pa-widget__top-actions"
|
|
391
|
-
),
|
|
391
|
+
), _e = i.querySelector(
|
|
392
392
|
".pluno-pa-widget__history"
|
|
393
|
-
),
|
|
393
|
+
), ue = i.querySelector(
|
|
394
394
|
".pluno-pa-widget__history-panel"
|
|
395
|
-
),
|
|
395
|
+
), w = i.querySelector(
|
|
396
396
|
".pluno-pa-widget__history-list"
|
|
397
|
-
),
|
|
397
|
+
), z = i.querySelector(
|
|
398
398
|
".pluno-pa-widget__history-close"
|
|
399
|
-
),
|
|
399
|
+
), H = i.querySelector(
|
|
400
400
|
".pluno-pa-widget__history-status"
|
|
401
|
-
),
|
|
401
|
+
), q = i.querySelector(
|
|
402
402
|
".pluno-pa-widget__timeline-jump"
|
|
403
|
-
),
|
|
403
|
+
), N = i.querySelector(
|
|
404
404
|
".pluno-pa-widget__active-users-counter"
|
|
405
|
-
),
|
|
405
|
+
), C = i.querySelector(
|
|
406
406
|
".pluno-pa-widget__timeline"
|
|
407
|
-
),
|
|
407
|
+
), re = i.querySelector(
|
|
408
408
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
409
|
-
),
|
|
409
|
+
), Ue = i.querySelector(
|
|
410
410
|
".pluno-pa-widget__notify-suggestion"
|
|
411
411
|
), Ao = i.querySelector(
|
|
412
412
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
@@ -415,28 +415,28 @@ async function ta(e = {}) {
|
|
|
415
415
|
), Do = i.querySelector(
|
|
416
416
|
".pluno-pa-widget__notify-suggestion-never"
|
|
417
417
|
);
|
|
418
|
-
if (!v || !
|
|
418
|
+
if (!v || !S || !x || !I || !R || !P || !Oe || !$ || !U || !ce || !y || !ee || !Ze || !_e || !ue || !w || !z || !H || !q || !N || !C || !re)
|
|
419
419
|
throw new Error("Failed to mount Pluno widget");
|
|
420
|
-
if (t.movableLauncher && !
|
|
420
|
+
if (t.movableLauncher && !D)
|
|
421
421
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
422
|
-
Wn(
|
|
422
|
+
Wn(S), Wn(y);
|
|
423
423
|
let W = [], le = null;
|
|
424
|
-
const
|
|
424
|
+
const Le = () => {
|
|
425
425
|
Ga(
|
|
426
426
|
$,
|
|
427
427
|
W,
|
|
428
428
|
(r) => {
|
|
429
429
|
W = W.filter(
|
|
430
|
-
(s,
|
|
431
|
-
),
|
|
430
|
+
(s, b) => b !== r
|
|
431
|
+
), Le(), G(_.getState()), j();
|
|
432
432
|
}
|
|
433
433
|
);
|
|
434
434
|
}, Ro = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
435
435
|
if (!t.tokenEndpoint)
|
|
436
436
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
437
437
|
return Io(t.tokenEndpoint);
|
|
438
|
-
}),
|
|
439
|
-
let
|
|
438
|
+
}), Mo = window.fetch.bind(window), ft = xr(t.clientId);
|
|
439
|
+
let _;
|
|
440
440
|
try {
|
|
441
441
|
const r = {
|
|
442
442
|
token: t.token,
|
|
@@ -444,7 +444,7 @@ async function ta(e = {}) {
|
|
|
444
444
|
backendUrl: t.backendUrl,
|
|
445
445
|
metadata: () => ({
|
|
446
446
|
...t.metadata ?? {},
|
|
447
|
-
...!
|
|
447
|
+
...!_.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
448
448
|
}),
|
|
449
449
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
450
450
|
clientId: ft.clientId,
|
|
@@ -455,11 +455,11 @@ async function ta(e = {}) {
|
|
|
455
455
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0,
|
|
456
456
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
457
457
|
};
|
|
458
|
-
|
|
458
|
+
_ = await Jo.init(r);
|
|
459
459
|
} catch (r) {
|
|
460
460
|
throw ft.release(), n.remove(), r;
|
|
461
461
|
}
|
|
462
|
-
m.appendChild(n),
|
|
462
|
+
m.appendChild(n), Q(
|
|
463
463
|
"web-sdk.widget",
|
|
464
464
|
"Applied initial widget appearance",
|
|
465
465
|
{
|
|
@@ -469,77 +469,77 @@ async function ta(e = {}) {
|
|
|
469
469
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
470
470
|
}
|
|
471
471
|
);
|
|
472
|
-
const wt = new Set(l.openToolGroupKeys),
|
|
472
|
+
const wt = new Set(l.openToolGroupKeys), Pe = new Set(
|
|
473
473
|
l.seenShareCandidateIds
|
|
474
|
-
),
|
|
475
|
-
let bt = l.sharePromptsDisabled || await vr(t),
|
|
474
|
+
), Je = new Set(Pe);
|
|
475
|
+
let bt = l.sharePromptsDisabled || await vr(t), X = null, Ie = !1, ge = !1, xe = {
|
|
476
476
|
enabled: !0
|
|
477
|
-
},
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
|
|
477
|
+
}, ye = 0, rn = "", he = !1, pe = !1, me = [], _t = null, Be = null;
|
|
478
|
+
const Z = (r, s) => {
|
|
479
|
+
xe = { enabled: r, reason: s };
|
|
480
|
+
}, J = () => {
|
|
481
|
+
q.hidden = !0;
|
|
482
|
+
}, zo = () => {
|
|
483
|
+
q.hidden = !1;
|
|
484
484
|
}, Oo = (r = "jump") => {
|
|
485
|
-
|
|
486
|
-
},
|
|
487
|
-
if (
|
|
485
|
+
Z(!0, r), J(), Ye(C, () => xe.enabled), ye = C.scrollTop;
|
|
486
|
+
}, ve = () => {
|
|
487
|
+
if (_e.hidden = t.loginRequired, ue.hidden = !he, _e.setAttribute("aria-expanded", String(he)), w.classList.toggle(
|
|
488
488
|
"pluno-pa-widget__history-list--center",
|
|
489
|
-
pe &&
|
|
490
|
-
),
|
|
489
|
+
pe && me.length === 0
|
|
490
|
+
), w.replaceChildren(), pe && me.length === 0) {
|
|
491
491
|
const r = document.createElement("p");
|
|
492
|
-
r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...",
|
|
492
|
+
r.className = "pluno-pa-widget__history-loading", r.textContent = "Loading...", w.appendChild(r);
|
|
493
493
|
}
|
|
494
|
-
for (const r of
|
|
494
|
+
for (const r of me) {
|
|
495
495
|
const s = document.createElement("button");
|
|
496
496
|
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
|
|
497
|
-
const
|
|
498
|
-
|
|
497
|
+
const b = document.createElement("span");
|
|
498
|
+
b.className = "pluno-pa-widget__history-item-title", b.textContent = ya(r);
|
|
499
499
|
const L = document.createElement("time");
|
|
500
500
|
L.className = "pluno-pa-widget__history-time", L.dateTime = r.lastActiveAt, L.textContent = Ca(
|
|
501
501
|
r.lastActiveAt,
|
|
502
502
|
Date.now()
|
|
503
503
|
);
|
|
504
504
|
const M = document.createElement("small");
|
|
505
|
-
M.className = "pluno-pa-widget__history-path", M.textContent = va(r), s.append(
|
|
506
|
-
|
|
507
|
-
}),
|
|
505
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = va(r), s.append(b, L, M), s.addEventListener("click", () => {
|
|
506
|
+
he = !1, Be = null, ve(), Z(!0, "newSession"), J(), _.loadSession(r.id), G(_.getState());
|
|
507
|
+
}), w.appendChild(s);
|
|
508
508
|
}
|
|
509
|
-
if (pe &&
|
|
509
|
+
if (pe && me.length > 0) {
|
|
510
510
|
const r = document.createElement("p");
|
|
511
|
-
r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...",
|
|
511
|
+
r.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", r.textContent = "Loading...", w.appendChild(r);
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
H.textContent = Be ?? (!pe && me.length === 0 ? "No recent chats for this page yet." : ""), H.hidden = H.textContent.length === 0;
|
|
514
514
|
}, ln = async (r) => {
|
|
515
515
|
if (!pe) {
|
|
516
|
-
pe = !0,
|
|
516
|
+
pe = !0, Be = null, ve();
|
|
517
517
|
try {
|
|
518
|
-
const s = await
|
|
519
|
-
|
|
518
|
+
const s = await _.listSessions({ cursor: r, limit: 20 });
|
|
519
|
+
me = r ? [...me, ...s.sessions] : s.sessions, _t = s.nextCursor;
|
|
520
520
|
} catch (s) {
|
|
521
|
-
|
|
521
|
+
Q(
|
|
522
522
|
"web-sdk.widget",
|
|
523
523
|
"Failed to load session history",
|
|
524
524
|
{
|
|
525
525
|
message: s instanceof Error ? s.message : String(s)
|
|
526
526
|
}
|
|
527
|
-
),
|
|
527
|
+
), Be = Bi;
|
|
528
528
|
} finally {
|
|
529
|
-
pe = !1,
|
|
529
|
+
pe = !1, ve();
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
}, Uo = () => {
|
|
533
|
-
!_t || pe ||
|
|
533
|
+
!_t || pe || w.scrollHeight - w.scrollTop - w.clientHeight <= 24 && ln(_t);
|
|
534
534
|
}, pn = () => {
|
|
535
|
-
|
|
535
|
+
Ie || typeof document > "u" || (Xn(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
|
|
536
536
|
}, sn = new MutationObserver(pn);
|
|
537
|
-
sn.observe(
|
|
537
|
+
sn.observe(k.documentElement, {
|
|
538
538
|
childList: !0,
|
|
539
539
|
subtree: !0
|
|
540
540
|
}), pn();
|
|
541
|
-
const
|
|
542
|
-
const s =
|
|
541
|
+
const Fe = (r = !0) => {
|
|
542
|
+
const s = ut(i, r);
|
|
543
543
|
return Xt(
|
|
544
544
|
i,
|
|
545
545
|
p ? ho(p, s) : sa(
|
|
@@ -549,37 +549,37 @@ async function ta(e = {}) {
|
|
|
549
549
|
),
|
|
550
550
|
s
|
|
551
551
|
);
|
|
552
|
-
},
|
|
553
|
-
const r = fa(o,
|
|
552
|
+
}, B = () => {
|
|
553
|
+
const r = fa(o, S, y);
|
|
554
554
|
Sr(t, {
|
|
555
555
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
556
|
-
composerValue:
|
|
556
|
+
composerValue: y.value,
|
|
557
557
|
focusedInput: r,
|
|
558
558
|
focusedInputAt: r ? Date.now() : null,
|
|
559
559
|
openToolGroupKeys: [...wt],
|
|
560
560
|
launcherPosition: d ? p : null,
|
|
561
561
|
panelSize: c,
|
|
562
|
-
seenShareCandidateIds: [...
|
|
562
|
+
seenShareCandidateIds: [...Pe].slice(
|
|
563
563
|
-oo
|
|
564
564
|
),
|
|
565
565
|
sharePromptsDisabled: bt
|
|
566
566
|
});
|
|
567
|
-
},
|
|
567
|
+
}, Qe = (r) => {
|
|
568
568
|
t.onDisplayStateChange?.(r);
|
|
569
|
-
},
|
|
569
|
+
}, He = (r, s = !0) => {
|
|
570
570
|
if (r === "shown") {
|
|
571
|
-
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") &&
|
|
571
|
+
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && We(!1), s && Qe("shown");
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
|
-
|
|
574
|
+
X !== null && (window.clearTimeout(X), X = 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, x.hidden = !0, I.hidden = !0, v.tabIndex = 0, y.value = "", Ee(
|
|
575
575
|
i,
|
|
576
|
-
|
|
576
|
+
Mt(
|
|
577
577
|
i,
|
|
578
578
|
p,
|
|
579
579
|
t.position
|
|
580
580
|
)
|
|
581
|
-
), Bn(i),
|
|
582
|
-
},
|
|
581
|
+
), Bn(i), B(), s && Qe("minimized");
|
|
582
|
+
}, Ce = (r, s = {}) => {
|
|
583
583
|
ma(r, {
|
|
584
584
|
debugVersion: Qi,
|
|
585
585
|
launcherPosition: p,
|
|
@@ -592,17 +592,17 @@ async function ta(e = {}) {
|
|
|
592
592
|
},
|
|
593
593
|
rootRect: Ot(i),
|
|
594
594
|
launcherRect: Ot(v),
|
|
595
|
-
panelRect: Ot(
|
|
595
|
+
panelRect: Ot(x),
|
|
596
596
|
viewport: Y(),
|
|
597
|
-
panelHidden:
|
|
598
|
-
closeHidden:
|
|
597
|
+
panelHidden: x.hidden,
|
|
598
|
+
closeHidden: I.hidden,
|
|
599
599
|
...s
|
|
600
600
|
});
|
|
601
|
-
},
|
|
601
|
+
}, We = (r = !0) => {
|
|
602
602
|
if (!p)
|
|
603
|
-
return
|
|
604
|
-
const s =
|
|
605
|
-
return
|
|
603
|
+
return Ee(i, null), Fe(r);
|
|
604
|
+
const s = Fe(r);
|
|
605
|
+
return Ee(i, s), Ce("Applied stored closed launcher position", {
|
|
606
606
|
visibleLauncherPosition: s
|
|
607
607
|
}), s;
|
|
608
608
|
}, xt = (r, s) => {
|
|
@@ -616,9 +616,9 @@ async function ta(e = {}) {
|
|
|
616
616
|
});
|
|
617
617
|
}, dn = () => {
|
|
618
618
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
619
|
-
|
|
619
|
+
Ee(
|
|
620
620
|
i,
|
|
621
|
-
|
|
621
|
+
Mt(
|
|
622
622
|
i,
|
|
623
623
|
p,
|
|
624
624
|
t.position
|
|
@@ -626,7 +626,7 @@ async function ta(e = {}) {
|
|
|
626
626
|
);
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
|
-
const r =
|
|
629
|
+
const r = We();
|
|
630
630
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
631
631
|
Rt(i, c);
|
|
632
632
|
const s = ze(c);
|
|
@@ -634,8 +634,8 @@ async function ta(e = {}) {
|
|
|
634
634
|
h,
|
|
635
635
|
s.width
|
|
636
636
|
);
|
|
637
|
-
const
|
|
638
|
-
u ??
|
|
637
|
+
const b = st(
|
|
638
|
+
u ?? zt(
|
|
639
639
|
i,
|
|
640
640
|
r,
|
|
641
641
|
t.position,
|
|
@@ -643,44 +643,44 @@ async function ta(e = {}) {
|
|
|
643
643
|
),
|
|
644
644
|
s
|
|
645
645
|
);
|
|
646
|
-
u && (u =
|
|
646
|
+
u && (u = b), xt(b, r), Ce(
|
|
647
647
|
"Applied open panel position after viewport resize",
|
|
648
|
-
{ openPanelPosition:
|
|
648
|
+
{ openPanelPosition: b }
|
|
649
649
|
);
|
|
650
|
-
} else p &&
|
|
650
|
+
} else p && Ce(
|
|
651
651
|
"Applied visible launcher position after viewport resize",
|
|
652
652
|
{ visibleLauncherPosition: r }
|
|
653
653
|
);
|
|
654
654
|
};
|
|
655
655
|
let cn = () => {
|
|
656
656
|
};
|
|
657
|
-
window.addEventListener("resize", dn), t.movableLauncher &&
|
|
657
|
+
window.addEventListener("resize", dn), t.movableLauncher && D ? (We(), cn = ra({
|
|
658
658
|
root: i,
|
|
659
659
|
launcher: v,
|
|
660
|
-
launcherDragHandle:
|
|
661
|
-
getPosition: () =>
|
|
660
|
+
launcherDragHandle: D,
|
|
661
|
+
getPosition: () => Fe(),
|
|
662
662
|
setPosition: (r) => {
|
|
663
|
-
const s = r,
|
|
663
|
+
const s = r, b = ut(i), L = Xt(
|
|
664
664
|
i,
|
|
665
665
|
r,
|
|
666
|
-
|
|
666
|
+
b
|
|
667
667
|
);
|
|
668
668
|
p = ca(
|
|
669
669
|
L,
|
|
670
|
-
|
|
671
|
-
),
|
|
670
|
+
b
|
|
671
|
+
), Ee(i, L), Ce("Dragging closed launcher", {
|
|
672
672
|
requestedPosition: s
|
|
673
673
|
});
|
|
674
674
|
},
|
|
675
675
|
persist: () => {
|
|
676
|
-
d = !0,
|
|
676
|
+
d = !0, B(), Ce("Persisted closed launcher drag position");
|
|
677
677
|
}
|
|
678
|
-
})) :
|
|
678
|
+
})) : Ee(i, null), Rt(i, c);
|
|
679
679
|
const Bo = () => {
|
|
680
|
-
const r = ze(c), s =
|
|
680
|
+
const r = ze(c), s = Fe();
|
|
681
681
|
return {
|
|
682
|
-
position:
|
|
683
|
-
u ??
|
|
682
|
+
position: st(
|
|
683
|
+
u ?? zt(
|
|
684
684
|
i,
|
|
685
685
|
s,
|
|
686
686
|
t.position,
|
|
@@ -691,21 +691,21 @@ async function ta(e = {}) {
|
|
|
691
691
|
size: r
|
|
692
692
|
};
|
|
693
693
|
}, Fo = (r) => {
|
|
694
|
-
c =
|
|
694
|
+
c = ht(r.size), Rt(i, c), Bt(
|
|
695
695
|
h,
|
|
696
696
|
ze(c).width
|
|
697
|
-
), u =
|
|
697
|
+
), u = st(
|
|
698
698
|
r.position,
|
|
699
699
|
ze(c)
|
|
700
700
|
);
|
|
701
|
-
const s =
|
|
701
|
+
const s = Fe();
|
|
702
702
|
xt(u, s);
|
|
703
|
-
}, Ho =
|
|
703
|
+
}, Ho = A.length > 0 ? la({
|
|
704
704
|
root: i,
|
|
705
|
-
handles:
|
|
705
|
+
handles: A,
|
|
706
706
|
getBounds: Bo,
|
|
707
707
|
setBounds: Fo,
|
|
708
|
-
persist:
|
|
708
|
+
persist: B
|
|
709
709
|
}) : () => {
|
|
710
710
|
};
|
|
711
711
|
let yt = !1;
|
|
@@ -717,67 +717,67 @@ async function ta(e = {}) {
|
|
|
717
717
|
$n(
|
|
718
718
|
t.billingStatus,
|
|
719
719
|
r,
|
|
720
|
-
|
|
720
|
+
_.getState().lastErrorCode
|
|
721
721
|
) && (t.billingStatus = r, Ht(
|
|
722
|
-
|
|
722
|
+
Oe,
|
|
723
723
|
t.billingStatus,
|
|
724
|
-
|
|
724
|
+
_.getState().lastErrorCode
|
|
725
725
|
), j());
|
|
726
726
|
} finally {
|
|
727
727
|
yt = !1;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
},
|
|
731
|
-
un(),
|
|
730
|
+
}, fe = (r = "", s = !0) => {
|
|
731
|
+
un(), $e && ($e = !1, Ct()), i.classList.contains("pluno-pa-widget--open") || (u = null), X !== null && (window.clearTimeout(X), X = null), He("shown", !1), x.hidden = !1, I.hidden = !1, Bt(
|
|
732
732
|
h,
|
|
733
733
|
ze(c).width
|
|
734
734
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
735
|
-
const
|
|
735
|
+
const b = We(), L = zt(
|
|
736
736
|
i,
|
|
737
|
-
|
|
737
|
+
b,
|
|
738
738
|
t.position,
|
|
739
739
|
c
|
|
740
740
|
);
|
|
741
|
-
if (xt(L,
|
|
741
|
+
if (xt(L, b), Ce("Opening launcher at clamped open panel position", {
|
|
742
742
|
openPanelPosition: L,
|
|
743
|
-
visibleLauncherPosition:
|
|
744
|
-
}),
|
|
745
|
-
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, r && (
|
|
743
|
+
visibleLauncherPosition: b
|
|
744
|
+
}), Z(!0, "open"), J(), !s) {
|
|
745
|
+
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, r && (y.value = r, Ke(y)), Ye(C, () => xe.enabled), ye = C.scrollTop, y.focus(), y.setSelectionRange(y.value.length, y.value.length), B(), Qe("shown"), t.onPanelOpenChange?.(!0);
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
748
|
window.requestAnimationFrame(() => {
|
|
749
|
-
i.classList.add("pluno-pa-widget--open"), r && (
|
|
750
|
-
v.hidden = !0,
|
|
749
|
+
i.classList.add("pluno-pa-widget--open"), r && (y.value = r, Ke(y)), Ye(C, () => xe.enabled), ye = C.scrollTop, y.focus(), y.setSelectionRange(y.value.length, y.value.length), B(), Qe("shown"), t.onPanelOpenChange?.(!0), X = window.setTimeout(() => {
|
|
750
|
+
v.hidden = !0, Ye(C, () => xe.enabled), ye = C.scrollTop;
|
|
751
751
|
}, 220);
|
|
752
752
|
});
|
|
753
753
|
}, Wo = () => {
|
|
754
|
-
|
|
755
|
-
|
|
754
|
+
X !== null && (window.clearTimeout(X), X = null), v.hidden = !1, p && (We(!1), Ce("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), X = window.setTimeout(() => {
|
|
755
|
+
x.hidden = !0, I.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
756
756
|
}, 220);
|
|
757
757
|
};
|
|
758
758
|
v.addEventListener("submit", (r) => {
|
|
759
|
-
r.preventDefault(),
|
|
760
|
-
}),
|
|
759
|
+
r.preventDefault(), fe(S.value), S.value = "";
|
|
760
|
+
}), D?.addEventListener("click", (r) => {
|
|
761
761
|
r.preventDefault(), r.stopPropagation();
|
|
762
762
|
}), v.addEventListener("click", (r) => {
|
|
763
|
-
r.target ===
|
|
764
|
-
}),
|
|
765
|
-
|
|
766
|
-
}),
|
|
767
|
-
if (!
|
|
763
|
+
r.target === S && !D || (fe(S.value), S.value = "");
|
|
764
|
+
}), S.addEventListener("focus", () => {
|
|
765
|
+
fe(S.value), S.value = "";
|
|
766
|
+
}), S.addEventListener("input", () => {
|
|
767
|
+
if (!S.value)
|
|
768
768
|
return;
|
|
769
|
-
const r =
|
|
770
|
-
|
|
769
|
+
const r = S.value;
|
|
770
|
+
fe(r), S.value = "";
|
|
771
771
|
});
|
|
772
|
-
let vt = null,
|
|
773
|
-
const gn = (r) => r ===
|
|
772
|
+
let vt = null, et = null, Se = null;
|
|
773
|
+
const gn = (r) => r === S || r === y, Go = (r) => {
|
|
774
774
|
if (!(r instanceof Element) || r.getRootNode() === i.getRootNode())
|
|
775
775
|
return null;
|
|
776
776
|
let s = r;
|
|
777
777
|
for (; s; ) {
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
return
|
|
778
|
+
const b = s.closest(Pn);
|
|
779
|
+
if (b)
|
|
780
|
+
return b;
|
|
781
781
|
const L = s.getRootNode();
|
|
782
782
|
s = L instanceof ShadowRoot ? L.host : null;
|
|
783
783
|
}
|
|
@@ -794,65 +794,65 @@ async function ta(e = {}) {
|
|
|
794
794
|
const s = window.getComputedStyle(r);
|
|
795
795
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
796
796
|
}, hn = (r) => {
|
|
797
|
-
|
|
798
|
-
const s =
|
|
797
|
+
Ge !== r && (Ge = r, i.classList.toggle("pluno-pa-widget--host-modal-conflict", r !== null), nt(), r !== null ? Se = window.setInterval(() => {
|
|
798
|
+
const s = Ge;
|
|
799
799
|
(!s || !$o(s)) && hn(null);
|
|
800
|
-
}, Ui) :
|
|
800
|
+
}, Ui) : Se !== null && (window.clearInterval(Se), Se = null, et = null));
|
|
801
801
|
}, qo = () => {
|
|
802
|
-
|
|
802
|
+
Se !== null && (window.clearInterval(Se), Se = null);
|
|
803
803
|
};
|
|
804
804
|
i.addEventListener("focusin", (r) => {
|
|
805
|
-
gn(r.target) && (vt = Date.now(),
|
|
805
|
+
gn(r.target) && (vt = Date.now(), B());
|
|
806
806
|
}), i.addEventListener("focusout", (r) => {
|
|
807
|
-
if (!gn(r.target) ||
|
|
807
|
+
if (!gn(r.target) || Ge !== null)
|
|
808
808
|
return;
|
|
809
809
|
const s = vt;
|
|
810
|
-
if (vt = null, s === null || Date.now() - s >
|
|
810
|
+
if (vt = null, s === null || Date.now() - s > zi)
|
|
811
811
|
return;
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
812
|
+
const b = Go(r.relatedTarget);
|
|
813
|
+
if (!b)
|
|
814
814
|
return;
|
|
815
815
|
const L = Date.now();
|
|
816
|
-
if (
|
|
817
|
-
hn(
|
|
816
|
+
if (et !== null && L - et <= Oi) {
|
|
817
|
+
hn(b);
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
|
-
|
|
820
|
+
et = L;
|
|
821
821
|
}), v.addEventListener("keydown", (r) => {
|
|
822
|
-
!i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(),
|
|
822
|
+
!i.classList.contains("pluno-pa-widget--minimized") || r.key !== "Enter" && r.key !== " " || (r.preventDefault(), fe());
|
|
823
823
|
}), g?.addEventListener("pointerdown", (r) => {
|
|
824
824
|
r.stopPropagation();
|
|
825
825
|
}), g?.addEventListener("click", (r) => {
|
|
826
|
-
r.preventDefault(), r.stopPropagation(),
|
|
827
|
-
}),
|
|
828
|
-
|
|
829
|
-
}),
|
|
826
|
+
r.preventDefault(), r.stopPropagation(), He("minimized");
|
|
827
|
+
}), I.addEventListener("click", Wo), C.addEventListener("scroll", () => {
|
|
828
|
+
C.scrollTop < ye - 1 && Z(!1, "userScroll"), ye = C.scrollTop;
|
|
829
|
+
}), q.addEventListener("click", () => {
|
|
830
830
|
Oo();
|
|
831
831
|
});
|
|
832
832
|
const mn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
833
833
|
([r]) => {
|
|
834
|
-
r?.isIntersecting && (
|
|
834
|
+
r?.isIntersecting && (Z(!0, "bottom"), J());
|
|
835
835
|
},
|
|
836
|
-
{ root:
|
|
836
|
+
{ root: C, threshold: 0 }
|
|
837
837
|
);
|
|
838
|
-
mn?.observe(
|
|
839
|
-
const
|
|
840
|
-
let
|
|
841
|
-
const
|
|
842
|
-
const r =
|
|
843
|
-
|
|
838
|
+
mn?.observe(re);
|
|
839
|
+
const tt = () => t.loginRequired || t.signupRequired;
|
|
840
|
+
let Ge = null, $e = !1;
|
|
841
|
+
const nt = () => {
|
|
842
|
+
const r = tt(), s = Ge !== null;
|
|
843
|
+
S.readOnly = r || s, y.readOnly = s, S.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : $e ? "New update" : t.launcherLabel, y.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ne.launcherLabel, R.hidden = r;
|
|
844
844
|
}, j = () => {
|
|
845
|
-
|
|
845
|
+
ee.disabled = ie(t.billingStatus) || !_.getState().isThinking && y.value.trim().length === 0 && W.length === 0, ce.disabled = tt() || ie(t.billingStatus);
|
|
846
846
|
};
|
|
847
|
-
|
|
847
|
+
nt();
|
|
848
848
|
const Ct = () => {
|
|
849
|
-
const r =
|
|
849
|
+
const r = _.getState().isThinking;
|
|
850
850
|
i.classList.toggle("pluno-pa-widget--thinking", r), i.classList.toggle(
|
|
851
851
|
"pluno-pa-widget--unread",
|
|
852
|
-
!r &&
|
|
853
|
-
),
|
|
852
|
+
!r && $e
|
|
853
|
+
), nt();
|
|
854
854
|
};
|
|
855
|
-
Ct(),
|
|
855
|
+
Ct(), R.addEventListener("submit", (r) => {
|
|
856
856
|
if (r.preventDefault(), t.loginRequired) {
|
|
857
857
|
t.onLoginClick?.();
|
|
858
858
|
return;
|
|
@@ -861,157 +861,158 @@ async function ta(e = {}) {
|
|
|
861
861
|
t.onSignupClick?.();
|
|
862
862
|
return;
|
|
863
863
|
}
|
|
864
|
-
|
|
864
|
+
ie(t.billingStatus) || (ge = !0, Z(!0, "send"), J(), W = Ut(
|
|
865
|
+
_,
|
|
865
866
|
y,
|
|
866
|
-
x,
|
|
867
867
|
W
|
|
868
|
-
),
|
|
868
|
+
), Le(), j());
|
|
869
869
|
});
|
|
870
|
-
let
|
|
870
|
+
let qe = 0;
|
|
871
871
|
const jo = () => {
|
|
872
|
-
|
|
872
|
+
qe = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
873
873
|
}, St = (r) => {
|
|
874
|
-
le !== null && window.clearTimeout(le),
|
|
875
|
-
|
|
874
|
+
le !== null && window.clearTimeout(le), P.textContent = r, P.hidden = !1, le = window.setTimeout(() => {
|
|
875
|
+
P.textContent = "", P.hidden = !0, le = null;
|
|
876
876
|
}, 3e3);
|
|
877
877
|
}, Vo = () => {
|
|
878
|
-
le !== null && (window.clearTimeout(le), le = null),
|
|
878
|
+
le !== null && (window.clearTimeout(le), le = null), P.textContent = "", P.hidden = !0;
|
|
879
879
|
}, Et = async (r) => {
|
|
880
880
|
if (r.length === 0)
|
|
881
881
|
return;
|
|
882
|
-
const s = ja(
|
|
883
|
-
W = [...W, ...s],
|
|
882
|
+
const s = ja(_, r);
|
|
883
|
+
W = [...W, ...s], Le(), Vo(), j(), G(_.getState()), i.classList.contains("pluno-pa-widget--open") || fe();
|
|
884
884
|
};
|
|
885
|
-
|
|
886
|
-
t.loginRequired ||
|
|
887
|
-
}),
|
|
888
|
-
const r = Array.from(
|
|
889
|
-
|
|
885
|
+
ce.addEventListener("click", () => {
|
|
886
|
+
t.loginRequired || ie(t.billingStatus) || U.click();
|
|
887
|
+
}), U.addEventListener("change", () => {
|
|
888
|
+
const r = Array.from(U.files ?? []);
|
|
889
|
+
U.value = "", Et(r).catch((s) => {
|
|
890
890
|
St(
|
|
891
891
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
892
|
-
),
|
|
892
|
+
), Q("web-sdk.widget", "Attachment failed", {
|
|
893
893
|
message: s instanceof Error ? s.message : String(s)
|
|
894
894
|
});
|
|
895
895
|
});
|
|
896
896
|
}), i.addEventListener("dragenter", (r) => {
|
|
897
|
-
!
|
|
897
|
+
!rt(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), qe += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
898
898
|
}), i.addEventListener("dragover", (r) => {
|
|
899
899
|
const s = r.dataTransfer;
|
|
900
|
-
!
|
|
900
|
+
!rt(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), s.dropEffect = "copy");
|
|
901
901
|
}), i.addEventListener("dragleave", (r) => {
|
|
902
|
-
|
|
902
|
+
rt(r.dataTransfer) && (r.stopPropagation(), qe = Math.max(0, qe - 1), qe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
903
903
|
}), i.addEventListener("drop", (r) => {
|
|
904
904
|
const s = r.dataTransfer;
|
|
905
|
-
!
|
|
905
|
+
!rt(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), jo(), Et(s.files).catch((b) => {
|
|
906
906
|
St(
|
|
907
|
-
|
|
908
|
-
),
|
|
909
|
-
message:
|
|
907
|
+
b instanceof Error ? b.message : "Failed to attach file"
|
|
908
|
+
), Q("web-sdk.widget", "Attachment failed", {
|
|
909
|
+
message: b instanceof Error ? b.message : String(b)
|
|
910
910
|
});
|
|
911
911
|
}));
|
|
912
912
|
}), i.addEventListener("paste", (r) => {
|
|
913
|
-
|
|
914
|
-
|
|
913
|
+
r.stopPropagation();
|
|
914
|
+
const s = r.clipboardData, b = Array.from(s?.files ?? []);
|
|
915
|
+
b.length === 0 || t.loginRequired || (r.preventDefault(), Et(b).catch((L) => {
|
|
915
916
|
St(
|
|
916
917
|
L instanceof Error ? L.message : "Failed to attach file"
|
|
917
|
-
),
|
|
918
|
+
), Q("web-sdk.widget", "Attachment failed", {
|
|
918
919
|
message: L instanceof Error ? L.message : String(L)
|
|
919
920
|
});
|
|
920
921
|
}));
|
|
921
|
-
}),
|
|
922
|
+
}), ee.addEventListener("click", () => {
|
|
922
923
|
if (t.loginRequired) {
|
|
923
924
|
t.onLoginClick?.();
|
|
924
925
|
return;
|
|
925
926
|
}
|
|
926
|
-
if (
|
|
927
|
-
|
|
927
|
+
if (_.getState().isThinking) {
|
|
928
|
+
_.stop();
|
|
928
929
|
return;
|
|
929
930
|
}
|
|
930
|
-
|
|
931
|
+
ge = !0, Z(!0, "send"), J(), W = Ut(
|
|
932
|
+
_,
|
|
931
933
|
y,
|
|
932
|
-
x,
|
|
933
934
|
W
|
|
934
|
-
),
|
|
935
|
-
}),
|
|
936
|
-
|
|
937
|
-
}),
|
|
938
|
-
|
|
939
|
-
}),
|
|
940
|
-
|
|
941
|
-
}),
|
|
935
|
+
), Le(), j(), G(_.getState());
|
|
936
|
+
}), _e.addEventListener("click", () => {
|
|
937
|
+
he = !he, Be = null, ve(), he && me.length === 0 && ln(null);
|
|
938
|
+
}), z.addEventListener("click", () => {
|
|
939
|
+
he = !1, ve();
|
|
940
|
+
}), w.addEventListener("scroll", Uo), y.addEventListener("input", () => {
|
|
941
|
+
Ke(y), B(), j(), Xo();
|
|
942
|
+
}), y.addEventListener("keydown", (r) => {
|
|
942
943
|
if (!(r.key !== "Enter" || r.shiftKey)) {
|
|
943
944
|
if (r.preventDefault(), t.loginRequired) {
|
|
944
945
|
t.onLoginClick?.();
|
|
945
946
|
return;
|
|
946
947
|
}
|
|
947
|
-
|
|
948
|
+
ge = !0, Z(!0, "send"), J(), W = Ut(
|
|
949
|
+
_,
|
|
948
950
|
y,
|
|
949
|
-
x,
|
|
950
951
|
W
|
|
951
|
-
),
|
|
952
|
+
), Le(), j(), G(_.getState());
|
|
952
953
|
}
|
|
953
954
|
}), i.addEventListener("click", (r) => {
|
|
954
|
-
(r.target instanceof Element ? r.target : null)?.closest("a[href]") &&
|
|
955
|
-
}), l.composerValue && (
|
|
956
|
-
const
|
|
957
|
-
let kt =
|
|
958
|
-
const
|
|
959
|
-
let
|
|
955
|
+
(r.target instanceof Element ? r.target : null)?.closest("a[href]") && B();
|
|
956
|
+
}), l.composerValue && (y.value = l.composerValue, Ke(y)), t.initialDisplayState === "minimized" ? He("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(y.value, !1), wa(l, i, S, y);
|
|
957
|
+
const ot = () => a;
|
|
958
|
+
let kt = _.getState().appearance !== null, it = null, je = null, Te = null, fn = _.getState().isThinking, Ae = null;
|
|
959
|
+
const Ve = t.taskNotifications;
|
|
960
|
+
let Ne = null, De = !1;
|
|
960
961
|
const wn = () => {
|
|
961
|
-
|
|
962
|
-
},
|
|
963
|
-
|
|
964
|
-
}, bn = () =>
|
|
965
|
-
if (!
|
|
962
|
+
Ne !== null && (window.clearTimeout(Ne), Ne = null);
|
|
963
|
+
}, at = () => {
|
|
964
|
+
Ue && (Ue.hidden = !0);
|
|
965
|
+
}, bn = () => _.getState().assistantDraft.trim().length > 0, Ko = async () => {
|
|
966
|
+
if (!Ve || !Ue || De || Ie || !_.getState().isThinking || bn())
|
|
966
967
|
return;
|
|
967
968
|
let r;
|
|
968
969
|
try {
|
|
969
|
-
r = await
|
|
970
|
+
r = await Ve.getState();
|
|
970
971
|
} catch {
|
|
971
972
|
return;
|
|
972
973
|
}
|
|
973
|
-
r.enabled || r.neverSuggest || !
|
|
974
|
+
r.enabled || r.neverSuggest || !_.getState().isThinking || bn() || De || Ie || (Ue.hidden = !1);
|
|
974
975
|
};
|
|
975
976
|
Ao?.addEventListener("click", () => {
|
|
976
|
-
|
|
977
|
+
De = !0, at(), Ve?.enable().catch(() => {
|
|
977
978
|
});
|
|
978
979
|
}), No?.addEventListener("click", () => {
|
|
979
|
-
|
|
980
|
+
De = !0, at();
|
|
980
981
|
}), Do?.addEventListener("click", () => {
|
|
981
|
-
|
|
982
|
+
De = !0, at(), Ve?.dismissForever().catch(() => {
|
|
982
983
|
});
|
|
983
984
|
});
|
|
984
|
-
let
|
|
985
|
+
let Re = null, _n = () => {
|
|
985
986
|
};
|
|
986
|
-
const Yo = !!t.socialPostDraftHandler, Lt = /* @__PURE__ */ new Map(), Pt = () =>
|
|
987
|
-
const r =
|
|
988
|
-
|
|
987
|
+
const Yo = !!t.socialPostDraftHandler, Lt = /* @__PURE__ */ new Map(), Pt = () => y.value.trim().length > 0 || W.length > 0, Xo = () => {
|
|
988
|
+
const r = Re !== null && Wt(_.getState(), Pt());
|
|
989
|
+
N.hidden = !r, r && Re !== null && fo(N, Re);
|
|
989
990
|
};
|
|
990
|
-
let
|
|
991
|
+
let Me = null;
|
|
991
992
|
const xn = (r = {}) => {
|
|
992
|
-
|
|
993
|
+
ge = !0, Z(!0, "newSession"), J(), he = !1, ve(), _.startNewSession(r), wt.clear(), y.value = "", W = [], Le(), Ke(y), B(), j(), y.focus(), G(_.getState());
|
|
993
994
|
}, It = (r) => {
|
|
994
995
|
if (!r) {
|
|
995
|
-
|
|
996
|
+
Me?.remove(), Me = null;
|
|
996
997
|
return;
|
|
997
998
|
}
|
|
998
|
-
|
|
999
|
+
Me || (Me = mt(
|
|
999
1000
|
"pluno-pa-widget__new-chat",
|
|
1000
1001
|
"New chat",
|
|
1001
|
-
|
|
1002
|
+
Ma(),
|
|
1002
1003
|
!1
|
|
1003
|
-
),
|
|
1004
|
+
), Me.addEventListener("click", () => xn()), Ze.insertBefore(Me, _e));
|
|
1004
1005
|
}, G = (r) => {
|
|
1005
|
-
if (
|
|
1006
|
-
|
|
1006
|
+
if (ve(), an(r.lastErrorCode) ? Ae = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ie(t.billingStatus) && (Ae = null), Ht(
|
|
1007
|
+
Oe,
|
|
1007
1008
|
t.billingStatus,
|
|
1008
|
-
|
|
1009
|
+
Ae
|
|
1009
1010
|
), t.loginRequired) {
|
|
1010
1011
|
Lt.clear(), Kn(
|
|
1011
|
-
|
|
1012
|
-
|
|
1012
|
+
C,
|
|
1013
|
+
ee,
|
|
1013
1014
|
It,
|
|
1014
|
-
|
|
1015
|
+
ot,
|
|
1015
1016
|
"Log in to use Pluno on this page.",
|
|
1016
1017
|
t.loginButtonLabel,
|
|
1017
1018
|
t.loginUrl,
|
|
@@ -1021,10 +1022,10 @@ async function ta(e = {}) {
|
|
|
1021
1022
|
}
|
|
1022
1023
|
if (t.signupRequired) {
|
|
1023
1024
|
Lt.clear(), Kn(
|
|
1024
|
-
|
|
1025
|
-
|
|
1025
|
+
C,
|
|
1026
|
+
ee,
|
|
1026
1027
|
It,
|
|
1027
|
-
|
|
1028
|
+
ot,
|
|
1028
1029
|
"Complete signup to unlock your free trial credits.",
|
|
1029
1030
|
t.signupButtonLabel,
|
|
1030
1031
|
t.signupUrl,
|
|
@@ -1032,67 +1033,70 @@ async function ta(e = {}) {
|
|
|
1032
1033
|
);
|
|
1033
1034
|
return;
|
|
1034
1035
|
}
|
|
1035
|
-
const s = _a(r),
|
|
1036
|
+
const s = _a(r), b = s !== rn;
|
|
1036
1037
|
rn = s;
|
|
1037
|
-
const L =
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1038
|
+
const L = ge || xe.enabled;
|
|
1039
|
+
ge = !1, Qa(
|
|
1040
|
+
C,
|
|
1041
|
+
re,
|
|
1042
|
+
ee,
|
|
1042
1043
|
It,
|
|
1043
|
-
|
|
1044
|
+
N,
|
|
1044
1045
|
r,
|
|
1045
|
-
|
|
1046
|
-
|
|
1046
|
+
Re,
|
|
1047
|
+
Re !== null && Wt(r, Pt()),
|
|
1047
1048
|
L,
|
|
1048
|
-
() =>
|
|
1049
|
+
() => xe.enabled,
|
|
1049
1050
|
wt,
|
|
1050
1051
|
Lt,
|
|
1051
|
-
|
|
1052
|
-
|
|
1052
|
+
B,
|
|
1053
|
+
ot,
|
|
1053
1054
|
(M) => {
|
|
1054
|
-
|
|
1055
|
+
ge = !0, Z(!0, "send"), J(), _.sendMessage(M);
|
|
1056
|
+
},
|
|
1057
|
+
() => {
|
|
1058
|
+
ge = !0, Z(!0, "send"), J(), _.retryLastMessage();
|
|
1055
1059
|
},
|
|
1056
1060
|
Yo && !bt ? {
|
|
1057
|
-
dismissedCandidateIds:
|
|
1058
|
-
draftingCandidateId:
|
|
1059
|
-
error:
|
|
1060
|
-
characterIconOptions:
|
|
1061
|
+
dismissedCandidateIds: Je,
|
|
1062
|
+
draftingCandidateId: it,
|
|
1063
|
+
error: je,
|
|
1064
|
+
characterIconOptions: ot(),
|
|
1061
1065
|
onSeen: (M) => {
|
|
1062
|
-
|
|
1066
|
+
Pe.add(M.id), B();
|
|
1063
1067
|
},
|
|
1064
1068
|
onDraft: (M) => {
|
|
1065
1069
|
Zo(M);
|
|
1066
1070
|
},
|
|
1067
1071
|
onDismiss: (M) => {
|
|
1068
|
-
|
|
1072
|
+
Pe.add(M.id), Je.add(M.id), B(), je = null, G(_.getState());
|
|
1069
1073
|
},
|
|
1070
1074
|
onDisable: (M) => {
|
|
1071
|
-
bt = !0,
|
|
1075
|
+
bt = !0, Pe.add(M.id), Je.add(M.id), B(), Cr(t, !0), je = null, G(_.getState());
|
|
1072
1076
|
}
|
|
1073
1077
|
} : void 0
|
|
1074
|
-
), L ? (
|
|
1078
|
+
), L ? (ye = C.scrollTop, J()) : b && xa(r) && zo();
|
|
1075
1079
|
};
|
|
1076
1080
|
return _n = fi(
|
|
1077
1081
|
(r) => {
|
|
1078
|
-
|
|
1082
|
+
Re = r, !Ie && Wt(_.getState(), Pt()) && G(_.getState());
|
|
1079
1083
|
},
|
|
1080
1084
|
{
|
|
1081
1085
|
backendUrl: t.backendUrl,
|
|
1082
|
-
fetcher:
|
|
1086
|
+
fetcher: Mo,
|
|
1083
1087
|
loader: t.activeUsersLoader
|
|
1084
1088
|
}
|
|
1085
|
-
),
|
|
1089
|
+
), _.on("state", (r) => {
|
|
1086
1090
|
const s = fn && !r.isThinking;
|
|
1087
|
-
fn = r.isThinking, r.isThinking && !r.assistantDraft.trim() &&
|
|
1088
|
-
|
|
1089
|
-
}, yi)), (!r.isThinking || r.assistantDraft.trim()) && (wn(),
|
|
1091
|
+
fn = r.isThinking, r.isThinking && !r.assistantDraft.trim() && Ve && !De && Ne === null && Ue?.hidden !== !1 && (Ne = window.setTimeout(() => {
|
|
1092
|
+
Ne = null, Ko();
|
|
1093
|
+
}, yi)), (!r.isThinking || r.assistantDraft.trim()) && (wn(), at()), s && !i.classList.contains("pluno-pa-widget--open") && ($e = !0), Ct(), r.appearance ? (kt = !0, Q(
|
|
1090
1094
|
"web-sdk.widget",
|
|
1091
1095
|
"Agent state supplied appearance",
|
|
1092
1096
|
{
|
|
1093
1097
|
appearance: r.appearance
|
|
1094
1098
|
}
|
|
1095
|
-
), Tt(r.appearance, "agent.state.appearance")) : kt && (kt = !1,
|
|
1099
|
+
), Tt(r.appearance, "agent.state.appearance")) : kt && (kt = !1, Q(
|
|
1096
1100
|
"web-sdk.widget",
|
|
1097
1101
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1098
1102
|
{
|
|
@@ -1101,8 +1105,8 @@ async function ta(e = {}) {
|
|
|
1101
1105
|
fallbackFontFamily: t.fontFamily
|
|
1102
1106
|
}
|
|
1103
1107
|
), Tt({}, "agent.state.appearance-cleared")), G(r), j(), s && un();
|
|
1104
|
-
}), G(
|
|
1105
|
-
agent:
|
|
1108
|
+
}), G(_.getState()), j(), {
|
|
1109
|
+
agent: _,
|
|
1106
1110
|
startNewChat: xn,
|
|
1107
1111
|
host: n,
|
|
1108
1112
|
updateAppearance: (r) => {
|
|
@@ -1113,75 +1117,75 @@ async function ta(e = {}) {
|
|
|
1113
1117
|
$n(
|
|
1114
1118
|
t.billingStatus,
|
|
1115
1119
|
s,
|
|
1116
|
-
|
|
1117
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !
|
|
1120
|
+
Ae
|
|
1121
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !ie(t.billingStatus) && (Ae = null), Ht(
|
|
1118
1122
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1119
1123
|
t.billingStatus,
|
|
1120
|
-
|
|
1124
|
+
Ae
|
|
1121
1125
|
), j());
|
|
1122
1126
|
},
|
|
1123
1127
|
updateAuthGate: (r) => {
|
|
1124
|
-
const s =
|
|
1125
|
-
t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl),
|
|
1126
|
-
|
|
1128
|
+
const s = tt();
|
|
1129
|
+
t.loginRequired = r.loginRequired === !0, t.signupRequired = r.signupRequired === !0, r.loginButtonLabel !== void 0 && (t.loginButtonLabel = r.loginButtonLabel), r.loginUrl !== void 0 && (t.loginUrl = r.loginUrl), r.signupButtonLabel !== void 0 && (t.signupButtonLabel = r.signupButtonLabel), r.signupUrl !== void 0 && (t.signupUrl = r.signupUrl), nt(), G(_.getState()), j(), s && !tt() && _.connect().catch((b) => {
|
|
1130
|
+
Q(
|
|
1127
1131
|
"web-sdk.widget",
|
|
1128
1132
|
"Failed to connect after auth gate cleared",
|
|
1129
1133
|
{
|
|
1130
|
-
message:
|
|
1134
|
+
message: b instanceof Error ? b.message : String(b)
|
|
1131
1135
|
}
|
|
1132
1136
|
);
|
|
1133
1137
|
});
|
|
1134
1138
|
},
|
|
1135
1139
|
openPanel: () => {
|
|
1136
|
-
|
|
1140
|
+
fe(y.value, !1);
|
|
1137
1141
|
},
|
|
1138
1142
|
updateDisplayState: (r) => {
|
|
1139
1143
|
if (r === "shown") {
|
|
1140
|
-
|
|
1144
|
+
He("shown", !1);
|
|
1141
1145
|
return;
|
|
1142
1146
|
}
|
|
1143
|
-
|
|
1147
|
+
He("minimized", !1);
|
|
1144
1148
|
},
|
|
1145
1149
|
destroy: () => {
|
|
1146
|
-
|
|
1150
|
+
Ie || (B(), Ie = !0, sn.disconnect(), mn?.disconnect(), qo(), window.removeEventListener("resize", dn), cn(), Ho(), le !== null && window.clearTimeout(le), wn(), _n(), Te?.remove(), _.destroy(), ft.release(), n.remove());
|
|
1147
1151
|
}
|
|
1148
1152
|
};
|
|
1149
1153
|
async function Zo(r) {
|
|
1150
|
-
if (!
|
|
1151
|
-
|
|
1154
|
+
if (!it) {
|
|
1155
|
+
it = r.id, je = null, G(_.getState());
|
|
1152
1156
|
try {
|
|
1153
1157
|
if (!t.socialPostDraftHandler)
|
|
1154
1158
|
throw new Error("Social post drafting is not available here.");
|
|
1155
1159
|
const s = await t.socialPostDraftHandler(r);
|
|
1156
1160
|
if (!s.linkedinPost || !s.xPost)
|
|
1157
1161
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1158
|
-
|
|
1162
|
+
Pe.add(r.id), Je.add(r.id), B(), Te?.remove(), Te = lr(s, {
|
|
1159
1163
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1160
1164
|
onClose: () => {
|
|
1161
|
-
|
|
1165
|
+
Te?.remove(), Te = null;
|
|
1162
1166
|
}
|
|
1163
|
-
}), i.appendChild(
|
|
1167
|
+
}), i.appendChild(Te);
|
|
1164
1168
|
} catch (s) {
|
|
1165
|
-
|
|
1169
|
+
je = s instanceof Error ? s.message : "Could not draft social post.";
|
|
1166
1170
|
} finally {
|
|
1167
|
-
|
|
1171
|
+
it = null, G(_.getState());
|
|
1168
1172
|
}
|
|
1169
1173
|
}
|
|
1170
1174
|
}
|
|
1171
1175
|
function Tt(r, s) {
|
|
1172
|
-
const
|
|
1176
|
+
const b = r.accentColor ?? t.accentColor, L = r.colorScheme ?? t.colorScheme, M = r.fontFamily ?? t.fontFamily, At = r.scribbleStyle ?? t.scribbleStyle;
|
|
1173
1177
|
a = Rn(
|
|
1174
|
-
|
|
1178
|
+
b,
|
|
1175
1179
|
At
|
|
1176
|
-
),
|
|
1177
|
-
accentColor:
|
|
1180
|
+
), Mn(i, a, {
|
|
1181
|
+
accentColor: b,
|
|
1178
1182
|
colorScheme: L,
|
|
1179
1183
|
fontFamily: M,
|
|
1180
1184
|
scribbleStyle: At
|
|
1181
|
-
}),
|
|
1185
|
+
}), Q("web-sdk.widget", "Updated widget appearance", {
|
|
1182
1186
|
source: s,
|
|
1183
1187
|
inputAppearance: r,
|
|
1184
|
-
appliedAccentColor:
|
|
1188
|
+
appliedAccentColor: b,
|
|
1185
1189
|
appliedColorScheme: L,
|
|
1186
1190
|
appliedFontFamily: M,
|
|
1187
1191
|
appliedScribbleStyle: At,
|
|
@@ -1215,7 +1219,7 @@ function ia([e, t, n]) {
|
|
|
1215
1219
|
};
|
|
1216
1220
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1217
1221
|
}
|
|
1218
|
-
function
|
|
1222
|
+
function Mn(e, t, n) {
|
|
1219
1223
|
e.classList.toggle(
|
|
1220
1224
|
"pluno-pa-widget--dark",
|
|
1221
1225
|
n.colorScheme === "dark"
|
|
@@ -1233,7 +1237,7 @@ function zn(e, t, n) {
|
|
|
1233
1237
|
);
|
|
1234
1238
|
for (const a of i)
|
|
1235
1239
|
a.replaceWith(
|
|
1236
|
-
|
|
1240
|
+
be(
|
|
1237
1241
|
Array.from(a.classList).join(" "),
|
|
1238
1242
|
t
|
|
1239
1243
|
)
|
|
@@ -1262,35 +1266,35 @@ function ra({
|
|
|
1262
1266
|
let l = null, p = null, d = null, c = !1, u = null;
|
|
1263
1267
|
const m = () => {
|
|
1264
1268
|
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1265
|
-
},
|
|
1269
|
+
}, k = (h) => {
|
|
1266
1270
|
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));
|
|
1267
1271
|
}, v = (h) => {
|
|
1268
1272
|
if (l !== h.pointerId || !p || !d)
|
|
1269
1273
|
return;
|
|
1270
1274
|
h.preventDefault();
|
|
1271
|
-
const
|
|
1272
|
-
!c && Math.hypot(
|
|
1273
|
-
},
|
|
1275
|
+
const A = h.clientX - p.x, I = h.clientY - p.y;
|
|
1276
|
+
!c && Math.hypot(A, I) < Yt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + A, y: d.y + I }));
|
|
1277
|
+
}, D = (h) => {
|
|
1274
1278
|
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, a()), m());
|
|
1275
|
-
},
|
|
1279
|
+
}, S = (h) => {
|
|
1276
1280
|
l === h.pointerId && (h.preventDefault(), m());
|
|
1277
1281
|
}, g = (h) => {
|
|
1278
1282
|
if (!u)
|
|
1279
1283
|
return;
|
|
1280
|
-
const
|
|
1284
|
+
const A = Math.hypot(
|
|
1281
1285
|
h.clientX - u.x,
|
|
1282
1286
|
h.clientY - u.y
|
|
1283
1287
|
) <= Yt;
|
|
1284
|
-
u = null,
|
|
1285
|
-
},
|
|
1288
|
+
u = null, A && (h.preventDefault(), h.stopPropagation());
|
|
1289
|
+
}, x = (h) => {
|
|
1286
1290
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1287
1291
|
return;
|
|
1288
|
-
const
|
|
1289
|
-
let
|
|
1290
|
-
h.key === "ArrowUp" ?
|
|
1292
|
+
const A = h.shiftKey ? co : so, I = o();
|
|
1293
|
+
let R = null;
|
|
1294
|
+
h.key === "ArrowUp" ? R = { x: I.x, y: I.y - A } : h.key === "ArrowDown" ? R = { x: I.x, y: I.y + A } : h.key === "ArrowLeft" ? R = { x: I.x - A, y: I.y } : h.key === "ArrowRight" && (R = { x: I.x + A, y: I.y }), R && (h.preventDefault(), h.stopPropagation(), i(R), a());
|
|
1291
1295
|
};
|
|
1292
|
-
return t.addEventListener("pointerdown",
|
|
1293
|
-
t.removeEventListener("pointerdown",
|
|
1296
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", D), t.addEventListener("pointercancel", S), t.addEventListener("click", g, !0), n.addEventListener("keydown", x), () => {
|
|
1297
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", D), t.removeEventListener("pointercancel", S), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", x);
|
|
1294
1298
|
};
|
|
1295
1299
|
}
|
|
1296
1300
|
function la({
|
|
@@ -1304,33 +1308,33 @@ function la({
|
|
|
1304
1308
|
const u = () => {
|
|
1305
1309
|
a = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1306
1310
|
}, m = (g) => {
|
|
1307
|
-
const
|
|
1308
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1309
|
-
},
|
|
1311
|
+
const x = g.currentTarget, h = x.dataset.resizeDirection;
|
|
1312
|
+
!e.classList.contains("pluno-pa-widget--open") || !zn(h) || (g.preventDefault(), g.stopPropagation(), a = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, x.setPointerCapture?.(g.pointerId));
|
|
1313
|
+
}, k = (g) => {
|
|
1310
1314
|
if (a !== g.pointerId || !l || !p || !d)
|
|
1311
1315
|
return;
|
|
1312
1316
|
g.preventDefault(), g.stopPropagation();
|
|
1313
|
-
const
|
|
1314
|
-
!c && Math.hypot(
|
|
1315
|
-
On(d, l,
|
|
1317
|
+
const x = g.clientX - p.x, h = g.clientY - p.y;
|
|
1318
|
+
!c && Math.hypot(x, h) < Yt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1319
|
+
On(d, l, x, h)
|
|
1316
1320
|
));
|
|
1317
1321
|
}, v = (g) => {
|
|
1318
1322
|
a === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1319
|
-
},
|
|
1323
|
+
}, D = (g) => {
|
|
1320
1324
|
a === g.pointerId && (g.preventDefault(), u());
|
|
1321
|
-
},
|
|
1322
|
-
const h = g.currentTarget.dataset.resizeDirection,
|
|
1323
|
-
let
|
|
1324
|
-
|
|
1325
|
+
}, S = (g) => {
|
|
1326
|
+
const h = g.currentTarget.dataset.resizeDirection, A = g.shiftKey ? co : so, I = n();
|
|
1327
|
+
let R = 0, P = 0;
|
|
1328
|
+
zn(h) && (g.key === "ArrowLeft" ? R = -A : g.key === "ArrowRight" ? R = A : g.key === "ArrowUp" ? P = -A : g.key === "ArrowDown" && (P = A), !(R === 0 && P === 0) && (g.preventDefault(), g.stopPropagation(), o(On(I, h, R, P)), i()));
|
|
1325
1329
|
};
|
|
1326
1330
|
for (const g of t)
|
|
1327
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove",
|
|
1331
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", D), g.addEventListener("keydown", S);
|
|
1328
1332
|
return () => {
|
|
1329
1333
|
for (const g of t)
|
|
1330
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove",
|
|
1334
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", D), g.removeEventListener("keydown", S);
|
|
1331
1335
|
};
|
|
1332
1336
|
}
|
|
1333
|
-
function
|
|
1337
|
+
function zn(e) {
|
|
1334
1338
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1335
1339
|
}
|
|
1336
1340
|
function On(e, t, n, o) {
|
|
@@ -1340,11 +1344,11 @@ function On(e, t, n, o) {
|
|
|
1340
1344
|
delta: n,
|
|
1341
1345
|
resizeLeading: t.endsWith("left") || t === "left",
|
|
1342
1346
|
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1343
|
-
minLeading:
|
|
1344
|
-
maxTrailing: i.width -
|
|
1347
|
+
minLeading: T,
|
|
1348
|
+
maxTrailing: i.width - T,
|
|
1345
1349
|
minLength: Math.min(
|
|
1346
1350
|
tn,
|
|
1347
|
-
i.width -
|
|
1351
|
+
i.width - T * 2
|
|
1348
1352
|
)
|
|
1349
1353
|
}), l = Un({
|
|
1350
1354
|
leading: e.position.y,
|
|
@@ -1352,11 +1356,11 @@ function On(e, t, n, o) {
|
|
|
1352
1356
|
delta: o,
|
|
1353
1357
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1354
1358
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1355
|
-
minLeading:
|
|
1356
|
-
maxTrailing: i.height -
|
|
1359
|
+
minLeading: ke,
|
|
1360
|
+
maxTrailing: i.height - T,
|
|
1357
1361
|
minLength: Math.min(
|
|
1358
1362
|
nn,
|
|
1359
|
-
i.height -
|
|
1363
|
+
i.height - ke - T
|
|
1360
1364
|
)
|
|
1361
1365
|
});
|
|
1362
1366
|
return {
|
|
@@ -1407,7 +1411,7 @@ function Un({
|
|
|
1407
1411
|
}
|
|
1408
1412
|
return { leading: e, length: t };
|
|
1409
1413
|
}
|
|
1410
|
-
function
|
|
1414
|
+
function ut(e, t = !0) {
|
|
1411
1415
|
const n = Y();
|
|
1412
1416
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1413
1417
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
@@ -1429,7 +1433,7 @@ function pa() {
|
|
|
1429
1433
|
tn,
|
|
1430
1434
|
qi
|
|
1431
1435
|
),
|
|
1432
|
-
e.width -
|
|
1436
|
+
e.width - T * 2
|
|
1433
1437
|
),
|
|
1434
1438
|
height: Math.min(
|
|
1435
1439
|
K(
|
|
@@ -1437,36 +1441,36 @@ function pa() {
|
|
|
1437
1441
|
nn,
|
|
1438
1442
|
Vi
|
|
1439
1443
|
),
|
|
1440
|
-
e.height -
|
|
1444
|
+
e.height - ke - T
|
|
1441
1445
|
)
|
|
1442
1446
|
};
|
|
1443
1447
|
}
|
|
1444
1448
|
function ze(e = null) {
|
|
1445
|
-
return e ?
|
|
1449
|
+
return e ? ht(e) : pa();
|
|
1446
1450
|
}
|
|
1447
|
-
function
|
|
1451
|
+
function ht(e) {
|
|
1448
1452
|
const t = Y();
|
|
1449
1453
|
return {
|
|
1450
1454
|
width: K(
|
|
1451
1455
|
e.width,
|
|
1452
1456
|
Math.min(
|
|
1453
1457
|
tn,
|
|
1454
|
-
t.width -
|
|
1458
|
+
t.width - T * 2
|
|
1455
1459
|
),
|
|
1456
1460
|
Math.max(
|
|
1457
|
-
|
|
1458
|
-
t.width -
|
|
1461
|
+
T,
|
|
1462
|
+
t.width - T * 2
|
|
1459
1463
|
)
|
|
1460
1464
|
),
|
|
1461
1465
|
height: K(
|
|
1462
1466
|
e.height,
|
|
1463
1467
|
Math.min(
|
|
1464
1468
|
nn,
|
|
1465
|
-
t.height -
|
|
1469
|
+
t.height - ke - T
|
|
1466
1470
|
),
|
|
1467
1471
|
Math.max(
|
|
1468
|
-
|
|
1469
|
-
t.height -
|
|
1472
|
+
T,
|
|
1473
|
+
t.height - ke - T
|
|
1470
1474
|
)
|
|
1471
1475
|
)
|
|
1472
1476
|
};
|
|
@@ -1476,7 +1480,7 @@ function Rt(e, t) {
|
|
|
1476
1480
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1477
1481
|
return;
|
|
1478
1482
|
}
|
|
1479
|
-
const n =
|
|
1483
|
+
const n = ht(t);
|
|
1480
1484
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1481
1485
|
}
|
|
1482
1486
|
function sa(e, t, n) {
|
|
@@ -1492,8 +1496,8 @@ function sa(e, t, n) {
|
|
|
1492
1496
|
y: l.height - 24 - n.height
|
|
1493
1497
|
};
|
|
1494
1498
|
}
|
|
1495
|
-
function
|
|
1496
|
-
const o =
|
|
1499
|
+
function Mt(e, t, n) {
|
|
1500
|
+
const o = ut(e, !1);
|
|
1497
1501
|
return t ? Xt(
|
|
1498
1502
|
e,
|
|
1499
1503
|
ho(t, o),
|
|
@@ -1508,14 +1512,14 @@ function da(e, t, n) {
|
|
|
1508
1512
|
};
|
|
1509
1513
|
}
|
|
1510
1514
|
function Xt(e, t, n) {
|
|
1511
|
-
const o = Y(), i =
|
|
1515
|
+
const o = Y(), i = T + ga(e);
|
|
1512
1516
|
return {
|
|
1513
1517
|
x: K(
|
|
1514
1518
|
t.x,
|
|
1515
|
-
|
|
1519
|
+
T,
|
|
1516
1520
|
Math.max(
|
|
1517
|
-
|
|
1518
|
-
o.width - n.width -
|
|
1521
|
+
T,
|
|
1522
|
+
o.width - n.width - T
|
|
1519
1523
|
)
|
|
1520
1524
|
),
|
|
1521
1525
|
y: K(
|
|
@@ -1523,7 +1527,7 @@ function Xt(e, t, n) {
|
|
|
1523
1527
|
i,
|
|
1524
1528
|
Math.max(
|
|
1525
1529
|
i,
|
|
1526
|
-
o.height - n.height -
|
|
1530
|
+
o.height - n.height - T
|
|
1527
1531
|
)
|
|
1528
1532
|
)
|
|
1529
1533
|
};
|
|
@@ -1550,35 +1554,35 @@ function ua(e, t) {
|
|
|
1550
1554
|
function ga(e) {
|
|
1551
1555
|
return e.classList.contains("pluno-pa-widget--scribble") ? Ji : Zi;
|
|
1552
1556
|
}
|
|
1553
|
-
function
|
|
1554
|
-
const i =
|
|
1557
|
+
function zt(e, t, n, o = null) {
|
|
1558
|
+
const i = ut(e), a = ze(o), l = {
|
|
1555
1559
|
x: n === "bottom-left" ? t.x : t.x + i.width - a.width,
|
|
1556
1560
|
y: t.y + i.height - a.height
|
|
1557
1561
|
};
|
|
1558
|
-
return
|
|
1562
|
+
return st(l, a);
|
|
1559
1563
|
}
|
|
1560
|
-
function
|
|
1564
|
+
function st(e, t) {
|
|
1561
1565
|
const n = Y();
|
|
1562
1566
|
return {
|
|
1563
1567
|
x: K(
|
|
1564
1568
|
e.x,
|
|
1565
|
-
|
|
1569
|
+
T,
|
|
1566
1570
|
Math.max(
|
|
1567
|
-
|
|
1568
|
-
n.width - t.width -
|
|
1571
|
+
T,
|
|
1572
|
+
n.width - t.width - T
|
|
1569
1573
|
)
|
|
1570
1574
|
),
|
|
1571
1575
|
y: K(
|
|
1572
1576
|
e.y,
|
|
1573
|
-
|
|
1577
|
+
ke,
|
|
1574
1578
|
Math.max(
|
|
1575
|
-
|
|
1576
|
-
n.height - t.height -
|
|
1579
|
+
ke,
|
|
1580
|
+
n.height - t.height - T
|
|
1577
1581
|
)
|
|
1578
1582
|
)
|
|
1579
1583
|
};
|
|
1580
1584
|
}
|
|
1581
|
-
function
|
|
1585
|
+
function Ee(e, t) {
|
|
1582
1586
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1583
1587
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1584
1588
|
return;
|
|
@@ -1593,8 +1597,8 @@ function Bn(e) {
|
|
|
1593
1597
|
}
|
|
1594
1598
|
function Y() {
|
|
1595
1599
|
return {
|
|
1596
|
-
width: window.innerWidth || document.documentElement.clientWidth || ro +
|
|
1597
|
-
height: window.innerHeight || document.documentElement.clientHeight || lo +
|
|
1600
|
+
width: window.innerWidth || document.documentElement.clientWidth || ro + T * 2,
|
|
1601
|
+
height: window.innerHeight || document.documentElement.clientHeight || lo + T * 2
|
|
1598
1602
|
};
|
|
1599
1603
|
}
|
|
1600
1604
|
function Ot(e) {
|
|
@@ -1609,7 +1613,7 @@ function Ot(e) {
|
|
|
1609
1613
|
function K(e, t, n) {
|
|
1610
1614
|
return Math.min(Math.max(e, t), n);
|
|
1611
1615
|
}
|
|
1612
|
-
function
|
|
1616
|
+
function Q(e, t, n) {
|
|
1613
1617
|
if (typeof window > "u")
|
|
1614
1618
|
return;
|
|
1615
1619
|
const o = window, i = {
|
|
@@ -1623,7 +1627,7 @@ function J(e, t, n) {
|
|
|
1623
1627
|
);
|
|
1624
1628
|
}
|
|
1625
1629
|
function ma(e, t) {
|
|
1626
|
-
|
|
1630
|
+
Q("web-sdk.widget.position", e, t);
|
|
1627
1631
|
}
|
|
1628
1632
|
function Ut(e, t, n) {
|
|
1629
1633
|
const o = t.value.trim();
|
|
@@ -1646,12 +1650,12 @@ function wa(e, t, n, o) {
|
|
|
1646
1650
|
function ba(e) {
|
|
1647
1651
|
return e;
|
|
1648
1652
|
}
|
|
1649
|
-
function
|
|
1653
|
+
function Ke(e) {
|
|
1650
1654
|
e.style.height = "0px";
|
|
1651
1655
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1652
1656
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1653
1657
|
}
|
|
1654
|
-
function
|
|
1658
|
+
function Ye(e, t = () => !0) {
|
|
1655
1659
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1656
1660
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1657
1661
|
});
|
|
@@ -1709,7 +1713,7 @@ function Sa(e, t, n, o, i) {
|
|
|
1709
1713
|
i
|
|
1710
1714
|
)
|
|
1711
1715
|
), e.appendChild(
|
|
1712
|
-
|
|
1716
|
+
mt(
|
|
1713
1717
|
"pluno-pa-widget__close",
|
|
1714
1718
|
"Close",
|
|
1715
1719
|
Ra(16),
|
|
@@ -1729,7 +1733,7 @@ function Ea(e, t, n, o) {
|
|
|
1729
1733
|
10
|
|
1730
1734
|
)
|
|
1731
1735
|
), i.appendChild(
|
|
1732
|
-
|
|
1736
|
+
be(
|
|
1733
1737
|
"pluno-pa-widget__character--launcher",
|
|
1734
1738
|
t
|
|
1735
1739
|
)
|
|
@@ -1738,7 +1742,7 @@ function Ea(e, t, n, o) {
|
|
|
1738
1742
|
a.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(a);
|
|
1739
1743
|
const l = document.createElement("input");
|
|
1740
1744
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1741
|
-
const p =
|
|
1745
|
+
const p = gt("Working...");
|
|
1742
1746
|
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1743
1747
|
const d = document.createElement("button");
|
|
1744
1748
|
d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", i.appendChild(d);
|
|
@@ -1762,27 +1766,27 @@ function ka(e) {
|
|
|
1762
1766
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1763
1767
|
const p = document.createElement("div");
|
|
1764
1768
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1765
|
-
|
|
1769
|
+
mt(
|
|
1766
1770
|
"pluno-pa-widget__history",
|
|
1767
1771
|
Zt(),
|
|
1768
|
-
|
|
1772
|
+
za(),
|
|
1769
1773
|
!0
|
|
1770
1774
|
)
|
|
1771
|
-
), n.appendChild(p), n.appendChild(Ia()), t.appendChild(n), t.appendChild(La()), t.appendChild(Pa()), t.appendChild(
|
|
1772
|
-
|
|
1773
|
-
), t.appendChild(
|
|
1774
|
-
|
|
1775
|
+
), n.appendChild(p), n.appendChild(Ia()), t.appendChild(n), t.appendChild(La()), t.appendChild(Pa()), t.appendChild(we("left", "Resize Pluno from left")), t.appendChild(
|
|
1776
|
+
we("right", "Resize Pluno from right")
|
|
1777
|
+
), t.appendChild(we("top", "Resize Pluno from top")), t.appendChild(
|
|
1778
|
+
we("bottom", "Resize Pluno from bottom")
|
|
1775
1779
|
), t.appendChild(
|
|
1776
|
-
|
|
1780
|
+
we("top-left", "Resize Pluno from top left")
|
|
1777
1781
|
), t.appendChild(
|
|
1778
|
-
|
|
1782
|
+
we("top-right", "Resize Pluno from top right")
|
|
1779
1783
|
), t.appendChild(
|
|
1780
|
-
|
|
1784
|
+
we("bottom-left", "Resize Pluno from bottom left")
|
|
1781
1785
|
), t.appendChild(
|
|
1782
|
-
|
|
1786
|
+
we("bottom-right", "Resize Pluno from bottom right")
|
|
1783
1787
|
), t;
|
|
1784
1788
|
}
|
|
1785
|
-
function
|
|
1789
|
+
function we(e, t) {
|
|
1786
1790
|
const n = document.createElement("button");
|
|
1787
1791
|
return n.type = "button", n.className = [
|
|
1788
1792
|
"pluno-pa-widget__resize-handle",
|
|
@@ -1839,7 +1843,7 @@ function Ia() {
|
|
|
1839
1843
|
t.className = "pluno-pa-widget__history-header";
|
|
1840
1844
|
const n = document.createElement("strong");
|
|
1841
1845
|
n.textContent = Zt();
|
|
1842
|
-
const o =
|
|
1846
|
+
const o = mt(
|
|
1843
1847
|
"pluno-pa-widget__history-close",
|
|
1844
1848
|
"Close recent chats",
|
|
1845
1849
|
Oa(),
|
|
@@ -1854,7 +1858,7 @@ function Ia() {
|
|
|
1854
1858
|
function Ta(e) {
|
|
1855
1859
|
const t = document.createElement("div");
|
|
1856
1860
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1857
|
-
|
|
1861
|
+
be(
|
|
1858
1862
|
"pluno-pa-widget__character--empty",
|
|
1859
1863
|
e
|
|
1860
1864
|
)
|
|
@@ -1876,7 +1880,7 @@ function fo(e, t) {
|
|
|
1876
1880
|
)
|
|
1877
1881
|
);
|
|
1878
1882
|
}
|
|
1879
|
-
function
|
|
1883
|
+
function be(e, t) {
|
|
1880
1884
|
const n = `pluno-pa-character-${Dn}`;
|
|
1881
1885
|
Dn += 1;
|
|
1882
1886
|
const o = t.scribbleStyle ? Na(t.accentColor, n) : Aa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
@@ -1951,7 +1955,7 @@ function Aa(e, t) {
|
|
|
1951
1955
|
"flood-color": n.shadow,
|
|
1952
1956
|
"flood-opacity": "0.24"
|
|
1953
1957
|
});
|
|
1954
|
-
const
|
|
1958
|
+
const k = f(a, "filter", {
|
|
1955
1959
|
id: o.innerDepth,
|
|
1956
1960
|
x: "-8%",
|
|
1957
1961
|
y: "-8%",
|
|
@@ -1959,27 +1963,27 @@ function Aa(e, t) {
|
|
|
1959
1963
|
height: "116%",
|
|
1960
1964
|
"color-interpolation-filters": "sRGB"
|
|
1961
1965
|
});
|
|
1962
|
-
f(
|
|
1966
|
+
f(k, "feGaussianBlur", {
|
|
1963
1967
|
in: "SourceAlpha",
|
|
1964
1968
|
stdDeviation: "8",
|
|
1965
1969
|
result: "blur"
|
|
1966
|
-
}), f(
|
|
1970
|
+
}), f(k, "feOffset", {
|
|
1967
1971
|
dx: "-7",
|
|
1968
1972
|
dy: "-9",
|
|
1969
1973
|
result: "topLeft"
|
|
1970
|
-
}), f(
|
|
1974
|
+
}), f(k, "feComposite", {
|
|
1971
1975
|
in: "topLeft",
|
|
1972
1976
|
in2: "SourceAlpha",
|
|
1973
1977
|
operator: "arithmetic",
|
|
1974
1978
|
k2: "-1",
|
|
1975
1979
|
k3: "1",
|
|
1976
1980
|
result: "innerShadow"
|
|
1977
|
-
}), f(
|
|
1981
|
+
}), f(k, "feColorMatrix", {
|
|
1978
1982
|
in: "innerShadow",
|
|
1979
1983
|
type: "matrix",
|
|
1980
1984
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1981
1985
|
result: "innerLight"
|
|
1982
|
-
}), f(
|
|
1986
|
+
}), f(k, "feBlend", {
|
|
1983
1987
|
in: "SourceGraphic",
|
|
1984
1988
|
in2: "innerLight",
|
|
1985
1989
|
mode: "screen"
|
|
@@ -1999,7 +2003,7 @@ function Aa(e, t) {
|
|
|
1999
2003
|
"flood-color": n.shadow,
|
|
2000
2004
|
"flood-opacity": "0.3"
|
|
2001
2005
|
});
|
|
2002
|
-
const
|
|
2006
|
+
const D = f(a, "filter", {
|
|
2003
2007
|
id: o.pupilGloss,
|
|
2004
2008
|
x: "-15%",
|
|
2005
2009
|
y: "-15%",
|
|
@@ -2007,29 +2011,29 @@ function Aa(e, t) {
|
|
|
2007
2011
|
height: "130%",
|
|
2008
2012
|
"color-interpolation-filters": "sRGB"
|
|
2009
2013
|
});
|
|
2010
|
-
f(
|
|
2014
|
+
f(D, "feDropShadow", {
|
|
2011
2015
|
dx: "0",
|
|
2012
2016
|
dy: "3",
|
|
2013
2017
|
stdDeviation: "3",
|
|
2014
2018
|
"flood-color": "#000000",
|
|
2015
2019
|
"flood-opacity": "0.22"
|
|
2016
2020
|
});
|
|
2017
|
-
const
|
|
2018
|
-
f(
|
|
2021
|
+
const S = f(a, "clipPath", { id: o.boltClip });
|
|
2022
|
+
f(S, "path", { d: dt });
|
|
2019
2023
|
const g = f(i, "g", {
|
|
2020
2024
|
filter: V(o.softDropShadow)
|
|
2021
2025
|
});
|
|
2022
2026
|
f(g, "path", {
|
|
2023
|
-
d:
|
|
2027
|
+
d: dt,
|
|
2024
2028
|
fill: V(o.boltEdge)
|
|
2025
2029
|
});
|
|
2026
|
-
const
|
|
2030
|
+
const x = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
2027
2031
|
f(g, "path", {
|
|
2028
|
-
d:
|
|
2032
|
+
d: x,
|
|
2029
2033
|
fill: V(o.boltFill),
|
|
2030
2034
|
filter: V(o.innerDepth)
|
|
2031
2035
|
}), f(g, "path", {
|
|
2032
|
-
d:
|
|
2036
|
+
d: x,
|
|
2033
2037
|
fill: V(o.boltGlow),
|
|
2034
2038
|
opacity: "0.74"
|
|
2035
2039
|
});
|
|
@@ -2059,9 +2063,9 @@ function Aa(e, t) {
|
|
|
2059
2063
|
"stroke-linecap": "round",
|
|
2060
2064
|
opacity: "0.48"
|
|
2061
2065
|
});
|
|
2062
|
-
const
|
|
2066
|
+
const A = f(i, "g", { filter: V(o.eyeShadow) });
|
|
2063
2067
|
return Fn(
|
|
2064
|
-
|
|
2068
|
+
A,
|
|
2065
2069
|
"rotate(-2 528 463)",
|
|
2066
2070
|
"528",
|
|
2067
2071
|
"463",
|
|
@@ -2071,7 +2075,7 @@ function Aa(e, t) {
|
|
|
2071
2075
|
"447",
|
|
2072
2076
|
o
|
|
2073
2077
|
), Fn(
|
|
2074
|
-
|
|
2078
|
+
A,
|
|
2075
2079
|
"rotate(2 717 462)",
|
|
2076
2080
|
"717",
|
|
2077
2081
|
"462",
|
|
@@ -2087,7 +2091,7 @@ function Na(e, t) {
|
|
|
2087
2091
|
clip: `${t}-scribbleBoltClip`,
|
|
2088
2092
|
wobble: `${t}-scribbleBoltWobble`
|
|
2089
2093
|
}, i = wo(), a = f(i, "defs"), l = f(a, "clipPath", { id: o.clip });
|
|
2090
|
-
f(l, "path", { d:
|
|
2094
|
+
f(l, "path", { d: dt });
|
|
2091
2095
|
const p = f(a, "filter", {
|
|
2092
2096
|
id: o.wobble,
|
|
2093
2097
|
x: "-10%",
|
|
@@ -2122,9 +2126,9 @@ function Na(e, t) {
|
|
|
2122
2126
|
opacity: "0.9",
|
|
2123
2127
|
transform: "rotate(-14 627 600)"
|
|
2124
2128
|
}), f(d, "path", {
|
|
2125
|
-
d:
|
|
2129
|
+
d: dt,
|
|
2126
2130
|
fill: "none",
|
|
2127
|
-
stroke:
|
|
2131
|
+
stroke: ct,
|
|
2128
2132
|
"stroke-width": "18",
|
|
2129
2133
|
"stroke-linejoin": "round"
|
|
2130
2134
|
}), Hn(
|
|
@@ -2148,7 +2152,7 @@ function Na(e, t) {
|
|
|
2148
2152
|
), i;
|
|
2149
2153
|
}
|
|
2150
2154
|
function wo() {
|
|
2151
|
-
return
|
|
2155
|
+
return E("svg", {
|
|
2152
2156
|
xmlns: po,
|
|
2153
2157
|
viewBox: "0 0 1254 1254"
|
|
2154
2158
|
});
|
|
@@ -2183,14 +2187,14 @@ function Hn(e, t, n, o, i, a, l, p) {
|
|
|
2183
2187
|
rx: "73",
|
|
2184
2188
|
ry: "80",
|
|
2185
2189
|
fill: "#ffffff",
|
|
2186
|
-
stroke:
|
|
2190
|
+
stroke: ct,
|
|
2187
2191
|
"stroke-width": "13"
|
|
2188
2192
|
}), f(d, "ellipse", {
|
|
2189
2193
|
cx: i,
|
|
2190
2194
|
cy: a,
|
|
2191
2195
|
rx: "45",
|
|
2192
2196
|
ry: "53",
|
|
2193
|
-
fill:
|
|
2197
|
+
fill: ct
|
|
2194
2198
|
}), f(d, "circle", {
|
|
2195
2199
|
cx: l,
|
|
2196
2200
|
cy: p,
|
|
@@ -2199,7 +2203,7 @@ function Hn(e, t, n, o, i, a, l, p) {
|
|
|
2199
2203
|
});
|
|
2200
2204
|
}
|
|
2201
2205
|
function f(e, t, n = {}) {
|
|
2202
|
-
const o =
|
|
2206
|
+
const o = E(t, n);
|
|
2203
2207
|
return e.appendChild(o), o;
|
|
2204
2208
|
}
|
|
2205
2209
|
function O(e, t, n, o) {
|
|
@@ -2209,18 +2213,18 @@ function O(e, t, n, o) {
|
|
|
2209
2213
|
function V(e) {
|
|
2210
2214
|
return `url(#${e})`;
|
|
2211
2215
|
}
|
|
2212
|
-
function
|
|
2216
|
+
function mt(e, t, n, o) {
|
|
2213
2217
|
const i = document.createElement("button");
|
|
2214
2218
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2215
2219
|
}
|
|
2216
2220
|
function Da() {
|
|
2217
|
-
const e =
|
|
2221
|
+
const e = E("svg", {
|
|
2218
2222
|
class: "pluno-pa-widget__scribble-defs",
|
|
2219
2223
|
"aria-hidden": "true",
|
|
2220
2224
|
focusable: "false",
|
|
2221
2225
|
width: "0",
|
|
2222
2226
|
height: "0"
|
|
2223
|
-
}), t =
|
|
2227
|
+
}), t = E("defs");
|
|
2224
2228
|
return t.appendChild(Ft("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2225
2229
|
Ft("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2226
2230
|
), t.appendChild(
|
|
@@ -2228,7 +2232,7 @@ function Da() {
|
|
|
2228
2232
|
), e.appendChild(t), e;
|
|
2229
2233
|
}
|
|
2230
2234
|
function bo(e, t) {
|
|
2231
|
-
const n =
|
|
2235
|
+
const n = E("svg", {
|
|
2232
2236
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2233
2237
|
preserveAspectRatio: "xMidYMid meet",
|
|
2234
2238
|
"aria-hidden": "true",
|
|
@@ -2259,11 +2263,11 @@ function _o(e, t) {
|
|
|
2259
2263
|
`0 0 ${n} ${Yi}`
|
|
2260
2264
|
), e.replaceChildren();
|
|
2261
2265
|
for (let o = 0; o < t; o += 1) {
|
|
2262
|
-
const i = Nn[o % Nn.length], a =
|
|
2266
|
+
const i = Nn[o % Nn.length], a = E("g", {
|
|
2263
2267
|
transform: `translate(${Vt + o * jt} 0)`
|
|
2264
2268
|
});
|
|
2265
2269
|
a.appendChild(
|
|
2266
|
-
|
|
2270
|
+
E("ellipse", {
|
|
2267
2271
|
cx: i.ellipseCx,
|
|
2268
2272
|
cy: i.ellipseCy,
|
|
2269
2273
|
rx: i.ellipseRx,
|
|
@@ -2274,7 +2278,7 @@ function _o(e, t) {
|
|
|
2274
2278
|
opacity: "0.8"
|
|
2275
2279
|
})
|
|
2276
2280
|
), a.appendChild(
|
|
2277
|
-
|
|
2281
|
+
E("path", {
|
|
2278
2282
|
d: i.path,
|
|
2279
2283
|
fill: "none",
|
|
2280
2284
|
stroke: "#2c2a1e",
|
|
@@ -2285,7 +2289,7 @@ function _o(e, t) {
|
|
|
2285
2289
|
}
|
|
2286
2290
|
}
|
|
2287
2291
|
function Ft(e, t, n) {
|
|
2288
|
-
const o =
|
|
2292
|
+
const o = E("filter", {
|
|
2289
2293
|
id: e,
|
|
2290
2294
|
x: "-8%",
|
|
2291
2295
|
y: "-8%",
|
|
@@ -2293,7 +2297,7 @@ function Ft(e, t, n) {
|
|
|
2293
2297
|
height: "116%"
|
|
2294
2298
|
});
|
|
2295
2299
|
return o.appendChild(
|
|
2296
|
-
|
|
2300
|
+
E("feTurbulence", {
|
|
2297
2301
|
type: "fractalNoise",
|
|
2298
2302
|
baseFrequency: "0.012 0.028",
|
|
2299
2303
|
numOctaves: "3",
|
|
@@ -2301,7 +2305,7 @@ function Ft(e, t, n) {
|
|
|
2301
2305
|
result: "stroke-noise"
|
|
2302
2306
|
})
|
|
2303
2307
|
), o.appendChild(
|
|
2304
|
-
|
|
2308
|
+
E("feDisplacementMap", {
|
|
2305
2309
|
in: "SourceGraphic",
|
|
2306
2310
|
in2: "stroke-noise",
|
|
2307
2311
|
scale: "3.5",
|
|
@@ -2310,7 +2314,7 @@ function Ft(e, t, n) {
|
|
|
2310
2314
|
result: "warped"
|
|
2311
2315
|
})
|
|
2312
2316
|
), o.appendChild(
|
|
2313
|
-
|
|
2317
|
+
E("feTurbulence", {
|
|
2314
2318
|
type: "fractalNoise",
|
|
2315
2319
|
baseFrequency: "0.7",
|
|
2316
2320
|
numOctaves: "1",
|
|
@@ -2318,7 +2322,7 @@ function Ft(e, t, n) {
|
|
|
2318
2322
|
result: "ink-noise"
|
|
2319
2323
|
})
|
|
2320
2324
|
), o.appendChild(
|
|
2321
|
-
|
|
2325
|
+
E("feDisplacementMap", {
|
|
2322
2326
|
in: "warped",
|
|
2323
2327
|
in2: "ink-noise",
|
|
2324
2328
|
scale: "0.9",
|
|
@@ -2328,7 +2332,7 @@ function Ft(e, t, n) {
|
|
|
2328
2332
|
), o;
|
|
2329
2333
|
}
|
|
2330
2334
|
function Ra(e) {
|
|
2331
|
-
const t =
|
|
2335
|
+
const t = ae(
|
|
2332
2336
|
"0 0 24 24",
|
|
2333
2337
|
e,
|
|
2334
2338
|
e,
|
|
@@ -2336,10 +2340,10 @@ function Ra(e) {
|
|
|
2336
2340
|
"currentColor",
|
|
2337
2341
|
"2.25"
|
|
2338
2342
|
);
|
|
2339
|
-
return t.appendChild(
|
|
2343
|
+
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2340
2344
|
}
|
|
2341
|
-
function
|
|
2342
|
-
const e =
|
|
2345
|
+
function Ma() {
|
|
2346
|
+
const e = ae(
|
|
2343
2347
|
"0 0 24 24",
|
|
2344
2348
|
17,
|
|
2345
2349
|
17,
|
|
@@ -2348,17 +2352,17 @@ function za() {
|
|
|
2348
2352
|
"2.25"
|
|
2349
2353
|
);
|
|
2350
2354
|
return e.appendChild(
|
|
2351
|
-
|
|
2355
|
+
E("path", {
|
|
2352
2356
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2353
2357
|
})
|
|
2354
2358
|
), e.appendChild(
|
|
2355
|
-
|
|
2359
|
+
E("path", {
|
|
2356
2360
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2357
2361
|
})
|
|
2358
2362
|
), e;
|
|
2359
2363
|
}
|
|
2360
|
-
function
|
|
2361
|
-
const e =
|
|
2364
|
+
function za() {
|
|
2365
|
+
const e = ae(
|
|
2362
2366
|
"0 0 24 24",
|
|
2363
2367
|
17,
|
|
2364
2368
|
17,
|
|
@@ -2366,10 +2370,10 @@ function Ma() {
|
|
|
2366
2370
|
"currentColor",
|
|
2367
2371
|
"2.25"
|
|
2368
2372
|
);
|
|
2369
|
-
return e.appendChild(
|
|
2373
|
+
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;
|
|
2370
2374
|
}
|
|
2371
2375
|
function Oa() {
|
|
2372
|
-
const e =
|
|
2376
|
+
const e = ae(
|
|
2373
2377
|
"0 0 24 24",
|
|
2374
2378
|
15,
|
|
2375
2379
|
15,
|
|
@@ -2377,10 +2381,10 @@ function Oa() {
|
|
|
2377
2381
|
"currentColor",
|
|
2378
2382
|
"2.4"
|
|
2379
2383
|
);
|
|
2380
|
-
return e.appendChild(
|
|
2384
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2381
2385
|
}
|
|
2382
2386
|
function xo() {
|
|
2383
|
-
const e =
|
|
2387
|
+
const e = ae(
|
|
2384
2388
|
"0 0 24 24",
|
|
2385
2389
|
14,
|
|
2386
2390
|
14,
|
|
@@ -2389,11 +2393,11 @@ function xo() {
|
|
|
2389
2393
|
"2.75"
|
|
2390
2394
|
);
|
|
2391
2395
|
return e.appendChild(
|
|
2392
|
-
|
|
2393
|
-
), e.appendChild(
|
|
2396
|
+
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2397
|
+
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2394
2398
|
}
|
|
2395
2399
|
function Ua() {
|
|
2396
|
-
const e =
|
|
2400
|
+
const e = ae(
|
|
2397
2401
|
"0 0 24 24",
|
|
2398
2402
|
16,
|
|
2399
2403
|
16,
|
|
@@ -2405,18 +2409,18 @@ function Ua() {
|
|
|
2405
2409
|
"class",
|
|
2406
2410
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2407
2411
|
), e.appendChild(
|
|
2408
|
-
|
|
2412
|
+
E("path", {
|
|
2409
2413
|
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"
|
|
2410
2414
|
})
|
|
2411
2415
|
), e;
|
|
2412
2416
|
}
|
|
2413
2417
|
function Ba() {
|
|
2414
|
-
const e =
|
|
2418
|
+
const e = ae("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2415
2419
|
return e.setAttribute(
|
|
2416
2420
|
"class",
|
|
2417
2421
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2418
2422
|
), e.appendChild(
|
|
2419
|
-
|
|
2423
|
+
E("path", {
|
|
2420
2424
|
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",
|
|
2421
2425
|
stroke: "currentColor",
|
|
2422
2426
|
"stroke-width": "2",
|
|
@@ -2426,9 +2430,9 @@ function Ba() {
|
|
|
2426
2430
|
), e;
|
|
2427
2431
|
}
|
|
2428
2432
|
function Fa() {
|
|
2429
|
-
const e =
|
|
2433
|
+
const e = ae("0 0 24 24", 18, 18, "currentColor");
|
|
2430
2434
|
return e.appendChild(
|
|
2431
|
-
|
|
2435
|
+
E("rect", {
|
|
2432
2436
|
x: "6",
|
|
2433
2437
|
y: "6",
|
|
2434
2438
|
width: "12",
|
|
@@ -2438,7 +2442,7 @@ function Fa() {
|
|
|
2438
2442
|
), e;
|
|
2439
2443
|
}
|
|
2440
2444
|
function Ha() {
|
|
2441
|
-
const e =
|
|
2445
|
+
const e = ae(
|
|
2442
2446
|
"0 0 24 24",
|
|
2443
2447
|
12,
|
|
2444
2448
|
12,
|
|
@@ -2446,10 +2450,10 @@ function Ha() {
|
|
|
2446
2450
|
"currentColor",
|
|
2447
2451
|
"2.4"
|
|
2448
2452
|
);
|
|
2449
|
-
return e.appendChild(
|
|
2453
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2450
2454
|
}
|
|
2451
2455
|
function Wa() {
|
|
2452
|
-
const e =
|
|
2456
|
+
const e = ae(
|
|
2453
2457
|
"0 0 24 24",
|
|
2454
2458
|
13,
|
|
2455
2459
|
13,
|
|
@@ -2458,7 +2462,7 @@ function Wa() {
|
|
|
2458
2462
|
"2.25"
|
|
2459
2463
|
);
|
|
2460
2464
|
return e.appendChild(
|
|
2461
|
-
|
|
2465
|
+
E("rect", {
|
|
2462
2466
|
width: "14",
|
|
2463
2467
|
height: "14",
|
|
2464
2468
|
x: "8",
|
|
@@ -2467,12 +2471,12 @@ function Wa() {
|
|
|
2467
2471
|
ry: "2"
|
|
2468
2472
|
})
|
|
2469
2473
|
), e.appendChild(
|
|
2470
|
-
|
|
2474
|
+
E("path", {
|
|
2471
2475
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2472
2476
|
})
|
|
2473
2477
|
), e;
|
|
2474
2478
|
}
|
|
2475
|
-
function
|
|
2479
|
+
function ae(e, t, n, o, i, a) {
|
|
2476
2480
|
const l = {
|
|
2477
2481
|
viewBox: e,
|
|
2478
2482
|
width: String(t),
|
|
@@ -2480,9 +2484,9 @@ function re(e, t, n, o, i, a) {
|
|
|
2480
2484
|
fill: o,
|
|
2481
2485
|
"aria-hidden": "true"
|
|
2482
2486
|
};
|
|
2483
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a),
|
|
2487
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), E("svg", l);
|
|
2484
2488
|
}
|
|
2485
|
-
function
|
|
2489
|
+
function E(e, t = {}) {
|
|
2486
2490
|
const n = document.createElementNS(po, e);
|
|
2487
2491
|
for (const [o, i] of Object.entries(t))
|
|
2488
2492
|
n.setAttribute(o, i);
|
|
@@ -2509,31 +2513,31 @@ function $a(e) {
|
|
|
2509
2513
|
const t = on(e), n = yo(e);
|
|
2510
2514
|
if (t === "image" && n) {
|
|
2511
2515
|
const o = document.createElement("img");
|
|
2512
|
-
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2516
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(oe(e))), o;
|
|
2513
2517
|
}
|
|
2514
2518
|
if (t === "video" && n) {
|
|
2515
2519
|
const o = document.createElement("video");
|
|
2516
|
-
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2520
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(oe(e))), o.addEventListener("stalled", () => o.replaceWith(oe(e))), o;
|
|
2517
2521
|
}
|
|
2518
|
-
return
|
|
2522
|
+
return oe(e);
|
|
2519
2523
|
}
|
|
2520
2524
|
function qa(e) {
|
|
2521
2525
|
const t = on(e), n = yo(e);
|
|
2522
2526
|
if (t === "image" && n) {
|
|
2523
2527
|
const o = document.createElement("img");
|
|
2524
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(
|
|
2528
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(oe(e, "message"))), o;
|
|
2525
2529
|
}
|
|
2526
2530
|
if (t === "pdf" && n) {
|
|
2527
2531
|
const o = document.createElement("object");
|
|
2528
|
-
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(
|
|
2532
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(oe(e, "message"))), o.appendChild(oe(e, "message")), o;
|
|
2529
2533
|
}
|
|
2530
2534
|
if (t === "video" && n) {
|
|
2531
2535
|
const o = document.createElement("video");
|
|
2532
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(
|
|
2536
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(oe(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(oe(e, "message"))), o;
|
|
2533
2537
|
}
|
|
2534
|
-
return
|
|
2538
|
+
return oe(e, "message");
|
|
2535
2539
|
}
|
|
2536
|
-
function
|
|
2540
|
+
function oe(e, t = "composer") {
|
|
2537
2541
|
if (t === "composer") {
|
|
2538
2542
|
const a = document.createElement("span");
|
|
2539
2543
|
return a.className = "pluno-pa-widget__attachment-file", a.textContent = Gn(e), a;
|
|
@@ -2564,7 +2568,7 @@ function ja(e, t) {
|
|
|
2564
2568
|
function Va(e) {
|
|
2565
2569
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2566
2570
|
}
|
|
2567
|
-
function
|
|
2571
|
+
function rt(e) {
|
|
2568
2572
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2569
2573
|
}
|
|
2570
2574
|
function Ht(e, t, n = null) {
|
|
@@ -2572,7 +2576,7 @@ function Ht(e, t, n = null) {
|
|
|
2572
2576
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2573
2577
|
return;
|
|
2574
2578
|
}
|
|
2575
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2579
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ie(t) || an(n) ? e.appendChild(
|
|
2576
2580
|
Ka(t, n)
|
|
2577
2581
|
) : vo(t) && e.appendChild(Ya(t));
|
|
2578
2582
|
}
|
|
@@ -2605,22 +2609,22 @@ function Ya(e) {
|
|
|
2605
2609
|
), t;
|
|
2606
2610
|
}
|
|
2607
2611
|
function Jt(e, t) {
|
|
2608
|
-
return e !== null && (
|
|
2612
|
+
return e !== null && (ie(e) || vo(e) || an(t));
|
|
2609
2613
|
}
|
|
2610
2614
|
function $n(e, t, n) {
|
|
2611
2615
|
return Jt(t, n) || Xa(t) ? !0 : !Jt(e, n);
|
|
2612
2616
|
}
|
|
2613
2617
|
function Xa(e) {
|
|
2614
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2618
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ie(e));
|
|
2615
2619
|
}
|
|
2616
|
-
function
|
|
2620
|
+
function ie(e) {
|
|
2617
2621
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2618
2622
|
}
|
|
2619
2623
|
function an(e) {
|
|
2620
2624
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2621
2625
|
}
|
|
2622
2626
|
function vo(e) {
|
|
2623
|
-
return !
|
|
2627
|
+
return !ie(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2624
2628
|
}
|
|
2625
2629
|
function Za(e) {
|
|
2626
2630
|
return e.creditsRemaining === null ? null : `${Ja(e.creditsRemaining)} credits left`;
|
|
@@ -2654,107 +2658,113 @@ function Wt(e, t) {
|
|
|
2654
2658
|
(o) => !So(o)
|
|
2655
2659
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2656
2660
|
}
|
|
2657
|
-
function Qa(e, t, n, o, i, a, l, p, d, c, u, m,
|
|
2658
|
-
const
|
|
2659
|
-
(
|
|
2660
|
-
),
|
|
2661
|
-
|
|
2661
|
+
function Qa(e, t, n, o, i, a, l, p, d, c, u, m, k, v, D, S, g) {
|
|
2662
|
+
const x = or(a), h = x.filter(
|
|
2663
|
+
(w) => !So(w)
|
|
2664
|
+
), A = e.scrollTop, I = [], R = /* @__PURE__ */ new Set(), P = (w) => {
|
|
2665
|
+
I.push(w);
|
|
2662
2666
|
};
|
|
2663
2667
|
ko(n, a.isThinking), i.hidden = !p, p && l !== null && fo(i, l);
|
|
2664
|
-
const
|
|
2665
|
-
if (o(
|
|
2666
|
-
const
|
|
2667
|
-
|
|
2668
|
-
const
|
|
2669
|
-
|
|
2670
|
-
const
|
|
2668
|
+
const Oe = h.length > 0 || !!a.assistantDraft || a.isThinking;
|
|
2669
|
+
if (o(Oe), h.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
|
|
2670
|
+
const w = document.createElement("div");
|
|
2671
|
+
w.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2672
|
+
const z = document.createElement("div");
|
|
2673
|
+
z.className = "pluno-pa-widget__empty-hero";
|
|
2674
|
+
const H = be(
|
|
2671
2675
|
"pluno-pa-widget__character--empty",
|
|
2672
2676
|
v()
|
|
2673
2677
|
);
|
|
2674
|
-
|
|
2678
|
+
z.appendChild(H), w.appendChild(z), w.appendChild(mo());
|
|
2675
2679
|
const q = document.createElement("div");
|
|
2676
2680
|
if (q.className = a.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", a.starterPrompts.length === 0 && !a.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), a.starterPrompts.length > 0)
|
|
2677
|
-
for (const
|
|
2678
|
-
const
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
}), q.appendChild(
|
|
2681
|
+
for (const N of a.starterPrompts) {
|
|
2682
|
+
const C = document.createElement("button");
|
|
2683
|
+
C.type = "button", C.className = "pluno-pa-widget__starter-prompt", C.textContent = `"${N}"`, C.addEventListener("click", () => {
|
|
2684
|
+
D(N);
|
|
2685
|
+
}), q.appendChild(C);
|
|
2682
2686
|
}
|
|
2683
2687
|
else if (a.starterPromptsLoading) {
|
|
2684
|
-
const
|
|
2685
|
-
|
|
2688
|
+
const N = document.createElement("button");
|
|
2689
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", N.disabled = !0, N.tabIndex = -1, N.textContent = "Generating example tasks...", q.appendChild(N);
|
|
2686
2690
|
} else
|
|
2687
|
-
for (let
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2691
|
+
for (let N = 0; N < Mi; N += 1) {
|
|
2692
|
+
const C = document.createElement("button");
|
|
2693
|
+
C.type = "button", C.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", C.disabled = !0, C.tabIndex = -1, C.textContent = "", q.appendChild(C);
|
|
2690
2694
|
}
|
|
2691
|
-
|
|
2695
|
+
w.appendChild(q), m.clear(), P(w), P(t), jn(e, I);
|
|
2692
2696
|
return;
|
|
2693
2697
|
}
|
|
2694
|
-
let
|
|
2695
|
-
const
|
|
2696
|
-
if (
|
|
2698
|
+
let $ = null, U = null, ce = [];
|
|
2699
|
+
const y = h.some(Qt), ee = () => {
|
|
2700
|
+
if (ce.length === 0)
|
|
2697
2701
|
return !1;
|
|
2698
|
-
const
|
|
2699
|
-
|
|
2702
|
+
const w = gr(
|
|
2703
|
+
ce,
|
|
2700
2704
|
u,
|
|
2701
|
-
|
|
2705
|
+
k,
|
|
2702
2706
|
v()
|
|
2703
2707
|
);
|
|
2704
|
-
return
|
|
2708
|
+
return P(w), $ = null, U = w, ce = [], !0;
|
|
2705
2709
|
};
|
|
2706
|
-
for (let
|
|
2707
|
-
const
|
|
2708
|
-
if (
|
|
2709
|
-
|
|
2710
|
+
for (let w = 0; w < h.length; w += 1) {
|
|
2711
|
+
const z = h[w];
|
|
2712
|
+
if (z.role === "tool") {
|
|
2713
|
+
ce.push(z);
|
|
2710
2714
|
continue;
|
|
2711
2715
|
}
|
|
2712
|
-
if (Qt(
|
|
2713
|
-
if (
|
|
2714
|
-
const
|
|
2715
|
-
|
|
2716
|
+
if (Qt(z)) {
|
|
2717
|
+
if (ee()) {
|
|
2718
|
+
const re = gt();
|
|
2719
|
+
P(re), $ = null, U = re;
|
|
2716
2720
|
} else {
|
|
2717
|
-
const
|
|
2718
|
-
|
|
2721
|
+
const re = Yn(v());
|
|
2722
|
+
P(re), $ = null, U = re;
|
|
2719
2723
|
}
|
|
2720
2724
|
continue;
|
|
2721
2725
|
}
|
|
2722
|
-
if (
|
|
2726
|
+
if (z.role === "system")
|
|
2723
2727
|
continue;
|
|
2724
|
-
const
|
|
2725
|
-
if (
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2728
|
+
const H = ee(), q = ur(z.content);
|
|
2729
|
+
if (z.role === "assistant" && !H) {
|
|
2730
|
+
const C = Eo(v());
|
|
2731
|
+
P(C), $ = null, U = C;
|
|
2728
2732
|
}
|
|
2729
|
-
const
|
|
2730
|
-
|
|
2733
|
+
const N = er(z, q, m, R);
|
|
2734
|
+
P(N), $ = N, U = null;
|
|
2731
2735
|
}
|
|
2732
|
-
const
|
|
2733
|
-
if (a.isThinking && !
|
|
2734
|
-
if (
|
|
2735
|
-
const
|
|
2736
|
-
|
|
2736
|
+
const Ze = ee(), _e = h[h.length - 1]?.id === "assistant-draft";
|
|
2737
|
+
if (a.isThinking && !_e && !y)
|
|
2738
|
+
if (Ze) {
|
|
2739
|
+
const w = gt();
|
|
2740
|
+
P(w), $ = null, U = w;
|
|
2737
2741
|
} else {
|
|
2738
|
-
const
|
|
2739
|
-
|
|
2742
|
+
const w = Yn(v());
|
|
2743
|
+
P(w), $ = null, U = w;
|
|
2740
2744
|
}
|
|
2741
2745
|
if (a.lastError) {
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2746
|
+
const w = document.createElement("div");
|
|
2747
|
+
w.className = "pluno-pa-widget__error";
|
|
2748
|
+
const z = document.createElement("span");
|
|
2749
|
+
if (z.textContent = a.lastError, w.appendChild(z), a.lastErrorCode === "run_recovery_exhausted" || a.lastErrorCode === "transient_model_error" || a.lastErrorCode === "run_still_active") {
|
|
2750
|
+
const H = document.createElement("button");
|
|
2751
|
+
H.type = "button", H.className = "pluno-pa-widget__error-retry", H.textContent = "Try again", H.addEventListener("click", S), w.appendChild(H);
|
|
2752
|
+
}
|
|
2753
|
+
P(w), $ = w, U = null;
|
|
2744
2754
|
}
|
|
2745
|
-
const
|
|
2746
|
-
if (
|
|
2747
|
-
const
|
|
2748
|
-
isDrafting:
|
|
2749
|
-
error:
|
|
2750
|
-
characterIconOptions:
|
|
2751
|
-
onDraft:
|
|
2752
|
-
onDismiss:
|
|
2753
|
-
onDisable:
|
|
2755
|
+
const ue = g && !a.isThinking ? ri(x) : null;
|
|
2756
|
+
if (g && ue && !g.dismissedCandidateIds.has(ue.id)) {
|
|
2757
|
+
const w = rr(ue, {
|
|
2758
|
+
isDrafting: g.draftingCandidateId === ue.id,
|
|
2759
|
+
error: g.error,
|
|
2760
|
+
characterIconOptions: g.characterIconOptions,
|
|
2761
|
+
onDraft: g.onDraft,
|
|
2762
|
+
onDismiss: g.onDismiss,
|
|
2763
|
+
onDisable: g.onDisable
|
|
2754
2764
|
});
|
|
2755
|
-
|
|
2765
|
+
P(w), g.onSeen(ue), $ = null, U = w;
|
|
2756
2766
|
}
|
|
2757
|
-
|
|
2767
|
+
$?.classList.add("pluno-pa-widget__message--bottom-reserve"), U?.classList.add("pluno-pa-widget__bottom-reserve-compact"), P(t), nr(m, R), jn(e, I), d ? Ye(e, c) : e.scrollTop = A;
|
|
2758
2768
|
}
|
|
2759
2769
|
function er(e, t, n, o) {
|
|
2760
2770
|
const i = tr(e, t), a = i ? n.get(i) : void 0;
|
|
@@ -2848,7 +2858,7 @@ function Kn(e, t, n, o, i, a, l, p) {
|
|
|
2848
2858
|
e.replaceChildren(), ko(t, !1), t.disabled = !0, n(!1);
|
|
2849
2859
|
const d = document.createElement("div");
|
|
2850
2860
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2851
|
-
const c =
|
|
2861
|
+
const c = be(
|
|
2852
2862
|
"pluno-pa-widget__character--empty",
|
|
2853
2863
|
o()
|
|
2854
2864
|
);
|
|
@@ -2881,7 +2891,7 @@ function rr(e, t) {
|
|
|
2881
2891
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2882
2892
|
const o = document.createElement("div");
|
|
2883
2893
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2884
|
-
|
|
2894
|
+
be(
|
|
2885
2895
|
"pluno-pa-widget__share-prompt-icon",
|
|
2886
2896
|
t.characterIconOptions
|
|
2887
2897
|
)
|
|
@@ -2949,27 +2959,27 @@ function lr(e, t) {
|
|
|
2949
2959
|
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2950
2960
|
const g = document.createElement("div");
|
|
2951
2961
|
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2952
|
-
const
|
|
2953
|
-
|
|
2962
|
+
const x = document.createElement("img");
|
|
2963
|
+
x.src = e.screenshotDataUrl, x.alt = "Product page with Pluno open", g.appendChild(x), d.appendChild(g);
|
|
2954
2964
|
}
|
|
2955
2965
|
o.appendChild(d), o.appendChild(p);
|
|
2956
|
-
const
|
|
2957
|
-
|
|
2966
|
+
const k = document.createElement("div");
|
|
2967
|
+
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2958
2968
|
const v = document.createElement("strong");
|
|
2959
|
-
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on",
|
|
2960
|
-
const
|
|
2961
|
-
|
|
2962
|
-
const
|
|
2963
|
-
|
|
2969
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
2970
|
+
const D = document.createElement("p");
|
|
2971
|
+
D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(D);
|
|
2972
|
+
const S = document.createElement("footer");
|
|
2973
|
+
S.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2964
2974
|
for (const g of sr(e)) {
|
|
2965
|
-
const
|
|
2966
|
-
|
|
2975
|
+
const x = document.createElement("a");
|
|
2976
|
+
x.href = g.href, x.target = "_blank", x.rel = "noopener noreferrer", x.title = g.label, x.setAttribute("aria-label", `Open ${g.label}`), x.appendChild(dr(g.id)), S.appendChild(x);
|
|
2967
2977
|
}
|
|
2968
|
-
if (
|
|
2978
|
+
if (k.appendChild(S), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2969
2979
|
const g = document.createElement("div");
|
|
2970
2980
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2971
|
-
const
|
|
2972
|
-
|
|
2981
|
+
const x = document.createElement("strong");
|
|
2982
|
+
x.className = "pluno-pa-widget__share-dialog-step-title", x.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(x);
|
|
2973
2983
|
const h = document.createElement("a");
|
|
2974
2984
|
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(cr()), g.appendChild(h), o.appendChild(g);
|
|
2975
2985
|
}
|
|
@@ -3003,34 +3013,34 @@ function sr(e) {
|
|
|
3003
3013
|
}
|
|
3004
3014
|
function dr(e) {
|
|
3005
3015
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3006
|
-
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" ? (
|
|
3016
|
+
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" ? (F(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), F(
|
|
3007
3017
|
t,
|
|
3008
3018
|
"M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"
|
|
3009
|
-
),
|
|
3019
|
+
), F(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), F(
|
|
3010
3020
|
t,
|
|
3011
3021
|
"M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"
|
|
3012
|
-
),
|
|
3022
|
+
), F(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (F(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), F(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), F(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (F(
|
|
3013
3023
|
t,
|
|
3014
3024
|
"M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"
|
|
3015
|
-
),
|
|
3025
|
+
), F(
|
|
3016
3026
|
t,
|
|
3017
3027
|
"M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1",
|
|
3018
3028
|
"0.48"
|
|
3019
|
-
),
|
|
3029
|
+
), F(
|
|
3020
3030
|
t,
|
|
3021
3031
|
"M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"
|
|
3022
|
-
),
|
|
3032
|
+
), F(
|
|
3023
3033
|
t,
|
|
3024
3034
|
"M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"
|
|
3025
3035
|
), t);
|
|
3026
3036
|
}
|
|
3027
|
-
function
|
|
3037
|
+
function F(e, t, n) {
|
|
3028
3038
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3029
3039
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3030
3040
|
}
|
|
3031
3041
|
function cr() {
|
|
3032
3042
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3033
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3043
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), F(e, "M14 5h5v5"), F(e, "M19 5l-8 8"), F(
|
|
3034
3044
|
e,
|
|
3035
3045
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3036
3046
|
), e;
|
|
@@ -3046,7 +3056,7 @@ function gr(e, t, n, o) {
|
|
|
3046
3056
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3047
3057
|
e[e.length - 1].createdAt
|
|
3048
3058
|
).toLocaleString(), i.appendChild(
|
|
3049
|
-
|
|
3059
|
+
be(
|
|
3050
3060
|
"pluno-pa-widget__character--tool-group",
|
|
3051
3061
|
o
|
|
3052
3062
|
)
|
|
@@ -3062,10 +3072,10 @@ function gr(e, t, n, o) {
|
|
|
3062
3072
|
const u = document.createElement("div");
|
|
3063
3073
|
u.className = "pluno-pa-widget__tool-lines";
|
|
3064
3074
|
for (const m of e) {
|
|
3065
|
-
const
|
|
3066
|
-
|
|
3075
|
+
const k = document.createElement("div");
|
|
3076
|
+
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(en());
|
|
3067
3077
|
const v = document.createElement("span");
|
|
3068
|
-
v.textContent = m.content || "Run tool",
|
|
3078
|
+
v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
|
|
3069
3079
|
}
|
|
3070
3080
|
a.appendChild(u);
|
|
3071
3081
|
}
|
|
@@ -3074,7 +3084,7 @@ function gr(e, t, n, o) {
|
|
|
3074
3084
|
function Eo(e) {
|
|
3075
3085
|
const t = document.createElement("article");
|
|
3076
3086
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3077
|
-
|
|
3087
|
+
be(
|
|
3078
3088
|
"pluno-pa-widget__character--tool-group",
|
|
3079
3089
|
e
|
|
3080
3090
|
)
|
|
@@ -3082,9 +3092,9 @@ function Eo(e) {
|
|
|
3082
3092
|
}
|
|
3083
3093
|
function Yn(e) {
|
|
3084
3094
|
const t = Eo(e);
|
|
3085
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3095
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(gt()), t;
|
|
3086
3096
|
}
|
|
3087
|
-
function
|
|
3097
|
+
function gt(e = "Thinking...") {
|
|
3088
3098
|
const t = document.createElement("div");
|
|
3089
3099
|
t.className = "pluno-pa-widget__status";
|
|
3090
3100
|
const n = document.createElement("span");
|
|
@@ -3126,14 +3136,14 @@ function mr(e, t) {
|
|
|
3126
3136
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3127
3137
|
if (l) {
|
|
3128
3138
|
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3129
|
-
|
|
3139
|
+
lt(c, l[2]), e.appendChild(c), o += 1;
|
|
3130
3140
|
continue;
|
|
3131
3141
|
}
|
|
3132
3142
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3133
3143
|
const c = document.createElement("ul");
|
|
3134
3144
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3135
3145
|
const u = document.createElement("li");
|
|
3136
|
-
|
|
3146
|
+
lt(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
|
|
3137
3147
|
}
|
|
3138
3148
|
e.appendChild(c);
|
|
3139
3149
|
continue;
|
|
@@ -3142,7 +3152,7 @@ function mr(e, t) {
|
|
|
3142
3152
|
const c = document.createElement("ol");
|
|
3143
3153
|
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3144
3154
|
const u = document.createElement("li");
|
|
3145
|
-
|
|
3155
|
+
lt(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
|
|
3146
3156
|
}
|
|
3147
3157
|
e.appendChild(c);
|
|
3148
3158
|
continue;
|
|
@@ -3152,11 +3162,11 @@ function mr(e, t) {
|
|
|
3152
3162
|
p.push(n[o]), o += 1;
|
|
3153
3163
|
const d = document.createElement("p");
|
|
3154
3164
|
p.forEach((c, u) => {
|
|
3155
|
-
u > 0 && d.appendChild(document.createElement("br")),
|
|
3165
|
+
u > 0 && d.appendChild(document.createElement("br")), lt(d, c);
|
|
3156
3166
|
}), e.appendChild(d);
|
|
3157
3167
|
}
|
|
3158
3168
|
}
|
|
3159
|
-
function
|
|
3169
|
+
function lt(e, t) {
|
|
3160
3170
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3161
3171
|
let o = 0;
|
|
3162
3172
|
for (const i of t.matchAll(n)) {
|
|
@@ -3250,7 +3260,7 @@ function Xn(e, t) {
|
|
|
3250
3260
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3251
3261
|
position: fixed;
|
|
3252
3262
|
z-index: 2147483645;
|
|
3253
|
-
font-family: ${
|
|
3263
|
+
font-family: ${ne.fontFamily};
|
|
3254
3264
|
font-size: 14px;
|
|
3255
3265
|
color: var(--pluno-pa-text);
|
|
3256
3266
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -4329,7 +4339,7 @@ function Xn(e, t) {
|
|
|
4329
4339
|
place-items: center;
|
|
4330
4340
|
padding: 18px;
|
|
4331
4341
|
background: rgba(24, 24, 27, 0.28);
|
|
4332
|
-
font-family: var(--pluno-pa-font, ${
|
|
4342
|
+
font-family: var(--pluno-pa-font, ${ne.fontFamily});
|
|
4333
4343
|
color: var(--pluno-pa-text);
|
|
4334
4344
|
}
|
|
4335
4345
|
.pluno-pa-widget__share-dialog {
|
|
@@ -4900,6 +4910,18 @@ function Xn(e, t) {
|
|
|
4900
4910
|
padding: 36px 4px calc(var(--pluno-pa-starter-edge-gap) - 12px);
|
|
4901
4911
|
text-align: left;
|
|
4902
4912
|
}
|
|
4913
|
+
.pluno-pa-widget__error-retry {
|
|
4914
|
+
display: block;
|
|
4915
|
+
margin-top: 6px;
|
|
4916
|
+
padding: 0;
|
|
4917
|
+
border: 0;
|
|
4918
|
+
background: transparent;
|
|
4919
|
+
color: inherit;
|
|
4920
|
+
font: inherit;
|
|
4921
|
+
font-weight: 700;
|
|
4922
|
+
text-decoration: underline;
|
|
4923
|
+
cursor: pointer;
|
|
4924
|
+
}
|
|
4903
4925
|
.pluno-pa-widget__empty-state--starter .pluno-pa-widget__empty {
|
|
4904
4926
|
color: var(--pluno-pa-text);
|
|
4905
4927
|
font-size: 24px;
|
|
@@ -5535,7 +5557,7 @@ function yr(e) {
|
|
|
5535
5557
|
(o) => typeof o == "string"
|
|
5536
5558
|
) : [],
|
|
5537
5559
|
launcherPosition: Er(n.launcherPosition) ? n.launcherPosition : null,
|
|
5538
|
-
panelSize: kr(n.panelSize) ?
|
|
5560
|
+
panelSize: kr(n.panelSize) ? ht(n.panelSize) : null,
|
|
5539
5561
|
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-oo) : [],
|
|
5540
5562
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5541
5563
|
};
|
|
@@ -5680,7 +5702,7 @@ class de extends EventTarget {
|
|
|
5680
5702
|
), this.cleanup();
|
|
5681
5703
|
}), window.dispatchEvent(
|
|
5682
5704
|
new CustomEvent(
|
|
5683
|
-
|
|
5705
|
+
pt(
|
|
5684
5706
|
Ci,
|
|
5685
5707
|
this.channelId
|
|
5686
5708
|
),
|
|
@@ -5711,7 +5733,7 @@ class de extends EventTarget {
|
|
|
5711
5733
|
);
|
|
5712
5734
|
window.dispatchEvent(
|
|
5713
5735
|
new CustomEvent(
|
|
5714
|
-
|
|
5736
|
+
pt(Si, this.channelId),
|
|
5715
5737
|
{
|
|
5716
5738
|
detail: {
|
|
5717
5739
|
socketId: this.socketId,
|
|
@@ -5724,7 +5746,7 @@ class de extends EventTarget {
|
|
|
5724
5746
|
close(t, n) {
|
|
5725
5747
|
this.readyState !== de.CLOSED && (this.readyState = de.CLOSING, window.dispatchEvent(
|
|
5726
5748
|
new CustomEvent(
|
|
5727
|
-
|
|
5749
|
+
pt(Ei, this.channelId),
|
|
5728
5750
|
{
|
|
5729
5751
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5730
5752
|
}
|
|
@@ -5732,7 +5754,7 @@ class de extends EventTarget {
|
|
|
5732
5754
|
), this.cleanup());
|
|
5733
5755
|
}
|
|
5734
5756
|
addPreviewListener(t, n) {
|
|
5735
|
-
const o =
|
|
5757
|
+
const o = pt(
|
|
5736
5758
|
t,
|
|
5737
5759
|
this.channelId
|
|
5738
5760
|
), i = (a) => {
|
|
@@ -5755,7 +5777,7 @@ function Tr() {
|
|
|
5755
5777
|
const t = crypto.randomUUID();
|
|
5756
5778
|
return window.sessionStorage.setItem(kn, t), t;
|
|
5757
5779
|
}
|
|
5758
|
-
function
|
|
5780
|
+
function pt(e, t) {
|
|
5759
5781
|
return `${e}:${t}`;
|
|
5760
5782
|
}
|
|
5761
5783
|
function Ar(e) {
|