@pluno/product-agent-web 0.1.66 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-widget.js +320 -286
- package/package.json +1 -1
|
@@ -224,7 +224,7 @@ const Zn = 100, hi = 1e4, mi = 5e3, fi = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !1,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
}, Ai = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Sn = "pluno-pa-scribble-font", Qn = 190, eo = 41, En = 22, Ni =
|
|
227
|
+
}, Ai = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Sn = "pluno-pa-scribble-font", Qn = 190, eo = 41, En = 22, Ni = 1, Ti = 48, Jt = 420, Di = 520, zi = 0.24, Qt = 680, Ri = 800, Mi = 0.76, I = 8, Ce = 50, to = "http://www.w3.org/2000/svg", Gt = 26, $t = 8, Oi = 36, qt = 16, Bi = 4, kn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,12 +261,12 @@ const Zn = 100, hi = 1e4, mi = 5e3, fi = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
],
|
|
264
|
+
], Ui = 11, Fi = 13, jt = 4, no = 10, oo = 40, Hi = "movable-launcher-position-v2", io = "pluno-pa-widget-styles", ao = "data-pluno-pa-widget-styles";
|
|
265
265
|
let Ln = 0;
|
|
266
|
-
function
|
|
266
|
+
function Wi(e) {
|
|
267
267
|
return (t) => new se(t, e);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function Gi(e = {}) {
|
|
270
270
|
const t = {
|
|
271
271
|
launcherLabel: e.launcherLabel ?? oe.launcherLabel,
|
|
272
272
|
accentColor: e.accentColor ?? oe.accentColor,
|
|
@@ -334,14 +334,14 @@ async function qi(e = {}) {
|
|
|
334
334
|
t.accentColor,
|
|
335
335
|
t.scribbleStyle
|
|
336
336
|
);
|
|
337
|
-
|
|
337
|
+
ua(
|
|
338
338
|
i,
|
|
339
339
|
t.launcherLabel,
|
|
340
340
|
r,
|
|
341
341
|
t.movableLauncher,
|
|
342
342
|
t.showLauncherMinimizeButton
|
|
343
343
|
), o.appendChild(i);
|
|
344
|
-
const l =
|
|
344
|
+
const l = pr(t);
|
|
345
345
|
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
346
|
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ve(
|
|
347
347
|
i,
|
|
@@ -356,7 +356,7 @@ async function qi(e = {}) {
|
|
|
356
356
|
fontFamily: t.fontFamily,
|
|
357
357
|
scribbleStyle: t.scribbleStyle
|
|
358
358
|
});
|
|
359
|
-
const m = await
|
|
359
|
+
const m = await lr(), k = m.ownerDocument;
|
|
360
360
|
m.appendChild(n), J(
|
|
361
361
|
"web-sdk.widget",
|
|
362
362
|
"Applied initial widget appearance",
|
|
@@ -369,7 +369,7 @@ async function qi(e = {}) {
|
|
|
369
369
|
);
|
|
370
370
|
const v = i.querySelector(
|
|
371
371
|
".pluno-pa-widget__launcher"
|
|
372
|
-
),
|
|
372
|
+
), R = i.querySelector(
|
|
373
373
|
".pluno-pa-widget__launcher-drag-handle"
|
|
374
374
|
), _ = i.querySelector(
|
|
375
375
|
".pluno-pa-widget__launcher-input"
|
|
@@ -391,7 +391,7 @@ async function qi(e = {}) {
|
|
|
391
391
|
".pluno-pa-widget__attachments"
|
|
392
392
|
), Q = i.querySelector(
|
|
393
393
|
".pluno-pa-widget__attachment-input"
|
|
394
|
-
),
|
|
394
|
+
), Re = i.querySelector(
|
|
395
395
|
".pluno-pa-widget__attach"
|
|
396
396
|
), x = i.querySelector(
|
|
397
397
|
".pluno-pa-widget__input"
|
|
@@ -409,7 +409,7 @@ async function qi(e = {}) {
|
|
|
409
409
|
".pluno-pa-widget__history-close"
|
|
410
410
|
), q = i.querySelector(
|
|
411
411
|
".pluno-pa-widget__history-status"
|
|
412
|
-
),
|
|
412
|
+
), z = i.querySelector(
|
|
413
413
|
".pluno-pa-widget__timeline-jump"
|
|
414
414
|
), D = i.querySelector(
|
|
415
415
|
".pluno-pa-widget__active-users-counter"
|
|
@@ -426,14 +426,14 @@ async function qi(e = {}) {
|
|
|
426
426
|
), So = i.querySelector(
|
|
427
427
|
".pluno-pa-widget__notify-suggestion-never"
|
|
428
428
|
);
|
|
429
|
-
if (!v || !_ || !b || !A || !L || !F || !H || !$ || !Q || !
|
|
429
|
+
if (!v || !_ || !b || !A || !L || !F || !H || !$ || !Q || !Re || !x || !de || !Ye || !X || !C || !T || !Se || !q || !z || !D || !N || !ht)
|
|
430
430
|
throw new Error("Failed to mount Pluno widget");
|
|
431
|
-
if (t.movableLauncher && !
|
|
431
|
+
if (t.movableLauncher && !R)
|
|
432
432
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
433
433
|
Mn(_), Mn(x);
|
|
434
434
|
let W = [], le = null;
|
|
435
435
|
const Ee = () => {
|
|
436
|
-
|
|
436
|
+
Na(
|
|
437
437
|
$,
|
|
438
438
|
W,
|
|
439
439
|
(a) => {
|
|
@@ -483,15 +483,15 @@ async function qi(e = {}) {
|
|
|
483
483
|
const mt = new Set(l.openToolGroupKeys), ke = new Set(
|
|
484
484
|
l.seenShareCandidateIds
|
|
485
485
|
), Xe = new Set(ke);
|
|
486
|
-
let ft = l.sharePromptsDisabled || await
|
|
486
|
+
let ft = l.sharePromptsDisabled || await sr(t), Z = null, Le = !1, fe = !1, we = {
|
|
487
487
|
enabled: !0
|
|
488
488
|
}, be = 0, nn = "", ce = !1, pe = !1, ue = [], wt = null, Oe = null;
|
|
489
489
|
const ee = (a, s) => {
|
|
490
490
|
we = { enabled: a, reason: s };
|
|
491
491
|
}, te = () => {
|
|
492
|
-
|
|
492
|
+
z.hidden = !0;
|
|
493
493
|
}, Lo = () => {
|
|
494
|
-
|
|
494
|
+
z.hidden = !1;
|
|
495
495
|
}, Po = (a = "jump") => {
|
|
496
496
|
ee(!0, a), te(), Ve(N, () => we.enabled), be = N.scrollTop;
|
|
497
497
|
}, _e = () => {
|
|
@@ -506,14 +506,14 @@ async function qi(e = {}) {
|
|
|
506
506
|
const s = document.createElement("button");
|
|
507
507
|
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
|
|
508
508
|
const w = document.createElement("span");
|
|
509
|
-
w.className = "pluno-pa-widget__history-item-title", w.textContent =
|
|
509
|
+
w.className = "pluno-pa-widget__history-item-title", w.textContent = sa(a);
|
|
510
510
|
const S = document.createElement("time");
|
|
511
|
-
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent =
|
|
511
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = ca(
|
|
512
512
|
a.lastActiveAt,
|
|
513
513
|
Date.now()
|
|
514
514
|
);
|
|
515
515
|
const M = document.createElement("small");
|
|
516
|
-
M.className = "pluno-pa-widget__history-path", M.textContent =
|
|
516
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = da(a), s.append(w, S, M), s.addEventListener("click", () => {
|
|
517
517
|
ce = !1, Oe = null, _e(), ee(!0, "newSession"), te(), y.loadSession(a.id), G(y.getState());
|
|
518
518
|
}), T.appendChild(s);
|
|
519
519
|
}
|
|
@@ -553,7 +553,7 @@ async function qi(e = {}) {
|
|
|
553
553
|
const s = dt(i, a);
|
|
554
554
|
return Vt(
|
|
555
555
|
i,
|
|
556
|
-
p ? ro(p, s) :
|
|
556
|
+
p ? ro(p, s) : Zi(
|
|
557
557
|
i,
|
|
558
558
|
t.position,
|
|
559
559
|
s
|
|
@@ -561,8 +561,12 @@ async function qi(e = {}) {
|
|
|
561
561
|
s
|
|
562
562
|
);
|
|
563
563
|
}, B = () => {
|
|
564
|
-
const a =
|
|
565
|
-
|
|
564
|
+
const a = ia(
|
|
565
|
+
o,
|
|
566
|
+
_,
|
|
567
|
+
x
|
|
568
|
+
);
|
|
569
|
+
cr(t, {
|
|
566
570
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
567
571
|
composerValue: x.value,
|
|
568
572
|
focusedInput: a,
|
|
@@ -591,8 +595,8 @@ async function qi(e = {}) {
|
|
|
591
595
|
)
|
|
592
596
|
), Dn(i), B(), s && Ze("minimized");
|
|
593
597
|
}, xe = (a, s = {}) => {
|
|
594
|
-
|
|
595
|
-
debugVersion:
|
|
598
|
+
oa(a, {
|
|
599
|
+
debugVersion: Hi,
|
|
596
600
|
launcherPosition: p,
|
|
597
601
|
rootClasses: i.className,
|
|
598
602
|
rootStyle: {
|
|
@@ -601,9 +605,9 @@ async function qi(e = {}) {
|
|
|
601
605
|
right: i.style.right,
|
|
602
606
|
bottom: i.style.bottom
|
|
603
607
|
},
|
|
604
|
-
rootRect:
|
|
605
|
-
launcherRect:
|
|
606
|
-
panelRect:
|
|
608
|
+
rootRect: zt(i),
|
|
609
|
+
launcherRect: zt(v),
|
|
610
|
+
panelRect: zt(b),
|
|
607
611
|
viewport: Y(),
|
|
608
612
|
panelHidden: b.hidden,
|
|
609
613
|
closeHidden: A.hidden,
|
|
@@ -621,7 +625,7 @@ async function qi(e = {}) {
|
|
|
621
625
|
Dn(i);
|
|
622
626
|
return;
|
|
623
627
|
}
|
|
624
|
-
|
|
628
|
+
na(i, {
|
|
625
629
|
x: a.x - s.x,
|
|
626
630
|
y: a.y - s.y
|
|
627
631
|
});
|
|
@@ -640,11 +644,8 @@ async function qi(e = {}) {
|
|
|
640
644
|
const a = Fe();
|
|
641
645
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
642
646
|
Nt(i, c);
|
|
643
|
-
const s =
|
|
644
|
-
Mt(
|
|
645
|
-
h,
|
|
646
|
-
s.width
|
|
647
|
-
);
|
|
647
|
+
const s = ze(c);
|
|
648
|
+
Mt(h, s.width);
|
|
648
649
|
const w = lt(
|
|
649
650
|
u ?? Dt(
|
|
650
651
|
i,
|
|
@@ -665,10 +666,10 @@ async function qi(e = {}) {
|
|
|
665
666
|
};
|
|
666
667
|
let ln = () => {
|
|
667
668
|
};
|
|
668
|
-
window.addEventListener("resize", rn), t.movableLauncher &&
|
|
669
|
+
window.addEventListener("resize", rn), t.movableLauncher && R ? (Fe(), ln = Ki({
|
|
669
670
|
root: i,
|
|
670
671
|
launcher: v,
|
|
671
|
-
launcherDragHandle:
|
|
672
|
+
launcherDragHandle: R,
|
|
672
673
|
getPosition: () => Be(),
|
|
673
674
|
setPosition: (a) => {
|
|
674
675
|
const s = a, w = dt(i), S = Vt(
|
|
@@ -676,7 +677,7 @@ async function qi(e = {}) {
|
|
|
676
677
|
a,
|
|
677
678
|
w
|
|
678
679
|
);
|
|
679
|
-
p =
|
|
680
|
+
p = Qi(
|
|
680
681
|
S,
|
|
681
682
|
w
|
|
682
683
|
), ve(i, S), xe("Dragging closed launcher", {
|
|
@@ -688,7 +689,7 @@ async function qi(e = {}) {
|
|
|
688
689
|
}
|
|
689
690
|
})) : ve(i, null), Nt(i, c);
|
|
690
691
|
const No = () => {
|
|
691
|
-
const a =
|
|
692
|
+
const a = ze(c), s = Be();
|
|
692
693
|
return {
|
|
693
694
|
position: lt(
|
|
694
695
|
u ?? Dt(
|
|
@@ -704,14 +705,14 @@ async function qi(e = {}) {
|
|
|
704
705
|
}, To = (a) => {
|
|
705
706
|
c = ut(a.size), Nt(i, c), Mt(
|
|
706
707
|
h,
|
|
707
|
-
|
|
708
|
+
ze(c).width
|
|
708
709
|
), u = lt(
|
|
709
710
|
a.position,
|
|
710
|
-
|
|
711
|
+
ze(c)
|
|
711
712
|
);
|
|
712
713
|
const s = Be();
|
|
713
714
|
bt(u, s);
|
|
714
|
-
}, Do = P.length > 0 ?
|
|
715
|
+
}, Do = P.length > 0 ? Yi({
|
|
715
716
|
root: i,
|
|
716
717
|
handles: P,
|
|
717
718
|
getBounds: No,
|
|
@@ -741,7 +742,7 @@ async function qi(e = {}) {
|
|
|
741
742
|
}, ge = (a = "", s = !0) => {
|
|
742
743
|
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1), b.hidden = !1, A.hidden = !1, Mt(
|
|
743
744
|
h,
|
|
744
|
-
|
|
745
|
+
ze(c).width
|
|
745
746
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
746
747
|
const w = Fe(), S = Dt(
|
|
747
748
|
i,
|
|
@@ -761,17 +762,17 @@ async function qi(e = {}) {
|
|
|
761
762
|
v.hidden = !0, Ve(N, () => we.enabled), be = N.scrollTop;
|
|
762
763
|
}, 220);
|
|
763
764
|
});
|
|
764
|
-
},
|
|
765
|
+
}, zo = () => {
|
|
765
766
|
Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (Fe(!1), xe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
|
|
766
767
|
b.hidden = !0, A.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
767
768
|
}, 220);
|
|
768
769
|
};
|
|
769
770
|
v.addEventListener("submit", (a) => {
|
|
770
771
|
a.preventDefault(), ge(_.value), _.value = "";
|
|
771
|
-
}),
|
|
772
|
+
}), R?.addEventListener("click", (a) => {
|
|
772
773
|
a.preventDefault(), a.stopPropagation();
|
|
773
774
|
}), v.addEventListener("click", (a) => {
|
|
774
|
-
a.target === _ && !
|
|
775
|
+
a.target === _ && !R || (ge(_.value), _.value = "");
|
|
775
776
|
}), _.addEventListener("focus", () => {
|
|
776
777
|
ge(_.value), _.value = "";
|
|
777
778
|
}), _.addEventListener("input", () => {
|
|
@@ -781,7 +782,7 @@ async function qi(e = {}) {
|
|
|
781
782
|
ge(a), _.value = "";
|
|
782
783
|
});
|
|
783
784
|
let xt = null, Je = null, ye = null;
|
|
784
|
-
const sn = (a) => a === _ || a === x,
|
|
785
|
+
const sn = (a) => a === _ || a === x, Ro = (a) => {
|
|
785
786
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
786
787
|
return null;
|
|
787
788
|
let s = a;
|
|
@@ -805,7 +806,10 @@ async function qi(e = {}) {
|
|
|
805
806
|
const s = window.getComputedStyle(a);
|
|
806
807
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
807
808
|
}, dn = (a) => {
|
|
808
|
-
He !== a && (He = a, i.classList.toggle(
|
|
809
|
+
He !== a && (He = a, i.classList.toggle(
|
|
810
|
+
"pluno-pa-widget--host-modal-conflict",
|
|
811
|
+
a !== null
|
|
812
|
+
), et(), a !== null ? ye = window.setInterval(() => {
|
|
809
813
|
const s = He;
|
|
810
814
|
(!s || !Mo(s)) && dn(null);
|
|
811
815
|
}, Pi) : ye !== null && (window.clearInterval(ye), ye = null, Je = null));
|
|
@@ -820,7 +824,7 @@ async function qi(e = {}) {
|
|
|
820
824
|
const s = xt;
|
|
821
825
|
if (xt = null, s === null || Date.now() - s > ki)
|
|
822
826
|
return;
|
|
823
|
-
const w =
|
|
827
|
+
const w = Ro(a.relatedTarget);
|
|
824
828
|
if (!w)
|
|
825
829
|
return;
|
|
826
830
|
const S = Date.now();
|
|
@@ -835,9 +839,9 @@ async function qi(e = {}) {
|
|
|
835
839
|
a.stopPropagation();
|
|
836
840
|
}), g?.addEventListener("click", (a) => {
|
|
837
841
|
a.preventDefault(), a.stopPropagation(), Ue("minimized");
|
|
838
|
-
}), A.addEventListener("click",
|
|
842
|
+
}), A.addEventListener("click", zo), N.addEventListener("scroll", () => {
|
|
839
843
|
N.scrollTop < be - 1 && ee(!1, "userScroll"), be = N.scrollTop;
|
|
840
|
-
}),
|
|
844
|
+
}), z.addEventListener("click", () => {
|
|
841
845
|
Po();
|
|
842
846
|
});
|
|
843
847
|
const cn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
@@ -853,7 +857,7 @@ async function qi(e = {}) {
|
|
|
853
857
|
const a = Qe(), s = He !== null;
|
|
854
858
|
_.readOnly = a || s, x.readOnly = s, _.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : We ? "New update" : t.launcherLabel, x.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, L.hidden = a;
|
|
855
859
|
}, j = () => {
|
|
856
|
-
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0,
|
|
860
|
+
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, Re.disabled = Qe() || ae(t.billingStatus);
|
|
857
861
|
};
|
|
858
862
|
et();
|
|
859
863
|
const yt = () => {
|
|
@@ -872,7 +876,7 @@ async function qi(e = {}) {
|
|
|
872
876
|
t.onSignupClick?.();
|
|
873
877
|
return;
|
|
874
878
|
}
|
|
875
|
-
ae(t.billingStatus) || (fe = !0, ee(!0, "send"), te(), W =
|
|
879
|
+
ae(t.billingStatus) || (fe = !0, ee(!0, "send"), te(), W = Rt(
|
|
876
880
|
y,
|
|
877
881
|
x,
|
|
878
882
|
W
|
|
@@ -890,10 +894,10 @@ async function qi(e = {}) {
|
|
|
890
894
|
}, Ct = async (a) => {
|
|
891
895
|
if (a.length === 0)
|
|
892
896
|
return;
|
|
893
|
-
const s =
|
|
897
|
+
const s = za(y, a);
|
|
894
898
|
W = [...W, ...s], Ee(), Uo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || ge();
|
|
895
899
|
};
|
|
896
|
-
|
|
900
|
+
Re.addEventListener("click", () => {
|
|
897
901
|
t.loginRequired || ae(t.billingStatus) || Q.click();
|
|
898
902
|
}), Q.addEventListener("change", () => {
|
|
899
903
|
const a = Array.from(Q.files ?? []);
|
|
@@ -938,7 +942,7 @@ async function qi(e = {}) {
|
|
|
938
942
|
y.stop();
|
|
939
943
|
return;
|
|
940
944
|
}
|
|
941
|
-
fe = !0, ee(!0, "send"), te(), W =
|
|
945
|
+
fe = !0, ee(!0, "send"), te(), W = Rt(
|
|
942
946
|
y,
|
|
943
947
|
x,
|
|
944
948
|
W
|
|
@@ -955,7 +959,7 @@ async function qi(e = {}) {
|
|
|
955
959
|
t.onLoginClick?.();
|
|
956
960
|
return;
|
|
957
961
|
}
|
|
958
|
-
fe = !0, ee(!0, "send"), te(), W =
|
|
962
|
+
fe = !0, ee(!0, "send"), te(), W = Rt(
|
|
959
963
|
y,
|
|
960
964
|
x,
|
|
961
965
|
W
|
|
@@ -963,7 +967,7 @@ async function qi(e = {}) {
|
|
|
963
967
|
}
|
|
964
968
|
}), i.addEventListener("click", (a) => {
|
|
965
969
|
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
966
|
-
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1),
|
|
970
|
+
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1), aa(l, i, _, x);
|
|
967
971
|
const tt = () => r;
|
|
968
972
|
let St = y.getState().appearance !== null, nt = null, $e = null, Pe = null, un = y.getState().isThinking, Ie = null;
|
|
969
973
|
const qe = t.taskNotifications;
|
|
@@ -1009,7 +1013,7 @@ async function qi(e = {}) {
|
|
|
1009
1013
|
De || (De = gt(
|
|
1010
1014
|
"pluno-pa-widget__new-chat",
|
|
1011
1015
|
"New chat",
|
|
1012
|
-
|
|
1016
|
+
Ca(),
|
|
1013
1017
|
!1
|
|
1014
1018
|
), De.addEventListener("click", Go), Ye.insertBefore(De, X));
|
|
1015
1019
|
}, G = (a) => {
|
|
@@ -1043,10 +1047,10 @@ async function qi(e = {}) {
|
|
|
1043
1047
|
);
|
|
1044
1048
|
return;
|
|
1045
1049
|
}
|
|
1046
|
-
const s =
|
|
1050
|
+
const s = la(a), w = s !== nn;
|
|
1047
1051
|
nn = s;
|
|
1048
1052
|
const S = fe || we.enabled;
|
|
1049
|
-
fe = !1,
|
|
1053
|
+
fe = !1, Ha(
|
|
1050
1054
|
N,
|
|
1051
1055
|
ht,
|
|
1052
1056
|
de,
|
|
@@ -1079,10 +1083,10 @@ async function qi(e = {}) {
|
|
|
1079
1083
|
ke.add(M.id), Xe.add(M.id), B(), $e = null, G(y.getState());
|
|
1080
1084
|
},
|
|
1081
1085
|
onDisable: (M) => {
|
|
1082
|
-
ft = !0, ke.add(M.id), Xe.add(M.id), B(),
|
|
1086
|
+
ft = !0, ke.add(M.id), Xe.add(M.id), B(), dr(t, !0), $e = null, G(y.getState());
|
|
1083
1087
|
}
|
|
1084
1088
|
} : void 0
|
|
1085
|
-
), S ? (be = N.scrollTop, te()) : w &&
|
|
1089
|
+
), S ? (be = N.scrollTop, te()) : w && pa(a) && Lo();
|
|
1086
1090
|
};
|
|
1087
1091
|
return mn = si(
|
|
1088
1092
|
(a) => {
|
|
@@ -1164,7 +1168,7 @@ async function qi(e = {}) {
|
|
|
1164
1168
|
const s = await t.socialPostDraftHandler(a);
|
|
1165
1169
|
if (!s.linkedinPost || !s.xPost)
|
|
1166
1170
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1167
|
-
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe =
|
|
1171
|
+
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe = Ya(s, {
|
|
1168
1172
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1169
1173
|
onClose: () => {
|
|
1170
1174
|
Pe?.remove(), Pe = null;
|
|
@@ -1201,11 +1205,11 @@ async function qi(e = {}) {
|
|
|
1201
1205
|
function Pn(e, t) {
|
|
1202
1206
|
return { accentColor: e, scribbleStyle: t };
|
|
1203
1207
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const t =
|
|
1206
|
-
return t === null ? "#fafafa" :
|
|
1208
|
+
function $i(e) {
|
|
1209
|
+
const t = qi(e);
|
|
1210
|
+
return t === null ? "#fafafa" : ji(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1207
1211
|
}
|
|
1208
|
-
function
|
|
1212
|
+
function qi(e) {
|
|
1209
1213
|
const t = e.trim();
|
|
1210
1214
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1211
1215
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1217,7 +1221,7 @@ function Vi(e) {
|
|
|
1217
1221
|
Number.parseInt(t[3] + t[3], 16)
|
|
1218
1222
|
] : null;
|
|
1219
1223
|
}
|
|
1220
|
-
function
|
|
1224
|
+
function ji([e, t, n]) {
|
|
1221
1225
|
const o = (i) => {
|
|
1222
1226
|
const r = i / 255;
|
|
1223
1227
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
@@ -1235,8 +1239,8 @@ function In(e, t, n) {
|
|
|
1235
1239
|
const o = n.scribbleStyle ? Kn(n.accentColor) : n.accentColor;
|
|
1236
1240
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1237
1241
|
"--pluno-pa-accent-contrast",
|
|
1238
|
-
|
|
1239
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ai : n.fontFamily, n.scribbleStyle &&
|
|
1242
|
+
$i(o)
|
|
1243
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ai : n.fontFamily, n.scribbleStyle && Vi(e.ownerDocument);
|
|
1240
1244
|
const i = Array.from(
|
|
1241
1245
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1242
1246
|
);
|
|
@@ -1248,7 +1252,7 @@ function In(e, t, n) {
|
|
|
1248
1252
|
)
|
|
1249
1253
|
);
|
|
1250
1254
|
}
|
|
1251
|
-
function
|
|
1255
|
+
function Vi(e) {
|
|
1252
1256
|
if (e.getElementById(Sn))
|
|
1253
1257
|
return;
|
|
1254
1258
|
const t = e.createElement("style");
|
|
@@ -1260,7 +1264,7 @@ function Yi(e) {
|
|
|
1260
1264
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1261
1265
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1262
1266
|
}
|
|
1263
|
-
function
|
|
1267
|
+
function Ki({
|
|
1264
1268
|
root: e,
|
|
1265
1269
|
launcher: t,
|
|
1266
1270
|
launcherDragHandle: n,
|
|
@@ -1279,7 +1283,7 @@ function Xi({
|
|
|
1279
1283
|
h.preventDefault();
|
|
1280
1284
|
const P = h.clientX - p.x, A = h.clientY - p.y;
|
|
1281
1285
|
!c && Math.hypot(P, A) < jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + P, y: d.y + A }));
|
|
1282
|
-
},
|
|
1286
|
+
}, R = (h) => {
|
|
1283
1287
|
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1284
1288
|
}, _ = (h) => {
|
|
1285
1289
|
l === h.pointerId && (h.preventDefault(), m());
|
|
@@ -1298,11 +1302,11 @@ function Xi({
|
|
|
1298
1302
|
let L = null;
|
|
1299
1303
|
h.key === "ArrowUp" ? L = { x: A.x, y: A.y - P } : h.key === "ArrowDown" ? L = { x: A.x, y: A.y + P } : h.key === "ArrowLeft" ? L = { x: A.x - P, y: A.y } : h.key === "ArrowRight" && (L = { x: A.x + P, y: A.y }), L && (h.preventDefault(), h.stopPropagation(), i(L), r());
|
|
1300
1304
|
};
|
|
1301
|
-
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup",
|
|
1302
|
-
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup",
|
|
1305
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", R), t.addEventListener("pointercancel", _), t.addEventListener("click", g, !0), n.addEventListener("keydown", b), () => {
|
|
1306
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", R), t.removeEventListener("pointercancel", _), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", b);
|
|
1303
1307
|
};
|
|
1304
1308
|
}
|
|
1305
|
-
function
|
|
1309
|
+
function Yi({
|
|
1306
1310
|
root: e,
|
|
1307
1311
|
handles: t,
|
|
1308
1312
|
getBounds: n,
|
|
@@ -1325,7 +1329,7 @@ function Zi({
|
|
|
1325
1329
|
));
|
|
1326
1330
|
}, v = (g) => {
|
|
1327
1331
|
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1328
|
-
},
|
|
1332
|
+
}, R = (g) => {
|
|
1329
1333
|
r === g.pointerId && (g.preventDefault(), u());
|
|
1330
1334
|
}, _ = (g) => {
|
|
1331
1335
|
const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? oo : no, A = n();
|
|
@@ -1333,10 +1337,10 @@ function Zi({
|
|
|
1333
1337
|
An(h) && (g.key === "ArrowLeft" ? L = -P : g.key === "ArrowRight" ? L = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(L === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(Nn(A, h, L, F)), i()));
|
|
1334
1338
|
};
|
|
1335
1339
|
for (const g of t)
|
|
1336
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel",
|
|
1340
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", R), g.addEventListener("keydown", _);
|
|
1337
1341
|
return () => {
|
|
1338
1342
|
for (const g of t)
|
|
1339
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel",
|
|
1343
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", R), g.removeEventListener("keydown", _);
|
|
1340
1344
|
};
|
|
1341
1345
|
}
|
|
1342
1346
|
function An(e) {
|
|
@@ -1387,7 +1391,11 @@ function Tn({
|
|
|
1387
1391
|
if (o) {
|
|
1388
1392
|
const c = e + n;
|
|
1389
1393
|
if (c >= r) {
|
|
1390
|
-
const m = K(
|
|
1394
|
+
const m = K(
|
|
1395
|
+
c,
|
|
1396
|
+
r,
|
|
1397
|
+
d - p
|
|
1398
|
+
);
|
|
1391
1399
|
return { leading: m, length: d - m };
|
|
1392
1400
|
}
|
|
1393
1401
|
const u = K(
|
|
@@ -1419,39 +1427,36 @@ function Tn({
|
|
|
1419
1427
|
function dt(e, t = !0) {
|
|
1420
1428
|
const n = Y();
|
|
1421
1429
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1422
|
-
return
|
|
1423
|
-
width: Ni,
|
|
1424
|
-
height: Ti
|
|
1425
|
-
} : { width: En, height: En };
|
|
1430
|
+
return { width: En, height: En };
|
|
1426
1431
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1427
1432
|
return {
|
|
1428
1433
|
width: t && i && o.width > 0 ? o.width : Math.min(Qn, n.width - 36),
|
|
1429
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1434
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Ti : eo
|
|
1430
1435
|
};
|
|
1431
1436
|
}
|
|
1432
|
-
function
|
|
1437
|
+
function Xi() {
|
|
1433
1438
|
const e = Y();
|
|
1434
1439
|
return {
|
|
1435
1440
|
width: Math.min(
|
|
1436
1441
|
K(
|
|
1437
|
-
e.width *
|
|
1442
|
+
e.width * zi,
|
|
1438
1443
|
Jt,
|
|
1439
|
-
|
|
1444
|
+
Di
|
|
1440
1445
|
),
|
|
1441
1446
|
e.width - I * 2
|
|
1442
1447
|
),
|
|
1443
1448
|
height: Math.min(
|
|
1444
1449
|
K(
|
|
1445
|
-
e.height *
|
|
1450
|
+
e.height * Mi,
|
|
1446
1451
|
Qt,
|
|
1447
|
-
|
|
1452
|
+
Ri
|
|
1448
1453
|
),
|
|
1449
1454
|
e.height - Ce - I
|
|
1450
1455
|
)
|
|
1451
1456
|
};
|
|
1452
1457
|
}
|
|
1453
|
-
function
|
|
1454
|
-
return e ? ut(e) :
|
|
1458
|
+
function ze(e = null) {
|
|
1459
|
+
return e ? ut(e) : Xi();
|
|
1455
1460
|
}
|
|
1456
1461
|
function ut(e) {
|
|
1457
1462
|
const t = Y();
|
|
@@ -1488,7 +1493,7 @@ function Nt(e, t) {
|
|
|
1488
1493
|
const n = ut(t);
|
|
1489
1494
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1490
1495
|
}
|
|
1491
|
-
function
|
|
1496
|
+
function Zi(e, t, n) {
|
|
1492
1497
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1493
1498
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1494
1499
|
return { x: o, y: i };
|
|
@@ -1507,9 +1512,9 @@ function Tt(e, t, n) {
|
|
|
1507
1512
|
e,
|
|
1508
1513
|
ro(t, o),
|
|
1509
1514
|
o
|
|
1510
|
-
) :
|
|
1515
|
+
) : Ji(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Ni);
|
|
1511
1516
|
}
|
|
1512
|
-
function
|
|
1517
|
+
function Ji(e, t, n) {
|
|
1513
1518
|
const o = Y();
|
|
1514
1519
|
return {
|
|
1515
1520
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
@@ -1517,7 +1522,7 @@ function ea(e, t, n) {
|
|
|
1517
1522
|
};
|
|
1518
1523
|
}
|
|
1519
1524
|
function Vt(e, t, n) {
|
|
1520
|
-
const o = Y(), i = I +
|
|
1525
|
+
const o = Y(), i = I + ta(e);
|
|
1521
1526
|
return {
|
|
1522
1527
|
x: K(
|
|
1523
1528
|
t.x,
|
|
@@ -1544,23 +1549,23 @@ function ro(e, t) {
|
|
|
1544
1549
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1545
1550
|
};
|
|
1546
1551
|
}
|
|
1547
|
-
function
|
|
1548
|
-
const n =
|
|
1552
|
+
function Qi(e, t) {
|
|
1553
|
+
const n = ea(e, t), o = Y();
|
|
1549
1554
|
return {
|
|
1550
1555
|
anchor: n,
|
|
1551
1556
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1552
1557
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1553
1558
|
};
|
|
1554
1559
|
}
|
|
1555
|
-
function
|
|
1560
|
+
function ea(e, t) {
|
|
1556
1561
|
const n = Y(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1557
1562
|
return `${r}-${l}`;
|
|
1558
1563
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1564
|
+
function ta(e) {
|
|
1565
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Fi : Ui;
|
|
1561
1566
|
}
|
|
1562
1567
|
function Dt(e, t, n, o = null) {
|
|
1563
|
-
const i = dt(e), r =
|
|
1568
|
+
const i = dt(e), r = ze(o), l = {
|
|
1564
1569
|
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1565
1570
|
y: t.y + i.height - r.height
|
|
1566
1571
|
};
|
|
@@ -1594,7 +1599,7 @@ function ve(e, t) {
|
|
|
1594
1599
|
}
|
|
1595
1600
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1596
1601
|
}
|
|
1597
|
-
function
|
|
1602
|
+
function na(e, t) {
|
|
1598
1603
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1599
1604
|
}
|
|
1600
1605
|
function Dn(e) {
|
|
@@ -1606,7 +1611,7 @@ function Y() {
|
|
|
1606
1611
|
height: window.innerHeight || document.documentElement.clientHeight || eo + I * 2
|
|
1607
1612
|
};
|
|
1608
1613
|
}
|
|
1609
|
-
function
|
|
1614
|
+
function zt(e) {
|
|
1610
1615
|
const t = e.getBoundingClientRect();
|
|
1611
1616
|
return {
|
|
1612
1617
|
x: Math.round(t.x),
|
|
@@ -1631,20 +1636,20 @@ function J(e, t, n) {
|
|
|
1631
1636
|
new CustomEvent(Si, { detail: i })
|
|
1632
1637
|
);
|
|
1633
1638
|
}
|
|
1634
|
-
function
|
|
1639
|
+
function oa(e, t) {
|
|
1635
1640
|
J("web-sdk.widget.position", e, t);
|
|
1636
1641
|
}
|
|
1637
|
-
function
|
|
1642
|
+
function Rt(e, t, n) {
|
|
1638
1643
|
const o = t.value.trim();
|
|
1639
1644
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1640
|
-
attachments: n.length > 0 ? n.map(
|
|
1645
|
+
attachments: n.length > 0 ? n.map(ra) : void 0
|
|
1641
1646
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1642
1647
|
}
|
|
1643
|
-
function
|
|
1648
|
+
function ia(e, t, n) {
|
|
1644
1649
|
const o = e.activeElement;
|
|
1645
1650
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1646
1651
|
}
|
|
1647
|
-
function
|
|
1652
|
+
function aa(e, t, n, o) {
|
|
1648
1653
|
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > mi)
|
|
1649
1654
|
return;
|
|
1650
1655
|
const i = e.focusedInput === "composer" ? o : n;
|
|
@@ -1652,7 +1657,7 @@ function la(e, t, n, o) {
|
|
|
1652
1657
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1653
1658
|
});
|
|
1654
1659
|
}
|
|
1655
|
-
function
|
|
1660
|
+
function ra(e) {
|
|
1656
1661
|
return e;
|
|
1657
1662
|
}
|
|
1658
1663
|
function je(e) {
|
|
@@ -1665,7 +1670,7 @@ function Ve(e, t = () => !0) {
|
|
|
1665
1670
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1666
1671
|
});
|
|
1667
1672
|
}
|
|
1668
|
-
function
|
|
1673
|
+
function la(e) {
|
|
1669
1674
|
const t = e.messages[e.messages.length - 1];
|
|
1670
1675
|
return [
|
|
1671
1676
|
e.messages.length,
|
|
@@ -1676,13 +1681,13 @@ function sa(e) {
|
|
|
1676
1681
|
e.lastError ?? ""
|
|
1677
1682
|
].join(":");
|
|
1678
1683
|
}
|
|
1679
|
-
function
|
|
1684
|
+
function pa(e) {
|
|
1680
1685
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1681
1686
|
}
|
|
1682
|
-
function
|
|
1687
|
+
function sa(e) {
|
|
1683
1688
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1684
1689
|
}
|
|
1685
|
-
function
|
|
1690
|
+
function da(e) {
|
|
1686
1691
|
const t = e.currentPage;
|
|
1687
1692
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1688
1693
|
try {
|
|
@@ -1693,7 +1698,7 @@ function ua(e) {
|
|
|
1693
1698
|
}
|
|
1694
1699
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1695
1700
|
}
|
|
1696
|
-
function
|
|
1701
|
+
function ca(e, t) {
|
|
1697
1702
|
const n = new Date(e).getTime();
|
|
1698
1703
|
if (!Number.isFinite(n))
|
|
1699
1704
|
return "now";
|
|
@@ -1709,9 +1714,9 @@ function ga(e, t) {
|
|
|
1709
1714
|
}
|
|
1710
1715
|
return "now";
|
|
1711
1716
|
}
|
|
1712
|
-
function
|
|
1713
|
-
e.appendChild(
|
|
1714
|
-
|
|
1717
|
+
function ua(e, t, n, o, i) {
|
|
1718
|
+
e.appendChild(ya()), e.appendChild(
|
|
1719
|
+
ga(
|
|
1715
1720
|
t,
|
|
1716
1721
|
n,
|
|
1717
1722
|
o,
|
|
@@ -1721,12 +1726,12 @@ function ha(e, t, n, o, i) {
|
|
|
1721
1726
|
gt(
|
|
1722
1727
|
"pluno-pa-widget__close",
|
|
1723
1728
|
"Close",
|
|
1724
|
-
|
|
1729
|
+
va(16),
|
|
1725
1730
|
!0
|
|
1726
1731
|
)
|
|
1727
|
-
), e.appendChild(
|
|
1732
|
+
), e.appendChild(ha(n));
|
|
1728
1733
|
}
|
|
1729
|
-
function
|
|
1734
|
+
function ga(e, t, n, o) {
|
|
1730
1735
|
const i = document.createElement("form");
|
|
1731
1736
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1732
1737
|
const d = document.createElement("button");
|
|
@@ -1754,7 +1759,7 @@ function ma(e, t, n, o) {
|
|
|
1754
1759
|
}
|
|
1755
1760
|
return i;
|
|
1756
1761
|
}
|
|
1757
|
-
function
|
|
1762
|
+
function ha(e) {
|
|
1758
1763
|
const t = document.createElement("section");
|
|
1759
1764
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1760
1765
|
co("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
@@ -1762,7 +1767,7 @@ function fa(e) {
|
|
|
1762
1767
|
const n = document.createElement("div");
|
|
1763
1768
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1764
1769
|
const o = document.createElement("main");
|
|
1765
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1770
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(ba(e));
|
|
1766
1771
|
const i = document.createElement("div");
|
|
1767
1772
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1768
1773
|
const r = document.createElement("div");
|
|
@@ -1774,10 +1779,10 @@ function fa(e) {
|
|
|
1774
1779
|
gt(
|
|
1775
1780
|
"pluno-pa-widget__history",
|
|
1776
1781
|
Kt(),
|
|
1777
|
-
|
|
1782
|
+
Sa(),
|
|
1778
1783
|
!0
|
|
1779
1784
|
)
|
|
1780
|
-
), n.appendChild(p), n.appendChild(
|
|
1785
|
+
), n.appendChild(p), n.appendChild(wa()), t.appendChild(n), t.appendChild(ma()), t.appendChild(fa()), t.appendChild(he("left", "Resize Pluno from left")), t.appendChild(
|
|
1781
1786
|
he("right", "Resize Pluno from right")
|
|
1782
1787
|
), t.appendChild(he("top", "Resize Pluno from top")), t.appendChild(
|
|
1783
1788
|
he("bottom", "Resize Pluno from bottom")
|
|
@@ -1798,7 +1803,7 @@ function he(e, t) {
|
|
|
1798
1803
|
`pluno-pa-widget__resize-handle--${e}`
|
|
1799
1804
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1800
1805
|
}
|
|
1801
|
-
function
|
|
1806
|
+
function ma() {
|
|
1802
1807
|
const e = document.createElement("div");
|
|
1803
1808
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1804
1809
|
const t = document.createElement("span");
|
|
@@ -1812,7 +1817,7 @@ function wa() {
|
|
|
1812
1817
|
const r = document.createElement("button");
|
|
1813
1818
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1814
1819
|
}
|
|
1815
|
-
function
|
|
1820
|
+
function fa() {
|
|
1816
1821
|
const e = document.createElement("form");
|
|
1817
1822
|
e.className = "pluno-pa-widget__composer";
|
|
1818
1823
|
const t = document.createElement("div");
|
|
@@ -1826,7 +1831,7 @@ function ba() {
|
|
|
1826
1831
|
const r = document.createElement("input");
|
|
1827
1832
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1828
1833
|
const l = document.createElement("button");
|
|
1829
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1834
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(ka()), l.appendChild(La()), i.appendChild(l);
|
|
1830
1835
|
const p = document.createElement("textarea");
|
|
1831
1836
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1832
1837
|
const d = document.createElement("button");
|
|
@@ -1841,7 +1846,7 @@ function ba() {
|
|
|
1841
1846
|
function Kt() {
|
|
1842
1847
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1843
1848
|
}
|
|
1844
|
-
function
|
|
1849
|
+
function wa() {
|
|
1845
1850
|
const e = document.createElement("section");
|
|
1846
1851
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Kt());
|
|
1847
1852
|
const t = document.createElement("div");
|
|
@@ -1851,7 +1856,7 @@ function _a() {
|
|
|
1851
1856
|
const o = gt(
|
|
1852
1857
|
"pluno-pa-widget__history-close",
|
|
1853
1858
|
"Close recent chats",
|
|
1854
|
-
|
|
1859
|
+
Ea(),
|
|
1855
1860
|
!1
|
|
1856
1861
|
);
|
|
1857
1862
|
t.append(n, o);
|
|
@@ -1860,7 +1865,7 @@ function _a() {
|
|
|
1860
1865
|
const r = document.createElement("p");
|
|
1861
1866
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1862
1867
|
}
|
|
1863
|
-
function
|
|
1868
|
+
function ba(e) {
|
|
1864
1869
|
const t = document.createElement("div");
|
|
1865
1870
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1866
1871
|
me(
|
|
@@ -1888,13 +1893,13 @@ function po(e, t) {
|
|
|
1888
1893
|
function me(e, t) {
|
|
1889
1894
|
const n = `pluno-pa-character-${Ln}`;
|
|
1890
1895
|
Ln += 1;
|
|
1891
|
-
const o = t.scribbleStyle ?
|
|
1896
|
+
const o = t.scribbleStyle ? xa(t.accentColor, n) : _a(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1892
1897
|
return o.setAttribute(
|
|
1893
1898
|
"class",
|
|
1894
1899
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1895
1900
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1896
1901
|
}
|
|
1897
|
-
function
|
|
1902
|
+
function _a(e, t) {
|
|
1898
1903
|
const n = Yo(e), o = {
|
|
1899
1904
|
boltFill: `${t}-boltFill`,
|
|
1900
1905
|
boltEdge: `${t}-boltEdge`,
|
|
@@ -2008,7 +2013,7 @@ function ya(e, t) {
|
|
|
2008
2013
|
"flood-color": n.shadow,
|
|
2009
2014
|
"flood-opacity": "0.3"
|
|
2010
2015
|
});
|
|
2011
|
-
const
|
|
2016
|
+
const R = f(r, "filter", {
|
|
2012
2017
|
id: o.pupilGloss,
|
|
2013
2018
|
x: "-15%",
|
|
2014
2019
|
y: "-15%",
|
|
@@ -2016,7 +2021,7 @@ function ya(e, t) {
|
|
|
2016
2021
|
height: "130%",
|
|
2017
2022
|
"color-interpolation-filters": "sRGB"
|
|
2018
2023
|
});
|
|
2019
|
-
f(
|
|
2024
|
+
f(R, "feDropShadow", {
|
|
2020
2025
|
dx: "0",
|
|
2021
2026
|
dy: "3",
|
|
2022
2027
|
stdDeviation: "3",
|
|
@@ -2069,7 +2074,7 @@ function ya(e, t) {
|
|
|
2069
2074
|
opacity: "0.48"
|
|
2070
2075
|
});
|
|
2071
2076
|
const P = f(i, "g", { filter: V(o.eyeShadow) });
|
|
2072
|
-
return
|
|
2077
|
+
return zn(
|
|
2073
2078
|
P,
|
|
2074
2079
|
"rotate(-2 528 463)",
|
|
2075
2080
|
"528",
|
|
@@ -2079,7 +2084,7 @@ function ya(e, t) {
|
|
|
2079
2084
|
"557",
|
|
2080
2085
|
"447",
|
|
2081
2086
|
o
|
|
2082
|
-
),
|
|
2087
|
+
), zn(
|
|
2083
2088
|
P,
|
|
2084
2089
|
"rotate(2 717 462)",
|
|
2085
2090
|
"717",
|
|
@@ -2091,7 +2096,7 @@ function ya(e, t) {
|
|
|
2091
2096
|
o
|
|
2092
2097
|
), i;
|
|
2093
2098
|
}
|
|
2094
|
-
function
|
|
2099
|
+
function xa(e, t) {
|
|
2095
2100
|
const n = Kn(e), o = {
|
|
2096
2101
|
clip: `${t}-scribbleBoltClip`,
|
|
2097
2102
|
wobble: `${t}-scribbleBoltWobble`
|
|
@@ -2136,7 +2141,7 @@ function va(e, t) {
|
|
|
2136
2141
|
stroke: st,
|
|
2137
2142
|
"stroke-width": "18",
|
|
2138
2143
|
"stroke-linejoin": "round"
|
|
2139
|
-
}),
|
|
2144
|
+
}), Rn(
|
|
2140
2145
|
d,
|
|
2141
2146
|
"rotate(-2 528 463)",
|
|
2142
2147
|
"528",
|
|
@@ -2145,7 +2150,7 @@ function va(e, t) {
|
|
|
2145
2150
|
"473",
|
|
2146
2151
|
"557",
|
|
2147
2152
|
"447"
|
|
2148
|
-
),
|
|
2153
|
+
), Rn(
|
|
2149
2154
|
d,
|
|
2150
2155
|
"rotate(2 717 462)",
|
|
2151
2156
|
"717",
|
|
@@ -2162,7 +2167,7 @@ function so() {
|
|
|
2162
2167
|
viewBox: "0 0 1254 1254"
|
|
2163
2168
|
});
|
|
2164
2169
|
}
|
|
2165
|
-
function
|
|
2170
|
+
function zn(e, t, n, o, i, r, l, p, d) {
|
|
2166
2171
|
const c = f(e, "g", { transform: t });
|
|
2167
2172
|
f(c, "ellipse", {
|
|
2168
2173
|
cx: n,
|
|
@@ -2184,7 +2189,7 @@ function Rn(e, t, n, o, i, r, l, p, d) {
|
|
|
2184
2189
|
fill: "#ffffff"
|
|
2185
2190
|
});
|
|
2186
2191
|
}
|
|
2187
|
-
function
|
|
2192
|
+
function Rn(e, t, n, o, i, r, l, p) {
|
|
2188
2193
|
const d = f(e, "g", { transform: t });
|
|
2189
2194
|
f(d, "ellipse", {
|
|
2190
2195
|
cx: n,
|
|
@@ -2222,7 +2227,7 @@ function gt(e, t, n, o) {
|
|
|
2222
2227
|
const i = document.createElement("button");
|
|
2223
2228
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2224
2229
|
}
|
|
2225
|
-
function
|
|
2230
|
+
function ya() {
|
|
2226
2231
|
const e = E("svg", {
|
|
2227
2232
|
class: "pluno-pa-widget__scribble-defs",
|
|
2228
2233
|
"aria-hidden": "true",
|
|
@@ -2252,7 +2257,7 @@ function Mt(e, t) {
|
|
|
2252
2257
|
0,
|
|
2253
2258
|
t - qt * 2
|
|
2254
2259
|
), o = Math.max(
|
|
2255
|
-
|
|
2260
|
+
Bi,
|
|
2256
2261
|
Math.floor(
|
|
2257
2262
|
(n - $t * 2) / Gt
|
|
2258
2263
|
)
|
|
@@ -2265,7 +2270,7 @@ function uo(e, t) {
|
|
|
2265
2270
|
const n = t * Gt + $t * 2;
|
|
2266
2271
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2267
2272
|
"viewBox",
|
|
2268
|
-
`0 0 ${n} ${
|
|
2273
|
+
`0 0 ${n} ${Oi}`
|
|
2269
2274
|
), e.replaceChildren();
|
|
2270
2275
|
for (let o = 0; o < t; o += 1) {
|
|
2271
2276
|
const i = kn[o % kn.length], r = E("g", {
|
|
@@ -2336,7 +2341,7 @@ function Ot(e, t, n) {
|
|
|
2336
2341
|
})
|
|
2337
2342
|
), o;
|
|
2338
2343
|
}
|
|
2339
|
-
function
|
|
2344
|
+
function va(e) {
|
|
2340
2345
|
const t = re(
|
|
2341
2346
|
"0 0 24 24",
|
|
2342
2347
|
e,
|
|
@@ -2347,7 +2352,7 @@ function Sa(e) {
|
|
|
2347
2352
|
);
|
|
2348
2353
|
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2349
2354
|
}
|
|
2350
|
-
function
|
|
2355
|
+
function Ca() {
|
|
2351
2356
|
const e = re(
|
|
2352
2357
|
"0 0 24 24",
|
|
2353
2358
|
17,
|
|
@@ -2366,7 +2371,7 @@ function Ea() {
|
|
|
2366
2371
|
})
|
|
2367
2372
|
), e;
|
|
2368
2373
|
}
|
|
2369
|
-
function
|
|
2374
|
+
function Sa() {
|
|
2370
2375
|
const e = re(
|
|
2371
2376
|
"0 0 24 24",
|
|
2372
2377
|
17,
|
|
@@ -2377,7 +2382,7 @@ function ka() {
|
|
|
2377
2382
|
);
|
|
2378
2383
|
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2379
2384
|
}
|
|
2380
|
-
function
|
|
2385
|
+
function Ea() {
|
|
2381
2386
|
const e = re(
|
|
2382
2387
|
"0 0 24 24",
|
|
2383
2388
|
15,
|
|
@@ -2401,7 +2406,7 @@ function go() {
|
|
|
2401
2406
|
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2402
2407
|
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2403
2408
|
}
|
|
2404
|
-
function
|
|
2409
|
+
function ka() {
|
|
2405
2410
|
const e = re(
|
|
2406
2411
|
"0 0 24 24",
|
|
2407
2412
|
16,
|
|
@@ -2419,7 +2424,7 @@ function Pa() {
|
|
|
2419
2424
|
})
|
|
2420
2425
|
), e;
|
|
2421
2426
|
}
|
|
2422
|
-
function
|
|
2427
|
+
function La() {
|
|
2423
2428
|
const e = re("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2424
2429
|
return e.setAttribute(
|
|
2425
2430
|
"class",
|
|
@@ -2434,7 +2439,7 @@ function Ia() {
|
|
|
2434
2439
|
})
|
|
2435
2440
|
), e;
|
|
2436
2441
|
}
|
|
2437
|
-
function
|
|
2442
|
+
function Pa() {
|
|
2438
2443
|
const e = re("0 0 24 24", 18, 18, "currentColor");
|
|
2439
2444
|
return e.appendChild(
|
|
2440
2445
|
E("rect", {
|
|
@@ -2446,7 +2451,7 @@ function Aa() {
|
|
|
2446
2451
|
})
|
|
2447
2452
|
), e;
|
|
2448
2453
|
}
|
|
2449
|
-
function
|
|
2454
|
+
function Ia() {
|
|
2450
2455
|
const e = re(
|
|
2451
2456
|
"0 0 24 24",
|
|
2452
2457
|
12,
|
|
@@ -2457,7 +2462,7 @@ function Na() {
|
|
|
2457
2462
|
);
|
|
2458
2463
|
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2459
2464
|
}
|
|
2460
|
-
function
|
|
2465
|
+
function Aa() {
|
|
2461
2466
|
const e = re(
|
|
2462
2467
|
"0 0 24 24",
|
|
2463
2468
|
13,
|
|
@@ -2503,42 +2508,65 @@ function Mn(e) {
|
|
|
2503
2508
|
n.stopPropagation();
|
|
2504
2509
|
});
|
|
2505
2510
|
}
|
|
2506
|
-
function
|
|
2511
|
+
function Na(e, t, n) {
|
|
2507
2512
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2508
2513
|
for (const [o, i] of t.entries()) {
|
|
2509
2514
|
const r = document.createElement("div");
|
|
2510
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2515
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Ta(i));
|
|
2511
2516
|
const l = document.createElement("span");
|
|
2512
2517
|
l.textContent = i.name, r.appendChild(l);
|
|
2513
2518
|
const p = document.createElement("button");
|
|
2514
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2519
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ia()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2515
2520
|
}
|
|
2516
2521
|
}
|
|
2517
|
-
function
|
|
2522
|
+
function Ta(e) {
|
|
2518
2523
|
const t = en(e), n = ho(e);
|
|
2519
2524
|
if (t === "image" && n) {
|
|
2520
2525
|
const o = document.createElement("img");
|
|
2521
|
-
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2526
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2527
|
+
"error",
|
|
2528
|
+
() => o.replaceWith(ie(e))
|
|
2529
|
+
), o;
|
|
2522
2530
|
}
|
|
2523
2531
|
if (t === "video" && n) {
|
|
2524
2532
|
const o = document.createElement("video");
|
|
2525
|
-
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2533
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
2534
|
+
"error",
|
|
2535
|
+
() => o.replaceWith(ie(e))
|
|
2536
|
+
), o.addEventListener(
|
|
2537
|
+
"stalled",
|
|
2538
|
+
() => o.replaceWith(ie(e))
|
|
2539
|
+
), o;
|
|
2526
2540
|
}
|
|
2527
2541
|
return ie(e);
|
|
2528
2542
|
}
|
|
2529
|
-
function
|
|
2543
|
+
function Da(e) {
|
|
2530
2544
|
const t = en(e), n = ho(e);
|
|
2531
2545
|
if (t === "image" && n) {
|
|
2532
2546
|
const o = document.createElement("img");
|
|
2533
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener(
|
|
2547
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener(
|
|
2548
|
+
"error",
|
|
2549
|
+
() => o.replaceWith(ie(e, "message"))
|
|
2550
|
+
), o;
|
|
2534
2551
|
}
|
|
2535
2552
|
if (t === "pdf" && n) {
|
|
2536
2553
|
const o = document.createElement("object");
|
|
2537
|
-
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener(
|
|
2554
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener(
|
|
2555
|
+
"error",
|
|
2556
|
+
() => o.replaceWith(
|
|
2557
|
+
ie(e, "message")
|
|
2558
|
+
)
|
|
2559
|
+
), o.appendChild(ie(e, "message")), o;
|
|
2538
2560
|
}
|
|
2539
2561
|
if (t === "video" && n) {
|
|
2540
2562
|
const o = document.createElement("video");
|
|
2541
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener(
|
|
2563
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener(
|
|
2564
|
+
"error",
|
|
2565
|
+
() => o.replaceWith(ie(e, "message"))
|
|
2566
|
+
), o.addEventListener(
|
|
2567
|
+
"stalled",
|
|
2568
|
+
() => o.replaceWith(ie(e, "message"))
|
|
2569
|
+
), o;
|
|
2542
2570
|
}
|
|
2543
2571
|
return ie(e, "message");
|
|
2544
2572
|
}
|
|
@@ -2564,13 +2592,13 @@ function On(e) {
|
|
|
2564
2592
|
const t = en(e);
|
|
2565
2593
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2566
2594
|
}
|
|
2567
|
-
function
|
|
2595
|
+
function za(e, t) {
|
|
2568
2596
|
return t ? Array.from(t).map((o) => ({
|
|
2569
2597
|
...e.createLocalAttachment(o),
|
|
2570
|
-
previewUrl:
|
|
2598
|
+
previewUrl: Ra(o)
|
|
2571
2599
|
})) : [];
|
|
2572
2600
|
}
|
|
2573
|
-
function
|
|
2601
|
+
function Ra(e) {
|
|
2574
2602
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2575
2603
|
}
|
|
2576
2604
|
function it(e) {
|
|
@@ -2582,10 +2610,10 @@ function Bt(e, t, n = null) {
|
|
|
2582
2610
|
return;
|
|
2583
2611
|
}
|
|
2584
2612
|
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || tn(n) ? e.appendChild(
|
|
2585
|
-
|
|
2586
|
-
) : mo(t) && e.appendChild(
|
|
2613
|
+
Ma(t, n)
|
|
2614
|
+
) : mo(t) && e.appendChild(Oa(t));
|
|
2587
2615
|
}
|
|
2588
|
-
function
|
|
2616
|
+
function Ma(e, t) {
|
|
2589
2617
|
const n = document.createElement("div");
|
|
2590
2618
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2591
2619
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
@@ -2599,13 +2627,13 @@ function Ba(e, t) {
|
|
|
2599
2627
|
)
|
|
2600
2628
|
), n;
|
|
2601
2629
|
}
|
|
2602
|
-
function
|
|
2630
|
+
function Oa(e) {
|
|
2603
2631
|
const t = document.createElement("div");
|
|
2604
2632
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2605
2633
|
const n = document.createElement("strong");
|
|
2606
2634
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2607
2635
|
const o = document.createElement("span");
|
|
2608
|
-
return o.textContent =
|
|
2636
|
+
return o.textContent = Ua(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2609
2637
|
fo(
|
|
2610
2638
|
e,
|
|
2611
2639
|
"Upgrade",
|
|
@@ -2617,9 +2645,9 @@ function Yt(e, t) {
|
|
|
2617
2645
|
return e !== null && (ae(e) || mo(e) || tn(t));
|
|
2618
2646
|
}
|
|
2619
2647
|
function Bn(e, t, n) {
|
|
2620
|
-
return Yt(t, n) ||
|
|
2648
|
+
return Yt(t, n) || Ba(t) ? !0 : !Yt(e, n);
|
|
2621
2649
|
}
|
|
2622
|
-
function
|
|
2650
|
+
function Ba(e) {
|
|
2623
2651
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
|
|
2624
2652
|
}
|
|
2625
2653
|
function ae(e) {
|
|
@@ -2631,10 +2659,10 @@ function tn(e) {
|
|
|
2631
2659
|
function mo(e) {
|
|
2632
2660
|
return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2633
2661
|
}
|
|
2634
|
-
function
|
|
2635
|
-
return e.creditsRemaining === null ? null : `${
|
|
2662
|
+
function Ua(e) {
|
|
2663
|
+
return e.creditsRemaining === null ? null : `${Fa(e.creditsRemaining)} credits left`;
|
|
2636
2664
|
}
|
|
2637
|
-
function
|
|
2665
|
+
function Fa(e) {
|
|
2638
2666
|
return new Intl.NumberFormat("en-US", {
|
|
2639
2667
|
maximumFractionDigits: 0
|
|
2640
2668
|
}).format(Math.ceil(e));
|
|
@@ -2663,8 +2691,8 @@ function Ut(e, t) {
|
|
|
2663
2691
|
(o) => !wo(o)
|
|
2664
2692
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2665
2693
|
}
|
|
2666
|
-
function
|
|
2667
|
-
const g =
|
|
2694
|
+
function Ha(e, t, n, o, i, r, l, p, d, c, u, m, k, v, R, _) {
|
|
2695
|
+
const g = qa(r), b = g.filter(
|
|
2668
2696
|
(C) => !wo(C)
|
|
2669
2697
|
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(), L = (C) => {
|
|
2670
2698
|
P.push(C);
|
|
@@ -2683,17 +2711,17 @@ function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
|
2683
2711
|
T.appendChild(Se), C.appendChild(T), C.appendChild(lo());
|
|
2684
2712
|
const q = document.createElement("div");
|
|
2685
2713
|
if (q.className = r.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", r.starterPrompts.length === 0 && !r.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), r.starterPrompts.length > 0)
|
|
2686
|
-
for (const
|
|
2714
|
+
for (const z of r.starterPrompts) {
|
|
2687
2715
|
const D = document.createElement("button");
|
|
2688
|
-
D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${
|
|
2689
|
-
z
|
|
2716
|
+
D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${z}"`, D.addEventListener("click", () => {
|
|
2717
|
+
R(z);
|
|
2690
2718
|
}), q.appendChild(D);
|
|
2691
2719
|
}
|
|
2692
2720
|
else if (r.starterPromptsLoading) {
|
|
2693
|
-
const
|
|
2694
|
-
|
|
2721
|
+
const z = document.createElement("button");
|
|
2722
|
+
z.type = "button", z.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", z.disabled = !0, z.tabIndex = -1, z.textContent = "Generating example tasks...", q.appendChild(z);
|
|
2695
2723
|
} else
|
|
2696
|
-
for (let
|
|
2724
|
+
for (let z = 0; z < Ei; z += 1) {
|
|
2697
2725
|
const D = document.createElement("button");
|
|
2698
2726
|
D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
|
|
2699
2727
|
}
|
|
@@ -2701,10 +2729,10 @@ function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
|
2701
2729
|
return;
|
|
2702
2730
|
}
|
|
2703
2731
|
let H = null, $ = null, Q = [];
|
|
2704
|
-
const
|
|
2732
|
+
const Re = b.some(Xt), x = () => {
|
|
2705
2733
|
if (Q.length === 0)
|
|
2706
2734
|
return !1;
|
|
2707
|
-
const C =
|
|
2735
|
+
const C = tr(
|
|
2708
2736
|
Q,
|
|
2709
2737
|
u,
|
|
2710
2738
|
k,
|
|
@@ -2730,16 +2758,21 @@ function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
|
2730
2758
|
}
|
|
2731
2759
|
if (T.role === "system")
|
|
2732
2760
|
continue;
|
|
2733
|
-
const Se = x(), q =
|
|
2761
|
+
const Se = x(), q = er(T.content);
|
|
2734
2762
|
if (T.role === "assistant" && !Se) {
|
|
2735
2763
|
const D = bo(v());
|
|
2736
2764
|
L(D), H = null, $ = D;
|
|
2737
2765
|
}
|
|
2738
|
-
const
|
|
2739
|
-
|
|
2766
|
+
const z = Wa(
|
|
2767
|
+
T,
|
|
2768
|
+
q,
|
|
2769
|
+
m,
|
|
2770
|
+
A
|
|
2771
|
+
);
|
|
2772
|
+
L(z), H = z, $ = null;
|
|
2740
2773
|
}
|
|
2741
2774
|
const de = x(), Ye = b[b.length - 1]?.id === "assistant-draft";
|
|
2742
|
-
if (r.isThinking && !Ye && !
|
|
2775
|
+
if (r.isThinking && !Ye && !Re)
|
|
2743
2776
|
if (de) {
|
|
2744
2777
|
const C = ct();
|
|
2745
2778
|
L(C), H = null, $ = C;
|
|
@@ -2753,7 +2786,7 @@ function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
|
2753
2786
|
}
|
|
2754
2787
|
const X = _ && !r.isThinking ? Qo(g) : null;
|
|
2755
2788
|
if (_ && X && !_.dismissedCandidateIds.has(X.id)) {
|
|
2756
|
-
const C =
|
|
2789
|
+
const C = Ka(X, {
|
|
2757
2790
|
isDrafting: _.draftingCandidateId === X.id,
|
|
2758
2791
|
error: _.error,
|
|
2759
2792
|
characterIconOptions: _.characterIconOptions,
|
|
@@ -2763,18 +2796,27 @@ function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
|
2763
2796
|
});
|
|
2764
2797
|
L(C), _.onSeen(X), H = null, $ = C;
|
|
2765
2798
|
}
|
|
2766
|
-
H?.classList.add(
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2799
|
+
H?.classList.add(
|
|
2800
|
+
"pluno-pa-widget__message--bottom-reserve"
|
|
2801
|
+
), $?.classList.add(
|
|
2802
|
+
"pluno-pa-widget__bottom-reserve-compact"
|
|
2803
|
+
), L(t), $a(
|
|
2804
|
+
m,
|
|
2805
|
+
A
|
|
2806
|
+
), Fn(e, P), d ? Ve(e, c) : e.scrollTop = h;
|
|
2807
|
+
}
|
|
2808
|
+
function Wa(e, t, n, o) {
|
|
2809
|
+
const i = Ga(e, t), r = i ? n.get(i) : void 0;
|
|
2770
2810
|
if (i && r)
|
|
2771
|
-
return r.classList.remove(
|
|
2811
|
+
return r.classList.remove(
|
|
2812
|
+
"pluno-pa-widget__message--bottom-reserve"
|
|
2813
|
+
), o.add(i), r;
|
|
2772
2814
|
const l = document.createElement("div");
|
|
2773
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2815
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? or(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(ja(e.attachments));
|
|
2774
2816
|
const p = document.createElement("div");
|
|
2775
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2817
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Va(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2776
2818
|
}
|
|
2777
|
-
function
|
|
2819
|
+
function Ga(e, t) {
|
|
2778
2820
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2779
2821
|
id: e.id,
|
|
2780
2822
|
content: t,
|
|
@@ -2792,7 +2834,7 @@ function qa(e, t) {
|
|
|
2792
2834
|
})
|
|
2793
2835
|
});
|
|
2794
2836
|
}
|
|
2795
|
-
function
|
|
2837
|
+
function $a(e, t) {
|
|
2796
2838
|
for (const n of e.keys())
|
|
2797
2839
|
t.has(n) || e.delete(n);
|
|
2798
2840
|
}
|
|
@@ -2810,7 +2852,7 @@ function Fn(e, t) {
|
|
|
2810
2852
|
n = n.nextSibling, e.removeChild(o);
|
|
2811
2853
|
}
|
|
2812
2854
|
}
|
|
2813
|
-
function
|
|
2855
|
+
function qa(e) {
|
|
2814
2856
|
if (!e.assistantDraft)
|
|
2815
2857
|
return [...e.messages];
|
|
2816
2858
|
const t = {
|
|
@@ -2872,20 +2914,20 @@ function Wn(e, t, n, o, i, r, l, p) {
|
|
|
2872
2914
|
}
|
|
2873
2915
|
e.appendChild(d);
|
|
2874
2916
|
}
|
|
2875
|
-
function
|
|
2917
|
+
function ja(e) {
|
|
2876
2918
|
const t = document.createElement("div");
|
|
2877
2919
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2878
2920
|
for (const n of e)
|
|
2879
|
-
t.appendChild(
|
|
2921
|
+
t.appendChild(Da(n));
|
|
2880
2922
|
return t;
|
|
2881
2923
|
}
|
|
2882
|
-
function
|
|
2924
|
+
function Va(e) {
|
|
2883
2925
|
const t = document.createElement("button");
|
|
2884
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2926
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Aa()), t.addEventListener("click", (n) => {
|
|
2885
2927
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2886
2928
|
}), t;
|
|
2887
2929
|
}
|
|
2888
|
-
function
|
|
2930
|
+
function Ka(e, t) {
|
|
2889
2931
|
const n = document.createElement("article");
|
|
2890
2932
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2891
2933
|
const o = document.createElement("div");
|
|
@@ -2926,7 +2968,7 @@ function Xa(e, t) {
|
|
|
2926
2968
|
}
|
|
2927
2969
|
return o.appendChild(p), n.appendChild(o), n;
|
|
2928
2970
|
}
|
|
2929
|
-
function
|
|
2971
|
+
function Ya(e, t) {
|
|
2930
2972
|
const n = document.createElement("div");
|
|
2931
2973
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
|
|
2932
2974
|
g.target === n && t.onClose();
|
|
@@ -2945,7 +2987,7 @@ function Za(e, t) {
|
|
|
2945
2987
|
c.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2946
2988
|
const u = document.createElement("strong");
|
|
2947
2989
|
u.textContent = "1) Copy Screenshot", c.appendChild(u);
|
|
2948
|
-
const m =
|
|
2990
|
+
const m = Xa(
|
|
2949
2991
|
"Copy Screenshot",
|
|
2950
2992
|
async () => {
|
|
2951
2993
|
try {
|
|
@@ -2966,13 +3008,13 @@ function Za(e, t) {
|
|
|
2966
3008
|
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2967
3009
|
const v = document.createElement("strong");
|
|
2968
3010
|
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
2969
|
-
const
|
|
2970
|
-
|
|
3011
|
+
const R = document.createElement("p");
|
|
3012
|
+
R.className = "pluno-pa-widget__share-dialog-hint", R.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(R);
|
|
2971
3013
|
const _ = document.createElement("footer");
|
|
2972
3014
|
_.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2973
|
-
for (const g of
|
|
3015
|
+
for (const g of Za(e)) {
|
|
2974
3016
|
const b = document.createElement("a");
|
|
2975
|
-
b.href = g.href, b.target = "_blank", b.rel = "noopener noreferrer", b.title = g.label, b.setAttribute("aria-label", `Open ${g.label}`), b.appendChild(
|
|
3017
|
+
b.href = g.href, b.target = "_blank", b.rel = "noopener noreferrer", b.title = g.label, b.setAttribute("aria-label", `Open ${g.label}`), b.appendChild(Ja(g.id)), _.appendChild(b);
|
|
2976
3018
|
}
|
|
2977
3019
|
if (k.appendChild(_), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2978
3020
|
const g = document.createElement("div");
|
|
@@ -2980,17 +3022,17 @@ function Za(e, t) {
|
|
|
2980
3022
|
const b = document.createElement("strong");
|
|
2981
3023
|
b.className = "pluno-pa-widget__share-dialog-step-title", b.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(b);
|
|
2982
3024
|
const h = document.createElement("a");
|
|
2983
|
-
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(
|
|
3025
|
+
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(Qa()), g.appendChild(h), o.appendChild(g);
|
|
2984
3026
|
}
|
|
2985
3027
|
return n.appendChild(o), n;
|
|
2986
3028
|
}
|
|
2987
|
-
function
|
|
3029
|
+
function Xa(e, t) {
|
|
2988
3030
|
const n = document.createElement("button");
|
|
2989
3031
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
2990
3032
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
2991
3033
|
}), n;
|
|
2992
3034
|
}
|
|
2993
|
-
function
|
|
3035
|
+
function Za(e) {
|
|
2994
3036
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
2995
3037
|
return [
|
|
2996
3038
|
{
|
|
@@ -3010,7 +3052,7 @@ function Qa(e) {
|
|
|
3010
3052
|
}
|
|
3011
3053
|
];
|
|
3012
3054
|
}
|
|
3013
|
-
function
|
|
3055
|
+
function Ja(e) {
|
|
3014
3056
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3015
3057
|
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (U(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), U(
|
|
3016
3058
|
t,
|
|
@@ -3037,7 +3079,7 @@ function U(e, t, n) {
|
|
|
3037
3079
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3038
3080
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3039
3081
|
}
|
|
3040
|
-
function
|
|
3082
|
+
function Qa() {
|
|
3041
3083
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3042
3084
|
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), U(e, "M14 5h5v5"), U(e, "M19 5l-8 8"), U(
|
|
3043
3085
|
e,
|
|
@@ -3047,10 +3089,10 @@ function tr() {
|
|
|
3047
3089
|
function wo(e) {
|
|
3048
3090
|
return e.role === "tool" && e.toolName === Xn;
|
|
3049
3091
|
}
|
|
3050
|
-
function
|
|
3092
|
+
function er(e) {
|
|
3051
3093
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3052
3094
|
}
|
|
3053
|
-
function
|
|
3095
|
+
function tr(e, t, n, o) {
|
|
3054
3096
|
const i = document.createElement("article");
|
|
3055
3097
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3056
3098
|
e[e.length - 1].createdAt
|
|
@@ -3060,7 +3102,7 @@ function or(e, t, n, o) {
|
|
|
3060
3102
|
o
|
|
3061
3103
|
)
|
|
3062
3104
|
);
|
|
3063
|
-
const r = document.createElement("details"), l =
|
|
3105
|
+
const r = document.createElement("details"), l = nr(e);
|
|
3064
3106
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3065
3107
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3066
3108
|
});
|
|
@@ -3101,7 +3143,7 @@ function ct(e = "Thinking...") {
|
|
|
3101
3143
|
const o = document.createElement("span");
|
|
3102
3144
|
return o.textContent = e, t.appendChild(o), t;
|
|
3103
3145
|
}
|
|
3104
|
-
function
|
|
3146
|
+
function nr(e) {
|
|
3105
3147
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3106
3148
|
}
|
|
3107
3149
|
function Zt() {
|
|
@@ -3109,9 +3151,9 @@ function Zt() {
|
|
|
3109
3151
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3110
3152
|
}
|
|
3111
3153
|
function _o(e, t) {
|
|
3112
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3154
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Pa() : go());
|
|
3113
3155
|
}
|
|
3114
|
-
function
|
|
3156
|
+
function or(e, t) {
|
|
3115
3157
|
const n = t.replace(/\r\n/g, `
|
|
3116
3158
|
`).split(`
|
|
3117
3159
|
`);
|
|
@@ -3185,7 +3227,7 @@ function at(e, t) {
|
|
|
3185
3227
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3186
3228
|
} else {
|
|
3187
3229
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3188
|
-
if (p &&
|
|
3230
|
+
if (p && ir(p[2])) {
|
|
3189
3231
|
const d = document.createElement("a");
|
|
3190
3232
|
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
3191
3233
|
} else
|
|
@@ -3195,7 +3237,7 @@ function at(e, t) {
|
|
|
3195
3237
|
}
|
|
3196
3238
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3197
3239
|
}
|
|
3198
|
-
function
|
|
3240
|
+
function ir(e) {
|
|
3199
3241
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3200
3242
|
return !0;
|
|
3201
3243
|
try {
|
|
@@ -3206,7 +3248,7 @@ function rr(e) {
|
|
|
3206
3248
|
}
|
|
3207
3249
|
}
|
|
3208
3250
|
function $n(e, t) {
|
|
3209
|
-
if (
|
|
3251
|
+
if (ar(e))
|
|
3210
3252
|
return;
|
|
3211
3253
|
const n = `
|
|
3212
3254
|
:host {
|
|
@@ -3249,6 +3291,9 @@ function $n(e, t) {
|
|
|
3249
3291
|
--pluno-pa-faint: #8e8e95;
|
|
3250
3292
|
--pluno-pa-divider: rgba(24, 24, 27, 0.08);
|
|
3251
3293
|
--pluno-pa-launcher-hairline: rgba(24, 24, 27, 0.06);
|
|
3294
|
+
--pluno-pa-minimized-launcher-paper: #fffdf6;
|
|
3295
|
+
--pluno-pa-minimized-launcher-ink: #2c2a1e;
|
|
3296
|
+
--pluno-pa-scribble-grid-line: rgba(96, 138, 188, 0.22);
|
|
3252
3297
|
--pluno-pa-launcher-width: min(190px, calc(100vw - 36px));
|
|
3253
3298
|
--pluno-pa-launcher-height: 41px;
|
|
3254
3299
|
--pluno-pa-panel-width: min(clamp(420px, 24vw, 520px), calc(100vw - 16px));
|
|
@@ -3472,12 +3517,15 @@ function $n(e, t) {
|
|
|
3472
3517
|
.pluno-pa-widget--thinking:not(.pluno-pa-widget--open):not(.pluno-pa-widget--minimized):not(.pluno-pa-widget--host-modal-conflict) .pluno-pa-widget__launcher-input {
|
|
3473
3518
|
display: none;
|
|
3474
3519
|
}
|
|
3475
|
-
.pluno-pa-widget--minimized {
|
|
3520
|
+
.pluno-pa-widget.pluno-pa-widget--minimized {
|
|
3476
3521
|
--pluno-pa-launcher-width: 22px;
|
|
3477
3522
|
--pluno-pa-launcher-height: 22px;
|
|
3478
3523
|
pointer-events: none;
|
|
3479
3524
|
}
|
|
3480
|
-
.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
3525
|
+
.pluno-pa-widget.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
3526
|
+
/* The scribble circle gives the bolt a recognizable silhouette on host
|
|
3527
|
+
pages whose background colors are outside the widget's control. */
|
|
3528
|
+
isolation: isolate;
|
|
3481
3529
|
border: 0;
|
|
3482
3530
|
border-radius: 999px;
|
|
3483
3531
|
background: transparent;
|
|
@@ -3491,16 +3539,31 @@ function $n(e, t) {
|
|
|
3491
3539
|
overflow: visible;
|
|
3492
3540
|
pointer-events: auto;
|
|
3493
3541
|
}
|
|
3542
|
+
.pluno-pa-widget.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before {
|
|
3543
|
+
content: "";
|
|
3544
|
+
position: absolute;
|
|
3545
|
+
inset: 0;
|
|
3546
|
+
z-index: -1;
|
|
3547
|
+
border: 1.5px solid var(--pluno-pa-minimized-launcher-ink);
|
|
3548
|
+
border-radius: inherit;
|
|
3549
|
+
background-color: var(--pluno-pa-minimized-launcher-paper);
|
|
3550
|
+
background-image:
|
|
3551
|
+
linear-gradient(var(--pluno-pa-scribble-grid-line) 1px, transparent 1px),
|
|
3552
|
+
linear-gradient(90deg, var(--pluno-pa-scribble-grid-line) 1px, transparent 1px);
|
|
3553
|
+
background-size: 12px 12px;
|
|
3554
|
+
pointer-events: none;
|
|
3555
|
+
}
|
|
3494
3556
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-input,
|
|
3495
3557
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-drag-handle,
|
|
3496
3558
|
.pluno-pa-widget--minimized .pluno-pa-widget__launcher-minimize,
|
|
3497
3559
|
.pluno-pa-widget--minimized .pluno-pa-widget__scribble-spirals--launcher {
|
|
3498
3560
|
display: none;
|
|
3499
3561
|
}
|
|
3500
|
-
.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
3501
|
-
left:
|
|
3502
|
-
width:
|
|
3503
|
-
height:
|
|
3562
|
+
.pluno-pa-widget.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
3563
|
+
left: 3px;
|
|
3564
|
+
width: 16px;
|
|
3565
|
+
height: 16px;
|
|
3566
|
+
margin-top: 0;
|
|
3504
3567
|
}
|
|
3505
3568
|
.pluno-pa-widget--bottom-left .pluno-pa-widget__launcher {
|
|
3506
3569
|
left: 0;
|
|
@@ -5217,20 +5280,6 @@ function $n(e, t) {
|
|
|
5217
5280
|
.pluno-pa-widget--scribble .pluno-pa-widget__history-panel {
|
|
5218
5281
|
border-radius: var(--pluno-pa-scribble-wobble);
|
|
5219
5282
|
}
|
|
5220
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized {
|
|
5221
|
-
--pluno-pa-launcher-width: 16px;
|
|
5222
|
-
--pluno-pa-launcher-height: 24px;
|
|
5223
|
-
}
|
|
5224
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
5225
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
5226
|
-
content: none;
|
|
5227
|
-
}
|
|
5228
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
5229
|
-
left: -3px;
|
|
5230
|
-
width: 22px;
|
|
5231
|
-
height: 22px;
|
|
5232
|
-
margin-top: 0;
|
|
5233
|
-
}
|
|
5234
5283
|
.pluno-pa-widget--scribble .pluno-pa-widget__launcher-minimize {
|
|
5235
5284
|
color: var(--pluno-pa-text);
|
|
5236
5285
|
font-size: 18px;
|
|
@@ -5366,21 +5415,6 @@ function $n(e, t) {
|
|
|
5366
5415
|
opacity: 0.6;
|
|
5367
5416
|
transform: rotate(5deg);
|
|
5368
5417
|
}
|
|
5369
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher {
|
|
5370
|
-
border: 0;
|
|
5371
|
-
width: var(--pluno-pa-launcher-width);
|
|
5372
|
-
min-width: 0;
|
|
5373
|
-
height: var(--pluno-pa-launcher-height);
|
|
5374
|
-
min-height: 0;
|
|
5375
|
-
padding: 0;
|
|
5376
|
-
}
|
|
5377
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::before,
|
|
5378
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__launcher::after {
|
|
5379
|
-
content: none;
|
|
5380
|
-
}
|
|
5381
|
-
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__scribble-spirals {
|
|
5382
|
-
display: none;
|
|
5383
|
-
}
|
|
5384
5418
|
.pluno-pa-widget--scribble .pluno-pa-widget__attach:hover:not(:disabled),
|
|
5385
5419
|
.pluno-pa-widget--scribble .pluno-pa-widget__attach:focus-visible {
|
|
5386
5420
|
background: transparent;
|
|
@@ -5475,18 +5509,18 @@ function $n(e, t) {
|
|
|
5475
5509
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5476
5510
|
}
|
|
5477
5511
|
`;
|
|
5478
|
-
if (
|
|
5512
|
+
if (rr(e, n))
|
|
5479
5513
|
return;
|
|
5480
5514
|
const o = e.ownerDocument.createElement("style");
|
|
5481
5515
|
o.id = io, o.textContent = n, e.appendChild(o), xo(e);
|
|
5482
5516
|
}
|
|
5483
|
-
function
|
|
5517
|
+
function ar(e) {
|
|
5484
5518
|
return e.getElementById(io) !== null || e.host instanceof HTMLElement && e.host.getAttribute(ao) === "true";
|
|
5485
5519
|
}
|
|
5486
5520
|
function xo(e) {
|
|
5487
5521
|
e.host instanceof HTMLElement && e.host.setAttribute(ao, "true");
|
|
5488
5522
|
}
|
|
5489
|
-
function
|
|
5523
|
+
function rr(e, t) {
|
|
5490
5524
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5491
5525
|
return !1;
|
|
5492
5526
|
try {
|
|
@@ -5496,7 +5530,7 @@ function pr(e, t) {
|
|
|
5496
5530
|
return !1;
|
|
5497
5531
|
}
|
|
5498
5532
|
}
|
|
5499
|
-
async function
|
|
5533
|
+
async function lr() {
|
|
5500
5534
|
return document.body ? document.body : await new Promise((e) => {
|
|
5501
5535
|
const t = new MutationObserver(() => {
|
|
5502
5536
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5507,7 +5541,7 @@ async function sr() {
|
|
|
5507
5541
|
function yo(e) {
|
|
5508
5542
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5509
5543
|
}
|
|
5510
|
-
function
|
|
5544
|
+
function pr(e) {
|
|
5511
5545
|
try {
|
|
5512
5546
|
const t = window.localStorage.getItem(yo(e));
|
|
5513
5547
|
if (!t)
|
|
@@ -5521,8 +5555,8 @@ function dr(e) {
|
|
|
5521
5555
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5522
5556
|
(o) => typeof o == "string"
|
|
5523
5557
|
) : [],
|
|
5524
|
-
launcherPosition:
|
|
5525
|
-
panelSize:
|
|
5558
|
+
launcherPosition: ur(n.launcherPosition) ? n.launcherPosition : null,
|
|
5559
|
+
panelSize: gr(n.panelSize) ? ut(n.panelSize) : null,
|
|
5526
5560
|
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Zn) : [],
|
|
5527
5561
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5528
5562
|
};
|
|
@@ -5530,7 +5564,7 @@ function dr(e) {
|
|
|
5530
5564
|
return qn();
|
|
5531
5565
|
}
|
|
5532
5566
|
}
|
|
5533
|
-
async function
|
|
5567
|
+
async function sr(e) {
|
|
5534
5568
|
if (e.loadSharePromptsDisabled)
|
|
5535
5569
|
return e.loadSharePromptsDisabled();
|
|
5536
5570
|
try {
|
|
@@ -5539,7 +5573,7 @@ async function cr(e) {
|
|
|
5539
5573
|
return !1;
|
|
5540
5574
|
}
|
|
5541
5575
|
}
|
|
5542
|
-
function
|
|
5576
|
+
function dr(e, t) {
|
|
5543
5577
|
if (e.persistSharePromptsDisabled) {
|
|
5544
5578
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5545
5579
|
() => {
|
|
@@ -5566,7 +5600,7 @@ function qn() {
|
|
|
5566
5600
|
sharePromptsDisabled: !1
|
|
5567
5601
|
};
|
|
5568
5602
|
}
|
|
5569
|
-
function
|
|
5603
|
+
function cr(e, t) {
|
|
5570
5604
|
try {
|
|
5571
5605
|
window.localStorage.setItem(
|
|
5572
5606
|
yo(e),
|
|
@@ -5576,27 +5610,27 @@ function gr(e, t) {
|
|
|
5576
5610
|
return;
|
|
5577
5611
|
}
|
|
5578
5612
|
}
|
|
5579
|
-
function
|
|
5613
|
+
function ur(e) {
|
|
5580
5614
|
if (!e || typeof e != "object")
|
|
5581
5615
|
return !1;
|
|
5582
5616
|
const t = e;
|
|
5583
5617
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
5584
5618
|
}
|
|
5585
|
-
function
|
|
5619
|
+
function gr(e) {
|
|
5586
5620
|
if (!e || typeof e != "object")
|
|
5587
5621
|
return !1;
|
|
5588
5622
|
const t = e;
|
|
5589
5623
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5590
5624
|
}
|
|
5591
5625
|
const jn = /* @__PURE__ */ new WeakSet();
|
|
5592
|
-
function
|
|
5626
|
+
function hr(e) {
|
|
5593
5627
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5594
5628
|
}
|
|
5595
5629
|
function Vn(e) {
|
|
5596
5630
|
const t = e.pathname.split("/");
|
|
5597
5631
|
return t[t.length - 1] ?? "";
|
|
5598
5632
|
}
|
|
5599
|
-
function
|
|
5633
|
+
function mr(e, t) {
|
|
5600
5634
|
const n = new URL(e.src, document.baseURI);
|
|
5601
5635
|
return n.href === t.href || n.pathname === t.pathname ? !0 : Vn(n) === Vn(t);
|
|
5602
5636
|
}
|
|
@@ -5643,7 +5677,7 @@ class se extends EventTarget {
|
|
|
5643
5677
|
binaryType = "blob";
|
|
5644
5678
|
bufferedAmount = 0;
|
|
5645
5679
|
readyState = se.CONNECTING;
|
|
5646
|
-
socketId =
|
|
5680
|
+
socketId = fr();
|
|
5647
5681
|
listeners = /* @__PURE__ */ new Map();
|
|
5648
5682
|
send(t) {
|
|
5649
5683
|
if (this.readyState !== se.OPEN)
|
|
@@ -5688,7 +5722,7 @@ class se extends EventTarget {
|
|
|
5688
5722
|
this.listeners.clear();
|
|
5689
5723
|
}
|
|
5690
5724
|
}
|
|
5691
|
-
function
|
|
5725
|
+
function fr() {
|
|
5692
5726
|
const e = window.sessionStorage.getItem(
|
|
5693
5727
|
yn
|
|
5694
5728
|
);
|
|
@@ -5700,7 +5734,7 @@ function br() {
|
|
|
5700
5734
|
function rt(e, t) {
|
|
5701
5735
|
return `${e}:${t}`;
|
|
5702
5736
|
}
|
|
5703
|
-
function
|
|
5737
|
+
function wr(e) {
|
|
5704
5738
|
const t = document.currentScript;
|
|
5705
5739
|
if (t instanceof HTMLScriptElement)
|
|
5706
5740
|
return [t];
|
|
@@ -5708,20 +5742,20 @@ function _r(e) {
|
|
|
5708
5742
|
return Array.from(
|
|
5709
5743
|
document.querySelectorAll("script[type='module'][src]")
|
|
5710
5744
|
).filter(
|
|
5711
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5745
|
+
(i) => i instanceof HTMLScriptElement && hr(i) && mr(i, o)
|
|
5712
5746
|
);
|
|
5713
5747
|
}
|
|
5714
|
-
function
|
|
5715
|
-
for (const t of
|
|
5748
|
+
function br(e) {
|
|
5749
|
+
for (const t of wr(e)) {
|
|
5716
5750
|
if (jn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
5717
5751
|
continue;
|
|
5718
5752
|
jn.add(t);
|
|
5719
5753
|
const n = t.dataset.plunoPreviewChannel;
|
|
5720
|
-
|
|
5754
|
+
Gi({
|
|
5721
5755
|
token: t.dataset.plunoToken,
|
|
5722
5756
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
5723
5757
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
5724
|
-
webSocketFactory: n ?
|
|
5758
|
+
webSocketFactory: n ? Wi(n) : void 0,
|
|
5725
5759
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5726
5760
|
accentColor: t.dataset.plunoAccentColor,
|
|
5727
5761
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5733,8 +5767,8 @@ function xr(e) {
|
|
|
5733
5767
|
});
|
|
5734
5768
|
}
|
|
5735
5769
|
}
|
|
5736
|
-
|
|
5770
|
+
br(import.meta.url);
|
|
5737
5771
|
export {
|
|
5738
|
-
|
|
5739
|
-
|
|
5772
|
+
Wi as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5773
|
+
Gi as mountPlunoProductAgentWidget
|
|
5740
5774
|
};
|