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