@pluno/product-agent-web 0.1.65 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/product-agent-sdk.js +153 -149
- package/dist/product-agent-widget.js +398 -396
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PlunoProductAgent as qo } from "./product-agent-sdk.js";
|
|
2
|
-
const
|
|
1
|
+
import { PlunoProductAgent as qo, getProductAgentOriginAccessErrorMessage as jo } from "./product-agent-sdk.js";
|
|
2
|
+
const Vo = "#7c3aed", pt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", st = "#2c2a1e", fn = [253, 250, 241], wn = 3.5;
|
|
3
3
|
function Kn(e) {
|
|
4
4
|
const t = Yn(e);
|
|
5
5
|
if (bn(Ke(t), fn) >= wn)
|
|
@@ -7,11 +7,11 @@ function Kn(e) {
|
|
|
7
7
|
let o = Ke(t);
|
|
8
8
|
const i = Ke(st);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
10
|
+
if (o = Xo(o, i, 0.22), bn(o, fn) >= wn)
|
|
11
11
|
return Ft(o);
|
|
12
12
|
return Ft(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Ko() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
@@ -19,7 +19,7 @@ function Vo() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Yo(e) {
|
|
23
23
|
const t = Yn(e), n = Ht(Ke(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
@@ -58,7 +58,7 @@ function Ko(e) {
|
|
|
58
58
|
}
|
|
59
59
|
function Yn(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
|
-
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` :
|
|
61
|
+
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Vo;
|
|
62
62
|
}
|
|
63
63
|
function Ke(e) {
|
|
64
64
|
return [
|
|
@@ -82,7 +82,7 @@ function bn(e, t) {
|
|
|
82
82
|
const n = Ht(e), o = Ht(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Xo(e, t, n) {
|
|
86
86
|
const o = Wt(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
@@ -91,17 +91,17 @@ function Yo(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function ne(e, t, n) {
|
|
94
|
-
const [o, i, r] =
|
|
95
|
-
return Ft(
|
|
94
|
+
const [o, i, r] = Zo(Ke(e));
|
|
95
|
+
return Ft(Jo(o, Wt(i + n), Wt(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Zo([e, t, n]) {
|
|
98
98
|
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
101
|
const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
102
|
return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Jo(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
@@ -119,7 +119,7 @@ function Wt(e) {
|
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
121
|
const Xn = "suggest_share_on_socials";
|
|
122
|
-
function
|
|
122
|
+
function Qo(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
125
|
if (n.role !== "tool" || n.toolName !== Xn)
|
|
@@ -136,8 +136,8 @@ function Jo(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function ei(e) {
|
|
140
|
+
const t = await ti(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
@@ -150,50 +150,50 @@ function _n(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function ti(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
156
|
+
const ni = "https://app.pluno.ai", oi = "/api/product-agent/embed/active-users", ii = 1800, ai = 15e3, ri = 250, li = 1e3, pi = 3e4;
|
|
157
|
+
function si(e, t = {}) {
|
|
158
158
|
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
161
|
}, p = (u) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
c();
|
|
164
|
-
},
|
|
164
|
+
}, ui(u)));
|
|
165
165
|
}, d = (u) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
167
|
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const m = o,
|
|
170
|
+
const m = o, k = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const v = Math.min(1, (performance.now() -
|
|
177
|
-
o = Math.round(m + (u - m) *
|
|
178
|
-
},
|
|
176
|
+
const v = Math.min(1, (performance.now() - k) / ii);
|
|
177
|
+
o = Math.round(m + (u - m) * gi(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
|
+
}, ri);
|
|
179
179
|
}, c = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const u = await
|
|
181
|
+
const u = await di(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
184
|
d(u.count), p(u.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(ai);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return c(), () => {
|
|
190
190
|
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function di(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(oi, ci(e.backendUrl ?? ni)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
@@ -207,16 +207,16 @@ async function si(e) {
|
|
|
207
207
|
function xn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function di(e) {
|
|
211
|
-
return e.endsWith("/") ? e : `${e}/`;
|
|
212
|
-
}
|
|
213
210
|
function ci(e) {
|
|
214
|
-
return
|
|
211
|
+
return e.endsWith("/") ? e : `${e}/`;
|
|
215
212
|
}
|
|
216
213
|
function ui(e) {
|
|
214
|
+
return Math.min(pi, Math.max(li, e));
|
|
215
|
+
}
|
|
216
|
+
function gi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const Zn = 100,
|
|
219
|
+
const Zn = 100, hi = 1e4, mi = 5e3, fi = "product-agent:sdk-preview-socket-connect", wi = "product-agent:sdk-preview-socket-send", bi = "product-agent:sdk-preview-socket-close", _i = "product-agent:sdk-preview-socket-open", xi = "product-agent:sdk-preview-socket-message", yi = "product-agent:sdk-preview-socket-error", vi = "product-agent:sdk-preview-socket-closed", yn = "product-agent:sdk-preview-socket-id", Ci = "data-pluno-sdk-preview-channel", Si = "product-agent:preview-diagnostic", Jn = "pluno.productAgent.sharePromptsDisabled", Ei = 3, vn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ki = 400, Li = 5e3, Pi = 500, Cn = "Close the page's popup to chat", Ii = "No recent chats for this page yet.", oe = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const Zn = 100, gi = 1e4, hi = 5e3, mi = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !1,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
},
|
|
227
|
+
}, Ai = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Sn = "pluno-pa-scribble-font", Qn = 190, eo = 41, En = 22, Ni = 16, Ti = 24, Di = 1, Ri = 48, Jt = 420, zi = 520, Mi = 0.24, Qt = 680, Oi = 800, Bi = 0.76, I = 8, Ce = 50, to = "http://www.w3.org/2000/svg", Gt = 26, $t = 8, Ui = 36, qt = 16, Fi = 4, kn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,12 +261,12 @@ const Zn = 100, gi = 1e4, hi = 5e3, mi = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
],
|
|
264
|
+
], Hi = 11, Wi = 13, jt = 4, no = 10, oo = 40, Gi = "movable-launcher-position-v2", io = "pluno-pa-widget-styles", ao = "data-pluno-pa-widget-styles";
|
|
265
265
|
let Ln = 0;
|
|
266
|
-
function
|
|
266
|
+
function $i(e) {
|
|
267
267
|
return (t) => new se(t, e);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function qi(e = {}) {
|
|
270
270
|
const t = {
|
|
271
271
|
launcherLabel: e.launcherLabel ?? oe.launcherLabel,
|
|
272
272
|
accentColor: e.accentColor ?? oe.accentColor,
|
|
@@ -325,7 +325,7 @@ async function $i(e = {}) {
|
|
|
325
325
|
);
|
|
326
326
|
const n = document.createElement("div");
|
|
327
327
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
328
|
-
|
|
328
|
+
Ci,
|
|
329
329
|
t.sdkPreviewChannelId
|
|
330
330
|
);
|
|
331
331
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
@@ -334,14 +334,14 @@ async function $i(e = {}) {
|
|
|
334
334
|
t.accentColor,
|
|
335
335
|
t.scribbleStyle
|
|
336
336
|
);
|
|
337
|
-
|
|
337
|
+
ha(
|
|
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 = dr(t);
|
|
345
345
|
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
346
|
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ve(
|
|
347
347
|
i,
|
|
@@ -356,7 +356,7 @@ async function $i(e = {}) {
|
|
|
356
356
|
fontFamily: t.fontFamily,
|
|
357
357
|
scribbleStyle: t.scribbleStyle
|
|
358
358
|
});
|
|
359
|
-
const m = await
|
|
359
|
+
const m = await sr(), k = m.ownerDocument;
|
|
360
360
|
m.appendChild(n), J(
|
|
361
361
|
"web-sdk.widget",
|
|
362
362
|
"Applied initial widget appearance",
|
|
@@ -371,17 +371,17 @@ async function $i(e = {}) {
|
|
|
371
371
|
".pluno-pa-widget__launcher"
|
|
372
372
|
), z = i.querySelector(
|
|
373
373
|
".pluno-pa-widget__launcher-drag-handle"
|
|
374
|
-
),
|
|
374
|
+
), _ = i.querySelector(
|
|
375
375
|
".pluno-pa-widget__launcher-input"
|
|
376
376
|
), g = i.querySelector(
|
|
377
377
|
".pluno-pa-widget__launcher-minimize"
|
|
378
|
-
),
|
|
378
|
+
), b = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
379
379
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
380
380
|
), P = Array.from(
|
|
381
381
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
382
382
|
), A = i.querySelector(
|
|
383
383
|
".pluno-pa-widget__close"
|
|
384
|
-
),
|
|
384
|
+
), L = i.querySelector(
|
|
385
385
|
".pluno-pa-widget__composer"
|
|
386
386
|
), F = i.querySelector(
|
|
387
387
|
".pluno-pa-widget__attachment-error"
|
|
@@ -426,19 +426,19 @@ async function $i(e = {}) {
|
|
|
426
426
|
), So = i.querySelector(
|
|
427
427
|
".pluno-pa-widget__notify-suggestion-never"
|
|
428
428
|
);
|
|
429
|
-
if (!v || !
|
|
429
|
+
if (!v || !_ || !b || !A || !L || !F || !H || !$ || !Q || !ze || !x || !de || !Ye || !X || !C || !T || !Se || !q || !R || !D || !N || !ht)
|
|
430
430
|
throw new Error("Failed to mount Pluno widget");
|
|
431
431
|
if (t.movableLauncher && !z)
|
|
432
432
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
433
|
-
Mn(
|
|
433
|
+
Mn(_), Mn(x);
|
|
434
434
|
let W = [], le = null;
|
|
435
435
|
const Ee = () => {
|
|
436
|
-
|
|
436
|
+
Da(
|
|
437
437
|
$,
|
|
438
438
|
W,
|
|
439
439
|
(a) => {
|
|
440
440
|
W = W.filter(
|
|
441
|
-
(s,
|
|
441
|
+
(s, w) => w !== a
|
|
442
442
|
), Ee(), G(y.getState()), j();
|
|
443
443
|
}
|
|
444
444
|
);
|
|
@@ -454,8 +454,10 @@ async function $i(e = {}) {
|
|
|
454
454
|
url: location.href
|
|
455
455
|
})
|
|
456
456
|
});
|
|
457
|
-
if (!a.ok)
|
|
458
|
-
|
|
457
|
+
if (!a.ok) {
|
|
458
|
+
const w = await a.text(), S = jo(w);
|
|
459
|
+
throw S ? (console.error(S), new Error(S)) : new Error(`Failed to load Pluno token (${a.status})`);
|
|
460
|
+
}
|
|
459
461
|
const s = await a.json();
|
|
460
462
|
if (!s.token)
|
|
461
463
|
throw new Error("Pluno token endpoint did not return a token");
|
|
@@ -481,7 +483,7 @@ async function $i(e = {}) {
|
|
|
481
483
|
const mt = new Set(l.openToolGroupKeys), ke = new Set(
|
|
482
484
|
l.seenShareCandidateIds
|
|
483
485
|
), Xe = new Set(ke);
|
|
484
|
-
let ft = l.sharePromptsDisabled || await
|
|
486
|
+
let ft = l.sharePromptsDisabled || await cr(t), Z = null, Le = !1, fe = !1, we = {
|
|
485
487
|
enabled: !0
|
|
486
488
|
}, be = 0, nn = "", ce = !1, pe = !1, ue = [], wt = null, Oe = null;
|
|
487
489
|
const ee = (a, s) => {
|
|
@@ -503,15 +505,15 @@ async function $i(e = {}) {
|
|
|
503
505
|
for (const a of ue) {
|
|
504
506
|
const s = document.createElement("button");
|
|
505
507
|
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
const
|
|
509
|
-
|
|
508
|
+
const w = document.createElement("span");
|
|
509
|
+
w.className = "pluno-pa-widget__history-item-title", w.textContent = ca(a);
|
|
510
|
+
const S = document.createElement("time");
|
|
511
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = ga(
|
|
510
512
|
a.lastActiveAt,
|
|
511
513
|
Date.now()
|
|
512
514
|
);
|
|
513
515
|
const M = document.createElement("small");
|
|
514
|
-
M.className = "pluno-pa-widget__history-path", M.textContent =
|
|
516
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = ua(a), s.append(w, S, M), s.addEventListener("click", () => {
|
|
515
517
|
ce = !1, Oe = null, _e(), ee(!0, "newSession"), te(), y.loadSession(a.id), G(y.getState());
|
|
516
518
|
}), T.appendChild(s);
|
|
517
519
|
}
|
|
@@ -533,7 +535,7 @@ async function $i(e = {}) {
|
|
|
533
535
|
{
|
|
534
536
|
message: s instanceof Error ? s.message : String(s)
|
|
535
537
|
}
|
|
536
|
-
), Oe =
|
|
538
|
+
), Oe = Ii;
|
|
537
539
|
} finally {
|
|
538
540
|
pe = !1, _e();
|
|
539
541
|
}
|
|
@@ -541,9 +543,9 @@ async function $i(e = {}) {
|
|
|
541
543
|
}, Io = () => {
|
|
542
544
|
!wt || pe || T.scrollHeight - T.scrollTop - T.clientHeight <= 24 && on(wt);
|
|
543
545
|
}, Ao = () => {
|
|
544
|
-
Le || typeof document > "u" || ($n(o, t.accentColor), n.isConnected ||
|
|
546
|
+
Le || typeof document > "u" || ($n(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
|
|
545
547
|
}, an = new MutationObserver(Ao);
|
|
546
|
-
an.observe(
|
|
548
|
+
an.observe(k.documentElement, {
|
|
547
549
|
childList: !0,
|
|
548
550
|
subtree: !0
|
|
549
551
|
});
|
|
@@ -551,7 +553,7 @@ async function $i(e = {}) {
|
|
|
551
553
|
const s = dt(i, a);
|
|
552
554
|
return Vt(
|
|
553
555
|
i,
|
|
554
|
-
p ? ro(p, s) :
|
|
556
|
+
p ? ro(p, s) : Qi(
|
|
555
557
|
i,
|
|
556
558
|
t.position,
|
|
557
559
|
s
|
|
@@ -559,8 +561,8 @@ async function $i(e = {}) {
|
|
|
559
561
|
s
|
|
560
562
|
);
|
|
561
563
|
}, B = () => {
|
|
562
|
-
const a =
|
|
563
|
-
|
|
564
|
+
const a = ra(o, _, x);
|
|
565
|
+
gr(t, {
|
|
564
566
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
565
567
|
composerValue: x.value,
|
|
566
568
|
focusedInput: a,
|
|
@@ -580,7 +582,7 @@ async function $i(e = {}) {
|
|
|
580
582
|
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Fe(!1), s && Ze("shown");
|
|
581
583
|
return;
|
|
582
584
|
}
|
|
583
|
-
Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1,
|
|
585
|
+
Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, b.hidden = !0, A.hidden = !0, v.tabIndex = 0, x.value = "", ve(
|
|
584
586
|
i,
|
|
585
587
|
Tt(
|
|
586
588
|
i,
|
|
@@ -589,8 +591,8 @@ async function $i(e = {}) {
|
|
|
589
591
|
)
|
|
590
592
|
), Dn(i), B(), s && Ze("minimized");
|
|
591
593
|
}, xe = (a, s = {}) => {
|
|
592
|
-
|
|
593
|
-
debugVersion:
|
|
594
|
+
aa(a, {
|
|
595
|
+
debugVersion: Gi,
|
|
594
596
|
launcherPosition: p,
|
|
595
597
|
rootClasses: i.className,
|
|
596
598
|
rootStyle: {
|
|
@@ -601,9 +603,9 @@ async function $i(e = {}) {
|
|
|
601
603
|
},
|
|
602
604
|
rootRect: Rt(i),
|
|
603
605
|
launcherRect: Rt(v),
|
|
604
|
-
panelRect: Rt(
|
|
606
|
+
panelRect: Rt(b),
|
|
605
607
|
viewport: Y(),
|
|
606
|
-
panelHidden:
|
|
608
|
+
panelHidden: b.hidden,
|
|
607
609
|
closeHidden: A.hidden,
|
|
608
610
|
...s
|
|
609
611
|
});
|
|
@@ -619,7 +621,7 @@ async function $i(e = {}) {
|
|
|
619
621
|
Dn(i);
|
|
620
622
|
return;
|
|
621
623
|
}
|
|
622
|
-
|
|
624
|
+
ia(i, {
|
|
623
625
|
x: a.x - s.x,
|
|
624
626
|
y: a.y - s.y
|
|
625
627
|
});
|
|
@@ -643,7 +645,7 @@ async function $i(e = {}) {
|
|
|
643
645
|
h,
|
|
644
646
|
s.width
|
|
645
647
|
);
|
|
646
|
-
const
|
|
648
|
+
const w = lt(
|
|
647
649
|
u ?? Dt(
|
|
648
650
|
i,
|
|
649
651
|
a,
|
|
@@ -652,9 +654,9 @@ async function $i(e = {}) {
|
|
|
652
654
|
),
|
|
653
655
|
s
|
|
654
656
|
);
|
|
655
|
-
u && (u =
|
|
657
|
+
u && (u = w), bt(w, a), xe(
|
|
656
658
|
"Applied open panel position after viewport resize",
|
|
657
|
-
{ openPanelPosition:
|
|
659
|
+
{ openPanelPosition: w }
|
|
658
660
|
);
|
|
659
661
|
} else p && xe(
|
|
660
662
|
"Applied visible launcher position after viewport resize",
|
|
@@ -663,21 +665,21 @@ async function $i(e = {}) {
|
|
|
663
665
|
};
|
|
664
666
|
let ln = () => {
|
|
665
667
|
};
|
|
666
|
-
window.addEventListener("resize", rn), t.movableLauncher && z ? (Fe(), ln =
|
|
668
|
+
window.addEventListener("resize", rn), t.movableLauncher && z ? (Fe(), ln = Xi({
|
|
667
669
|
root: i,
|
|
668
670
|
launcher: v,
|
|
669
671
|
launcherDragHandle: z,
|
|
670
672
|
getPosition: () => Be(),
|
|
671
673
|
setPosition: (a) => {
|
|
672
|
-
const s = a,
|
|
674
|
+
const s = a, w = dt(i), S = Vt(
|
|
673
675
|
i,
|
|
674
676
|
a,
|
|
675
|
-
|
|
677
|
+
w
|
|
676
678
|
);
|
|
677
|
-
p =
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
), ve(i,
|
|
679
|
+
p = ta(
|
|
680
|
+
S,
|
|
681
|
+
w
|
|
682
|
+
), ve(i, S), xe("Dragging closed launcher", {
|
|
681
683
|
requestedPosition: s
|
|
682
684
|
});
|
|
683
685
|
},
|
|
@@ -709,7 +711,7 @@ async function $i(e = {}) {
|
|
|
709
711
|
);
|
|
710
712
|
const s = Be();
|
|
711
713
|
bt(u, s);
|
|
712
|
-
}, Do = P.length > 0 ?
|
|
714
|
+
}, Do = P.length > 0 ? Zi({
|
|
713
715
|
root: i,
|
|
714
716
|
handles: P,
|
|
715
717
|
getBounds: No,
|
|
@@ -737,19 +739,19 @@ async function $i(e = {}) {
|
|
|
737
739
|
}
|
|
738
740
|
}
|
|
739
741
|
}, ge = (a = "", s = !0) => {
|
|
740
|
-
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1),
|
|
742
|
+
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1), b.hidden = !1, A.hidden = !1, Mt(
|
|
741
743
|
h,
|
|
742
744
|
Re(c).width
|
|
743
745
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
744
|
-
const
|
|
746
|
+
const w = Fe(), S = Dt(
|
|
745
747
|
i,
|
|
746
|
-
|
|
748
|
+
w,
|
|
747
749
|
t.position,
|
|
748
750
|
c
|
|
749
751
|
);
|
|
750
|
-
if (bt(
|
|
751
|
-
openPanelPosition:
|
|
752
|
-
visibleLauncherPosition:
|
|
752
|
+
if (bt(S, w), xe("Opening launcher at clamped open panel position", {
|
|
753
|
+
openPanelPosition: S,
|
|
754
|
+
visibleLauncherPosition: w
|
|
753
755
|
}), ee(!0, "open"), te(), !s) {
|
|
754
756
|
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (x.value = a, je(x)), Ve(N, () => we.enabled), be = N.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), B(), Ze("shown"), t.onPanelOpenChange?.(!0);
|
|
755
757
|
return;
|
|
@@ -761,34 +763,34 @@ async function $i(e = {}) {
|
|
|
761
763
|
});
|
|
762
764
|
}, Ro = () => {
|
|
763
765
|
Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (Fe(!1), xe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
|
|
764
|
-
|
|
766
|
+
b.hidden = !0, A.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
765
767
|
}, 220);
|
|
766
768
|
};
|
|
767
769
|
v.addEventListener("submit", (a) => {
|
|
768
|
-
a.preventDefault(), ge(
|
|
770
|
+
a.preventDefault(), ge(_.value), _.value = "";
|
|
769
771
|
}), z?.addEventListener("click", (a) => {
|
|
770
772
|
a.preventDefault(), a.stopPropagation();
|
|
771
773
|
}), v.addEventListener("click", (a) => {
|
|
772
|
-
a.target ===
|
|
773
|
-
}),
|
|
774
|
-
ge(
|
|
775
|
-
}),
|
|
776
|
-
if (!
|
|
774
|
+
a.target === _ && !z || (ge(_.value), _.value = "");
|
|
775
|
+
}), _.addEventListener("focus", () => {
|
|
776
|
+
ge(_.value), _.value = "";
|
|
777
|
+
}), _.addEventListener("input", () => {
|
|
778
|
+
if (!_.value)
|
|
777
779
|
return;
|
|
778
|
-
const a =
|
|
779
|
-
ge(a),
|
|
780
|
+
const a = _.value;
|
|
781
|
+
ge(a), _.value = "";
|
|
780
782
|
});
|
|
781
783
|
let xt = null, Je = null, ye = null;
|
|
782
|
-
const sn = (a) => a ===
|
|
784
|
+
const sn = (a) => a === _ || a === x, zo = (a) => {
|
|
783
785
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
784
786
|
return null;
|
|
785
787
|
let s = a;
|
|
786
788
|
for (; s; ) {
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
789
|
-
return
|
|
790
|
-
const
|
|
791
|
-
s =
|
|
789
|
+
const w = s.closest(vn);
|
|
790
|
+
if (w)
|
|
791
|
+
return w;
|
|
792
|
+
const S = s.getRootNode();
|
|
793
|
+
s = S instanceof ShadowRoot ? S.host : null;
|
|
792
794
|
}
|
|
793
795
|
return null;
|
|
794
796
|
}, Mo = (a) => {
|
|
@@ -806,7 +808,7 @@ async function $i(e = {}) {
|
|
|
806
808
|
He !== a && (He = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), et(), a !== null ? ye = window.setInterval(() => {
|
|
807
809
|
const s = He;
|
|
808
810
|
(!s || !Mo(s)) && dn(null);
|
|
809
|
-
},
|
|
811
|
+
}, Pi) : ye !== null && (window.clearInterval(ye), ye = null, Je = null));
|
|
810
812
|
}, Oo = () => {
|
|
811
813
|
ye !== null && (window.clearInterval(ye), ye = null);
|
|
812
814
|
};
|
|
@@ -816,17 +818,17 @@ async function $i(e = {}) {
|
|
|
816
818
|
if (!sn(a.target) || He !== null)
|
|
817
819
|
return;
|
|
818
820
|
const s = xt;
|
|
819
|
-
if (xt = null, s === null || Date.now() - s >
|
|
821
|
+
if (xt = null, s === null || Date.now() - s > ki)
|
|
820
822
|
return;
|
|
821
|
-
const
|
|
822
|
-
if (!
|
|
823
|
+
const w = zo(a.relatedTarget);
|
|
824
|
+
if (!w)
|
|
823
825
|
return;
|
|
824
|
-
const
|
|
825
|
-
if (Je !== null &&
|
|
826
|
-
dn(
|
|
826
|
+
const S = Date.now();
|
|
827
|
+
if (Je !== null && S - Je <= Li) {
|
|
828
|
+
dn(w);
|
|
827
829
|
return;
|
|
828
830
|
}
|
|
829
|
-
Je =
|
|
831
|
+
Je = S;
|
|
830
832
|
}), v.addEventListener("keydown", (a) => {
|
|
831
833
|
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), ge());
|
|
832
834
|
}), g?.addEventListener("pointerdown", (a) => {
|
|
@@ -849,7 +851,7 @@ async function $i(e = {}) {
|
|
|
849
851
|
let He = null, We = !1;
|
|
850
852
|
const et = () => {
|
|
851
853
|
const a = Qe(), s = He !== null;
|
|
852
|
-
|
|
854
|
+
_.readOnly = a || s, x.readOnly = s, _.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : We ? "New update" : t.launcherLabel, x.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, L.hidden = a;
|
|
853
855
|
}, j = () => {
|
|
854
856
|
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, ze.disabled = Qe() || ae(t.billingStatus);
|
|
855
857
|
};
|
|
@@ -861,7 +863,7 @@ async function $i(e = {}) {
|
|
|
861
863
|
!a && We
|
|
862
864
|
), et();
|
|
863
865
|
};
|
|
864
|
-
yt(),
|
|
866
|
+
yt(), L.addEventListener("submit", (a) => {
|
|
865
867
|
if (a.preventDefault(), t.loginRequired) {
|
|
866
868
|
t.onLoginClick?.();
|
|
867
869
|
return;
|
|
@@ -888,7 +890,7 @@ async function $i(e = {}) {
|
|
|
888
890
|
}, Ct = async (a) => {
|
|
889
891
|
if (a.length === 0)
|
|
890
892
|
return;
|
|
891
|
-
const s =
|
|
893
|
+
const s = Ma(y, a);
|
|
892
894
|
W = [...W, ...s], Ee(), Uo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || ge();
|
|
893
895
|
};
|
|
894
896
|
ze.addEventListener("click", () => {
|
|
@@ -911,20 +913,20 @@ async function $i(e = {}) {
|
|
|
911
913
|
it(a.dataTransfer) && (a.stopPropagation(), Ge = Math.max(0, Ge - 1), Ge === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
912
914
|
}), i.addEventListener("drop", (a) => {
|
|
913
915
|
const s = a.dataTransfer;
|
|
914
|
-
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Bo(), Ct(s.files).catch((
|
|
916
|
+
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Bo(), Ct(s.files).catch((w) => {
|
|
915
917
|
vt(
|
|
916
|
-
|
|
918
|
+
w instanceof Error ? w.message : "Failed to attach file"
|
|
917
919
|
), J("web-sdk.widget", "Attachment failed", {
|
|
918
|
-
message:
|
|
920
|
+
message: w instanceof Error ? w.message : String(w)
|
|
919
921
|
});
|
|
920
922
|
}));
|
|
921
923
|
}), i.addEventListener("paste", (a) => {
|
|
922
|
-
const s = a.clipboardData,
|
|
923
|
-
|
|
924
|
+
const s = a.clipboardData, w = Array.from(s?.files ?? []);
|
|
925
|
+
w.length === 0 || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Ct(w).catch((S) => {
|
|
924
926
|
vt(
|
|
925
|
-
|
|
927
|
+
S instanceof Error ? S.message : "Failed to attach file"
|
|
926
928
|
), J("web-sdk.widget", "Attachment failed", {
|
|
927
|
-
message:
|
|
929
|
+
message: S instanceof Error ? S.message : String(S)
|
|
928
930
|
});
|
|
929
931
|
}));
|
|
930
932
|
}), de.addEventListener("click", () => {
|
|
@@ -961,7 +963,7 @@ async function $i(e = {}) {
|
|
|
961
963
|
}
|
|
962
964
|
}), i.addEventListener("click", (a) => {
|
|
963
965
|
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
964
|
-
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1),
|
|
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), la(l, i, _, x);
|
|
965
967
|
const tt = () => r;
|
|
966
968
|
let St = y.getState().appearance !== null, nt = null, $e = null, Pe = null, un = y.getState().isThinking, Ie = null;
|
|
967
969
|
const qe = t.taskNotifications;
|
|
@@ -1007,7 +1009,7 @@ async function $i(e = {}) {
|
|
|
1007
1009
|
De || (De = gt(
|
|
1008
1010
|
"pluno-pa-widget__new-chat",
|
|
1009
1011
|
"New chat",
|
|
1010
|
-
|
|
1012
|
+
Ea(),
|
|
1011
1013
|
!1
|
|
1012
1014
|
), De.addEventListener("click", Go), Ye.insertBefore(De, X));
|
|
1013
1015
|
}, G = (a) => {
|
|
@@ -1041,10 +1043,10 @@ async function $i(e = {}) {
|
|
|
1041
1043
|
);
|
|
1042
1044
|
return;
|
|
1043
1045
|
}
|
|
1044
|
-
const s =
|
|
1046
|
+
const s = sa(a), w = s !== nn;
|
|
1045
1047
|
nn = s;
|
|
1046
|
-
const
|
|
1047
|
-
fe = !1,
|
|
1048
|
+
const S = fe || we.enabled;
|
|
1049
|
+
fe = !1, Ga(
|
|
1048
1050
|
N,
|
|
1049
1051
|
ht,
|
|
1050
1052
|
de,
|
|
@@ -1053,7 +1055,7 @@ async function $i(e = {}) {
|
|
|
1053
1055
|
a,
|
|
1054
1056
|
Te,
|
|
1055
1057
|
Te !== null && Ut(a, kt()),
|
|
1056
|
-
|
|
1058
|
+
S,
|
|
1057
1059
|
() => we.enabled,
|
|
1058
1060
|
mt,
|
|
1059
1061
|
Et,
|
|
@@ -1077,12 +1079,12 @@ async function $i(e = {}) {
|
|
|
1077
1079
|
ke.add(M.id), Xe.add(M.id), B(), $e = null, G(y.getState());
|
|
1078
1080
|
},
|
|
1079
1081
|
onDisable: (M) => {
|
|
1080
|
-
ft = !0, ke.add(M.id), Xe.add(M.id), B(),
|
|
1082
|
+
ft = !0, ke.add(M.id), Xe.add(M.id), B(), ur(t, !0), $e = null, G(y.getState());
|
|
1081
1083
|
}
|
|
1082
1084
|
} : void 0
|
|
1083
|
-
),
|
|
1085
|
+
), S ? (be = N.scrollTop, te()) : w && da(a) && Lo();
|
|
1084
1086
|
};
|
|
1085
|
-
return mn =
|
|
1087
|
+
return mn = si(
|
|
1086
1088
|
(a) => {
|
|
1087
1089
|
Te = a, !Le && Ut(y.getState(), kt()) && G(y.getState());
|
|
1088
1090
|
},
|
|
@@ -1095,7 +1097,7 @@ async function $i(e = {}) {
|
|
|
1095
1097
|
const s = un && !a.isThinking;
|
|
1096
1098
|
un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && qe && !Ne && Ae === null && Me?.hidden !== !1 && (Ae = window.setTimeout(() => {
|
|
1097
1099
|
Ae = null, Fo();
|
|
1098
|
-
},
|
|
1100
|
+
}, hi)), (!a.isThinking || a.assistantDraft.trim()) && (gn(), ot()), s && !i.classList.contains("pluno-pa-widget--open") && (We = !0), yt(), a.appearance ? (St = !0, J(
|
|
1099
1101
|
"web-sdk.widget",
|
|
1100
1102
|
"Agent state supplied appearance",
|
|
1101
1103
|
{
|
|
@@ -1129,12 +1131,12 @@ async function $i(e = {}) {
|
|
|
1129
1131
|
},
|
|
1130
1132
|
updateAuthGate: (a) => {
|
|
1131
1133
|
const s = Qe();
|
|
1132
|
-
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), et(), G(y.getState()), j(), s && !Qe() && y.connect().catch((
|
|
1134
|
+
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), et(), G(y.getState()), j(), s && !Qe() && y.connect().catch((w) => {
|
|
1133
1135
|
J(
|
|
1134
1136
|
"web-sdk.widget",
|
|
1135
1137
|
"Failed to connect after auth gate cleared",
|
|
1136
1138
|
{
|
|
1137
|
-
message:
|
|
1139
|
+
message: w instanceof Error ? w.message : String(w)
|
|
1138
1140
|
}
|
|
1139
1141
|
);
|
|
1140
1142
|
});
|
|
@@ -1162,7 +1164,7 @@ async function $i(e = {}) {
|
|
|
1162
1164
|
const s = await t.socialPostDraftHandler(a);
|
|
1163
1165
|
if (!s.linkedinPost || !s.xPost)
|
|
1164
1166
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1165
|
-
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe =
|
|
1167
|
+
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe = Za(s, {
|
|
1166
1168
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1167
1169
|
onClose: () => {
|
|
1168
1170
|
Pe?.remove(), Pe = null;
|
|
@@ -1176,20 +1178,20 @@ async function $i(e = {}) {
|
|
|
1176
1178
|
}
|
|
1177
1179
|
}
|
|
1178
1180
|
function Pt(a, s) {
|
|
1179
|
-
const
|
|
1181
|
+
const w = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, It = a.scribbleStyle ?? t.scribbleStyle;
|
|
1180
1182
|
r = Pn(
|
|
1181
|
-
|
|
1183
|
+
w,
|
|
1182
1184
|
It
|
|
1183
1185
|
), In(i, r, {
|
|
1184
|
-
accentColor:
|
|
1185
|
-
colorScheme:
|
|
1186
|
+
accentColor: w,
|
|
1187
|
+
colorScheme: S,
|
|
1186
1188
|
fontFamily: M,
|
|
1187
1189
|
scribbleStyle: It
|
|
1188
1190
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1189
1191
|
source: s,
|
|
1190
1192
|
inputAppearance: a,
|
|
1191
|
-
appliedAccentColor:
|
|
1192
|
-
appliedColorScheme:
|
|
1193
|
+
appliedAccentColor: w,
|
|
1194
|
+
appliedColorScheme: S,
|
|
1193
1195
|
appliedFontFamily: M,
|
|
1194
1196
|
appliedScribbleStyle: It,
|
|
1195
1197
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
@@ -1199,11 +1201,11 @@ async function $i(e = {}) {
|
|
|
1199
1201
|
function Pn(e, t) {
|
|
1200
1202
|
return { accentColor: e, scribbleStyle: t };
|
|
1201
1203
|
}
|
|
1202
|
-
function qi(e) {
|
|
1203
|
-
const t = ji(e);
|
|
1204
|
-
return t === null ? "#fafafa" : Vi(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1205
|
-
}
|
|
1206
1204
|
function ji(e) {
|
|
1205
|
+
const t = Vi(e);
|
|
1206
|
+
return t === null ? "#fafafa" : Ki(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1207
|
+
}
|
|
1208
|
+
function Vi(e) {
|
|
1207
1209
|
const t = e.trim();
|
|
1208
1210
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1209
1211
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1215,7 +1217,7 @@ function ji(e) {
|
|
|
1215
1217
|
Number.parseInt(t[3] + t[3], 16)
|
|
1216
1218
|
] : null;
|
|
1217
1219
|
}
|
|
1218
|
-
function
|
|
1220
|
+
function Ki([e, t, n]) {
|
|
1219
1221
|
const o = (i) => {
|
|
1220
1222
|
const r = i / 255;
|
|
1221
1223
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
@@ -1233,8 +1235,8 @@ function In(e, t, n) {
|
|
|
1233
1235
|
const o = n.scribbleStyle ? Kn(n.accentColor) : n.accentColor;
|
|
1234
1236
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1235
1237
|
"--pluno-pa-accent-contrast",
|
|
1236
|
-
|
|
1237
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1238
|
+
ji(o)
|
|
1239
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ai : n.fontFamily, n.scribbleStyle && Yi(e.ownerDocument);
|
|
1238
1240
|
const i = Array.from(
|
|
1239
1241
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1240
1242
|
);
|
|
@@ -1246,7 +1248,7 @@ function In(e, t, n) {
|
|
|
1246
1248
|
)
|
|
1247
1249
|
);
|
|
1248
1250
|
}
|
|
1249
|
-
function
|
|
1251
|
+
function Yi(e) {
|
|
1250
1252
|
if (e.getElementById(Sn))
|
|
1251
1253
|
return;
|
|
1252
1254
|
const t = e.createElement("style");
|
|
@@ -1258,7 +1260,7 @@ function Ki(e) {
|
|
|
1258
1260
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1259
1261
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1260
1262
|
}
|
|
1261
|
-
function
|
|
1263
|
+
function Xi({
|
|
1262
1264
|
root: e,
|
|
1263
1265
|
launcher: t,
|
|
1264
1266
|
launcherDragHandle: n,
|
|
@@ -1269,7 +1271,7 @@ function Yi({
|
|
|
1269
1271
|
let l = null, p = null, d = null, c = !1, u = null;
|
|
1270
1272
|
const m = () => {
|
|
1271
1273
|
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1272
|
-
},
|
|
1274
|
+
}, k = (h) => {
|
|
1273
1275
|
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d = o(), c = !1, t.setPointerCapture?.(h.pointerId));
|
|
1274
1276
|
}, v = (h) => {
|
|
1275
1277
|
if (l !== h.pointerId || !p || !d)
|
|
@@ -1279,7 +1281,7 @@ function Yi({
|
|
|
1279
1281
|
!c && Math.hypot(P, A) < jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + P, y: d.y + A }));
|
|
1280
1282
|
}, z = (h) => {
|
|
1281
1283
|
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1282
|
-
},
|
|
1284
|
+
}, _ = (h) => {
|
|
1283
1285
|
l === h.pointerId && (h.preventDefault(), m());
|
|
1284
1286
|
}, g = (h) => {
|
|
1285
1287
|
if (!u)
|
|
@@ -1289,18 +1291,18 @@ function Yi({
|
|
|
1289
1291
|
h.clientY - u.y
|
|
1290
1292
|
) <= jt;
|
|
1291
1293
|
u = null, P && (h.preventDefault(), h.stopPropagation());
|
|
1292
|
-
},
|
|
1294
|
+
}, b = (h) => {
|
|
1293
1295
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1294
1296
|
return;
|
|
1295
1297
|
const P = h.shiftKey ? oo : no, A = o();
|
|
1296
|
-
let
|
|
1297
|
-
h.key === "ArrowUp" ?
|
|
1298
|
+
let L = null;
|
|
1299
|
+
h.key === "ArrowUp" ? L = { x: A.x, y: A.y - P } : h.key === "ArrowDown" ? L = { x: A.x, y: A.y + P } : h.key === "ArrowLeft" ? L = { x: A.x - P, y: A.y } : h.key === "ArrowRight" && (L = { x: A.x + P, y: A.y }), L && (h.preventDefault(), h.stopPropagation(), i(L), r());
|
|
1298
1300
|
};
|
|
1299
|
-
return t.addEventListener("pointerdown",
|
|
1300
|
-
t.removeEventListener("pointerdown",
|
|
1301
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", z), t.addEventListener("pointercancel", _), t.addEventListener("click", g, !0), n.addEventListener("keydown", b), () => {
|
|
1302
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", z), t.removeEventListener("pointercancel", _), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", b);
|
|
1301
1303
|
};
|
|
1302
1304
|
}
|
|
1303
|
-
function
|
|
1305
|
+
function Zi({
|
|
1304
1306
|
root: e,
|
|
1305
1307
|
handles: t,
|
|
1306
1308
|
getBounds: n,
|
|
@@ -1311,30 +1313,30 @@ function Xi({
|
|
|
1311
1313
|
const u = () => {
|
|
1312
1314
|
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1313
1315
|
}, m = (g) => {
|
|
1314
|
-
const
|
|
1315
|
-
!e.classList.contains("pluno-pa-widget--open") || !An(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1,
|
|
1316
|
-
},
|
|
1316
|
+
const b = g.currentTarget, h = b.dataset.resizeDirection;
|
|
1317
|
+
!e.classList.contains("pluno-pa-widget--open") || !An(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, b.setPointerCapture?.(g.pointerId));
|
|
1318
|
+
}, k = (g) => {
|
|
1317
1319
|
if (r !== g.pointerId || !l || !p || !d)
|
|
1318
1320
|
return;
|
|
1319
1321
|
g.preventDefault(), g.stopPropagation();
|
|
1320
|
-
const
|
|
1321
|
-
!c && Math.hypot(
|
|
1322
|
-
Nn(d, l,
|
|
1322
|
+
const b = g.clientX - p.x, h = g.clientY - p.y;
|
|
1323
|
+
!c && Math.hypot(b, h) < jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1324
|
+
Nn(d, l, b, h)
|
|
1323
1325
|
));
|
|
1324
1326
|
}, v = (g) => {
|
|
1325
1327
|
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1326
1328
|
}, z = (g) => {
|
|
1327
1329
|
r === g.pointerId && (g.preventDefault(), u());
|
|
1328
|
-
},
|
|
1330
|
+
}, _ = (g) => {
|
|
1329
1331
|
const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? oo : no, A = n();
|
|
1330
|
-
let
|
|
1331
|
-
An(h) && (g.key === "ArrowLeft" ?
|
|
1332
|
+
let L = 0, F = 0;
|
|
1333
|
+
An(h) && (g.key === "ArrowLeft" ? L = -P : g.key === "ArrowRight" ? L = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(L === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(Nn(A, h, L, F)), i()));
|
|
1332
1334
|
};
|
|
1333
1335
|
for (const g of t)
|
|
1334
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove",
|
|
1336
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", z), g.addEventListener("keydown", _);
|
|
1335
1337
|
return () => {
|
|
1336
1338
|
for (const g of t)
|
|
1337
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove",
|
|
1339
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", z), g.removeEventListener("keydown", _);
|
|
1338
1340
|
};
|
|
1339
1341
|
}
|
|
1340
1342
|
function An(e) {
|
|
@@ -1418,38 +1420,38 @@ function dt(e, t = !0) {
|
|
|
1418
1420
|
const n = Y();
|
|
1419
1421
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1420
1422
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1421
|
-
width:
|
|
1422
|
-
height:
|
|
1423
|
+
width: Ni,
|
|
1424
|
+
height: Ti
|
|
1423
1425
|
} : { width: En, height: En };
|
|
1424
1426
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1425
1427
|
return {
|
|
1426
1428
|
width: t && i && o.width > 0 ? o.width : Math.min(Qn, n.width - 36),
|
|
1427
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1429
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Ri : eo
|
|
1428
1430
|
};
|
|
1429
1431
|
}
|
|
1430
|
-
function
|
|
1432
|
+
function Ji() {
|
|
1431
1433
|
const e = Y();
|
|
1432
1434
|
return {
|
|
1433
1435
|
width: Math.min(
|
|
1434
1436
|
K(
|
|
1435
|
-
e.width *
|
|
1437
|
+
e.width * Mi,
|
|
1436
1438
|
Jt,
|
|
1437
|
-
|
|
1439
|
+
zi
|
|
1438
1440
|
),
|
|
1439
1441
|
e.width - I * 2
|
|
1440
1442
|
),
|
|
1441
1443
|
height: Math.min(
|
|
1442
1444
|
K(
|
|
1443
|
-
e.height *
|
|
1445
|
+
e.height * Bi,
|
|
1444
1446
|
Qt,
|
|
1445
|
-
|
|
1447
|
+
Oi
|
|
1446
1448
|
),
|
|
1447
1449
|
e.height - Ce - I
|
|
1448
1450
|
)
|
|
1449
1451
|
};
|
|
1450
1452
|
}
|
|
1451
1453
|
function Re(e = null) {
|
|
1452
|
-
return e ? ut(e) :
|
|
1454
|
+
return e ? ut(e) : Ji();
|
|
1453
1455
|
}
|
|
1454
1456
|
function ut(e) {
|
|
1455
1457
|
const t = Y();
|
|
@@ -1486,7 +1488,7 @@ function Nt(e, t) {
|
|
|
1486
1488
|
const n = ut(t);
|
|
1487
1489
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1488
1490
|
}
|
|
1489
|
-
function
|
|
1491
|
+
function Qi(e, t, n) {
|
|
1490
1492
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1491
1493
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1492
1494
|
return { x: o, y: i };
|
|
@@ -1505,9 +1507,9 @@ function Tt(e, t, n) {
|
|
|
1505
1507
|
e,
|
|
1506
1508
|
ro(t, o),
|
|
1507
1509
|
o
|
|
1508
|
-
) :
|
|
1510
|
+
) : ea(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Di);
|
|
1509
1511
|
}
|
|
1510
|
-
function
|
|
1512
|
+
function ea(e, t, n) {
|
|
1511
1513
|
const o = Y();
|
|
1512
1514
|
return {
|
|
1513
1515
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
@@ -1515,7 +1517,7 @@ function Qi(e, t, n) {
|
|
|
1515
1517
|
};
|
|
1516
1518
|
}
|
|
1517
1519
|
function Vt(e, t, n) {
|
|
1518
|
-
const o = Y(), i = I +
|
|
1520
|
+
const o = Y(), i = I + oa(e);
|
|
1519
1521
|
return {
|
|
1520
1522
|
x: K(
|
|
1521
1523
|
t.x,
|
|
@@ -1542,20 +1544,20 @@ function ro(e, t) {
|
|
|
1542
1544
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1543
1545
|
};
|
|
1544
1546
|
}
|
|
1545
|
-
function
|
|
1546
|
-
const n =
|
|
1547
|
+
function ta(e, t) {
|
|
1548
|
+
const n = na(e, t), o = Y();
|
|
1547
1549
|
return {
|
|
1548
1550
|
anchor: n,
|
|
1549
1551
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1550
1552
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1551
1553
|
};
|
|
1552
1554
|
}
|
|
1553
|
-
function
|
|
1555
|
+
function na(e, t) {
|
|
1554
1556
|
const n = Y(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1555
1557
|
return `${r}-${l}`;
|
|
1556
1558
|
}
|
|
1557
|
-
function
|
|
1558
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1559
|
+
function oa(e) {
|
|
1560
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Wi : Hi;
|
|
1559
1561
|
}
|
|
1560
1562
|
function Dt(e, t, n, o = null) {
|
|
1561
1563
|
const i = dt(e), r = Re(o), l = {
|
|
@@ -1592,7 +1594,7 @@ function ve(e, t) {
|
|
|
1592
1594
|
}
|
|
1593
1595
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1594
1596
|
}
|
|
1595
|
-
function
|
|
1597
|
+
function ia(e, t) {
|
|
1596
1598
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1597
1599
|
}
|
|
1598
1600
|
function Dn(e) {
|
|
@@ -1626,31 +1628,31 @@ function J(e, t, n) {
|
|
|
1626
1628
|
details: n
|
|
1627
1629
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1628
1630
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1629
|
-
new CustomEvent(
|
|
1631
|
+
new CustomEvent(Si, { detail: i })
|
|
1630
1632
|
);
|
|
1631
1633
|
}
|
|
1632
|
-
function
|
|
1634
|
+
function aa(e, t) {
|
|
1633
1635
|
J("web-sdk.widget.position", e, t);
|
|
1634
1636
|
}
|
|
1635
1637
|
function zt(e, t, n) {
|
|
1636
1638
|
const o = t.value.trim();
|
|
1637
1639
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1638
|
-
attachments: n.length > 0 ? n.map(
|
|
1640
|
+
attachments: n.length > 0 ? n.map(pa) : void 0
|
|
1639
1641
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1640
1642
|
}
|
|
1641
|
-
function
|
|
1643
|
+
function ra(e, t, n) {
|
|
1642
1644
|
const o = e.activeElement;
|
|
1643
1645
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1644
1646
|
}
|
|
1645
|
-
function
|
|
1646
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1647
|
+
function la(e, t, n, o) {
|
|
1648
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > mi)
|
|
1647
1649
|
return;
|
|
1648
1650
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1649
1651
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1650
1652
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1651
1653
|
});
|
|
1652
1654
|
}
|
|
1653
|
-
function
|
|
1655
|
+
function pa(e) {
|
|
1654
1656
|
return e;
|
|
1655
1657
|
}
|
|
1656
1658
|
function je(e) {
|
|
@@ -1663,7 +1665,7 @@ function Ve(e, t = () => !0) {
|
|
|
1663
1665
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1664
1666
|
});
|
|
1665
1667
|
}
|
|
1666
|
-
function
|
|
1668
|
+
function sa(e) {
|
|
1667
1669
|
const t = e.messages[e.messages.length - 1];
|
|
1668
1670
|
return [
|
|
1669
1671
|
e.messages.length,
|
|
@@ -1674,13 +1676,13 @@ function pa(e) {
|
|
|
1674
1676
|
e.lastError ?? ""
|
|
1675
1677
|
].join(":");
|
|
1676
1678
|
}
|
|
1677
|
-
function
|
|
1679
|
+
function da(e) {
|
|
1678
1680
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1679
1681
|
}
|
|
1680
|
-
function
|
|
1682
|
+
function ca(e) {
|
|
1681
1683
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1682
1684
|
}
|
|
1683
|
-
function
|
|
1685
|
+
function ua(e) {
|
|
1684
1686
|
const t = e.currentPage;
|
|
1685
1687
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1686
1688
|
try {
|
|
@@ -1691,7 +1693,7 @@ function ca(e) {
|
|
|
1691
1693
|
}
|
|
1692
1694
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1693
1695
|
}
|
|
1694
|
-
function
|
|
1696
|
+
function ga(e, t) {
|
|
1695
1697
|
const n = new Date(e).getTime();
|
|
1696
1698
|
if (!Number.isFinite(n))
|
|
1697
1699
|
return "now";
|
|
@@ -1707,9 +1709,9 @@ function ua(e, t) {
|
|
|
1707
1709
|
}
|
|
1708
1710
|
return "now";
|
|
1709
1711
|
}
|
|
1710
|
-
function
|
|
1711
|
-
e.appendChild(
|
|
1712
|
-
|
|
1712
|
+
function ha(e, t, n, o, i) {
|
|
1713
|
+
e.appendChild(Ca()), e.appendChild(
|
|
1714
|
+
ma(
|
|
1713
1715
|
t,
|
|
1714
1716
|
n,
|
|
1715
1717
|
o,
|
|
@@ -1719,12 +1721,12 @@ function ga(e, t, n, o, i) {
|
|
|
1719
1721
|
gt(
|
|
1720
1722
|
"pluno-pa-widget__close",
|
|
1721
1723
|
"Close",
|
|
1722
|
-
|
|
1724
|
+
Sa(16),
|
|
1723
1725
|
!0
|
|
1724
1726
|
)
|
|
1725
|
-
), e.appendChild(
|
|
1727
|
+
), e.appendChild(fa(n));
|
|
1726
1728
|
}
|
|
1727
|
-
function
|
|
1729
|
+
function ma(e, t, n, o) {
|
|
1728
1730
|
const i = document.createElement("form");
|
|
1729
1731
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1730
1732
|
const d = document.createElement("button");
|
|
@@ -1752,7 +1754,7 @@ function ha(e, t, n, o) {
|
|
|
1752
1754
|
}
|
|
1753
1755
|
return i;
|
|
1754
1756
|
}
|
|
1755
|
-
function
|
|
1757
|
+
function fa(e) {
|
|
1756
1758
|
const t = document.createElement("section");
|
|
1757
1759
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1758
1760
|
co("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
@@ -1760,7 +1762,7 @@ function ma(e) {
|
|
|
1760
1762
|
const n = document.createElement("div");
|
|
1761
1763
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1762
1764
|
const o = document.createElement("main");
|
|
1763
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1765
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(xa(e));
|
|
1764
1766
|
const i = document.createElement("div");
|
|
1765
1767
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1766
1768
|
const r = document.createElement("div");
|
|
@@ -1772,10 +1774,10 @@ function ma(e) {
|
|
|
1772
1774
|
gt(
|
|
1773
1775
|
"pluno-pa-widget__history",
|
|
1774
1776
|
Kt(),
|
|
1775
|
-
|
|
1777
|
+
ka(),
|
|
1776
1778
|
!0
|
|
1777
1779
|
)
|
|
1778
|
-
), n.appendChild(p), n.appendChild(
|
|
1780
|
+
), n.appendChild(p), n.appendChild(_a()), t.appendChild(n), t.appendChild(wa()), t.appendChild(ba()), t.appendChild(he("left", "Resize Pluno from left")), t.appendChild(
|
|
1779
1781
|
he("right", "Resize Pluno from right")
|
|
1780
1782
|
), t.appendChild(he("top", "Resize Pluno from top")), t.appendChild(
|
|
1781
1783
|
he("bottom", "Resize Pluno from bottom")
|
|
@@ -1796,7 +1798,7 @@ function he(e, t) {
|
|
|
1796
1798
|
`pluno-pa-widget__resize-handle--${e}`
|
|
1797
1799
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1798
1800
|
}
|
|
1799
|
-
function
|
|
1801
|
+
function wa() {
|
|
1800
1802
|
const e = document.createElement("div");
|
|
1801
1803
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1802
1804
|
const t = document.createElement("span");
|
|
@@ -1810,7 +1812,7 @@ function fa() {
|
|
|
1810
1812
|
const r = document.createElement("button");
|
|
1811
1813
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1812
1814
|
}
|
|
1813
|
-
function
|
|
1815
|
+
function ba() {
|
|
1814
1816
|
const e = document.createElement("form");
|
|
1815
1817
|
e.className = "pluno-pa-widget__composer";
|
|
1816
1818
|
const t = document.createElement("div");
|
|
@@ -1824,7 +1826,7 @@ function wa() {
|
|
|
1824
1826
|
const r = document.createElement("input");
|
|
1825
1827
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1826
1828
|
const l = document.createElement("button");
|
|
1827
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1829
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Pa()), l.appendChild(Ia()), i.appendChild(l);
|
|
1828
1830
|
const p = document.createElement("textarea");
|
|
1829
1831
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1830
1832
|
const d = document.createElement("button");
|
|
@@ -1839,7 +1841,7 @@ function wa() {
|
|
|
1839
1841
|
function Kt() {
|
|
1840
1842
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1841
1843
|
}
|
|
1842
|
-
function
|
|
1844
|
+
function _a() {
|
|
1843
1845
|
const e = document.createElement("section");
|
|
1844
1846
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Kt());
|
|
1845
1847
|
const t = document.createElement("div");
|
|
@@ -1849,7 +1851,7 @@ function ba() {
|
|
|
1849
1851
|
const o = gt(
|
|
1850
1852
|
"pluno-pa-widget__history-close",
|
|
1851
1853
|
"Close recent chats",
|
|
1852
|
-
|
|
1854
|
+
La(),
|
|
1853
1855
|
!1
|
|
1854
1856
|
);
|
|
1855
1857
|
t.append(n, o);
|
|
@@ -1858,7 +1860,7 @@ function ba() {
|
|
|
1858
1860
|
const r = document.createElement("p");
|
|
1859
1861
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1860
1862
|
}
|
|
1861
|
-
function
|
|
1863
|
+
function xa(e) {
|
|
1862
1864
|
const t = document.createElement("div");
|
|
1863
1865
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1864
1866
|
me(
|
|
@@ -1886,14 +1888,14 @@ function po(e, t) {
|
|
|
1886
1888
|
function me(e, t) {
|
|
1887
1889
|
const n = `pluno-pa-character-${Ln}`;
|
|
1888
1890
|
Ln += 1;
|
|
1889
|
-
const o = t.scribbleStyle ?
|
|
1891
|
+
const o = t.scribbleStyle ? va(t.accentColor, n) : ya(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1890
1892
|
return o.setAttribute(
|
|
1891
1893
|
"class",
|
|
1892
1894
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1893
1895
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1894
1896
|
}
|
|
1895
|
-
function
|
|
1896
|
-
const n =
|
|
1897
|
+
function ya(e, t) {
|
|
1898
|
+
const n = Yo(e), o = {
|
|
1897
1899
|
boltFill: `${t}-boltFill`,
|
|
1898
1900
|
boltEdge: `${t}-boltEdge`,
|
|
1899
1901
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1958,7 +1960,7 @@ function xa(e, t) {
|
|
|
1958
1960
|
"flood-color": n.shadow,
|
|
1959
1961
|
"flood-opacity": "0.24"
|
|
1960
1962
|
});
|
|
1961
|
-
const
|
|
1963
|
+
const k = f(r, "filter", {
|
|
1962
1964
|
id: o.innerDepth,
|
|
1963
1965
|
x: "-8%",
|
|
1964
1966
|
y: "-8%",
|
|
@@ -1966,27 +1968,27 @@ function xa(e, t) {
|
|
|
1966
1968
|
height: "116%",
|
|
1967
1969
|
"color-interpolation-filters": "sRGB"
|
|
1968
1970
|
});
|
|
1969
|
-
f(
|
|
1971
|
+
f(k, "feGaussianBlur", {
|
|
1970
1972
|
in: "SourceAlpha",
|
|
1971
1973
|
stdDeviation: "8",
|
|
1972
1974
|
result: "blur"
|
|
1973
|
-
}), f(
|
|
1975
|
+
}), f(k, "feOffset", {
|
|
1974
1976
|
dx: "-7",
|
|
1975
1977
|
dy: "-9",
|
|
1976
1978
|
result: "topLeft"
|
|
1977
|
-
}), f(
|
|
1979
|
+
}), f(k, "feComposite", {
|
|
1978
1980
|
in: "topLeft",
|
|
1979
1981
|
in2: "SourceAlpha",
|
|
1980
1982
|
operator: "arithmetic",
|
|
1981
1983
|
k2: "-1",
|
|
1982
1984
|
k3: "1",
|
|
1983
1985
|
result: "innerShadow"
|
|
1984
|
-
}), f(
|
|
1986
|
+
}), f(k, "feColorMatrix", {
|
|
1985
1987
|
in: "innerShadow",
|
|
1986
1988
|
type: "matrix",
|
|
1987
1989
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1988
1990
|
result: "innerLight"
|
|
1989
|
-
}), f(
|
|
1991
|
+
}), f(k, "feBlend", {
|
|
1990
1992
|
in: "SourceGraphic",
|
|
1991
1993
|
in2: "innerLight",
|
|
1992
1994
|
mode: "screen"
|
|
@@ -2021,8 +2023,8 @@ function xa(e, t) {
|
|
|
2021
2023
|
"flood-color": "#000000",
|
|
2022
2024
|
"flood-opacity": "0.22"
|
|
2023
2025
|
});
|
|
2024
|
-
const
|
|
2025
|
-
f(
|
|
2026
|
+
const _ = f(r, "clipPath", { id: o.boltClip });
|
|
2027
|
+
f(_, "path", { d: pt });
|
|
2026
2028
|
const g = f(i, "g", {
|
|
2027
2029
|
filter: V(o.softDropShadow)
|
|
2028
2030
|
});
|
|
@@ -2030,13 +2032,13 @@ function xa(e, t) {
|
|
|
2030
2032
|
d: pt,
|
|
2031
2033
|
fill: V(o.boltEdge)
|
|
2032
2034
|
});
|
|
2033
|
-
const
|
|
2035
|
+
const b = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
2034
2036
|
f(g, "path", {
|
|
2035
|
-
d:
|
|
2037
|
+
d: b,
|
|
2036
2038
|
fill: V(o.boltFill),
|
|
2037
2039
|
filter: V(o.innerDepth)
|
|
2038
2040
|
}), f(g, "path", {
|
|
2039
|
-
d:
|
|
2041
|
+
d: b,
|
|
2040
2042
|
fill: V(o.boltGlow),
|
|
2041
2043
|
opacity: "0.74"
|
|
2042
2044
|
});
|
|
@@ -2089,7 +2091,7 @@ function xa(e, t) {
|
|
|
2089
2091
|
o
|
|
2090
2092
|
), i;
|
|
2091
2093
|
}
|
|
2092
|
-
function
|
|
2094
|
+
function va(e, t) {
|
|
2093
2095
|
const n = Kn(e), o = {
|
|
2094
2096
|
clip: `${t}-scribbleBoltClip`,
|
|
2095
2097
|
wobble: `${t}-scribbleBoltWobble`
|
|
@@ -2120,7 +2122,7 @@ function ya(e, t) {
|
|
|
2120
2122
|
"clip-path": V(o.clip)
|
|
2121
2123
|
});
|
|
2122
2124
|
return f(c, "path", {
|
|
2123
|
-
d:
|
|
2125
|
+
d: Ko(),
|
|
2124
2126
|
fill: "none",
|
|
2125
2127
|
stroke: n,
|
|
2126
2128
|
"stroke-width": "56",
|
|
@@ -2155,7 +2157,7 @@ function ya(e, t) {
|
|
|
2155
2157
|
), i;
|
|
2156
2158
|
}
|
|
2157
2159
|
function so() {
|
|
2158
|
-
return
|
|
2160
|
+
return E("svg", {
|
|
2159
2161
|
xmlns: to,
|
|
2160
2162
|
viewBox: "0 0 1254 1254"
|
|
2161
2163
|
});
|
|
@@ -2206,7 +2208,7 @@ function zn(e, t, n, o, i, r, l, p) {
|
|
|
2206
2208
|
});
|
|
2207
2209
|
}
|
|
2208
2210
|
function f(e, t, n = {}) {
|
|
2209
|
-
const o =
|
|
2211
|
+
const o = E(t, n);
|
|
2210
2212
|
return e.appendChild(o), o;
|
|
2211
2213
|
}
|
|
2212
2214
|
function O(e, t, n, o) {
|
|
@@ -2220,14 +2222,14 @@ function gt(e, t, n, o) {
|
|
|
2220
2222
|
const i = document.createElement("button");
|
|
2221
2223
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2222
2224
|
}
|
|
2223
|
-
function
|
|
2224
|
-
const e =
|
|
2225
|
+
function Ca() {
|
|
2226
|
+
const e = E("svg", {
|
|
2225
2227
|
class: "pluno-pa-widget__scribble-defs",
|
|
2226
2228
|
"aria-hidden": "true",
|
|
2227
2229
|
focusable: "false",
|
|
2228
2230
|
width: "0",
|
|
2229
2231
|
height: "0"
|
|
2230
|
-
}), t =
|
|
2232
|
+
}), t = E("defs");
|
|
2231
2233
|
return t.appendChild(Ot("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2232
2234
|
Ot("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2233
2235
|
), t.appendChild(
|
|
@@ -2235,7 +2237,7 @@ function va() {
|
|
|
2235
2237
|
), e.appendChild(t), e;
|
|
2236
2238
|
}
|
|
2237
2239
|
function co(e, t) {
|
|
2238
|
-
const n =
|
|
2240
|
+
const n = E("svg", {
|
|
2239
2241
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2240
2242
|
preserveAspectRatio: "xMidYMid meet",
|
|
2241
2243
|
"aria-hidden": "true",
|
|
@@ -2250,7 +2252,7 @@ function Mt(e, t) {
|
|
|
2250
2252
|
0,
|
|
2251
2253
|
t - qt * 2
|
|
2252
2254
|
), o = Math.max(
|
|
2253
|
-
|
|
2255
|
+
Fi,
|
|
2254
2256
|
Math.floor(
|
|
2255
2257
|
(n - $t * 2) / Gt
|
|
2256
2258
|
)
|
|
@@ -2263,14 +2265,14 @@ function uo(e, t) {
|
|
|
2263
2265
|
const n = t * Gt + $t * 2;
|
|
2264
2266
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2265
2267
|
"viewBox",
|
|
2266
|
-
`0 0 ${n} ${
|
|
2268
|
+
`0 0 ${n} ${Ui}`
|
|
2267
2269
|
), e.replaceChildren();
|
|
2268
2270
|
for (let o = 0; o < t; o += 1) {
|
|
2269
|
-
const i = kn[o % kn.length], r =
|
|
2271
|
+
const i = kn[o % kn.length], r = E("g", {
|
|
2270
2272
|
transform: `translate(${$t + o * Gt} 0)`
|
|
2271
2273
|
});
|
|
2272
2274
|
r.appendChild(
|
|
2273
|
-
|
|
2275
|
+
E("ellipse", {
|
|
2274
2276
|
cx: i.ellipseCx,
|
|
2275
2277
|
cy: i.ellipseCy,
|
|
2276
2278
|
rx: i.ellipseRx,
|
|
@@ -2281,7 +2283,7 @@ function uo(e, t) {
|
|
|
2281
2283
|
opacity: "0.8"
|
|
2282
2284
|
})
|
|
2283
2285
|
), r.appendChild(
|
|
2284
|
-
|
|
2286
|
+
E("path", {
|
|
2285
2287
|
d: i.path,
|
|
2286
2288
|
fill: "none",
|
|
2287
2289
|
stroke: "#2c2a1e",
|
|
@@ -2292,7 +2294,7 @@ function uo(e, t) {
|
|
|
2292
2294
|
}
|
|
2293
2295
|
}
|
|
2294
2296
|
function Ot(e, t, n) {
|
|
2295
|
-
const o =
|
|
2297
|
+
const o = E("filter", {
|
|
2296
2298
|
id: e,
|
|
2297
2299
|
x: "-8%",
|
|
2298
2300
|
y: "-8%",
|
|
@@ -2300,7 +2302,7 @@ function Ot(e, t, n) {
|
|
|
2300
2302
|
height: "116%"
|
|
2301
2303
|
});
|
|
2302
2304
|
return o.appendChild(
|
|
2303
|
-
|
|
2305
|
+
E("feTurbulence", {
|
|
2304
2306
|
type: "fractalNoise",
|
|
2305
2307
|
baseFrequency: "0.012 0.028",
|
|
2306
2308
|
numOctaves: "3",
|
|
@@ -2308,7 +2310,7 @@ function Ot(e, t, n) {
|
|
|
2308
2310
|
result: "stroke-noise"
|
|
2309
2311
|
})
|
|
2310
2312
|
), o.appendChild(
|
|
2311
|
-
|
|
2313
|
+
E("feDisplacementMap", {
|
|
2312
2314
|
in: "SourceGraphic",
|
|
2313
2315
|
in2: "stroke-noise",
|
|
2314
2316
|
scale: "3.5",
|
|
@@ -2317,7 +2319,7 @@ function Ot(e, t, n) {
|
|
|
2317
2319
|
result: "warped"
|
|
2318
2320
|
})
|
|
2319
2321
|
), o.appendChild(
|
|
2320
|
-
|
|
2322
|
+
E("feTurbulence", {
|
|
2321
2323
|
type: "fractalNoise",
|
|
2322
2324
|
baseFrequency: "0.7",
|
|
2323
2325
|
numOctaves: "1",
|
|
@@ -2325,7 +2327,7 @@ function Ot(e, t, n) {
|
|
|
2325
2327
|
result: "ink-noise"
|
|
2326
2328
|
})
|
|
2327
2329
|
), o.appendChild(
|
|
2328
|
-
|
|
2330
|
+
E("feDisplacementMap", {
|
|
2329
2331
|
in: "warped",
|
|
2330
2332
|
in2: "ink-noise",
|
|
2331
2333
|
scale: "0.9",
|
|
@@ -2334,7 +2336,7 @@ function Ot(e, t, n) {
|
|
|
2334
2336
|
})
|
|
2335
2337
|
), o;
|
|
2336
2338
|
}
|
|
2337
|
-
function
|
|
2339
|
+
function Sa(e) {
|
|
2338
2340
|
const t = re(
|
|
2339
2341
|
"0 0 24 24",
|
|
2340
2342
|
e,
|
|
@@ -2343,9 +2345,9 @@ function Ca(e) {
|
|
|
2343
2345
|
"currentColor",
|
|
2344
2346
|
"2.25"
|
|
2345
2347
|
);
|
|
2346
|
-
return t.appendChild(
|
|
2348
|
+
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2347
2349
|
}
|
|
2348
|
-
function
|
|
2350
|
+
function Ea() {
|
|
2349
2351
|
const e = re(
|
|
2350
2352
|
"0 0 24 24",
|
|
2351
2353
|
17,
|
|
@@ -2355,16 +2357,16 @@ function Sa() {
|
|
|
2355
2357
|
"2.25"
|
|
2356
2358
|
);
|
|
2357
2359
|
return e.appendChild(
|
|
2358
|
-
|
|
2360
|
+
E("path", {
|
|
2359
2361
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2360
2362
|
})
|
|
2361
2363
|
), e.appendChild(
|
|
2362
|
-
|
|
2364
|
+
E("path", {
|
|
2363
2365
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2364
2366
|
})
|
|
2365
2367
|
), e;
|
|
2366
2368
|
}
|
|
2367
|
-
function
|
|
2369
|
+
function ka() {
|
|
2368
2370
|
const e = re(
|
|
2369
2371
|
"0 0 24 24",
|
|
2370
2372
|
17,
|
|
@@ -2373,9 +2375,9 @@ function Ea() {
|
|
|
2373
2375
|
"currentColor",
|
|
2374
2376
|
"2.25"
|
|
2375
2377
|
);
|
|
2376
|
-
return e.appendChild(
|
|
2378
|
+
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2377
2379
|
}
|
|
2378
|
-
function
|
|
2380
|
+
function La() {
|
|
2379
2381
|
const e = re(
|
|
2380
2382
|
"0 0 24 24",
|
|
2381
2383
|
15,
|
|
@@ -2384,7 +2386,7 @@ function ka() {
|
|
|
2384
2386
|
"currentColor",
|
|
2385
2387
|
"2.4"
|
|
2386
2388
|
);
|
|
2387
|
-
return e.appendChild(
|
|
2389
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2388
2390
|
}
|
|
2389
2391
|
function go() {
|
|
2390
2392
|
const e = re(
|
|
@@ -2396,10 +2398,10 @@ function go() {
|
|
|
2396
2398
|
"2.75"
|
|
2397
2399
|
);
|
|
2398
2400
|
return e.appendChild(
|
|
2399
|
-
|
|
2400
|
-
), e.appendChild(
|
|
2401
|
+
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2402
|
+
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2401
2403
|
}
|
|
2402
|
-
function
|
|
2404
|
+
function Pa() {
|
|
2403
2405
|
const e = re(
|
|
2404
2406
|
"0 0 24 24",
|
|
2405
2407
|
16,
|
|
@@ -2412,18 +2414,18 @@ function La() {
|
|
|
2412
2414
|
"class",
|
|
2413
2415
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2414
2416
|
), e.appendChild(
|
|
2415
|
-
|
|
2417
|
+
E("path", {
|
|
2416
2418
|
d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
|
|
2417
2419
|
})
|
|
2418
2420
|
), e;
|
|
2419
2421
|
}
|
|
2420
|
-
function
|
|
2422
|
+
function Ia() {
|
|
2421
2423
|
const e = re("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2422
2424
|
return e.setAttribute(
|
|
2423
2425
|
"class",
|
|
2424
2426
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2425
2427
|
), e.appendChild(
|
|
2426
|
-
|
|
2428
|
+
E("path", {
|
|
2427
2429
|
d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
|
|
2428
2430
|
stroke: "currentColor",
|
|
2429
2431
|
"stroke-width": "2",
|
|
@@ -2432,10 +2434,10 @@ function Pa() {
|
|
|
2432
2434
|
})
|
|
2433
2435
|
), e;
|
|
2434
2436
|
}
|
|
2435
|
-
function
|
|
2437
|
+
function Aa() {
|
|
2436
2438
|
const e = re("0 0 24 24", 18, 18, "currentColor");
|
|
2437
2439
|
return e.appendChild(
|
|
2438
|
-
|
|
2440
|
+
E("rect", {
|
|
2439
2441
|
x: "6",
|
|
2440
2442
|
y: "6",
|
|
2441
2443
|
width: "12",
|
|
@@ -2444,7 +2446,7 @@ function Ia() {
|
|
|
2444
2446
|
})
|
|
2445
2447
|
), e;
|
|
2446
2448
|
}
|
|
2447
|
-
function
|
|
2449
|
+
function Na() {
|
|
2448
2450
|
const e = re(
|
|
2449
2451
|
"0 0 24 24",
|
|
2450
2452
|
12,
|
|
@@ -2453,9 +2455,9 @@ function Aa() {
|
|
|
2453
2455
|
"currentColor",
|
|
2454
2456
|
"2.4"
|
|
2455
2457
|
);
|
|
2456
|
-
return e.appendChild(
|
|
2458
|
+
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2457
2459
|
}
|
|
2458
|
-
function
|
|
2460
|
+
function Ta() {
|
|
2459
2461
|
const e = re(
|
|
2460
2462
|
"0 0 24 24",
|
|
2461
2463
|
13,
|
|
@@ -2465,7 +2467,7 @@ function Na() {
|
|
|
2465
2467
|
"2.25"
|
|
2466
2468
|
);
|
|
2467
2469
|
return e.appendChild(
|
|
2468
|
-
|
|
2470
|
+
E("rect", {
|
|
2469
2471
|
width: "14",
|
|
2470
2472
|
height: "14",
|
|
2471
2473
|
x: "8",
|
|
@@ -2474,7 +2476,7 @@ function Na() {
|
|
|
2474
2476
|
ry: "2"
|
|
2475
2477
|
})
|
|
2476
2478
|
), e.appendChild(
|
|
2477
|
-
|
|
2479
|
+
E("path", {
|
|
2478
2480
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2479
2481
|
})
|
|
2480
2482
|
), e;
|
|
@@ -2487,9 +2489,9 @@ function re(e, t, n, o, i, r) {
|
|
|
2487
2489
|
fill: o,
|
|
2488
2490
|
"aria-hidden": "true"
|
|
2489
2491
|
};
|
|
2490
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2492
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2491
2493
|
}
|
|
2492
|
-
function
|
|
2494
|
+
function E(e, t = {}) {
|
|
2493
2495
|
const n = document.createElementNS(to, e);
|
|
2494
2496
|
for (const [o, i] of Object.entries(t))
|
|
2495
2497
|
n.setAttribute(o, i);
|
|
@@ -2501,18 +2503,18 @@ function Mn(e) {
|
|
|
2501
2503
|
n.stopPropagation();
|
|
2502
2504
|
});
|
|
2503
2505
|
}
|
|
2504
|
-
function
|
|
2506
|
+
function Da(e, t, n) {
|
|
2505
2507
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2506
2508
|
for (const [o, i] of t.entries()) {
|
|
2507
2509
|
const r = document.createElement("div");
|
|
2508
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2510
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Ra(i));
|
|
2509
2511
|
const l = document.createElement("span");
|
|
2510
2512
|
l.textContent = i.name, r.appendChild(l);
|
|
2511
2513
|
const p = document.createElement("button");
|
|
2512
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2514
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Na()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2513
2515
|
}
|
|
2514
2516
|
}
|
|
2515
|
-
function
|
|
2517
|
+
function Ra(e) {
|
|
2516
2518
|
const t = en(e), n = ho(e);
|
|
2517
2519
|
if (t === "image" && n) {
|
|
2518
2520
|
const o = document.createElement("img");
|
|
@@ -2524,7 +2526,7 @@ function Da(e) {
|
|
|
2524
2526
|
}
|
|
2525
2527
|
return ie(e);
|
|
2526
2528
|
}
|
|
2527
|
-
function
|
|
2529
|
+
function za(e) {
|
|
2528
2530
|
const t = en(e), n = ho(e);
|
|
2529
2531
|
if (t === "image" && n) {
|
|
2530
2532
|
const o = document.createElement("img");
|
|
@@ -2562,13 +2564,13 @@ function On(e) {
|
|
|
2562
2564
|
const t = en(e);
|
|
2563
2565
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2564
2566
|
}
|
|
2565
|
-
function
|
|
2567
|
+
function Ma(e, t) {
|
|
2566
2568
|
return t ? Array.from(t).map((o) => ({
|
|
2567
2569
|
...e.createLocalAttachment(o),
|
|
2568
|
-
previewUrl:
|
|
2570
|
+
previewUrl: Oa(o)
|
|
2569
2571
|
})) : [];
|
|
2570
2572
|
}
|
|
2571
|
-
function
|
|
2573
|
+
function Oa(e) {
|
|
2572
2574
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2573
2575
|
}
|
|
2574
2576
|
function it(e) {
|
|
@@ -2580,10 +2582,10 @@ function Bt(e, t, n = null) {
|
|
|
2580
2582
|
return;
|
|
2581
2583
|
}
|
|
2582
2584
|
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || tn(n) ? e.appendChild(
|
|
2583
|
-
|
|
2584
|
-
) : mo(t) && e.appendChild(
|
|
2585
|
+
Ba(t, n)
|
|
2586
|
+
) : mo(t) && e.appendChild(Ua(t));
|
|
2585
2587
|
}
|
|
2586
|
-
function
|
|
2588
|
+
function Ba(e, t) {
|
|
2587
2589
|
const n = document.createElement("div");
|
|
2588
2590
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2589
2591
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
@@ -2597,13 +2599,13 @@ function Oa(e, t) {
|
|
|
2597
2599
|
)
|
|
2598
2600
|
), n;
|
|
2599
2601
|
}
|
|
2600
|
-
function
|
|
2602
|
+
function Ua(e) {
|
|
2601
2603
|
const t = document.createElement("div");
|
|
2602
2604
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2603
2605
|
const n = document.createElement("strong");
|
|
2604
2606
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2605
2607
|
const o = document.createElement("span");
|
|
2606
|
-
return o.textContent =
|
|
2608
|
+
return o.textContent = Ha(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2607
2609
|
fo(
|
|
2608
2610
|
e,
|
|
2609
2611
|
"Upgrade",
|
|
@@ -2615,9 +2617,9 @@ function Yt(e, t) {
|
|
|
2615
2617
|
return e !== null && (ae(e) || mo(e) || tn(t));
|
|
2616
2618
|
}
|
|
2617
2619
|
function Bn(e, t, n) {
|
|
2618
|
-
return Yt(t, n) ||
|
|
2620
|
+
return Yt(t, n) || Fa(t) ? !0 : !Yt(e, n);
|
|
2619
2621
|
}
|
|
2620
|
-
function
|
|
2622
|
+
function Fa(e) {
|
|
2621
2623
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
|
|
2622
2624
|
}
|
|
2623
2625
|
function ae(e) {
|
|
@@ -2629,10 +2631,10 @@ function tn(e) {
|
|
|
2629
2631
|
function mo(e) {
|
|
2630
2632
|
return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2631
2633
|
}
|
|
2632
|
-
function Fa(e) {
|
|
2633
|
-
return e.creditsRemaining === null ? null : `${Ha(e.creditsRemaining)} credits left`;
|
|
2634
|
-
}
|
|
2635
2634
|
function Ha(e) {
|
|
2635
|
+
return e.creditsRemaining === null ? null : `${Wa(e.creditsRemaining)} credits left`;
|
|
2636
|
+
}
|
|
2637
|
+
function Wa(e) {
|
|
2636
2638
|
return new Intl.NumberFormat("en-US", {
|
|
2637
2639
|
maximumFractionDigits: 0
|
|
2638
2640
|
}).format(Math.ceil(e));
|
|
@@ -2661,15 +2663,15 @@ function Ut(e, t) {
|
|
|
2661
2663
|
(o) => !wo(o)
|
|
2662
2664
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2663
2665
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const g =
|
|
2666
|
+
function Ga(e, t, n, o, i, r, l, p, d, c, u, m, k, v, z, _) {
|
|
2667
|
+
const g = Va(r), b = g.filter(
|
|
2666
2668
|
(C) => !wo(C)
|
|
2667
|
-
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(),
|
|
2669
|
+
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(), L = (C) => {
|
|
2668
2670
|
P.push(C);
|
|
2669
2671
|
};
|
|
2670
2672
|
_o(n, r.isThinking), i.hidden = !p, p && l !== null && po(i, l);
|
|
2671
|
-
const F =
|
|
2672
|
-
if (o(F),
|
|
2673
|
+
const F = b.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2674
|
+
if (o(F), b.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2673
2675
|
const C = document.createElement("div");
|
|
2674
2676
|
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2675
2677
|
const T = document.createElement("div");
|
|
@@ -2691,27 +2693,27 @@ function Wa(e, t, n, o, i, r, l, p, d, c, u, m, E, v, z, b) {
|
|
|
2691
2693
|
const R = document.createElement("button");
|
|
2692
2694
|
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", R.disabled = !0, R.tabIndex = -1, R.textContent = "Generating example tasks...", q.appendChild(R);
|
|
2693
2695
|
} else
|
|
2694
|
-
for (let R = 0; R <
|
|
2696
|
+
for (let R = 0; R < Ei; R += 1) {
|
|
2695
2697
|
const D = document.createElement("button");
|
|
2696
2698
|
D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
|
|
2697
2699
|
}
|
|
2698
|
-
C.appendChild(q), m.clear(),
|
|
2700
|
+
C.appendChild(q), m.clear(), L(C), L(t), Fn(e, P);
|
|
2699
2701
|
return;
|
|
2700
2702
|
}
|
|
2701
2703
|
let H = null, $ = null, Q = [];
|
|
2702
|
-
const ze =
|
|
2704
|
+
const ze = b.some(Xt), x = () => {
|
|
2703
2705
|
if (Q.length === 0)
|
|
2704
2706
|
return !1;
|
|
2705
|
-
const C =
|
|
2707
|
+
const C = or(
|
|
2706
2708
|
Q,
|
|
2707
2709
|
u,
|
|
2708
|
-
|
|
2710
|
+
k,
|
|
2709
2711
|
v()
|
|
2710
2712
|
);
|
|
2711
|
-
return
|
|
2713
|
+
return L(C), H = null, $ = C, Q = [], !0;
|
|
2712
2714
|
};
|
|
2713
|
-
for (let C = 0; C <
|
|
2714
|
-
const T =
|
|
2715
|
+
for (let C = 0; C < b.length; C += 1) {
|
|
2716
|
+
const T = b[C];
|
|
2715
2717
|
if (T.role === "tool") {
|
|
2716
2718
|
Q.push(T);
|
|
2717
2719
|
continue;
|
|
@@ -2719,60 +2721,60 @@ function Wa(e, t, n, o, i, r, l, p, d, c, u, m, E, v, z, b) {
|
|
|
2719
2721
|
if (Xt(T)) {
|
|
2720
2722
|
if (x()) {
|
|
2721
2723
|
const N = ct();
|
|
2722
|
-
|
|
2724
|
+
L(N), H = null, $ = N;
|
|
2723
2725
|
} else {
|
|
2724
2726
|
const N = Gn(v());
|
|
2725
|
-
|
|
2727
|
+
L(N), H = null, $ = N;
|
|
2726
2728
|
}
|
|
2727
2729
|
continue;
|
|
2728
2730
|
}
|
|
2729
2731
|
if (T.role === "system")
|
|
2730
2732
|
continue;
|
|
2731
|
-
const Se = x(), q =
|
|
2733
|
+
const Se = x(), q = nr(T.content);
|
|
2732
2734
|
if (T.role === "assistant" && !Se) {
|
|
2733
2735
|
const D = bo(v());
|
|
2734
|
-
|
|
2736
|
+
L(D), H = null, $ = D;
|
|
2735
2737
|
}
|
|
2736
|
-
const R =
|
|
2737
|
-
|
|
2738
|
+
const R = $a(T, q, m, A);
|
|
2739
|
+
L(R), H = R, $ = null;
|
|
2738
2740
|
}
|
|
2739
|
-
const de = x(), Ye =
|
|
2741
|
+
const de = x(), Ye = b[b.length - 1]?.id === "assistant-draft";
|
|
2740
2742
|
if (r.isThinking && !Ye && !ze)
|
|
2741
2743
|
if (de) {
|
|
2742
2744
|
const C = ct();
|
|
2743
|
-
|
|
2745
|
+
L(C), H = null, $ = C;
|
|
2744
2746
|
} else {
|
|
2745
2747
|
const C = Gn(v());
|
|
2746
|
-
|
|
2748
|
+
L(C), H = null, $ = C;
|
|
2747
2749
|
}
|
|
2748
2750
|
if (r.lastError) {
|
|
2749
2751
|
const C = document.createElement("div");
|
|
2750
|
-
C.className = "pluno-pa-widget__error", C.textContent = r.lastError,
|
|
2752
|
+
C.className = "pluno-pa-widget__error", C.textContent = r.lastError, L(C), H = C, $ = null;
|
|
2751
2753
|
}
|
|
2752
|
-
const X =
|
|
2753
|
-
if (
|
|
2754
|
-
const C =
|
|
2755
|
-
isDrafting:
|
|
2756
|
-
error:
|
|
2757
|
-
characterIconOptions:
|
|
2758
|
-
onDraft:
|
|
2759
|
-
onDismiss:
|
|
2760
|
-
onDisable:
|
|
2754
|
+
const X = _ && !r.isThinking ? Qo(g) : null;
|
|
2755
|
+
if (_ && X && !_.dismissedCandidateIds.has(X.id)) {
|
|
2756
|
+
const C = Xa(X, {
|
|
2757
|
+
isDrafting: _.draftingCandidateId === X.id,
|
|
2758
|
+
error: _.error,
|
|
2759
|
+
characterIconOptions: _.characterIconOptions,
|
|
2760
|
+
onDraft: _.onDraft,
|
|
2761
|
+
onDismiss: _.onDismiss,
|
|
2762
|
+
onDisable: _.onDisable
|
|
2761
2763
|
});
|
|
2762
|
-
|
|
2764
|
+
L(C), _.onSeen(X), H = null, $ = C;
|
|
2763
2765
|
}
|
|
2764
|
-
H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"),
|
|
2766
|
+
H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"), L(t), ja(m, A), Fn(e, P), d ? Ve(e, c) : e.scrollTop = h;
|
|
2765
2767
|
}
|
|
2766
|
-
function
|
|
2767
|
-
const i =
|
|
2768
|
+
function $a(e, t, n, o) {
|
|
2769
|
+
const i = qa(e, t), r = i ? n.get(i) : void 0;
|
|
2768
2770
|
if (i && r)
|
|
2769
2771
|
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2770
2772
|
const l = document.createElement("div");
|
|
2771
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2773
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? ar(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(Ka(e.attachments));
|
|
2772
2774
|
const p = document.createElement("div");
|
|
2773
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2775
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Ya(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2774
2776
|
}
|
|
2775
|
-
function
|
|
2777
|
+
function qa(e, t) {
|
|
2776
2778
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2777
2779
|
id: e.id,
|
|
2778
2780
|
content: t,
|
|
@@ -2790,7 +2792,7 @@ function $a(e, t) {
|
|
|
2790
2792
|
})
|
|
2791
2793
|
});
|
|
2792
2794
|
}
|
|
2793
|
-
function
|
|
2795
|
+
function ja(e, t) {
|
|
2794
2796
|
for (const n of e.keys())
|
|
2795
2797
|
t.has(n) || e.delete(n);
|
|
2796
2798
|
}
|
|
@@ -2808,7 +2810,7 @@ function Fn(e, t) {
|
|
|
2808
2810
|
n = n.nextSibling, e.removeChild(o);
|
|
2809
2811
|
}
|
|
2810
2812
|
}
|
|
2811
|
-
function
|
|
2813
|
+
function Va(e) {
|
|
2812
2814
|
if (!e.assistantDraft)
|
|
2813
2815
|
return [...e.messages];
|
|
2814
2816
|
const t = {
|
|
@@ -2870,20 +2872,20 @@ function Wn(e, t, n, o, i, r, l, p) {
|
|
|
2870
2872
|
}
|
|
2871
2873
|
e.appendChild(d);
|
|
2872
2874
|
}
|
|
2873
|
-
function
|
|
2875
|
+
function Ka(e) {
|
|
2874
2876
|
const t = document.createElement("div");
|
|
2875
2877
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2876
2878
|
for (const n of e)
|
|
2877
|
-
t.appendChild(
|
|
2879
|
+
t.appendChild(za(n));
|
|
2878
2880
|
return t;
|
|
2879
2881
|
}
|
|
2880
|
-
function
|
|
2882
|
+
function Ya(e) {
|
|
2881
2883
|
const t = document.createElement("button");
|
|
2882
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2884
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Ta()), t.addEventListener("click", (n) => {
|
|
2883
2885
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2884
2886
|
}), t;
|
|
2885
2887
|
}
|
|
2886
|
-
function
|
|
2888
|
+
function Xa(e, t) {
|
|
2887
2889
|
const n = document.createElement("article");
|
|
2888
2890
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2889
2891
|
const o = document.createElement("div");
|
|
@@ -2924,7 +2926,7 @@ function Ya(e, t) {
|
|
|
2924
2926
|
}
|
|
2925
2927
|
return o.appendChild(p), n.appendChild(o), n;
|
|
2926
2928
|
}
|
|
2927
|
-
function
|
|
2929
|
+
function Za(e, t) {
|
|
2928
2930
|
const n = document.createElement("div");
|
|
2929
2931
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
|
|
2930
2932
|
g.target === n && t.onClose();
|
|
@@ -2943,11 +2945,11 @@ function Xa(e, t) {
|
|
|
2943
2945
|
c.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2944
2946
|
const u = document.createElement("strong");
|
|
2945
2947
|
u.textContent = "1) Copy Screenshot", c.appendChild(u);
|
|
2946
|
-
const m =
|
|
2948
|
+
const m = Ja(
|
|
2947
2949
|
"Copy Screenshot",
|
|
2948
2950
|
async () => {
|
|
2949
2951
|
try {
|
|
2950
|
-
return await
|
|
2952
|
+
return await ei(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2951
2953
|
} catch {
|
|
2952
2954
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2953
2955
|
}
|
|
@@ -2956,39 +2958,39 @@ function Xa(e, t) {
|
|
|
2956
2958
|
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2957
2959
|
const g = document.createElement("div");
|
|
2958
2960
|
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2959
|
-
const
|
|
2960
|
-
|
|
2961
|
+
const b = document.createElement("img");
|
|
2962
|
+
b.src = e.screenshotDataUrl, b.alt = "Product page with Pluno open", g.appendChild(b), d.appendChild(g);
|
|
2961
2963
|
}
|
|
2962
2964
|
o.appendChild(d), o.appendChild(p);
|
|
2963
|
-
const
|
|
2964
|
-
|
|
2965
|
+
const k = document.createElement("div");
|
|
2966
|
+
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2965
2967
|
const v = document.createElement("strong");
|
|
2966
|
-
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on",
|
|
2968
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
2967
2969
|
const z = document.createElement("p");
|
|
2968
|
-
z.className = "pluno-pa-widget__share-dialog-hint", z.textContent = "Post draft opens prefilled on supported platforms.",
|
|
2969
|
-
const
|
|
2970
|
-
|
|
2971
|
-
for (const g of
|
|
2972
|
-
const
|
|
2973
|
-
|
|
2970
|
+
z.className = "pluno-pa-widget__share-dialog-hint", z.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(z);
|
|
2971
|
+
const _ = document.createElement("footer");
|
|
2972
|
+
_.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2973
|
+
for (const g of Qa(e)) {
|
|
2974
|
+
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(er(g.id)), _.appendChild(b);
|
|
2974
2976
|
}
|
|
2975
|
-
if (
|
|
2977
|
+
if (k.appendChild(_), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2976
2978
|
const g = document.createElement("div");
|
|
2977
2979
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
+
const b = document.createElement("strong");
|
|
2981
|
+
b.className = "pluno-pa-widget__share-dialog-step-title", b.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(b);
|
|
2980
2982
|
const h = document.createElement("a");
|
|
2981
|
-
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(
|
|
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(tr()), g.appendChild(h), o.appendChild(g);
|
|
2982
2984
|
}
|
|
2983
2985
|
return n.appendChild(o), n;
|
|
2984
2986
|
}
|
|
2985
|
-
function
|
|
2987
|
+
function Ja(e, t) {
|
|
2986
2988
|
const n = document.createElement("button");
|
|
2987
2989
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
2988
2990
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
2989
2991
|
}), n;
|
|
2990
2992
|
}
|
|
2991
|
-
function
|
|
2993
|
+
function Qa(e) {
|
|
2992
2994
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
2993
2995
|
return [
|
|
2994
2996
|
{
|
|
@@ -3008,7 +3010,7 @@ function Ja(e) {
|
|
|
3008
3010
|
}
|
|
3009
3011
|
];
|
|
3010
3012
|
}
|
|
3011
|
-
function
|
|
3013
|
+
function er(e) {
|
|
3012
3014
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3013
3015
|
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (U(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), U(
|
|
3014
3016
|
t,
|
|
@@ -3035,7 +3037,7 @@ function U(e, t, n) {
|
|
|
3035
3037
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3036
3038
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3037
3039
|
}
|
|
3038
|
-
function
|
|
3040
|
+
function tr() {
|
|
3039
3041
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3040
3042
|
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), U(e, "M14 5h5v5"), U(e, "M19 5l-8 8"), U(
|
|
3041
3043
|
e,
|
|
@@ -3045,10 +3047,10 @@ function er() {
|
|
|
3045
3047
|
function wo(e) {
|
|
3046
3048
|
return e.role === "tool" && e.toolName === Xn;
|
|
3047
3049
|
}
|
|
3048
|
-
function
|
|
3050
|
+
function nr(e) {
|
|
3049
3051
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3050
3052
|
}
|
|
3051
|
-
function
|
|
3053
|
+
function or(e, t, n, o) {
|
|
3052
3054
|
const i = document.createElement("article");
|
|
3053
3055
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3054
3056
|
e[e.length - 1].createdAt
|
|
@@ -3058,7 +3060,7 @@ function nr(e, t, n, o) {
|
|
|
3058
3060
|
o
|
|
3059
3061
|
)
|
|
3060
3062
|
);
|
|
3061
|
-
const r = document.createElement("details"), l =
|
|
3063
|
+
const r = document.createElement("details"), l = ir(e);
|
|
3062
3064
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3063
3065
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3064
3066
|
});
|
|
@@ -3069,10 +3071,10 @@ function nr(e, t, n, o) {
|
|
|
3069
3071
|
const u = document.createElement("div");
|
|
3070
3072
|
u.className = "pluno-pa-widget__tool-lines";
|
|
3071
3073
|
for (const m of e) {
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3074
|
+
const k = document.createElement("div");
|
|
3075
|
+
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(Zt());
|
|
3074
3076
|
const v = document.createElement("span");
|
|
3075
|
-
v.textContent = m.content || "Run tool",
|
|
3077
|
+
v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
|
|
3076
3078
|
}
|
|
3077
3079
|
r.appendChild(u);
|
|
3078
3080
|
}
|
|
@@ -3099,7 +3101,7 @@ function ct(e = "Thinking...") {
|
|
|
3099
3101
|
const o = document.createElement("span");
|
|
3100
3102
|
return o.textContent = e, t.appendChild(o), t;
|
|
3101
3103
|
}
|
|
3102
|
-
function
|
|
3104
|
+
function ir(e) {
|
|
3103
3105
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3104
3106
|
}
|
|
3105
3107
|
function Zt() {
|
|
@@ -3107,9 +3109,9 @@ function Zt() {
|
|
|
3107
3109
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3108
3110
|
}
|
|
3109
3111
|
function _o(e, t) {
|
|
3110
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3112
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Aa() : go());
|
|
3111
3113
|
}
|
|
3112
|
-
function
|
|
3114
|
+
function ar(e, t) {
|
|
3113
3115
|
const n = t.replace(/\r\n/g, `
|
|
3114
3116
|
`).split(`
|
|
3115
3117
|
`);
|
|
@@ -3183,7 +3185,7 @@ function at(e, t) {
|
|
|
3183
3185
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3184
3186
|
} else {
|
|
3185
3187
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3186
|
-
if (p &&
|
|
3188
|
+
if (p && rr(p[2])) {
|
|
3187
3189
|
const d = document.createElement("a");
|
|
3188
3190
|
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
3189
3191
|
} else
|
|
@@ -3193,7 +3195,7 @@ function at(e, t) {
|
|
|
3193
3195
|
}
|
|
3194
3196
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3195
3197
|
}
|
|
3196
|
-
function
|
|
3198
|
+
function rr(e) {
|
|
3197
3199
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3198
3200
|
return !0;
|
|
3199
3201
|
try {
|
|
@@ -3204,7 +3206,7 @@ function ar(e) {
|
|
|
3204
3206
|
}
|
|
3205
3207
|
}
|
|
3206
3208
|
function $n(e, t) {
|
|
3207
|
-
if (
|
|
3209
|
+
if (lr(e))
|
|
3208
3210
|
return;
|
|
3209
3211
|
const n = `
|
|
3210
3212
|
:host {
|
|
@@ -5473,18 +5475,18 @@ function $n(e, t) {
|
|
|
5473
5475
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5474
5476
|
}
|
|
5475
5477
|
`;
|
|
5476
|
-
if (
|
|
5478
|
+
if (pr(e, n))
|
|
5477
5479
|
return;
|
|
5478
5480
|
const o = e.ownerDocument.createElement("style");
|
|
5479
5481
|
o.id = io, o.textContent = n, e.appendChild(o), xo(e);
|
|
5480
5482
|
}
|
|
5481
|
-
function
|
|
5483
|
+
function lr(e) {
|
|
5482
5484
|
return e.getElementById(io) !== null || e.host instanceof HTMLElement && e.host.getAttribute(ao) === "true";
|
|
5483
5485
|
}
|
|
5484
5486
|
function xo(e) {
|
|
5485
5487
|
e.host instanceof HTMLElement && e.host.setAttribute(ao, "true");
|
|
5486
5488
|
}
|
|
5487
|
-
function
|
|
5489
|
+
function pr(e, t) {
|
|
5488
5490
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5489
5491
|
return !1;
|
|
5490
5492
|
try {
|
|
@@ -5494,7 +5496,7 @@ function lr(e, t) {
|
|
|
5494
5496
|
return !1;
|
|
5495
5497
|
}
|
|
5496
5498
|
}
|
|
5497
|
-
async function
|
|
5499
|
+
async function sr() {
|
|
5498
5500
|
return document.body ? document.body : await new Promise((e) => {
|
|
5499
5501
|
const t = new MutationObserver(() => {
|
|
5500
5502
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5505,7 +5507,7 @@ async function pr() {
|
|
|
5505
5507
|
function yo(e) {
|
|
5506
5508
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5507
5509
|
}
|
|
5508
|
-
function
|
|
5510
|
+
function dr(e) {
|
|
5509
5511
|
try {
|
|
5510
5512
|
const t = window.localStorage.getItem(yo(e));
|
|
5511
5513
|
if (!t)
|
|
@@ -5519,8 +5521,8 @@ function sr(e) {
|
|
|
5519
5521
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5520
5522
|
(o) => typeof o == "string"
|
|
5521
5523
|
) : [],
|
|
5522
|
-
launcherPosition:
|
|
5523
|
-
panelSize:
|
|
5524
|
+
launcherPosition: hr(n.launcherPosition) ? n.launcherPosition : null,
|
|
5525
|
+
panelSize: mr(n.panelSize) ? ut(n.panelSize) : null,
|
|
5524
5526
|
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Zn) : [],
|
|
5525
5527
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5526
5528
|
};
|
|
@@ -5528,7 +5530,7 @@ function sr(e) {
|
|
|
5528
5530
|
return qn();
|
|
5529
5531
|
}
|
|
5530
5532
|
}
|
|
5531
|
-
async function
|
|
5533
|
+
async function cr(e) {
|
|
5532
5534
|
if (e.loadSharePromptsDisabled)
|
|
5533
5535
|
return e.loadSharePromptsDisabled();
|
|
5534
5536
|
try {
|
|
@@ -5537,7 +5539,7 @@ async function dr(e) {
|
|
|
5537
5539
|
return !1;
|
|
5538
5540
|
}
|
|
5539
5541
|
}
|
|
5540
|
-
function
|
|
5542
|
+
function ur(e, t) {
|
|
5541
5543
|
if (e.persistSharePromptsDisabled) {
|
|
5542
5544
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5543
5545
|
() => {
|
|
@@ -5564,7 +5566,7 @@ function qn() {
|
|
|
5564
5566
|
sharePromptsDisabled: !1
|
|
5565
5567
|
};
|
|
5566
5568
|
}
|
|
5567
|
-
function
|
|
5569
|
+
function gr(e, t) {
|
|
5568
5570
|
try {
|
|
5569
5571
|
window.localStorage.setItem(
|
|
5570
5572
|
yo(e),
|
|
@@ -5574,42 +5576,42 @@ function ur(e, t) {
|
|
|
5574
5576
|
return;
|
|
5575
5577
|
}
|
|
5576
5578
|
}
|
|
5577
|
-
function
|
|
5579
|
+
function hr(e) {
|
|
5578
5580
|
if (!e || typeof e != "object")
|
|
5579
5581
|
return !1;
|
|
5580
5582
|
const t = e;
|
|
5581
5583
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
5582
5584
|
}
|
|
5583
|
-
function
|
|
5585
|
+
function mr(e) {
|
|
5584
5586
|
if (!e || typeof e != "object")
|
|
5585
5587
|
return !1;
|
|
5586
5588
|
const t = e;
|
|
5587
5589
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5588
5590
|
}
|
|
5589
5591
|
const jn = /* @__PURE__ */ new WeakSet();
|
|
5590
|
-
function
|
|
5592
|
+
function fr(e) {
|
|
5591
5593
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5592
5594
|
}
|
|
5593
5595
|
function Vn(e) {
|
|
5594
5596
|
const t = e.pathname.split("/");
|
|
5595
5597
|
return t[t.length - 1] ?? "";
|
|
5596
5598
|
}
|
|
5597
|
-
function
|
|
5599
|
+
function wr(e, t) {
|
|
5598
5600
|
const n = new URL(e.src, document.baseURI);
|
|
5599
5601
|
return n.href === t.href || n.pathname === t.pathname ? !0 : Vn(n) === Vn(t);
|
|
5600
5602
|
}
|
|
5601
5603
|
class se extends EventTarget {
|
|
5602
5604
|
constructor(t, n) {
|
|
5603
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
5605
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(_i, () => {
|
|
5604
5606
|
this.readyState = se.OPEN, this.dispatchEvent(new Event("open"));
|
|
5605
|
-
}), this.addPreviewListener(
|
|
5607
|
+
}), this.addPreviewListener(xi, (o) => {
|
|
5606
5608
|
const i = o;
|
|
5607
5609
|
this.dispatchEvent(
|
|
5608
5610
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5609
5611
|
);
|
|
5610
|
-
}), this.addPreviewListener(
|
|
5612
|
+
}), this.addPreviewListener(yi, () => {
|
|
5611
5613
|
this.readyState = se.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5612
|
-
}), this.addPreviewListener(
|
|
5614
|
+
}), this.addPreviewListener(vi, (o) => {
|
|
5613
5615
|
const i = o;
|
|
5614
5616
|
this.readyState = se.CLOSED, this.dispatchEvent(
|
|
5615
5617
|
new CloseEvent("close", {
|
|
@@ -5621,7 +5623,7 @@ class se extends EventTarget {
|
|
|
5621
5623
|
}), window.dispatchEvent(
|
|
5622
5624
|
new CustomEvent(
|
|
5623
5625
|
rt(
|
|
5624
|
-
|
|
5626
|
+
fi,
|
|
5625
5627
|
this.channelId
|
|
5626
5628
|
),
|
|
5627
5629
|
{
|
|
@@ -5641,7 +5643,7 @@ class se extends EventTarget {
|
|
|
5641
5643
|
binaryType = "blob";
|
|
5642
5644
|
bufferedAmount = 0;
|
|
5643
5645
|
readyState = se.CONNECTING;
|
|
5644
|
-
socketId =
|
|
5646
|
+
socketId = br();
|
|
5645
5647
|
listeners = /* @__PURE__ */ new Map();
|
|
5646
5648
|
send(t) {
|
|
5647
5649
|
if (this.readyState !== se.OPEN)
|
|
@@ -5651,7 +5653,7 @@ class se extends EventTarget {
|
|
|
5651
5653
|
);
|
|
5652
5654
|
window.dispatchEvent(
|
|
5653
5655
|
new CustomEvent(
|
|
5654
|
-
rt(
|
|
5656
|
+
rt(wi, this.channelId),
|
|
5655
5657
|
{
|
|
5656
5658
|
detail: {
|
|
5657
5659
|
socketId: this.socketId,
|
|
@@ -5664,7 +5666,7 @@ class se extends EventTarget {
|
|
|
5664
5666
|
close(t, n) {
|
|
5665
5667
|
this.readyState !== se.CLOSED && (this.readyState = se.CLOSING, window.dispatchEvent(
|
|
5666
5668
|
new CustomEvent(
|
|
5667
|
-
rt(
|
|
5669
|
+
rt(bi, this.channelId),
|
|
5668
5670
|
{
|
|
5669
5671
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5670
5672
|
}
|
|
@@ -5686,7 +5688,7 @@ class se extends EventTarget {
|
|
|
5686
5688
|
this.listeners.clear();
|
|
5687
5689
|
}
|
|
5688
5690
|
}
|
|
5689
|
-
function
|
|
5691
|
+
function br() {
|
|
5690
5692
|
const e = window.sessionStorage.getItem(
|
|
5691
5693
|
yn
|
|
5692
5694
|
);
|
|
@@ -5698,7 +5700,7 @@ function wr() {
|
|
|
5698
5700
|
function rt(e, t) {
|
|
5699
5701
|
return `${e}:${t}`;
|
|
5700
5702
|
}
|
|
5701
|
-
function
|
|
5703
|
+
function _r(e) {
|
|
5702
5704
|
const t = document.currentScript;
|
|
5703
5705
|
if (t instanceof HTMLScriptElement)
|
|
5704
5706
|
return [t];
|
|
@@ -5706,20 +5708,20 @@ function br(e) {
|
|
|
5706
5708
|
return Array.from(
|
|
5707
5709
|
document.querySelectorAll("script[type='module'][src]")
|
|
5708
5710
|
).filter(
|
|
5709
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5711
|
+
(i) => i instanceof HTMLScriptElement && fr(i) && wr(i, o)
|
|
5710
5712
|
);
|
|
5711
5713
|
}
|
|
5712
|
-
function
|
|
5713
|
-
for (const t of
|
|
5714
|
+
function xr(e) {
|
|
5715
|
+
for (const t of _r(e)) {
|
|
5714
5716
|
if (jn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
5715
5717
|
continue;
|
|
5716
5718
|
jn.add(t);
|
|
5717
5719
|
const n = t.dataset.plunoPreviewChannel;
|
|
5718
|
-
|
|
5720
|
+
qi({
|
|
5719
5721
|
token: t.dataset.plunoToken,
|
|
5720
5722
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
5721
5723
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
5722
|
-
webSocketFactory: n ?
|
|
5724
|
+
webSocketFactory: n ? $i(n) : void 0,
|
|
5723
5725
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5724
5726
|
accentColor: t.dataset.plunoAccentColor,
|
|
5725
5727
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5731,8 +5733,8 @@ function _r(e) {
|
|
|
5731
5733
|
});
|
|
5732
5734
|
}
|
|
5733
5735
|
}
|
|
5734
|
-
|
|
5736
|
+
xr(import.meta.url);
|
|
5735
5737
|
export {
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
+
$i as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5739
|
+
qi as mountPlunoProductAgentWidget
|
|
5738
5740
|
};
|