@pluno/product-agent-web 0.1.101 → 0.1.102
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/product-agent-widget.js +219 -203
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PlunoProductAgent as wi, getProductAgentOriginAccessErrorMessage as bi } from "./product-agent-sdk.js";
|
|
2
|
-
const _i = "#7c3aed", vt = "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",
|
|
2
|
+
const _i = "#7c3aed", vt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", St = "#2c2a1e", Un = [253, 250, 241], Bn = 3.5;
|
|
3
3
|
function vo(e) {
|
|
4
|
-
const t =
|
|
4
|
+
const t = So(e);
|
|
5
5
|
if (Fn(lt(t), Un) >= Bn)
|
|
6
6
|
return t;
|
|
7
7
|
let i = lt(t);
|
|
8
|
-
const o = lt(
|
|
8
|
+
const o = lt(St);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
10
|
if (i = vi(i, o, 0.22), Fn(i, Un) >= Bn)
|
|
11
11
|
return rn(i);
|
|
@@ -20,7 +20,7 @@ function xi() {
|
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
22
|
function yi(e) {
|
|
23
|
-
const t =
|
|
23
|
+
const t = So(e), n = ln(lt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,7 +56,7 @@ function yi(e) {
|
|
|
56
56
|
shadow: se(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function So(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()}` : _i;
|
|
62
62
|
}
|
|
@@ -91,17 +91,17 @@ function vi(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function se(e, t, n) {
|
|
94
|
-
const [i, o, r] =
|
|
95
|
-
return rn(
|
|
94
|
+
const [i, o, r] = Si(lt(e));
|
|
95
|
+
return rn(Ci(i, sn(o + n), sn(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Si([e, t, n]) {
|
|
98
98
|
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), s = Math.min(i, o, r), p = (l + s) / 2;
|
|
99
99
|
if (l === s)
|
|
100
100
|
return [0, 0, p];
|
|
101
101
|
const g = l - s, c = p > 0.5 ? g / (2 - l - s) : g / (l + s);
|
|
102
102
|
return [(l === i ? (o - r) / g + (o < r ? 6 : 0) : l === o ? (r - i) / g + 2 : (i - o) / g + 4) / 6, c, p];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ci(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const i = n < 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - i;
|
|
@@ -118,11 +118,11 @@ function Kt(e, t, n) {
|
|
|
118
118
|
function sn(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const Co = "suggest_share_on_socials";
|
|
122
122
|
function Ei(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== Co)
|
|
126
126
|
continue;
|
|
127
127
|
const i = Wn(e, t, "assistant");
|
|
128
128
|
if (!i)
|
|
@@ -153,7 +153,7 @@ function Wn(e, t, n) {
|
|
|
153
153
|
async function Li(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const Pi = "https://app.pluno.ai", Ti = "/api/product-agent/embed/active-users",
|
|
156
|
+
const Pi = "https://app.pluno.ai", Ti = "/api/product-agent/embed/active-users", Ni = 1800, Ai = 15e3, Ii = 250, Ri = 1e3, Di = 3e4;
|
|
157
157
|
function zi(e, t = {}) {
|
|
158
158
|
let n = !1, i = null, o = null, r = null;
|
|
159
159
|
const l = () => {
|
|
@@ -173,9 +173,9 @@ function zi(e, t = {}) {
|
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const P = Math.min(1, (performance.now() - E) /
|
|
176
|
+
const P = Math.min(1, (performance.now() - E) / Ni);
|
|
177
177
|
i = Math.round(h + (c - h) * Bi(P)), e(i), P >= 1 && (i = c, e(c), l());
|
|
178
|
-
},
|
|
178
|
+
}, Ii);
|
|
179
179
|
}, g = async () => {
|
|
180
180
|
try {
|
|
181
181
|
const c = await Mi(t);
|
|
@@ -183,7 +183,7 @@ function zi(e, t = {}) {
|
|
|
183
183
|
return;
|
|
184
184
|
p(c.count), s(c.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
s(
|
|
186
|
+
s(Ai);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return g(), () => {
|
|
@@ -316,7 +316,7 @@ const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-conne
|
|
|
316
316
|
scribbleStyle: !0,
|
|
317
317
|
position: "bottom-right",
|
|
318
318
|
movableLauncher: !0
|
|
319
|
-
}, ha = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Yn = "pluno-pa-scribble-font", Po = 190, To = 41, Xn = 22, ma = 1, fa = 48, bn = 420, wa = 520, ba = 0.24, _n = 680, _a = 800, xa = 0.76,
|
|
319
|
+
}, ha = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Yn = "pluno-pa-scribble-font", Po = 190, To = 41, Xn = 22, ma = 1, fa = 48, bn = 420, wa = 520, ba = 0.24, _n = 680, _a = 800, xa = 0.76, A = 8, Ie = 50, No = "http://www.w3.org/2000/svg", pn = 26, dn = 8, ya = 36, cn = 16, va = 4, Zn = [
|
|
320
320
|
{
|
|
321
321
|
ellipseCx: "17.5",
|
|
322
322
|
ellipseCy: "24.5",
|
|
@@ -353,7 +353,7 @@ const Eo = 100, Yi = 1e4, Xi = 5e3, Zi = "product-agent:sdk-preview-socket-conne
|
|
|
353
353
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
354
354
|
pathStrokeWidth: "2.45"
|
|
355
355
|
}
|
|
356
|
-
],
|
|
356
|
+
], Sa = 11, Ca = 13, un = 4, Ao = 10, Io = 40, Ea = "movable-launcher-position-v2", Ro = "pluno-pa-widget-styles", Do = "data-pluno-pa-widget-styles";
|
|
357
357
|
let Jn = 0;
|
|
358
358
|
function ka(e) {
|
|
359
359
|
return (t) => new be(t, e);
|
|
@@ -447,7 +447,7 @@ async function La(e = {}) {
|
|
|
447
447
|
const l = Kr(t), s = t.layout === "floating" ? t.initialDisplayState ?? jr(t) : "shown";
|
|
448
448
|
bo(t, s);
|
|
449
449
|
let p = t.movableLauncher ? l.launcherPosition : null, g = p !== null, c = l.panelSize, h = null;
|
|
450
|
-
o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (o.classList.add("pluno-pa-widget--minimized"),
|
|
450
|
+
o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), Ae(
|
|
451
451
|
o,
|
|
452
452
|
Zt(
|
|
453
453
|
o,
|
|
@@ -466,9 +466,9 @@ async function La(e = {}) {
|
|
|
466
466
|
".pluno-pa-widget__launcher-drag-handle"
|
|
467
467
|
), u = o.querySelector(
|
|
468
468
|
".pluno-pa-widget__launcher-input"
|
|
469
|
-
),
|
|
469
|
+
), S = o.querySelector(
|
|
470
470
|
".pluno-pa-widget__launcher-minimize"
|
|
471
|
-
), m = o.querySelector(".pluno-pa-widget__panel"),
|
|
471
|
+
), m = o.querySelector(".pluno-pa-widget__panel"), I = o.querySelector(
|
|
472
472
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
473
473
|
), L = Array.from(
|
|
474
474
|
o.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
@@ -478,7 +478,7 @@ async function La(e = {}) {
|
|
|
478
478
|
".pluno-pa-widget__composer"
|
|
479
479
|
), ue = o.querySelector(
|
|
480
480
|
".pluno-pa-widget__attachment-error"
|
|
481
|
-
),
|
|
481
|
+
), Ce = o.querySelector(
|
|
482
482
|
".pluno-pa-widget__billing-status"
|
|
483
483
|
), Ve = o.querySelector(
|
|
484
484
|
".pluno-pa-widget__attachments"
|
|
@@ -516,7 +516,7 @@ async function La(e = {}) {
|
|
|
516
516
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
517
517
|
), v = o.querySelector(
|
|
518
518
|
".pluno-pa-widget__notify-suggestion-later"
|
|
519
|
-
),
|
|
519
|
+
), N = o.querySelector(
|
|
520
520
|
".pluno-pa-widget__notify-suggestion-never"
|
|
521
521
|
), ze = o.querySelector(
|
|
522
522
|
".pluno-pa-widget__tab-groups-suggestion"
|
|
@@ -525,7 +525,7 @@ async function La(e = {}) {
|
|
|
525
525
|
), Qo = o.querySelector(
|
|
526
526
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
527
527
|
);
|
|
528
|
-
if (!T || !u || !m || !R || !U || !ue || !
|
|
528
|
+
if (!T || !u || !m || !R || !U || !ue || !Ce || !Ve || !D || !Re || !f || !O || !Ee || !re || !Ke || !H || !st || !De || !le || !_ || !y || !j)
|
|
529
529
|
throw new Error("Failed to mount Pluno widget");
|
|
530
530
|
if (t.movableLauncher && !M)
|
|
531
531
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
@@ -544,15 +544,15 @@ async function La(e = {}) {
|
|
|
544
544
|
), Me(), W(b.getState()), $(), _e();
|
|
545
545
|
}
|
|
546
546
|
);
|
|
547
|
-
},
|
|
548
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
547
|
+
}, Sn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Xo(t.tokenEndpoint) : void 0);
|
|
548
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Sn && !t.webSocketFactory)
|
|
549
549
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
550
550
|
const ei = window.fetch.bind(window), Pt = Vr(t.clientId);
|
|
551
551
|
let b;
|
|
552
552
|
try {
|
|
553
553
|
const a = {
|
|
554
554
|
token: t.token,
|
|
555
|
-
tokenProvider:
|
|
555
|
+
tokenProvider: Sn,
|
|
556
556
|
backendUrl: t.backendUrl,
|
|
557
557
|
metadata: () => ({
|
|
558
558
|
...t.metadata ?? {},
|
|
@@ -587,9 +587,9 @@ async function La(e = {}) {
|
|
|
587
587
|
const Tt = new Set(l.openToolGroupKeys), Oe = new Set(
|
|
588
588
|
l.seenShareCandidateIds
|
|
589
589
|
), pt = new Set(Oe);
|
|
590
|
-
let
|
|
590
|
+
let Nt = l.sharePromptsDisabled || await Yr(t), te = null, Y = !1, dt = !(t.loginRequired || t.signupRequired), xe = !1, ke = {
|
|
591
591
|
enabled: !0
|
|
592
|
-
}, Le = 0,
|
|
592
|
+
}, Le = 0, Cn = "", V = !1, he = !1, ye = [], At = null, Ye = null;
|
|
593
593
|
const ne = (a, d) => {
|
|
594
594
|
ke = { enabled: a, reason: d };
|
|
595
595
|
}, oe = () => {
|
|
@@ -611,13 +611,13 @@ async function La(e = {}) {
|
|
|
611
611
|
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = he;
|
|
612
612
|
const x = document.createElement("span");
|
|
613
613
|
x.className = "pluno-pa-widget__history-item-title", x.textContent = Va(a);
|
|
614
|
-
const
|
|
615
|
-
|
|
614
|
+
const C = document.createElement("time");
|
|
615
|
+
C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = Ya(
|
|
616
616
|
a.lastActiveAt,
|
|
617
617
|
Date.now()
|
|
618
618
|
);
|
|
619
619
|
const z = document.createElement("small");
|
|
620
|
-
z.className = "pluno-pa-widget__history-path", z.textContent = Ka(a), d.append(x,
|
|
620
|
+
z.className = "pluno-pa-widget__history-path", z.textContent = Ka(a), d.append(x, C, z), d.addEventListener("click", () => {
|
|
621
621
|
V = !1, Ye = null, me(), ne(!0, "newSession"), oe(), b.loadSession(a.id), W(b.getState()), _e();
|
|
622
622
|
}), H.appendChild(d);
|
|
623
623
|
}
|
|
@@ -631,7 +631,7 @@ async function La(e = {}) {
|
|
|
631
631
|
he = !0, Ye = null, me();
|
|
632
632
|
try {
|
|
633
633
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
634
|
-
ye = a ? [...ye, ...d.sessions] : d.sessions,
|
|
634
|
+
ye = a ? [...ye, ...d.sessions] : d.sessions, At = d.nextCursor;
|
|
635
635
|
} catch (d) {
|
|
636
636
|
X(
|
|
637
637
|
"web-sdk.widget",
|
|
@@ -645,7 +645,7 @@ async function La(e = {}) {
|
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
}, oi = () => {
|
|
648
|
-
!
|
|
648
|
+
!At || he || H.scrollHeight - H.scrollTop - H.clientHeight <= 24 && En(At);
|
|
649
649
|
}, kn = () => {
|
|
650
650
|
Y || typeof document > "u" || (wo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || P.body?.appendChild(n)));
|
|
651
651
|
}, Ln = new MutationObserver(kn);
|
|
@@ -654,7 +654,7 @@ async function La(e = {}) {
|
|
|
654
654
|
subtree: !0
|
|
655
655
|
}), kn();
|
|
656
656
|
const Xe = (a = !0) => {
|
|
657
|
-
const d =
|
|
657
|
+
const d = Ct(o, a);
|
|
658
658
|
return gn(
|
|
659
659
|
o,
|
|
660
660
|
p ? zo(p, d) : za(
|
|
@@ -677,7 +677,7 @@ async function La(e = {}) {
|
|
|
677
677
|
seenShareCandidateIds: [...Oe].slice(
|
|
678
678
|
-Eo
|
|
679
679
|
),
|
|
680
|
-
sharePromptsDisabled:
|
|
680
|
+
sharePromptsDisabled: Nt
|
|
681
681
|
});
|
|
682
682
|
}, ct = (a) => {
|
|
683
683
|
t.onDisplayStateChange?.(a);
|
|
@@ -686,7 +686,7 @@ async function La(e = {}) {
|
|
|
686
686
|
o.classList.remove("pluno-pa-widget--minimized"), T.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && Je(!1), d && ct("shown");
|
|
687
687
|
return;
|
|
688
688
|
}
|
|
689
|
-
te !== null && (window.clearTimeout(te), te = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), T.hidden = !1, m.hidden = !0, R.hidden = !0, T.tabIndex = 0, f.value = "",
|
|
689
|
+
te !== null && (window.clearTimeout(te), te = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), T.hidden = !1, m.hidden = !0, R.hidden = !0, T.tabIndex = 0, f.value = "", Ae(
|
|
690
690
|
o,
|
|
691
691
|
Zt(
|
|
692
692
|
o,
|
|
@@ -715,12 +715,12 @@ async function La(e = {}) {
|
|
|
715
715
|
});
|
|
716
716
|
}, Je = (a = !0) => {
|
|
717
717
|
if (!p)
|
|
718
|
-
return
|
|
718
|
+
return Ae(o, null), Xe(a);
|
|
719
719
|
const d = Xe(a);
|
|
720
|
-
return
|
|
720
|
+
return Ae(o, d), Pe("Applied stored closed launcher position", {
|
|
721
721
|
visibleLauncherPosition: d
|
|
722
722
|
}), d;
|
|
723
|
-
},
|
|
723
|
+
}, It = (a, d) => {
|
|
724
724
|
if (!a || !d) {
|
|
725
725
|
io(o);
|
|
726
726
|
return;
|
|
@@ -734,7 +734,7 @@ async function La(e = {}) {
|
|
|
734
734
|
return t.layout === "page" && m.getBoundingClientRect().width || a;
|
|
735
735
|
}, Pn = () => {
|
|
736
736
|
if (o.classList.contains("pluno-pa-widget--minimized")) {
|
|
737
|
-
|
|
737
|
+
Ae(
|
|
738
738
|
o,
|
|
739
739
|
Zt(
|
|
740
740
|
o,
|
|
@@ -749,7 +749,7 @@ async function La(e = {}) {
|
|
|
749
749
|
Xt(o, c);
|
|
750
750
|
const d = at(c);
|
|
751
751
|
tn(
|
|
752
|
-
|
|
752
|
+
I,
|
|
753
753
|
Rt()
|
|
754
754
|
);
|
|
755
755
|
const x = yt(
|
|
@@ -761,7 +761,7 @@ async function La(e = {}) {
|
|
|
761
761
|
),
|
|
762
762
|
d
|
|
763
763
|
);
|
|
764
|
-
h && (h = x),
|
|
764
|
+
h && (h = x), It(x, a), Pe(
|
|
765
765
|
"Applied open panel position after viewport resize",
|
|
766
766
|
{ openPanelPosition: x }
|
|
767
767
|
);
|
|
@@ -772,28 +772,28 @@ async function La(e = {}) {
|
|
|
772
772
|
};
|
|
773
773
|
let Tn = () => {
|
|
774
774
|
};
|
|
775
|
-
window.addEventListener("resize", Pn), t.movableLauncher && M ? (Je(), Tn =
|
|
775
|
+
window.addEventListener("resize", Pn), t.movableLauncher && M ? (Je(), Tn = Ia({
|
|
776
776
|
root: o,
|
|
777
777
|
launcher: T,
|
|
778
778
|
launcherDragHandle: M,
|
|
779
779
|
getPosition: () => Xe(),
|
|
780
780
|
setPosition: (a) => {
|
|
781
|
-
const d = a, x =
|
|
781
|
+
const d = a, x = Ct(o), C = gn(
|
|
782
782
|
o,
|
|
783
783
|
a,
|
|
784
784
|
x
|
|
785
785
|
);
|
|
786
786
|
p = Oa(
|
|
787
|
-
|
|
787
|
+
C,
|
|
788
788
|
x
|
|
789
|
-
),
|
|
789
|
+
), Ae(o, C), Pe("Dragging closed launcher", {
|
|
790
790
|
requestedPosition: d
|
|
791
791
|
});
|
|
792
792
|
},
|
|
793
793
|
persist: () => {
|
|
794
794
|
g = !0, F(), Pe("Persisted closed launcher drag position");
|
|
795
795
|
}
|
|
796
|
-
})) :
|
|
796
|
+
})) : Ae(o, null), Xt(o, c);
|
|
797
797
|
const ii = () => {
|
|
798
798
|
const a = at(c), d = Xe();
|
|
799
799
|
return {
|
|
@@ -810,14 +810,14 @@ async function La(e = {}) {
|
|
|
810
810
|
};
|
|
811
811
|
}, ai = (a) => {
|
|
812
812
|
c = kt(a.size), Xt(o, c), tn(
|
|
813
|
-
|
|
813
|
+
I,
|
|
814
814
|
Rt()
|
|
815
815
|
), h = yt(
|
|
816
816
|
a.position,
|
|
817
817
|
at(c)
|
|
818
818
|
);
|
|
819
819
|
const d = Xe();
|
|
820
|
-
|
|
820
|
+
It(h, d);
|
|
821
821
|
}, ri = L.length > 0 ? Ra({
|
|
822
822
|
root: o,
|
|
823
823
|
handles: L,
|
|
@@ -827,7 +827,7 @@ async function La(e = {}) {
|
|
|
827
827
|
}) : () => {
|
|
828
828
|
};
|
|
829
829
|
let Dt = !1;
|
|
830
|
-
const
|
|
830
|
+
const Nn = async () => {
|
|
831
831
|
if (!(!t.billingStatusLoader || Dt)) {
|
|
832
832
|
Dt = !0;
|
|
833
833
|
try {
|
|
@@ -839,7 +839,7 @@ async function La(e = {}) {
|
|
|
839
839
|
a,
|
|
840
840
|
b.getState().lastErrorCode
|
|
841
841
|
) && (t.billingStatus = a, on(
|
|
842
|
-
|
|
842
|
+
Ce,
|
|
843
843
|
t.billingStatus,
|
|
844
844
|
b.getState().lastErrorCode
|
|
845
845
|
), $());
|
|
@@ -854,18 +854,18 @@ async function La(e = {}) {
|
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
856
|
}, fe = (a = "", d = !0) => {
|
|
857
|
-
|
|
858
|
-
|
|
857
|
+
Nn(), et && (et = !1, Ot()), o.classList.contains("pluno-pa-widget--open") || (h = null), te !== null && (window.clearTimeout(te), te = null), Ze("shown", !1), m.hidden = !1, R.hidden = !1, tn(
|
|
858
|
+
I,
|
|
859
859
|
Rt()
|
|
860
860
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
861
|
-
const x = Je(),
|
|
861
|
+
const x = Je(), C = Jt(
|
|
862
862
|
o,
|
|
863
863
|
x,
|
|
864
864
|
t.position,
|
|
865
865
|
c
|
|
866
866
|
);
|
|
867
|
-
if (
|
|
868
|
-
openPanelPosition:
|
|
867
|
+
if (It(C, x), Pe("Opening launcher at clamped open panel position", {
|
|
868
|
+
openPanelPosition: C,
|
|
869
869
|
visibleLauncherPosition: x
|
|
870
870
|
}), ne(!0, "open"), oe(), !d) {
|
|
871
871
|
o.classList.add("pluno-pa-widget--open"), T.hidden = !0, a && (f.value = a, it(f)), rt(y, () => ke.enabled), Le = y.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), ct("shown"), t.onPanelOpenChange?.(!0);
|
|
@@ -896,7 +896,7 @@ async function La(e = {}) {
|
|
|
896
896
|
fe(a), u.value = "";
|
|
897
897
|
});
|
|
898
898
|
let Mt = null, ut = null, Te = null;
|
|
899
|
-
const
|
|
899
|
+
const An = (a) => a === u || a === f, li = (a) => {
|
|
900
900
|
if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
|
|
901
901
|
return null;
|
|
902
902
|
let d = a;
|
|
@@ -904,8 +904,8 @@ async function La(e = {}) {
|
|
|
904
904
|
const x = d.closest(Vn);
|
|
905
905
|
if (x)
|
|
906
906
|
return x;
|
|
907
|
-
const
|
|
908
|
-
d =
|
|
907
|
+
const C = d.getRootNode();
|
|
908
|
+
d = C instanceof ShadowRoot ? C.host : null;
|
|
909
909
|
}
|
|
910
910
|
return null;
|
|
911
911
|
}, si = (a) => {
|
|
@@ -919,18 +919,18 @@ async function La(e = {}) {
|
|
|
919
919
|
return a.checkVisibility();
|
|
920
920
|
const d = window.getComputedStyle(a);
|
|
921
921
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
922
|
-
},
|
|
923
|
-
Ue !== a && (Ue = a, o.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null),
|
|
922
|
+
}, In = (a) => {
|
|
923
|
+
Ue !== a && (Ue = a, o.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ne(), a !== null ? Te = window.setInterval(() => {
|
|
924
924
|
const d = Ue;
|
|
925
|
-
(!d || !si(d)) &&
|
|
925
|
+
(!d || !si(d)) && In(null);
|
|
926
926
|
}, ua) : Te !== null && (window.clearInterval(Te), Te = null, ut = null));
|
|
927
927
|
}, pi = () => {
|
|
928
928
|
Te !== null && (window.clearInterval(Te), Te = null);
|
|
929
929
|
};
|
|
930
930
|
o.addEventListener("focusin", (a) => {
|
|
931
|
-
|
|
931
|
+
An(a.target) && (Mt = Date.now(), F());
|
|
932
932
|
}), o.addEventListener("focusout", (a) => {
|
|
933
|
-
if (!
|
|
933
|
+
if (!An(a.target) || Ue !== null)
|
|
934
934
|
return;
|
|
935
935
|
const d = Mt;
|
|
936
936
|
if (Mt = null, d === null || Date.now() - d > da)
|
|
@@ -938,17 +938,17 @@ async function La(e = {}) {
|
|
|
938
938
|
const x = li(a.relatedTarget);
|
|
939
939
|
if (!x)
|
|
940
940
|
return;
|
|
941
|
-
const
|
|
942
|
-
if (ut !== null &&
|
|
943
|
-
|
|
941
|
+
const C = Date.now();
|
|
942
|
+
if (ut !== null && C - ut <= ca) {
|
|
943
|
+
In(x);
|
|
944
944
|
return;
|
|
945
945
|
}
|
|
946
|
-
ut =
|
|
946
|
+
ut = C;
|
|
947
947
|
}), T.addEventListener("keydown", (a) => {
|
|
948
948
|
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), fe());
|
|
949
|
-
}),
|
|
949
|
+
}), S?.addEventListener("pointerdown", (a) => {
|
|
950
950
|
a.stopPropagation();
|
|
951
|
-
}),
|
|
951
|
+
}), S?.addEventListener("click", (a) => {
|
|
952
952
|
a.preventDefault(), a.stopPropagation(), Ze("minimized");
|
|
953
953
|
}), R.addEventListener("click", zt), y.addEventListener("scroll", () => {
|
|
954
954
|
y.scrollTop < Le - 1 && ne(!1, "userScroll"), Le = y.scrollTop;
|
|
@@ -964,28 +964,28 @@ async function La(e = {}) {
|
|
|
964
964
|
Rn?.observe(j);
|
|
965
965
|
const Qe = () => t.loginRequired || t.signupRequired;
|
|
966
966
|
let Ue = null, et = !1;
|
|
967
|
-
const ie = () => dt || b.getState().status !== "connected",
|
|
967
|
+
const ie = () => dt || b.getState().status !== "connected", Ne = () => {
|
|
968
968
|
const a = Qe(), d = Ue !== null;
|
|
969
969
|
u.readOnly = !1, f.readOnly = !1, u.placeholder = d ? Kn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : et ? "New update" : t.launcherLabel, f.placeholder = d ? Kn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : pe.launcherLabel, U.hidden = a;
|
|
970
970
|
}, $ = () => {
|
|
971
971
|
O.disabled = ie() || ae(t.billingStatus) || !b.getState().isThinking && f.value.trim().length === 0 && G.length === 0, Re.disabled = Qe() || ie() || ae(t.billingStatus);
|
|
972
972
|
};
|
|
973
|
-
|
|
973
|
+
Ne();
|
|
974
974
|
const Ot = () => {
|
|
975
975
|
const a = b.getState().isThinking;
|
|
976
976
|
o.classList.toggle("pluno-pa-widget--thinking", a), o.classList.toggle(
|
|
977
977
|
"pluno-pa-widget--unread",
|
|
978
978
|
!a && et
|
|
979
|
-
),
|
|
979
|
+
), Ne();
|
|
980
980
|
};
|
|
981
981
|
Ot();
|
|
982
982
|
const Ut = () => {
|
|
983
|
-
Qe() || Y || (dt = !0,
|
|
983
|
+
Qe() || Y || (dt = !0, Ne(), $(), b.connect().then(
|
|
984
984
|
() => {
|
|
985
|
-
Y || (dt = !1,
|
|
985
|
+
Y || (dt = !1, Ne(), $());
|
|
986
986
|
},
|
|
987
987
|
(a) => {
|
|
988
|
-
Y || (dt = !1,
|
|
988
|
+
Y || (dt = !1, Ne(), $(), X(
|
|
989
989
|
"web-sdk.widget",
|
|
990
990
|
"Failed to connect Product Agent widget",
|
|
991
991
|
{
|
|
@@ -1062,11 +1062,11 @@ async function La(e = {}) {
|
|
|
1062
1062
|
}), o.addEventListener("paste", (a) => {
|
|
1063
1063
|
a.stopPropagation();
|
|
1064
1064
|
const d = a.clipboardData, x = Array.from(d?.files ?? []);
|
|
1065
|
-
!t.attachmentsEnabled || x.length === 0 || t.loginRequired || ie() || (a.preventDefault(), Ft(x).catch((
|
|
1065
|
+
!t.attachmentsEnabled || x.length === 0 || t.loginRequired || ie() || (a.preventDefault(), Ft(x).catch((C) => {
|
|
1066
1066
|
Bt(
|
|
1067
|
-
|
|
1067
|
+
C instanceof Error ? C.message : "Failed to attach file"
|
|
1068
1068
|
), X("web-sdk.widget", "Attachment failed", {
|
|
1069
|
-
message:
|
|
1069
|
+
message: C instanceof Error ? C.message : String(C)
|
|
1070
1070
|
});
|
|
1071
1071
|
}));
|
|
1072
1072
|
}), O.addEventListener("click", () => {
|
|
@@ -1109,13 +1109,29 @@ async function La(e = {}) {
|
|
|
1109
1109
|
}), o.addEventListener("click", (a) => {
|
|
1110
1110
|
const d = a.target instanceof Element ? a.target : null;
|
|
1111
1111
|
d?.closest("a[href]") && F(), V && Gi(d, Ke, re) && (V = !1, me());
|
|
1112
|
-
const
|
|
1112
|
+
const C = window.getSelection(), z = !!(C && !C.isCollapsed && C.anchorNode && o.contains(C.anchorNode));
|
|
1113
1113
|
Wi(
|
|
1114
1114
|
a.target,
|
|
1115
1115
|
a.detail,
|
|
1116
1116
|
z
|
|
1117
1117
|
) && _e();
|
|
1118
|
-
}), o.addEventListener("
|
|
1118
|
+
}), o.addEventListener("copy", (a) => {
|
|
1119
|
+
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
1120
|
+
"text/plain",
|
|
1121
|
+
window.getSelection()?.toString() ?? ""
|
|
1122
|
+
), a.preventDefault()), a.stopPropagation();
|
|
1123
|
+
});
|
|
1124
|
+
for (const a of ["keypress", "keyup"])
|
|
1125
|
+
o.addEventListener(a, (d) => {
|
|
1126
|
+
(d.metaKey || d.ctrlKey) && d.key.toLowerCase() === "c" && d.stopPropagation();
|
|
1127
|
+
});
|
|
1128
|
+
o.addEventListener("keydown", (a) => {
|
|
1129
|
+
if ((a.metaKey || a.ctrlKey) && a.key.toLowerCase() === "c") {
|
|
1130
|
+
a.defaultPrevented && navigator.clipboard && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && navigator.clipboard.writeText(
|
|
1131
|
+
window.getSelection()?.toString() ?? ""
|
|
1132
|
+
), a.stopPropagation();
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1119
1135
|
a.key !== "Escape" || !V || (V = !1, me(), _e());
|
|
1120
1136
|
}), l.composerValue && (f.value = l.composerValue, it(f)), t.layout === "page" ? fe(f.value, !1) : s === "minimized" ? Ze("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(f.value, !1), Ga(l, o, u, f);
|
|
1121
1137
|
const gt = () => r;
|
|
@@ -1142,7 +1158,7 @@ async function La(e = {}) {
|
|
|
1142
1158
|
});
|
|
1143
1159
|
}), v?.addEventListener("click", () => {
|
|
1144
1160
|
He = !0, mt();
|
|
1145
|
-
}),
|
|
1161
|
+
}), N?.addEventListener("click", () => {
|
|
1146
1162
|
He = !0, mt(), ot?.dismissForever().catch(() => {
|
|
1147
1163
|
});
|
|
1148
1164
|
});
|
|
@@ -1189,7 +1205,7 @@ async function La(e = {}) {
|
|
|
1189
1205
|
), qe.addEventListener("click", () => $t()), Ee.insertBefore(qe, re));
|
|
1190
1206
|
}, W = (a) => {
|
|
1191
1207
|
if (me(), yn(a.lastErrorCode) ? Fe = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Fe = null), on(
|
|
1192
|
-
|
|
1208
|
+
Ce,
|
|
1193
1209
|
t.billingStatus,
|
|
1194
1210
|
Fe
|
|
1195
1211
|
), t.loginRequired) {
|
|
@@ -1218,9 +1234,9 @@ async function La(e = {}) {
|
|
|
1218
1234
|
);
|
|
1219
1235
|
return;
|
|
1220
1236
|
}
|
|
1221
|
-
const d = qa(a), x = d !==
|
|
1222
|
-
|
|
1223
|
-
const
|
|
1237
|
+
const d = qa(a), x = d !== Cn;
|
|
1238
|
+
Cn = d;
|
|
1239
|
+
const C = xe || ke.enabled;
|
|
1224
1240
|
xe = !1, kr(
|
|
1225
1241
|
y,
|
|
1226
1242
|
j,
|
|
@@ -1230,7 +1246,7 @@ async function La(e = {}) {
|
|
|
1230
1246
|
a,
|
|
1231
1247
|
$e,
|
|
1232
1248
|
$e !== null && an(a, Gt()),
|
|
1233
|
-
|
|
1249
|
+
C,
|
|
1234
1250
|
() => ke.enabled,
|
|
1235
1251
|
Tt,
|
|
1236
1252
|
Ht,
|
|
@@ -1248,7 +1264,7 @@ async function La(e = {}) {
|
|
|
1248
1264
|
},
|
|
1249
1265
|
Ut,
|
|
1250
1266
|
t.attachmentPreviewUrlResolver,
|
|
1251
|
-
hi && !
|
|
1267
|
+
hi && !Nt ? {
|
|
1252
1268
|
dismissedCandidateIds: pt,
|
|
1253
1269
|
draftingCandidate: ht,
|
|
1254
1270
|
error: nt,
|
|
@@ -1263,10 +1279,10 @@ async function La(e = {}) {
|
|
|
1263
1279
|
Oe.add(z.id), pt.add(z.id), F(), nt = null, W(b.getState());
|
|
1264
1280
|
},
|
|
1265
1281
|
onDisable: (z) => {
|
|
1266
|
-
|
|
1282
|
+
Nt = !0, Oe.add(z.id), pt.add(z.id), F(), Xr(t, !0), nt = null, W(b.getState());
|
|
1267
1283
|
}
|
|
1268
1284
|
} : void 0
|
|
1269
|
-
),
|
|
1285
|
+
), C ? (Le = y.scrollTop, oe()) : x && ja(a) && ti();
|
|
1270
1286
|
};
|
|
1271
1287
|
return On = zi(
|
|
1272
1288
|
(a) => {
|
|
@@ -1296,7 +1312,7 @@ async function La(e = {}) {
|
|
|
1296
1312
|
fallbackColorScheme: t.colorScheme,
|
|
1297
1313
|
fallbackFontFamily: t.fontFamily
|
|
1298
1314
|
}
|
|
1299
|
-
), jt({}, "agent.state.appearance-cleared")), W(a), $(), d &&
|
|
1315
|
+
), jt({}, "agent.state.appearance-cleared")), W(a), $(), d && Nn();
|
|
1300
1316
|
}), W(b.getState()), $(), Ut(), {
|
|
1301
1317
|
agent: b,
|
|
1302
1318
|
startNewChat: $t,
|
|
@@ -1318,7 +1334,7 @@ async function La(e = {}) {
|
|
|
1318
1334
|
},
|
|
1319
1335
|
updateAuthGate: (a) => {
|
|
1320
1336
|
const d = Qe();
|
|
1321
|
-
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl),
|
|
1337
|
+
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), Ne(), W(b.getState()), $(), d && !Qe() && Ut();
|
|
1322
1338
|
},
|
|
1323
1339
|
openPanel: () => {
|
|
1324
1340
|
fe(f.value, !1);
|
|
@@ -1361,20 +1377,20 @@ async function La(e = {}) {
|
|
|
1361
1377
|
}
|
|
1362
1378
|
}
|
|
1363
1379
|
function jt(a, d) {
|
|
1364
|
-
const x = a.accentColor ?? t.accentColor,
|
|
1380
|
+
const x = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, z = a.fontFamily ?? t.fontFamily, Vt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1365
1381
|
r = Qn(
|
|
1366
1382
|
x,
|
|
1367
1383
|
Vt
|
|
1368
1384
|
), eo(o, r, {
|
|
1369
1385
|
accentColor: x,
|
|
1370
|
-
colorScheme:
|
|
1386
|
+
colorScheme: C,
|
|
1371
1387
|
fontFamily: z,
|
|
1372
1388
|
scribbleStyle: Vt
|
|
1373
1389
|
}), X("web-sdk.widget", "Updated widget appearance", {
|
|
1374
1390
|
source: d,
|
|
1375
1391
|
inputAppearance: a,
|
|
1376
1392
|
appliedAccentColor: x,
|
|
1377
|
-
appliedColorScheme:
|
|
1393
|
+
appliedColorScheme: C,
|
|
1378
1394
|
appliedFontFamily: z,
|
|
1379
1395
|
appliedScribbleStyle: Vt,
|
|
1380
1396
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
@@ -1386,7 +1402,7 @@ function Qn(e, t) {
|
|
|
1386
1402
|
}
|
|
1387
1403
|
function Pa(e) {
|
|
1388
1404
|
const t = Ta(e);
|
|
1389
|
-
return t === null ? "#fafafa" :
|
|
1405
|
+
return t === null ? "#fafafa" : Na(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1390
1406
|
}
|
|
1391
1407
|
function Ta(e) {
|
|
1392
1408
|
const t = e.trim();
|
|
@@ -1400,7 +1416,7 @@ function Ta(e) {
|
|
|
1400
1416
|
Number.parseInt(t[3] + t[3], 16)
|
|
1401
1417
|
] : null;
|
|
1402
1418
|
}
|
|
1403
|
-
function
|
|
1419
|
+
function Na([e, t, n]) {
|
|
1404
1420
|
const i = (o) => {
|
|
1405
1421
|
const r = o / 255;
|
|
1406
1422
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
@@ -1419,19 +1435,19 @@ function eo(e, t, n) {
|
|
|
1419
1435
|
e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
|
|
1420
1436
|
"--pluno-pa-accent-contrast",
|
|
1421
1437
|
Pa(i)
|
|
1422
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ha : n.fontFamily, n.scribbleStyle &&
|
|
1438
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ha : n.fontFamily, n.scribbleStyle && Aa(e.ownerDocument);
|
|
1423
1439
|
const o = Array.from(
|
|
1424
1440
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1425
1441
|
);
|
|
1426
1442
|
for (const r of o)
|
|
1427
1443
|
r.replaceWith(
|
|
1428
|
-
|
|
1444
|
+
Se(
|
|
1429
1445
|
Array.from(r.classList).join(" "),
|
|
1430
1446
|
t
|
|
1431
1447
|
)
|
|
1432
1448
|
);
|
|
1433
1449
|
}
|
|
1434
|
-
function
|
|
1450
|
+
function Aa(e) {
|
|
1435
1451
|
if (e.getElementById(Yn))
|
|
1436
1452
|
return;
|
|
1437
1453
|
const t = e.createElement("style");
|
|
@@ -1443,7 +1459,7 @@ function Ia(e) {
|
|
|
1443
1459
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1444
1460
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1445
1461
|
}
|
|
1446
|
-
function
|
|
1462
|
+
function Ia({
|
|
1447
1463
|
root: e,
|
|
1448
1464
|
launcher: t,
|
|
1449
1465
|
launcherDragHandle: n,
|
|
@@ -1460,8 +1476,8 @@ function Na({
|
|
|
1460
1476
|
if (l !== m.pointerId || !s || !p)
|
|
1461
1477
|
return;
|
|
1462
1478
|
m.preventDefault();
|
|
1463
|
-
const
|
|
1464
|
-
!g && Math.hypot(
|
|
1479
|
+
const I = m.clientX - s.x, L = m.clientY - s.y;
|
|
1480
|
+
!g && Math.hypot(I, L) < un || (g = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + I, y: p.y + L }));
|
|
1465
1481
|
}, T = (m) => {
|
|
1466
1482
|
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), g && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1467
1483
|
}, M = (m) => {
|
|
@@ -1469,20 +1485,20 @@ function Na({
|
|
|
1469
1485
|
}, u = (m) => {
|
|
1470
1486
|
if (!c)
|
|
1471
1487
|
return;
|
|
1472
|
-
const
|
|
1488
|
+
const I = Math.hypot(
|
|
1473
1489
|
m.clientX - c.x,
|
|
1474
1490
|
m.clientY - c.y
|
|
1475
1491
|
) <= un;
|
|
1476
|
-
c = null,
|
|
1477
|
-
},
|
|
1492
|
+
c = null, I && (m.preventDefault(), m.stopPropagation());
|
|
1493
|
+
}, S = (m) => {
|
|
1478
1494
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1479
1495
|
return;
|
|
1480
|
-
const
|
|
1496
|
+
const I = m.shiftKey ? Io : Ao, L = i();
|
|
1481
1497
|
let R = null;
|
|
1482
|
-
m.key === "ArrowUp" ? R = { x: L.x, y: L.y -
|
|
1498
|
+
m.key === "ArrowUp" ? R = { x: L.x, y: L.y - I } : m.key === "ArrowDown" ? R = { x: L.x, y: L.y + I } : m.key === "ArrowLeft" ? R = { x: L.x - I, y: L.y } : m.key === "ArrowRight" && (R = { x: L.x + I, y: L.y }), R && (m.preventDefault(), m.stopPropagation(), o(R), r());
|
|
1483
1499
|
};
|
|
1484
|
-
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", P), t.addEventListener("pointerup", T), t.addEventListener("pointercancel", M), t.addEventListener("click", u, !0), n.addEventListener("keydown",
|
|
1485
|
-
t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", P), t.removeEventListener("pointerup", T), t.removeEventListener("pointercancel", M), t.removeEventListener("click", u, !0), n.removeEventListener("keydown",
|
|
1500
|
+
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", P), t.addEventListener("pointerup", T), t.addEventListener("pointercancel", M), t.addEventListener("click", u, !0), n.addEventListener("keydown", S), () => {
|
|
1501
|
+
t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", P), t.removeEventListener("pointerup", T), t.removeEventListener("pointercancel", M), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", S);
|
|
1486
1502
|
};
|
|
1487
1503
|
}
|
|
1488
1504
|
function Ra({
|
|
@@ -1496,24 +1512,24 @@ function Ra({
|
|
|
1496
1512
|
const c = () => {
|
|
1497
1513
|
r = null, l = null, s = null, p = null, g = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1498
1514
|
}, h = (u) => {
|
|
1499
|
-
const
|
|
1500
|
-
!e.classList.contains("pluno-pa-widget--open") || !to(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, s = { x: u.clientX, y: u.clientY }, p = n(), g = !1,
|
|
1515
|
+
const S = u.currentTarget, m = S.dataset.resizeDirection;
|
|
1516
|
+
!e.classList.contains("pluno-pa-widget--open") || !to(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, s = { x: u.clientX, y: u.clientY }, p = n(), g = !1, S.setPointerCapture?.(u.pointerId));
|
|
1501
1517
|
}, E = (u) => {
|
|
1502
1518
|
if (r !== u.pointerId || !l || !s || !p)
|
|
1503
1519
|
return;
|
|
1504
1520
|
u.preventDefault(), u.stopPropagation();
|
|
1505
|
-
const
|
|
1506
|
-
!g && Math.hypot(
|
|
1507
|
-
no(p, l,
|
|
1521
|
+
const S = u.clientX - s.x, m = u.clientY - s.y;
|
|
1522
|
+
!g && Math.hypot(S, m) < un || (g = !0, e.classList.add("pluno-pa-widget--resizing"), i(
|
|
1523
|
+
no(p, l, S, m)
|
|
1508
1524
|
));
|
|
1509
1525
|
}, P = (u) => {
|
|
1510
1526
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && o(), c());
|
|
1511
1527
|
}, T = (u) => {
|
|
1512
1528
|
r === u.pointerId && (u.preventDefault(), c());
|
|
1513
1529
|
}, M = (u) => {
|
|
1514
|
-
const m = u.currentTarget.dataset.resizeDirection,
|
|
1530
|
+
const m = u.currentTarget.dataset.resizeDirection, I = u.shiftKey ? Io : Ao, L = n();
|
|
1515
1531
|
let R = 0, U = 0;
|
|
1516
|
-
to(m) && (u.key === "ArrowLeft" ? R = -
|
|
1532
|
+
to(m) && (u.key === "ArrowLeft" ? R = -I : u.key === "ArrowRight" ? R = I : u.key === "ArrowUp" ? U = -I : u.key === "ArrowDown" && (U = I), !(R === 0 && U === 0) && (u.preventDefault(), u.stopPropagation(), i(no(L, m, R, U)), o()));
|
|
1517
1533
|
};
|
|
1518
1534
|
for (const u of t)
|
|
1519
1535
|
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", E), u.addEventListener("pointerup", P), u.addEventListener("pointercancel", T), u.addEventListener("keydown", M);
|
|
@@ -1532,11 +1548,11 @@ function no(e, t, n, i) {
|
|
|
1532
1548
|
delta: n,
|
|
1533
1549
|
resizeLeading: t.endsWith("left") || t === "left",
|
|
1534
1550
|
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1535
|
-
minLeading:
|
|
1536
|
-
maxTrailing: o.width -
|
|
1551
|
+
minLeading: A,
|
|
1552
|
+
maxTrailing: o.width - A,
|
|
1537
1553
|
minLength: Math.min(
|
|
1538
1554
|
bn,
|
|
1539
|
-
o.width -
|
|
1555
|
+
o.width - A * 2
|
|
1540
1556
|
)
|
|
1541
1557
|
}), l = oo({
|
|
1542
1558
|
leading: e.position.y,
|
|
@@ -1544,11 +1560,11 @@ function no(e, t, n, i) {
|
|
|
1544
1560
|
delta: i,
|
|
1545
1561
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1546
1562
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1547
|
-
minLeading:
|
|
1548
|
-
maxTrailing: o.height -
|
|
1563
|
+
minLeading: Ie,
|
|
1564
|
+
maxTrailing: o.height - A,
|
|
1549
1565
|
minLength: Math.min(
|
|
1550
1566
|
_n,
|
|
1551
|
-
o.height -
|
|
1567
|
+
o.height - Ie - A
|
|
1552
1568
|
)
|
|
1553
1569
|
});
|
|
1554
1570
|
return {
|
|
@@ -1599,7 +1615,7 @@ function oo({
|
|
|
1599
1615
|
}
|
|
1600
1616
|
return { leading: e, length: t };
|
|
1601
1617
|
}
|
|
1602
|
-
function
|
|
1618
|
+
function Ct(e, t = !0) {
|
|
1603
1619
|
const n = Q();
|
|
1604
1620
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1605
1621
|
return { width: Xn, height: Xn };
|
|
@@ -1618,7 +1634,7 @@ function Da() {
|
|
|
1618
1634
|
bn,
|
|
1619
1635
|
wa
|
|
1620
1636
|
),
|
|
1621
|
-
e.width -
|
|
1637
|
+
e.width - A * 2
|
|
1622
1638
|
),
|
|
1623
1639
|
height: Math.min(
|
|
1624
1640
|
J(
|
|
@@ -1626,7 +1642,7 @@ function Da() {
|
|
|
1626
1642
|
_n,
|
|
1627
1643
|
_a
|
|
1628
1644
|
),
|
|
1629
|
-
e.height -
|
|
1645
|
+
e.height - Ie - A
|
|
1630
1646
|
)
|
|
1631
1647
|
};
|
|
1632
1648
|
}
|
|
@@ -1640,22 +1656,22 @@ function kt(e) {
|
|
|
1640
1656
|
e.width,
|
|
1641
1657
|
Math.min(
|
|
1642
1658
|
bn,
|
|
1643
|
-
t.width -
|
|
1659
|
+
t.width - A * 2
|
|
1644
1660
|
),
|
|
1645
1661
|
Math.max(
|
|
1646
|
-
|
|
1647
|
-
t.width -
|
|
1662
|
+
A,
|
|
1663
|
+
t.width - A * 2
|
|
1648
1664
|
)
|
|
1649
1665
|
),
|
|
1650
1666
|
height: J(
|
|
1651
1667
|
e.height,
|
|
1652
1668
|
Math.min(
|
|
1653
1669
|
_n,
|
|
1654
|
-
t.height -
|
|
1670
|
+
t.height - Ie - A
|
|
1655
1671
|
),
|
|
1656
1672
|
Math.max(
|
|
1657
|
-
|
|
1658
|
-
t.height -
|
|
1673
|
+
A,
|
|
1674
|
+
t.height - Ie - A
|
|
1659
1675
|
)
|
|
1660
1676
|
)
|
|
1661
1677
|
};
|
|
@@ -1682,7 +1698,7 @@ function za(e, t, n) {
|
|
|
1682
1698
|
};
|
|
1683
1699
|
}
|
|
1684
1700
|
function Zt(e, t, n) {
|
|
1685
|
-
const i =
|
|
1701
|
+
const i = Ct(e, !1);
|
|
1686
1702
|
return t ? gn(
|
|
1687
1703
|
e,
|
|
1688
1704
|
zo(t, i),
|
|
@@ -1697,14 +1713,14 @@ function Ma(e, t, n) {
|
|
|
1697
1713
|
};
|
|
1698
1714
|
}
|
|
1699
1715
|
function gn(e, t, n) {
|
|
1700
|
-
const i = Q(), o =
|
|
1716
|
+
const i = Q(), o = A + Ba(e);
|
|
1701
1717
|
return {
|
|
1702
1718
|
x: J(
|
|
1703
1719
|
t.x,
|
|
1704
|
-
|
|
1720
|
+
A,
|
|
1705
1721
|
Math.max(
|
|
1706
|
-
|
|
1707
|
-
i.width - n.width -
|
|
1722
|
+
A,
|
|
1723
|
+
i.width - n.width - A
|
|
1708
1724
|
)
|
|
1709
1725
|
),
|
|
1710
1726
|
y: J(
|
|
@@ -1712,7 +1728,7 @@ function gn(e, t, n) {
|
|
|
1712
1728
|
o,
|
|
1713
1729
|
Math.max(
|
|
1714
1730
|
o,
|
|
1715
|
-
i.height - n.height -
|
|
1731
|
+
i.height - n.height - A
|
|
1716
1732
|
)
|
|
1717
1733
|
)
|
|
1718
1734
|
};
|
|
@@ -1737,10 +1753,10 @@ function Ua(e, t) {
|
|
|
1737
1753
|
return `${r}-${l}`;
|
|
1738
1754
|
}
|
|
1739
1755
|
function Ba(e) {
|
|
1740
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1756
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Ca : Sa;
|
|
1741
1757
|
}
|
|
1742
1758
|
function Jt(e, t, n, i = null) {
|
|
1743
|
-
const o =
|
|
1759
|
+
const o = Ct(e), r = at(i), l = {
|
|
1744
1760
|
x: n === "bottom-left" ? t.x : t.x + o.width - r.width,
|
|
1745
1761
|
y: t.y + o.height - r.height
|
|
1746
1762
|
};
|
|
@@ -1751,23 +1767,23 @@ function yt(e, t) {
|
|
|
1751
1767
|
return {
|
|
1752
1768
|
x: J(
|
|
1753
1769
|
e.x,
|
|
1754
|
-
|
|
1770
|
+
A,
|
|
1755
1771
|
Math.max(
|
|
1756
|
-
|
|
1757
|
-
n.width - t.width -
|
|
1772
|
+
A,
|
|
1773
|
+
n.width - t.width - A
|
|
1758
1774
|
)
|
|
1759
1775
|
),
|
|
1760
1776
|
y: J(
|
|
1761
1777
|
e.y,
|
|
1762
|
-
|
|
1778
|
+
Ie,
|
|
1763
1779
|
Math.max(
|
|
1764
|
-
|
|
1765
|
-
n.height - t.height -
|
|
1780
|
+
Ie,
|
|
1781
|
+
n.height - t.height - A
|
|
1766
1782
|
)
|
|
1767
1783
|
)
|
|
1768
1784
|
};
|
|
1769
1785
|
}
|
|
1770
|
-
function
|
|
1786
|
+
function Ae(e, t) {
|
|
1771
1787
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1772
1788
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1773
1789
|
return;
|
|
@@ -1782,8 +1798,8 @@ function io(e) {
|
|
|
1782
1798
|
}
|
|
1783
1799
|
function Q() {
|
|
1784
1800
|
return {
|
|
1785
|
-
width: window.innerWidth || document.documentElement.clientWidth || Po +
|
|
1786
|
-
height: window.innerHeight || document.documentElement.clientHeight || To +
|
|
1801
|
+
width: window.innerWidth || document.documentElement.clientWidth || Po + A * 2,
|
|
1802
|
+
height: window.innerHeight || document.documentElement.clientHeight || To + A * 2
|
|
1787
1803
|
};
|
|
1788
1804
|
}
|
|
1789
1805
|
function Qt(e) {
|
|
@@ -1918,7 +1934,7 @@ function Za(e, t, n, i) {
|
|
|
1918
1934
|
10
|
|
1919
1935
|
)
|
|
1920
1936
|
), o.appendChild(
|
|
1921
|
-
|
|
1937
|
+
Se(
|
|
1922
1938
|
"pluno-pa-widget__character--launcher",
|
|
1923
1939
|
t
|
|
1924
1940
|
)
|
|
@@ -2055,7 +2071,7 @@ function nr() {
|
|
|
2055
2071
|
function or(e) {
|
|
2056
2072
|
const t = document.createElement("div");
|
|
2057
2073
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
2058
|
-
|
|
2074
|
+
Se(
|
|
2059
2075
|
"pluno-pa-widget__character--empty",
|
|
2060
2076
|
e
|
|
2061
2077
|
)
|
|
@@ -2077,7 +2093,7 @@ function Oo(e, t) {
|
|
|
2077
2093
|
)
|
|
2078
2094
|
);
|
|
2079
2095
|
}
|
|
2080
|
-
function
|
|
2096
|
+
function Se(e, t) {
|
|
2081
2097
|
const n = `pluno-pa-character-${Jn}`;
|
|
2082
2098
|
Jn += 1;
|
|
2083
2099
|
const i = t.scribbleStyle ? ar(t.accentColor, n) : ir(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
|
|
@@ -2224,13 +2240,13 @@ function ir(e, t) {
|
|
|
2224
2240
|
d: vt,
|
|
2225
2241
|
fill: Z(i.boltEdge)
|
|
2226
2242
|
});
|
|
2227
|
-
const
|
|
2243
|
+
const S = "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";
|
|
2228
2244
|
w(u, "path", {
|
|
2229
|
-
d:
|
|
2245
|
+
d: S,
|
|
2230
2246
|
fill: Z(i.boltFill),
|
|
2231
2247
|
filter: Z(i.innerDepth)
|
|
2232
2248
|
}), w(u, "path", {
|
|
2233
|
-
d:
|
|
2249
|
+
d: S,
|
|
2234
2250
|
fill: Z(i.boltGlow),
|
|
2235
2251
|
opacity: "0.74"
|
|
2236
2252
|
});
|
|
@@ -2260,9 +2276,9 @@ function ir(e, t) {
|
|
|
2260
2276
|
"stroke-linecap": "round",
|
|
2261
2277
|
opacity: "0.48"
|
|
2262
2278
|
});
|
|
2263
|
-
const
|
|
2279
|
+
const I = w(o, "g", { filter: Z(i.eyeShadow) });
|
|
2264
2280
|
return ao(
|
|
2265
|
-
|
|
2281
|
+
I,
|
|
2266
2282
|
"rotate(-2 528 463)",
|
|
2267
2283
|
"528",
|
|
2268
2284
|
"463",
|
|
@@ -2272,7 +2288,7 @@ function ir(e, t) {
|
|
|
2272
2288
|
"447",
|
|
2273
2289
|
i
|
|
2274
2290
|
), ao(
|
|
2275
|
-
|
|
2291
|
+
I,
|
|
2276
2292
|
"rotate(2 717 462)",
|
|
2277
2293
|
"717",
|
|
2278
2294
|
"462",
|
|
@@ -2325,7 +2341,7 @@ function ar(e, t) {
|
|
|
2325
2341
|
}), w(p, "path", {
|
|
2326
2342
|
d: vt,
|
|
2327
2343
|
fill: "none",
|
|
2328
|
-
stroke:
|
|
2344
|
+
stroke: St,
|
|
2329
2345
|
"stroke-width": "18",
|
|
2330
2346
|
"stroke-linejoin": "round"
|
|
2331
2347
|
}), ro(
|
|
@@ -2350,7 +2366,7 @@ function ar(e, t) {
|
|
|
2350
2366
|
}
|
|
2351
2367
|
function Uo() {
|
|
2352
2368
|
return k("svg", {
|
|
2353
|
-
xmlns:
|
|
2369
|
+
xmlns: No,
|
|
2354
2370
|
viewBox: "0 0 1254 1254"
|
|
2355
2371
|
});
|
|
2356
2372
|
}
|
|
@@ -2384,14 +2400,14 @@ function ro(e, t, n, i, o, r, l, s) {
|
|
|
2384
2400
|
rx: "73",
|
|
2385
2401
|
ry: "80",
|
|
2386
2402
|
fill: "#ffffff",
|
|
2387
|
-
stroke:
|
|
2403
|
+
stroke: St,
|
|
2388
2404
|
"stroke-width": "13"
|
|
2389
2405
|
}), w(p, "ellipse", {
|
|
2390
2406
|
cx: o,
|
|
2391
2407
|
cy: r,
|
|
2392
2408
|
rx: "45",
|
|
2393
2409
|
ry: "53",
|
|
2394
|
-
fill:
|
|
2410
|
+
fill: St
|
|
2395
2411
|
}), w(p, "circle", {
|
|
2396
2412
|
cx: l,
|
|
2397
2413
|
cy: s,
|
|
@@ -2684,7 +2700,7 @@ function ce(e, t, n, i, o, r) {
|
|
|
2684
2700
|
return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), k("svg", l);
|
|
2685
2701
|
}
|
|
2686
2702
|
function k(e, t = {}) {
|
|
2687
|
-
const n = document.createElementNS(
|
|
2703
|
+
const n = document.createElementNS(No, e);
|
|
2688
2704
|
for (const [i, o] of Object.entries(t))
|
|
2689
2705
|
n.setAttribute(i, o);
|
|
2690
2706
|
return n;
|
|
@@ -2810,7 +2826,7 @@ function vr(e) {
|
|
|
2810
2826
|
const n = document.createElement("strong");
|
|
2811
2827
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2812
2828
|
const i = document.createElement("span");
|
|
2813
|
-
return i.textContent =
|
|
2829
|
+
return i.textContent = Cr(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
|
|
2814
2830
|
$o(
|
|
2815
2831
|
e,
|
|
2816
2832
|
"Upgrade",
|
|
@@ -2822,9 +2838,9 @@ function mn(e, t) {
|
|
|
2822
2838
|
return e !== null && (ae(e) || Go(e) || yn(t));
|
|
2823
2839
|
}
|
|
2824
2840
|
function po(e, t, n) {
|
|
2825
|
-
return mn(t, n) ||
|
|
2841
|
+
return mn(t, n) || Sr(t) ? !0 : !mn(e, n);
|
|
2826
2842
|
}
|
|
2827
|
-
function
|
|
2843
|
+
function Sr(e) {
|
|
2828
2844
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
|
|
2829
2845
|
}
|
|
2830
2846
|
function ae(e) {
|
|
@@ -2836,7 +2852,7 @@ function yn(e) {
|
|
|
2836
2852
|
function Go(e) {
|
|
2837
2853
|
return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2838
2854
|
}
|
|
2839
|
-
function
|
|
2855
|
+
function Cr(e) {
|
|
2840
2856
|
return e.creditsRemaining === null ? null : `${Er(e.creditsRemaining)} credits left`;
|
|
2841
2857
|
}
|
|
2842
2858
|
function Er(e) {
|
|
@@ -2868,11 +2884,11 @@ function an(e, t) {
|
|
|
2868
2884
|
(i) => !qo(i)
|
|
2869
2885
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2870
2886
|
}
|
|
2871
|
-
function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u,
|
|
2872
|
-
const R =
|
|
2887
|
+
function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u, S, m, I, L) {
|
|
2888
|
+
const R = Nr(r), U = R.filter(
|
|
2873
2889
|
(_) => !qo(_)
|
|
2874
|
-
), ue = e.scrollTop,
|
|
2875
|
-
|
|
2890
|
+
), ue = e.scrollTop, Ce = [], Ve = /* @__PURE__ */ new Set(), D = (_) => {
|
|
2891
|
+
Ce.push(_);
|
|
2876
2892
|
};
|
|
2877
2893
|
Vo(n, r.isThinking), o.hidden = !s, s && l !== null && Oo(o, l);
|
|
2878
2894
|
const Re = U.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
@@ -2881,7 +2897,7 @@ function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u, C, m, N, L) {
|
|
|
2881
2897
|
_.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2882
2898
|
const y = document.createElement("div");
|
|
2883
2899
|
y.className = "pluno-pa-widget__empty-hero";
|
|
2884
|
-
const j =
|
|
2900
|
+
const j = Se(
|
|
2885
2901
|
"pluno-pa-widget__character--empty",
|
|
2886
2902
|
P()
|
|
2887
2903
|
);
|
|
@@ -2893,24 +2909,24 @@ function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u, C, m, N, L) {
|
|
|
2893
2909
|
const K = u?.prompts ?? r.starterPrompts, ee = document.createElement("div");
|
|
2894
2910
|
if (ee.className = K.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", K.length === 0 && !r.starterPromptsLoading && ee.setAttribute("aria-hidden", "true"), K.length > 0)
|
|
2895
2911
|
for (const v of K) {
|
|
2896
|
-
const
|
|
2897
|
-
|
|
2912
|
+
const N = document.createElement("button");
|
|
2913
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt", N.textContent = `"${v}"`, N.addEventListener("click", () => {
|
|
2898
2914
|
T(v);
|
|
2899
|
-
}), ee.appendChild(
|
|
2915
|
+
}), ee.appendChild(N);
|
|
2900
2916
|
}
|
|
2901
2917
|
else if (r.starterPromptsLoading) {
|
|
2902
2918
|
const v = document.createElement("button");
|
|
2903
2919
|
v.type = "button", v.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", v.disabled = !0, v.tabIndex = -1, v.textContent = "Generating example tasks...", ee.appendChild(v);
|
|
2904
2920
|
} else
|
|
2905
2921
|
for (let v = 0; v < pa; v += 1) {
|
|
2906
|
-
const
|
|
2907
|
-
|
|
2922
|
+
const N = document.createElement("button");
|
|
2923
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", N.disabled = !0, N.tabIndex = -1, N.textContent = "", ee.appendChild(N);
|
|
2908
2924
|
}
|
|
2909
2925
|
if (_.appendChild(ee), u) {
|
|
2910
2926
|
const v = document.createElement("button");
|
|
2911
|
-
v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click",
|
|
2927
|
+
v.type = "button", v.className = "pluno-pa-widget__morning-report-snooze", v.textContent = "Snooze morning report", v.addEventListener("click", S), _.appendChild(v);
|
|
2912
2928
|
}
|
|
2913
|
-
h.clear(), D(_), D(t), uo(e,
|
|
2929
|
+
h.clear(), D(_), D(t), uo(e, Ce);
|
|
2914
2930
|
return;
|
|
2915
2931
|
}
|
|
2916
2932
|
let f = null, O = null, Ee = [];
|
|
@@ -2935,19 +2951,19 @@ function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u, C, m, N, L) {
|
|
|
2935
2951
|
if (_ !== re)
|
|
2936
2952
|
continue;
|
|
2937
2953
|
if (H()) {
|
|
2938
|
-
const
|
|
2939
|
-
D(
|
|
2954
|
+
const N = Et();
|
|
2955
|
+
D(N), f = null, O = N;
|
|
2940
2956
|
} else {
|
|
2941
|
-
const
|
|
2942
|
-
D(
|
|
2957
|
+
const N = fo(P());
|
|
2958
|
+
D(N), f = null, O = N;
|
|
2943
2959
|
}
|
|
2944
2960
|
continue;
|
|
2945
2961
|
}
|
|
2946
2962
|
if (y.role === "system") {
|
|
2947
2963
|
if (y.dataType === "run_error" || y.dataType === "run_status") {
|
|
2948
2964
|
H();
|
|
2949
|
-
const v = document.createElement("div"),
|
|
2950
|
-
v.className =
|
|
2965
|
+
const v = document.createElement("div"), N = y.dataType === "run_error";
|
|
2966
|
+
v.className = N ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", v.textContent = mo(y.content), D(v), f = N ? v : null, O = N ? null : v;
|
|
2951
2967
|
}
|
|
2952
2968
|
continue;
|
|
2953
2969
|
}
|
|
@@ -2961,7 +2977,7 @@ function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u, C, m, N, L) {
|
|
|
2961
2977
|
K,
|
|
2962
2978
|
h,
|
|
2963
2979
|
Ve,
|
|
2964
|
-
|
|
2980
|
+
I
|
|
2965
2981
|
);
|
|
2966
2982
|
D(ee), f = ee, O = null;
|
|
2967
2983
|
}
|
|
@@ -2999,7 +3015,7 @@ function kr(e, t, n, i, o, r, l, s, p, g, c, h, E, P, T, M, u, C, m, N, L) {
|
|
|
2999
3015
|
});
|
|
3000
3016
|
D(_), L.onSeen(le), f = null, O = _;
|
|
3001
3017
|
}
|
|
3002
|
-
f?.classList.add("pluno-pa-widget__message--bottom-reserve"), O?.classList.add("pluno-pa-widget__bottom-reserve-compact"), D(t), Tr(h, Ve), uo(e,
|
|
3018
|
+
f?.classList.add("pluno-pa-widget__message--bottom-reserve"), O?.classList.add("pluno-pa-widget__bottom-reserve-compact"), D(t), Tr(h, Ve), uo(e, Ce), p ? rt(e, g) : e.scrollTop = ue;
|
|
3003
3019
|
}
|
|
3004
3020
|
function Lr(e, t, n, i, o) {
|
|
3005
3021
|
const r = Pr(e, t), l = r ? n.get(r) : void 0;
|
|
@@ -3007,13 +3023,13 @@ function Lr(e, t, n, i, o) {
|
|
|
3007
3023
|
return l.classList.remove("pluno-pa-widget__message--bottom-reserve"), i.add(r), l;
|
|
3008
3024
|
const s = document.createElement("div");
|
|
3009
3025
|
s.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? Wr(s, t) : s.textContent = t, e.role === "user" && e.attachments?.length && s.appendChild(
|
|
3010
|
-
|
|
3026
|
+
Ar(
|
|
3011
3027
|
e.attachments,
|
|
3012
3028
|
o
|
|
3013
3029
|
)
|
|
3014
3030
|
);
|
|
3015
3031
|
const p = document.createElement("div");
|
|
3016
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
3032
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Ir(t)), s.appendChild(p), r && (n.set(r, s), i.add(r)), s;
|
|
3017
3033
|
}
|
|
3018
3034
|
function Pr(e, t) {
|
|
3019
3035
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
@@ -3051,7 +3067,7 @@ function uo(e, t) {
|
|
|
3051
3067
|
n = n.nextSibling, e.removeChild(i);
|
|
3052
3068
|
}
|
|
3053
3069
|
}
|
|
3054
|
-
function
|
|
3070
|
+
function Nr(e) {
|
|
3055
3071
|
if (!e.assistantDraft)
|
|
3056
3072
|
return [...e.messages];
|
|
3057
3073
|
const t = {
|
|
@@ -3098,7 +3114,7 @@ function ho(e, t, n, i, o, r, l, s) {
|
|
|
3098
3114
|
e.replaceChildren(), Vo(t, !1), t.disabled = !0, n(!1);
|
|
3099
3115
|
const p = document.createElement("div");
|
|
3100
3116
|
p.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3101
|
-
const g =
|
|
3117
|
+
const g = Se(
|
|
3102
3118
|
"pluno-pa-widget__character--empty",
|
|
3103
3119
|
i()
|
|
3104
3120
|
);
|
|
@@ -3113,7 +3129,7 @@ function ho(e, t, n, i, o, r, l, s) {
|
|
|
3113
3129
|
}
|
|
3114
3130
|
e.appendChild(p);
|
|
3115
3131
|
}
|
|
3116
|
-
function
|
|
3132
|
+
function Ar(e, t) {
|
|
3117
3133
|
const n = document.createElement("div");
|
|
3118
3134
|
n.className = "pluno-pa-widget__message-attachments";
|
|
3119
3135
|
for (const i of e)
|
|
@@ -3125,7 +3141,7 @@ function Ir(e, t) {
|
|
|
3125
3141
|
);
|
|
3126
3142
|
return n;
|
|
3127
3143
|
}
|
|
3128
|
-
function
|
|
3144
|
+
function Ir(e) {
|
|
3129
3145
|
const t = document.createElement("button");
|
|
3130
3146
|
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(mr()), t.addEventListener("click", (n) => {
|
|
3131
3147
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
@@ -3136,7 +3152,7 @@ function Rr(e, t) {
|
|
|
3136
3152
|
n.className = "pluno-pa-widget__share-prompt";
|
|
3137
3153
|
const i = document.createElement("div");
|
|
3138
3154
|
i.className = "pluno-pa-widget__share-prompt-body", i.appendChild(
|
|
3139
|
-
|
|
3155
|
+
Se(
|
|
3140
3156
|
"pluno-pa-widget__share-prompt-icon",
|
|
3141
3157
|
t.characterIconOptions
|
|
3142
3158
|
)
|
|
@@ -3204,8 +3220,8 @@ function Dr(e, t) {
|
|
|
3204
3220
|
if (g.appendChild(h), p.appendChild(g), e.screenshotDataUrl) {
|
|
3205
3221
|
const u = document.createElement("div");
|
|
3206
3222
|
u.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3207
|
-
const
|
|
3208
|
-
|
|
3223
|
+
const S = document.createElement("img");
|
|
3224
|
+
S.src = e.screenshotDataUrl, S.alt = "Product page with Pluno open", u.appendChild(S), p.appendChild(u);
|
|
3209
3225
|
}
|
|
3210
3226
|
i.appendChild(p), i.appendChild(s);
|
|
3211
3227
|
const E = document.createElement("div");
|
|
@@ -3217,14 +3233,14 @@ function Dr(e, t) {
|
|
|
3217
3233
|
const M = document.createElement("footer");
|
|
3218
3234
|
M.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3219
3235
|
for (const u of Mr(e)) {
|
|
3220
|
-
const
|
|
3221
|
-
|
|
3236
|
+
const S = document.createElement("a");
|
|
3237
|
+
S.href = u.href, S.target = "_blank", S.rel = "noopener noreferrer", S.title = u.label, S.setAttribute("aria-label", `Open ${u.label}`), S.appendChild(Or(u.id)), M.appendChild(S);
|
|
3222
3238
|
}
|
|
3223
3239
|
if (E.appendChild(M), i.appendChild(E), t.socialPostRewardsUrl) {
|
|
3224
3240
|
const u = document.createElement("div");
|
|
3225
3241
|
u.className = "pluno-pa-widget__share-dialog-step";
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3242
|
+
const S = document.createElement("strong");
|
|
3243
|
+
S.className = "pluno-pa-widget__share-dialog-step-title", S.textContent = "3) Submit post to get 2000 free credits!", u.appendChild(S);
|
|
3228
3244
|
const m = document.createElement("a");
|
|
3229
3245
|
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Ur()), u.appendChild(m), i.appendChild(u);
|
|
3230
3246
|
}
|
|
@@ -3291,7 +3307,7 @@ function Ur() {
|
|
|
3291
3307
|
), e;
|
|
3292
3308
|
}
|
|
3293
3309
|
function qo(e) {
|
|
3294
|
-
return e.role === "tool" && e.toolName ===
|
|
3310
|
+
return e.role === "tool" && e.toolName === Co;
|
|
3295
3311
|
}
|
|
3296
3312
|
function mo(e) {
|
|
3297
3313
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
@@ -3301,7 +3317,7 @@ function Br(e, t, n, i) {
|
|
|
3301
3317
|
o.className = "pluno-pa-widget__tool-group", o.title = new Date(
|
|
3302
3318
|
e[e.length - 1].createdAt
|
|
3303
3319
|
).toLocaleString(), o.appendChild(
|
|
3304
|
-
|
|
3320
|
+
Se(
|
|
3305
3321
|
"pluno-pa-widget__character--tool-group",
|
|
3306
3322
|
i
|
|
3307
3323
|
)
|
|
@@ -3329,7 +3345,7 @@ function Br(e, t, n, i) {
|
|
|
3329
3345
|
function jo(e) {
|
|
3330
3346
|
const t = document.createElement("article");
|
|
3331
3347
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3332
|
-
|
|
3348
|
+
Se(
|
|
3333
3349
|
"pluno-pa-widget__character--tool-group",
|
|
3334
3350
|
e
|
|
3335
3351
|
)
|
package/package.json
CHANGED