@pluno/product-agent-web 0.1.92 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/product-agent-sdk.js +181 -167
- package/dist/product-agent-widget.js +914 -875
- package/dist/widget.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as mi, getProductAgentOriginAccessErrorMessage as fi } from "./product-agent-sdk.js";
|
|
2
|
+
const wi = "#7c3aed", xt = "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", yt = "#2c2a1e", Mn = [253, 250, 241], On = 3.5;
|
|
3
|
+
function xo(e) {
|
|
4
|
+
const t = yo(e);
|
|
5
|
+
if (Un(it(t), Mn) >= On)
|
|
6
6
|
return t;
|
|
7
|
-
let o =
|
|
8
|
-
const i =
|
|
7
|
+
let o = it(t);
|
|
8
|
+
const i = it(yt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = xi(o, i, 0.22), Un(o, Mn) >= On)
|
|
11
|
+
return on(o);
|
|
12
|
+
return on(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function bi() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
@@ -19,8 +19,8 @@ function ui() {
|
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function _i(e) {
|
|
23
|
+
const t = yo(e), n = an(it(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,34 +56,34 @@ function gi(e) {
|
|
|
56
56
|
shadow: le(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function yo(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()}` : wi;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function it(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function on([e, t, n]) {
|
|
71
71
|
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function an([e, t, n]) {
|
|
75
75
|
const o = (i) => {
|
|
76
76
|
const r = i / 255;
|
|
77
77
|
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
81
|
+
function Un(e, t) {
|
|
82
|
+
const n = an(e), o = an(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const o =
|
|
85
|
+
function xi(e, t, n) {
|
|
86
|
+
const o = rn(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
@@ -91,43 +91,43 @@ function hi(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function le(e, t, n) {
|
|
94
|
-
const [o, i, r] =
|
|
95
|
-
return
|
|
94
|
+
const [o, i, r] = yi(it(e));
|
|
95
|
+
return on(vi(o, rn(i + n), rn(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function yi([e, t, n]) {
|
|
98
98
|
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), s = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, s];
|
|
101
101
|
const g = l - p, c = s > 0.5 ? g / (2 - l - p) : g / (l + p);
|
|
102
102
|
return [(l === o ? (i - r) / g + (i < r ? 6 : 0) : l === i ? (r - o) / g + 2 : (o - i) / g + 4) / 6, c, s];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function vi(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
jt(i, o, e + 1 / 3) * 255,
|
|
110
|
+
jt(i, o, e) * 255,
|
|
111
|
+
jt(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function jt(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 rn(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const vo = "suggest_share_on_socials";
|
|
122
|
+
function Si(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== vo)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = Bn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = Bn(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -136,13 +136,13 @@ function wi(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function Ci(e) {
|
|
140
|
+
const t = await Ei(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 Bn(e, t, n) {
|
|
146
146
|
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
147
|
const i = e[o];
|
|
148
148
|
if (i.role === n && i.content.trim())
|
|
@@ -150,74 +150,74 @@ function zn(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function Ei(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
156
|
+
const ki = "https://app.pluno.ai", Li = "/api/product-agent/embed/active-users", Ti = 1800, Pi = 15e3, Ii = 250, Ai = 1e3, Ni = 3e4;
|
|
157
|
+
function Ri(e, t = {}) {
|
|
158
158
|
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
161
|
}, p = (c) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
g();
|
|
164
|
-
},
|
|
164
|
+
}, Mi(c)));
|
|
165
165
|
}, s = (c) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
167
|
o = c, e(c);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const h = o,
|
|
170
|
+
const h = o, S = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const P = Math.min(1, (performance.now() -
|
|
177
|
-
o = Math.round(h + (c - h) *
|
|
178
|
-
},
|
|
176
|
+
const P = Math.min(1, (performance.now() - S) / Ti);
|
|
177
|
+
o = Math.round(h + (c - h) * Oi(P)), e(o), P >= 1 && (o = c, e(c), l());
|
|
178
|
+
}, Ii);
|
|
179
179
|
}, g = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const c = await
|
|
181
|
+
const c = await Di(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
184
|
s(c.count), p(c.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(Pi);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
return g(), () => {
|
|
190
190
|
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function Di(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(Li, zi(e.backendUrl ?? ki)).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(), i =
|
|
202
|
+
const o = await n.json(), i = Fn(o.count), r = Fn(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
203
|
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
205
|
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Fn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function zi(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function Mi(e) {
|
|
214
|
+
return Math.min(Ni, Math.max(Ai, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Oi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
function
|
|
219
|
+
const Ui = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
220
|
+
function Bi(e) {
|
|
221
221
|
let t = "", n = "", o = null;
|
|
222
222
|
for (const i of e.split(new RegExp("(?<=\\n)"))) {
|
|
223
223
|
if (o) {
|
|
@@ -228,7 +228,7 @@ function Ri(e) {
|
|
|
228
228
|
}
|
|
229
229
|
const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
230
230
|
if (r) {
|
|
231
|
-
t +=
|
|
231
|
+
t += Wn(n) + i, n = "", o = {
|
|
232
232
|
marker: r[1][0],
|
|
233
233
|
length: r[1].length
|
|
234
234
|
};
|
|
@@ -236,31 +236,31 @@ function Ri(e) {
|
|
|
236
236
|
}
|
|
237
237
|
n += i;
|
|
238
238
|
}
|
|
239
|
-
return t +
|
|
239
|
+
return t + Wn(n);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Wn(e) {
|
|
242
242
|
let t = "", n = 0;
|
|
243
|
-
for (const o of e.matchAll(
|
|
243
|
+
for (const o of e.matchAll(Ui)) {
|
|
244
244
|
const i = o.index ?? 0;
|
|
245
|
-
t +=
|
|
245
|
+
t += Hn(
|
|
246
246
|
e.slice(n, i)
|
|
247
247
|
), t += o[0], n = i + o[0].length;
|
|
248
248
|
}
|
|
249
|
-
return t +
|
|
249
|
+
return t + Hn(e.slice(n));
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function Hn(e) {
|
|
252
252
|
return e.replace(
|
|
253
253
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
254
|
-
(t, n, o, i, r) => r[i - 1] === "!" ||
|
|
254
|
+
(t, n, o, i, r) => r[i - 1] === "!" || Fi(r, i) || Wi(r, i, n) ? t : `[${n}](${o})`
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Fi(e, t) {
|
|
258
258
|
let n = 0;
|
|
259
259
|
for (let o = t - 1; e[o] === "\\"; o -= 1)
|
|
260
260
|
n += 1;
|
|
261
261
|
return n % 2 === 1;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Wi(e, t, n) {
|
|
264
264
|
if (n !== "x" && n !== "X")
|
|
265
265
|
return !1;
|
|
266
266
|
const o = e.lastIndexOf(`
|
|
@@ -269,7 +269,7 @@ function zi(e, t, n) {
|
|
|
269
269
|
e.slice(o, t)
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const So = 100, Hi = 1e4, Gi = 5e3, $i = "product-agent:sdk-preview-socket-connect", qi = "product-agent:sdk-preview-socket-send", ji = "product-agent:sdk-preview-socket-close", Vi = "product-agent:sdk-preview-socket-open", Ki = "product-agent:sdk-preview-socket-message", Yi = "product-agent:sdk-preview-socket-error", Xi = "product-agent:sdk-preview-socket-closed", Gn = "product-agent:sdk-preview-socket-id", Zi = "data-pluno-sdk-preview-channel", Co = "data-pluno-auto-mounted", me = "__plunoProductAgentAutoMountOwner", Ji = 1e4, Qi = "Failed to load Pluno widget token", $n = "Timed out loading Pluno widget token", ea = "pluno.productAgent.widgetClientId.", Vt = /* @__PURE__ */ new Set(), ta = "product-agent:preview-diagnostic", Eo = "pluno.productAgent.sharePromptsDisabled", na = 3, qn = 'dialog[open], [aria-modal="true"], [role="dialog"]', oa = 400, ia = 5e3, aa = 500, jn = "Close the page's popup to chat", ra = "No recent chats for this page yet.", pe = {
|
|
273
273
|
launcherLabel: "Ask for anything...",
|
|
274
274
|
accentColor: "#7c3aed",
|
|
275
275
|
colorScheme: "light",
|
|
@@ -277,7 +277,7 @@ const _o = 100, Mi = 1e4, Oi = 5e3, Ui = "product-agent:sdk-preview-socket-conne
|
|
|
277
277
|
scribbleStyle: !0,
|
|
278
278
|
position: "bottom-right",
|
|
279
279
|
movableLauncher: !0
|
|
280
|
-
},
|
|
280
|
+
}, la = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Vn = "pluno-pa-scribble-font", ko = 190, Lo = 41, Kn = 22, pa = 1, sa = 48, fn = 420, da = 520, ca = 0.24, wn = 680, ua = 800, ga = 0.76, N = 8, Ne = 50, To = "http://www.w3.org/2000/svg", ln = 26, pn = 8, ha = 36, sn = 16, ma = 4, Yn = [
|
|
281
281
|
{
|
|
282
282
|
ellipseCx: "17.5",
|
|
283
283
|
ellipseCy: "24.5",
|
|
@@ -314,12 +314,12 @@ const _o = 100, Mi = 1e4, Oi = 5e3, Ui = "product-agent:sdk-preview-socket-conne
|
|
|
314
314
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
315
315
|
pathStrokeWidth: "2.45"
|
|
316
316
|
}
|
|
317
|
-
],
|
|
318
|
-
let
|
|
319
|
-
function
|
|
317
|
+
], fa = 11, wa = 13, dn = 4, Po = 10, Io = 40, ba = "movable-launcher-position-v2", Ao = "pluno-pa-widget-styles", No = "data-pluno-pa-widget-styles";
|
|
318
|
+
let Xn = 0;
|
|
319
|
+
function _a(e) {
|
|
320
320
|
return (t) => new fe(t, e);
|
|
321
321
|
}
|
|
322
|
-
async function
|
|
322
|
+
async function xa(e = {}) {
|
|
323
323
|
const t = {
|
|
324
324
|
layout: e.layout ?? "floating",
|
|
325
325
|
mountTarget: e.mountTarget,
|
|
@@ -368,9 +368,10 @@ async function ha(e = {}) {
|
|
|
368
368
|
morningReport: e.morningReport ?? null,
|
|
369
369
|
onMorningReportSnooze: e.onMorningReportSnooze,
|
|
370
370
|
onMorningReportTaskStart: e.onMorningReportTaskStart,
|
|
371
|
-
taskNotifications: e.taskNotifications
|
|
371
|
+
taskNotifications: e.taskNotifications,
|
|
372
|
+
tabGroups: e.tabGroups
|
|
372
373
|
};
|
|
373
|
-
|
|
374
|
+
Y(
|
|
374
375
|
"web-sdk.widget",
|
|
375
376
|
"Mounting widget with merged options",
|
|
376
377
|
{
|
|
@@ -387,39 +388,39 @@ async function ha(e = {}) {
|
|
|
387
388
|
);
|
|
388
389
|
const n = document.createElement("div");
|
|
389
390
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", t.layout), t.sdkPreviewChannelId && n.setAttribute(
|
|
390
|
-
|
|
391
|
+
Zi,
|
|
391
392
|
t.sdkPreviewChannelId
|
|
392
393
|
);
|
|
393
394
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
394
395
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.classList.add(`pluno-pa-widget--layout-${t.layout}`), i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
395
|
-
let r =
|
|
396
|
+
let r = Zn(
|
|
396
397
|
t.accentColor,
|
|
397
398
|
t.scribbleStyle
|
|
398
399
|
);
|
|
399
|
-
|
|
400
|
+
Ga(
|
|
400
401
|
i,
|
|
401
402
|
t.launcherLabel,
|
|
402
403
|
r,
|
|
403
404
|
t.movableLauncher,
|
|
404
405
|
t.showLauncherMinimizeButton
|
|
405
406
|
), o.appendChild(i);
|
|
406
|
-
const l =
|
|
407
|
-
|
|
407
|
+
const l = Wr(t), p = t.layout === "floating" ? t.initialDisplayState ?? Br(t) : "shown";
|
|
408
|
+
fo(t, p);
|
|
408
409
|
let s = t.movableLauncher ? l.launcherPosition : null, g = s !== null, c = l.panelSize, h = null;
|
|
409
410
|
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Ae(
|
|
410
411
|
i,
|
|
411
|
-
|
|
412
|
+
Yt(
|
|
412
413
|
i,
|
|
413
414
|
s,
|
|
414
415
|
t.position
|
|
415
416
|
)
|
|
416
|
-
)),
|
|
417
|
+
)), mo(o, t.accentColor), Jn(i, r, {
|
|
417
418
|
accentColor: t.accentColor,
|
|
418
419
|
colorScheme: t.colorScheme,
|
|
419
420
|
fontFamily: t.fontFamily,
|
|
420
421
|
scribbleStyle: t.scribbleStyle
|
|
421
422
|
});
|
|
422
|
-
const
|
|
423
|
+
const S = t.mountTarget ?? await Ur(), P = S.ownerDocument, I = i.querySelector(
|
|
423
424
|
".pluno-pa-widget__launcher"
|
|
424
425
|
), D = i.querySelector(
|
|
425
426
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -427,15 +428,15 @@ async function ha(e = {}) {
|
|
|
427
428
|
".pluno-pa-widget__launcher-input"
|
|
428
429
|
), v = i.querySelector(
|
|
429
430
|
".pluno-pa-widget__launcher-minimize"
|
|
430
|
-
), m = i.querySelector(".pluno-pa-widget__panel"),
|
|
431
|
+
), m = i.querySelector(".pluno-pa-widget__panel"), C = i.querySelector(
|
|
431
432
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
432
433
|
), z = Array.from(
|
|
433
434
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
434
435
|
), L = i.querySelector(
|
|
435
436
|
".pluno-pa-widget__close"
|
|
436
|
-
),
|
|
437
|
+
), ie = i.querySelector(
|
|
437
438
|
".pluno-pa-widget__composer"
|
|
438
|
-
),
|
|
439
|
+
), Q = i.querySelector(
|
|
439
440
|
".pluno-pa-widget__attachment-error"
|
|
440
441
|
), Re = i.querySelector(
|
|
441
442
|
".pluno-pa-widget__billing-status"
|
|
@@ -447,19 +448,19 @@ async function ha(e = {}) {
|
|
|
447
448
|
".pluno-pa-widget__attach"
|
|
448
449
|
), f = i.querySelector(
|
|
449
450
|
".pluno-pa-widget__input"
|
|
450
|
-
),
|
|
451
|
+
), ee = i.querySelector(
|
|
451
452
|
".pluno-pa-widget__send"
|
|
452
453
|
), De = i.querySelector(
|
|
453
454
|
".pluno-pa-widget__top-actions"
|
|
454
|
-
), Ce = i.querySelector(
|
|
455
|
-
".pluno-pa-widget__history"
|
|
456
455
|
), Se = i.querySelector(
|
|
456
|
+
".pluno-pa-widget__history"
|
|
457
|
+
), Ce = i.querySelector(
|
|
457
458
|
".pluno-pa-widget__history-panel"
|
|
458
459
|
), j = i.querySelector(
|
|
459
460
|
".pluno-pa-widget__history-list"
|
|
460
|
-
),
|
|
461
|
+
), at = i.querySelector(
|
|
461
462
|
".pluno-pa-widget__history-close"
|
|
462
|
-
),
|
|
463
|
+
), ae = i.querySelector(
|
|
463
464
|
".pluno-pa-widget__history-status"
|
|
464
465
|
), x = i.querySelector(
|
|
465
466
|
".pluno-pa-widget__timeline-jump"
|
|
@@ -467,7 +468,7 @@ async function ha(e = {}) {
|
|
|
467
468
|
".pluno-pa-widget__active-users-counter"
|
|
468
469
|
), T = i.querySelector(
|
|
469
470
|
".pluno-pa-widget__timeline"
|
|
470
|
-
),
|
|
471
|
+
), re = i.querySelector(
|
|
471
472
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
472
473
|
), H = i.querySelector(
|
|
473
474
|
".pluno-pa-widget__notify-suggestion"
|
|
@@ -475,41 +476,47 @@ async function ha(e = {}) {
|
|
|
475
476
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
476
477
|
), A = i.querySelector(
|
|
477
478
|
".pluno-pa-widget__notify-suggestion-later"
|
|
478
|
-
),
|
|
479
|
+
), Xo = i.querySelector(
|
|
479
480
|
".pluno-pa-widget__notify-suggestion-never"
|
|
481
|
+
), ze = i.querySelector(
|
|
482
|
+
".pluno-pa-widget__tab-groups-suggestion"
|
|
483
|
+
), Zo = i.querySelector(
|
|
484
|
+
".pluno-pa-widget__tab-groups-suggestion-enable"
|
|
485
|
+
), Jo = i.querySelector(
|
|
486
|
+
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
480
487
|
);
|
|
481
|
-
if (!I || !u || !m || !L || !
|
|
488
|
+
if (!I || !u || !m || !L || !ie || !Q || !Re || !U || !we || !B || !f || !ee || !De || !Se || !Ce || !j || !at || !ae || !x || !R || !T || !re)
|
|
482
489
|
throw new Error("Failed to mount Pluno widget");
|
|
483
490
|
if (t.movableLauncher && !D)
|
|
484
491
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
485
|
-
B.hidden = !t.attachmentsEnabled, we.disabled = !t.attachmentsEnabled,
|
|
492
|
+
B.hidden = !t.attachmentsEnabled, we.disabled = !t.attachmentsEnabled, ao(u), ao(f);
|
|
486
493
|
let q = [], ue = null;
|
|
487
|
-
const
|
|
488
|
-
|
|
494
|
+
const Me = () => {
|
|
495
|
+
sr(
|
|
489
496
|
U,
|
|
490
497
|
q,
|
|
491
498
|
(a) => {
|
|
492
499
|
q = q.filter(
|
|
493
500
|
(d, _) => _ !== a
|
|
494
|
-
),
|
|
501
|
+
), Me(), W(b.getState()), G();
|
|
495
502
|
}
|
|
496
503
|
);
|
|
497
|
-
},
|
|
498
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
504
|
+
}, yn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Ko(t.tokenEndpoint) : void 0);
|
|
505
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !yn && !t.webSocketFactory)
|
|
499
506
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
500
|
-
const
|
|
507
|
+
const Qo = window.fetch.bind(window), kt = Fr(t.clientId);
|
|
501
508
|
let b;
|
|
502
509
|
try {
|
|
503
510
|
const a = {
|
|
504
511
|
token: t.token,
|
|
505
|
-
tokenProvider:
|
|
512
|
+
tokenProvider: yn,
|
|
506
513
|
backendUrl: t.backendUrl,
|
|
507
514
|
metadata: () => ({
|
|
508
515
|
...t.metadata ?? {},
|
|
509
516
|
...!b.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
510
517
|
}),
|
|
511
518
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
512
|
-
clientId:
|
|
519
|
+
clientId: kt.clientId,
|
|
513
520
|
restorePersistedState: t.restorePersistedState,
|
|
514
521
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
515
522
|
keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
|
|
@@ -520,11 +527,11 @@ async function ha(e = {}) {
|
|
|
520
527
|
autoConnect: !1,
|
|
521
528
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
522
529
|
};
|
|
523
|
-
b = await
|
|
530
|
+
b = await mi.init(a);
|
|
524
531
|
} catch (a) {
|
|
525
|
-
throw
|
|
532
|
+
throw kt.release(), n.remove(), a;
|
|
526
533
|
}
|
|
527
|
-
|
|
534
|
+
S.appendChild(n), Y(
|
|
528
535
|
"web-sdk.widget",
|
|
529
536
|
"Applied initial widget appearance",
|
|
530
537
|
{
|
|
@@ -534,22 +541,22 @@ async function ha(e = {}) {
|
|
|
534
541
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
535
542
|
}
|
|
536
543
|
);
|
|
537
|
-
const
|
|
544
|
+
const Lt = new Set(l.openToolGroupKeys), Oe = new Set(
|
|
538
545
|
l.seenShareCandidateIds
|
|
539
|
-
),
|
|
540
|
-
let
|
|
546
|
+
), rt = new Set(Oe);
|
|
547
|
+
let Tt = l.sharePromptsDisabled || await Hr(t), te = null, V = !1, lt = !(t.loginRequired || t.signupRequired), be = !1, Ee = {
|
|
541
548
|
enabled: !0
|
|
542
|
-
}, ke = 0,
|
|
543
|
-
const
|
|
549
|
+
}, ke = 0, vn = "", _e = !1, ge = !1, xe = [], Pt = null, qe = null;
|
|
550
|
+
const ne = (a, d) => {
|
|
544
551
|
Ee = { enabled: a, reason: d };
|
|
545
|
-
},
|
|
552
|
+
}, oe = () => {
|
|
546
553
|
x.hidden = !0;
|
|
547
|
-
},
|
|
554
|
+
}, ei = () => {
|
|
548
555
|
x.hidden = !1;
|
|
549
|
-
},
|
|
550
|
-
|
|
556
|
+
}, ti = (a = "jump") => {
|
|
557
|
+
ne(!0, a), oe(), ot(T, () => Ee.enabled), ke = T.scrollTop;
|
|
551
558
|
}, Le = () => {
|
|
552
|
-
if (
|
|
559
|
+
if (Se.hidden = t.layout === "page" || t.loginRequired, Ce.hidden = !_e, Se.setAttribute("aria-expanded", String(_e)), j.classList.toggle(
|
|
553
560
|
"pluno-pa-widget__history-list--center",
|
|
554
561
|
ge && xe.length === 0
|
|
555
562
|
), j.replaceChildren(), ge && xe.length === 0) {
|
|
@@ -560,54 +567,54 @@ async function ha(e = {}) {
|
|
|
560
567
|
const d = document.createElement("button");
|
|
561
568
|
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ge;
|
|
562
569
|
const _ = document.createElement("span");
|
|
563
|
-
_.className = "pluno-pa-widget__history-item-title", _.textContent =
|
|
570
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = Fa(a);
|
|
564
571
|
const k = document.createElement("time");
|
|
565
|
-
k.className = "pluno-pa-widget__history-time", k.dateTime = a.lastActiveAt, k.textContent =
|
|
572
|
+
k.className = "pluno-pa-widget__history-time", k.dateTime = a.lastActiveAt, k.textContent = Ha(
|
|
566
573
|
a.lastActiveAt,
|
|
567
574
|
Date.now()
|
|
568
575
|
);
|
|
569
576
|
const M = document.createElement("small");
|
|
570
|
-
M.className = "pluno-pa-widget__history-path", M.textContent =
|
|
571
|
-
_e = !1,
|
|
577
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = Wa(a), d.append(_, k, M), d.addEventListener("click", () => {
|
|
578
|
+
_e = !1, qe = null, Le(), ne(!0, "newSession"), oe(), b.loadSession(a.id), W(b.getState());
|
|
572
579
|
}), j.appendChild(d);
|
|
573
580
|
}
|
|
574
581
|
if (ge && xe.length > 0) {
|
|
575
582
|
const a = document.createElement("p");
|
|
576
583
|
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", j.appendChild(a);
|
|
577
584
|
}
|
|
578
|
-
|
|
579
|
-
},
|
|
585
|
+
ae.textContent = qe ?? (!ge && xe.length === 0 ? "No recent chats for this page yet." : ""), ae.hidden = ae.textContent.length === 0;
|
|
586
|
+
}, Sn = async (a) => {
|
|
580
587
|
if (!ge) {
|
|
581
|
-
ge = !0,
|
|
588
|
+
ge = !0, qe = null, Le();
|
|
582
589
|
try {
|
|
583
590
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
584
|
-
xe = a ? [...xe, ...d.sessions] : d.sessions,
|
|
591
|
+
xe = a ? [...xe, ...d.sessions] : d.sessions, Pt = d.nextCursor;
|
|
585
592
|
} catch (d) {
|
|
586
|
-
|
|
593
|
+
Y(
|
|
587
594
|
"web-sdk.widget",
|
|
588
595
|
"Failed to load session history",
|
|
589
596
|
{
|
|
590
597
|
message: d instanceof Error ? d.message : String(d)
|
|
591
598
|
}
|
|
592
|
-
),
|
|
599
|
+
), qe = ra;
|
|
593
600
|
} finally {
|
|
594
601
|
ge = !1, Le();
|
|
595
602
|
}
|
|
596
603
|
}
|
|
597
|
-
},
|
|
598
|
-
!
|
|
599
|
-
},
|
|
600
|
-
|
|
601
|
-
},
|
|
602
|
-
|
|
604
|
+
}, ni = () => {
|
|
605
|
+
!Pt || ge || j.scrollHeight - j.scrollTop - j.clientHeight <= 24 && Sn(Pt);
|
|
606
|
+
}, Cn = () => {
|
|
607
|
+
V || typeof document > "u" || (mo(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || P.body?.appendChild(n)));
|
|
608
|
+
}, En = new MutationObserver(Cn);
|
|
609
|
+
En.observe(P.documentElement, {
|
|
603
610
|
childList: !0,
|
|
604
611
|
subtree: !0
|
|
605
|
-
}),
|
|
606
|
-
const
|
|
607
|
-
const d =
|
|
608
|
-
return
|
|
612
|
+
}), Cn();
|
|
613
|
+
const je = (a = !0) => {
|
|
614
|
+
const d = vt(i, a);
|
|
615
|
+
return cn(
|
|
609
616
|
i,
|
|
610
|
-
s ?
|
|
617
|
+
s ? Ro(s, d) : Ta(
|
|
611
618
|
i,
|
|
612
619
|
t.position,
|
|
613
620
|
d
|
|
@@ -615,38 +622,38 @@ async function ha(e = {}) {
|
|
|
615
622
|
d
|
|
616
623
|
);
|
|
617
624
|
}, F = () => {
|
|
618
|
-
const a =
|
|
619
|
-
|
|
625
|
+
const a = za(o, u, f);
|
|
626
|
+
$r(t, {
|
|
620
627
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
621
628
|
composerValue: f.value,
|
|
622
629
|
focusedInput: a,
|
|
623
630
|
focusedInputAt: a ? Date.now() : null,
|
|
624
|
-
openToolGroupKeys: [...
|
|
631
|
+
openToolGroupKeys: [...Lt],
|
|
625
632
|
launcherPosition: g ? s : null,
|
|
626
633
|
panelSize: c,
|
|
627
|
-
seenShareCandidateIds: [...
|
|
628
|
-
-
|
|
634
|
+
seenShareCandidateIds: [...Oe].slice(
|
|
635
|
+
-So
|
|
629
636
|
),
|
|
630
|
-
sharePromptsDisabled:
|
|
637
|
+
sharePromptsDisabled: Tt
|
|
631
638
|
});
|
|
632
|
-
},
|
|
639
|
+
}, pt = (a) => {
|
|
633
640
|
t.onDisplayStateChange?.(a);
|
|
634
|
-
},
|
|
635
|
-
if (
|
|
636
|
-
i.classList.remove("pluno-pa-widget--minimized"), I.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") &&
|
|
641
|
+
}, Ve = (a, d = !0) => {
|
|
642
|
+
if (fo(t, a), a === "shown") {
|
|
643
|
+
i.classList.remove("pluno-pa-widget--minimized"), I.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Ke(!1), d && pt("shown");
|
|
637
644
|
return;
|
|
638
645
|
}
|
|
639
|
-
|
|
646
|
+
te !== null && (window.clearTimeout(te), te = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), I.hidden = !1, m.hidden = !0, L.hidden = !0, I.tabIndex = 0, f.value = "", Ae(
|
|
640
647
|
i,
|
|
641
|
-
|
|
648
|
+
Yt(
|
|
642
649
|
i,
|
|
643
650
|
s,
|
|
644
651
|
t.position
|
|
645
652
|
)
|
|
646
|
-
),
|
|
653
|
+
), no(i), F(), d && pt("minimized");
|
|
647
654
|
}, Te = (a, d = {}) => {
|
|
648
|
-
|
|
649
|
-
debugVersion:
|
|
655
|
+
Da(a, {
|
|
656
|
+
debugVersion: ba,
|
|
650
657
|
launcherPosition: s,
|
|
651
658
|
rootClasses: i.className,
|
|
652
659
|
rootStyle: {
|
|
@@ -655,38 +662,38 @@ async function ha(e = {}) {
|
|
|
655
662
|
right: i.style.right,
|
|
656
663
|
bottom: i.style.bottom
|
|
657
664
|
},
|
|
658
|
-
rootRect:
|
|
659
|
-
launcherRect:
|
|
660
|
-
panelRect:
|
|
661
|
-
viewport:
|
|
665
|
+
rootRect: Zt(i),
|
|
666
|
+
launcherRect: Zt(I),
|
|
667
|
+
panelRect: Zt(m),
|
|
668
|
+
viewport: J(),
|
|
662
669
|
panelHidden: m.hidden,
|
|
663
670
|
closeHidden: L.hidden,
|
|
664
671
|
...d
|
|
665
672
|
});
|
|
666
|
-
},
|
|
673
|
+
}, Ke = (a = !0) => {
|
|
667
674
|
if (!s)
|
|
668
|
-
return Ae(i, null),
|
|
669
|
-
const d =
|
|
675
|
+
return Ae(i, null), je(a);
|
|
676
|
+
const d = je(a);
|
|
670
677
|
return Ae(i, d), Te("Applied stored closed launcher position", {
|
|
671
678
|
visibleLauncherPosition: d
|
|
672
679
|
}), d;
|
|
673
|
-
},
|
|
680
|
+
}, It = (a, d) => {
|
|
674
681
|
if (!a || !d) {
|
|
675
|
-
|
|
682
|
+
no(i);
|
|
676
683
|
return;
|
|
677
684
|
}
|
|
678
|
-
|
|
685
|
+
Ra(i, {
|
|
679
686
|
x: a.x - d.x,
|
|
680
687
|
y: a.y - d.y
|
|
681
688
|
});
|
|
682
|
-
},
|
|
683
|
-
const a =
|
|
689
|
+
}, At = () => {
|
|
690
|
+
const a = nt(c).width;
|
|
684
691
|
return t.layout === "page" && m.getBoundingClientRect().width || a;
|
|
685
|
-
},
|
|
692
|
+
}, kn = () => {
|
|
686
693
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
687
694
|
Ae(
|
|
688
695
|
i,
|
|
689
|
-
|
|
696
|
+
Yt(
|
|
690
697
|
i,
|
|
691
698
|
s,
|
|
692
699
|
t.position
|
|
@@ -694,16 +701,16 @@ async function ha(e = {}) {
|
|
|
694
701
|
);
|
|
695
702
|
return;
|
|
696
703
|
}
|
|
697
|
-
const a =
|
|
704
|
+
const a = Ke();
|
|
698
705
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
699
|
-
|
|
700
|
-
const d =
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
706
|
+
Kt(i, c);
|
|
707
|
+
const d = nt(c);
|
|
708
|
+
Qt(
|
|
709
|
+
C,
|
|
710
|
+
At()
|
|
704
711
|
);
|
|
705
|
-
const _ =
|
|
706
|
-
h ??
|
|
712
|
+
const _ = _t(
|
|
713
|
+
h ?? Xt(
|
|
707
714
|
i,
|
|
708
715
|
a,
|
|
709
716
|
t.position,
|
|
@@ -711,7 +718,7 @@ async function ha(e = {}) {
|
|
|
711
718
|
),
|
|
712
719
|
d
|
|
713
720
|
);
|
|
714
|
-
h && (h = _),
|
|
721
|
+
h && (h = _), It(_, a), Te(
|
|
715
722
|
"Applied open panel position after viewport resize",
|
|
716
723
|
{ openPanelPosition: _ }
|
|
717
724
|
);
|
|
@@ -720,20 +727,20 @@ async function ha(e = {}) {
|
|
|
720
727
|
{ visibleLauncherPosition: a }
|
|
721
728
|
);
|
|
722
729
|
};
|
|
723
|
-
let
|
|
730
|
+
let Ln = () => {
|
|
724
731
|
};
|
|
725
|
-
window.addEventListener("resize",
|
|
732
|
+
window.addEventListener("resize", kn), t.movableLauncher && D ? (Ke(), Ln = Ea({
|
|
726
733
|
root: i,
|
|
727
734
|
launcher: I,
|
|
728
735
|
launcherDragHandle: D,
|
|
729
|
-
getPosition: () =>
|
|
736
|
+
getPosition: () => je(),
|
|
730
737
|
setPosition: (a) => {
|
|
731
|
-
const d = a, _ =
|
|
738
|
+
const d = a, _ = vt(i), k = cn(
|
|
732
739
|
i,
|
|
733
740
|
a,
|
|
734
741
|
_
|
|
735
742
|
);
|
|
736
|
-
s =
|
|
743
|
+
s = Ia(
|
|
737
744
|
k,
|
|
738
745
|
_
|
|
739
746
|
), Ae(i, k), Te("Dragging closed launcher", {
|
|
@@ -743,12 +750,12 @@ async function ha(e = {}) {
|
|
|
743
750
|
persist: () => {
|
|
744
751
|
g = !0, F(), Te("Persisted closed launcher drag position");
|
|
745
752
|
}
|
|
746
|
-
})) : Ae(i, null),
|
|
747
|
-
const
|
|
748
|
-
const a =
|
|
753
|
+
})) : Ae(i, null), Kt(i, c);
|
|
754
|
+
const oi = () => {
|
|
755
|
+
const a = nt(c), d = je();
|
|
749
756
|
return {
|
|
750
|
-
position:
|
|
751
|
-
h ??
|
|
757
|
+
position: _t(
|
|
758
|
+
h ?? Xt(
|
|
752
759
|
i,
|
|
753
760
|
d,
|
|
754
761
|
t.position,
|
|
@@ -758,76 +765,76 @@ async function ha(e = {}) {
|
|
|
758
765
|
),
|
|
759
766
|
size: a
|
|
760
767
|
};
|
|
761
|
-
},
|
|
762
|
-
c =
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
), h =
|
|
768
|
+
}, ii = (a) => {
|
|
769
|
+
c = Ct(a.size), Kt(i, c), Qt(
|
|
770
|
+
C,
|
|
771
|
+
At()
|
|
772
|
+
), h = _t(
|
|
766
773
|
a.position,
|
|
767
|
-
|
|
774
|
+
nt(c)
|
|
768
775
|
);
|
|
769
|
-
const d =
|
|
770
|
-
|
|
771
|
-
},
|
|
776
|
+
const d = je();
|
|
777
|
+
It(h, d);
|
|
778
|
+
}, ai = z.length > 0 ? ka({
|
|
772
779
|
root: i,
|
|
773
780
|
handles: z,
|
|
774
|
-
getBounds:
|
|
775
|
-
setBounds:
|
|
781
|
+
getBounds: oi,
|
|
782
|
+
setBounds: ii,
|
|
776
783
|
persist: F
|
|
777
784
|
}) : () => {
|
|
778
785
|
};
|
|
779
|
-
let
|
|
780
|
-
const
|
|
781
|
-
if (!(!t.billingStatusLoader ||
|
|
782
|
-
|
|
786
|
+
let Nt = !1;
|
|
787
|
+
const Tn = async () => {
|
|
788
|
+
if (!(!t.billingStatusLoader || Nt)) {
|
|
789
|
+
Nt = !0;
|
|
783
790
|
try {
|
|
784
791
|
const a = await t.billingStatusLoader();
|
|
785
|
-
if (
|
|
792
|
+
if (V)
|
|
786
793
|
return;
|
|
787
|
-
|
|
794
|
+
lo(
|
|
788
795
|
t.billingStatus,
|
|
789
796
|
a,
|
|
790
797
|
b.getState().lastErrorCode
|
|
791
|
-
) && (t.billingStatus = a,
|
|
798
|
+
) && (t.billingStatus = a, tn(
|
|
792
799
|
Re,
|
|
793
800
|
t.billingStatus,
|
|
794
801
|
b.getState().lastErrorCode
|
|
795
|
-
),
|
|
802
|
+
), G());
|
|
796
803
|
} catch (a) {
|
|
797
|
-
|
|
804
|
+
Y(
|
|
798
805
|
"web-sdk.widget",
|
|
799
806
|
"Failed to refresh billing status",
|
|
800
807
|
{ message: a instanceof Error ? a.message : String(a) }
|
|
801
808
|
);
|
|
802
809
|
} finally {
|
|
803
|
-
|
|
810
|
+
Nt = !1;
|
|
804
811
|
}
|
|
805
812
|
}
|
|
806
813
|
}, he = (a = "", d = !0) => {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
814
|
+
Tn(), Ze && (Ze = !1, zt()), i.classList.contains("pluno-pa-widget--open") || (h = null), te !== null && (window.clearTimeout(te), te = null), Ve("shown", !1), m.hidden = !1, L.hidden = !1, Qt(
|
|
815
|
+
C,
|
|
816
|
+
At()
|
|
810
817
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
811
|
-
const _ =
|
|
818
|
+
const _ = Ke(), k = Xt(
|
|
812
819
|
i,
|
|
813
820
|
_,
|
|
814
821
|
t.position,
|
|
815
822
|
c
|
|
816
823
|
);
|
|
817
|
-
if (
|
|
824
|
+
if (It(k, _), Te("Opening launcher at clamped open panel position", {
|
|
818
825
|
openPanelPosition: k,
|
|
819
826
|
visibleLauncherPosition: _
|
|
820
|
-
}),
|
|
821
|
-
i.classList.add("pluno-pa-widget--open"), I.hidden = !0, a && (f.value = a,
|
|
827
|
+
}), ne(!0, "open"), oe(), !d) {
|
|
828
|
+
i.classList.add("pluno-pa-widget--open"), I.hidden = !0, a && (f.value = a, tt(f)), ot(T, () => Ee.enabled), ke = T.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), pt("shown"), t.onPanelOpenChange?.(!0);
|
|
822
829
|
return;
|
|
823
830
|
}
|
|
824
831
|
window.requestAnimationFrame(() => {
|
|
825
|
-
i.classList.add("pluno-pa-widget--open"), a && (f.value = a,
|
|
826
|
-
I.hidden = !0,
|
|
832
|
+
i.classList.add("pluno-pa-widget--open"), a && (f.value = a, tt(f)), ot(T, () => Ee.enabled), ke = T.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), pt("shown"), t.onPanelOpenChange?.(!0), te = window.setTimeout(() => {
|
|
833
|
+
I.hidden = !0, ot(T, () => Ee.enabled), ke = T.scrollTop;
|
|
827
834
|
}, 220);
|
|
828
835
|
});
|
|
829
|
-
},
|
|
830
|
-
|
|
836
|
+
}, Rt = () => {
|
|
837
|
+
te !== null && (window.clearTimeout(te), te = null), I.hidden = !1, s && (Ke(!1), Te("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), F(), t.onPanelOpenChange?.(!1), te = window.setTimeout(() => {
|
|
831
838
|
m.hidden = !0, L.hidden = !0, h = null, i.classList.remove("pluno-pa-widget--closing");
|
|
832
839
|
}, 220);
|
|
833
840
|
};
|
|
@@ -845,21 +852,21 @@ async function ha(e = {}) {
|
|
|
845
852
|
const a = u.value;
|
|
846
853
|
he(a), u.value = "";
|
|
847
854
|
});
|
|
848
|
-
let
|
|
849
|
-
const
|
|
855
|
+
let Dt = null, st = null, Pe = null;
|
|
856
|
+
const Pn = (a) => a === u || a === f, ri = (a) => {
|
|
850
857
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
851
858
|
return null;
|
|
852
859
|
let d = a;
|
|
853
860
|
for (; d; ) {
|
|
854
|
-
const _ = d.closest(
|
|
861
|
+
const _ = d.closest(qn);
|
|
855
862
|
if (_)
|
|
856
863
|
return _;
|
|
857
864
|
const k = d.getRootNode();
|
|
858
865
|
d = k instanceof ShadowRoot ? k.host : null;
|
|
859
866
|
}
|
|
860
867
|
return null;
|
|
861
|
-
},
|
|
862
|
-
if (!a.isConnected || !a.matches(
|
|
868
|
+
}, li = (a) => {
|
|
869
|
+
if (!a.isConnected || !a.matches(qn))
|
|
863
870
|
return !1;
|
|
864
871
|
if (!(a instanceof HTMLElement))
|
|
865
872
|
return !0;
|
|
@@ -869,73 +876,73 @@ async function ha(e = {}) {
|
|
|
869
876
|
return a.checkVisibility();
|
|
870
877
|
const d = window.getComputedStyle(a);
|
|
871
878
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
872
|
-
},
|
|
873
|
-
|
|
874
|
-
const d =
|
|
875
|
-
(!d || !
|
|
876
|
-
},
|
|
877
|
-
},
|
|
879
|
+
}, In = (a) => {
|
|
880
|
+
Xe !== a && (Xe = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ie(), a !== null ? Pe = window.setInterval(() => {
|
|
881
|
+
const d = Xe;
|
|
882
|
+
(!d || !li(d)) && In(null);
|
|
883
|
+
}, aa) : Pe !== null && (window.clearInterval(Pe), Pe = null, st = null));
|
|
884
|
+
}, pi = () => {
|
|
878
885
|
Pe !== null && (window.clearInterval(Pe), Pe = null);
|
|
879
886
|
};
|
|
880
887
|
i.addEventListener("focusin", (a) => {
|
|
881
|
-
|
|
888
|
+
Pn(a.target) && (Dt = Date.now(), F());
|
|
882
889
|
}), i.addEventListener("focusout", (a) => {
|
|
883
|
-
if (!
|
|
890
|
+
if (!Pn(a.target) || Xe !== null)
|
|
884
891
|
return;
|
|
885
|
-
const d =
|
|
886
|
-
if (
|
|
892
|
+
const d = Dt;
|
|
893
|
+
if (Dt = null, d === null || Date.now() - d > oa)
|
|
887
894
|
return;
|
|
888
|
-
const _ =
|
|
895
|
+
const _ = ri(a.relatedTarget);
|
|
889
896
|
if (!_)
|
|
890
897
|
return;
|
|
891
898
|
const k = Date.now();
|
|
892
|
-
if (
|
|
893
|
-
|
|
899
|
+
if (st !== null && k - st <= ia) {
|
|
900
|
+
In(_);
|
|
894
901
|
return;
|
|
895
902
|
}
|
|
896
|
-
|
|
903
|
+
st = k;
|
|
897
904
|
}), I.addEventListener("keydown", (a) => {
|
|
898
905
|
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), he());
|
|
899
906
|
}), v?.addEventListener("pointerdown", (a) => {
|
|
900
907
|
a.stopPropagation();
|
|
901
908
|
}), v?.addEventListener("click", (a) => {
|
|
902
|
-
a.preventDefault(), a.stopPropagation(),
|
|
903
|
-
}), L.addEventListener("click",
|
|
904
|
-
T.scrollTop < ke - 1 &&
|
|
909
|
+
a.preventDefault(), a.stopPropagation(), Ve("minimized");
|
|
910
|
+
}), L.addEventListener("click", Rt), T.addEventListener("scroll", () => {
|
|
911
|
+
T.scrollTop < ke - 1 && ne(!1, "userScroll"), ke = T.scrollTop;
|
|
905
912
|
}), x.addEventListener("click", () => {
|
|
906
|
-
|
|
913
|
+
ti();
|
|
907
914
|
});
|
|
908
|
-
const
|
|
915
|
+
const An = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
909
916
|
([a]) => {
|
|
910
|
-
a?.isIntersecting && (
|
|
917
|
+
a?.isIntersecting && (ne(!0, "bottom"), oe());
|
|
911
918
|
},
|
|
912
919
|
{ root: T, threshold: 0 }
|
|
913
920
|
);
|
|
914
|
-
|
|
915
|
-
const
|
|
916
|
-
let
|
|
917
|
-
const
|
|
918
|
-
const a =
|
|
919
|
-
u.readOnly = a || d || _, f.readOnly = d || _, u.placeholder = d ?
|
|
920
|
-
},
|
|
921
|
-
|
|
921
|
+
An?.observe(re);
|
|
922
|
+
const Ye = () => t.loginRequired || t.signupRequired;
|
|
923
|
+
let Xe = null, Ze = !1;
|
|
924
|
+
const K = () => lt || b.getState().status !== "connected", Ie = () => {
|
|
925
|
+
const a = Ye(), d = Xe !== null, _ = !a && K();
|
|
926
|
+
u.readOnly = a || d || _, f.readOnly = d || _, u.placeholder = d ? jn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ze ? "New update" : t.launcherLabel, f.placeholder = d ? jn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : pe.launcherLabel, ie.hidden = a;
|
|
927
|
+
}, G = () => {
|
|
928
|
+
ee.disabled = K() || de(t.billingStatus) || !b.getState().isThinking && f.value.trim().length === 0 && q.length === 0, B.disabled = Ye() || K() || de(t.billingStatus);
|
|
922
929
|
};
|
|
923
930
|
Ie();
|
|
924
|
-
const
|
|
931
|
+
const zt = () => {
|
|
925
932
|
const a = b.getState().isThinking;
|
|
926
933
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
927
934
|
"pluno-pa-widget--unread",
|
|
928
|
-
!a &&
|
|
935
|
+
!a && Ze
|
|
929
936
|
), Ie();
|
|
930
937
|
};
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
|
|
938
|
+
zt();
|
|
939
|
+
const Mt = () => {
|
|
940
|
+
Ye() || V || (lt = !0, Ie(), G(), b.connect().then(
|
|
934
941
|
() => {
|
|
935
|
-
|
|
942
|
+
V || (lt = !1, Ie(), G());
|
|
936
943
|
},
|
|
937
944
|
(a) => {
|
|
938
|
-
|
|
945
|
+
V || (lt = !1, Ie(), G(), Y(
|
|
939
946
|
"web-sdk.widget",
|
|
940
947
|
"Failed to connect Product Agent widget",
|
|
941
948
|
{
|
|
@@ -945,7 +952,7 @@ async function ha(e = {}) {
|
|
|
945
952
|
}
|
|
946
953
|
));
|
|
947
954
|
};
|
|
948
|
-
|
|
955
|
+
ie.addEventListener("submit", (a) => {
|
|
949
956
|
if (a.preventDefault(), t.loginRequired) {
|
|
950
957
|
t.onLoginClick?.();
|
|
951
958
|
return;
|
|
@@ -954,66 +961,66 @@ async function ha(e = {}) {
|
|
|
954
961
|
t.onSignupClick?.();
|
|
955
962
|
return;
|
|
956
963
|
}
|
|
957
|
-
|
|
964
|
+
K() || de(t.billingStatus) || (be = !0, ne(!0, "send"), oe(), q = Jt(
|
|
958
965
|
b,
|
|
959
966
|
f,
|
|
960
967
|
q,
|
|
961
|
-
|
|
962
|
-
),
|
|
968
|
+
mt
|
|
969
|
+
), Me(), G());
|
|
963
970
|
});
|
|
964
|
-
let
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
},
|
|
968
|
-
ue !== null && window.clearTimeout(ue),
|
|
969
|
-
|
|
971
|
+
let Je = 0;
|
|
972
|
+
const si = () => {
|
|
973
|
+
Je = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
974
|
+
}, Ot = (a) => {
|
|
975
|
+
ue !== null && window.clearTimeout(ue), Q.textContent = a, Q.hidden = !1, ue = window.setTimeout(() => {
|
|
976
|
+
Q.textContent = "", Q.hidden = !0, ue = null;
|
|
970
977
|
}, 3e3);
|
|
971
|
-
},
|
|
972
|
-
ue !== null && (window.clearTimeout(ue), ue = null),
|
|
973
|
-
},
|
|
978
|
+
}, di = () => {
|
|
979
|
+
ue !== null && (window.clearTimeout(ue), ue = null), Q.textContent = "", Q.hidden = !0;
|
|
980
|
+
}, Ut = async (a) => {
|
|
974
981
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
975
982
|
return;
|
|
976
|
-
const d =
|
|
977
|
-
q = [...q, ...d],
|
|
983
|
+
const d = ur(b, a);
|
|
984
|
+
q = [...q, ...d], Me(), di(), G(), W(b.getState()), i.classList.contains("pluno-pa-widget--open") || he();
|
|
978
985
|
};
|
|
979
986
|
B.addEventListener("click", () => {
|
|
980
|
-
t.loginRequired ||
|
|
987
|
+
t.loginRequired || K() || de(t.billingStatus) || we.click();
|
|
981
988
|
}), we.addEventListener("change", () => {
|
|
982
989
|
const a = Array.from(we.files ?? []);
|
|
983
|
-
we.value = "",
|
|
984
|
-
|
|
990
|
+
we.value = "", Ut(a).catch((d) => {
|
|
991
|
+
Ot(
|
|
985
992
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
986
|
-
),
|
|
993
|
+
), Y("web-sdk.widget", "Attachment failed", {
|
|
987
994
|
message: d instanceof Error ? d.message : String(d)
|
|
988
995
|
});
|
|
989
996
|
});
|
|
990
997
|
}), i.addEventListener("dragenter", (a) => {
|
|
991
|
-
!t.attachmentsEnabled || !
|
|
998
|
+
!t.attachmentsEnabled || !ft(a.dataTransfer) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Je += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
992
999
|
}), i.addEventListener("dragover", (a) => {
|
|
993
1000
|
const d = a.dataTransfer;
|
|
994
|
-
!t.attachmentsEnabled || !
|
|
1001
|
+
!t.attachmentsEnabled || !ft(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
995
1002
|
}), i.addEventListener("dragleave", (a) => {
|
|
996
|
-
|
|
1003
|
+
ft(a.dataTransfer) && (a.stopPropagation(), Je = Math.max(0, Je - 1), Je === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
997
1004
|
}), i.addEventListener("drop", (a) => {
|
|
998
1005
|
const d = a.dataTransfer;
|
|
999
|
-
!t.attachmentsEnabled || !
|
|
1000
|
-
|
|
1006
|
+
!t.attachmentsEnabled || !ft(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), si(), Ut(d.files).catch((_) => {
|
|
1007
|
+
Ot(
|
|
1001
1008
|
_ instanceof Error ? _.message : "Failed to attach file"
|
|
1002
|
-
),
|
|
1009
|
+
), Y("web-sdk.widget", "Attachment failed", {
|
|
1003
1010
|
message: _ instanceof Error ? _.message : String(_)
|
|
1004
1011
|
});
|
|
1005
1012
|
}));
|
|
1006
1013
|
}), i.addEventListener("paste", (a) => {
|
|
1007
1014
|
a.stopPropagation();
|
|
1008
1015
|
const d = a.clipboardData, _ = Array.from(d?.files ?? []);
|
|
1009
|
-
!t.attachmentsEnabled || _.length === 0 || t.loginRequired ||
|
|
1010
|
-
|
|
1016
|
+
!t.attachmentsEnabled || _.length === 0 || t.loginRequired || K() || (a.preventDefault(), Ut(_).catch((k) => {
|
|
1017
|
+
Ot(
|
|
1011
1018
|
k instanceof Error ? k.message : "Failed to attach file"
|
|
1012
|
-
),
|
|
1019
|
+
), Y("web-sdk.widget", "Attachment failed", {
|
|
1013
1020
|
message: k instanceof Error ? k.message : String(k)
|
|
1014
1021
|
});
|
|
1015
1022
|
}));
|
|
1016
|
-
}),
|
|
1023
|
+
}), ee.addEventListener("click", () => {
|
|
1017
1024
|
if (t.loginRequired) {
|
|
1018
1025
|
t.onLoginClick?.();
|
|
1019
1026
|
return;
|
|
@@ -1022,95 +1029,114 @@ async function ha(e = {}) {
|
|
|
1022
1029
|
b.stop();
|
|
1023
1030
|
return;
|
|
1024
1031
|
}
|
|
1025
|
-
|
|
1032
|
+
K() || (be = !0, ne(!0, "send"), oe(), q = Jt(
|
|
1026
1033
|
b,
|
|
1027
1034
|
f,
|
|
1028
1035
|
q,
|
|
1029
|
-
|
|
1030
|
-
),
|
|
1031
|
-
}),
|
|
1032
|
-
_e = !_e,
|
|
1033
|
-
}),
|
|
1036
|
+
mt
|
|
1037
|
+
), Me(), G(), W(b.getState()));
|
|
1038
|
+
}), Se.addEventListener("click", () => {
|
|
1039
|
+
_e = !_e, qe = null, Le(), _e && xe.length === 0 && Sn(null);
|
|
1040
|
+
}), at.addEventListener("click", () => {
|
|
1034
1041
|
_e = !1, Le();
|
|
1035
|
-
}), j.addEventListener("scroll",
|
|
1036
|
-
|
|
1042
|
+
}), j.addEventListener("scroll", ni), f.addEventListener("input", () => {
|
|
1043
|
+
tt(f), F(), G(), gi();
|
|
1037
1044
|
}), f.addEventListener("keydown", (a) => {
|
|
1038
1045
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1039
1046
|
if (a.preventDefault(), t.loginRequired) {
|
|
1040
1047
|
t.onLoginClick?.();
|
|
1041
1048
|
return;
|
|
1042
1049
|
}
|
|
1043
|
-
|
|
1050
|
+
K() || (be = !0, ne(!0, "send"), oe(), q = Jt(
|
|
1044
1051
|
b,
|
|
1045
1052
|
f,
|
|
1046
1053
|
q,
|
|
1047
|
-
|
|
1048
|
-
),
|
|
1054
|
+
mt
|
|
1055
|
+
), Me(), G(), W(b.getState()));
|
|
1049
1056
|
}
|
|
1050
1057
|
}), i.addEventListener("click", (a) => {
|
|
1051
1058
|
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && F();
|
|
1052
|
-
}), l.composerValue && (f.value = l.composerValue,
|
|
1053
|
-
const
|
|
1054
|
-
let
|
|
1055
|
-
const
|
|
1056
|
-
let
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
},
|
|
1059
|
+
}), l.composerValue && (f.value = l.composerValue, tt(f)), t.layout === "page" ? he(f.value, !1) : p === "minimized" ? Ve("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && he(f.value, !1), Ma(l, i, u, f);
|
|
1060
|
+
const dt = () => r;
|
|
1061
|
+
let Bt = b.getState().appearance !== null, ct = null, Qe = null, Ue = null, Nn = b.getState().isThinking, Be = null;
|
|
1062
|
+
const et = t.taskNotifications;
|
|
1063
|
+
let Fe = null, We = !1;
|
|
1064
|
+
const Rn = () => {
|
|
1065
|
+
Fe !== null && (window.clearTimeout(Fe), Fe = null);
|
|
1066
|
+
}, ut = () => {
|
|
1060
1067
|
H && (H.hidden = !0);
|
|
1061
|
-
},
|
|
1062
|
-
if (!
|
|
1068
|
+
}, Dn = () => b.getState().assistantDraft.trim().length > 0, ci = async () => {
|
|
1069
|
+
if (!et || !H || We || V || !b.getState().isThinking || Dn())
|
|
1063
1070
|
return;
|
|
1064
1071
|
let a;
|
|
1065
1072
|
try {
|
|
1066
|
-
a = await
|
|
1073
|
+
a = await et.getState();
|
|
1067
1074
|
} catch {
|
|
1068
1075
|
return;
|
|
1069
1076
|
}
|
|
1070
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking ||
|
|
1077
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Dn() || We || V || (H.hidden = !1);
|
|
1071
1078
|
};
|
|
1072
1079
|
y?.addEventListener("click", () => {
|
|
1073
|
-
|
|
1080
|
+
We = !0, ut(), et?.enable().catch(() => {
|
|
1074
1081
|
});
|
|
1075
1082
|
}), A?.addEventListener("click", () => {
|
|
1076
|
-
|
|
1077
|
-
}),
|
|
1078
|
-
|
|
1083
|
+
We = !0, ut();
|
|
1084
|
+
}), Xo?.addEventListener("click", () => {
|
|
1085
|
+
We = !0, ut(), et?.dismissForever().catch(() => {
|
|
1079
1086
|
});
|
|
1080
1087
|
});
|
|
1081
|
-
|
|
1088
|
+
const gt = t.tabGroups;
|
|
1089
|
+
let He = !1;
|
|
1090
|
+
const ht = async () => {
|
|
1091
|
+
if (!gt || !ze || He || V)
|
|
1092
|
+
return;
|
|
1093
|
+
const a = await gt.getState().catch(() => null);
|
|
1094
|
+
!a || He || V || (ze.hidden = !a.permissionNeeded);
|
|
1095
|
+
};
|
|
1096
|
+
Zo?.addEventListener("click", () => {
|
|
1097
|
+
He = !0, ze && (ze.hidden = !0), gt?.enable().catch(() => {
|
|
1098
|
+
}).finally(() => {
|
|
1099
|
+
He = !1, ht();
|
|
1100
|
+
});
|
|
1101
|
+
}), Jo?.addEventListener("click", () => {
|
|
1102
|
+
He = !0, ze && (ze.hidden = !0), gt?.dismiss().catch(() => {
|
|
1103
|
+
}).finally(() => {
|
|
1104
|
+
He = !1, ht();
|
|
1105
|
+
});
|
|
1106
|
+
}), ht();
|
|
1107
|
+
let Ge = null, zn = () => {
|
|
1082
1108
|
};
|
|
1083
|
-
const
|
|
1084
|
-
const a =
|
|
1085
|
-
R.hidden = !a, a &&
|
|
1109
|
+
const ui = !!t.socialPostDraftHandler, Ft = /* @__PURE__ */ new Map(), Wt = () => f.value.trim().length > 0 || q.length > 0, gi = () => {
|
|
1110
|
+
const a = Ge !== null && nn(b.getState(), Wt());
|
|
1111
|
+
R.hidden = !a, a && Ge !== null && zo(R, Ge);
|
|
1086
1112
|
};
|
|
1087
|
-
let
|
|
1088
|
-
const
|
|
1089
|
-
be = !0,
|
|
1090
|
-
},
|
|
1091
|
-
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(),
|
|
1092
|
-
},
|
|
1113
|
+
let $e = null;
|
|
1114
|
+
const Ht = (a = {}) => {
|
|
1115
|
+
be = !0, ne(!0, "newSession"), oe(), _e = !1, Le(), b.startNewSession(a), Lt.clear(), f.value = "", q = [], Me(), tt(f), F(), G(), f.focus(), W(b.getState());
|
|
1116
|
+
}, mt = () => {
|
|
1117
|
+
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), Ht());
|
|
1118
|
+
}, Gt = (a) => {
|
|
1093
1119
|
if (!a || t.layout === "page") {
|
|
1094
|
-
|
|
1120
|
+
$e?.remove(), $e = null;
|
|
1095
1121
|
return;
|
|
1096
1122
|
}
|
|
1097
|
-
|
|
1123
|
+
$e || ($e = Et(
|
|
1098
1124
|
"pluno-pa-widget__new-chat",
|
|
1099
1125
|
"New chat",
|
|
1100
|
-
|
|
1126
|
+
tr(),
|
|
1101
1127
|
!1
|
|
1102
|
-
),
|
|
1128
|
+
), $e.addEventListener("click", () => Ht()), De.insertBefore($e, Se));
|
|
1103
1129
|
}, W = (a) => {
|
|
1104
|
-
if (Le(),
|
|
1130
|
+
if (Le(), _n(a.lastErrorCode) ? Be = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (Be = null), tn(
|
|
1105
1131
|
Re,
|
|
1106
1132
|
t.billingStatus,
|
|
1107
|
-
|
|
1133
|
+
Be
|
|
1108
1134
|
), t.loginRequired) {
|
|
1109
|
-
|
|
1135
|
+
Ft.clear(), uo(
|
|
1110
1136
|
T,
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1137
|
+
ee,
|
|
1138
|
+
Gt,
|
|
1139
|
+
dt,
|
|
1114
1140
|
"Log in to use Pluno on this page.",
|
|
1115
1141
|
t.loginButtonLabel,
|
|
1116
1142
|
t.loginUrl,
|
|
@@ -1119,11 +1145,11 @@ async function ha(e = {}) {
|
|
|
1119
1145
|
return;
|
|
1120
1146
|
}
|
|
1121
1147
|
if (t.signupRequired) {
|
|
1122
|
-
|
|
1148
|
+
Ft.clear(), uo(
|
|
1123
1149
|
T,
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1150
|
+
ee,
|
|
1151
|
+
Gt,
|
|
1152
|
+
dt,
|
|
1127
1153
|
"Complete signup to unlock your free trial credits.",
|
|
1128
1154
|
t.signupButtonLabel,
|
|
1129
1155
|
t.signupUrl,
|
|
@@ -1131,75 +1157,76 @@ async function ha(e = {}) {
|
|
|
1131
1157
|
);
|
|
1132
1158
|
return;
|
|
1133
1159
|
}
|
|
1134
|
-
const d =
|
|
1135
|
-
|
|
1160
|
+
const d = Ua(a), _ = d !== vn;
|
|
1161
|
+
vn = d;
|
|
1136
1162
|
const k = be || Ee.enabled;
|
|
1137
|
-
be = !1,
|
|
1163
|
+
be = !1, _r(
|
|
1138
1164
|
T,
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1165
|
+
re,
|
|
1166
|
+
ee,
|
|
1167
|
+
Gt,
|
|
1142
1168
|
R,
|
|
1143
1169
|
a,
|
|
1144
|
-
|
|
1145
|
-
|
|
1170
|
+
Ge,
|
|
1171
|
+
Ge !== null && nn(a, Wt()),
|
|
1146
1172
|
k,
|
|
1147
1173
|
() => Ee.enabled,
|
|
1148
|
-
|
|
1149
|
-
|
|
1174
|
+
Lt,
|
|
1175
|
+
Ft,
|
|
1150
1176
|
F,
|
|
1151
|
-
|
|
1177
|
+
dt,
|
|
1152
1178
|
(M) => {
|
|
1153
|
-
|
|
1179
|
+
K() || (mt(), be = !0, ne(!0, "send"), oe(), b.sendMessage(M));
|
|
1154
1180
|
},
|
|
1155
1181
|
() => {
|
|
1156
|
-
be = !0,
|
|
1182
|
+
be = !0, ne(!0, "send"), oe(), b.retryLastMessage();
|
|
1157
1183
|
},
|
|
1158
1184
|
t.morningReport,
|
|
1159
1185
|
() => {
|
|
1160
|
-
t.morningReport = null, t.onMorningReportSnooze?.(),
|
|
1186
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Rt(), W(b.getState());
|
|
1161
1187
|
},
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
dismissedCandidateIds:
|
|
1165
|
-
draftingCandidateId:
|
|
1166
|
-
error:
|
|
1167
|
-
characterIconOptions:
|
|
1188
|
+
Mt,
|
|
1189
|
+
ui && !Tt ? {
|
|
1190
|
+
dismissedCandidateIds: rt,
|
|
1191
|
+
draftingCandidateId: ct,
|
|
1192
|
+
error: Qe,
|
|
1193
|
+
characterIconOptions: dt(),
|
|
1168
1194
|
onSeen: (M) => {
|
|
1169
|
-
|
|
1195
|
+
Oe.add(M.id), F();
|
|
1170
1196
|
},
|
|
1171
1197
|
onDraft: (M) => {
|
|
1172
|
-
|
|
1198
|
+
hi(M);
|
|
1173
1199
|
},
|
|
1174
1200
|
onDismiss: (M) => {
|
|
1175
|
-
|
|
1201
|
+
Oe.add(M.id), rt.add(M.id), F(), Qe = null, W(b.getState());
|
|
1176
1202
|
},
|
|
1177
1203
|
onDisable: (M) => {
|
|
1178
|
-
|
|
1204
|
+
Tt = !0, Oe.add(M.id), rt.add(M.id), F(), Gr(t, !0), Qe = null, W(b.getState());
|
|
1179
1205
|
}
|
|
1180
1206
|
} : void 0
|
|
1181
|
-
), k ? (ke = T.scrollTop,
|
|
1207
|
+
), k ? (ke = T.scrollTop, oe()) : _ && Ba(a) && ei();
|
|
1182
1208
|
};
|
|
1183
|
-
return
|
|
1209
|
+
return zn = Ri(
|
|
1184
1210
|
(a) => {
|
|
1185
|
-
|
|
1211
|
+
Ge = a, !V && nn(b.getState(), Wt()) && W(b.getState());
|
|
1186
1212
|
},
|
|
1187
1213
|
{
|
|
1188
1214
|
backendUrl: t.backendUrl,
|
|
1189
|
-
fetcher:
|
|
1215
|
+
fetcher: Qo,
|
|
1190
1216
|
loader: t.activeUsersLoader
|
|
1191
1217
|
}
|
|
1192
1218
|
), b.on("state", (a) => {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1219
|
+
ht();
|
|
1220
|
+
const d = Nn && !a.isThinking;
|
|
1221
|
+
Nn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && et && !We && Fe === null && H?.hidden !== !1 && (Fe = window.setTimeout(() => {
|
|
1222
|
+
Fe = null, ci();
|
|
1223
|
+
}, Hi)), (!a.isThinking || a.assistantDraft.trim()) && (Rn(), ut()), d && !i.classList.contains("pluno-pa-widget--open") && (Ze = !0), zt(), a.appearance ? (Bt = !0, Y(
|
|
1197
1224
|
"web-sdk.widget",
|
|
1198
1225
|
"Agent state supplied appearance",
|
|
1199
1226
|
{
|
|
1200
1227
|
appearance: a.appearance
|
|
1201
1228
|
}
|
|
1202
|
-
),
|
|
1229
|
+
), $t(a.appearance, "agent.state.appearance")) : Bt && (Bt = !1, Y(
|
|
1203
1230
|
"web-sdk.widget",
|
|
1204
1231
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1205
1232
|
{
|
|
@@ -1207,99 +1234,99 @@ async function ha(e = {}) {
|
|
|
1207
1234
|
fallbackColorScheme: t.colorScheme,
|
|
1208
1235
|
fallbackFontFamily: t.fontFamily
|
|
1209
1236
|
}
|
|
1210
|
-
),
|
|
1211
|
-
}), W(b.getState()),
|
|
1237
|
+
), $t({}, "agent.state.appearance-cleared")), W(a), G(), d && Tn();
|
|
1238
|
+
}), W(b.getState()), G(), Mt(), {
|
|
1212
1239
|
agent: b,
|
|
1213
|
-
startNewChat:
|
|
1240
|
+
startNewChat: Ht,
|
|
1214
1241
|
host: n,
|
|
1215
1242
|
updateAppearance: (a) => {
|
|
1216
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1243
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), $t(a, "widgetHandle.updateAppearance");
|
|
1217
1244
|
},
|
|
1218
1245
|
updateBillingStatus: (a) => {
|
|
1219
1246
|
const d = a ?? null;
|
|
1220
|
-
|
|
1247
|
+
lo(
|
|
1221
1248
|
t.billingStatus,
|
|
1222
1249
|
d,
|
|
1223
|
-
|
|
1224
|
-
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (
|
|
1250
|
+
Be
|
|
1251
|
+
) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !de(t.billingStatus) && (Be = null), tn(
|
|
1225
1252
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1226
1253
|
t.billingStatus,
|
|
1227
|
-
|
|
1228
|
-
),
|
|
1254
|
+
Be
|
|
1255
|
+
), G());
|
|
1229
1256
|
},
|
|
1230
1257
|
updateAuthGate: (a) => {
|
|
1231
|
-
const d =
|
|
1232
|
-
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), Ie(), W(b.getState()),
|
|
1258
|
+
const d = Ye();
|
|
1259
|
+
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), Ie(), W(b.getState()), G(), d && !Ye() && Mt();
|
|
1233
1260
|
},
|
|
1234
1261
|
openPanel: () => {
|
|
1235
1262
|
he(f.value, !1);
|
|
1236
1263
|
},
|
|
1237
|
-
closePanel:
|
|
1264
|
+
closePanel: Rt,
|
|
1238
1265
|
updateDisplayState: (a) => {
|
|
1239
1266
|
if (a === "shown") {
|
|
1240
|
-
|
|
1267
|
+
Ve("shown", !1);
|
|
1241
1268
|
return;
|
|
1242
1269
|
}
|
|
1243
|
-
|
|
1270
|
+
Ve("minimized", !1);
|
|
1244
1271
|
},
|
|
1245
1272
|
updateMorningReport: (a) => {
|
|
1246
1273
|
t.morningReport = a ?? null, W(b.getState());
|
|
1247
1274
|
},
|
|
1248
1275
|
destroy: () => {
|
|
1249
|
-
|
|
1276
|
+
V || (F(), V = !0, En.disconnect(), An?.disconnect(), pi(), window.removeEventListener("resize", kn), Ln(), ai(), ue !== null && window.clearTimeout(ue), Rn(), zn(), Ue?.remove(), b.destroy(), kt.release(), n.remove());
|
|
1250
1277
|
}
|
|
1251
1278
|
};
|
|
1252
|
-
async function
|
|
1253
|
-
if (!
|
|
1254
|
-
|
|
1279
|
+
async function hi(a) {
|
|
1280
|
+
if (!ct) {
|
|
1281
|
+
ct = a.id, Qe = null, W(b.getState());
|
|
1255
1282
|
try {
|
|
1256
1283
|
if (!t.socialPostDraftHandler)
|
|
1257
1284
|
throw new Error("Social post drafting is not available here.");
|
|
1258
1285
|
const d = await t.socialPostDraftHandler(a);
|
|
1259
1286
|
if (!d.linkedinPost || !d.xPost)
|
|
1260
1287
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1261
|
-
|
|
1288
|
+
Oe.add(a.id), rt.add(a.id), F(), Ue?.remove(), Ue = Lr(d, {
|
|
1262
1289
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1263
1290
|
onClose: () => {
|
|
1264
|
-
|
|
1291
|
+
Ue?.remove(), Ue = null;
|
|
1265
1292
|
}
|
|
1266
|
-
}), i.appendChild(
|
|
1293
|
+
}), i.appendChild(Ue);
|
|
1267
1294
|
} catch (d) {
|
|
1268
|
-
|
|
1295
|
+
Qe = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1269
1296
|
} finally {
|
|
1270
|
-
|
|
1297
|
+
ct = null, W(b.getState());
|
|
1271
1298
|
}
|
|
1272
1299
|
}
|
|
1273
1300
|
}
|
|
1274
|
-
function
|
|
1275
|
-
const _ = a.accentColor ?? t.accentColor, k = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily,
|
|
1276
|
-
r =
|
|
1301
|
+
function $t(a, d) {
|
|
1302
|
+
const _ = a.accentColor ?? t.accentColor, k = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, qt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1303
|
+
r = Zn(
|
|
1277
1304
|
_,
|
|
1278
|
-
|
|
1279
|
-
),
|
|
1305
|
+
qt
|
|
1306
|
+
), Jn(i, r, {
|
|
1280
1307
|
accentColor: _,
|
|
1281
1308
|
colorScheme: k,
|
|
1282
1309
|
fontFamily: M,
|
|
1283
|
-
scribbleStyle:
|
|
1284
|
-
}),
|
|
1310
|
+
scribbleStyle: qt
|
|
1311
|
+
}), Y("web-sdk.widget", "Updated widget appearance", {
|
|
1285
1312
|
source: d,
|
|
1286
1313
|
inputAppearance: a,
|
|
1287
1314
|
appliedAccentColor: _,
|
|
1288
1315
|
appliedColorScheme: k,
|
|
1289
1316
|
appliedFontFamily: M,
|
|
1290
|
-
appliedScribbleStyle:
|
|
1317
|
+
appliedScribbleStyle: qt,
|
|
1291
1318
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1292
1319
|
});
|
|
1293
1320
|
}
|
|
1294
1321
|
}
|
|
1295
|
-
function
|
|
1322
|
+
function Zn(e, t) {
|
|
1296
1323
|
return { accentColor: e, scribbleStyle: t };
|
|
1297
1324
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const t =
|
|
1300
|
-
return t === null ? "#fafafa" :
|
|
1325
|
+
function ya(e) {
|
|
1326
|
+
const t = va(e);
|
|
1327
|
+
return t === null ? "#fafafa" : Sa(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1301
1328
|
}
|
|
1302
|
-
function
|
|
1329
|
+
function va(e) {
|
|
1303
1330
|
const t = e.trim();
|
|
1304
1331
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1305
1332
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1311,14 +1338,14 @@ function fa(e) {
|
|
|
1311
1338
|
Number.parseInt(t[3] + t[3], 16)
|
|
1312
1339
|
] : null;
|
|
1313
1340
|
}
|
|
1314
|
-
function
|
|
1341
|
+
function Sa([e, t, n]) {
|
|
1315
1342
|
const o = (i) => {
|
|
1316
1343
|
const r = i / 255;
|
|
1317
1344
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1318
1345
|
};
|
|
1319
1346
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1320
1347
|
}
|
|
1321
|
-
function
|
|
1348
|
+
function Jn(e, t, n) {
|
|
1322
1349
|
e.classList.toggle(
|
|
1323
1350
|
"pluno-pa-widget--dark",
|
|
1324
1351
|
n.colorScheme === "dark"
|
|
@@ -1326,11 +1353,11 @@ function Kn(e, t, n) {
|
|
|
1326
1353
|
"pluno-pa-widget--light",
|
|
1327
1354
|
n.colorScheme !== "dark"
|
|
1328
1355
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1329
|
-
const o = n.scribbleStyle ?
|
|
1356
|
+
const o = n.scribbleStyle ? xo(n.accentColor) : n.accentColor;
|
|
1330
1357
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1331
1358
|
"--pluno-pa-accent-contrast",
|
|
1332
|
-
|
|
1333
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1359
|
+
ya(o)
|
|
1360
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? la : n.fontFamily, n.scribbleStyle && Ca(e.ownerDocument);
|
|
1334
1361
|
const i = Array.from(
|
|
1335
1362
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1336
1363
|
);
|
|
@@ -1342,11 +1369,11 @@ function Kn(e, t, n) {
|
|
|
1342
1369
|
)
|
|
1343
1370
|
);
|
|
1344
1371
|
}
|
|
1345
|
-
function
|
|
1346
|
-
if (e.getElementById(
|
|
1372
|
+
function Ca(e) {
|
|
1373
|
+
if (e.getElementById(Vn))
|
|
1347
1374
|
return;
|
|
1348
1375
|
const t = e.createElement("style");
|
|
1349
|
-
t.id =
|
|
1376
|
+
t.id = Vn, t.textContent = `@font-face {
|
|
1350
1377
|
font-family: "Architects Daughter";
|
|
1351
1378
|
font-style: normal;
|
|
1352
1379
|
font-weight: 400;
|
|
@@ -1354,7 +1381,7 @@ function ba(e) {
|
|
|
1354
1381
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1355
1382
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1356
1383
|
}
|
|
1357
|
-
function
|
|
1384
|
+
function Ea({
|
|
1358
1385
|
root: e,
|
|
1359
1386
|
launcher: t,
|
|
1360
1387
|
launcherDragHandle: n,
|
|
@@ -1365,14 +1392,14 @@ function _a({
|
|
|
1365
1392
|
let l = null, p = null, s = null, g = !1, c = null;
|
|
1366
1393
|
const h = () => {
|
|
1367
1394
|
l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1368
|
-
},
|
|
1395
|
+
}, S = (m) => {
|
|
1369
1396
|
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(), g = !1, t.setPointerCapture?.(m.pointerId));
|
|
1370
1397
|
}, P = (m) => {
|
|
1371
1398
|
if (l !== m.pointerId || !p || !s)
|
|
1372
1399
|
return;
|
|
1373
1400
|
m.preventDefault();
|
|
1374
|
-
const
|
|
1375
|
-
!g && Math.hypot(
|
|
1401
|
+
const C = m.clientX - p.x, z = m.clientY - p.y;
|
|
1402
|
+
!g && Math.hypot(C, z) < dn || (g = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + C, y: s.y + z }));
|
|
1376
1403
|
}, I = (m) => {
|
|
1377
1404
|
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), g && (c = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1378
1405
|
}, D = (m) => {
|
|
@@ -1380,23 +1407,23 @@ function _a({
|
|
|
1380
1407
|
}, u = (m) => {
|
|
1381
1408
|
if (!c)
|
|
1382
1409
|
return;
|
|
1383
|
-
const
|
|
1410
|
+
const C = Math.hypot(
|
|
1384
1411
|
m.clientX - c.x,
|
|
1385
1412
|
m.clientY - c.y
|
|
1386
|
-
) <=
|
|
1387
|
-
c = null,
|
|
1413
|
+
) <= dn;
|
|
1414
|
+
c = null, C && (m.preventDefault(), m.stopPropagation());
|
|
1388
1415
|
}, v = (m) => {
|
|
1389
1416
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1390
1417
|
return;
|
|
1391
|
-
const
|
|
1418
|
+
const C = m.shiftKey ? Io : Po, z = o();
|
|
1392
1419
|
let L = null;
|
|
1393
|
-
m.key === "ArrowUp" ? L = { x: z.x, y: z.y -
|
|
1420
|
+
m.key === "ArrowUp" ? L = { x: z.x, y: z.y - C } : m.key === "ArrowDown" ? L = { x: z.x, y: z.y + C } : m.key === "ArrowLeft" ? L = { x: z.x - C, y: z.y } : m.key === "ArrowRight" && (L = { x: z.x + C, y: z.y }), L && (m.preventDefault(), m.stopPropagation(), i(L), r());
|
|
1394
1421
|
};
|
|
1395
|
-
return t.addEventListener("pointerdown",
|
|
1396
|
-
t.removeEventListener("pointerdown",
|
|
1422
|
+
return t.addEventListener("pointerdown", S), t.addEventListener("pointermove", P), t.addEventListener("pointerup", I), t.addEventListener("pointercancel", D), t.addEventListener("click", u, !0), n.addEventListener("keydown", v), () => {
|
|
1423
|
+
t.removeEventListener("pointerdown", S), t.removeEventListener("pointermove", P), t.removeEventListener("pointerup", I), t.removeEventListener("pointercancel", D), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", v);
|
|
1397
1424
|
};
|
|
1398
1425
|
}
|
|
1399
|
-
function
|
|
1426
|
+
function ka({
|
|
1400
1427
|
root: e,
|
|
1401
1428
|
handles: t,
|
|
1402
1429
|
getBounds: n,
|
|
@@ -1408,36 +1435,36 @@ function xa({
|
|
|
1408
1435
|
r = null, l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1409
1436
|
}, h = (u) => {
|
|
1410
1437
|
const v = u.currentTarget, m = v.dataset.resizeDirection;
|
|
1411
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1412
|
-
},
|
|
1438
|
+
!e.classList.contains("pluno-pa-widget--open") || !Qn(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, p = { x: u.clientX, y: u.clientY }, s = n(), g = !1, v.setPointerCapture?.(u.pointerId));
|
|
1439
|
+
}, S = (u) => {
|
|
1413
1440
|
if (r !== u.pointerId || !l || !p || !s)
|
|
1414
1441
|
return;
|
|
1415
1442
|
u.preventDefault(), u.stopPropagation();
|
|
1416
1443
|
const v = u.clientX - p.x, m = u.clientY - p.y;
|
|
1417
|
-
!g && Math.hypot(v, m) <
|
|
1418
|
-
|
|
1444
|
+
!g && Math.hypot(v, m) < dn || (g = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1445
|
+
eo(s, l, v, m)
|
|
1419
1446
|
));
|
|
1420
1447
|
}, P = (u) => {
|
|
1421
1448
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && i(), c());
|
|
1422
1449
|
}, I = (u) => {
|
|
1423
1450
|
r === u.pointerId && (u.preventDefault(), c());
|
|
1424
1451
|
}, D = (u) => {
|
|
1425
|
-
const m = u.currentTarget.dataset.resizeDirection,
|
|
1426
|
-
let L = 0,
|
|
1427
|
-
|
|
1452
|
+
const m = u.currentTarget.dataset.resizeDirection, C = u.shiftKey ? Io : Po, z = n();
|
|
1453
|
+
let L = 0, ie = 0;
|
|
1454
|
+
Qn(m) && (u.key === "ArrowLeft" ? L = -C : u.key === "ArrowRight" ? L = C : u.key === "ArrowUp" ? ie = -C : u.key === "ArrowDown" && (ie = C), !(L === 0 && ie === 0) && (u.preventDefault(), u.stopPropagation(), o(eo(z, m, L, ie)), i()));
|
|
1428
1455
|
};
|
|
1429
1456
|
for (const u of t)
|
|
1430
|
-
u.addEventListener("pointerdown", h), u.addEventListener("pointermove",
|
|
1457
|
+
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", S), u.addEventListener("pointerup", P), u.addEventListener("pointercancel", I), u.addEventListener("keydown", D);
|
|
1431
1458
|
return () => {
|
|
1432
1459
|
for (const u of t)
|
|
1433
|
-
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove",
|
|
1460
|
+
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", S), u.removeEventListener("pointerup", P), u.removeEventListener("pointercancel", I), u.removeEventListener("keydown", D);
|
|
1434
1461
|
};
|
|
1435
1462
|
}
|
|
1436
|
-
function
|
|
1463
|
+
function Qn(e) {
|
|
1437
1464
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1438
1465
|
}
|
|
1439
|
-
function
|
|
1440
|
-
const i =
|
|
1466
|
+
function eo(e, t, n, o) {
|
|
1467
|
+
const i = J(), r = to({
|
|
1441
1468
|
leading: e.position.x,
|
|
1442
1469
|
length: e.size.width,
|
|
1443
1470
|
delta: n,
|
|
@@ -1446,10 +1473,10 @@ function Xn(e, t, n, o) {
|
|
|
1446
1473
|
minLeading: N,
|
|
1447
1474
|
maxTrailing: i.width - N,
|
|
1448
1475
|
minLength: Math.min(
|
|
1449
|
-
|
|
1476
|
+
fn,
|
|
1450
1477
|
i.width - N * 2
|
|
1451
1478
|
)
|
|
1452
|
-
}), l =
|
|
1479
|
+
}), l = to({
|
|
1453
1480
|
leading: e.position.y,
|
|
1454
1481
|
length: e.size.height,
|
|
1455
1482
|
delta: o,
|
|
@@ -1458,7 +1485,7 @@ function Xn(e, t, n, o) {
|
|
|
1458
1485
|
minLeading: Ne,
|
|
1459
1486
|
maxTrailing: i.height - N,
|
|
1460
1487
|
minLength: Math.min(
|
|
1461
|
-
|
|
1488
|
+
wn,
|
|
1462
1489
|
i.height - Ne - N
|
|
1463
1490
|
)
|
|
1464
1491
|
});
|
|
@@ -1467,7 +1494,7 @@ function Xn(e, t, n, o) {
|
|
|
1467
1494
|
size: { width: r.length, height: l.length }
|
|
1468
1495
|
};
|
|
1469
1496
|
}
|
|
1470
|
-
function
|
|
1497
|
+
function to({
|
|
1471
1498
|
leading: e,
|
|
1472
1499
|
length: t,
|
|
1473
1500
|
delta: n,
|
|
@@ -1481,10 +1508,10 @@ function Zn({
|
|
|
1481
1508
|
if (o) {
|
|
1482
1509
|
const g = e + n;
|
|
1483
1510
|
if (g >= r) {
|
|
1484
|
-
const h =
|
|
1511
|
+
const h = Z(g, r, s - p);
|
|
1485
1512
|
return { leading: h, length: s - h };
|
|
1486
1513
|
}
|
|
1487
|
-
const c =
|
|
1514
|
+
const c = Z(
|
|
1488
1515
|
s + r - g,
|
|
1489
1516
|
s,
|
|
1490
1517
|
l
|
|
@@ -1494,14 +1521,14 @@ function Zn({
|
|
|
1494
1521
|
if (i) {
|
|
1495
1522
|
const g = s + n;
|
|
1496
1523
|
if (g <= l) {
|
|
1497
|
-
const h =
|
|
1524
|
+
const h = Z(
|
|
1498
1525
|
g,
|
|
1499
1526
|
e + p,
|
|
1500
1527
|
l
|
|
1501
1528
|
);
|
|
1502
1529
|
return { leading: e, length: h - e };
|
|
1503
1530
|
}
|
|
1504
|
-
const c =
|
|
1531
|
+
const c = Z(
|
|
1505
1532
|
e - (g - l),
|
|
1506
1533
|
r,
|
|
1507
1534
|
e
|
|
@@ -1510,47 +1537,47 @@ function Zn({
|
|
|
1510
1537
|
}
|
|
1511
1538
|
return { leading: e, length: t };
|
|
1512
1539
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const n =
|
|
1540
|
+
function vt(e, t = !0) {
|
|
1541
|
+
const n = J();
|
|
1515
1542
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1516
|
-
return { width:
|
|
1543
|
+
return { width: Kn, height: Kn };
|
|
1517
1544
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1518
1545
|
return {
|
|
1519
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1520
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1546
|
+
width: t && i && o.width > 0 ? o.width : Math.min(ko, n.width - 36),
|
|
1547
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? sa : Lo
|
|
1521
1548
|
};
|
|
1522
1549
|
}
|
|
1523
|
-
function
|
|
1524
|
-
const e =
|
|
1550
|
+
function La() {
|
|
1551
|
+
const e = J();
|
|
1525
1552
|
return {
|
|
1526
1553
|
width: Math.min(
|
|
1527
|
-
|
|
1528
|
-
e.width *
|
|
1529
|
-
|
|
1530
|
-
|
|
1554
|
+
Z(
|
|
1555
|
+
e.width * ca,
|
|
1556
|
+
fn,
|
|
1557
|
+
da
|
|
1531
1558
|
),
|
|
1532
1559
|
e.width - N * 2
|
|
1533
1560
|
),
|
|
1534
1561
|
height: Math.min(
|
|
1535
|
-
|
|
1536
|
-
e.height *
|
|
1537
|
-
|
|
1538
|
-
|
|
1562
|
+
Z(
|
|
1563
|
+
e.height * ga,
|
|
1564
|
+
wn,
|
|
1565
|
+
ua
|
|
1539
1566
|
),
|
|
1540
1567
|
e.height - Ne - N
|
|
1541
1568
|
)
|
|
1542
1569
|
};
|
|
1543
1570
|
}
|
|
1544
|
-
function
|
|
1545
|
-
return e ?
|
|
1571
|
+
function nt(e = null) {
|
|
1572
|
+
return e ? Ct(e) : La();
|
|
1546
1573
|
}
|
|
1547
|
-
function
|
|
1548
|
-
const t =
|
|
1574
|
+
function Ct(e) {
|
|
1575
|
+
const t = J();
|
|
1549
1576
|
return {
|
|
1550
|
-
width:
|
|
1577
|
+
width: Z(
|
|
1551
1578
|
e.width,
|
|
1552
1579
|
Math.min(
|
|
1553
|
-
|
|
1580
|
+
fn,
|
|
1554
1581
|
t.width - N * 2
|
|
1555
1582
|
),
|
|
1556
1583
|
Math.max(
|
|
@@ -1558,10 +1585,10 @@ function xt(e) {
|
|
|
1558
1585
|
t.width - N * 2
|
|
1559
1586
|
)
|
|
1560
1587
|
),
|
|
1561
|
-
height:
|
|
1588
|
+
height: Z(
|
|
1562
1589
|
e.height,
|
|
1563
1590
|
Math.min(
|
|
1564
|
-
|
|
1591
|
+
wn,
|
|
1565
1592
|
t.height - Ne - N
|
|
1566
1593
|
),
|
|
1567
1594
|
Math.max(
|
|
@@ -1571,46 +1598,46 @@ function xt(e) {
|
|
|
1571
1598
|
)
|
|
1572
1599
|
};
|
|
1573
1600
|
}
|
|
1574
|
-
function
|
|
1601
|
+
function Kt(e, t) {
|
|
1575
1602
|
if (!t) {
|
|
1576
1603
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1577
1604
|
return;
|
|
1578
1605
|
}
|
|
1579
|
-
const n =
|
|
1606
|
+
const n = Ct(t);
|
|
1580
1607
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1581
1608
|
}
|
|
1582
|
-
function
|
|
1609
|
+
function Ta(e, t, n) {
|
|
1583
1610
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1584
1611
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1585
1612
|
return { x: o, y: i };
|
|
1586
1613
|
const r = e.getBoundingClientRect();
|
|
1587
1614
|
if (r.width > 0 || r.height > 0)
|
|
1588
1615
|
return { x: r.left, y: r.top };
|
|
1589
|
-
const l =
|
|
1616
|
+
const l = J();
|
|
1590
1617
|
return {
|
|
1591
1618
|
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1592
1619
|
y: l.height - 24 - n.height
|
|
1593
1620
|
};
|
|
1594
1621
|
}
|
|
1595
|
-
function
|
|
1596
|
-
const o =
|
|
1597
|
-
return t ?
|
|
1622
|
+
function Yt(e, t, n) {
|
|
1623
|
+
const o = vt(e, !1);
|
|
1624
|
+
return t ? cn(
|
|
1598
1625
|
e,
|
|
1599
|
-
|
|
1626
|
+
Ro(t, o),
|
|
1600
1627
|
o
|
|
1601
|
-
) :
|
|
1628
|
+
) : Pa(n === "bottom-left" ? "bottom-left" : "bottom-right", o, pa);
|
|
1602
1629
|
}
|
|
1603
|
-
function
|
|
1604
|
-
const o =
|
|
1630
|
+
function Pa(e, t, n) {
|
|
1631
|
+
const o = J();
|
|
1605
1632
|
return {
|
|
1606
1633
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1607
1634
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1608
1635
|
};
|
|
1609
1636
|
}
|
|
1610
|
-
function
|
|
1611
|
-
const o =
|
|
1637
|
+
function cn(e, t, n) {
|
|
1638
|
+
const o = J(), i = N + Na(e);
|
|
1612
1639
|
return {
|
|
1613
|
-
x:
|
|
1640
|
+
x: Z(
|
|
1614
1641
|
t.x,
|
|
1615
1642
|
N,
|
|
1616
1643
|
Math.max(
|
|
@@ -1618,7 +1645,7 @@ function ln(e, t, n) {
|
|
|
1618
1645
|
o.width - n.width - N
|
|
1619
1646
|
)
|
|
1620
1647
|
),
|
|
1621
|
-
y:
|
|
1648
|
+
y: Z(
|
|
1622
1649
|
t.y,
|
|
1623
1650
|
i,
|
|
1624
1651
|
Math.max(
|
|
@@ -1628,39 +1655,39 @@ function ln(e, t, n) {
|
|
|
1628
1655
|
)
|
|
1629
1656
|
};
|
|
1630
1657
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const n =
|
|
1658
|
+
function Ro(e, t) {
|
|
1659
|
+
const n = J();
|
|
1633
1660
|
return {
|
|
1634
1661
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1635
1662
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1636
1663
|
};
|
|
1637
1664
|
}
|
|
1638
|
-
function
|
|
1639
|
-
const n =
|
|
1665
|
+
function Ia(e, t) {
|
|
1666
|
+
const n = Aa(e, t), o = J();
|
|
1640
1667
|
return {
|
|
1641
1668
|
anchor: n,
|
|
1642
1669
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1643
1670
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1644
1671
|
};
|
|
1645
1672
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const n =
|
|
1673
|
+
function Aa(e, t) {
|
|
1674
|
+
const n = J(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1648
1675
|
return `${r}-${l}`;
|
|
1649
1676
|
}
|
|
1650
|
-
function
|
|
1651
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1677
|
+
function Na(e) {
|
|
1678
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? wa : fa;
|
|
1652
1679
|
}
|
|
1653
|
-
function
|
|
1654
|
-
const i =
|
|
1680
|
+
function Xt(e, t, n, o = null) {
|
|
1681
|
+
const i = vt(e), r = nt(o), l = {
|
|
1655
1682
|
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1656
1683
|
y: t.y + i.height - r.height
|
|
1657
1684
|
};
|
|
1658
|
-
return
|
|
1685
|
+
return _t(l, r);
|
|
1659
1686
|
}
|
|
1660
|
-
function
|
|
1661
|
-
const n =
|
|
1687
|
+
function _t(e, t) {
|
|
1688
|
+
const n = J();
|
|
1662
1689
|
return {
|
|
1663
|
-
x:
|
|
1690
|
+
x: Z(
|
|
1664
1691
|
e.x,
|
|
1665
1692
|
N,
|
|
1666
1693
|
Math.max(
|
|
@@ -1668,7 +1695,7 @@ function mt(e, t) {
|
|
|
1668
1695
|
n.width - t.width - N
|
|
1669
1696
|
)
|
|
1670
1697
|
),
|
|
1671
|
-
y:
|
|
1698
|
+
y: Z(
|
|
1672
1699
|
e.y,
|
|
1673
1700
|
Ne,
|
|
1674
1701
|
Math.max(
|
|
@@ -1685,19 +1712,19 @@ function Ae(e, t) {
|
|
|
1685
1712
|
}
|
|
1686
1713
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1687
1714
|
}
|
|
1688
|
-
function
|
|
1715
|
+
function Ra(e, t) {
|
|
1689
1716
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1690
1717
|
}
|
|
1691
|
-
function
|
|
1718
|
+
function no(e) {
|
|
1692
1719
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1693
1720
|
}
|
|
1694
|
-
function
|
|
1721
|
+
function J() {
|
|
1695
1722
|
return {
|
|
1696
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1697
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1723
|
+
width: window.innerWidth || document.documentElement.clientWidth || ko + N * 2,
|
|
1724
|
+
height: window.innerHeight || document.documentElement.clientHeight || Lo + N * 2
|
|
1698
1725
|
};
|
|
1699
1726
|
}
|
|
1700
|
-
function
|
|
1727
|
+
function Zt(e) {
|
|
1701
1728
|
const t = e.getBoundingClientRect();
|
|
1702
1729
|
return {
|
|
1703
1730
|
x: Math.round(t.x),
|
|
@@ -1706,10 +1733,10 @@ function Vt(e) {
|
|
|
1706
1733
|
height: Math.round(t.height)
|
|
1707
1734
|
};
|
|
1708
1735
|
}
|
|
1709
|
-
function
|
|
1736
|
+
function Z(e, t, n) {
|
|
1710
1737
|
return Math.min(Math.max(e, t), n);
|
|
1711
1738
|
}
|
|
1712
|
-
function
|
|
1739
|
+
function Y(e, t, n) {
|
|
1713
1740
|
if (typeof window > "u")
|
|
1714
1741
|
return;
|
|
1715
1742
|
const o = window, i = {
|
|
@@ -1719,44 +1746,44 @@ function K(e, t, n) {
|
|
|
1719
1746
|
details: n
|
|
1720
1747
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1721
1748
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1722
|
-
new CustomEvent(
|
|
1749
|
+
new CustomEvent(ta, { detail: i })
|
|
1723
1750
|
);
|
|
1724
1751
|
}
|
|
1725
|
-
function
|
|
1726
|
-
|
|
1752
|
+
function Da(e, t) {
|
|
1753
|
+
Y("web-sdk.widget.position", e, t);
|
|
1727
1754
|
}
|
|
1728
|
-
function
|
|
1755
|
+
function Jt(e, t, n, o) {
|
|
1729
1756
|
const i = t.value.trim();
|
|
1730
1757
|
return !i && n.length === 0 ? n : (o(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(i, {
|
|
1731
|
-
attachments: n.length > 0 ? n.map(
|
|
1758
|
+
attachments: n.length > 0 ? n.map(Oa) : void 0
|
|
1732
1759
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1733
1760
|
}
|
|
1734
|
-
function
|
|
1761
|
+
function za(e, t, n) {
|
|
1735
1762
|
const o = e.activeElement;
|
|
1736
1763
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1737
1764
|
}
|
|
1738
|
-
function
|
|
1739
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1765
|
+
function Ma(e, t, n, o) {
|
|
1766
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Gi)
|
|
1740
1767
|
return;
|
|
1741
1768
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1742
1769
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1743
1770
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1744
1771
|
});
|
|
1745
1772
|
}
|
|
1746
|
-
function
|
|
1773
|
+
function Oa(e) {
|
|
1747
1774
|
return e;
|
|
1748
1775
|
}
|
|
1749
|
-
function
|
|
1776
|
+
function tt(e) {
|
|
1750
1777
|
e.style.height = "0px";
|
|
1751
1778
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1752
1779
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1753
1780
|
}
|
|
1754
|
-
function
|
|
1781
|
+
function ot(e, t = () => !0) {
|
|
1755
1782
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1756
1783
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1757
1784
|
});
|
|
1758
1785
|
}
|
|
1759
|
-
function
|
|
1786
|
+
function Ua(e) {
|
|
1760
1787
|
const t = e.messages[e.messages.length - 1];
|
|
1761
1788
|
return [
|
|
1762
1789
|
e.messages.length,
|
|
@@ -1767,13 +1794,13 @@ function Na(e) {
|
|
|
1767
1794
|
e.lastError ?? ""
|
|
1768
1795
|
].join(":");
|
|
1769
1796
|
}
|
|
1770
|
-
function
|
|
1797
|
+
function Ba(e) {
|
|
1771
1798
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1772
1799
|
}
|
|
1773
|
-
function
|
|
1800
|
+
function Fa(e) {
|
|
1774
1801
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1775
1802
|
}
|
|
1776
|
-
function
|
|
1803
|
+
function Wa(e) {
|
|
1777
1804
|
const t = e.currentPage;
|
|
1778
1805
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1779
1806
|
try {
|
|
@@ -1784,7 +1811,7 @@ function za(e) {
|
|
|
1784
1811
|
}
|
|
1785
1812
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1786
1813
|
}
|
|
1787
|
-
function
|
|
1814
|
+
function Ha(e, t) {
|
|
1788
1815
|
const n = new Date(e).getTime();
|
|
1789
1816
|
if (!Number.isFinite(n))
|
|
1790
1817
|
return "now";
|
|
@@ -1800,31 +1827,31 @@ function Ma(e, t) {
|
|
|
1800
1827
|
}
|
|
1801
1828
|
return "now";
|
|
1802
1829
|
}
|
|
1803
|
-
function
|
|
1804
|
-
e.appendChild(
|
|
1805
|
-
|
|
1830
|
+
function Ga(e, t, n, o, i) {
|
|
1831
|
+
e.appendChild(Qa()), e.appendChild(
|
|
1832
|
+
$a(
|
|
1806
1833
|
t,
|
|
1807
1834
|
n,
|
|
1808
1835
|
o,
|
|
1809
1836
|
i
|
|
1810
1837
|
)
|
|
1811
1838
|
), e.appendChild(
|
|
1812
|
-
|
|
1839
|
+
Et(
|
|
1813
1840
|
"pluno-pa-widget__close",
|
|
1814
1841
|
"Close",
|
|
1815
|
-
|
|
1842
|
+
er(16),
|
|
1816
1843
|
!0
|
|
1817
1844
|
)
|
|
1818
|
-
), e.appendChild(
|
|
1845
|
+
), e.appendChild(qa(n));
|
|
1819
1846
|
}
|
|
1820
|
-
function
|
|
1847
|
+
function $a(e, t, n, o) {
|
|
1821
1848
|
const i = document.createElement("form");
|
|
1822
1849
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1823
1850
|
const s = document.createElement("button");
|
|
1824
1851
|
s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", i.appendChild(s);
|
|
1825
1852
|
}
|
|
1826
1853
|
i.appendChild(
|
|
1827
|
-
|
|
1854
|
+
Oo(
|
|
1828
1855
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1829
1856
|
10
|
|
1830
1857
|
)
|
|
@@ -1838,22 +1865,22 @@ function Ua(e, t, n, o) {
|
|
|
1838
1865
|
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
1839
1866
|
const l = document.createElement("input");
|
|
1840
1867
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1841
|
-
const p =
|
|
1868
|
+
const p = St("Working...");
|
|
1842
1869
|
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1843
1870
|
const s = document.createElement("button");
|
|
1844
1871
|
s.type = "button", s.className = "pluno-pa-widget__launcher-minimize", s.textContent = "-", s.setAttribute("aria-label", "Minimize Pluno on this site"), s.title = "Minimize Pluno on this site", i.appendChild(s);
|
|
1845
1872
|
}
|
|
1846
1873
|
return i;
|
|
1847
1874
|
}
|
|
1848
|
-
function
|
|
1875
|
+
function qa(e) {
|
|
1849
1876
|
const t = document.createElement("section");
|
|
1850
1877
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1851
|
-
|
|
1878
|
+
Oo("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1852
1879
|
);
|
|
1853
1880
|
const n = document.createElement("div");
|
|
1854
1881
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1855
1882
|
const o = document.createElement("main");
|
|
1856
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
1883
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(Xa(e));
|
|
1857
1884
|
const i = document.createElement("div");
|
|
1858
1885
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1859
1886
|
const r = document.createElement("div");
|
|
@@ -1862,13 +1889,13 @@ function Ba(e) {
|
|
|
1862
1889
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1863
1890
|
const p = document.createElement("div");
|
|
1864
1891
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1865
|
-
|
|
1892
|
+
Et(
|
|
1866
1893
|
"pluno-pa-widget__history",
|
|
1867
|
-
|
|
1868
|
-
|
|
1894
|
+
un(),
|
|
1895
|
+
nr(),
|
|
1869
1896
|
!0
|
|
1870
1897
|
)
|
|
1871
|
-
), n.appendChild(p), n.appendChild(
|
|
1898
|
+
), n.appendChild(p), n.appendChild(Ya()), t.appendChild(n), t.appendChild(ja()), t.appendChild(Va()), t.appendChild(Ka()), t.appendChild(ye("left", "Resize Pluno from left")), t.appendChild(
|
|
1872
1899
|
ye("right", "Resize Pluno from right")
|
|
1873
1900
|
), t.appendChild(ye("top", "Resize Pluno from top")), t.appendChild(
|
|
1874
1901
|
ye("bottom", "Resize Pluno from bottom")
|
|
@@ -1889,7 +1916,7 @@ function ye(e, t) {
|
|
|
1889
1916
|
`pluno-pa-widget__resize-handle--${e}`
|
|
1890
1917
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1891
1918
|
}
|
|
1892
|
-
function
|
|
1919
|
+
function ja() {
|
|
1893
1920
|
const e = document.createElement("div");
|
|
1894
1921
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1895
1922
|
const t = document.createElement("span");
|
|
@@ -1903,7 +1930,19 @@ function Fa() {
|
|
|
1903
1930
|
const r = document.createElement("button");
|
|
1904
1931
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1905
1932
|
}
|
|
1906
|
-
function
|
|
1933
|
+
function Va() {
|
|
1934
|
+
const e = document.createElement("div");
|
|
1935
|
+
e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
|
|
1936
|
+
const t = document.createElement("span");
|
|
1937
|
+
t.className = "pluno-pa-widget__notify-suggestion-label", t.textContent = "Let Pluno group the tabs used by this task?";
|
|
1938
|
+
const n = document.createElement("div");
|
|
1939
|
+
n.className = "pluno-pa-widget__notify-suggestion-actions";
|
|
1940
|
+
const o = document.createElement("button");
|
|
1941
|
+
o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-enable pluno-pa-widget__tab-groups-suggestion-enable", o.textContent = "Enable grouping";
|
|
1942
|
+
const i = document.createElement("button");
|
|
1943
|
+
return i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", i.textContent = "Not now", n.append(o, i), e.append(t, n), e;
|
|
1944
|
+
}
|
|
1945
|
+
function Ka() {
|
|
1907
1946
|
const e = document.createElement("form");
|
|
1908
1947
|
e.className = "pluno-pa-widget__composer";
|
|
1909
1948
|
const t = document.createElement("div");
|
|
@@ -1917,11 +1956,11 @@ function Wa() {
|
|
|
1917
1956
|
const r = document.createElement("input");
|
|
1918
1957
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1919
1958
|
const l = document.createElement("button");
|
|
1920
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1959
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(ir()), l.appendChild(ar()), i.appendChild(l);
|
|
1921
1960
|
const p = document.createElement("textarea");
|
|
1922
1961
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1923
1962
|
const s = document.createElement("button");
|
|
1924
|
-
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(
|
|
1963
|
+
s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(Bo()), i.appendChild(s), e.appendChild(i);
|
|
1925
1964
|
const g = document.createElement("div");
|
|
1926
1965
|
g.className = "pluno-pa-widget__composer-meta";
|
|
1927
1966
|
const c = document.createElement("a");
|
|
@@ -1929,20 +1968,20 @@ function Wa() {
|
|
|
1929
1968
|
const h = document.createElement("span");
|
|
1930
1969
|
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", g.appendChild(h), e.appendChild(g), e;
|
|
1931
1970
|
}
|
|
1932
|
-
function
|
|
1971
|
+
function un() {
|
|
1933
1972
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1934
1973
|
}
|
|
1935
|
-
function
|
|
1974
|
+
function Ya() {
|
|
1936
1975
|
const e = document.createElement("section");
|
|
1937
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1976
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", un());
|
|
1938
1977
|
const t = document.createElement("div");
|
|
1939
1978
|
t.className = "pluno-pa-widget__history-header";
|
|
1940
1979
|
const n = document.createElement("strong");
|
|
1941
|
-
n.textContent =
|
|
1942
|
-
const o =
|
|
1980
|
+
n.textContent = un();
|
|
1981
|
+
const o = Et(
|
|
1943
1982
|
"pluno-pa-widget__history-close",
|
|
1944
1983
|
"Close recent chats",
|
|
1945
|
-
|
|
1984
|
+
or(),
|
|
1946
1985
|
!1
|
|
1947
1986
|
);
|
|
1948
1987
|
t.append(n, o);
|
|
@@ -1951,20 +1990,20 @@ function Ha() {
|
|
|
1951
1990
|
const r = document.createElement("p");
|
|
1952
1991
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1953
1992
|
}
|
|
1954
|
-
function
|
|
1993
|
+
function Xa(e) {
|
|
1955
1994
|
const t = document.createElement("div");
|
|
1956
1995
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1957
1996
|
ve(
|
|
1958
1997
|
"pluno-pa-widget__character--empty",
|
|
1959
1998
|
e
|
|
1960
1999
|
)
|
|
1961
|
-
), t.appendChild(
|
|
2000
|
+
), t.appendChild(Do()), t;
|
|
1962
2001
|
}
|
|
1963
|
-
function
|
|
2002
|
+
function Do() {
|
|
1964
2003
|
const e = document.createElement("div");
|
|
1965
2004
|
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;
|
|
1966
2005
|
}
|
|
1967
|
-
function
|
|
2006
|
+
function zo(e, t) {
|
|
1968
2007
|
e.replaceChildren(), e.setAttribute(
|
|
1969
2008
|
"aria-label",
|
|
1970
2009
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1977,16 +2016,16 @@ function Ao(e, t) {
|
|
|
1977
2016
|
);
|
|
1978
2017
|
}
|
|
1979
2018
|
function ve(e, t) {
|
|
1980
|
-
const n = `pluno-pa-character-${
|
|
1981
|
-
|
|
1982
|
-
const o = t.scribbleStyle ?
|
|
2019
|
+
const n = `pluno-pa-character-${Xn}`;
|
|
2020
|
+
Xn += 1;
|
|
2021
|
+
const o = t.scribbleStyle ? Ja(t.accentColor, n) : Za(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1983
2022
|
return o.setAttribute(
|
|
1984
2023
|
"class",
|
|
1985
2024
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1986
2025
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1987
2026
|
}
|
|
1988
|
-
function
|
|
1989
|
-
const n =
|
|
2027
|
+
function Za(e, t) {
|
|
2028
|
+
const n = _i(e), o = {
|
|
1990
2029
|
boltFill: `${t}-boltFill`,
|
|
1991
2030
|
boltEdge: `${t}-boltEdge`,
|
|
1992
2031
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1997,7 +2036,7 @@ function Ga(e, t) {
|
|
|
1997
2036
|
eyeShadow: `${t}-eyeShadow`,
|
|
1998
2037
|
pupilGloss: `${t}-pupilGloss`,
|
|
1999
2038
|
boltClip: `${t}-boltClip`
|
|
2000
|
-
}, i =
|
|
2039
|
+
}, i = Mo(), r = w(i, "defs"), l = w(r, "linearGradient", {
|
|
2001
2040
|
id: o.boltFill,
|
|
2002
2041
|
x1: "420",
|
|
2003
2042
|
y1: "180",
|
|
@@ -2051,7 +2090,7 @@ function Ga(e, t) {
|
|
|
2051
2090
|
"flood-color": n.shadow,
|
|
2052
2091
|
"flood-opacity": "0.24"
|
|
2053
2092
|
});
|
|
2054
|
-
const
|
|
2093
|
+
const S = w(r, "filter", {
|
|
2055
2094
|
id: o.innerDepth,
|
|
2056
2095
|
x: "-8%",
|
|
2057
2096
|
y: "-8%",
|
|
@@ -2059,27 +2098,27 @@ function Ga(e, t) {
|
|
|
2059
2098
|
height: "116%",
|
|
2060
2099
|
"color-interpolation-filters": "sRGB"
|
|
2061
2100
|
});
|
|
2062
|
-
w(
|
|
2101
|
+
w(S, "feGaussianBlur", {
|
|
2063
2102
|
in: "SourceAlpha",
|
|
2064
2103
|
stdDeviation: "8",
|
|
2065
2104
|
result: "blur"
|
|
2066
|
-
}), w(
|
|
2105
|
+
}), w(S, "feOffset", {
|
|
2067
2106
|
dx: "-7",
|
|
2068
2107
|
dy: "-9",
|
|
2069
2108
|
result: "topLeft"
|
|
2070
|
-
}), w(
|
|
2109
|
+
}), w(S, "feComposite", {
|
|
2071
2110
|
in: "topLeft",
|
|
2072
2111
|
in2: "SourceAlpha",
|
|
2073
2112
|
operator: "arithmetic",
|
|
2074
2113
|
k2: "-1",
|
|
2075
2114
|
k3: "1",
|
|
2076
2115
|
result: "innerShadow"
|
|
2077
|
-
}), w(
|
|
2116
|
+
}), w(S, "feColorMatrix", {
|
|
2078
2117
|
in: "innerShadow",
|
|
2079
2118
|
type: "matrix",
|
|
2080
2119
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2081
2120
|
result: "innerLight"
|
|
2082
|
-
}), w(
|
|
2121
|
+
}), w(S, "feBlend", {
|
|
2083
2122
|
in: "SourceGraphic",
|
|
2084
2123
|
in2: "innerLight",
|
|
2085
2124
|
mode: "screen"
|
|
@@ -2115,26 +2154,26 @@ function Ga(e, t) {
|
|
|
2115
2154
|
"flood-opacity": "0.22"
|
|
2116
2155
|
});
|
|
2117
2156
|
const D = w(r, "clipPath", { id: o.boltClip });
|
|
2118
|
-
w(D, "path", { d:
|
|
2157
|
+
w(D, "path", { d: xt });
|
|
2119
2158
|
const u = w(i, "g", {
|
|
2120
|
-
filter:
|
|
2159
|
+
filter: X(o.softDropShadow)
|
|
2121
2160
|
});
|
|
2122
2161
|
w(u, "path", {
|
|
2123
|
-
d:
|
|
2124
|
-
fill:
|
|
2162
|
+
d: xt,
|
|
2163
|
+
fill: X(o.boltEdge)
|
|
2125
2164
|
});
|
|
2126
2165
|
const v = "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";
|
|
2127
2166
|
w(u, "path", {
|
|
2128
2167
|
d: v,
|
|
2129
|
-
fill:
|
|
2130
|
-
filter:
|
|
2168
|
+
fill: X(o.boltFill),
|
|
2169
|
+
filter: X(o.innerDepth)
|
|
2131
2170
|
}), w(u, "path", {
|
|
2132
2171
|
d: v,
|
|
2133
|
-
fill:
|
|
2172
|
+
fill: X(o.boltGlow),
|
|
2134
2173
|
opacity: "0.74"
|
|
2135
2174
|
});
|
|
2136
2175
|
const m = w(u, "g", {
|
|
2137
|
-
"clip-path":
|
|
2176
|
+
"clip-path": X(o.boltClip),
|
|
2138
2177
|
opacity: "0.42"
|
|
2139
2178
|
});
|
|
2140
2179
|
w(m, "path", {
|
|
@@ -2159,9 +2198,9 @@ function Ga(e, t) {
|
|
|
2159
2198
|
"stroke-linecap": "round",
|
|
2160
2199
|
opacity: "0.48"
|
|
2161
2200
|
});
|
|
2162
|
-
const
|
|
2163
|
-
return
|
|
2164
|
-
|
|
2201
|
+
const C = w(i, "g", { filter: X(o.eyeShadow) });
|
|
2202
|
+
return oo(
|
|
2203
|
+
C,
|
|
2165
2204
|
"rotate(-2 528 463)",
|
|
2166
2205
|
"528",
|
|
2167
2206
|
"463",
|
|
@@ -2170,8 +2209,8 @@ function Ga(e, t) {
|
|
|
2170
2209
|
"557",
|
|
2171
2210
|
"447",
|
|
2172
2211
|
o
|
|
2173
|
-
),
|
|
2174
|
-
|
|
2212
|
+
), oo(
|
|
2213
|
+
C,
|
|
2175
2214
|
"rotate(2 717 462)",
|
|
2176
2215
|
"717",
|
|
2177
2216
|
"462",
|
|
@@ -2182,12 +2221,12 @@ function Ga(e, t) {
|
|
|
2182
2221
|
o
|
|
2183
2222
|
), i;
|
|
2184
2223
|
}
|
|
2185
|
-
function
|
|
2186
|
-
const n =
|
|
2224
|
+
function Ja(e, t) {
|
|
2225
|
+
const n = xo(e), o = {
|
|
2187
2226
|
clip: `${t}-scribbleBoltClip`,
|
|
2188
2227
|
wobble: `${t}-scribbleBoltWobble`
|
|
2189
|
-
}, i =
|
|
2190
|
-
w(l, "path", { d:
|
|
2228
|
+
}, i = Mo(), r = w(i, "defs"), l = w(r, "clipPath", { id: o.clip });
|
|
2229
|
+
w(l, "path", { d: xt });
|
|
2191
2230
|
const p = w(r, "filter", {
|
|
2192
2231
|
id: o.wobble,
|
|
2193
2232
|
x: "-10%",
|
|
@@ -2209,11 +2248,11 @@ function qa(e, t) {
|
|
|
2209
2248
|
xChannelSelector: "R",
|
|
2210
2249
|
yChannelSelector: "G"
|
|
2211
2250
|
});
|
|
2212
|
-
const s = w(i, "g", { filter:
|
|
2213
|
-
"clip-path":
|
|
2251
|
+
const s = w(i, "g", { filter: X(o.wobble) }), g = w(s, "g", {
|
|
2252
|
+
"clip-path": X(o.clip)
|
|
2214
2253
|
});
|
|
2215
2254
|
return w(g, "path", {
|
|
2216
|
-
d:
|
|
2255
|
+
d: bi(),
|
|
2217
2256
|
fill: "none",
|
|
2218
2257
|
stroke: n,
|
|
2219
2258
|
"stroke-width": "56",
|
|
@@ -2222,12 +2261,12 @@ function qa(e, t) {
|
|
|
2222
2261
|
opacity: "0.9",
|
|
2223
2262
|
transform: "rotate(-14 627 600)"
|
|
2224
2263
|
}), w(s, "path", {
|
|
2225
|
-
d:
|
|
2264
|
+
d: xt,
|
|
2226
2265
|
fill: "none",
|
|
2227
|
-
stroke:
|
|
2266
|
+
stroke: yt,
|
|
2228
2267
|
"stroke-width": "18",
|
|
2229
2268
|
"stroke-linejoin": "round"
|
|
2230
|
-
}),
|
|
2269
|
+
}), io(
|
|
2231
2270
|
s,
|
|
2232
2271
|
"rotate(-2 528 463)",
|
|
2233
2272
|
"528",
|
|
@@ -2236,7 +2275,7 @@ function qa(e, t) {
|
|
|
2236
2275
|
"473",
|
|
2237
2276
|
"557",
|
|
2238
2277
|
"447"
|
|
2239
|
-
),
|
|
2278
|
+
), io(
|
|
2240
2279
|
s,
|
|
2241
2280
|
"rotate(2 717 462)",
|
|
2242
2281
|
"717",
|
|
@@ -2247,27 +2286,27 @@ function qa(e, t) {
|
|
|
2247
2286
|
"447"
|
|
2248
2287
|
), i;
|
|
2249
2288
|
}
|
|
2250
|
-
function
|
|
2289
|
+
function Mo() {
|
|
2251
2290
|
return E("svg", {
|
|
2252
|
-
xmlns:
|
|
2291
|
+
xmlns: To,
|
|
2253
2292
|
viewBox: "0 0 1254 1254"
|
|
2254
2293
|
});
|
|
2255
2294
|
}
|
|
2256
|
-
function
|
|
2295
|
+
function oo(e, t, n, o, i, r, l, p, s) {
|
|
2257
2296
|
const g = w(e, "g", { transform: t });
|
|
2258
2297
|
w(g, "ellipse", {
|
|
2259
2298
|
cx: n,
|
|
2260
2299
|
cy: o,
|
|
2261
2300
|
rx: "73",
|
|
2262
2301
|
ry: "80",
|
|
2263
|
-
fill:
|
|
2302
|
+
fill: X(s.eyeWhite)
|
|
2264
2303
|
}), w(g, "ellipse", {
|
|
2265
2304
|
cx: i,
|
|
2266
2305
|
cy: r,
|
|
2267
2306
|
rx: "49",
|
|
2268
2307
|
ry: "57",
|
|
2269
|
-
fill:
|
|
2270
|
-
filter:
|
|
2308
|
+
fill: X(s.pupil),
|
|
2309
|
+
filter: X(s.pupilGloss)
|
|
2271
2310
|
}), w(g, "circle", {
|
|
2272
2311
|
cx: l,
|
|
2273
2312
|
cy: p,
|
|
@@ -2275,7 +2314,7 @@ function Qn(e, t, n, o, i, r, l, p, s) {
|
|
|
2275
2314
|
fill: "#ffffff"
|
|
2276
2315
|
});
|
|
2277
2316
|
}
|
|
2278
|
-
function
|
|
2317
|
+
function io(e, t, n, o, i, r, l, p) {
|
|
2279
2318
|
const s = w(e, "g", { transform: t });
|
|
2280
2319
|
w(s, "ellipse", {
|
|
2281
2320
|
cx: n,
|
|
@@ -2283,14 +2322,14 @@ function eo(e, t, n, o, i, r, l, p) {
|
|
|
2283
2322
|
rx: "73",
|
|
2284
2323
|
ry: "80",
|
|
2285
2324
|
fill: "#ffffff",
|
|
2286
|
-
stroke:
|
|
2325
|
+
stroke: yt,
|
|
2287
2326
|
"stroke-width": "13"
|
|
2288
2327
|
}), w(s, "ellipse", {
|
|
2289
2328
|
cx: i,
|
|
2290
2329
|
cy: r,
|
|
2291
2330
|
rx: "45",
|
|
2292
2331
|
ry: "53",
|
|
2293
|
-
fill:
|
|
2332
|
+
fill: yt
|
|
2294
2333
|
}), w(s, "circle", {
|
|
2295
2334
|
cx: l,
|
|
2296
2335
|
cy: p,
|
|
@@ -2306,14 +2345,14 @@ function O(e, t, n, o) {
|
|
|
2306
2345
|
const i = { offset: t, "stop-color": n };
|
|
2307
2346
|
o !== void 0 && (i["stop-opacity"] = o), w(e, "stop", i);
|
|
2308
2347
|
}
|
|
2309
|
-
function
|
|
2348
|
+
function X(e) {
|
|
2310
2349
|
return `url(#${e})`;
|
|
2311
2350
|
}
|
|
2312
|
-
function
|
|
2351
|
+
function Et(e, t, n, o) {
|
|
2313
2352
|
const i = document.createElement("button");
|
|
2314
2353
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2315
2354
|
}
|
|
2316
|
-
function
|
|
2355
|
+
function Qa() {
|
|
2317
2356
|
const e = E("svg", {
|
|
2318
2357
|
class: "pluno-pa-widget__scribble-defs",
|
|
2319
2358
|
"aria-hidden": "true",
|
|
@@ -2321,46 +2360,46 @@ function ja() {
|
|
|
2321
2360
|
width: "0",
|
|
2322
2361
|
height: "0"
|
|
2323
2362
|
}), t = E("defs");
|
|
2324
|
-
return t.appendChild(
|
|
2325
|
-
|
|
2363
|
+
return t.appendChild(en("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2364
|
+
en("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2326
2365
|
), t.appendChild(
|
|
2327
|
-
|
|
2366
|
+
en("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2328
2367
|
), e.appendChild(t), e;
|
|
2329
2368
|
}
|
|
2330
|
-
function
|
|
2369
|
+
function Oo(e, t) {
|
|
2331
2370
|
const n = E("svg", {
|
|
2332
2371
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2333
2372
|
preserveAspectRatio: "xMidYMid meet",
|
|
2334
2373
|
"aria-hidden": "true",
|
|
2335
2374
|
focusable: "false"
|
|
2336
2375
|
});
|
|
2337
|
-
return
|
|
2376
|
+
return Uo(n, t), n;
|
|
2338
2377
|
}
|
|
2339
|
-
function
|
|
2378
|
+
function Qt(e, t) {
|
|
2340
2379
|
if (!e)
|
|
2341
2380
|
return;
|
|
2342
2381
|
const n = Math.max(
|
|
2343
2382
|
0,
|
|
2344
|
-
t -
|
|
2383
|
+
t - sn * 2
|
|
2345
2384
|
), o = Math.max(
|
|
2346
|
-
|
|
2385
|
+
ma,
|
|
2347
2386
|
Math.floor(
|
|
2348
|
-
(n -
|
|
2387
|
+
(n - pn * 2) / ln
|
|
2349
2388
|
)
|
|
2350
2389
|
);
|
|
2351
|
-
|
|
2390
|
+
Uo(e, o);
|
|
2352
2391
|
}
|
|
2353
|
-
function
|
|
2392
|
+
function Uo(e, t) {
|
|
2354
2393
|
if (e.dataset.spiralCount === `${t}`)
|
|
2355
2394
|
return;
|
|
2356
|
-
const n = t *
|
|
2395
|
+
const n = t * ln + pn * 2;
|
|
2357
2396
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2358
2397
|
"viewBox",
|
|
2359
|
-
`0 0 ${n} ${
|
|
2398
|
+
`0 0 ${n} ${ha}`
|
|
2360
2399
|
), e.replaceChildren();
|
|
2361
2400
|
for (let o = 0; o < t; o += 1) {
|
|
2362
|
-
const i =
|
|
2363
|
-
transform: `translate(${
|
|
2401
|
+
const i = Yn[o % Yn.length], r = E("g", {
|
|
2402
|
+
transform: `translate(${pn + o * ln} 0)`
|
|
2364
2403
|
});
|
|
2365
2404
|
r.appendChild(
|
|
2366
2405
|
E("ellipse", {
|
|
@@ -2384,7 +2423,7 @@ function Do(e, t) {
|
|
|
2384
2423
|
), e.appendChild(r);
|
|
2385
2424
|
}
|
|
2386
2425
|
}
|
|
2387
|
-
function
|
|
2426
|
+
function en(e, t, n) {
|
|
2388
2427
|
const o = E("filter", {
|
|
2389
2428
|
id: e,
|
|
2390
2429
|
x: "-8%",
|
|
@@ -2427,7 +2466,7 @@ function Xt(e, t, n) {
|
|
|
2427
2466
|
})
|
|
2428
2467
|
), o;
|
|
2429
2468
|
}
|
|
2430
|
-
function
|
|
2469
|
+
function er(e) {
|
|
2431
2470
|
const t = ce(
|
|
2432
2471
|
"0 0 24 24",
|
|
2433
2472
|
e,
|
|
@@ -2438,7 +2477,7 @@ function Va(e) {
|
|
|
2438
2477
|
);
|
|
2439
2478
|
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2440
2479
|
}
|
|
2441
|
-
function
|
|
2480
|
+
function tr() {
|
|
2442
2481
|
const e = ce(
|
|
2443
2482
|
"0 0 24 24",
|
|
2444
2483
|
17,
|
|
@@ -2457,7 +2496,7 @@ function Ka() {
|
|
|
2457
2496
|
})
|
|
2458
2497
|
), e;
|
|
2459
2498
|
}
|
|
2460
|
-
function
|
|
2499
|
+
function nr() {
|
|
2461
2500
|
const e = ce(
|
|
2462
2501
|
"0 0 24 24",
|
|
2463
2502
|
17,
|
|
@@ -2468,7 +2507,7 @@ function Ya() {
|
|
|
2468
2507
|
);
|
|
2469
2508
|
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2470
2509
|
}
|
|
2471
|
-
function
|
|
2510
|
+
function or() {
|
|
2472
2511
|
const e = ce(
|
|
2473
2512
|
"0 0 24 24",
|
|
2474
2513
|
15,
|
|
@@ -2479,7 +2518,7 @@ function Xa() {
|
|
|
2479
2518
|
);
|
|
2480
2519
|
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2481
2520
|
}
|
|
2482
|
-
function
|
|
2521
|
+
function Bo() {
|
|
2483
2522
|
const e = ce(
|
|
2484
2523
|
"0 0 24 24",
|
|
2485
2524
|
14,
|
|
@@ -2492,7 +2531,7 @@ function zo() {
|
|
|
2492
2531
|
E("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2493
2532
|
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2494
2533
|
}
|
|
2495
|
-
function
|
|
2534
|
+
function ir() {
|
|
2496
2535
|
const e = ce(
|
|
2497
2536
|
"0 0 24 24",
|
|
2498
2537
|
16,
|
|
@@ -2510,7 +2549,7 @@ function Za() {
|
|
|
2510
2549
|
})
|
|
2511
2550
|
), e;
|
|
2512
2551
|
}
|
|
2513
|
-
function
|
|
2552
|
+
function ar() {
|
|
2514
2553
|
const e = ce("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2515
2554
|
return e.setAttribute(
|
|
2516
2555
|
"class",
|
|
@@ -2525,7 +2564,7 @@ function Ja() {
|
|
|
2525
2564
|
})
|
|
2526
2565
|
), e;
|
|
2527
2566
|
}
|
|
2528
|
-
function
|
|
2567
|
+
function rr() {
|
|
2529
2568
|
const e = ce("0 0 24 24", 18, 18, "currentColor");
|
|
2530
2569
|
return e.appendChild(
|
|
2531
2570
|
E("rect", {
|
|
@@ -2537,7 +2576,7 @@ function Qa() {
|
|
|
2537
2576
|
})
|
|
2538
2577
|
), e;
|
|
2539
2578
|
}
|
|
2540
|
-
function
|
|
2579
|
+
function lr() {
|
|
2541
2580
|
const e = ce(
|
|
2542
2581
|
"0 0 24 24",
|
|
2543
2582
|
12,
|
|
@@ -2548,7 +2587,7 @@ function er() {
|
|
|
2548
2587
|
);
|
|
2549
2588
|
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2550
2589
|
}
|
|
2551
|
-
function
|
|
2590
|
+
function pr() {
|
|
2552
2591
|
const e = ce(
|
|
2553
2592
|
"0 0 24 24",
|
|
2554
2593
|
13,
|
|
@@ -2583,30 +2622,30 @@ function ce(e, t, n, o, i, r) {
|
|
|
2583
2622
|
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2584
2623
|
}
|
|
2585
2624
|
function E(e, t = {}) {
|
|
2586
|
-
const n = document.createElementNS(
|
|
2625
|
+
const n = document.createElementNS(To, e);
|
|
2587
2626
|
for (const [o, i] of Object.entries(t))
|
|
2588
2627
|
n.setAttribute(o, i);
|
|
2589
2628
|
return n;
|
|
2590
2629
|
}
|
|
2591
|
-
function
|
|
2630
|
+
function ao(e) {
|
|
2592
2631
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2593
2632
|
e.addEventListener(t, (n) => {
|
|
2594
2633
|
n.stopPropagation();
|
|
2595
2634
|
});
|
|
2596
2635
|
}
|
|
2597
|
-
function
|
|
2636
|
+
function sr(e, t, n) {
|
|
2598
2637
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2599
2638
|
for (const [o, i] of t.entries()) {
|
|
2600
2639
|
const r = document.createElement("div");
|
|
2601
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2640
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(dr(i));
|
|
2602
2641
|
const l = document.createElement("span");
|
|
2603
2642
|
l.textContent = i.name, r.appendChild(l);
|
|
2604
2643
|
const p = document.createElement("button");
|
|
2605
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2644
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(lr()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2606
2645
|
}
|
|
2607
2646
|
}
|
|
2608
|
-
function
|
|
2609
|
-
const t =
|
|
2647
|
+
function dr(e) {
|
|
2648
|
+
const t = bn(e), n = Fo(e);
|
|
2610
2649
|
if (t === "image" && n) {
|
|
2611
2650
|
const o = document.createElement("img");
|
|
2612
2651
|
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(se(e))), o;
|
|
@@ -2617,8 +2656,8 @@ function or(e) {
|
|
|
2617
2656
|
}
|
|
2618
2657
|
return se(e);
|
|
2619
2658
|
}
|
|
2620
|
-
function
|
|
2621
|
-
const t =
|
|
2659
|
+
function cr(e) {
|
|
2660
|
+
const t = bn(e), n = Fo(e);
|
|
2622
2661
|
if (t === "image" && n) {
|
|
2623
2662
|
const o = document.createElement("img");
|
|
2624
2663
|
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(se(e, "message"))), o;
|
|
@@ -2636,109 +2675,109 @@ function ir(e) {
|
|
|
2636
2675
|
function se(e, t = "composer") {
|
|
2637
2676
|
if (t === "composer") {
|
|
2638
2677
|
const r = document.createElement("span");
|
|
2639
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2678
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = ro(e), r;
|
|
2640
2679
|
}
|
|
2641
2680
|
const n = document.createElement("div");
|
|
2642
2681
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2643
2682
|
const o = document.createElement("span");
|
|
2644
|
-
o.textContent =
|
|
2683
|
+
o.textContent = ro(e);
|
|
2645
2684
|
const i = document.createElement("strong");
|
|
2646
2685
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2647
2686
|
}
|
|
2648
|
-
function
|
|
2687
|
+
function bn(e) {
|
|
2649
2688
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2650
2689
|
}
|
|
2651
|
-
function
|
|
2690
|
+
function Fo(e) {
|
|
2652
2691
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2653
2692
|
}
|
|
2654
|
-
function
|
|
2655
|
-
const t =
|
|
2693
|
+
function ro(e) {
|
|
2694
|
+
const t = bn(e);
|
|
2656
2695
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2657
2696
|
}
|
|
2658
|
-
function
|
|
2697
|
+
function ur(e, t) {
|
|
2659
2698
|
return t ? Array.from(t).map((o) => ({
|
|
2660
2699
|
...e.createLocalAttachment(o),
|
|
2661
|
-
previewUrl:
|
|
2700
|
+
previewUrl: gr(o)
|
|
2662
2701
|
})) : [];
|
|
2663
2702
|
}
|
|
2664
|
-
function
|
|
2703
|
+
function gr(e) {
|
|
2665
2704
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2666
2705
|
}
|
|
2667
|
-
function
|
|
2706
|
+
function ft(e) {
|
|
2668
2707
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2669
2708
|
}
|
|
2670
|
-
function
|
|
2671
|
-
if (!e || !
|
|
2709
|
+
function tn(e, t, n = null) {
|
|
2710
|
+
if (!e || !gn(t, n)) {
|
|
2672
2711
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2673
2712
|
return;
|
|
2674
2713
|
}
|
|
2675
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", de(t) ||
|
|
2676
|
-
|
|
2677
|
-
) :
|
|
2714
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", de(t) || _n(n) ? e.appendChild(
|
|
2715
|
+
hr(t, n)
|
|
2716
|
+
) : Wo(t) && e.appendChild(mr(t));
|
|
2678
2717
|
}
|
|
2679
|
-
function
|
|
2718
|
+
function hr(e, t) {
|
|
2680
2719
|
const n = document.createElement("div");
|
|
2681
2720
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2682
2721
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2683
2722
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2684
2723
|
const r = document.createElement("span");
|
|
2685
2724
|
return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
|
|
2686
|
-
|
|
2725
|
+
Ho(
|
|
2687
2726
|
e,
|
|
2688
2727
|
"Upgrade plan",
|
|
2689
2728
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2690
2729
|
)
|
|
2691
2730
|
), n;
|
|
2692
2731
|
}
|
|
2693
|
-
function
|
|
2732
|
+
function mr(e) {
|
|
2694
2733
|
const t = document.createElement("div");
|
|
2695
2734
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2696
2735
|
const n = document.createElement("strong");
|
|
2697
2736
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2698
2737
|
const o = document.createElement("span");
|
|
2699
|
-
return o.textContent =
|
|
2700
|
-
|
|
2738
|
+
return o.textContent = wr(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2739
|
+
Ho(
|
|
2701
2740
|
e,
|
|
2702
2741
|
"Upgrade",
|
|
2703
2742
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2704
2743
|
)
|
|
2705
2744
|
), t;
|
|
2706
2745
|
}
|
|
2707
|
-
function
|
|
2708
|
-
return e !== null && (de(e) ||
|
|
2746
|
+
function gn(e, t) {
|
|
2747
|
+
return e !== null && (de(e) || Wo(e) || _n(t));
|
|
2709
2748
|
}
|
|
2710
|
-
function
|
|
2711
|
-
return
|
|
2749
|
+
function lo(e, t, n) {
|
|
2750
|
+
return gn(t, n) || fr(t) ? !0 : !gn(e, n);
|
|
2712
2751
|
}
|
|
2713
|
-
function
|
|
2752
|
+
function fr(e) {
|
|
2714
2753
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || de(e));
|
|
2715
2754
|
}
|
|
2716
2755
|
function de(e) {
|
|
2717
2756
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2718
2757
|
}
|
|
2719
|
-
function
|
|
2758
|
+
function _n(e) {
|
|
2720
2759
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2721
2760
|
}
|
|
2722
|
-
function
|
|
2761
|
+
function Wo(e) {
|
|
2723
2762
|
return !de(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2724
2763
|
}
|
|
2725
|
-
function
|
|
2726
|
-
return e.creditsRemaining === null ? null : `${
|
|
2764
|
+
function wr(e) {
|
|
2765
|
+
return e.creditsRemaining === null ? null : `${br(e.creditsRemaining)} credits left`;
|
|
2727
2766
|
}
|
|
2728
|
-
function
|
|
2767
|
+
function br(e) {
|
|
2729
2768
|
return new Intl.NumberFormat("en-US", {
|
|
2730
2769
|
maximumFractionDigits: 0
|
|
2731
2770
|
}).format(Math.ceil(e));
|
|
2732
2771
|
}
|
|
2733
|
-
function
|
|
2772
|
+
function Ho(e, t, n) {
|
|
2734
2773
|
const o = document.createElement("div");
|
|
2735
2774
|
return o.className = n, o.appendChild(
|
|
2736
|
-
|
|
2775
|
+
po(t, e.pricingUrl)
|
|
2737
2776
|
), o.appendChild(
|
|
2738
|
-
|
|
2777
|
+
po("Earn credits", e.earnCreditsUrl)
|
|
2739
2778
|
), o;
|
|
2740
2779
|
}
|
|
2741
|
-
function
|
|
2780
|
+
function po(e, t) {
|
|
2742
2781
|
const n = document.createElement("button");
|
|
2743
2782
|
if (n.type = "button", e === "Earn credits") {
|
|
2744
2783
|
const o = document.createElement("span");
|
|
@@ -2749,18 +2788,18 @@ function io(e, t) {
|
|
|
2749
2788
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2750
2789
|
}), n;
|
|
2751
2790
|
}
|
|
2752
|
-
function
|
|
2791
|
+
function nn(e, t) {
|
|
2753
2792
|
return e.messages.filter(
|
|
2754
|
-
(o) => !
|
|
2793
|
+
(o) => !Go(o)
|
|
2755
2794
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2756
2795
|
}
|
|
2757
|
-
function
|
|
2758
|
-
const z =
|
|
2759
|
-
(x) => !
|
|
2760
|
-
),
|
|
2761
|
-
|
|
2796
|
+
function _r(e, t, n, o, i, r, l, p, s, g, c, h, S, P, I, D, u, v, m, C) {
|
|
2797
|
+
const z = Sr(r), L = z.filter(
|
|
2798
|
+
(x) => !Go(x)
|
|
2799
|
+
), ie = e.scrollTop, Q = [], Re = /* @__PURE__ */ new Set(), U = (x) => {
|
|
2800
|
+
Q.push(x);
|
|
2762
2801
|
};
|
|
2763
|
-
|
|
2802
|
+
qo(n, r.isThinking), i.hidden = !p, p && l !== null && zo(i, l);
|
|
2764
2803
|
const we = L.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2765
2804
|
if (o(we), u || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2766
2805
|
const x = document.createElement("div");
|
|
@@ -2775,10 +2814,10 @@ function ur(e, t, n, o, i, r, l, p, s, g, c, h, C, P, I, D, u, v, m, S) {
|
|
|
2775
2814
|
const y = document.createElement("h2");
|
|
2776
2815
|
y.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", y.textContent = u.opening, x.appendChild(y);
|
|
2777
2816
|
} else
|
|
2778
|
-
x.appendChild(
|
|
2779
|
-
const
|
|
2780
|
-
if (H.className =
|
|
2781
|
-
for (const y of
|
|
2817
|
+
x.appendChild(Do());
|
|
2818
|
+
const re = u?.prompts ?? r.starterPrompts, H = document.createElement("div");
|
|
2819
|
+
if (H.className = re.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", re.length === 0 && !r.starterPromptsLoading && H.setAttribute("aria-hidden", "true"), re.length > 0)
|
|
2820
|
+
for (const y of re) {
|
|
2782
2821
|
const A = document.createElement("button");
|
|
2783
2822
|
A.type = "button", A.className = "pluno-pa-widget__starter-prompt", A.textContent = `"${y}"`, A.addEventListener("click", () => {
|
|
2784
2823
|
I(y);
|
|
@@ -2788,7 +2827,7 @@ function ur(e, t, n, o, i, r, l, p, s, g, c, h, C, P, I, D, u, v, m, S) {
|
|
|
2788
2827
|
const y = document.createElement("button");
|
|
2789
2828
|
y.type = "button", y.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", y.disabled = !0, y.tabIndex = -1, y.textContent = "Generating example tasks...", H.appendChild(y);
|
|
2790
2829
|
} else
|
|
2791
|
-
for (let y = 0; y <
|
|
2830
|
+
for (let y = 0; y < na; y += 1) {
|
|
2792
2831
|
const A = document.createElement("button");
|
|
2793
2832
|
A.type = "button", A.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", A.disabled = !0, A.tabIndex = -1, A.textContent = "", H.appendChild(A);
|
|
2794
2833
|
}
|
|
@@ -2796,62 +2835,62 @@ function ur(e, t, n, o, i, r, l, p, s, g, c, h, C, P, I, D, u, v, m, S) {
|
|
|
2796
2835
|
const y = document.createElement("button");
|
|
2797
2836
|
y.type = "button", y.className = "pluno-pa-widget__morning-report-snooze", y.textContent = "Snooze morning report", y.addEventListener("click", v), x.appendChild(y);
|
|
2798
2837
|
}
|
|
2799
|
-
h.clear(), U(x), U(t),
|
|
2838
|
+
h.clear(), U(x), U(t), so(e, Q);
|
|
2800
2839
|
return;
|
|
2801
2840
|
}
|
|
2802
|
-
let B = null, f = null,
|
|
2803
|
-
const De = L.length - 1,
|
|
2804
|
-
if (
|
|
2841
|
+
let B = null, f = null, ee = [];
|
|
2842
|
+
const De = L.length - 1, Se = De >= 0 && hn(L[De]), Ce = () => {
|
|
2843
|
+
if (ee.length === 0)
|
|
2805
2844
|
return !1;
|
|
2806
|
-
const x =
|
|
2807
|
-
|
|
2845
|
+
const x = Nr(
|
|
2846
|
+
ee,
|
|
2808
2847
|
c,
|
|
2809
|
-
|
|
2848
|
+
S,
|
|
2810
2849
|
P()
|
|
2811
2850
|
);
|
|
2812
|
-
return U(x), B = null, f = x,
|
|
2851
|
+
return U(x), B = null, f = x, ee = [], !0;
|
|
2813
2852
|
};
|
|
2814
2853
|
for (let x = 0; x < L.length; x += 1) {
|
|
2815
2854
|
const R = L[x];
|
|
2816
2855
|
if (R.role === "tool") {
|
|
2817
|
-
|
|
2856
|
+
ee.push(R);
|
|
2818
2857
|
continue;
|
|
2819
2858
|
}
|
|
2820
|
-
if (
|
|
2859
|
+
if (hn(R)) {
|
|
2821
2860
|
if (x !== De)
|
|
2822
2861
|
continue;
|
|
2823
|
-
if (
|
|
2824
|
-
const A =
|
|
2862
|
+
if (Ce()) {
|
|
2863
|
+
const A = St();
|
|
2825
2864
|
U(A), B = null, f = A;
|
|
2826
2865
|
} else {
|
|
2827
|
-
const A =
|
|
2866
|
+
const A = ho(P());
|
|
2828
2867
|
U(A), B = null, f = A;
|
|
2829
2868
|
}
|
|
2830
2869
|
continue;
|
|
2831
2870
|
}
|
|
2832
2871
|
if (R.role === "system") {
|
|
2833
2872
|
if (R.dataType === "run_error" || R.dataType === "run_status") {
|
|
2834
|
-
|
|
2873
|
+
Ce();
|
|
2835
2874
|
const y = document.createElement("div"), A = R.dataType === "run_error";
|
|
2836
|
-
y.className = A ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", y.textContent =
|
|
2875
|
+
y.className = A ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", y.textContent = go(R.content), U(y), B = A ? y : null, f = A ? null : y;
|
|
2837
2876
|
}
|
|
2838
2877
|
continue;
|
|
2839
2878
|
}
|
|
2840
|
-
const T =
|
|
2879
|
+
const T = Ce(), re = go(R.content);
|
|
2841
2880
|
if (R.role === "assistant" && !T) {
|
|
2842
|
-
const y =
|
|
2881
|
+
const y = $o(P());
|
|
2843
2882
|
U(y), B = null, f = y;
|
|
2844
2883
|
}
|
|
2845
|
-
const H =
|
|
2884
|
+
const H = xr(R, re, h, Re);
|
|
2846
2885
|
U(H), B = H, f = null;
|
|
2847
2886
|
}
|
|
2848
|
-
const j =
|
|
2849
|
-
if (r.isThinking && !
|
|
2887
|
+
const j = Ce(), at = L[L.length - 1]?.id === "assistant-draft";
|
|
2888
|
+
if (r.isThinking && !at && !Se)
|
|
2850
2889
|
if (j) {
|
|
2851
|
-
const x =
|
|
2890
|
+
const x = St();
|
|
2852
2891
|
U(x), B = null, f = x;
|
|
2853
2892
|
} else {
|
|
2854
|
-
const x =
|
|
2893
|
+
const x = ho(P());
|
|
2855
2894
|
U(x), B = null, f = x;
|
|
2856
2895
|
}
|
|
2857
2896
|
if (r.lastError) {
|
|
@@ -2867,30 +2906,30 @@ function ur(e, t, n, o, i, r, l, p, s, g, c, h, C, P, I, D, u, v, m, S) {
|
|
|
2867
2906
|
}
|
|
2868
2907
|
U(x), B = x, f = null;
|
|
2869
2908
|
}
|
|
2870
|
-
const
|
|
2871
|
-
if (
|
|
2872
|
-
const x =
|
|
2873
|
-
isDrafting:
|
|
2874
|
-
error:
|
|
2875
|
-
characterIconOptions:
|
|
2876
|
-
onDraft:
|
|
2877
|
-
onDismiss:
|
|
2878
|
-
onDisable:
|
|
2909
|
+
const ae = C && !r.isThinking ? Si(z) : null;
|
|
2910
|
+
if (C && ae && !C.dismissedCandidateIds.has(ae.id)) {
|
|
2911
|
+
const x = kr(ae, {
|
|
2912
|
+
isDrafting: C.draftingCandidateId === ae.id,
|
|
2913
|
+
error: C.error,
|
|
2914
|
+
characterIconOptions: C.characterIconOptions,
|
|
2915
|
+
onDraft: C.onDraft,
|
|
2916
|
+
onDismiss: C.onDismiss,
|
|
2917
|
+
onDisable: C.onDisable
|
|
2879
2918
|
});
|
|
2880
|
-
U(x),
|
|
2919
|
+
U(x), C.onSeen(ae), B = null, f = x;
|
|
2881
2920
|
}
|
|
2882
|
-
B?.classList.add("pluno-pa-widget__message--bottom-reserve"), f?.classList.add("pluno-pa-widget__bottom-reserve-compact"), U(t),
|
|
2921
|
+
B?.classList.add("pluno-pa-widget__message--bottom-reserve"), f?.classList.add("pluno-pa-widget__bottom-reserve-compact"), U(t), vr(h, Re), so(e, Q), s ? ot(e, g) : e.scrollTop = ie;
|
|
2883
2922
|
}
|
|
2884
|
-
function
|
|
2885
|
-
const i =
|
|
2923
|
+
function xr(e, t, n, o) {
|
|
2924
|
+
const i = yr(e, t), r = i ? n.get(i) : void 0;
|
|
2886
2925
|
if (i && r)
|
|
2887
2926
|
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2888
2927
|
const l = document.createElement("div");
|
|
2889
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2928
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? Dr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(Cr(e.attachments));
|
|
2890
2929
|
const p = document.createElement("div");
|
|
2891
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2930
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Er(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2892
2931
|
}
|
|
2893
|
-
function
|
|
2932
|
+
function yr(e, t) {
|
|
2894
2933
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2895
2934
|
id: e.id,
|
|
2896
2935
|
content: t,
|
|
@@ -2908,11 +2947,11 @@ function hr(e, t) {
|
|
|
2908
2947
|
})
|
|
2909
2948
|
});
|
|
2910
2949
|
}
|
|
2911
|
-
function
|
|
2950
|
+
function vr(e, t) {
|
|
2912
2951
|
for (const n of e.keys())
|
|
2913
2952
|
t.has(n) || e.delete(n);
|
|
2914
2953
|
}
|
|
2915
|
-
function
|
|
2954
|
+
function so(e, t) {
|
|
2916
2955
|
let n = e.firstChild;
|
|
2917
2956
|
for (const o of t) {
|
|
2918
2957
|
if (o === n) {
|
|
@@ -2926,7 +2965,7 @@ function ao(e, t) {
|
|
|
2926
2965
|
n = n.nextSibling, e.removeChild(o);
|
|
2927
2966
|
}
|
|
2928
2967
|
}
|
|
2929
|
-
function
|
|
2968
|
+
function Sr(e) {
|
|
2930
2969
|
if (!e.assistantDraft)
|
|
2931
2970
|
return [...e.messages];
|
|
2932
2971
|
const t = {
|
|
@@ -2946,7 +2985,7 @@ function fr(e) {
|
|
|
2946
2985
|
if (n === -1)
|
|
2947
2986
|
return [...e.messages, t];
|
|
2948
2987
|
const o = e.messages.findIndex(
|
|
2949
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2988
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && co(r, t) && hn(r)
|
|
2950
2989
|
);
|
|
2951
2990
|
if (o !== -1)
|
|
2952
2991
|
return [
|
|
@@ -2955,7 +2994,7 @@ function fr(e) {
|
|
|
2955
2994
|
...e.messages.slice(o + 1)
|
|
2956
2995
|
];
|
|
2957
2996
|
let i = n + 1;
|
|
2958
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2997
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && co(e.messages[i], t); )
|
|
2959
2998
|
i += 1;
|
|
2960
2999
|
return [
|
|
2961
3000
|
...e.messages.slice(0, i),
|
|
@@ -2963,14 +3002,14 @@ function fr(e) {
|
|
|
2963
3002
|
...e.messages.slice(i)
|
|
2964
3003
|
];
|
|
2965
3004
|
}
|
|
2966
|
-
function
|
|
3005
|
+
function hn(e) {
|
|
2967
3006
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2968
3007
|
}
|
|
2969
|
-
function
|
|
3008
|
+
function co(e, t) {
|
|
2970
3009
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2971
3010
|
}
|
|
2972
|
-
function
|
|
2973
|
-
e.replaceChildren(),
|
|
3011
|
+
function uo(e, t, n, o, i, r, l, p) {
|
|
3012
|
+
e.replaceChildren(), qo(t, !1), t.disabled = !0, n(!1);
|
|
2974
3013
|
const s = document.createElement("div");
|
|
2975
3014
|
s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2976
3015
|
const g = ve(
|
|
@@ -2988,20 +3027,20 @@ function lo(e, t, n, o, i, r, l, p) {
|
|
|
2988
3027
|
}
|
|
2989
3028
|
e.appendChild(s);
|
|
2990
3029
|
}
|
|
2991
|
-
function
|
|
3030
|
+
function Cr(e) {
|
|
2992
3031
|
const t = document.createElement("div");
|
|
2993
3032
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2994
3033
|
for (const n of e)
|
|
2995
|
-
t.appendChild(
|
|
3034
|
+
t.appendChild(cr(n));
|
|
2996
3035
|
return t;
|
|
2997
3036
|
}
|
|
2998
|
-
function
|
|
3037
|
+
function Er(e) {
|
|
2999
3038
|
const t = document.createElement("button");
|
|
3000
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
3039
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(pr()), t.addEventListener("click", (n) => {
|
|
3001
3040
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
3002
3041
|
}), t;
|
|
3003
3042
|
}
|
|
3004
|
-
function
|
|
3043
|
+
function kr(e, t) {
|
|
3005
3044
|
const n = document.createElement("article");
|
|
3006
3045
|
n.className = "pluno-pa-widget__share-prompt";
|
|
3007
3046
|
const o = document.createElement("div");
|
|
@@ -3028,7 +3067,7 @@ function _r(e, t) {
|
|
|
3028
3067
|
const g = document.createElement("button");
|
|
3029
3068
|
if (g.type = "button", g.disabled = t.isDrafting, g.addEventListener("click", () => {
|
|
3030
3069
|
t.onDraft(e);
|
|
3031
|
-
}), t.isDrafting ? (g.appendChild(
|
|
3070
|
+
}), t.isDrafting ? (g.appendChild(mn()), g.appendChild(document.createTextNode("Drafting..."))) : g.textContent = "Draft a social post", s.appendChild(g), t.isDrafting)
|
|
3032
3071
|
p.appendChild(s);
|
|
3033
3072
|
else {
|
|
3034
3073
|
const c = document.createElement("button");
|
|
@@ -3042,7 +3081,7 @@ function _r(e, t) {
|
|
|
3042
3081
|
}
|
|
3043
3082
|
return o.appendChild(p), n.appendChild(o), n;
|
|
3044
3083
|
}
|
|
3045
|
-
function
|
|
3084
|
+
function Lr(e, t) {
|
|
3046
3085
|
const n = document.createElement("div");
|
|
3047
3086
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (u) => {
|
|
3048
3087
|
u.target === n && t.onClose();
|
|
@@ -3061,11 +3100,11 @@ function xr(e, t) {
|
|
|
3061
3100
|
g.className = "pluno-pa-widget__share-dialog-step-header";
|
|
3062
3101
|
const c = document.createElement("strong");
|
|
3063
3102
|
c.textContent = "1) Copy Screenshot", g.appendChild(c);
|
|
3064
|
-
const h =
|
|
3103
|
+
const h = Tr(
|
|
3065
3104
|
"Copy Screenshot",
|
|
3066
3105
|
async () => {
|
|
3067
3106
|
try {
|
|
3068
|
-
return await
|
|
3107
|
+
return await Ci(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
3069
3108
|
} catch {
|
|
3070
3109
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
3071
3110
|
}
|
|
@@ -3078,35 +3117,35 @@ function xr(e, t) {
|
|
|
3078
3117
|
v.src = e.screenshotDataUrl, v.alt = "Product page with Pluno open", u.appendChild(v), s.appendChild(u);
|
|
3079
3118
|
}
|
|
3080
3119
|
o.appendChild(s), o.appendChild(p);
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3120
|
+
const S = document.createElement("div");
|
|
3121
|
+
S.className = "pluno-pa-widget__share-dialog-step";
|
|
3083
3122
|
const P = document.createElement("strong");
|
|
3084
|
-
P.className = "pluno-pa-widget__share-dialog-step-title", P.textContent = "2) Share on",
|
|
3123
|
+
P.className = "pluno-pa-widget__share-dialog-step-title", P.textContent = "2) Share on", S.appendChild(P);
|
|
3085
3124
|
const I = document.createElement("p");
|
|
3086
|
-
I.className = "pluno-pa-widget__share-dialog-hint", I.textContent = "Post draft opens prefilled on supported platforms.",
|
|
3125
|
+
I.className = "pluno-pa-widget__share-dialog-hint", I.textContent = "Post draft opens prefilled on supported platforms.", S.appendChild(I);
|
|
3087
3126
|
const D = document.createElement("footer");
|
|
3088
3127
|
D.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3089
|
-
for (const u of
|
|
3128
|
+
for (const u of Pr(e)) {
|
|
3090
3129
|
const v = document.createElement("a");
|
|
3091
|
-
v.href = u.href, v.target = "_blank", v.rel = "noopener noreferrer", v.title = u.label, v.setAttribute("aria-label", `Open ${u.label}`), v.appendChild(
|
|
3130
|
+
v.href = u.href, v.target = "_blank", v.rel = "noopener noreferrer", v.title = u.label, v.setAttribute("aria-label", `Open ${u.label}`), v.appendChild(Ir(u.id)), D.appendChild(v);
|
|
3092
3131
|
}
|
|
3093
|
-
if (
|
|
3132
|
+
if (S.appendChild(D), o.appendChild(S), t.socialPostRewardsUrl) {
|
|
3094
3133
|
const u = document.createElement("div");
|
|
3095
3134
|
u.className = "pluno-pa-widget__share-dialog-step";
|
|
3096
3135
|
const v = document.createElement("strong");
|
|
3097
3136
|
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "3) Submit post to get 2000 free credits!", u.appendChild(v);
|
|
3098
3137
|
const m = document.createElement("a");
|
|
3099
|
-
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(
|
|
3138
|
+
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Ar()), u.appendChild(m), o.appendChild(u);
|
|
3100
3139
|
}
|
|
3101
3140
|
return n.appendChild(o), n;
|
|
3102
3141
|
}
|
|
3103
|
-
function
|
|
3142
|
+
function Tr(e, t) {
|
|
3104
3143
|
const n = document.createElement("button");
|
|
3105
3144
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
3106
3145
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
3107
3146
|
}), n;
|
|
3108
3147
|
}
|
|
3109
|
-
function
|
|
3148
|
+
function Pr(e) {
|
|
3110
3149
|
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
3111
3150
|
return [
|
|
3112
3151
|
{
|
|
@@ -3126,47 +3165,47 @@ function vr(e) {
|
|
|
3126
3165
|
}
|
|
3127
3166
|
];
|
|
3128
3167
|
}
|
|
3129
|
-
function
|
|
3168
|
+
function Ir(e) {
|
|
3130
3169
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3131
|
-
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" ? (
|
|
3170
|
+
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" ? ($(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), $(
|
|
3132
3171
|
t,
|
|
3133
3172
|
"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"
|
|
3134
|
-
),
|
|
3173
|
+
), $(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), $(
|
|
3135
3174
|
t,
|
|
3136
3175
|
"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"
|
|
3137
|
-
),
|
|
3176
|
+
), $(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? ($(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), $(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), $(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : ($(
|
|
3138
3177
|
t,
|
|
3139
3178
|
"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"
|
|
3140
|
-
),
|
|
3179
|
+
), $(
|
|
3141
3180
|
t,
|
|
3142
3181
|
"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",
|
|
3143
3182
|
"0.48"
|
|
3144
|
-
),
|
|
3183
|
+
), $(
|
|
3145
3184
|
t,
|
|
3146
3185
|
"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"
|
|
3147
|
-
),
|
|
3186
|
+
), $(
|
|
3148
3187
|
t,
|
|
3149
3188
|
"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"
|
|
3150
3189
|
), t);
|
|
3151
3190
|
}
|
|
3152
|
-
function
|
|
3191
|
+
function $(e, t, n) {
|
|
3153
3192
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3154
3193
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3155
3194
|
}
|
|
3156
|
-
function
|
|
3195
|
+
function Ar() {
|
|
3157
3196
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3158
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3197
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), $(e, "M14 5h5v5"), $(e, "M19 5l-8 8"), $(
|
|
3159
3198
|
e,
|
|
3160
3199
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3161
3200
|
), e;
|
|
3162
3201
|
}
|
|
3163
|
-
function
|
|
3164
|
-
return e.role === "tool" && e.toolName ===
|
|
3202
|
+
function Go(e) {
|
|
3203
|
+
return e.role === "tool" && e.toolName === vo;
|
|
3165
3204
|
}
|
|
3166
|
-
function
|
|
3205
|
+
function go(e) {
|
|
3167
3206
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3168
3207
|
}
|
|
3169
|
-
function
|
|
3208
|
+
function Nr(e, t, n, o) {
|
|
3170
3209
|
const i = document.createElement("article");
|
|
3171
3210
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3172
3211
|
e[e.length - 1].createdAt
|
|
@@ -3176,27 +3215,27 @@ function Er(e, t, n, o) {
|
|
|
3176
3215
|
o
|
|
3177
3216
|
)
|
|
3178
3217
|
);
|
|
3179
|
-
const r = document.createElement("details"), l =
|
|
3218
|
+
const r = document.createElement("details"), l = Rr(e);
|
|
3180
3219
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3181
3220
|
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3182
3221
|
});
|
|
3183
3222
|
const p = document.createElement("summary");
|
|
3184
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(
|
|
3223
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(mn());
|
|
3185
3224
|
const g = document.createElement("span");
|
|
3186
3225
|
if (g.className = "pluno-pa-widget__tool-summary-title", g.textContent = e[e.length - 1].content || "Run tool", p.appendChild(g), r.appendChild(p), e.length > 0) {
|
|
3187
3226
|
const c = document.createElement("div");
|
|
3188
3227
|
c.className = "pluno-pa-widget__tool-lines";
|
|
3189
3228
|
for (const h of e) {
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3229
|
+
const S = document.createElement("div");
|
|
3230
|
+
S.className = "pluno-pa-widget__tool-line", h.loading && S.appendChild(mn());
|
|
3192
3231
|
const P = document.createElement("span");
|
|
3193
|
-
P.textContent = h.content || "Run tool",
|
|
3232
|
+
P.textContent = h.content || "Run tool", S.appendChild(P), c.appendChild(S);
|
|
3194
3233
|
}
|
|
3195
3234
|
r.appendChild(c);
|
|
3196
3235
|
}
|
|
3197
3236
|
return i.appendChild(r), i;
|
|
3198
3237
|
}
|
|
3199
|
-
function
|
|
3238
|
+
function $o(e) {
|
|
3200
3239
|
const t = document.createElement("article");
|
|
3201
3240
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3202
3241
|
ve(
|
|
@@ -3205,11 +3244,11 @@ function Fo(e) {
|
|
|
3205
3244
|
)
|
|
3206
3245
|
), t;
|
|
3207
3246
|
}
|
|
3208
|
-
function
|
|
3209
|
-
const t =
|
|
3210
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3247
|
+
function ho(e) {
|
|
3248
|
+
const t = $o(e);
|
|
3249
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(St()), t;
|
|
3211
3250
|
}
|
|
3212
|
-
function
|
|
3251
|
+
function St(e = "Thinking...") {
|
|
3213
3252
|
const t = document.createElement("div");
|
|
3214
3253
|
t.className = "pluno-pa-widget__status";
|
|
3215
3254
|
const n = document.createElement("span");
|
|
@@ -3217,18 +3256,18 @@ function _t(e = "Thinking...") {
|
|
|
3217
3256
|
const o = document.createElement("span");
|
|
3218
3257
|
return o.textContent = e, t.appendChild(o), t;
|
|
3219
3258
|
}
|
|
3220
|
-
function
|
|
3259
|
+
function Rr(e) {
|
|
3221
3260
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3222
3261
|
}
|
|
3223
|
-
function
|
|
3262
|
+
function mn() {
|
|
3224
3263
|
const e = document.createElement("span");
|
|
3225
3264
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3226
3265
|
}
|
|
3227
|
-
function
|
|
3228
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3266
|
+
function qo(e, t) {
|
|
3267
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? rr() : Bo());
|
|
3229
3268
|
}
|
|
3230
|
-
function
|
|
3231
|
-
const n =
|
|
3269
|
+
function Dr(e, t) {
|
|
3270
|
+
const n = Bi(t).replace(/\r\n/g, `
|
|
3232
3271
|
`).split(`
|
|
3233
3272
|
`);
|
|
3234
3273
|
let o = 0;
|
|
@@ -3243,22 +3282,22 @@ function Lr(e, t) {
|
|
|
3243
3282
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3244
3283
|
c.push(n[o]), o += 1;
|
|
3245
3284
|
o += o < n.length ? 1 : 0;
|
|
3246
|
-
const h = document.createElement("pre"),
|
|
3247
|
-
|
|
3248
|
-
`), h.appendChild(
|
|
3285
|
+
const h = document.createElement("pre"), S = document.createElement("code");
|
|
3286
|
+
S.textContent = c.join(`
|
|
3287
|
+
`), h.appendChild(S), e.appendChild(h);
|
|
3249
3288
|
continue;
|
|
3250
3289
|
}
|
|
3251
3290
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3252
3291
|
if (l) {
|
|
3253
3292
|
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3254
|
-
|
|
3293
|
+
wt(c, l[2]), e.appendChild(c), o += 1;
|
|
3255
3294
|
continue;
|
|
3256
3295
|
}
|
|
3257
3296
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3258
3297
|
const c = document.createElement("ul");
|
|
3259
3298
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3260
3299
|
const h = document.createElement("li");
|
|
3261
|
-
|
|
3300
|
+
wt(h, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(h), o += 1;
|
|
3262
3301
|
}
|
|
3263
3302
|
e.appendChild(c);
|
|
3264
3303
|
continue;
|
|
@@ -3268,7 +3307,7 @@ function Lr(e, t) {
|
|
|
3268
3307
|
const c = document.createElement("ol");
|
|
3269
3308
|
for (c.start = Number(p[1]); o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3270
3309
|
const h = document.createElement("li");
|
|
3271
|
-
|
|
3310
|
+
wt(h, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(h), o += 1;
|
|
3272
3311
|
}
|
|
3273
3312
|
e.appendChild(c);
|
|
3274
3313
|
continue;
|
|
@@ -3278,11 +3317,11 @@ function Lr(e, t) {
|
|
|
3278
3317
|
s.push(n[o]), o += 1;
|
|
3279
3318
|
const g = document.createElement("p");
|
|
3280
3319
|
s.forEach((c, h) => {
|
|
3281
|
-
h > 0 && g.appendChild(document.createElement("br")),
|
|
3320
|
+
h > 0 && g.appendChild(document.createElement("br")), wt(g, c);
|
|
3282
3321
|
}), e.appendChild(g);
|
|
3283
3322
|
}
|
|
3284
3323
|
}
|
|
3285
|
-
function
|
|
3324
|
+
function wt(e, t) {
|
|
3286
3325
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3287
3326
|
let o = 0;
|
|
3288
3327
|
for (const i of t.matchAll(n)) {
|
|
@@ -3302,7 +3341,7 @@ function gt(e, t) {
|
|
|
3302
3341
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3303
3342
|
} else {
|
|
3304
3343
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3305
|
-
if (p &&
|
|
3344
|
+
if (p && zr(p[2])) {
|
|
3306
3345
|
const s = document.createElement("a");
|
|
3307
3346
|
s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
|
|
3308
3347
|
} else
|
|
@@ -3312,7 +3351,7 @@ function gt(e, t) {
|
|
|
3312
3351
|
}
|
|
3313
3352
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3314
3353
|
}
|
|
3315
|
-
function
|
|
3354
|
+
function zr(e) {
|
|
3316
3355
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3317
3356
|
return !0;
|
|
3318
3357
|
try {
|
|
@@ -3322,8 +3361,8 @@ function Tr(e) {
|
|
|
3322
3361
|
return !1;
|
|
3323
3362
|
}
|
|
3324
3363
|
}
|
|
3325
|
-
function
|
|
3326
|
-
if (
|
|
3364
|
+
function mo(e, t) {
|
|
3365
|
+
if (Mr(e))
|
|
3327
3366
|
return;
|
|
3328
3367
|
const n = `
|
|
3329
3368
|
:host {
|
|
@@ -5312,8 +5351,8 @@ function co(e, t) {
|
|
|
5312
5351
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5313
5352
|
position: absolute;
|
|
5314
5353
|
top: -16px;
|
|
5315
|
-
left: ${
|
|
5316
|
-
width: calc(100% - ${
|
|
5354
|
+
left: ${sn}px;
|
|
5355
|
+
width: calc(100% - ${sn * 2}px);
|
|
5317
5356
|
height: 36px;
|
|
5318
5357
|
z-index: 3;
|
|
5319
5358
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5663,28 +5702,28 @@ function co(e, t) {
|
|
|
5663
5702
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5664
5703
|
}
|
|
5665
5704
|
`;
|
|
5666
|
-
if (
|
|
5705
|
+
if (Or(e, n))
|
|
5667
5706
|
return;
|
|
5668
5707
|
const o = e.ownerDocument.createElement("style");
|
|
5669
|
-
o.id =
|
|
5708
|
+
o.id = Ao, o.textContent = n, e.appendChild(o), jo(e);
|
|
5670
5709
|
}
|
|
5671
|
-
function
|
|
5672
|
-
return e.getElementById(
|
|
5710
|
+
function Mr(e) {
|
|
5711
|
+
return e.getElementById(Ao) !== null || e.host instanceof HTMLElement && e.host.getAttribute(No) === "true";
|
|
5673
5712
|
}
|
|
5674
|
-
function
|
|
5675
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5713
|
+
function jo(e) {
|
|
5714
|
+
e.host instanceof HTMLElement && e.host.setAttribute(No, "true");
|
|
5676
5715
|
}
|
|
5677
|
-
function
|
|
5716
|
+
function Or(e, t) {
|
|
5678
5717
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5679
5718
|
return !1;
|
|
5680
5719
|
try {
|
|
5681
5720
|
const n = new CSSStyleSheet();
|
|
5682
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
5721
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], jo(e), !0;
|
|
5683
5722
|
} catch {
|
|
5684
5723
|
return !1;
|
|
5685
5724
|
}
|
|
5686
5725
|
}
|
|
5687
|
-
async function
|
|
5726
|
+
async function Ur() {
|
|
5688
5727
|
return document.body ? document.body : await new Promise((e) => {
|
|
5689
5728
|
const t = new MutationObserver(() => {
|
|
5690
5729
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5692,25 +5731,25 @@ async function Ar() {
|
|
|
5692
5731
|
t.observe(document.documentElement, { childList: !0 });
|
|
5693
5732
|
});
|
|
5694
5733
|
}
|
|
5695
|
-
function
|
|
5734
|
+
function xn(e) {
|
|
5696
5735
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5697
5736
|
}
|
|
5698
|
-
function
|
|
5699
|
-
return `${
|
|
5737
|
+
function Vo(e) {
|
|
5738
|
+
return `${xn(e)}.displayState`;
|
|
5700
5739
|
}
|
|
5701
|
-
function
|
|
5740
|
+
function Br(e) {
|
|
5702
5741
|
try {
|
|
5703
5742
|
return window.sessionStorage.getItem(
|
|
5704
|
-
|
|
5743
|
+
Vo(e)
|
|
5705
5744
|
) === "minimized" ? "minimized" : "shown";
|
|
5706
5745
|
} catch {
|
|
5707
5746
|
return "shown";
|
|
5708
5747
|
}
|
|
5709
5748
|
}
|
|
5710
|
-
function
|
|
5749
|
+
function fo(e, t) {
|
|
5711
5750
|
if (e.layout === "floating")
|
|
5712
5751
|
try {
|
|
5713
|
-
const n =
|
|
5752
|
+
const n = Vo(e);
|
|
5714
5753
|
if (t === "minimized") {
|
|
5715
5754
|
window.sessionStorage.setItem(n, t);
|
|
5716
5755
|
return;
|
|
@@ -5720,15 +5759,15 @@ function uo(e, t) {
|
|
|
5720
5759
|
return;
|
|
5721
5760
|
}
|
|
5722
5761
|
}
|
|
5723
|
-
function
|
|
5762
|
+
function Fr(e) {
|
|
5724
5763
|
if (e)
|
|
5725
5764
|
return { clientId: e, release: () => {
|
|
5726
5765
|
} };
|
|
5727
5766
|
let t = 0;
|
|
5728
|
-
for (;
|
|
5767
|
+
for (; Vt.has(t); )
|
|
5729
5768
|
t += 1;
|
|
5730
|
-
|
|
5731
|
-
const n = `${
|
|
5769
|
+
Vt.add(t);
|
|
5770
|
+
const n = `${ea}${t}`;
|
|
5732
5771
|
let o = crypto.randomUUID();
|
|
5733
5772
|
try {
|
|
5734
5773
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -5738,15 +5777,15 @@ function Rr(e) {
|
|
|
5738
5777
|
return {
|
|
5739
5778
|
clientId: o,
|
|
5740
5779
|
release: () => {
|
|
5741
|
-
i || (i = !0,
|
|
5780
|
+
i || (i = !0, Vt.delete(t));
|
|
5742
5781
|
}
|
|
5743
5782
|
};
|
|
5744
5783
|
}
|
|
5745
|
-
function
|
|
5784
|
+
function Wr(e) {
|
|
5746
5785
|
try {
|
|
5747
|
-
const t = window.localStorage.getItem(
|
|
5786
|
+
const t = window.localStorage.getItem(xn(e));
|
|
5748
5787
|
if (!t)
|
|
5749
|
-
return
|
|
5788
|
+
return wo();
|
|
5750
5789
|
const n = JSON.parse(t);
|
|
5751
5790
|
return {
|
|
5752
5791
|
isOpen: n.isOpen === !0,
|
|
@@ -5756,25 +5795,25 @@ function Dr(e) {
|
|
|
5756
5795
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5757
5796
|
(o) => typeof o == "string"
|
|
5758
5797
|
) : [],
|
|
5759
|
-
launcherPosition:
|
|
5760
|
-
panelSize:
|
|
5761
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
5798
|
+
launcherPosition: qr(n.launcherPosition) ? n.launcherPosition : null,
|
|
5799
|
+
panelSize: jr(n.panelSize) ? Ct(n.panelSize) : null,
|
|
5800
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-So) : [],
|
|
5762
5801
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5763
5802
|
};
|
|
5764
5803
|
} catch {
|
|
5765
|
-
return
|
|
5804
|
+
return wo();
|
|
5766
5805
|
}
|
|
5767
5806
|
}
|
|
5768
|
-
async function
|
|
5807
|
+
async function Hr(e) {
|
|
5769
5808
|
if (e.loadSharePromptsDisabled)
|
|
5770
5809
|
return e.loadSharePromptsDisabled();
|
|
5771
5810
|
try {
|
|
5772
|
-
return window.localStorage.getItem(
|
|
5811
|
+
return window.localStorage.getItem(Eo) === "true";
|
|
5773
5812
|
} catch {
|
|
5774
5813
|
return !1;
|
|
5775
5814
|
}
|
|
5776
5815
|
}
|
|
5777
|
-
function
|
|
5816
|
+
function Gr(e, t) {
|
|
5778
5817
|
if (e.persistSharePromptsDisabled) {
|
|
5779
5818
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5780
5819
|
() => {
|
|
@@ -5783,12 +5822,12 @@ function Mr(e, t) {
|
|
|
5783
5822
|
return;
|
|
5784
5823
|
}
|
|
5785
5824
|
try {
|
|
5786
|
-
t && window.localStorage.setItem(
|
|
5825
|
+
t && window.localStorage.setItem(Eo, "true");
|
|
5787
5826
|
} catch {
|
|
5788
5827
|
return;
|
|
5789
5828
|
}
|
|
5790
5829
|
}
|
|
5791
|
-
function
|
|
5830
|
+
function wo() {
|
|
5792
5831
|
return {
|
|
5793
5832
|
isOpen: !1,
|
|
5794
5833
|
composerValue: "",
|
|
@@ -5801,29 +5840,29 @@ function go() {
|
|
|
5801
5840
|
sharePromptsDisabled: !1
|
|
5802
5841
|
};
|
|
5803
5842
|
}
|
|
5804
|
-
function
|
|
5843
|
+
function $r(e, t) {
|
|
5805
5844
|
try {
|
|
5806
5845
|
window.localStorage.setItem(
|
|
5807
|
-
|
|
5846
|
+
xn(e),
|
|
5808
5847
|
JSON.stringify(t)
|
|
5809
5848
|
);
|
|
5810
5849
|
} catch {
|
|
5811
5850
|
return;
|
|
5812
5851
|
}
|
|
5813
5852
|
}
|
|
5814
|
-
function
|
|
5853
|
+
function qr(e) {
|
|
5815
5854
|
if (!e || typeof e != "object")
|
|
5816
5855
|
return !1;
|
|
5817
5856
|
const t = e;
|
|
5818
5857
|
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");
|
|
5819
5858
|
}
|
|
5820
|
-
function
|
|
5859
|
+
function jr(e) {
|
|
5821
5860
|
if (!e || typeof e != "object")
|
|
5822
5861
|
return !1;
|
|
5823
5862
|
const t = e;
|
|
5824
5863
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5825
5864
|
}
|
|
5826
|
-
async function
|
|
5865
|
+
async function Ko(e, t) {
|
|
5827
5866
|
const n = await fetch(e, {
|
|
5828
5867
|
method: "POST",
|
|
5829
5868
|
credentials: "include",
|
|
@@ -5835,7 +5874,7 @@ async function Go(e, t) {
|
|
|
5835
5874
|
...t ? { signal: t } : {}
|
|
5836
5875
|
});
|
|
5837
5876
|
if (!n.ok) {
|
|
5838
|
-
const i = await n.text(), r =
|
|
5877
|
+
const i = await n.text(), r = fi(i);
|
|
5839
5878
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
5840
5879
|
}
|
|
5841
5880
|
const o = await n.json();
|
|
@@ -5843,15 +5882,15 @@ async function Go(e, t) {
|
|
|
5843
5882
|
throw new Error("Pluno token endpoint did not return a token");
|
|
5844
5883
|
return o.token;
|
|
5845
5884
|
}
|
|
5846
|
-
function
|
|
5885
|
+
function Vr(e) {
|
|
5847
5886
|
let t = !1, n = !1;
|
|
5848
5887
|
const o = async () => {
|
|
5849
5888
|
const i = new AbortController();
|
|
5850
5889
|
let r = !1;
|
|
5851
5890
|
const l = new Promise((p, s) => {
|
|
5852
5891
|
const g = window.setTimeout(() => {
|
|
5853
|
-
r = !0, i.abort(), s(new Error(
|
|
5854
|
-
},
|
|
5892
|
+
r = !0, i.abort(), s(new Error($n));
|
|
5893
|
+
}, Ji);
|
|
5855
5894
|
i.signal.addEventListener(
|
|
5856
5895
|
"abort",
|
|
5857
5896
|
() => window.clearTimeout(g),
|
|
@@ -5860,12 +5899,12 @@ function Fr(e) {
|
|
|
5860
5899
|
});
|
|
5861
5900
|
try {
|
|
5862
5901
|
const p = await Promise.race([
|
|
5863
|
-
|
|
5902
|
+
Ko(e, i.signal),
|
|
5864
5903
|
l
|
|
5865
5904
|
]);
|
|
5866
5905
|
return i.abort(), p;
|
|
5867
5906
|
} catch (p) {
|
|
5868
|
-
throw i.abort(), r ? new Error(
|
|
5907
|
+
throw i.abort(), r ? new Error($n) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(Qi);
|
|
5869
5908
|
}
|
|
5870
5909
|
};
|
|
5871
5910
|
return {
|
|
@@ -5888,30 +5927,30 @@ function Fr(e) {
|
|
|
5888
5927
|
}
|
|
5889
5928
|
};
|
|
5890
5929
|
}
|
|
5891
|
-
const
|
|
5892
|
-
function
|
|
5930
|
+
const bo = /* @__PURE__ */ new WeakSet();
|
|
5931
|
+
function Kr(e) {
|
|
5893
5932
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5894
5933
|
}
|
|
5895
|
-
function
|
|
5934
|
+
function _o(e) {
|
|
5896
5935
|
const t = e.pathname.split("/");
|
|
5897
5936
|
return t[t.length - 1] ?? "";
|
|
5898
5937
|
}
|
|
5899
|
-
function
|
|
5938
|
+
function Yr(e, t) {
|
|
5900
5939
|
const n = new URL(e.src, document.baseURI);
|
|
5901
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5940
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : _o(n) === _o(t);
|
|
5902
5941
|
}
|
|
5903
5942
|
class fe extends EventTarget {
|
|
5904
5943
|
constructor(t, n) {
|
|
5905
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
5944
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(Vi, () => {
|
|
5906
5945
|
this.readyState = fe.OPEN, this.dispatchEvent(new Event("open"));
|
|
5907
|
-
}), this.addPreviewListener(
|
|
5946
|
+
}), this.addPreviewListener(Ki, (o) => {
|
|
5908
5947
|
const i = o;
|
|
5909
5948
|
this.dispatchEvent(
|
|
5910
5949
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5911
5950
|
);
|
|
5912
|
-
}), this.addPreviewListener(
|
|
5951
|
+
}), this.addPreviewListener(Yi, () => {
|
|
5913
5952
|
this.readyState = fe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5914
|
-
}), this.addPreviewListener(
|
|
5953
|
+
}), this.addPreviewListener(Xi, (o) => {
|
|
5915
5954
|
const i = o;
|
|
5916
5955
|
this.readyState = fe.CLOSED, this.dispatchEvent(
|
|
5917
5956
|
new CloseEvent("close", {
|
|
@@ -5922,8 +5961,8 @@ class fe extends EventTarget {
|
|
|
5922
5961
|
), this.cleanup();
|
|
5923
5962
|
}), window.dispatchEvent(
|
|
5924
5963
|
new CustomEvent(
|
|
5925
|
-
|
|
5926
|
-
|
|
5964
|
+
bt(
|
|
5965
|
+
$i,
|
|
5927
5966
|
this.channelId
|
|
5928
5967
|
),
|
|
5929
5968
|
{
|
|
@@ -5943,7 +5982,7 @@ class fe extends EventTarget {
|
|
|
5943
5982
|
binaryType = "blob";
|
|
5944
5983
|
bufferedAmount = 0;
|
|
5945
5984
|
readyState = fe.CONNECTING;
|
|
5946
|
-
socketId =
|
|
5985
|
+
socketId = Xr();
|
|
5947
5986
|
listeners = /* @__PURE__ */ new Map();
|
|
5948
5987
|
send(t) {
|
|
5949
5988
|
if (this.readyState !== fe.OPEN)
|
|
@@ -5953,7 +5992,7 @@ class fe extends EventTarget {
|
|
|
5953
5992
|
);
|
|
5954
5993
|
window.dispatchEvent(
|
|
5955
5994
|
new CustomEvent(
|
|
5956
|
-
|
|
5995
|
+
bt(qi, this.channelId),
|
|
5957
5996
|
{
|
|
5958
5997
|
detail: {
|
|
5959
5998
|
socketId: this.socketId,
|
|
@@ -5966,7 +6005,7 @@ class fe extends EventTarget {
|
|
|
5966
6005
|
close(t, n) {
|
|
5967
6006
|
this.readyState !== fe.CLOSED && (this.readyState = fe.CLOSING, window.dispatchEvent(
|
|
5968
6007
|
new CustomEvent(
|
|
5969
|
-
|
|
6008
|
+
bt(ji, this.channelId),
|
|
5970
6009
|
{
|
|
5971
6010
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5972
6011
|
}
|
|
@@ -5974,7 +6013,7 @@ class fe extends EventTarget {
|
|
|
5974
6013
|
), this.cleanup());
|
|
5975
6014
|
}
|
|
5976
6015
|
addPreviewListener(t, n) {
|
|
5977
|
-
const o =
|
|
6016
|
+
const o = bt(
|
|
5978
6017
|
t,
|
|
5979
6018
|
this.channelId
|
|
5980
6019
|
), i = (r) => {
|
|
@@ -5988,19 +6027,19 @@ class fe extends EventTarget {
|
|
|
5988
6027
|
this.listeners.clear();
|
|
5989
6028
|
}
|
|
5990
6029
|
}
|
|
5991
|
-
function
|
|
6030
|
+
function Xr() {
|
|
5992
6031
|
const e = window.sessionStorage.getItem(
|
|
5993
|
-
|
|
6032
|
+
Gn
|
|
5994
6033
|
);
|
|
5995
6034
|
if (e)
|
|
5996
6035
|
return e;
|
|
5997
6036
|
const t = crypto.randomUUID();
|
|
5998
|
-
return window.sessionStorage.setItem(
|
|
6037
|
+
return window.sessionStorage.setItem(Gn, t), t;
|
|
5999
6038
|
}
|
|
6000
|
-
function
|
|
6039
|
+
function bt(e, t) {
|
|
6001
6040
|
return `${e}:${t}`;
|
|
6002
6041
|
}
|
|
6003
|
-
function
|
|
6042
|
+
function Zr(e) {
|
|
6004
6043
|
const t = document.currentScript;
|
|
6005
6044
|
if (t instanceof HTMLScriptElement)
|
|
6006
6045
|
return [t];
|
|
@@ -6008,35 +6047,35 @@ function Gr(e) {
|
|
|
6008
6047
|
return Array.from(
|
|
6009
6048
|
document.querySelectorAll("script[type='module'][src]")
|
|
6010
6049
|
).filter(
|
|
6011
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
6050
|
+
(i) => i instanceof HTMLScriptElement && Kr(i) && Yr(i, o)
|
|
6012
6051
|
);
|
|
6013
6052
|
}
|
|
6014
|
-
function
|
|
6015
|
-
for (const t of
|
|
6016
|
-
|
|
6053
|
+
function Jr(e) {
|
|
6054
|
+
for (const t of Zr(e))
|
|
6055
|
+
bo.has(t) || t.dataset.plunoAutoMount === "false" || (bo.add(t), Yo(t).catch((n) => {
|
|
6017
6056
|
console.error("Failed to mount Pluno widget", n);
|
|
6018
6057
|
}));
|
|
6019
6058
|
}
|
|
6020
|
-
function
|
|
6059
|
+
function Yo(e) {
|
|
6021
6060
|
const t = window, n = t[me];
|
|
6022
6061
|
if (n) {
|
|
6023
6062
|
if (n.host === null)
|
|
6024
6063
|
return n.mountPromise.catch(() => {
|
|
6025
6064
|
const s = t[me];
|
|
6026
|
-
return s ? s.mountPromise :
|
|
6065
|
+
return s ? s.mountPromise : Yo(e);
|
|
6027
6066
|
});
|
|
6028
|
-
if (
|
|
6067
|
+
if (Qr(n.host))
|
|
6029
6068
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6030
6069
|
n.destroy?.(), delete t[me];
|
|
6031
6070
|
}
|
|
6032
|
-
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ?
|
|
6071
|
+
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Vr(i) : null;
|
|
6033
6072
|
let l;
|
|
6034
|
-
const p =
|
|
6073
|
+
const p = xa({
|
|
6035
6074
|
token: e.dataset.plunoToken,
|
|
6036
6075
|
tokenProvider: r?.loadToken,
|
|
6037
6076
|
tokenEndpoint: i,
|
|
6038
6077
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
6039
|
-
webSocketFactory: o ?
|
|
6078
|
+
webSocketFactory: o ? _a(o) : void 0,
|
|
6040
6079
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
6041
6080
|
accentColor: e.dataset.plunoAccentColor,
|
|
6042
6081
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -6049,7 +6088,7 @@ function qo(e) {
|
|
|
6049
6088
|
return;
|
|
6050
6089
|
}
|
|
6051
6090
|
const g = s.host;
|
|
6052
|
-
g.setAttribute(
|
|
6091
|
+
g.setAttribute(Co, "true"), l.host = g, l.destroy = () => {
|
|
6053
6092
|
t[me] === l && delete t[me], l.host = null, l.destroy = null, s.destroy();
|
|
6054
6093
|
};
|
|
6055
6094
|
}).catch((s) => {
|
|
@@ -6062,11 +6101,11 @@ function qo(e) {
|
|
|
6062
6101
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6063
6102
|
}, t[me] = l, p;
|
|
6064
6103
|
}
|
|
6065
|
-
function
|
|
6066
|
-
return e.isConnected && e.getAttribute(
|
|
6104
|
+
function Qr(e) {
|
|
6105
|
+
return e.isConnected && e.getAttribute(Co) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
6067
6106
|
}
|
|
6068
|
-
|
|
6107
|
+
Jr(import.meta.url);
|
|
6069
6108
|
export {
|
|
6070
|
-
|
|
6071
|
-
|
|
6109
|
+
_a as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6110
|
+
xa as mountPlunoProductAgentWidget
|
|
6072
6111
|
};
|