@pluno/product-agent-web 0.1.118 → 0.1.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-widget.js +881 -776
- package/dist/widget.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { PlunoProductAgent as zi, getProductAgentOriginAccessErrorMessage as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
1
|
+
import { PlunoProductAgent as zi, getProductAgentOriginAccessErrorMessage as Mi } from "./product-agent-sdk.js";
|
|
2
|
+
const Di = "#7c3aed", zt = "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", Mt = "#2c2a1e", no = [253, 250, 241], oo = 3.5;
|
|
3
|
+
function Uo(e) {
|
|
4
|
+
const t = Bo(e);
|
|
5
5
|
if (io(mt(t), no) >= oo)
|
|
6
6
|
return t;
|
|
7
7
|
let i = mt(t);
|
|
8
|
-
const o = mt(
|
|
8
|
+
const o = mt(Mt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (i =
|
|
10
|
+
if (i = Bi(i, o, 0.22), io(i, no) >= oo)
|
|
11
11
|
return xn(i);
|
|
12
12
|
return xn(i);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Oi() {
|
|
15
15
|
let n = "M 280 120", i = !1, o = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
|
-
const l = (o % 3 - 1) * 18,
|
|
18
|
-
n += ` L ${
|
|
17
|
+
const l = (o % 3 - 1) * 18, p = i ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${p} ${r}`, i = !i, o += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function Ui(e) {
|
|
23
|
+
const t = Bo(e), n = yn(mt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,9 +56,9 @@ function Bi(e) {
|
|
|
56
56
|
shadow: de(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Bo(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()}` : Di;
|
|
62
62
|
}
|
|
63
63
|
function mt(e) {
|
|
64
64
|
return [
|
|
@@ -82,7 +82,7 @@ function io(e, t) {
|
|
|
82
82
|
const n = yn(e), i = yn(t), [o, r] = n > i ? [n, i] : [i, n];
|
|
83
83
|
return (o + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Bi(e, t, n) {
|
|
86
86
|
const i = vn(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * i,
|
|
@@ -91,38 +91,38 @@ function Fi(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function de(e, t, n) {
|
|
94
|
-
const [i, o, r] =
|
|
95
|
-
return xn(
|
|
94
|
+
const [i, o, r] = Fi(mt(e));
|
|
95
|
+
return xn(Wi(i, vn(o + n), vn(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r),
|
|
99
|
-
if (l ===
|
|
97
|
+
function Fi([e, t, n]) {
|
|
98
|
+
const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), p = Math.min(i, o, r), d = (l + p) / 2;
|
|
99
|
+
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
|
-
const c = l -
|
|
101
|
+
const c = l - p, g = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
102
|
return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g, d];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Wi(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const i = n < 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - i;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
pn(o, i, e + 1 / 3) * 255,
|
|
110
|
+
pn(o, i, e) * 255,
|
|
111
|
+
pn(o, i, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function pn(e, t, n) {
|
|
115
115
|
let i = n;
|
|
116
116
|
return i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? e + (t - e) * 6 * i : i < 1 / 2 ? t : i < 2 / 3 ? e + (t - e) * (2 / 3 - i) * 6 : e;
|
|
117
117
|
}
|
|
118
118
|
function vn(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Fo = "suggest_share_on_socials";
|
|
122
|
+
function Hi(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 !== Fo)
|
|
126
126
|
continue;
|
|
127
127
|
const i = ao(e, t, "assistant");
|
|
128
128
|
if (!i)
|
|
@@ -150,15 +150,15 @@ function ao(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
function
|
|
153
|
+
const Gi = "https://app.pluno.ai", qi = "/api/product-agent/embed/active-users", ji = 1800, Vi = 15e3, Ki = 250, Yi = 1e3, Xi = 3e4;
|
|
154
|
+
function Zi(e, t = {}) {
|
|
155
155
|
let n = !1, i = null, o = null, r = null;
|
|
156
156
|
const l = () => {
|
|
157
157
|
r !== null && (window.clearInterval(r), r = null);
|
|
158
|
-
},
|
|
158
|
+
}, p = (g) => {
|
|
159
159
|
n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
|
|
160
160
|
c();
|
|
161
|
-
},
|
|
161
|
+
}, ea(g)));
|
|
162
162
|
}, d = (g) => {
|
|
163
163
|
if (l(), i === null) {
|
|
164
164
|
i = g, e(g);
|
|
@@ -170,27 +170,27 @@ function Ji(e, t = {}) {
|
|
|
170
170
|
l();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
const y = Math.min(1, (performance.now() - f) /
|
|
174
|
-
i = Math.round(h + (g - h) *
|
|
175
|
-
},
|
|
173
|
+
const y = Math.min(1, (performance.now() - f) / ji);
|
|
174
|
+
i = Math.round(h + (g - h) * ta(y)), e(i), y >= 1 && (i = g, e(g), l());
|
|
175
|
+
}, Ki);
|
|
176
176
|
}, c = async () => {
|
|
177
177
|
try {
|
|
178
|
-
const g = await
|
|
178
|
+
const g = await Ji(t);
|
|
179
179
|
if (n)
|
|
180
180
|
return;
|
|
181
|
-
d(g.count),
|
|
181
|
+
d(g.count), p(g.refreshAfterMs);
|
|
182
182
|
} catch {
|
|
183
|
-
|
|
183
|
+
p(Vi);
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
186
|
return c(), () => {
|
|
187
187
|
n = !0, o !== null && window.clearTimeout(o), l();
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
async function
|
|
190
|
+
async function Ji(e) {
|
|
191
191
|
if (e.loader)
|
|
192
192
|
return e.loader();
|
|
193
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
193
|
+
const n = await (e.fetcher ?? fetch)(new URL(qi, Qi(e.backendUrl ?? Gi)).toString(), {
|
|
194
194
|
cache: "no-store",
|
|
195
195
|
credentials: "omit"
|
|
196
196
|
});
|
|
@@ -204,16 +204,16 @@ async function Qi(e) {
|
|
|
204
204
|
function ro(e) {
|
|
205
205
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Qi(e) {
|
|
208
208
|
return e.endsWith("/") ? e : `${e}/`;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
return Math.min(
|
|
210
|
+
function ea(e) {
|
|
211
|
+
return Math.min(Xi, Math.max(Yi, e));
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function ta(e) {
|
|
214
214
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const na = [
|
|
217
217
|
"a[href]",
|
|
218
218
|
"button",
|
|
219
219
|
"input",
|
|
@@ -237,26 +237,26 @@ const oa = [
|
|
|
237
237
|
".pluno-pa-widget__message",
|
|
238
238
|
".timeline-item"
|
|
239
239
|
].join(",");
|
|
240
|
-
function
|
|
241
|
-
return e instanceof Element ?
|
|
240
|
+
function oa(e, t, n) {
|
|
241
|
+
return e instanceof Element ? ia(
|
|
242
242
|
t,
|
|
243
243
|
n,
|
|
244
|
-
e.closest(
|
|
244
|
+
e.closest(na) !== null
|
|
245
245
|
) : !1;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ia(e, t, n) {
|
|
248
248
|
return e === 1 && !t && !n;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function aa(e, t, n) {
|
|
251
251
|
return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function ra(e, t = !0) {
|
|
254
254
|
if (!e || !t || !e.isConnected || e.disabled || e.readOnly)
|
|
255
255
|
return !1;
|
|
256
256
|
const n = e.getRootNode();
|
|
257
257
|
return (n instanceof ShadowRoot ? n.activeElement : e.ownerDocument.activeElement) === e ? !1 : (e.focus({ preventScroll: !0 }), !0);
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const la = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
260
260
|
function pa(e) {
|
|
261
261
|
let t = "", n = "", i = null;
|
|
262
262
|
for (const o of e.split(new RegExp("(?<=\\n)"))) {
|
|
@@ -280,27 +280,27 @@ function pa(e) {
|
|
|
280
280
|
}
|
|
281
281
|
function lo(e) {
|
|
282
282
|
let t = "", n = 0;
|
|
283
|
-
for (const i of e.matchAll(
|
|
283
|
+
for (const i of e.matchAll(la)) {
|
|
284
284
|
const o = i.index ?? 0;
|
|
285
|
-
t +=
|
|
285
|
+
t += po(
|
|
286
286
|
e.slice(n, o)
|
|
287
287
|
), t += i[0], n = o + i[0].length;
|
|
288
288
|
}
|
|
289
|
-
return t +
|
|
289
|
+
return t + po(e.slice(n));
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function po(e) {
|
|
292
292
|
return e.replace(
|
|
293
293
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
294
|
-
(t, n, i, o, r) => r[o - 1] === "!" ||
|
|
294
|
+
(t, n, i, o, r) => r[o - 1] === "!" || sa(r, o) || da(r, o, n) ? t : `[${n}](${i})`
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function sa(e, t) {
|
|
298
298
|
let n = 0;
|
|
299
299
|
for (let i = t - 1; e[i] === "\\"; i -= 1)
|
|
300
300
|
n += 1;
|
|
301
301
|
return n % 2 === 1;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function da(e, t, n) {
|
|
304
304
|
if (n !== "x" && n !== "X")
|
|
305
305
|
return !1;
|
|
306
306
|
const i = e.lastIndexOf(`
|
|
@@ -309,7 +309,7 @@ function ca(e, t, n) {
|
|
|
309
309
|
e.slice(i, t)
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const Wo = 100, ca = 1e4, ua = 5e3, ga = "product-agent:sdk-preview-socket-connect", ha = "product-agent:sdk-preview-socket-send", ma = "product-agent:sdk-preview-socket-close", fa = "product-agent:sdk-preview-socket-open", wa = "product-agent:sdk-preview-socket-message", ba = "product-agent:sdk-preview-socket-error", _a = "product-agent:sdk-preview-socket-closed", so = "product-agent:sdk-preview-socket-id", xa = "data-pluno-sdk-preview-channel", Ho = "data-pluno-auto-mounted", ye = "__plunoProductAgentAutoMountOwner", ya = 1e4, va = "Failed to load Pluno widget token", co = "Timed out loading Pluno widget token", Sa = "pluno.productAgent.widgetClientId.", sn = /* @__PURE__ */ new Set(), Ca = "product-agent:preview-diagnostic", $o = "pluno.productAgent.sharePromptsDisabled", Ea = 3, uo = 'dialog[open], [aria-modal="true"], [role="dialog"]', go = 1500, ka = 5e3, La = 500, Ta = "No recent chats for this page yet.", ve = {
|
|
313
313
|
launcherLabel: "Ask for anything...",
|
|
314
314
|
accentColor: "#7c3aed",
|
|
315
315
|
colorScheme: "light",
|
|
@@ -317,7 +317,7 @@ const Ho = 100, ua = 1e4, ga = 5e3, ha = "product-agent:sdk-preview-socket-conne
|
|
|
317
317
|
scribbleStyle: !0,
|
|
318
318
|
position: "bottom-right",
|
|
319
319
|
movableLauncher: !0
|
|
320
|
-
},
|
|
320
|
+
}, Aa = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', ho = "pluno-pa-scribble-font", Go = 190, qo = 41, Pa = 22, Ia = 32, Na = 1, Ra = 48, Rn = 420, za = 520, Ma = 0.24, zn = 680, Da = 800, Oa = 0.76, N = 8, He = 50, jo = "http://www.w3.org/2000/svg", Sn = 26, Cn = 8, Ua = 36, En = 16, Ba = 4, mo = [
|
|
321
321
|
{
|
|
322
322
|
ellipseCx: "17.5",
|
|
323
323
|
ellipseCy: "24.5",
|
|
@@ -354,9 +354,9 @@ const Ho = 100, ua = 1e4, ga = 5e3, ha = "product-agent:sdk-preview-socket-conne
|
|
|
354
354
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
355
355
|
pathStrokeWidth: "2.45"
|
|
356
356
|
}
|
|
357
|
-
],
|
|
358
|
-
let
|
|
359
|
-
function
|
|
357
|
+
], Fa = 11, Wa = 13, kn = 4, Vo = 10, Ko = 40, Ha = "movable-launcher-position-v2", Yo = "pluno-pa-widget-styles", Xo = "data-pluno-pa-widget-styles";
|
|
358
|
+
let fo = 0;
|
|
359
|
+
function $a(e) {
|
|
360
360
|
return (t) => new Se(t, e);
|
|
361
361
|
}
|
|
362
362
|
async function Ga(e = {}) {
|
|
@@ -370,6 +370,7 @@ async function Ga(e = {}) {
|
|
|
370
370
|
scribbleStyle: e.scribbleStyle ?? ve.scribbleStyle,
|
|
371
371
|
position: e.position ?? ve.position,
|
|
372
372
|
movableLauncher: e.movableLauncher ?? ve.movableLauncher,
|
|
373
|
+
mobilePanelTopOffset: typeof e.mobilePanelTopOffset == "number" && Number.isFinite(e.mobilePanelTopOffset) ? Math.max(0, e.mobilePanelTopOffset) : 0,
|
|
373
374
|
token: e.token,
|
|
374
375
|
tokenProvider: e.tokenProvider,
|
|
375
376
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -431,39 +432,42 @@ async function Ga(e = {}) {
|
|
|
431
432
|
);
|
|
432
433
|
const n = document.createElement("div");
|
|
433
434
|
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(
|
|
434
|
-
|
|
435
|
+
xa,
|
|
435
436
|
t.sdkPreviewChannelId
|
|
436
437
|
);
|
|
437
438
|
const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
|
|
438
439
|
o.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, o.classList.add(`pluno-pa-widget--layout-${t.layout}`), o.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
439
|
-
let r =
|
|
440
|
+
let r = wo(
|
|
440
441
|
t.accentColor,
|
|
441
442
|
t.scribbleStyle
|
|
442
443
|
);
|
|
443
|
-
|
|
444
|
+
ur(
|
|
444
445
|
o,
|
|
445
446
|
t.launcherLabel,
|
|
446
447
|
r,
|
|
447
448
|
t.movableLauncher,
|
|
448
449
|
t.showLauncherMinimizeButton
|
|
449
450
|
), i.appendChild(o);
|
|
450
|
-
const l =
|
|
451
|
-
zo(t,
|
|
451
|
+
const l = fl(t), p = t.layout === "floating" ? t.initialDisplayState ?? hl(t) : "shown";
|
|
452
|
+
zo(t, p);
|
|
452
453
|
let d = t.movableLauncher ? l.launcherPosition : null, c = d !== null, g = l.panelSize, h = null;
|
|
453
|
-
o.
|
|
454
|
+
o.style.setProperty(
|
|
455
|
+
"--pluno-pa-mobile-panel-top-offset",
|
|
456
|
+
`${t.mobilePanelTopOffset}px`
|
|
457
|
+
), o.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && o.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (o.classList.add("pluno-pa-widget--minimized"), We(
|
|
454
458
|
o,
|
|
455
459
|
cn(
|
|
456
460
|
o,
|
|
457
461
|
d,
|
|
458
462
|
t.position
|
|
459
463
|
)
|
|
460
|
-
)),
|
|
464
|
+
)), Ro(i, t.accentColor), bo(o, r, {
|
|
461
465
|
accentColor: t.accentColor,
|
|
462
466
|
colorScheme: t.colorScheme,
|
|
463
467
|
fontFamily: t.fontFamily,
|
|
464
468
|
scribbleStyle: t.scribbleStyle
|
|
465
469
|
});
|
|
466
|
-
const f = t.mountTarget ?? await
|
|
470
|
+
const f = t.mountTarget ?? await gl(), y = f.ownerDocument, v = o.querySelector(
|
|
467
471
|
".pluno-pa-widget__launcher"
|
|
468
472
|
), O = o.querySelector(
|
|
469
473
|
".pluno-pa-widget__launcher-drag-handle"
|
|
@@ -473,7 +477,7 @@ async function Ga(e = {}) {
|
|
|
473
477
|
".pluno-pa-widget__launcher-minimize"
|
|
474
478
|
), w = o.querySelector(".pluno-pa-widget__panel"), R = o.querySelector(
|
|
475
479
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
476
|
-
),
|
|
480
|
+
), M = Array.from(
|
|
477
481
|
o.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
478
482
|
), T = o.querySelector(
|
|
479
483
|
".pluno-pa-widget__close"
|
|
@@ -483,13 +487,13 @@ async function Ga(e = {}) {
|
|
|
483
487
|
".pluno-pa-widget__attachment-error"
|
|
484
488
|
), Qe = o.querySelector(
|
|
485
489
|
".pluno-pa-widget__billing-status"
|
|
486
|
-
),
|
|
490
|
+
), $e = o.querySelector(
|
|
487
491
|
".pluno-pa-widget__attachments"
|
|
488
492
|
), ge = o.querySelector(
|
|
489
493
|
".pluno-pa-widget__attachment-input"
|
|
490
494
|
), U = o.querySelector(
|
|
491
495
|
".pluno-pa-widget__attach"
|
|
492
|
-
),
|
|
496
|
+
), S = o.querySelector(
|
|
493
497
|
".pluno-pa-widget__input"
|
|
494
498
|
), B = o.querySelector(
|
|
495
499
|
".pluno-pa-widget__send"
|
|
@@ -509,15 +513,15 @@ async function Ga(e = {}) {
|
|
|
509
513
|
".pluno-pa-widget__timeline-jump"
|
|
510
514
|
), me = o.querySelector(
|
|
511
515
|
".pluno-pa-widget__active-users-counter"
|
|
512
|
-
),
|
|
516
|
+
), z = o.querySelector(
|
|
513
517
|
".pluno-pa-widget__timeline"
|
|
514
518
|
), et = o.querySelector(
|
|
515
519
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
516
|
-
), Me = o.querySelector(
|
|
517
|
-
".pluno-pa-widget__notify-suggestion"
|
|
518
520
|
), ze = o.querySelector(
|
|
521
|
+
".pluno-pa-widget__notify-suggestion"
|
|
522
|
+
), Me = o.querySelector(
|
|
519
523
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
520
|
-
),
|
|
524
|
+
), E = o.querySelector(
|
|
521
525
|
".pluno-pa-widget__notify-suggestion-later"
|
|
522
526
|
), A = o.querySelector(
|
|
523
527
|
".pluno-pa-widget__notify-suggestion-never"
|
|
@@ -528,29 +532,29 @@ async function Ga(e = {}) {
|
|
|
528
532
|
), oe = o.querySelector(
|
|
529
533
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
530
534
|
);
|
|
531
|
-
if (!
|
|
535
|
+
if (!v || !u || !w || !T || !ne || !H || !Qe || !$e || !ge || !U || !S || !B || !q || !Z || !Ne || !K || !wt || !Re || !he || !me || !z || !et)
|
|
532
536
|
throw new Error("Failed to mount Pluno widget");
|
|
533
537
|
if (t.movableLauncher && !O)
|
|
534
538
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
535
|
-
U.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled,
|
|
539
|
+
U.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled, ko(u), ko(S);
|
|
536
540
|
let b = [], L = null;
|
|
537
|
-
const j = () =>
|
|
538
|
-
|
|
539
|
-
o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !
|
|
540
|
-
),
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
const j = () => ra(
|
|
542
|
+
S,
|
|
543
|
+
o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !pe(t.billingStatus)
|
|
544
|
+
), Ge = () => {
|
|
545
|
+
Nr(
|
|
546
|
+
$e,
|
|
543
547
|
b,
|
|
544
548
|
(a) => {
|
|
545
549
|
b = b.filter(
|
|
546
|
-
(
|
|
547
|
-
),
|
|
550
|
+
(s, m) => m !== a
|
|
551
|
+
), Ge(), D(_.getState()), V(), j();
|
|
548
552
|
}
|
|
549
553
|
);
|
|
550
|
-
}, Un = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () =>
|
|
554
|
+
}, Un = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => gi(t.tokenEndpoint) : void 0);
|
|
551
555
|
if (!t.loginRequired && !t.signupRequired && !t.token && !Un && !t.webSocketFactory)
|
|
552
556
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
553
|
-
const
|
|
557
|
+
const mi = window.fetch.bind(window), Bt = ml(t.clientId);
|
|
554
558
|
let _;
|
|
555
559
|
try {
|
|
556
560
|
const a = {
|
|
@@ -590,17 +594,17 @@ async function Ga(e = {}) {
|
|
|
590
594
|
const Ft = new Set(l.openToolGroupKeys), De = new Set(
|
|
591
595
|
l.seenShareCandidateIds
|
|
592
596
|
), tt = new Set(De);
|
|
593
|
-
let Wt = l.sharePromptsDisabled || await
|
|
597
|
+
let Wt = l.sharePromptsDisabled || await wl(t), ie = null, Y = !1, bt = !(t.loginRequired || t.signupRequired), Ee = !1, Oe = {
|
|
594
598
|
enabled: !0
|
|
595
599
|
}, Ue = 0, Bn = "", X = !1, fe = !1, ke = [], Ht = null, nt = null;
|
|
596
|
-
const ae = (a,
|
|
597
|
-
Oe = { enabled: a, reason:
|
|
600
|
+
const ae = (a, s) => {
|
|
601
|
+
Oe = { enabled: a, reason: s };
|
|
598
602
|
}, re = () => {
|
|
599
603
|
he.hidden = !0;
|
|
600
|
-
},
|
|
604
|
+
}, fi = () => {
|
|
601
605
|
he.hidden = !1;
|
|
602
|
-
},
|
|
603
|
-
ae(!0, a), re(), ht(
|
|
606
|
+
}, wi = (a = "jump") => {
|
|
607
|
+
ae(!0, a), re(), ht(z, () => Oe.enabled), Ue = z.scrollTop;
|
|
604
608
|
}, we = () => {
|
|
605
609
|
if (Z.hidden = t.layout === "page" || t.loginRequired, Ne.hidden = !X, Z.setAttribute("aria-expanded", String(X)), K.classList.toggle(
|
|
606
610
|
"pluno-pa-widget__history-list--center",
|
|
@@ -610,19 +614,19 @@ async function Ga(e = {}) {
|
|
|
610
614
|
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", K.appendChild(a);
|
|
611
615
|
}
|
|
612
616
|
for (const a of ke) {
|
|
613
|
-
const
|
|
614
|
-
|
|
617
|
+
const s = document.createElement("button");
|
|
618
|
+
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = fe;
|
|
615
619
|
const m = document.createElement("span");
|
|
616
620
|
m.className = "pluno-pa-widget__history-item-title", m.textContent = sr(a);
|
|
617
|
-
const
|
|
618
|
-
|
|
621
|
+
const C = document.createElement("time");
|
|
622
|
+
C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = cr(
|
|
619
623
|
a.lastActiveAt,
|
|
620
624
|
Date.now()
|
|
621
625
|
);
|
|
622
626
|
const k = document.createElement("small");
|
|
623
|
-
k.className = "pluno-pa-widget__history-path", k.textContent =
|
|
627
|
+
k.className = "pluno-pa-widget__history-path", k.textContent = dr(a), s.append(m, C, k), s.addEventListener("click", () => {
|
|
624
628
|
X = !1, nt = null, we(), ae(!0, "newSession"), re(), _.loadSession(a.id), D(_.getState()), j();
|
|
625
|
-
}), K.appendChild(
|
|
629
|
+
}), K.appendChild(s);
|
|
626
630
|
}
|
|
627
631
|
if (fe && ke.length > 0) {
|
|
628
632
|
const a = document.createElement("p");
|
|
@@ -633,77 +637,77 @@ async function Ga(e = {}) {
|
|
|
633
637
|
if (!fe) {
|
|
634
638
|
fe = !0, nt = null, we();
|
|
635
639
|
try {
|
|
636
|
-
const
|
|
637
|
-
ke = a ? [...ke, ...
|
|
638
|
-
} catch (
|
|
640
|
+
const s = await _.listSessions({ cursor: a, limit: 20 });
|
|
641
|
+
ke = a ? [...ke, ...s.sessions] : s.sessions, Ht = s.nextCursor;
|
|
642
|
+
} catch (s) {
|
|
639
643
|
J(
|
|
640
644
|
"web-sdk.widget",
|
|
641
645
|
"Failed to load session history",
|
|
642
646
|
{
|
|
643
|
-
message:
|
|
647
|
+
message: s instanceof Error ? s.message : String(s)
|
|
644
648
|
}
|
|
645
|
-
), nt =
|
|
649
|
+
), nt = Ta;
|
|
646
650
|
} finally {
|
|
647
651
|
fe = !1, we();
|
|
648
652
|
}
|
|
649
653
|
}
|
|
650
|
-
},
|
|
654
|
+
}, bi = () => {
|
|
651
655
|
!Ht || fe || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && Fn(Ht);
|
|
652
656
|
}, Wn = () => {
|
|
653
|
-
Y || typeof document > "u" || (
|
|
657
|
+
Y || typeof document > "u" || (Ro(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || y.body?.appendChild(n)));
|
|
654
658
|
}, Hn = new MutationObserver(Wn);
|
|
655
659
|
Hn.observe(y.documentElement, {
|
|
656
660
|
childList: !0,
|
|
657
661
|
subtree: !0
|
|
658
662
|
}), Wn();
|
|
659
663
|
const ot = (a = !0) => {
|
|
660
|
-
const
|
|
664
|
+
const s = Dt(o, a);
|
|
661
665
|
return Ln(
|
|
662
666
|
o,
|
|
663
|
-
d ? Nt(d,
|
|
667
|
+
d ? Nt(d, s) : Ja(
|
|
664
668
|
o,
|
|
665
669
|
t.position,
|
|
666
|
-
|
|
670
|
+
s
|
|
667
671
|
),
|
|
668
|
-
|
|
672
|
+
s
|
|
669
673
|
);
|
|
670
674
|
}, F = () => {
|
|
671
|
-
const a =
|
|
675
|
+
const a = ir(
|
|
672
676
|
i,
|
|
673
677
|
u,
|
|
674
|
-
|
|
678
|
+
S
|
|
675
679
|
);
|
|
676
|
-
|
|
680
|
+
_l(t, {
|
|
677
681
|
isOpen: o.classList.contains("pluno-pa-widget--open"),
|
|
678
|
-
composerValue:
|
|
682
|
+
composerValue: S.value,
|
|
679
683
|
focusedInput: a,
|
|
680
684
|
focusedInputAt: a ? Date.now() : null,
|
|
681
685
|
openToolGroupKeys: [...Ft],
|
|
682
686
|
launcherPosition: c ? d : null,
|
|
683
687
|
panelSize: g,
|
|
684
688
|
seenShareCandidateIds: [...De].slice(
|
|
685
|
-
-
|
|
689
|
+
-Wo
|
|
686
690
|
),
|
|
687
691
|
sharePromptsDisabled: Wt
|
|
688
692
|
});
|
|
689
693
|
}, _t = (a) => {
|
|
690
694
|
t.onDisplayStateChange?.(a);
|
|
691
|
-
}, it = (a,
|
|
695
|
+
}, it = (a, s = !0) => {
|
|
692
696
|
if (zo(t, a), a === "shown") {
|
|
693
|
-
o.classList.remove("pluno-pa-widget--minimized"),
|
|
697
|
+
o.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), v.removeAttribute("role"), v.removeAttribute("aria-label"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && at(!1), s && _t("shown");
|
|
694
698
|
return;
|
|
695
699
|
}
|
|
696
|
-
ie !== null && (window.clearTimeout(ie), ie = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"),
|
|
700
|
+
ie !== null && (window.clearTimeout(ie), ie = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, v.setAttribute("role", "button"), v.setAttribute("aria-label", "Open Pluno"), w.hidden = !0, T.hidden = !0, v.tabIndex = 0, S.value = "", We(
|
|
697
701
|
o,
|
|
698
702
|
cn(
|
|
699
703
|
o,
|
|
700
704
|
d,
|
|
701
705
|
t.position
|
|
702
706
|
)
|
|
703
|
-
),
|
|
704
|
-
}, Be = (a,
|
|
705
|
-
|
|
706
|
-
debugVersion:
|
|
707
|
+
), So(o), F(), s && _t("minimized");
|
|
708
|
+
}, Be = (a, s = {}) => {
|
|
709
|
+
or(a, {
|
|
710
|
+
debugVersion: Ha,
|
|
707
711
|
launcherPosition: d,
|
|
708
712
|
rootClasses: o.className,
|
|
709
713
|
rootStyle: {
|
|
@@ -713,33 +717,33 @@ async function Ga(e = {}) {
|
|
|
713
717
|
bottom: o.style.bottom
|
|
714
718
|
},
|
|
715
719
|
rootRect: gn(o),
|
|
716
|
-
launcherRect: gn(
|
|
720
|
+
launcherRect: gn(v),
|
|
717
721
|
panelRect: gn(w),
|
|
718
722
|
viewport: te(),
|
|
719
723
|
panelHidden: w.hidden,
|
|
720
724
|
closeHidden: T.hidden,
|
|
721
|
-
...
|
|
725
|
+
...s
|
|
722
726
|
});
|
|
723
727
|
}, at = (a = !0) => {
|
|
724
728
|
if (!d)
|
|
725
729
|
return We(o, null), ot(a);
|
|
726
|
-
const
|
|
727
|
-
return We(o,
|
|
728
|
-
visibleLauncherPosition:
|
|
729
|
-
}),
|
|
730
|
-
},
|
|
731
|
-
if (!a || !
|
|
732
|
-
|
|
730
|
+
const s = ot(a);
|
|
731
|
+
return We(o, s), Be("Applied stored closed launcher position", {
|
|
732
|
+
visibleLauncherPosition: s
|
|
733
|
+
}), s;
|
|
734
|
+
}, $t = (a, s) => {
|
|
735
|
+
if (!a || !s) {
|
|
736
|
+
So(o);
|
|
733
737
|
return;
|
|
734
738
|
}
|
|
735
|
-
|
|
736
|
-
x: a.x -
|
|
737
|
-
y: a.y -
|
|
739
|
+
nr(o, {
|
|
740
|
+
x: a.x - s.x,
|
|
741
|
+
y: a.y - s.y
|
|
738
742
|
});
|
|
739
|
-
},
|
|
743
|
+
}, Gt = () => {
|
|
740
744
|
const a = Je(g).width;
|
|
741
745
|
return t.layout === "page" && w.getBoundingClientRect().width || a;
|
|
742
|
-
},
|
|
746
|
+
}, $n = () => {
|
|
743
747
|
if (o.classList.contains("pluno-pa-widget--minimized")) {
|
|
744
748
|
We(
|
|
745
749
|
o,
|
|
@@ -754,21 +758,21 @@ async function Ga(e = {}) {
|
|
|
754
758
|
const a = at();
|
|
755
759
|
if (o.classList.contains("pluno-pa-widget--open") || o.classList.contains("pluno-pa-widget--closing")) {
|
|
756
760
|
dn(o, g);
|
|
757
|
-
const
|
|
761
|
+
const s = Je(g);
|
|
758
762
|
mn(
|
|
759
763
|
R,
|
|
760
|
-
|
|
764
|
+
Gt()
|
|
761
765
|
);
|
|
762
766
|
const m = Rt(
|
|
763
|
-
h ? Nt(h,
|
|
767
|
+
h ? Nt(h, s) : un(
|
|
764
768
|
o,
|
|
765
769
|
a,
|
|
766
770
|
t.position,
|
|
767
771
|
g
|
|
768
772
|
),
|
|
769
|
-
|
|
773
|
+
s
|
|
770
774
|
);
|
|
771
|
-
|
|
775
|
+
$t(m, a), Be(
|
|
772
776
|
"Applied open panel position after viewport resize",
|
|
773
777
|
{ openPanelPosition: m }
|
|
774
778
|
);
|
|
@@ -777,37 +781,37 @@ async function Ga(e = {}) {
|
|
|
777
781
|
{ visibleLauncherPosition: a }
|
|
778
782
|
);
|
|
779
783
|
};
|
|
780
|
-
let
|
|
784
|
+
let Gn = () => {
|
|
781
785
|
};
|
|
782
|
-
window.addEventListener("resize",
|
|
786
|
+
window.addEventListener("resize", $n), t.movableLauncher && O ? (at(), Gn = Ya({
|
|
783
787
|
root: o,
|
|
784
|
-
launcher:
|
|
788
|
+
launcher: v,
|
|
785
789
|
launcherDragHandle: O,
|
|
786
790
|
getPosition: () => ot(),
|
|
787
791
|
setPosition: (a) => {
|
|
788
|
-
const
|
|
792
|
+
const s = a, m = Dt(o), C = Ln(
|
|
789
793
|
o,
|
|
790
794
|
a,
|
|
791
795
|
m
|
|
792
796
|
);
|
|
793
|
-
d =
|
|
794
|
-
|
|
797
|
+
d = vo(
|
|
798
|
+
C,
|
|
795
799
|
m
|
|
796
|
-
), We(o,
|
|
797
|
-
requestedPosition:
|
|
800
|
+
), We(o, C), Be("Dragging closed launcher", {
|
|
801
|
+
requestedPosition: s
|
|
798
802
|
});
|
|
799
803
|
},
|
|
800
804
|
persist: () => {
|
|
801
805
|
c = !0, F(), Be("Persisted closed launcher drag position");
|
|
802
806
|
}
|
|
803
807
|
})) : We(o, null), dn(o, g);
|
|
804
|
-
const
|
|
805
|
-
const a = Je(g),
|
|
808
|
+
const _i = () => {
|
|
809
|
+
const a = Je(g), s = ot();
|
|
806
810
|
return {
|
|
807
811
|
position: Rt(
|
|
808
812
|
h ? Nt(h, a) : un(
|
|
809
813
|
o,
|
|
810
|
-
|
|
814
|
+
s,
|
|
811
815
|
t.position,
|
|
812
816
|
g
|
|
813
817
|
),
|
|
@@ -815,26 +819,26 @@ async function Ga(e = {}) {
|
|
|
815
819
|
),
|
|
816
820
|
size: a
|
|
817
821
|
};
|
|
818
|
-
},
|
|
822
|
+
}, xi = (a) => {
|
|
819
823
|
g = Ot(a.size), dn(o, g), mn(
|
|
820
824
|
R,
|
|
821
|
-
|
|
825
|
+
Gt()
|
|
822
826
|
);
|
|
823
|
-
const
|
|
827
|
+
const s = Rt(
|
|
824
828
|
a.position,
|
|
825
829
|
Je(g)
|
|
826
830
|
);
|
|
827
|
-
h =
|
|
828
|
-
|
|
831
|
+
h = vo(
|
|
832
|
+
s,
|
|
829
833
|
Je(g)
|
|
830
834
|
);
|
|
831
835
|
const m = ot();
|
|
832
|
-
|
|
833
|
-
},
|
|
836
|
+
$t(s, m);
|
|
837
|
+
}, yi = M.length > 0 ? Xa({
|
|
834
838
|
root: o,
|
|
835
|
-
handles:
|
|
836
|
-
getBounds:
|
|
837
|
-
setBounds:
|
|
839
|
+
handles: M,
|
|
840
|
+
getBounds: _i,
|
|
841
|
+
setBounds: xi,
|
|
838
842
|
persist: F
|
|
839
843
|
}) : () => {
|
|
840
844
|
};
|
|
@@ -846,7 +850,7 @@ async function Ga(e = {}) {
|
|
|
846
850
|
const a = await t.billingStatusLoader();
|
|
847
851
|
if (Y)
|
|
848
852
|
return;
|
|
849
|
-
|
|
853
|
+
To(
|
|
850
854
|
t.billingStatus,
|
|
851
855
|
a,
|
|
852
856
|
_.getState().lastErrorCode
|
|
@@ -865,39 +869,39 @@ async function Ga(e = {}) {
|
|
|
865
869
|
qt = !1;
|
|
866
870
|
}
|
|
867
871
|
}
|
|
868
|
-
}, be = (a = "",
|
|
869
|
-
qn(),
|
|
872
|
+
}, be = (a = "", s = !0, m = !0) => {
|
|
873
|
+
qn(), st && (st = !1, Xt()), o.classList.contains("pluno-pa-widget--open") || (h = null), ie !== null && (window.clearTimeout(ie), ie = null), it("shown", !1), w.hidden = !1, T.hidden = !1, mn(
|
|
870
874
|
R,
|
|
871
|
-
|
|
875
|
+
Gt()
|
|
872
876
|
), o.classList.remove("pluno-pa-widget--closing");
|
|
873
|
-
const
|
|
877
|
+
const C = at(), k = un(
|
|
874
878
|
o,
|
|
875
|
-
|
|
879
|
+
C,
|
|
876
880
|
t.position,
|
|
877
881
|
g
|
|
878
882
|
);
|
|
879
|
-
if (
|
|
883
|
+
if ($t(k, C), Be("Opening launcher at clamped open panel position", {
|
|
880
884
|
openPanelPosition: k,
|
|
881
|
-
visibleLauncherPosition:
|
|
882
|
-
}), ae(!0, "open"), re(), !
|
|
883
|
-
o.classList.add("pluno-pa-widget--open"),
|
|
885
|
+
visibleLauncherPosition: C
|
|
886
|
+
}), ae(!0, "open"), re(), !s) {
|
|
887
|
+
o.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (S.value = a, gt(S)), ht(z, () => Oe.enabled), Ue = z.scrollTop, m && (S.focus(), S.setSelectionRange(S.value.length, S.value.length)), F(), _t("shown"), t.onPanelOpenChange?.(!0);
|
|
884
888
|
return;
|
|
885
889
|
}
|
|
886
890
|
window.requestAnimationFrame(() => {
|
|
887
|
-
o.classList.add("pluno-pa-widget--open"), a && (
|
|
888
|
-
|
|
891
|
+
o.classList.add("pluno-pa-widget--open"), a && (S.value = a, gt(S)), ht(z, () => Oe.enabled), Ue = z.scrollTop, m && (S.focus(), S.setSelectionRange(S.value.length, S.value.length)), F(), _t("shown"), t.onPanelOpenChange?.(!0), ie = window.setTimeout(() => {
|
|
892
|
+
v.hidden = !0, ht(z, () => Oe.enabled), Ue = z.scrollTop;
|
|
889
893
|
}, 220);
|
|
890
894
|
});
|
|
891
895
|
}, jt = () => {
|
|
892
|
-
ie !== null && (window.clearTimeout(ie), ie = null),
|
|
896
|
+
ie !== null && (window.clearTimeout(ie), ie = null), v.hidden = !1, d && (at(!1), Be("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), F(), t.onPanelOpenChange?.(!1), ie = window.setTimeout(() => {
|
|
893
897
|
w.hidden = !0, T.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
|
|
894
898
|
}, 220);
|
|
895
899
|
};
|
|
896
|
-
|
|
900
|
+
v.addEventListener("submit", (a) => {
|
|
897
901
|
a.preventDefault(), be(u.value), u.value = "";
|
|
898
902
|
}), O?.addEventListener("click", (a) => {
|
|
899
903
|
a.preventDefault(), a.stopPropagation();
|
|
900
|
-
}),
|
|
904
|
+
}), v.addEventListener("click", (a) => {
|
|
901
905
|
a.target === u && !O || (be(u.value), u.value = "");
|
|
902
906
|
});
|
|
903
907
|
const jn = () => {
|
|
@@ -909,30 +913,30 @@ async function Ga(e = {}) {
|
|
|
909
913
|
const a = u.value;
|
|
910
914
|
be(a), u.value = "";
|
|
911
915
|
});
|
|
912
|
-
let rt = null, Le = null, xt = null, Fe = null,
|
|
913
|
-
const yt = (a) => a === u || a ===
|
|
914
|
-
let
|
|
915
|
-
for (;
|
|
916
|
-
if (
|
|
917
|
-
return
|
|
918
|
-
|
|
916
|
+
let rt = null, Le = null, xt = null, Fe = null, se = null, G = null;
|
|
917
|
+
const yt = (a) => a === u || a === S, Vn = (a) => a.composedPath().find(yt) ?? null, vi = (a) => {
|
|
918
|
+
let s = a;
|
|
919
|
+
for (; s; ) {
|
|
920
|
+
if (s.assignedSlot)
|
|
921
|
+
return s.assignedSlot;
|
|
922
|
+
s = s.parentElement;
|
|
919
923
|
}
|
|
920
924
|
return null;
|
|
921
925
|
}, Vt = (a) => {
|
|
922
926
|
if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
|
|
923
927
|
return null;
|
|
924
|
-
let
|
|
925
|
-
for (;
|
|
926
|
-
const m =
|
|
928
|
+
let s = a;
|
|
929
|
+
for (; s; ) {
|
|
930
|
+
const m = s.closest(uo);
|
|
927
931
|
if (m)
|
|
928
932
|
return m;
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
931
|
-
|
|
933
|
+
const C = vi(s);
|
|
934
|
+
if (C) {
|
|
935
|
+
s = C;
|
|
932
936
|
continue;
|
|
933
937
|
}
|
|
934
|
-
const k =
|
|
935
|
-
|
|
938
|
+
const k = s.getRootNode();
|
|
939
|
+
s = k instanceof ShadowRoot ? k.host : null;
|
|
936
940
|
}
|
|
937
941
|
return null;
|
|
938
942
|
}, Kt = () => {
|
|
@@ -940,7 +944,7 @@ async function Ga(e = {}) {
|
|
|
940
944
|
for (; a?.shadowRoot?.activeElement; )
|
|
941
945
|
a = a.shadowRoot.activeElement;
|
|
942
946
|
return a;
|
|
943
|
-
},
|
|
947
|
+
}, Si = (a) => {
|
|
944
948
|
if (!a.isConnected || !a.matches(uo))
|
|
945
949
|
return !1;
|
|
946
950
|
if (!(a instanceof HTMLElement))
|
|
@@ -949,48 +953,48 @@ async function Ga(e = {}) {
|
|
|
949
953
|
return !1;
|
|
950
954
|
if (typeof a.checkVisibility == "function")
|
|
951
955
|
return a.checkVisibility();
|
|
952
|
-
const
|
|
953
|
-
return
|
|
954
|
-
}, Yt = (a,
|
|
955
|
-
|
|
956
|
-
|
|
956
|
+
const s = window.getComputedStyle(a);
|
|
957
|
+
return s.display !== "none" && s.visibility !== "hidden";
|
|
958
|
+
}, Yt = (a, s) => {
|
|
959
|
+
s && (se !== null && window.clearTimeout(se), se = window.setTimeout(() => {
|
|
960
|
+
se = null, _e === a && s.isConnected && s.focus({ preventScroll: !0 });
|
|
957
961
|
}, 0));
|
|
958
|
-
}, lt = (a,
|
|
962
|
+
}, lt = (a, s = null) => {
|
|
959
963
|
if (_e === a) {
|
|
960
|
-
a && Yt(a,
|
|
964
|
+
a && Yt(a, s);
|
|
961
965
|
return;
|
|
962
966
|
}
|
|
963
|
-
_e = a, a !== null ? (Yt(a,
|
|
967
|
+
_e = a, a !== null ? (Yt(a, s), Fe = window.setInterval(() => {
|
|
964
968
|
const m = _e;
|
|
965
|
-
if (!m || !
|
|
969
|
+
if (!m || !Si(m)) {
|
|
966
970
|
lt(null);
|
|
967
971
|
return;
|
|
968
972
|
}
|
|
969
973
|
Yt(m, null);
|
|
970
|
-
},
|
|
971
|
-
},
|
|
972
|
-
Fe !== null && (window.clearInterval(Fe), Fe = null),
|
|
974
|
+
}, La)) : (Fe !== null && (window.clearInterval(Fe), Fe = null), se !== null && (window.clearTimeout(se), se = null), xt = null);
|
|
975
|
+
}, Ci = () => {
|
|
976
|
+
Fe !== null && (window.clearInterval(Fe), Fe = null), se !== null && (window.clearTimeout(se), se = null), G !== null && (window.clearTimeout(G), G = null);
|
|
973
977
|
}, Kn = (a) => {
|
|
974
|
-
const
|
|
975
|
-
if (!
|
|
978
|
+
const s = Vn(a);
|
|
979
|
+
if (!s)
|
|
976
980
|
return;
|
|
977
981
|
const m = Date.now();
|
|
978
|
-
Le = m, rt = m,
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
if (
|
|
982
|
+
Le = m, rt = m, G !== null && window.clearTimeout(G);
|
|
983
|
+
const C = _e ?? Vt(Kt());
|
|
984
|
+
C && (lt(C, s), a.stopImmediatePropagation()), G = window.setTimeout(() => {
|
|
985
|
+
if (G = null, Le !== m)
|
|
982
986
|
return;
|
|
983
987
|
const k = Kt();
|
|
984
|
-
if (k ===
|
|
988
|
+
if (k === s) {
|
|
985
989
|
Le = null;
|
|
986
990
|
return;
|
|
987
991
|
}
|
|
988
992
|
const Te = Vt(k);
|
|
989
|
-
Te && lt(Te,
|
|
993
|
+
Te && lt(Te, s);
|
|
990
994
|
}, 0);
|
|
991
995
|
}, vt = (a) => {
|
|
992
|
-
const
|
|
993
|
-
|
|
996
|
+
const s = Vn(a);
|
|
997
|
+
s && (rt = Date.now(), _e !== null && (a.stopImmediatePropagation(), Le = null, G !== null && (window.clearTimeout(G), G = null), F(), a.type === "focus" && s === u && jn()));
|
|
994
998
|
};
|
|
995
999
|
y.defaultView?.addEventListener(
|
|
996
1000
|
"pointerdown",
|
|
@@ -1007,64 +1011,64 @@ async function Ga(e = {}) {
|
|
|
1007
1011
|
), o.addEventListener("pointerdown", (a) => {
|
|
1008
1012
|
yt(a.target) && a.stopPropagation();
|
|
1009
1013
|
}), o.addEventListener("focusin", (a) => {
|
|
1010
|
-
yt(a.target) && (a.stopPropagation(), rt = Date.now(), Le = null,
|
|
1014
|
+
yt(a.target) && (a.stopPropagation(), rt = Date.now(), Le = null, G !== null && (window.clearTimeout(G), G = null), F());
|
|
1011
1015
|
}), o.addEventListener("focusout", (a) => {
|
|
1012
1016
|
if (!yt(a.target) || _e !== null)
|
|
1013
1017
|
return;
|
|
1014
|
-
const
|
|
1015
|
-
if (rt = null,
|
|
1018
|
+
const s = rt;
|
|
1019
|
+
if (rt = null, s === null || Date.now() - s > go)
|
|
1016
1020
|
return;
|
|
1017
|
-
const m = a.target,
|
|
1018
|
-
Le = null,
|
|
1021
|
+
const m = a.target, C = Le !== null && Date.now() - Le <= go;
|
|
1022
|
+
Le = null, G !== null && (window.clearTimeout(G), G = null);
|
|
1019
1023
|
const k = (Te) => {
|
|
1020
1024
|
const ln = Vt(Te);
|
|
1021
1025
|
if (!ln)
|
|
1022
1026
|
return !1;
|
|
1023
|
-
if (
|
|
1027
|
+
if (C)
|
|
1024
1028
|
return lt(ln, m), !0;
|
|
1025
1029
|
const to = Date.now();
|
|
1026
|
-
return xt !== null && to - xt <=
|
|
1030
|
+
return xt !== null && to - xt <= ka ? (lt(ln, m), !0) : (xt = to, !0);
|
|
1027
1031
|
};
|
|
1028
1032
|
k(a.relatedTarget) || window.setTimeout(() => {
|
|
1029
1033
|
_e === null && m.isConnected && k(Kt());
|
|
1030
1034
|
}, 0);
|
|
1031
|
-
}),
|
|
1035
|
+
}), v.addEventListener("keydown", (a) => {
|
|
1032
1036
|
!o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), be());
|
|
1033
1037
|
}), W?.addEventListener("pointerdown", (a) => {
|
|
1034
1038
|
a.stopPropagation();
|
|
1035
1039
|
}), W?.addEventListener("click", (a) => {
|
|
1036
1040
|
a.preventDefault(), a.stopPropagation(), it("minimized");
|
|
1037
|
-
}), T.addEventListener("click", jt),
|
|
1038
|
-
|
|
1041
|
+
}), T.addEventListener("click", jt), z.addEventListener("scroll", () => {
|
|
1042
|
+
z.scrollTop < Ue - 1 && ae(!1, "userScroll"), Ue = z.scrollTop;
|
|
1039
1043
|
}), he.addEventListener("click", () => {
|
|
1040
|
-
|
|
1044
|
+
wi();
|
|
1041
1045
|
});
|
|
1042
1046
|
const Yn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
1043
1047
|
([a]) => {
|
|
1044
1048
|
a?.isIntersecting && (ae(!0, "bottom"), re());
|
|
1045
1049
|
},
|
|
1046
|
-
{ root:
|
|
1050
|
+
{ root: z, threshold: 0 }
|
|
1047
1051
|
);
|
|
1048
1052
|
Yn?.observe(et);
|
|
1049
|
-
const
|
|
1050
|
-
let _e = null,
|
|
1053
|
+
const pt = () => t.loginRequired || t.signupRequired;
|
|
1054
|
+
let _e = null, st = !1;
|
|
1051
1055
|
const le = () => bt || _.getState().status !== "connected", qe = () => {
|
|
1052
|
-
const a =
|
|
1053
|
-
u.readOnly = !1,
|
|
1056
|
+
const a = pt();
|
|
1057
|
+
u.readOnly = !1, S.readOnly = !1, u.placeholder = a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : st ? "New update" : t.launcherLabel, S.placeholder = a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ve.launcherLabel, ne.hidden = a;
|
|
1054
1058
|
}, V = () => {
|
|
1055
|
-
B.disabled = le() ||
|
|
1059
|
+
B.disabled = le() || pe(t.billingStatus) || !_.getState().isThinking && S.value.trim().length === 0 && b.length === 0, U.disabled = pt() || le() || pe(t.billingStatus);
|
|
1056
1060
|
};
|
|
1057
1061
|
qe();
|
|
1058
1062
|
const Xt = () => {
|
|
1059
1063
|
const a = _.getState().isThinking;
|
|
1060
1064
|
o.classList.toggle("pluno-pa-widget--thinking", a), o.classList.toggle(
|
|
1061
1065
|
"pluno-pa-widget--unread",
|
|
1062
|
-
!a &&
|
|
1066
|
+
!a && st
|
|
1063
1067
|
), qe();
|
|
1064
1068
|
};
|
|
1065
1069
|
Xt();
|
|
1066
1070
|
const Zt = () => {
|
|
1067
|
-
|
|
1071
|
+
pt() || Y || (bt = !0, qe(), V(), _.connect().then(
|
|
1068
1072
|
() => {
|
|
1069
1073
|
Y || (bt = !1, qe(), V());
|
|
1070
1074
|
},
|
|
@@ -1088,55 +1092,55 @@ async function Ga(e = {}) {
|
|
|
1088
1092
|
t.onSignupClick?.();
|
|
1089
1093
|
return;
|
|
1090
1094
|
}
|
|
1091
|
-
le() ||
|
|
1095
|
+
le() || pe(t.billingStatus) || (Ee = !0, ae(!0, "send"), re(), b = hn(
|
|
1092
1096
|
_,
|
|
1093
|
-
|
|
1097
|
+
S,
|
|
1094
1098
|
b,
|
|
1095
1099
|
At
|
|
1096
|
-
),
|
|
1100
|
+
), Ge(), V());
|
|
1097
1101
|
});
|
|
1098
1102
|
let dt = 0;
|
|
1099
|
-
const
|
|
1103
|
+
const Ei = () => {
|
|
1100
1104
|
dt = 0, o.classList.remove("pluno-pa-widget--drag-over");
|
|
1101
1105
|
}, Jt = (a) => {
|
|
1102
1106
|
L !== null && window.clearTimeout(L), H.textContent = a, H.hidden = !1, L = window.setTimeout(() => {
|
|
1103
1107
|
H.textContent = "", H.hidden = !0, L = null;
|
|
1104
1108
|
}, 3e3);
|
|
1105
|
-
},
|
|
1109
|
+
}, ki = () => {
|
|
1106
1110
|
L !== null && (window.clearTimeout(L), L = null), H.textContent = "", H.hidden = !0;
|
|
1107
1111
|
}, Qt = async (a) => {
|
|
1108
1112
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
1109
1113
|
return;
|
|
1110
|
-
const
|
|
1111
|
-
if (b = [...b, ...
|
|
1114
|
+
const s = Mr(_, a);
|
|
1115
|
+
if (b = [...b, ...s], Ge(), ki(), V(), D(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
|
|
1112
1116
|
be();
|
|
1113
1117
|
return;
|
|
1114
1118
|
}
|
|
1115
1119
|
j();
|
|
1116
|
-
},
|
|
1117
|
-
await Qt(a), !(a.length === 0 || _e !== null) &&
|
|
1120
|
+
}, Li = async (a) => {
|
|
1121
|
+
await Qt(a), !(a.length === 0 || _e !== null) && S.focus();
|
|
1118
1122
|
};
|
|
1119
1123
|
U.addEventListener("click", () => {
|
|
1120
|
-
t.loginRequired || le() ||
|
|
1124
|
+
t.loginRequired || le() || pe(t.billingStatus) || ge.click();
|
|
1121
1125
|
}), ge.addEventListener("change", () => {
|
|
1122
1126
|
const a = Array.from(ge.files ?? []);
|
|
1123
|
-
ge.value = "",
|
|
1127
|
+
ge.value = "", Li(a).catch((s) => {
|
|
1124
1128
|
Jt(
|
|
1125
|
-
|
|
1129
|
+
s instanceof Error ? s.message : "Failed to attach file"
|
|
1126
1130
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1127
|
-
message:
|
|
1131
|
+
message: s instanceof Error ? s.message : String(s)
|
|
1128
1132
|
});
|
|
1129
1133
|
});
|
|
1130
1134
|
}), o.addEventListener("dragenter", (a) => {
|
|
1131
1135
|
!t.attachmentsEnabled || !Pt(a.dataTransfer) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), dt += 1, o.classList.add("pluno-pa-widget--drag-over"));
|
|
1132
1136
|
}), o.addEventListener("dragover", (a) => {
|
|
1133
|
-
const
|
|
1134
|
-
!t.attachmentsEnabled || !Pt(
|
|
1137
|
+
const s = a.dataTransfer;
|
|
1138
|
+
!t.attachmentsEnabled || !Pt(s) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
1135
1139
|
}), o.addEventListener("dragleave", (a) => {
|
|
1136
1140
|
Pt(a.dataTransfer) && (a.stopPropagation(), dt = Math.max(0, dt - 1), dt === 0 && o.classList.remove("pluno-pa-widget--drag-over"));
|
|
1137
1141
|
}), o.addEventListener("drop", (a) => {
|
|
1138
|
-
const
|
|
1139
|
-
!t.attachmentsEnabled || !Pt(
|
|
1142
|
+
const s = a.dataTransfer;
|
|
1143
|
+
!t.attachmentsEnabled || !Pt(s) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), Ei(), Qt(s.files).catch((m) => {
|
|
1140
1144
|
Jt(
|
|
1141
1145
|
m instanceof Error ? m.message : "Failed to attach file"
|
|
1142
1146
|
), J("web-sdk.widget", "Attachment failed", {
|
|
@@ -1145,12 +1149,12 @@ async function Ga(e = {}) {
|
|
|
1145
1149
|
}));
|
|
1146
1150
|
}), o.addEventListener("paste", (a) => {
|
|
1147
1151
|
a.stopPropagation();
|
|
1148
|
-
const
|
|
1149
|
-
!t.attachmentsEnabled || m.length === 0 || t.loginRequired || le() || (a.preventDefault(), Qt(m).catch((
|
|
1152
|
+
const s = a.clipboardData, m = Array.from(s?.files ?? []);
|
|
1153
|
+
!t.attachmentsEnabled || m.length === 0 || t.loginRequired || le() || (a.preventDefault(), Qt(m).catch((C) => {
|
|
1150
1154
|
Jt(
|
|
1151
|
-
|
|
1155
|
+
C instanceof Error ? C.message : "Failed to attach file"
|
|
1152
1156
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1153
|
-
message:
|
|
1157
|
+
message: C instanceof Error ? C.message : String(C)
|
|
1154
1158
|
});
|
|
1155
1159
|
}));
|
|
1156
1160
|
}), B.addEventListener("click", () => {
|
|
@@ -1164,20 +1168,20 @@ async function Ga(e = {}) {
|
|
|
1164
1168
|
}
|
|
1165
1169
|
if (le())
|
|
1166
1170
|
return;
|
|
1167
|
-
const a =
|
|
1171
|
+
const a = S.value.trim().length > 0 || b.length > 0;
|
|
1168
1172
|
Ee = !0, ae(!0, "send"), re(), b = hn(
|
|
1169
1173
|
_,
|
|
1170
|
-
|
|
1174
|
+
S,
|
|
1171
1175
|
b,
|
|
1172
1176
|
At
|
|
1173
|
-
),
|
|
1177
|
+
), Ge(), V(), D(_.getState()), a && j();
|
|
1174
1178
|
}), Z.addEventListener("click", () => {
|
|
1175
1179
|
X = !X, nt = null, we(), X && ke.length === 0 && Fn(null), X || j();
|
|
1176
1180
|
}), wt.addEventListener("click", () => {
|
|
1177
1181
|
X = !1, we(), j();
|
|
1178
|
-
}), K.addEventListener("scroll",
|
|
1179
|
-
gt(
|
|
1180
|
-
}),
|
|
1182
|
+
}), K.addEventListener("scroll", bi), S.addEventListener("input", () => {
|
|
1183
|
+
gt(S), F(), V(), Pi();
|
|
1184
|
+
}), S.addEventListener("keydown", (a) => {
|
|
1181
1185
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1182
1186
|
if (a.preventDefault(), t.loginRequired) {
|
|
1183
1187
|
t.onLoginClick?.();
|
|
@@ -1185,16 +1189,16 @@ async function Ga(e = {}) {
|
|
|
1185
1189
|
}
|
|
1186
1190
|
le() || (Ee = !0, ae(!0, "send"), re(), b = hn(
|
|
1187
1191
|
_,
|
|
1188
|
-
|
|
1192
|
+
S,
|
|
1189
1193
|
b,
|
|
1190
1194
|
At
|
|
1191
|
-
),
|
|
1195
|
+
), Ge(), V(), D(_.getState()));
|
|
1192
1196
|
}
|
|
1193
1197
|
}), o.addEventListener("click", (a) => {
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
+
const s = a.target instanceof Element ? a.target : null;
|
|
1199
|
+
s?.closest("a[href]") && F(), X && aa(s, Ne, Z) && (X = !1, we());
|
|
1200
|
+
const C = window.getSelection(), k = !!(C && !C.isCollapsed && C.anchorNode && o.contains(C.anchorNode));
|
|
1201
|
+
oa(a.target, a.detail, k) && j();
|
|
1198
1202
|
}), o.addEventListener("copy", (a) => {
|
|
1199
1203
|
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
1200
1204
|
"text/plain",
|
|
@@ -1202,8 +1206,8 @@ async function Ga(e = {}) {
|
|
|
1202
1206
|
), a.preventDefault()), a.stopPropagation();
|
|
1203
1207
|
});
|
|
1204
1208
|
for (const a of ["keypress", "keyup"])
|
|
1205
|
-
o.addEventListener(a, (
|
|
1206
|
-
(
|
|
1209
|
+
o.addEventListener(a, (s) => {
|
|
1210
|
+
(s.metaKey || s.ctrlKey) && s.key.toLowerCase() === "c" && s.stopPropagation();
|
|
1207
1211
|
});
|
|
1208
1212
|
o.addEventListener("keydown", (a) => {
|
|
1209
1213
|
if ((a.metaKey || a.ctrlKey) && a.key.toLowerCase() === "c") {
|
|
@@ -1213,7 +1217,7 @@ async function Ga(e = {}) {
|
|
|
1213
1217
|
return;
|
|
1214
1218
|
}
|
|
1215
1219
|
a.key !== "Escape" || !X || (X = !1, we(), j());
|
|
1216
|
-
}), l.composerValue && (
|
|
1220
|
+
}), l.composerValue && (S.value = l.composerValue, gt(S)), t.layout === "page" ? be(S.value, !1) : p === "minimized" ? it("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(S.value, !1, !1), ar(l, o, u, S);
|
|
1217
1221
|
const St = () => r;
|
|
1218
1222
|
let en = _.getState().appearance !== null, Ct = null, ct = null, Xn = _.getState().isThinking, je = null;
|
|
1219
1223
|
const ut = t.taskNotifications;
|
|
@@ -1221,9 +1225,9 @@ async function Ga(e = {}) {
|
|
|
1221
1225
|
const Zn = () => {
|
|
1222
1226
|
Ve !== null && (window.clearTimeout(Ve), Ve = null);
|
|
1223
1227
|
}, Et = () => {
|
|
1224
|
-
|
|
1225
|
-
}, Jn = () => _.getState().assistantDraft.trim().length > 0,
|
|
1226
|
-
if (!ut || !
|
|
1228
|
+
ze && (ze.hidden = !0);
|
|
1229
|
+
}, Jn = () => _.getState().assistantDraft.trim().length > 0, Ti = async () => {
|
|
1230
|
+
if (!ut || !ze || Ke || Y || !_.getState().isThinking || Jn())
|
|
1227
1231
|
return;
|
|
1228
1232
|
let a;
|
|
1229
1233
|
try {
|
|
@@ -1231,12 +1235,12 @@ async function Ga(e = {}) {
|
|
|
1231
1235
|
} catch {
|
|
1232
1236
|
return;
|
|
1233
1237
|
}
|
|
1234
|
-
a.enabled || a.neverSuggest || !_.getState().isThinking || Jn() || Ke || Y || (
|
|
1238
|
+
a.enabled || a.neverSuggest || !_.getState().isThinking || Jn() || Ke || Y || (ze.hidden = !1);
|
|
1235
1239
|
};
|
|
1236
|
-
|
|
1240
|
+
Me?.addEventListener("click", () => {
|
|
1237
1241
|
Ke = !0, Et(), ut?.enable().catch(() => {
|
|
1238
1242
|
});
|
|
1239
|
-
}),
|
|
1243
|
+
}), E?.addEventListener("click", () => {
|
|
1240
1244
|
Ke = !0, Et();
|
|
1241
1245
|
}), A?.addEventListener("click", () => {
|
|
1242
1246
|
Ke = !0, Et(), ut?.dismissForever().catch(() => {
|
|
@@ -1263,26 +1267,26 @@ async function Ga(e = {}) {
|
|
|
1263
1267
|
}), Lt();
|
|
1264
1268
|
let Xe = null, Qn = () => {
|
|
1265
1269
|
};
|
|
1266
|
-
const
|
|
1270
|
+
const Ai = !!(t.sdkPreviewChannelId && t.referralLinkLoader), tn = /* @__PURE__ */ new Map(), nn = () => S.value.trim().length > 0 || b.length > 0, Pi = () => {
|
|
1267
1271
|
const a = Xe !== null && bn(_.getState(), nn());
|
|
1268
|
-
me.hidden = !a, a && Xe !== null &&
|
|
1272
|
+
me.hidden = !a, a && Xe !== null && Jo(me, Xe);
|
|
1269
1273
|
};
|
|
1270
1274
|
let Ze = null;
|
|
1271
|
-
const xe = /* @__PURE__ */ new Map(), Tt = /* @__PURE__ */ new Set(),
|
|
1275
|
+
const xe = /* @__PURE__ */ new Map(), Tt = /* @__PURE__ */ new Set(), Ii = async (a) => {
|
|
1272
1276
|
if (t.integrationAuthHandler) {
|
|
1273
1277
|
xe.set(a.authRequestId, { status: "connecting" }), D(_.getState());
|
|
1274
1278
|
try {
|
|
1275
1279
|
await t.integrationAuthHandler(a), xe.set(a.authRequestId, { status: "completed" });
|
|
1276
|
-
} catch (
|
|
1280
|
+
} catch (s) {
|
|
1277
1281
|
xe.set(a.authRequestId, {
|
|
1278
1282
|
status: "error",
|
|
1279
|
-
error:
|
|
1283
|
+
error: s instanceof Error ? s.message : `Could not connect ${a.appName}.`
|
|
1280
1284
|
});
|
|
1281
1285
|
}
|
|
1282
1286
|
D(_.getState());
|
|
1283
1287
|
}
|
|
1284
1288
|
}, on = (a = {}) => {
|
|
1285
|
-
Ee = !0, ae(!0, "newSession"), re(), X = !1, we(), _.startNewSession(a), Ft.clear(), xe.clear(), Tt.clear(),
|
|
1289
|
+
Ee = !0, ae(!0, "newSession"), re(), X = !1, we(), _.startNewSession(a), Ft.clear(), xe.clear(), Tt.clear(), S.value = "", b = [], Ge(), gt(S), F(), V(), S.focus(), D(_.getState());
|
|
1286
1290
|
}, At = () => {
|
|
1287
1291
|
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), on());
|
|
1288
1292
|
}, an = (a) => {
|
|
@@ -1293,17 +1297,17 @@ async function Ga(e = {}) {
|
|
|
1293
1297
|
Ze || (Ze = Ut(
|
|
1294
1298
|
"pluno-pa-widget__new-chat",
|
|
1295
1299
|
"New chat",
|
|
1296
|
-
|
|
1300
|
+
Cr(),
|
|
1297
1301
|
!1
|
|
1298
1302
|
), Ze.addEventListener("click", () => on()), q.insertBefore(Ze, Z));
|
|
1299
1303
|
}, D = (a) => {
|
|
1300
|
-
if (we(), Dn(a.lastErrorCode) ? je = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !
|
|
1304
|
+
if (we(), Dn(a.lastErrorCode) ? je = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (je = null), wn(
|
|
1301
1305
|
Qe,
|
|
1302
1306
|
t.billingStatus,
|
|
1303
1307
|
je
|
|
1304
1308
|
), t.loginRequired) {
|
|
1305
|
-
tn.clear(),
|
|
1306
|
-
|
|
1309
|
+
tn.clear(), Io(
|
|
1310
|
+
z,
|
|
1307
1311
|
B,
|
|
1308
1312
|
an,
|
|
1309
1313
|
St,
|
|
@@ -1315,8 +1319,8 @@ async function Ga(e = {}) {
|
|
|
1315
1319
|
return;
|
|
1316
1320
|
}
|
|
1317
1321
|
if (t.signupRequired) {
|
|
1318
|
-
tn.clear(),
|
|
1319
|
-
|
|
1322
|
+
tn.clear(), Io(
|
|
1323
|
+
z,
|
|
1320
1324
|
B,
|
|
1321
1325
|
an,
|
|
1322
1326
|
St,
|
|
@@ -1327,11 +1331,11 @@ async function Ga(e = {}) {
|
|
|
1327
1331
|
);
|
|
1328
1332
|
return;
|
|
1329
1333
|
}
|
|
1330
|
-
const
|
|
1331
|
-
Bn =
|
|
1332
|
-
const
|
|
1333
|
-
Ee = !1,
|
|
1334
|
-
|
|
1334
|
+
const s = lr(a), m = s !== Bn;
|
|
1335
|
+
Bn = s;
|
|
1336
|
+
const C = Ee || Oe.enabled;
|
|
1337
|
+
Ee = !1, Hr(
|
|
1338
|
+
z,
|
|
1335
1339
|
et,
|
|
1336
1340
|
B,
|
|
1337
1341
|
an,
|
|
@@ -1339,7 +1343,7 @@ async function Ga(e = {}) {
|
|
|
1339
1343
|
a,
|
|
1340
1344
|
Xe,
|
|
1341
1345
|
Xe !== null && bn(a, nn()),
|
|
1342
|
-
|
|
1346
|
+
C,
|
|
1343
1347
|
() => Oe.enabled,
|
|
1344
1348
|
Ft,
|
|
1345
1349
|
tn,
|
|
@@ -1361,10 +1365,10 @@ async function Ga(e = {}) {
|
|
|
1361
1365
|
states: xe,
|
|
1362
1366
|
initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
|
|
1363
1367
|
onConnect: (k) => {
|
|
1364
|
-
|
|
1368
|
+
Ii(k);
|
|
1365
1369
|
}
|
|
1366
1370
|
} : void 0,
|
|
1367
|
-
|
|
1371
|
+
Ai && !Wt ? {
|
|
1368
1372
|
dismissedCandidateIds: tt,
|
|
1369
1373
|
actionCandidate: Ct,
|
|
1370
1374
|
error: ct,
|
|
@@ -1374,7 +1378,7 @@ async function Ga(e = {}) {
|
|
|
1374
1378
|
De.add(k.id), F();
|
|
1375
1379
|
},
|
|
1376
1380
|
onReferralCopy: (k) => {
|
|
1377
|
-
|
|
1381
|
+
Ni(k);
|
|
1378
1382
|
},
|
|
1379
1383
|
onSocialShare: (k) => {
|
|
1380
1384
|
De.add(k.id), tt.add(k.id), F();
|
|
@@ -1383,29 +1387,29 @@ async function Ga(e = {}) {
|
|
|
1383
1387
|
De.add(k.id), tt.add(k.id), F(), ct = null, D(_.getState());
|
|
1384
1388
|
},
|
|
1385
1389
|
onDisable: (k) => {
|
|
1386
|
-
Wt = !0, De.add(k.id), tt.add(k.id), F(),
|
|
1390
|
+
Wt = !0, De.add(k.id), tt.add(k.id), F(), bl(t, !0), ct = null, D(_.getState());
|
|
1387
1391
|
}
|
|
1388
1392
|
} : void 0
|
|
1389
|
-
),
|
|
1393
|
+
), C ? (Ue = z.scrollTop, re()) : m && pr(a) && fi();
|
|
1390
1394
|
}, eo = async (a) => {
|
|
1391
1395
|
if (!t.integrationAuthStatusLoader)
|
|
1392
1396
|
return;
|
|
1393
|
-
const
|
|
1397
|
+
const s = a.messages.map((m) => m.integrationAuthRequest).filter(
|
|
1394
1398
|
(m) => !!m
|
|
1395
1399
|
);
|
|
1396
1400
|
await Promise.all(
|
|
1397
|
-
|
|
1401
|
+
s.map(async (m) => {
|
|
1398
1402
|
if (!(xe.has(m.authRequestId) || Tt.has(m.authRequestId))) {
|
|
1399
1403
|
Tt.add(m.authRequestId), xe.set(m.authRequestId, {
|
|
1400
1404
|
status: "checking"
|
|
1401
1405
|
}), D(_.getState());
|
|
1402
1406
|
try {
|
|
1403
|
-
const
|
|
1404
|
-
xe.set(m.authRequestId, { status:
|
|
1405
|
-
} catch (
|
|
1407
|
+
const C = await t.integrationAuthStatusLoader(m);
|
|
1408
|
+
xe.set(m.authRequestId, { status: C });
|
|
1409
|
+
} catch (C) {
|
|
1406
1410
|
xe.set(m.authRequestId, {
|
|
1407
1411
|
status: "error",
|
|
1408
|
-
error:
|
|
1412
|
+
error: C instanceof Error ? C.message : `Could not load ${m.appName} connection status.`
|
|
1409
1413
|
});
|
|
1410
1414
|
} finally {
|
|
1411
1415
|
Tt.delete(m.authRequestId);
|
|
@@ -1415,21 +1419,21 @@ async function Ga(e = {}) {
|
|
|
1415
1419
|
})
|
|
1416
1420
|
);
|
|
1417
1421
|
};
|
|
1418
|
-
return Qn =
|
|
1422
|
+
return Qn = Zi(
|
|
1419
1423
|
(a) => {
|
|
1420
1424
|
Xe = a, !Y && bn(_.getState(), nn()) && D(_.getState());
|
|
1421
1425
|
},
|
|
1422
1426
|
{
|
|
1423
1427
|
backendUrl: t.backendUrl,
|
|
1424
|
-
fetcher:
|
|
1428
|
+
fetcher: mi,
|
|
1425
1429
|
loader: t.activeUsersLoader
|
|
1426
1430
|
}
|
|
1427
1431
|
), _.on("state", (a) => {
|
|
1428
1432
|
Lt();
|
|
1429
|
-
const
|
|
1430
|
-
Xn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && ut && !Ke && Ve === null &&
|
|
1431
|
-
Ve = null,
|
|
1432
|
-
},
|
|
1433
|
+
const s = Xn && !a.isThinking;
|
|
1434
|
+
Xn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && ut && !Ke && Ve === null && ze?.hidden !== !1 && (Ve = window.setTimeout(() => {
|
|
1435
|
+
Ve = null, Ti();
|
|
1436
|
+
}, ca)), (!a.isThinking || a.assistantDraft.trim()) && (Zn(), Et()), s && !o.classList.contains("pluno-pa-widget--open") && (st = !0), Xt(), a.appearance ? (en = !0, J(
|
|
1433
1437
|
"web-sdk.widget",
|
|
1434
1438
|
"Agent state supplied appearance",
|
|
1435
1439
|
{
|
|
@@ -1443,7 +1447,7 @@ async function Ga(e = {}) {
|
|
|
1443
1447
|
fallbackColorScheme: t.colorScheme,
|
|
1444
1448
|
fallbackFontFamily: t.fontFamily
|
|
1445
1449
|
}
|
|
1446
|
-
), rn({}, "agent.state.appearance-cleared")), D(a), eo(a), V(),
|
|
1450
|
+
), rn({}, "agent.state.appearance-cleared")), D(a), eo(a), V(), s && qn();
|
|
1447
1451
|
}), D(_.getState()), eo(_.getState()), V(), Zt(), {
|
|
1448
1452
|
agent: _,
|
|
1449
1453
|
startNewChat: on,
|
|
@@ -1452,24 +1456,24 @@ async function Ga(e = {}) {
|
|
|
1452
1456
|
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), rn(a, "widgetHandle.updateAppearance");
|
|
1453
1457
|
},
|
|
1454
1458
|
updateBillingStatus: (a) => {
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1459
|
+
const s = a ?? null;
|
|
1460
|
+
To(
|
|
1457
1461
|
t.billingStatus,
|
|
1458
|
-
|
|
1462
|
+
s,
|
|
1459
1463
|
je
|
|
1460
|
-
) && (t.billingStatus =
|
|
1464
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (je = null), wn(
|
|
1461
1465
|
o.querySelector(".pluno-pa-widget__billing-status"),
|
|
1462
1466
|
t.billingStatus,
|
|
1463
1467
|
je
|
|
1464
1468
|
), V());
|
|
1465
1469
|
},
|
|
1466
1470
|
updateAuthGate: (a) => {
|
|
1467
|
-
const
|
|
1468
|
-
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), qe(), D(_.getState()), V(),
|
|
1471
|
+
const s = pt();
|
|
1472
|
+
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), qe(), D(_.getState()), V(), s && !pt() && Zt();
|
|
1469
1473
|
},
|
|
1470
1474
|
openPanel: (a) => {
|
|
1471
|
-
const
|
|
1472
|
-
be(
|
|
1475
|
+
const s = typeof a == "string" ? a : S.value, m = typeof a == "object" ? a.focusComposer !== !1 : !0;
|
|
1476
|
+
be(s, !1, m);
|
|
1473
1477
|
},
|
|
1474
1478
|
closePanel: jt,
|
|
1475
1479
|
updateDisplayState: (a) => {
|
|
@@ -1483,7 +1487,7 @@ async function Ga(e = {}) {
|
|
|
1483
1487
|
t.morningReport = a ?? null, D(_.getState());
|
|
1484
1488
|
},
|
|
1485
1489
|
destroy: () => {
|
|
1486
|
-
Y || (F(), Y = !0, Hn.disconnect(), Yn?.disconnect(),
|
|
1490
|
+
Y || (F(), Y = !0, Hn.disconnect(), Yn?.disconnect(), Ci(), y.defaultView?.removeEventListener(
|
|
1487
1491
|
"pointerdown",
|
|
1488
1492
|
Kn,
|
|
1489
1493
|
!0
|
|
@@ -1495,71 +1499,71 @@ async function Ga(e = {}) {
|
|
|
1495
1499
|
"focusin",
|
|
1496
1500
|
vt,
|
|
1497
1501
|
!0
|
|
1498
|
-
), window.removeEventListener("resize",
|
|
1502
|
+
), window.removeEventListener("resize", $n), Gn(), yi(), L !== null && window.clearTimeout(L), Zn(), Qn(), _.destroy(), Bt.release(), n.remove());
|
|
1499
1503
|
}
|
|
1500
1504
|
};
|
|
1501
|
-
async function
|
|
1505
|
+
async function Ni(a) {
|
|
1502
1506
|
if (!Ct) {
|
|
1503
1507
|
Ct = a, ct = null, D(_.getState());
|
|
1504
1508
|
try {
|
|
1505
1509
|
if (!t.referralLinkLoader)
|
|
1506
1510
|
throw new Error("Referral sharing is not available here.");
|
|
1507
|
-
const
|
|
1508
|
-
if (!
|
|
1511
|
+
const s = await t.referralLinkLoader();
|
|
1512
|
+
if (!s)
|
|
1509
1513
|
throw new Error("Pluno did not return a referral link.");
|
|
1510
|
-
await
|
|
1511
|
-
} catch (
|
|
1512
|
-
ct =
|
|
1514
|
+
await Ri(s), De.add(a.id), tt.add(a.id), F();
|
|
1515
|
+
} catch (s) {
|
|
1516
|
+
ct = s instanceof Error ? s.message : "Could not copy referral link.";
|
|
1513
1517
|
} finally {
|
|
1514
1518
|
Ct = null, D(_.getState());
|
|
1515
1519
|
}
|
|
1516
1520
|
}
|
|
1517
1521
|
}
|
|
1518
|
-
async function
|
|
1522
|
+
async function Ri(a) {
|
|
1519
1523
|
if (navigator.clipboard?.writeText)
|
|
1520
1524
|
try {
|
|
1521
1525
|
await navigator.clipboard.writeText(a);
|
|
1522
1526
|
return;
|
|
1523
1527
|
} catch {
|
|
1524
1528
|
}
|
|
1525
|
-
const
|
|
1529
|
+
const s = document.activeElement instanceof HTMLElement ? document.activeElement : null, m = document.createElement("textarea");
|
|
1526
1530
|
m.value = a, m.readOnly = !0, m.setAttribute("aria-hidden", "true"), m.style.position = "fixed", m.style.left = "-9999px", m.style.opacity = "0", document.body.appendChild(m);
|
|
1527
1531
|
try {
|
|
1528
1532
|
if (m.select(), m.setSelectionRange(0, a.length), !document.execCommand("copy"))
|
|
1529
1533
|
throw new Error("Could not copy referral link.");
|
|
1530
1534
|
} finally {
|
|
1531
|
-
m.remove(),
|
|
1535
|
+
m.remove(), s?.isConnected && s.focus({ preventScroll: !0 });
|
|
1532
1536
|
}
|
|
1533
1537
|
}
|
|
1534
|
-
function rn(a,
|
|
1535
|
-
const m = a.accentColor ?? t.accentColor,
|
|
1536
|
-
r =
|
|
1538
|
+
function rn(a, s) {
|
|
1539
|
+
const m = a.accentColor ?? t.accentColor, C = a.colorScheme ?? t.colorScheme, k = a.fontFamily ?? t.fontFamily, Te = a.scribbleStyle ?? t.scribbleStyle;
|
|
1540
|
+
r = wo(
|
|
1537
1541
|
m,
|
|
1538
1542
|
Te
|
|
1539
|
-
),
|
|
1543
|
+
), bo(o, r, {
|
|
1540
1544
|
accentColor: m,
|
|
1541
|
-
colorScheme:
|
|
1545
|
+
colorScheme: C,
|
|
1542
1546
|
fontFamily: k,
|
|
1543
1547
|
scribbleStyle: Te
|
|
1544
1548
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1545
|
-
source:
|
|
1549
|
+
source: s,
|
|
1546
1550
|
inputAppearance: a,
|
|
1547
1551
|
appliedAccentColor: m,
|
|
1548
|
-
appliedColorScheme:
|
|
1552
|
+
appliedColorScheme: C,
|
|
1549
1553
|
appliedFontFamily: k,
|
|
1550
1554
|
appliedScribbleStyle: Te,
|
|
1551
1555
|
cssAccent: o.style.getPropertyValue("--pluno-pa-accent")
|
|
1552
1556
|
});
|
|
1553
1557
|
}
|
|
1554
1558
|
}
|
|
1555
|
-
function
|
|
1559
|
+
function wo(e, t) {
|
|
1556
1560
|
return { accentColor: e, scribbleStyle: t };
|
|
1557
1561
|
}
|
|
1558
|
-
function $a(e) {
|
|
1559
|
-
const t = qa(e);
|
|
1560
|
-
return t === null ? "#fafafa" : ja(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1561
|
-
}
|
|
1562
1562
|
function qa(e) {
|
|
1563
|
+
const t = ja(e);
|
|
1564
|
+
return t === null ? "#fafafa" : Va(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1565
|
+
}
|
|
1566
|
+
function ja(e) {
|
|
1563
1567
|
const t = e.trim();
|
|
1564
1568
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1565
1569
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1571,14 +1575,14 @@ function qa(e) {
|
|
|
1571
1575
|
Number.parseInt(t[3] + t[3], 16)
|
|
1572
1576
|
] : null;
|
|
1573
1577
|
}
|
|
1574
|
-
function
|
|
1578
|
+
function Va([e, t, n]) {
|
|
1575
1579
|
const i = (o) => {
|
|
1576
1580
|
const r = o / 255;
|
|
1577
1581
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1578
1582
|
};
|
|
1579
1583
|
return 0.2126 * i(e) + 0.7152 * i(t) + 0.0722 * i(n);
|
|
1580
1584
|
}
|
|
1581
|
-
function
|
|
1585
|
+
function bo(e, t, n) {
|
|
1582
1586
|
e.classList.toggle(
|
|
1583
1587
|
"pluno-pa-widget--dark",
|
|
1584
1588
|
n.colorScheme === "dark"
|
|
@@ -1586,11 +1590,11 @@ function _o(e, t, n) {
|
|
|
1586
1590
|
"pluno-pa-widget--light",
|
|
1587
1591
|
n.colorScheme !== "dark"
|
|
1588
1592
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1589
|
-
const i = n.scribbleStyle ?
|
|
1593
|
+
const i = n.scribbleStyle ? Uo(n.accentColor) : n.accentColor;
|
|
1590
1594
|
e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
|
|
1591
1595
|
"--pluno-pa-accent-contrast",
|
|
1592
|
-
|
|
1593
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1596
|
+
qa(i)
|
|
1597
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Aa : n.fontFamily, n.scribbleStyle && Ka(e.ownerDocument);
|
|
1594
1598
|
const o = Array.from(
|
|
1595
1599
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1596
1600
|
);
|
|
@@ -1602,7 +1606,7 @@ function _o(e, t, n) {
|
|
|
1602
1606
|
)
|
|
1603
1607
|
);
|
|
1604
1608
|
}
|
|
1605
|
-
function
|
|
1609
|
+
function Ka(e) {
|
|
1606
1610
|
if (e.getElementById(ho))
|
|
1607
1611
|
return;
|
|
1608
1612
|
const t = e.createElement("style");
|
|
@@ -1614,7 +1618,7 @@ function Va(e) {
|
|
|
1614
1618
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1615
1619
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1616
1620
|
}
|
|
1617
|
-
function
|
|
1621
|
+
function Ya({
|
|
1618
1622
|
root: e,
|
|
1619
1623
|
launcher: t,
|
|
1620
1624
|
launcherDragHandle: n,
|
|
@@ -1622,18 +1626,18 @@ function Ka({
|
|
|
1622
1626
|
setPosition: o,
|
|
1623
1627
|
persist: r
|
|
1624
1628
|
}) {
|
|
1625
|
-
let l = null,
|
|
1629
|
+
let l = null, p = null, d = null, c = !1, g = null;
|
|
1626
1630
|
const h = () => {
|
|
1627
|
-
l = null,
|
|
1631
|
+
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1628
1632
|
}, f = (w) => {
|
|
1629
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId,
|
|
1633
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId, p = { x: w.clientX, y: w.clientY }, d = i(), c = !1, t.setPointerCapture?.(w.pointerId));
|
|
1630
1634
|
}, y = (w) => {
|
|
1631
|
-
if (l !== w.pointerId || !
|
|
1635
|
+
if (l !== w.pointerId || !p || !d)
|
|
1632
1636
|
return;
|
|
1633
1637
|
w.preventDefault();
|
|
1634
|
-
const R = w.clientX -
|
|
1635
|
-
!c && Math.hypot(R,
|
|
1636
|
-
},
|
|
1638
|
+
const R = w.clientX - p.x, M = w.clientY - p.y;
|
|
1639
|
+
!c && Math.hypot(R, M) < kn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: d.x + R, y: d.y + M }));
|
|
1640
|
+
}, v = (w) => {
|
|
1637
1641
|
l === w.pointerId && (w.preventDefault(), w.stopPropagation(), c && (g = { x: w.clientX, y: w.clientY }, r()), h());
|
|
1638
1642
|
}, O = (w) => {
|
|
1639
1643
|
l === w.pointerId && (w.preventDefault(), h());
|
|
@@ -1648,56 +1652,56 @@ function Ka({
|
|
|
1648
1652
|
}, W = (w) => {
|
|
1649
1653
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1650
1654
|
return;
|
|
1651
|
-
const R = w.shiftKey ?
|
|
1655
|
+
const R = w.shiftKey ? Ko : Vo, M = i();
|
|
1652
1656
|
let T = null;
|
|
1653
|
-
w.key === "ArrowUp" ? T = { x:
|
|
1657
|
+
w.key === "ArrowUp" ? T = { x: M.x, y: M.y - R } : w.key === "ArrowDown" ? T = { x: M.x, y: M.y + R } : w.key === "ArrowLeft" ? T = { x: M.x - R, y: M.y } : w.key === "ArrowRight" && (T = { x: M.x + R, y: M.y }), T && (w.preventDefault(), w.stopPropagation(), o(T), r());
|
|
1654
1658
|
};
|
|
1655
|
-
return t.addEventListener("pointerdown", f), t.addEventListener("pointermove", y), t.addEventListener("pointerup",
|
|
1656
|
-
t.removeEventListener("pointerdown", f), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup",
|
|
1659
|
+
return t.addEventListener("pointerdown", f), t.addEventListener("pointermove", y), t.addEventListener("pointerup", v), t.addEventListener("pointercancel", O), t.addEventListener("click", u, !0), n.addEventListener("keydown", W), () => {
|
|
1660
|
+
t.removeEventListener("pointerdown", f), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup", v), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", W);
|
|
1657
1661
|
};
|
|
1658
1662
|
}
|
|
1659
|
-
function
|
|
1663
|
+
function Xa({
|
|
1660
1664
|
root: e,
|
|
1661
1665
|
handles: t,
|
|
1662
1666
|
getBounds: n,
|
|
1663
1667
|
setBounds: i,
|
|
1664
1668
|
persist: o
|
|
1665
1669
|
}) {
|
|
1666
|
-
let r = null, l = null,
|
|
1670
|
+
let r = null, l = null, p = null, d = null, c = !1;
|
|
1667
1671
|
const g = () => {
|
|
1668
|
-
r = null, l = null,
|
|
1672
|
+
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1669
1673
|
}, h = (u) => {
|
|
1670
1674
|
const W = u.currentTarget, w = W.dataset.resizeDirection;
|
|
1671
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1675
|
+
!e.classList.contains("pluno-pa-widget--open") || !_o(w) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = w, p = { x: u.clientX, y: u.clientY }, d = n(), c = !1, W.setPointerCapture?.(u.pointerId));
|
|
1672
1676
|
}, f = (u) => {
|
|
1673
|
-
if (r !== u.pointerId || !l || !
|
|
1677
|
+
if (r !== u.pointerId || !l || !p || !d)
|
|
1674
1678
|
return;
|
|
1675
1679
|
u.preventDefault(), u.stopPropagation();
|
|
1676
|
-
const W = u.clientX -
|
|
1680
|
+
const W = u.clientX - p.x, w = u.clientY - p.y;
|
|
1677
1681
|
!c && Math.hypot(W, w) < kn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
|
|
1678
|
-
|
|
1682
|
+
xo(d, l, W, w)
|
|
1679
1683
|
));
|
|
1680
1684
|
}, y = (u) => {
|
|
1681
1685
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
|
|
1682
|
-
},
|
|
1686
|
+
}, v = (u) => {
|
|
1683
1687
|
r === u.pointerId && (u.preventDefault(), g());
|
|
1684
1688
|
}, O = (u) => {
|
|
1685
|
-
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ?
|
|
1689
|
+
const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Ko : Vo, M = n();
|
|
1686
1690
|
let T = 0, ne = 0;
|
|
1687
|
-
|
|
1691
|
+
_o(w) && (u.key === "ArrowLeft" ? T = -R : u.key === "ArrowRight" ? T = R : u.key === "ArrowUp" ? ne = -R : u.key === "ArrowDown" && (ne = R), !(T === 0 && ne === 0) && (u.preventDefault(), u.stopPropagation(), i(xo(M, w, T, ne)), o()));
|
|
1688
1692
|
};
|
|
1689
1693
|
for (const u of t)
|
|
1690
|
-
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", f), u.addEventListener("pointerup", y), u.addEventListener("pointercancel",
|
|
1694
|
+
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", f), u.addEventListener("pointerup", y), u.addEventListener("pointercancel", v), u.addEventListener("keydown", O);
|
|
1691
1695
|
return () => {
|
|
1692
1696
|
for (const u of t)
|
|
1693
|
-
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", f), u.removeEventListener("pointerup", y), u.removeEventListener("pointercancel",
|
|
1697
|
+
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", f), u.removeEventListener("pointerup", y), u.removeEventListener("pointercancel", v), u.removeEventListener("keydown", O);
|
|
1694
1698
|
};
|
|
1695
1699
|
}
|
|
1696
|
-
function
|
|
1700
|
+
function _o(e) {
|
|
1697
1701
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1698
1702
|
}
|
|
1699
|
-
function
|
|
1700
|
-
const o = te(), r =
|
|
1703
|
+
function xo(e, t, n, i) {
|
|
1704
|
+
const o = te(), r = yo({
|
|
1701
1705
|
leading: e.position.x,
|
|
1702
1706
|
length: e.size.width,
|
|
1703
1707
|
delta: n,
|
|
@@ -1709,7 +1713,7 @@ function yo(e, t, n, i) {
|
|
|
1709
1713
|
Rn,
|
|
1710
1714
|
o.width - N * 2
|
|
1711
1715
|
)
|
|
1712
|
-
}), l =
|
|
1716
|
+
}), l = yo({
|
|
1713
1717
|
leading: e.position.y,
|
|
1714
1718
|
length: e.size.height,
|
|
1715
1719
|
delta: i,
|
|
@@ -1718,7 +1722,7 @@ function yo(e, t, n, i) {
|
|
|
1718
1722
|
minLeading: He,
|
|
1719
1723
|
maxTrailing: o.height - N,
|
|
1720
1724
|
minLength: Math.min(
|
|
1721
|
-
|
|
1725
|
+
zn,
|
|
1722
1726
|
o.height - He - N
|
|
1723
1727
|
)
|
|
1724
1728
|
});
|
|
@@ -1727,7 +1731,7 @@ function yo(e, t, n, i) {
|
|
|
1727
1731
|
size: { width: r.length, height: l.length }
|
|
1728
1732
|
};
|
|
1729
1733
|
}
|
|
1730
|
-
function
|
|
1734
|
+
function yo({
|
|
1731
1735
|
leading: e,
|
|
1732
1736
|
length: t,
|
|
1733
1737
|
delta: n,
|
|
@@ -1735,7 +1739,7 @@ function vo({
|
|
|
1735
1739
|
resizeTrailing: o,
|
|
1736
1740
|
minLeading: r,
|
|
1737
1741
|
maxTrailing: l,
|
|
1738
|
-
minLength:
|
|
1742
|
+
minLength: p
|
|
1739
1743
|
}) {
|
|
1740
1744
|
const d = e + t;
|
|
1741
1745
|
if (i) {
|
|
@@ -1744,7 +1748,7 @@ function vo({
|
|
|
1744
1748
|
const h = ee(
|
|
1745
1749
|
c,
|
|
1746
1750
|
r,
|
|
1747
|
-
d -
|
|
1751
|
+
d - p
|
|
1748
1752
|
);
|
|
1749
1753
|
return { leading: h, length: d - h };
|
|
1750
1754
|
}
|
|
@@ -1760,7 +1764,7 @@ function vo({
|
|
|
1760
1764
|
if (c <= l) {
|
|
1761
1765
|
const h = ee(
|
|
1762
1766
|
c,
|
|
1763
|
-
e +
|
|
1767
|
+
e + p,
|
|
1764
1768
|
l
|
|
1765
1769
|
);
|
|
1766
1770
|
return { leading: e, length: h - e };
|
|
@@ -1776,37 +1780,39 @@ function vo({
|
|
|
1776
1780
|
}
|
|
1777
1781
|
function Dt(e, t = !0) {
|
|
1778
1782
|
const n = te();
|
|
1779
|
-
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1780
|
-
|
|
1783
|
+
if (e.classList.contains("pluno-pa-widget--minimized")) {
|
|
1784
|
+
const r = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? Ia : Pa;
|
|
1785
|
+
return { width: r, height: r };
|
|
1786
|
+
}
|
|
1781
1787
|
const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1782
1788
|
return {
|
|
1783
|
-
width: t && o && i.width > 0 ? i.width : Math.min(
|
|
1784
|
-
height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1789
|
+
width: t && o && i.width > 0 ? i.width : Math.min(Go, n.width - 36),
|
|
1790
|
+
height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? Ra : qo
|
|
1785
1791
|
};
|
|
1786
1792
|
}
|
|
1787
|
-
function
|
|
1793
|
+
function Za() {
|
|
1788
1794
|
const e = te();
|
|
1789
1795
|
return {
|
|
1790
1796
|
width: Math.min(
|
|
1791
1797
|
ee(
|
|
1792
1798
|
e.width * Ma,
|
|
1793
1799
|
Rn,
|
|
1794
|
-
|
|
1800
|
+
za
|
|
1795
1801
|
),
|
|
1796
1802
|
e.width - N * 2
|
|
1797
1803
|
),
|
|
1798
1804
|
height: Math.min(
|
|
1799
1805
|
ee(
|
|
1800
|
-
e.height *
|
|
1801
|
-
|
|
1802
|
-
|
|
1806
|
+
e.height * Oa,
|
|
1807
|
+
zn,
|
|
1808
|
+
Da
|
|
1803
1809
|
),
|
|
1804
1810
|
e.height - He - N
|
|
1805
1811
|
)
|
|
1806
1812
|
};
|
|
1807
1813
|
}
|
|
1808
1814
|
function Je(e = null) {
|
|
1809
|
-
return e ? Ot(e) :
|
|
1815
|
+
return e ? Ot(e) : Za();
|
|
1810
1816
|
}
|
|
1811
1817
|
function Ot(e) {
|
|
1812
1818
|
const t = te();
|
|
@@ -1825,7 +1831,7 @@ function Ot(e) {
|
|
|
1825
1831
|
height: ee(
|
|
1826
1832
|
e.height,
|
|
1827
1833
|
Math.min(
|
|
1828
|
-
|
|
1834
|
+
zn,
|
|
1829
1835
|
t.height - He - N
|
|
1830
1836
|
),
|
|
1831
1837
|
Math.max(
|
|
@@ -1843,7 +1849,7 @@ function dn(e, t) {
|
|
|
1843
1849
|
const n = Ot(t);
|
|
1844
1850
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1845
1851
|
}
|
|
1846
|
-
function
|
|
1852
|
+
function Ja(e, t, n) {
|
|
1847
1853
|
const i = Number.parseFloat(e.style.left), o = Number.parseFloat(e.style.top);
|
|
1848
1854
|
if (Number.isFinite(i) && Number.isFinite(o))
|
|
1849
1855
|
return { x: i, y: o };
|
|
@@ -1862,9 +1868,9 @@ function cn(e, t, n) {
|
|
|
1862
1868
|
e,
|
|
1863
1869
|
Nt(t, i),
|
|
1864
1870
|
i
|
|
1865
|
-
) :
|
|
1871
|
+
) : Qa(n === "bottom-left" ? "bottom-left" : "bottom-right", i, Na);
|
|
1866
1872
|
}
|
|
1867
|
-
function
|
|
1873
|
+
function Qa(e, t, n) {
|
|
1868
1874
|
const i = te();
|
|
1869
1875
|
return {
|
|
1870
1876
|
x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
|
|
@@ -1872,7 +1878,7 @@ function Ja(e, t, n) {
|
|
|
1872
1878
|
};
|
|
1873
1879
|
}
|
|
1874
1880
|
function Ln(e, t, n) {
|
|
1875
|
-
const i = te(), o = N +
|
|
1881
|
+
const i = te(), o = N + tr(e);
|
|
1876
1882
|
return {
|
|
1877
1883
|
x: ee(
|
|
1878
1884
|
t.x,
|
|
@@ -1899,20 +1905,20 @@ function Nt(e, t) {
|
|
|
1899
1905
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1900
1906
|
};
|
|
1901
1907
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const n =
|
|
1908
|
+
function vo(e, t) {
|
|
1909
|
+
const n = er(e, t), i = te();
|
|
1904
1910
|
return {
|
|
1905
1911
|
anchor: n,
|
|
1906
1912
|
x: n.endsWith("right") ? i.width - e.x - t.width : e.x,
|
|
1907
1913
|
y: n.startsWith("bottom") ? i.height - e.y - t.height : e.y
|
|
1908
1914
|
};
|
|
1909
1915
|
}
|
|
1910
|
-
function
|
|
1916
|
+
function er(e, t) {
|
|
1911
1917
|
const n = te(), i = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = i <= n.width / 2 ? "left" : "right";
|
|
1912
1918
|
return `${r}-${l}`;
|
|
1913
1919
|
}
|
|
1914
|
-
function
|
|
1915
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1920
|
+
function tr(e) {
|
|
1921
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Wa : Fa;
|
|
1916
1922
|
}
|
|
1917
1923
|
function un(e, t, n, i = null) {
|
|
1918
1924
|
const o = Dt(e), r = Je(i), l = {
|
|
@@ -1949,16 +1955,16 @@ function We(e, t) {
|
|
|
1949
1955
|
}
|
|
1950
1956
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1951
1957
|
}
|
|
1952
|
-
function
|
|
1958
|
+
function nr(e, t) {
|
|
1953
1959
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1954
1960
|
}
|
|
1955
|
-
function
|
|
1961
|
+
function So(e) {
|
|
1956
1962
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1957
1963
|
}
|
|
1958
1964
|
function te() {
|
|
1959
1965
|
return {
|
|
1960
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1961
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1966
|
+
width: window.innerWidth || document.documentElement.clientWidth || Go + N * 2,
|
|
1967
|
+
height: window.innerHeight || document.documentElement.clientHeight || qo + N * 2
|
|
1962
1968
|
};
|
|
1963
1969
|
}
|
|
1964
1970
|
function gn(e) {
|
|
@@ -1983,31 +1989,31 @@ function J(e, t, n) {
|
|
|
1983
1989
|
details: n
|
|
1984
1990
|
}, r = i.__plunoProductAgentDiagnostics__ ?? [];
|
|
1985
1991
|
r.push(o), r.length > 120 && r.splice(0, r.length - 120), i.__plunoProductAgentDiagnostics__ = r, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1986
|
-
new CustomEvent(
|
|
1992
|
+
new CustomEvent(Ca, { detail: o })
|
|
1987
1993
|
);
|
|
1988
1994
|
}
|
|
1989
|
-
function
|
|
1995
|
+
function or(e, t) {
|
|
1990
1996
|
J("web-sdk.widget.position", e, t);
|
|
1991
1997
|
}
|
|
1992
1998
|
function hn(e, t, n, i) {
|
|
1993
1999
|
const o = t.value.trim();
|
|
1994
2000
|
return !o && n.length === 0 ? n : (i(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1995
|
-
attachments: n.length > 0 ? n.map(
|
|
2001
|
+
attachments: n.length > 0 ? n.map(rr) : void 0
|
|
1996
2002
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1997
2003
|
}
|
|
1998
|
-
function
|
|
2004
|
+
function ir(e, t, n) {
|
|
1999
2005
|
const i = e.activeElement;
|
|
2000
2006
|
return i === n ? "composer" : i === t ? "launcher" : null;
|
|
2001
2007
|
}
|
|
2002
|
-
function
|
|
2003
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
2008
|
+
function ar(e, t, n, i) {
|
|
2009
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > ua)
|
|
2004
2010
|
return;
|
|
2005
2011
|
const o = e.focusedInput === "composer" ? i : n;
|
|
2006
2012
|
o === i && !t.classList.contains("pluno-pa-widget--open") || o === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
2007
2013
|
!o.isConnected || o.readOnly || (o.focus(), o.setSelectionRange(o.value.length, o.value.length));
|
|
2008
2014
|
});
|
|
2009
2015
|
}
|
|
2010
|
-
function
|
|
2016
|
+
function rr(e) {
|
|
2011
2017
|
return e;
|
|
2012
2018
|
}
|
|
2013
2019
|
function gt(e) {
|
|
@@ -2018,7 +2024,7 @@ function ht(e, t = () => !0) {
|
|
|
2018
2024
|
t() && (e.scrollTop = e.scrollHeight);
|
|
2019
2025
|
});
|
|
2020
2026
|
}
|
|
2021
|
-
function
|
|
2027
|
+
function lr(e) {
|
|
2022
2028
|
const t = e.messages[e.messages.length - 1];
|
|
2023
2029
|
return [
|
|
2024
2030
|
e.messages.length,
|
|
@@ -2029,13 +2035,13 @@ function rr(e) {
|
|
|
2029
2035
|
e.lastError ?? ""
|
|
2030
2036
|
].join(":");
|
|
2031
2037
|
}
|
|
2032
|
-
function
|
|
2038
|
+
function pr(e) {
|
|
2033
2039
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
2034
2040
|
}
|
|
2035
2041
|
function sr(e) {
|
|
2036
2042
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
2037
2043
|
}
|
|
2038
|
-
function
|
|
2044
|
+
function dr(e) {
|
|
2039
2045
|
const t = e.currentPage;
|
|
2040
2046
|
if (typeof t?.url == "string" && t.url.trim())
|
|
2041
2047
|
try {
|
|
@@ -2046,7 +2052,7 @@ function pr(e) {
|
|
|
2046
2052
|
}
|
|
2047
2053
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
2048
2054
|
}
|
|
2049
|
-
function
|
|
2055
|
+
function cr(e, t) {
|
|
2050
2056
|
const n = new Date(e).getTime();
|
|
2051
2057
|
if (!Number.isFinite(n))
|
|
2052
2058
|
return "now";
|
|
@@ -2057,14 +2063,14 @@ function dr(e, t) {
|
|
|
2057
2063
|
];
|
|
2058
2064
|
for (const [r, l] of o)
|
|
2059
2065
|
if (i >= l) {
|
|
2060
|
-
const
|
|
2061
|
-
return r === "min" ? `${
|
|
2066
|
+
const p = Math.max(1, Math.floor(i / l));
|
|
2067
|
+
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
2062
2068
|
}
|
|
2063
2069
|
return "now";
|
|
2064
2070
|
}
|
|
2065
|
-
function
|
|
2066
|
-
e.appendChild(
|
|
2067
|
-
|
|
2071
|
+
function ur(e, t, n, i, o) {
|
|
2072
|
+
e.appendChild(vr()), e.appendChild(
|
|
2073
|
+
gr(
|
|
2068
2074
|
t,
|
|
2069
2075
|
n,
|
|
2070
2076
|
i,
|
|
@@ -2074,19 +2080,20 @@ function cr(e, t, n, i, o) {
|
|
|
2074
2080
|
Ut(
|
|
2075
2081
|
"pluno-pa-widget__close",
|
|
2076
2082
|
"Close",
|
|
2077
|
-
|
|
2083
|
+
Sr(16),
|
|
2078
2084
|
!0
|
|
2079
2085
|
)
|
|
2080
|
-
), e.appendChild(
|
|
2086
|
+
), e.appendChild(hr(n));
|
|
2081
2087
|
}
|
|
2082
|
-
function
|
|
2088
|
+
function gr(e, t, n, i) {
|
|
2083
2089
|
const o = document.createElement("form");
|
|
2084
2090
|
if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
2091
|
+
o.classList.add("pluno-pa-widget__launcher--movable");
|
|
2085
2092
|
const d = document.createElement("button");
|
|
2086
2093
|
d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", o.appendChild(d);
|
|
2087
2094
|
}
|
|
2088
2095
|
o.appendChild(
|
|
2089
|
-
|
|
2096
|
+
ei(
|
|
2090
2097
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
2091
2098
|
10
|
|
2092
2099
|
)
|
|
@@ -2100,37 +2107,37 @@ function ur(e, t, n, i) {
|
|
|
2100
2107
|
r.className = "pluno-pa-widget__launcher-run-indicator", o.appendChild(r);
|
|
2101
2108
|
const l = document.createElement("input");
|
|
2102
2109
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), o.appendChild(l);
|
|
2103
|
-
const
|
|
2104
|
-
if (
|
|
2110
|
+
const p = ft("Working...");
|
|
2111
|
+
if (p.classList.add("pluno-pa-widget__status--launcher"), o.appendChild(p), i) {
|
|
2105
2112
|
const d = document.createElement("button");
|
|
2106
2113
|
d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", o.appendChild(d);
|
|
2107
2114
|
}
|
|
2108
2115
|
return o;
|
|
2109
2116
|
}
|
|
2110
|
-
function
|
|
2117
|
+
function hr(e) {
|
|
2111
2118
|
const t = document.createElement("section");
|
|
2112
2119
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
2113
|
-
|
|
2120
|
+
ei("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
2114
2121
|
);
|
|
2115
2122
|
const n = document.createElement("div");
|
|
2116
2123
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
2117
2124
|
const i = document.createElement("main");
|
|
2118
|
-
i.className = "pluno-pa-widget__timeline", i.appendChild(
|
|
2125
|
+
i.className = "pluno-pa-widget__timeline", i.appendChild(_r(e));
|
|
2119
2126
|
const o = document.createElement("div");
|
|
2120
2127
|
o.className = "pluno-pa-widget__timeline-bottom-sentinel", o.setAttribute("aria-hidden", "true"), i.appendChild(o), n.appendChild(i);
|
|
2121
2128
|
const r = document.createElement("div");
|
|
2122
2129
|
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
2123
2130
|
const l = document.createElement("button");
|
|
2124
2131
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
2125
|
-
const
|
|
2126
|
-
return
|
|
2132
|
+
const p = document.createElement("div");
|
|
2133
|
+
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
2127
2134
|
Ut(
|
|
2128
2135
|
"pluno-pa-widget__history",
|
|
2129
2136
|
Tn(),
|
|
2130
|
-
|
|
2137
|
+
Er(),
|
|
2131
2138
|
!0
|
|
2132
2139
|
)
|
|
2133
|
-
), n.appendChild(
|
|
2140
|
+
), n.appendChild(p), n.appendChild(br()), t.appendChild(n), t.appendChild(mr()), t.appendChild(fr()), t.appendChild(wr()), t.appendChild(Ae("left", "Resize Pluno from left")), t.appendChild(
|
|
2134
2141
|
Ae("right", "Resize Pluno from right")
|
|
2135
2142
|
), t.appendChild(Ae("top", "Resize Pluno from top")), t.appendChild(
|
|
2136
2143
|
Ae("bottom", "Resize Pluno from bottom")
|
|
@@ -2151,7 +2158,7 @@ function Ae(e, t) {
|
|
|
2151
2158
|
`pluno-pa-widget__resize-handle--${e}`
|
|
2152
2159
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
2153
2160
|
}
|
|
2154
|
-
function
|
|
2161
|
+
function mr() {
|
|
2155
2162
|
const e = document.createElement("div");
|
|
2156
2163
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
2157
2164
|
const t = document.createElement("span");
|
|
@@ -2165,7 +2172,7 @@ function hr() {
|
|
|
2165
2172
|
const r = document.createElement("button");
|
|
2166
2173
|
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(i, o, r), e.append(t, n), e;
|
|
2167
2174
|
}
|
|
2168
|
-
function
|
|
2175
|
+
function fr() {
|
|
2169
2176
|
const e = document.createElement("div");
|
|
2170
2177
|
e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
|
|
2171
2178
|
const t = document.createElement("span");
|
|
@@ -2177,7 +2184,7 @@ function mr() {
|
|
|
2177
2184
|
const o = document.createElement("button");
|
|
2178
2185
|
return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", o.textContent = "Not now", n.append(i, o), e.append(t, n), e;
|
|
2179
2186
|
}
|
|
2180
|
-
function
|
|
2187
|
+
function wr() {
|
|
2181
2188
|
const e = document.createElement("form");
|
|
2182
2189
|
e.className = "pluno-pa-widget__composer";
|
|
2183
2190
|
const t = document.createElement("div");
|
|
@@ -2191,11 +2198,11 @@ function fr() {
|
|
|
2191
2198
|
const r = document.createElement("input");
|
|
2192
2199
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
|
|
2193
2200
|
const l = document.createElement("button");
|
|
2194
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2201
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Lr()), l.appendChild(Tr()), o.appendChild(l);
|
|
2202
|
+
const p = document.createElement("textarea");
|
|
2203
|
+
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
|
|
2197
2204
|
const d = document.createElement("button");
|
|
2198
|
-
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(
|
|
2205
|
+
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(ni()), o.appendChild(d), e.appendChild(o);
|
|
2199
2206
|
const c = document.createElement("div");
|
|
2200
2207
|
c.className = "pluno-pa-widget__composer-meta";
|
|
2201
2208
|
const g = document.createElement("a");
|
|
@@ -2206,7 +2213,7 @@ function fr() {
|
|
|
2206
2213
|
function Tn() {
|
|
2207
2214
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
2208
2215
|
}
|
|
2209
|
-
function
|
|
2216
|
+
function br() {
|
|
2210
2217
|
const e = document.createElement("section");
|
|
2211
2218
|
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Tn());
|
|
2212
2219
|
const t = document.createElement("div");
|
|
@@ -2216,7 +2223,7 @@ function wr() {
|
|
|
2216
2223
|
const i = Ut(
|
|
2217
2224
|
"pluno-pa-widget__history-close",
|
|
2218
2225
|
"Close recent chats",
|
|
2219
|
-
|
|
2226
|
+
kr(),
|
|
2220
2227
|
!1
|
|
2221
2228
|
);
|
|
2222
2229
|
t.append(n, i);
|
|
@@ -2225,20 +2232,20 @@ function wr() {
|
|
|
2225
2232
|
const r = document.createElement("p");
|
|
2226
2233
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, o, r), e;
|
|
2227
2234
|
}
|
|
2228
|
-
function
|
|
2235
|
+
function _r(e) {
|
|
2229
2236
|
const t = document.createElement("div");
|
|
2230
2237
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
2231
2238
|
Ie(
|
|
2232
2239
|
"pluno-pa-widget__character--empty",
|
|
2233
2240
|
e
|
|
2234
2241
|
)
|
|
2235
|
-
), t.appendChild(
|
|
2242
|
+
), t.appendChild(Zo()), t;
|
|
2236
2243
|
}
|
|
2237
|
-
function
|
|
2244
|
+
function Zo() {
|
|
2238
2245
|
const e = document.createElement("div");
|
|
2239
2246
|
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;
|
|
2240
2247
|
}
|
|
2241
|
-
function
|
|
2248
|
+
function Jo(e, t) {
|
|
2242
2249
|
e.replaceChildren(), e.setAttribute(
|
|
2243
2250
|
"aria-label",
|
|
2244
2251
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -2251,16 +2258,16 @@ function Qo(e, t) {
|
|
|
2251
2258
|
);
|
|
2252
2259
|
}
|
|
2253
2260
|
function Ie(e, t) {
|
|
2254
|
-
const n = `pluno-pa-character-${
|
|
2255
|
-
|
|
2256
|
-
const i = t.scribbleStyle ?
|
|
2261
|
+
const n = `pluno-pa-character-${fo}`;
|
|
2262
|
+
fo += 1;
|
|
2263
|
+
const i = t.scribbleStyle ? yr(t.accentColor, n) : xr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
|
|
2257
2264
|
return i.setAttribute(
|
|
2258
2265
|
"class",
|
|
2259
2266
|
o.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
2260
2267
|
), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
|
|
2261
2268
|
}
|
|
2262
|
-
function
|
|
2263
|
-
const n =
|
|
2269
|
+
function xr(e, t) {
|
|
2270
|
+
const n = Ui(e), i = {
|
|
2264
2271
|
boltFill: `${t}-boltFill`,
|
|
2265
2272
|
boltEdge: `${t}-boltEdge`,
|
|
2266
2273
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -2271,7 +2278,7 @@ function _r(e, t) {
|
|
|
2271
2278
|
eyeShadow: `${t}-eyeShadow`,
|
|
2272
2279
|
pupilGloss: `${t}-pupilGloss`,
|
|
2273
2280
|
boltClip: `${t}-boltClip`
|
|
2274
|
-
}, o =
|
|
2281
|
+
}, o = Qo(), r = x(o, "defs"), l = x(r, "linearGradient", {
|
|
2275
2282
|
id: i.boltFill,
|
|
2276
2283
|
x1: "420",
|
|
2277
2284
|
y1: "180",
|
|
@@ -2279,8 +2286,8 @@ function _r(e, t) {
|
|
|
2279
2286
|
y2: "1040",
|
|
2280
2287
|
gradientUnits: "userSpaceOnUse"
|
|
2281
2288
|
});
|
|
2282
|
-
|
|
2283
|
-
const
|
|
2289
|
+
$(l, "0", n.top), $(l, "0.36", n.middle), $(l, "0.72", n.bottom), $(l, "1", n.bottom);
|
|
2290
|
+
const p = x(r, "linearGradient", {
|
|
2284
2291
|
id: i.boltEdge,
|
|
2285
2292
|
x1: "470",
|
|
2286
2293
|
y1: "145",
|
|
@@ -2288,28 +2295,28 @@ function _r(e, t) {
|
|
|
2288
2295
|
y2: "980",
|
|
2289
2296
|
gradientUnits: "userSpaceOnUse"
|
|
2290
2297
|
});
|
|
2291
|
-
|
|
2298
|
+
$(p, "0", n.edgeStart), $(p, "0.32", n.edgeMiddle), $(p, "0.78", n.edgeEnd), $(p, "1", n.edgeEnd);
|
|
2292
2299
|
const d = x(r, "radialGradient", {
|
|
2293
2300
|
id: i.boltGlow,
|
|
2294
2301
|
cx: "50%",
|
|
2295
2302
|
cy: "22%",
|
|
2296
2303
|
r: "82%"
|
|
2297
2304
|
});
|
|
2298
|
-
|
|
2305
|
+
$(d, "0", n.glow, "0.72"), $(d, "0.5", n.middle, "0.44"), $(d, "1", n.bottom, "0");
|
|
2299
2306
|
const c = x(r, "radialGradient", {
|
|
2300
2307
|
id: i.eyeWhite,
|
|
2301
2308
|
cx: "35%",
|
|
2302
2309
|
cy: "25%",
|
|
2303
2310
|
r: "70%"
|
|
2304
2311
|
});
|
|
2305
|
-
|
|
2312
|
+
$(c, "0", "#ffffff"), $(c, "0.72", "#ffffff"), $(c, "1", "#e5e5e5");
|
|
2306
2313
|
const g = x(r, "radialGradient", {
|
|
2307
2314
|
id: i.pupil,
|
|
2308
2315
|
cx: "42%",
|
|
2309
2316
|
cy: "38%",
|
|
2310
2317
|
r: "65%"
|
|
2311
2318
|
});
|
|
2312
|
-
|
|
2319
|
+
$(g, "0", "#2a1f10"), $(g, "0.52", "#080604"), $(g, "1", "#000000");
|
|
2313
2320
|
const h = x(r, "filter", {
|
|
2314
2321
|
id: i.softDropShadow,
|
|
2315
2322
|
x: "-18%",
|
|
@@ -2373,7 +2380,7 @@ function _r(e, t) {
|
|
|
2373
2380
|
"flood-color": n.shadow,
|
|
2374
2381
|
"flood-opacity": "0.3"
|
|
2375
2382
|
});
|
|
2376
|
-
const
|
|
2383
|
+
const v = x(r, "filter", {
|
|
2377
2384
|
id: i.pupilGloss,
|
|
2378
2385
|
x: "-15%",
|
|
2379
2386
|
y: "-15%",
|
|
@@ -2381,7 +2388,7 @@ function _r(e, t) {
|
|
|
2381
2388
|
height: "130%",
|
|
2382
2389
|
"color-interpolation-filters": "sRGB"
|
|
2383
2390
|
});
|
|
2384
|
-
x(
|
|
2391
|
+
x(v, "feDropShadow", {
|
|
2385
2392
|
dx: "0",
|
|
2386
2393
|
dy: "3",
|
|
2387
2394
|
stdDeviation: "3",
|
|
@@ -2389,12 +2396,12 @@ function _r(e, t) {
|
|
|
2389
2396
|
"flood-opacity": "0.22"
|
|
2390
2397
|
});
|
|
2391
2398
|
const O = x(r, "clipPath", { id: i.boltClip });
|
|
2392
|
-
x(O, "path", { d:
|
|
2399
|
+
x(O, "path", { d: zt });
|
|
2393
2400
|
const u = x(o, "g", {
|
|
2394
2401
|
filter: Q(i.softDropShadow)
|
|
2395
2402
|
});
|
|
2396
2403
|
x(u, "path", {
|
|
2397
|
-
d:
|
|
2404
|
+
d: zt,
|
|
2398
2405
|
fill: Q(i.boltEdge)
|
|
2399
2406
|
});
|
|
2400
2407
|
const W = "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";
|
|
@@ -2434,7 +2441,7 @@ function _r(e, t) {
|
|
|
2434
2441
|
opacity: "0.48"
|
|
2435
2442
|
});
|
|
2436
2443
|
const R = x(o, "g", { filter: Q(i.eyeShadow) });
|
|
2437
|
-
return
|
|
2444
|
+
return Co(
|
|
2438
2445
|
R,
|
|
2439
2446
|
"rotate(-2 528 463)",
|
|
2440
2447
|
"528",
|
|
@@ -2444,7 +2451,7 @@ function _r(e, t) {
|
|
|
2444
2451
|
"557",
|
|
2445
2452
|
"447",
|
|
2446
2453
|
i
|
|
2447
|
-
),
|
|
2454
|
+
), Co(
|
|
2448
2455
|
R,
|
|
2449
2456
|
"rotate(2 717 462)",
|
|
2450
2457
|
"717",
|
|
@@ -2456,13 +2463,13 @@ function _r(e, t) {
|
|
|
2456
2463
|
i
|
|
2457
2464
|
), o;
|
|
2458
2465
|
}
|
|
2459
|
-
function
|
|
2460
|
-
const n =
|
|
2466
|
+
function yr(e, t) {
|
|
2467
|
+
const n = Uo(e), i = {
|
|
2461
2468
|
clip: `${t}-scribbleBoltClip`,
|
|
2462
2469
|
wobble: `${t}-scribbleBoltWobble`
|
|
2463
|
-
}, o =
|
|
2464
|
-
x(l, "path", { d:
|
|
2465
|
-
const
|
|
2470
|
+
}, o = Qo(), r = x(o, "defs"), l = x(r, "clipPath", { id: i.clip });
|
|
2471
|
+
x(l, "path", { d: zt });
|
|
2472
|
+
const p = x(r, "filter", {
|
|
2466
2473
|
id: i.wobble,
|
|
2467
2474
|
x: "-10%",
|
|
2468
2475
|
y: "-10%",
|
|
@@ -2470,13 +2477,13 @@ function xr(e, t) {
|
|
|
2470
2477
|
height: "120%",
|
|
2471
2478
|
"color-interpolation-filters": "sRGB"
|
|
2472
2479
|
});
|
|
2473
|
-
x(
|
|
2480
|
+
x(p, "feTurbulence", {
|
|
2474
2481
|
type: "fractalNoise",
|
|
2475
2482
|
baseFrequency: "0.011",
|
|
2476
2483
|
numOctaves: "3",
|
|
2477
2484
|
seed: "7",
|
|
2478
2485
|
result: "noise"
|
|
2479
|
-
}), x(
|
|
2486
|
+
}), x(p, "feDisplacementMap", {
|
|
2480
2487
|
in: "SourceGraphic",
|
|
2481
2488
|
in2: "noise",
|
|
2482
2489
|
scale: "16",
|
|
@@ -2487,7 +2494,7 @@ function xr(e, t) {
|
|
|
2487
2494
|
"clip-path": Q(i.clip)
|
|
2488
2495
|
});
|
|
2489
2496
|
return x(c, "path", {
|
|
2490
|
-
d:
|
|
2497
|
+
d: Oi(),
|
|
2491
2498
|
fill: "none",
|
|
2492
2499
|
stroke: n,
|
|
2493
2500
|
"stroke-width": "56",
|
|
@@ -2496,12 +2503,12 @@ function xr(e, t) {
|
|
|
2496
2503
|
opacity: "0.9",
|
|
2497
2504
|
transform: "rotate(-14 627 600)"
|
|
2498
2505
|
}), x(d, "path", {
|
|
2499
|
-
d:
|
|
2506
|
+
d: zt,
|
|
2500
2507
|
fill: "none",
|
|
2501
|
-
stroke:
|
|
2508
|
+
stroke: Mt,
|
|
2502
2509
|
"stroke-width": "18",
|
|
2503
2510
|
"stroke-linejoin": "round"
|
|
2504
|
-
}),
|
|
2511
|
+
}), Eo(
|
|
2505
2512
|
d,
|
|
2506
2513
|
"rotate(-2 528 463)",
|
|
2507
2514
|
"528",
|
|
@@ -2510,7 +2517,7 @@ function xr(e, t) {
|
|
|
2510
2517
|
"473",
|
|
2511
2518
|
"557",
|
|
2512
2519
|
"447"
|
|
2513
|
-
),
|
|
2520
|
+
), Eo(
|
|
2514
2521
|
d,
|
|
2515
2522
|
"rotate(2 717 462)",
|
|
2516
2523
|
"717",
|
|
@@ -2521,13 +2528,13 @@ function xr(e, t) {
|
|
|
2521
2528
|
"447"
|
|
2522
2529
|
), o;
|
|
2523
2530
|
}
|
|
2524
|
-
function
|
|
2531
|
+
function Qo() {
|
|
2525
2532
|
return P("svg", {
|
|
2526
|
-
xmlns:
|
|
2533
|
+
xmlns: jo,
|
|
2527
2534
|
viewBox: "0 0 1254 1254"
|
|
2528
2535
|
});
|
|
2529
2536
|
}
|
|
2530
|
-
function
|
|
2537
|
+
function Co(e, t, n, i, o, r, l, p, d) {
|
|
2531
2538
|
const c = x(e, "g", { transform: t });
|
|
2532
2539
|
x(c, "ellipse", {
|
|
2533
2540
|
cx: n,
|
|
@@ -2544,12 +2551,12 @@ function Eo(e, t, n, i, o, r, l, s, d) {
|
|
|
2544
2551
|
filter: Q(d.pupilGloss)
|
|
2545
2552
|
}), x(c, "circle", {
|
|
2546
2553
|
cx: l,
|
|
2547
|
-
cy:
|
|
2554
|
+
cy: p,
|
|
2548
2555
|
r: "18",
|
|
2549
2556
|
fill: "#ffffff"
|
|
2550
2557
|
});
|
|
2551
2558
|
}
|
|
2552
|
-
function
|
|
2559
|
+
function Eo(e, t, n, i, o, r, l, p) {
|
|
2553
2560
|
const d = x(e, "g", { transform: t });
|
|
2554
2561
|
x(d, "ellipse", {
|
|
2555
2562
|
cx: n,
|
|
@@ -2557,17 +2564,17 @@ function ko(e, t, n, i, o, r, l, s) {
|
|
|
2557
2564
|
rx: "73",
|
|
2558
2565
|
ry: "80",
|
|
2559
2566
|
fill: "#ffffff",
|
|
2560
|
-
stroke:
|
|
2567
|
+
stroke: Mt,
|
|
2561
2568
|
"stroke-width": "13"
|
|
2562
2569
|
}), x(d, "ellipse", {
|
|
2563
2570
|
cx: o,
|
|
2564
2571
|
cy: r,
|
|
2565
2572
|
rx: "45",
|
|
2566
2573
|
ry: "53",
|
|
2567
|
-
fill:
|
|
2574
|
+
fill: Mt
|
|
2568
2575
|
}), x(d, "circle", {
|
|
2569
2576
|
cx: l,
|
|
2570
|
-
cy:
|
|
2577
|
+
cy: p,
|
|
2571
2578
|
r: "16",
|
|
2572
2579
|
fill: "#ffffff"
|
|
2573
2580
|
});
|
|
@@ -2576,7 +2583,7 @@ function x(e, t, n = {}) {
|
|
|
2576
2583
|
const i = P(t, n);
|
|
2577
2584
|
return e.appendChild(i), i;
|
|
2578
2585
|
}
|
|
2579
|
-
function
|
|
2586
|
+
function $(e, t, n, i) {
|
|
2580
2587
|
const o = { offset: t, "stop-color": n };
|
|
2581
2588
|
i !== void 0 && (o["stop-opacity"] = i), x(e, "stop", o);
|
|
2582
2589
|
}
|
|
@@ -2587,7 +2594,7 @@ function Ut(e, t, n, i) {
|
|
|
2587
2594
|
const o = document.createElement("button");
|
|
2588
2595
|
return o.type = "button", o.className = e, o.setAttribute("aria-label", t), o.title = t, o.hidden = i, o.appendChild(n), o;
|
|
2589
2596
|
}
|
|
2590
|
-
function
|
|
2597
|
+
function vr() {
|
|
2591
2598
|
const e = P("svg", {
|
|
2592
2599
|
class: "pluno-pa-widget__scribble-defs",
|
|
2593
2600
|
"aria-hidden": "true",
|
|
@@ -2601,14 +2608,14 @@ function yr() {
|
|
|
2601
2608
|
fn("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2602
2609
|
), e.appendChild(t), e;
|
|
2603
2610
|
}
|
|
2604
|
-
function
|
|
2611
|
+
function ei(e, t) {
|
|
2605
2612
|
const n = P("svg", {
|
|
2606
2613
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2607
2614
|
preserveAspectRatio: "xMidYMid meet",
|
|
2608
2615
|
"aria-hidden": "true",
|
|
2609
2616
|
focusable: "false"
|
|
2610
2617
|
});
|
|
2611
|
-
return
|
|
2618
|
+
return ti(n, t), n;
|
|
2612
2619
|
}
|
|
2613
2620
|
function mn(e, t) {
|
|
2614
2621
|
if (!e)
|
|
@@ -2617,23 +2624,23 @@ function mn(e, t) {
|
|
|
2617
2624
|
0,
|
|
2618
2625
|
t - En * 2
|
|
2619
2626
|
), i = Math.max(
|
|
2620
|
-
|
|
2627
|
+
Ba,
|
|
2621
2628
|
Math.floor(
|
|
2622
2629
|
(n - Cn * 2) / Sn
|
|
2623
2630
|
)
|
|
2624
2631
|
);
|
|
2625
|
-
|
|
2632
|
+
ti(e, i);
|
|
2626
2633
|
}
|
|
2627
|
-
function
|
|
2634
|
+
function ti(e, t) {
|
|
2628
2635
|
if (e.dataset.spiralCount === `${t}`)
|
|
2629
2636
|
return;
|
|
2630
2637
|
const n = t * Sn + Cn * 2;
|
|
2631
2638
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2632
2639
|
"viewBox",
|
|
2633
|
-
`0 0 ${n} ${
|
|
2640
|
+
`0 0 ${n} ${Ua}`
|
|
2634
2641
|
), e.replaceChildren();
|
|
2635
2642
|
for (let i = 0; i < t; i += 1) {
|
|
2636
|
-
const o =
|
|
2643
|
+
const o = mo[i % mo.length], r = P("g", {
|
|
2637
2644
|
transform: `translate(${Cn + i * Sn} 0)`
|
|
2638
2645
|
});
|
|
2639
2646
|
r.appendChild(
|
|
@@ -2701,7 +2708,7 @@ function fn(e, t, n) {
|
|
|
2701
2708
|
})
|
|
2702
2709
|
), i;
|
|
2703
2710
|
}
|
|
2704
|
-
function
|
|
2711
|
+
function Sr(e) {
|
|
2705
2712
|
const t = ue(
|
|
2706
2713
|
"0 0 24 24",
|
|
2707
2714
|
e,
|
|
@@ -2712,7 +2719,7 @@ function vr(e) {
|
|
|
2712
2719
|
);
|
|
2713
2720
|
return t.appendChild(P("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2714
2721
|
}
|
|
2715
|
-
function
|
|
2722
|
+
function Cr() {
|
|
2716
2723
|
const e = ue(
|
|
2717
2724
|
"0 0 24 24",
|
|
2718
2725
|
17,
|
|
@@ -2731,7 +2738,7 @@ function Sr() {
|
|
|
2731
2738
|
})
|
|
2732
2739
|
), e;
|
|
2733
2740
|
}
|
|
2734
|
-
function
|
|
2741
|
+
function Er() {
|
|
2735
2742
|
const e = ue(
|
|
2736
2743
|
"0 0 24 24",
|
|
2737
2744
|
17,
|
|
@@ -2742,7 +2749,7 @@ function Cr() {
|
|
|
2742
2749
|
);
|
|
2743
2750
|
return e.appendChild(P("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(P("path", { d: "M3 4v5h5" })), e.appendChild(P("path", { d: "M12 7v5l3 2" })), e;
|
|
2744
2751
|
}
|
|
2745
|
-
function
|
|
2752
|
+
function kr() {
|
|
2746
2753
|
const e = ue(
|
|
2747
2754
|
"0 0 24 24",
|
|
2748
2755
|
15,
|
|
@@ -2753,7 +2760,7 @@ function Er() {
|
|
|
2753
2760
|
);
|
|
2754
2761
|
return e.appendChild(P("path", { d: "M18 6 6 18" })), e.appendChild(P("path", { d: "m6 6 12 12" })), e;
|
|
2755
2762
|
}
|
|
2756
|
-
function
|
|
2763
|
+
function ni() {
|
|
2757
2764
|
const e = ue(
|
|
2758
2765
|
"0 0 24 24",
|
|
2759
2766
|
14,
|
|
@@ -2766,7 +2773,7 @@ function oi() {
|
|
|
2766
2773
|
P("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2767
2774
|
), e.appendChild(P("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2768
2775
|
}
|
|
2769
|
-
function
|
|
2776
|
+
function Lr() {
|
|
2770
2777
|
const e = ue(
|
|
2771
2778
|
"0 0 24 24",
|
|
2772
2779
|
16,
|
|
@@ -2784,7 +2791,7 @@ function kr() {
|
|
|
2784
2791
|
})
|
|
2785
2792
|
), e;
|
|
2786
2793
|
}
|
|
2787
|
-
function
|
|
2794
|
+
function Tr() {
|
|
2788
2795
|
const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2789
2796
|
return e.setAttribute(
|
|
2790
2797
|
"class",
|
|
@@ -2799,7 +2806,7 @@ function Lr() {
|
|
|
2799
2806
|
})
|
|
2800
2807
|
), e;
|
|
2801
2808
|
}
|
|
2802
|
-
function
|
|
2809
|
+
function Ar() {
|
|
2803
2810
|
const e = ue("0 0 24 24", 18, 18, "currentColor");
|
|
2804
2811
|
return e.appendChild(
|
|
2805
2812
|
P("rect", {
|
|
@@ -2811,7 +2818,7 @@ function Tr() {
|
|
|
2811
2818
|
})
|
|
2812
2819
|
), e;
|
|
2813
2820
|
}
|
|
2814
|
-
function
|
|
2821
|
+
function Pr() {
|
|
2815
2822
|
const e = ue(
|
|
2816
2823
|
"0 0 24 24",
|
|
2817
2824
|
12,
|
|
@@ -2822,7 +2829,7 @@ function Ar() {
|
|
|
2822
2829
|
);
|
|
2823
2830
|
return e.appendChild(P("path", { d: "M18 6 6 18" })), e.appendChild(P("path", { d: "m6 6 12 12" })), e;
|
|
2824
2831
|
}
|
|
2825
|
-
function
|
|
2832
|
+
function Ir() {
|
|
2826
2833
|
const e = ue(
|
|
2827
2834
|
"0 0 24 24",
|
|
2828
2835
|
13,
|
|
@@ -2857,30 +2864,30 @@ function ue(e, t, n, i, o, r) {
|
|
|
2857
2864
|
return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), P("svg", l);
|
|
2858
2865
|
}
|
|
2859
2866
|
function P(e, t = {}) {
|
|
2860
|
-
const n = document.createElementNS(
|
|
2867
|
+
const n = document.createElementNS(jo, e);
|
|
2861
2868
|
for (const [i, o] of Object.entries(t))
|
|
2862
2869
|
n.setAttribute(i, o);
|
|
2863
2870
|
return n;
|
|
2864
2871
|
}
|
|
2865
|
-
function
|
|
2872
|
+
function ko(e) {
|
|
2866
2873
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2867
2874
|
e.addEventListener(t, (n) => {
|
|
2868
2875
|
n.stopPropagation();
|
|
2869
2876
|
});
|
|
2870
2877
|
}
|
|
2871
|
-
function
|
|
2878
|
+
function Nr(e, t, n) {
|
|
2872
2879
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2873
2880
|
for (const [i, o] of t.entries()) {
|
|
2874
2881
|
const r = document.createElement("div");
|
|
2875
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2882
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Rr(o));
|
|
2876
2883
|
const l = document.createElement("span");
|
|
2877
2884
|
l.textContent = o.name, r.appendChild(l);
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2885
|
+
const p = document.createElement("button");
|
|
2886
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(Pr()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
|
|
2880
2887
|
}
|
|
2881
2888
|
}
|
|
2882
|
-
function
|
|
2883
|
-
const t =
|
|
2889
|
+
function Rr(e) {
|
|
2890
|
+
const t = Mn(e), n = oi(e);
|
|
2884
2891
|
if (t === "image" && n) {
|
|
2885
2892
|
const i = document.createElement("img");
|
|
2886
2893
|
return i.src = n, i.alt = "", i.setAttribute("aria-hidden", "true"), i.addEventListener(
|
|
@@ -2900,8 +2907,8 @@ function Nr(e) {
|
|
|
2900
2907
|
}
|
|
2901
2908
|
return ce(e);
|
|
2902
2909
|
}
|
|
2903
|
-
function
|
|
2904
|
-
const n =
|
|
2910
|
+
function zr(e, t) {
|
|
2911
|
+
const n = Mn(e), i = oi(e);
|
|
2905
2912
|
if (n === "image" && i) {
|
|
2906
2913
|
const o = document.createElement("img");
|
|
2907
2914
|
o.className = "pluno-pa-widget__message-attachment-preview", o.alt = e.name;
|
|
@@ -2943,32 +2950,32 @@ function Rr(e, t) {
|
|
|
2943
2950
|
function ce(e, t = "composer") {
|
|
2944
2951
|
if (t === "composer") {
|
|
2945
2952
|
const r = document.createElement("span");
|
|
2946
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2953
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = Lo(e), r;
|
|
2947
2954
|
}
|
|
2948
2955
|
const n = document.createElement("div");
|
|
2949
2956
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2950
2957
|
const i = document.createElement("span");
|
|
2951
|
-
i.textContent =
|
|
2958
|
+
i.textContent = Lo(e);
|
|
2952
2959
|
const o = document.createElement("strong");
|
|
2953
2960
|
return o.textContent = e.name, n.append(i, o), n;
|
|
2954
2961
|
}
|
|
2955
|
-
function
|
|
2962
|
+
function Mn(e) {
|
|
2956
2963
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2957
2964
|
}
|
|
2958
|
-
function
|
|
2965
|
+
function oi(e) {
|
|
2959
2966
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2960
2967
|
}
|
|
2961
|
-
function
|
|
2962
|
-
const t =
|
|
2968
|
+
function Lo(e) {
|
|
2969
|
+
const t = Mn(e);
|
|
2963
2970
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2964
2971
|
}
|
|
2965
2972
|
function Mr(e, t) {
|
|
2966
2973
|
return t ? Array.from(t).map((i) => ({
|
|
2967
2974
|
...e.createLocalAttachment(i),
|
|
2968
|
-
previewUrl:
|
|
2975
|
+
previewUrl: Dr(i)
|
|
2969
2976
|
})) : [];
|
|
2970
2977
|
}
|
|
2971
|
-
function
|
|
2978
|
+
function Dr(e) {
|
|
2972
2979
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2973
2980
|
}
|
|
2974
2981
|
function Pt(e) {
|
|
@@ -2979,24 +2986,24 @@ function wn(e, t, n = null) {
|
|
|
2979
2986
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2980
2987
|
return;
|
|
2981
2988
|
}
|
|
2982
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2983
|
-
|
|
2984
|
-
) :
|
|
2989
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", pe(t) || Dn(n) ? e.appendChild(
|
|
2990
|
+
Or(t, n)
|
|
2991
|
+
) : ii(t) && e.appendChild(Ur(t));
|
|
2985
2992
|
}
|
|
2986
|
-
function
|
|
2993
|
+
function Or(e, t) {
|
|
2987
2994
|
const n = document.createElement("div");
|
|
2988
2995
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2989
2996
|
const i = e.limitExceeded || t === "limit_exceeded", o = i && e.onboardingIncomplete === !0, r = document.createElement("strong");
|
|
2990
2997
|
r.textContent = o ? "Complete onboarding" : i ? "Credits used up" : "Billing needs attention", n.appendChild(r);
|
|
2991
2998
|
const l = document.createElement("span");
|
|
2992
2999
|
if (l.textContent = o ? "Complete onboarding to unlock credits and start using Pluno." : i ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(l), o) {
|
|
2993
|
-
const
|
|
2994
|
-
|
|
3000
|
+
const p = document.createElement("div");
|
|
3001
|
+
p.className = "pluno-pa-widget__billing-action-card-actions", p.appendChild(
|
|
2995
3002
|
Pn("Complete onboarding", e.onboardingUrl ?? "")
|
|
2996
|
-
), n.appendChild(
|
|
3003
|
+
), n.appendChild(p);
|
|
2997
3004
|
} else
|
|
2998
3005
|
n.appendChild(
|
|
2999
|
-
|
|
3006
|
+
ai(
|
|
3000
3007
|
e,
|
|
3001
3008
|
"Upgrade plan",
|
|
3002
3009
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -3004,14 +3011,14 @@ function Dr(e, t) {
|
|
|
3004
3011
|
);
|
|
3005
3012
|
return n;
|
|
3006
3013
|
}
|
|
3007
|
-
function
|
|
3014
|
+
function Ur(e) {
|
|
3008
3015
|
const t = document.createElement("div");
|
|
3009
3016
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
3010
3017
|
const n = document.createElement("strong");
|
|
3011
3018
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
3012
3019
|
const i = document.createElement("span");
|
|
3013
|
-
return i.textContent =
|
|
3014
|
-
|
|
3020
|
+
return i.textContent = Fr(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
|
|
3021
|
+
ai(
|
|
3015
3022
|
e,
|
|
3016
3023
|
"Upgrade",
|
|
3017
3024
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -3019,32 +3026,32 @@ function Or(e) {
|
|
|
3019
3026
|
), t;
|
|
3020
3027
|
}
|
|
3021
3028
|
function An(e, t) {
|
|
3022
|
-
return e !== null && (
|
|
3029
|
+
return e !== null && (pe(e) || ii(e) || Dn(t));
|
|
3023
3030
|
}
|
|
3024
|
-
function
|
|
3025
|
-
return An(t, n) ||
|
|
3031
|
+
function To(e, t, n) {
|
|
3032
|
+
return An(t, n) || Br(t) ? !0 : !An(e, n);
|
|
3026
3033
|
}
|
|
3027
|
-
function
|
|
3028
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
3034
|
+
function Br(e) {
|
|
3035
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || pe(e));
|
|
3029
3036
|
}
|
|
3030
|
-
function
|
|
3037
|
+
function pe(e) {
|
|
3031
3038
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
3032
3039
|
}
|
|
3033
3040
|
function Dn(e) {
|
|
3034
3041
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
3035
3042
|
}
|
|
3036
|
-
function
|
|
3037
|
-
return !
|
|
3038
|
-
}
|
|
3039
|
-
function Br(e) {
|
|
3040
|
-
return e.creditsRemaining === null ? null : `${Fr(e.creditsRemaining)} credits left`;
|
|
3043
|
+
function ii(e) {
|
|
3044
|
+
return !pe(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
3041
3045
|
}
|
|
3042
3046
|
function Fr(e) {
|
|
3047
|
+
return e.creditsRemaining === null ? null : `${Wr(e.creditsRemaining)} credits left`;
|
|
3048
|
+
}
|
|
3049
|
+
function Wr(e) {
|
|
3043
3050
|
return new Intl.NumberFormat("en-US", {
|
|
3044
3051
|
maximumFractionDigits: 0
|
|
3045
3052
|
}).format(Math.ceil(e));
|
|
3046
3053
|
}
|
|
3047
|
-
function
|
|
3054
|
+
function ai(e, t, n) {
|
|
3048
3055
|
const i = document.createElement("div");
|
|
3049
3056
|
return i.className = n, i.appendChild(
|
|
3050
3057
|
Pn(t, e.pricingUrl)
|
|
@@ -3065,86 +3072,86 @@ function Pn(e, t) {
|
|
|
3065
3072
|
}
|
|
3066
3073
|
function bn(e, t) {
|
|
3067
3074
|
return e.messages.filter(
|
|
3068
|
-
(i) => !
|
|
3075
|
+
(i) => !li(i)
|
|
3069
3076
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
3070
3077
|
}
|
|
3071
|
-
function
|
|
3072
|
-
const ne =
|
|
3073
|
-
ne.filter((
|
|
3074
|
-
), Qe = e.scrollTop,
|
|
3075
|
-
|
|
3078
|
+
function Hr(e, t, n, i, o, r, l, p, d, c, g, h, f, y, v, O, u, W, w, R, M, T) {
|
|
3079
|
+
const ne = Vr(r), H = Kr(
|
|
3080
|
+
ne.filter((E) => !li(E))
|
|
3081
|
+
), Qe = e.scrollTop, $e = [], ge = /* @__PURE__ */ new Set(), U = (E) => {
|
|
3082
|
+
$e.push(E);
|
|
3076
3083
|
};
|
|
3077
|
-
|
|
3078
|
-
const
|
|
3079
|
-
if (i(
|
|
3080
|
-
const
|
|
3081
|
-
|
|
3084
|
+
di(n, r.isThinking), o.hidden = !p, p && l !== null && Jo(o, l);
|
|
3085
|
+
const S = H.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
3086
|
+
if (i(S), u || H.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
3087
|
+
const E = document.createElement("div");
|
|
3088
|
+
E.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
3082
3089
|
const A = document.createElement("div");
|
|
3083
3090
|
A.className = "pluno-pa-widget__empty-hero";
|
|
3084
3091
|
const I = Ie(
|
|
3085
3092
|
"pluno-pa-widget__character--empty",
|
|
3086
3093
|
y()
|
|
3087
3094
|
);
|
|
3088
|
-
if (A.appendChild(I),
|
|
3095
|
+
if (A.appendChild(I), E.appendChild(A), u) {
|
|
3089
3096
|
const b = document.createElement("h2");
|
|
3090
|
-
b.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", b.textContent = u.opening,
|
|
3097
|
+
b.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", b.textContent = u.opening, E.appendChild(b);
|
|
3091
3098
|
} else
|
|
3092
|
-
|
|
3099
|
+
E.appendChild(Zo());
|
|
3093
3100
|
const Ce = u?.prompts ?? r.starterPrompts, oe = document.createElement("div");
|
|
3094
3101
|
if (oe.className = Ce.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", Ce.length === 0 && !r.starterPromptsLoading && oe.setAttribute("aria-hidden", "true"), Ce.length > 0)
|
|
3095
3102
|
for (const b of Ce) {
|
|
3096
3103
|
const L = document.createElement("button");
|
|
3097
3104
|
L.type = "button", L.className = "pluno-pa-widget__starter-prompt", L.textContent = `"${b}"`, L.addEventListener("click", () => {
|
|
3098
|
-
|
|
3105
|
+
v(b);
|
|
3099
3106
|
}), oe.appendChild(L);
|
|
3100
3107
|
}
|
|
3101
3108
|
else if (r.starterPromptsLoading) {
|
|
3102
3109
|
const b = document.createElement("button");
|
|
3103
3110
|
b.type = "button", b.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", b.disabled = !0, b.tabIndex = -1, b.textContent = "Generating example tasks...", oe.appendChild(b);
|
|
3104
3111
|
} else
|
|
3105
|
-
for (let b = 0; b <
|
|
3112
|
+
for (let b = 0; b < Ea; b += 1) {
|
|
3106
3113
|
const L = document.createElement("button");
|
|
3107
3114
|
L.type = "button", L.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", L.disabled = !0, L.tabIndex = -1, L.textContent = "", oe.appendChild(L);
|
|
3108
3115
|
}
|
|
3109
|
-
if (
|
|
3116
|
+
if (E.appendChild(oe), u) {
|
|
3110
3117
|
const b = document.createElement("button");
|
|
3111
|
-
b.type = "button", b.className = "pluno-pa-widget__morning-report-snooze", b.textContent = "Snooze morning report", b.addEventListener("click", W),
|
|
3118
|
+
b.type = "button", b.className = "pluno-pa-widget__morning-report-snooze", b.textContent = "Snooze morning report", b.addEventListener("click", W), E.appendChild(b);
|
|
3112
3119
|
}
|
|
3113
|
-
h.clear(), U(
|
|
3120
|
+
h.clear(), U(E), U(t), Ao(e, $e);
|
|
3114
3121
|
return;
|
|
3115
3122
|
}
|
|
3116
3123
|
let B = null, q = null, Z = [], Ne = [];
|
|
3117
|
-
const K = H.length - 1, wt = K >= 0 && In(H[K]), Re =
|
|
3124
|
+
const K = H.length - 1, wt = K >= 0 && In(H[K]), Re = Yr(H);
|
|
3118
3125
|
let he = !1;
|
|
3119
3126
|
const me = () => {
|
|
3120
3127
|
if (Z.length === 0)
|
|
3121
3128
|
return he = !1, !1;
|
|
3122
|
-
const
|
|
3123
|
-
(I) =>
|
|
3124
|
-
), A =
|
|
3129
|
+
const E = Re !== null && Z.some(
|
|
3130
|
+
(I) => ri(I, Re)
|
|
3131
|
+
), A = ol(
|
|
3125
3132
|
Z,
|
|
3126
|
-
|
|
3133
|
+
E,
|
|
3127
3134
|
g,
|
|
3128
3135
|
f,
|
|
3129
3136
|
y()
|
|
3130
3137
|
);
|
|
3131
|
-
return U(A), B = null, q = A, Z = [], he =
|
|
3132
|
-
},
|
|
3133
|
-
for (const
|
|
3134
|
-
U(
|
|
3138
|
+
return U(A), B = null, q = A, Z = [], he = E, !0;
|
|
3139
|
+
}, z = () => {
|
|
3140
|
+
for (const E of Ne)
|
|
3141
|
+
U(E), B = null, q = E;
|
|
3135
3142
|
Ne = [];
|
|
3136
3143
|
};
|
|
3137
|
-
for (let
|
|
3138
|
-
const A = H[
|
|
3139
|
-
if (A.role === "tool" && A.integrationAuthRequest &&
|
|
3140
|
-
const b =
|
|
3144
|
+
for (let E = 0; E < H.length; E += 1) {
|
|
3145
|
+
const A = H[E];
|
|
3146
|
+
if (A.role === "tool" && A.integrationAuthRequest && M) {
|
|
3147
|
+
const b = $r(
|
|
3141
3148
|
A.integrationAuthRequest,
|
|
3142
|
-
|
|
3149
|
+
M.states.get(
|
|
3143
3150
|
A.integrationAuthRequest.authRequestId
|
|
3144
3151
|
) ?? {
|
|
3145
|
-
status:
|
|
3152
|
+
status: M.initialStatus
|
|
3146
3153
|
},
|
|
3147
|
-
|
|
3154
|
+
M.onConnect
|
|
3148
3155
|
);
|
|
3149
3156
|
Ne.push(b);
|
|
3150
3157
|
continue;
|
|
@@ -3154,7 +3161,7 @@ function Wr(e, t, n, i, o, r, l, s, d, c, g, h, f, y, E, O, u, W, w, R, z, T) {
|
|
|
3154
3161
|
continue;
|
|
3155
3162
|
}
|
|
3156
3163
|
if (In(A)) {
|
|
3157
|
-
if (
|
|
3164
|
+
if (E !== K)
|
|
3158
3165
|
continue;
|
|
3159
3166
|
if (me()) {
|
|
3160
3167
|
if (!he) {
|
|
@@ -3162,7 +3169,7 @@ function Wr(e, t, n, i, o, r, l, s, d, c, g, h, f, y, E, O, u, W, w, R, z, T) {
|
|
|
3162
3169
|
U(L), B = null, q = L;
|
|
3163
3170
|
}
|
|
3164
3171
|
} else {
|
|
3165
|
-
const L =
|
|
3172
|
+
const L = No(y());
|
|
3166
3173
|
U(L), B = null, q = L;
|
|
3167
3174
|
}
|
|
3168
3175
|
continue;
|
|
@@ -3177,14 +3184,14 @@ function Wr(e, t, n, i, o, r, l, s, d, c, g, h, f, y, E, O, u, W, w, R, z, T) {
|
|
|
3177
3184
|
const j = document.createElement("a");
|
|
3178
3185
|
j.className = "pluno-pa-widget__error-retry", j.href = A.securitySettingsUrl, j.target = "_blank", j.rel = "noreferrer", j.textContent = "Security settings", b.appendChild(j);
|
|
3179
3186
|
}
|
|
3180
|
-
U(b), B = L ? b : null, q = L ? null : b,
|
|
3187
|
+
U(b), B = L ? b : null, q = L ? null : b, z();
|
|
3181
3188
|
}
|
|
3182
3189
|
continue;
|
|
3183
3190
|
}
|
|
3184
|
-
A.role === "user" &&
|
|
3191
|
+
A.role === "user" && z();
|
|
3185
3192
|
const I = me(), Ce = Nn(A.content);
|
|
3186
3193
|
if (A.role === "assistant" && !I) {
|
|
3187
|
-
const b =
|
|
3194
|
+
const b = si(y());
|
|
3188
3195
|
U(b), B = null, q = b;
|
|
3189
3196
|
}
|
|
3190
3197
|
const oe = Gr(
|
|
@@ -3194,40 +3201,40 @@ function Wr(e, t, n, i, o, r, l, s, d, c, g, h, f, y, E, O, u, W, w, R, z, T) {
|
|
|
3194
3201
|
ge,
|
|
3195
3202
|
R
|
|
3196
3203
|
);
|
|
3197
|
-
U(oe), B = oe, q = null, A.role === "assistant" &&
|
|
3204
|
+
U(oe), B = oe, q = null, A.role === "assistant" && z();
|
|
3198
3205
|
}
|
|
3199
|
-
const et = me(),
|
|
3200
|
-
if (r.isThinking && !
|
|
3206
|
+
const et = me(), ze = H[H.length - 1]?.role === "assistant";
|
|
3207
|
+
if (r.isThinking && !ze && !wt)
|
|
3201
3208
|
if (et) {
|
|
3202
3209
|
if (!he) {
|
|
3203
|
-
const
|
|
3204
|
-
U(
|
|
3210
|
+
const E = ft();
|
|
3211
|
+
U(E), B = null, q = E;
|
|
3205
3212
|
}
|
|
3206
3213
|
} else {
|
|
3207
|
-
const
|
|
3208
|
-
U(
|
|
3214
|
+
const E = No(y());
|
|
3215
|
+
U(E), B = null, q = E;
|
|
3209
3216
|
}
|
|
3210
3217
|
if (r.lastError) {
|
|
3211
|
-
const
|
|
3212
|
-
|
|
3218
|
+
const E = document.createElement("div");
|
|
3219
|
+
E.className = "pluno-pa-widget__error";
|
|
3213
3220
|
const A = document.createElement("span");
|
|
3214
|
-
if (A.textContent = r.lastError,
|
|
3221
|
+
if (A.textContent = r.lastError, E.appendChild(A), r.lastErrorSecuritySettingsUrl) {
|
|
3215
3222
|
const I = document.createElement("a");
|
|
3216
|
-
I.className = "pluno-pa-widget__error-retry", I.href = r.lastErrorSecuritySettingsUrl, I.target = "_blank", I.rel = "noreferrer", I.textContent = "Security settings",
|
|
3223
|
+
I.className = "pluno-pa-widget__error-retry", I.href = r.lastErrorSecuritySettingsUrl, I.target = "_blank", I.rel = "noreferrer", I.textContent = "Security settings", E.appendChild(I);
|
|
3217
3224
|
}
|
|
3218
3225
|
if (r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
3219
3226
|
const I = document.createElement("button");
|
|
3220
3227
|
I.type = "button", I.className = "pluno-pa-widget__error-retry", I.textContent = "Try again", I.addEventListener(
|
|
3221
3228
|
"click",
|
|
3222
3229
|
r.lastErrorCode === "connection_failed" ? w : O
|
|
3223
|
-
),
|
|
3230
|
+
), E.appendChild(I);
|
|
3224
3231
|
}
|
|
3225
|
-
U(
|
|
3232
|
+
U(E), B = E, q = null;
|
|
3226
3233
|
}
|
|
3227
|
-
const
|
|
3228
|
-
if (T &&
|
|
3229
|
-
const
|
|
3230
|
-
isActing: T.actionCandidate?.id ===
|
|
3234
|
+
const Me = T ? T.actionCandidate ?? (r.isThinking ? null : Hi(ne)) : null;
|
|
3235
|
+
if (T && Me && !T.dismissedCandidateIds.has(Me.id)) {
|
|
3236
|
+
const E = el(Me, {
|
|
3237
|
+
isActing: T.actionCandidate?.id === Me.id,
|
|
3231
3238
|
error: T.error,
|
|
3232
3239
|
characterIconOptions: T.characterIconOptions,
|
|
3233
3240
|
socialPostRewardsUrl: T.socialPostRewardsUrl,
|
|
@@ -3236,18 +3243,18 @@ function Wr(e, t, n, i, o, r, l, s, d, c, g, h, f, y, E, O, u, W, w, R, z, T) {
|
|
|
3236
3243
|
onDismiss: T.onDismiss,
|
|
3237
3244
|
onDisable: T.onDisable
|
|
3238
3245
|
});
|
|
3239
|
-
U(
|
|
3246
|
+
U(E), T.onSeen(Me), B = null, q = E;
|
|
3240
3247
|
}
|
|
3241
|
-
|
|
3248
|
+
z(), B?.classList.add(
|
|
3242
3249
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3243
3250
|
), q?.classList.add(
|
|
3244
3251
|
"pluno-pa-widget__bottom-reserve-compact"
|
|
3245
|
-
), U(t),
|
|
3252
|
+
), U(t), jr(
|
|
3246
3253
|
h,
|
|
3247
3254
|
ge
|
|
3248
|
-
),
|
|
3255
|
+
), Ao(e, $e), d ? ht(e, c) : e.scrollTop = Qe;
|
|
3249
3256
|
}
|
|
3250
|
-
function
|
|
3257
|
+
function $r(e, t, n) {
|
|
3251
3258
|
const i = document.createElement("section");
|
|
3252
3259
|
i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", `Connect ${e.appName}`);
|
|
3253
3260
|
const o = document.createElement("div");
|
|
@@ -3257,8 +3264,8 @@ function Hr(e, t, n) {
|
|
|
3257
3264
|
}
|
|
3258
3265
|
const r = document.createElement("div"), l = document.createElement("strong");
|
|
3259
3266
|
l.textContent = `Connect ${e.appName}`;
|
|
3260
|
-
const
|
|
3261
|
-
if (
|
|
3267
|
+
const p = document.createElement("span");
|
|
3268
|
+
if (p.textContent = "Authenticate in this browser so Pluno can continue your task.", r.append(l, p), o.appendChild(r), i.appendChild(o), t.error) {
|
|
3262
3269
|
const c = document.createElement("div");
|
|
3263
3270
|
c.className = "pluno-pa-widget__integration-auth-error", c.textContent = t.error, i.appendChild(c);
|
|
3264
3271
|
}
|
|
@@ -3266,24 +3273,24 @@ function Hr(e, t, n) {
|
|
|
3266
3273
|
return d.type = "button", d.className = "pluno-pa-widget__integration-auth-button", d.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? d.textContent = "Checking connection..." : t.status === "connecting" ? d.textContent = "Connecting..." : t.status === "completed" ? d.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? d.textContent = `Reconnect ${e.appName}` : t.status === "error" ? d.textContent = "Try again" : d.textContent = `Connect ${e.appName}`, d.addEventListener("click", () => n(e)), i.appendChild(d), i;
|
|
3267
3274
|
}
|
|
3268
3275
|
function Gr(e, t, n, i, o) {
|
|
3269
|
-
const r =
|
|
3276
|
+
const r = qr(e, t), l = r ? n.get(r) : void 0;
|
|
3270
3277
|
if (r && l)
|
|
3271
3278
|
return l.classList.remove(
|
|
3272
3279
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3273
3280
|
), i.add(r), l;
|
|
3274
|
-
const
|
|
3275
|
-
if (
|
|
3276
|
-
|
|
3281
|
+
const p = document.createElement("div");
|
|
3282
|
+
if (p.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (p.dataset.phase = e.phase), sl(p, t)) : p.textContent = t, e.role === "user" && e.attachments?.length && p.appendChild(
|
|
3283
|
+
Jr(
|
|
3277
3284
|
e.attachments,
|
|
3278
3285
|
o
|
|
3279
3286
|
)
|
|
3280
3287
|
), e.phase !== "commentary") {
|
|
3281
3288
|
const d = document.createElement("div");
|
|
3282
|
-
d.className = "pluno-pa-widget__message-actions", d.appendChild(
|
|
3289
|
+
d.className = "pluno-pa-widget__message-actions", d.appendChild(Qr(t)), p.appendChild(d);
|
|
3283
3290
|
}
|
|
3284
|
-
return r && (n.set(r,
|
|
3291
|
+
return r && (n.set(r, p), i.add(r)), p;
|
|
3285
3292
|
}
|
|
3286
|
-
function
|
|
3293
|
+
function qr(e, t) {
|
|
3287
3294
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
3288
3295
|
id: e.id,
|
|
3289
3296
|
content: t,
|
|
@@ -3301,11 +3308,11 @@ function $r(e, t) {
|
|
|
3301
3308
|
})
|
|
3302
3309
|
});
|
|
3303
3310
|
}
|
|
3304
|
-
function
|
|
3311
|
+
function jr(e, t) {
|
|
3305
3312
|
for (const n of e.keys())
|
|
3306
3313
|
t.has(n) || e.delete(n);
|
|
3307
3314
|
}
|
|
3308
|
-
function
|
|
3315
|
+
function Ao(e, t) {
|
|
3309
3316
|
let n = e.firstChild;
|
|
3310
3317
|
for (const i of t) {
|
|
3311
3318
|
if (i === n) {
|
|
@@ -3319,7 +3326,7 @@ function Po(e, t) {
|
|
|
3319
3326
|
n = n.nextSibling, e.removeChild(i);
|
|
3320
3327
|
}
|
|
3321
3328
|
}
|
|
3322
|
-
function
|
|
3329
|
+
function Vr(e) {
|
|
3323
3330
|
if (!e.assistantDraft)
|
|
3324
3331
|
return [...e.messages];
|
|
3325
3332
|
const t = {
|
|
@@ -3340,7 +3347,7 @@ function jr(e) {
|
|
|
3340
3347
|
if (n === -1)
|
|
3341
3348
|
return [...e.messages, t];
|
|
3342
3349
|
const i = e.messages.findIndex(
|
|
3343
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3350
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && Po(r, t) && In(r)
|
|
3344
3351
|
);
|
|
3345
3352
|
if (i !== -1)
|
|
3346
3353
|
return [
|
|
@@ -3349,7 +3356,7 @@ function jr(e) {
|
|
|
3349
3356
|
...e.messages.slice(i + 1)
|
|
3350
3357
|
];
|
|
3351
3358
|
let o = n + 1;
|
|
3352
|
-
for (; o < e.messages.length && e.messages[o].role !== "user" && e.messages[o].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3359
|
+
for (; o < e.messages.length && e.messages[o].role !== "user" && e.messages[o].respondsToUserMessageId === t.respondsToUserMessageId && Po(e.messages[o], t); )
|
|
3353
3360
|
o += 1;
|
|
3354
3361
|
return [
|
|
3355
3362
|
...e.messages.slice(0, o),
|
|
@@ -3357,39 +3364,39 @@ function jr(e) {
|
|
|
3357
3364
|
...e.messages.slice(o)
|
|
3358
3365
|
];
|
|
3359
3366
|
}
|
|
3360
|
-
function
|
|
3367
|
+
function Kr(e) {
|
|
3361
3368
|
return e.map(
|
|
3362
3369
|
(t) => t.role === "assistant" && t.phase === "commentary" ? { ...t, role: "tool" } : t
|
|
3363
3370
|
);
|
|
3364
3371
|
}
|
|
3365
|
-
function
|
|
3372
|
+
function Yr(e) {
|
|
3366
3373
|
const t = [...e].reverse().find((n) => n.role === "user");
|
|
3367
3374
|
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
3368
3375
|
const i = e[n];
|
|
3369
3376
|
if (!(i.role !== "tool" || e.slice(n + 1).some(
|
|
3370
|
-
(r) => (
|
|
3377
|
+
(r) => (Xr(r) || Zr(r)) && ri(i, r)
|
|
3371
3378
|
)) && (i.loading || i.dataType === "assistant_draft" || t && i.respondsToUserMessageId === t.id))
|
|
3372
3379
|
return i;
|
|
3373
3380
|
}
|
|
3374
3381
|
return null;
|
|
3375
3382
|
}
|
|
3376
|
-
function
|
|
3383
|
+
function Xr(e) {
|
|
3377
3384
|
return e.role === "assistant" && e.phase !== "commentary";
|
|
3378
3385
|
}
|
|
3379
|
-
function
|
|
3386
|
+
function Zr(e) {
|
|
3380
3387
|
return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
|
|
3381
3388
|
}
|
|
3382
|
-
function
|
|
3389
|
+
function ri(e, t) {
|
|
3383
3390
|
return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
|
|
3384
3391
|
}
|
|
3385
3392
|
function In(e) {
|
|
3386
3393
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
3387
3394
|
}
|
|
3388
|
-
function
|
|
3395
|
+
function Po(e, t) {
|
|
3389
3396
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
3390
3397
|
}
|
|
3391
|
-
function
|
|
3392
|
-
e.replaceChildren(),
|
|
3398
|
+
function Io(e, t, n, i, o, r, l, p) {
|
|
3399
|
+
e.replaceChildren(), di(t, !1), t.disabled = !0, n(!1);
|
|
3393
3400
|
const d = document.createElement("div");
|
|
3394
3401
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3395
3402
|
const c = Ie(
|
|
@@ -3403,26 +3410,26 @@ function No(e, t, n, i, o, r, l, s) {
|
|
|
3403
3410
|
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, d.appendChild(h);
|
|
3404
3411
|
} else {
|
|
3405
3412
|
const h = document.createElement("button");
|
|
3406
|
-
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () =>
|
|
3413
|
+
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => p?.()), d.appendChild(h);
|
|
3407
3414
|
}
|
|
3408
3415
|
e.appendChild(d);
|
|
3409
3416
|
}
|
|
3410
|
-
function
|
|
3417
|
+
function Jr(e, t) {
|
|
3411
3418
|
const n = document.createElement("div");
|
|
3412
3419
|
n.className = "pluno-pa-widget__message-attachments";
|
|
3413
3420
|
for (const i of e)
|
|
3414
3421
|
n.appendChild(
|
|
3415
|
-
|
|
3422
|
+
zr(i, t)
|
|
3416
3423
|
);
|
|
3417
3424
|
return n;
|
|
3418
3425
|
}
|
|
3419
|
-
function
|
|
3426
|
+
function Qr(e) {
|
|
3420
3427
|
const t = document.createElement("button");
|
|
3421
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
3428
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Ir()), t.addEventListener("click", (n) => {
|
|
3422
3429
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
3423
3430
|
}), t;
|
|
3424
3431
|
}
|
|
3425
|
-
function
|
|
3432
|
+
function el(e, t) {
|
|
3426
3433
|
const n = $i(e.id), i = document.createElement("article");
|
|
3427
3434
|
i.className = "pluno-pa-widget__share-prompt";
|
|
3428
3435
|
const o = document.createElement("div");
|
|
@@ -3436,20 +3443,20 @@ function Qr(e, t) {
|
|
|
3436
3443
|
r.className = "pluno-pa-widget__share-prompt-copy";
|
|
3437
3444
|
const l = document.createElement("strong");
|
|
3438
3445
|
l.textContent = n === "referral" ? "Know someone who'd love this?" : "Share Pluno, earn 2,000 credits", r.appendChild(l);
|
|
3439
|
-
const
|
|
3446
|
+
const p = document.createElement("span");
|
|
3440
3447
|
if (n === "referral")
|
|
3441
|
-
|
|
3448
|
+
p.textContent = "Give them 2,000 free credits—and earn 2,000 when they try Pluno.";
|
|
3442
3449
|
else {
|
|
3443
|
-
if (
|
|
3450
|
+
if (p.appendChild(
|
|
3444
3451
|
document.createTextNode("Post on LinkedIn, X, or Instagram, then ")
|
|
3445
3452
|
), t.socialPostRewardsUrl) {
|
|
3446
3453
|
const f = document.createElement("a");
|
|
3447
|
-
f.className = "pluno-pa-widget__share-prompt-reward", f.href = t.socialPostRewardsUrl, f.target = "_blank", f.rel = "noopener noreferrer", f.textContent = "submit your post URL",
|
|
3454
|
+
f.className = "pluno-pa-widget__share-prompt-reward", f.href = t.socialPostRewardsUrl, f.target = "_blank", f.rel = "noopener noreferrer", f.textContent = "submit your post URL", p.appendChild(f);
|
|
3448
3455
|
} else
|
|
3449
|
-
|
|
3450
|
-
|
|
3456
|
+
p.appendChild(document.createTextNode("submit your post URL"));
|
|
3457
|
+
p.appendChild(document.createTextNode(" for approval."));
|
|
3451
3458
|
}
|
|
3452
|
-
if (r.appendChild(
|
|
3459
|
+
if (r.appendChild(p), t.error) {
|
|
3453
3460
|
const f = document.createElement("span");
|
|
3454
3461
|
f.className = "pluno-pa-widget__share-prompt-error", f.textContent = t.error, r.appendChild(f);
|
|
3455
3462
|
}
|
|
@@ -3461,18 +3468,18 @@ function Qr(e, t) {
|
|
|
3461
3468
|
const f = document.createElement("button");
|
|
3462
3469
|
f.type = "button", f.className = "pluno-pa-widget__share-prompt-draft", f.disabled = t.isActing, f.addEventListener("click", () => {
|
|
3463
3470
|
t.onReferralCopy(e);
|
|
3464
|
-
}), t.isActing ? (f.appendChild(
|
|
3471
|
+
}), t.isActing ? (f.appendChild(rl()), f.appendChild(document.createTextNode("Copying..."))) : f.textContent = "Copy invite link", c.appendChild(f);
|
|
3465
3472
|
} else
|
|
3466
|
-
for (const f of
|
|
3473
|
+
for (const f of tl()) {
|
|
3467
3474
|
const y = document.createElement("a");
|
|
3468
|
-
y.className = "pluno-pa-widget__share-prompt-social", y.href = f.href, y.target = "_blank", y.rel = "noopener noreferrer", y.setAttribute("aria-label", `Open ${f.label}`), y.title = f.label, y.appendChild(
|
|
3475
|
+
y.className = "pluno-pa-widget__share-prompt-social", y.href = f.href, y.target = "_blank", y.rel = "noopener noreferrer", y.setAttribute("aria-label", `Open ${f.label}`), y.title = f.label, y.appendChild(nl(f.id)), y.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(y);
|
|
3469
3476
|
}
|
|
3470
3477
|
const g = document.createElement("button");
|
|
3471
3478
|
g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => t.onDismiss(e)), c.appendChild(g), d.appendChild(c);
|
|
3472
3479
|
const h = document.createElement("button");
|
|
3473
3480
|
return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)), d.appendChild(h), o.appendChild(d), i.appendChild(o), i;
|
|
3474
3481
|
}
|
|
3475
|
-
function
|
|
3482
|
+
function tl() {
|
|
3476
3483
|
const e = "https://pluno.ai/browser", t = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${e}`;
|
|
3477
3484
|
return [
|
|
3478
3485
|
{
|
|
@@ -3492,7 +3499,7 @@ function el() {
|
|
|
3492
3499
|
}
|
|
3493
3500
|
];
|
|
3494
3501
|
}
|
|
3495
|
-
function
|
|
3502
|
+
function nl(e) {
|
|
3496
3503
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3497
3504
|
t.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true");
|
|
3498
3505
|
const n = (i, o) => {
|
|
@@ -3501,13 +3508,13 @@ function tl(e) {
|
|
|
3501
3508
|
};
|
|
3502
3509
|
return e === "linkedin" ? (n("M6.7 13.2c.4 4.1.2 8.1.1 12.3"), n("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"), n("M14.4 13.3c.1 3.8.1 7.8 0 11.9"), n("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"), n("M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (n("M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), n("M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), n("M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (n("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"), n("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", "0.48"), n("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"), n("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"), t);
|
|
3503
3510
|
}
|
|
3504
|
-
function
|
|
3505
|
-
return e.role === "tool" && e.toolName ===
|
|
3511
|
+
function li(e) {
|
|
3512
|
+
return e.role === "tool" && e.toolName === Fo;
|
|
3506
3513
|
}
|
|
3507
3514
|
function Nn(e) {
|
|
3508
3515
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3509
3516
|
}
|
|
3510
|
-
function
|
|
3517
|
+
function ol(e, t, n, i, o) {
|
|
3511
3518
|
const r = document.createElement("article");
|
|
3512
3519
|
r.className = "pluno-pa-widget__tool-group", r.classList.toggle("pluno-pa-widget__tool-group--active", t), r.title = new Date(
|
|
3513
3520
|
e[e.length - 1].createdAt
|
|
@@ -3517,25 +3524,25 @@ function nl(e, t, n, i, o) {
|
|
|
3517
3524
|
o
|
|
3518
3525
|
)
|
|
3519
3526
|
);
|
|
3520
|
-
const l =
|
|
3527
|
+
const l = il(e, t);
|
|
3521
3528
|
if (t) {
|
|
3522
|
-
const
|
|
3523
|
-
return
|
|
3529
|
+
const v = document.createElement("div");
|
|
3530
|
+
return v.className = "pluno-pa-widget__tool-active-content", v.appendChild(ft()), v.appendChild(l), r.appendChild(v), r;
|
|
3524
3531
|
}
|
|
3525
|
-
const
|
|
3526
|
-
|
|
3527
|
-
r.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
3532
|
+
const p = document.createElement("details"), d = al(e);
|
|
3533
|
+
p.open = n.has(d), r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
|
|
3534
|
+
r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(d) : n.delete(d), i();
|
|
3528
3535
|
});
|
|
3529
3536
|
const c = document.createElement("summary");
|
|
3530
3537
|
c.className = "pluno-pa-widget__tool-summary";
|
|
3531
|
-
const g = [...e].reverse().find((
|
|
3532
|
-
(
|
|
3538
|
+
const g = [...e].reverse().find((v) => v.phase !== "commentary"), h = e.some(
|
|
3539
|
+
(v) => v.phase !== "commentary" && v.loading
|
|
3533
3540
|
), f = document.createElement("span");
|
|
3534
3541
|
f.className = "pluno-pa-widget__tool-summary-title";
|
|
3535
3542
|
const y = g ? pi(g.content) : "Activity";
|
|
3536
|
-
return f.textContent = y, h && (f.classList.add("pluno-pa-widget__tool-summary-title--loading"), f.dataset.loadingText = y), c.appendChild(f),
|
|
3543
|
+
return f.textContent = y, h && (f.classList.add("pluno-pa-widget__tool-summary-title--loading"), f.dataset.loadingText = y), c.appendChild(f), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
|
|
3537
3544
|
}
|
|
3538
|
-
function
|
|
3545
|
+
function il(e, t) {
|
|
3539
3546
|
const n = document.createElement("div");
|
|
3540
3547
|
n.className = "pluno-pa-widget__tool-lines";
|
|
3541
3548
|
const i = e[e.length - 1];
|
|
@@ -3544,7 +3551,7 @@ function ol(e, t) {
|
|
|
3544
3551
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = o.phase === "commentary" ? "commentary" : "tool";
|
|
3545
3552
|
const l = document.createElement("span");
|
|
3546
3553
|
l.className = "pluno-pa-widget__tool-line-text";
|
|
3547
|
-
const
|
|
3554
|
+
const p = Nn(o.content) || (o.phase === "commentary" ? "" : "Run tool"), d = o.phase === "commentary" ? p : pi(p);
|
|
3548
3555
|
t && o === i && o.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = d), l.textContent = d, r.appendChild(l), n.appendChild(r);
|
|
3549
3556
|
}
|
|
3550
3557
|
return n;
|
|
@@ -3553,7 +3560,7 @@ function pi(e) {
|
|
|
3553
3560
|
const t = e.trim() || "Run tool", n = t.codePointAt(0) ?? 0;
|
|
3554
3561
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? t : `🛠️ ${t}`;
|
|
3555
3562
|
}
|
|
3556
|
-
function
|
|
3563
|
+
function si(e) {
|
|
3557
3564
|
const t = document.createElement("article");
|
|
3558
3565
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3559
3566
|
Ie(
|
|
@@ -3562,8 +3569,8 @@ function di(e) {
|
|
|
3562
3569
|
)
|
|
3563
3570
|
), t;
|
|
3564
3571
|
}
|
|
3565
|
-
function
|
|
3566
|
-
const t =
|
|
3572
|
+
function No(e) {
|
|
3573
|
+
const t = si(e);
|
|
3567
3574
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ft()), t;
|
|
3568
3575
|
}
|
|
3569
3576
|
function ft(e = "Thinking...") {
|
|
@@ -3574,15 +3581,15 @@ function ft(e = "Thinking...") {
|
|
|
3574
3581
|
const i = document.createElement("span");
|
|
3575
3582
|
return i.textContent = e, t.appendChild(i), t;
|
|
3576
3583
|
}
|
|
3577
|
-
function
|
|
3584
|
+
function al(e) {
|
|
3578
3585
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3579
3586
|
}
|
|
3580
|
-
function
|
|
3587
|
+
function rl() {
|
|
3581
3588
|
const e = document.createElement("span");
|
|
3582
3589
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3583
3590
|
}
|
|
3584
|
-
function
|
|
3585
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3591
|
+
function di(e, t) {
|
|
3592
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ar() : ni());
|
|
3586
3593
|
}
|
|
3587
3594
|
function _n(e) {
|
|
3588
3595
|
let t = e.trim();
|
|
@@ -3597,29 +3604,29 @@ function _n(e) {
|
|
|
3597
3604
|
}
|
|
3598
3605
|
return n.push(i.trim()), n.length > 1 ? n : null;
|
|
3599
3606
|
}
|
|
3600
|
-
function
|
|
3607
|
+
function ll(e) {
|
|
3601
3608
|
const t = e.trim();
|
|
3602
3609
|
if (/^:?-{3,}:?$/.test(t))
|
|
3603
3610
|
return t.startsWith(":") && t.endsWith(":") ? "center" : t.endsWith(":") ? "right" : t.startsWith(":") ? "left" : null;
|
|
3604
3611
|
}
|
|
3605
|
-
function
|
|
3612
|
+
function pl(e, t) {
|
|
3606
3613
|
const n = _n(e[t] ?? ""), i = _n(e[t + 1] ?? "");
|
|
3607
3614
|
if (!n || !i || n.length !== i.length)
|
|
3608
3615
|
return null;
|
|
3609
3616
|
const o = [];
|
|
3610
3617
|
for (const h of i) {
|
|
3611
|
-
const f =
|
|
3618
|
+
const f = ll(h);
|
|
3612
3619
|
if (f === void 0)
|
|
3613
3620
|
return null;
|
|
3614
3621
|
o.push(f);
|
|
3615
3622
|
}
|
|
3616
3623
|
const r = document.createElement("div");
|
|
3617
3624
|
r.className = "pluno-pa-widget__table-scroll";
|
|
3618
|
-
const l = document.createElement("table"),
|
|
3625
|
+
const l = document.createElement("table"), p = document.createElement("thead"), d = document.createElement("tr");
|
|
3619
3626
|
n.forEach((h, f) => {
|
|
3620
|
-
const y = document.createElement("th"),
|
|
3621
|
-
|
|
3622
|
-
}),
|
|
3627
|
+
const y = document.createElement("th"), v = o[f];
|
|
3628
|
+
v && y.classList.add(`pluno-pa-widget__table-cell--${v}`), Pe(y, h), d.appendChild(y);
|
|
3629
|
+
}), p.appendChild(d), l.appendChild(p);
|
|
3623
3630
|
const c = document.createElement("tbody");
|
|
3624
3631
|
let g = t + 2;
|
|
3625
3632
|
for (; g < e.length && e[g].trim(); ) {
|
|
@@ -3627,9 +3634,9 @@ function ll(e, t) {
|
|
|
3627
3634
|
if (!h)
|
|
3628
3635
|
break;
|
|
3629
3636
|
const f = document.createElement("tr");
|
|
3630
|
-
n.forEach((y,
|
|
3631
|
-
const O = document.createElement("td"), u = o[
|
|
3632
|
-
u && O.classList.add(`pluno-pa-widget__table-cell--${u}`), Pe(O, h[
|
|
3637
|
+
n.forEach((y, v) => {
|
|
3638
|
+
const O = document.createElement("td"), u = o[v];
|
|
3639
|
+
u && O.classList.add(`pluno-pa-widget__table-cell--${u}`), Pe(O, h[v] ?? ""), f.appendChild(O);
|
|
3633
3640
|
}), c.appendChild(f), g += 1;
|
|
3634
3641
|
}
|
|
3635
3642
|
return l.appendChild(c), r.appendChild(l), { element: r, nextIndex: g };
|
|
@@ -3655,15 +3662,15 @@ function sl(e, t) {
|
|
|
3655
3662
|
`), f.appendChild(y), e.appendChild(f);
|
|
3656
3663
|
continue;
|
|
3657
3664
|
}
|
|
3658
|
-
const l =
|
|
3665
|
+
const l = pl(n, i);
|
|
3659
3666
|
if (l) {
|
|
3660
3667
|
e.appendChild(l.element), i = l.nextIndex;
|
|
3661
3668
|
continue;
|
|
3662
3669
|
}
|
|
3663
|
-
const
|
|
3664
|
-
if (
|
|
3665
|
-
const h = document.createElement(`h${
|
|
3666
|
-
Pe(h,
|
|
3670
|
+
const p = o.match(/^(#{1,3})\s+(.+)$/);
|
|
3671
|
+
if (p) {
|
|
3672
|
+
const h = document.createElement(`h${p[1].length + 2}`);
|
|
3673
|
+
Pe(h, p[2]), e.appendChild(h), i += 1;
|
|
3667
3674
|
continue;
|
|
3668
3675
|
}
|
|
3669
3676
|
if (/^\s*[-*+]\s+/.test(o)) {
|
|
@@ -3704,19 +3711,19 @@ function Pe(e, t) {
|
|
|
3704
3711
|
);
|
|
3705
3712
|
const l = o[0];
|
|
3706
3713
|
if (l.startsWith("`")) {
|
|
3707
|
-
const
|
|
3708
|
-
|
|
3714
|
+
const p = document.createElement("code");
|
|
3715
|
+
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
3709
3716
|
} else if (l.startsWith("**")) {
|
|
3710
|
-
const
|
|
3711
|
-
Pe(
|
|
3717
|
+
const p = document.createElement("strong");
|
|
3718
|
+
Pe(p, l.slice(2, -2)), e.appendChild(p);
|
|
3712
3719
|
} else if (l.startsWith("*")) {
|
|
3713
|
-
const
|
|
3714
|
-
Pe(
|
|
3720
|
+
const p = document.createElement("em");
|
|
3721
|
+
Pe(p, l.slice(1, -1)), e.appendChild(p);
|
|
3715
3722
|
} else {
|
|
3716
|
-
const
|
|
3717
|
-
if (
|
|
3723
|
+
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3724
|
+
if (p && dl(p[2])) {
|
|
3718
3725
|
const d = document.createElement("a");
|
|
3719
|
-
d.href =
|
|
3726
|
+
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
3720
3727
|
} else
|
|
3721
3728
|
e.appendChild(document.createTextNode(l));
|
|
3722
3729
|
}
|
|
@@ -3724,7 +3731,7 @@ function Pe(e, t) {
|
|
|
3724
3731
|
}
|
|
3725
3732
|
i < t.length && e.appendChild(document.createTextNode(t.slice(i)));
|
|
3726
3733
|
}
|
|
3727
|
-
function
|
|
3734
|
+
function dl(e) {
|
|
3728
3735
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3729
3736
|
return !0;
|
|
3730
3737
|
try {
|
|
@@ -3734,8 +3741,8 @@ function pl(e) {
|
|
|
3734
3741
|
return !1;
|
|
3735
3742
|
}
|
|
3736
3743
|
}
|
|
3737
|
-
function
|
|
3738
|
-
if (
|
|
3744
|
+
function Ro(e, t) {
|
|
3745
|
+
if (cl(e))
|
|
3739
3746
|
return;
|
|
3740
3747
|
const n = `
|
|
3741
3748
|
:host {
|
|
@@ -3787,7 +3794,7 @@ function Mo(e, t) {
|
|
|
3787
3794
|
--pluno-pa-launcher-width: min(190px, calc(100vw - 36px));
|
|
3788
3795
|
--pluno-pa-launcher-height: 41px;
|
|
3789
3796
|
--pluno-pa-panel-width: min(clamp(420px, 24vw, 520px), calc(100vw - 16px));
|
|
3790
|
-
--pluno-pa-panel-height: min(clamp(680px, 76vh, 800px), calc(
|
|
3797
|
+
--pluno-pa-panel-height: min(clamp(680px, 76vh, 800px), calc(100dvh - 58px));
|
|
3791
3798
|
--pluno-pa-panel-offset-x: calc(var(--pluno-pa-launcher-width) - var(--pluno-pa-panel-width));
|
|
3792
3799
|
--pluno-pa-panel-offset-y: calc(var(--pluno-pa-launcher-height) - var(--pluno-pa-panel-height));
|
|
3793
3800
|
--pluno-pa-accent-soft: rgba(24, 24, 27, 0.12);
|
|
@@ -3814,6 +3821,7 @@ function Mo(e, t) {
|
|
|
3814
3821
|
}
|
|
3815
3822
|
.pluno-pa-widget--layout-page {
|
|
3816
3823
|
position: relative !important;
|
|
3824
|
+
z-index: 0;
|
|
3817
3825
|
inset: auto !important;
|
|
3818
3826
|
width: 100%;
|
|
3819
3827
|
height: 100%;
|
|
@@ -3894,6 +3902,10 @@ function Mo(e, t) {
|
|
|
3894
3902
|
box-shadow 150ms ease,
|
|
3895
3903
|
background 150ms ease;
|
|
3896
3904
|
}
|
|
3905
|
+
.pluno-pa-widget__launcher--movable {
|
|
3906
|
+
/* Mobile browsers otherwise claim the gesture as page scrolling before the launcher can start dragging. */
|
|
3907
|
+
touch-action: none;
|
|
3908
|
+
}
|
|
3897
3909
|
.pluno-pa-widget__launcher-drag-handle {
|
|
3898
3910
|
position: absolute;
|
|
3899
3911
|
z-index: 2;
|
|
@@ -4038,6 +4050,10 @@ function Mo(e, t) {
|
|
|
4038
4050
|
background: transparent;
|
|
4039
4051
|
box-shadow: none;
|
|
4040
4052
|
cursor: pointer;
|
|
4053
|
+
/* Keep the larger transparent touch target from flashing the browser's selection highlight. */
|
|
4054
|
+
-webkit-tap-highlight-color: transparent;
|
|
4055
|
+
-webkit-user-select: none;
|
|
4056
|
+
user-select: none;
|
|
4041
4057
|
width: var(--pluno-pa-launcher-width);
|
|
4042
4058
|
min-width: 0;
|
|
4043
4059
|
height: var(--pluno-pa-launcher-height);
|
|
@@ -5738,6 +5754,10 @@ function Mo(e, t) {
|
|
|
5738
5754
|
--pluno-pa-scribble-wobble-alt: 15px 225px 15px 255px / 255px 15px 225px 15px;
|
|
5739
5755
|
font-size: 17px;
|
|
5740
5756
|
}
|
|
5757
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized {
|
|
5758
|
+
--pluno-pa-launcher-width: 22px;
|
|
5759
|
+
--pluno-pa-launcher-height: 22px;
|
|
5760
|
+
}
|
|
5741
5761
|
.pluno-pa-widget--scribble .pluno-pa-widget__panel {
|
|
5742
5762
|
/* The paper sheet and border live on ::before so the wobble filter can
|
|
5743
5763
|
bend them; overflow must stay visible for the spiral binding on top */
|
|
@@ -6182,29 +6202,114 @@ function Mo(e, t) {
|
|
|
6182
6202
|
.pluno-pa-widget--scribble .pluno-pa-widget__close svg {
|
|
6183
6203
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
6184
6204
|
}
|
|
6205
|
+
@media (hover: none), (pointer: coarse) {
|
|
6206
|
+
.pluno-pa-widget:not(.pluno-pa-widget--layout-page):not(.pluno-pa-widget--minimized) {
|
|
6207
|
+
--pluno-pa-launcher-width: min(168px, calc(100vw - 24px));
|
|
6208
|
+
--pluno-pa-launcher-height: 42px;
|
|
6209
|
+
--pluno-pa-panel-height: min(clamp(560px, 76dvh, 800px), calc(100dvh - 58px));
|
|
6210
|
+
}
|
|
6211
|
+
.pluno-pa-widget--bottom-right { right: 12px; bottom: 12px; }
|
|
6212
|
+
.pluno-pa-widget--bottom-left { left: 12px; bottom: 12px; }
|
|
6213
|
+
.pluno-pa-widget--minimized,
|
|
6214
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized {
|
|
6215
|
+
--pluno-pa-launcher-width: 32px;
|
|
6216
|
+
--pluno-pa-launcher-height: 32px;
|
|
6217
|
+
}
|
|
6218
|
+
.pluno-pa-widget--scribble.pluno-pa-widget--minimized .pluno-pa-widget__character--launcher {
|
|
6219
|
+
left: 6px;
|
|
6220
|
+
}
|
|
6221
|
+
.pluno-pa-widget--minimized:not(.pluno-pa-widget--scribble) .pluno-pa-widget__character--launcher {
|
|
6222
|
+
left: 6px;
|
|
6223
|
+
}
|
|
6224
|
+
.pluno-pa-widget__launcher--minimizable .pluno-pa-widget__launcher-minimize {
|
|
6225
|
+
opacity: 1;
|
|
6226
|
+
pointer-events: auto;
|
|
6227
|
+
transform: translateY(0) scale(1);
|
|
6228
|
+
}
|
|
6229
|
+
.pluno-pa-widget--scribble:not(.pluno-pa-widget--minimized) .pluno-pa-widget__launcher {
|
|
6230
|
+
height: 42px;
|
|
6231
|
+
}
|
|
6232
|
+
.pluno-pa-widget--scribble:not(.pluno-pa-widget--minimized) .pluno-pa-widget__character--launcher {
|
|
6233
|
+
width: 38px;
|
|
6234
|
+
height: 38px;
|
|
6235
|
+
margin-top: 2px;
|
|
6236
|
+
}
|
|
6237
|
+
.pluno-pa-widget--scribble:not(.pluno-pa-widget--minimized) .pluno-pa-widget__launcher-input {
|
|
6238
|
+
height: 24px;
|
|
6239
|
+
margin-top: 1px;
|
|
6240
|
+
padding-left: 40px;
|
|
6241
|
+
font-size: 14px;
|
|
6242
|
+
line-height: 24px;
|
|
6243
|
+
}
|
|
6244
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__panel {
|
|
6245
|
+
border-radius: 12px;
|
|
6246
|
+
}
|
|
6247
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__composer-inner {
|
|
6248
|
+
padding-right: 50px;
|
|
6249
|
+
}
|
|
6250
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__send {
|
|
6251
|
+
width: 36px;
|
|
6252
|
+
height: 36px;
|
|
6253
|
+
margin-top: -18px;
|
|
6254
|
+
}
|
|
6255
|
+
.pluno-pa-widget--layout-page .pluno-pa-widget__starter-prompt {
|
|
6256
|
+
display: flex;
|
|
6257
|
+
min-height: 44px;
|
|
6258
|
+
align-items: center;
|
|
6259
|
+
}
|
|
6260
|
+
}
|
|
6261
|
+
@media (max-width: 767px) {
|
|
6262
|
+
/* Mobile chat fills the available viewport while preserving host navigation and the widget frame. */
|
|
6263
|
+
.pluno-pa-widget:not(.pluno-pa-widget--layout-page) .pluno-pa-widget__panel {
|
|
6264
|
+
position: fixed;
|
|
6265
|
+
top: calc(var(--pluno-pa-mobile-panel-top-offset, 0px) + max(8px, env(safe-area-inset-top))) !important;
|
|
6266
|
+
right: max(8px, env(safe-area-inset-right)) !important;
|
|
6267
|
+
bottom: max(8px, env(safe-area-inset-bottom)) !important;
|
|
6268
|
+
left: max(8px, env(safe-area-inset-left)) !important;
|
|
6269
|
+
width: auto !important;
|
|
6270
|
+
height: auto !important;
|
|
6271
|
+
transform: none;
|
|
6272
|
+
}
|
|
6273
|
+
.pluno-pa-widget:not(.pluno-pa-widget--layout-page) .pluno-pa-widget__resize-handle {
|
|
6274
|
+
display: none !important;
|
|
6275
|
+
}
|
|
6276
|
+
.pluno-pa-widget:not(.pluno-pa-widget--layout-page).pluno-pa-widget--open .pluno-pa-widget__close,
|
|
6277
|
+
.pluno-pa-widget:not(.pluno-pa-widget--layout-page).pluno-pa-widget--closing .pluno-pa-widget__close {
|
|
6278
|
+
position: fixed;
|
|
6279
|
+
/* Match the control-row centerline while keeping collapse separate on the left. */
|
|
6280
|
+
top: calc(var(--pluno-pa-mobile-panel-top-offset, 0px) + max(8px, env(safe-area-inset-top)) + 15px);
|
|
6281
|
+
right: auto;
|
|
6282
|
+
left: calc(max(8px, env(safe-area-inset-left)) + 13px);
|
|
6283
|
+
}
|
|
6284
|
+
.pluno-pa-widget:not(.pluno-pa-widget--layout-page).pluno-pa-widget--open .pluno-pa-widget__close {
|
|
6285
|
+
opacity: 1;
|
|
6286
|
+
pointer-events: auto;
|
|
6287
|
+
transform: translateY(0) scale(1);
|
|
6288
|
+
}
|
|
6289
|
+
}
|
|
6185
6290
|
`;
|
|
6186
|
-
if (
|
|
6291
|
+
if (ul(e, n))
|
|
6187
6292
|
return;
|
|
6188
6293
|
const i = e.ownerDocument.createElement("style");
|
|
6189
|
-
i.id =
|
|
6294
|
+
i.id = Yo, i.textContent = n, e.appendChild(i), ci(e);
|
|
6190
6295
|
}
|
|
6191
|
-
function
|
|
6192
|
-
return e.getElementById(
|
|
6296
|
+
function cl(e) {
|
|
6297
|
+
return e.getElementById(Yo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Xo) === "true";
|
|
6193
6298
|
}
|
|
6194
|
-
function
|
|
6195
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
6299
|
+
function ci(e) {
|
|
6300
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Xo, "true");
|
|
6196
6301
|
}
|
|
6197
|
-
function
|
|
6302
|
+
function ul(e, t) {
|
|
6198
6303
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
6199
6304
|
return !1;
|
|
6200
6305
|
try {
|
|
6201
6306
|
const n = new CSSStyleSheet();
|
|
6202
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
6307
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ci(e), !0;
|
|
6203
6308
|
} catch {
|
|
6204
6309
|
return !1;
|
|
6205
6310
|
}
|
|
6206
6311
|
}
|
|
6207
|
-
async function
|
|
6312
|
+
async function gl() {
|
|
6208
6313
|
return document.body ? document.body : await new Promise((e) => {
|
|
6209
6314
|
const t = new MutationObserver(() => {
|
|
6210
6315
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -6215,13 +6320,13 @@ async function ul() {
|
|
|
6215
6320
|
function On(e) {
|
|
6216
6321
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
6217
6322
|
}
|
|
6218
|
-
function
|
|
6323
|
+
function ui(e) {
|
|
6219
6324
|
return `${On(e)}.displayState`;
|
|
6220
6325
|
}
|
|
6221
|
-
function
|
|
6326
|
+
function hl(e) {
|
|
6222
6327
|
try {
|
|
6223
6328
|
return window.sessionStorage.getItem(
|
|
6224
|
-
|
|
6329
|
+
ui(e)
|
|
6225
6330
|
) === "minimized" ? "minimized" : "shown";
|
|
6226
6331
|
} catch {
|
|
6227
6332
|
return "shown";
|
|
@@ -6230,7 +6335,7 @@ function gl(e) {
|
|
|
6230
6335
|
function zo(e, t) {
|
|
6231
6336
|
if (e.layout === "floating")
|
|
6232
6337
|
try {
|
|
6233
|
-
const n =
|
|
6338
|
+
const n = ui(e);
|
|
6234
6339
|
if (t === "minimized") {
|
|
6235
6340
|
window.sessionStorage.setItem(n, t);
|
|
6236
6341
|
return;
|
|
@@ -6240,15 +6345,15 @@ function zo(e, t) {
|
|
|
6240
6345
|
return;
|
|
6241
6346
|
}
|
|
6242
6347
|
}
|
|
6243
|
-
function
|
|
6348
|
+
function ml(e) {
|
|
6244
6349
|
if (e)
|
|
6245
6350
|
return { clientId: e, release: () => {
|
|
6246
6351
|
} };
|
|
6247
6352
|
let t = 0;
|
|
6248
|
-
for (;
|
|
6353
|
+
for (; sn.has(t); )
|
|
6249
6354
|
t += 1;
|
|
6250
|
-
|
|
6251
|
-
const n = `${
|
|
6355
|
+
sn.add(t);
|
|
6356
|
+
const n = `${Sa}${t}`;
|
|
6252
6357
|
let i = crypto.randomUUID();
|
|
6253
6358
|
try {
|
|
6254
6359
|
i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
|
|
@@ -6258,15 +6363,15 @@ function hl(e) {
|
|
|
6258
6363
|
return {
|
|
6259
6364
|
clientId: i,
|
|
6260
6365
|
release: () => {
|
|
6261
|
-
o || (o = !0,
|
|
6366
|
+
o || (o = !0, sn.delete(t));
|
|
6262
6367
|
}
|
|
6263
6368
|
};
|
|
6264
6369
|
}
|
|
6265
|
-
function
|
|
6370
|
+
function fl(e) {
|
|
6266
6371
|
try {
|
|
6267
6372
|
const t = window.localStorage.getItem(On(e));
|
|
6268
6373
|
if (!t)
|
|
6269
|
-
return
|
|
6374
|
+
return Mo();
|
|
6270
6375
|
const n = JSON.parse(t);
|
|
6271
6376
|
return {
|
|
6272
6377
|
isOpen: n.isOpen === !0,
|
|
@@ -6276,16 +6381,16 @@ function ml(e) {
|
|
|
6276
6381
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
6277
6382
|
(i) => typeof i == "string"
|
|
6278
6383
|
) : [],
|
|
6279
|
-
launcherPosition:
|
|
6280
|
-
panelSize:
|
|
6281
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-
|
|
6384
|
+
launcherPosition: xl(n.launcherPosition) ? n.launcherPosition : null,
|
|
6385
|
+
panelSize: yl(n.panelSize) ? Ot(n.panelSize) : null,
|
|
6386
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-Wo) : [],
|
|
6282
6387
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
6283
6388
|
};
|
|
6284
6389
|
} catch {
|
|
6285
|
-
return
|
|
6390
|
+
return Mo();
|
|
6286
6391
|
}
|
|
6287
6392
|
}
|
|
6288
|
-
async function
|
|
6393
|
+
async function wl(e) {
|
|
6289
6394
|
if (e.loadSharePromptsDisabled)
|
|
6290
6395
|
return e.loadSharePromptsDisabled();
|
|
6291
6396
|
try {
|
|
@@ -6294,7 +6399,7 @@ async function fl(e) {
|
|
|
6294
6399
|
return !1;
|
|
6295
6400
|
}
|
|
6296
6401
|
}
|
|
6297
|
-
function
|
|
6402
|
+
function bl(e, t) {
|
|
6298
6403
|
if (e.persistSharePromptsDisabled) {
|
|
6299
6404
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
6300
6405
|
() => {
|
|
@@ -6308,7 +6413,7 @@ function wl(e, t) {
|
|
|
6308
6413
|
return;
|
|
6309
6414
|
}
|
|
6310
6415
|
}
|
|
6311
|
-
function
|
|
6416
|
+
function Mo() {
|
|
6312
6417
|
return {
|
|
6313
6418
|
isOpen: !1,
|
|
6314
6419
|
composerValue: "",
|
|
@@ -6321,7 +6426,7 @@ function Do() {
|
|
|
6321
6426
|
sharePromptsDisabled: !1
|
|
6322
6427
|
};
|
|
6323
6428
|
}
|
|
6324
|
-
function
|
|
6429
|
+
function _l(e, t) {
|
|
6325
6430
|
try {
|
|
6326
6431
|
window.localStorage.setItem(
|
|
6327
6432
|
On(e),
|
|
@@ -6331,19 +6436,19 @@ function bl(e, t) {
|
|
|
6331
6436
|
return;
|
|
6332
6437
|
}
|
|
6333
6438
|
}
|
|
6334
|
-
function
|
|
6439
|
+
function xl(e) {
|
|
6335
6440
|
if (!e || typeof e != "object")
|
|
6336
6441
|
return !1;
|
|
6337
6442
|
const t = e;
|
|
6338
6443
|
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");
|
|
6339
6444
|
}
|
|
6340
|
-
function
|
|
6445
|
+
function yl(e) {
|
|
6341
6446
|
if (!e || typeof e != "object")
|
|
6342
6447
|
return !1;
|
|
6343
6448
|
const t = e;
|
|
6344
6449
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
6345
6450
|
}
|
|
6346
|
-
async function
|
|
6451
|
+
async function gi(e, t) {
|
|
6347
6452
|
const n = await fetch(e, {
|
|
6348
6453
|
method: "POST",
|
|
6349
6454
|
credentials: "include",
|
|
@@ -6355,7 +6460,7 @@ async function hi(e, t) {
|
|
|
6355
6460
|
...t ? { signal: t } : {}
|
|
6356
6461
|
});
|
|
6357
6462
|
if (!n.ok) {
|
|
6358
|
-
const o = await n.text(), r =
|
|
6463
|
+
const o = await n.text(), r = Mi(o);
|
|
6359
6464
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
6360
6465
|
}
|
|
6361
6466
|
const i = await n.json();
|
|
@@ -6363,15 +6468,15 @@ async function hi(e, t) {
|
|
|
6363
6468
|
throw new Error("Pluno token endpoint did not return a token");
|
|
6364
6469
|
return i.token;
|
|
6365
6470
|
}
|
|
6366
|
-
function
|
|
6471
|
+
function vl(e) {
|
|
6367
6472
|
let t = !1, n = !1;
|
|
6368
6473
|
const i = async () => {
|
|
6369
6474
|
const o = new AbortController();
|
|
6370
6475
|
let r = !1;
|
|
6371
|
-
const l = new Promise((
|
|
6476
|
+
const l = new Promise((p, d) => {
|
|
6372
6477
|
const c = window.setTimeout(() => {
|
|
6373
6478
|
r = !0, o.abort(), d(new Error(co));
|
|
6374
|
-
},
|
|
6479
|
+
}, ya);
|
|
6375
6480
|
o.signal.addEventListener(
|
|
6376
6481
|
"abort",
|
|
6377
6482
|
() => window.clearTimeout(c),
|
|
@@ -6379,13 +6484,13 @@ function yl(e) {
|
|
|
6379
6484
|
);
|
|
6380
6485
|
});
|
|
6381
6486
|
try {
|
|
6382
|
-
const
|
|
6383
|
-
|
|
6487
|
+
const p = await Promise.race([
|
|
6488
|
+
gi(e, o.signal),
|
|
6384
6489
|
l
|
|
6385
6490
|
]);
|
|
6386
|
-
return o.abort(),
|
|
6387
|
-
} catch (
|
|
6388
|
-
throw o.abort(), r ? new Error(co) :
|
|
6491
|
+
return o.abort(), p;
|
|
6492
|
+
} catch (p) {
|
|
6493
|
+
throw o.abort(), r ? new Error(co) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(va);
|
|
6389
6494
|
}
|
|
6390
6495
|
};
|
|
6391
6496
|
return {
|
|
@@ -6408,30 +6513,30 @@ function yl(e) {
|
|
|
6408
6513
|
}
|
|
6409
6514
|
};
|
|
6410
6515
|
}
|
|
6411
|
-
const
|
|
6412
|
-
function
|
|
6516
|
+
const Do = /* @__PURE__ */ new WeakSet();
|
|
6517
|
+
function Sl(e) {
|
|
6413
6518
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
6414
6519
|
}
|
|
6415
|
-
function
|
|
6520
|
+
function Oo(e) {
|
|
6416
6521
|
const t = e.pathname.split("/");
|
|
6417
6522
|
return t[t.length - 1] ?? "";
|
|
6418
6523
|
}
|
|
6419
|
-
function
|
|
6524
|
+
function Cl(e, t) {
|
|
6420
6525
|
const n = new URL(e.src, document.baseURI);
|
|
6421
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
6526
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : Oo(n) === Oo(t);
|
|
6422
6527
|
}
|
|
6423
6528
|
class Se extends EventTarget {
|
|
6424
6529
|
constructor(t, n) {
|
|
6425
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
6530
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(fa, () => {
|
|
6426
6531
|
this.readyState = Se.OPEN, this.dispatchEvent(new Event("open"));
|
|
6427
|
-
}), this.addPreviewListener(
|
|
6532
|
+
}), this.addPreviewListener(wa, (i) => {
|
|
6428
6533
|
const o = i;
|
|
6429
6534
|
this.dispatchEvent(
|
|
6430
6535
|
new MessageEvent("message", { data: o.detail?.data ?? "" })
|
|
6431
6536
|
);
|
|
6432
|
-
}), this.addPreviewListener(
|
|
6537
|
+
}), this.addPreviewListener(ba, () => {
|
|
6433
6538
|
this.readyState = Se.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6434
|
-
}), this.addPreviewListener(
|
|
6539
|
+
}), this.addPreviewListener(_a, (i) => {
|
|
6435
6540
|
const o = i;
|
|
6436
6541
|
this.readyState = Se.CLOSED, this.dispatchEvent(
|
|
6437
6542
|
new CloseEvent("close", {
|
|
@@ -6443,7 +6548,7 @@ class Se extends EventTarget {
|
|
|
6443
6548
|
}), window.dispatchEvent(
|
|
6444
6549
|
new CustomEvent(
|
|
6445
6550
|
It(
|
|
6446
|
-
|
|
6551
|
+
ga,
|
|
6447
6552
|
this.channelId
|
|
6448
6553
|
),
|
|
6449
6554
|
{
|
|
@@ -6463,7 +6568,7 @@ class Se extends EventTarget {
|
|
|
6463
6568
|
binaryType = "blob";
|
|
6464
6569
|
bufferedAmount = 0;
|
|
6465
6570
|
readyState = Se.CONNECTING;
|
|
6466
|
-
socketId =
|
|
6571
|
+
socketId = El();
|
|
6467
6572
|
listeners = /* @__PURE__ */ new Map();
|
|
6468
6573
|
send(t) {
|
|
6469
6574
|
if (this.readyState !== Se.OPEN)
|
|
@@ -6473,7 +6578,7 @@ class Se extends EventTarget {
|
|
|
6473
6578
|
);
|
|
6474
6579
|
window.dispatchEvent(
|
|
6475
6580
|
new CustomEvent(
|
|
6476
|
-
It(
|
|
6581
|
+
It(ha, this.channelId),
|
|
6477
6582
|
{
|
|
6478
6583
|
detail: {
|
|
6479
6584
|
socketId: this.socketId,
|
|
@@ -6486,7 +6591,7 @@ class Se extends EventTarget {
|
|
|
6486
6591
|
close(t, n) {
|
|
6487
6592
|
this.readyState !== Se.CLOSED && (this.readyState = Se.CLOSING, window.dispatchEvent(
|
|
6488
6593
|
new CustomEvent(
|
|
6489
|
-
It(
|
|
6594
|
+
It(ma, this.channelId),
|
|
6490
6595
|
{
|
|
6491
6596
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
6492
6597
|
}
|
|
@@ -6508,19 +6613,19 @@ class Se extends EventTarget {
|
|
|
6508
6613
|
this.listeners.clear();
|
|
6509
6614
|
}
|
|
6510
6615
|
}
|
|
6511
|
-
function
|
|
6616
|
+
function El() {
|
|
6512
6617
|
const e = window.sessionStorage.getItem(
|
|
6513
|
-
|
|
6618
|
+
so
|
|
6514
6619
|
);
|
|
6515
6620
|
if (e)
|
|
6516
6621
|
return e;
|
|
6517
6622
|
const t = crypto.randomUUID();
|
|
6518
|
-
return window.sessionStorage.setItem(
|
|
6623
|
+
return window.sessionStorage.setItem(so, t), t;
|
|
6519
6624
|
}
|
|
6520
6625
|
function It(e, t) {
|
|
6521
6626
|
return `${e}:${t}`;
|
|
6522
6627
|
}
|
|
6523
|
-
function
|
|
6628
|
+
function kl(e) {
|
|
6524
6629
|
const t = document.currentScript;
|
|
6525
6630
|
if (t instanceof HTMLScriptElement)
|
|
6526
6631
|
return [t];
|
|
@@ -6528,35 +6633,35 @@ function El(e) {
|
|
|
6528
6633
|
return Array.from(
|
|
6529
6634
|
document.querySelectorAll("script[type='module'][src]")
|
|
6530
6635
|
).filter(
|
|
6531
|
-
(o) => o instanceof HTMLScriptElement &&
|
|
6636
|
+
(o) => o instanceof HTMLScriptElement && Sl(o) && Cl(o, i)
|
|
6532
6637
|
);
|
|
6533
6638
|
}
|
|
6534
|
-
function
|
|
6535
|
-
for (const t of
|
|
6536
|
-
|
|
6639
|
+
function Ll(e) {
|
|
6640
|
+
for (const t of kl(e))
|
|
6641
|
+
Do.has(t) || t.dataset.plunoAutoMount === "false" || (Do.add(t), hi(t).catch((n) => {
|
|
6537
6642
|
console.error("Failed to mount Pluno widget", n);
|
|
6538
6643
|
}));
|
|
6539
6644
|
}
|
|
6540
|
-
function
|
|
6645
|
+
function hi(e) {
|
|
6541
6646
|
const t = window, n = t[ye];
|
|
6542
6647
|
if (n) {
|
|
6543
6648
|
if (n.host === null)
|
|
6544
6649
|
return n.mountPromise.catch(() => {
|
|
6545
6650
|
const d = t[ye];
|
|
6546
|
-
return d ? d.mountPromise :
|
|
6651
|
+
return d ? d.mountPromise : hi(e);
|
|
6547
6652
|
});
|
|
6548
|
-
if (
|
|
6653
|
+
if (Tl(n.host))
|
|
6549
6654
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6550
6655
|
n.destroy?.(), delete t[ye];
|
|
6551
6656
|
}
|
|
6552
|
-
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ?
|
|
6657
|
+
const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? vl(o) : null;
|
|
6553
6658
|
let l;
|
|
6554
|
-
const
|
|
6659
|
+
const p = Ga({
|
|
6555
6660
|
token: e.dataset.plunoToken,
|
|
6556
6661
|
tokenProvider: r?.loadToken,
|
|
6557
6662
|
tokenEndpoint: o,
|
|
6558
6663
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
6559
|
-
webSocketFactory: i ?
|
|
6664
|
+
webSocketFactory: i ? $a(i) : void 0,
|
|
6560
6665
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
6561
6666
|
accentColor: e.dataset.plunoAccentColor,
|
|
6562
6667
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
@@ -6569,24 +6674,24 @@ function mi(e) {
|
|
|
6569
6674
|
return;
|
|
6570
6675
|
}
|
|
6571
6676
|
const c = d.host;
|
|
6572
|
-
c.setAttribute(
|
|
6677
|
+
c.setAttribute(Ho, "true"), l.host = c, l.destroy = () => {
|
|
6573
6678
|
t[ye] === l && delete t[ye], l.host = null, l.destroy = null, d.destroy();
|
|
6574
6679
|
};
|
|
6575
6680
|
}).catch((d) => {
|
|
6576
6681
|
throw t[ye] === l && delete t[ye], d;
|
|
6577
6682
|
});
|
|
6578
6683
|
return l = {
|
|
6579
|
-
mountPromise:
|
|
6684
|
+
mountPromise: p,
|
|
6580
6685
|
host: null,
|
|
6581
6686
|
destroy: null,
|
|
6582
6687
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6583
|
-
}, t[ye] = l,
|
|
6688
|
+
}, t[ye] = l, p;
|
|
6584
6689
|
}
|
|
6585
|
-
function
|
|
6586
|
-
return e.isConnected && e.getAttribute(
|
|
6690
|
+
function Tl(e) {
|
|
6691
|
+
return e.isConnected && e.getAttribute(Ho) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
6587
6692
|
}
|
|
6588
|
-
|
|
6693
|
+
Ll(import.meta.url);
|
|
6589
6694
|
export {
|
|
6590
|
-
|
|
6695
|
+
$a as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6591
6696
|
Ga as mountPlunoProductAgentWidget
|
|
6592
6697
|
};
|