@pluno/product-agent-web 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-widget.js +987 -931
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as so } from "./product-agent-sdk.js";
|
|
2
|
+
const co = "#7c3aed", Ve = "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", Ke = "#2c2a1e", Wt = [253, 250, 241], Gt = 3.5;
|
|
3
|
+
function yn(e) {
|
|
4
|
+
const t = Cn(e);
|
|
5
|
+
if ($t(Me(t), Wt) >= Gt)
|
|
6
6
|
return t;
|
|
7
|
-
let n =
|
|
8
|
-
const i =
|
|
9
|
-
for (let
|
|
10
|
-
if (n =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
function
|
|
7
|
+
let n = Me(t);
|
|
8
|
+
const i = Me(Ke);
|
|
9
|
+
for (let r = 0; r < 6; r += 1)
|
|
10
|
+
if (n = ho(n, i, 0.22), $t(n, Wt) >= Gt)
|
|
11
|
+
return ft(n);
|
|
12
|
+
return ft(n);
|
|
13
|
+
}
|
|
14
|
+
function uo() {
|
|
15
15
|
let o = "M 280 120", n = !1, i = 0;
|
|
16
|
-
for (let
|
|
16
|
+
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = n ? 280 - l : 1020 + l;
|
|
18
|
-
o += ` L ${p} ${
|
|
18
|
+
o += ` L ${p} ${r}`, n = !n, i += 1;
|
|
19
19
|
}
|
|
20
20
|
return o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function go(e) {
|
|
23
|
+
const t = Cn(e), o = wt(Me(t));
|
|
24
24
|
return o > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,34 +56,34 @@ function to(e) {
|
|
|
56
56
|
shadow: Z(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Cn(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
|
-
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((o) => o + o).join("").toLowerCase()}` :
|
|
61
|
+
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((o) => o + o).join("").toLowerCase()}` : co;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Me(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ft([e, t, o]) {
|
|
71
71
|
const n = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${n(e)}${n(t)}${n(o)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function wt([e, t, o]) {
|
|
75
75
|
const n = (i) => {
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const r = i / 255;
|
|
77
|
+
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * n(e) + 0.7152 * n(t) + 0.0722 * n(o);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const o =
|
|
83
|
-
return (i + 0.05) / (
|
|
81
|
+
function $t(e, t) {
|
|
82
|
+
const o = wt(e), n = wt(t), [i, r] = o > n ? [o, n] : [n, o];
|
|
83
|
+
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const n =
|
|
85
|
+
function ho(e, t, o) {
|
|
86
|
+
const n = _t(o);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * n,
|
|
89
89
|
e[1] + (t[1] - e[1]) * n,
|
|
@@ -91,43 +91,43 @@ function no(e, t, o) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function Z(e, t, o) {
|
|
94
|
-
const [n, i,
|
|
95
|
-
return
|
|
94
|
+
const [n, i, r] = mo(Me(e));
|
|
95
|
+
return ft(bo(n, _t(i + o), _t(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const n = e / 255, i = t / 255,
|
|
97
|
+
function mo([e, t, o]) {
|
|
98
|
+
const n = e / 255, i = t / 255, r = o / 255, l = Math.max(n, i, r), p = Math.min(n, i, r), c = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, c];
|
|
101
101
|
const u = l - p, d = c > 0.5 ? u / (2 - l - p) : u / (l + p);
|
|
102
|
-
return [(l === n ? (i -
|
|
102
|
+
return [(l === n ? (i - r) / u + (i < r ? 6 : 0) : l === i ? (r - n) / u + 2 : (n - i) / u + 4) / 6, d, c];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function bo(e, t, o) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [o * 255, o * 255, o * 255];
|
|
107
107
|
const n = o < 0.5 ? o * (1 + t) : o + t - o * t, i = 2 * o - n;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
dt(i, n, e + 1 / 3) * 255,
|
|
110
|
+
dt(i, n, e) * 255,
|
|
111
|
+
dt(i, n, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function dt(e, t, o) {
|
|
115
115
|
let n = o;
|
|
116
116
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function _t(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Sn = "suggest_share_on_socials";
|
|
122
|
+
function fo(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const o = e[t];
|
|
125
|
-
if (o.role !== "tool" || o.toolName !==
|
|
125
|
+
if (o.role !== "tool" || o.toolName !== Sn)
|
|
126
126
|
continue;
|
|
127
|
-
const n =
|
|
127
|
+
const n = qt(e, t, "assistant");
|
|
128
128
|
if (!n)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = qt(e, n.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${o.callId ?? o.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -136,13 +136,13 @@ function ao(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function wo(e) {
|
|
140
|
+
const t = await _o(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function qt(e, t, o) {
|
|
146
146
|
for (let n = t - 1; n >= 0; n -= 1) {
|
|
147
147
|
const i = e[n];
|
|
148
148
|
if (i.role === o && i.content.trim())
|
|
@@ -150,73 +150,73 @@ function Ot(e, t, o) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function _o(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
let o = !1, n = null, i = null,
|
|
156
|
+
const xo = "https://app.pluno.ai", vo = "/api/product-agent/embed/active-users", yo = 1800, Co = 15e3, So = 250, Eo = 1e3, ko = 3e4;
|
|
157
|
+
function Lo(e, t = {}) {
|
|
158
|
+
let o = !1, n = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
|
-
|
|
160
|
+
r !== null && (window.clearInterval(r), r = null);
|
|
161
161
|
}, p = (d) => {
|
|
162
162
|
o || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
u();
|
|
164
|
-
},
|
|
164
|
+
}, Po(d)));
|
|
165
165
|
}, c = (d) => {
|
|
166
166
|
if (l(), n === null) {
|
|
167
167
|
n = d, e(d);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const g = n,
|
|
171
|
-
|
|
170
|
+
const g = n, E = performance.now();
|
|
171
|
+
r = window.setInterval(() => {
|
|
172
172
|
if (o) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const f = Math.min(1, (performance.now() -
|
|
177
|
-
n = Math.round(g + (d - g) *
|
|
178
|
-
},
|
|
176
|
+
const f = Math.min(1, (performance.now() - E) / yo);
|
|
177
|
+
n = Math.round(g + (d - g) * To(f)), e(n), f >= 1 && (n = d, e(d), l());
|
|
178
|
+
}, So);
|
|
179
179
|
}, u = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const d = await
|
|
181
|
+
const d = await Io(t);
|
|
182
182
|
if (o)
|
|
183
183
|
return;
|
|
184
184
|
c(d.count), p(d.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(Co);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return u(), () => {
|
|
190
190
|
o = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function Io(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const o = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const o = await (e.fetcher ?? fetch)(new URL(vo, Ao(e.backendUrl ?? xo)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
200
200
|
if (!o.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const n = await o.json(), i =
|
|
203
|
-
if (i === null ||
|
|
202
|
+
const n = await o.json(), i = jt(n.count), r = jt(n.refreshAfterMs ?? n.refresh_after_ms);
|
|
203
|
+
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
|
-
return { count: i, refreshAfterMs:
|
|
205
|
+
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function jt(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ao(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function Po(e) {
|
|
214
|
+
return Math.min(ko, Math.max(Eo, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function To(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 En = 100, No = "product-agent:sdk-preview-socket-connect", Do = "product-agent:sdk-preview-socket-send", Ro = "product-agent:sdk-preview-socket-close", Mo = "product-agent:sdk-preview-socket-open", Oo = "product-agent:sdk-preview-socket-message", zo = "product-agent:sdk-preview-socket-error", Bo = "product-agent:sdk-preview-socket-closed", Vt = "product-agent:sdk-preview-socket-id", Uo = "data-pluno-sdk-preview-channel", Ho = "product-agent:preview-diagnostic", kn = "pluno.productAgent.sharePromptsDisabled", Fo = 3, Kt = 'dialog[open], [aria-modal="true"], [role="dialog"]', Wo = 400, Go = 5e3, $o = 500, Yt = "Close the page's popup to chat", qo = "No recent chats for this page yet.", Q = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const fn = 100, vo = "product-agent:sdk-preview-socket-connect", yo = "product-a
|
|
|
224
224
|
scribbleStyle: !1,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
},
|
|
227
|
+
}, jo = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Xt = "pluno-pa-scribble-font", Ln = 190, In = 41, Zt = 22, Vo = 16, Ko = 24, Yo = 1, Xo = 48, Zo = 420, Jo = 520, Qo = 0.24, ei = 680, ti = 800, ni = 0.76, F = 8, xt = 50, An = "http://www.w3.org/2000/svg", Jt = 26, Qt = 8, oi = 36, en = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,12 +261,12 @@ const fn = 100, vo = "product-agent:sdk-preview-socket-connect", yo = "product-a
|
|
|
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
|
-
],
|
|
265
|
-
let
|
|
266
|
-
function
|
|
264
|
+
], ii = 11, ai = 13, tn = 4, ri = 10, li = 40, pi = "movable-launcher-position-v2", Pn = "pluno-pa-widget-styles", Tn = "data-pluno-pa-widget-styles";
|
|
265
|
+
let nn = 0;
|
|
266
|
+
function si(e) {
|
|
267
267
|
return (t) => new ae(t, e);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function di(e = {}) {
|
|
270
270
|
const t = {
|
|
271
271
|
launcherLabel: e.launcherLabel ?? Q.launcherLabel,
|
|
272
272
|
accentColor: e.accentColor ?? Q.accentColor,
|
|
@@ -324,38 +324,38 @@ async function Xo(e = {}) {
|
|
|
324
324
|
);
|
|
325
325
|
const o = document.createElement("div");
|
|
326
326
|
o.className = "pluno-pa-widget-host", o.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && o.setAttribute(
|
|
327
|
-
|
|
327
|
+
Uo,
|
|
328
328
|
t.sdkPreviewChannelId
|
|
329
329
|
);
|
|
330
330
|
const n = o.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
331
331
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
332
|
-
let
|
|
332
|
+
let r = on(
|
|
333
333
|
t.accentColor,
|
|
334
334
|
t.scribbleStyle
|
|
335
335
|
);
|
|
336
|
-
|
|
336
|
+
Pi(
|
|
337
337
|
i,
|
|
338
338
|
t.launcherLabel,
|
|
339
|
-
|
|
339
|
+
r,
|
|
340
340
|
t.movableLauncher,
|
|
341
341
|
t.showLauncherMinimizeButton
|
|
342
342
|
), n.appendChild(i);
|
|
343
|
-
const l =
|
|
343
|
+
const l = Ea(t);
|
|
344
344
|
let p = t.movableLauncher ? l.launcherPosition : null, c = p !== null;
|
|
345
|
-
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"),
|
|
345
|
+
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"), we(
|
|
346
346
|
i,
|
|
347
|
-
|
|
347
|
+
ct(
|
|
348
348
|
i,
|
|
349
349
|
p,
|
|
350
350
|
t.position
|
|
351
351
|
)
|
|
352
|
-
)),
|
|
352
|
+
)), wn(n, t.accentColor), an(i, r, {
|
|
353
353
|
accentColor: t.accentColor,
|
|
354
354
|
colorScheme: t.colorScheme,
|
|
355
355
|
fontFamily: t.fontFamily,
|
|
356
356
|
scribbleStyle: t.scribbleStyle
|
|
357
357
|
});
|
|
358
|
-
const u = await
|
|
358
|
+
const u = await Sa(), d = u.ownerDocument;
|
|
359
359
|
u.appendChild(o), J(
|
|
360
360
|
"web-sdk.widget",
|
|
361
361
|
"Applied initial widget appearance",
|
|
@@ -368,71 +368,71 @@ async function Xo(e = {}) {
|
|
|
368
368
|
);
|
|
369
369
|
const g = i.querySelector(
|
|
370
370
|
".pluno-pa-widget__launcher"
|
|
371
|
-
),
|
|
371
|
+
), E = i.querySelector(
|
|
372
372
|
".pluno-pa-widget__launcher-drag-handle"
|
|
373
373
|
), f = i.querySelector(
|
|
374
374
|
".pluno-pa-widget__launcher-input"
|
|
375
|
-
),
|
|
375
|
+
), U = i.querySelector(
|
|
376
376
|
".pluno-pa-widget__launcher-minimize"
|
|
377
|
-
), k = i.querySelector(".pluno-pa-widget__panel"),
|
|
377
|
+
), k = i.querySelector(".pluno-pa-widget__panel"), v = i.querySelector(
|
|
378
378
|
".pluno-pa-widget__close"
|
|
379
|
-
),
|
|
379
|
+
), y = i.querySelector(
|
|
380
380
|
".pluno-pa-widget__composer"
|
|
381
381
|
), h = i.querySelector(
|
|
382
382
|
".pluno-pa-widget__attachment-error"
|
|
383
|
-
), A = i.querySelector(
|
|
384
|
-
".pluno-pa-widget__billing-status"
|
|
385
383
|
), T = i.querySelector(
|
|
384
|
+
".pluno-pa-widget__billing-status"
|
|
385
|
+
), D = i.querySelector(
|
|
386
386
|
".pluno-pa-widget__attachments"
|
|
387
387
|
), I = i.querySelector(
|
|
388
388
|
".pluno-pa-widget__attachment-input"
|
|
389
|
-
),
|
|
389
|
+
), ke = i.querySelector(
|
|
390
390
|
".pluno-pa-widget__attach"
|
|
391
391
|
), b = i.querySelector(
|
|
392
392
|
".pluno-pa-widget__input"
|
|
393
|
-
),
|
|
393
|
+
), R = i.querySelector(
|
|
394
394
|
".pluno-pa-widget__send"
|
|
395
395
|
), de = i.querySelector(
|
|
396
396
|
".pluno-pa-widget__top-actions"
|
|
397
397
|
), ce = i.querySelector(
|
|
398
398
|
".pluno-pa-widget__history"
|
|
399
|
-
),
|
|
399
|
+
), _e = i.querySelector(
|
|
400
400
|
".pluno-pa-widget__history-panel"
|
|
401
401
|
), W = i.querySelector(
|
|
402
402
|
".pluno-pa-widget__history-list"
|
|
403
|
-
),
|
|
403
|
+
), Oe = i.querySelector(
|
|
404
404
|
".pluno-pa-widget__history-close"
|
|
405
405
|
), K = i.querySelector(
|
|
406
406
|
".pluno-pa-widget__history-status"
|
|
407
407
|
), _ = i.querySelector(
|
|
408
408
|
".pluno-pa-widget__timeline-jump"
|
|
409
|
-
),
|
|
409
|
+
), O = i.querySelector(
|
|
410
410
|
".pluno-pa-widget__active-users-counter"
|
|
411
411
|
), P = i.querySelector(
|
|
412
412
|
".pluno-pa-widget__timeline"
|
|
413
413
|
), G = i.querySelector(
|
|
414
414
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
415
415
|
);
|
|
416
|
-
if (!g || !f || !k || !
|
|
416
|
+
if (!g || !f || !k || !v || !y || !h || !T || !D || !I || !ke || !b || !R || !de || !ce || !_e || !W || !Oe || !K || !_ || !O || !P || !G)
|
|
417
417
|
throw new Error("Failed to mount Pluno widget");
|
|
418
|
-
if (t.movableLauncher && !
|
|
418
|
+
if (t.movableLauncher && !E)
|
|
419
419
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
420
|
-
|
|
421
|
-
let
|
|
420
|
+
dn(f), dn(b);
|
|
421
|
+
let S = [], L = null;
|
|
422
422
|
const $ = () => {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
(
|
|
427
|
-
|
|
428
|
-
(s,
|
|
429
|
-
), $(),
|
|
423
|
+
Ki(
|
|
424
|
+
D,
|
|
425
|
+
S,
|
|
426
|
+
(a) => {
|
|
427
|
+
S = S.filter(
|
|
428
|
+
(s, x) => x !== a
|
|
429
|
+
), $(), B(w.getState()), q();
|
|
430
430
|
}
|
|
431
431
|
);
|
|
432
|
-
},
|
|
432
|
+
}, Vn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
433
433
|
if (!t.tokenEndpoint)
|
|
434
434
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
435
|
-
const
|
|
435
|
+
const a = await fetch(t.tokenEndpoint, {
|
|
436
436
|
method: "POST",
|
|
437
437
|
credentials: "include",
|
|
438
438
|
headers: { "content-type": "application/json" },
|
|
@@ -441,17 +441,17 @@ async function Xo(e = {}) {
|
|
|
441
441
|
url: location.href
|
|
442
442
|
})
|
|
443
443
|
});
|
|
444
|
-
if (!
|
|
444
|
+
if (!a.ok)
|
|
445
445
|
throw new Error("Failed to load Pluno token");
|
|
446
|
-
const s = await
|
|
446
|
+
const s = await a.json();
|
|
447
447
|
if (!s.token)
|
|
448
448
|
throw new Error("Pluno token endpoint did not return a token");
|
|
449
449
|
return s.token;
|
|
450
|
-
}),
|
|
450
|
+
}), Kn = window.fetch.bind(window);
|
|
451
451
|
let w;
|
|
452
|
-
w = await
|
|
452
|
+
w = await so.init({
|
|
453
453
|
token: t.token,
|
|
454
|
-
tokenProvider:
|
|
454
|
+
tokenProvider: Vn,
|
|
455
455
|
backendUrl: t.backendUrl,
|
|
456
456
|
metadata: () => ({
|
|
457
457
|
...t.metadata ?? {},
|
|
@@ -465,54 +465,54 @@ async function Xo(e = {}) {
|
|
|
465
465
|
prepareAttachmentUpload: t.prepareAttachmentUpload,
|
|
466
466
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0
|
|
467
467
|
});
|
|
468
|
-
const
|
|
468
|
+
const Ze = new Set(l.openToolGroupKeys), xe = new Set(
|
|
469
469
|
l.seenShareCandidateIds
|
|
470
|
-
),
|
|
471
|
-
let
|
|
470
|
+
), ze = new Set(xe);
|
|
471
|
+
let Je = l.sharePromptsDisabled || await ka(t), V = null, Be = !1, ue = !1, ge = {
|
|
472
472
|
enabled: !0
|
|
473
|
-
}, he = 0,
|
|
474
|
-
const Y = (
|
|
475
|
-
ge = { enabled:
|
|
473
|
+
}, he = 0, It = "", re = !1, ie = !1, le = [], Qe = null, Le = null;
|
|
474
|
+
const Y = (a, s) => {
|
|
475
|
+
ge = { enabled: a, reason: s };
|
|
476
476
|
}, X = () => {
|
|
477
477
|
_.hidden = !0;
|
|
478
|
-
},
|
|
478
|
+
}, Yn = () => {
|
|
479
479
|
_.hidden = !1;
|
|
480
|
-
},
|
|
481
|
-
Y(!0,
|
|
480
|
+
}, Xn = (a = "jump") => {
|
|
481
|
+
Y(!0, a), X(), Re(P, () => ge.enabled), he = P.scrollTop;
|
|
482
482
|
}, me = () => {
|
|
483
|
-
if (ce.hidden = t.loginRequired,
|
|
483
|
+
if (ce.hidden = t.loginRequired, _e.hidden = !re, ce.setAttribute("aria-expanded", String(re)), W.classList.toggle(
|
|
484
484
|
"pluno-pa-widget__history-list--center",
|
|
485
485
|
ie && le.length === 0
|
|
486
486
|
), W.replaceChildren(), ie && le.length === 0) {
|
|
487
|
-
const
|
|
488
|
-
|
|
487
|
+
const a = document.createElement("p");
|
|
488
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", W.appendChild(a);
|
|
489
489
|
}
|
|
490
|
-
for (const
|
|
490
|
+
for (const a of le) {
|
|
491
491
|
const s = document.createElement("button");
|
|
492
492
|
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = ie;
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
493
|
+
const x = document.createElement("span");
|
|
494
|
+
x.className = "pluno-pa-widget__history-item-title", x.textContent = Li(a);
|
|
495
|
+
const A = document.createElement("time");
|
|
496
|
+
A.className = "pluno-pa-widget__history-time", A.dateTime = a.lastActiveAt, A.textContent = Ai(
|
|
497
|
+
a.lastActiveAt,
|
|
498
498
|
Date.now()
|
|
499
499
|
);
|
|
500
500
|
const N = document.createElement("small");
|
|
501
|
-
N.className = "pluno-pa-widget__history-path", N.textContent =
|
|
502
|
-
re = !1,
|
|
501
|
+
N.className = "pluno-pa-widget__history-path", N.textContent = Ii(a), s.append(x, A, N), s.addEventListener("click", () => {
|
|
502
|
+
re = !1, Le = null, me(), Y(!0, "newSession"), X(), w.loadSession(a.id), B(w.getState());
|
|
503
503
|
}), W.appendChild(s);
|
|
504
504
|
}
|
|
505
505
|
if (ie && le.length > 0) {
|
|
506
|
-
const
|
|
507
|
-
|
|
506
|
+
const a = document.createElement("p");
|
|
507
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", W.appendChild(a);
|
|
508
508
|
}
|
|
509
|
-
K.textContent =
|
|
510
|
-
},
|
|
509
|
+
K.textContent = Le ?? (!ie && le.length === 0 ? "No recent chats for this page yet." : ""), K.hidden = K.textContent.length === 0;
|
|
510
|
+
}, At = async (a) => {
|
|
511
511
|
if (!ie) {
|
|
512
|
-
ie = !0,
|
|
512
|
+
ie = !0, Le = null, me();
|
|
513
513
|
try {
|
|
514
|
-
const s = await w.listSessions({ cursor:
|
|
515
|
-
le =
|
|
514
|
+
const s = await w.listSessions({ cursor: a, limit: 20 });
|
|
515
|
+
le = a ? [...le, ...s.sessions] : s.sessions, Qe = s.nextCursor;
|
|
516
516
|
} catch (s) {
|
|
517
517
|
J(
|
|
518
518
|
"web-sdk.widget",
|
|
@@ -520,60 +520,60 @@ async function Xo(e = {}) {
|
|
|
520
520
|
{
|
|
521
521
|
message: s instanceof Error ? s.message : String(s)
|
|
522
522
|
}
|
|
523
|
-
),
|
|
523
|
+
), Le = qo;
|
|
524
524
|
} finally {
|
|
525
525
|
ie = !1, me();
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
},
|
|
529
|
-
!
|
|
530
|
-
},
|
|
531
|
-
|
|
532
|
-
},
|
|
533
|
-
|
|
528
|
+
}, Zn = () => {
|
|
529
|
+
!Qe || ie || W.scrollHeight - W.scrollTop - W.clientHeight <= 24 && At(Qe);
|
|
530
|
+
}, Jn = () => {
|
|
531
|
+
Be || typeof document > "u" || (wn(n, t.accentColor), o.isConnected || d.body?.appendChild(o));
|
|
532
|
+
}, Pt = new MutationObserver(Jn);
|
|
533
|
+
Pt.observe(d.documentElement, {
|
|
534
534
|
childList: !0,
|
|
535
535
|
subtree: !0
|
|
536
536
|
});
|
|
537
|
-
const
|
|
538
|
-
const s =
|
|
539
|
-
return
|
|
537
|
+
const et = (a = !0) => {
|
|
538
|
+
const s = Ye(i, a);
|
|
539
|
+
return vt(
|
|
540
540
|
i,
|
|
541
|
-
p ?
|
|
541
|
+
p ? Dn(p, s) : bi(
|
|
542
542
|
i,
|
|
543
543
|
t.position,
|
|
544
544
|
s
|
|
545
545
|
),
|
|
546
546
|
s
|
|
547
547
|
);
|
|
548
|
-
},
|
|
549
|
-
|
|
548
|
+
}, H = () => {
|
|
549
|
+
Ia(t, {
|
|
550
550
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
551
551
|
composerValue: b.value,
|
|
552
|
-
openToolGroupKeys: [...
|
|
552
|
+
openToolGroupKeys: [...Ze],
|
|
553
553
|
launcherPosition: c ? p : null,
|
|
554
|
-
seenShareCandidateIds: [...
|
|
555
|
-
-
|
|
554
|
+
seenShareCandidateIds: [...xe].slice(
|
|
555
|
+
-En
|
|
556
556
|
),
|
|
557
|
-
sharePromptsDisabled:
|
|
557
|
+
sharePromptsDisabled: Je
|
|
558
558
|
});
|
|
559
|
-
},
|
|
560
|
-
t.onDisplayStateChange?.(
|
|
561
|
-
},
|
|
562
|
-
if (
|
|
563
|
-
i.classList.remove("pluno-pa-widget--minimized"), g.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") &&
|
|
559
|
+
}, Ue = (a) => {
|
|
560
|
+
t.onDisplayStateChange?.(a);
|
|
561
|
+
}, Ie = (a, s = !0) => {
|
|
562
|
+
if (a === "shown") {
|
|
563
|
+
i.classList.remove("pluno-pa-widget--minimized"), g.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Ae(!1), s && Ue("shown");
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
|
-
V !== null && (window.clearTimeout(V), V = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), g.hidden = !1, k.hidden = !0,
|
|
566
|
+
V !== null && (window.clearTimeout(V), V = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), g.hidden = !1, k.hidden = !0, v.hidden = !0, g.tabIndex = 0, b.value = "", we(
|
|
567
567
|
i,
|
|
568
|
-
|
|
568
|
+
ct(
|
|
569
569
|
i,
|
|
570
570
|
p,
|
|
571
571
|
t.position
|
|
572
572
|
)
|
|
573
|
-
),
|
|
574
|
-
}, be = (
|
|
575
|
-
|
|
576
|
-
debugVersion:
|
|
573
|
+
), ln(i), H(), s && Ue("minimized");
|
|
574
|
+
}, be = (a, s = {}) => {
|
|
575
|
+
Ci(a, {
|
|
576
|
+
debugVersion: pi,
|
|
577
577
|
launcherPosition: p,
|
|
578
578
|
rootClasses: i.className,
|
|
579
579
|
rootStyle: {
|
|
@@ -582,35 +582,35 @@ async function Xo(e = {}) {
|
|
|
582
582
|
right: i.style.right,
|
|
583
583
|
bottom: i.style.bottom
|
|
584
584
|
},
|
|
585
|
-
rootRect:
|
|
586
|
-
launcherRect:
|
|
587
|
-
panelRect:
|
|
585
|
+
rootRect: ut(i),
|
|
586
|
+
launcherRect: ut(g),
|
|
587
|
+
panelRect: ut(k),
|
|
588
588
|
viewport: ne(),
|
|
589
589
|
panelHidden: k.hidden,
|
|
590
|
-
closeHidden:
|
|
590
|
+
closeHidden: v.hidden,
|
|
591
591
|
...s
|
|
592
592
|
});
|
|
593
|
-
},
|
|
593
|
+
}, Ae = (a = !0) => {
|
|
594
594
|
if (!p)
|
|
595
|
-
return
|
|
596
|
-
const s =
|
|
597
|
-
return
|
|
595
|
+
return we(i, null), et(a);
|
|
596
|
+
const s = et(a);
|
|
597
|
+
return we(i, s), be("Applied stored closed launcher position", {
|
|
598
598
|
visibleLauncherPosition: s
|
|
599
599
|
}), s;
|
|
600
|
-
},
|
|
601
|
-
if (!
|
|
602
|
-
|
|
600
|
+
}, Tt = (a, s) => {
|
|
601
|
+
if (!a || !s) {
|
|
602
|
+
ln(i);
|
|
603
603
|
return;
|
|
604
604
|
}
|
|
605
|
-
|
|
606
|
-
x:
|
|
607
|
-
y:
|
|
605
|
+
yi(i, {
|
|
606
|
+
x: a.x - s.x,
|
|
607
|
+
y: a.y - s.y
|
|
608
608
|
});
|
|
609
|
-
},
|
|
609
|
+
}, Nt = () => {
|
|
610
610
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
611
|
-
|
|
611
|
+
we(
|
|
612
612
|
i,
|
|
613
|
-
|
|
613
|
+
ct(
|
|
614
614
|
i,
|
|
615
615
|
p,
|
|
616
616
|
t.position
|
|
@@ -618,128 +618,180 @@ async function Xo(e = {}) {
|
|
|
618
618
|
);
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
|
-
const
|
|
621
|
+
const a = Ae();
|
|
622
622
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
623
|
-
const s =
|
|
623
|
+
const s = rn(
|
|
624
624
|
i,
|
|
625
|
-
|
|
625
|
+
a,
|
|
626
626
|
t.position
|
|
627
627
|
);
|
|
628
|
-
|
|
628
|
+
Tt(s, a), be(
|
|
629
629
|
"Applied open panel position after viewport resize",
|
|
630
630
|
{ openPanelPosition: s }
|
|
631
631
|
);
|
|
632
632
|
} else p && be(
|
|
633
633
|
"Applied visible launcher position after viewport resize",
|
|
634
|
-
{ visibleLauncherPosition:
|
|
634
|
+
{ visibleLauncherPosition: a }
|
|
635
635
|
);
|
|
636
636
|
};
|
|
637
|
-
let
|
|
637
|
+
let Dt = () => {
|
|
638
638
|
};
|
|
639
|
-
window.addEventListener("resize",
|
|
639
|
+
window.addEventListener("resize", Nt), t.movableLauncher && E ? (Ae(), Dt = mi({
|
|
640
640
|
root: i,
|
|
641
641
|
launcher: g,
|
|
642
|
-
launcherDragHandle:
|
|
643
|
-
getPosition: () =>
|
|
644
|
-
setPosition: (
|
|
645
|
-
const s =
|
|
642
|
+
launcherDragHandle: E,
|
|
643
|
+
getPosition: () => et(),
|
|
644
|
+
setPosition: (a) => {
|
|
645
|
+
const s = a, x = Ye(i), A = vt(
|
|
646
646
|
i,
|
|
647
|
-
|
|
648
|
-
|
|
647
|
+
a,
|
|
648
|
+
x
|
|
649
649
|
);
|
|
650
|
-
p =
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
),
|
|
650
|
+
p = wi(
|
|
651
|
+
A,
|
|
652
|
+
x
|
|
653
|
+
), we(i, A), be("Dragging closed launcher", {
|
|
654
654
|
requestedPosition: s
|
|
655
655
|
});
|
|
656
656
|
},
|
|
657
657
|
persist: () => {
|
|
658
|
-
c = !0,
|
|
658
|
+
c = !0, H(), be("Persisted closed launcher drag position");
|
|
659
659
|
}
|
|
660
|
-
})) :
|
|
661
|
-
let
|
|
662
|
-
const
|
|
663
|
-
if (!(!t.billingStatusLoader ||
|
|
664
|
-
|
|
660
|
+
})) : we(i, null);
|
|
661
|
+
let tt = !1;
|
|
662
|
+
const Rt = async () => {
|
|
663
|
+
if (!(!t.billingStatusLoader || tt)) {
|
|
664
|
+
tt = !0;
|
|
665
665
|
try {
|
|
666
|
-
const
|
|
667
|
-
|
|
666
|
+
const a = await t.billingStatusLoader();
|
|
667
|
+
un(
|
|
668
668
|
t.billingStatus,
|
|
669
|
-
|
|
669
|
+
a,
|
|
670
670
|
w.getState().lastErrorCode
|
|
671
|
-
) && (t.billingStatus =
|
|
672
|
-
|
|
671
|
+
) && (t.billingStatus = a, mt(
|
|
672
|
+
T,
|
|
673
673
|
t.billingStatus,
|
|
674
674
|
w.getState().lastErrorCode
|
|
675
675
|
), q());
|
|
676
676
|
} finally {
|
|
677
|
-
|
|
677
|
+
tt = !1;
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
-
}, pe = (
|
|
681
|
-
|
|
682
|
-
const
|
|
680
|
+
}, pe = (a = "", s = !0) => {
|
|
681
|
+
Rt(), V !== null && (window.clearTimeout(V), V = null), Ie("shown", !1), k.hidden = !1, v.hidden = !1, i.classList.remove("pluno-pa-widget--closing");
|
|
682
|
+
const x = Ae(), A = rn(
|
|
683
683
|
i,
|
|
684
|
-
|
|
684
|
+
x,
|
|
685
685
|
t.position
|
|
686
686
|
);
|
|
687
|
-
if (
|
|
688
|
-
openPanelPosition:
|
|
689
|
-
visibleLauncherPosition:
|
|
687
|
+
if (Tt(A, x), be("Opening launcher at clamped open panel position", {
|
|
688
|
+
openPanelPosition: A,
|
|
689
|
+
visibleLauncherPosition: x
|
|
690
690
|
}), Y(!0, "open"), X(), !s) {
|
|
691
|
-
i.classList.add("pluno-pa-widget--open"), g.hidden = !0,
|
|
691
|
+
i.classList.add("pluno-pa-widget--open"), g.hidden = !0, a && (b.value = a, De(b)), Re(P, () => ge.enabled), he = P.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), H(), Ue("shown"), t.onPanelOpenChange?.(!0);
|
|
692
692
|
return;
|
|
693
693
|
}
|
|
694
694
|
window.requestAnimationFrame(() => {
|
|
695
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
696
|
-
g.hidden = !0,
|
|
695
|
+
i.classList.add("pluno-pa-widget--open"), a && (b.value = a, De(b)), Re(P, () => ge.enabled), he = P.scrollTop, b.focus(), b.setSelectionRange(b.value.length, b.value.length), H(), Ue("shown"), t.onPanelOpenChange?.(!0), V = window.setTimeout(() => {
|
|
696
|
+
g.hidden = !0, Re(P, () => ge.enabled), he = P.scrollTop;
|
|
697
697
|
}, 220);
|
|
698
698
|
});
|
|
699
|
-
},
|
|
700
|
-
V !== null && (window.clearTimeout(V), V = null), g.hidden = !1, p && (
|
|
701
|
-
k.hidden = !0,
|
|
699
|
+
}, Qn = () => {
|
|
700
|
+
V !== null && (window.clearTimeout(V), V = null), g.hidden = !1, p && (Ae(!1), be("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), V = window.setTimeout(() => {
|
|
701
|
+
k.hidden = !0, v.hidden = !0, i.classList.remove("pluno-pa-widget--closing");
|
|
702
702
|
}, 220);
|
|
703
703
|
};
|
|
704
|
-
g.addEventListener("submit", (
|
|
705
|
-
|
|
706
|
-
}),
|
|
707
|
-
|
|
708
|
-
}), g.addEventListener("click", (
|
|
709
|
-
|
|
704
|
+
g.addEventListener("submit", (a) => {
|
|
705
|
+
a.preventDefault(), pe(f.value), f.value = "";
|
|
706
|
+
}), E?.addEventListener("click", (a) => {
|
|
707
|
+
a.preventDefault(), a.stopPropagation();
|
|
708
|
+
}), g.addEventListener("click", (a) => {
|
|
709
|
+
a.target === f && !E || (pe(f.value), f.value = "");
|
|
710
710
|
}), f.addEventListener("focus", () => {
|
|
711
711
|
pe(f.value), f.value = "";
|
|
712
712
|
}), f.addEventListener("input", () => {
|
|
713
713
|
if (!f.value)
|
|
714
714
|
return;
|
|
715
|
-
const
|
|
716
|
-
pe(
|
|
717
|
-
})
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
715
|
+
const a = f.value;
|
|
716
|
+
pe(a), f.value = "";
|
|
717
|
+
});
|
|
718
|
+
let nt = null, He = null, fe = null;
|
|
719
|
+
const Mt = (a) => a === f || a === b, eo = (a) => {
|
|
720
|
+
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
721
|
+
return null;
|
|
722
|
+
let s = a;
|
|
723
|
+
for (; s; ) {
|
|
724
|
+
const x = s.closest(Kt);
|
|
725
|
+
if (x)
|
|
726
|
+
return x;
|
|
727
|
+
const A = s.getRootNode();
|
|
728
|
+
s = A instanceof ShadowRoot ? A.host : null;
|
|
729
|
+
}
|
|
730
|
+
return null;
|
|
731
|
+
}, to = (a) => {
|
|
732
|
+
if (!a.isConnected || !a.matches(Kt))
|
|
733
|
+
return !1;
|
|
734
|
+
if (!(a instanceof HTMLElement))
|
|
735
|
+
return !0;
|
|
736
|
+
if (a.hidden)
|
|
737
|
+
return !1;
|
|
738
|
+
if (typeof a.checkVisibility == "function")
|
|
739
|
+
return a.checkVisibility();
|
|
740
|
+
const s = window.getComputedStyle(a);
|
|
741
|
+
return s.display !== "none" && s.visibility !== "hidden";
|
|
742
|
+
}, Ot = (a) => {
|
|
743
|
+
Pe !== a && (Pe = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), ot(), a !== null ? fe = window.setInterval(() => {
|
|
744
|
+
const s = Pe;
|
|
745
|
+
(!s || !to(s)) && Ot(null);
|
|
746
|
+
}, $o) : fe !== null && (window.clearInterval(fe), fe = null, He = null));
|
|
747
|
+
}, no = () => {
|
|
748
|
+
fe !== null && (window.clearInterval(fe), fe = null);
|
|
749
|
+
};
|
|
750
|
+
i.addEventListener("focusin", (a) => {
|
|
751
|
+
Mt(a.target) && (nt = Date.now());
|
|
752
|
+
}), i.addEventListener("focusout", (a) => {
|
|
753
|
+
if (!Mt(a.target) || Pe !== null)
|
|
754
|
+
return;
|
|
755
|
+
const s = nt;
|
|
756
|
+
if (nt = null, s === null || Date.now() - s > Wo)
|
|
757
|
+
return;
|
|
758
|
+
const x = eo(a.relatedTarget);
|
|
759
|
+
if (!x)
|
|
760
|
+
return;
|
|
761
|
+
const A = Date.now();
|
|
762
|
+
if (He !== null && A - He <= Go) {
|
|
763
|
+
Ot(x);
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
He = A;
|
|
767
|
+
}), g.addEventListener("keydown", (a) => {
|
|
768
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), pe());
|
|
769
|
+
}), U?.addEventListener("pointerdown", (a) => {
|
|
770
|
+
a.stopPropagation();
|
|
771
|
+
}), U?.addEventListener("click", (a) => {
|
|
772
|
+
a.preventDefault(), a.stopPropagation(), Ie("minimized");
|
|
773
|
+
}), v.addEventListener("click", Qn), P.addEventListener("scroll", () => {
|
|
724
774
|
P.scrollTop < he - 1 && Y(!1, "userScroll"), he = P.scrollTop;
|
|
725
775
|
}), _.addEventListener("click", () => {
|
|
726
|
-
|
|
776
|
+
Xn();
|
|
727
777
|
});
|
|
728
|
-
const
|
|
729
|
-
([
|
|
730
|
-
|
|
778
|
+
const zt = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
779
|
+
([a]) => {
|
|
780
|
+
a?.isIntersecting && (Y(!0, "bottom"), X());
|
|
731
781
|
},
|
|
732
782
|
{ root: P, threshold: 0 }
|
|
733
783
|
);
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
784
|
+
zt?.observe(G);
|
|
785
|
+
const Fe = () => t.loginRequired || t.signupRequired;
|
|
786
|
+
let Pe = null;
|
|
787
|
+
const ot = () => {
|
|
788
|
+
const a = Fe(), s = Pe !== null;
|
|
789
|
+
f.readOnly = a || s, b.readOnly = s, f.placeholder = s ? Yt : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : t.launcherLabel, b.placeholder = s ? Yt : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Q.launcherLabel, y.hidden = a;
|
|
738
790
|
}, q = () => {
|
|
739
|
-
|
|
791
|
+
R.disabled = te(t.billingStatus) || !w.getState().isThinking && b.value.trim().length === 0 && S.length === 0, ke.disabled = Fe() || te(t.billingStatus);
|
|
740
792
|
};
|
|
741
|
-
|
|
742
|
-
if (
|
|
793
|
+
ot(), y.addEventListener("submit", (a) => {
|
|
794
|
+
if (a.preventDefault(), t.loginRequired) {
|
|
743
795
|
t.onLoginClick?.();
|
|
744
796
|
return;
|
|
745
797
|
}
|
|
@@ -747,55 +799,55 @@ async function Xo(e = {}) {
|
|
|
747
799
|
t.onSignupClick?.();
|
|
748
800
|
return;
|
|
749
801
|
}
|
|
750
|
-
te(t.billingStatus) || (ue = !0, Y(!0, "send"), X(),
|
|
802
|
+
te(t.billingStatus) || (ue = !0, Y(!0, "send"), X(), S = gt(
|
|
751
803
|
w,
|
|
752
804
|
b,
|
|
753
|
-
|
|
805
|
+
S
|
|
754
806
|
), $(), q());
|
|
755
807
|
});
|
|
756
|
-
let
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
},
|
|
760
|
-
L !== null && window.clearTimeout(L), h.textContent =
|
|
808
|
+
let Te = 0;
|
|
809
|
+
const oo = () => {
|
|
810
|
+
Te = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
811
|
+
}, Bt = (a) => {
|
|
812
|
+
L !== null && window.clearTimeout(L), h.textContent = a, h.hidden = !1, L = window.setTimeout(() => {
|
|
761
813
|
h.textContent = "", h.hidden = !0, L = null;
|
|
762
814
|
}, 3e3);
|
|
763
|
-
},
|
|
815
|
+
}, io = () => {
|
|
764
816
|
L !== null && (window.clearTimeout(L), L = null), h.textContent = "", h.hidden = !0;
|
|
765
|
-
},
|
|
766
|
-
if (
|
|
817
|
+
}, Ut = async (a) => {
|
|
818
|
+
if (a.length === 0)
|
|
767
819
|
return;
|
|
768
|
-
const s =
|
|
769
|
-
|
|
820
|
+
const s = Zi(w, a);
|
|
821
|
+
S = [...S, ...s], $(), io(), q(), B(w.getState()), i.classList.contains("pluno-pa-widget--open") || pe();
|
|
770
822
|
};
|
|
771
|
-
|
|
823
|
+
ke.addEventListener("click", () => {
|
|
772
824
|
t.loginRequired || te(t.billingStatus) || I.click();
|
|
773
825
|
}), I.addEventListener("change", () => {
|
|
774
|
-
const
|
|
775
|
-
I.value = "",
|
|
776
|
-
|
|
826
|
+
const a = Array.from(I.files ?? []);
|
|
827
|
+
I.value = "", Ut(a).catch((s) => {
|
|
828
|
+
Bt(
|
|
777
829
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
778
830
|
), J("web-sdk.widget", "Attachment failed", {
|
|
779
831
|
message: s instanceof Error ? s.message : String(s)
|
|
780
832
|
});
|
|
781
833
|
});
|
|
782
|
-
}), i.addEventListener("dragenter", (
|
|
783
|
-
|
|
784
|
-
}), i.addEventListener("dragover", (
|
|
785
|
-
const s =
|
|
786
|
-
|
|
787
|
-
}), i.addEventListener("dragleave", (
|
|
788
|
-
|
|
789
|
-
}), i.addEventListener("drop", (
|
|
790
|
-
const s =
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
834
|
+
}), i.addEventListener("dragenter", (a) => {
|
|
835
|
+
!$e(a.dataTransfer) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Te += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
836
|
+
}), i.addEventListener("dragover", (a) => {
|
|
837
|
+
const s = a.dataTransfer;
|
|
838
|
+
!$e(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
839
|
+
}), i.addEventListener("dragleave", (a) => {
|
|
840
|
+
$e(a.dataTransfer) && (a.stopPropagation(), Te = Math.max(0, Te - 1), Te === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
841
|
+
}), i.addEventListener("drop", (a) => {
|
|
842
|
+
const s = a.dataTransfer;
|
|
843
|
+
!$e(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), oo(), Ut(s.files).catch((x) => {
|
|
844
|
+
Bt(
|
|
845
|
+
x instanceof Error ? x.message : "Failed to attach file"
|
|
794
846
|
), J("web-sdk.widget", "Attachment failed", {
|
|
795
|
-
message:
|
|
847
|
+
message: x instanceof Error ? x.message : String(x)
|
|
796
848
|
});
|
|
797
849
|
}));
|
|
798
|
-
}),
|
|
850
|
+
}), R.addEventListener("click", () => {
|
|
799
851
|
if (t.loginRequired) {
|
|
800
852
|
t.onLoginClick?.();
|
|
801
853
|
return;
|
|
@@ -804,64 +856,64 @@ async function Xo(e = {}) {
|
|
|
804
856
|
w.stop();
|
|
805
857
|
return;
|
|
806
858
|
}
|
|
807
|
-
ue = !0, Y(!0, "send"), X(),
|
|
859
|
+
ue = !0, Y(!0, "send"), X(), S = gt(
|
|
808
860
|
w,
|
|
809
861
|
b,
|
|
810
|
-
|
|
811
|
-
), $(), q(),
|
|
862
|
+
S
|
|
863
|
+
), $(), q(), B(w.getState());
|
|
812
864
|
}), ce.addEventListener("click", () => {
|
|
813
|
-
re = !re,
|
|
814
|
-
}),
|
|
865
|
+
re = !re, Le = null, me(), re && le.length === 0 && At(null);
|
|
866
|
+
}), Oe.addEventListener("click", () => {
|
|
815
867
|
re = !1, me();
|
|
816
|
-
}), W.addEventListener("scroll",
|
|
817
|
-
|
|
818
|
-
}), b.addEventListener("keydown", (
|
|
819
|
-
if (!(
|
|
820
|
-
if (
|
|
868
|
+
}), W.addEventListener("scroll", Zn), b.addEventListener("input", () => {
|
|
869
|
+
De(b), H(), q(), ro();
|
|
870
|
+
}), b.addEventListener("keydown", (a) => {
|
|
871
|
+
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
872
|
+
if (a.preventDefault(), t.loginRequired) {
|
|
821
873
|
t.onLoginClick?.();
|
|
822
874
|
return;
|
|
823
875
|
}
|
|
824
|
-
ue = !0, Y(!0, "send"), X(),
|
|
876
|
+
ue = !0, Y(!0, "send"), X(), S = gt(
|
|
825
877
|
w,
|
|
826
878
|
b,
|
|
827
|
-
|
|
828
|
-
), $(), q(),
|
|
829
|
-
}
|
|
830
|
-
}), i.addEventListener("click", (
|
|
831
|
-
(
|
|
832
|
-
}), l.composerValue && (b.value = l.composerValue,
|
|
833
|
-
const
|
|
834
|
-
let
|
|
879
|
+
S
|
|
880
|
+
), $(), q(), B(w.getState());
|
|
881
|
+
}
|
|
882
|
+
}), i.addEventListener("click", (a) => {
|
|
883
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && H();
|
|
884
|
+
}), l.composerValue && (b.value = l.composerValue, De(b)), t.initialDisplayState === "minimized" ? Ie("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && pe(b.value, !1);
|
|
885
|
+
const We = () => r;
|
|
886
|
+
let it = w.getState().appearance !== null, Ge = null, Ne = null, ve = null, Ht = w.getState().isThinking, ye = null, Ce = null, Ft = () => {
|
|
835
887
|
};
|
|
836
|
-
const
|
|
837
|
-
const
|
|
838
|
-
|
|
888
|
+
const ao = !!t.socialPostDraftHandler, at = /* @__PURE__ */ new Map(), rt = () => b.value.trim().length > 0 || S.length > 0, ro = () => {
|
|
889
|
+
const a = Ce !== null && bt(w.getState(), rt());
|
|
890
|
+
O.hidden = !a, a && Ce !== null && Mn(O, Ce);
|
|
839
891
|
};
|
|
840
|
-
let
|
|
841
|
-
const
|
|
842
|
-
ue = !0, Y(!0, "newSession"), X(), re = !1, me(), w.startNewSession(),
|
|
843
|
-
},
|
|
844
|
-
if (!
|
|
845
|
-
|
|
892
|
+
let Se = null;
|
|
893
|
+
const lo = () => {
|
|
894
|
+
ue = !0, Y(!0, "newSession"), X(), re = !1, me(), w.startNewSession(), Ze.clear(), b.value = "", S = [], $(), De(b), H(), q(), b.focus(), B(w.getState());
|
|
895
|
+
}, lt = (a) => {
|
|
896
|
+
if (!a) {
|
|
897
|
+
Se?.remove(), Se = null;
|
|
846
898
|
return;
|
|
847
899
|
}
|
|
848
|
-
|
|
900
|
+
Se || (Se = Xe(
|
|
849
901
|
"pluno-pa-widget__new-chat",
|
|
850
902
|
"New chat",
|
|
851
|
-
|
|
903
|
+
Hi(),
|
|
852
904
|
!1
|
|
853
|
-
),
|
|
854
|
-
},
|
|
855
|
-
if (me(),
|
|
856
|
-
|
|
905
|
+
), Se.addEventListener("click", lo), de.insertBefore(Se, ce));
|
|
906
|
+
}, B = (a) => {
|
|
907
|
+
if (me(), Lt(a.lastErrorCode) ? ye = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !te(t.billingStatus) && (ye = null), mt(
|
|
908
|
+
T,
|
|
857
909
|
t.billingStatus,
|
|
858
|
-
|
|
910
|
+
ye
|
|
859
911
|
), t.loginRequired) {
|
|
860
|
-
|
|
912
|
+
at.clear(), bn(
|
|
861
913
|
P,
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
914
|
+
R,
|
|
915
|
+
lt,
|
|
916
|
+
We,
|
|
865
917
|
"Log in to use Pluno on this page.",
|
|
866
918
|
t.loginButtonLabel,
|
|
867
919
|
t.loginUrl,
|
|
@@ -870,11 +922,11 @@ async function Xo(e = {}) {
|
|
|
870
922
|
return;
|
|
871
923
|
}
|
|
872
924
|
if (t.signupRequired) {
|
|
873
|
-
|
|
925
|
+
at.clear(), bn(
|
|
874
926
|
P,
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
927
|
+
R,
|
|
928
|
+
lt,
|
|
929
|
+
We,
|
|
878
930
|
"Complete signup to unlock your free trial credits.",
|
|
879
931
|
t.signupButtonLabel,
|
|
880
932
|
t.signupUrl,
|
|
@@ -882,65 +934,65 @@ async function Xo(e = {}) {
|
|
|
882
934
|
);
|
|
883
935
|
return;
|
|
884
936
|
}
|
|
885
|
-
const s =
|
|
886
|
-
|
|
887
|
-
const
|
|
888
|
-
ue = !1,
|
|
937
|
+
const s = Ei(a), x = s !== It;
|
|
938
|
+
It = s;
|
|
939
|
+
const A = ue || ge.enabled;
|
|
940
|
+
ue = !1, ia(
|
|
889
941
|
P,
|
|
890
942
|
G,
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
943
|
+
R,
|
|
944
|
+
lt,
|
|
945
|
+
O,
|
|
946
|
+
a,
|
|
947
|
+
Ce,
|
|
948
|
+
Ce !== null && bt(a, rt()),
|
|
949
|
+
A,
|
|
898
950
|
() => ge.enabled,
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
951
|
+
Ze,
|
|
952
|
+
at,
|
|
953
|
+
H,
|
|
954
|
+
We,
|
|
903
955
|
(N) => {
|
|
904
956
|
ue = !0, Y(!0, "send"), X(), w.sendMessage(N);
|
|
905
957
|
},
|
|
906
|
-
|
|
907
|
-
dismissedCandidateIds:
|
|
908
|
-
draftingCandidateId:
|
|
909
|
-
error:
|
|
910
|
-
characterIconOptions:
|
|
958
|
+
ao && !Je ? {
|
|
959
|
+
dismissedCandidateIds: ze,
|
|
960
|
+
draftingCandidateId: Ge,
|
|
961
|
+
error: Ne,
|
|
962
|
+
characterIconOptions: We(),
|
|
911
963
|
onSeen: (N) => {
|
|
912
|
-
|
|
964
|
+
xe.add(N.id), H();
|
|
913
965
|
},
|
|
914
966
|
onDraft: (N) => {
|
|
915
|
-
|
|
967
|
+
po(N);
|
|
916
968
|
},
|
|
917
969
|
onDismiss: (N) => {
|
|
918
|
-
|
|
970
|
+
xe.add(N.id), ze.add(N.id), H(), Ne = null, B(w.getState());
|
|
919
971
|
},
|
|
920
972
|
onDisable: (N) => {
|
|
921
|
-
|
|
973
|
+
Je = !0, xe.add(N.id), ze.add(N.id), H(), La(t, !0), Ne = null, B(w.getState());
|
|
922
974
|
}
|
|
923
975
|
} : void 0
|
|
924
|
-
),
|
|
976
|
+
), A ? (he = P.scrollTop, X()) : x && ki(a) && Yn();
|
|
925
977
|
};
|
|
926
|
-
return
|
|
927
|
-
(
|
|
928
|
-
|
|
978
|
+
return Ft = Lo(
|
|
979
|
+
(a) => {
|
|
980
|
+
Ce = a, !Be && bt(w.getState(), rt()) && B(w.getState());
|
|
929
981
|
},
|
|
930
982
|
{
|
|
931
983
|
backendUrl: t.backendUrl,
|
|
932
|
-
fetcher:
|
|
984
|
+
fetcher: Kn,
|
|
933
985
|
loader: t.activeUsersLoader
|
|
934
986
|
}
|
|
935
|
-
), w.on("state", (
|
|
936
|
-
const s =
|
|
937
|
-
|
|
987
|
+
), w.on("state", (a) => {
|
|
988
|
+
const s = Ht && !a.isThinking;
|
|
989
|
+
Ht = a.isThinking, a.appearance ? (it = !0, J(
|
|
938
990
|
"web-sdk.widget",
|
|
939
991
|
"Agent state supplied appearance",
|
|
940
992
|
{
|
|
941
|
-
appearance:
|
|
993
|
+
appearance: a.appearance
|
|
942
994
|
}
|
|
943
|
-
),
|
|
995
|
+
), pt(a.appearance, "agent.state.appearance")) : it && (it = !1, J(
|
|
944
996
|
"web-sdk.widget",
|
|
945
997
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
946
998
|
{
|
|
@@ -948,32 +1000,32 @@ async function Xo(e = {}) {
|
|
|
948
1000
|
fallbackColorScheme: t.colorScheme,
|
|
949
1001
|
fallbackFontFamily: t.fontFamily
|
|
950
1002
|
}
|
|
951
|
-
),
|
|
952
|
-
}),
|
|
1003
|
+
), pt({}, "agent.state.appearance-cleared")), B(a), q(), s && Rt();
|
|
1004
|
+
}), B(w.getState()), q(), {
|
|
953
1005
|
agent: w,
|
|
954
|
-
updateAppearance: (
|
|
955
|
-
|
|
1006
|
+
updateAppearance: (a) => {
|
|
1007
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), pt(a, "widgetHandle.updateAppearance");
|
|
956
1008
|
},
|
|
957
|
-
updateBillingStatus: (
|
|
958
|
-
const s =
|
|
959
|
-
|
|
1009
|
+
updateBillingStatus: (a) => {
|
|
1010
|
+
const s = a ?? null;
|
|
1011
|
+
un(
|
|
960
1012
|
t.billingStatus,
|
|
961
1013
|
s,
|
|
962
|
-
|
|
963
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !te(t.billingStatus) && (
|
|
1014
|
+
ye
|
|
1015
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !te(t.billingStatus) && (ye = null), mt(
|
|
964
1016
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
965
1017
|
t.billingStatus,
|
|
966
|
-
|
|
1018
|
+
ye
|
|
967
1019
|
), q());
|
|
968
1020
|
},
|
|
969
|
-
updateAuthGate: (
|
|
970
|
-
const s =
|
|
971
|
-
t.loginRequired =
|
|
1021
|
+
updateAuthGate: (a) => {
|
|
1022
|
+
const s = Fe();
|
|
1023
|
+
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), ot(), B(w.getState()), q(), s && !Fe() && w.connect().catch((x) => {
|
|
972
1024
|
J(
|
|
973
1025
|
"web-sdk.widget",
|
|
974
1026
|
"Failed to connect after auth gate cleared",
|
|
975
1027
|
{
|
|
976
|
-
message:
|
|
1028
|
+
message: x instanceof Error ? x.message : String(x)
|
|
977
1029
|
}
|
|
978
1030
|
);
|
|
979
1031
|
});
|
|
@@ -981,68 +1033,68 @@ async function Xo(e = {}) {
|
|
|
981
1033
|
openPanel: () => {
|
|
982
1034
|
pe(b.value, !1);
|
|
983
1035
|
},
|
|
984
|
-
updateDisplayState: (
|
|
985
|
-
if (
|
|
986
|
-
|
|
1036
|
+
updateDisplayState: (a) => {
|
|
1037
|
+
if (a === "shown") {
|
|
1038
|
+
Ie("shown", !1);
|
|
987
1039
|
return;
|
|
988
1040
|
}
|
|
989
|
-
|
|
1041
|
+
Ie("minimized", !1);
|
|
990
1042
|
},
|
|
991
1043
|
destroy: () => {
|
|
992
|
-
|
|
1044
|
+
Be || (Be = !0, Pt.disconnect(), zt?.disconnect(), no(), window.removeEventListener("resize", Nt), Dt(), L !== null && window.clearTimeout(L), Ft(), ve?.remove(), w.destroy(), o.remove());
|
|
993
1045
|
}
|
|
994
1046
|
};
|
|
995
|
-
async function
|
|
996
|
-
if (!
|
|
997
|
-
|
|
1047
|
+
async function po(a) {
|
|
1048
|
+
if (!Ge) {
|
|
1049
|
+
Ge = a.id, Ne = null, B(w.getState());
|
|
998
1050
|
try {
|
|
999
1051
|
if (!t.socialPostDraftHandler)
|
|
1000
1052
|
throw new Error("Social post drafting is not available here.");
|
|
1001
|
-
const s = await t.socialPostDraftHandler(
|
|
1053
|
+
const s = await t.socialPostDraftHandler(a);
|
|
1002
1054
|
if (!s.linkedinPost || !s.xPost)
|
|
1003
1055
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1004
|
-
|
|
1056
|
+
xe.add(a.id), ze.add(a.id), H(), ve?.remove(), ve = ua(s, {
|
|
1005
1057
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1006
1058
|
onClose: () => {
|
|
1007
|
-
|
|
1059
|
+
ve?.remove(), ve = null;
|
|
1008
1060
|
}
|
|
1009
|
-
}), i.appendChild(
|
|
1061
|
+
}), i.appendChild(ve);
|
|
1010
1062
|
} catch (s) {
|
|
1011
|
-
|
|
1063
|
+
Ne = s instanceof Error ? s.message : "Could not draft social post.";
|
|
1012
1064
|
} finally {
|
|
1013
|
-
|
|
1065
|
+
Ge = null, B(w.getState());
|
|
1014
1066
|
}
|
|
1015
1067
|
}
|
|
1016
1068
|
}
|
|
1017
|
-
function
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
),
|
|
1023
|
-
accentColor:
|
|
1024
|
-
colorScheme:
|
|
1069
|
+
function pt(a, s) {
|
|
1070
|
+
const x = a.accentColor ?? t.accentColor, A = a.colorScheme ?? t.colorScheme, N = a.fontFamily ?? t.fontFamily, st = a.scribbleStyle ?? t.scribbleStyle;
|
|
1071
|
+
r = on(
|
|
1072
|
+
x,
|
|
1073
|
+
st
|
|
1074
|
+
), an(i, r, {
|
|
1075
|
+
accentColor: x,
|
|
1076
|
+
colorScheme: A,
|
|
1025
1077
|
fontFamily: N,
|
|
1026
|
-
scribbleStyle:
|
|
1078
|
+
scribbleStyle: st
|
|
1027
1079
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1028
1080
|
source: s,
|
|
1029
|
-
inputAppearance:
|
|
1030
|
-
appliedAccentColor:
|
|
1031
|
-
appliedColorScheme:
|
|
1081
|
+
inputAppearance: a,
|
|
1082
|
+
appliedAccentColor: x,
|
|
1083
|
+
appliedColorScheme: A,
|
|
1032
1084
|
appliedFontFamily: N,
|
|
1033
|
-
appliedScribbleStyle:
|
|
1085
|
+
appliedScribbleStyle: st,
|
|
1034
1086
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1035
1087
|
});
|
|
1036
1088
|
}
|
|
1037
1089
|
}
|
|
1038
|
-
function
|
|
1090
|
+
function on(e, t) {
|
|
1039
1091
|
return { accentColor: e, scribbleStyle: t };
|
|
1040
1092
|
}
|
|
1041
|
-
function
|
|
1042
|
-
const t =
|
|
1043
|
-
return t === null ? "#fafafa" :
|
|
1093
|
+
function ci(e) {
|
|
1094
|
+
const t = ui(e);
|
|
1095
|
+
return t === null ? "#fafafa" : gi(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1044
1096
|
}
|
|
1045
|
-
function
|
|
1097
|
+
function ui(e) {
|
|
1046
1098
|
const t = e.trim();
|
|
1047
1099
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1048
1100
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1054,14 +1106,14 @@ function Jo(e) {
|
|
|
1054
1106
|
Number.parseInt(t[3] + t[3], 16)
|
|
1055
1107
|
] : null;
|
|
1056
1108
|
}
|
|
1057
|
-
function
|
|
1109
|
+
function gi([e, t, o]) {
|
|
1058
1110
|
const n = (i) => {
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1111
|
+
const r = i / 255;
|
|
1112
|
+
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1061
1113
|
};
|
|
1062
1114
|
return 0.2126 * n(e) + 0.7152 * n(t) + 0.0722 * n(o);
|
|
1063
1115
|
}
|
|
1064
|
-
function
|
|
1116
|
+
function an(e, t, o) {
|
|
1065
1117
|
e.classList.toggle(
|
|
1066
1118
|
"pluno-pa-widget--dark",
|
|
1067
1119
|
o.colorScheme === "dark"
|
|
@@ -1069,27 +1121,27 @@ function Xt(e, t, o) {
|
|
|
1069
1121
|
"pluno-pa-widget--light",
|
|
1070
1122
|
o.colorScheme !== "dark"
|
|
1071
1123
|
), e.classList.toggle("pluno-pa-widget--scribble", o.scribbleStyle);
|
|
1072
|
-
const n = o.scribbleStyle ?
|
|
1124
|
+
const n = o.scribbleStyle ? yn(o.accentColor) : o.accentColor;
|
|
1073
1125
|
e.style.setProperty("--pluno-pa-accent", n), o.scribbleStyle ? e.style.setProperty(
|
|
1074
1126
|
"--pluno-pa-accent-contrast",
|
|
1075
|
-
|
|
1076
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = o.scribbleStyle ?
|
|
1127
|
+
ci(n)
|
|
1128
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = o.scribbleStyle ? jo : o.fontFamily, o.scribbleStyle && hi(e.ownerDocument);
|
|
1077
1129
|
const i = Array.from(
|
|
1078
1130
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1079
1131
|
);
|
|
1080
|
-
for (const
|
|
1081
|
-
|
|
1132
|
+
for (const r of i)
|
|
1133
|
+
r.replaceWith(
|
|
1082
1134
|
se(
|
|
1083
|
-
Array.from(
|
|
1135
|
+
Array.from(r.classList).join(" "),
|
|
1084
1136
|
t
|
|
1085
1137
|
)
|
|
1086
1138
|
);
|
|
1087
1139
|
}
|
|
1088
|
-
function
|
|
1089
|
-
if (e.getElementById(
|
|
1140
|
+
function hi(e) {
|
|
1141
|
+
if (e.getElementById(Xt))
|
|
1090
1142
|
return;
|
|
1091
1143
|
const t = e.createElement("style");
|
|
1092
|
-
t.id =
|
|
1144
|
+
t.id = Xt, t.textContent = `@font-face {
|
|
1093
1145
|
font-family: "Architects Daughter";
|
|
1094
1146
|
font-style: normal;
|
|
1095
1147
|
font-weight: 400;
|
|
@@ -1097,201 +1149,201 @@ function ei(e) {
|
|
|
1097
1149
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1098
1150
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1099
1151
|
}
|
|
1100
|
-
function
|
|
1152
|
+
function mi({
|
|
1101
1153
|
root: e,
|
|
1102
1154
|
launcher: t,
|
|
1103
1155
|
launcherDragHandle: o,
|
|
1104
1156
|
getPosition: n,
|
|
1105
1157
|
setPosition: i,
|
|
1106
|
-
persist:
|
|
1158
|
+
persist: r
|
|
1107
1159
|
}) {
|
|
1108
1160
|
let l = null, p = null, c = null, u = !1, d = null;
|
|
1109
1161
|
const g = () => {
|
|
1110
1162
|
l = null, p = null, c = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1111
|
-
},
|
|
1163
|
+
}, E = (h) => {
|
|
1112
1164
|
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 }, c = n(), u = !1, t.setPointerCapture?.(h.pointerId));
|
|
1113
1165
|
}, f = (h) => {
|
|
1114
1166
|
if (l !== h.pointerId || !p || !c)
|
|
1115
1167
|
return;
|
|
1116
1168
|
h.preventDefault();
|
|
1117
|
-
const
|
|
1118
|
-
!u && Math.hypot(
|
|
1119
|
-
},
|
|
1120
|
-
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), u && (d = { x: h.clientX, y: h.clientY },
|
|
1169
|
+
const T = h.clientX - p.x, D = h.clientY - p.y;
|
|
1170
|
+
!u && Math.hypot(T, D) < tn || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: c.x + T, y: c.y + D }));
|
|
1171
|
+
}, U = (h) => {
|
|
1172
|
+
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), u && (d = { x: h.clientX, y: h.clientY }, r()), g());
|
|
1121
1173
|
}, k = (h) => {
|
|
1122
1174
|
l === h.pointerId && (h.preventDefault(), g());
|
|
1123
|
-
},
|
|
1175
|
+
}, v = (h) => {
|
|
1124
1176
|
if (!d)
|
|
1125
1177
|
return;
|
|
1126
|
-
const
|
|
1178
|
+
const T = Math.hypot(
|
|
1127
1179
|
h.clientX - d.x,
|
|
1128
1180
|
h.clientY - d.y
|
|
1129
|
-
) <=
|
|
1130
|
-
d = null,
|
|
1131
|
-
},
|
|
1181
|
+
) <= tn;
|
|
1182
|
+
d = null, T && (h.preventDefault(), h.stopPropagation());
|
|
1183
|
+
}, y = (h) => {
|
|
1132
1184
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1133
1185
|
return;
|
|
1134
|
-
const
|
|
1186
|
+
const T = h.shiftKey ? li : ri, D = n();
|
|
1135
1187
|
let I = null;
|
|
1136
|
-
h.key === "ArrowUp" ? I = { x:
|
|
1188
|
+
h.key === "ArrowUp" ? I = { x: D.x, y: D.y - T } : h.key === "ArrowDown" ? I = { x: D.x, y: D.y + T } : h.key === "ArrowLeft" ? I = { x: D.x - T, y: D.y } : h.key === "ArrowRight" && (I = { x: D.x + T, y: D.y }), I && (h.preventDefault(), h.stopPropagation(), i(I), r());
|
|
1137
1189
|
};
|
|
1138
|
-
return t.addEventListener("pointerdown",
|
|
1139
|
-
t.removeEventListener("pointerdown",
|
|
1190
|
+
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", f), t.addEventListener("pointerup", U), t.addEventListener("pointercancel", k), t.addEventListener("click", v, !0), o.addEventListener("keydown", y), () => {
|
|
1191
|
+
t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", f), t.removeEventListener("pointerup", U), t.removeEventListener("pointercancel", k), t.removeEventListener("click", v, !0), o.removeEventListener("keydown", y);
|
|
1140
1192
|
};
|
|
1141
1193
|
}
|
|
1142
|
-
function
|
|
1194
|
+
function Ye(e, t = !0) {
|
|
1143
1195
|
const o = ne();
|
|
1144
1196
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1145
1197
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1146
|
-
width:
|
|
1147
|
-
height:
|
|
1148
|
-
} : { width:
|
|
1198
|
+
width: Vo,
|
|
1199
|
+
height: Ko
|
|
1200
|
+
} : { width: Zt, height: Zt };
|
|
1149
1201
|
const n = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1150
1202
|
return {
|
|
1151
|
-
width: t && i && n.width > 0 ? n.width : Math.min(
|
|
1152
|
-
height: t && i && n.height > 0 ? n.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1203
|
+
width: t && i && n.width > 0 ? n.width : Math.min(Ln, o.width - 36),
|
|
1204
|
+
height: t && i && n.height > 0 ? n.height : e.classList.contains("pluno-pa-widget--scribble") ? Xo : In
|
|
1153
1205
|
};
|
|
1154
1206
|
}
|
|
1155
|
-
function
|
|
1207
|
+
function Nn() {
|
|
1156
1208
|
const e = ne();
|
|
1157
1209
|
return {
|
|
1158
1210
|
width: Math.min(
|
|
1159
|
-
|
|
1160
|
-
e.width *
|
|
1161
|
-
|
|
1162
|
-
|
|
1211
|
+
Ee(
|
|
1212
|
+
e.width * Qo,
|
|
1213
|
+
Zo,
|
|
1214
|
+
Jo
|
|
1163
1215
|
),
|
|
1164
|
-
e.width -
|
|
1216
|
+
e.width - F * 2
|
|
1165
1217
|
),
|
|
1166
1218
|
height: Math.min(
|
|
1167
|
-
|
|
1168
|
-
e.height *
|
|
1169
|
-
|
|
1170
|
-
|
|
1219
|
+
Ee(
|
|
1220
|
+
e.height * ni,
|
|
1221
|
+
ei,
|
|
1222
|
+
ti
|
|
1171
1223
|
),
|
|
1172
|
-
e.height -
|
|
1224
|
+
e.height - xt - F
|
|
1173
1225
|
)
|
|
1174
1226
|
};
|
|
1175
1227
|
}
|
|
1176
|
-
function
|
|
1228
|
+
function bi(e, t, o) {
|
|
1177
1229
|
const n = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1178
1230
|
if (Number.isFinite(n) && Number.isFinite(i))
|
|
1179
1231
|
return { x: n, y: i };
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1182
|
-
return { x:
|
|
1232
|
+
const r = e.getBoundingClientRect();
|
|
1233
|
+
if (r.width > 0 || r.height > 0)
|
|
1234
|
+
return { x: r.left, y: r.top };
|
|
1183
1235
|
const l = ne();
|
|
1184
1236
|
return {
|
|
1185
1237
|
x: t === "bottom-left" ? 26 : l.width - 26 - o.width,
|
|
1186
1238
|
y: l.height - 24 - o.height
|
|
1187
1239
|
};
|
|
1188
1240
|
}
|
|
1189
|
-
function
|
|
1190
|
-
const n =
|
|
1191
|
-
return t ?
|
|
1241
|
+
function ct(e, t, o) {
|
|
1242
|
+
const n = Ye(e, !1);
|
|
1243
|
+
return t ? vt(
|
|
1192
1244
|
e,
|
|
1193
|
-
|
|
1245
|
+
Dn(t, n),
|
|
1194
1246
|
n
|
|
1195
|
-
) :
|
|
1247
|
+
) : fi(o === "bottom-left" ? "bottom-left" : "bottom-right", n, Yo);
|
|
1196
1248
|
}
|
|
1197
|
-
function
|
|
1249
|
+
function fi(e, t, o) {
|
|
1198
1250
|
const n = ne();
|
|
1199
1251
|
return {
|
|
1200
1252
|
x: e.endsWith("right") ? Math.max(0, n.width - t.width - o) : o,
|
|
1201
1253
|
y: e.startsWith("bottom") ? Math.max(0, n.height - t.height - o) : o
|
|
1202
1254
|
};
|
|
1203
1255
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const n = ne(), i =
|
|
1256
|
+
function vt(e, t, o) {
|
|
1257
|
+
const n = ne(), i = F + xi(e);
|
|
1206
1258
|
return {
|
|
1207
|
-
x:
|
|
1259
|
+
x: Ee(
|
|
1208
1260
|
t.x,
|
|
1209
|
-
|
|
1261
|
+
F,
|
|
1210
1262
|
Math.max(
|
|
1211
|
-
|
|
1212
|
-
n.width - o.width -
|
|
1263
|
+
F,
|
|
1264
|
+
n.width - o.width - F
|
|
1213
1265
|
)
|
|
1214
1266
|
),
|
|
1215
|
-
y:
|
|
1267
|
+
y: Ee(
|
|
1216
1268
|
t.y,
|
|
1217
1269
|
i,
|
|
1218
1270
|
Math.max(
|
|
1219
1271
|
i,
|
|
1220
|
-
n.height - o.height -
|
|
1272
|
+
n.height - o.height - F
|
|
1221
1273
|
)
|
|
1222
1274
|
)
|
|
1223
1275
|
};
|
|
1224
1276
|
}
|
|
1225
|
-
function
|
|
1277
|
+
function Dn(e, t) {
|
|
1226
1278
|
const o = ne();
|
|
1227
1279
|
return {
|
|
1228
1280
|
x: e.anchor.endsWith("right") ? o.width - t.width - e.x : e.x,
|
|
1229
1281
|
y: e.anchor.startsWith("bottom") ? o.height - t.height - e.y : e.y
|
|
1230
1282
|
};
|
|
1231
1283
|
}
|
|
1232
|
-
function
|
|
1233
|
-
const o =
|
|
1284
|
+
function wi(e, t) {
|
|
1285
|
+
const o = _i(e, t), n = ne();
|
|
1234
1286
|
return {
|
|
1235
1287
|
anchor: o,
|
|
1236
1288
|
x: o.endsWith("right") ? n.width - e.x - t.width : e.x,
|
|
1237
1289
|
y: o.startsWith("bottom") ? n.height - e.y - t.height : e.y
|
|
1238
1290
|
};
|
|
1239
1291
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const o = ne(), n = e.x + t.width / 2,
|
|
1242
|
-
return `${
|
|
1292
|
+
function _i(e, t) {
|
|
1293
|
+
const o = ne(), n = e.x + t.width / 2, r = e.y + t.height / 2 <= o.height / 2 ? "top" : "bottom", l = n <= o.width / 2 ? "left" : "right";
|
|
1294
|
+
return `${r}-${l}`;
|
|
1243
1295
|
}
|
|
1244
|
-
function
|
|
1245
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1296
|
+
function xi(e) {
|
|
1297
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? ai : ii;
|
|
1246
1298
|
}
|
|
1247
|
-
function
|
|
1248
|
-
const n =
|
|
1299
|
+
function rn(e, t, o) {
|
|
1300
|
+
const n = Ye(e), i = Nn(), r = {
|
|
1249
1301
|
x: o === "bottom-left" ? t.x : t.x + n.width - i.width,
|
|
1250
1302
|
y: t.y + n.height - i.height
|
|
1251
1303
|
};
|
|
1252
|
-
return
|
|
1304
|
+
return vi(r);
|
|
1253
1305
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const t = ne(), o =
|
|
1306
|
+
function vi(e) {
|
|
1307
|
+
const t = ne(), o = Nn();
|
|
1256
1308
|
return {
|
|
1257
|
-
x:
|
|
1309
|
+
x: Ee(
|
|
1258
1310
|
e.x,
|
|
1259
|
-
|
|
1311
|
+
F,
|
|
1260
1312
|
Math.max(
|
|
1261
|
-
|
|
1262
|
-
t.width - o.width -
|
|
1313
|
+
F,
|
|
1314
|
+
t.width - o.width - F
|
|
1263
1315
|
)
|
|
1264
1316
|
),
|
|
1265
|
-
y:
|
|
1317
|
+
y: Ee(
|
|
1266
1318
|
e.y,
|
|
1267
|
-
|
|
1319
|
+
xt,
|
|
1268
1320
|
Math.max(
|
|
1269
|
-
|
|
1270
|
-
t.height - o.height -
|
|
1321
|
+
xt,
|
|
1322
|
+
t.height - o.height - F
|
|
1271
1323
|
)
|
|
1272
1324
|
)
|
|
1273
1325
|
};
|
|
1274
1326
|
}
|
|
1275
|
-
function
|
|
1327
|
+
function we(e, t) {
|
|
1276
1328
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1277
1329
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1278
1330
|
return;
|
|
1279
1331
|
}
|
|
1280
1332
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1281
1333
|
}
|
|
1282
|
-
function
|
|
1334
|
+
function yi(e, t) {
|
|
1283
1335
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1284
1336
|
}
|
|
1285
|
-
function
|
|
1337
|
+
function ln(e) {
|
|
1286
1338
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1287
1339
|
}
|
|
1288
1340
|
function ne() {
|
|
1289
1341
|
return {
|
|
1290
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1291
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1342
|
+
width: window.innerWidth || document.documentElement.clientWidth || Ln + F * 2,
|
|
1343
|
+
height: window.innerHeight || document.documentElement.clientHeight || In + F * 2
|
|
1292
1344
|
};
|
|
1293
1345
|
}
|
|
1294
|
-
function
|
|
1346
|
+
function ut(e) {
|
|
1295
1347
|
const t = e.getBoundingClientRect();
|
|
1296
1348
|
return {
|
|
1297
1349
|
x: Math.round(t.x),
|
|
@@ -1300,7 +1352,7 @@ function lt(e) {
|
|
|
1300
1352
|
height: Math.round(t.height)
|
|
1301
1353
|
};
|
|
1302
1354
|
}
|
|
1303
|
-
function
|
|
1355
|
+
function Ee(e, t, o) {
|
|
1304
1356
|
return Math.min(Math.max(e, t), o);
|
|
1305
1357
|
}
|
|
1306
1358
|
function J(e, t, o) {
|
|
@@ -1311,34 +1363,34 @@ function J(e, t, o) {
|
|
|
1311
1363
|
source: e,
|
|
1312
1364
|
message: t,
|
|
1313
1365
|
details: o
|
|
1314
|
-
},
|
|
1315
|
-
|
|
1316
|
-
new CustomEvent(
|
|
1366
|
+
}, r = n.__plunoProductAgentDiagnostics__ ?? [];
|
|
1367
|
+
r.push(i), r.length > 120 && r.splice(0, r.length - 120), n.__plunoProductAgentDiagnostics__ = r, n.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1368
|
+
new CustomEvent(Ho, { detail: i })
|
|
1317
1369
|
);
|
|
1318
1370
|
}
|
|
1319
|
-
function
|
|
1371
|
+
function Ci(e, t) {
|
|
1320
1372
|
J("web-sdk.widget.position", e, t);
|
|
1321
1373
|
}
|
|
1322
|
-
function
|
|
1374
|
+
function gt(e, t, o) {
|
|
1323
1375
|
const n = t.value.trim();
|
|
1324
1376
|
return !n && o.length === 0 ? o : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(n, {
|
|
1325
|
-
attachments: o.length > 0 ? o.map(
|
|
1377
|
+
attachments: o.length > 0 ? o.map(Si) : void 0
|
|
1326
1378
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1327
1379
|
}
|
|
1328
|
-
function
|
|
1380
|
+
function Si(e) {
|
|
1329
1381
|
return e;
|
|
1330
1382
|
}
|
|
1331
|
-
function
|
|
1383
|
+
function De(e) {
|
|
1332
1384
|
e.style.height = "0px";
|
|
1333
1385
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1334
1386
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1335
1387
|
}
|
|
1336
|
-
function
|
|
1388
|
+
function Re(e, t = () => !0) {
|
|
1337
1389
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1338
1390
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1339
1391
|
});
|
|
1340
1392
|
}
|
|
1341
|
-
function
|
|
1393
|
+
function Ei(e) {
|
|
1342
1394
|
const t = e.messages[e.messages.length - 1];
|
|
1343
1395
|
return [
|
|
1344
1396
|
e.messages.length,
|
|
@@ -1349,13 +1401,13 @@ function ci(e) {
|
|
|
1349
1401
|
e.lastError ?? ""
|
|
1350
1402
|
].join(":");
|
|
1351
1403
|
}
|
|
1352
|
-
function
|
|
1404
|
+
function ki(e) {
|
|
1353
1405
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1354
1406
|
}
|
|
1355
|
-
function
|
|
1407
|
+
function Li(e) {
|
|
1356
1408
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1357
1409
|
}
|
|
1358
|
-
function
|
|
1410
|
+
function Ii(e) {
|
|
1359
1411
|
const t = e.currentPage;
|
|
1360
1412
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1361
1413
|
try {
|
|
@@ -1366,7 +1418,7 @@ function hi(e) {
|
|
|
1366
1418
|
}
|
|
1367
1419
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1368
1420
|
}
|
|
1369
|
-
function
|
|
1421
|
+
function Ai(e, t) {
|
|
1370
1422
|
const o = new Date(e).getTime();
|
|
1371
1423
|
if (!Number.isFinite(o))
|
|
1372
1424
|
return "now";
|
|
@@ -1375,38 +1427,38 @@ function mi(e, t) {
|
|
|
1375
1427
|
["hour", 36e5],
|
|
1376
1428
|
["min", 6e4]
|
|
1377
1429
|
];
|
|
1378
|
-
for (const [
|
|
1430
|
+
for (const [r, l] of i)
|
|
1379
1431
|
if (n >= l) {
|
|
1380
1432
|
const p = Math.max(1, Math.floor(n / l));
|
|
1381
|
-
return
|
|
1433
|
+
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
1382
1434
|
}
|
|
1383
1435
|
return "now";
|
|
1384
1436
|
}
|
|
1385
|
-
function
|
|
1386
|
-
e.appendChild(
|
|
1387
|
-
|
|
1437
|
+
function Pi(e, t, o, n, i) {
|
|
1438
|
+
e.appendChild(Bi()), e.appendChild(
|
|
1439
|
+
Ti(
|
|
1388
1440
|
t,
|
|
1389
1441
|
o,
|
|
1390
1442
|
n,
|
|
1391
1443
|
i
|
|
1392
1444
|
)
|
|
1393
1445
|
), e.appendChild(
|
|
1394
|
-
|
|
1446
|
+
Xe(
|
|
1395
1447
|
"pluno-pa-widget__close",
|
|
1396
1448
|
"Close",
|
|
1397
|
-
|
|
1449
|
+
Ui(16),
|
|
1398
1450
|
!0
|
|
1399
1451
|
)
|
|
1400
|
-
), e.appendChild(
|
|
1452
|
+
), e.appendChild(Ni(o));
|
|
1401
1453
|
}
|
|
1402
|
-
function
|
|
1454
|
+
function Ti(e, t, o, n) {
|
|
1403
1455
|
const i = document.createElement("form");
|
|
1404
1456
|
if (i.className = "pluno-pa-widget__launcher", n && i.classList.add("pluno-pa-widget__launcher--minimizable"), o) {
|
|
1405
1457
|
const l = document.createElement("button");
|
|
1406
1458
|
l.type = "button", l.className = "pluno-pa-widget__launcher-drag-handle", l.setAttribute("aria-label", "Move Pluno launcher"), l.title = "Move Pluno launcher", i.appendChild(l);
|
|
1407
1459
|
}
|
|
1408
1460
|
i.appendChild(
|
|
1409
|
-
|
|
1461
|
+
zn(
|
|
1410
1462
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1411
1463
|
10
|
|
1412
1464
|
)
|
|
@@ -1416,39 +1468,39 @@ function fi(e, t, o, n) {
|
|
|
1416
1468
|
t
|
|
1417
1469
|
)
|
|
1418
1470
|
);
|
|
1419
|
-
const
|
|
1420
|
-
if (
|
|
1471
|
+
const r = document.createElement("input");
|
|
1472
|
+
if (r.className = "pluno-pa-widget__launcher-input", r.type = "text", r.placeholder = e, r.setAttribute("aria-label", e), i.appendChild(r), n) {
|
|
1421
1473
|
const l = document.createElement("button");
|
|
1422
1474
|
l.type = "button", l.className = "pluno-pa-widget__launcher-minimize", l.textContent = "-", l.setAttribute("aria-label", "Minimize Pluno on this site"), l.title = "Minimize Pluno on this site", i.appendChild(l);
|
|
1423
1475
|
}
|
|
1424
1476
|
return i;
|
|
1425
1477
|
}
|
|
1426
|
-
function
|
|
1478
|
+
function Ni(e) {
|
|
1427
1479
|
const t = document.createElement("section");
|
|
1428
1480
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1429
|
-
|
|
1481
|
+
zn("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1430
1482
|
);
|
|
1431
1483
|
const o = document.createElement("div");
|
|
1432
1484
|
o.className = "pluno-pa-widget__timeline-wrap";
|
|
1433
1485
|
const n = document.createElement("main");
|
|
1434
|
-
n.className = "pluno-pa-widget__timeline", n.appendChild(
|
|
1486
|
+
n.className = "pluno-pa-widget__timeline", n.appendChild(Mi(e));
|
|
1435
1487
|
const i = document.createElement("div");
|
|
1436
1488
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), n.appendChild(i), o.appendChild(n);
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1489
|
+
const r = document.createElement("div");
|
|
1490
|
+
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, o.appendChild(r);
|
|
1439
1491
|
const l = document.createElement("button");
|
|
1440
1492
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, o.appendChild(l);
|
|
1441
1493
|
const p = document.createElement("div");
|
|
1442
1494
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1443
|
-
|
|
1495
|
+
Xe(
|
|
1444
1496
|
"pluno-pa-widget__history",
|
|
1445
1497
|
"Recent chats",
|
|
1446
|
-
|
|
1498
|
+
Fi(),
|
|
1447
1499
|
!0
|
|
1448
1500
|
)
|
|
1449
|
-
), o.appendChild(p), o.appendChild(
|
|
1501
|
+
), o.appendChild(p), o.appendChild(Ri()), t.appendChild(o), t.appendChild(Di()), t;
|
|
1450
1502
|
}
|
|
1451
|
-
function
|
|
1503
|
+
function Di() {
|
|
1452
1504
|
const e = document.createElement("form");
|
|
1453
1505
|
e.className = "pluno-pa-widget__composer";
|
|
1454
1506
|
const t = document.createElement("div");
|
|
@@ -1459,14 +1511,14 @@ function _i() {
|
|
|
1459
1511
|
n.className = "pluno-pa-widget__attachments", n.hidden = !0, e.appendChild(n);
|
|
1460
1512
|
const i = document.createElement("div");
|
|
1461
1513
|
i.className = "pluno-pa-widget__composer-inner";
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1514
|
+
const r = document.createElement("input");
|
|
1515
|
+
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1464
1516
|
const l = document.createElement("button");
|
|
1465
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1517
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Gi()), l.appendChild($i()), i.appendChild(l);
|
|
1466
1518
|
const p = document.createElement("textarea");
|
|
1467
1519
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1468
1520
|
const c = document.createElement("button");
|
|
1469
|
-
c.type = "button", c.className = "pluno-pa-widget__send", c.setAttribute("aria-label", "Send"), c.appendChild(
|
|
1521
|
+
c.type = "button", c.className = "pluno-pa-widget__send", c.setAttribute("aria-label", "Send"), c.appendChild(Bn()), i.appendChild(c), e.appendChild(i);
|
|
1470
1522
|
const u = document.createElement("div");
|
|
1471
1523
|
u.className = "pluno-pa-widget__composer-meta";
|
|
1472
1524
|
const d = document.createElement("a");
|
|
@@ -1474,39 +1526,39 @@ function _i() {
|
|
|
1474
1526
|
const g = document.createElement("span");
|
|
1475
1527
|
return g.className = "pluno-pa-widget__ai-disclaimer", g.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(g), e.appendChild(u), e;
|
|
1476
1528
|
}
|
|
1477
|
-
function
|
|
1529
|
+
function Ri() {
|
|
1478
1530
|
const e = document.createElement("section");
|
|
1479
1531
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", "Recent chats");
|
|
1480
1532
|
const t = document.createElement("div");
|
|
1481
1533
|
t.className = "pluno-pa-widget__history-header";
|
|
1482
1534
|
const o = document.createElement("strong");
|
|
1483
1535
|
o.textContent = "Recent chats";
|
|
1484
|
-
const n =
|
|
1536
|
+
const n = Xe(
|
|
1485
1537
|
"pluno-pa-widget__history-close",
|
|
1486
1538
|
"Close recent chats",
|
|
1487
|
-
|
|
1539
|
+
Wi(),
|
|
1488
1540
|
!1
|
|
1489
1541
|
);
|
|
1490
1542
|
t.append(o, n);
|
|
1491
1543
|
const i = document.createElement("div");
|
|
1492
1544
|
i.className = "pluno-pa-widget__history-list";
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1545
|
+
const r = document.createElement("p");
|
|
1546
|
+
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1495
1547
|
}
|
|
1496
|
-
function
|
|
1548
|
+
function Mi(e) {
|
|
1497
1549
|
const t = document.createElement("div");
|
|
1498
1550
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1499
1551
|
se(
|
|
1500
1552
|
"pluno-pa-widget__character--empty",
|
|
1501
1553
|
e
|
|
1502
1554
|
)
|
|
1503
|
-
), t.appendChild(
|
|
1555
|
+
), t.appendChild(Rn()), t;
|
|
1504
1556
|
}
|
|
1505
|
-
function
|
|
1557
|
+
function Rn() {
|
|
1506
1558
|
const e = document.createElement("div");
|
|
1507
1559
|
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;
|
|
1508
1560
|
}
|
|
1509
|
-
function
|
|
1561
|
+
function Mn(e, t) {
|
|
1510
1562
|
e.replaceChildren(), e.setAttribute(
|
|
1511
1563
|
"aria-label",
|
|
1512
1564
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1519,16 +1571,16 @@ function Ln(e, t) {
|
|
|
1519
1571
|
);
|
|
1520
1572
|
}
|
|
1521
1573
|
function se(e, t) {
|
|
1522
|
-
const o = `pluno-pa-character-${
|
|
1523
|
-
|
|
1524
|
-
const n = t.scribbleStyle ?
|
|
1574
|
+
const o = `pluno-pa-character-${nn}`;
|
|
1575
|
+
nn += 1;
|
|
1576
|
+
const n = t.scribbleStyle ? zi(t.accentColor, o) : Oi(t.accentColor, o), i = e.split(/\s+/).filter(Boolean);
|
|
1525
1577
|
return n.setAttribute(
|
|
1526
1578
|
"class",
|
|
1527
1579
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1528
1580
|
), n.setAttribute("aria-hidden", "true"), n.setAttribute("focusable", "false"), n.removeAttribute("role"), n.removeAttribute("aria-label"), n;
|
|
1529
1581
|
}
|
|
1530
|
-
function
|
|
1531
|
-
const o =
|
|
1582
|
+
function Oi(e, t) {
|
|
1583
|
+
const o = go(e), n = {
|
|
1532
1584
|
boltFill: `${t}-boltFill`,
|
|
1533
1585
|
boltEdge: `${t}-boltEdge`,
|
|
1534
1586
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1539,7 +1591,7 @@ function yi(e, t) {
|
|
|
1539
1591
|
eyeShadow: `${t}-eyeShadow`,
|
|
1540
1592
|
pupilGloss: `${t}-pupilGloss`,
|
|
1541
1593
|
boltClip: `${t}-boltClip`
|
|
1542
|
-
}, i =
|
|
1594
|
+
}, i = On(), r = m(i, "defs"), l = m(r, "linearGradient", {
|
|
1543
1595
|
id: n.boltFill,
|
|
1544
1596
|
x1: "420",
|
|
1545
1597
|
y1: "180",
|
|
@@ -1547,8 +1599,8 @@ function yi(e, t) {
|
|
|
1547
1599
|
y2: "1040",
|
|
1548
1600
|
gradientUnits: "userSpaceOnUse"
|
|
1549
1601
|
});
|
|
1550
|
-
|
|
1551
|
-
const p = m(
|
|
1602
|
+
M(l, "0", o.top), M(l, "0.36", o.middle), M(l, "0.72", o.bottom), M(l, "1", o.bottom);
|
|
1603
|
+
const p = m(r, "linearGradient", {
|
|
1552
1604
|
id: n.boltEdge,
|
|
1553
1605
|
x1: "470",
|
|
1554
1606
|
y1: "145",
|
|
@@ -1556,29 +1608,29 @@ function yi(e, t) {
|
|
|
1556
1608
|
y2: "980",
|
|
1557
1609
|
gradientUnits: "userSpaceOnUse"
|
|
1558
1610
|
});
|
|
1559
|
-
|
|
1560
|
-
const c = m(
|
|
1611
|
+
M(p, "0", o.edgeStart), M(p, "0.32", o.edgeMiddle), M(p, "0.78", o.edgeEnd), M(p, "1", o.edgeEnd);
|
|
1612
|
+
const c = m(r, "radialGradient", {
|
|
1561
1613
|
id: n.boltGlow,
|
|
1562
1614
|
cx: "50%",
|
|
1563
1615
|
cy: "22%",
|
|
1564
1616
|
r: "82%"
|
|
1565
1617
|
});
|
|
1566
|
-
|
|
1567
|
-
const u = m(
|
|
1618
|
+
M(c, "0", o.glow, "0.72"), M(c, "0.5", o.middle, "0.44"), M(c, "1", o.bottom, "0");
|
|
1619
|
+
const u = m(r, "radialGradient", {
|
|
1568
1620
|
id: n.eyeWhite,
|
|
1569
1621
|
cx: "35%",
|
|
1570
1622
|
cy: "25%",
|
|
1571
1623
|
r: "70%"
|
|
1572
1624
|
});
|
|
1573
|
-
|
|
1574
|
-
const d = m(
|
|
1625
|
+
M(u, "0", "#ffffff"), M(u, "0.72", "#ffffff"), M(u, "1", "#e5e5e5");
|
|
1626
|
+
const d = m(r, "radialGradient", {
|
|
1575
1627
|
id: n.pupil,
|
|
1576
1628
|
cx: "42%",
|
|
1577
1629
|
cy: "38%",
|
|
1578
1630
|
r: "65%"
|
|
1579
1631
|
});
|
|
1580
|
-
|
|
1581
|
-
const g = m(
|
|
1632
|
+
M(d, "0", "#2a1f10"), M(d, "0.52", "#080604"), M(d, "1", "#000000");
|
|
1633
|
+
const g = m(r, "filter", {
|
|
1582
1634
|
id: n.softDropShadow,
|
|
1583
1635
|
x: "-18%",
|
|
1584
1636
|
y: "-12%",
|
|
@@ -1593,7 +1645,7 @@ function yi(e, t) {
|
|
|
1593
1645
|
"flood-color": o.shadow,
|
|
1594
1646
|
"flood-opacity": "0.24"
|
|
1595
1647
|
});
|
|
1596
|
-
const
|
|
1648
|
+
const E = m(r, "filter", {
|
|
1597
1649
|
id: n.innerDepth,
|
|
1598
1650
|
x: "-8%",
|
|
1599
1651
|
y: "-8%",
|
|
@@ -1601,32 +1653,32 @@ function yi(e, t) {
|
|
|
1601
1653
|
height: "116%",
|
|
1602
1654
|
"color-interpolation-filters": "sRGB"
|
|
1603
1655
|
});
|
|
1604
|
-
m(
|
|
1656
|
+
m(E, "feGaussianBlur", {
|
|
1605
1657
|
in: "SourceAlpha",
|
|
1606
1658
|
stdDeviation: "8",
|
|
1607
1659
|
result: "blur"
|
|
1608
|
-
}), m(
|
|
1660
|
+
}), m(E, "feOffset", {
|
|
1609
1661
|
dx: "-7",
|
|
1610
1662
|
dy: "-9",
|
|
1611
1663
|
result: "topLeft"
|
|
1612
|
-
}), m(
|
|
1664
|
+
}), m(E, "feComposite", {
|
|
1613
1665
|
in: "topLeft",
|
|
1614
1666
|
in2: "SourceAlpha",
|
|
1615
1667
|
operator: "arithmetic",
|
|
1616
1668
|
k2: "-1",
|
|
1617
1669
|
k3: "1",
|
|
1618
1670
|
result: "innerShadow"
|
|
1619
|
-
}), m(
|
|
1671
|
+
}), m(E, "feColorMatrix", {
|
|
1620
1672
|
in: "innerShadow",
|
|
1621
1673
|
type: "matrix",
|
|
1622
1674
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1623
1675
|
result: "innerLight"
|
|
1624
|
-
}), m(
|
|
1676
|
+
}), m(E, "feBlend", {
|
|
1625
1677
|
in: "SourceGraphic",
|
|
1626
1678
|
in2: "innerLight",
|
|
1627
1679
|
mode: "screen"
|
|
1628
1680
|
});
|
|
1629
|
-
const f = m(
|
|
1681
|
+
const f = m(r, "filter", {
|
|
1630
1682
|
id: n.eyeShadow,
|
|
1631
1683
|
x: "-24%",
|
|
1632
1684
|
y: "-20%",
|
|
@@ -1641,7 +1693,7 @@ function yi(e, t) {
|
|
|
1641
1693
|
"flood-color": o.shadow,
|
|
1642
1694
|
"flood-opacity": "0.3"
|
|
1643
1695
|
});
|
|
1644
|
-
const
|
|
1696
|
+
const U = m(r, "filter", {
|
|
1645
1697
|
id: n.pupilGloss,
|
|
1646
1698
|
x: "-15%",
|
|
1647
1699
|
y: "-15%",
|
|
@@ -1649,33 +1701,33 @@ function yi(e, t) {
|
|
|
1649
1701
|
height: "130%",
|
|
1650
1702
|
"color-interpolation-filters": "sRGB"
|
|
1651
1703
|
});
|
|
1652
|
-
m(
|
|
1704
|
+
m(U, "feDropShadow", {
|
|
1653
1705
|
dx: "0",
|
|
1654
1706
|
dy: "3",
|
|
1655
1707
|
stdDeviation: "3",
|
|
1656
1708
|
"flood-color": "#000000",
|
|
1657
1709
|
"flood-opacity": "0.22"
|
|
1658
1710
|
});
|
|
1659
|
-
const k = m(
|
|
1660
|
-
m(k, "path", { d:
|
|
1661
|
-
const
|
|
1711
|
+
const k = m(r, "clipPath", { id: n.boltClip });
|
|
1712
|
+
m(k, "path", { d: Ve });
|
|
1713
|
+
const v = m(i, "g", {
|
|
1662
1714
|
filter: j(n.softDropShadow)
|
|
1663
1715
|
});
|
|
1664
|
-
m(
|
|
1665
|
-
d:
|
|
1716
|
+
m(v, "path", {
|
|
1717
|
+
d: Ve,
|
|
1666
1718
|
fill: j(n.boltEdge)
|
|
1667
1719
|
});
|
|
1668
|
-
const
|
|
1669
|
-
m(
|
|
1670
|
-
d:
|
|
1720
|
+
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";
|
|
1721
|
+
m(v, "path", {
|
|
1722
|
+
d: y,
|
|
1671
1723
|
fill: j(n.boltFill),
|
|
1672
1724
|
filter: j(n.innerDepth)
|
|
1673
|
-
}), m(
|
|
1674
|
-
d:
|
|
1725
|
+
}), m(v, "path", {
|
|
1726
|
+
d: y,
|
|
1675
1727
|
fill: j(n.boltGlow),
|
|
1676
1728
|
opacity: "0.74"
|
|
1677
1729
|
});
|
|
1678
|
-
const h = m(
|
|
1730
|
+
const h = m(v, "g", {
|
|
1679
1731
|
"clip-path": j(n.boltClip),
|
|
1680
1732
|
opacity: "0.42"
|
|
1681
1733
|
});
|
|
@@ -1701,9 +1753,9 @@ function yi(e, t) {
|
|
|
1701
1753
|
"stroke-linecap": "round",
|
|
1702
1754
|
opacity: "0.48"
|
|
1703
1755
|
});
|
|
1704
|
-
const
|
|
1705
|
-
return
|
|
1706
|
-
|
|
1756
|
+
const T = m(i, "g", { filter: j(n.eyeShadow) });
|
|
1757
|
+
return pn(
|
|
1758
|
+
T,
|
|
1707
1759
|
"rotate(-2 528 463)",
|
|
1708
1760
|
"528",
|
|
1709
1761
|
"463",
|
|
@@ -1712,8 +1764,8 @@ function yi(e, t) {
|
|
|
1712
1764
|
"557",
|
|
1713
1765
|
"447",
|
|
1714
1766
|
n
|
|
1715
|
-
),
|
|
1716
|
-
|
|
1767
|
+
), pn(
|
|
1768
|
+
T,
|
|
1717
1769
|
"rotate(2 717 462)",
|
|
1718
1770
|
"717",
|
|
1719
1771
|
"462",
|
|
@@ -1724,13 +1776,13 @@ function yi(e, t) {
|
|
|
1724
1776
|
n
|
|
1725
1777
|
), i;
|
|
1726
1778
|
}
|
|
1727
|
-
function
|
|
1728
|
-
const o =
|
|
1779
|
+
function zi(e, t) {
|
|
1780
|
+
const o = yn(e), n = {
|
|
1729
1781
|
clip: `${t}-scribbleBoltClip`,
|
|
1730
1782
|
wobble: `${t}-scribbleBoltWobble`
|
|
1731
|
-
}, i =
|
|
1732
|
-
m(l, "path", { d:
|
|
1733
|
-
const p = m(
|
|
1783
|
+
}, i = On(), r = m(i, "defs"), l = m(r, "clipPath", { id: n.clip });
|
|
1784
|
+
m(l, "path", { d: Ve });
|
|
1785
|
+
const p = m(r, "filter", {
|
|
1734
1786
|
id: n.wobble,
|
|
1735
1787
|
x: "-10%",
|
|
1736
1788
|
y: "-10%",
|
|
@@ -1755,7 +1807,7 @@ function Ci(e, t) {
|
|
|
1755
1807
|
"clip-path": j(n.clip)
|
|
1756
1808
|
});
|
|
1757
1809
|
return m(u, "path", {
|
|
1758
|
-
d:
|
|
1810
|
+
d: uo(),
|
|
1759
1811
|
fill: "none",
|
|
1760
1812
|
stroke: o,
|
|
1761
1813
|
"stroke-width": "56",
|
|
@@ -1764,12 +1816,12 @@ function Ci(e, t) {
|
|
|
1764
1816
|
opacity: "0.9",
|
|
1765
1817
|
transform: "rotate(-14 627 600)"
|
|
1766
1818
|
}), m(c, "path", {
|
|
1767
|
-
d:
|
|
1819
|
+
d: Ve,
|
|
1768
1820
|
fill: "none",
|
|
1769
|
-
stroke:
|
|
1821
|
+
stroke: Ke,
|
|
1770
1822
|
"stroke-width": "18",
|
|
1771
1823
|
"stroke-linejoin": "round"
|
|
1772
|
-
}),
|
|
1824
|
+
}), sn(
|
|
1773
1825
|
c,
|
|
1774
1826
|
"rotate(-2 528 463)",
|
|
1775
1827
|
"528",
|
|
@@ -1778,7 +1830,7 @@ function Ci(e, t) {
|
|
|
1778
1830
|
"473",
|
|
1779
1831
|
"557",
|
|
1780
1832
|
"447"
|
|
1781
|
-
),
|
|
1833
|
+
), sn(
|
|
1782
1834
|
c,
|
|
1783
1835
|
"rotate(2 717 462)",
|
|
1784
1836
|
"717",
|
|
@@ -1789,13 +1841,13 @@ function Ci(e, t) {
|
|
|
1789
1841
|
"447"
|
|
1790
1842
|
), i;
|
|
1791
1843
|
}
|
|
1792
|
-
function
|
|
1793
|
-
return
|
|
1794
|
-
xmlns:
|
|
1844
|
+
function On() {
|
|
1845
|
+
return C("svg", {
|
|
1846
|
+
xmlns: An,
|
|
1795
1847
|
viewBox: "0 0 1254 1254"
|
|
1796
1848
|
});
|
|
1797
1849
|
}
|
|
1798
|
-
function
|
|
1850
|
+
function pn(e, t, o, n, i, r, l, p, c) {
|
|
1799
1851
|
const u = m(e, "g", { transform: t });
|
|
1800
1852
|
m(u, "ellipse", {
|
|
1801
1853
|
cx: o,
|
|
@@ -1805,7 +1857,7 @@ function Qt(e, t, o, n, i, a, l, p, c) {
|
|
|
1805
1857
|
fill: j(c.eyeWhite)
|
|
1806
1858
|
}), m(u, "ellipse", {
|
|
1807
1859
|
cx: i,
|
|
1808
|
-
cy:
|
|
1860
|
+
cy: r,
|
|
1809
1861
|
rx: "49",
|
|
1810
1862
|
ry: "57",
|
|
1811
1863
|
fill: j(c.pupil),
|
|
@@ -1817,7 +1869,7 @@ function Qt(e, t, o, n, i, a, l, p, c) {
|
|
|
1817
1869
|
fill: "#ffffff"
|
|
1818
1870
|
});
|
|
1819
1871
|
}
|
|
1820
|
-
function
|
|
1872
|
+
function sn(e, t, o, n, i, r, l, p) {
|
|
1821
1873
|
const c = m(e, "g", { transform: t });
|
|
1822
1874
|
m(c, "ellipse", {
|
|
1823
1875
|
cx: o,
|
|
@@ -1825,14 +1877,14 @@ function en(e, t, o, n, i, a, l, p) {
|
|
|
1825
1877
|
rx: "73",
|
|
1826
1878
|
ry: "80",
|
|
1827
1879
|
fill: "#ffffff",
|
|
1828
|
-
stroke:
|
|
1880
|
+
stroke: Ke,
|
|
1829
1881
|
"stroke-width": "13"
|
|
1830
1882
|
}), m(c, "ellipse", {
|
|
1831
1883
|
cx: i,
|
|
1832
|
-
cy:
|
|
1884
|
+
cy: r,
|
|
1833
1885
|
rx: "45",
|
|
1834
1886
|
ry: "53",
|
|
1835
|
-
fill:
|
|
1887
|
+
fill: Ke
|
|
1836
1888
|
}), m(c, "circle", {
|
|
1837
1889
|
cx: l,
|
|
1838
1890
|
cy: p,
|
|
@@ -1841,71 +1893,71 @@ function en(e, t, o, n, i, a, l, p) {
|
|
|
1841
1893
|
});
|
|
1842
1894
|
}
|
|
1843
1895
|
function m(e, t, o = {}) {
|
|
1844
|
-
const n =
|
|
1896
|
+
const n = C(t, o);
|
|
1845
1897
|
return e.appendChild(n), n;
|
|
1846
1898
|
}
|
|
1847
|
-
function
|
|
1899
|
+
function M(e, t, o, n) {
|
|
1848
1900
|
const i = { offset: t, "stop-color": o };
|
|
1849
1901
|
n !== void 0 && (i["stop-opacity"] = n), m(e, "stop", i);
|
|
1850
1902
|
}
|
|
1851
1903
|
function j(e) {
|
|
1852
1904
|
return `url(#${e})`;
|
|
1853
1905
|
}
|
|
1854
|
-
function
|
|
1906
|
+
function Xe(e, t, o, n) {
|
|
1855
1907
|
const i = document.createElement("button");
|
|
1856
1908
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = n, i.appendChild(o), i;
|
|
1857
1909
|
}
|
|
1858
|
-
function
|
|
1859
|
-
const e =
|
|
1910
|
+
function Bi() {
|
|
1911
|
+
const e = C("svg", {
|
|
1860
1912
|
class: "pluno-pa-widget__scribble-defs",
|
|
1861
1913
|
"aria-hidden": "true",
|
|
1862
1914
|
focusable: "false",
|
|
1863
1915
|
width: "0",
|
|
1864
1916
|
height: "0"
|
|
1865
|
-
}), t =
|
|
1866
|
-
return t.appendChild(
|
|
1867
|
-
|
|
1917
|
+
}), t = C("defs");
|
|
1918
|
+
return t.appendChild(ht("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
1919
|
+
ht("pluno-pa-scribble-wobble-2", "5", "15")
|
|
1868
1920
|
), t.appendChild(
|
|
1869
|
-
|
|
1921
|
+
ht("pluno-pa-scribble-wobble-3", "9", "19")
|
|
1870
1922
|
), e.appendChild(t), e;
|
|
1871
1923
|
}
|
|
1872
|
-
function
|
|
1873
|
-
const o = t *
|
|
1924
|
+
function zn(e, t) {
|
|
1925
|
+
const o = t * Jt + Qt * 2, n = C("svg", {
|
|
1874
1926
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
1875
|
-
viewBox: `0 0 ${o} ${
|
|
1927
|
+
viewBox: `0 0 ${o} ${oi}`,
|
|
1876
1928
|
preserveAspectRatio: "xMidYMid meet",
|
|
1877
1929
|
"aria-hidden": "true",
|
|
1878
1930
|
focusable: "false"
|
|
1879
1931
|
});
|
|
1880
1932
|
for (let i = 0; i < t; i += 1) {
|
|
1881
|
-
const
|
|
1882
|
-
transform: `translate(${
|
|
1933
|
+
const r = en[i % en.length], l = C("g", {
|
|
1934
|
+
transform: `translate(${Qt + i * Jt} 0)`
|
|
1883
1935
|
});
|
|
1884
1936
|
l.appendChild(
|
|
1885
|
-
|
|
1886
|
-
cx:
|
|
1887
|
-
cy:
|
|
1888
|
-
rx:
|
|
1889
|
-
ry:
|
|
1937
|
+
C("ellipse", {
|
|
1938
|
+
cx: r.ellipseCx,
|
|
1939
|
+
cy: r.ellipseCy,
|
|
1940
|
+
rx: r.ellipseRx,
|
|
1941
|
+
ry: r.ellipseRy,
|
|
1890
1942
|
fill: "none",
|
|
1891
1943
|
stroke: "#2c2a1e",
|
|
1892
|
-
"stroke-width":
|
|
1944
|
+
"stroke-width": r.strokeWidth,
|
|
1893
1945
|
opacity: "0.8"
|
|
1894
1946
|
})
|
|
1895
1947
|
), l.appendChild(
|
|
1896
|
-
|
|
1897
|
-
d:
|
|
1948
|
+
C("path", {
|
|
1949
|
+
d: r.path,
|
|
1898
1950
|
fill: "none",
|
|
1899
1951
|
stroke: "#2c2a1e",
|
|
1900
|
-
"stroke-width":
|
|
1952
|
+
"stroke-width": r.pathStrokeWidth,
|
|
1901
1953
|
"stroke-linecap": "round"
|
|
1902
1954
|
})
|
|
1903
1955
|
), n.appendChild(l);
|
|
1904
1956
|
}
|
|
1905
1957
|
return n;
|
|
1906
1958
|
}
|
|
1907
|
-
function
|
|
1908
|
-
const n =
|
|
1959
|
+
function ht(e, t, o) {
|
|
1960
|
+
const n = C("filter", {
|
|
1909
1961
|
id: e,
|
|
1910
1962
|
x: "-8%",
|
|
1911
1963
|
y: "-8%",
|
|
@@ -1913,7 +1965,7 @@ function st(e, t, o) {
|
|
|
1913
1965
|
height: "116%"
|
|
1914
1966
|
});
|
|
1915
1967
|
return n.appendChild(
|
|
1916
|
-
|
|
1968
|
+
C("feTurbulence", {
|
|
1917
1969
|
type: "fractalNoise",
|
|
1918
1970
|
baseFrequency: "0.012 0.028",
|
|
1919
1971
|
numOctaves: "3",
|
|
@@ -1921,7 +1973,7 @@ function st(e, t, o) {
|
|
|
1921
1973
|
result: "stroke-noise"
|
|
1922
1974
|
})
|
|
1923
1975
|
), n.appendChild(
|
|
1924
|
-
|
|
1976
|
+
C("feDisplacementMap", {
|
|
1925
1977
|
in: "SourceGraphic",
|
|
1926
1978
|
in2: "stroke-noise",
|
|
1927
1979
|
scale: "3.5",
|
|
@@ -1930,7 +1982,7 @@ function st(e, t, o) {
|
|
|
1930
1982
|
result: "warped"
|
|
1931
1983
|
})
|
|
1932
1984
|
), n.appendChild(
|
|
1933
|
-
|
|
1985
|
+
C("feTurbulence", {
|
|
1934
1986
|
type: "fractalNoise",
|
|
1935
1987
|
baseFrequency: "0.7",
|
|
1936
1988
|
numOctaves: "1",
|
|
@@ -1938,7 +1990,7 @@ function st(e, t, o) {
|
|
|
1938
1990
|
result: "ink-noise"
|
|
1939
1991
|
})
|
|
1940
1992
|
), n.appendChild(
|
|
1941
|
-
|
|
1993
|
+
C("feDisplacementMap", {
|
|
1942
1994
|
in: "warped",
|
|
1943
1995
|
in2: "ink-noise",
|
|
1944
1996
|
scale: "0.9",
|
|
@@ -1947,7 +1999,7 @@ function st(e, t, o) {
|
|
|
1947
1999
|
})
|
|
1948
2000
|
), n;
|
|
1949
2001
|
}
|
|
1950
|
-
function
|
|
2002
|
+
function Ui(e) {
|
|
1951
2003
|
const t = oe(
|
|
1952
2004
|
"0 0 24 24",
|
|
1953
2005
|
e,
|
|
@@ -1956,9 +2008,9 @@ function Ei(e) {
|
|
|
1956
2008
|
"currentColor",
|
|
1957
2009
|
"2.25"
|
|
1958
2010
|
);
|
|
1959
|
-
return t.appendChild(
|
|
2011
|
+
return t.appendChild(C("path", { d: "m6 9 6 6 6-6" })), t;
|
|
1960
2012
|
}
|
|
1961
|
-
function
|
|
2013
|
+
function Hi() {
|
|
1962
2014
|
const e = oe(
|
|
1963
2015
|
"0 0 24 24",
|
|
1964
2016
|
17,
|
|
@@ -1968,16 +2020,16 @@ function ki() {
|
|
|
1968
2020
|
"2.25"
|
|
1969
2021
|
);
|
|
1970
2022
|
return e.appendChild(
|
|
1971
|
-
|
|
2023
|
+
C("path", {
|
|
1972
2024
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
1973
2025
|
})
|
|
1974
2026
|
), e.appendChild(
|
|
1975
|
-
|
|
2027
|
+
C("path", {
|
|
1976
2028
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
1977
2029
|
})
|
|
1978
2030
|
), e;
|
|
1979
2031
|
}
|
|
1980
|
-
function
|
|
2032
|
+
function Fi() {
|
|
1981
2033
|
const e = oe(
|
|
1982
2034
|
"0 0 24 24",
|
|
1983
2035
|
17,
|
|
@@ -1986,9 +2038,9 @@ function Li() {
|
|
|
1986
2038
|
"currentColor",
|
|
1987
2039
|
"2.25"
|
|
1988
2040
|
);
|
|
1989
|
-
return e.appendChild(
|
|
2041
|
+
return e.appendChild(C("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(C("path", { d: "M3 4v5h5" })), e.appendChild(C("path", { d: "M12 7v5l3 2" })), e;
|
|
1990
2042
|
}
|
|
1991
|
-
function
|
|
2043
|
+
function Wi() {
|
|
1992
2044
|
const e = oe(
|
|
1993
2045
|
"0 0 24 24",
|
|
1994
2046
|
15,
|
|
@@ -1997,9 +2049,9 @@ function Ii() {
|
|
|
1997
2049
|
"currentColor",
|
|
1998
2050
|
"2.4"
|
|
1999
2051
|
);
|
|
2000
|
-
return e.appendChild(
|
|
2052
|
+
return e.appendChild(C("path", { d: "M18 6 6 18" })), e.appendChild(C("path", { d: "m6 6 12 12" })), e;
|
|
2001
2053
|
}
|
|
2002
|
-
function
|
|
2054
|
+
function Bn() {
|
|
2003
2055
|
const e = oe(
|
|
2004
2056
|
"0 0 24 24",
|
|
2005
2057
|
14,
|
|
@@ -2009,10 +2061,10 @@ function An() {
|
|
|
2009
2061
|
"2.75"
|
|
2010
2062
|
);
|
|
2011
2063
|
return e.appendChild(
|
|
2012
|
-
|
|
2013
|
-
), e.appendChild(
|
|
2064
|
+
C("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2065
|
+
), e.appendChild(C("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2014
2066
|
}
|
|
2015
|
-
function
|
|
2067
|
+
function Gi() {
|
|
2016
2068
|
const e = oe(
|
|
2017
2069
|
"0 0 24 24",
|
|
2018
2070
|
16,
|
|
@@ -2025,18 +2077,18 @@ function Pi() {
|
|
|
2025
2077
|
"class",
|
|
2026
2078
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2027
2079
|
), e.appendChild(
|
|
2028
|
-
|
|
2080
|
+
C("path", {
|
|
2029
2081
|
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"
|
|
2030
2082
|
})
|
|
2031
2083
|
), e;
|
|
2032
2084
|
}
|
|
2033
|
-
function
|
|
2085
|
+
function $i() {
|
|
2034
2086
|
const e = oe("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2035
2087
|
return e.setAttribute(
|
|
2036
2088
|
"class",
|
|
2037
2089
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2038
2090
|
), e.appendChild(
|
|
2039
|
-
|
|
2091
|
+
C("path", {
|
|
2040
2092
|
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",
|
|
2041
2093
|
stroke: "currentColor",
|
|
2042
2094
|
"stroke-width": "2",
|
|
@@ -2045,10 +2097,10 @@ function Ai() {
|
|
|
2045
2097
|
})
|
|
2046
2098
|
), e;
|
|
2047
2099
|
}
|
|
2048
|
-
function
|
|
2100
|
+
function qi() {
|
|
2049
2101
|
const e = oe("0 0 24 24", 18, 18, "currentColor");
|
|
2050
2102
|
return e.appendChild(
|
|
2051
|
-
|
|
2103
|
+
C("rect", {
|
|
2052
2104
|
x: "6",
|
|
2053
2105
|
y: "6",
|
|
2054
2106
|
width: "12",
|
|
@@ -2057,7 +2109,7 @@ function Ni() {
|
|
|
2057
2109
|
})
|
|
2058
2110
|
), e;
|
|
2059
2111
|
}
|
|
2060
|
-
function
|
|
2112
|
+
function ji() {
|
|
2061
2113
|
const e = oe(
|
|
2062
2114
|
"0 0 24 24",
|
|
2063
2115
|
12,
|
|
@@ -2066,9 +2118,9 @@ function Ti() {
|
|
|
2066
2118
|
"currentColor",
|
|
2067
2119
|
"2.4"
|
|
2068
2120
|
);
|
|
2069
|
-
return e.appendChild(
|
|
2121
|
+
return e.appendChild(C("path", { d: "M18 6 6 18" })), e.appendChild(C("path", { d: "m6 6 12 12" })), e;
|
|
2070
2122
|
}
|
|
2071
|
-
function
|
|
2123
|
+
function Vi() {
|
|
2072
2124
|
const e = oe(
|
|
2073
2125
|
"0 0 24 24",
|
|
2074
2126
|
13,
|
|
@@ -2078,7 +2130,7 @@ function Di() {
|
|
|
2078
2130
|
"2.25"
|
|
2079
2131
|
);
|
|
2080
2132
|
return e.appendChild(
|
|
2081
|
-
|
|
2133
|
+
C("rect", {
|
|
2082
2134
|
width: "14",
|
|
2083
2135
|
height: "14",
|
|
2084
2136
|
x: "8",
|
|
@@ -2087,12 +2139,12 @@ function Di() {
|
|
|
2087
2139
|
ry: "2"
|
|
2088
2140
|
})
|
|
2089
2141
|
), e.appendChild(
|
|
2090
|
-
|
|
2142
|
+
C("path", {
|
|
2091
2143
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2092
2144
|
})
|
|
2093
2145
|
), e;
|
|
2094
2146
|
}
|
|
2095
|
-
function oe(e, t, o, n, i,
|
|
2147
|
+
function oe(e, t, o, n, i, r) {
|
|
2096
2148
|
const l = {
|
|
2097
2149
|
viewBox: e,
|
|
2098
2150
|
width: String(t),
|
|
@@ -2100,33 +2152,33 @@ function oe(e, t, o, n, i, a) {
|
|
|
2100
2152
|
fill: n,
|
|
2101
2153
|
"aria-hidden": "true"
|
|
2102
2154
|
};
|
|
2103
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"),
|
|
2155
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), C("svg", l);
|
|
2104
2156
|
}
|
|
2105
|
-
function
|
|
2106
|
-
const o = document.createElementNS(
|
|
2157
|
+
function C(e, t = {}) {
|
|
2158
|
+
const o = document.createElementNS(An, e);
|
|
2107
2159
|
for (const [n, i] of Object.entries(t))
|
|
2108
2160
|
o.setAttribute(n, i);
|
|
2109
2161
|
return o;
|
|
2110
2162
|
}
|
|
2111
|
-
function
|
|
2163
|
+
function dn(e) {
|
|
2112
2164
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2113
2165
|
e.addEventListener(t, (o) => {
|
|
2114
2166
|
o.stopPropagation();
|
|
2115
2167
|
});
|
|
2116
2168
|
}
|
|
2117
|
-
function
|
|
2169
|
+
function Ki(e, t, o) {
|
|
2118
2170
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2119
2171
|
for (const [n, i] of t.entries()) {
|
|
2120
|
-
const
|
|
2121
|
-
|
|
2172
|
+
const r = document.createElement("div");
|
|
2173
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Yi(i));
|
|
2122
2174
|
const l = document.createElement("span");
|
|
2123
|
-
l.textContent = i.name,
|
|
2175
|
+
l.textContent = i.name, r.appendChild(l);
|
|
2124
2176
|
const p = document.createElement("button");
|
|
2125
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2177
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(ji()), p.addEventListener("click", () => o(n)), r.appendChild(p), e.appendChild(r);
|
|
2126
2178
|
}
|
|
2127
2179
|
}
|
|
2128
|
-
function
|
|
2129
|
-
const t =
|
|
2180
|
+
function Yi(e) {
|
|
2181
|
+
const t = kt(e), o = Un(e);
|
|
2130
2182
|
if (t === "image" && o) {
|
|
2131
2183
|
const n = document.createElement("img");
|
|
2132
2184
|
return n.src = o, n.alt = "", n.setAttribute("aria-hidden", "true"), n.addEventListener("error", () => n.replaceWith(ee(e))), n;
|
|
@@ -2137,8 +2189,8 @@ function Mi(e) {
|
|
|
2137
2189
|
}
|
|
2138
2190
|
return ee(e);
|
|
2139
2191
|
}
|
|
2140
|
-
function
|
|
2141
|
-
const t =
|
|
2192
|
+
function Xi(e) {
|
|
2193
|
+
const t = kt(e), o = Un(e);
|
|
2142
2194
|
if (t === "image" && o) {
|
|
2143
2195
|
const n = document.createElement("img");
|
|
2144
2196
|
return n.className = "pluno-pa-widget__message-attachment-preview", n.src = o, n.alt = e.name, n.addEventListener("error", () => n.replaceWith(ee(e, "message"))), n;
|
|
@@ -2155,110 +2207,110 @@ function zi(e) {
|
|
|
2155
2207
|
}
|
|
2156
2208
|
function ee(e, t = "composer") {
|
|
2157
2209
|
if (t === "composer") {
|
|
2158
|
-
const
|
|
2159
|
-
return
|
|
2210
|
+
const r = document.createElement("span");
|
|
2211
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = cn(e), r;
|
|
2160
2212
|
}
|
|
2161
2213
|
const o = document.createElement("div");
|
|
2162
2214
|
o.className = "pluno-pa-widget__message-attachment-file";
|
|
2163
2215
|
const n = document.createElement("span");
|
|
2164
|
-
n.textContent =
|
|
2216
|
+
n.textContent = cn(e);
|
|
2165
2217
|
const i = document.createElement("strong");
|
|
2166
2218
|
return i.textContent = e.name, o.append(n, i), o;
|
|
2167
2219
|
}
|
|
2168
|
-
function
|
|
2220
|
+
function kt(e) {
|
|
2169
2221
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2170
2222
|
}
|
|
2171
|
-
function
|
|
2223
|
+
function Un(e) {
|
|
2172
2224
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2173
2225
|
}
|
|
2174
|
-
function
|
|
2175
|
-
const t =
|
|
2226
|
+
function cn(e) {
|
|
2227
|
+
const t = kt(e);
|
|
2176
2228
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2177
2229
|
}
|
|
2178
|
-
function
|
|
2230
|
+
function Zi(e, t) {
|
|
2179
2231
|
return t ? Array.from(t).map((n) => ({
|
|
2180
2232
|
...e.createLocalAttachment(n),
|
|
2181
|
-
previewUrl:
|
|
2233
|
+
previewUrl: Ji(n)
|
|
2182
2234
|
})) : [];
|
|
2183
2235
|
}
|
|
2184
|
-
function
|
|
2236
|
+
function Ji(e) {
|
|
2185
2237
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2186
2238
|
}
|
|
2187
|
-
function
|
|
2239
|
+
function $e(e) {
|
|
2188
2240
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2189
2241
|
}
|
|
2190
|
-
function
|
|
2191
|
-
if (!e || !
|
|
2242
|
+
function mt(e, t, o = null) {
|
|
2243
|
+
if (!e || !yt(t, o)) {
|
|
2192
2244
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2193
2245
|
return;
|
|
2194
2246
|
}
|
|
2195
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", te(t) ||
|
|
2196
|
-
|
|
2197
|
-
) :
|
|
2247
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", te(t) || Lt(o) ? e.appendChild(
|
|
2248
|
+
Qi(t, o)
|
|
2249
|
+
) : Hn(t) && e.appendChild(ea(t));
|
|
2198
2250
|
}
|
|
2199
|
-
function
|
|
2251
|
+
function Qi(e, t) {
|
|
2200
2252
|
const o = document.createElement("div");
|
|
2201
2253
|
o.className = "pluno-pa-widget__billing-action-card";
|
|
2202
2254
|
const n = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2203
2255
|
i.textContent = n ? "Credits used up" : "Billing needs attention", o.appendChild(i);
|
|
2204
|
-
const
|
|
2205
|
-
return
|
|
2206
|
-
|
|
2256
|
+
const r = document.createElement("span");
|
|
2257
|
+
return r.textContent = n ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", o.appendChild(r), o.appendChild(
|
|
2258
|
+
Fn(
|
|
2207
2259
|
e,
|
|
2208
2260
|
"Upgrade plan",
|
|
2209
2261
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2210
2262
|
)
|
|
2211
2263
|
), o;
|
|
2212
2264
|
}
|
|
2213
|
-
function
|
|
2265
|
+
function ea(e) {
|
|
2214
2266
|
const t = document.createElement("div");
|
|
2215
2267
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2216
2268
|
const o = document.createElement("strong");
|
|
2217
2269
|
o.textContent = "Credits running low", t.appendChild(o);
|
|
2218
2270
|
const n = document.createElement("span");
|
|
2219
|
-
return n.textContent =
|
|
2220
|
-
|
|
2271
|
+
return n.textContent = na(e) ?? "Credits are running low for this period.", t.appendChild(n), t.appendChild(
|
|
2272
|
+
Fn(
|
|
2221
2273
|
e,
|
|
2222
2274
|
"Upgrade",
|
|
2223
2275
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2224
2276
|
)
|
|
2225
2277
|
), t;
|
|
2226
2278
|
}
|
|
2227
|
-
function
|
|
2228
|
-
return e !== null && (te(e) ||
|
|
2279
|
+
function yt(e, t) {
|
|
2280
|
+
return e !== null && (te(e) || Hn(e) || Lt(t));
|
|
2229
2281
|
}
|
|
2230
|
-
function
|
|
2231
|
-
return
|
|
2282
|
+
function un(e, t, o) {
|
|
2283
|
+
return yt(t, o) || ta(t) ? !0 : !yt(e, o);
|
|
2232
2284
|
}
|
|
2233
|
-
function
|
|
2285
|
+
function ta(e) {
|
|
2234
2286
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || te(e));
|
|
2235
2287
|
}
|
|
2236
2288
|
function te(e) {
|
|
2237
2289
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2238
2290
|
}
|
|
2239
|
-
function
|
|
2291
|
+
function Lt(e) {
|
|
2240
2292
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2241
2293
|
}
|
|
2242
|
-
function
|
|
2294
|
+
function Hn(e) {
|
|
2243
2295
|
return !te(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2244
2296
|
}
|
|
2245
|
-
function
|
|
2246
|
-
return e.creditsRemaining === null ? null : `${
|
|
2297
|
+
function na(e) {
|
|
2298
|
+
return e.creditsRemaining === null ? null : `${oa(e.creditsRemaining)} credits left`;
|
|
2247
2299
|
}
|
|
2248
|
-
function
|
|
2300
|
+
function oa(e) {
|
|
2249
2301
|
return new Intl.NumberFormat("en-US", {
|
|
2250
2302
|
maximumFractionDigits: 0
|
|
2251
2303
|
}).format(Math.ceil(e));
|
|
2252
2304
|
}
|
|
2253
|
-
function
|
|
2305
|
+
function Fn(e, t, o) {
|
|
2254
2306
|
const n = document.createElement("div");
|
|
2255
2307
|
return n.className = o, n.appendChild(
|
|
2256
|
-
|
|
2308
|
+
gn(t, e.pricingUrl)
|
|
2257
2309
|
), n.appendChild(
|
|
2258
|
-
|
|
2310
|
+
gn("Earn credits", e.earnCreditsUrl)
|
|
2259
2311
|
), n;
|
|
2260
2312
|
}
|
|
2261
|
-
function
|
|
2313
|
+
function gn(e, t) {
|
|
2262
2314
|
const o = document.createElement("button");
|
|
2263
2315
|
if (o.type = "button", e === "Earn credits") {
|
|
2264
2316
|
const n = document.createElement("span");
|
|
@@ -2269,102 +2321,102 @@ function an(e, t) {
|
|
|
2269
2321
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2270
2322
|
}), o;
|
|
2271
2323
|
}
|
|
2272
|
-
function
|
|
2324
|
+
function bt(e, t) {
|
|
2273
2325
|
return e.messages.filter(
|
|
2274
|
-
(n) => !
|
|
2326
|
+
(n) => !Wn(n)
|
|
2275
2327
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2276
2328
|
}
|
|
2277
|
-
function
|
|
2278
|
-
const
|
|
2279
|
-
(_) => !
|
|
2280
|
-
), h = e.scrollTop,
|
|
2281
|
-
|
|
2329
|
+
function ia(e, t, o, n, i, r, l, p, c, u, d, g, E, f, U, k) {
|
|
2330
|
+
const v = pa(r), y = v.filter(
|
|
2331
|
+
(_) => !Wn(_)
|
|
2332
|
+
), h = e.scrollTop, T = [], D = /* @__PURE__ */ new Set(), I = (_) => {
|
|
2333
|
+
T.push(_);
|
|
2282
2334
|
};
|
|
2283
|
-
|
|
2284
|
-
const
|
|
2285
|
-
if (n(
|
|
2335
|
+
$n(o, r.isThinking), i.hidden = !p, p && l !== null && Mn(i, l);
|
|
2336
|
+
const ke = y.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2337
|
+
if (n(ke), y.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2286
2338
|
const _ = document.createElement("div");
|
|
2287
2339
|
_.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2340
|
+
const O = document.createElement("div");
|
|
2341
|
+
O.className = "pluno-pa-widget__empty-hero";
|
|
2290
2342
|
const P = se(
|
|
2291
2343
|
"pluno-pa-widget__character--empty",
|
|
2292
2344
|
f()
|
|
2293
2345
|
);
|
|
2294
|
-
|
|
2346
|
+
O.appendChild(P), _.appendChild(O), _.appendChild(Rn());
|
|
2295
2347
|
const G = document.createElement("div");
|
|
2296
|
-
if (G.className =
|
|
2297
|
-
for (const
|
|
2348
|
+
if (G.className = r.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", r.starterPrompts.length === 0 && !r.starterPromptsLoading && G.setAttribute("aria-hidden", "true"), r.starterPrompts.length > 0)
|
|
2349
|
+
for (const S of r.starterPrompts) {
|
|
2298
2350
|
const L = document.createElement("button");
|
|
2299
|
-
L.type = "button", L.className = "pluno-pa-widget__starter-prompt", L.textContent = `"${
|
|
2300
|
-
|
|
2351
|
+
L.type = "button", L.className = "pluno-pa-widget__starter-prompt", L.textContent = `"${S}"`, L.addEventListener("click", () => {
|
|
2352
|
+
U(S);
|
|
2301
2353
|
}), G.appendChild(L);
|
|
2302
2354
|
}
|
|
2303
|
-
else if (
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2355
|
+
else if (r.starterPromptsLoading) {
|
|
2356
|
+
const S = document.createElement("button");
|
|
2357
|
+
S.type = "button", S.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", S.disabled = !0, S.tabIndex = -1, S.textContent = "Generating example tasks...", G.appendChild(S);
|
|
2306
2358
|
} else
|
|
2307
|
-
for (let
|
|
2359
|
+
for (let S = 0; S < Fo; S += 1) {
|
|
2308
2360
|
const L = document.createElement("button");
|
|
2309
2361
|
L.type = "button", L.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", L.disabled = !0, L.tabIndex = -1, L.textContent = "", G.appendChild(L);
|
|
2310
2362
|
}
|
|
2311
|
-
_.appendChild(G), g.clear(), I(_), I(t),
|
|
2363
|
+
_.appendChild(G), g.clear(), I(_), I(t), hn(e, T);
|
|
2312
2364
|
return;
|
|
2313
2365
|
}
|
|
2314
|
-
let b = null,
|
|
2315
|
-
const ce =
|
|
2366
|
+
let b = null, R = null, de = [];
|
|
2367
|
+
const ce = y.some(Ct), _e = () => {
|
|
2316
2368
|
if (de.length === 0)
|
|
2317
2369
|
return !1;
|
|
2318
|
-
const _ =
|
|
2370
|
+
const _ = wa(
|
|
2319
2371
|
de,
|
|
2320
2372
|
d,
|
|
2321
|
-
|
|
2373
|
+
E,
|
|
2322
2374
|
f()
|
|
2323
2375
|
);
|
|
2324
|
-
return I(_), b = null,
|
|
2376
|
+
return I(_), b = null, R = _, de = [], !0;
|
|
2325
2377
|
};
|
|
2326
|
-
for (let _ = 0; _ <
|
|
2327
|
-
const
|
|
2328
|
-
if (
|
|
2329
|
-
de.push(
|
|
2378
|
+
for (let _ = 0; _ < y.length; _ += 1) {
|
|
2379
|
+
const O = y[_];
|
|
2380
|
+
if (O.role === "tool") {
|
|
2381
|
+
de.push(O);
|
|
2330
2382
|
continue;
|
|
2331
2383
|
}
|
|
2332
|
-
if (
|
|
2333
|
-
if (
|
|
2334
|
-
const $ =
|
|
2335
|
-
I($), b = null,
|
|
2384
|
+
if (Ct(O)) {
|
|
2385
|
+
if (_e()) {
|
|
2386
|
+
const $ = St();
|
|
2387
|
+
I($), b = null, R = $;
|
|
2336
2388
|
} else {
|
|
2337
|
-
const $ =
|
|
2338
|
-
I($), b = null,
|
|
2389
|
+
const $ = fn(f());
|
|
2390
|
+
I($), b = null, R = $;
|
|
2339
2391
|
}
|
|
2340
2392
|
continue;
|
|
2341
2393
|
}
|
|
2342
|
-
if (
|
|
2394
|
+
if (O.role === "system")
|
|
2343
2395
|
continue;
|
|
2344
|
-
const P =
|
|
2345
|
-
if (
|
|
2346
|
-
const L =
|
|
2347
|
-
I(L), b = null,
|
|
2396
|
+
const P = _e(), G = fa(O.content);
|
|
2397
|
+
if (O.role === "assistant" && !P) {
|
|
2398
|
+
const L = Gn(f());
|
|
2399
|
+
I(L), b = null, R = L;
|
|
2348
2400
|
}
|
|
2349
|
-
const
|
|
2350
|
-
I(
|
|
2401
|
+
const S = aa(O, G, g, D);
|
|
2402
|
+
I(S), b = S, R = null;
|
|
2351
2403
|
}
|
|
2352
|
-
const W =
|
|
2353
|
-
if (
|
|
2404
|
+
const W = _e(), Oe = y[y.length - 1]?.id === "assistant-draft";
|
|
2405
|
+
if (r.isThinking && !Oe && !ce)
|
|
2354
2406
|
if (W) {
|
|
2355
|
-
const _ =
|
|
2356
|
-
I(_), b = null,
|
|
2407
|
+
const _ = St();
|
|
2408
|
+
I(_), b = null, R = _;
|
|
2357
2409
|
} else {
|
|
2358
|
-
const _ =
|
|
2359
|
-
I(_), b = null,
|
|
2410
|
+
const _ = fn(f());
|
|
2411
|
+
I(_), b = null, R = _;
|
|
2360
2412
|
}
|
|
2361
|
-
if (
|
|
2413
|
+
if (r.lastError) {
|
|
2362
2414
|
const _ = document.createElement("div");
|
|
2363
|
-
_.className = "pluno-pa-widget__error", _.textContent =
|
|
2415
|
+
_.className = "pluno-pa-widget__error", _.textContent = r.lastError, I(_), b = _, R = null;
|
|
2364
2416
|
}
|
|
2365
|
-
const K = k && !
|
|
2417
|
+
const K = k && !r.isThinking ? fo(v) : null;
|
|
2366
2418
|
if (k && K && !k.dismissedCandidateIds.has(K.id)) {
|
|
2367
|
-
const _ =
|
|
2419
|
+
const _ = ca(K, {
|
|
2368
2420
|
isDrafting: k.draftingCandidateId === K.id,
|
|
2369
2421
|
error: k.error,
|
|
2370
2422
|
characterIconOptions: k.characterIconOptions,
|
|
@@ -2372,20 +2424,20 @@ function $i(e, t, o, n, i, a, l, p, c, u, d, g, S, f, O, k) {
|
|
|
2372
2424
|
onDismiss: k.onDismiss,
|
|
2373
2425
|
onDisable: k.onDisable
|
|
2374
2426
|
});
|
|
2375
|
-
I(_), k.onSeen(K), b = null,
|
|
2427
|
+
I(_), k.onSeen(K), b = null, R = _;
|
|
2376
2428
|
}
|
|
2377
|
-
b?.classList.add("pluno-pa-widget__message--bottom-reserve"),
|
|
2429
|
+
b?.classList.add("pluno-pa-widget__message--bottom-reserve"), R?.classList.add("pluno-pa-widget__bottom-reserve-compact"), I(t), la(g, D), hn(e, T), c ? Re(e, u) : e.scrollTop = h;
|
|
2378
2430
|
}
|
|
2379
|
-
function
|
|
2380
|
-
const i =
|
|
2381
|
-
if (i &&
|
|
2382
|
-
return
|
|
2431
|
+
function aa(e, t, o, n) {
|
|
2432
|
+
const i = ra(e, t), r = i ? o.get(i) : void 0;
|
|
2433
|
+
if (i && r)
|
|
2434
|
+
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), n.add(i), r;
|
|
2383
2435
|
const l = document.createElement("div");
|
|
2384
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2436
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? xa(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(sa(e.attachments));
|
|
2385
2437
|
const p = document.createElement("div");
|
|
2386
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2438
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(da(t)), l.appendChild(p), i && (o.set(i, l), n.add(i)), l;
|
|
2387
2439
|
}
|
|
2388
|
-
function
|
|
2440
|
+
function ra(e, t) {
|
|
2389
2441
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2390
2442
|
id: e.id,
|
|
2391
2443
|
content: t,
|
|
@@ -2403,11 +2455,11 @@ function ji(e, t) {
|
|
|
2403
2455
|
})
|
|
2404
2456
|
});
|
|
2405
2457
|
}
|
|
2406
|
-
function
|
|
2458
|
+
function la(e, t) {
|
|
2407
2459
|
for (const o of e.keys())
|
|
2408
2460
|
t.has(o) || e.delete(o);
|
|
2409
2461
|
}
|
|
2410
|
-
function
|
|
2462
|
+
function hn(e, t) {
|
|
2411
2463
|
let o = e.firstChild;
|
|
2412
2464
|
for (const n of t) {
|
|
2413
2465
|
if (n === o) {
|
|
@@ -2421,7 +2473,7 @@ function rn(e, t) {
|
|
|
2421
2473
|
o = o.nextSibling, e.removeChild(n);
|
|
2422
2474
|
}
|
|
2423
2475
|
}
|
|
2424
|
-
function
|
|
2476
|
+
function pa(e) {
|
|
2425
2477
|
if (!e.assistantDraft)
|
|
2426
2478
|
return [...e.messages];
|
|
2427
2479
|
const t = {
|
|
@@ -2436,12 +2488,12 @@ function Ki(e) {
|
|
|
2436
2488
|
if (!t.respondsToUserMessageId)
|
|
2437
2489
|
return [...e.messages, t];
|
|
2438
2490
|
const o = e.messages.findIndex(
|
|
2439
|
-
(
|
|
2491
|
+
(r) => r.role === "user" && r.id === t.respondsToUserMessageId
|
|
2440
2492
|
);
|
|
2441
2493
|
if (o === -1)
|
|
2442
2494
|
return [...e.messages, t];
|
|
2443
2495
|
const n = e.messages.findIndex(
|
|
2444
|
-
(
|
|
2496
|
+
(r, l) => l > o && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && mn(r, t) && Ct(r)
|
|
2445
2497
|
);
|
|
2446
2498
|
if (n !== -1)
|
|
2447
2499
|
return [
|
|
@@ -2450,7 +2502,7 @@ function Ki(e) {
|
|
|
2450
2502
|
...e.messages.slice(n + 1)
|
|
2451
2503
|
];
|
|
2452
2504
|
let i = o + 1;
|
|
2453
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2505
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && mn(e.messages[i], t); )
|
|
2454
2506
|
i += 1;
|
|
2455
2507
|
return [
|
|
2456
2508
|
...e.messages.slice(0, i),
|
|
@@ -2458,14 +2510,14 @@ function Ki(e) {
|
|
|
2458
2510
|
...e.messages.slice(i)
|
|
2459
2511
|
];
|
|
2460
2512
|
}
|
|
2461
|
-
function
|
|
2513
|
+
function Ct(e) {
|
|
2462
2514
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2463
2515
|
}
|
|
2464
|
-
function
|
|
2516
|
+
function mn(e, t) {
|
|
2465
2517
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2466
2518
|
}
|
|
2467
|
-
function
|
|
2468
|
-
e.replaceChildren(),
|
|
2519
|
+
function bn(e, t, o, n, i, r, l, p) {
|
|
2520
|
+
e.replaceChildren(), $n(t, !1), t.disabled = !0, o(!1);
|
|
2469
2521
|
const c = document.createElement("div");
|
|
2470
2522
|
c.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2471
2523
|
const u = se(
|
|
@@ -2476,27 +2528,27 @@ function pn(e, t, o, n, i, a, l, p) {
|
|
|
2476
2528
|
const d = document.createElement("div");
|
|
2477
2529
|
if (d.className = "pluno-pa-widget__empty", d.textContent = i, c.appendChild(d), l) {
|
|
2478
2530
|
const g = document.createElement("a");
|
|
2479
|
-
g.className = "pluno-pa-widget__login", g.href = l, g.target = "_blank", g.rel = "noopener noreferrer", g.textContent =
|
|
2531
|
+
g.className = "pluno-pa-widget__login", g.href = l, g.target = "_blank", g.rel = "noopener noreferrer", g.textContent = r, c.appendChild(g);
|
|
2480
2532
|
} else {
|
|
2481
2533
|
const g = document.createElement("button");
|
|
2482
|
-
g.type = "button", g.className = "pluno-pa-widget__login", g.textContent =
|
|
2534
|
+
g.type = "button", g.className = "pluno-pa-widget__login", g.textContent = r, g.addEventListener("click", () => p?.()), c.appendChild(g);
|
|
2483
2535
|
}
|
|
2484
2536
|
e.appendChild(c);
|
|
2485
2537
|
}
|
|
2486
|
-
function
|
|
2538
|
+
function sa(e) {
|
|
2487
2539
|
const t = document.createElement("div");
|
|
2488
2540
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2489
2541
|
for (const o of e)
|
|
2490
|
-
t.appendChild(
|
|
2542
|
+
t.appendChild(Xi(o));
|
|
2491
2543
|
return t;
|
|
2492
2544
|
}
|
|
2493
|
-
function
|
|
2545
|
+
function da(e) {
|
|
2494
2546
|
const t = document.createElement("button");
|
|
2495
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2547
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Vi()), t.addEventListener("click", (o) => {
|
|
2496
2548
|
o.preventDefault(), o.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2497
2549
|
}), t;
|
|
2498
2550
|
}
|
|
2499
|
-
function
|
|
2551
|
+
function ca(e, t) {
|
|
2500
2552
|
const o = document.createElement("article");
|
|
2501
2553
|
o.className = "pluno-pa-widget__share-prompt";
|
|
2502
2554
|
const n = document.createElement("div");
|
|
@@ -2508,8 +2560,8 @@ function Zi(e, t) {
|
|
|
2508
2560
|
);
|
|
2509
2561
|
const i = document.createElement("div");
|
|
2510
2562
|
i.className = "pluno-pa-widget__share-prompt-copy";
|
|
2511
|
-
const
|
|
2512
|
-
|
|
2563
|
+
const r = document.createElement("strong");
|
|
2564
|
+
r.textContent = "Share this win?", i.appendChild(r);
|
|
2513
2565
|
const l = document.createElement("span");
|
|
2514
2566
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2515
2567
|
const d = document.createElement("span");
|
|
@@ -2523,7 +2575,7 @@ function Zi(e, t) {
|
|
|
2523
2575
|
const u = document.createElement("button");
|
|
2524
2576
|
if (u.type = "button", u.disabled = t.isDrafting, u.addEventListener("click", () => {
|
|
2525
2577
|
t.onDraft(e);
|
|
2526
|
-
}), t.isDrafting ? (u.appendChild(
|
|
2578
|
+
}), t.isDrafting ? (u.appendChild(Et()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", c.appendChild(u), t.isDrafting)
|
|
2527
2579
|
p.appendChild(c);
|
|
2528
2580
|
else {
|
|
2529
2581
|
const d = document.createElement("button");
|
|
@@ -2537,15 +2589,15 @@ function Zi(e, t) {
|
|
|
2537
2589
|
}
|
|
2538
2590
|
return n.appendChild(p), o.appendChild(n), o;
|
|
2539
2591
|
}
|
|
2540
|
-
function
|
|
2592
|
+
function ua(e, t) {
|
|
2541
2593
|
const o = document.createElement("div");
|
|
2542
|
-
o.className = "pluno-pa-widget__share-dialog-backdrop", o.addEventListener("click", (
|
|
2543
|
-
|
|
2594
|
+
o.className = "pluno-pa-widget__share-dialog-backdrop", o.addEventListener("click", (v) => {
|
|
2595
|
+
v.target === o && t.onClose();
|
|
2544
2596
|
});
|
|
2545
2597
|
const n = document.createElement("section");
|
|
2546
2598
|
n.className = "pluno-pa-widget__share-dialog", n.setAttribute("role", "dialog"), n.setAttribute("aria-modal", "true"), n.setAttribute("aria-label", "Draft a social post");
|
|
2547
|
-
const i = document.createElement("header"),
|
|
2548
|
-
|
|
2599
|
+
const i = document.createElement("header"), r = document.createElement("strong");
|
|
2600
|
+
r.textContent = "Share this win", i.appendChild(r);
|
|
2549
2601
|
const l = document.createElement("button");
|
|
2550
2602
|
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), n.appendChild(i);
|
|
2551
2603
|
const p = document.createElement("p");
|
|
@@ -2556,52 +2608,52 @@ function Ji(e, t) {
|
|
|
2556
2608
|
u.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2557
2609
|
const d = document.createElement("strong");
|
|
2558
2610
|
d.textContent = "1) Copy Screenshot", u.appendChild(d);
|
|
2559
|
-
const g =
|
|
2611
|
+
const g = ga(
|
|
2560
2612
|
"Copy Screenshot",
|
|
2561
2613
|
async () => {
|
|
2562
2614
|
try {
|
|
2563
|
-
return await
|
|
2615
|
+
return await wo(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2564
2616
|
} catch {
|
|
2565
2617
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2566
2618
|
}
|
|
2567
2619
|
}
|
|
2568
2620
|
);
|
|
2569
2621
|
if (u.appendChild(g), c.appendChild(u), e.screenshotDataUrl) {
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2572
|
-
const
|
|
2573
|
-
|
|
2622
|
+
const v = document.createElement("div");
|
|
2623
|
+
v.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2624
|
+
const y = document.createElement("img");
|
|
2625
|
+
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", v.appendChild(y), c.appendChild(v);
|
|
2574
2626
|
}
|
|
2575
2627
|
n.appendChild(c), n.appendChild(p);
|
|
2576
|
-
const
|
|
2577
|
-
|
|
2628
|
+
const E = document.createElement("div");
|
|
2629
|
+
E.className = "pluno-pa-widget__share-dialog-step";
|
|
2578
2630
|
const f = document.createElement("strong");
|
|
2579
|
-
f.className = "pluno-pa-widget__share-dialog-step-title", f.textContent = "2) Share on",
|
|
2580
|
-
const
|
|
2581
|
-
|
|
2631
|
+
f.className = "pluno-pa-widget__share-dialog-step-title", f.textContent = "2) Share on", E.appendChild(f);
|
|
2632
|
+
const U = document.createElement("p");
|
|
2633
|
+
U.className = "pluno-pa-widget__share-dialog-hint", U.textContent = "Post draft opens prefilled on supported platforms.", E.appendChild(U);
|
|
2582
2634
|
const k = document.createElement("footer");
|
|
2583
2635
|
k.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2584
|
-
for (const
|
|
2585
|
-
const
|
|
2586
|
-
|
|
2636
|
+
for (const v of ha(e)) {
|
|
2637
|
+
const y = document.createElement("a");
|
|
2638
|
+
y.href = v.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = v.label, y.setAttribute("aria-label", `Open ${v.label}`), y.appendChild(ma(v.id)), k.appendChild(y);
|
|
2587
2639
|
}
|
|
2588
|
-
if (
|
|
2589
|
-
const
|
|
2590
|
-
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2640
|
+
if (E.appendChild(k), n.appendChild(E), t.socialPostRewardsUrl) {
|
|
2641
|
+
const v = document.createElement("div");
|
|
2642
|
+
v.className = "pluno-pa-widget__share-dialog-step";
|
|
2643
|
+
const y = document.createElement("strong");
|
|
2644
|
+
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", v.appendChild(y);
|
|
2593
2645
|
const h = document.createElement("a");
|
|
2594
|
-
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(
|
|
2646
|
+
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(ba()), v.appendChild(h), n.appendChild(v);
|
|
2595
2647
|
}
|
|
2596
2648
|
return o.appendChild(n), o;
|
|
2597
2649
|
}
|
|
2598
|
-
function
|
|
2650
|
+
function ga(e, t) {
|
|
2599
2651
|
const o = document.createElement("button");
|
|
2600
2652
|
return o.type = "button", o.className = "pluno-pa-widget__share-dialog-copy", o.textContent = e, o.addEventListener("click", async (n) => {
|
|
2601
2653
|
n.preventDefault(), n.stopPropagation(), await t() && (o.textContent = "Copied ✓");
|
|
2602
2654
|
}), o;
|
|
2603
2655
|
}
|
|
2604
|
-
function
|
|
2656
|
+
function ha(e) {
|
|
2605
2657
|
const t = e.linkedinPost.trim(), o = e.xPost.trim();
|
|
2606
2658
|
return [
|
|
2607
2659
|
{
|
|
@@ -2621,47 +2673,47 @@ function ea(e) {
|
|
|
2621
2673
|
}
|
|
2622
2674
|
];
|
|
2623
2675
|
}
|
|
2624
|
-
function
|
|
2676
|
+
function ma(e) {
|
|
2625
2677
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2626
|
-
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" ? (
|
|
2678
|
+
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" ? (z(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), z(
|
|
2627
2679
|
t,
|
|
2628
2680
|
"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"
|
|
2629
|
-
),
|
|
2681
|
+
), z(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), z(
|
|
2630
2682
|
t,
|
|
2631
2683
|
"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"
|
|
2632
|
-
),
|
|
2684
|
+
), z(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (z(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), z(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), z(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (z(
|
|
2633
2685
|
t,
|
|
2634
2686
|
"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"
|
|
2635
|
-
),
|
|
2687
|
+
), z(
|
|
2636
2688
|
t,
|
|
2637
2689
|
"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",
|
|
2638
2690
|
"0.48"
|
|
2639
|
-
),
|
|
2691
|
+
), z(
|
|
2640
2692
|
t,
|
|
2641
2693
|
"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"
|
|
2642
|
-
),
|
|
2694
|
+
), z(
|
|
2643
2695
|
t,
|
|
2644
2696
|
"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"
|
|
2645
2697
|
), t);
|
|
2646
2698
|
}
|
|
2647
|
-
function
|
|
2699
|
+
function z(e, t, o) {
|
|
2648
2700
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2649
2701
|
n.setAttribute("d", t), o && n.setAttribute("opacity", o), e.appendChild(n);
|
|
2650
2702
|
}
|
|
2651
|
-
function
|
|
2703
|
+
function ba() {
|
|
2652
2704
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2653
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
2705
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), z(e, "M14 5h5v5"), z(e, "M19 5l-8 8"), z(
|
|
2654
2706
|
e,
|
|
2655
2707
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
2656
2708
|
), e;
|
|
2657
2709
|
}
|
|
2658
|
-
function
|
|
2659
|
-
return e.role === "tool" && e.toolName ===
|
|
2710
|
+
function Wn(e) {
|
|
2711
|
+
return e.role === "tool" && e.toolName === Sn;
|
|
2660
2712
|
}
|
|
2661
|
-
function
|
|
2713
|
+
function fa(e) {
|
|
2662
2714
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
2663
2715
|
}
|
|
2664
|
-
function
|
|
2716
|
+
function wa(e, t, o, n) {
|
|
2665
2717
|
const i = document.createElement("article");
|
|
2666
2718
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
2667
2719
|
e[e.length - 1].createdAt
|
|
@@ -2671,27 +2723,27 @@ function ia(e, t, o, n) {
|
|
|
2671
2723
|
n
|
|
2672
2724
|
)
|
|
2673
2725
|
);
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2676
|
-
i.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
2726
|
+
const r = document.createElement("details"), l = _a(e);
|
|
2727
|
+
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
2728
|
+
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), o();
|
|
2677
2729
|
});
|
|
2678
2730
|
const p = document.createElement("summary");
|
|
2679
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((d) => d.loading) && p.appendChild(
|
|
2731
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((d) => d.loading) && p.appendChild(Et());
|
|
2680
2732
|
const u = document.createElement("span");
|
|
2681
|
-
if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u),
|
|
2733
|
+
if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u), r.appendChild(p), e.length > 0) {
|
|
2682
2734
|
const d = document.createElement("div");
|
|
2683
2735
|
d.className = "pluno-pa-widget__tool-lines";
|
|
2684
2736
|
for (const g of e) {
|
|
2685
|
-
const
|
|
2686
|
-
|
|
2737
|
+
const E = document.createElement("div");
|
|
2738
|
+
E.className = "pluno-pa-widget__tool-line", g.loading && E.appendChild(Et());
|
|
2687
2739
|
const f = document.createElement("span");
|
|
2688
|
-
f.textContent = g.content || "Run tool",
|
|
2740
|
+
f.textContent = g.content || "Run tool", E.appendChild(f), d.appendChild(E);
|
|
2689
2741
|
}
|
|
2690
|
-
|
|
2742
|
+
r.appendChild(d);
|
|
2691
2743
|
}
|
|
2692
|
-
return i.appendChild(
|
|
2744
|
+
return i.appendChild(r), i;
|
|
2693
2745
|
}
|
|
2694
|
-
function
|
|
2746
|
+
function Gn(e) {
|
|
2695
2747
|
const t = document.createElement("article");
|
|
2696
2748
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
2697
2749
|
se(
|
|
@@ -2700,11 +2752,11 @@ function Mn(e) {
|
|
|
2700
2752
|
)
|
|
2701
2753
|
), t;
|
|
2702
2754
|
}
|
|
2703
|
-
function
|
|
2704
|
-
const t =
|
|
2705
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
2755
|
+
function fn(e) {
|
|
2756
|
+
const t = Gn(e);
|
|
2757
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(St()), t;
|
|
2706
2758
|
}
|
|
2707
|
-
function
|
|
2759
|
+
function St() {
|
|
2708
2760
|
const e = document.createElement("div");
|
|
2709
2761
|
e.className = "pluno-pa-widget__status";
|
|
2710
2762
|
const t = document.createElement("span");
|
|
@@ -2712,17 +2764,17 @@ function _t() {
|
|
|
2712
2764
|
const o = document.createElement("span");
|
|
2713
2765
|
return o.textContent = "Thinking...", e.appendChild(o), e;
|
|
2714
2766
|
}
|
|
2715
|
-
function
|
|
2767
|
+
function _a(e) {
|
|
2716
2768
|
return `tools:${e[0]?.id ?? ""}`;
|
|
2717
2769
|
}
|
|
2718
|
-
function
|
|
2770
|
+
function Et() {
|
|
2719
2771
|
const e = document.createElement("span");
|
|
2720
2772
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
2721
2773
|
}
|
|
2722
|
-
function
|
|
2723
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
2774
|
+
function $n(e, t) {
|
|
2775
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? qi() : Bn());
|
|
2724
2776
|
}
|
|
2725
|
-
function
|
|
2777
|
+
function xa(e, t) {
|
|
2726
2778
|
const o = t.replace(/\r\n/g, `
|
|
2727
2779
|
`).split(`
|
|
2728
2780
|
`);
|
|
@@ -2746,14 +2798,14 @@ function ra(e, t) {
|
|
|
2746
2798
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
2747
2799
|
if (l) {
|
|
2748
2800
|
const u = document.createElement(`h${l[1].length + 2}`);
|
|
2749
|
-
|
|
2801
|
+
qe(u, l[2]), e.appendChild(u), n += 1;
|
|
2750
2802
|
continue;
|
|
2751
2803
|
}
|
|
2752
2804
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
2753
2805
|
const u = document.createElement("ul");
|
|
2754
2806
|
for (; n < o.length && /^\s*[-*+]\s+/.test(o[n]); ) {
|
|
2755
2807
|
const d = document.createElement("li");
|
|
2756
|
-
|
|
2808
|
+
qe(d, o[n].replace(/^\s*[-*+]\s+/, "")), u.appendChild(d), n += 1;
|
|
2757
2809
|
}
|
|
2758
2810
|
e.appendChild(u);
|
|
2759
2811
|
continue;
|
|
@@ -2762,7 +2814,7 @@ function ra(e, t) {
|
|
|
2762
2814
|
const u = document.createElement("ol");
|
|
2763
2815
|
for (; n < o.length && /^\s*\d+\.\s+/.test(o[n]); ) {
|
|
2764
2816
|
const d = document.createElement("li");
|
|
2765
|
-
|
|
2817
|
+
qe(d, o[n].replace(/^\s*\d+\.\s+/, "")), u.appendChild(d), n += 1;
|
|
2766
2818
|
}
|
|
2767
2819
|
e.appendChild(u);
|
|
2768
2820
|
continue;
|
|
@@ -2772,17 +2824,17 @@ function ra(e, t) {
|
|
|
2772
2824
|
p.push(o[n]), n += 1;
|
|
2773
2825
|
const c = document.createElement("p");
|
|
2774
2826
|
p.forEach((u, d) => {
|
|
2775
|
-
d > 0 && c.appendChild(document.createElement("br")),
|
|
2827
|
+
d > 0 && c.appendChild(document.createElement("br")), qe(c, u);
|
|
2776
2828
|
}), e.appendChild(c);
|
|
2777
2829
|
}
|
|
2778
2830
|
}
|
|
2779
|
-
function
|
|
2831
|
+
function qe(e, t) {
|
|
2780
2832
|
const o = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
2781
2833
|
let n = 0;
|
|
2782
2834
|
for (const i of t.matchAll(o)) {
|
|
2783
|
-
const
|
|
2784
|
-
|
|
2785
|
-
document.createTextNode(t.slice(n,
|
|
2835
|
+
const r = i.index ?? 0;
|
|
2836
|
+
r > n && e.appendChild(
|
|
2837
|
+
document.createTextNode(t.slice(n, r))
|
|
2786
2838
|
);
|
|
2787
2839
|
const l = i[0];
|
|
2788
2840
|
if (l.startsWith("`")) {
|
|
@@ -2796,17 +2848,17 @@ function We(e, t) {
|
|
|
2796
2848
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
2797
2849
|
} else {
|
|
2798
2850
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
2799
|
-
if (p &&
|
|
2851
|
+
if (p && va(p[2])) {
|
|
2800
2852
|
const c = document.createElement("a");
|
|
2801
2853
|
c.href = p[2], c.target = "_top", c.rel = "noreferrer", c.textContent = p[1], e.appendChild(c);
|
|
2802
2854
|
} else
|
|
2803
2855
|
e.appendChild(document.createTextNode(l));
|
|
2804
2856
|
}
|
|
2805
|
-
n =
|
|
2857
|
+
n = r + l.length;
|
|
2806
2858
|
}
|
|
2807
2859
|
n < t.length && e.appendChild(document.createTextNode(t.slice(n)));
|
|
2808
2860
|
}
|
|
2809
|
-
function
|
|
2861
|
+
function va(e) {
|
|
2810
2862
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
2811
2863
|
return !0;
|
|
2812
2864
|
try {
|
|
@@ -2816,8 +2868,8 @@ function la(e) {
|
|
|
2816
2868
|
return !1;
|
|
2817
2869
|
}
|
|
2818
2870
|
}
|
|
2819
|
-
function
|
|
2820
|
-
if (
|
|
2871
|
+
function wn(e, t) {
|
|
2872
|
+
if (ya(e))
|
|
2821
2873
|
return;
|
|
2822
2874
|
const o = `
|
|
2823
2875
|
:host {
|
|
@@ -3008,6 +3060,10 @@ function dn(e, t) {
|
|
|
3008
3060
|
.pluno-pa-widget__launcher-input::placeholder {
|
|
3009
3061
|
color: var(--pluno-pa-faint);
|
|
3010
3062
|
}
|
|
3063
|
+
.pluno-pa-widget--host-modal-conflict .pluno-pa-widget__launcher-input,
|
|
3064
|
+
.pluno-pa-widget--host-modal-conflict .pluno-pa-widget__input {
|
|
3065
|
+
cursor: not-allowed;
|
|
3066
|
+
}
|
|
3011
3067
|
.pluno-pa-widget__launcher-minimize {
|
|
3012
3068
|
position: absolute;
|
|
3013
3069
|
top: -6px;
|
|
@@ -3652,12 +3708,11 @@ function dn(e, t) {
|
|
|
3652
3708
|
font-size: 12px;
|
|
3653
3709
|
color: var(--pluno-pa-muted);
|
|
3654
3710
|
line-height: 1.35;
|
|
3655
|
-
|
|
3711
|
+
min-height: 36px;
|
|
3656
3712
|
}
|
|
3657
3713
|
.pluno-pa-widget__character--tool-group {
|
|
3658
3714
|
width: 36px;
|
|
3659
3715
|
height: 36px;
|
|
3660
|
-
margin-top: -8px;
|
|
3661
3716
|
}
|
|
3662
3717
|
.pluno-pa-widget__assistant-marker {
|
|
3663
3718
|
min-height: 19px;
|
|
@@ -4625,24 +4680,25 @@ function dn(e, t) {
|
|
|
4625
4680
|
.pluno-pa-widget--scribble .pluno-pa-widget__character--tool-group {
|
|
4626
4681
|
width: 60px;
|
|
4627
4682
|
height: 60px;
|
|
4628
|
-
margin-
|
|
4683
|
+
margin-left: -6px;
|
|
4684
|
+
margin-right: -10px;
|
|
4629
4685
|
}
|
|
4630
4686
|
.pluno-pa-widget--scribble .pluno-pa-widget__tool-group {
|
|
4631
4687
|
align-items: center;
|
|
4632
|
-
|
|
4688
|
+
min-height: 60px;
|
|
4633
4689
|
}
|
|
4634
4690
|
.pluno-pa-widget--scribble .pluno-pa-widget__assistant-marker:not(.pluno-pa-widget__thinking-marker) {
|
|
4635
|
-
|
|
4691
|
+
min-height: 60px;
|
|
4636
4692
|
}
|
|
4637
4693
|
.pluno-pa-widget--scribble .pluno-pa-widget__tool-group.pluno-pa-widget__tool-group--open {
|
|
4638
4694
|
align-items: flex-start;
|
|
4639
4695
|
}
|
|
4640
4696
|
.pluno-pa-widget--scribble .pluno-pa-widget__tool-group details {
|
|
4641
|
-
transform:
|
|
4697
|
+
transform: none;
|
|
4642
4698
|
}
|
|
4643
4699
|
.pluno-pa-widget--scribble .pluno-pa-widget__thinking-marker .pluno-pa-widget__status,
|
|
4644
4700
|
.pluno-pa-widget--scribble .pluno-pa-widget__status.pluno-pa-widget__bottom-reserve-compact {
|
|
4645
|
-
transform:
|
|
4701
|
+
transform: none;
|
|
4646
4702
|
}
|
|
4647
4703
|
.pluno-pa-widget--scribble .pluno-pa-widget__thinking-marker.pluno-pa-widget__bottom-reserve-compact {
|
|
4648
4704
|
margin-bottom: 28px;
|
|
@@ -4925,28 +4981,28 @@ function dn(e, t) {
|
|
|
4925
4981
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
4926
4982
|
}
|
|
4927
4983
|
`;
|
|
4928
|
-
if (
|
|
4984
|
+
if (Ca(e, o))
|
|
4929
4985
|
return;
|
|
4930
4986
|
const n = e.ownerDocument.createElement("style");
|
|
4931
|
-
n.id =
|
|
4987
|
+
n.id = Pn, n.textContent = o, e.appendChild(n), qn(e);
|
|
4932
4988
|
}
|
|
4933
|
-
function
|
|
4934
|
-
return e.getElementById(
|
|
4989
|
+
function ya(e) {
|
|
4990
|
+
return e.getElementById(Pn) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Tn) === "true";
|
|
4935
4991
|
}
|
|
4936
|
-
function
|
|
4937
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
4992
|
+
function qn(e) {
|
|
4993
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Tn, "true");
|
|
4938
4994
|
}
|
|
4939
|
-
function
|
|
4995
|
+
function Ca(e, t) {
|
|
4940
4996
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
4941
4997
|
return !1;
|
|
4942
4998
|
try {
|
|
4943
4999
|
const o = new CSSStyleSheet();
|
|
4944
|
-
return o.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, o],
|
|
5000
|
+
return o.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, o], qn(e), !0;
|
|
4945
5001
|
} catch {
|
|
4946
5002
|
return !1;
|
|
4947
5003
|
}
|
|
4948
5004
|
}
|
|
4949
|
-
async function
|
|
5005
|
+
async function Sa() {
|
|
4950
5006
|
return document.body ? document.body : await new Promise((e) => {
|
|
4951
5007
|
const t = new MutationObserver(() => {
|
|
4952
5008
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -4954,14 +5010,14 @@ async function da() {
|
|
|
4954
5010
|
t.observe(document.documentElement, { childList: !0 });
|
|
4955
5011
|
});
|
|
4956
5012
|
}
|
|
4957
|
-
function
|
|
5013
|
+
function jn(e) {
|
|
4958
5014
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
4959
5015
|
}
|
|
4960
|
-
function
|
|
5016
|
+
function Ea(e) {
|
|
4961
5017
|
try {
|
|
4962
|
-
const t = window.localStorage.getItem(
|
|
5018
|
+
const t = window.localStorage.getItem(jn(e));
|
|
4963
5019
|
if (!t)
|
|
4964
|
-
return
|
|
5020
|
+
return _n();
|
|
4965
5021
|
const o = JSON.parse(t);
|
|
4966
5022
|
return {
|
|
4967
5023
|
isOpen: o.isOpen === !0,
|
|
@@ -4969,24 +5025,24 @@ function ca(e) {
|
|
|
4969
5025
|
openToolGroupKeys: Array.isArray(o.openToolGroupKeys) ? o.openToolGroupKeys.filter(
|
|
4970
5026
|
(n) => typeof n == "string"
|
|
4971
5027
|
) : [],
|
|
4972
|
-
launcherPosition:
|
|
4973
|
-
seenShareCandidateIds: Array.isArray(o.seenShareCandidateIds) ? o.seenShareCandidateIds.filter((n) => typeof n == "string").slice(-
|
|
5028
|
+
launcherPosition: Aa(o.launcherPosition) ? o.launcherPosition : null,
|
|
5029
|
+
seenShareCandidateIds: Array.isArray(o.seenShareCandidateIds) ? o.seenShareCandidateIds.filter((n) => typeof n == "string").slice(-En) : [],
|
|
4974
5030
|
sharePromptsDisabled: o.sharePromptsDisabled === !0
|
|
4975
5031
|
};
|
|
4976
5032
|
} catch {
|
|
4977
|
-
return
|
|
5033
|
+
return _n();
|
|
4978
5034
|
}
|
|
4979
5035
|
}
|
|
4980
|
-
async function
|
|
5036
|
+
async function ka(e) {
|
|
4981
5037
|
if (e.loadSharePromptsDisabled)
|
|
4982
5038
|
return e.loadSharePromptsDisabled();
|
|
4983
5039
|
try {
|
|
4984
|
-
return window.localStorage.getItem(
|
|
5040
|
+
return window.localStorage.getItem(kn) === "true";
|
|
4985
5041
|
} catch {
|
|
4986
5042
|
return !1;
|
|
4987
5043
|
}
|
|
4988
5044
|
}
|
|
4989
|
-
function
|
|
5045
|
+
function La(e, t) {
|
|
4990
5046
|
if (e.persistSharePromptsDisabled) {
|
|
4991
5047
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
4992
5048
|
() => {
|
|
@@ -4995,12 +5051,12 @@ function ga(e, t) {
|
|
|
4995
5051
|
return;
|
|
4996
5052
|
}
|
|
4997
5053
|
try {
|
|
4998
|
-
t && window.localStorage.setItem(
|
|
5054
|
+
t && window.localStorage.setItem(kn, "true");
|
|
4999
5055
|
} catch {
|
|
5000
5056
|
return;
|
|
5001
5057
|
}
|
|
5002
5058
|
}
|
|
5003
|
-
function
|
|
5059
|
+
function _n() {
|
|
5004
5060
|
return {
|
|
5005
5061
|
isOpen: !1,
|
|
5006
5062
|
composerValue: "",
|
|
@@ -5010,46 +5066,46 @@ function cn() {
|
|
|
5010
5066
|
sharePromptsDisabled: !1
|
|
5011
5067
|
};
|
|
5012
5068
|
}
|
|
5013
|
-
function
|
|
5069
|
+
function Ia(e, t) {
|
|
5014
5070
|
try {
|
|
5015
5071
|
window.localStorage.setItem(
|
|
5016
|
-
|
|
5072
|
+
jn(e),
|
|
5017
5073
|
JSON.stringify(t)
|
|
5018
5074
|
);
|
|
5019
5075
|
} catch {
|
|
5020
5076
|
return;
|
|
5021
5077
|
}
|
|
5022
5078
|
}
|
|
5023
|
-
function
|
|
5079
|
+
function Aa(e) {
|
|
5024
5080
|
if (!e || typeof e != "object")
|
|
5025
5081
|
return !1;
|
|
5026
5082
|
const t = e;
|
|
5027
5083
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
5028
5084
|
}
|
|
5029
|
-
const
|
|
5030
|
-
function
|
|
5085
|
+
const xn = /* @__PURE__ */ new WeakSet();
|
|
5086
|
+
function Pa(e) {
|
|
5031
5087
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5032
5088
|
}
|
|
5033
|
-
function
|
|
5089
|
+
function vn(e) {
|
|
5034
5090
|
const t = e.pathname.split("/");
|
|
5035
5091
|
return t[t.length - 1] ?? "";
|
|
5036
5092
|
}
|
|
5037
|
-
function
|
|
5093
|
+
function Ta(e, t) {
|
|
5038
5094
|
const o = new URL(e.src, document.baseURI);
|
|
5039
|
-
return o.href === t.href || o.pathname === t.pathname ? !0 :
|
|
5095
|
+
return o.href === t.href || o.pathname === t.pathname ? !0 : vn(o) === vn(t);
|
|
5040
5096
|
}
|
|
5041
5097
|
class ae extends EventTarget {
|
|
5042
5098
|
constructor(t, o) {
|
|
5043
|
-
super(), this.channelId = o, this.url = t, this.addPreviewListener(
|
|
5099
|
+
super(), this.channelId = o, this.url = t, this.addPreviewListener(Mo, () => {
|
|
5044
5100
|
this.readyState = ae.OPEN, this.dispatchEvent(new Event("open"));
|
|
5045
|
-
}), this.addPreviewListener(
|
|
5101
|
+
}), this.addPreviewListener(Oo, (n) => {
|
|
5046
5102
|
const i = n;
|
|
5047
5103
|
this.dispatchEvent(
|
|
5048
5104
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5049
5105
|
);
|
|
5050
|
-
}), this.addPreviewListener(
|
|
5106
|
+
}), this.addPreviewListener(zo, () => {
|
|
5051
5107
|
this.readyState = ae.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5052
|
-
}), this.addPreviewListener(
|
|
5108
|
+
}), this.addPreviewListener(Bo, (n) => {
|
|
5053
5109
|
const i = n;
|
|
5054
5110
|
this.readyState = ae.CLOSED, this.dispatchEvent(
|
|
5055
5111
|
new CloseEvent("close", {
|
|
@@ -5060,8 +5116,8 @@ class ae extends EventTarget {
|
|
|
5060
5116
|
), this.cleanup();
|
|
5061
5117
|
}), window.dispatchEvent(
|
|
5062
5118
|
new CustomEvent(
|
|
5063
|
-
|
|
5064
|
-
|
|
5119
|
+
je(
|
|
5120
|
+
No,
|
|
5065
5121
|
this.channelId
|
|
5066
5122
|
),
|
|
5067
5123
|
{
|
|
@@ -5081,7 +5137,7 @@ class ae extends EventTarget {
|
|
|
5081
5137
|
binaryType = "blob";
|
|
5082
5138
|
bufferedAmount = 0;
|
|
5083
5139
|
readyState = ae.CONNECTING;
|
|
5084
|
-
socketId =
|
|
5140
|
+
socketId = Na();
|
|
5085
5141
|
listeners = /* @__PURE__ */ new Map();
|
|
5086
5142
|
send(t) {
|
|
5087
5143
|
if (this.readyState !== ae.OPEN)
|
|
@@ -5091,7 +5147,7 @@ class ae extends EventTarget {
|
|
|
5091
5147
|
);
|
|
5092
5148
|
window.dispatchEvent(
|
|
5093
5149
|
new CustomEvent(
|
|
5094
|
-
|
|
5150
|
+
je(Do, this.channelId),
|
|
5095
5151
|
{
|
|
5096
5152
|
detail: {
|
|
5097
5153
|
socketId: this.socketId,
|
|
@@ -5104,7 +5160,7 @@ class ae extends EventTarget {
|
|
|
5104
5160
|
close(t, o) {
|
|
5105
5161
|
this.readyState !== ae.CLOSED && (this.readyState = ae.CLOSING, window.dispatchEvent(
|
|
5106
5162
|
new CustomEvent(
|
|
5107
|
-
|
|
5163
|
+
je(Ro, this.channelId),
|
|
5108
5164
|
{
|
|
5109
5165
|
detail: { socketId: this.socketId, code: t, reason: o }
|
|
5110
5166
|
}
|
|
@@ -5112,11 +5168,11 @@ class ae extends EventTarget {
|
|
|
5112
5168
|
), this.cleanup());
|
|
5113
5169
|
}
|
|
5114
5170
|
addPreviewListener(t, o) {
|
|
5115
|
-
const n =
|
|
5171
|
+
const n = je(
|
|
5116
5172
|
t,
|
|
5117
5173
|
this.channelId
|
|
5118
|
-
), i = (
|
|
5119
|
-
|
|
5174
|
+
), i = (r) => {
|
|
5175
|
+
r.detail?.socketId === this.socketId && o(r);
|
|
5120
5176
|
};
|
|
5121
5177
|
this.listeners.set(n, i), window.addEventListener(n, i);
|
|
5122
5178
|
}
|
|
@@ -5126,19 +5182,19 @@ class ae extends EventTarget {
|
|
|
5126
5182
|
this.listeners.clear();
|
|
5127
5183
|
}
|
|
5128
5184
|
}
|
|
5129
|
-
function
|
|
5185
|
+
function Na() {
|
|
5130
5186
|
const e = window.sessionStorage.getItem(
|
|
5131
|
-
|
|
5187
|
+
Vt
|
|
5132
5188
|
);
|
|
5133
5189
|
if (e)
|
|
5134
5190
|
return e;
|
|
5135
5191
|
const t = crypto.randomUUID();
|
|
5136
|
-
return window.sessionStorage.setItem(
|
|
5192
|
+
return window.sessionStorage.setItem(Vt, t), t;
|
|
5137
5193
|
}
|
|
5138
|
-
function
|
|
5194
|
+
function je(e, t) {
|
|
5139
5195
|
return `${e}:${t}`;
|
|
5140
5196
|
}
|
|
5141
|
-
function
|
|
5197
|
+
function Da(e) {
|
|
5142
5198
|
const t = document.currentScript;
|
|
5143
5199
|
if (t instanceof HTMLScriptElement)
|
|
5144
5200
|
return [t];
|
|
@@ -5146,20 +5202,20 @@ function _a(e) {
|
|
|
5146
5202
|
return Array.from(
|
|
5147
5203
|
document.querySelectorAll("script[type='module'][src]")
|
|
5148
5204
|
).filter(
|
|
5149
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5205
|
+
(i) => i instanceof HTMLScriptElement && Pa(i) && Ta(i, n)
|
|
5150
5206
|
);
|
|
5151
5207
|
}
|
|
5152
|
-
function
|
|
5153
|
-
for (const t of
|
|
5154
|
-
if (
|
|
5208
|
+
function Ra(e) {
|
|
5209
|
+
for (const t of Da(e)) {
|
|
5210
|
+
if (xn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
5155
5211
|
continue;
|
|
5156
|
-
|
|
5212
|
+
xn.add(t);
|
|
5157
5213
|
const o = t.dataset.plunoPreviewChannel;
|
|
5158
|
-
|
|
5214
|
+
di({
|
|
5159
5215
|
token: t.dataset.plunoToken,
|
|
5160
5216
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
5161
5217
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
5162
|
-
webSocketFactory: o ?
|
|
5218
|
+
webSocketFactory: o ? si(o) : void 0,
|
|
5163
5219
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5164
5220
|
accentColor: t.dataset.plunoAccentColor,
|
|
5165
5221
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -5171,8 +5227,8 @@ function xa(e) {
|
|
|
5171
5227
|
});
|
|
5172
5228
|
}
|
|
5173
5229
|
}
|
|
5174
|
-
|
|
5230
|
+
Ra(import.meta.url);
|
|
5175
5231
|
export {
|
|
5176
|
-
|
|
5177
|
-
|
|
5232
|
+
si as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5233
|
+
di as mountPlunoProductAgentWidget
|
|
5178
5234
|
};
|