@pluno/product-agent-web 0.1.76 → 0.1.79
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 +2 -0
- package/dist/product-agent-sdk.js +865 -638
- package/dist/product-agent-widget.js +744 -742
- package/dist/scheduledChatContinuations.d.ts +47 -0
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { PlunoProductAgent as ti, getProductAgentOriginAccessErrorMessage as ni } from "./product-agent-sdk.js";
|
|
2
|
-
const oi = "#7c3aed",
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
2
|
+
const oi = "#7c3aed", ft = "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", wt = "#2c2a1e", Tn = [253, 250, 241], In = 3.5;
|
|
3
|
+
function po(e) {
|
|
4
|
+
const t = so(e);
|
|
5
|
+
if (An(nt(t), Tn) >= In)
|
|
6
6
|
return t;
|
|
7
7
|
let o = nt(t);
|
|
8
|
-
const i = nt(
|
|
8
|
+
const i = nt(wt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o = ri(o, i, 0.22),
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = ri(o, i, 0.22), An(o, Tn) >= In)
|
|
11
|
+
return Zt(o);
|
|
12
|
+
return Zt(o);
|
|
13
13
|
}
|
|
14
14
|
function ii() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
@@ -20,7 +20,7 @@ function ii() {
|
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
22
|
function ai(e) {
|
|
23
|
-
const t =
|
|
23
|
+
const t = so(e), n = Jt(nt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,7 +56,7 @@ function ai(e) {
|
|
|
56
56
|
shadow: ie(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function so(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
61
|
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : oi;
|
|
62
62
|
}
|
|
@@ -67,23 +67,23 @@ function nt(e) {
|
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Zt([e, t, n]) {
|
|
71
71
|
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Jt([e, t, n]) {
|
|
75
75
|
const o = (i) => {
|
|
76
76
|
const r = i / 255;
|
|
77
77
|
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
81
|
+
function An(e, t) {
|
|
82
|
+
const n = Jt(e), o = Jt(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
85
|
function ri(e, t, n) {
|
|
86
|
-
const o =
|
|
86
|
+
const o = Qt(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
@@ -92,7 +92,7 @@ function ri(e, t, n) {
|
|
|
92
92
|
}
|
|
93
93
|
function ie(e, t, n) {
|
|
94
94
|
const [o, i, r] = li(nt(e));
|
|
95
|
-
return
|
|
95
|
+
return Zt(pi(o, Qt(i + n), Qt(r + t)));
|
|
96
96
|
}
|
|
97
97
|
function li([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), s = (l + p) / 2;
|
|
@@ -106,28 +106,28 @@ function pi(e, t, n) {
|
|
|
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;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
Ft(i, o, e + 1 / 3) * 255,
|
|
110
|
+
Ft(i, o, e) * 255,
|
|
111
|
+
Ft(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ft(e, t, n) {
|
|
115
115
|
let o = n;
|
|
116
116
|
return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Qt(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const co = "suggest_share_on_socials";
|
|
122
122
|
function si(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== co)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = Nn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = Nn(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -142,7 +142,7 @@ async function di(e) {
|
|
|
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 })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Nn(e, t, n) {
|
|
146
146
|
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
147
|
const i = e[o];
|
|
148
148
|
if (i.role === n && i.content.trim())
|
|
@@ -167,13 +167,13 @@ function _i(e, t = {}) {
|
|
|
167
167
|
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const m = o,
|
|
170
|
+
const m = o, L = 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() -
|
|
176
|
+
const v = Math.min(1, (performance.now() - L) / hi);
|
|
177
177
|
o = Math.round(m + (u - m) * Ci(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
178
|
}, fi);
|
|
179
179
|
}, c = async () => {
|
|
@@ -199,12 +199,12 @@ async function xi(e) {
|
|
|
199
199
|
});
|
|
200
200
|
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const o = await n.json(), i =
|
|
202
|
+
const o = await n.json(), i = Rn(o.count), r = Rn(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
203
|
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
205
|
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Rn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
210
|
function yi(e) {
|
|
@@ -216,7 +216,7 @@ function vi(e) {
|
|
|
216
216
|
function Ci(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const uo = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-connect", Li = "product-agent:sdk-preview-socket-send", Pi = "product-agent:sdk-preview-socket-close", Ti = "product-agent:sdk-preview-socket-open", Ii = "product-agent:sdk-preview-socket-message", Ai = "product-agent:sdk-preview-socket-error", Ni = "product-agent:sdk-preview-socket-closed", Dn = "product-agent:sdk-preview-socket-id", Ri = "data-pluno-sdk-preview-channel", go = "data-pluno-auto-mounted", ge = "__plunoProductAgentAutoMountOwner", Di = 1e4, Mi = "Failed to load Pluno widget token", Mn = "Timed out loading Pluno widget token", zi = "pluno.productAgent.widgetClientId.", Ht = /* @__PURE__ */ new Set(), Oi = "product-agent:preview-diagnostic", ho = "pluno.productAgent.sharePromptsDisabled", Ui = 3, zn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Bi = 400, Fi = 5e3, Hi = 500, On = "Close the page's popup to chat", Wi = "No recent chats for this page yet.", ae = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const co = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !0,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !0
|
|
227
|
-
}, Gi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive',
|
|
227
|
+
}, Gi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Un = "pluno-pa-scribble-font", mo = 190, fo = 41, Bn = 22, $i = 16, qi = 24, ji = 1, Vi = 48, dn = 420, Ki = 520, Yi = 0.24, cn = 680, Xi = 800, Zi = 0.76, A = 8, Ie = 50, wo = "http://www.w3.org/2000/svg", en = 26, tn = 8, Ji = 36, nn = 16, Qi = 4, Fn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,10 +261,10 @@ const co = 100, Si = 1e4, Ei = 5e3, ki = "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
|
-
], ea = 11, ta = 13,
|
|
265
|
-
let
|
|
264
|
+
], ea = 11, ta = 13, on = 4, bo = 10, _o = 40, na = "movable-launcher-position-v2", xo = "pluno-pa-widget-styles", yo = "data-pluno-pa-widget-styles";
|
|
265
|
+
let Hn = 0;
|
|
266
266
|
function oa(e) {
|
|
267
|
-
return (t) => new
|
|
267
|
+
return (t) => new he(t, e);
|
|
268
268
|
}
|
|
269
269
|
async function ia(e = {}) {
|
|
270
270
|
const t = {
|
|
@@ -311,7 +311,7 @@ async function ia(e = {}) {
|
|
|
311
311
|
onMorningReportTaskStart: e.onMorningReportTaskStart,
|
|
312
312
|
taskNotifications: e.taskNotifications
|
|
313
313
|
};
|
|
314
|
-
|
|
314
|
+
ne(
|
|
315
315
|
"web-sdk.widget",
|
|
316
316
|
"Mounting widget with merged options",
|
|
317
317
|
{
|
|
@@ -333,7 +333,7 @@ async function ia(e = {}) {
|
|
|
333
333
|
);
|
|
334
334
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
335
335
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
336
|
-
let r =
|
|
336
|
+
let r = Wn(
|
|
337
337
|
t.accentColor,
|
|
338
338
|
t.scribbleStyle
|
|
339
339
|
);
|
|
@@ -348,18 +348,18 @@ async function ia(e = {}) {
|
|
|
348
348
|
let p = t.movableLauncher ? l.launcherPosition : null, s = p !== null, c = l.panelSize, u = null;
|
|
349
349
|
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"), Te(
|
|
350
350
|
i,
|
|
351
|
-
|
|
351
|
+
Gt(
|
|
352
352
|
i,
|
|
353
353
|
p,
|
|
354
354
|
t.position
|
|
355
355
|
)
|
|
356
|
-
)),
|
|
356
|
+
)), io(o, t.accentColor), Gn(i, r, {
|
|
357
357
|
accentColor: t.accentColor,
|
|
358
358
|
colorScheme: t.colorScheme,
|
|
359
359
|
fontFamily: t.fontFamily,
|
|
360
360
|
scribbleStyle: t.scribbleStyle
|
|
361
361
|
});
|
|
362
|
-
const m = await vr(),
|
|
362
|
+
const m = await vr(), L = m.ownerDocument, v = i.querySelector(
|
|
363
363
|
".pluno-pa-widget__launcher"
|
|
364
364
|
), D = i.querySelector(
|
|
365
365
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -369,87 +369,87 @@ async function ia(e = {}) {
|
|
|
369
369
|
".pluno-pa-widget__launcher-minimize"
|
|
370
370
|
), y = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
371
371
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
372
|
-
),
|
|
372
|
+
), E = Array.from(
|
|
373
373
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
374
|
-
), A = i.querySelector(
|
|
375
|
-
".pluno-pa-widget__close"
|
|
376
374
|
), N = i.querySelector(
|
|
375
|
+
".pluno-pa-widget__close"
|
|
376
|
+
), I = i.querySelector(
|
|
377
377
|
".pluno-pa-widget__composer"
|
|
378
|
-
),
|
|
378
|
+
), G = i.querySelector(
|
|
379
379
|
".pluno-pa-widget__attachment-error"
|
|
380
|
-
),
|
|
380
|
+
), ye = i.querySelector(
|
|
381
381
|
".pluno-pa-widget__billing-status"
|
|
382
382
|
), He = i.querySelector(
|
|
383
383
|
".pluno-pa-widget__attachments"
|
|
384
|
-
),
|
|
384
|
+
), M = i.querySelector(
|
|
385
385
|
".pluno-pa-widget__attachment-input"
|
|
386
386
|
), We = i.querySelector(
|
|
387
387
|
".pluno-pa-widget__attach"
|
|
388
388
|
), w = i.querySelector(
|
|
389
389
|
".pluno-pa-widget__input"
|
|
390
|
-
),
|
|
390
|
+
), O = i.querySelector(
|
|
391
391
|
".pluno-pa-widget__send"
|
|
392
|
-
), ye = i.querySelector(
|
|
393
|
-
".pluno-pa-widget__top-actions"
|
|
394
392
|
), ve = i.querySelector(
|
|
393
|
+
".pluno-pa-widget__top-actions"
|
|
394
|
+
), se = i.querySelector(
|
|
395
395
|
".pluno-pa-widget__history"
|
|
396
|
-
),
|
|
396
|
+
), ot = i.querySelector(
|
|
397
397
|
".pluno-pa-widget__history-panel"
|
|
398
|
-
),
|
|
398
|
+
), $ = i.querySelector(
|
|
399
399
|
".pluno-pa-widget__history-list"
|
|
400
|
-
),
|
|
400
|
+
), it = i.querySelector(
|
|
401
401
|
".pluno-pa-widget__history-close"
|
|
402
|
-
),
|
|
402
|
+
), Ae = i.querySelector(
|
|
403
403
|
".pluno-pa-widget__history-status"
|
|
404
|
-
),
|
|
404
|
+
), oe = i.querySelector(
|
|
405
405
|
".pluno-pa-widget__timeline-jump"
|
|
406
|
-
),
|
|
406
|
+
), x = i.querySelector(
|
|
407
407
|
".pluno-pa-widget__active-users-counter"
|
|
408
|
-
),
|
|
408
|
+
), S = i.querySelector(
|
|
409
409
|
".pluno-pa-widget__timeline"
|
|
410
|
-
),
|
|
410
|
+
), j = i.querySelector(
|
|
411
411
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
412
|
-
),
|
|
412
|
+
), V = i.querySelector(
|
|
413
413
|
".pluno-pa-widget__notify-suggestion"
|
|
414
|
-
),
|
|
414
|
+
), J = i.querySelector(
|
|
415
415
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
416
|
-
),
|
|
416
|
+
), P = i.querySelector(
|
|
417
417
|
".pluno-pa-widget__notify-suggestion-later"
|
|
418
|
-
),
|
|
418
|
+
), R = i.querySelector(
|
|
419
419
|
".pluno-pa-widget__notify-suggestion-never"
|
|
420
420
|
);
|
|
421
|
-
if (!v || !C || !y || !
|
|
421
|
+
if (!v || !C || !y || !N || !I || !G || !ye || !He || !M || !We || !w || !O || !ve || !se || !ot || !$ || !it || !Ae || !oe || !x || !S || !j)
|
|
422
422
|
throw new Error("Failed to mount Pluno widget");
|
|
423
423
|
if (t.movableLauncher && !D)
|
|
424
424
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
425
|
-
|
|
426
|
-
let
|
|
425
|
+
Xn(C), Xn(w);
|
|
426
|
+
let q = [], de = null;
|
|
427
427
|
const Ne = () => {
|
|
428
428
|
ja(
|
|
429
429
|
He,
|
|
430
|
-
|
|
430
|
+
q,
|
|
431
431
|
(a) => {
|
|
432
|
-
|
|
432
|
+
q = q.filter(
|
|
433
433
|
(d, _) => _ !== a
|
|
434
|
-
), Ne(),
|
|
434
|
+
), Ne(), F(b.getState()), H();
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
|
-
},
|
|
438
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
437
|
+
}, hn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Oo(t.tokenEndpoint) : void 0);
|
|
438
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !hn && !t.webSocketFactory)
|
|
439
439
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
440
|
-
const Bo = window.fetch.bind(window),
|
|
440
|
+
const Bo = window.fetch.bind(window), vt = Cr(t.clientId);
|
|
441
441
|
let b;
|
|
442
442
|
try {
|
|
443
443
|
const a = {
|
|
444
444
|
token: t.token,
|
|
445
|
-
tokenProvider:
|
|
445
|
+
tokenProvider: hn,
|
|
446
446
|
backendUrl: t.backendUrl,
|
|
447
447
|
metadata: () => ({
|
|
448
448
|
...t.metadata ?? {},
|
|
449
449
|
...!b.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
450
450
|
}),
|
|
451
451
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
452
|
-
clientId:
|
|
452
|
+
clientId: vt.clientId,
|
|
453
453
|
restorePersistedState: t.restorePersistedState,
|
|
454
454
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
455
455
|
webSocketFactory: t.webSocketFactory,
|
|
@@ -461,9 +461,9 @@ async function ia(e = {}) {
|
|
|
461
461
|
};
|
|
462
462
|
b = await ti.init(a);
|
|
463
463
|
} catch (a) {
|
|
464
|
-
throw
|
|
464
|
+
throw vt.release(), n.remove(), a;
|
|
465
465
|
}
|
|
466
|
-
m.appendChild(n),
|
|
466
|
+
m.appendChild(n), ne(
|
|
467
467
|
"web-sdk.widget",
|
|
468
468
|
"Applied initial widget appearance",
|
|
469
469
|
{
|
|
@@ -473,56 +473,56 @@ async function ia(e = {}) {
|
|
|
473
473
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
474
474
|
}
|
|
475
475
|
);
|
|
476
|
-
const
|
|
476
|
+
const Ct = new Set(l.openToolGroupKeys), Re = new Set(
|
|
477
477
|
l.seenShareCandidateIds
|
|
478
|
-
),
|
|
479
|
-
let
|
|
478
|
+
), at = new Set(Re);
|
|
479
|
+
let St = l.sharePromptsDisabled || await Er(t), Q = null, ce = !1, rt = !(t.loginRequired || t.signupRequired), me = !1, Ce = {
|
|
480
480
|
enabled: !0
|
|
481
|
-
}, Se = 0,
|
|
482
|
-
const
|
|
481
|
+
}, Se = 0, mn = "", fe = !1, ue = !1, we = [], Et = null, Ge = null;
|
|
482
|
+
const ee = (a, d) => {
|
|
483
483
|
Ce = { enabled: a, reason: d };
|
|
484
|
-
},
|
|
485
|
-
|
|
484
|
+
}, te = () => {
|
|
485
|
+
oe.hidden = !0;
|
|
486
486
|
}, Fo = () => {
|
|
487
|
-
|
|
487
|
+
oe.hidden = !1;
|
|
488
488
|
}, Ho = (a = "jump") => {
|
|
489
|
-
|
|
489
|
+
ee(!0, a), te(), tt(S, () => Ce.enabled), Se = S.scrollTop;
|
|
490
490
|
}, Ee = () => {
|
|
491
|
-
if (
|
|
491
|
+
if (se.hidden = t.loginRequired, ot.hidden = !fe, se.setAttribute("aria-expanded", String(fe)), $.classList.toggle(
|
|
492
492
|
"pluno-pa-widget__history-list--center",
|
|
493
|
-
|
|
494
|
-
),
|
|
493
|
+
ue && we.length === 0
|
|
494
|
+
), $.replaceChildren(), ue && we.length === 0) {
|
|
495
495
|
const a = document.createElement("p");
|
|
496
|
-
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...",
|
|
496
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", $.appendChild(a);
|
|
497
497
|
}
|
|
498
|
-
for (const a of
|
|
498
|
+
for (const a of we) {
|
|
499
499
|
const d = document.createElement("button");
|
|
500
|
-
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled =
|
|
500
|
+
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ue;
|
|
501
501
|
const _ = document.createElement("span");
|
|
502
502
|
_.className = "pluno-pa-widget__history-item-title", _.textContent = Sa(a);
|
|
503
|
-
const
|
|
504
|
-
|
|
503
|
+
const T = document.createElement("time");
|
|
504
|
+
T.className = "pluno-pa-widget__history-time", T.dateTime = a.lastActiveAt, T.textContent = ka(
|
|
505
505
|
a.lastActiveAt,
|
|
506
506
|
Date.now()
|
|
507
507
|
);
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}),
|
|
508
|
+
const z = document.createElement("small");
|
|
509
|
+
z.className = "pluno-pa-widget__history-path", z.textContent = Ea(a), d.append(_, T, z), d.addEventListener("click", () => {
|
|
510
|
+
fe = !1, Ge = null, Ee(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
|
|
511
|
+
}), $.appendChild(d);
|
|
512
512
|
}
|
|
513
|
-
if (
|
|
513
|
+
if (ue && we.length > 0) {
|
|
514
514
|
const a = document.createElement("p");
|
|
515
|
-
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...",
|
|
515
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", $.appendChild(a);
|
|
516
516
|
}
|
|
517
|
-
|
|
518
|
-
},
|
|
519
|
-
if (!
|
|
520
|
-
|
|
517
|
+
Ae.textContent = Ge ?? (!ue && we.length === 0 ? "No recent chats for this page yet." : ""), Ae.hidden = Ae.textContent.length === 0;
|
|
518
|
+
}, fn = async (a) => {
|
|
519
|
+
if (!ue) {
|
|
520
|
+
ue = !0, Ge = null, Ee();
|
|
521
521
|
try {
|
|
522
522
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
523
|
-
|
|
523
|
+
we = a ? [...we, ...d.sessions] : d.sessions, Et = d.nextCursor;
|
|
524
524
|
} catch (d) {
|
|
525
|
-
|
|
525
|
+
ne(
|
|
526
526
|
"web-sdk.widget",
|
|
527
527
|
"Failed to load session history",
|
|
528
528
|
{
|
|
@@ -530,59 +530,59 @@ async function ia(e = {}) {
|
|
|
530
530
|
}
|
|
531
531
|
), Ge = Wi;
|
|
532
532
|
} finally {
|
|
533
|
-
|
|
533
|
+
ue = !1, Ee();
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
}, Wo = () => {
|
|
537
|
-
!
|
|
538
|
-
},
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
|
|
537
|
+
!Et || ue || $.scrollHeight - $.scrollTop - $.clientHeight <= 24 && fn(Et);
|
|
538
|
+
}, wn = () => {
|
|
539
|
+
ce || typeof document > "u" || (io(o, t.accentColor), n.isConnected || L.body?.appendChild(n));
|
|
540
|
+
}, bn = new MutationObserver(wn);
|
|
541
|
+
bn.observe(L.documentElement, {
|
|
542
542
|
childList: !0,
|
|
543
543
|
subtree: !0
|
|
544
|
-
}),
|
|
544
|
+
}), wn();
|
|
545
545
|
const $e = (a = !0) => {
|
|
546
|
-
const d =
|
|
547
|
-
return
|
|
546
|
+
const d = bt(i, a);
|
|
547
|
+
return an(
|
|
548
548
|
i,
|
|
549
|
-
p ?
|
|
549
|
+
p ? vo(p, d) : ua(
|
|
550
550
|
i,
|
|
551
551
|
t.position,
|
|
552
552
|
d
|
|
553
553
|
),
|
|
554
554
|
d
|
|
555
555
|
);
|
|
556
|
-
},
|
|
556
|
+
}, B = () => {
|
|
557
557
|
const a = _a(o, C, w);
|
|
558
558
|
Lr(t, {
|
|
559
559
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
560
560
|
composerValue: w.value,
|
|
561
561
|
focusedInput: a,
|
|
562
562
|
focusedInputAt: a ? Date.now() : null,
|
|
563
|
-
openToolGroupKeys: [...
|
|
563
|
+
openToolGroupKeys: [...Ct],
|
|
564
564
|
launcherPosition: s ? p : null,
|
|
565
565
|
panelSize: c,
|
|
566
566
|
seenShareCandidateIds: [...Re].slice(
|
|
567
|
-
-
|
|
567
|
+
-uo
|
|
568
568
|
),
|
|
569
|
-
sharePromptsDisabled:
|
|
569
|
+
sharePromptsDisabled: St
|
|
570
570
|
});
|
|
571
|
-
},
|
|
571
|
+
}, lt = (a) => {
|
|
572
572
|
t.onDisplayStateChange?.(a);
|
|
573
573
|
}, qe = (a, d = !0) => {
|
|
574
574
|
if (a === "shown") {
|
|
575
|
-
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && je(!1), d &&
|
|
575
|
+
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && je(!1), d && lt("shown");
|
|
576
576
|
return;
|
|
577
577
|
}
|
|
578
|
-
|
|
578
|
+
Q !== null && (window.clearTimeout(Q), Q = 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, y.hidden = !0, N.hidden = !0, v.tabIndex = 0, w.value = "", Te(
|
|
579
579
|
i,
|
|
580
|
-
|
|
580
|
+
Gt(
|
|
581
581
|
i,
|
|
582
582
|
p,
|
|
583
583
|
t.position
|
|
584
584
|
)
|
|
585
|
-
),
|
|
585
|
+
), Vn(i), B(), d && lt("minimized");
|
|
586
586
|
}, ke = (a, d = {}) => {
|
|
587
587
|
ba(a, {
|
|
588
588
|
debugVersion: na,
|
|
@@ -594,12 +594,12 @@ async function ia(e = {}) {
|
|
|
594
594
|
right: i.style.right,
|
|
595
595
|
bottom: i.style.bottom
|
|
596
596
|
},
|
|
597
|
-
rootRect:
|
|
598
|
-
launcherRect:
|
|
599
|
-
panelRect:
|
|
597
|
+
rootRect: qt(i),
|
|
598
|
+
launcherRect: qt(v),
|
|
599
|
+
panelRect: qt(y),
|
|
600
600
|
viewport: Z(),
|
|
601
601
|
panelHidden: y.hidden,
|
|
602
|
-
closeHidden:
|
|
602
|
+
closeHidden: N.hidden,
|
|
603
603
|
...d
|
|
604
604
|
});
|
|
605
605
|
}, je = (a = !0) => {
|
|
@@ -609,20 +609,20 @@ async function ia(e = {}) {
|
|
|
609
609
|
return Te(i, d), ke("Applied stored closed launcher position", {
|
|
610
610
|
visibleLauncherPosition: d
|
|
611
611
|
}), d;
|
|
612
|
-
},
|
|
612
|
+
}, kt = (a, d) => {
|
|
613
613
|
if (!a || !d) {
|
|
614
|
-
|
|
614
|
+
Vn(i);
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
617
|
wa(i, {
|
|
618
618
|
x: a.x - d.x,
|
|
619
619
|
y: a.y - d.y
|
|
620
620
|
});
|
|
621
|
-
},
|
|
621
|
+
}, _n = () => {
|
|
622
622
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
623
623
|
Te(
|
|
624
624
|
i,
|
|
625
|
-
|
|
625
|
+
Gt(
|
|
626
626
|
i,
|
|
627
627
|
p,
|
|
628
628
|
t.position
|
|
@@ -632,14 +632,14 @@ async function ia(e = {}) {
|
|
|
632
632
|
}
|
|
633
633
|
const a = je();
|
|
634
634
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
635
|
-
|
|
635
|
+
Wt(i, c);
|
|
636
636
|
const d = Fe(c);
|
|
637
|
-
|
|
637
|
+
Vt(
|
|
638
638
|
h,
|
|
639
639
|
d.width
|
|
640
640
|
);
|
|
641
|
-
const _ =
|
|
642
|
-
u ??
|
|
641
|
+
const _ = mt(
|
|
642
|
+
u ?? $t(
|
|
643
643
|
i,
|
|
644
644
|
a,
|
|
645
645
|
t.position,
|
|
@@ -647,7 +647,7 @@ async function ia(e = {}) {
|
|
|
647
647
|
),
|
|
648
648
|
d
|
|
649
649
|
);
|
|
650
|
-
u && (u = _),
|
|
650
|
+
u && (u = _), kt(_, a), ke(
|
|
651
651
|
"Applied open panel position after viewport resize",
|
|
652
652
|
{ openPanelPosition: _ }
|
|
653
653
|
);
|
|
@@ -656,35 +656,35 @@ async function ia(e = {}) {
|
|
|
656
656
|
{ visibleLauncherPosition: a }
|
|
657
657
|
);
|
|
658
658
|
};
|
|
659
|
-
let
|
|
659
|
+
let xn = () => {
|
|
660
660
|
};
|
|
661
|
-
window.addEventListener("resize",
|
|
661
|
+
window.addEventListener("resize", _n), t.movableLauncher && D ? (je(), xn = sa({
|
|
662
662
|
root: i,
|
|
663
663
|
launcher: v,
|
|
664
664
|
launcherDragHandle: D,
|
|
665
665
|
getPosition: () => $e(),
|
|
666
666
|
setPosition: (a) => {
|
|
667
|
-
const d = a, _ =
|
|
667
|
+
const d = a, _ = bt(i), T = an(
|
|
668
668
|
i,
|
|
669
669
|
a,
|
|
670
670
|
_
|
|
671
671
|
);
|
|
672
672
|
p = ha(
|
|
673
|
-
|
|
673
|
+
T,
|
|
674
674
|
_
|
|
675
|
-
), Te(i,
|
|
675
|
+
), Te(i, T), ke("Dragging closed launcher", {
|
|
676
676
|
requestedPosition: d
|
|
677
677
|
});
|
|
678
678
|
},
|
|
679
679
|
persist: () => {
|
|
680
|
-
s = !0,
|
|
680
|
+
s = !0, B(), ke("Persisted closed launcher drag position");
|
|
681
681
|
}
|
|
682
|
-
})) : Te(i, null),
|
|
682
|
+
})) : Te(i, null), Wt(i, c);
|
|
683
683
|
const Go = () => {
|
|
684
684
|
const a = Fe(c), d = $e();
|
|
685
685
|
return {
|
|
686
|
-
position:
|
|
687
|
-
u ??
|
|
686
|
+
position: mt(
|
|
687
|
+
u ?? $t(
|
|
688
688
|
i,
|
|
689
689
|
d,
|
|
690
690
|
t.position,
|
|
@@ -695,99 +695,99 @@ async function ia(e = {}) {
|
|
|
695
695
|
size: a
|
|
696
696
|
};
|
|
697
697
|
}, $o = (a) => {
|
|
698
|
-
c =
|
|
698
|
+
c = xt(a.size), Wt(i, c), Vt(
|
|
699
699
|
h,
|
|
700
700
|
Fe(c).width
|
|
701
|
-
), u =
|
|
701
|
+
), u = mt(
|
|
702
702
|
a.position,
|
|
703
703
|
Fe(c)
|
|
704
704
|
);
|
|
705
705
|
const d = $e();
|
|
706
|
-
|
|
707
|
-
}, qo =
|
|
706
|
+
kt(u, d);
|
|
707
|
+
}, qo = E.length > 0 ? da({
|
|
708
708
|
root: i,
|
|
709
|
-
handles:
|
|
709
|
+
handles: E,
|
|
710
710
|
getBounds: Go,
|
|
711
711
|
setBounds: $o,
|
|
712
|
-
persist:
|
|
712
|
+
persist: B
|
|
713
713
|
}) : () => {
|
|
714
714
|
};
|
|
715
|
-
let
|
|
716
|
-
const
|
|
717
|
-
if (!(!t.billingStatusLoader ||
|
|
718
|
-
|
|
715
|
+
let Lt = !1;
|
|
716
|
+
const yn = async () => {
|
|
717
|
+
if (!(!t.billingStatusLoader || Lt)) {
|
|
718
|
+
Lt = !0;
|
|
719
719
|
try {
|
|
720
720
|
const a = await t.billingStatusLoader();
|
|
721
|
-
|
|
721
|
+
Jn(
|
|
722
722
|
t.billingStatus,
|
|
723
723
|
a,
|
|
724
724
|
b.getState().lastErrorCode
|
|
725
|
-
) && (t.billingStatus = a,
|
|
726
|
-
|
|
725
|
+
) && (t.billingStatus = a, Yt(
|
|
726
|
+
ye,
|
|
727
727
|
t.billingStatus,
|
|
728
728
|
b.getState().lastErrorCode
|
|
729
|
-
),
|
|
729
|
+
), H());
|
|
730
730
|
} finally {
|
|
731
|
-
|
|
731
|
+
Lt = !1;
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
},
|
|
735
|
-
|
|
734
|
+
}, be = (a = "", d = !0) => {
|
|
735
|
+
yn(), Ye && (Ye = !1, It()), i.classList.contains("pluno-pa-widget--open") || (u = null), Q !== null && (window.clearTimeout(Q), Q = null), qe("shown", !1), y.hidden = !1, N.hidden = !1, Vt(
|
|
736
736
|
h,
|
|
737
737
|
Fe(c).width
|
|
738
738
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
739
|
-
const _ = je(),
|
|
739
|
+
const _ = je(), T = $t(
|
|
740
740
|
i,
|
|
741
741
|
_,
|
|
742
742
|
t.position,
|
|
743
743
|
c
|
|
744
744
|
);
|
|
745
|
-
if (
|
|
746
|
-
openPanelPosition:
|
|
745
|
+
if (kt(T, _), ke("Opening launcher at clamped open panel position", {
|
|
746
|
+
openPanelPosition: T,
|
|
747
747
|
visibleLauncherPosition: _
|
|
748
|
-
}),
|
|
749
|
-
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, et(w)), tt(
|
|
748
|
+
}), ee(!0, "open"), te(), !d) {
|
|
749
|
+
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, et(w)), tt(S, () => Ce.enabled), Se = S.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
752
|
window.requestAnimationFrame(() => {
|
|
753
|
-
i.classList.add("pluno-pa-widget--open"), a && (w.value = a, et(w)), tt(
|
|
754
|
-
v.hidden = !0, tt(
|
|
753
|
+
i.classList.add("pluno-pa-widget--open"), a && (w.value = a, et(w)), tt(S, () => Ce.enabled), Se = S.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0), Q = window.setTimeout(() => {
|
|
754
|
+
v.hidden = !0, tt(S, () => Ce.enabled), Se = S.scrollTop;
|
|
755
755
|
}, 220);
|
|
756
756
|
});
|
|
757
|
-
},
|
|
758
|
-
|
|
759
|
-
y.hidden = !0,
|
|
757
|
+
}, Pt = () => {
|
|
758
|
+
Q !== null && (window.clearTimeout(Q), Q = null), v.hidden = !1, p && (je(!1), ke("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Q = window.setTimeout(() => {
|
|
759
|
+
y.hidden = !0, N.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
760
760
|
}, 220);
|
|
761
761
|
};
|
|
762
762
|
v.addEventListener("submit", (a) => {
|
|
763
|
-
a.preventDefault(),
|
|
763
|
+
a.preventDefault(), be(C.value), C.value = "";
|
|
764
764
|
}), D?.addEventListener("click", (a) => {
|
|
765
765
|
a.preventDefault(), a.stopPropagation();
|
|
766
766
|
}), v.addEventListener("click", (a) => {
|
|
767
|
-
a.target === C && !D || (
|
|
767
|
+
a.target === C && !D || (be(C.value), C.value = "");
|
|
768
768
|
}), C.addEventListener("focus", () => {
|
|
769
|
-
|
|
769
|
+
be(C.value), C.value = "";
|
|
770
770
|
}), C.addEventListener("input", () => {
|
|
771
771
|
if (!C.value)
|
|
772
772
|
return;
|
|
773
773
|
const a = C.value;
|
|
774
|
-
|
|
774
|
+
be(a), C.value = "";
|
|
775
775
|
});
|
|
776
|
-
let
|
|
777
|
-
const
|
|
776
|
+
let Tt = null, pt = null, Le = null;
|
|
777
|
+
const vn = (a) => a === C || a === w, jo = (a) => {
|
|
778
778
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
779
779
|
return null;
|
|
780
780
|
let d = a;
|
|
781
781
|
for (; d; ) {
|
|
782
|
-
const _ = d.closest(
|
|
782
|
+
const _ = d.closest(zn);
|
|
783
783
|
if (_)
|
|
784
784
|
return _;
|
|
785
|
-
const
|
|
786
|
-
d =
|
|
785
|
+
const T = d.getRootNode();
|
|
786
|
+
d = T instanceof ShadowRoot ? T.host : null;
|
|
787
787
|
}
|
|
788
788
|
return null;
|
|
789
789
|
}, Vo = (a) => {
|
|
790
|
-
if (!a.isConnected || !a.matches(
|
|
790
|
+
if (!a.isConnected || !a.matches(zn))
|
|
791
791
|
return !1;
|
|
792
792
|
if (!(a instanceof HTMLElement))
|
|
793
793
|
return !0;
|
|
@@ -797,73 +797,73 @@ async function ia(e = {}) {
|
|
|
797
797
|
return a.checkVisibility();
|
|
798
798
|
const d = window.getComputedStyle(a);
|
|
799
799
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
800
|
-
},
|
|
800
|
+
}, Cn = (a) => {
|
|
801
801
|
Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Pe(), a !== null ? Le = window.setInterval(() => {
|
|
802
802
|
const d = Ke;
|
|
803
|
-
(!d || !Vo(d)) &&
|
|
804
|
-
}, Hi) : Le !== null && (window.clearInterval(Le), Le = null,
|
|
803
|
+
(!d || !Vo(d)) && Cn(null);
|
|
804
|
+
}, Hi) : Le !== null && (window.clearInterval(Le), Le = null, pt = null));
|
|
805
805
|
}, Ko = () => {
|
|
806
806
|
Le !== null && (window.clearInterval(Le), Le = null);
|
|
807
807
|
};
|
|
808
808
|
i.addEventListener("focusin", (a) => {
|
|
809
|
-
|
|
809
|
+
vn(a.target) && (Tt = Date.now(), B());
|
|
810
810
|
}), i.addEventListener("focusout", (a) => {
|
|
811
|
-
if (!
|
|
811
|
+
if (!vn(a.target) || Ke !== null)
|
|
812
812
|
return;
|
|
813
|
-
const d =
|
|
814
|
-
if (
|
|
813
|
+
const d = Tt;
|
|
814
|
+
if (Tt = null, d === null || Date.now() - d > Bi)
|
|
815
815
|
return;
|
|
816
816
|
const _ = jo(a.relatedTarget);
|
|
817
817
|
if (!_)
|
|
818
818
|
return;
|
|
819
|
-
const
|
|
820
|
-
if (
|
|
821
|
-
|
|
819
|
+
const T = Date.now();
|
|
820
|
+
if (pt !== null && T - pt <= Fi) {
|
|
821
|
+
Cn(_);
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
|
-
|
|
824
|
+
pt = T;
|
|
825
825
|
}), v.addEventListener("keydown", (a) => {
|
|
826
|
-
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(),
|
|
826
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), be());
|
|
827
827
|
}), g?.addEventListener("pointerdown", (a) => {
|
|
828
828
|
a.stopPropagation();
|
|
829
829
|
}), g?.addEventListener("click", (a) => {
|
|
830
830
|
a.preventDefault(), a.stopPropagation(), qe("minimized");
|
|
831
|
-
}),
|
|
832
|
-
|
|
833
|
-
}),
|
|
831
|
+
}), N.addEventListener("click", Pt), S.addEventListener("scroll", () => {
|
|
832
|
+
S.scrollTop < Se - 1 && ee(!1, "userScroll"), Se = S.scrollTop;
|
|
833
|
+
}), oe.addEventListener("click", () => {
|
|
834
834
|
Ho();
|
|
835
835
|
});
|
|
836
|
-
const
|
|
836
|
+
const Sn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
837
837
|
([a]) => {
|
|
838
|
-
a?.isIntersecting && (
|
|
838
|
+
a?.isIntersecting && (ee(!0, "bottom"), te());
|
|
839
839
|
},
|
|
840
|
-
{ root:
|
|
840
|
+
{ root: S, threshold: 0 }
|
|
841
841
|
);
|
|
842
|
-
|
|
842
|
+
Sn?.observe(j);
|
|
843
843
|
const Ve = () => t.loginRequired || t.signupRequired;
|
|
844
844
|
let Ke = null, Ye = !1;
|
|
845
|
-
const K = () =>
|
|
845
|
+
const K = () => rt || b.getState().status !== "connected", Pe = () => {
|
|
846
846
|
const a = Ve(), d = Ke !== null, _ = !a && K();
|
|
847
|
-
C.readOnly = a || d || _, w.readOnly = d || _, C.placeholder = d ?
|
|
848
|
-
},
|
|
849
|
-
|
|
847
|
+
C.readOnly = a || d || _, w.readOnly = d || _, C.placeholder = d ? On : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ye ? "New update" : t.launcherLabel, w.placeholder = d ? On : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ae.launcherLabel, I.hidden = a;
|
|
848
|
+
}, H = () => {
|
|
849
|
+
O.disabled = K() || le(t.billingStatus) || !b.getState().isThinking && w.value.trim().length === 0 && q.length === 0, We.disabled = Ve() || K() || le(t.billingStatus);
|
|
850
850
|
};
|
|
851
851
|
Pe();
|
|
852
|
-
const
|
|
852
|
+
const It = () => {
|
|
853
853
|
const a = b.getState().isThinking;
|
|
854
854
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
855
855
|
"pluno-pa-widget--unread",
|
|
856
856
|
!a && Ye
|
|
857
857
|
), Pe();
|
|
858
858
|
};
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
Ve() ||
|
|
859
|
+
It();
|
|
860
|
+
const At = () => {
|
|
861
|
+
Ve() || ce || (rt = !0, Pe(), H(), b.connect().then(
|
|
862
862
|
() => {
|
|
863
|
-
|
|
863
|
+
ce || (rt = !1, Pe(), H());
|
|
864
864
|
},
|
|
865
865
|
(a) => {
|
|
866
|
-
|
|
866
|
+
ce || (rt = !1, Pe(), H(), ne(
|
|
867
867
|
"web-sdk.widget",
|
|
868
868
|
"Failed to connect Product Agent widget",
|
|
869
869
|
{
|
|
@@ -873,7 +873,7 @@ async function ia(e = {}) {
|
|
|
873
873
|
}
|
|
874
874
|
));
|
|
875
875
|
};
|
|
876
|
-
|
|
876
|
+
I.addEventListener("submit", (a) => {
|
|
877
877
|
if (a.preventDefault(), t.loginRequired) {
|
|
878
878
|
t.onLoginClick?.();
|
|
879
879
|
return;
|
|
@@ -882,65 +882,65 @@ async function ia(e = {}) {
|
|
|
882
882
|
t.onSignupClick?.();
|
|
883
883
|
return;
|
|
884
884
|
}
|
|
885
|
-
K() || le(t.billingStatus) || (
|
|
885
|
+
K() || le(t.billingStatus) || (me = !0, ee(!0, "send"), te(), q = jt(
|
|
886
886
|
b,
|
|
887
887
|
w,
|
|
888
|
-
|
|
889
|
-
), Ne(),
|
|
888
|
+
q
|
|
889
|
+
), Ne(), H());
|
|
890
890
|
});
|
|
891
891
|
let Xe = 0;
|
|
892
892
|
const Yo = () => {
|
|
893
893
|
Xe = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
894
|
-
},
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
}, Nt = (a) => {
|
|
895
|
+
de !== null && window.clearTimeout(de), G.textContent = a, G.hidden = !1, de = window.setTimeout(() => {
|
|
896
|
+
G.textContent = "", G.hidden = !0, de = null;
|
|
897
897
|
}, 3e3);
|
|
898
898
|
}, Xo = () => {
|
|
899
|
-
|
|
900
|
-
},
|
|
899
|
+
de !== null && (window.clearTimeout(de), de = null), G.textContent = "", G.hidden = !0;
|
|
900
|
+
}, Rt = async (a) => {
|
|
901
901
|
if (a.length === 0)
|
|
902
902
|
return;
|
|
903
903
|
const d = Ya(b, a);
|
|
904
|
-
|
|
904
|
+
q = [...q, ...d], Ne(), Xo(), H(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || be();
|
|
905
905
|
};
|
|
906
906
|
We.addEventListener("click", () => {
|
|
907
|
-
t.loginRequired || K() || le(t.billingStatus) ||
|
|
908
|
-
}),
|
|
909
|
-
const a = Array.from(
|
|
910
|
-
|
|
911
|
-
|
|
907
|
+
t.loginRequired || K() || le(t.billingStatus) || M.click();
|
|
908
|
+
}), M.addEventListener("change", () => {
|
|
909
|
+
const a = Array.from(M.files ?? []);
|
|
910
|
+
M.value = "", Rt(a).catch((d) => {
|
|
911
|
+
Nt(
|
|
912
912
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
913
|
-
),
|
|
913
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
914
914
|
message: d instanceof Error ? d.message : String(d)
|
|
915
915
|
});
|
|
916
916
|
});
|
|
917
917
|
}), i.addEventListener("dragenter", (a) => {
|
|
918
|
-
!
|
|
918
|
+
!ut(a.dataTransfer) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Xe += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
919
919
|
}), i.addEventListener("dragover", (a) => {
|
|
920
920
|
const d = a.dataTransfer;
|
|
921
|
-
!
|
|
921
|
+
!ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
922
922
|
}), i.addEventListener("dragleave", (a) => {
|
|
923
|
-
|
|
923
|
+
ut(a.dataTransfer) && (a.stopPropagation(), Xe = Math.max(0, Xe - 1), Xe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
924
924
|
}), i.addEventListener("drop", (a) => {
|
|
925
925
|
const d = a.dataTransfer;
|
|
926
|
-
!
|
|
927
|
-
|
|
926
|
+
!ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Yo(), Rt(d.files).catch((_) => {
|
|
927
|
+
Nt(
|
|
928
928
|
_ instanceof Error ? _.message : "Failed to attach file"
|
|
929
|
-
),
|
|
929
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
930
930
|
message: _ instanceof Error ? _.message : String(_)
|
|
931
931
|
});
|
|
932
932
|
}));
|
|
933
933
|
}), i.addEventListener("paste", (a) => {
|
|
934
934
|
a.stopPropagation();
|
|
935
935
|
const d = a.clipboardData, _ = Array.from(d?.files ?? []);
|
|
936
|
-
_.length === 0 || t.loginRequired || K() || (a.preventDefault(),
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
),
|
|
940
|
-
message:
|
|
936
|
+
_.length === 0 || t.loginRequired || K() || (a.preventDefault(), Rt(_).catch((T) => {
|
|
937
|
+
Nt(
|
|
938
|
+
T instanceof Error ? T.message : "Failed to attach file"
|
|
939
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
940
|
+
message: T instanceof Error ? T.message : String(T)
|
|
941
941
|
});
|
|
942
942
|
}));
|
|
943
|
-
}),
|
|
943
|
+
}), O.addEventListener("click", () => {
|
|
944
944
|
if (t.loginRequired) {
|
|
945
945
|
t.onLoginClick?.();
|
|
946
946
|
return;
|
|
@@ -949,42 +949,42 @@ async function ia(e = {}) {
|
|
|
949
949
|
b.stop();
|
|
950
950
|
return;
|
|
951
951
|
}
|
|
952
|
-
K() || (
|
|
952
|
+
K() || (me = !0, ee(!0, "send"), te(), q = jt(
|
|
953
953
|
b,
|
|
954
954
|
w,
|
|
955
|
-
|
|
956
|
-
), Ne(),
|
|
957
|
-
}),
|
|
958
|
-
|
|
959
|
-
}),
|
|
960
|
-
|
|
961
|
-
}),
|
|
962
|
-
et(w),
|
|
955
|
+
q
|
|
956
|
+
), Ne(), H(), F(b.getState()));
|
|
957
|
+
}), se.addEventListener("click", () => {
|
|
958
|
+
fe = !fe, Ge = null, Ee(), fe && we.length === 0 && fn(null);
|
|
959
|
+
}), it.addEventListener("click", () => {
|
|
960
|
+
fe = !1, Ee();
|
|
961
|
+
}), $.addEventListener("scroll", Wo), w.addEventListener("input", () => {
|
|
962
|
+
et(w), B(), H(), Qo();
|
|
963
963
|
}), w.addEventListener("keydown", (a) => {
|
|
964
964
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
965
965
|
if (a.preventDefault(), t.loginRequired) {
|
|
966
966
|
t.onLoginClick?.();
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
|
-
K() || (
|
|
969
|
+
K() || (me = !0, ee(!0, "send"), te(), q = jt(
|
|
970
970
|
b,
|
|
971
971
|
w,
|
|
972
|
-
|
|
973
|
-
), Ne(),
|
|
972
|
+
q
|
|
973
|
+
), Ne(), H(), F(b.getState()));
|
|
974
974
|
}
|
|
975
975
|
}), i.addEventListener("click", (a) => {
|
|
976
|
-
(a.target instanceof Element ? a.target : null)?.closest("a[href]") &&
|
|
977
|
-
}), l.composerValue && (w.value = l.composerValue, et(w)), t.initialDisplayState === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen &&
|
|
978
|
-
const
|
|
979
|
-
let
|
|
976
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
977
|
+
}), l.composerValue && (w.value = l.composerValue, et(w)), t.initialDisplayState === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(w.value, !1), xa(l, i, C, w);
|
|
978
|
+
const st = () => r;
|
|
979
|
+
let Dt = b.getState().appearance !== null, dt = null, Ze = null, De = null, En = b.getState().isThinking, Me = null;
|
|
980
980
|
const Je = t.taskNotifications;
|
|
981
981
|
let ze = null, Oe = !1;
|
|
982
|
-
const
|
|
982
|
+
const kn = () => {
|
|
983
983
|
ze !== null && (window.clearTimeout(ze), ze = null);
|
|
984
|
-
},
|
|
985
|
-
|
|
986
|
-
},
|
|
987
|
-
if (!Je || !
|
|
984
|
+
}, ct = () => {
|
|
985
|
+
V && (V.hidden = !0);
|
|
986
|
+
}, Ln = () => b.getState().assistantDraft.trim().length > 0, Zo = async () => {
|
|
987
|
+
if (!Je || !V || Oe || ce || !b.getState().isThinking || Ln())
|
|
988
988
|
return;
|
|
989
989
|
let a;
|
|
990
990
|
try {
|
|
@@ -992,48 +992,48 @@ async function ia(e = {}) {
|
|
|
992
992
|
} catch {
|
|
993
993
|
return;
|
|
994
994
|
}
|
|
995
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking ||
|
|
995
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Ln() || Oe || ce || (V.hidden = !1);
|
|
996
996
|
};
|
|
997
|
-
|
|
998
|
-
Oe = !0,
|
|
997
|
+
J?.addEventListener("click", () => {
|
|
998
|
+
Oe = !0, ct(), Je?.enable().catch(() => {
|
|
999
999
|
});
|
|
1000
|
+
}), P?.addEventListener("click", () => {
|
|
1001
|
+
Oe = !0, ct();
|
|
1000
1002
|
}), R?.addEventListener("click", () => {
|
|
1001
|
-
Oe = !0,
|
|
1002
|
-
}), Uo?.addEventListener("click", () => {
|
|
1003
|
-
Oe = !0, dt(), Je?.dismissForever().catch(() => {
|
|
1003
|
+
Oe = !0, ct(), Je?.dismissForever().catch(() => {
|
|
1004
1004
|
});
|
|
1005
1005
|
});
|
|
1006
|
-
let Ue = null,
|
|
1006
|
+
let Ue = null, Pn = () => {
|
|
1007
1007
|
};
|
|
1008
|
-
const Jo = !!t.socialPostDraftHandler,
|
|
1009
|
-
const a = Ue !== null &&
|
|
1010
|
-
|
|
1008
|
+
const Jo = !!t.socialPostDraftHandler, Mt = /* @__PURE__ */ new Map(), zt = () => w.value.trim().length > 0 || q.length > 0, Qo = () => {
|
|
1009
|
+
const a = Ue !== null && Xt(b.getState(), zt());
|
|
1010
|
+
x.hidden = !a, a && Ue !== null && So(x, Ue);
|
|
1011
1011
|
};
|
|
1012
1012
|
let Be = null;
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
},
|
|
1013
|
+
const Ot = (a = {}) => {
|
|
1014
|
+
me = !0, ee(!0, "newSession"), te(), fe = !1, Ee(), b.startNewSession(a), Ct.clear(), w.value = "", q = [], Ne(), et(w), B(), H(), w.focus(), F(b.getState());
|
|
1015
|
+
}, Ut = (a) => {
|
|
1016
1016
|
if (!a) {
|
|
1017
1017
|
Be?.remove(), Be = null;
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
|
-
Be || (Be =
|
|
1020
|
+
Be || (Be = yt(
|
|
1021
1021
|
"pluno-pa-widget__new-chat",
|
|
1022
1022
|
"New chat",
|
|
1023
1023
|
Ua(),
|
|
1024
1024
|
!1
|
|
1025
|
-
), Be.addEventListener("click", () =>
|
|
1026
|
-
},
|
|
1027
|
-
if (Ee(),
|
|
1028
|
-
|
|
1025
|
+
), Be.addEventListener("click", () => Ot()), ve.insertBefore(Be, se));
|
|
1026
|
+
}, F = (a) => {
|
|
1027
|
+
if (Ee(), gn(a.lastErrorCode) ? Me = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (Me = null), Yt(
|
|
1028
|
+
ye,
|
|
1029
1029
|
t.billingStatus,
|
|
1030
1030
|
Me
|
|
1031
1031
|
), t.loginRequired) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1032
|
+
Mt.clear(), no(
|
|
1033
|
+
S,
|
|
1034
|
+
O,
|
|
1035
|
+
Ut,
|
|
1036
|
+
st,
|
|
1037
1037
|
"Log in to use Pluno on this page.",
|
|
1038
1038
|
t.loginButtonLabel,
|
|
1039
1039
|
t.loginUrl,
|
|
@@ -1042,11 +1042,11 @@ async function ia(e = {}) {
|
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
if (t.signupRequired) {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1045
|
+
Mt.clear(), no(
|
|
1046
|
+
S,
|
|
1047
|
+
O,
|
|
1048
|
+
Ut,
|
|
1049
|
+
st,
|
|
1050
1050
|
"Complete signup to unlock your free trial credits.",
|
|
1051
1051
|
t.signupButtonLabel,
|
|
1052
1052
|
t.signupUrl,
|
|
@@ -1054,61 +1054,61 @@ async function ia(e = {}) {
|
|
|
1054
1054
|
);
|
|
1055
1055
|
return;
|
|
1056
1056
|
}
|
|
1057
|
-
const d = va(a), _ = d !==
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1057
|
+
const d = va(a), _ = d !== mn;
|
|
1058
|
+
mn = d;
|
|
1059
|
+
const T = me || Ce.enabled;
|
|
1060
|
+
me = !1, nr(
|
|
1061
|
+
S,
|
|
1062
|
+
j,
|
|
1063
|
+
O,
|
|
1064
|
+
Ut,
|
|
1065
|
+
x,
|
|
1066
1066
|
a,
|
|
1067
1067
|
Ue,
|
|
1068
|
-
Ue !== null &&
|
|
1069
|
-
|
|
1068
|
+
Ue !== null && Xt(a, zt()),
|
|
1069
|
+
T,
|
|
1070
1070
|
() => Ce.enabled,
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
(
|
|
1071
|
+
Ct,
|
|
1072
|
+
Mt,
|
|
1073
|
+
B,
|
|
1074
|
+
st,
|
|
1075
|
+
(z) => {
|
|
1076
1076
|
if (K())
|
|
1077
1077
|
return;
|
|
1078
1078
|
const Qe = t.morningReport !== null;
|
|
1079
|
-
t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(),
|
|
1079
|
+
t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ot()), me = !0, ee(!0, "send"), te(), b.sendMessage(z);
|
|
1080
1080
|
},
|
|
1081
1081
|
() => {
|
|
1082
|
-
|
|
1082
|
+
me = !0, ee(!0, "send"), te(), b.retryLastMessage();
|
|
1083
1083
|
},
|
|
1084
1084
|
t.morningReport,
|
|
1085
1085
|
() => {
|
|
1086
|
-
t.morningReport = null, t.onMorningReportSnooze?.(),
|
|
1086
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Pt(), F(b.getState());
|
|
1087
1087
|
},
|
|
1088
|
-
|
|
1089
|
-
Jo && !
|
|
1090
|
-
dismissedCandidateIds:
|
|
1091
|
-
draftingCandidateId:
|
|
1088
|
+
At,
|
|
1089
|
+
Jo && !St ? {
|
|
1090
|
+
dismissedCandidateIds: at,
|
|
1091
|
+
draftingCandidateId: dt,
|
|
1092
1092
|
error: Ze,
|
|
1093
|
-
characterIconOptions:
|
|
1094
|
-
onSeen: (
|
|
1095
|
-
Re.add(
|
|
1093
|
+
characterIconOptions: st(),
|
|
1094
|
+
onSeen: (z) => {
|
|
1095
|
+
Re.add(z.id), B();
|
|
1096
1096
|
},
|
|
1097
|
-
onDraft: (
|
|
1098
|
-
ei(
|
|
1097
|
+
onDraft: (z) => {
|
|
1098
|
+
ei(z);
|
|
1099
1099
|
},
|
|
1100
|
-
onDismiss: (
|
|
1101
|
-
Re.add(
|
|
1100
|
+
onDismiss: (z) => {
|
|
1101
|
+
Re.add(z.id), at.add(z.id), B(), Ze = null, F(b.getState());
|
|
1102
1102
|
},
|
|
1103
|
-
onDisable: (
|
|
1104
|
-
|
|
1103
|
+
onDisable: (z) => {
|
|
1104
|
+
St = !0, Re.add(z.id), at.add(z.id), B(), kr(t, !0), Ze = null, F(b.getState());
|
|
1105
1105
|
}
|
|
1106
1106
|
} : void 0
|
|
1107
|
-
),
|
|
1107
|
+
), T ? (Se = S.scrollTop, te()) : _ && Ca(a) && Fo();
|
|
1108
1108
|
};
|
|
1109
|
-
return
|
|
1109
|
+
return Pn = _i(
|
|
1110
1110
|
(a) => {
|
|
1111
|
-
Ue = a, !
|
|
1111
|
+
Ue = a, !ce && Xt(b.getState(), zt()) && F(b.getState());
|
|
1112
1112
|
},
|
|
1113
1113
|
{
|
|
1114
1114
|
backendUrl: t.backendUrl,
|
|
@@ -1116,16 +1116,16 @@ async function ia(e = {}) {
|
|
|
1116
1116
|
loader: t.activeUsersLoader
|
|
1117
1117
|
}
|
|
1118
1118
|
), b.on("state", (a) => {
|
|
1119
|
-
const d =
|
|
1120
|
-
|
|
1119
|
+
const d = En && !a.isThinking;
|
|
1120
|
+
En = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Oe && ze === null && V?.hidden !== !1 && (ze = window.setTimeout(() => {
|
|
1121
1121
|
ze = null, Zo();
|
|
1122
|
-
}, Si)), (!a.isThinking || a.assistantDraft.trim()) && (
|
|
1122
|
+
}, Si)), (!a.isThinking || a.assistantDraft.trim()) && (kn(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ye = !0), It(), a.appearance ? (Dt = !0, ne(
|
|
1123
1123
|
"web-sdk.widget",
|
|
1124
1124
|
"Agent state supplied appearance",
|
|
1125
1125
|
{
|
|
1126
1126
|
appearance: a.appearance
|
|
1127
1127
|
}
|
|
1128
|
-
),
|
|
1128
|
+
), Bt(a.appearance, "agent.state.appearance")) : Dt && (Dt = !1, ne(
|
|
1129
1129
|
"web-sdk.widget",
|
|
1130
1130
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1131
1131
|
{
|
|
@@ -1133,34 +1133,34 @@ async function ia(e = {}) {
|
|
|
1133
1133
|
fallbackColorScheme: t.colorScheme,
|
|
1134
1134
|
fallbackFontFamily: t.fontFamily
|
|
1135
1135
|
}
|
|
1136
|
-
),
|
|
1137
|
-
}),
|
|
1136
|
+
), Bt({}, "agent.state.appearance-cleared")), F(a), H(), d && yn();
|
|
1137
|
+
}), F(b.getState()), H(), At(), {
|
|
1138
1138
|
agent: b,
|
|
1139
|
-
startNewChat:
|
|
1139
|
+
startNewChat: Ot,
|
|
1140
1140
|
host: n,
|
|
1141
1141
|
updateAppearance: (a) => {
|
|
1142
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1142
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Bt(a, "widgetHandle.updateAppearance");
|
|
1143
1143
|
},
|
|
1144
1144
|
updateBillingStatus: (a) => {
|
|
1145
1145
|
const d = a ?? null;
|
|
1146
|
-
|
|
1146
|
+
Jn(
|
|
1147
1147
|
t.billingStatus,
|
|
1148
1148
|
d,
|
|
1149
1149
|
Me
|
|
1150
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (Me = null),
|
|
1150
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (Me = null), Yt(
|
|
1151
1151
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1152
1152
|
t.billingStatus,
|
|
1153
1153
|
Me
|
|
1154
|
-
),
|
|
1154
|
+
), H());
|
|
1155
1155
|
},
|
|
1156
1156
|
updateAuthGate: (a) => {
|
|
1157
1157
|
const d = Ve();
|
|
1158
|
-
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), Pe(),
|
|
1158
|
+
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), Pe(), F(b.getState()), H(), d && !Ve() && At();
|
|
1159
1159
|
},
|
|
1160
1160
|
openPanel: () => {
|
|
1161
|
-
|
|
1161
|
+
be(w.value, !1);
|
|
1162
1162
|
},
|
|
1163
|
-
closePanel:
|
|
1163
|
+
closePanel: Pt,
|
|
1164
1164
|
updateDisplayState: (a) => {
|
|
1165
1165
|
if (a === "shown") {
|
|
1166
1166
|
qe("shown", !1);
|
|
@@ -1169,22 +1169,22 @@ async function ia(e = {}) {
|
|
|
1169
1169
|
qe("minimized", !1);
|
|
1170
1170
|
},
|
|
1171
1171
|
updateMorningReport: (a) => {
|
|
1172
|
-
t.morningReport = a ?? null,
|
|
1172
|
+
t.morningReport = a ?? null, F(b.getState());
|
|
1173
1173
|
},
|
|
1174
1174
|
destroy: () => {
|
|
1175
|
-
|
|
1175
|
+
ce || (B(), ce = !0, bn.disconnect(), Sn?.disconnect(), Ko(), window.removeEventListener("resize", _n), xn(), qo(), de !== null && window.clearTimeout(de), kn(), Pn(), De?.remove(), b.destroy(), vt.release(), n.remove());
|
|
1176
1176
|
}
|
|
1177
1177
|
};
|
|
1178
1178
|
async function ei(a) {
|
|
1179
|
-
if (!
|
|
1180
|
-
|
|
1179
|
+
if (!dt) {
|
|
1180
|
+
dt = a.id, Ze = null, F(b.getState());
|
|
1181
1181
|
try {
|
|
1182
1182
|
if (!t.socialPostDraftHandler)
|
|
1183
1183
|
throw new Error("Social post drafting is not available here.");
|
|
1184
1184
|
const d = await t.socialPostDraftHandler(a);
|
|
1185
1185
|
if (!d.linkedinPost || !d.xPost)
|
|
1186
1186
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1187
|
-
Re.add(a.id),
|
|
1187
|
+
Re.add(a.id), at.add(a.id), B(), De?.remove(), De = dr(d, {
|
|
1188
1188
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1189
1189
|
onClose: () => {
|
|
1190
1190
|
De?.remove(), De = null;
|
|
@@ -1193,32 +1193,32 @@ async function ia(e = {}) {
|
|
|
1193
1193
|
} catch (d) {
|
|
1194
1194
|
Ze = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1195
1195
|
} finally {
|
|
1196
|
-
|
|
1196
|
+
dt = null, F(b.getState());
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const _ = a.accentColor ?? t.accentColor,
|
|
1202
|
-
r =
|
|
1200
|
+
function Bt(a, d) {
|
|
1201
|
+
const _ = a.accentColor ?? t.accentColor, T = a.colorScheme ?? t.colorScheme, z = a.fontFamily ?? t.fontFamily, Qe = a.scribbleStyle ?? t.scribbleStyle;
|
|
1202
|
+
r = Wn(
|
|
1203
1203
|
_,
|
|
1204
1204
|
Qe
|
|
1205
|
-
),
|
|
1205
|
+
), Gn(i, r, {
|
|
1206
1206
|
accentColor: _,
|
|
1207
|
-
colorScheme:
|
|
1208
|
-
fontFamily:
|
|
1207
|
+
colorScheme: T,
|
|
1208
|
+
fontFamily: z,
|
|
1209
1209
|
scribbleStyle: Qe
|
|
1210
|
-
}),
|
|
1210
|
+
}), ne("web-sdk.widget", "Updated widget appearance", {
|
|
1211
1211
|
source: d,
|
|
1212
1212
|
inputAppearance: a,
|
|
1213
1213
|
appliedAccentColor: _,
|
|
1214
|
-
appliedColorScheme:
|
|
1215
|
-
appliedFontFamily:
|
|
1214
|
+
appliedColorScheme: T,
|
|
1215
|
+
appliedFontFamily: z,
|
|
1216
1216
|
appliedScribbleStyle: Qe,
|
|
1217
1217
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1218
1218
|
});
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function Wn(e, t) {
|
|
1222
1222
|
return { accentColor: e, scribbleStyle: t };
|
|
1223
1223
|
}
|
|
1224
1224
|
function aa(e) {
|
|
@@ -1244,7 +1244,7 @@ function la([e, t, n]) {
|
|
|
1244
1244
|
};
|
|
1245
1245
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1247
|
+
function Gn(e, t, n) {
|
|
1248
1248
|
e.classList.toggle(
|
|
1249
1249
|
"pluno-pa-widget--dark",
|
|
1250
1250
|
n.colorScheme === "dark"
|
|
@@ -1252,7 +1252,7 @@ function Wn(e, t, n) {
|
|
|
1252
1252
|
"pluno-pa-widget--light",
|
|
1253
1253
|
n.colorScheme !== "dark"
|
|
1254
1254
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1255
|
-
const o = n.scribbleStyle ?
|
|
1255
|
+
const o = n.scribbleStyle ? po(n.accentColor) : n.accentColor;
|
|
1256
1256
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1257
1257
|
"--pluno-pa-accent-contrast",
|
|
1258
1258
|
aa(o)
|
|
@@ -1262,17 +1262,17 @@ function Wn(e, t, n) {
|
|
|
1262
1262
|
);
|
|
1263
1263
|
for (const r of i)
|
|
1264
1264
|
r.replaceWith(
|
|
1265
|
-
|
|
1265
|
+
xe(
|
|
1266
1266
|
Array.from(r.classList).join(" "),
|
|
1267
1267
|
t
|
|
1268
1268
|
)
|
|
1269
1269
|
);
|
|
1270
1270
|
}
|
|
1271
1271
|
function pa(e) {
|
|
1272
|
-
if (e.getElementById(
|
|
1272
|
+
if (e.getElementById(Un))
|
|
1273
1273
|
return;
|
|
1274
1274
|
const t = e.createElement("style");
|
|
1275
|
-
t.id =
|
|
1275
|
+
t.id = Un, t.textContent = `@font-face {
|
|
1276
1276
|
font-family: "Architects Daughter";
|
|
1277
1277
|
font-style: normal;
|
|
1278
1278
|
font-weight: 400;
|
|
@@ -1291,14 +1291,14 @@ function sa({
|
|
|
1291
1291
|
let l = null, p = null, s = null, c = !1, u = null;
|
|
1292
1292
|
const m = () => {
|
|
1293
1293
|
l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1294
|
-
},
|
|
1294
|
+
}, L = (h) => {
|
|
1295
1295
|
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 }, s = o(), c = !1, t.setPointerCapture?.(h.pointerId));
|
|
1296
1296
|
}, v = (h) => {
|
|
1297
1297
|
if (l !== h.pointerId || !p || !s)
|
|
1298
1298
|
return;
|
|
1299
1299
|
h.preventDefault();
|
|
1300
|
-
const
|
|
1301
|
-
!c && Math.hypot(
|
|
1300
|
+
const E = h.clientX - p.x, N = h.clientY - p.y;
|
|
1301
|
+
!c && Math.hypot(E, N) < on || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + E, y: s.y + N }));
|
|
1302
1302
|
}, D = (h) => {
|
|
1303
1303
|
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1304
1304
|
}, C = (h) => {
|
|
@@ -1306,20 +1306,20 @@ function sa({
|
|
|
1306
1306
|
}, g = (h) => {
|
|
1307
1307
|
if (!u)
|
|
1308
1308
|
return;
|
|
1309
|
-
const
|
|
1309
|
+
const E = Math.hypot(
|
|
1310
1310
|
h.clientX - u.x,
|
|
1311
1311
|
h.clientY - u.y
|
|
1312
|
-
) <=
|
|
1313
|
-
u = null,
|
|
1312
|
+
) <= on;
|
|
1313
|
+
u = null, E && (h.preventDefault(), h.stopPropagation());
|
|
1314
1314
|
}, y = (h) => {
|
|
1315
1315
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1316
1316
|
return;
|
|
1317
|
-
const
|
|
1318
|
-
let
|
|
1319
|
-
h.key === "ArrowUp" ?
|
|
1317
|
+
const E = h.shiftKey ? _o : bo, N = o();
|
|
1318
|
+
let I = null;
|
|
1319
|
+
h.key === "ArrowUp" ? I = { x: N.x, y: N.y - E } : h.key === "ArrowDown" ? I = { x: N.x, y: N.y + E } : h.key === "ArrowLeft" ? I = { x: N.x - E, y: N.y } : h.key === "ArrowRight" && (I = { x: N.x + E, y: N.y }), I && (h.preventDefault(), h.stopPropagation(), i(I), r());
|
|
1320
1320
|
};
|
|
1321
|
-
return t.addEventListener("pointerdown",
|
|
1322
|
-
t.removeEventListener("pointerdown",
|
|
1321
|
+
return t.addEventListener("pointerdown", L), t.addEventListener("pointermove", v), t.addEventListener("pointerup", D), t.addEventListener("pointercancel", C), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
|
|
1322
|
+
t.removeEventListener("pointerdown", L), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", D), t.removeEventListener("pointercancel", C), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
|
|
1323
1323
|
};
|
|
1324
1324
|
}
|
|
1325
1325
|
function da({
|
|
@@ -1334,58 +1334,58 @@ function da({
|
|
|
1334
1334
|
r = null, l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1335
1335
|
}, m = (g) => {
|
|
1336
1336
|
const y = g.currentTarget, h = y.dataset.resizeDirection;
|
|
1337
|
-
!e.classList.contains("pluno-pa-widget--open") ||
|
|
1338
|
-
},
|
|
1337
|
+
!e.classList.contains("pluno-pa-widget--open") || !$n(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, s = n(), c = !1, y.setPointerCapture?.(g.pointerId));
|
|
1338
|
+
}, L = (g) => {
|
|
1339
1339
|
if (r !== g.pointerId || !l || !p || !s)
|
|
1340
1340
|
return;
|
|
1341
1341
|
g.preventDefault(), g.stopPropagation();
|
|
1342
1342
|
const y = g.clientX - p.x, h = g.clientY - p.y;
|
|
1343
|
-
!c && Math.hypot(y, h) <
|
|
1344
|
-
|
|
1343
|
+
!c && Math.hypot(y, h) < on || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1344
|
+
qn(s, l, y, h)
|
|
1345
1345
|
));
|
|
1346
1346
|
}, v = (g) => {
|
|
1347
1347
|
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1348
1348
|
}, D = (g) => {
|
|
1349
1349
|
r === g.pointerId && (g.preventDefault(), u());
|
|
1350
1350
|
}, C = (g) => {
|
|
1351
|
-
const h = g.currentTarget.dataset.resizeDirection,
|
|
1352
|
-
let
|
|
1353
|
-
|
|
1351
|
+
const h = g.currentTarget.dataset.resizeDirection, E = g.shiftKey ? _o : bo, N = n();
|
|
1352
|
+
let I = 0, G = 0;
|
|
1353
|
+
$n(h) && (g.key === "ArrowLeft" ? I = -E : g.key === "ArrowRight" ? I = E : g.key === "ArrowUp" ? G = -E : g.key === "ArrowDown" && (G = E), !(I === 0 && G === 0) && (g.preventDefault(), g.stopPropagation(), o(qn(N, h, I, G)), i()));
|
|
1354
1354
|
};
|
|
1355
1355
|
for (const g of t)
|
|
1356
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove",
|
|
1356
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", L), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", D), g.addEventListener("keydown", C);
|
|
1357
1357
|
return () => {
|
|
1358
1358
|
for (const g of t)
|
|
1359
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove",
|
|
1359
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", L), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", D), g.removeEventListener("keydown", C);
|
|
1360
1360
|
};
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function $n(e) {
|
|
1363
1363
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1366
|
-
const i = Z(), r =
|
|
1365
|
+
function qn(e, t, n, o) {
|
|
1366
|
+
const i = Z(), r = jn({
|
|
1367
1367
|
leading: e.position.x,
|
|
1368
1368
|
length: e.size.width,
|
|
1369
1369
|
delta: n,
|
|
1370
1370
|
resizeLeading: t.endsWith("left") || t === "left",
|
|
1371
1371
|
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1372
|
-
minLeading:
|
|
1373
|
-
maxTrailing: i.width -
|
|
1372
|
+
minLeading: A,
|
|
1373
|
+
maxTrailing: i.width - A,
|
|
1374
1374
|
minLength: Math.min(
|
|
1375
|
-
|
|
1376
|
-
i.width -
|
|
1375
|
+
dn,
|
|
1376
|
+
i.width - A * 2
|
|
1377
1377
|
)
|
|
1378
|
-
}), l =
|
|
1378
|
+
}), l = jn({
|
|
1379
1379
|
leading: e.position.y,
|
|
1380
1380
|
length: e.size.height,
|
|
1381
1381
|
delta: o,
|
|
1382
1382
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1383
1383
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1384
1384
|
minLeading: Ie,
|
|
1385
|
-
maxTrailing: i.height -
|
|
1385
|
+
maxTrailing: i.height - A,
|
|
1386
1386
|
minLength: Math.min(
|
|
1387
|
-
|
|
1388
|
-
i.height - Ie -
|
|
1387
|
+
cn,
|
|
1388
|
+
i.height - Ie - A
|
|
1389
1389
|
)
|
|
1390
1390
|
});
|
|
1391
1391
|
return {
|
|
@@ -1393,7 +1393,7 @@ function $n(e, t, n, o) {
|
|
|
1393
1393
|
size: { width: r.length, height: l.length }
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function jn({
|
|
1397
1397
|
leading: e,
|
|
1398
1398
|
length: t,
|
|
1399
1399
|
delta: n,
|
|
@@ -1436,17 +1436,17 @@ function qn({
|
|
|
1436
1436
|
}
|
|
1437
1437
|
return { leading: e, length: t };
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function bt(e, t = !0) {
|
|
1440
1440
|
const n = Z();
|
|
1441
1441
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1442
1442
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1443
1443
|
width: $i,
|
|
1444
1444
|
height: qi
|
|
1445
|
-
} : { width:
|
|
1445
|
+
} : { width: Bn, height: Bn };
|
|
1446
1446
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1447
1447
|
return {
|
|
1448
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1449
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Vi :
|
|
1448
|
+
width: t && i && o.width > 0 ? o.width : Math.min(mo, n.width - 36),
|
|
1449
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Vi : fo
|
|
1450
1450
|
};
|
|
1451
1451
|
}
|
|
1452
1452
|
function ca() {
|
|
@@ -1455,57 +1455,57 @@ function ca() {
|
|
|
1455
1455
|
width: Math.min(
|
|
1456
1456
|
X(
|
|
1457
1457
|
e.width * Yi,
|
|
1458
|
-
|
|
1458
|
+
dn,
|
|
1459
1459
|
Ki
|
|
1460
1460
|
),
|
|
1461
|
-
e.width -
|
|
1461
|
+
e.width - A * 2
|
|
1462
1462
|
),
|
|
1463
1463
|
height: Math.min(
|
|
1464
1464
|
X(
|
|
1465
1465
|
e.height * Zi,
|
|
1466
|
-
|
|
1466
|
+
cn,
|
|
1467
1467
|
Xi
|
|
1468
1468
|
),
|
|
1469
|
-
e.height - Ie -
|
|
1469
|
+
e.height - Ie - A
|
|
1470
1470
|
)
|
|
1471
1471
|
};
|
|
1472
1472
|
}
|
|
1473
1473
|
function Fe(e = null) {
|
|
1474
|
-
return e ?
|
|
1474
|
+
return e ? xt(e) : ca();
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function xt(e) {
|
|
1477
1477
|
const t = Z();
|
|
1478
1478
|
return {
|
|
1479
1479
|
width: X(
|
|
1480
1480
|
e.width,
|
|
1481
1481
|
Math.min(
|
|
1482
|
-
|
|
1483
|
-
t.width -
|
|
1482
|
+
dn,
|
|
1483
|
+
t.width - A * 2
|
|
1484
1484
|
),
|
|
1485
1485
|
Math.max(
|
|
1486
|
-
|
|
1487
|
-
t.width -
|
|
1486
|
+
A,
|
|
1487
|
+
t.width - A * 2
|
|
1488
1488
|
)
|
|
1489
1489
|
),
|
|
1490
1490
|
height: X(
|
|
1491
1491
|
e.height,
|
|
1492
1492
|
Math.min(
|
|
1493
|
-
|
|
1494
|
-
t.height - Ie -
|
|
1493
|
+
cn,
|
|
1494
|
+
t.height - Ie - A
|
|
1495
1495
|
),
|
|
1496
1496
|
Math.max(
|
|
1497
|
-
|
|
1498
|
-
t.height - Ie -
|
|
1497
|
+
A,
|
|
1498
|
+
t.height - Ie - A
|
|
1499
1499
|
)
|
|
1500
1500
|
)
|
|
1501
1501
|
};
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1503
|
+
function Wt(e, t) {
|
|
1504
1504
|
if (!t) {
|
|
1505
1505
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1506
1506
|
return;
|
|
1507
1507
|
}
|
|
1508
|
-
const n =
|
|
1508
|
+
const n = xt(t);
|
|
1509
1509
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1510
1510
|
}
|
|
1511
1511
|
function ua(e, t, n) {
|
|
@@ -1521,11 +1521,11 @@ function ua(e, t, n) {
|
|
|
1521
1521
|
y: l.height - 24 - n.height
|
|
1522
1522
|
};
|
|
1523
1523
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const o =
|
|
1526
|
-
return t ?
|
|
1524
|
+
function Gt(e, t, n) {
|
|
1525
|
+
const o = bt(e, !1);
|
|
1526
|
+
return t ? an(
|
|
1527
1527
|
e,
|
|
1528
|
-
|
|
1528
|
+
vo(t, o),
|
|
1529
1529
|
o
|
|
1530
1530
|
) : ga(n === "bottom-left" ? "bottom-left" : "bottom-right", o, ji);
|
|
1531
1531
|
}
|
|
@@ -1536,15 +1536,15 @@ function ga(e, t, n) {
|
|
|
1536
1536
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const o = Z(), i =
|
|
1539
|
+
function an(e, t, n) {
|
|
1540
|
+
const o = Z(), i = A + fa(e);
|
|
1541
1541
|
return {
|
|
1542
1542
|
x: X(
|
|
1543
1543
|
t.x,
|
|
1544
|
-
|
|
1544
|
+
A,
|
|
1545
1545
|
Math.max(
|
|
1546
|
-
|
|
1547
|
-
o.width - n.width -
|
|
1546
|
+
A,
|
|
1547
|
+
o.width - n.width - A
|
|
1548
1548
|
)
|
|
1549
1549
|
),
|
|
1550
1550
|
y: X(
|
|
@@ -1552,12 +1552,12 @@ function on(e, t, n) {
|
|
|
1552
1552
|
i,
|
|
1553
1553
|
Math.max(
|
|
1554
1554
|
i,
|
|
1555
|
-
o.height - n.height -
|
|
1555
|
+
o.height - n.height - A
|
|
1556
1556
|
)
|
|
1557
1557
|
)
|
|
1558
1558
|
};
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1560
|
+
function vo(e, t) {
|
|
1561
1561
|
const n = Z();
|
|
1562
1562
|
return {
|
|
1563
1563
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
@@ -1579,22 +1579,22 @@ function ma(e, t) {
|
|
|
1579
1579
|
function fa(e) {
|
|
1580
1580
|
return e.classList.contains("pluno-pa-widget--scribble") ? ta : ea;
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1583
|
-
const i =
|
|
1582
|
+
function $t(e, t, n, o = null) {
|
|
1583
|
+
const i = bt(e), r = Fe(o), l = {
|
|
1584
1584
|
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1585
1585
|
y: t.y + i.height - r.height
|
|
1586
1586
|
};
|
|
1587
|
-
return
|
|
1587
|
+
return mt(l, r);
|
|
1588
1588
|
}
|
|
1589
|
-
function
|
|
1589
|
+
function mt(e, t) {
|
|
1590
1590
|
const n = Z();
|
|
1591
1591
|
return {
|
|
1592
1592
|
x: X(
|
|
1593
1593
|
e.x,
|
|
1594
|
-
|
|
1594
|
+
A,
|
|
1595
1595
|
Math.max(
|
|
1596
|
-
|
|
1597
|
-
n.width - t.width -
|
|
1596
|
+
A,
|
|
1597
|
+
n.width - t.width - A
|
|
1598
1598
|
)
|
|
1599
1599
|
),
|
|
1600
1600
|
y: X(
|
|
@@ -1602,7 +1602,7 @@ function ht(e, t) {
|
|
|
1602
1602
|
Ie,
|
|
1603
1603
|
Math.max(
|
|
1604
1604
|
Ie,
|
|
1605
|
-
n.height - t.height -
|
|
1605
|
+
n.height - t.height - A
|
|
1606
1606
|
)
|
|
1607
1607
|
)
|
|
1608
1608
|
};
|
|
@@ -1617,16 +1617,16 @@ function Te(e, t) {
|
|
|
1617
1617
|
function wa(e, t) {
|
|
1618
1618
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1620
|
+
function Vn(e) {
|
|
1621
1621
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1622
1622
|
}
|
|
1623
1623
|
function Z() {
|
|
1624
1624
|
return {
|
|
1625
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1626
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1625
|
+
width: window.innerWidth || document.documentElement.clientWidth || mo + A * 2,
|
|
1626
|
+
height: window.innerHeight || document.documentElement.clientHeight || fo + A * 2
|
|
1627
1627
|
};
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1629
|
+
function qt(e) {
|
|
1630
1630
|
const t = e.getBoundingClientRect();
|
|
1631
1631
|
return {
|
|
1632
1632
|
x: Math.round(t.x),
|
|
@@ -1638,7 +1638,7 @@ function $t(e) {
|
|
|
1638
1638
|
function X(e, t, n) {
|
|
1639
1639
|
return Math.min(Math.max(e, t), n);
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function ne(e, t, n) {
|
|
1642
1642
|
if (typeof window > "u")
|
|
1643
1643
|
return;
|
|
1644
1644
|
const o = window, i = {
|
|
@@ -1652,9 +1652,9 @@ function te(e, t, n) {
|
|
|
1652
1652
|
);
|
|
1653
1653
|
}
|
|
1654
1654
|
function ba(e, t) {
|
|
1655
|
-
|
|
1655
|
+
ne("web-sdk.widget.position", e, t);
|
|
1656
1656
|
}
|
|
1657
|
-
function
|
|
1657
|
+
function jt(e, t, n) {
|
|
1658
1658
|
const o = t.value.trim();
|
|
1659
1659
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1660
1660
|
attachments: n.length > 0 ? n.map(ya) : void 0
|
|
@@ -1738,7 +1738,7 @@ function La(e, t, n, o, i) {
|
|
|
1738
1738
|
i
|
|
1739
1739
|
)
|
|
1740
1740
|
), e.appendChild(
|
|
1741
|
-
|
|
1741
|
+
yt(
|
|
1742
1742
|
"pluno-pa-widget__close",
|
|
1743
1743
|
"Close",
|
|
1744
1744
|
Oa(16),
|
|
@@ -1753,12 +1753,12 @@ function Pa(e, t, n, o) {
|
|
|
1753
1753
|
s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", i.appendChild(s);
|
|
1754
1754
|
}
|
|
1755
1755
|
i.appendChild(
|
|
1756
|
-
|
|
1756
|
+
ko(
|
|
1757
1757
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1758
1758
|
10
|
|
1759
1759
|
)
|
|
1760
1760
|
), i.appendChild(
|
|
1761
|
-
|
|
1761
|
+
xe(
|
|
1762
1762
|
"pluno-pa-widget__character--launcher",
|
|
1763
1763
|
t
|
|
1764
1764
|
)
|
|
@@ -1767,7 +1767,7 @@ function Pa(e, t, n, o) {
|
|
|
1767
1767
|
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
1768
1768
|
const l = document.createElement("input");
|
|
1769
1769
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1770
|
-
const p =
|
|
1770
|
+
const p = _t("Working...");
|
|
1771
1771
|
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1772
1772
|
const s = document.createElement("button");
|
|
1773
1773
|
s.type = "button", s.className = "pluno-pa-widget__launcher-minimize", s.textContent = "-", s.setAttribute("aria-label", "Minimize Pluno on this site"), s.title = "Minimize Pluno on this site", i.appendChild(s);
|
|
@@ -1777,7 +1777,7 @@ function Pa(e, t, n, o) {
|
|
|
1777
1777
|
function Ta(e) {
|
|
1778
1778
|
const t = document.createElement("section");
|
|
1779
1779
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1780
|
-
|
|
1780
|
+
ko("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1781
1781
|
);
|
|
1782
1782
|
const n = document.createElement("div");
|
|
1783
1783
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
@@ -1791,27 +1791,27 @@ function Ta(e) {
|
|
|
1791
1791
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1792
1792
|
const p = document.createElement("div");
|
|
1793
1793
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1794
|
-
|
|
1794
|
+
yt(
|
|
1795
1795
|
"pluno-pa-widget__history",
|
|
1796
|
-
|
|
1796
|
+
rn(),
|
|
1797
1797
|
Ba(),
|
|
1798
1798
|
!0
|
|
1799
1799
|
)
|
|
1800
|
-
), n.appendChild(p), n.appendChild(Na()), t.appendChild(n), t.appendChild(Ia()), t.appendChild(Aa()), t.appendChild(
|
|
1801
|
-
|
|
1802
|
-
), t.appendChild(
|
|
1803
|
-
|
|
1800
|
+
), n.appendChild(p), n.appendChild(Na()), t.appendChild(n), t.appendChild(Ia()), t.appendChild(Aa()), t.appendChild(_e("left", "Resize Pluno from left")), t.appendChild(
|
|
1801
|
+
_e("right", "Resize Pluno from right")
|
|
1802
|
+
), t.appendChild(_e("top", "Resize Pluno from top")), t.appendChild(
|
|
1803
|
+
_e("bottom", "Resize Pluno from bottom")
|
|
1804
1804
|
), t.appendChild(
|
|
1805
|
-
|
|
1805
|
+
_e("top-left", "Resize Pluno from top left")
|
|
1806
1806
|
), t.appendChild(
|
|
1807
|
-
|
|
1807
|
+
_e("top-right", "Resize Pluno from top right")
|
|
1808
1808
|
), t.appendChild(
|
|
1809
|
-
|
|
1809
|
+
_e("bottom-left", "Resize Pluno from bottom left")
|
|
1810
1810
|
), t.appendChild(
|
|
1811
|
-
|
|
1811
|
+
_e("bottom-right", "Resize Pluno from bottom right")
|
|
1812
1812
|
), t;
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function _e(e, t) {
|
|
1815
1815
|
const n = document.createElement("button");
|
|
1816
1816
|
return n.type = "button", n.className = [
|
|
1817
1817
|
"pluno-pa-widget__resize-handle",
|
|
@@ -1850,7 +1850,7 @@ function Aa() {
|
|
|
1850
1850
|
const p = document.createElement("textarea");
|
|
1851
1851
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1852
1852
|
const s = document.createElement("button");
|
|
1853
|
-
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(
|
|
1853
|
+
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(Po()), i.appendChild(s), e.appendChild(i);
|
|
1854
1854
|
const c = document.createElement("div");
|
|
1855
1855
|
c.className = "pluno-pa-widget__composer-meta";
|
|
1856
1856
|
const u = document.createElement("a");
|
|
@@ -1858,17 +1858,17 @@ function Aa() {
|
|
|
1858
1858
|
const m = document.createElement("span");
|
|
1859
1859
|
return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1861
|
+
function rn() {
|
|
1862
1862
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1863
1863
|
}
|
|
1864
1864
|
function Na() {
|
|
1865
1865
|
const e = document.createElement("section");
|
|
1866
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1866
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", rn());
|
|
1867
1867
|
const t = document.createElement("div");
|
|
1868
1868
|
t.className = "pluno-pa-widget__history-header";
|
|
1869
1869
|
const n = document.createElement("strong");
|
|
1870
|
-
n.textContent =
|
|
1871
|
-
const o =
|
|
1870
|
+
n.textContent = rn();
|
|
1871
|
+
const o = yt(
|
|
1872
1872
|
"pluno-pa-widget__history-close",
|
|
1873
1873
|
"Close recent chats",
|
|
1874
1874
|
Fa(),
|
|
@@ -1883,17 +1883,17 @@ function Na() {
|
|
|
1883
1883
|
function Ra(e) {
|
|
1884
1884
|
const t = document.createElement("div");
|
|
1885
1885
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1886
|
-
|
|
1886
|
+
xe(
|
|
1887
1887
|
"pluno-pa-widget__character--empty",
|
|
1888
1888
|
e
|
|
1889
1889
|
)
|
|
1890
|
-
), t.appendChild(
|
|
1890
|
+
), t.appendChild(Co()), t;
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function Co() {
|
|
1893
1893
|
const e = document.createElement("div");
|
|
1894
1894
|
return e.className = "pluno-pa-widget__empty", e.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), e.appendChild(document.createElement("br")), e.appendChild(document.createTextNode("What do you want to do today?")), e;
|
|
1895
1895
|
}
|
|
1896
|
-
function
|
|
1896
|
+
function So(e, t) {
|
|
1897
1897
|
e.replaceChildren(), e.setAttribute(
|
|
1898
1898
|
"aria-label",
|
|
1899
1899
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1905,9 +1905,9 @@ function Co(e, t) {
|
|
|
1905
1905
|
)
|
|
1906
1906
|
);
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1909
|
-
const n = `pluno-pa-character-${
|
|
1910
|
-
|
|
1908
|
+
function xe(e, t) {
|
|
1909
|
+
const n = `pluno-pa-character-${Hn}`;
|
|
1910
|
+
Hn += 1;
|
|
1911
1911
|
const o = t.scribbleStyle ? Ma(t.accentColor, n) : Da(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1912
1912
|
return o.setAttribute(
|
|
1913
1913
|
"class",
|
|
@@ -1926,7 +1926,7 @@ function Da(e, t) {
|
|
|
1926
1926
|
eyeShadow: `${t}-eyeShadow`,
|
|
1927
1927
|
pupilGloss: `${t}-pupilGloss`,
|
|
1928
1928
|
boltClip: `${t}-boltClip`
|
|
1929
|
-
}, i =
|
|
1929
|
+
}, i = Eo(), r = f(i, "defs"), l = f(r, "linearGradient", {
|
|
1930
1930
|
id: o.boltFill,
|
|
1931
1931
|
x1: "420",
|
|
1932
1932
|
y1: "180",
|
|
@@ -1934,7 +1934,7 @@ function Da(e, t) {
|
|
|
1934
1934
|
y2: "1040",
|
|
1935
1935
|
gradientUnits: "userSpaceOnUse"
|
|
1936
1936
|
});
|
|
1937
|
-
|
|
1937
|
+
U(l, "0", n.top), U(l, "0.36", n.middle), U(l, "0.72", n.bottom), U(l, "1", n.bottom);
|
|
1938
1938
|
const p = f(r, "linearGradient", {
|
|
1939
1939
|
id: o.boltEdge,
|
|
1940
1940
|
x1: "470",
|
|
@@ -1943,28 +1943,28 @@ function Da(e, t) {
|
|
|
1943
1943
|
y2: "980",
|
|
1944
1944
|
gradientUnits: "userSpaceOnUse"
|
|
1945
1945
|
});
|
|
1946
|
-
|
|
1946
|
+
U(p, "0", n.edgeStart), U(p, "0.32", n.edgeMiddle), U(p, "0.78", n.edgeEnd), U(p, "1", n.edgeEnd);
|
|
1947
1947
|
const s = f(r, "radialGradient", {
|
|
1948
1948
|
id: o.boltGlow,
|
|
1949
1949
|
cx: "50%",
|
|
1950
1950
|
cy: "22%",
|
|
1951
1951
|
r: "82%"
|
|
1952
1952
|
});
|
|
1953
|
-
|
|
1953
|
+
U(s, "0", n.glow, "0.72"), U(s, "0.5", n.middle, "0.44"), U(s, "1", n.bottom, "0");
|
|
1954
1954
|
const c = f(r, "radialGradient", {
|
|
1955
1955
|
id: o.eyeWhite,
|
|
1956
1956
|
cx: "35%",
|
|
1957
1957
|
cy: "25%",
|
|
1958
1958
|
r: "70%"
|
|
1959
1959
|
});
|
|
1960
|
-
|
|
1960
|
+
U(c, "0", "#ffffff"), U(c, "0.72", "#ffffff"), U(c, "1", "#e5e5e5");
|
|
1961
1961
|
const u = f(r, "radialGradient", {
|
|
1962
1962
|
id: o.pupil,
|
|
1963
1963
|
cx: "42%",
|
|
1964
1964
|
cy: "38%",
|
|
1965
1965
|
r: "65%"
|
|
1966
1966
|
});
|
|
1967
|
-
|
|
1967
|
+
U(u, "0", "#2a1f10"), U(u, "0.52", "#080604"), U(u, "1", "#000000");
|
|
1968
1968
|
const m = f(r, "filter", {
|
|
1969
1969
|
id: o.softDropShadow,
|
|
1970
1970
|
x: "-18%",
|
|
@@ -1980,7 +1980,7 @@ function Da(e, t) {
|
|
|
1980
1980
|
"flood-color": n.shadow,
|
|
1981
1981
|
"flood-opacity": "0.24"
|
|
1982
1982
|
});
|
|
1983
|
-
const
|
|
1983
|
+
const L = f(r, "filter", {
|
|
1984
1984
|
id: o.innerDepth,
|
|
1985
1985
|
x: "-8%",
|
|
1986
1986
|
y: "-8%",
|
|
@@ -1988,27 +1988,27 @@ function Da(e, t) {
|
|
|
1988
1988
|
height: "116%",
|
|
1989
1989
|
"color-interpolation-filters": "sRGB"
|
|
1990
1990
|
});
|
|
1991
|
-
f(
|
|
1991
|
+
f(L, "feGaussianBlur", {
|
|
1992
1992
|
in: "SourceAlpha",
|
|
1993
1993
|
stdDeviation: "8",
|
|
1994
1994
|
result: "blur"
|
|
1995
|
-
}), f(
|
|
1995
|
+
}), f(L, "feOffset", {
|
|
1996
1996
|
dx: "-7",
|
|
1997
1997
|
dy: "-9",
|
|
1998
1998
|
result: "topLeft"
|
|
1999
|
-
}), f(
|
|
1999
|
+
}), f(L, "feComposite", {
|
|
2000
2000
|
in: "topLeft",
|
|
2001
2001
|
in2: "SourceAlpha",
|
|
2002
2002
|
operator: "arithmetic",
|
|
2003
2003
|
k2: "-1",
|
|
2004
2004
|
k3: "1",
|
|
2005
2005
|
result: "innerShadow"
|
|
2006
|
-
}), f(
|
|
2006
|
+
}), f(L, "feColorMatrix", {
|
|
2007
2007
|
in: "innerShadow",
|
|
2008
2008
|
type: "matrix",
|
|
2009
2009
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2010
2010
|
result: "innerLight"
|
|
2011
|
-
}), f(
|
|
2011
|
+
}), f(L, "feBlend", {
|
|
2012
2012
|
in: "SourceGraphic",
|
|
2013
2013
|
in2: "innerLight",
|
|
2014
2014
|
mode: "screen"
|
|
@@ -2044,12 +2044,12 @@ function Da(e, t) {
|
|
|
2044
2044
|
"flood-opacity": "0.22"
|
|
2045
2045
|
});
|
|
2046
2046
|
const C = f(r, "clipPath", { id: o.boltClip });
|
|
2047
|
-
f(C, "path", { d:
|
|
2047
|
+
f(C, "path", { d: ft });
|
|
2048
2048
|
const g = f(i, "g", {
|
|
2049
2049
|
filter: Y(o.softDropShadow)
|
|
2050
2050
|
});
|
|
2051
2051
|
f(g, "path", {
|
|
2052
|
-
d:
|
|
2052
|
+
d: ft,
|
|
2053
2053
|
fill: Y(o.boltEdge)
|
|
2054
2054
|
});
|
|
2055
2055
|
const y = "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";
|
|
@@ -2088,9 +2088,9 @@ function Da(e, t) {
|
|
|
2088
2088
|
"stroke-linecap": "round",
|
|
2089
2089
|
opacity: "0.48"
|
|
2090
2090
|
});
|
|
2091
|
-
const
|
|
2092
|
-
return
|
|
2093
|
-
|
|
2091
|
+
const E = f(i, "g", { filter: Y(o.eyeShadow) });
|
|
2092
|
+
return Kn(
|
|
2093
|
+
E,
|
|
2094
2094
|
"rotate(-2 528 463)",
|
|
2095
2095
|
"528",
|
|
2096
2096
|
"463",
|
|
@@ -2099,8 +2099,8 @@ function Da(e, t) {
|
|
|
2099
2099
|
"557",
|
|
2100
2100
|
"447",
|
|
2101
2101
|
o
|
|
2102
|
-
),
|
|
2103
|
-
|
|
2102
|
+
), Kn(
|
|
2103
|
+
E,
|
|
2104
2104
|
"rotate(2 717 462)",
|
|
2105
2105
|
"717",
|
|
2106
2106
|
"462",
|
|
@@ -2112,11 +2112,11 @@ function Da(e, t) {
|
|
|
2112
2112
|
), i;
|
|
2113
2113
|
}
|
|
2114
2114
|
function Ma(e, t) {
|
|
2115
|
-
const n =
|
|
2115
|
+
const n = po(e), o = {
|
|
2116
2116
|
clip: `${t}-scribbleBoltClip`,
|
|
2117
2117
|
wobble: `${t}-scribbleBoltWobble`
|
|
2118
|
-
}, i =
|
|
2119
|
-
f(l, "path", { d:
|
|
2118
|
+
}, i = Eo(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
|
|
2119
|
+
f(l, "path", { d: ft });
|
|
2120
2120
|
const p = f(r, "filter", {
|
|
2121
2121
|
id: o.wobble,
|
|
2122
2122
|
x: "-10%",
|
|
@@ -2151,12 +2151,12 @@ function Ma(e, t) {
|
|
|
2151
2151
|
opacity: "0.9",
|
|
2152
2152
|
transform: "rotate(-14 627 600)"
|
|
2153
2153
|
}), f(s, "path", {
|
|
2154
|
-
d:
|
|
2154
|
+
d: ft,
|
|
2155
2155
|
fill: "none",
|
|
2156
|
-
stroke:
|
|
2156
|
+
stroke: wt,
|
|
2157
2157
|
"stroke-width": "18",
|
|
2158
2158
|
"stroke-linejoin": "round"
|
|
2159
|
-
}),
|
|
2159
|
+
}), Yn(
|
|
2160
2160
|
s,
|
|
2161
2161
|
"rotate(-2 528 463)",
|
|
2162
2162
|
"528",
|
|
@@ -2165,7 +2165,7 @@ function Ma(e, t) {
|
|
|
2165
2165
|
"473",
|
|
2166
2166
|
"557",
|
|
2167
2167
|
"447"
|
|
2168
|
-
),
|
|
2168
|
+
), Yn(
|
|
2169
2169
|
s,
|
|
2170
2170
|
"rotate(2 717 462)",
|
|
2171
2171
|
"717",
|
|
@@ -2176,13 +2176,13 @@ function Ma(e, t) {
|
|
|
2176
2176
|
"447"
|
|
2177
2177
|
), i;
|
|
2178
2178
|
}
|
|
2179
|
-
function
|
|
2180
|
-
return
|
|
2181
|
-
xmlns:
|
|
2179
|
+
function Eo() {
|
|
2180
|
+
return k("svg", {
|
|
2181
|
+
xmlns: wo,
|
|
2182
2182
|
viewBox: "0 0 1254 1254"
|
|
2183
2183
|
});
|
|
2184
2184
|
}
|
|
2185
|
-
function
|
|
2185
|
+
function Kn(e, t, n, o, i, r, l, p, s) {
|
|
2186
2186
|
const c = f(e, "g", { transform: t });
|
|
2187
2187
|
f(c, "ellipse", {
|
|
2188
2188
|
cx: n,
|
|
@@ -2204,7 +2204,7 @@ function Vn(e, t, n, o, i, r, l, p, s) {
|
|
|
2204
2204
|
fill: "#ffffff"
|
|
2205
2205
|
});
|
|
2206
2206
|
}
|
|
2207
|
-
function
|
|
2207
|
+
function Yn(e, t, n, o, i, r, l, p) {
|
|
2208
2208
|
const s = f(e, "g", { transform: t });
|
|
2209
2209
|
f(s, "ellipse", {
|
|
2210
2210
|
cx: n,
|
|
@@ -2212,14 +2212,14 @@ function Kn(e, t, n, o, i, r, l, p) {
|
|
|
2212
2212
|
rx: "73",
|
|
2213
2213
|
ry: "80",
|
|
2214
2214
|
fill: "#ffffff",
|
|
2215
|
-
stroke:
|
|
2215
|
+
stroke: wt,
|
|
2216
2216
|
"stroke-width": "13"
|
|
2217
2217
|
}), f(s, "ellipse", {
|
|
2218
2218
|
cx: i,
|
|
2219
2219
|
cy: r,
|
|
2220
2220
|
rx: "45",
|
|
2221
2221
|
ry: "53",
|
|
2222
|
-
fill:
|
|
2222
|
+
fill: wt
|
|
2223
2223
|
}), f(s, "circle", {
|
|
2224
2224
|
cx: l,
|
|
2225
2225
|
cy: p,
|
|
@@ -2228,71 +2228,71 @@ function Kn(e, t, n, o, i, r, l, p) {
|
|
|
2228
2228
|
});
|
|
2229
2229
|
}
|
|
2230
2230
|
function f(e, t, n = {}) {
|
|
2231
|
-
const o =
|
|
2231
|
+
const o = k(t, n);
|
|
2232
2232
|
return e.appendChild(o), o;
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function U(e, t, n, o) {
|
|
2235
2235
|
const i = { offset: t, "stop-color": n };
|
|
2236
2236
|
o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
|
|
2237
2237
|
}
|
|
2238
2238
|
function Y(e) {
|
|
2239
2239
|
return `url(#${e})`;
|
|
2240
2240
|
}
|
|
2241
|
-
function
|
|
2241
|
+
function yt(e, t, n, o) {
|
|
2242
2242
|
const i = document.createElement("button");
|
|
2243
2243
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2244
2244
|
}
|
|
2245
2245
|
function za() {
|
|
2246
|
-
const e =
|
|
2246
|
+
const e = k("svg", {
|
|
2247
2247
|
class: "pluno-pa-widget__scribble-defs",
|
|
2248
2248
|
"aria-hidden": "true",
|
|
2249
2249
|
focusable: "false",
|
|
2250
2250
|
width: "0",
|
|
2251
2251
|
height: "0"
|
|
2252
|
-
}), t =
|
|
2253
|
-
return t.appendChild(
|
|
2254
|
-
|
|
2252
|
+
}), t = k("defs");
|
|
2253
|
+
return t.appendChild(Kt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2254
|
+
Kt("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2255
2255
|
), t.appendChild(
|
|
2256
|
-
|
|
2256
|
+
Kt("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2257
2257
|
), e.appendChild(t), e;
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2260
|
-
const n =
|
|
2259
|
+
function ko(e, t) {
|
|
2260
|
+
const n = k("svg", {
|
|
2261
2261
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2262
2262
|
preserveAspectRatio: "xMidYMid meet",
|
|
2263
2263
|
"aria-hidden": "true",
|
|
2264
2264
|
focusable: "false"
|
|
2265
2265
|
});
|
|
2266
|
-
return
|
|
2266
|
+
return Lo(n, t), n;
|
|
2267
2267
|
}
|
|
2268
|
-
function
|
|
2268
|
+
function Vt(e, t) {
|
|
2269
2269
|
if (!e)
|
|
2270
2270
|
return;
|
|
2271
2271
|
const n = Math.max(
|
|
2272
2272
|
0,
|
|
2273
|
-
t -
|
|
2273
|
+
t - nn * 2
|
|
2274
2274
|
), o = Math.max(
|
|
2275
2275
|
Qi,
|
|
2276
2276
|
Math.floor(
|
|
2277
|
-
(n -
|
|
2277
|
+
(n - tn * 2) / en
|
|
2278
2278
|
)
|
|
2279
2279
|
);
|
|
2280
|
-
|
|
2280
|
+
Lo(e, o);
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2282
|
+
function Lo(e, t) {
|
|
2283
2283
|
if (e.dataset.spiralCount === `${t}`)
|
|
2284
2284
|
return;
|
|
2285
|
-
const n = t *
|
|
2285
|
+
const n = t * en + tn * 2;
|
|
2286
2286
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2287
2287
|
"viewBox",
|
|
2288
2288
|
`0 0 ${n} ${Ji}`
|
|
2289
2289
|
), e.replaceChildren();
|
|
2290
2290
|
for (let o = 0; o < t; o += 1) {
|
|
2291
|
-
const i =
|
|
2292
|
-
transform: `translate(${
|
|
2291
|
+
const i = Fn[o % Fn.length], r = k("g", {
|
|
2292
|
+
transform: `translate(${tn + o * en} 0)`
|
|
2293
2293
|
});
|
|
2294
2294
|
r.appendChild(
|
|
2295
|
-
|
|
2295
|
+
k("ellipse", {
|
|
2296
2296
|
cx: i.ellipseCx,
|
|
2297
2297
|
cy: i.ellipseCy,
|
|
2298
2298
|
rx: i.ellipseRx,
|
|
@@ -2303,7 +2303,7 @@ function ko(e, t) {
|
|
|
2303
2303
|
opacity: "0.8"
|
|
2304
2304
|
})
|
|
2305
2305
|
), r.appendChild(
|
|
2306
|
-
|
|
2306
|
+
k("path", {
|
|
2307
2307
|
d: i.path,
|
|
2308
2308
|
fill: "none",
|
|
2309
2309
|
stroke: "#2c2a1e",
|
|
@@ -2313,8 +2313,8 @@ function ko(e, t) {
|
|
|
2313
2313
|
), e.appendChild(r);
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2317
|
-
const o =
|
|
2316
|
+
function Kt(e, t, n) {
|
|
2317
|
+
const o = k("filter", {
|
|
2318
2318
|
id: e,
|
|
2319
2319
|
x: "-8%",
|
|
2320
2320
|
y: "-8%",
|
|
@@ -2322,7 +2322,7 @@ function Vt(e, t, n) {
|
|
|
2322
2322
|
height: "116%"
|
|
2323
2323
|
});
|
|
2324
2324
|
return o.appendChild(
|
|
2325
|
-
|
|
2325
|
+
k("feTurbulence", {
|
|
2326
2326
|
type: "fractalNoise",
|
|
2327
2327
|
baseFrequency: "0.012 0.028",
|
|
2328
2328
|
numOctaves: "3",
|
|
@@ -2330,7 +2330,7 @@ function Vt(e, t, n) {
|
|
|
2330
2330
|
result: "stroke-noise"
|
|
2331
2331
|
})
|
|
2332
2332
|
), o.appendChild(
|
|
2333
|
-
|
|
2333
|
+
k("feDisplacementMap", {
|
|
2334
2334
|
in: "SourceGraphic",
|
|
2335
2335
|
in2: "stroke-noise",
|
|
2336
2336
|
scale: "3.5",
|
|
@@ -2339,7 +2339,7 @@ function Vt(e, t, n) {
|
|
|
2339
2339
|
result: "warped"
|
|
2340
2340
|
})
|
|
2341
2341
|
), o.appendChild(
|
|
2342
|
-
|
|
2342
|
+
k("feTurbulence", {
|
|
2343
2343
|
type: "fractalNoise",
|
|
2344
2344
|
baseFrequency: "0.7",
|
|
2345
2345
|
numOctaves: "1",
|
|
@@ -2347,7 +2347,7 @@ function Vt(e, t, n) {
|
|
|
2347
2347
|
result: "ink-noise"
|
|
2348
2348
|
})
|
|
2349
2349
|
), o.appendChild(
|
|
2350
|
-
|
|
2350
|
+
k("feDisplacementMap", {
|
|
2351
2351
|
in: "warped",
|
|
2352
2352
|
in2: "ink-noise",
|
|
2353
2353
|
scale: "0.9",
|
|
@@ -2365,7 +2365,7 @@ function Oa(e) {
|
|
|
2365
2365
|
"currentColor",
|
|
2366
2366
|
"2.25"
|
|
2367
2367
|
);
|
|
2368
|
-
return t.appendChild(
|
|
2368
|
+
return t.appendChild(k("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2369
2369
|
}
|
|
2370
2370
|
function Ua() {
|
|
2371
2371
|
const e = pe(
|
|
@@ -2377,11 +2377,11 @@ function Ua() {
|
|
|
2377
2377
|
"2.25"
|
|
2378
2378
|
);
|
|
2379
2379
|
return e.appendChild(
|
|
2380
|
-
|
|
2380
|
+
k("path", {
|
|
2381
2381
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2382
2382
|
})
|
|
2383
2383
|
), e.appendChild(
|
|
2384
|
-
|
|
2384
|
+
k("path", {
|
|
2385
2385
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2386
2386
|
})
|
|
2387
2387
|
), e;
|
|
@@ -2395,7 +2395,7 @@ function Ba() {
|
|
|
2395
2395
|
"currentColor",
|
|
2396
2396
|
"2.25"
|
|
2397
2397
|
);
|
|
2398
|
-
return e.appendChild(
|
|
2398
|
+
return e.appendChild(k("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(k("path", { d: "M3 4v5h5" })), e.appendChild(k("path", { d: "M12 7v5l3 2" })), e;
|
|
2399
2399
|
}
|
|
2400
2400
|
function Fa() {
|
|
2401
2401
|
const e = pe(
|
|
@@ -2406,9 +2406,9 @@ function Fa() {
|
|
|
2406
2406
|
"currentColor",
|
|
2407
2407
|
"2.4"
|
|
2408
2408
|
);
|
|
2409
|
-
return e.appendChild(
|
|
2409
|
+
return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2411
|
+
function Po() {
|
|
2412
2412
|
const e = pe(
|
|
2413
2413
|
"0 0 24 24",
|
|
2414
2414
|
14,
|
|
@@ -2418,8 +2418,8 @@ function Lo() {
|
|
|
2418
2418
|
"2.75"
|
|
2419
2419
|
);
|
|
2420
2420
|
return e.appendChild(
|
|
2421
|
-
|
|
2422
|
-
), e.appendChild(
|
|
2421
|
+
k("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2422
|
+
), e.appendChild(k("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2423
2423
|
}
|
|
2424
2424
|
function Ha() {
|
|
2425
2425
|
const e = pe(
|
|
@@ -2434,7 +2434,7 @@ function Ha() {
|
|
|
2434
2434
|
"class",
|
|
2435
2435
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2436
2436
|
), e.appendChild(
|
|
2437
|
-
|
|
2437
|
+
k("path", {
|
|
2438
2438
|
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"
|
|
2439
2439
|
})
|
|
2440
2440
|
), e;
|
|
@@ -2445,7 +2445,7 @@ function Wa() {
|
|
|
2445
2445
|
"class",
|
|
2446
2446
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2447
2447
|
), e.appendChild(
|
|
2448
|
-
|
|
2448
|
+
k("path", {
|
|
2449
2449
|
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",
|
|
2450
2450
|
stroke: "currentColor",
|
|
2451
2451
|
"stroke-width": "2",
|
|
@@ -2457,7 +2457,7 @@ function Wa() {
|
|
|
2457
2457
|
function Ga() {
|
|
2458
2458
|
const e = pe("0 0 24 24", 18, 18, "currentColor");
|
|
2459
2459
|
return e.appendChild(
|
|
2460
|
-
|
|
2460
|
+
k("rect", {
|
|
2461
2461
|
x: "6",
|
|
2462
2462
|
y: "6",
|
|
2463
2463
|
width: "12",
|
|
@@ -2475,7 +2475,7 @@ function $a() {
|
|
|
2475
2475
|
"currentColor",
|
|
2476
2476
|
"2.4"
|
|
2477
2477
|
);
|
|
2478
|
-
return e.appendChild(
|
|
2478
|
+
return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
|
|
2479
2479
|
}
|
|
2480
2480
|
function qa() {
|
|
2481
2481
|
const e = pe(
|
|
@@ -2487,7 +2487,7 @@ function qa() {
|
|
|
2487
2487
|
"2.25"
|
|
2488
2488
|
);
|
|
2489
2489
|
return e.appendChild(
|
|
2490
|
-
|
|
2490
|
+
k("rect", {
|
|
2491
2491
|
width: "14",
|
|
2492
2492
|
height: "14",
|
|
2493
2493
|
x: "8",
|
|
@@ -2496,7 +2496,7 @@ function qa() {
|
|
|
2496
2496
|
ry: "2"
|
|
2497
2497
|
})
|
|
2498
2498
|
), e.appendChild(
|
|
2499
|
-
|
|
2499
|
+
k("path", {
|
|
2500
2500
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2501
2501
|
})
|
|
2502
2502
|
), e;
|
|
@@ -2509,15 +2509,15 @@ function pe(e, t, n, o, i, r) {
|
|
|
2509
2509
|
fill: o,
|
|
2510
2510
|
"aria-hidden": "true"
|
|
2511
2511
|
};
|
|
2512
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2512
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), k("svg", l);
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2515
|
-
const n = document.createElementNS(
|
|
2514
|
+
function k(e, t = {}) {
|
|
2515
|
+
const n = document.createElementNS(wo, e);
|
|
2516
2516
|
for (const [o, i] of Object.entries(t))
|
|
2517
2517
|
n.setAttribute(o, i);
|
|
2518
2518
|
return n;
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2520
|
+
function Xn(e) {
|
|
2521
2521
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2522
2522
|
e.addEventListener(t, (n) => {
|
|
2523
2523
|
n.stopPropagation();
|
|
@@ -2535,7 +2535,7 @@ function ja(e, t, n) {
|
|
|
2535
2535
|
}
|
|
2536
2536
|
}
|
|
2537
2537
|
function Va(e) {
|
|
2538
|
-
const t =
|
|
2538
|
+
const t = un(e), n = To(e);
|
|
2539
2539
|
if (t === "image" && n) {
|
|
2540
2540
|
const o = document.createElement("img");
|
|
2541
2541
|
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(re(e))), o;
|
|
@@ -2547,7 +2547,7 @@ function Va(e) {
|
|
|
2547
2547
|
return re(e);
|
|
2548
2548
|
}
|
|
2549
2549
|
function Ka(e) {
|
|
2550
|
-
const t =
|
|
2550
|
+
const t = un(e), n = To(e);
|
|
2551
2551
|
if (t === "image" && n) {
|
|
2552
2552
|
const o = document.createElement("img");
|
|
2553
2553
|
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o;
|
|
@@ -2565,23 +2565,23 @@ function Ka(e) {
|
|
|
2565
2565
|
function re(e, t = "composer") {
|
|
2566
2566
|
if (t === "composer") {
|
|
2567
2567
|
const r = document.createElement("span");
|
|
2568
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2568
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = Zn(e), r;
|
|
2569
2569
|
}
|
|
2570
2570
|
const n = document.createElement("div");
|
|
2571
2571
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2572
2572
|
const o = document.createElement("span");
|
|
2573
|
-
o.textContent =
|
|
2573
|
+
o.textContent = Zn(e);
|
|
2574
2574
|
const i = document.createElement("strong");
|
|
2575
2575
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2576
2576
|
}
|
|
2577
|
-
function
|
|
2577
|
+
function un(e) {
|
|
2578
2578
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2580
|
+
function To(e) {
|
|
2581
2581
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2582
2582
|
}
|
|
2583
|
-
function
|
|
2584
|
-
const t =
|
|
2583
|
+
function Zn(e) {
|
|
2584
|
+
const t = un(e);
|
|
2585
2585
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2586
2586
|
}
|
|
2587
2587
|
function Ya(e, t) {
|
|
@@ -2593,17 +2593,17 @@ function Ya(e, t) {
|
|
|
2593
2593
|
function Xa(e) {
|
|
2594
2594
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2595
2595
|
}
|
|
2596
|
-
function
|
|
2596
|
+
function ut(e) {
|
|
2597
2597
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2598
2598
|
}
|
|
2599
|
-
function
|
|
2600
|
-
if (!e || !
|
|
2599
|
+
function Yt(e, t, n = null) {
|
|
2600
|
+
if (!e || !ln(t, n)) {
|
|
2601
2601
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2602
2602
|
return;
|
|
2603
2603
|
}
|
|
2604
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) ||
|
|
2604
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || gn(n) ? e.appendChild(
|
|
2605
2605
|
Za(t, n)
|
|
2606
|
-
) :
|
|
2606
|
+
) : Io(t) && e.appendChild(Ja(t));
|
|
2607
2607
|
}
|
|
2608
2608
|
function Za(e, t) {
|
|
2609
2609
|
const n = document.createElement("div");
|
|
@@ -2612,7 +2612,7 @@ function Za(e, t) {
|
|
|
2612
2612
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2613
2613
|
const r = document.createElement("span");
|
|
2614
2614
|
return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
|
|
2615
|
-
|
|
2615
|
+
Ao(
|
|
2616
2616
|
e,
|
|
2617
2617
|
"Upgrade plan",
|
|
2618
2618
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -2626,18 +2626,18 @@ function Ja(e) {
|
|
|
2626
2626
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2627
2627
|
const o = document.createElement("span");
|
|
2628
2628
|
return o.textContent = er(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2629
|
-
|
|
2629
|
+
Ao(
|
|
2630
2630
|
e,
|
|
2631
2631
|
"Upgrade",
|
|
2632
2632
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2633
2633
|
)
|
|
2634
2634
|
), t;
|
|
2635
2635
|
}
|
|
2636
|
-
function
|
|
2637
|
-
return e !== null && (le(e) ||
|
|
2636
|
+
function ln(e, t) {
|
|
2637
|
+
return e !== null && (le(e) || Io(e) || gn(t));
|
|
2638
2638
|
}
|
|
2639
|
-
function
|
|
2640
|
-
return
|
|
2639
|
+
function Jn(e, t, n) {
|
|
2640
|
+
return ln(t, n) || Qa(t) ? !0 : !ln(e, n);
|
|
2641
2641
|
}
|
|
2642
2642
|
function Qa(e) {
|
|
2643
2643
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
|
|
@@ -2645,10 +2645,10 @@ function Qa(e) {
|
|
|
2645
2645
|
function le(e) {
|
|
2646
2646
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2647
2647
|
}
|
|
2648
|
-
function
|
|
2648
|
+
function gn(e) {
|
|
2649
2649
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2651
|
+
function Io(e) {
|
|
2652
2652
|
return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2653
2653
|
}
|
|
2654
2654
|
function er(e) {
|
|
@@ -2659,15 +2659,15 @@ function tr(e) {
|
|
|
2659
2659
|
maximumFractionDigits: 0
|
|
2660
2660
|
}).format(Math.ceil(e));
|
|
2661
2661
|
}
|
|
2662
|
-
function
|
|
2662
|
+
function Ao(e, t, n) {
|
|
2663
2663
|
const o = document.createElement("div");
|
|
2664
2664
|
return o.className = n, o.appendChild(
|
|
2665
|
-
|
|
2665
|
+
Qn(t, e.pricingUrl)
|
|
2666
2666
|
), o.appendChild(
|
|
2667
|
-
|
|
2667
|
+
Qn("Earn credits", e.earnCreditsUrl)
|
|
2668
2668
|
), o;
|
|
2669
2669
|
}
|
|
2670
|
-
function
|
|
2670
|
+
function Qn(e, t) {
|
|
2671
2671
|
const n = document.createElement("button");
|
|
2672
2672
|
if (n.type = "button", e === "Earn credits") {
|
|
2673
2673
|
const o = document.createElement("span");
|
|
@@ -2678,129 +2678,131 @@ function Jn(e, t) {
|
|
|
2678
2678
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2679
2679
|
}), n;
|
|
2680
2680
|
}
|
|
2681
|
-
function
|
|
2681
|
+
function Xt(e, t) {
|
|
2682
2682
|
return e.messages.filter(
|
|
2683
|
-
(o) => !
|
|
2683
|
+
(o) => !No(o)
|
|
2684
2684
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2685
2685
|
}
|
|
2686
|
-
function nr(e, t, n, o, i, r, l, p, s, c, u, m,
|
|
2687
|
-
const
|
|
2688
|
-
(x) => !
|
|
2689
|
-
),
|
|
2690
|
-
|
|
2686
|
+
function nr(e, t, n, o, i, r, l, p, s, c, u, m, L, v, D, C, g, y, h, E) {
|
|
2687
|
+
const N = rr(r), I = N.filter(
|
|
2688
|
+
(x) => !No(x)
|
|
2689
|
+
), G = e.scrollTop, ye = [], He = /* @__PURE__ */ new Set(), M = (x) => {
|
|
2690
|
+
ye.push(x);
|
|
2691
2691
|
};
|
|
2692
|
-
|
|
2693
|
-
const We =
|
|
2694
|
-
if (o(We), g ||
|
|
2692
|
+
Do(n, r.isThinking), i.hidden = !p, p && l !== null && So(i, l);
|
|
2693
|
+
const We = I.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2694
|
+
if (o(We), g || I.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2695
2695
|
const x = document.createElement("div");
|
|
2696
2696
|
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2699
|
-
const
|
|
2697
|
+
const S = document.createElement("div");
|
|
2698
|
+
S.className = "pluno-pa-widget__empty-hero";
|
|
2699
|
+
const j = xe(
|
|
2700
2700
|
"pluno-pa-widget__character--empty",
|
|
2701
2701
|
v()
|
|
2702
2702
|
);
|
|
2703
|
-
if (
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2703
|
+
if (S.appendChild(j), x.appendChild(S), g) {
|
|
2704
|
+
const P = document.createElement("h2");
|
|
2705
|
+
P.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", P.textContent = g.opening, x.appendChild(P);
|
|
2706
2706
|
} else
|
|
2707
|
-
x.appendChild(
|
|
2708
|
-
const
|
|
2709
|
-
if (
|
|
2710
|
-
for (const
|
|
2707
|
+
x.appendChild(Co());
|
|
2708
|
+
const V = g?.prompts ?? r.starterPrompts, J = document.createElement("div");
|
|
2709
|
+
if (J.className = V.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", V.length === 0 && !r.starterPromptsLoading && J.setAttribute("aria-hidden", "true"), V.length > 0)
|
|
2710
|
+
for (const P of V) {
|
|
2711
2711
|
const R = document.createElement("button");
|
|
2712
|
-
R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${
|
|
2713
|
-
D(
|
|
2714
|
-
}),
|
|
2712
|
+
R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${P}"`, R.addEventListener("click", () => {
|
|
2713
|
+
D(P);
|
|
2714
|
+
}), J.appendChild(R);
|
|
2715
2715
|
}
|
|
2716
2716
|
else if (r.starterPromptsLoading) {
|
|
2717
|
-
const
|
|
2718
|
-
|
|
2717
|
+
const P = document.createElement("button");
|
|
2718
|
+
P.type = "button", P.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", P.disabled = !0, P.tabIndex = -1, P.textContent = "Generating example tasks...", J.appendChild(P);
|
|
2719
2719
|
} else
|
|
2720
|
-
for (let
|
|
2720
|
+
for (let P = 0; P < Ui; P += 1) {
|
|
2721
2721
|
const R = document.createElement("button");
|
|
2722
|
-
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "",
|
|
2722
|
+
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "", J.appendChild(R);
|
|
2723
2723
|
}
|
|
2724
|
-
if (x.appendChild(
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2724
|
+
if (x.appendChild(J), g) {
|
|
2725
|
+
const P = document.createElement("button");
|
|
2726
|
+
P.type = "button", P.className = "pluno-pa-widget__morning-report-snooze", P.textContent = "Snooze morning report", P.addEventListener("click", y), x.appendChild(P);
|
|
2727
2727
|
}
|
|
2728
|
-
m.clear(),
|
|
2728
|
+
m.clear(), M(x), M(t), eo(e, ye);
|
|
2729
2729
|
return;
|
|
2730
2730
|
}
|
|
2731
|
-
let w = null,
|
|
2732
|
-
const
|
|
2733
|
-
if (
|
|
2731
|
+
let w = null, O = null, ve = [];
|
|
2732
|
+
const se = I.length - 1, ot = se >= 0 && pn(I[se]), $ = () => {
|
|
2733
|
+
if (ve.length === 0)
|
|
2734
2734
|
return !1;
|
|
2735
2735
|
const x = fr(
|
|
2736
|
-
|
|
2736
|
+
ve,
|
|
2737
2737
|
u,
|
|
2738
|
-
|
|
2738
|
+
L,
|
|
2739
2739
|
v()
|
|
2740
2740
|
);
|
|
2741
|
-
return
|
|
2741
|
+
return M(x), w = null, O = x, ve = [], !0;
|
|
2742
2742
|
};
|
|
2743
|
-
for (let x = 0; x <
|
|
2744
|
-
const
|
|
2745
|
-
if (
|
|
2746
|
-
|
|
2743
|
+
for (let x = 0; x < I.length; x += 1) {
|
|
2744
|
+
const S = I[x];
|
|
2745
|
+
if (S.role === "tool") {
|
|
2746
|
+
ve.push(S);
|
|
2747
2747
|
continue;
|
|
2748
2748
|
}
|
|
2749
|
-
if (
|
|
2750
|
-
if (
|
|
2751
|
-
|
|
2752
|
-
|
|
2749
|
+
if (pn(S)) {
|
|
2750
|
+
if (x !== se)
|
|
2751
|
+
continue;
|
|
2752
|
+
if ($()) {
|
|
2753
|
+
const R = _t();
|
|
2754
|
+
M(R), w = null, O = R;
|
|
2753
2755
|
} else {
|
|
2754
|
-
const R =
|
|
2755
|
-
|
|
2756
|
+
const R = oo(v());
|
|
2757
|
+
M(R), w = null, O = R;
|
|
2756
2758
|
}
|
|
2757
2759
|
continue;
|
|
2758
2760
|
}
|
|
2759
|
-
if (
|
|
2761
|
+
if (S.role === "system")
|
|
2760
2762
|
continue;
|
|
2761
|
-
const
|
|
2762
|
-
if (
|
|
2763
|
-
const
|
|
2764
|
-
|
|
2763
|
+
const j = $(), V = mr(S.content);
|
|
2764
|
+
if (S.role === "assistant" && !j) {
|
|
2765
|
+
const P = Ro(v());
|
|
2766
|
+
M(P), w = null, O = P;
|
|
2765
2767
|
}
|
|
2766
|
-
const
|
|
2767
|
-
|
|
2768
|
+
const J = or(S, V, m, He);
|
|
2769
|
+
M(J), w = J, O = null;
|
|
2768
2770
|
}
|
|
2769
|
-
const
|
|
2770
|
-
if (r.isThinking && !
|
|
2771
|
-
if (
|
|
2772
|
-
const x =
|
|
2773
|
-
|
|
2771
|
+
const it = $(), Ae = I[I.length - 1]?.id === "assistant-draft";
|
|
2772
|
+
if (r.isThinking && !Ae && !ot)
|
|
2773
|
+
if (it) {
|
|
2774
|
+
const x = _t();
|
|
2775
|
+
M(x), w = null, O = x;
|
|
2774
2776
|
} else {
|
|
2775
|
-
const x =
|
|
2776
|
-
|
|
2777
|
+
const x = oo(v());
|
|
2778
|
+
M(x), w = null, O = x;
|
|
2777
2779
|
}
|
|
2778
2780
|
if (r.lastError) {
|
|
2779
2781
|
const x = document.createElement("div");
|
|
2780
2782
|
x.className = "pluno-pa-widget__error";
|
|
2781
|
-
const
|
|
2782
|
-
if (
|
|
2783
|
-
const
|
|
2784
|
-
|
|
2783
|
+
const S = document.createElement("span");
|
|
2784
|
+
if (S.textContent = r.lastError, x.appendChild(S), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
2785
|
+
const j = document.createElement("button");
|
|
2786
|
+
j.type = "button", j.className = "pluno-pa-widget__error-retry", j.textContent = "Try again", j.addEventListener(
|
|
2785
2787
|
"click",
|
|
2786
2788
|
r.lastErrorCode === "connection_failed" ? h : C
|
|
2787
|
-
), x.appendChild(
|
|
2789
|
+
), x.appendChild(j);
|
|
2788
2790
|
}
|
|
2789
|
-
|
|
2791
|
+
M(x), w = x, O = null;
|
|
2790
2792
|
}
|
|
2791
|
-
const
|
|
2792
|
-
if (
|
|
2793
|
-
const x = sr(
|
|
2794
|
-
isDrafting:
|
|
2795
|
-
error:
|
|
2796
|
-
characterIconOptions:
|
|
2797
|
-
onDraft:
|
|
2798
|
-
onDismiss:
|
|
2799
|
-
onDisable:
|
|
2793
|
+
const oe = E && !r.isThinking ? si(N) : null;
|
|
2794
|
+
if (E && oe && !E.dismissedCandidateIds.has(oe.id)) {
|
|
2795
|
+
const x = sr(oe, {
|
|
2796
|
+
isDrafting: E.draftingCandidateId === oe.id,
|
|
2797
|
+
error: E.error,
|
|
2798
|
+
characterIconOptions: E.characterIconOptions,
|
|
2799
|
+
onDraft: E.onDraft,
|
|
2800
|
+
onDismiss: E.onDismiss,
|
|
2801
|
+
onDisable: E.onDisable
|
|
2800
2802
|
});
|
|
2801
|
-
|
|
2803
|
+
M(x), E.onSeen(oe), w = null, O = x;
|
|
2802
2804
|
}
|
|
2803
|
-
w?.classList.add("pluno-pa-widget__message--bottom-reserve"),
|
|
2805
|
+
w?.classList.add("pluno-pa-widget__message--bottom-reserve"), O?.classList.add("pluno-pa-widget__bottom-reserve-compact"), M(t), ar(m, He), eo(e, ye), s ? tt(e, c) : e.scrollTop = G;
|
|
2804
2806
|
}
|
|
2805
2807
|
function or(e, t, n, o) {
|
|
2806
2808
|
const i = ir(e, t), r = i ? n.get(i) : void 0;
|
|
@@ -2833,7 +2835,7 @@ function ar(e, t) {
|
|
|
2833
2835
|
for (const n of e.keys())
|
|
2834
2836
|
t.has(n) || e.delete(n);
|
|
2835
2837
|
}
|
|
2836
|
-
function
|
|
2838
|
+
function eo(e, t) {
|
|
2837
2839
|
let n = e.firstChild;
|
|
2838
2840
|
for (const o of t) {
|
|
2839
2841
|
if (o === n) {
|
|
@@ -2867,7 +2869,7 @@ function rr(e) {
|
|
|
2867
2869
|
if (n === -1)
|
|
2868
2870
|
return [...e.messages, t];
|
|
2869
2871
|
const o = e.messages.findIndex(
|
|
2870
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2872
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && to(r, t) && pn(r)
|
|
2871
2873
|
);
|
|
2872
2874
|
if (o !== -1)
|
|
2873
2875
|
return [
|
|
@@ -2876,7 +2878,7 @@ function rr(e) {
|
|
|
2876
2878
|
...e.messages.slice(o + 1)
|
|
2877
2879
|
];
|
|
2878
2880
|
let i = n + 1;
|
|
2879
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2881
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && to(e.messages[i], t); )
|
|
2880
2882
|
i += 1;
|
|
2881
2883
|
return [
|
|
2882
2884
|
...e.messages.slice(0, i),
|
|
@@ -2884,17 +2886,17 @@ function rr(e) {
|
|
|
2884
2886
|
...e.messages.slice(i)
|
|
2885
2887
|
];
|
|
2886
2888
|
}
|
|
2887
|
-
function
|
|
2889
|
+
function pn(e) {
|
|
2888
2890
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2889
2891
|
}
|
|
2890
|
-
function
|
|
2892
|
+
function to(e, t) {
|
|
2891
2893
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2892
2894
|
}
|
|
2893
|
-
function
|
|
2894
|
-
e.replaceChildren(),
|
|
2895
|
+
function no(e, t, n, o, i, r, l, p) {
|
|
2896
|
+
e.replaceChildren(), Do(t, !1), t.disabled = !0, n(!1);
|
|
2895
2897
|
const s = document.createElement("div");
|
|
2896
2898
|
s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2897
|
-
const c =
|
|
2899
|
+
const c = xe(
|
|
2898
2900
|
"pluno-pa-widget__character--empty",
|
|
2899
2901
|
o()
|
|
2900
2902
|
);
|
|
@@ -2927,7 +2929,7 @@ function sr(e, t) {
|
|
|
2927
2929
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2928
2930
|
const o = document.createElement("div");
|
|
2929
2931
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2930
|
-
|
|
2932
|
+
xe(
|
|
2931
2933
|
"pluno-pa-widget__share-prompt-icon",
|
|
2932
2934
|
t.characterIconOptions
|
|
2933
2935
|
)
|
|
@@ -2949,7 +2951,7 @@ function sr(e, t) {
|
|
|
2949
2951
|
const c = document.createElement("button");
|
|
2950
2952
|
if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
|
|
2951
2953
|
t.onDraft(e);
|
|
2952
|
-
}), t.isDrafting ? (c.appendChild(
|
|
2954
|
+
}), t.isDrafting ? (c.appendChild(sn()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", s.appendChild(c), t.isDrafting)
|
|
2953
2955
|
p.appendChild(s);
|
|
2954
2956
|
else {
|
|
2955
2957
|
const u = document.createElement("button");
|
|
@@ -2999,19 +3001,19 @@ function dr(e, t) {
|
|
|
2999
3001
|
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), s.appendChild(g);
|
|
3000
3002
|
}
|
|
3001
3003
|
o.appendChild(s), o.appendChild(p);
|
|
3002
|
-
const
|
|
3003
|
-
|
|
3004
|
+
const L = document.createElement("div");
|
|
3005
|
+
L.className = "pluno-pa-widget__share-dialog-step";
|
|
3004
3006
|
const v = document.createElement("strong");
|
|
3005
|
-
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on",
|
|
3007
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", L.appendChild(v);
|
|
3006
3008
|
const D = document.createElement("p");
|
|
3007
|
-
D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.",
|
|
3009
|
+
D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.", L.appendChild(D);
|
|
3008
3010
|
const C = document.createElement("footer");
|
|
3009
3011
|
C.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3010
3012
|
for (const g of ur(e)) {
|
|
3011
3013
|
const y = document.createElement("a");
|
|
3012
3014
|
y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(gr(g.id)), C.appendChild(y);
|
|
3013
3015
|
}
|
|
3014
|
-
if (
|
|
3016
|
+
if (L.appendChild(C), o.appendChild(L), t.socialPostRewardsUrl) {
|
|
3015
3017
|
const g = document.createElement("div");
|
|
3016
3018
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
3017
3019
|
const y = document.createElement("strong");
|
|
@@ -3049,40 +3051,40 @@ function ur(e) {
|
|
|
3049
3051
|
}
|
|
3050
3052
|
function gr(e) {
|
|
3051
3053
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3052
|
-
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" ? (
|
|
3054
|
+
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" ? (W(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), W(
|
|
3053
3055
|
t,
|
|
3054
3056
|
"M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"
|
|
3055
|
-
),
|
|
3057
|
+
), W(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), W(
|
|
3056
3058
|
t,
|
|
3057
3059
|
"M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"
|
|
3058
|
-
),
|
|
3060
|
+
), W(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (W(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), W(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), W(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (W(
|
|
3059
3061
|
t,
|
|
3060
3062
|
"M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"
|
|
3061
|
-
),
|
|
3063
|
+
), W(
|
|
3062
3064
|
t,
|
|
3063
3065
|
"M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1",
|
|
3064
3066
|
"0.48"
|
|
3065
|
-
),
|
|
3067
|
+
), W(
|
|
3066
3068
|
t,
|
|
3067
3069
|
"M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"
|
|
3068
|
-
),
|
|
3070
|
+
), W(
|
|
3069
3071
|
t,
|
|
3070
3072
|
"M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"
|
|
3071
3073
|
), t);
|
|
3072
3074
|
}
|
|
3073
|
-
function
|
|
3075
|
+
function W(e, t, n) {
|
|
3074
3076
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3075
3077
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3076
3078
|
}
|
|
3077
3079
|
function hr() {
|
|
3078
3080
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3079
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3081
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), W(e, "M14 5h5v5"), W(e, "M19 5l-8 8"), W(
|
|
3080
3082
|
e,
|
|
3081
3083
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3082
3084
|
), e;
|
|
3083
3085
|
}
|
|
3084
|
-
function
|
|
3085
|
-
return e.role === "tool" && e.toolName ===
|
|
3086
|
+
function No(e) {
|
|
3087
|
+
return e.role === "tool" && e.toolName === co;
|
|
3086
3088
|
}
|
|
3087
3089
|
function mr(e) {
|
|
3088
3090
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
@@ -3092,7 +3094,7 @@ function fr(e, t, n, o) {
|
|
|
3092
3094
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3093
3095
|
e[e.length - 1].createdAt
|
|
3094
3096
|
).toLocaleString(), i.appendChild(
|
|
3095
|
-
|
|
3097
|
+
xe(
|
|
3096
3098
|
"pluno-pa-widget__character--tool-group",
|
|
3097
3099
|
o
|
|
3098
3100
|
)
|
|
@@ -3102,35 +3104,35 @@ function fr(e, t, n, o) {
|
|
|
3102
3104
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3103
3105
|
});
|
|
3104
3106
|
const p = document.createElement("summary");
|
|
3105
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(
|
|
3107
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(sn());
|
|
3106
3108
|
const c = document.createElement("span");
|
|
3107
3109
|
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
|
|
3108
3110
|
const u = document.createElement("div");
|
|
3109
3111
|
u.className = "pluno-pa-widget__tool-lines";
|
|
3110
3112
|
for (const m of e) {
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3113
|
+
const L = document.createElement("div");
|
|
3114
|
+
L.className = "pluno-pa-widget__tool-line", m.loading && L.appendChild(sn());
|
|
3113
3115
|
const v = document.createElement("span");
|
|
3114
|
-
v.textContent = m.content || "Run tool",
|
|
3116
|
+
v.textContent = m.content || "Run tool", L.appendChild(v), u.appendChild(L);
|
|
3115
3117
|
}
|
|
3116
3118
|
r.appendChild(u);
|
|
3117
3119
|
}
|
|
3118
3120
|
return i.appendChild(r), i;
|
|
3119
3121
|
}
|
|
3120
|
-
function
|
|
3122
|
+
function Ro(e) {
|
|
3121
3123
|
const t = document.createElement("article");
|
|
3122
3124
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3123
|
-
|
|
3125
|
+
xe(
|
|
3124
3126
|
"pluno-pa-widget__character--tool-group",
|
|
3125
3127
|
e
|
|
3126
3128
|
)
|
|
3127
3129
|
), t;
|
|
3128
3130
|
}
|
|
3129
|
-
function
|
|
3130
|
-
const t =
|
|
3131
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3131
|
+
function oo(e) {
|
|
3132
|
+
const t = Ro(e);
|
|
3133
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(_t()), t;
|
|
3132
3134
|
}
|
|
3133
|
-
function
|
|
3135
|
+
function _t(e = "Thinking...") {
|
|
3134
3136
|
const t = document.createElement("div");
|
|
3135
3137
|
t.className = "pluno-pa-widget__status";
|
|
3136
3138
|
const n = document.createElement("span");
|
|
@@ -3141,12 +3143,12 @@ function bt(e = "Thinking...") {
|
|
|
3141
3143
|
function wr(e) {
|
|
3142
3144
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3143
3145
|
}
|
|
3144
|
-
function
|
|
3146
|
+
function sn() {
|
|
3145
3147
|
const e = document.createElement("span");
|
|
3146
3148
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3147
3149
|
}
|
|
3148
|
-
function
|
|
3149
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ga() :
|
|
3150
|
+
function Do(e, t) {
|
|
3151
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ga() : Po());
|
|
3150
3152
|
}
|
|
3151
3153
|
function br(e, t) {
|
|
3152
3154
|
const n = t.replace(/\r\n/g, `
|
|
@@ -3172,14 +3174,14 @@ function br(e, t) {
|
|
|
3172
3174
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3173
3175
|
if (l) {
|
|
3174
3176
|
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3175
|
-
|
|
3177
|
+
gt(c, l[2]), e.appendChild(c), o += 1;
|
|
3176
3178
|
continue;
|
|
3177
3179
|
}
|
|
3178
3180
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3179
3181
|
const c = document.createElement("ul");
|
|
3180
3182
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3181
3183
|
const u = document.createElement("li");
|
|
3182
|
-
|
|
3184
|
+
gt(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
|
|
3183
3185
|
}
|
|
3184
3186
|
e.appendChild(c);
|
|
3185
3187
|
continue;
|
|
@@ -3188,7 +3190,7 @@ function br(e, t) {
|
|
|
3188
3190
|
const c = document.createElement("ol");
|
|
3189
3191
|
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3190
3192
|
const u = document.createElement("li");
|
|
3191
|
-
|
|
3193
|
+
gt(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
|
|
3192
3194
|
}
|
|
3193
3195
|
e.appendChild(c);
|
|
3194
3196
|
continue;
|
|
@@ -3198,11 +3200,11 @@ function br(e, t) {
|
|
|
3198
3200
|
p.push(n[o]), o += 1;
|
|
3199
3201
|
const s = document.createElement("p");
|
|
3200
3202
|
p.forEach((c, u) => {
|
|
3201
|
-
u > 0 && s.appendChild(document.createElement("br")),
|
|
3203
|
+
u > 0 && s.appendChild(document.createElement("br")), gt(s, c);
|
|
3202
3204
|
}), e.appendChild(s);
|
|
3203
3205
|
}
|
|
3204
3206
|
}
|
|
3205
|
-
function
|
|
3207
|
+
function gt(e, t) {
|
|
3206
3208
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3207
3209
|
let o = 0;
|
|
3208
3210
|
for (const i of t.matchAll(n)) {
|
|
@@ -3242,7 +3244,7 @@ function _r(e) {
|
|
|
3242
3244
|
return !1;
|
|
3243
3245
|
}
|
|
3244
3246
|
}
|
|
3245
|
-
function
|
|
3247
|
+
function io(e, t) {
|
|
3246
3248
|
if (xr(e))
|
|
3247
3249
|
return;
|
|
3248
3250
|
const n = `
|
|
@@ -5198,8 +5200,8 @@ function oo(e, t) {
|
|
|
5198
5200
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5199
5201
|
position: absolute;
|
|
5200
5202
|
top: -16px;
|
|
5201
|
-
left: ${
|
|
5202
|
-
width: calc(100% - ${
|
|
5203
|
+
left: ${nn}px;
|
|
5204
|
+
width: calc(100% - ${nn * 2}px);
|
|
5203
5205
|
height: 36px;
|
|
5204
5206
|
z-index: 3;
|
|
5205
5207
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5554,20 +5556,20 @@ function oo(e, t) {
|
|
|
5554
5556
|
if (yr(e, n))
|
|
5555
5557
|
return;
|
|
5556
5558
|
const o = e.ownerDocument.createElement("style");
|
|
5557
|
-
o.id =
|
|
5559
|
+
o.id = xo, o.textContent = n, e.appendChild(o), Mo(e);
|
|
5558
5560
|
}
|
|
5559
5561
|
function xr(e) {
|
|
5560
|
-
return e.getElementById(
|
|
5562
|
+
return e.getElementById(xo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(yo) === "true";
|
|
5561
5563
|
}
|
|
5562
|
-
function
|
|
5563
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5564
|
+
function Mo(e) {
|
|
5565
|
+
e.host instanceof HTMLElement && e.host.setAttribute(yo, "true");
|
|
5564
5566
|
}
|
|
5565
5567
|
function yr(e, t) {
|
|
5566
5568
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5567
5569
|
return !1;
|
|
5568
5570
|
try {
|
|
5569
5571
|
const n = new CSSStyleSheet();
|
|
5570
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
5572
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Mo(e), !0;
|
|
5571
5573
|
} catch {
|
|
5572
5574
|
return !1;
|
|
5573
5575
|
}
|
|
@@ -5580,7 +5582,7 @@ async function vr() {
|
|
|
5580
5582
|
t.observe(document.documentElement, { childList: !0 });
|
|
5581
5583
|
});
|
|
5582
5584
|
}
|
|
5583
|
-
function
|
|
5585
|
+
function zo(e) {
|
|
5584
5586
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5585
5587
|
}
|
|
5586
5588
|
function Cr(e) {
|
|
@@ -5588,9 +5590,9 @@ function Cr(e) {
|
|
|
5588
5590
|
return { clientId: e, release: () => {
|
|
5589
5591
|
} };
|
|
5590
5592
|
let t = 0;
|
|
5591
|
-
for (;
|
|
5593
|
+
for (; Ht.has(t); )
|
|
5592
5594
|
t += 1;
|
|
5593
|
-
|
|
5595
|
+
Ht.add(t);
|
|
5594
5596
|
const n = `${zi}${t}`;
|
|
5595
5597
|
let o = crypto.randomUUID();
|
|
5596
5598
|
try {
|
|
@@ -5601,15 +5603,15 @@ function Cr(e) {
|
|
|
5601
5603
|
return {
|
|
5602
5604
|
clientId: o,
|
|
5603
5605
|
release: () => {
|
|
5604
|
-
i || (i = !0,
|
|
5606
|
+
i || (i = !0, Ht.delete(t));
|
|
5605
5607
|
}
|
|
5606
5608
|
};
|
|
5607
5609
|
}
|
|
5608
5610
|
function Sr(e) {
|
|
5609
5611
|
try {
|
|
5610
|
-
const t = window.localStorage.getItem(
|
|
5612
|
+
const t = window.localStorage.getItem(zo(e));
|
|
5611
5613
|
if (!t)
|
|
5612
|
-
return
|
|
5614
|
+
return ao();
|
|
5613
5615
|
const n = JSON.parse(t);
|
|
5614
5616
|
return {
|
|
5615
5617
|
isOpen: n.isOpen === !0,
|
|
@@ -5620,19 +5622,19 @@ function Sr(e) {
|
|
|
5620
5622
|
(o) => typeof o == "string"
|
|
5621
5623
|
) : [],
|
|
5622
5624
|
launcherPosition: Pr(n.launcherPosition) ? n.launcherPosition : null,
|
|
5623
|
-
panelSize: Tr(n.panelSize) ?
|
|
5624
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
5625
|
+
panelSize: Tr(n.panelSize) ? xt(n.panelSize) : null,
|
|
5626
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-uo) : [],
|
|
5625
5627
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5626
5628
|
};
|
|
5627
5629
|
} catch {
|
|
5628
|
-
return
|
|
5630
|
+
return ao();
|
|
5629
5631
|
}
|
|
5630
5632
|
}
|
|
5631
5633
|
async function Er(e) {
|
|
5632
5634
|
if (e.loadSharePromptsDisabled)
|
|
5633
5635
|
return e.loadSharePromptsDisabled();
|
|
5634
5636
|
try {
|
|
5635
|
-
return window.localStorage.getItem(
|
|
5637
|
+
return window.localStorage.getItem(ho) === "true";
|
|
5636
5638
|
} catch {
|
|
5637
5639
|
return !1;
|
|
5638
5640
|
}
|
|
@@ -5646,12 +5648,12 @@ function kr(e, t) {
|
|
|
5646
5648
|
return;
|
|
5647
5649
|
}
|
|
5648
5650
|
try {
|
|
5649
|
-
t && window.localStorage.setItem(
|
|
5651
|
+
t && window.localStorage.setItem(ho, "true");
|
|
5650
5652
|
} catch {
|
|
5651
5653
|
return;
|
|
5652
5654
|
}
|
|
5653
5655
|
}
|
|
5654
|
-
function
|
|
5656
|
+
function ao() {
|
|
5655
5657
|
return {
|
|
5656
5658
|
isOpen: !1,
|
|
5657
5659
|
composerValue: "",
|
|
@@ -5667,7 +5669,7 @@ function io() {
|
|
|
5667
5669
|
function Lr(e, t) {
|
|
5668
5670
|
try {
|
|
5669
5671
|
window.localStorage.setItem(
|
|
5670
|
-
|
|
5672
|
+
zo(e),
|
|
5671
5673
|
JSON.stringify(t)
|
|
5672
5674
|
);
|
|
5673
5675
|
} catch {
|
|
@@ -5686,7 +5688,7 @@ function Tr(e) {
|
|
|
5686
5688
|
const t = e;
|
|
5687
5689
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5688
5690
|
}
|
|
5689
|
-
async function
|
|
5691
|
+
async function Oo(e, t) {
|
|
5690
5692
|
const n = await fetch(e, {
|
|
5691
5693
|
method: "POST",
|
|
5692
5694
|
credentials: "include",
|
|
@@ -5713,7 +5715,7 @@ function Ir(e) {
|
|
|
5713
5715
|
let r = !1;
|
|
5714
5716
|
const l = new Promise((p, s) => {
|
|
5715
5717
|
const c = window.setTimeout(() => {
|
|
5716
|
-
r = !0, i.abort(), s(new Error(
|
|
5718
|
+
r = !0, i.abort(), s(new Error(Mn));
|
|
5717
5719
|
}, Di);
|
|
5718
5720
|
i.signal.addEventListener(
|
|
5719
5721
|
"abort",
|
|
@@ -5723,12 +5725,12 @@ function Ir(e) {
|
|
|
5723
5725
|
});
|
|
5724
5726
|
try {
|
|
5725
5727
|
const p = await Promise.race([
|
|
5726
|
-
|
|
5728
|
+
Oo(e, i.signal),
|
|
5727
5729
|
l
|
|
5728
5730
|
]);
|
|
5729
5731
|
return i.abort(), p;
|
|
5730
5732
|
} catch (p) {
|
|
5731
|
-
throw i.abort(), r ? new Error(
|
|
5733
|
+
throw i.abort(), r ? new Error(Mn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(Mi);
|
|
5732
5734
|
}
|
|
5733
5735
|
};
|
|
5734
5736
|
return {
|
|
@@ -5751,32 +5753,32 @@ function Ir(e) {
|
|
|
5751
5753
|
}
|
|
5752
5754
|
};
|
|
5753
5755
|
}
|
|
5754
|
-
const
|
|
5756
|
+
const ro = /* @__PURE__ */ new WeakSet();
|
|
5755
5757
|
function Ar(e) {
|
|
5756
5758
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5757
5759
|
}
|
|
5758
|
-
function
|
|
5760
|
+
function lo(e) {
|
|
5759
5761
|
const t = e.pathname.split("/");
|
|
5760
5762
|
return t[t.length - 1] ?? "";
|
|
5761
5763
|
}
|
|
5762
5764
|
function Nr(e, t) {
|
|
5763
5765
|
const n = new URL(e.src, document.baseURI);
|
|
5764
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5766
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : lo(n) === lo(t);
|
|
5765
5767
|
}
|
|
5766
|
-
class
|
|
5768
|
+
class he extends EventTarget {
|
|
5767
5769
|
constructor(t, n) {
|
|
5768
5770
|
super(), this.channelId = n, this.url = t, this.addPreviewListener(Ti, () => {
|
|
5769
|
-
this.readyState =
|
|
5771
|
+
this.readyState = he.OPEN, this.dispatchEvent(new Event("open"));
|
|
5770
5772
|
}), this.addPreviewListener(Ii, (o) => {
|
|
5771
5773
|
const i = o;
|
|
5772
5774
|
this.dispatchEvent(
|
|
5773
5775
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5774
5776
|
);
|
|
5775
5777
|
}), this.addPreviewListener(Ai, () => {
|
|
5776
|
-
this.readyState =
|
|
5778
|
+
this.readyState = he.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5777
5779
|
}), this.addPreviewListener(Ni, (o) => {
|
|
5778
5780
|
const i = o;
|
|
5779
|
-
this.readyState =
|
|
5781
|
+
this.readyState = he.CLOSED, this.dispatchEvent(
|
|
5780
5782
|
new CloseEvent("close", {
|
|
5781
5783
|
code: i.detail?.code ?? 1e3,
|
|
5782
5784
|
reason: i.detail?.reason ?? "",
|
|
@@ -5785,7 +5787,7 @@ class ge extends EventTarget {
|
|
|
5785
5787
|
), this.cleanup();
|
|
5786
5788
|
}), window.dispatchEvent(
|
|
5787
5789
|
new CustomEvent(
|
|
5788
|
-
|
|
5790
|
+
ht(
|
|
5789
5791
|
ki,
|
|
5790
5792
|
this.channelId
|
|
5791
5793
|
),
|
|
@@ -5805,18 +5807,18 @@ class ge extends EventTarget {
|
|
|
5805
5807
|
extensions = "";
|
|
5806
5808
|
binaryType = "blob";
|
|
5807
5809
|
bufferedAmount = 0;
|
|
5808
|
-
readyState =
|
|
5810
|
+
readyState = he.CONNECTING;
|
|
5809
5811
|
socketId = Rr();
|
|
5810
5812
|
listeners = /* @__PURE__ */ new Map();
|
|
5811
5813
|
send(t) {
|
|
5812
|
-
if (this.readyState !==
|
|
5814
|
+
if (this.readyState !== he.OPEN)
|
|
5813
5815
|
throw new DOMException(
|
|
5814
5816
|
"Pluno preview websocket is not open",
|
|
5815
5817
|
"InvalidStateError"
|
|
5816
5818
|
);
|
|
5817
5819
|
window.dispatchEvent(
|
|
5818
5820
|
new CustomEvent(
|
|
5819
|
-
|
|
5821
|
+
ht(Li, this.channelId),
|
|
5820
5822
|
{
|
|
5821
5823
|
detail: {
|
|
5822
5824
|
socketId: this.socketId,
|
|
@@ -5827,9 +5829,9 @@ class ge extends EventTarget {
|
|
|
5827
5829
|
);
|
|
5828
5830
|
}
|
|
5829
5831
|
close(t, n) {
|
|
5830
|
-
this.readyState !==
|
|
5832
|
+
this.readyState !== he.CLOSED && (this.readyState = he.CLOSING, window.dispatchEvent(
|
|
5831
5833
|
new CustomEvent(
|
|
5832
|
-
|
|
5834
|
+
ht(Pi, this.channelId),
|
|
5833
5835
|
{
|
|
5834
5836
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5835
5837
|
}
|
|
@@ -5837,7 +5839,7 @@ class ge extends EventTarget {
|
|
|
5837
5839
|
), this.cleanup());
|
|
5838
5840
|
}
|
|
5839
5841
|
addPreviewListener(t, n) {
|
|
5840
|
-
const o =
|
|
5842
|
+
const o = ht(
|
|
5841
5843
|
t,
|
|
5842
5844
|
this.channelId
|
|
5843
5845
|
), i = (r) => {
|
|
@@ -5853,14 +5855,14 @@ class ge extends EventTarget {
|
|
|
5853
5855
|
}
|
|
5854
5856
|
function Rr() {
|
|
5855
5857
|
const e = window.sessionStorage.getItem(
|
|
5856
|
-
|
|
5858
|
+
Dn
|
|
5857
5859
|
);
|
|
5858
5860
|
if (e)
|
|
5859
5861
|
return e;
|
|
5860
5862
|
const t = crypto.randomUUID();
|
|
5861
|
-
return window.sessionStorage.setItem(
|
|
5863
|
+
return window.sessionStorage.setItem(Dn, t), t;
|
|
5862
5864
|
}
|
|
5863
|
-
function
|
|
5865
|
+
function ht(e, t) {
|
|
5864
5866
|
return `${e}:${t}`;
|
|
5865
5867
|
}
|
|
5866
5868
|
function Dr(e) {
|
|
@@ -5876,21 +5878,21 @@ function Dr(e) {
|
|
|
5876
5878
|
}
|
|
5877
5879
|
function Mr(e) {
|
|
5878
5880
|
for (const t of Dr(e))
|
|
5879
|
-
|
|
5881
|
+
ro.has(t) || t.dataset.plunoAutoMount === "false" || (ro.add(t), Uo(t).catch((n) => {
|
|
5880
5882
|
console.error("Failed to mount Pluno widget", n);
|
|
5881
5883
|
}));
|
|
5882
5884
|
}
|
|
5883
|
-
function
|
|
5884
|
-
const t = window, n = t[
|
|
5885
|
+
function Uo(e) {
|
|
5886
|
+
const t = window, n = t[ge];
|
|
5885
5887
|
if (n) {
|
|
5886
5888
|
if (n.host === null)
|
|
5887
5889
|
return n.mountPromise.catch(() => {
|
|
5888
|
-
const s = t[
|
|
5889
|
-
return s ? s.mountPromise :
|
|
5890
|
+
const s = t[ge];
|
|
5891
|
+
return s ? s.mountPromise : Uo(e);
|
|
5890
5892
|
});
|
|
5891
5893
|
if (zr(n.host))
|
|
5892
5894
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
5893
|
-
n.destroy?.(), delete t[
|
|
5895
|
+
n.destroy?.(), delete t[ge];
|
|
5894
5896
|
}
|
|
5895
5897
|
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Ir(i) : null;
|
|
5896
5898
|
let l;
|
|
@@ -5907,26 +5909,26 @@ function Oo(e) {
|
|
|
5907
5909
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
5908
5910
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
5909
5911
|
}).then((s) => {
|
|
5910
|
-
if (t[
|
|
5912
|
+
if (t[ge] !== l) {
|
|
5911
5913
|
s.destroy();
|
|
5912
5914
|
return;
|
|
5913
5915
|
}
|
|
5914
5916
|
const c = s.host;
|
|
5915
|
-
c.setAttribute(
|
|
5916
|
-
t[
|
|
5917
|
+
c.setAttribute(go, "true"), l.host = c, l.destroy = () => {
|
|
5918
|
+
t[ge] === l && delete t[ge], l.host = null, l.destroy = null, s.destroy();
|
|
5917
5919
|
};
|
|
5918
5920
|
}).catch((s) => {
|
|
5919
|
-
throw t[
|
|
5921
|
+
throw t[ge] === l && delete t[ge], s;
|
|
5920
5922
|
});
|
|
5921
5923
|
return l = {
|
|
5922
5924
|
mountPromise: p,
|
|
5923
5925
|
host: null,
|
|
5924
5926
|
destroy: null,
|
|
5925
5927
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
5926
|
-
}, t[
|
|
5928
|
+
}, t[ge] = l, p;
|
|
5927
5929
|
}
|
|
5928
5930
|
function zr(e) {
|
|
5929
|
-
return e.isConnected && e.getAttribute(
|
|
5931
|
+
return e.isConnected && e.getAttribute(go) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
5930
5932
|
}
|
|
5931
5933
|
Mr(import.meta.url);
|
|
5932
5934
|
export {
|