@pagelines/sdk 1.0.915 → 1.0.916
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/BotProvider.js +1 -2
- package/dist/BotProvider.js.map +1 -1
- package/dist/BotWidgetInline.js +1 -3
- package/dist/BotWidgetInline.js.map +1 -1
- package/dist/BotWidgetModal.js +1 -3
- package/dist/BotWidgetModal.js.map +1 -1
- package/dist/BotWrap.js +1142 -1171
- package/dist/BotWrap.js.map +1 -1
- package/dist/bot.js +9 -24
- package/dist/bot.js.map +1 -1
- package/dist/constants.js +1 -2
- package/dist/provider.js +1 -2
- package/dist/provider2.js +181 -392
- package/dist/provider2.js.map +1 -1
- package/dist/rolldown-runtime.js +1 -2
- package/dist/sdkClient.js +8 -16
- package/dist/sdkClient.js.map +1 -1
- package/dist/useWidgetState.js +1 -2
- package/dist/widget.js +3 -6
- package/dist/widget.js.map +1 -1
- package/package.json +4 -4
package/dist/BotWrap.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime.js";
|
|
2
2
|
import { c as t, t as n } from "./sdkClient.js";
|
|
3
3
|
import { CUSTOMER_COMPUTER_STATE_LABEL as r, SettingsObject as i, chatTransportError as a, createLogger as o, customerComputerState as s, getDefaultAvatarUrl as c, isAssistantSilenceControl as d, parseChatCardFencePayload as f, parseChatVisualFencePayload as p } from "@pagelines/core";
|
|
4
|
-
import { Fragment as m, Teleport as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as w, createTextVNode as T, createVNode as E, defineComponent as D, guardReactiveProps as A, nextTick as ee, normalizeClass as j, normalizeProps as M, normalizeStyle as N, onBeforeUnmount as te, onMounted as ne, onUnmounted as ae, openBlock as R, ref as B, renderList as V, renderSlot as ce, resolveDynamicComponent as
|
|
5
|
-
|
|
6
|
-
var
|
|
4
|
+
import { Fragment as m, Teleport as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as w, createTextVNode as T, createVNode as E, defineComponent as D, guardReactiveProps as A, nextTick as ee, normalizeClass as j, normalizeProps as M, normalizeStyle as N, onBeforeUnmount as te, onMounted as ne, onUnmounted as ae, openBlock as R, ref as B, renderList as V, renderSlot as ce, resolveDynamicComponent as le, shallowRef as H, toDisplayString as U, unref as ue, useTemplateRef as fe, vModelText as pe, watch as G, withCtx as me, withDirectives as he, withKeys as ge, withModifiers as _e } from "vue";
|
|
5
|
+
// \0plugin-vue:export-helper
|
|
6
|
+
var ve = /* @__PURE__ */ e((e, t) => {
|
|
7
7
|
let n = e.__vccOpts || e;
|
|
8
8
|
for (let [e, r] of t) n[e] = r;
|
|
9
9
|
return n;
|
|
10
|
-
}, "default"),
|
|
10
|
+
}, "default"), ye = {}, xe = { class: "spinner max-w-sm" };
|
|
11
11
|
function _sfc_render(e, t) {
|
|
12
|
-
return R(), x("div",
|
|
12
|
+
return R(), x("div", xe, [...t[0] || (t[0] = [w("svg", {
|
|
13
13
|
class: "ring-circular h-full w-full origin-center",
|
|
14
14
|
viewBox: "25 25 50 50"
|
|
15
15
|
}, [w("circle", {
|
|
@@ -23,9 +23,8 @@ function _sfc_render(e, t) {
|
|
|
23
23
|
"stroke-miterlimit": "30"
|
|
24
24
|
})], -1)])]);
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
//#region bot/VoiceRecorderController.ts
|
|
26
|
+
var Se = /*#__PURE__*/ ve(ye, [["render", _sfc_render]]);
|
|
27
|
+
// bot/VoiceRecorderController.ts
|
|
29
28
|
function formatVoiceRecordingDuration(e) {
|
|
30
29
|
let t = Math.max(0, Math.floor(e.ms / 1e3));
|
|
31
30
|
return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
|
|
@@ -40,7 +39,7 @@ function recorderMimeType() {
|
|
|
40
39
|
"audio/webm"
|
|
41
40
|
].find((e) => MediaRecorder.isTypeSupported?.(e)) || "";
|
|
42
41
|
}
|
|
43
|
-
var
|
|
42
|
+
var Ce = 400, VoiceRecorderController = class extends i {
|
|
44
43
|
constructor(e) {
|
|
45
44
|
super("VoiceRecorderController", e), t(this, "state", B({
|
|
46
45
|
phase: "idle",
|
|
@@ -74,15 +73,11 @@ var ye = 400, VoiceRecorderController = class extends i {
|
|
|
74
73
|
this.stream = t, this.recorder = r, this.chunks = [], r.addEventListener("dataavailable", (e) => {
|
|
75
74
|
e.data.size > 0 && this.chunks.push(e.data);
|
|
76
75
|
}), r.addEventListener("stop", async () => {
|
|
77
|
-
let e = new Blob(this.chunks, { type: r.mimeType || n || "audio/webm" }), t = this.now() - this.startedAt, i = !this.cancelOnStop && e.size > 0 && t >=
|
|
78
|
-
|
|
79
|
-
this.reset();
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this.state.value = {
|
|
76
|
+
let e = new Blob(this.chunks, { type: r.mimeType || n || "audio/webm" }), t = this.now() - this.startedAt, i = !this.cancelOnStop && e.size > 0 && t >= Ce;
|
|
77
|
+
this.stopCapture(), i && (this.state.value = {
|
|
83
78
|
phase: "sending",
|
|
84
79
|
elapsedMs: this.state.value.elapsedMs
|
|
85
|
-
}, await this.sendBlob({ blob: e }), this.reset();
|
|
80
|
+
}, await this.sendBlob({ blob: e })), this.reset();
|
|
86
81
|
}), r.start(), this.startedAt = this.now(), this.state.value = {
|
|
87
82
|
phase: "recording",
|
|
88
83
|
elapsedMs: 0
|
|
@@ -100,17 +95,7 @@ var ye = 400, VoiceRecorderController = class extends i {
|
|
|
100
95
|
}
|
|
101
96
|
}
|
|
102
97
|
finish(e) {
|
|
103
|
-
|
|
104
|
-
if (this.state.value.phase === "preparing") {
|
|
105
|
-
this.stopAfterStart = !0, this.cancelOnStop = e.cancelled;
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (!this.recorder || this.recorder.state !== "recording") {
|
|
109
|
-
this.teardown();
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.cancelOnStop = e.cancelled, this.recorder.stop();
|
|
113
|
-
}
|
|
98
|
+
this.state.value.phase !== "idle" && this.state.value.phase !== "sending" && (this.state.value.phase === "preparing" ? (this.stopAfterStart = !0, this.cancelOnStop = e.cancelled) : !this.recorder || this.recorder.state !== "recording" ? this.teardown() : (this.cancelOnStop = e.cancelled, this.recorder.stop()));
|
|
114
99
|
}
|
|
115
100
|
teardown() {
|
|
116
101
|
this.cancelOnStop = !0, this.startToken += 1, this.recorder?.state === "recording" && this.recorder.stop(), this.stopCapture(), this.reset();
|
|
@@ -152,12 +137,11 @@ var ye = 400, VoiceRecorderController = class extends i {
|
|
|
152
137
|
(this.settings.clearInterval ?? clearInterval)(e);
|
|
153
138
|
}
|
|
154
139
|
};
|
|
155
|
-
|
|
156
|
-
//#region bot/work-journal.ts
|
|
140
|
+
// bot/work-journal.ts
|
|
157
141
|
function durableJournalOutcome(e) {
|
|
158
142
|
return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
|
|
159
143
|
}
|
|
160
|
-
var
|
|
144
|
+
var K = {
|
|
161
145
|
finishing: "Finishing up",
|
|
162
146
|
slowHint: "Taking longer than usual.",
|
|
163
147
|
completed: "Work complete",
|
|
@@ -165,7 +149,7 @@ var xe = {
|
|
|
165
149
|
stopped: "Stopped",
|
|
166
150
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
167
151
|
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
168
|
-
},
|
|
152
|
+
}, Ee = 1e4, J = 15e3, De = 6e4, ke = 3;
|
|
169
153
|
function toMs(e) {
|
|
170
154
|
if (!e) return;
|
|
171
155
|
let t = Date.parse(e);
|
|
@@ -181,11 +165,7 @@ function milestoneRows(e, t) {
|
|
|
181
165
|
let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
|
|
182
166
|
for (let e of n) {
|
|
183
167
|
let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
|
|
184
|
-
|
|
185
|
-
n.count += 1, n.lastMs = eventMs(e);
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
r.push({
|
|
168
|
+
t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= J ? (n.count += 1, n.lastMs = eventMs(e)) : r.push({
|
|
189
169
|
id: e.activityId,
|
|
190
170
|
tone: t,
|
|
191
171
|
label: e.label,
|
|
@@ -202,12 +182,12 @@ function milestoneRows(e, t) {
|
|
|
202
182
|
}));
|
|
203
183
|
}
|
|
204
184
|
function splitRows(e) {
|
|
205
|
-
return e.length <=
|
|
185
|
+
return e.length <= ke ? {
|
|
206
186
|
visibleRows: e,
|
|
207
187
|
hiddenRows: []
|
|
208
188
|
} : {
|
|
209
|
-
visibleRows: e.slice(e.length -
|
|
210
|
-
hiddenRows: e.slice(0, e.length -
|
|
189
|
+
visibleRows: e.slice(e.length - ke),
|
|
190
|
+
hiddenRows: e.slice(0, e.length - ke)
|
|
211
191
|
};
|
|
212
192
|
}
|
|
213
193
|
function buildWorkJournalModel(e) {
|
|
@@ -219,7 +199,7 @@ function buildWorkJournalModel(e) {
|
|
|
219
199
|
terminal: {
|
|
220
200
|
id: "work-complete",
|
|
221
201
|
tone: "completed",
|
|
222
|
-
label:
|
|
202
|
+
label: K.completed
|
|
223
203
|
}
|
|
224
204
|
};
|
|
225
205
|
if (n === "failed") {
|
|
@@ -233,7 +213,7 @@ function buildWorkJournalModel(e) {
|
|
|
233
213
|
terminal: {
|
|
234
214
|
id: "work-failed",
|
|
235
215
|
tone: "failed",
|
|
236
|
-
label:
|
|
216
|
+
label: K.failed,
|
|
237
217
|
...o && e?.note ? { note: e.note } : {}
|
|
238
218
|
}
|
|
239
219
|
};
|
|
@@ -247,18 +227,18 @@ function buildWorkJournalModel(e) {
|
|
|
247
227
|
terminal: {
|
|
248
228
|
id: "work-stopped",
|
|
249
229
|
tone: "stopped",
|
|
250
|
-
label:
|
|
230
|
+
label: K.stopped
|
|
251
231
|
}
|
|
252
232
|
};
|
|
253
233
|
}
|
|
254
234
|
let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), d = t.filter((e) => e.status === "started").sort(byEvent).pop(), f = t.reduce((e, t) => Math.max(e, eventMs(t)), a ?? -Infinity), p = Number.isFinite(f) ? f : r, m = t.reduce((e, t) => {
|
|
255
235
|
let n = toMs(t.startedAt) ?? toMs(t.endedAt);
|
|
256
236
|
return n === void 0 ? e : Math.min(e, n);
|
|
257
|
-
}, Infinity), g = p +
|
|
237
|
+
}, Infinity), g = p + Ee, _ = (Number.isFinite(m) ? m : p) + De, v = r >= g, y = d || v ? {
|
|
258
238
|
id: d?.activityId ?? "work-active",
|
|
259
239
|
tone: "active",
|
|
260
|
-
label: d?.label ??
|
|
261
|
-
} : void 0, b = v && r >= _ ? i ?
|
|
240
|
+
label: d?.label ?? K.finishing
|
|
241
|
+
} : void 0, b = v && r >= _ ? i ? K.notifyHint : K.leaveHint : void 0, x = [g, _].filter((e) => e > r).sort((e, t) => e - t)[0];
|
|
262
242
|
return {
|
|
263
243
|
outcome: n,
|
|
264
244
|
visibleRows: s,
|
|
@@ -322,8 +302,7 @@ function buildLiveTurnBlocks(e) {
|
|
|
322
302
|
id: "work-tail"
|
|
323
303
|
}), s;
|
|
324
304
|
}
|
|
325
|
-
|
|
326
|
-
//#region bot/BotController.ts
|
|
305
|
+
// bot/BotController.ts
|
|
327
306
|
var BotChatController = class extends i {
|
|
328
307
|
isQueuedMessage(e) {
|
|
329
308
|
return this.queuedMessageIdSet.value.has(e);
|
|
@@ -352,7 +331,7 @@ var BotChatController = class extends i {
|
|
|
352
331
|
super("BotChatController", e), t(this, "isTextMode", !1), t(this, "lastMessage", {
|
|
353
332
|
hash: "",
|
|
354
333
|
time: 0
|
|
355
|
-
}), t(this, "isConnecting", !1), t(this, "turnEpoch", 0), t(this, "nextStreamToken", 0), t(this, "runningStreamToken", void 0), t(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), t(this, "queuedMessageIdSet", B(/* @__PURE__ */ new Set())), t(this, "queuedMessageIds", v(() => this.queuedMessageIdSet.value)), t(this, "boundaryTimer", void 0), t(this, "nowMs",
|
|
334
|
+
}), t(this, "isConnecting", !1), t(this, "turnEpoch", 0), t(this, "nextStreamToken", 0), t(this, "runningStreamToken", void 0), t(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), t(this, "queuedMessageIdSet", B(/* @__PURE__ */ new Set())), t(this, "queuedMessageIds", v(() => this.queuedMessageIdSet.value)), t(this, "boundaryTimer", void 0), t(this, "nowMs", H(Date.now())), t(this, "toolActivityTiming", H({})), t(this, "lastVisibleProgressAtMs", H()), t(this, "liveSegments", H([])), t(this, "liveStreamMessageId", H(void 0)), t(this, "conversationId", void 0), t(this, "textState", B({
|
|
356
335
|
isActive: !1,
|
|
357
336
|
isConnected: !1,
|
|
358
337
|
isThinking: !1,
|
|
@@ -493,22 +472,14 @@ var BotChatController = class extends i {
|
|
|
493
472
|
async sendComposerMessage() {
|
|
494
473
|
if (!this.canSend.value) return;
|
|
495
474
|
let e = this.composerState.value.text, t = this.composerState.value.pendingAttachments.length > 0 ? [...this.composerState.value.pendingAttachments] : void 0;
|
|
496
|
-
|
|
497
|
-
this.addOfflineSystemReply();
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
this.composerState.value = {
|
|
475
|
+
this.chatEnabled ? (this.composerState.value = {
|
|
501
476
|
...this.composerState.value,
|
|
502
477
|
text: "",
|
|
503
478
|
pendingAttachments: []
|
|
504
|
-
}, await this.sendChatMessage(e, t);
|
|
479
|
+
}, await this.sendChatMessage(e, t)) : this.addOfflineSystemReply();
|
|
505
480
|
}
|
|
506
481
|
async handleComposerAction() {
|
|
507
|
-
|
|
508
|
-
await this.stopChatTurn();
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
this.composerAction.value === "send" && await this.sendComposerMessage();
|
|
482
|
+
this.composerAction.value === "stop" ? await this.stopChatTurn() : this.composerAction.value === "send" && await this.sendComposerMessage();
|
|
512
483
|
}
|
|
513
484
|
getDynamicSettings() {
|
|
514
485
|
return {
|
|
@@ -539,7 +510,7 @@ var BotChatController = class extends i {
|
|
|
539
510
|
});
|
|
540
511
|
}
|
|
541
512
|
setupBoundaryWatcher() {
|
|
542
|
-
|
|
513
|
+
G(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
|
|
543
514
|
this.scheduleBoundary(e);
|
|
544
515
|
});
|
|
545
516
|
}
|
|
@@ -601,27 +572,21 @@ var BotChatController = class extends i {
|
|
|
601
572
|
});
|
|
602
573
|
}
|
|
603
574
|
setupModeWatcher() {
|
|
604
|
-
|
|
575
|
+
G(this.botMode, async (e, t) => {
|
|
605
576
|
this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
|
|
606
577
|
});
|
|
607
578
|
}
|
|
608
579
|
setupAvailabilityWatcher() {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
this.textState.value.isConnected && this.updateState(this.textState, {
|
|
620
|
-
isConnected: !1,
|
|
621
|
-
connectionStatus: "disconnected",
|
|
622
|
-
error: this.chatUnavailableReason
|
|
623
|
-
});
|
|
624
|
-
}
|
|
580
|
+
G(() => [this.chatEnabled, this._bot.state.value.lifecycle], ([e]) => {
|
|
581
|
+
this.isTextMode && !this.isConnecting && (e ? this.textState.value.isConnected || this.updateState(this.textState, {
|
|
582
|
+
isConnected: !0,
|
|
583
|
+
connectionStatus: "connected",
|
|
584
|
+
error: void 0
|
|
585
|
+
}) : this.textState.value.isConnected && this.updateState(this.textState, {
|
|
586
|
+
isConnected: !1,
|
|
587
|
+
connectionStatus: "disconnected",
|
|
588
|
+
error: this.chatUnavailableReason
|
|
589
|
+
}));
|
|
625
590
|
});
|
|
626
591
|
}
|
|
627
592
|
handleError(e) {
|
|
@@ -638,37 +603,33 @@ var BotChatController = class extends i {
|
|
|
638
603
|
this.botMode.value !== e && (this.botMode.value = e);
|
|
639
604
|
}
|
|
640
605
|
async startTextConversation(e = {}) {
|
|
641
|
-
if (this.isConnecting)
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
606
|
+
if (this.isConnecting) this.logger.info("Text conversation already connecting, ignoring duplicate request");
|
|
607
|
+
else {
|
|
608
|
+
this.isConnecting = !0, this.isTextMode = !0, this.updateState(this.textState, {
|
|
609
|
+
isActive: !0,
|
|
610
|
+
connectionStatus: "connecting"
|
|
611
|
+
});
|
|
612
|
+
try {
|
|
613
|
+
if (!this.chatEnabled) {
|
|
614
|
+
this.isConnecting = !1, this.updateState(this.textState, {
|
|
615
|
+
isConnected: !1,
|
|
616
|
+
connectionStatus: "disconnected",
|
|
617
|
+
error: this.chatUnavailableReason
|
|
618
|
+
});
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
651
621
|
this.isConnecting = !1, this.updateState(this.textState, {
|
|
652
|
-
isConnected: !
|
|
653
|
-
connectionStatus: "
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
622
|
+
isConnected: !0,
|
|
623
|
+
connectionStatus: "connected"
|
|
624
|
+
}), e.onConnect?.(), this.logger.info("Text conversation ready");
|
|
625
|
+
} catch (e) {
|
|
626
|
+
throw this.isConnecting = !1, this.handleError(e), e;
|
|
657
627
|
}
|
|
658
|
-
this.isConnecting = !1, this.updateState(this.textState, {
|
|
659
|
-
isConnected: !0,
|
|
660
|
-
connectionStatus: "connected"
|
|
661
|
-
}), e.onConnect?.(), this.logger.info("Text conversation ready");
|
|
662
|
-
} catch (e) {
|
|
663
|
-
throw this.isConnecting = !1, this.handleError(e), e;
|
|
664
628
|
}
|
|
665
629
|
}
|
|
666
630
|
async endConversation() {
|
|
667
|
-
if (this.turnEpoch += 1, this.runningStreamToken = void 0, this.suppressedStreamTokens.clear(), this.queuedMessageIdSet.value = /* @__PURE__ */ new Set(), !this.isTextMode)
|
|
668
|
-
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
try {
|
|
631
|
+
if (this.turnEpoch += 1, this.runningStreamToken = void 0, this.suppressedStreamTokens.clear(), this.queuedMessageIdSet.value = /* @__PURE__ */ new Set(), !this.isTextMode) this.resetState();
|
|
632
|
+
else try {
|
|
672
633
|
this.conversationId = void 0, this.resetState(), this.isTextMode = !1;
|
|
673
634
|
} catch {
|
|
674
635
|
this.isTextMode = !1;
|
|
@@ -919,8 +880,7 @@ function parseToolActivityMs(e) {
|
|
|
919
880
|
function voiceBrowserSupported() {
|
|
920
881
|
return typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof RTCPeerConnection < "u";
|
|
921
882
|
}
|
|
922
|
-
|
|
923
|
-
//#region bot/utils.ts
|
|
883
|
+
// bot/utils.ts
|
|
924
884
|
function getImageSrc(e) {
|
|
925
885
|
return e ? typeof e == "string" ? e : e.src || "" : "";
|
|
926
886
|
}
|
|
@@ -935,12 +895,11 @@ function parseButtonTemplate(e) {
|
|
|
935
895
|
let { template: t, bot: n } = e;
|
|
936
896
|
return t.replace(/{name}/g, n.name || "Assistant").replace(/{title}/g, n.title || "").replace(/{handle}/g, n.handle || "");
|
|
937
897
|
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
var ke = {
|
|
898
|
+
// bot/ui/ElBotButton.vue?vue&type=script&setup=true&lang.ts
|
|
899
|
+
var Ae = {
|
|
941
900
|
key: 0,
|
|
942
901
|
class: "absolute inset-0 flex items-center justify-center"
|
|
943
|
-
},
|
|
902
|
+
}, je = /* @__PURE__ */ D({
|
|
944
903
|
__name: "ElBotButton",
|
|
945
904
|
props: {
|
|
946
905
|
theme: { default: "primary" },
|
|
@@ -968,7 +927,7 @@ var ke = {
|
|
|
968
927
|
md: "size-4",
|
|
969
928
|
lg: "size-5"
|
|
970
929
|
})[e.size]);
|
|
971
|
-
return (i, a) => (R(), x("button", { class: j(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, n.value]]) }, [e.loading ? (R(), x("div",
|
|
930
|
+
return (i, a) => (R(), x("button", { class: j(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, n.value]]) }, [e.loading ? (R(), x("div", Ae, [...a[0] || (a[0] = [w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : b("", !0), w("span", { class: j(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
|
|
972
931
|
e.icon ? (R(), x("i", {
|
|
973
932
|
key: 0,
|
|
974
933
|
class: j([e.icon, r.value])
|
|
@@ -980,7 +939,7 @@ var ke = {
|
|
|
980
939
|
}, null, 2)) : b("", !0)
|
|
981
940
|
], 2)], 2));
|
|
982
941
|
}
|
|
983
|
-
}),
|
|
942
|
+
}), Me = ["value"], Ne = /* @__PURE__ */ D({
|
|
984
943
|
__name: "BotInputEmail",
|
|
985
944
|
props: { modelValue: { default: "" } },
|
|
986
945
|
emits: ["update:modelValue"],
|
|
@@ -999,9 +958,9 @@ var ke = {
|
|
|
999
958
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
1000
959
|
style: { "font-size": "16px" },
|
|
1001
960
|
onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
|
|
1002
|
-
}, null, 40,
|
|
961
|
+
}, null, 40, Me));
|
|
1003
962
|
}
|
|
1004
|
-
}),
|
|
963
|
+
}), Pe = ["placeholder", "value"], Fe = /* @__PURE__ */ D({
|
|
1005
964
|
__name: "BotInputOneTimeCode",
|
|
1006
965
|
props: {
|
|
1007
966
|
modelValue: {},
|
|
@@ -1034,12 +993,12 @@ var ke = {
|
|
|
1034
993
|
class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
1035
994
|
style: { "font-size": "16px" },
|
|
1036
995
|
onInput
|
|
1037
|
-
}, null, 40,
|
|
996
|
+
}, null, 40, Pe));
|
|
1038
997
|
}
|
|
1039
|
-
}),
|
|
998
|
+
}), Ie = { class: "relative flex-shrink-0" }, Le = ["src", "alt"], ze = { class: "absolute top-1 right-1" }, Be = {
|
|
1040
999
|
key: 1,
|
|
1041
1000
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
1042
|
-
},
|
|
1001
|
+
}, Ve = { class: "min-w-0" }, He = /* @__PURE__ */ D({
|
|
1043
1002
|
__name: "ElModeHeader",
|
|
1044
1003
|
props: {
|
|
1045
1004
|
bot: {},
|
|
@@ -1051,19 +1010,18 @@ var ke = {
|
|
|
1051
1010
|
layout: { default: "centered" }
|
|
1052
1011
|
},
|
|
1053
1012
|
setup(e) {
|
|
1054
|
-
return (t, n) => (R(), x("div", { class: j(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [w("div",
|
|
1013
|
+
return (t, n) => (R(), x("div", { class: j(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [w("div", Ie, [w("div", { class: j(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [w("img", {
|
|
1055
1014
|
src: e.bot.avatarUrl.value,
|
|
1056
1015
|
alt: e.bot.displayName.value,
|
|
1057
1016
|
class: "w-full h-full object-cover",
|
|
1058
|
-
onError: n[0] || (n[0] = (...e) =>
|
|
1059
|
-
}, null, 40,
|
|
1017
|
+
onError: n[0] || (n[0] = (...e) => ue(handleImageError) && ue(handleImageError)(...e))
|
|
1018
|
+
}, null, 40, Le)], 2), w("div", ze, [e.isOnline ? (R(), x(m, { key: 0 }, [n[1] || (n[1] = w("div", {
|
|
1060
1019
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1061
1020
|
style: { "animation-duration": "3s" }
|
|
1062
|
-
}, null, -1)), n[2] || (n[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (R(), x("div",
|
|
1021
|
+
}, null, -1)), n[2] || (n[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (R(), x("div", Be))])]), w("div", Ve, [w("h1", { class: j(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, U(e.bot.displayName.value), 3), w("p", { class: j(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, U(e.layout === "horizontal" ? e.bot.title.value || "Assistant" : e.bot.title.value), 3)])], 2));
|
|
1063
1022
|
}
|
|
1064
1023
|
});
|
|
1065
|
-
|
|
1066
|
-
//#region bot/voice/voice-end-copy.ts
|
|
1024
|
+
// bot/voice/voice-end-copy.ts
|
|
1067
1025
|
function voiceEndNotice(e, t) {
|
|
1068
1026
|
switch (e) {
|
|
1069
1027
|
case "bot": return `${t} ended the call`;
|
|
@@ -1073,9 +1031,8 @@ function voiceEndNotice(e, t) {
|
|
|
1073
1031
|
case "unavailable": return "Call couldn’t connect";
|
|
1074
1032
|
}
|
|
1075
1033
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We = ["src", "alt"], Ge = ["aria-label"], Ke = /* @__PURE__ */ D({
|
|
1034
|
+
// bot/ui/BotAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
1035
|
+
var Ue = { class: "relative shrink-0 rounded-full" }, We = ["src", "alt"], Ge = ["src", "alt"], Ke = ["aria-label"], qe = /* @__PURE__ */ D({
|
|
1079
1036
|
__name: "BotAvatar",
|
|
1080
1037
|
props: {
|
|
1081
1038
|
bot: {},
|
|
@@ -1107,25 +1064,25 @@ var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We =
|
|
|
1107
1064
|
top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
|
|
1108
1065
|
right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
|
|
1109
1066
|
}, i = v(() => e.isLight ? "ring-white" : "ring-theme-900");
|
|
1110
|
-
return (t, a) => (R(), x("div",
|
|
1067
|
+
return (t, a) => (R(), x("div", Ue, [
|
|
1111
1068
|
w("img", {
|
|
1112
1069
|
src: e.bot.avatarUrl.value,
|
|
1113
1070
|
alt: e.bot.displayName.value,
|
|
1114
1071
|
class: j(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
|
|
1115
|
-
}, null, 10,
|
|
1072
|
+
}, null, 10, We),
|
|
1116
1073
|
e.showOwnerMark && e.bot.ownerMarkUrl.value ? (R(), x("img", {
|
|
1117
1074
|
key: 0,
|
|
1118
1075
|
src: e.bot.ownerMarkUrl.value,
|
|
1119
1076
|
alt: e.bot.owner.value?.fullName ? `Owned by ${e.bot.owner.value.fullName}` : "Owner",
|
|
1120
1077
|
class: j(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
|
|
1121
|
-
}, null, 10,
|
|
1078
|
+
}, null, 10, Ge)) : b("", !0),
|
|
1122
1079
|
n.value ? (R(), x("span", {
|
|
1123
1080
|
key: 1,
|
|
1124
1081
|
role: "status",
|
|
1125
1082
|
"aria-label": e.bot.state.value.tooltip,
|
|
1126
1083
|
class: j(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
|
|
1127
1084
|
style: r
|
|
1128
|
-
}, null, 10,
|
|
1085
|
+
}, null, 10, Ke)) : b("", !0),
|
|
1129
1086
|
n.value && e.bot.state.value.lifecycle === "running" ? (R(), x("span", {
|
|
1130
1087
|
key: 2,
|
|
1131
1088
|
"aria-hidden": "true",
|
|
@@ -1134,28 +1091,28 @@ var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We =
|
|
|
1134
1091
|
}, null, 2)) : b("", !0)
|
|
1135
1092
|
]));
|
|
1136
1093
|
}
|
|
1137
|
-
}),
|
|
1094
|
+
}), Je = {
|
|
1138
1095
|
key: 0,
|
|
1139
1096
|
class: "sr-only",
|
|
1140
1097
|
role: "status",
|
|
1141
1098
|
"aria-live": "polite"
|
|
1142
|
-
},
|
|
1099
|
+
}, Ye = ["aria-expanded", "disabled"], Xe = ["aria-expanded"], Ze = {
|
|
1143
1100
|
class: "flex w-5 shrink-0 justify-center self-stretch",
|
|
1144
1101
|
"aria-hidden": "true"
|
|
1145
|
-
},
|
|
1102
|
+
}, Qe = ["data-journal-row"], $e = {
|
|
1146
1103
|
class: "flex w-5 shrink-0 flex-col items-center self-stretch",
|
|
1147
1104
|
"aria-hidden": "true"
|
|
1148
|
-
},
|
|
1105
|
+
}, et = { class: "flex h-[17px] shrink-0 items-center" }, tt = {
|
|
1149
1106
|
key: 0,
|
|
1150
1107
|
class: "sr-only"
|
|
1151
|
-
},
|
|
1108
|
+
}, nt = /* @__PURE__ */ D({
|
|
1152
1109
|
__name: "BotToolActivityGroup",
|
|
1153
1110
|
props: {
|
|
1154
1111
|
model: {},
|
|
1155
1112
|
isLight: { type: Boolean }
|
|
1156
1113
|
},
|
|
1157
1114
|
setup(e) {
|
|
1158
|
-
let t = e, n =
|
|
1115
|
+
let t = e, n = H(!1);
|
|
1159
1116
|
function toggle() {
|
|
1160
1117
|
n.value = !n.value;
|
|
1161
1118
|
}
|
|
@@ -1228,7 +1185,7 @@ var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We =
|
|
|
1228
1185
|
};
|
|
1229
1186
|
});
|
|
1230
1187
|
return (t, d) => (R(), x("div", { class: j(["w-full py-0.5", s.value.muted]) }, [
|
|
1231
|
-
a.value ? (R(), x("span",
|
|
1188
|
+
a.value ? (R(), x("span", Je, U(a.value), 1)) : b("", !0),
|
|
1232
1189
|
r.value ? (R(), x("button", {
|
|
1233
1190
|
key: 1,
|
|
1234
1191
|
type: "button",
|
|
@@ -1244,13 +1201,13 @@ var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We =
|
|
|
1244
1201
|
class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
|
|
1245
1202
|
"aria-hidden": "true"
|
|
1246
1203
|
}, null, -1)),
|
|
1247
|
-
w("span", { class: j(["text-[12px] font-medium leading-none", s.value.muted]) },
|
|
1204
|
+
w("span", { class: j(["text-[12px] font-medium leading-none", s.value.muted]) }, U(e.model.terminal?.label), 3),
|
|
1248
1205
|
i.value ? (R(), x("i", {
|
|
1249
1206
|
key: 0,
|
|
1250
1207
|
class: j(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
|
|
1251
1208
|
"aria-hidden": "true"
|
|
1252
1209
|
}, null, 2)) : b("", !0)
|
|
1253
|
-
], 10,
|
|
1210
|
+
], 10, Ye)) : i.value ? (R(), x("button", {
|
|
1254
1211
|
key: 2,
|
|
1255
1212
|
type: "button",
|
|
1256
1213
|
"data-test": "messaging-tool-activity-summary",
|
|
@@ -1258,38 +1215,40 @@ var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We =
|
|
|
1258
1215
|
"aria-expanded": n.value,
|
|
1259
1216
|
class: j(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", s.value.ring]),
|
|
1260
1217
|
onClick: toggle
|
|
1261
|
-
}, [w("span",
|
|
1218
|
+
}, [w("span", Ze, [w("span", {
|
|
1262
1219
|
"data-journal-spine": "dashed",
|
|
1263
1220
|
class: j(["w-0 border-l border-dashed", s.value.dashed])
|
|
1264
|
-
}, null, 2)]), w("span", { class: j(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [T(
|
|
1221
|
+
}, null, 2)]), w("span", { class: j(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [T(U(i.value) + " earlier updates ", 1), w("i", {
|
|
1265
1222
|
class: j(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1266
1223
|
"aria-hidden": "true"
|
|
1267
|
-
}, null, 2)], 2)], 10,
|
|
1224
|
+
}, null, 2)], 2)], 10, Xe)) : b("", !0),
|
|
1268
1225
|
(R(!0), x(m, null, V(o.value, (e, t) => (R(), x("div", {
|
|
1269
1226
|
key: e.id,
|
|
1270
1227
|
"data-test": "messaging-tool-activity-row",
|
|
1271
1228
|
"data-journal-row": e.tone,
|
|
1272
1229
|
class: j([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
|
|
1273
|
-
}, [w("div",
|
|
1230
|
+
}, [w("div", $e, [w("span", et, [(R(), y(le(c.value[e.tone].station.tag), {
|
|
1274
1231
|
"data-journal-station": e.tone,
|
|
1275
1232
|
class: j(c.value[e.tone].station.class)
|
|
1276
1233
|
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? b("", !0) : (R(), x("span", {
|
|
1277
1234
|
key: 0,
|
|
1278
1235
|
class: j(["w-px flex-1", s.value.spine])
|
|
1279
|
-
}, null, 2))]), w("div", { class: j(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [w("span", { class: j(["relative block leading-snug", c.value[e.tone].label]) }, [T(
|
|
1236
|
+
}, null, 2))]), w("div", { class: j(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [w("span", { class: j(["relative block leading-snug", c.value[e.tone].label]) }, [T(U(e.label), 1), c.value[e.tone].statusWord ? (R(), x("span", tt, ", " + U(c.value[e.tone].statusWord), 1)) : b("", !0)], 2), e.note ? (R(), x("p", {
|
|
1280
1237
|
key: 0,
|
|
1281
1238
|
class: j(["pt-0.5 text-[12px] leading-snug", s.value.muted])
|
|
1282
|
-
},
|
|
1239
|
+
}, U(e.note), 3)) : b("", !0)], 2)], 10, Qe))), 128)),
|
|
1283
1240
|
!r.value && e.model.hint ? (R(), x("p", {
|
|
1284
1241
|
key: 3,
|
|
1285
1242
|
"data-test": "messaging-tool-activity-hint",
|
|
1286
1243
|
class: j(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
|
|
1287
|
-
},
|
|
1244
|
+
}, U(e.model.hint), 3)) : b("", !0)
|
|
1288
1245
|
], 2));
|
|
1289
1246
|
}
|
|
1290
1247
|
});
|
|
1291
|
-
|
|
1292
|
-
|
|
1248
|
+
// ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
1249
|
+
function _OverloadYield(e, t) {
|
|
1250
|
+
this.v = e, this.k = t;
|
|
1251
|
+
}
|
|
1293
1252
|
function _arrayLikeToArray(e, t) {
|
|
1294
1253
|
(t == null || t > e.length) && (t = e.length);
|
|
1295
1254
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
@@ -1303,7 +1262,10 @@ function _iterableToArrayLimit(e, t) {
|
|
|
1303
1262
|
if (n != null) {
|
|
1304
1263
|
var r, i, a, o, s = [], c = !0, d = !1;
|
|
1305
1264
|
try {
|
|
1306
|
-
if (a = (n = n.call(e)).next, t
|
|
1265
|
+
if (a = (n = n.call(e)).next, t === 0) {
|
|
1266
|
+
if (Object(n) !== n) return;
|
|
1267
|
+
c = !1;
|
|
1268
|
+
} else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
|
|
1307
1269
|
} catch (e) {
|
|
1308
1270
|
d = !0, i = e;
|
|
1309
1271
|
} finally {
|
|
@@ -1329,100 +1291,157 @@ function _unsupportedIterableToArray(e, t) {
|
|
|
1329
1291
|
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
|
|
1330
1292
|
}
|
|
1331
1293
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1294
|
+
function AsyncGenerator(e) {
|
|
1295
|
+
var t, n;
|
|
1296
|
+
function resume(t, n) {
|
|
1297
|
+
try {
|
|
1298
|
+
var r = e[t](n), i = r.value, a = i instanceof _OverloadYield;
|
|
1299
|
+
Promise.resolve(a ? i.v : i).then(function(n) {
|
|
1300
|
+
if (a) {
|
|
1301
|
+
var o = t === "return" && i.k ? t : "next";
|
|
1302
|
+
if (!i.k || n.done) return resume(o, n);
|
|
1303
|
+
n = e[o](n).value;
|
|
1304
|
+
}
|
|
1305
|
+
settle(!!r.done, n);
|
|
1306
|
+
}, function(e) {
|
|
1307
|
+
resume("throw", e);
|
|
1308
|
+
});
|
|
1309
|
+
} catch (e) {
|
|
1310
|
+
settle(2, e);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
function settle(e, r) {
|
|
1314
|
+
e === 2 ? t.reject(r) : t.resolve({
|
|
1315
|
+
value: r,
|
|
1316
|
+
done: e
|
|
1317
|
+
}), (t = t.next) ? resume(t.key, t.arg) : n = null;
|
|
1318
|
+
}
|
|
1319
|
+
this._invoke = function(e, r) {
|
|
1320
|
+
return new Promise(function(i, a) {
|
|
1321
|
+
var o = {
|
|
1322
|
+
key: e,
|
|
1323
|
+
arg: r,
|
|
1324
|
+
resolve: i,
|
|
1325
|
+
reject: a,
|
|
1326
|
+
next: null
|
|
1327
|
+
};
|
|
1328
|
+
n ? n = n.next = o : (t = n = o, resume(e, r));
|
|
1329
|
+
});
|
|
1330
|
+
}, typeof e.return != "function" && (this.return = void 0);
|
|
1331
|
+
}
|
|
1332
|
+
AsyncGenerator.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
1333
|
+
return this;
|
|
1334
|
+
}, AsyncGenerator.prototype.next = function(e) {
|
|
1335
|
+
return this._invoke("next", e);
|
|
1336
|
+
}, AsyncGenerator.prototype.throw = function(e) {
|
|
1337
|
+
return this._invoke("throw", e);
|
|
1338
|
+
}, AsyncGenerator.prototype.return = function(e) {
|
|
1339
|
+
return this._invoke("return", e);
|
|
1340
|
+
};
|
|
1341
|
+
var rt = Object.entries, it = Object.setPrototypeOf, at = Object.isFrozen, ot = Object.getPrototypeOf, st = Object.getOwnPropertyDescriptor, Y = Object.freeze, X = Object.seal, ct = Object.create, lt = typeof Reflect < "u" && Reflect, ut = lt.apply, dt = lt.construct;
|
|
1342
|
+
Y || (Y = function freeze(e) {
|
|
1334
1343
|
return e;
|
|
1335
|
-
}),
|
|
1344
|
+
}), X || (X = function seal(e) {
|
|
1336
1345
|
return e;
|
|
1337
|
-
}),
|
|
1346
|
+
}), ut || (ut = function apply(e, t) {
|
|
1338
1347
|
var n = [...arguments].slice(2);
|
|
1339
1348
|
return e.apply(t, n);
|
|
1340
|
-
}),
|
|
1349
|
+
}), dt || (dt = function construct(e) {
|
|
1341
1350
|
return new e(...[...arguments].slice(1));
|
|
1342
1351
|
});
|
|
1343
|
-
var
|
|
1352
|
+
var ft = unapply(Array.prototype.forEach);
|
|
1353
|
+
Array.prototype.indexOf;
|
|
1354
|
+
var Z = unapply(Array.prototype.lastIndexOf), pt = unapply(Array.prototype.pop), mt = unapply(Array.prototype.push), ht = unapply(Array.prototype.slice), gt = unapply(Array.prototype.splice), _t = Array.isArray, vt = unconstruct(Set), bt = unapply(Set.prototype.add), xt = unapply(Set.prototype.has), St = unapply(String.prototype.toLowerCase), Ct = unapply(String.prototype.toString), wt = unapply(String.prototype.match), Tt = unapply(String.prototype.replace), Et = unapply(String.prototype.indexOf), Dt = unapply(String.prototype.trim), Ot = unapply(Number.prototype.toString), kt = unapply(Boolean.prototype.toString), At = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), jt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), Mt = unapply(Object.prototype.hasOwnProperty), Nt = unapply(Object.prototype.toString), Ft = unapply(RegExp.prototype.test), It = unconstruct(TypeError);
|
|
1344
1355
|
function unapply(e) {
|
|
1345
1356
|
return function(t) {
|
|
1346
1357
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1347
1358
|
var n = [...arguments].slice(1);
|
|
1348
|
-
return
|
|
1359
|
+
return ut(e, t, n);
|
|
1349
1360
|
};
|
|
1350
1361
|
}
|
|
1351
1362
|
function unconstruct(e) {
|
|
1352
1363
|
return function() {
|
|
1353
|
-
return
|
|
1364
|
+
return dt(e, [...arguments]);
|
|
1354
1365
|
};
|
|
1355
1366
|
}
|
|
1356
1367
|
function addToSet(e, t) {
|
|
1357
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1358
|
-
if (
|
|
1368
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : St;
|
|
1369
|
+
if (it && it(e, null), !_t(t)) return e;
|
|
1359
1370
|
let r = t.length;
|
|
1360
1371
|
for (; r--;) {
|
|
1361
1372
|
let i = t[r];
|
|
1362
1373
|
if (typeof i == "string") {
|
|
1363
1374
|
let e = n(i);
|
|
1364
|
-
e !== i && (
|
|
1375
|
+
e !== i && (at(t) || (t[r] = e), i = e);
|
|
1365
1376
|
}
|
|
1366
1377
|
e[i] = !0;
|
|
1367
1378
|
}
|
|
1368
1379
|
return e;
|
|
1369
1380
|
}
|
|
1370
1381
|
function cleanArray(e) {
|
|
1371
|
-
for (let t = 0; t < e.length; t++)
|
|
1382
|
+
for (let t = 0; t < e.length; t++) Mt(e, t) || (e[t] = null);
|
|
1372
1383
|
return e;
|
|
1373
1384
|
}
|
|
1374
1385
|
function clone(e) {
|
|
1375
|
-
let t =
|
|
1376
|
-
for (let r of
|
|
1386
|
+
let t = ct(null);
|
|
1387
|
+
for (let r of rt(e)) {
|
|
1377
1388
|
var n = _slicedToArray(r, 2);
|
|
1378
1389
|
let i = n[0], a = n[1];
|
|
1379
|
-
|
|
1390
|
+
Mt(e, i) && (t[i] = _t(a) ? cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? clone(a) : a);
|
|
1380
1391
|
}
|
|
1381
1392
|
return t;
|
|
1382
1393
|
}
|
|
1383
1394
|
function stringifyValue(e) {
|
|
1384
1395
|
switch (typeof e) {
|
|
1385
1396
|
case "string": return e;
|
|
1386
|
-
case "number": return
|
|
1387
|
-
case "boolean": return
|
|
1388
|
-
case "bigint": return
|
|
1389
|
-
case "symbol": return
|
|
1390
|
-
case "undefined": return
|
|
1397
|
+
case "number": return Ot(e);
|
|
1398
|
+
case "boolean": return kt(e);
|
|
1399
|
+
case "bigint": return At ? At(e) : "0";
|
|
1400
|
+
case "symbol": return jt ? jt(e) : "Symbol()";
|
|
1401
|
+
case "undefined": return Nt(e);
|
|
1391
1402
|
case "function":
|
|
1392
1403
|
case "object": {
|
|
1393
|
-
if (e === null) return
|
|
1404
|
+
if (e === null) return Nt(e);
|
|
1394
1405
|
let t = e, n = lookupGetter(t, "toString");
|
|
1395
1406
|
if (typeof n == "function") {
|
|
1396
1407
|
let e = n(t);
|
|
1397
|
-
return typeof e == "string" ? e :
|
|
1408
|
+
return typeof e == "string" ? e : Nt(e);
|
|
1398
1409
|
}
|
|
1399
|
-
return
|
|
1410
|
+
return Nt(e);
|
|
1400
1411
|
}
|
|
1401
|
-
default: return
|
|
1412
|
+
default: return Nt(e);
|
|
1402
1413
|
}
|
|
1403
1414
|
}
|
|
1404
1415
|
function lookupGetter(e, t) {
|
|
1405
1416
|
for (; e !== null;) {
|
|
1406
|
-
let n =
|
|
1417
|
+
let n = st(e, t);
|
|
1407
1418
|
if (n) {
|
|
1408
1419
|
if (n.get) return unapply(n.get);
|
|
1409
1420
|
if (typeof n.value == "function") return unapply(n.value);
|
|
1410
1421
|
}
|
|
1411
|
-
e =
|
|
1422
|
+
e = ot(e);
|
|
1412
1423
|
}
|
|
1413
1424
|
function fallbackValue() {
|
|
1414
1425
|
return null;
|
|
1415
1426
|
}
|
|
1416
1427
|
return fallbackValue;
|
|
1417
1428
|
}
|
|
1429
|
+
function lookupAccessor(e, t) {
|
|
1430
|
+
for (; e !== null;) {
|
|
1431
|
+
let n = st(e, t);
|
|
1432
|
+
if (n) return n.get ? unapply(n.get) : null;
|
|
1433
|
+
e = ot(e);
|
|
1434
|
+
}
|
|
1435
|
+
return null;
|
|
1436
|
+
}
|
|
1418
1437
|
function isRegex(e) {
|
|
1419
1438
|
try {
|
|
1420
|
-
return
|
|
1439
|
+
return Ft(e, ""), !0;
|
|
1421
1440
|
} catch {
|
|
1422
1441
|
return !1;
|
|
1423
1442
|
}
|
|
1424
1443
|
}
|
|
1425
|
-
var
|
|
1444
|
+
var Lt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Rt = Y(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), zt = Y([
|
|
1426
1445
|
"feBlend",
|
|
1427
1446
|
"feColorMatrix",
|
|
1428
1447
|
"feComponentTransfer",
|
|
@@ -1448,7 +1467,7 @@ var At = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1448
1467
|
"feSpotLight",
|
|
1449
1468
|
"feTile",
|
|
1450
1469
|
"feTurbulence"
|
|
1451
|
-
]),
|
|
1470
|
+
]), Bt = Y([
|
|
1452
1471
|
"animate",
|
|
1453
1472
|
"color-profile",
|
|
1454
1473
|
"cursor",
|
|
@@ -1471,7 +1490,7 @@ var At = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1471
1490
|
"solidcolor",
|
|
1472
1491
|
"unknown",
|
|
1473
1492
|
"use"
|
|
1474
|
-
]),
|
|
1493
|
+
]), Vt = Y(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Ht = Y([
|
|
1475
1494
|
"maction",
|
|
1476
1495
|
"maligngroup",
|
|
1477
1496
|
"malignmark",
|
|
@@ -1487,13 +1506,13 @@ var At = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1487
1506
|
"annotation-xml",
|
|
1488
1507
|
"mprescripts",
|
|
1489
1508
|
"none"
|
|
1490
|
-
]),
|
|
1509
|
+
]), Ut = Y(["#text"]), Wt = Y(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Gt = Y(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Kt = Y(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), qt = Y([
|
|
1491
1510
|
"xlink:href",
|
|
1492
1511
|
"xml:id",
|
|
1493
1512
|
"xlink:title",
|
|
1494
1513
|
"xml:space",
|
|
1495
1514
|
"xmlns:xlink"
|
|
1496
|
-
]),
|
|
1515
|
+
]), Jt = X(/{{[\w\W]*|^[\w\W]*}}/g), Yt = X(/<%[\w\W]*|^[\w\W]*%>/g), Xt = X(/\${[\w\W]*/g), Zt = X(/^data-[\-\w.\u00B7-\uFFFF]+$/), Qt = X(/^aria-[\-\w]+$/), $t = X(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), en = X(/^(?:\w+script|data):/i), tn = X(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), nn = X(/^html$/i), rn = X(/^[a-z][.\w]*(-[.\w]+)+$/i), an = X(/<[/\w!]/g), on = X(/<[/\w]/g), sn = X(/<\/no(script|embed|frames)/i), cn = X(/\/>/i), ln = {
|
|
1497
1516
|
element: 1,
|
|
1498
1517
|
attribute: 2,
|
|
1499
1518
|
text: 3,
|
|
@@ -1506,9 +1525,18 @@ var At = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1506
1525
|
documentType: 10,
|
|
1507
1526
|
documentFragment: 11,
|
|
1508
1527
|
notation: 12
|
|
1509
|
-
},
|
|
1528
|
+
}, un = Y(addToSet({}, [
|
|
1529
|
+
"style",
|
|
1530
|
+
"script",
|
|
1531
|
+
"xmp",
|
|
1532
|
+
"iframe",
|
|
1533
|
+
"noembed",
|
|
1534
|
+
"noframes",
|
|
1535
|
+
"plaintext",
|
|
1536
|
+
"noscript"
|
|
1537
|
+
])), dn = function getGlobal() {
|
|
1510
1538
|
return typeof window > "u" ? null : window;
|
|
1511
|
-
},
|
|
1539
|
+
}, fn = function _createTrustedTypesPolicy(e, t) {
|
|
1512
1540
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
1513
1541
|
let n = null, r = "data-tt-policy-suffix";
|
|
1514
1542
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -1525,7 +1553,7 @@ var At = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1525
1553
|
} catch {
|
|
1526
1554
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
1527
1555
|
}
|
|
1528
|
-
},
|
|
1556
|
+
}, pn = function _createHooksMap() {
|
|
1529
1557
|
return {
|
|
1530
1558
|
afterSanitizeAttributes: [],
|
|
1531
1559
|
afterSanitizeElements: [],
|
|
@@ -1537,53 +1565,62 @@ var At = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1537
1565
|
uponSanitizeElement: [],
|
|
1538
1566
|
uponSanitizeShadowNode: []
|
|
1539
1567
|
};
|
|
1540
|
-
},
|
|
1541
|
-
return
|
|
1568
|
+
}, mn = function _resolveSetOption(e, t, n, r) {
|
|
1569
|
+
return Mt(e, t) && _t(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1570
|
+
}, hn = function _resolveObjectOption(e, t, n) {
|
|
1571
|
+
let r = Mt(e, t) ? e[t] : void 0;
|
|
1572
|
+
return r && typeof r == "object" ? clone(r) : n();
|
|
1542
1573
|
};
|
|
1543
1574
|
function createDOMPurify() {
|
|
1544
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1545
|
-
if (DOMPurify.version = "3.4.
|
|
1575
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : dn(), DOMPurify = (e) => createDOMPurify(e);
|
|
1576
|
+
if (DOMPurify.version = "3.4.17", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== ln.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
|
|
1546
1577
|
let t = e.document, n = t, r = n.currentScript;
|
|
1547
1578
|
e.DocumentFragment;
|
|
1548
1579
|
let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
|
|
1549
1580
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
1550
|
-
let c = e.DOMParser, d = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), g = lookupGetter(f, "
|
|
1581
|
+
let c = e.DOMParser, d = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), g = lookupGetter(f, "removeAttributeNode"), _ = lookupGetter(f, "nextSibling"), v = lookupGetter(f, "childNodes"), y = lookupGetter(f, "parentNode"), b = lookupGetter(f, "shadowRoot"), x = lookupGetter(f, "attributes"), w = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, T = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null, E = a && a.prototype ? lookupGetter(a.prototype, "ownerDocument") : null, D = function _readNodeType(e) {
|
|
1582
|
+
return w ? w(e) : e.nodeType;
|
|
1583
|
+
}, A = function _readNodeName(e) {
|
|
1584
|
+
return T ? T(e) : e.nodeName;
|
|
1585
|
+
}, ee = lookupAccessor(f, "namespaceURI"), j = function _readNamespaceURI(e) {
|
|
1586
|
+
return ee ? ee(e) : e.namespaceURI;
|
|
1587
|
+
};
|
|
1551
1588
|
if (typeof i == "function") {
|
|
1552
1589
|
let e = t.createElement("template");
|
|
1553
1590
|
e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
|
|
1554
1591
|
}
|
|
1555
|
-
let
|
|
1556
|
-
if (
|
|
1557
|
-
},
|
|
1558
|
-
|
|
1592
|
+
let M, N = "", te, ne = !1, ae = 0, R = function _assertNotInTrustedTypesPolicy() {
|
|
1593
|
+
if (ae > 0) throw It("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
1594
|
+
}, B = function _createTrustedHTML(e) {
|
|
1595
|
+
R(), ae++;
|
|
1559
1596
|
try {
|
|
1560
|
-
return
|
|
1597
|
+
return M.createHTML(e);
|
|
1561
1598
|
} finally {
|
|
1562
|
-
|
|
1599
|
+
ae--;
|
|
1563
1600
|
}
|
|
1564
|
-
},
|
|
1565
|
-
|
|
1601
|
+
}, V = function _createTrustedScriptURL(e) {
|
|
1602
|
+
R(), ae++;
|
|
1566
1603
|
try {
|
|
1567
|
-
return
|
|
1604
|
+
return M.createScriptURL(e);
|
|
1568
1605
|
} finally {
|
|
1569
|
-
|
|
1570
|
-
}
|
|
1571
|
-
},
|
|
1572
|
-
return
|
|
1573
|
-
},
|
|
1574
|
-
DOMPurify.isSupported = typeof
|
|
1575
|
-
let
|
|
1576
|
-
...
|
|
1577
|
-
...jt,
|
|
1578
|
-
...Mt,
|
|
1579
|
-
...Ft,
|
|
1580
|
-
...Lt
|
|
1581
|
-
]), J = null, ve = addToSet({}, [
|
|
1606
|
+
ae--;
|
|
1607
|
+
}
|
|
1608
|
+
}, ce = function _getDefaultTrustedTypesPolicy() {
|
|
1609
|
+
return ne || (te = fn(d, r), ne = !0), te;
|
|
1610
|
+
}, le = t, H = le.implementation, U = le.createNodeIterator, ue = le.createDocumentFragment, fe = le.getElementsByTagName, pe = n.importNode, G = pn();
|
|
1611
|
+
DOMPurify.isSupported = typeof rt == "function" && typeof y == "function" && H && H.createHTMLDocument !== void 0;
|
|
1612
|
+
let me = Jt, he = Yt, ge = Xt, _e = Zt, ve = Qt, ye = en, xe = tn, Se = rn, Ce = $t, K = null, Ee = addToSet({}, [
|
|
1613
|
+
...Lt,
|
|
1582
1614
|
...Rt,
|
|
1583
1615
|
...zt,
|
|
1584
|
-
...
|
|
1585
|
-
...
|
|
1586
|
-
]),
|
|
1616
|
+
...Vt,
|
|
1617
|
+
...Ut
|
|
1618
|
+
]), J = null, De = addToSet({}, [
|
|
1619
|
+
...Wt,
|
|
1620
|
+
...Gt,
|
|
1621
|
+
...Kt,
|
|
1622
|
+
...qt
|
|
1623
|
+
]), ke = Object.seal(ct(null, {
|
|
1587
1624
|
tagNameCheck: {
|
|
1588
1625
|
writable: !0,
|
|
1589
1626
|
configurable: !1,
|
|
@@ -1602,7 +1639,7 @@ function createDOMPurify() {
|
|
|
1602
1639
|
enumerable: !0,
|
|
1603
1640
|
value: !1
|
|
1604
1641
|
}
|
|
1605
|
-
})),
|
|
1642
|
+
})), Ae = null, je = null, Me = Object.seal(ct(null, {
|
|
1606
1643
|
tagCheck: {
|
|
1607
1644
|
writable: !0,
|
|
1608
1645
|
configurable: !1,
|
|
@@ -1615,14 +1652,14 @@ function createDOMPurify() {
|
|
|
1615
1652
|
enumerable: !0,
|
|
1616
1653
|
value: null
|
|
1617
1654
|
}
|
|
1618
|
-
})),
|
|
1655
|
+
})), Ne = !0, Pe = !0, Fe = !1, Ie = !0, Le = !1, ze = !0, Be = !1, Ve = !1, He = null, Ue = null, We = !1, Ge = !1, Ke = !1, qe = !1, Je = !0, Ye = !1, Xe = "user-content-", Ze = !0, Qe = !1, $e = null, et = {}, tt = null, nt = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), it = null, at = addToSet({}, [
|
|
1619
1656
|
"audio",
|
|
1620
1657
|
"video",
|
|
1621
1658
|
"img",
|
|
1622
1659
|
"source",
|
|
1623
1660
|
"image",
|
|
1624
1661
|
"track"
|
|
1625
|
-
]),
|
|
1662
|
+
]), ot = null, st = addToSet({}, [
|
|
1626
1663
|
"alt",
|
|
1627
1664
|
"class",
|
|
1628
1665
|
"for",
|
|
@@ -1637,251 +1674,297 @@ function createDOMPurify() {
|
|
|
1637
1674
|
"value",
|
|
1638
1675
|
"style",
|
|
1639
1676
|
"xmlns"
|
|
1640
|
-
]),
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
],
|
|
1677
|
+
]), lt = "http://www.w3.org/1998/Math/MathML", ut = "http://www.w3.org/2000/svg", dt = "http://www.w3.org/1999/xhtml", Ot = dt, kt = !1, At = null, jt = addToSet({}, [
|
|
1678
|
+
lt,
|
|
1679
|
+
ut,
|
|
1680
|
+
dt
|
|
1681
|
+
], Ct), Nt = Y([
|
|
1645
1682
|
"mi",
|
|
1646
1683
|
"mo",
|
|
1647
1684
|
"mn",
|
|
1648
1685
|
"ms",
|
|
1649
1686
|
"mtext"
|
|
1650
|
-
]),
|
|
1687
|
+
]), gn = addToSet({}, Nt), _n = Y(["annotation-xml"]), vn = addToSet({}, _n), yn = addToSet({}, [
|
|
1651
1688
|
"title",
|
|
1652
1689
|
"style",
|
|
1653
1690
|
"font",
|
|
1654
1691
|
"a",
|
|
1655
1692
|
"script"
|
|
1656
|
-
]),
|
|
1693
|
+
]), Q = null, bn = ["application/xhtml+xml", "text/html"], $ = null, xn = null, Sn = t.createElement("form"), Cn = function isRegexOrFunction(e) {
|
|
1657
1694
|
return e instanceof RegExp || e instanceof Function;
|
|
1658
|
-
},
|
|
1695
|
+
}, wn = function _parseConfig() {
|
|
1659
1696
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1660
|
-
if (
|
|
1661
|
-
|
|
1697
|
+
if (xn && xn === e) return;
|
|
1698
|
+
e && typeof e == "object" || (e = {}), e = clone(e), Q = bn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, $ = Q === "application/xhtml+xml" ? Ct : St, K = mn(e, "ALLOWED_TAGS", Ee, { transform: $ }), J = mn(e, "ALLOWED_ATTR", De, { transform: $ }), At = mn(e, "ALLOWED_NAMESPACES", jt, { transform: Ct }), ot = mn(e, "ADD_URI_SAFE_ATTR", st, {
|
|
1662
1699
|
transform: $,
|
|
1663
|
-
base:
|
|
1664
|
-
}),
|
|
1700
|
+
base: st
|
|
1701
|
+
}), it = mn(e, "ADD_DATA_URI_TAGS", at, {
|
|
1665
1702
|
transform: $,
|
|
1666
|
-
base:
|
|
1667
|
-
}),
|
|
1668
|
-
let t =
|
|
1669
|
-
if (
|
|
1703
|
+
base: at
|
|
1704
|
+
}), tt = mn(e, "FORBID_CONTENTS", nt, { transform: $ }), Ae = mn(e, "FORBID_TAGS", clone({}), { transform: $ }), je = mn(e, "FORBID_ATTR", clone({}), { transform: $ }), et = Mt(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ie = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Le = e.SAFE_FOR_TEMPLATES || !1, ze = e.SAFE_FOR_XML !== !1, Be = e.WHOLE_DOCUMENT || !1, Ge = e.RETURN_DOM || !1, Ke = e.RETURN_DOM_FRAGMENT || !1, qe = e.RETURN_TRUSTED_TYPE || !1, We = e.FORCE_BODY || !1, Je = e.SANITIZE_DOM !== !1, Ye = e.SANITIZE_NAMED_PROPS || !1, Ze = e.KEEP_CONTENT !== !1, Qe = e.IN_PLACE || !1, Ce = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : $t, Ot = typeof e.NAMESPACE == "string" ? e.NAMESPACE : dt, gn = hn(e, "MATHML_TEXT_INTEGRATION_POINTS", () => addToSet({}, Nt)), vn = hn(e, "HTML_INTEGRATION_POINTS", () => addToSet({}, _n));
|
|
1705
|
+
let t = hn(e, "CUSTOM_ELEMENT_HANDLING", () => ct(null));
|
|
1706
|
+
if (ke = ct(null), Mt(t, "tagNameCheck") && Cn(t.tagNameCheck) && (ke.tagNameCheck = t.tagNameCheck), Mt(t, "attributeNameCheck") && Cn(t.attributeNameCheck) && (ke.attributeNameCheck = t.attributeNameCheck), Mt(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (ke.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), X(ke), Le && (Pe = !1), Ke && (Ge = !0), et && (K = addToSet({}, Ut), J = ct(null), et.html === !0 && (addToSet(K, Lt), addToSet(J, Wt)), et.svg === !0 && (addToSet(K, Rt), addToSet(J, Gt), addToSet(J, qt)), et.svgFilters === !0 && (addToSet(K, zt), addToSet(J, Gt), addToSet(J, qt)), et.mathMl === !0 && (addToSet(K, Vt), addToSet(J, Kt), addToSet(J, qt))), Me.tagCheck = null, Me.attributeCheck = null, Mt(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Me.tagCheck = e.ADD_TAGS : _t(e.ADD_TAGS) && (K === Ee && (K = clone(K)), addToSet(K, e.ADD_TAGS, $))), Mt(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Me.attributeCheck = e.ADD_ATTR : _t(e.ADD_ATTR) && (J === De && (J = clone(J)), addToSet(J, e.ADD_ATTR, $))), Mt(e, "ADD_FORBID_CONTENTS") && _t(e.ADD_FORBID_CONTENTS) && (tt === nt && (tt = clone(tt)), addToSet(tt, e.ADD_FORBID_CONTENTS, $)), Ze && (K["#text"] = !0), Be && addToSet(K, [
|
|
1670
1707
|
"html",
|
|
1671
1708
|
"head",
|
|
1672
1709
|
"body"
|
|
1673
|
-
]), K.table && (addToSet(K, ["tbody"]), delete
|
|
1674
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
1675
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
1676
|
-
let t =
|
|
1677
|
-
|
|
1710
|
+
]), K.table && (addToSet(K, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1711
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw It("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1712
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw It("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1713
|
+
let t = M;
|
|
1714
|
+
M = e.TRUSTED_TYPES_POLICY;
|
|
1678
1715
|
try {
|
|
1679
|
-
|
|
1716
|
+
N = B("");
|
|
1680
1717
|
} catch (e) {
|
|
1681
|
-
throw
|
|
1718
|
+
throw M = t, e;
|
|
1682
1719
|
}
|
|
1683
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
1684
|
-
|
|
1685
|
-
},
|
|
1686
|
-
...
|
|
1687
|
-
...
|
|
1688
|
-
...
|
|
1689
|
-
]),
|
|
1690
|
-
return t.namespaceURI ===
|
|
1691
|
-
},
|
|
1692
|
-
return t.namespaceURI ===
|
|
1693
|
-
},
|
|
1694
|
-
return t.namespaceURI ===
|
|
1695
|
-
},
|
|
1696
|
-
let t =
|
|
1697
|
-
(
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
});
|
|
1701
|
-
let n = gt(e.tagName), r = gt(t.tagName);
|
|
1702
|
-
return at[e.namespaceURI] ? e.namespaceURI === et ? mn(n, t, r) : e.namespaceURI === $e ? hn(n, t, r) : e.namespaceURI === tt ? gn(n, t, r) : !!(Tt === "application/xhtml+xml" && at[e.namespaceURI]) : !1;
|
|
1703
|
-
}, vn = function _forceRemove(e) {
|
|
1704
|
-
pt(DOMPurify.removed, { element: e });
|
|
1720
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (M = void 0, N = "") : (M === void 0 && (M = ce()), M && typeof N == "string" && (N = B("")));
|
|
1721
|
+
Y && Y(e), xn = e;
|
|
1722
|
+
}, Tn = addToSet({}, [
|
|
1723
|
+
...Rt,
|
|
1724
|
+
...zt,
|
|
1725
|
+
...Bt
|
|
1726
|
+
]), En = addToSet({}, [...Vt, ...Ht]), Dn = function _checkSvgNamespace(e, t, n) {
|
|
1727
|
+
return t.namespaceURI === dt ? e === "svg" : t.namespaceURI === lt ? e === "svg" && (n === "annotation-xml" || gn[n]) : !!Tn[e];
|
|
1728
|
+
}, On = function _checkMathMlNamespace(e, t, n) {
|
|
1729
|
+
return t.namespaceURI === dt ? e === "math" : t.namespaceURI === ut ? e === "math" && vn[n] : !!En[e];
|
|
1730
|
+
}, kn = function _checkHtmlNamespace(e, t, n) {
|
|
1731
|
+
return t.namespaceURI === ut && !vn[n] || t.namespaceURI === lt && !gn[n] ? !1 : !En[e] && (yn[e] || !Tn[e]);
|
|
1732
|
+
}, An = function _checkValidNamespace(e) {
|
|
1733
|
+
let t = j(e), n = St(A(e)), r = y(e), i, a;
|
|
1734
|
+
return r && D(r) === ln.element ? (i = { namespaceURI: j(r) }, a = St(A(r))) : (i = { namespaceURI: Ot }, a = "template"), At[t] ? t === ut ? Dn(n, i, a) : t === lt ? On(n, i, a) : t === dt ? kn(n, i, a) : !!(Q === "application/xhtml+xml" && At[t]) : !1;
|
|
1735
|
+
}, jn = function _forceRemove(e) {
|
|
1736
|
+
mt(DOMPurify.removed, { element: e });
|
|
1705
1737
|
try {
|
|
1706
|
-
|
|
1738
|
+
y(e).removeChild(e);
|
|
1707
1739
|
} catch {
|
|
1708
|
-
if (m(e), !
|
|
1740
|
+
if (m(e), !y(e)) throw It("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
1709
1741
|
}
|
|
1710
|
-
},
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
}), dt(e, (e) => {
|
|
1718
|
-
try {
|
|
1719
|
-
m(e);
|
|
1720
|
-
} catch {}
|
|
1721
|
-
});
|
|
1742
|
+
}, Mn = function _stripAttributeNode(e, t, n) {
|
|
1743
|
+
try {
|
|
1744
|
+
g(e, t);
|
|
1745
|
+
} catch {
|
|
1746
|
+
try {
|
|
1747
|
+
e.removeAttribute(n);
|
|
1748
|
+
} catch {}
|
|
1722
1749
|
}
|
|
1723
|
-
|
|
1750
|
+
}, Nn = function _neutralizeRoot(e) {
|
|
1751
|
+
Ln(e);
|
|
1752
|
+
let t = v(e);
|
|
1753
|
+
t && ft(ht(t), (e) => {
|
|
1754
|
+
try {
|
|
1755
|
+
m(e);
|
|
1756
|
+
} catch {}
|
|
1757
|
+
});
|
|
1758
|
+
let n = D(e) === ln.element ? x(e) : null;
|
|
1724
1759
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
1725
1760
|
let r = n[t], i = r && r.name;
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1761
|
+
typeof i == "string" && Mn(e, r, i);
|
|
1762
|
+
}
|
|
1763
|
+
}, Pn = function _removeAttribute(e, t, n) {
|
|
1764
|
+
if (!n) try {
|
|
1765
|
+
n = t.getAttributeNode(e);
|
|
1766
|
+
} catch {
|
|
1767
|
+
n = null;
|
|
1729
1768
|
}
|
|
1730
|
-
|
|
1769
|
+
mt(DOMPurify.removed, {
|
|
1770
|
+
attribute: n || null,
|
|
1771
|
+
from: t
|
|
1772
|
+
});
|
|
1731
1773
|
try {
|
|
1732
|
-
|
|
1733
|
-
attribute: t.getAttributeNode(e),
|
|
1734
|
-
from: t
|
|
1735
|
-
});
|
|
1774
|
+
n ? g(t, n) : t.removeAttribute(e);
|
|
1736
1775
|
} catch {
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
});
|
|
1776
|
+
try {
|
|
1777
|
+
t.removeAttribute(e);
|
|
1778
|
+
} catch {}
|
|
1741
1779
|
}
|
|
1742
|
-
if (
|
|
1743
|
-
if (
|
|
1744
|
-
|
|
1780
|
+
if (e === "is") {
|
|
1781
|
+
if (Ge || Ke) try {
|
|
1782
|
+
jn(t);
|
|
1745
1783
|
} catch {}
|
|
1746
1784
|
else try {
|
|
1747
1785
|
t.setAttribute(e, "");
|
|
1748
1786
|
} catch {}
|
|
1749
1787
|
}
|
|
1750
|
-
},
|
|
1751
|
-
let t =
|
|
1788
|
+
}, Fn = function _stripDisallowedAttributes(e) {
|
|
1789
|
+
let t = x(e);
|
|
1752
1790
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
1753
1791
|
let r = t[n], i = r && r.name;
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1792
|
+
typeof i != "string" || J[$(i)] || Mn(e, r, i);
|
|
1793
|
+
}
|
|
1794
|
+
}, In = function _walkTree(e, t) {
|
|
1795
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
1796
|
+
for (; r.length > 0;) {
|
|
1797
|
+
let e = r.pop();
|
|
1798
|
+
if (t(e) === !1) continue;
|
|
1799
|
+
if (n && D(e) === ln.element) {
|
|
1800
|
+
let t = b(e);
|
|
1801
|
+
Qn(t) && r.push(t);
|
|
1802
|
+
}
|
|
1803
|
+
let i = v(e);
|
|
1804
|
+
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
1757
1805
|
}
|
|
1758
|
-
},
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1806
|
+
}, Ln = function _neutralizeSubtree(e) {
|
|
1807
|
+
In(e, (e) => {
|
|
1808
|
+
D(e) === ln.element && Fn(e);
|
|
1809
|
+
});
|
|
1810
|
+
}, Rn = function _collectLiveNodes(e) {
|
|
1811
|
+
let t = [];
|
|
1812
|
+
return In(e, (e) => {
|
|
1813
|
+
t.push(e);
|
|
1814
|
+
}, !0), t;
|
|
1815
|
+
}, zn = function _neutralizeEscapedElements(e, t) {
|
|
1816
|
+
let n = vt();
|
|
1817
|
+
ft(Rn(e), (e) => {
|
|
1818
|
+
D(e) === ln.element && bt(n, e);
|
|
1819
|
+
}), ft(t, (e) => {
|
|
1820
|
+
D(e) === ln.element && !xt(n, e) && Fn(e);
|
|
1821
|
+
});
|
|
1822
|
+
}, Bn = function _neutralizeDiscarded(e, t) {
|
|
1823
|
+
let n = !1;
|
|
1824
|
+
return ft(DOMPurify.removed, (t) => {
|
|
1825
|
+
t.element && (n = n || t.element === e, Ln(t.element));
|
|
1826
|
+
}), zn(e, t), n;
|
|
1827
|
+
}, Vn = function _sanitizeUnvisitedNodes(e, t) {
|
|
1828
|
+
let n = $e, r = null, getOriginal = () => (r || (r = vt(), ft(t, (e) => {
|
|
1829
|
+
bt(r, e);
|
|
1830
|
+
})), r);
|
|
1831
|
+
for (let t = 0;; t++) {
|
|
1832
|
+
let r = Rn(e), i = [e], a = !1;
|
|
1833
|
+
if (ft(r, (e) => {
|
|
1834
|
+
D(e) === ln.documentFragment ? mt(i, e) : !a && !xt(n, e) && (a = xt(getOriginal(), e));
|
|
1835
|
+
}), !a) return;
|
|
1836
|
+
if (t >= 8) throw It("the tree kept changing during in-place sanitization; refusing to return it");
|
|
1837
|
+
ft(i, (t, n) => {
|
|
1838
|
+
Hn(t, n > 0, e, getOriginal());
|
|
1839
|
+
});
|
|
1765
1840
|
}
|
|
1766
|
-
},
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1841
|
+
}, Hn = function _sanitizeUnvisitedIn(e, t, n, r) {
|
|
1842
|
+
let i = qn(e), a;
|
|
1843
|
+
for (; a = i.nextNode();) xt(r, a) && !xt($e, a) && (t && _executeHooks(G.uponSanitizeShadowNode, a, null), ar(a, n), fr(a, n), Qn(a.content) && pr(a.content));
|
|
1844
|
+
}, Un = function _markVisited(e) {
|
|
1845
|
+
$e && bt($e, e);
|
|
1846
|
+
}, Wn = function _isPatchLinkageAttribute(e, t) {
|
|
1847
|
+
return ze ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
1848
|
+
}, Gn = function _neutralizePatchLinkage(e) {
|
|
1849
|
+
ze && In(e, (e) => {
|
|
1850
|
+
let t = D(e);
|
|
1851
|
+
if (t === ln.processingInstruction || t === ln.comment && Ft(on, e.data)) {
|
|
1772
1852
|
try {
|
|
1773
1853
|
m(e);
|
|
1774
1854
|
} catch {}
|
|
1775
|
-
|
|
1855
|
+
return !1;
|
|
1776
1856
|
}
|
|
1777
|
-
if (
|
|
1778
|
-
let t = e, n = $(
|
|
1857
|
+
if (t === ln.element) {
|
|
1858
|
+
let t = e, n = $(A(e));
|
|
1779
1859
|
try {
|
|
1780
|
-
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") &&
|
|
1860
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Wn("for", n) && t.removeAttribute("for");
|
|
1781
1861
|
} catch {}
|
|
1782
1862
|
}
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
}, wn = function _initDocument(e) {
|
|
1863
|
+
return !0;
|
|
1864
|
+
});
|
|
1865
|
+
}, Kn = function _initDocument(e) {
|
|
1787
1866
|
let n = null, r = null;
|
|
1788
|
-
if (
|
|
1867
|
+
if (We) e = "<remove></remove>" + e;
|
|
1789
1868
|
else {
|
|
1790
|
-
let t =
|
|
1869
|
+
let t = wt(e, /^[\r\n\t ]+/);
|
|
1791
1870
|
r = t && t[0];
|
|
1792
1871
|
}
|
|
1793
|
-
|
|
1794
|
-
let i =
|
|
1795
|
-
if (
|
|
1796
|
-
n = new c().parseFromString(i,
|
|
1872
|
+
Q === "application/xhtml+xml" && Ot === dt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1873
|
+
let i = M ? B(e) : e;
|
|
1874
|
+
if (Ot === dt) try {
|
|
1875
|
+
n = new c().parseFromString(i, Q);
|
|
1797
1876
|
} catch {}
|
|
1798
1877
|
if (!n || !n.documentElement) {
|
|
1799
|
-
n =
|
|
1878
|
+
n = H.createDocument(Ot, "template", null);
|
|
1800
1879
|
try {
|
|
1801
|
-
n.documentElement.innerHTML =
|
|
1880
|
+
n.documentElement.innerHTML = kt ? N : i;
|
|
1802
1881
|
} catch {}
|
|
1803
1882
|
}
|
|
1804
1883
|
let a = n.body || n.documentElement;
|
|
1805
|
-
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null),
|
|
1806
|
-
},
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
kn(e.content) && Dn(e.content);
|
|
1884
|
+
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), Ot === dt ? fe.call(n, Be ? "html" : "body")[0] : Be ? n.documentElement : a;
|
|
1885
|
+
}, qn = function _createNodeIterator(e) {
|
|
1886
|
+
let t = E ? E(e) : e.ownerDocument;
|
|
1887
|
+
return U.call(t || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
|
|
1888
|
+
}, Jn = function _stripTemplateExpressions(e) {
|
|
1889
|
+
return e = Tt(e, me, " "), e = Tt(e, he, " "), e = Tt(e, ge, " "), e;
|
|
1890
|
+
}, Yn = function _scrubTemplateExpressions(e) {
|
|
1891
|
+
Xn(e);
|
|
1892
|
+
let t = e.querySelectorAll?.call(e, "template");
|
|
1893
|
+
t && ft(t, (e) => {
|
|
1894
|
+
Qn(e.content) && Yn(e.content);
|
|
1817
1895
|
});
|
|
1818
|
-
},
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1896
|
+
}, Xn = function _scrubOwnCharacterData(e) {
|
|
1897
|
+
e.normalize();
|
|
1898
|
+
let t = E ? E(e) : e.ownerDocument, n = U.call(t || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
1899
|
+
for (; r;) r.data = Jn(r.data), r = n.nextNode();
|
|
1900
|
+
}, Zn = function _isClobbered(e) {
|
|
1901
|
+
let t = T ? T(e) : null;
|
|
1902
|
+
return typeof t != "string" || $(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== x(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== w(e) || e.childNodes !== v(e);
|
|
1903
|
+
}, Qn = function _isDocumentFragment(e) {
|
|
1904
|
+
if (!w || typeof e != "object" || !e) return !1;
|
|
1823
1905
|
try {
|
|
1824
|
-
return
|
|
1906
|
+
return w(e) === ln.documentFragment;
|
|
1825
1907
|
} catch {
|
|
1826
1908
|
return !1;
|
|
1827
1909
|
}
|
|
1828
|
-
},
|
|
1829
|
-
if (!
|
|
1910
|
+
}, $n = function _isNode(e) {
|
|
1911
|
+
if (!w || typeof e != "object" || !e) return !1;
|
|
1830
1912
|
try {
|
|
1831
|
-
return typeof
|
|
1913
|
+
return typeof w(e) == "number";
|
|
1832
1914
|
} catch {
|
|
1833
1915
|
return !1;
|
|
1834
1916
|
}
|
|
1835
1917
|
};
|
|
1836
1918
|
function _executeHooks(e, t, n) {
|
|
1837
|
-
e.length !== 0 &&
|
|
1838
|
-
e.call(DOMPurify, t, n,
|
|
1919
|
+
e.length !== 0 && ft(e, (e) => {
|
|
1920
|
+
e.call(DOMPurify, t, n, xn);
|
|
1839
1921
|
});
|
|
1840
1922
|
}
|
|
1841
|
-
let
|
|
1842
|
-
return !!(
|
|
1843
|
-
},
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1923
|
+
let er = function _isUnsafeNode(e, t) {
|
|
1924
|
+
return !!(ze && e.hasChildNodes() && !$n(e.firstElementChild) && Ft(an, e.textContent) && Ft(an, e.innerHTML) || ze && un[t] && D(e) === ln.element && j(e) === dt && ($n(e.firstElementChild) || typeof e.textContent == "string" && Ft(an, e.textContent)) || e.nodeType === ln.processingInstruction || ze && e.nodeType === ln.comment && Ft(on, e.data));
|
|
1925
|
+
}, tr = function _matchesNameCheck(e, t) {
|
|
1926
|
+
return e instanceof RegExp ? Ft(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
1927
|
+
}, nr = function _sanitizeDisallowedNode(e, t, n) {
|
|
1928
|
+
if (!Ae[t] && cr(t) && tr(ke.tagNameCheck, t)) return !1;
|
|
1929
|
+
if (Ze && !tt[t] && !tt[St(t)]) {
|
|
1930
|
+
let t = y(e), r = v(e);
|
|
1931
|
+
if (r && t) {
|
|
1932
|
+
let i = r.length;
|
|
1933
|
+
for (let a = i - 1; a >= 0; --a) {
|
|
1934
|
+
let i = e === n ? p(r[a], !0) : r[a];
|
|
1935
|
+
t.insertBefore(i, _(e));
|
|
1852
1936
|
}
|
|
1853
1937
|
}
|
|
1854
1938
|
}
|
|
1855
|
-
return
|
|
1856
|
-
},
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1939
|
+
return jn(e), !0;
|
|
1940
|
+
}, rr = function _forkSharedAllowlist(e, t, n, r) {
|
|
1941
|
+
return e.length === 0 ? t : t === n || t === r ? clone(t) : t;
|
|
1942
|
+
}, ir = function _handleHookDetachedNode(e, t) {
|
|
1943
|
+
return e === t || y(e) !== null ? !1 : (Qe && Ln(e), !0);
|
|
1944
|
+
}, ar = function _sanitizeElements(e, t) {
|
|
1945
|
+
if (Un(e), _executeHooks(G.beforeSanitizeElements, e, null), ir(e, t)) return !0;
|
|
1946
|
+
if (Zn(e)) return jn(e), !0;
|
|
1947
|
+
let n = $(A(e));
|
|
1948
|
+
if (K = rr(G.uponSanitizeElement, K, Ee, He), _executeHooks(G.uponSanitizeElement, e, {
|
|
1861
1949
|
tagName: n,
|
|
1862
1950
|
allowedTags: K
|
|
1863
|
-
}), e
|
|
1864
|
-
if (
|
|
1865
|
-
if (
|
|
1866
|
-
let
|
|
1867
|
-
return
|
|
1868
|
-
}
|
|
1869
|
-
if ((
|
|
1870
|
-
if (
|
|
1871
|
-
let t =
|
|
1872
|
-
e.textContent !== t && (
|
|
1873
|
-
}
|
|
1874
|
-
return _executeHooks(
|
|
1875
|
-
},
|
|
1876
|
-
if (
|
|
1877
|
-
let i = J[n] ||
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
if (!(In(e) && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, e) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(e)) && (Y.attributeNameCheck instanceof RegExp && Ot(Y.attributeNameCheck, n) || Y.attributeNameCheck instanceof Function && Y.attributeNameCheck(n, e)) || n === "is" && Y.allowCustomizedBuiltInElements && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, r) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(r)))) return !1;
|
|
1881
|
-
} else if (!Ze[n] && !Ot(ge, bt(r, me, "")) && (n !== "src" && n !== "xlink:href" && n !== "href" || e === "script" || xt(r, "data:") !== 0 || !Ye[e]) && (!De || Ot(pe, bt(r, me, ""))) && r) return !1;
|
|
1882
|
-
}
|
|
1883
|
-
return !0;
|
|
1884
|
-
}, Fn = addToSet({}, [
|
|
1951
|
+
}), ir(e, t)) return !0;
|
|
1952
|
+
if (er(e, n)) return jn(e), !0;
|
|
1953
|
+
if (Ae[n] || !(Me.tagCheck instanceof Function && Me.tagCheck(n)) && !K[n]) {
|
|
1954
|
+
let r = nr(e, n, t);
|
|
1955
|
+
return r === !1 && (_executeHooks(G.afterSanitizeElements, e, null), ir(e, t)) ? !0 : r;
|
|
1956
|
+
}
|
|
1957
|
+
if (D(e) === ln.element && !An(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Ft(sn, e.innerHTML)) return jn(e), !0;
|
|
1958
|
+
if (Le && e.nodeType === ln.text) {
|
|
1959
|
+
let t = Jn(e.textContent);
|
|
1960
|
+
e.textContent !== t && (mt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1961
|
+
}
|
|
1962
|
+
return _executeHooks(G.afterSanitizeElements, e, null), ir(e, t);
|
|
1963
|
+
}, or = function _isValidAttribute(e, n, r) {
|
|
1964
|
+
if (je[n] || Wn(n, e) || Je && (n === "id" || n === "name") && (r in t || r in Sn)) return !1;
|
|
1965
|
+
let i = J[n] || Me.attributeCheck instanceof Function && Me.attributeCheck(n, e);
|
|
1966
|
+
return Pe && Ft(_e, n) || Ne && Ft(ve, n) ? !0 : i ? ot[n] || Ft(Ce, Tt(r, xe, "")) || (n === "src" || n === "xlink:href" || n === "href") && e !== "script" && Et(r, "data:") === 0 && it[e] || Fe && !Ft(ye, Tt(r, xe, "")) ? !0 : !r : cr(e) && tr(ke.tagNameCheck, e) && tr(ke.attributeNameCheck, n, e) || n === "is" && ke.allowCustomizedBuiltInElements && tr(ke.tagNameCheck, r);
|
|
1967
|
+
}, sr = addToSet({}, [
|
|
1885
1968
|
"annotation-xml",
|
|
1886
1969
|
"color-profile",
|
|
1887
1970
|
"font-face",
|
|
@@ -1890,66 +1973,47 @@ function createDOMPurify() {
|
|
|
1890
1973
|
"font-face-src",
|
|
1891
1974
|
"font-face-uri",
|
|
1892
1975
|
"missing-glyph"
|
|
1893
|
-
]),
|
|
1894
|
-
return !
|
|
1895
|
-
},
|
|
1896
|
-
if (
|
|
1897
|
-
case "TrustedHTML": return
|
|
1898
|
-
case "TrustedScriptURL": return
|
|
1976
|
+
]), cr = function _isBasicCustomElement(e) {
|
|
1977
|
+
return !sr[St(e)] && Ft(Se, e);
|
|
1978
|
+
}, lr = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1979
|
+
if (M && typeof d == "object" && typeof d.getAttributeType == "function" && !n) switch (d.getAttributeType(e, t)) {
|
|
1980
|
+
case "TrustedHTML": return B(r);
|
|
1981
|
+
case "TrustedScriptURL": return V(r);
|
|
1899
1982
|
}
|
|
1900
1983
|
return r;
|
|
1901
|
-
},
|
|
1984
|
+
}, ur = function _setAttributeValue(e, t, n, r) {
|
|
1902
1985
|
try {
|
|
1903
|
-
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r),
|
|
1986
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Zn(e) || (jn(e), !1);
|
|
1904
1987
|
} catch {
|
|
1905
|
-
|
|
1906
|
-
}
|
|
1907
|
-
},
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
if (
|
|
1911
|
-
let n =
|
|
1988
|
+
return Pn(t, e), !1;
|
|
1989
|
+
}
|
|
1990
|
+
}, dr = function _isUnsafeAttributeValue(e, t) {
|
|
1991
|
+
return ze && Ft(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : St(e) === "attributename" && wt(t, "href") !== null;
|
|
1992
|
+
}, fr = function _sanitizeAttributes(e, t) {
|
|
1993
|
+
if (_executeHooks(G.beforeSanitizeAttributes, e, null), ir(e, t)) return;
|
|
1994
|
+
let n = e.attributes;
|
|
1995
|
+
if (!n || Zn(e)) return;
|
|
1996
|
+
J = rr(G.uponSanitizeAttribute, J, De, Ue);
|
|
1997
|
+
let r = {
|
|
1912
1998
|
attrName: "",
|
|
1913
1999
|
attrValue: "",
|
|
1914
2000
|
keepAttr: !0,
|
|
1915
2001
|
allowedAttributes: J,
|
|
1916
2002
|
forceKeepAttr: void 0
|
|
1917
|
-
},
|
|
1918
|
-
for (;
|
|
1919
|
-
let
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
continue;
|
|
1932
|
-
}
|
|
1933
|
-
if (!ke && Ot(tn, p)) {
|
|
1934
|
-
bn(o, e);
|
|
1935
|
-
continue;
|
|
1936
|
-
}
|
|
1937
|
-
if (Ae && (p = En(p)), !Pn(i, d, p)) {
|
|
1938
|
-
bn(o, e);
|
|
1939
|
-
continue;
|
|
1940
|
-
}
|
|
1941
|
-
p = Ln(i, d, s, p), p !== f && Rn(e, o, s, p);
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
_executeHooks(H.afterSanitizeAttributes, e, null);
|
|
1945
|
-
}, Bn = function _sanitizeShadowDOM(e) {
|
|
1946
|
-
let t = null, n = Tn(e);
|
|
1947
|
-
for (_executeHooks(H.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(H.uponSanitizeShadowNode, t, null), Nn(t, e), zn(t), kn(t.content) && Bn(t.content), (x ? x(t) : t.nodeType) === nn.element) {
|
|
1948
|
-
let e = y(t);
|
|
1949
|
-
kn(e) && (Vn(e), Bn(e));
|
|
1950
|
-
}
|
|
1951
|
-
_executeHooks(H.afterSanitizeShadowDOM, e, null);
|
|
1952
|
-
}, Vn = function _sanitizeAttachedShadowRoots(e) {
|
|
2003
|
+
}, i = n.length, a = $(e.nodeName);
|
|
2004
|
+
for (; i--;) {
|
|
2005
|
+
let t = n[i], o = t.name, s = t.namespaceURI, c = t.value, d = $(o), f = c, p = o === "value" ? f : Dt(f), m = !1;
|
|
2006
|
+
r.attrName = d, r.attrValue = p, r.keepAttr = !0, r.forceKeepAttr = void 0, _executeHooks(G.uponSanitizeAttribute, e, r), p = r.attrValue, Ye && (d === "id" || d === "name") && Et(p, Xe) !== 0 && (Pn(o, e, t), p = Xe + p, m = !0), dr(o, p) ? Pn(o, e, t) : r.forceKeepAttr || (r.keepAttr ? !Ie && Ft(cn, p) ? Pn(o, e, t) : (Le && (p = Jn(p)), or(a, d, p) ? (p = lr(a, d, s, p), p !== f && ur(e, o, s, p) && m && pt(DOMPurify.removed)) : Pn(o, e, t)) : Pn(o, e, t));
|
|
2007
|
+
}
|
|
2008
|
+
_executeHooks(G.afterSanitizeAttributes, e, null), ir(e, t);
|
|
2009
|
+
}, pr = function _sanitizeShadowDOM(e) {
|
|
2010
|
+
let t = null, n = qn(e);
|
|
2011
|
+
for (_executeHooks(G.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(G.uponSanitizeShadowNode, t, null), ar(t, e), fr(t, e), Qn(t.content) && pr(t.content), D(t) === ln.element) {
|
|
2012
|
+
let e = b(t);
|
|
2013
|
+
Qn(e) && (mr(e), pr(e));
|
|
2014
|
+
}
|
|
2015
|
+
Le && Xn(e), _executeHooks(G.afterSanitizeShadowDOM, e, null);
|
|
2016
|
+
}, mr = function _sanitizeAttachedShadowRoots(e) {
|
|
1953
2017
|
let t = [{
|
|
1954
2018
|
node: e,
|
|
1955
2019
|
shadow: null
|
|
@@ -1957,27 +2021,27 @@ function createDOMPurify() {
|
|
|
1957
2021
|
for (; t.length > 0;) {
|
|
1958
2022
|
let e = t.pop();
|
|
1959
2023
|
if (e.shadow) {
|
|
1960
|
-
|
|
2024
|
+
pr(e.shadow);
|
|
1961
2025
|
continue;
|
|
1962
2026
|
}
|
|
1963
|
-
let n = e.node, r = (
|
|
2027
|
+
let n = e.node, r = D(n) === ln.element, i = v(n);
|
|
1964
2028
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
1965
2029
|
node: i[e],
|
|
1966
2030
|
shadow: null
|
|
1967
2031
|
});
|
|
1968
2032
|
if (r) {
|
|
1969
|
-
let e =
|
|
2033
|
+
let e = T ? T(n) : null;
|
|
1970
2034
|
if (typeof e == "string" && $(e) === "template") {
|
|
1971
2035
|
let e = n.content;
|
|
1972
|
-
|
|
2036
|
+
Qn(e) && t.push({
|
|
1973
2037
|
node: e,
|
|
1974
2038
|
shadow: null
|
|
1975
2039
|
});
|
|
1976
2040
|
}
|
|
1977
2041
|
}
|
|
1978
2042
|
if (r) {
|
|
1979
|
-
let e =
|
|
1980
|
-
|
|
2043
|
+
let e = b(n);
|
|
2044
|
+
Qn(e) && t.push({
|
|
1981
2045
|
node: null,
|
|
1982
2046
|
shadow: e
|
|
1983
2047
|
}, {
|
|
@@ -1989,73 +2053,73 @@ function createDOMPurify() {
|
|
|
1989
2053
|
};
|
|
1990
2054
|
return DOMPurify.sanitize = function(e) {
|
|
1991
2055
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
|
|
1992
|
-
if (
|
|
2056
|
+
if (kt = !e, kt && (e = "<!-->"), typeof e != "string" && !$n(e) && (e = stringifyValue(e), typeof e != "string")) throw It("dirty is not a string, aborting");
|
|
1993
2057
|
if (!DOMPurify.isSupported) return e;
|
|
1994
|
-
|
|
1995
|
-
let s =
|
|
2058
|
+
Ve ? (K = He, J = Ue) : wn(t), (G.uponSanitizeElement.length > 0 || G.uponSanitizeAttribute.length > 0) && (K = clone(K)), G.uponSanitizeAttribute.length > 0 && (J = clone(J)), DOMPurify.removed = [];
|
|
2059
|
+
let s = Qe && typeof e != "string" && $n(e), c = [], d = $e;
|
|
1996
2060
|
if (s) {
|
|
1997
|
-
|
|
1998
|
-
let t =
|
|
2061
|
+
Gn(e);
|
|
2062
|
+
let t = A(e);
|
|
1999
2063
|
if (typeof t == "string") {
|
|
2000
2064
|
let n = $(t);
|
|
2001
|
-
if (!K[n] ||
|
|
2002
|
-
}
|
|
2003
|
-
if (On(e)) throw yn(e), kt("root node is clobbered and cannot be sanitized in-place");
|
|
2004
|
-
try {
|
|
2005
|
-
Vn(e);
|
|
2006
|
-
} catch (t) {
|
|
2007
|
-
throw yn(e), t;
|
|
2065
|
+
if (!K[n] || Ae[n]) throw Nn(e), It("root node is forbidden and cannot be sanitized in-place");
|
|
2008
2066
|
}
|
|
2009
|
-
|
|
2067
|
+
if (Zn(e)) throw Nn(e), It("root node is clobbered and cannot be sanitized in-place");
|
|
2068
|
+
c = Rn(e), $e = vt();
|
|
2069
|
+
} else if ($n(e)) r = Kn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === ln.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), mr(r);
|
|
2010
2070
|
else {
|
|
2011
|
-
if (!
|
|
2012
|
-
if (r =
|
|
2071
|
+
if (!Ge && !Le && !Be && e.indexOf("<") === -1) return M && qe ? B(e) : e;
|
|
2072
|
+
if (r = Kn(e), !r) return Ge ? null : qe ? N : "";
|
|
2013
2073
|
}
|
|
2014
|
-
r &&
|
|
2015
|
-
let
|
|
2074
|
+
r && We && jn(r.firstChild);
|
|
2075
|
+
let f = s ? e : r;
|
|
2016
2076
|
try {
|
|
2017
|
-
|
|
2077
|
+
s && mr(e);
|
|
2078
|
+
let t = qn(f);
|
|
2079
|
+
for (; a = t.nextNode();) ar(a, f), fr(a, f), Qn(a.content) && pr(a.content);
|
|
2080
|
+
s && Vn(e, c);
|
|
2018
2081
|
} catch (t) {
|
|
2019
|
-
throw s && (
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
}
|
|
2023
|
-
if (s)
|
|
2024
|
-
e
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2082
|
+
throw s && (Nn(e), Bn(e, c)), t;
|
|
2083
|
+
} finally {
|
|
2084
|
+
$e = d;
|
|
2085
|
+
}
|
|
2086
|
+
if (s) {
|
|
2087
|
+
if (Bn(e, c)) throw It("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2088
|
+
return Le && Yn(e), e;
|
|
2089
|
+
}
|
|
2090
|
+
if (Ge) {
|
|
2091
|
+
if (Le && Yn(r), Ke) for (o = ue.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
|
|
2028
2092
|
else o = r;
|
|
2029
|
-
return (J.shadowroot || J.shadowrootmode) && (o =
|
|
2093
|
+
return (J.shadowroot || J.shadowrootmode) && (o = pe.call(n, o, !0)), o;
|
|
2030
2094
|
}
|
|
2031
|
-
let
|
|
2032
|
-
return
|
|
2095
|
+
let p = Be ? r.outerHTML : r.innerHTML;
|
|
2096
|
+
return Be && K["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Ft(nn, r.ownerDocument.doctype.name) && (p = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + p), Le && (p = Jn(p)), M && qe ? B(p) : p;
|
|
2033
2097
|
}, DOMPurify.setConfig = function() {
|
|
2034
2098
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2035
|
-
|
|
2099
|
+
wn(e), Ve = !0, He = K, Ue = J;
|
|
2036
2100
|
}, DOMPurify.clearConfig = function() {
|
|
2037
|
-
|
|
2101
|
+
xn = null, Ve = !1, He = null, Ue = null, M = te, N = "";
|
|
2038
2102
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2039
|
-
|
|
2103
|
+
xn || wn({});
|
|
2040
2104
|
let r = $(e), i = $(t);
|
|
2041
|
-
return
|
|
2105
|
+
return typeof n == "string" && (dr(t, n) || !Ie && Ft(cn, n)) ? !1 : or(r, i, n);
|
|
2042
2106
|
}, DOMPurify.addHook = function(e, t) {
|
|
2043
|
-
typeof t == "function" &&
|
|
2107
|
+
typeof t == "function" && Mt(G, e) && mt(G[e], t);
|
|
2044
2108
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2045
|
-
if (
|
|
2109
|
+
if (Mt(G, e)) {
|
|
2046
2110
|
if (t !== void 0) {
|
|
2047
|
-
let n =
|
|
2048
|
-
return n === -1 ? void 0 :
|
|
2111
|
+
let n = Z(G[e], t);
|
|
2112
|
+
return n === -1 ? void 0 : gt(G[e], n, 1)[0];
|
|
2049
2113
|
}
|
|
2050
|
-
return
|
|
2114
|
+
return pt(G[e]);
|
|
2051
2115
|
}
|
|
2052
2116
|
}, DOMPurify.removeHooks = function(e) {
|
|
2053
|
-
|
|
2117
|
+
Mt(G, e) && (G[e] = []);
|
|
2054
2118
|
}, DOMPurify.removeAllHooks = function() {
|
|
2055
|
-
|
|
2119
|
+
G = pn();
|
|
2056
2120
|
}, DOMPurify;
|
|
2057
2121
|
}
|
|
2058
|
-
var
|
|
2122
|
+
var gn = createDOMPurify(), _Class;
|
|
2059
2123
|
function I() {
|
|
2060
2124
|
return {
|
|
2061
2125
|
async: !1,
|
|
@@ -2070,11 +2134,11 @@ function I() {
|
|
|
2070
2134
|
walkTokens: null
|
|
2071
2135
|
};
|
|
2072
2136
|
}
|
|
2073
|
-
var
|
|
2137
|
+
var _n = I();
|
|
2074
2138
|
function W(e) {
|
|
2075
|
-
|
|
2139
|
+
_n = e;
|
|
2076
2140
|
}
|
|
2077
|
-
var
|
|
2141
|
+
var vn = { exec: () => null };
|
|
2078
2142
|
function C(e) {
|
|
2079
2143
|
let t = [];
|
|
2080
2144
|
return (n) => {
|
|
@@ -2086,19 +2150,19 @@ function h(e, t = "") {
|
|
|
2086
2150
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
2087
2151
|
replace: (e, t) => {
|
|
2088
2152
|
let i = typeof t == "string" ? t : t.source;
|
|
2089
|
-
return i = i.replace(
|
|
2153
|
+
return i = i.replace(Q.caret, "$1"), n = n.replace(e, i), r;
|
|
2090
2154
|
},
|
|
2091
2155
|
getRegex: () => new RegExp(n, t)
|
|
2092
2156
|
};
|
|
2093
2157
|
return r;
|
|
2094
2158
|
}
|
|
2095
|
-
var
|
|
2159
|
+
var yn = ((e = "") => {
|
|
2096
2160
|
try {
|
|
2097
2161
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
2098
2162
|
} catch {
|
|
2099
2163
|
return !1;
|
|
2100
2164
|
}
|
|
2101
|
-
})(),
|
|
2165
|
+
})(), Q = {
|
|
2102
2166
|
codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
|
|
2103
2167
|
outputLinkReplace: /\\([\[\]])/g,
|
|
2104
2168
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -2156,125 +2220,125 @@ var dn = ((e = "") => {
|
|
|
2156
2220
|
hrRegex: C((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
2157
2221
|
fencesBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
2158
2222
|
headingBeginRegex: C((e) => RegExp(`^ {0,${e}}#`)),
|
|
2159
|
-
htmlBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:</?(?:${
|
|
2223
|
+
htmlBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:</?(?:${Nn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
2160
2224
|
blockquoteBeginRegex: C((e) => RegExp(`^ {0,${e}}>`))
|
|
2161
|
-
},
|
|
2162
|
-
blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
2163
|
-
code:
|
|
2164
|
-
def:
|
|
2165
|
-
fences:
|
|
2166
|
-
heading:
|
|
2167
|
-
hr:
|
|
2168
|
-
html:
|
|
2169
|
-
lheading:
|
|
2170
|
-
list:
|
|
2171
|
-
newline:
|
|
2172
|
-
paragraph:
|
|
2173
|
-
table:
|
|
2174
|
-
text:
|
|
2175
|
-
},
|
|
2176
|
-
...
|
|
2177
|
-
lheading:
|
|
2178
|
-
table:
|
|
2179
|
-
paragraph: h(
|
|
2180
|
-
},
|
|
2181
|
-
...
|
|
2182
|
-
html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
2225
|
+
}, bn = /^(?:[ \t]*(?:\n|$))+/, $ = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, xn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Sn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Cn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, wn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Tn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, En = h(Tn).replace(/bull/g, wn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Dn = h(Tn).replace(/bull/g, wn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), On = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, kn = /^[^\n]+/, An = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, jn = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", An).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Mn = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, wn).getRegex(), Nn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Pn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Fn = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Pn).replace("tag", Nn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = (e) => h(On).replace("hr", Sn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Nn).getRegex(), In = de(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Ln = de(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Rn = {
|
|
2226
|
+
blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ln).getRegex(),
|
|
2227
|
+
code: $,
|
|
2228
|
+
def: jn,
|
|
2229
|
+
fences: xn,
|
|
2230
|
+
heading: Cn,
|
|
2231
|
+
hr: Sn,
|
|
2232
|
+
html: Fn,
|
|
2233
|
+
lheading: En,
|
|
2234
|
+
list: Mn,
|
|
2235
|
+
newline: bn,
|
|
2236
|
+
paragraph: In,
|
|
2237
|
+
table: vn,
|
|
2238
|
+
text: kn
|
|
2239
|
+
}, zn = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Sn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Nn).getRegex(), Bn = {
|
|
2240
|
+
...Rn,
|
|
2241
|
+
lheading: Dn,
|
|
2242
|
+
table: zn,
|
|
2243
|
+
paragraph: h(On).replace("hr", Sn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", zn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Nn).getRegex()
|
|
2244
|
+
}, Vn = {
|
|
2245
|
+
...Rn,
|
|
2246
|
+
html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Pn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
2183
2247
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2184
2248
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2185
|
-
fences:
|
|
2249
|
+
fences: vn,
|
|
2186
2250
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2187
|
-
paragraph: h(
|
|
2188
|
-
},
|
|
2189
|
-
_backpedal:
|
|
2190
|
-
anyPunctuation:
|
|
2191
|
-
autolink:
|
|
2192
|
-
blockSkip:
|
|
2193
|
-
br:
|
|
2194
|
-
code:
|
|
2195
|
-
del:
|
|
2196
|
-
delLDelim:
|
|
2197
|
-
delRDelim:
|
|
2198
|
-
emStrongLDelim:
|
|
2199
|
-
emStrongRDelimAst:
|
|
2200
|
-
emStrongRDelimUnd:
|
|
2201
|
-
escape:
|
|
2202
|
-
link:
|
|
2203
|
-
nolink:
|
|
2204
|
-
punctuation:
|
|
2205
|
-
reflink:
|
|
2206
|
-
reflinkSearch:
|
|
2207
|
-
tag:
|
|
2208
|
-
text:
|
|
2209
|
-
url:
|
|
2210
|
-
},
|
|
2211
|
-
...
|
|
2212
|
-
emStrongLDelim:
|
|
2213
|
-
emStrongRDelimAst:
|
|
2214
|
-
emStrongRDelimUnd:
|
|
2215
|
-
link: h(/^!?\[(label)\]\((.*?)\)/).replace("label",
|
|
2216
|
-
reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",
|
|
2217
|
-
},
|
|
2218
|
-
...
|
|
2219
|
-
emStrongRDelimAst:
|
|
2220
|
-
emStrongLDelim:
|
|
2221
|
-
delLDelim:
|
|
2222
|
-
delRDelim:
|
|
2223
|
-
url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",
|
|
2251
|
+
paragraph: h(On).replace("hr", Sn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", En).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
2252
|
+
}, Hn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Un = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Wn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Gn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Kn = /[\p{P}\p{S}]/u, qn = /[\s\p{P}\p{S}]/u, Jn = /[^\s\p{P}\p{S}]/u, Yn = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, qn).getRegex(), Xn = /[\p{Pi}\p{Ps}"']/u, Zn = /(?!~)[\p{P}\p{S}]/u, Qn = /(?!~)[\s\p{P}\p{S}]/u, $n = /(?:[^\s\p{P}\p{S}]|~)/u, er = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", yn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), tr = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, nr = h(tr, "u").replace(/punct/g, Kn).getRegex(), rr = h(tr, "u").replace(/punct/g, Zn).getRegex(), ir = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Xn).replace(/punct/g, Kn).getRegex(), ar = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", or = h(ar, "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), sr = h(ar, "gu").replace(/notPunctSpace/g, $n).replace(/punctSpace/g, Qn).replace(/punct/g, Zn).getRegex(), cr = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), lr = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), ur = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), dr = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Kn).getRegex(), fr = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), pr = h(/\\(punct)/, "gu").replace(/punct/g, Kn).getRegex(), mr = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), hr = h(Pn).replace("(?:-->|$)", "-->").getRegex(), gr = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", hr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), _r = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, vr = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", _r).getRegex(), yr = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), br = h(/^!?\[(label)\]\[(ref)\]/).replace("label", vr).replace("ref", An).getRegex(), xr = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", An).getRegex(), Sr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Cr = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", _r).getRegex(), wr = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", Cr).replace("ref", Sr).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Sr).getRegex()).getRegex(), Tr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Er = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), Dr = {
|
|
2253
|
+
_backpedal: vn,
|
|
2254
|
+
anyPunctuation: pr,
|
|
2255
|
+
autolink: mr,
|
|
2256
|
+
blockSkip: er,
|
|
2257
|
+
br: Wn,
|
|
2258
|
+
code: Un,
|
|
2259
|
+
del: vn,
|
|
2260
|
+
delLDelim: vn,
|
|
2261
|
+
delRDelim: vn,
|
|
2262
|
+
emStrongLDelim: nr,
|
|
2263
|
+
emStrongRDelimAst: or,
|
|
2264
|
+
emStrongRDelimUnd: lr,
|
|
2265
|
+
escape: Hn,
|
|
2266
|
+
link: yr,
|
|
2267
|
+
nolink: xr,
|
|
2268
|
+
punctuation: Yn,
|
|
2269
|
+
reflink: br,
|
|
2270
|
+
reflinkSearch: wr,
|
|
2271
|
+
tag: gr,
|
|
2272
|
+
text: Gn,
|
|
2273
|
+
url: vn
|
|
2274
|
+
}, Or = {
|
|
2275
|
+
...Dr,
|
|
2276
|
+
emStrongLDelim: ir,
|
|
2277
|
+
emStrongRDelimAst: cr,
|
|
2278
|
+
emStrongRDelimUnd: ur,
|
|
2279
|
+
link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", vr).getRegex(),
|
|
2280
|
+
reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vr).getRegex()
|
|
2281
|
+
}, kr = {
|
|
2282
|
+
...Dr,
|
|
2283
|
+
emStrongRDelimAst: sr,
|
|
2284
|
+
emStrongLDelim: rr,
|
|
2285
|
+
delLDelim: dr,
|
|
2286
|
+
delRDelim: fr,
|
|
2287
|
+
url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Er).replace("protocol", Tr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
2224
2288
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2225
2289
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
2226
|
-
text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",
|
|
2227
|
-
},
|
|
2228
|
-
...
|
|
2229
|
-
br: h(
|
|
2230
|
-
text: h(
|
|
2231
|
-
},
|
|
2232
|
-
normal:
|
|
2233
|
-
gfm:
|
|
2234
|
-
pedantic:
|
|
2235
|
-
},
|
|
2236
|
-
normal:
|
|
2237
|
-
gfm:
|
|
2238
|
-
breaks:
|
|
2239
|
-
pedantic:
|
|
2240
|
-
},
|
|
2290
|
+
text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Tr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
2291
|
+
}, Ar = {
|
|
2292
|
+
...kr,
|
|
2293
|
+
br: h(Wn).replace("{2,}", "*").getRegex(),
|
|
2294
|
+
text: h(kr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2295
|
+
}, jr = {
|
|
2296
|
+
normal: Rn,
|
|
2297
|
+
gfm: Bn,
|
|
2298
|
+
pedantic: Vn
|
|
2299
|
+
}, Mr = {
|
|
2300
|
+
normal: Dr,
|
|
2301
|
+
gfm: kr,
|
|
2302
|
+
breaks: Ar,
|
|
2303
|
+
pedantic: Or
|
|
2304
|
+
}, Nr = {
|
|
2241
2305
|
"&": "&",
|
|
2242
2306
|
"<": "<",
|
|
2243
2307
|
">": ">",
|
|
2244
2308
|
"\"": """,
|
|
2245
2309
|
"'": "'"
|
|
2246
|
-
}, be = (e) =>
|
|
2310
|
+
}, be = (e) => Nr[e];
|
|
2247
2311
|
function O(e, t) {
|
|
2248
2312
|
if (t) {
|
|
2249
|
-
if (
|
|
2250
|
-
} else if (
|
|
2313
|
+
if (Q.escapeTest.test(e)) return e.replace(Q.escapeReplace, be);
|
|
2314
|
+
} else if (Q.escapeTestNoEncode.test(e)) return e.replace(Q.escapeReplaceNoEncode, be);
|
|
2251
2315
|
return e;
|
|
2252
2316
|
}
|
|
2253
2317
|
function Re(e) {
|
|
2254
|
-
return e.replace(
|
|
2318
|
+
return e.replace(Q.numericCharacterReference, (e, t, n) => {
|
|
2255
2319
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
2256
2320
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
2257
2321
|
});
|
|
2258
2322
|
}
|
|
2259
2323
|
function re(e) {
|
|
2260
2324
|
try {
|
|
2261
|
-
e = encodeURI(e).replace(
|
|
2325
|
+
e = encodeURI(e).replace(Q.percentDecode, "%");
|
|
2262
2326
|
} catch {
|
|
2263
2327
|
return null;
|
|
2264
2328
|
}
|
|
2265
2329
|
return e;
|
|
2266
2330
|
}
|
|
2267
2331
|
function se(e, t) {
|
|
2268
|
-
let n = e.replace(
|
|
2332
|
+
let n = e.replace(Q.findPipe, (e, t, n) => {
|
|
2269
2333
|
let r = !1, i = t;
|
|
2270
2334
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
2271
2335
|
return r ? "|" : " |";
|
|
2272
|
-
}).split(
|
|
2336
|
+
}).split(Q.splitPipe), r = 0;
|
|
2273
2337
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
2274
2338
|
if (n.length > t) n.splice(t);
|
|
2275
2339
|
else for (; n.length < t;) n.push("");
|
|
2276
2340
|
}
|
|
2277
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
2341
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(Q.slashPipe, "|");
|
|
2278
2342
|
return n;
|
|
2279
2343
|
}
|
|
2280
2344
|
function L(e, t, n) {
|
|
@@ -2291,7 +2355,7 @@ function L(e, t, n) {
|
|
|
2291
2355
|
}
|
|
2292
2356
|
function ie(e) {
|
|
2293
2357
|
let t = e.split("\n"), n = t.length - 1;
|
|
2294
|
-
for (; n >= 0 &&
|
|
2358
|
+
for (; n >= 0 && Q.blankLine.test(t[n]);) n--;
|
|
2295
2359
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
2296
2360
|
}
|
|
2297
2361
|
function q(e) {
|
|
@@ -2371,7 +2435,7 @@ function we(e, t, n, r) {
|
|
|
2371
2435
|
}
|
|
2372
2436
|
var P = class {
|
|
2373
2437
|
constructor(e) {
|
|
2374
|
-
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e ||
|
|
2438
|
+
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || _n;
|
|
2375
2439
|
}
|
|
2376
2440
|
space(e) {
|
|
2377
2441
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -2457,7 +2521,6 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2457
2521
|
if (f?.type === "list") {
|
|
2458
2522
|
let t = f, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
|
|
2459
2523
|
i[i.length - 1] = o, n = n.substring(0, n.length - f.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
|
|
2460
|
-
continue;
|
|
2461
2524
|
}
|
|
2462
2525
|
}
|
|
2463
2526
|
return {
|
|
@@ -2834,25 +2897,25 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2834
2897
|
};
|
|
2835
2898
|
}
|
|
2836
2899
|
}
|
|
2837
|
-
},
|
|
2900
|
+
}, Pr = class l {
|
|
2838
2901
|
constructor(e) {
|
|
2839
|
-
t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
2902
|
+
t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || _n, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2840
2903
|
inLink: !1,
|
|
2841
2904
|
inRawBlock: !1,
|
|
2842
2905
|
linkEmitted: !1,
|
|
2843
2906
|
top: !0
|
|
2844
2907
|
};
|
|
2845
2908
|
let n = {
|
|
2846
|
-
other:
|
|
2847
|
-
block:
|
|
2848
|
-
inline:
|
|
2909
|
+
other: Q,
|
|
2910
|
+
block: jr.normal,
|
|
2911
|
+
inline: Mr.normal
|
|
2849
2912
|
};
|
|
2850
|
-
this.options.pedantic ? (n.block =
|
|
2913
|
+
this.options.pedantic ? (n.block = jr.pedantic, n.inline = Mr.pedantic) : this.options.gfm && (n.block = jr.gfm, n.inline = this.options.breaks ? Mr.breaks : Mr.gfm), this.tokenizer.rules = n;
|
|
2851
2914
|
}
|
|
2852
2915
|
static get rules() {
|
|
2853
2916
|
return {
|
|
2854
|
-
block:
|
|
2855
|
-
inline:
|
|
2917
|
+
block: jr,
|
|
2918
|
+
inline: Mr
|
|
2856
2919
|
};
|
|
2857
2920
|
}
|
|
2858
2921
|
static lex(e, t) {
|
|
@@ -2862,7 +2925,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2862
2925
|
return new l(t).inlineTokens(e);
|
|
2863
2926
|
}
|
|
2864
2927
|
lex(e) {
|
|
2865
|
-
e = e.replace(
|
|
2928
|
+
e = e.replace(Q.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
2866
2929
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
2867
2930
|
let t = this.inlineQueue[e];
|
|
2868
2931
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -2870,7 +2933,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2870
2933
|
return this.inlineQueue = [], this.tokens;
|
|
2871
2934
|
}
|
|
2872
2935
|
blockTokens(e, t = [], n = !1) {
|
|
2873
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
2936
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(Q.tabCharGlobal, " ").replace(Q.spaceLine, ""));
|
|
2874
2937
|
let r = 1 / 0;
|
|
2875
2938
|
for (; e;) {
|
|
2876
2939
|
if (e.length < r) r = e.length;
|
|
@@ -2892,27 +2955,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2892
2955
|
n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.at(-1).src = n.text) : t.push(i);
|
|
2893
2956
|
continue;
|
|
2894
2957
|
}
|
|
2895
|
-
if (i = this.tokenizer.fences(e)) {
|
|
2896
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
2897
|
-
continue;
|
|
2898
|
-
}
|
|
2899
|
-
if (i = this.tokenizer.heading(e)) {
|
|
2900
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
2901
|
-
continue;
|
|
2902
|
-
}
|
|
2903
|
-
if (i = this.tokenizer.hr(e)) {
|
|
2904
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
2905
|
-
continue;
|
|
2906
|
-
}
|
|
2907
|
-
if (i = this.tokenizer.blockquote(e)) {
|
|
2908
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
2909
|
-
continue;
|
|
2910
|
-
}
|
|
2911
|
-
if (i = this.tokenizer.list(e)) {
|
|
2912
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
2913
|
-
continue;
|
|
2914
|
-
}
|
|
2915
|
-
if (i = this.tokenizer.html(e)) {
|
|
2958
|
+
if ((i = this.tokenizer.fences(e)) || (i = this.tokenizer.heading(e)) || (i = this.tokenizer.hr(e)) || (i = this.tokenizer.blockquote(e)) || (i = this.tokenizer.list(e)) || (i = this.tokenizer.html(e))) {
|
|
2916
2959
|
e = e.substring(i.raw.length), t.push(i);
|
|
2917
2960
|
continue;
|
|
2918
2961
|
}
|
|
@@ -2925,11 +2968,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2925
2968
|
}, t.push(i));
|
|
2926
2969
|
continue;
|
|
2927
2970
|
}
|
|
2928
|
-
if (i = this.tokenizer.table(e)) {
|
|
2929
|
-
e = e.substring(i.raw.length), t.push(i);
|
|
2930
|
-
continue;
|
|
2931
|
-
}
|
|
2932
|
-
if (i = this.tokenizer.lheading(e)) {
|
|
2971
|
+
if ((i = this.tokenizer.table(e)) || (i = this.tokenizer.lheading(e))) {
|
|
2933
2972
|
e = e.substring(i.raw.length), t.push(i);
|
|
2934
2973
|
continue;
|
|
2935
2974
|
}
|
|
@@ -2943,15 +2982,11 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2943
2982
|
if (this.state.top && (i = this.tokenizer.paragraph(a))) {
|
|
2944
2983
|
let r = t.at(-1);
|
|
2945
2984
|
n && r?.type === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + i.raw, r.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(i), n = a.length !== e.length, e = e.substring(i.raw.length);
|
|
2946
|
-
|
|
2947
|
-
}
|
|
2948
|
-
if (i = this.tokenizer.text(e)) {
|
|
2985
|
+
} else if (i = this.tokenizer.text(e)) {
|
|
2949
2986
|
e = e.substring(i.raw.length);
|
|
2950
2987
|
let n = t.at(-1);
|
|
2951
2988
|
n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(i);
|
|
2952
|
-
|
|
2953
|
-
}
|
|
2954
|
-
if (e) {
|
|
2989
|
+
} else if (e) {
|
|
2955
2990
|
this.infiniteLoopError(e.charCodeAt(0));
|
|
2956
2991
|
break;
|
|
2957
2992
|
}
|
|
@@ -3003,15 +3038,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
3003
3038
|
r || (i = ""), r = !1;
|
|
3004
3039
|
let o;
|
|
3005
3040
|
if (this.options.extensions?.inline?.some((n) => (o = n.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue;
|
|
3006
|
-
if (o = this.tokenizer.escape(e)) {
|
|
3007
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3008
|
-
continue;
|
|
3009
|
-
}
|
|
3010
|
-
if (o = this.tokenizer.tag(e)) {
|
|
3011
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3012
|
-
continue;
|
|
3013
|
-
}
|
|
3014
|
-
if (o = this.tokenizer.link(e)) {
|
|
3041
|
+
if ((o = this.tokenizer.escape(e)) || (o = this.tokenizer.tag(e)) || (o = this.tokenizer.link(e))) {
|
|
3015
3042
|
e = e.substring(o.raw.length), t.push(o);
|
|
3016
3043
|
continue;
|
|
3017
3044
|
}
|
|
@@ -3021,27 +3048,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
3021
3048
|
o.type === "text" && n?.type === "text" ? (n.raw += o.raw, n.text += o.text) : t.push(o);
|
|
3022
3049
|
continue;
|
|
3023
3050
|
}
|
|
3024
|
-
if (o = this.tokenizer.emStrong(e, n, i)) {
|
|
3025
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3026
|
-
continue;
|
|
3027
|
-
}
|
|
3028
|
-
if (o = this.tokenizer.codespan(e)) {
|
|
3029
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3030
|
-
continue;
|
|
3031
|
-
}
|
|
3032
|
-
if (o = this.tokenizer.br(e)) {
|
|
3033
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3034
|
-
continue;
|
|
3035
|
-
}
|
|
3036
|
-
if (o = this.tokenizer.del(e, n, i)) {
|
|
3037
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3038
|
-
continue;
|
|
3039
|
-
}
|
|
3040
|
-
if (o = this.tokenizer.autolink(e)) {
|
|
3041
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
3042
|
-
continue;
|
|
3043
|
-
}
|
|
3044
|
-
if (!this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
3051
|
+
if ((o = this.tokenizer.emStrong(e, n, i)) || (o = this.tokenizer.codespan(e)) || (o = this.tokenizer.br(e)) || (o = this.tokenizer.del(e, n, i)) || (o = this.tokenizer.autolink(e)) || !this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
3045
3052
|
e = e.substring(o.raw.length), t.push(o);
|
|
3046
3053
|
continue;
|
|
3047
3054
|
}
|
|
@@ -3056,9 +3063,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
3056
3063
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (i = o.raw.slice(-1)), r = !0;
|
|
3057
3064
|
let n = t.at(-1);
|
|
3058
3065
|
n?.type === "text" ? (n.raw += o.raw, n.text += o.text) : t.push(o);
|
|
3059
|
-
|
|
3060
|
-
}
|
|
3061
|
-
if (e) {
|
|
3066
|
+
} else if (e) {
|
|
3062
3067
|
this.infiniteLoopError(e.charCodeAt(0));
|
|
3063
3068
|
break;
|
|
3064
3069
|
}
|
|
@@ -3072,13 +3077,13 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
3072
3077
|
}
|
|
3073
3078
|
}, S = class {
|
|
3074
3079
|
constructor(e) {
|
|
3075
|
-
t(this, "options", void 0), t(this, "parser", void 0), this.options = e ||
|
|
3080
|
+
t(this, "options", void 0), t(this, "parser", void 0), this.options = e || _n;
|
|
3076
3081
|
}
|
|
3077
3082
|
space(e) {
|
|
3078
3083
|
return "";
|
|
3079
3084
|
}
|
|
3080
3085
|
code({ text: e, lang: t, escaped: n }) {
|
|
3081
|
-
let r = (t || "").match(
|
|
3086
|
+
let r = (t || "").match(Q.notSpaceStart)?.[0], i = e ? e.replace(Q.endingNewline, "") + "\n" : "";
|
|
3082
3087
|
return r ? "<pre><code class=\"language-" + O(r) + "\">" + (n ? i : O(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : O(i, !0)) + "</code></pre>\n";
|
|
3083
3088
|
}
|
|
3084
3089
|
blockquote({ tokens: e }) {
|
|
@@ -3206,9 +3211,9 @@ ${e}</tr>
|
|
|
3206
3211
|
checkbox({ raw: e }) {
|
|
3207
3212
|
return e;
|
|
3208
3213
|
}
|
|
3209
|
-
},
|
|
3214
|
+
}, Fr = class l {
|
|
3210
3215
|
constructor(e) {
|
|
3211
|
-
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e ||
|
|
3216
|
+
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || _n, this.options.renderer = this.options.renderer || new S(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
|
|
3212
3217
|
}
|
|
3213
3218
|
static parse(e, t) {
|
|
3214
3219
|
return new l(t).parse(e);
|
|
@@ -3356,9 +3361,9 @@ ${e}</tr>
|
|
|
3356
3361
|
}
|
|
3357
3362
|
return n;
|
|
3358
3363
|
}
|
|
3359
|
-
},
|
|
3364
|
+
}, Ir = (_Class = class {
|
|
3360
3365
|
constructor(e) {
|
|
3361
|
-
t(this, "options", void 0), t(this, "block", void 0), this.options = e ||
|
|
3366
|
+
t(this, "options", void 0), t(this, "block", void 0), this.options = e || _n;
|
|
3362
3367
|
}
|
|
3363
3368
|
preprocess(e) {
|
|
3364
3369
|
return e;
|
|
@@ -3373,10 +3378,10 @@ ${e}</tr>
|
|
|
3373
3378
|
return e;
|
|
3374
3379
|
}
|
|
3375
3380
|
provideLexer(e = this.block) {
|
|
3376
|
-
return e ?
|
|
3381
|
+
return e ? Pr.lex : Pr.lexInline;
|
|
3377
3382
|
}
|
|
3378
3383
|
provideParser(e = this.block) {
|
|
3379
|
-
return e ?
|
|
3384
|
+
return e ? Fr.parse : Fr.parseInline;
|
|
3380
3385
|
}
|
|
3381
3386
|
}, t(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
3382
3387
|
"preprocess",
|
|
@@ -3389,7 +3394,7 @@ ${e}</tr>
|
|
|
3389
3394
|
"processAllTokens"
|
|
3390
3395
|
])), _Class), F = class {
|
|
3391
3396
|
constructor(...e) {
|
|
3392
|
-
t(this, "defaults", I()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser",
|
|
3397
|
+
t(this, "defaults", I()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", Fr), t(this, "Renderer", S), t(this, "TextRenderer", z), t(this, "Lexer", Pr), t(this, "Tokenizer", P), t(this, "Hooks", Ir), this.use(...e);
|
|
3393
3398
|
}
|
|
3394
3399
|
walkTokens(e, t) {
|
|
3395
3400
|
let n = [];
|
|
@@ -3468,13 +3473,13 @@ ${e}</tr>
|
|
|
3468
3473
|
n.tokenizer = t;
|
|
3469
3474
|
}
|
|
3470
3475
|
if (e.hooks) {
|
|
3471
|
-
let t = this.defaults.hooks || new
|
|
3476
|
+
let t = this.defaults.hooks || new Ir();
|
|
3472
3477
|
for (let n in e.hooks) {
|
|
3473
3478
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
3474
3479
|
if (["options", "block"].includes(n)) continue;
|
|
3475
3480
|
let r = n, i = e.hooks[r], a = t[r];
|
|
3476
|
-
t[r] =
|
|
3477
|
-
if (this.defaults.async &&
|
|
3481
|
+
t[r] = Ir.passThroughHooks.has(n) ? (e) => {
|
|
3482
|
+
if (this.defaults.async && Ir.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
3478
3483
|
let n = await i.call(t, e);
|
|
3479
3484
|
return a.call(t, n);
|
|
3480
3485
|
})();
|
|
@@ -3511,10 +3516,10 @@ ${e}</tr>
|
|
|
3511
3516
|
}, this;
|
|
3512
3517
|
}
|
|
3513
3518
|
lexer(e, t) {
|
|
3514
|
-
return
|
|
3519
|
+
return Pr.lex(e, t ?? this.defaults);
|
|
3515
3520
|
}
|
|
3516
3521
|
parser(e, t) {
|
|
3517
|
-
return
|
|
3522
|
+
return Fr.parse(e, t ?? this.defaults);
|
|
3518
3523
|
}
|
|
3519
3524
|
parseMarkdown(e) {
|
|
3520
3525
|
return (t, n) => {
|
|
@@ -3526,16 +3531,16 @@ ${e}</tr>
|
|
|
3526
3531
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
3527
3532
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
3528
3533
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
3529
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
3534
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Pr.lex : Pr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
3530
3535
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
3531
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
3536
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? Fr.parse : Fr.parseInline)(a, i);
|
|
3532
3537
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
3533
3538
|
})().catch(a);
|
|
3534
3539
|
try {
|
|
3535
3540
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
3536
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
3541
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Pr.lex : Pr.lexInline)(t, i);
|
|
3537
3542
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
3538
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
3543
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? Fr.parse : Fr.parseInline)(n, i);
|
|
3539
3544
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
3540
3545
|
} catch (e) {
|
|
3541
3546
|
return a(e);
|
|
@@ -3552,22 +3557,21 @@ ${e}</tr>
|
|
|
3552
3557
|
throw n;
|
|
3553
3558
|
};
|
|
3554
3559
|
}
|
|
3555
|
-
},
|
|
3560
|
+
}, Lr = new F();
|
|
3556
3561
|
function k(e, t) {
|
|
3557
|
-
return
|
|
3562
|
+
return Lr.parse(e, t);
|
|
3558
3563
|
}
|
|
3559
3564
|
k.options = k.setOptions = function(e) {
|
|
3560
|
-
return
|
|
3561
|
-
}, k.getDefaults = I, k.defaults =
|
|
3565
|
+
return Lr.setOptions(e), k.defaults = Lr.defaults, W(k.defaults), k;
|
|
3566
|
+
}, k.getDefaults = I, k.defaults = _n;
|
|
3562
3567
|
function Pt(...e) {
|
|
3563
|
-
return
|
|
3568
|
+
return Lr.use(...e), k.defaults = Lr.defaults, W(k.defaults), k;
|
|
3564
3569
|
}
|
|
3565
3570
|
k.use = Pt, k.walkTokens = function(e, t) {
|
|
3566
|
-
return
|
|
3567
|
-
}, k.parseInline =
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
var Mr = ["aria-label"], Nr = { class: "px-4 pb-2 pt-4" }, Pr = ["innerHTML"], Fr = ["onClick"], Ir = /* @__PURE__ */ D({
|
|
3571
|
+
return Lr.walkTokens(e, t);
|
|
3572
|
+
}, k.parseInline = Lr.parseInline, k.Parser = Fr, k.parser = Fr.parse, k.Renderer = S, k.TextRenderer = z, k.Lexer = Pr, k.lexer = Pr.lex, k.Tokenizer = P, k.Hooks = Ir, k.parse = k, k.options, k.setOptions, k.walkTokens, k.parseInline, Fr.parse, Pr.lex;
|
|
3573
|
+
// bot/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3574
|
+
var Rr = ["aria-label"], zr = { class: "px-4 pb-2 pt-4" }, Br = ["innerHTML"], Vr = ["onClick"], Hr = /* @__PURE__ */ D({
|
|
3571
3575
|
__name: "ChatCardBlock",
|
|
3572
3576
|
props: {
|
|
3573
3577
|
spec: {},
|
|
@@ -3578,7 +3582,7 @@ var Mr = ["aria-label"], Nr = { class: "px-4 pb-2 pt-4" }, Pr = ["innerHTML"], F
|
|
|
3578
3582
|
let n = e, r = t, i = v(() => {
|
|
3579
3583
|
if (!n.spec.body) return "";
|
|
3580
3584
|
let e = k.parse(n.spec.body, { async: !1 });
|
|
3581
|
-
return
|
|
3585
|
+
return gn.sanitize(e, { ADD_ATTR: ["target"] });
|
|
3582
3586
|
}), a = v(() => n.inverted ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.16)"), o = v(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = v(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = v(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), d = v(() => n.inverted ? `inset 0 0 0 1px ${a.value}` : `inset 0 0 0 1px ${a.value}, 0 4px 16px rgba(15, 23, 42, 0.05)`), f = v(() => n.inverted ? "transparent" : "var(--color-theme-0)");
|
|
3583
3587
|
function actionStyle(e) {
|
|
3584
3588
|
return e === "primary" || e === "destructive" ? {
|
|
@@ -3598,16 +3602,16 @@ var Mr = ["aria-label"], Nr = { class: "px-4 pb-2 pt-4" }, Pr = ["innerHTML"], F
|
|
|
3598
3602
|
}),
|
|
3599
3603
|
"aria-label": e.spec.title
|
|
3600
3604
|
}, [
|
|
3601
|
-
w("div",
|
|
3605
|
+
w("div", zr, [w("div", {
|
|
3602
3606
|
class: "text-[14px] font-semibold leading-tight",
|
|
3603
3607
|
style: N({ color: s.value })
|
|
3604
|
-
},
|
|
3608
|
+
}, U(e.spec.title), 5)]),
|
|
3605
3609
|
i.value ? (R(), x("div", {
|
|
3606
3610
|
key: 0,
|
|
3607
3611
|
class: "chat-msg-prose px-4 pb-4 pt-2 text-[14px] leading-relaxed",
|
|
3608
3612
|
style: N({ color: c.value }),
|
|
3609
3613
|
innerHTML: i.value
|
|
3610
|
-
}, null, 12,
|
|
3614
|
+
}, null, 12, Br)) : b("", !0),
|
|
3611
3615
|
e.spec.actions?.length ? (R(), x("div", {
|
|
3612
3616
|
key: 1,
|
|
3613
3617
|
class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
|
|
@@ -3619,15 +3623,15 @@ var Mr = ["aria-label"], Nr = { class: "px-4 pb-2 pt-4" }, Pr = ["innerHTML"], F
|
|
|
3619
3623
|
class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
|
|
3620
3624
|
style: N(actionStyle(e.style)),
|
|
3621
3625
|
onClick: (t) => r("action", e.reply)
|
|
3622
|
-
},
|
|
3623
|
-
], 12,
|
|
3626
|
+
}, U(e.label), 13, Vr))), 128))], 4)) : b("", !0)
|
|
3627
|
+
], 12, Rr));
|
|
3624
3628
|
}
|
|
3625
|
-
}),
|
|
3629
|
+
}), Ur = 112, Wr = 52, Gr = 14, Kr = 54, qr = 34, Jr = 260;
|
|
3626
3630
|
function nodeWidthFor(e) {
|
|
3627
3631
|
let { orientation: t, maxRows: n, maxWidth: r } = e;
|
|
3628
|
-
if (t === "horizontal" || !r) return
|
|
3629
|
-
let i = r - 28 - (n - 1) *
|
|
3630
|
-
return Math.min(
|
|
3632
|
+
if (t === "horizontal" || !r) return Ur;
|
|
3633
|
+
let i = r - 28 - (n - 1) * Kr;
|
|
3634
|
+
return Math.min(Jr, Math.max(Ur, Math.floor(i / n)));
|
|
3631
3635
|
}
|
|
3632
3636
|
function orientationFor(e) {
|
|
3633
3637
|
return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
@@ -3664,11 +3668,11 @@ function buildLayout(e, t, n) {
|
|
|
3664
3668
|
orientation: t,
|
|
3665
3669
|
maxRows: o,
|
|
3666
3670
|
...n === void 0 ? {} : { maxWidth: n }
|
|
3667
|
-
}), d = t === "horizontal" ? 28 + s * c + (s - 1) *
|
|
3671
|
+
}), d = t === "horizontal" ? 28 + s * c + (s - 1) * Kr : 28 + o * c + (o - 1) * Kr, f = t === "horizontal" ? 28 + o * Wr + (o - 1) * qr : 28 + s * Wr + (s - 1) * qr, p = [];
|
|
3668
3672
|
for (let [e, [, n]] of a.entries()) {
|
|
3669
|
-
let r = (o - n.length) * (t === "horizontal" ? 86 : c +
|
|
3673
|
+
let r = (o - n.length) * (t === "horizontal" ? 86 : c + Kr) / 2;
|
|
3670
3674
|
for (let [i, a] of n.entries()) {
|
|
3671
|
-
let n = t === "horizontal" ?
|
|
3675
|
+
let n = t === "horizontal" ? Gr + e * (c + Kr) : Gr + r + i * (c + Kr), o = t === "horizontal" ? Gr + r + i * 86 : Gr + e * 86;
|
|
3672
3676
|
p.push({
|
|
3673
3677
|
id: a.id,
|
|
3674
3678
|
label: a.label,
|
|
@@ -3677,7 +3681,7 @@ function buildLayout(e, t, n) {
|
|
|
3677
3681
|
x: n,
|
|
3678
3682
|
y: o,
|
|
3679
3683
|
width: c,
|
|
3680
|
-
height:
|
|
3684
|
+
height: Wr
|
|
3681
3685
|
});
|
|
3682
3686
|
}
|
|
3683
3687
|
}
|
|
@@ -3706,8 +3710,7 @@ function buildLayout(e, t, n) {
|
|
|
3706
3710
|
})
|
|
3707
3711
|
};
|
|
3708
3712
|
}
|
|
3709
|
-
|
|
3710
|
-
//#region bot/ui/chat-visual-format.ts
|
|
3713
|
+
// bot/ui/chat-visual-format.ts
|
|
3711
3714
|
function formatChatVisualValue(e) {
|
|
3712
3715
|
let { value: t } = e, n = Math.abs(t);
|
|
3713
3716
|
return n >= 1e6 ? `${(t / 1e6).toFixed(1).replace(/\.0$/, "")}M` : n >= 1e3 ? `${(t / 1e3).toFixed(1).replace(/\.0$/, "")}k` : Number.isInteger(t) ? `${t}` : t.toFixed(1);
|
|
@@ -3754,14 +3757,14 @@ function formatChatVisualTick(e) {
|
|
|
3754
3757
|
let { prefix: r, suffix: i } = affixes(n);
|
|
3755
3758
|
return `${r}${formatChatVisualValue({ value: t })}${i}`;
|
|
3756
3759
|
}
|
|
3757
|
-
var
|
|
3760
|
+
var Yr = 5.4, Xr = 10, Zr = 15, Qr = 16;
|
|
3758
3761
|
function planChatVisualXLabels(e) {
|
|
3759
3762
|
let { labels: t, plotWidth: n } = e;
|
|
3760
3763
|
if (!t.length || n <= 0) return {
|
|
3761
3764
|
mode: "horizontal",
|
|
3762
3765
|
entries: []
|
|
3763
3766
|
};
|
|
3764
|
-
let r = t.map((e) => e.length >
|
|
3767
|
+
let r = t.map((e) => e.length > Qr ? `${e.slice(0, 15).trimEnd()}\u2026` : e), i = t.length - 1;
|
|
3765
3768
|
if (i === 0) return {
|
|
3766
3769
|
mode: "horizontal",
|
|
3767
3770
|
entries: [{
|
|
@@ -3769,14 +3772,14 @@ function planChatVisualXLabels(e) {
|
|
|
3769
3772
|
text: r[0]
|
|
3770
3773
|
}]
|
|
3771
3774
|
};
|
|
3772
|
-
if ((Math.max(...r.map((e) => e.length *
|
|
3775
|
+
if ((Math.max(...r.map((e) => e.length * Yr)) + Xr) * t.length <= n) return {
|
|
3773
3776
|
mode: "horizontal",
|
|
3774
3777
|
entries: r.map((e, t) => ({
|
|
3775
3778
|
index: t,
|
|
3776
3779
|
text: e
|
|
3777
3780
|
}))
|
|
3778
3781
|
};
|
|
3779
|
-
let a = Math.max(2, Math.floor(n /
|
|
3782
|
+
let a = Math.max(2, Math.floor(n / Zr));
|
|
3780
3783
|
if (t.length <= a) return {
|
|
3781
3784
|
mode: "angled",
|
|
3782
3785
|
entries: r.map((e, t) => ({
|
|
@@ -3794,24 +3797,23 @@ function planChatVisualXLabels(e) {
|
|
|
3794
3797
|
}))
|
|
3795
3798
|
};
|
|
3796
3799
|
}
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
var qr = [
|
|
3800
|
+
// bot/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3801
|
+
var $r = [
|
|
3800
3802
|
"data-visual-type",
|
|
3801
3803
|
"data-chart-type",
|
|
3802
3804
|
"data-stacking",
|
|
3803
3805
|
"data-diagram-type",
|
|
3804
3806
|
"aria-label"
|
|
3805
|
-
],
|
|
3807
|
+
], ei = { class: "mb-2.5" }, ti = ["aria-label"], ni = {
|
|
3806
3808
|
key: 0,
|
|
3807
3809
|
"data-test": "chat-visual-horizontal-bars",
|
|
3808
3810
|
class: "grid gap-3"
|
|
3809
|
-
},
|
|
3811
|
+
}, ri = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, ii = ["viewBox"], ai = [
|
|
3810
3812
|
"x1",
|
|
3811
3813
|
"x2",
|
|
3812
3814
|
"y1",
|
|
3813
3815
|
"y2"
|
|
3814
|
-
],
|
|
3816
|
+
], oi = ["x", "y"], si = [
|
|
3815
3817
|
"data-row-index",
|
|
3816
3818
|
"data-series-index",
|
|
3817
3819
|
"data-data-key",
|
|
@@ -3819,42 +3821,42 @@ var qr = [
|
|
|
3819
3821
|
"y",
|
|
3820
3822
|
"width",
|
|
3821
3823
|
"height"
|
|
3822
|
-
],
|
|
3824
|
+
], ci = ["data-trend-key", "d"], li = ["d"], ui = ["cx", "cy"], di = ["cx", "cy"], fi = [
|
|
3823
3825
|
"x",
|
|
3824
3826
|
"y",
|
|
3825
3827
|
"text-anchor",
|
|
3826
3828
|
"transform"
|
|
3827
|
-
],
|
|
3829
|
+
], pi = {
|
|
3828
3830
|
key: 2,
|
|
3829
3831
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3830
|
-
},
|
|
3832
|
+
}, mi = {
|
|
3831
3833
|
key: 1,
|
|
3832
3834
|
class: "grid gap-3"
|
|
3833
|
-
},
|
|
3835
|
+
}, hi = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, gi = { class: "shrink-0 tabular-nums" }, _i = {
|
|
3834
3836
|
key: 2,
|
|
3835
3837
|
class: "overflow-x-auto"
|
|
3836
|
-
},
|
|
3838
|
+
}, vi = ["viewBox", "aria-label"], yi = [
|
|
3837
3839
|
"data-from",
|
|
3838
3840
|
"data-to",
|
|
3839
3841
|
"x1",
|
|
3840
3842
|
"y1",
|
|
3841
3843
|
"x2",
|
|
3842
3844
|
"y2"
|
|
3843
|
-
],
|
|
3845
|
+
], bi = ["cx", "cy"], xi = ["x", "y"], Si = [
|
|
3844
3846
|
"data-node-id",
|
|
3845
3847
|
"data-node-kind",
|
|
3846
3848
|
"transform"
|
|
3847
|
-
],
|
|
3849
|
+
], Ci = ["points"], wi = ["width", "height"], Ti = ["width", "height"], Ei = {
|
|
3848
3850
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3849
3851
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3850
|
-
},
|
|
3852
|
+
}, Di = /* @__PURE__ */ D({
|
|
3851
3853
|
__name: "ChatVisualBlock",
|
|
3852
3854
|
props: {
|
|
3853
3855
|
result: {},
|
|
3854
3856
|
inverted: { type: Boolean }
|
|
3855
3857
|
},
|
|
3856
3858
|
setup(e) {
|
|
3857
|
-
let t = e, n = B(), r =
|
|
3859
|
+
let t = e, n = B(), r = H(360), i;
|
|
3858
3860
|
ne(() => {
|
|
3859
3861
|
typeof ResizeObserver < "u" && n.value && (i = new ResizeObserver((e) => {
|
|
3860
3862
|
let t = e[0]?.contentRect.width;
|
|
@@ -4089,7 +4091,7 @@ var qr = [
|
|
|
4089
4091
|
seriesIndex: n
|
|
4090
4092
|
};
|
|
4091
4093
|
});
|
|
4092
|
-
}),
|
|
4094
|
+
}), le = v(() => {
|
|
4093
4095
|
let e = f.value;
|
|
4094
4096
|
if (!e?.data.length || e.chartType !== "line") return [];
|
|
4095
4097
|
let t = e.data.length - 1, n = e.data[t];
|
|
@@ -4102,7 +4104,7 @@ var qr = [
|
|
|
4102
4104
|
seriesIndex: i
|
|
4103
4105
|
};
|
|
4104
4106
|
}).filter((e) => e !== null);
|
|
4105
|
-
}),
|
|
4107
|
+
}), fe = v(() => {
|
|
4106
4108
|
let e = g.value;
|
|
4107
4109
|
if (!e) return [];
|
|
4108
4110
|
let t = e.data.map((t) => ({
|
|
@@ -4118,7 +4120,7 @@ var qr = [
|
|
|
4118
4120
|
series: r
|
|
4119
4121
|
})
|
|
4120
4122
|
}));
|
|
4121
|
-
}),
|
|
4123
|
+
}), pe = v(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), G = [
|
|
4122
4124
|
"var(--color-theme-900)",
|
|
4123
4125
|
"var(--color-primary-500)",
|
|
4124
4126
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
@@ -4128,16 +4130,16 @@ var qr = [
|
|
|
4128
4130
|
"rgba(255, 255, 255, 0.55)"
|
|
4129
4131
|
];
|
|
4130
4132
|
function seriesColor(e) {
|
|
4131
|
-
let n = t.inverted ? me :
|
|
4133
|
+
let n = t.inverted ? me : G;
|
|
4132
4134
|
return n[e % n.length];
|
|
4133
4135
|
}
|
|
4134
4136
|
function diagramNodeFill(e) {
|
|
4135
4137
|
return t.inverted ? e === "decision" ? "rgba(255, 255, 255, 0.1)" : "rgba(255, 255, 255, 0.06)" : e === "decision" ? "color-mix(in oklch, var(--color-primary-500) 6%, var(--color-theme-0))" : e === "output" ? "color-mix(in oklch, var(--color-theme-900) 5%, var(--color-theme-0))" : "var(--color-theme-0)";
|
|
4136
4138
|
}
|
|
4137
4139
|
function diagramNodeStroke(e) {
|
|
4138
|
-
return t.inverted ? "rgba(255, 255, 255, 0.22)" :
|
|
4140
|
+
return t.inverted ? "rgba(255, 255, 255, 0.22)" : xe.value;
|
|
4139
4141
|
}
|
|
4140
|
-
let he = v(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ge = v(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"),
|
|
4142
|
+
let he = v(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ge = v(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), _e = v(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), ve = v(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), ye = v(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), xe = v(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), Se = v(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Ce = v(() => t.inverted ? "transparent" : "var(--color-theme-0)"), K = v(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Ee = v(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
4141
4143
|
return (e, r) => o.value ? (R(), x("section", {
|
|
4142
4144
|
key: 0,
|
|
4143
4145
|
"data-test": "chat-visual",
|
|
@@ -4147,19 +4149,19 @@ var qr = [
|
|
|
4147
4149
|
"data-diagram-type": c.value?.diagramType,
|
|
4148
4150
|
class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
|
|
4149
4151
|
style: N({
|
|
4150
|
-
background:
|
|
4151
|
-
boxShadow: `inset 0 0 0 1px ${
|
|
4152
|
+
background: Ce.value,
|
|
4153
|
+
boxShadow: `inset 0 0 0 1px ${Se.value}`
|
|
4152
4154
|
}),
|
|
4153
4155
|
"aria-label": o.value.meta.title
|
|
4154
4156
|
}, [
|
|
4155
|
-
w("header",
|
|
4157
|
+
w("header", ei, [w("h4", {
|
|
4156
4158
|
class: "text-[13px] font-semibold leading-tight",
|
|
4157
4159
|
style: N({ color: he.value })
|
|
4158
|
-
},
|
|
4160
|
+
}, U(o.value.meta.title), 5), o.value.meta.description ? (R(), x("p", {
|
|
4159
4161
|
key: 0,
|
|
4160
4162
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
4161
4163
|
style: N({ color: ge.value })
|
|
4162
|
-
},
|
|
4164
|
+
}, U(o.value.meta.description), 5)) : b("", !0)]),
|
|
4163
4165
|
w("div", {
|
|
4164
4166
|
ref_key: "bodyEl",
|
|
4165
4167
|
ref: n
|
|
@@ -4167,19 +4169,19 @@ var qr = [
|
|
|
4167
4169
|
key: 0,
|
|
4168
4170
|
role: "img",
|
|
4169
4171
|
"aria-label": o.value.meta.title
|
|
4170
|
-
}, [ae.value.length ? (R(), x("div",
|
|
4172
|
+
}, [ae.value.length ? (R(), x("div", ni, [(R(!0), x(m, null, V(ae.value, (e) => (R(), x("div", {
|
|
4171
4173
|
key: e.key,
|
|
4172
4174
|
"data-test": "chat-visual-horizontal-bar",
|
|
4173
4175
|
class: "min-w-0"
|
|
4174
|
-
}, [w("div",
|
|
4176
|
+
}, [w("div", ri, [w("span", {
|
|
4175
4177
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4176
4178
|
style: N({ color: he.value })
|
|
4177
|
-
},
|
|
4179
|
+
}, U(e.label), 5), w("span", {
|
|
4178
4180
|
class: "shrink-0 font-semibold tabular-nums",
|
|
4179
4181
|
style: N({ color: he.value })
|
|
4180
|
-
},
|
|
4182
|
+
}, U(e.value), 5)]), w("div", {
|
|
4181
4183
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4182
|
-
style: N({ background:
|
|
4184
|
+
style: N({ background: Ee.value })
|
|
4183
4185
|
}, [w("div", {
|
|
4184
4186
|
class: "h-full rounded-full",
|
|
4185
4187
|
style: N({
|
|
@@ -4202,19 +4204,19 @@ var qr = [
|
|
|
4202
4204
|
y2: yForValue(e),
|
|
4203
4205
|
"stroke-width": "1",
|
|
4204
4206
|
"vector-effect": "non-scaling-stroke",
|
|
4205
|
-
style: N({ stroke: e === 0 ?
|
|
4206
|
-
}, null, 12,
|
|
4207
|
+
style: N({ stroke: e === 0 ? ye.value : ve.value })
|
|
4208
|
+
}, null, 12, ai))), 128)),
|
|
4207
4209
|
w("g", null, [(R(!0), x(m, null, V(T.value.ticks, (e) => (R(), x("text", {
|
|
4208
4210
|
key: `y-${e}`,
|
|
4209
4211
|
x: A.value.left - 7,
|
|
4210
4212
|
y: yForValue(e) + 3,
|
|
4211
4213
|
"text-anchor": "end",
|
|
4212
4214
|
"font-size": "9.5",
|
|
4213
|
-
style: N({ fill:
|
|
4214
|
-
},
|
|
4215
|
+
style: N({ fill: _e.value })
|
|
4216
|
+
}, U(ue(formatChatVisualTick)({
|
|
4215
4217
|
value: e,
|
|
4216
4218
|
shared: E.value
|
|
4217
|
-
})), 13,
|
|
4219
|
+
})), 13, oi))), 128))]),
|
|
4218
4220
|
f.value.chartType === "bar" ? (R(!0), x(m, { key: 0 }, V(j.value, (e) => (R(), x("rect", {
|
|
4219
4221
|
key: e.key,
|
|
4220
4222
|
"data-test": "chat-visual-bar",
|
|
@@ -4227,7 +4229,7 @@ var qr = [
|
|
|
4227
4229
|
height: e.height,
|
|
4228
4230
|
rx: "2.5",
|
|
4229
4231
|
style: N({ fill: seriesColor(e.seriesIndex) })
|
|
4230
|
-
}, null, 12,
|
|
4232
|
+
}, null, 12, si))), 128)) : (R(), x(m, { key: 1 }, [
|
|
4231
4233
|
ee.value ? (R(), x("path", {
|
|
4232
4234
|
key: 0,
|
|
4233
4235
|
"data-test": "chat-visual-trend-line",
|
|
@@ -4240,7 +4242,7 @@ var qr = [
|
|
|
4240
4242
|
"stroke-dasharray": "4 3",
|
|
4241
4243
|
"vector-effect": "non-scaling-stroke",
|
|
4242
4244
|
style: N({ stroke: seriesColor(ee.value.seriesIndex) })
|
|
4243
|
-
}, null, 12,
|
|
4245
|
+
}, null, 12, ci)) : b("", !0),
|
|
4244
4246
|
(R(!0), x(m, null, V(p.value, (e, t) => (R(), x("g", { key: e.dataKey }, [f.value.chartType === "line" ? (R(), x("path", {
|
|
4245
4247
|
key: 0,
|
|
4246
4248
|
d: pathForSeries(e.dataKey),
|
|
@@ -4250,20 +4252,20 @@ var qr = [
|
|
|
4250
4252
|
"stroke-linejoin": "round",
|
|
4251
4253
|
"vector-effect": "non-scaling-stroke",
|
|
4252
4254
|
style: N({ stroke: seriesColor(t) })
|
|
4253
|
-
}, null, 12,
|
|
4255
|
+
}, null, 12, li)) : b("", !0), (R(!0), x(m, null, V(d.value, (n, r) => (R(), x(m, { key: `${e.dataKey}-${r}` }, [f.value.chartType === "scatter" ? (R(), x("circle", {
|
|
4254
4256
|
key: 0,
|
|
4255
4257
|
cx: xForIndex(r, d.value.length),
|
|
4256
4258
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4257
4259
|
r: "2.6",
|
|
4258
4260
|
style: N({ fill: seriesColor(t) })
|
|
4259
|
-
}, null, 12,
|
|
4260
|
-
(R(!0), x(m, null, V(
|
|
4261
|
+
}, null, 12, ui)) : b("", !0)], 64))), 128))]))), 128)),
|
|
4262
|
+
(R(!0), x(m, null, V(le.value, (e) => (R(), x("circle", {
|
|
4261
4263
|
key: `marker-${e.key}`,
|
|
4262
4264
|
cx: e.cx,
|
|
4263
4265
|
cy: e.cy,
|
|
4264
4266
|
r: "3",
|
|
4265
4267
|
style: N({ fill: seriesColor(e.seriesIndex) })
|
|
4266
|
-
}, null, 12,
|
|
4268
|
+
}, null, 12, di))), 128))
|
|
4267
4269
|
], 64)),
|
|
4268
4270
|
(R(!0), x(m, null, V(M.value, (e) => (R(), x("text", {
|
|
4269
4271
|
key: e.key,
|
|
@@ -4271,10 +4273,10 @@ var qr = [
|
|
|
4271
4273
|
y: e.angled ? A.value.height - A.value.bottom + 12 : A.value.height - 6,
|
|
4272
4274
|
"text-anchor": e.anchor,
|
|
4273
4275
|
"font-size": "9.5",
|
|
4274
|
-
transform: e.angled ? `rotate(${
|
|
4275
|
-
style: N({ fill:
|
|
4276
|
-
},
|
|
4277
|
-
], 12,
|
|
4276
|
+
transform: e.angled ? `rotate(${ue(-40)} ${e.x} ${A.value.height - A.value.bottom + 12})` : void 0,
|
|
4277
|
+
style: N({ fill: _e.value })
|
|
4278
|
+
}, U(e.label), 13, fi))), 128))
|
|
4279
|
+
], 12, ii)), ce.value.length > 1 || f.value.chartType !== "bar" ? (R(), x("div", pi, [(R(!0), x(m, null, V(ce.value, (e) => (R(), x("div", {
|
|
4278
4280
|
key: e.key,
|
|
4279
4281
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4280
4282
|
}, [
|
|
@@ -4282,41 +4284,41 @@ var qr = [
|
|
|
4282
4284
|
class: "size-2.5 shrink-0 rounded-full",
|
|
4283
4285
|
style: N({ background: seriesColor(e.seriesIndex) })
|
|
4284
4286
|
}, null, 4),
|
|
4285
|
-
w("span", { style: N({ color: ge.value }) },
|
|
4287
|
+
w("span", { style: N({ color: ge.value }) }, U(e.label), 5),
|
|
4286
4288
|
w("span", {
|
|
4287
4289
|
class: "font-semibold tabular-nums",
|
|
4288
4290
|
style: N({ color: he.value })
|
|
4289
|
-
},
|
|
4290
|
-
]))), 128))])) : b("", !0)], 8,
|
|
4291
|
+
}, U(e.value), 5)
|
|
4292
|
+
]))), 128))])) : b("", !0)], 8, ti)) : g.value ? (R(), x("div", mi, [(R(!0), x(m, null, V(fe.value, (e, t) => (R(), x("div", { key: e.key }, [w("div", hi, [w("span", {
|
|
4291
4293
|
class: "truncate font-medium",
|
|
4292
4294
|
style: N({ color: he.value })
|
|
4293
|
-
},
|
|
4295
|
+
}, U(e.name), 5), w("span", gi, [w("span", {
|
|
4294
4296
|
class: "font-semibold",
|
|
4295
4297
|
style: N({ color: he.value })
|
|
4296
|
-
},
|
|
4298
|
+
}, U(e.display), 5), w("span", {
|
|
4297
4299
|
class: "ml-1.5",
|
|
4298
4300
|
style: N({ color: ge.value })
|
|
4299
|
-
},
|
|
4301
|
+
}, U(Math.round(e.percent * 100)) + "%", 5)])]), w("div", {
|
|
4300
4302
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4301
|
-
style: N({ background:
|
|
4303
|
+
style: N({ background: Ee.value })
|
|
4302
4304
|
}, [w("div", {
|
|
4303
4305
|
class: "h-full rounded-full",
|
|
4304
4306
|
style: N({
|
|
4305
4307
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4306
4308
|
background: seriesColor(t)
|
|
4307
4309
|
})
|
|
4308
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4310
|
+
}, null, 4)], 4)]))), 128))])) : c.value && pe.value ? (R(), x("div", _i, [(R(), x("svg", {
|
|
4309
4311
|
"data-test": "chat-visual-diagram-svg",
|
|
4310
4312
|
class: "block h-auto overflow-visible",
|
|
4311
|
-
viewBox: `0 0 ${
|
|
4313
|
+
viewBox: `0 0 ${pe.value.width} ${pe.value.height}`,
|
|
4312
4314
|
style: N({
|
|
4313
|
-
width: `${
|
|
4314
|
-
aspectRatio: `${
|
|
4315
|
+
width: `${pe.value.width}px`,
|
|
4316
|
+
aspectRatio: `${pe.value.width} / ${pe.value.height}`
|
|
4315
4317
|
}),
|
|
4316
4318
|
role: "img",
|
|
4317
4319
|
"aria-label": o.value.meta.title
|
|
4318
4320
|
}, [
|
|
4319
|
-
(R(!0), x(m, null, V(
|
|
4321
|
+
(R(!0), x(m, null, V(pe.value.edges, (e) => (R(), x("line", {
|
|
4320
4322
|
key: e.key,
|
|
4321
4323
|
"data-test": "chat-visual-diagram-edge",
|
|
4322
4324
|
"data-from": e.from,
|
|
@@ -4328,16 +4330,16 @@ var qr = [
|
|
|
4328
4330
|
"stroke-width": "1.4",
|
|
4329
4331
|
"stroke-linecap": "round",
|
|
4330
4332
|
"vector-effect": "non-scaling-stroke",
|
|
4331
|
-
style: N({ stroke:
|
|
4332
|
-
}, null, 12,
|
|
4333
|
-
(R(!0), x(m, null, V(
|
|
4333
|
+
style: N({ stroke: K.value })
|
|
4334
|
+
}, null, 12, yi))), 128)),
|
|
4335
|
+
(R(!0), x(m, null, V(pe.value.edges, (e) => (R(), x("circle", {
|
|
4334
4336
|
key: `${e.key}-dot`,
|
|
4335
4337
|
cx: e.x2,
|
|
4336
4338
|
cy: e.y2,
|
|
4337
4339
|
r: "2.4",
|
|
4338
|
-
style: N({ fill:
|
|
4339
|
-
}, null, 12,
|
|
4340
|
-
(R(!0), x(m, null, V(
|
|
4340
|
+
style: N({ fill: K.value })
|
|
4341
|
+
}, null, 12, bi))), 128)),
|
|
4342
|
+
(R(!0), x(m, null, V(pe.value.edges.filter((e) => e.label), (e) => (R(), x("foreignObject", {
|
|
4341
4343
|
key: `${e.key}-label`,
|
|
4342
4344
|
x: e.labelX - 55,
|
|
4343
4345
|
y: e.labelY - 12,
|
|
@@ -4350,8 +4352,8 @@ var qr = [
|
|
|
4350
4352
|
color: ge.value,
|
|
4351
4353
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4352
4354
|
})
|
|
4353
|
-
},
|
|
4354
|
-
(R(!0), x(m, null, V(
|
|
4355
|
+
}, U(e.label), 5)], 8, xi))), 128)),
|
|
4356
|
+
(R(!0), x(m, null, V(pe.value.nodes, (e) => (R(), x("g", {
|
|
4355
4357
|
key: e.id,
|
|
4356
4358
|
"data-test": "chat-visual-diagram-node",
|
|
4357
4359
|
"data-node-id": e.id,
|
|
@@ -4366,7 +4368,7 @@ var qr = [
|
|
|
4366
4368
|
fill: diagramNodeFill(e.kind),
|
|
4367
4369
|
stroke: diagramNodeStroke(e.kind)
|
|
4368
4370
|
})
|
|
4369
|
-
}, null, 12,
|
|
4371
|
+
}, null, 12, Ci)) : (R(), x("rect", {
|
|
4370
4372
|
key: 1,
|
|
4371
4373
|
width: e.width,
|
|
4372
4374
|
height: e.height,
|
|
@@ -4377,28 +4379,28 @@ var qr = [
|
|
|
4377
4379
|
fill: diagramNodeFill(e.kind),
|
|
4378
4380
|
stroke: diagramNodeStroke(e.kind)
|
|
4379
4381
|
})
|
|
4380
|
-
}, null, 12,
|
|
4382
|
+
}, null, 12, wi)), (R(), x("foreignObject", {
|
|
4381
4383
|
x: "8",
|
|
4382
4384
|
y: "5",
|
|
4383
4385
|
width: e.width - 16,
|
|
4384
4386
|
height: e.height - 10
|
|
4385
|
-
}, [w("div",
|
|
4387
|
+
}, [w("div", Ei, [w("div", {
|
|
4386
4388
|
class: "line-clamp-2 text-[13px] font-medium leading-snug",
|
|
4387
4389
|
style: N({ color: he.value })
|
|
4388
|
-
},
|
|
4390
|
+
}, U(e.label), 5), e.detail ? (R(), x("div", {
|
|
4389
4391
|
key: 0,
|
|
4390
4392
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4391
4393
|
style: N({ color: ge.value })
|
|
4392
|
-
},
|
|
4393
|
-
], 12,
|
|
4394
|
+
}, U(e.detail), 5)) : b("", !0)])], 8, Ti))], 8, Si))), 128))
|
|
4395
|
+
], 12, vi))])) : b("", !0)], 512),
|
|
4394
4396
|
o.value.meta.footer ? (R(), x("footer", {
|
|
4395
4397
|
key: 0,
|
|
4396
4398
|
class: "mt-3 text-[11px] leading-snug",
|
|
4397
|
-
style: N({ color:
|
|
4398
|
-
},
|
|
4399
|
-
], 12,
|
|
4399
|
+
style: N({ color: _e.value })
|
|
4400
|
+
}, U(o.value.meta.footer), 5)) : b("", !0)
|
|
4401
|
+
], 12, $r)) : b("", !0);
|
|
4400
4402
|
}
|
|
4401
|
-
}),
|
|
4403
|
+
}), Oi = ["innerHTML"], ki = /* @__PURE__ */ D({
|
|
4402
4404
|
__name: "ChatRichText",
|
|
4403
4405
|
props: {
|
|
4404
4406
|
text: {},
|
|
@@ -4407,15 +4409,11 @@ var qr = [
|
|
|
4407
4409
|
},
|
|
4408
4410
|
emits: ["action"],
|
|
4409
4411
|
setup(e, { emit: t }) {
|
|
4410
|
-
let n = e, r = t, i =
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
|
|
4414
|
-
return;
|
|
4415
|
-
}
|
|
4416
|
-
a === void 0 && (a = requestAnimationFrame(() => {
|
|
4412
|
+
let n = e, r = t, i = H(n.text), a;
|
|
4413
|
+
G([() => n.text, () => n.streaming], ([e, t]) => {
|
|
4414
|
+
t ? a === void 0 && (a = requestAnimationFrame(() => {
|
|
4417
4415
|
a = void 0, i.value = n.text;
|
|
4418
|
-
}));
|
|
4416
|
+
})) : (a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e);
|
|
4419
4417
|
}), te(() => {
|
|
4420
4418
|
a !== void 0 && cancelAnimationFrame(a);
|
|
4421
4419
|
});
|
|
@@ -4438,7 +4436,7 @@ var qr = [
|
|
|
4438
4436
|
function renderMarkdown(e) {
|
|
4439
4437
|
if (!e) return "";
|
|
4440
4438
|
let t = k.parse(e, { async: !1 });
|
|
4441
|
-
return
|
|
4439
|
+
return gn.sanitize(t, {
|
|
4442
4440
|
ADD_ATTR: ["target"],
|
|
4443
4441
|
ADD_DATA_URI_TAGS: ["img"]
|
|
4444
4442
|
});
|
|
@@ -4576,11 +4574,11 @@ var qr = [
|
|
|
4576
4574
|
key: 0,
|
|
4577
4575
|
class: j(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4578
4576
|
innerHTML: t.html
|
|
4579
|
-
}, null, 10,
|
|
4577
|
+
}, null, 10, Oi)) : t.kind === "visual" ? (R(), y(Di, {
|
|
4580
4578
|
key: 1,
|
|
4581
4579
|
result: t.result,
|
|
4582
4580
|
inverted: e.inverted
|
|
4583
|
-
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (R(), y(
|
|
4581
|
+
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (R(), y(Hr, {
|
|
4584
4582
|
key: 2,
|
|
4585
4583
|
spec: t.spec,
|
|
4586
4584
|
inverted: e.inverted,
|
|
@@ -4600,7 +4598,7 @@ var qr = [
|
|
|
4600
4598
|
style: { background: "currentcolor" }
|
|
4601
4599
|
}, null, -1), T(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4602
4600
|
}
|
|
4603
|
-
}),
|
|
4601
|
+
}), Ai = 80, ji = 600, Mi = /* @__PURE__ */ D({
|
|
4604
4602
|
__name: "ChatScroller",
|
|
4605
4603
|
setup(e, { expose: t }) {
|
|
4606
4604
|
let n = B(), r = B(), i = B(!0), a, o, s = 0;
|
|
@@ -4610,10 +4608,10 @@ var qr = [
|
|
|
4610
4608
|
}
|
|
4611
4609
|
function onScroll() {
|
|
4612
4610
|
let e = n.value;
|
|
4613
|
-
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
4611
|
+
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= Ai);
|
|
4614
4612
|
}
|
|
4615
4613
|
function markUserGesture() {
|
|
4616
|
-
s = Date.now() +
|
|
4614
|
+
s = Date.now() + ji;
|
|
4617
4615
|
}
|
|
4618
4616
|
function followPinned() {
|
|
4619
4617
|
i.value && Date.now() > s && scrollToBottom();
|
|
@@ -4645,7 +4643,7 @@ var qr = [
|
|
|
4645
4643
|
class: "flex-1 flex flex-col"
|
|
4646
4644
|
}, [ce(e.$slots, "default")], 512)], 34));
|
|
4647
4645
|
}
|
|
4648
|
-
}),
|
|
4646
|
+
}), Ni = ["aria-label"], Pi = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, Fi = /* @__PURE__ */ D({
|
|
4649
4647
|
name: "FClose",
|
|
4650
4648
|
__name: "FClose",
|
|
4651
4649
|
props: { ariaLabel: {} },
|
|
@@ -4661,7 +4659,7 @@ var qr = [
|
|
|
4661
4659
|
"aria-label": e.ariaLabel || "Close",
|
|
4662
4660
|
class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
|
|
4663
4661
|
onClick: r[0] || (r[0] = (e) => n.$emit("click", e))
|
|
4664
|
-
}, [r[1] || (r[1] = w("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), w("span",
|
|
4662
|
+
}, [r[1] || (r[1] = w("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), w("span", Pi, [w("span", {
|
|
4665
4663
|
class: j(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
4666
4664
|
style: {
|
|
4667
4665
|
"background-color": "currentColor",
|
|
@@ -4673,15 +4671,15 @@ var qr = [
|
|
|
4673
4671
|
"background-color": "currentColor",
|
|
4674
4672
|
"transition-delay": "0.45s"
|
|
4675
4673
|
}
|
|
4676
|
-
}, null, 2)])], 8,
|
|
4674
|
+
}, null, 2)])], 8, Ni));
|
|
4677
4675
|
}
|
|
4678
|
-
}),
|
|
4676
|
+
}), Ii = { class: "flex min-h-full items-center justify-center text-center p-4" }, Li = {
|
|
4679
4677
|
key: 0,
|
|
4680
4678
|
class: "text-base p-4 font-semibold"
|
|
4681
|
-
},
|
|
4679
|
+
}, Ri = {
|
|
4682
4680
|
key: 1,
|
|
4683
4681
|
class: "flex items-center gap-2 px-2"
|
|
4684
|
-
},
|
|
4682
|
+
}, zi = /* @__PURE__ */ D({
|
|
4685
4683
|
inheritAttrs: !1,
|
|
4686
4684
|
name: "FModal",
|
|
4687
4685
|
__name: "FModal",
|
|
@@ -4737,7 +4735,7 @@ var qr = [
|
|
|
4737
4735
|
}
|
|
4738
4736
|
ne(async () => {
|
|
4739
4737
|
r.value = !0;
|
|
4740
|
-
let t =
|
|
4738
|
+
let t = G(() => e.vis, (e) => {
|
|
4741
4739
|
e ? setTimeout(() => a.value = !0, 300) : a.value = !1;
|
|
4742
4740
|
}, { immediate: !0 });
|
|
4743
4741
|
o.push(t), typeof document < "u" && (document.addEventListener("keydown", onKeydown), o.push(() => document.removeEventListener("keydown", onKeydown)));
|
|
@@ -4785,36 +4783,36 @@ var qr = [
|
|
|
4785
4783
|
}), w("div", {
|
|
4786
4784
|
class: "fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar",
|
|
4787
4785
|
onClick: n[3] || (n[3] = (e) => close({ reason: "escape" }))
|
|
4788
|
-
}, [w("div",
|
|
4786
|
+
}, [w("div", Ii, [E(_, M(A(s.value)), {
|
|
4789
4787
|
default: me(() => [e.vis ? (R(), x("div", {
|
|
4790
4788
|
key: 0,
|
|
4791
4789
|
class: j([i.value, "w-full"]),
|
|
4792
|
-
onClick: n[2] || (n[2] =
|
|
4790
|
+
onClick: n[2] || (n[2] = _e(() => {}, ["stop"]))
|
|
4793
4791
|
}, [e.hasClose || e.title || t.$slots.actions ? (R(), x("div", {
|
|
4794
4792
|
key: 0,
|
|
4795
4793
|
class: j(!e.title && (e.hasClose || t.$slots.actions) ? "absolute top-0 right-0 z-10" : "flex justify-between items-center")
|
|
4796
|
-
}, [e.title ? (R(), x("h2",
|
|
4794
|
+
}, [e.title ? (R(), x("h2", Li, U(e.title), 1)) : b("", !0), e.hasClose || t.$slots.actions ? (R(), x("div", Ri, [ce(t.$slots, "actions"), e.hasClose ? (R(), y(Fi, {
|
|
4797
4795
|
key: 0,
|
|
4798
4796
|
class: "relative",
|
|
4799
4797
|
"data-test-id": "close-modal",
|
|
4800
|
-
onClick: n[1] || (n[1] =
|
|
4798
|
+
onClick: n[1] || (n[1] = _e((e) => close({ reason: "escape" }), ["stop"]))
|
|
4801
4799
|
})) : b("", !0)])) : b("", !0)], 2)) : b("", !0), ce(t.$slots, "default")], 2)) : b("", !0)]),
|
|
4802
4800
|
_: 3
|
|
4803
4801
|
}, 16)])])], 2)], 8, ["to", "disabled"])) : b("", !0);
|
|
4804
4802
|
}
|
|
4805
|
-
}),
|
|
4803
|
+
}), Bi = {
|
|
4806
4804
|
"data-test": "share-reply-dialog",
|
|
4807
4805
|
class: "flex flex-col"
|
|
4808
|
-
},
|
|
4806
|
+
}, Vi = { class: "flex h-[60px] shrink-0 items-center justify-between border-b border-theme-950/[0.06] px-5" }, Hi = { class: "flex flex-col gap-4 p-5" }, Ui = { class: "relative max-h-[300px] overflow-hidden rounded-2xl bg-theme-25 p-4 ring-1 ring-theme-950/[0.06]" }, Wi = { class: "flex flex-col gap-3 text-[13px] leading-relaxed text-theme-800" }, Gi = {
|
|
4809
4807
|
key: 0,
|
|
4810
4808
|
class: "max-w-[85%] self-end whitespace-pre-wrap rounded-[14px] bg-theme-50 px-3 py-2"
|
|
4811
|
-
},
|
|
4809
|
+
}, Ki = {
|
|
4812
4810
|
key: 0,
|
|
4813
4811
|
class: "flex h-11 items-center gap-2 rounded-xl bg-theme-50 px-3"
|
|
4814
|
-
},
|
|
4812
|
+
}, qi = ["value"], Ji = {
|
|
4815
4813
|
key: 1,
|
|
4816
4814
|
class: "text-[13px] text-red-600"
|
|
4817
|
-
},
|
|
4815
|
+
}, Yi = { class: "flex items-center gap-3" }, Xi = ["disabled"], Zi = ["disabled"], Qi = /* @__PURE__ */ D({
|
|
4818
4816
|
__name: "ShareReplyDialog",
|
|
4819
4817
|
props: {
|
|
4820
4818
|
message: {},
|
|
@@ -4824,7 +4822,7 @@ var qr = [
|
|
|
4824
4822
|
emits: ["close"],
|
|
4825
4823
|
setup(e, { emit: t }) {
|
|
4826
4824
|
let n = t, r = B(), i = B(!1), a = B(!1), o = B(!1), s = B(), c;
|
|
4827
|
-
|
|
4825
|
+
G(() => e.message?.id, async (t) => {
|
|
4828
4826
|
if (r.value = void 0, s.value = void 0, o.value = !1, t) {
|
|
4829
4827
|
i.value = !0;
|
|
4830
4828
|
try {
|
|
@@ -4868,12 +4866,12 @@ var qr = [
|
|
|
4868
4866
|
}
|
|
4869
4867
|
}
|
|
4870
4868
|
}
|
|
4871
|
-
return (t, c) => (R(), y(
|
|
4869
|
+
return (t, c) => (R(), y(zi, {
|
|
4872
4870
|
vis: !!e.message,
|
|
4873
4871
|
"modal-class": "w-full max-w-[480px] p-0",
|
|
4874
4872
|
onClose: c[2] || (c[2] = (e) => n("close"))
|
|
4875
4873
|
}, {
|
|
4876
|
-
default: me(() => [w("div",
|
|
4874
|
+
default: me(() => [w("div", Bi, [w("div", Vi, [c[4] || (c[4] = w("span", { class: "text-[15px] font-semibold text-theme-900" }, "Share reply", -1)), w("button", {
|
|
4877
4875
|
type: "button",
|
|
4878
4876
|
"aria-label": "Close",
|
|
4879
4877
|
class: "grid size-9 cursor-pointer place-items-center rounded-full text-theme-500 transition-colors hover:bg-theme-950/5 hover:text-theme-900",
|
|
@@ -4881,13 +4879,13 @@ var qr = [
|
|
|
4881
4879
|
}, [...c[3] || (c[3] = [w("i", {
|
|
4882
4880
|
class: "i-tabler-x size-[17px]",
|
|
4883
4881
|
"aria-hidden": "true"
|
|
4884
|
-
}, null, -1)])])]), w("div",
|
|
4885
|
-
w("div",
|
|
4882
|
+
}, null, -1)])])]), w("div", Hi, [
|
|
4883
|
+
w("div", Ui, [w("div", Wi, [e.prompt ? (R(), x("div", Gi, U(e.prompt), 1)) : b("", !0), e.message ? (R(), y(ki, {
|
|
4886
4884
|
key: 1,
|
|
4887
4885
|
text: e.message.text
|
|
4888
4886
|
}, null, 8, ["text"])) : b("", !0)]), c[5] || (c[5] = w("div", { class: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-theme-25 to-transparent" }, null, -1))]),
|
|
4889
4887
|
c[8] || (c[8] = w("p", { class: "text-[13px] leading-relaxed text-theme-500" }, " Anyone with the link can see this message and reply. Messages after it stay private. ", -1)),
|
|
4890
|
-
r.value ? (R(), x("div",
|
|
4888
|
+
r.value ? (R(), x("div", Ki, [c[6] || (c[6] = w("i", {
|
|
4891
4889
|
class: "i-tabler-link size-[15px] shrink-0 text-theme-400",
|
|
4892
4890
|
"aria-hidden": "true"
|
|
4893
4891
|
}, null, -1)), w("input", {
|
|
@@ -4897,9 +4895,9 @@ var qr = [
|
|
|
4897
4895
|
"aria-label": "Share link",
|
|
4898
4896
|
class: "min-w-0 flex-1 truncate bg-transparent text-[14px] text-theme-800 outline-none",
|
|
4899
4897
|
onFocus: c[1] || (c[1] = (e) => e.target.select())
|
|
4900
|
-
}, null, 40,
|
|
4901
|
-
s.value ? (R(), x("p",
|
|
4902
|
-
w("div",
|
|
4898
|
+
}, null, 40, qi)])) : b("", !0),
|
|
4899
|
+
s.value ? (R(), x("p", Ji, U(s.value), 1)) : b("", !0),
|
|
4900
|
+
w("div", Yi, [r.value ? (R(), x("button", {
|
|
4903
4901
|
key: 0,
|
|
4904
4902
|
type: "button",
|
|
4905
4903
|
"data-test": "share-reply-delete",
|
|
@@ -4909,18 +4907,18 @@ var qr = [
|
|
|
4909
4907
|
}, [...c[7] || (c[7] = [w("i", {
|
|
4910
4908
|
class: "i-tabler-trash size-[15px]",
|
|
4911
4909
|
"aria-hidden": "true"
|
|
4912
|
-
}, null, -1), T(" Delete link ", -1)])], 8,
|
|
4910
|
+
}, null, -1), T(" Delete link ", -1)])], 8, Xi)) : b("", !0), w("button", {
|
|
4913
4911
|
type: "button",
|
|
4914
4912
|
"data-test": "share-reply-copy",
|
|
4915
4913
|
disabled: i.value || a.value,
|
|
4916
4914
|
class: "ml-auto h-11 cursor-pointer rounded-full bg-theme-900 px-5 text-[15px] font-semibold text-theme-0 transition-transform active:scale-[0.98] disabled:opacity-50",
|
|
4917
4915
|
onClick: copyLink
|
|
4918
|
-
},
|
|
4916
|
+
}, U(o.value ? "Copied" : "Copy link"), 9, Zi)])
|
|
4919
4917
|
])])]),
|
|
4920
4918
|
_: 1
|
|
4921
4919
|
}, 8, ["vis"]));
|
|
4922
4920
|
}
|
|
4923
|
-
}),
|
|
4921
|
+
}), $i = {
|
|
4924
4922
|
VOICE_MIC_UNAVAILABLE: "I couldn't reach your microphone. Check that this site is allowed to use it, then try again.",
|
|
4925
4923
|
VOICE_BOT_UNAVAILABLE: "Your assistant didn't pick up. Give it a moment and start the call again.",
|
|
4926
4924
|
VOICE_CONNECT_TIMEOUT: "The call took too long to connect. Try again in a moment.",
|
|
@@ -4929,21 +4927,20 @@ var qr = [
|
|
|
4929
4927
|
VOICE_UNAVAILABLE: "Voice isn't available right now. You can keep going by typing.",
|
|
4930
4928
|
VOICE_MINT_INVALID: "That call couldn't be started. Refresh the page and try again.",
|
|
4931
4929
|
VOICE_PROVIDER_ERROR: "The call ended unexpectedly. Try again, or keep going by typing."
|
|
4932
|
-
},
|
|
4930
|
+
}, ea = "The call ended unexpectedly. Try again, or keep going by typing.";
|
|
4933
4931
|
function voiceErrorMessage(e) {
|
|
4934
|
-
return e &&
|
|
4932
|
+
return e && $i[e] || ea;
|
|
4935
4933
|
}
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
var Yi = [
|
|
4934
|
+
// bot/ui/VoiceHistogramController.ts
|
|
4935
|
+
var ta = [
|
|
4939
4936
|
0,
|
|
4940
4937
|
2,
|
|
4941
4938
|
4,
|
|
4942
4939
|
6,
|
|
4943
4940
|
8
|
|
4944
|
-
],
|
|
4941
|
+
], na = 5, ra = 33, ia = .7, aa = .1, oa = 60, sa = 320, ca = .55, la = .1, ua = .32, da = .9, fa = ta.map(() => 0), pa = ta.map(() => na), VoiceHistogramController = class {
|
|
4945
4942
|
constructor(e = typeof window > "u" ? void 0 : window) {
|
|
4946
|
-
t(this, "browser", void 0), t(this, "heights",
|
|
4943
|
+
t(this, "browser", void 0), t(this, "heights", H(pa)), t(this, "targetBars", fa), t(this, "displayBars", fa), t(this, "level", {
|
|
4947
4944
|
source: "mic",
|
|
4948
4945
|
level: 0
|
|
4949
4946
|
}), t(this, "isMuted", !1), t(this, "usesIdleWave", !1), t(this, "frameId", 0), t(this, "lastFrameAt", 0), t(this, "easeFrame", (e) => {
|
|
@@ -4952,12 +4949,12 @@ var Yi = [
|
|
|
4952
4949
|
this.frameId = 0;
|
|
4953
4950
|
let n = Math.min(64, Math.max(0, e - this.lastFrameAt));
|
|
4954
4951
|
this.lastFrameAt = e;
|
|
4955
|
-
let r = this.usesIdleWave ?
|
|
4956
|
-
let r = e / 1e3 *
|
|
4957
|
-
return
|
|
4952
|
+
let r = this.usesIdleWave ? ta.map((t, n) => {
|
|
4953
|
+
let r = e / 1e3 * ca * 2 * Math.PI - n * da;
|
|
4954
|
+
return la + ua * (Math.sin(r) + 1) / 2;
|
|
4958
4955
|
}) : this.targetBars;
|
|
4959
4956
|
this.displayBars = this.displayBars.map((e, t) => {
|
|
4960
|
-
let i = r[t] ?? 0, a = i > e ?
|
|
4957
|
+
let i = r[t] ?? 0, a = i > e ? oa : sa;
|
|
4961
4958
|
return e + (i - e) * (1 - Math.exp(-n / a));
|
|
4962
4959
|
}), this.publish();
|
|
4963
4960
|
let i = this.displayBars.every((e, t) => Math.abs((r[t] ?? 0) - e) <= 5e-4);
|
|
@@ -4977,20 +4974,16 @@ var Yi = [
|
|
|
4977
4974
|
this.frameId && this.browser?.cancelAnimationFrame(this.frameId), this.frameId = 0;
|
|
4978
4975
|
}
|
|
4979
4976
|
updateTargets() {
|
|
4980
|
-
let gate = (e) => Math.max(0, e -
|
|
4981
|
-
this.targetBars =
|
|
4977
|
+
let gate = (e) => Math.max(0, e - aa) / .9, e = this.isMuted && this.level.source === "mic";
|
|
4978
|
+
this.targetBars = ta.map((t) => e ? 0 : gate(Math.min(1, Math.max(0, this.level.bands?.[t] ?? this.level.level)))), this.start();
|
|
4982
4979
|
}
|
|
4983
4980
|
start() {
|
|
4984
|
-
|
|
4985
|
-
this.displayBars = this.usesIdleWave ? oa : this.targetBars, this.publish();
|
|
4986
|
-
return;
|
|
4987
|
-
}
|
|
4988
|
-
this.frameId || (this.lastFrameAt = this.browser.performance.now(), this.frameId = this.browser.requestAnimationFrame(this.easeFrame));
|
|
4981
|
+
!this.browser || this.browser.matchMedia("(prefers-reduced-motion: reduce)").matches ? (this.displayBars = this.usesIdleWave ? fa : this.targetBars, this.publish()) : this.frameId || (this.lastFrameAt = this.browser.performance.now(), this.frameId = this.browser.requestAnimationFrame(this.easeFrame));
|
|
4989
4982
|
}
|
|
4990
4983
|
publish() {
|
|
4991
|
-
this.heights.value = this.displayBars.map((e) => Math.round((
|
|
4984
|
+
this.heights.value = this.displayBars.map((e) => Math.round((na + Math.min(1, Math.max(0, e)) ** ia * ra) * 10) / 10);
|
|
4992
4985
|
}
|
|
4993
|
-
},
|
|
4986
|
+
}, ma = {
|
|
4994
4987
|
connecting: {
|
|
4995
4988
|
label: "Connecting",
|
|
4996
4989
|
tone: "bg-amber-500",
|
|
@@ -5028,7 +5021,7 @@ function deriveActivity(e) {
|
|
|
5028
5021
|
return e.hadError ? "error" : e.sessionState === "live" ? e.speaking.bot ? "speaking" : e.speaking.user ? "listening" : e.work.active ? "working" : e.providerThinking ? "thinking" : "listening" : "connecting";
|
|
5029
5022
|
}
|
|
5030
5023
|
function deriveVoiceModePresentation(e) {
|
|
5031
|
-
let t = deriveActivity(e), n =
|
|
5024
|
+
let t = deriveActivity(e), n = ma[t], r = t === "working" ? e.work.description || "Working on it" : n.label, i = t === "working" ? r : n.visibleText ?? "", a = e.takingLonger && (t === "thinking" || t === "working"), o = a ? `${i} ${K.slowHint}` : i;
|
|
5032
5025
|
return {
|
|
5033
5026
|
activity: t,
|
|
5034
5027
|
label: a ? o : r,
|
|
@@ -5038,34 +5031,33 @@ function deriveVoiceModePresentation(e) {
|
|
|
5038
5031
|
takingLonger: a
|
|
5039
5032
|
};
|
|
5040
5033
|
}
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
5034
|
+
// bot/ui/VoiceMode.vue?vue&type=script&setup=true&lang.ts
|
|
5035
|
+
var ha = ["data-voice-state", "data-voice-activity"], ga = ["src"], _a = {
|
|
5044
5036
|
key: 1,
|
|
5045
5037
|
"data-test": "voice-background-fallback",
|
|
5046
5038
|
"aria-hidden": "true",
|
|
5047
5039
|
class: "pointer-events-none absolute inset-0 bg-[#0A1522]"
|
|
5048
|
-
},
|
|
5040
|
+
}, va = {
|
|
5049
5041
|
"data-test": "voice-stage",
|
|
5050
5042
|
class: "relative z-10 flex flex-1 flex-col items-center px-8"
|
|
5051
|
-
},
|
|
5043
|
+
}, ya = { "data-voice-assistant-avatar": "" }, ba = {
|
|
5052
5044
|
"data-test": "voice-lower-stage",
|
|
5053
5045
|
class: "flex flex-1 flex-col items-center pt-10"
|
|
5054
|
-
},
|
|
5046
|
+
}, xa = {
|
|
5055
5047
|
"data-test": "voice-histogram",
|
|
5056
5048
|
"aria-hidden": "true",
|
|
5057
5049
|
class: "flex h-[38px] items-center gap-[5px]"
|
|
5058
|
-
},
|
|
5050
|
+
}, Sa = {
|
|
5059
5051
|
"data-test": "voice-presence-status",
|
|
5060
5052
|
role: "status",
|
|
5061
5053
|
"aria-live": "polite",
|
|
5062
5054
|
class: "sr-only"
|
|
5063
|
-
},
|
|
5055
|
+
}, Ca = ["data-taking-longer"], wa = { class: "absolute inset-x-0 bottom-0 z-20 flex items-center justify-between px-14 pb-[max(3rem,env(safe-area-inset-bottom))] sm:px-12" }, Ta = [
|
|
5064
5056
|
"disabled",
|
|
5065
5057
|
"aria-label",
|
|
5066
5058
|
"aria-pressed",
|
|
5067
5059
|
"title"
|
|
5068
|
-
],
|
|
5060
|
+
], Ea = /* @__PURE__ */ D({
|
|
5069
5061
|
__name: "VoiceMode",
|
|
5070
5062
|
props: {
|
|
5071
5063
|
bot: {},
|
|
@@ -5075,10 +5067,10 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5075
5067
|
},
|
|
5076
5068
|
emits: ["end"],
|
|
5077
5069
|
setup(e, { expose: t, emit: n }) {
|
|
5078
|
-
let r = n, i =
|
|
5070
|
+
let r = n, i = H(!1), a = H(), o = H(!1), s = H({
|
|
5079
5071
|
user: !1,
|
|
5080
5072
|
bot: !1
|
|
5081
|
-
}), c =
|
|
5073
|
+
}), c = H({ active: !1 }), d = H(!1), f = H(!1), p = H(), g = v(() => p.value?.state.value ?? "idle"), _ = v(() => p.value?.isMuted.value ?? !1), y = new VoiceHistogramController(), b = y.heights, T = fe("endButton"), D = fe("muteButton"), A = !1, ee, M, te, B = v(() => deriveVoiceModePresentation({
|
|
5082
5074
|
sessionState: g.value,
|
|
5083
5075
|
hadError: i.value,
|
|
5084
5076
|
providerThinking: o.value,
|
|
@@ -5090,10 +5082,10 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5090
5082
|
if (B.value.activity === "thinking") return "thinking";
|
|
5091
5083
|
if (B.value.activity === "working") return `working:${c.value.description ?? ""}`;
|
|
5092
5084
|
});
|
|
5093
|
-
|
|
5085
|
+
G(() => B.value.usesIdleWave, (e) => y.setIdleWave(e), { immediate: !0 }), G(_, (e) => y.setMuted(e), { immediate: !0 }), G(ce, (e) => {
|
|
5094
5086
|
te && clearTimeout(te), d.value = !1, e && (te = setTimeout(() => {
|
|
5095
5087
|
te = void 0, d.value = !0;
|
|
5096
|
-
},
|
|
5088
|
+
}, Ee), te.unref?.());
|
|
5097
5089
|
}, { immediate: !0 });
|
|
5098
5090
|
async function end() {
|
|
5099
5091
|
A = !0, await p.value?.end();
|
|
@@ -5138,11 +5130,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5138
5130
|
e.chatController?.logger?.info(t.name, { durationMs: t.durationMs });
|
|
5139
5131
|
}
|
|
5140
5132
|
});
|
|
5141
|
-
|
|
5142
|
-
emitEnd();
|
|
5143
|
-
return;
|
|
5144
|
-
}
|
|
5145
|
-
p.value = t, await t.start();
|
|
5133
|
+
t ? (p.value = t, await t.start()) : emitEnd();
|
|
5146
5134
|
}), ae(() => {
|
|
5147
5135
|
A = !0, M && clearTimeout(M), te && clearTimeout(te), y.stop(), p.value?.end();
|
|
5148
5136
|
}), (t, n) => (R(), x("div", {
|
|
@@ -5160,42 +5148,42 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5160
5148
|
"aria-hidden": "true",
|
|
5161
5149
|
draggable: "false",
|
|
5162
5150
|
class: "pointer-events-none absolute inset-0 size-full object-cover"
|
|
5163
|
-
}, null, 8,
|
|
5151
|
+
}, null, 8, ga)) : (R(), x("div", _a)),
|
|
5164
5152
|
n[2] || (n[2] = w("div", {
|
|
5165
5153
|
"data-test": "voice-background-overlay",
|
|
5166
5154
|
"aria-hidden": "true",
|
|
5167
5155
|
class: "pointer-events-none absolute inset-0 bg-gradient-to-b from-[#050F19]/82 via-[#050F19]/90 to-[#050F19]/99"
|
|
5168
5156
|
}, null, -1)),
|
|
5169
|
-
w("div",
|
|
5157
|
+
w("div", va, [
|
|
5170
5158
|
n[0] || (n[0] = w("div", {
|
|
5171
5159
|
"data-test": "voice-stage-spacer",
|
|
5172
5160
|
"aria-hidden": "true",
|
|
5173
5161
|
class: "flex-1"
|
|
5174
5162
|
}, null, -1)),
|
|
5175
|
-
w("div",
|
|
5163
|
+
w("div", ya, [E(qe, {
|
|
5176
5164
|
bot: e.bot,
|
|
5177
5165
|
"show-status": !1,
|
|
5178
5166
|
"show-owner-mark": !1,
|
|
5179
5167
|
"is-light": !1,
|
|
5180
5168
|
class: "size-32"
|
|
5181
5169
|
}, null, 8, ["bot"])]),
|
|
5182
|
-
w("div",
|
|
5183
|
-
w("div",
|
|
5170
|
+
w("div", ba, [
|
|
5171
|
+
w("div", xa, [(R(!0), x(m, null, V(ue(b), (e, t) => (R(), x("span", {
|
|
5184
5172
|
key: t,
|
|
5185
5173
|
"data-test": "voice-histogram-bar",
|
|
5186
5174
|
class: j(["w-[5px] rounded-full transition-colors duration-150", B.value.tone]),
|
|
5187
5175
|
style: N({ height: `${e}px` })
|
|
5188
5176
|
}, null, 6))), 128))]),
|
|
5189
|
-
w("div",
|
|
5177
|
+
w("div", Sa, U(a.value ?? B.value.label), 1),
|
|
5190
5178
|
w("p", {
|
|
5191
5179
|
"data-test": "voice-visible-status",
|
|
5192
5180
|
"data-taking-longer": B.value.takingLonger || void 0,
|
|
5193
5181
|
"aria-hidden": "true",
|
|
5194
5182
|
class: "mt-5 min-h-5 text-center text-sm font-medium tracking-wide text-white/80"
|
|
5195
|
-
},
|
|
5183
|
+
}, U(a.value ?? B.value.visibleStatus), 9, Ca)
|
|
5196
5184
|
])
|
|
5197
5185
|
]),
|
|
5198
|
-
w("div",
|
|
5186
|
+
w("div", wa, [w("button", {
|
|
5199
5187
|
ref_key: "endButton",
|
|
5200
5188
|
ref: T,
|
|
5201
5189
|
type: "button",
|
|
@@ -5221,28 +5209,28 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5221
5209
|
}, [w("i", {
|
|
5222
5210
|
class: j([_.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
|
|
5223
5211
|
"aria-hidden": "true"
|
|
5224
|
-
}, null, 2)], 10,
|
|
5225
|
-
], 40,
|
|
5212
|
+
}, null, 2)], 10, Ta)])
|
|
5213
|
+
], 40, ha));
|
|
5226
5214
|
}
|
|
5227
|
-
}),
|
|
5215
|
+
}), Da = {
|
|
5228
5216
|
key: 0,
|
|
5229
5217
|
class: "pb-4"
|
|
5230
|
-
},
|
|
5218
|
+
}, Oa = {
|
|
5231
5219
|
key: 1,
|
|
5232
5220
|
"data-test": "messaging-sdk-header",
|
|
5233
5221
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
5234
|
-
},
|
|
5222
|
+
}, ka = { class: "min-w-0 flex-1" }, Aa = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, ja = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, Ma = {
|
|
5235
5223
|
key: 0,
|
|
5236
5224
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
5237
|
-
},
|
|
5225
|
+
}, Na = ["aria-label"], Pa = {
|
|
5238
5226
|
key: 0,
|
|
5239
5227
|
"data-test": "messaging-empty-state",
|
|
5240
5228
|
class: "flex flex-col items-center justify-center px-4"
|
|
5241
|
-
},
|
|
5229
|
+
}, Fa = ["title"], Ia = {
|
|
5242
5230
|
key: 0,
|
|
5243
5231
|
"data-test": "messaging-time-divider",
|
|
5244
5232
|
class: "flex items-center gap-3 py-3 px-2"
|
|
5245
|
-
},
|
|
5233
|
+
}, La = ["data-journal-outcome"], Ra = [
|
|
5246
5234
|
"data-message-id",
|
|
5247
5235
|
"data-message-sender",
|
|
5248
5236
|
"data-conversation-id",
|
|
@@ -5253,7 +5241,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5253
5241
|
"data-issue-action-label",
|
|
5254
5242
|
"data-issue-action-url",
|
|
5255
5243
|
"data-streaming"
|
|
5256
|
-
],
|
|
5244
|
+
], za = { class: "flex items-center gap-3" }, Ba = ["href"], Va = [
|
|
5257
5245
|
"data-test",
|
|
5258
5246
|
"data-message-id",
|
|
5259
5247
|
"data-message-sender",
|
|
@@ -5261,7 +5249,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5261
5249
|
"data-message-sequence",
|
|
5262
5250
|
"data-system-kind",
|
|
5263
5251
|
"data-routine-run-id"
|
|
5264
|
-
],
|
|
5252
|
+
], Ha = [
|
|
5265
5253
|
"data-message-id",
|
|
5266
5254
|
"data-message-sender",
|
|
5267
5255
|
"data-conversation-id",
|
|
@@ -5270,7 +5258,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5270
5258
|
"data-issue-code",
|
|
5271
5259
|
"data-issue-bucket",
|
|
5272
5260
|
"data-streaming"
|
|
5273
|
-
],
|
|
5261
|
+
], Ua = [
|
|
5274
5262
|
"data-test",
|
|
5275
5263
|
"data-message-id",
|
|
5276
5264
|
"data-message-sender",
|
|
@@ -5280,63 +5268,63 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5280
5268
|
"data-streaming",
|
|
5281
5269
|
"data-queued",
|
|
5282
5270
|
"aria-label"
|
|
5283
|
-
],
|
|
5271
|
+
], Wa = ["data-routine-run-id"], Ga = ["src", "alt"], Ka = ["src"], qa = ["href"], Ja = {
|
|
5284
5272
|
key: 0,
|
|
5285
5273
|
"data-test": "messaging-message-text-part"
|
|
5286
|
-
},
|
|
5274
|
+
}, Ya = [
|
|
5287
5275
|
"src",
|
|
5288
5276
|
"alt",
|
|
5289
5277
|
"data-attachment-placement"
|
|
5290
|
-
],
|
|
5278
|
+
], Xa = ["src", "data-attachment-placement"], Za = ["href", "data-attachment-placement"], Qa = ["data-actions-reveal"], $a = [
|
|
5291
5279
|
"data-copied",
|
|
5292
5280
|
"title",
|
|
5293
5281
|
"aria-label",
|
|
5294
5282
|
"onClick"
|
|
5295
|
-
],
|
|
5283
|
+
], eo = ["onClick"], to = ["onClick"], no = ["data-journal-outcome"], ro = ["data-journal-outcome"], io = ["data-test", "data-working-description"], ao = {
|
|
5296
5284
|
key: 0,
|
|
5297
5285
|
class: "truncate"
|
|
5298
|
-
},
|
|
5286
|
+
}, oo = {
|
|
5299
5287
|
key: 1,
|
|
5300
5288
|
class: "sr-only"
|
|
5301
|
-
},
|
|
5289
|
+
}, so = ["data-issue-code"], co = { class: "min-w-0 flex-1" }, lo = {
|
|
5302
5290
|
"data-test": "messaging-transient-issue-title",
|
|
5303
5291
|
class: "font-medium"
|
|
5304
|
-
},
|
|
5292
|
+
}, uo = { "data-test": "messaging-transient-issue-help" }, fo = ["href"], po = ["inert", "aria-hidden"], mo = ["data-seat-state"], ho = ["src", "alt"], go = { class: "max-w-20 truncate" }, _o = ["onClick"], vo = {
|
|
5305
5293
|
key: 0,
|
|
5306
5294
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
5307
|
-
},
|
|
5295
|
+
}, yo = ["data-composer-action"], bo = ["placeholder", "disabled"], xo = { class: "font-mono text-sm tabular-nums" }, So = { class: "mt-2.5 flex items-center" }, Co = [
|
|
5308
5296
|
"disabled",
|
|
5309
5297
|
"aria-label",
|
|
5310
5298
|
"title"
|
|
5311
|
-
],
|
|
5299
|
+
], wo = {
|
|
5312
5300
|
key: 0,
|
|
5313
5301
|
class: "i-svg-spinners-ring-resize size-5"
|
|
5314
|
-
},
|
|
5302
|
+
}, To = {
|
|
5315
5303
|
key: 1,
|
|
5316
5304
|
class: "i-tabler-plus size-5"
|
|
5317
|
-
},
|
|
5305
|
+
}, Eo = { class: "sr-only" }, Do = { class: "flex items-center gap-2" }, Oo = ["aria-label", "title"], ko = { class: "sr-only" }, Ao = [
|
|
5318
5306
|
"disabled",
|
|
5319
5307
|
"aria-label",
|
|
5320
5308
|
"title"
|
|
5321
|
-
],
|
|
5309
|
+
], jo = {
|
|
5322
5310
|
class: "flex h-4 items-center gap-[2px]",
|
|
5323
5311
|
"aria-hidden": "true"
|
|
5324
|
-
},
|
|
5312
|
+
}, Mo = [
|
|
5325
5313
|
"data-composer-action",
|
|
5326
5314
|
"disabled",
|
|
5327
5315
|
"aria-label",
|
|
5328
5316
|
"title"
|
|
5329
|
-
],
|
|
5317
|
+
], No = {
|
|
5330
5318
|
key: 0,
|
|
5331
5319
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
5332
|
-
},
|
|
5320
|
+
}, Po = {
|
|
5333
5321
|
key: 1,
|
|
5334
5322
|
class: "i-tabler-arrow-up size-[17px]"
|
|
5335
|
-
},
|
|
5323
|
+
}, Fo = { class: "sr-only" }, Io = {
|
|
5336
5324
|
key: 2,
|
|
5337
5325
|
"data-test": "messaging-ai-notice",
|
|
5338
5326
|
class: "mx-auto max-w-[640px] @5xl/chat:max-w-[720px] pt-3 text-center text-[11.5px] leading-none text-theme-300"
|
|
5339
|
-
},
|
|
5327
|
+
}, Lo = /*#__PURE__*/ ve(/* @__PURE__ */ D({
|
|
5340
5328
|
__name: "ElBotChat",
|
|
5341
5329
|
props: {
|
|
5342
5330
|
chatController: {},
|
|
@@ -5381,7 +5369,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5381
5369
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
5382
5370
|
}
|
|
5383
5371
|
function isSystemExplainerMessage(e) {
|
|
5384
|
-
return e.sender === "system" && (!!e.issue || e.id ===
|
|
5372
|
+
return e.sender === "system" && (!!e.issue || e.id === ye.value);
|
|
5385
5373
|
}
|
|
5386
5374
|
function isGroupEnd(e, t) {
|
|
5387
5375
|
let n = e[t], r = e[t + 1];
|
|
@@ -5397,11 +5385,11 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5397
5385
|
return g.value.length && A.value ? t.filter((e) => e.id !== A.value) : t;
|
|
5398
5386
|
}), te = v(() => {
|
|
5399
5387
|
if (!e.chatController?.workJournal?.value) return c.value?.workingDescription?.trim() || void 0;
|
|
5400
|
-
}),
|
|
5401
|
-
if (!
|
|
5388
|
+
}), le = v(() => e.chatController?.workJournal?.value), ue = v(() => {
|
|
5389
|
+
if (!le.value && !g.value.length) return;
|
|
5402
5390
|
let e = M.value, t = e[e.length - 1];
|
|
5403
5391
|
if (t) return t.sender === "bot" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
5404
|
-
}),
|
|
5392
|
+
}), fe = v(() => {
|
|
5405
5393
|
let t = {};
|
|
5406
5394
|
for (let n of M.value) {
|
|
5407
5395
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
@@ -5415,7 +5403,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5415
5403
|
return t;
|
|
5416
5404
|
});
|
|
5417
5405
|
function messageWorkJournal(e) {
|
|
5418
|
-
return
|
|
5406
|
+
return fe.value[e.id];
|
|
5419
5407
|
}
|
|
5420
5408
|
function inlineOffset(e, t) {
|
|
5421
5409
|
return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
|
|
@@ -5463,135 +5451,125 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5463
5451
|
text: t.slice(i)
|
|
5464
5452
|
}), r;
|
|
5465
5453
|
}
|
|
5466
|
-
let
|
|
5454
|
+
let ve = v(() => c.value?.transientIssue), ye = v(() => {
|
|
5467
5455
|
if (!f.value) return;
|
|
5468
5456
|
let e = M.value, t = e[e.length - 1];
|
|
5469
5457
|
return t?.sender === "bot" || t?.sender === "system" ? t.id : void 0;
|
|
5470
|
-
}),
|
|
5471
|
-
if (
|
|
5458
|
+
}), xe = v(() => !f.value || te.value || le.value || g.value.length ? !1 : ye.value === void 0), Ce = v(() => !!te.value || xe.value), K = v(() => c.value?.sendBlockedReason), Ee = v(() => K.value === "bot_deleted"), J = v(() => p.value ? "Connecting..." : K.value === "bot_deleted" ? "This assistant was deleted" : "Send a message"), De = v(() => s(e.bot.state.value)), ke = v(() => {
|
|
5459
|
+
if (ot.value || !De.value || De.value === "awake") return;
|
|
5472
5460
|
let t = e.bot.displayName.value || e.bot.name.value || "Your assistant";
|
|
5473
|
-
return
|
|
5474
|
-
}),
|
|
5461
|
+
return De.value === "changing" ? `${t} will be right back…` : De.value === "stuck" ? `${t} needs attention.` : `${t} is ${r[De.value].toLowerCase()}.`;
|
|
5462
|
+
}), Ae = v(() => e.chatController?.composerState?.value ?? {
|
|
5475
5463
|
text: "",
|
|
5476
5464
|
pendingAttachments: [],
|
|
5477
5465
|
isUploading: !1
|
|
5478
|
-
}),
|
|
5479
|
-
get: () =>
|
|
5466
|
+
}), je = v({
|
|
5467
|
+
get: () => Ae.value.text,
|
|
5480
5468
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
5481
|
-
}),
|
|
5469
|
+
}), Me = v(() => Ae.value.pendingAttachments), Ne = v(() => Ae.value.isUploading), Pe = v(() => e.chatController?.voiceRecorder), Fe = v(() => Pe.value?.isBusy.value ?? !1), Ie = v(() => e.chatController?.canAttachFile?.value ?? !1), Le = v(() => e.chatController?.canRecordAudio?.value ?? !1), ze = v(() => e.chatController?.composerAction?.value ?? "idle"), Be = v(() => ze.value !== "idle"), Ve = v(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), Ue = v(() => e.chatController?.queuedMessageIds?.value);
|
|
5482
5470
|
function isQueuedMessage(e) {
|
|
5483
|
-
return
|
|
5471
|
+
return Ue.value?.has(e) ?? !1;
|
|
5484
5472
|
}
|
|
5485
|
-
let
|
|
5473
|
+
let We = B(), Ge;
|
|
5486
5474
|
function canCopyMessage(e) {
|
|
5487
|
-
return e.sender === "bot" && e.id !==
|
|
5475
|
+
return e.sender === "bot" && e.id !== ye.value && !!e.text?.trim();
|
|
5488
5476
|
}
|
|
5489
|
-
let
|
|
5477
|
+
let Ke = v(() => [...M.value].reverse().find(canCopyMessage)?.id);
|
|
5490
5478
|
async function copyMessage(t) {
|
|
5491
5479
|
try {
|
|
5492
|
-
await navigator.clipboard.writeText(t.text),
|
|
5493
|
-
|
|
5480
|
+
await navigator.clipboard.writeText(t.text), We.value = t.id, clearTimeout(Ge), Ge = setTimeout(() => {
|
|
5481
|
+
We.value = void 0;
|
|
5494
5482
|
}, 1500);
|
|
5495
5483
|
} catch (t) {
|
|
5496
5484
|
console.warn("ElBotChat: copy to clipboard rejected", t), e.chatController?.notify?.("Could not copy that message.");
|
|
5497
5485
|
}
|
|
5498
5486
|
}
|
|
5499
|
-
ae(() => clearTimeout(
|
|
5500
|
-
let
|
|
5501
|
-
let e =
|
|
5487
|
+
ae(() => clearTimeout(Ge));
|
|
5488
|
+
let Je = v(() => e.chatController?.canReportMessages ?? !1), Ye = v(() => e.chatController?.messageShare), Xe = B(), Ze = v(() => {
|
|
5489
|
+
let e = Xe.value;
|
|
5502
5490
|
if (!e) return;
|
|
5503
5491
|
let t = M.value, n = t.findIndex((t) => t.id === e.id);
|
|
5504
5492
|
return t.slice(0, Math.max(n, 0)).reverse().find((e) => e.sender === "user")?.text;
|
|
5505
|
-
}),
|
|
5506
|
-
let e =
|
|
5507
|
-
return e === "preparing" || e === "sending" ?
|
|
5508
|
-
}),
|
|
5509
|
-
|
|
5510
|
-
let n = ++
|
|
5511
|
-
if (
|
|
5493
|
+
}), Qe = v(() => ze.value === "stop" ? "Stop reply" : Ve.value ? "Send — answered after current work" : "Send message"), $e = v(() => Le.value && !Fe.value && !!Pe.value?.canUseBrowserRecording), et = v(() => Pe.value?.isActive.value ?? !1), tt = v(() => Pe.value?.state.value.phase === "sending"), rt = v(() => Pe.value?.elapsedLabel.value ?? "0:00"), it = v(() => {
|
|
5494
|
+
let e = Pe.value?.state.value.phase;
|
|
5495
|
+
return e === "preparing" || e === "sending" ? Pe.value?.statusText.value ?? "Starting microphone" : ht.value ? "Release to send" : "Click mic to send";
|
|
5496
|
+
}), at = v(() => Pe.value?.state.value.phase === "sending" ? "Sending voice message" : et.value ? ht.value ? "Release to send voice message" : "Stop and send voice message" : "Record voice message"), ot = B(!1), st = B(), Y = B(), X = B(), ct = 0, lt = v(() => e.chatController?.canStartVoice?.value ?? !1);
|
|
5497
|
+
G([() => e.bot.avatar.value?.src, lt], ([e, t]) => {
|
|
5498
|
+
let n = ++ct;
|
|
5499
|
+
if (X.value = void 0, !t || !e || typeof Image > "u") return;
|
|
5512
5500
|
let r = new Image();
|
|
5513
5501
|
r.onload = () => {
|
|
5514
|
-
n ===
|
|
5502
|
+
n === ct && (X.value = e);
|
|
5515
5503
|
}, r.src = e;
|
|
5516
5504
|
}, { immediate: !0 });
|
|
5517
|
-
let
|
|
5505
|
+
let ut = v(() => lt.value && !ot.value && !et.value && ze.value === "idle"), dt = v(() => !d.value), ft = v(() => dt.value ? `Voice available when ${e.bot.displayName.value || e.bot.name.value || "the assistant"} is awake` : "Start voice conversation");
|
|
5518
5506
|
function startVoiceConversation() {
|
|
5519
|
-
|
|
5507
|
+
ut.value && !dt.value && (Y.value = X.value, ot.value = !0);
|
|
5520
5508
|
}
|
|
5521
5509
|
async function endVoiceConversation(t) {
|
|
5522
|
-
if (!
|
|
5523
|
-
let n =
|
|
5524
|
-
|
|
5510
|
+
if (!ot.value) return;
|
|
5511
|
+
let n = st.value;
|
|
5512
|
+
ot.value = !1, Y.value = void 0, await ee(), await n?.end(), window.matchMedia("(pointer: coarse)").matches || a.value?.focus(), await e.chatController?.refreshMessages(), t && e.chatController?.notify(voiceEndNotice(t, e.bot.displayName.value || e.bot.name.value || "Your assistant"), { systemKind: "voice_ended" });
|
|
5525
5513
|
}
|
|
5526
|
-
let
|
|
5514
|
+
let Z = v(() => e.variant === "light"), pt = v(() => Z.value ? "bg-theme-200/70" : "bg-white/15"), mt = v(() => Z.value ? "text-theme-300" : "text-white/30");
|
|
5527
5515
|
ne(async () => {
|
|
5528
5516
|
e.chatController && !d.value && await e.chatController.startTextConversation();
|
|
5529
5517
|
}), ae(() => {
|
|
5530
5518
|
e.chatController?.voiceRecorder?.teardown();
|
|
5531
5519
|
});
|
|
5532
5520
|
async function sendMessage() {
|
|
5533
|
-
e.chatController &&
|
|
5521
|
+
e.chatController && ze.value === "send" && (a.value && (a.value.style.height = "auto", window.matchMedia("(pointer: coarse)").matches ? (a.value.blur(), requestAnimationFrame(() => {
|
|
5534
5522
|
let e = document.activeElement;
|
|
5535
5523
|
e && (e.tagName === "TEXTAREA" || e.tagName === "INPUT") && e.blur();
|
|
5536
5524
|
})) : a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
|
|
5537
5525
|
}
|
|
5538
5526
|
async function handleCardAction(t) {
|
|
5539
|
-
e.chatController && !
|
|
5527
|
+
e.chatController && !Ee.value && (i.value?.pin(), await e.chatController.sendChatMessage(t));
|
|
5540
5528
|
}
|
|
5541
5529
|
async function handleComposerAction() {
|
|
5542
|
-
|
|
5543
|
-
if (Le.value === "send") {
|
|
5544
|
-
await sendMessage();
|
|
5545
|
-
return;
|
|
5546
|
-
}
|
|
5547
|
-
await e.chatController.handleComposerAction();
|
|
5548
|
-
}
|
|
5530
|
+
e.chatController && (ze.value === "send" ? await sendMessage() : await e.chatController.handleComposerAction());
|
|
5549
5531
|
}
|
|
5550
5532
|
async function handleKeydown(e) {
|
|
5551
5533
|
e.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
|
|
5552
5534
|
}
|
|
5553
5535
|
function focusComposer(e) {
|
|
5554
|
-
|
|
5536
|
+
et.value || Ee.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
|
|
5555
5537
|
}
|
|
5556
5538
|
function adjustTextareaHeight() {
|
|
5557
5539
|
a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
|
|
5558
5540
|
}
|
|
5559
|
-
|
|
5541
|
+
G(je, () => ee(() => adjustTextareaHeight()));
|
|
5560
5542
|
function triggerFileInput() {
|
|
5561
5543
|
o.value?.click();
|
|
5562
5544
|
}
|
|
5563
5545
|
async function handleFileSelect(t) {
|
|
5564
5546
|
let n = t.target, r = n.files?.[0];
|
|
5565
|
-
r && e.chatController && !
|
|
5547
|
+
r && e.chatController && !Fe.value && (await e.chatController.attachFile({ file: r }), n.value = "");
|
|
5566
5548
|
}
|
|
5567
5549
|
function removeAttachment(t) {
|
|
5568
5550
|
e.chatController?.removeAttachment({ index: t });
|
|
5569
5551
|
}
|
|
5570
5552
|
function startRecording() {
|
|
5571
|
-
|
|
5553
|
+
Pe.value?.start();
|
|
5572
5554
|
}
|
|
5573
5555
|
function finishRecording(e) {
|
|
5574
|
-
|
|
5556
|
+
Pe.value?.finish(e);
|
|
5575
5557
|
}
|
|
5576
|
-
let
|
|
5558
|
+
let ht = H(!1), gt = !1;
|
|
5577
5559
|
function onRecordPointerDown(e) {
|
|
5578
|
-
e.pointerType === "touch" && (
|
|
5560
|
+
e.pointerType === "touch" && (gt = !0, ht.value = !0, e.currentTarget.setPointerCapture?.(e.pointerId), startRecording());
|
|
5579
5561
|
}
|
|
5580
5562
|
function onRecordPointerUp(e) {
|
|
5581
|
-
e.pointerType === "touch" &&
|
|
5563
|
+
e.pointerType === "touch" && ht.value && (ht.value = !1, finishRecording({ cancelled: !1 }));
|
|
5582
5564
|
}
|
|
5583
5565
|
function onRecordPointerCancel(e) {
|
|
5584
|
-
e.pointerType === "touch" &&
|
|
5566
|
+
e.pointerType === "touch" && ht.value && (ht.value = !1, gt = !1, finishRecording({ cancelled: !0 }));
|
|
5585
5567
|
}
|
|
5586
5568
|
function toggleRecording() {
|
|
5587
|
-
|
|
5569
|
+
et.value ? finishRecording({ cancelled: !1 }) : startRecording();
|
|
5588
5570
|
}
|
|
5589
5571
|
function onRecordClick() {
|
|
5590
|
-
|
|
5591
|
-
ht = !1;
|
|
5592
|
-
return;
|
|
5593
|
-
}
|
|
5594
|
-
toggleRecording();
|
|
5572
|
+
gt ? gt = !1 : toggleRecording();
|
|
5595
5573
|
}
|
|
5596
5574
|
function shouldShowTimeDivider(e, t) {
|
|
5597
5575
|
if (t === 0) {
|
|
@@ -5624,20 +5602,20 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5624
5602
|
"data-test": "messaging-root",
|
|
5625
5603
|
class: j(["@container/chat relative flex h-full flex-col", M.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
|
|
5626
5604
|
}, [
|
|
5627
|
-
e.showHeader && !
|
|
5605
|
+
e.showHeader && !Z.value ? (R(), x("div", Da, [E(He, {
|
|
5628
5606
|
bot: e.bot,
|
|
5629
5607
|
"is-online": d.value
|
|
5630
|
-
}, null, 8, ["bot", "is-online"])])) : e.showHeader ? (R(), x("div",
|
|
5631
|
-
E(
|
|
5608
|
+
}, null, 8, ["bot", "is-online"])])) : e.showHeader ? (R(), x("div", Oa, [w("div", { class: j(["flex items-center gap-3", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""]) }, [
|
|
5609
|
+
E(qe, {
|
|
5632
5610
|
bot: e.bot,
|
|
5633
|
-
"is-light":
|
|
5611
|
+
"is-light": Z.value,
|
|
5634
5612
|
class: "size-10"
|
|
5635
5613
|
}, null, 8, ["bot", "is-light"]),
|
|
5636
|
-
w("div",
|
|
5637
|
-
e.headerMeta ? (R(), x("span",
|
|
5614
|
+
w("div", ka, [w("div", Aa, U(e.bot.displayName.value), 1), w("div", ja, U(e.bot.title.value || "Assistant"), 1)]),
|
|
5615
|
+
e.headerMeta ? (R(), x("span", Ma, U(e.headerMeta), 1)) : b("", !0)
|
|
5638
5616
|
], 2)])) : b("", !0),
|
|
5639
5617
|
E(_, { name: "voice-call" }, {
|
|
5640
|
-
default: me(() => [
|
|
5618
|
+
default: me(() => [ot.value ? (R(), x("div", {
|
|
5641
5619
|
key: 0,
|
|
5642
5620
|
"data-test": "voice-call-overlay",
|
|
5643
5621
|
role: "dialog",
|
|
@@ -5645,12 +5623,12 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5645
5623
|
"aria-label": `Voice conversation with ${e.bot.displayName.value}`,
|
|
5646
5624
|
class: "fixed inset-0 z-[100] flex items-stretch justify-stretch bg-[#050F19] sm:items-center sm:justify-center sm:bg-[#050F19]/45 sm:p-6",
|
|
5647
5625
|
onKeydown: r[0] || (r[0] = ge((e) => endVoiceConversation(), ["esc"]))
|
|
5648
|
-
}, [E(
|
|
5626
|
+
}, [E(Ea, {
|
|
5649
5627
|
ref_key: "voiceMode",
|
|
5650
|
-
ref:
|
|
5628
|
+
ref: st,
|
|
5651
5629
|
bot: e.bot,
|
|
5652
5630
|
"chat-controller": e.chatController,
|
|
5653
|
-
"backdrop-src":
|
|
5631
|
+
"backdrop-src": Y.value,
|
|
5654
5632
|
"is-light": !1,
|
|
5655
5633
|
class: "voice-call-card h-full w-full sm:max-h-[620px] sm:max-w-[420px] sm:flex-none sm:rounded-[32px] sm:shadow-[0_32px_80px_rgba(5,15,25,0.45)]",
|
|
5656
5634
|
onEnd: endVoiceConversation
|
|
@@ -5658,50 +5636,50 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5658
5636
|
"bot",
|
|
5659
5637
|
"chat-controller",
|
|
5660
5638
|
"backdrop-src"
|
|
5661
|
-
])], 40,
|
|
5639
|
+
])], 40, Na)) : b("", !0)]),
|
|
5662
5640
|
_: 1
|
|
5663
5641
|
}),
|
|
5664
5642
|
p.value ? (R(), x("div", {
|
|
5665
5643
|
key: 2,
|
|
5666
|
-
class: j(["py-16 flex flex-col items-center justify-center gap-2 text-sm",
|
|
5667
|
-
}, [E(
|
|
5644
|
+
class: j(["py-16 flex flex-col items-center justify-center gap-2 text-sm", Z.value ? "text-theme-400" : "text-theme-600"])
|
|
5645
|
+
}, [E(Se, { class: "size-4" })], 2)) : e.setupHint ? (R(), x("div", {
|
|
5668
5646
|
key: 3,
|
|
5669
|
-
class: j(["flex items-center justify-center gap-1.5 py-2 text-[11px]",
|
|
5670
|
-
}, [r[15] || (r[15] = w("i", { class: "i-tabler-tool size-3" }, null, -1)), w("span", null,
|
|
5671
|
-
E(
|
|
5647
|
+
class: j(["flex items-center justify-center gap-1.5 py-2 text-[11px]", mt.value])
|
|
5648
|
+
}, [r[15] || (r[15] = w("i", { class: "i-tabler-tool size-3" }, null, -1)), w("span", null, U(e.setupHint), 1)], 2)) : b("", !0),
|
|
5649
|
+
E(Mi, {
|
|
5672
5650
|
ref_key: "chatScroller",
|
|
5673
5651
|
ref: i,
|
|
5674
|
-
inert:
|
|
5675
|
-
"aria-hidden":
|
|
5652
|
+
inert: ot.value,
|
|
5653
|
+
"aria-hidden": ot.value ? "true" : void 0,
|
|
5676
5654
|
class: j(M.value.length === 0 ? "flex-none" : "flex-1")
|
|
5677
5655
|
}, {
|
|
5678
5656
|
default: me(() => [w("div", { class: j([M.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-5 px-3 @lg/chat:px-8 space-y-2" : "pt-4 pb-[120px] px-3 @lg/chat:px-8 space-y-2", e.centered ? M.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
5679
|
-
M.value.length === 0 && !p.value ? (R(), x("div",
|
|
5657
|
+
M.value.length === 0 && !p.value ? (R(), x("div", Pa, [ce(t.$slots, "empty-heading", {
|
|
5680
5658
|
bot: e.bot,
|
|
5681
|
-
isLight:
|
|
5682
|
-
}, () => [E(
|
|
5659
|
+
isLight: Z.value
|
|
5660
|
+
}, () => [E(qe, {
|
|
5683
5661
|
bot: e.bot,
|
|
5684
|
-
"is-light":
|
|
5662
|
+
"is-light": Z.value,
|
|
5685
5663
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
5686
|
-
}, null, 8, ["bot", "is-light"]), w("div", { class: j(["text-base @sm/chat:text-lg font-semibold",
|
|
5687
|
-
class: j(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]",
|
|
5664
|
+
}, null, 8, ["bot", "is-light"]), w("div", { class: j(["text-base @sm/chat:text-lg font-semibold", Z.value ? "text-theme-900" : "text-white"]) }, U(e.bot.displayName.value), 3)], !0), e.emptyStateMessage === "" ? b("", !0) : (R(), x(m, { key: 0 }, [w("p", { class: j(["mt-1 text-center text-xs @sm/chat:text-sm", mt.value]) }, U(e.emptyStateMessage || "Type your message to get started."), 3), w("div", {
|
|
5665
|
+
class: j(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", Z.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
5688
5666
|
title: n.value.tooltip
|
|
5689
|
-
}, [w("i", { class: j([n.value.icon, "size-3"]) }, null, 2), w("span", null,
|
|
5667
|
+
}, [w("i", { class: j([n.value.icon, "size-3"]) }, null, 2), w("span", null, U(n.value.label), 1)], 10, Fa)], 64))])) : b("", !0),
|
|
5690
5668
|
(R(!0), x(m, null, V(M.value, (t, n) => (R(), x(m, { key: t.id }, [
|
|
5691
|
-
shouldShowTimeDivider(M.value, n) ? (R(), x("div",
|
|
5692
|
-
w("div", { class: j(["flex-1 h-px",
|
|
5693
|
-
w("span", { class: j(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase",
|
|
5694
|
-
w("div", { class: j(["flex-1 h-px",
|
|
5669
|
+
shouldShowTimeDivider(M.value, n) ? (R(), x("div", Ia, [
|
|
5670
|
+
w("div", { class: j(["flex-1 h-px", pt.value]) }, null, 2),
|
|
5671
|
+
w("span", { class: j(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", mt.value]) }, U(shouldShowTimeDivider(M.value, n)), 3),
|
|
5672
|
+
w("div", { class: j(["flex-1 h-px", pt.value]) }, null, 2)
|
|
5695
5673
|
])) : b("", !0),
|
|
5696
5674
|
messageWorkJournal(t) ? (R(), x("div", {
|
|
5697
5675
|
key: 1,
|
|
5698
5676
|
"data-test": "messaging-message-tool-activity",
|
|
5699
5677
|
"data-journal-outcome": messageWorkJournal(t)?.outcome,
|
|
5700
5678
|
class: "mb-4 w-full"
|
|
5701
|
-
}, [E(
|
|
5679
|
+
}, [E(nt, {
|
|
5702
5680
|
model: messageWorkJournal(t),
|
|
5703
|
-
"is-light":
|
|
5704
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5681
|
+
"is-light": Z.value
|
|
5682
|
+
}, null, 8, ["model", "is-light"])], 8, La)) : b("", !0),
|
|
5705
5683
|
isSystemExplainerMessage(t) ? (R(), x("section", {
|
|
5706
5684
|
key: 2,
|
|
5707
5685
|
"data-test": "messaging-system-msg",
|
|
@@ -5714,42 +5692,42 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5714
5692
|
"data-issue-bucket": t.issue?.bucket,
|
|
5715
5693
|
"data-issue-action-label": t.issue?.actionLabel,
|
|
5716
5694
|
"data-issue-action-url": t.issue?.actionUrl,
|
|
5717
|
-
"data-streaming": t.id ===
|
|
5695
|
+
"data-streaming": t.id === ye.value ? "true" : void 0,
|
|
5718
5696
|
class: "mb-6 w-full"
|
|
5719
|
-
}, [w("div", { class: j(["mb-1.5 text-center text-[10.5px] font-medium",
|
|
5697
|
+
}, [w("div", { class: j(["mb-1.5 text-center text-[10.5px] font-medium", mt.value]) }, "System message", 2), w("div", za, [
|
|
5720
5698
|
w("span", {
|
|
5721
5699
|
"data-test": "messaging-system-divider-line",
|
|
5722
5700
|
"aria-hidden": "true",
|
|
5723
|
-
class: j(["hidden h-px flex-1 opacity-60 @md/chat:block",
|
|
5701
|
+
class: j(["hidden h-px flex-1 opacity-60 @md/chat:block", pt.value])
|
|
5724
5702
|
}, null, 2),
|
|
5725
|
-
w("div", { class: j(["w-[46ch] min-w-0 max-w-full rounded-2xl px-5 py-3.5 text-center text-[13px] ring-1 [&_.chat-msg-rich]:max-w-none [&_.chat-msg-rich]:text-[13px] [&_.chat-msg-rich]:italic [&_.chat-msg-rich]:leading-[1.6]",
|
|
5703
|
+
w("div", { class: j(["w-[46ch] min-w-0 max-w-full rounded-2xl px-5 py-3.5 text-center text-[13px] ring-1 [&_.chat-msg-rich]:max-w-none [&_.chat-msg-rich]:text-[13px] [&_.chat-msg-rich]:italic [&_.chat-msg-rich]:leading-[1.6]", Z.value ? "text-theme-700 ring-theme-200/50" : "text-white/85 ring-white/10"]) }, [t.text ? (R(), y(ki, {
|
|
5726
5704
|
key: 0,
|
|
5727
5705
|
text: t.text,
|
|
5728
|
-
inverted: !
|
|
5729
|
-
streaming: t.id ===
|
|
5730
|
-
onClick: r[1] || (r[1] =
|
|
5706
|
+
inverted: !Z.value,
|
|
5707
|
+
streaming: t.id === ye.value,
|
|
5708
|
+
onClick: r[1] || (r[1] = _e(() => {}, ["stop"])),
|
|
5731
5709
|
onAction: handleCardAction
|
|
5732
5710
|
}, null, 8, [
|
|
5733
5711
|
"text",
|
|
5734
5712
|
"inverted",
|
|
5735
5713
|
"streaming"
|
|
5736
|
-
])) : t.issue?.help ? (R(), y(
|
|
5714
|
+
])) : t.issue?.help ? (R(), y(ki, {
|
|
5737
5715
|
key: 1,
|
|
5738
5716
|
text: t.issue.help,
|
|
5739
|
-
inverted: !
|
|
5717
|
+
inverted: !Z.value
|
|
5740
5718
|
}, null, 8, ["text", "inverted"])) : b("", !0), t.issue?.actionUrl && !containsMarkdownLink(t.text) ? (R(), x("a", {
|
|
5741
5719
|
key: 2,
|
|
5742
5720
|
href: t.issue.actionUrl,
|
|
5743
5721
|
"data-test": "messaging-system-msg-action",
|
|
5744
|
-
class: j(["mt-2 text-[12px] font-medium inline-flex items-center gap-1",
|
|
5745
|
-
onClick: r[2] || (r[2] =
|
|
5746
|
-
}, [T(
|
|
5722
|
+
class: j(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", Z.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
5723
|
+
onClick: r[2] || (r[2] = _e(() => {}, ["stop"]))
|
|
5724
|
+
}, [T(U(t.issue.actionLabel) + " ", 1), r[16] || (r[16] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, Ba)) : b("", !0)], 2),
|
|
5747
5725
|
w("span", {
|
|
5748
5726
|
"data-test": "messaging-system-divider-line",
|
|
5749
5727
|
"aria-hidden": "true",
|
|
5750
|
-
class: j(["hidden h-px flex-1 opacity-60 @md/chat:block",
|
|
5728
|
+
class: j(["hidden h-px flex-1 opacity-60 @md/chat:block", pt.value])
|
|
5751
5729
|
}, null, 2)
|
|
5752
|
-
])], 8,
|
|
5730
|
+
])], 8, Ra)) : t.sender === "system" && (t.systemKind === "routine_completed" || t.systemKind === "voice_ended") ? (R(), x("div", {
|
|
5753
5731
|
key: 3,
|
|
5754
5732
|
"data-test": t.systemKind === "routine_completed" ? "messaging-routine-receipt" : "messaging-voice-receipt",
|
|
5755
5733
|
"data-message-id": t.id,
|
|
@@ -5758,11 +5736,11 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5758
5736
|
"data-message-sequence": t.sequence,
|
|
5759
5737
|
"data-system-kind": t.systemKind,
|
|
5760
5738
|
"data-routine-run-id": t.routine?.run.routineRunId,
|
|
5761
|
-
class: j(["mb-6 flex items-center justify-center gap-2 text-[12px] leading-relaxed",
|
|
5739
|
+
class: j(["mb-6 flex items-center justify-center gap-2 text-[12px] leading-relaxed", Z.value ? "text-theme-400" : "text-white/50"])
|
|
5762
5740
|
}, [w("i", {
|
|
5763
5741
|
class: j(["size-3.5 shrink-0", t.systemKind === "voice_ended" ? "i-tabler-phone-off" : "i-tabler-clock"]),
|
|
5764
5742
|
"aria-hidden": "true"
|
|
5765
|
-
}, null, 2), w("span", null,
|
|
5743
|
+
}, null, 2), w("span", null, U(t.text), 1)], 10, Va)) : t.sender === "system" ? (R(), x("div", {
|
|
5766
5744
|
key: 4,
|
|
5767
5745
|
"data-test": "messaging-system-status-msg",
|
|
5768
5746
|
"data-message-id": t.id,
|
|
@@ -5772,16 +5750,16 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5772
5750
|
"data-system-kind": t.systemKind,
|
|
5773
5751
|
"data-issue-code": t.issue?.code,
|
|
5774
5752
|
"data-issue-bucket": t.issue?.bucket,
|
|
5775
|
-
"data-streaming": t.id ===
|
|
5776
|
-
class: j(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1",
|
|
5753
|
+
"data-streaming": t.id === ye.value ? "true" : void 0,
|
|
5754
|
+
class: j(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", Z.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
|
|
5777
5755
|
}, [r[17] || (r[17] = w("i", {
|
|
5778
5756
|
class: "i-tabler-info-circle size-4 mt-0.5 shrink-0",
|
|
5779
5757
|
"aria-hidden": "true"
|
|
5780
|
-
}, null, -1)), E(
|
|
5758
|
+
}, null, -1)), E(ki, {
|
|
5781
5759
|
text: t.text,
|
|
5782
|
-
inverted: !
|
|
5783
|
-
onClick: r[3] || (r[3] =
|
|
5784
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
5760
|
+
inverted: !Z.value,
|
|
5761
|
+
onClick: r[3] || (r[3] = _e(() => {}, ["stop"]))
|
|
5762
|
+
}, null, 8, ["text", "inverted"])], 10, Ha)) : (R(), x("div", {
|
|
5785
5763
|
key: 5,
|
|
5786
5764
|
"data-test": t.sender === "bot" ? "messaging-assistant-msg" : t.sender === "user" ? "messaging-user-msg" : void 0,
|
|
5787
5765
|
"data-message-id": t.id,
|
|
@@ -5789,7 +5767,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5789
5767
|
"data-conversation-id": t.conversationId,
|
|
5790
5768
|
"data-message-sequence": t.sequence,
|
|
5791
5769
|
"data-system-kind": t.systemKind,
|
|
5792
|
-
"data-streaming": t.id ===
|
|
5770
|
+
"data-streaming": t.id === ye.value ? "true" : void 0,
|
|
5793
5771
|
"data-queued": isQueuedMessage(t.id) ? "true" : void 0,
|
|
5794
5772
|
"aria-label": isQueuedMessage(t.id) ? "Sent — will be answered after the current work finishes" : void 0,
|
|
5795
5773
|
class: j(["group/msg flex gap-2 items-end", {
|
|
@@ -5806,11 +5784,11 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5806
5784
|
key: 0,
|
|
5807
5785
|
"data-test": "messaging-routine-label",
|
|
5808
5786
|
"data-routine-run-id": t.routine.run.routineRunId,
|
|
5809
|
-
class: j(["mb-2 flex items-start gap-2 text-[12px] leading-relaxed",
|
|
5787
|
+
class: j(["mb-2 flex items-start gap-2 text-[12px] leading-relaxed", Z.value ? "text-theme-400" : "text-white/50"])
|
|
5810
5788
|
}, [r[18] || (r[18] = w("i", {
|
|
5811
5789
|
class: "i-tabler-clock size-3.5 mt-0.5 shrink-0",
|
|
5812
5790
|
"aria-hidden": "true"
|
|
5813
|
-
}, null, -1)), w("span", null, "Ran " +
|
|
5791
|
+
}, null, -1)), w("span", null, "Ran " + U(t.routine.run.name || t.routine.run.sourceLabel || "a routine"), 1)], 10, Wa)) : b("", !0),
|
|
5814
5792
|
blockAttachmentsForMessage(t).length ? (R(), x("div", {
|
|
5815
5793
|
key: 1,
|
|
5816
5794
|
class: j(["mb-1 space-y-1", t.sender === "user" ? "flex flex-col items-end" : ""])
|
|
@@ -5821,31 +5799,31 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5821
5799
|
"data-test": "messaging-attachment",
|
|
5822
5800
|
"data-attachment-placement": "block",
|
|
5823
5801
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5824
|
-
}, null, 8,
|
|
5802
|
+
}, null, 8, Ga)) : e.type === "audio" ? (R(), x("audio", {
|
|
5825
5803
|
key: 1,
|
|
5826
5804
|
src: e.src,
|
|
5827
5805
|
controls: "",
|
|
5828
5806
|
"data-test": "messaging-attachment",
|
|
5829
5807
|
"data-attachment-placement": "block",
|
|
5830
5808
|
class: "max-w-full"
|
|
5831
|
-
}, null, 8,
|
|
5809
|
+
}, null, 8, Ka)) : (R(), x("a", {
|
|
5832
5810
|
key: 2,
|
|
5833
5811
|
href: e.src,
|
|
5834
5812
|
target: "_blank",
|
|
5835
5813
|
rel: "noopener",
|
|
5836
5814
|
"data-test": "messaging-attachment",
|
|
5837
5815
|
"data-attachment-placement": "block",
|
|
5838
|
-
class: j(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
5839
|
-
}, [r[19] || (r[19] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " +
|
|
5816
|
+
class: j(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Z.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5817
|
+
}, [r[19] || (r[19] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " + U(e.filename), 1)], 10, qa))], 64))), 128))], 2)) : b("", !0),
|
|
5840
5818
|
messageRenderParts(t).length ? (R(), x("div", {
|
|
5841
5819
|
key: 2,
|
|
5842
5820
|
"data-test": "messaging-message-content",
|
|
5843
|
-
class: j(t.sender === "user" ?
|
|
5844
|
-
}, [(R(!0), x(m, null, V(messageRenderParts(t), (e) => (R(), x(m, { key: e.key }, [e.kind === "text" && e.text ? (R(), x("div",
|
|
5821
|
+
class: j(t.sender === "user" ? Z.value ? "rounded-[14px] px-4 py-2.5 bg-theme-50 text-theme-900" : "rounded-[14px] px-4 py-2.5 bg-white/10 text-white" : Z.value ? "text-theme-800" : "text-white/95")
|
|
5822
|
+
}, [(R(!0), x(m, null, V(messageRenderParts(t), (e) => (R(), x(m, { key: e.key }, [e.kind === "text" && e.text ? (R(), x("div", Ja, [E(ki, {
|
|
5845
5823
|
text: e.text,
|
|
5846
|
-
inverted: t.sender === "user" || !
|
|
5847
|
-
streaming: t.id ===
|
|
5848
|
-
onClick: r[4] || (r[4] =
|
|
5824
|
+
inverted: t.sender === "user" || !Z.value,
|
|
5825
|
+
streaming: t.id === ye.value,
|
|
5826
|
+
onClick: r[4] || (r[4] = _e(() => {}, ["stop"])),
|
|
5849
5827
|
onAction: handleCardAction
|
|
5850
5828
|
}, null, 8, [
|
|
5851
5829
|
"text",
|
|
@@ -5858,83 +5836,83 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5858
5836
|
"data-test": "messaging-attachment",
|
|
5859
5837
|
"data-attachment-placement": e.placement,
|
|
5860
5838
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5861
|
-
}, null, 8,
|
|
5839
|
+
}, null, 8, Ya)) : e.kind === "attachment" && e.attachment.type === "audio" ? (R(), x("audio", {
|
|
5862
5840
|
key: 2,
|
|
5863
5841
|
src: e.attachment.src,
|
|
5864
5842
|
controls: "",
|
|
5865
5843
|
"data-test": "messaging-attachment",
|
|
5866
5844
|
"data-attachment-placement": e.placement,
|
|
5867
5845
|
class: "my-2 max-w-full"
|
|
5868
|
-
}, null, 8,
|
|
5846
|
+
}, null, 8, Xa)) : e.kind === "attachment" ? (R(), x("a", {
|
|
5869
5847
|
key: 3,
|
|
5870
5848
|
href: e.attachment.src,
|
|
5871
5849
|
target: "_blank",
|
|
5872
5850
|
rel: "noopener",
|
|
5873
5851
|
"data-test": "messaging-attachment",
|
|
5874
5852
|
"data-attachment-placement": e.placement,
|
|
5875
|
-
class: j(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
5876
|
-
}, [r[20] || (r[20] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " +
|
|
5853
|
+
class: j(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Z.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5854
|
+
}, [r[20] || (r[20] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " + U(e.attachment.filename), 1)], 10, Za)) : b("", !0)], 64))), 128))], 2)) : b("", !0),
|
|
5877
5855
|
canCopyMessage(t) ? (R(), x("div", {
|
|
5878
5856
|
key: 3,
|
|
5879
5857
|
"data-test": "messaging-message-actions",
|
|
5880
|
-
"data-actions-reveal": t.id ===
|
|
5881
|
-
class: j(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [
|
|
5858
|
+
"data-actions-reveal": t.id === Ke.value ? "always" : "hover",
|
|
5859
|
+
class: j(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [Z.value ? "text-theme-300" : "text-white/35", t.id === Ke.value ? "" : "opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100"]])
|
|
5882
5860
|
}, [
|
|
5883
5861
|
w("button", {
|
|
5884
5862
|
type: "button",
|
|
5885
5863
|
"data-test": "messaging-message-copy",
|
|
5886
|
-
"data-copied":
|
|
5887
|
-
title:
|
|
5888
|
-
"aria-label":
|
|
5889
|
-
class: j(["grid size-6 cursor-pointer place-items-center transition-colors",
|
|
5890
|
-
onClick:
|
|
5864
|
+
"data-copied": We.value === t.id || void 0,
|
|
5865
|
+
title: We.value === t.id ? "Copied" : "Copy",
|
|
5866
|
+
"aria-label": We.value === t.id ? "Copied" : "Copy",
|
|
5867
|
+
class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Z.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5868
|
+
onClick: _e((e) => copyMessage(t), ["stop"])
|
|
5891
5869
|
}, [w("i", {
|
|
5892
|
-
class: j(["size-3.5",
|
|
5870
|
+
class: j(["size-3.5", We.value === t.id ? "i-tabler-check" : "i-tabler-copy"]),
|
|
5893
5871
|
"aria-hidden": "true"
|
|
5894
|
-
}, null, 2)], 10,
|
|
5895
|
-
|
|
5872
|
+
}, null, 2)], 10, $a),
|
|
5873
|
+
Ye.value ? (R(), x("button", {
|
|
5896
5874
|
key: 0,
|
|
5897
5875
|
type: "button",
|
|
5898
5876
|
"data-test": "messaging-message-share",
|
|
5899
5877
|
title: "Share",
|
|
5900
5878
|
"aria-label": "Share",
|
|
5901
|
-
class: j(["grid size-6 cursor-pointer place-items-center transition-colors",
|
|
5902
|
-
onClick:
|
|
5879
|
+
class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Z.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5880
|
+
onClick: _e((e) => Xe.value = t, ["stop"])
|
|
5903
5881
|
}, [...r[21] || (r[21] = [w("i", {
|
|
5904
5882
|
class: "i-tabler-share-2 size-3.5",
|
|
5905
5883
|
"aria-hidden": "true"
|
|
5906
|
-
}, null, -1)])], 10,
|
|
5907
|
-
|
|
5884
|
+
}, null, -1)])], 10, eo)) : b("", !0),
|
|
5885
|
+
Je.value ? (R(), x("button", {
|
|
5908
5886
|
key: 1,
|
|
5909
5887
|
type: "button",
|
|
5910
5888
|
"data-test": "messaging-message-report",
|
|
5911
5889
|
title: "Report",
|
|
5912
5890
|
"aria-label": "Report",
|
|
5913
|
-
class: j(["grid size-6 cursor-pointer place-items-center transition-colors",
|
|
5914
|
-
onClick:
|
|
5891
|
+
class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Z.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5892
|
+
onClick: _e((n) => e.chatController?.reportMessage(t.id), ["stop"])
|
|
5915
5893
|
}, [...r[22] || (r[22] = [w("i", {
|
|
5916
5894
|
class: "i-tabler-flag size-3.5",
|
|
5917
5895
|
"aria-hidden": "true"
|
|
5918
|
-
}, null, -1)])], 10,
|
|
5919
|
-
], 10,
|
|
5920
|
-
], 2)], 10,
|
|
5921
|
-
t.id ===
|
|
5896
|
+
}, null, -1)])], 10, to)) : b("", !0)
|
|
5897
|
+
], 10, Qa)) : b("", !0)
|
|
5898
|
+
], 2)], 10, Ua)),
|
|
5899
|
+
t.id === ue.value ? (R(), x(m, { key: 6 }, [g.value.length ? (R(!0), x(m, { key: 0 }, V(g.value, (e) => (R(), x(m, { key: e.id }, [e.kind === "work" ? (R(), x("div", {
|
|
5922
5900
|
key: 0,
|
|
5923
5901
|
"data-test": "messaging-tool-activity",
|
|
5924
5902
|
"data-journal-outcome": e.journal.outcome,
|
|
5925
5903
|
class: "chat-live-enter mb-4 w-full"
|
|
5926
|
-
}, [E(
|
|
5904
|
+
}, [E(nt, {
|
|
5927
5905
|
model: e.journal,
|
|
5928
|
-
"is-light":
|
|
5929
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5906
|
+
"is-light": Z.value
|
|
5907
|
+
}, null, 8, ["model", "is-light"])], 8, no)) : e.kind === "text" && e.content ? (R(), x("div", {
|
|
5930
5908
|
key: 1,
|
|
5931
5909
|
"data-test": "messaging-live-text-block",
|
|
5932
|
-
class: j(["mb-4",
|
|
5933
|
-
}, [E(
|
|
5910
|
+
class: j(["mb-4", Z.value ? "text-theme-800" : "text-white/95"])
|
|
5911
|
+
}, [E(ki, {
|
|
5934
5912
|
text: e.content,
|
|
5935
|
-
inverted: !
|
|
5913
|
+
inverted: !Z.value,
|
|
5936
5914
|
streaming: e.id === D.value,
|
|
5937
|
-
onClick: r[5] || (r[5] =
|
|
5915
|
+
onClick: r[5] || (r[5] = _e(() => {}, ["stop"])),
|
|
5938
5916
|
onAction: handleCardAction
|
|
5939
5917
|
}, null, 8, [
|
|
5940
5918
|
"text",
|
|
@@ -5944,7 +5922,7 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5944
5922
|
key: 2,
|
|
5945
5923
|
"data-test": "messaging-tool-activity-tail",
|
|
5946
5924
|
"aria-label": "Assistant is still working",
|
|
5947
|
-
class: j(["chat-live-enter mb-4 grid h-[17px] w-5 place-items-center",
|
|
5925
|
+
class: j(["chat-live-enter mb-4 grid h-[17px] w-5 place-items-center", Z.value ? "text-theme-500" : "text-white/70"])
|
|
5948
5926
|
}, [...r[23] || (r[23] = [w("span", {
|
|
5949
5927
|
class: "chat-dots chat-dots--mini",
|
|
5950
5928
|
"aria-hidden": "true"
|
|
@@ -5952,23 +5930,23 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5952
5930
|
w("span"),
|
|
5953
5931
|
w("span"),
|
|
5954
5932
|
w("span")
|
|
5955
|
-
], -1)])], 2))], 64))), 128)) :
|
|
5933
|
+
], -1)])], 2))], 64))), 128)) : le.value ? (R(), x("div", {
|
|
5956
5934
|
key: 1,
|
|
5957
5935
|
"data-test": "messaging-tool-activity",
|
|
5958
|
-
"data-journal-outcome":
|
|
5936
|
+
"data-journal-outcome": le.value.outcome,
|
|
5959
5937
|
class: "chat-live-enter mb-4 w-full"
|
|
5960
|
-
}, [E(
|
|
5961
|
-
model:
|
|
5962
|
-
"is-light":
|
|
5963
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5938
|
+
}, [E(nt, {
|
|
5939
|
+
model: le.value,
|
|
5940
|
+
"is-light": Z.value
|
|
5941
|
+
}, null, 8, ["model", "is-light"])], 8, ro)) : b("", !0)], 64)) : b("", !0)
|
|
5964
5942
|
], 64))), 128)),
|
|
5965
|
-
|
|
5943
|
+
Ce.value ? (R(), x("div", {
|
|
5966
5944
|
key: 1,
|
|
5967
5945
|
"data-test": te.value ? "messaging-working-state" : "messaging-thinking-indicator",
|
|
5968
5946
|
"data-working-description": te.value,
|
|
5969
5947
|
role: "status",
|
|
5970
5948
|
"aria-live": "polite",
|
|
5971
|
-
class: j(["chat-live-enter relative mb-4 flex h-[17px] items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug",
|
|
5949
|
+
class: j(["chat-live-enter relative mb-4 flex h-[17px] items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", Z.value ? "text-theme-500" : "text-white/50"])
|
|
5972
5950
|
}, [r[24] || (r[24] = w("span", {
|
|
5973
5951
|
"data-test": "messaging-thinking-dots",
|
|
5974
5952
|
class: "chat-dots shrink-0",
|
|
@@ -5977,26 +5955,26 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
5977
5955
|
w("span"),
|
|
5978
5956
|
w("span"),
|
|
5979
5957
|
w("span")
|
|
5980
|
-
], -1)), te.value ? (R(), x("span",
|
|
5981
|
-
|
|
5958
|
+
], -1)), te.value ? (R(), x("span", ao, U(te.value), 1)) : (R(), x("span", oo, "Thinking"))], 10, io)) : b("", !0),
|
|
5959
|
+
ve.value ? (R(), x("div", {
|
|
5982
5960
|
key: 2,
|
|
5983
5961
|
"data-test": "messaging-transient-issue",
|
|
5984
|
-
"data-issue-code":
|
|
5962
|
+
"data-issue-code": ve.value.code,
|
|
5985
5963
|
role: "alert",
|
|
5986
|
-
class: j(["chat-live-enter mb-4 flex items-start gap-2 px-2 text-[13px] leading-snug",
|
|
5964
|
+
class: j(["chat-live-enter mb-4 flex items-start gap-2 px-2 text-[13px] leading-snug", Z.value ? "text-theme-600" : "text-white/60"])
|
|
5987
5965
|
}, [
|
|
5988
5966
|
r[26] || (r[26] = w("i", {
|
|
5989
5967
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
5990
5968
|
"aria-hidden": "true"
|
|
5991
5969
|
}, null, -1)),
|
|
5992
|
-
w("span",
|
|
5993
|
-
|
|
5970
|
+
w("span", co, [w("span", lo, [T(U(ve.value.message), 1), ve.value.help ? (R(), x(m, { key: 0 }, [T(":")], 64)) : b("", !0)]), ve.value.help ? (R(), x(m, { key: 0 }, [r[25] || (r[25] = T(U(" "), -1)), w("span", uo, U(ve.value.help), 1)], 64)) : b("", !0)]),
|
|
5971
|
+
ve.value.actionUrl && ve.value.actionLabel ? (R(), x("a", {
|
|
5994
5972
|
key: 0,
|
|
5995
|
-
href:
|
|
5973
|
+
href: ve.value.actionUrl,
|
|
5996
5974
|
class: "shrink-0 underline underline-offset-2",
|
|
5997
|
-
onClick: r[6] || (r[6] =
|
|
5998
|
-
},
|
|
5999
|
-
], 10,
|
|
5975
|
+
onClick: r[6] || (r[6] = _e(() => {}, ["stop"]))
|
|
5976
|
+
}, U(ve.value.actionLabel), 9, fo)) : b("", !0)
|
|
5977
|
+
], 10, so)) : b("", !0)
|
|
6000
5978
|
], 2)]),
|
|
6001
5979
|
_: 3
|
|
6002
5980
|
}, 8, [
|
|
@@ -6006,40 +5984,40 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6006
5984
|
]),
|
|
6007
5985
|
w("div", {
|
|
6008
5986
|
"data-test": "messaging-composer-footer",
|
|
6009
|
-
inert:
|
|
6010
|
-
"aria-hidden":
|
|
5987
|
+
inert: ot.value,
|
|
5988
|
+
"aria-hidden": ot.value ? "true" : void 0,
|
|
6011
5989
|
class: j(["left-0 right-0 z-30 px-3 @lg/chat:px-8 pb-[max(env(safe-area-inset-bottom),1rem)]", [
|
|
6012
5990
|
M.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
|
|
6013
5991
|
e.centered && M.value.length > 0 ? "pt-0 sm:pb-7" : "pt-3",
|
|
6014
|
-
|
|
5992
|
+
Z.value ? e.centered ? "bg-transparent" : "bg-theme-0" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"
|
|
6015
5993
|
]])
|
|
6016
|
-
}, [ce(t.$slots, "composer", {}, () => [
|
|
5994
|
+
}, [ce(t.$slots, "composer", {}, () => [ke.value ? (R(), x("div", {
|
|
6017
5995
|
key: 0,
|
|
6018
5996
|
"data-test": "messaging-seat",
|
|
6019
|
-
"data-seat-state":
|
|
5997
|
+
"data-seat-state": De.value,
|
|
6020
5998
|
role: "status",
|
|
6021
5999
|
"aria-live": "polite",
|
|
6022
|
-
class: j(["py-3 text-center text-[14px]",
|
|
6023
|
-
},
|
|
6024
|
-
|
|
6000
|
+
class: j(["py-3 text-center text-[14px]", Z.value ? "text-theme-500" : "text-white/70"])
|
|
6001
|
+
}, U(ke.value), 11, mo)) : (R(), x(m, { key: 1 }, [
|
|
6002
|
+
Me.value.length > 0 ? (R(), x("div", {
|
|
6025
6003
|
key: 0,
|
|
6026
6004
|
class: j(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""])
|
|
6027
|
-
}, [(R(!0), x(m, null, V(
|
|
6005
|
+
}, [(R(!0), x(m, null, V(Me.value, (e, t) => (R(), x("div", {
|
|
6028
6006
|
key: t,
|
|
6029
6007
|
class: "relative shrink-0 group"
|
|
6030
6008
|
}, [e.type === "image" ? (R(), x("img", {
|
|
6031
6009
|
key: 0,
|
|
6032
6010
|
src: e.src,
|
|
6033
6011
|
alt: e.filename,
|
|
6034
|
-
class: j(["size-14 rounded-xl object-cover border",
|
|
6035
|
-
}, null, 10,
|
|
6012
|
+
class: j(["size-14 rounded-xl object-cover border", Z.value ? "border-black/10" : "border-white/20"])
|
|
6013
|
+
}, null, 10, ho)) : (R(), x("div", {
|
|
6036
6014
|
key: 1,
|
|
6037
|
-
class: j(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border",
|
|
6038
|
-
}, [r[27] || (r[27] = w("i", { class: "i-tabler-file size-4" }, null, -1)), w("span",
|
|
6015
|
+
class: j(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", Z.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
6016
|
+
}, [r[27] || (r[27] = w("i", { class: "i-tabler-file size-4" }, null, -1)), w("span", go, U(e.filename), 1)], 2)), w("button", {
|
|
6039
6017
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] cursor-pointer",
|
|
6040
6018
|
onClick: (e) => removeAttachment(t)
|
|
6041
|
-
}, [...r[28] || (r[28] = [w("i", { class: "i-tabler-x size-3" }, null, -1)])], 8,
|
|
6042
|
-
|
|
6019
|
+
}, [...r[28] || (r[28] = [w("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, _o)]))), 128)), Ne.value ? (R(), x("div", vo, [E(Se, { class: "size-5" })])) : b("", !0)], 2)) : b("", !0),
|
|
6020
|
+
Ie.value ? (R(), x("input", {
|
|
6043
6021
|
key: 1,
|
|
6044
6022
|
ref_key: "fileInput",
|
|
6045
6023
|
ref: o,
|
|
@@ -6050,22 +6028,22 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6050
6028
|
}, null, 544)) : b("", !0),
|
|
6051
6029
|
w("div", {
|
|
6052
6030
|
"data-test": "messaging-composer",
|
|
6053
|
-
"data-composer-action":
|
|
6054
|
-
class: j(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-4 transition-colors duration-200", [e.centered ? "mx-auto max-w-[640px] @5xl/chat:max-w-[740px] @5xl/chat:px-5 @5xl/chat:pt-3.5 @5xl/chat:pb-3" : "",
|
|
6031
|
+
"data-composer-action": ze.value,
|
|
6032
|
+
class: j(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-4 transition-colors duration-200", [e.centered ? "mx-auto max-w-[640px] @5xl/chat:max-w-[740px] @5xl/chat:px-5 @5xl/chat:pt-3.5 @5xl/chat:pb-3" : "", Z.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04),0_12px_32px_rgba(15,23,42,0.07)] ring-1 ring-theme-950/20 hover:ring-theme-950/30 focus-within:ring-theme-950/30" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25 focus-within:bg-white/15 focus-within:ring-white/25"]]),
|
|
6055
6033
|
onClick: focusComposer
|
|
6056
|
-
}, [
|
|
6034
|
+
}, [et.value ? (R(), x("div", {
|
|
6057
6035
|
key: 1,
|
|
6058
6036
|
"data-test": "messaging-recording-state",
|
|
6059
|
-
class: j(["flex min-w-0 items-center gap-2 py-1",
|
|
6037
|
+
class: j(["flex min-w-0 items-center gap-2 py-1", Z.value ? "text-theme-700" : "text-white/80"])
|
|
6060
6038
|
}, [
|
|
6061
6039
|
r[29] || (r[29] = w("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
6062
|
-
w("span",
|
|
6063
|
-
w("span", { class: j(["min-w-0 truncate text-sm",
|
|
6040
|
+
w("span", xo, U(rt.value), 1),
|
|
6041
|
+
w("span", { class: j(["min-w-0 truncate text-sm", Z.value ? "text-theme-400" : "text-white/45"]) }, U(it.value), 3)
|
|
6064
6042
|
], 2)) : he((R(), x("textarea", {
|
|
6065
6043
|
key: 0,
|
|
6066
6044
|
ref_key: "textarea",
|
|
6067
6045
|
ref: a,
|
|
6068
|
-
"onUpdate:modelValue": r[7] || (r[7] = (e) =>
|
|
6046
|
+
"onUpdate:modelValue": r[7] || (r[7] = (e) => je.value = e),
|
|
6069
6047
|
"data-test": "messaging-input",
|
|
6070
6048
|
rows: "1",
|
|
6071
6049
|
enterkeyhint: "send",
|
|
@@ -6074,32 +6052,32 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6074
6052
|
autocapitalize: "sentences",
|
|
6075
6053
|
autocorrect: "on",
|
|
6076
6054
|
spellcheck: "true",
|
|
6077
|
-
placeholder:
|
|
6078
|
-
disabled:
|
|
6055
|
+
placeholder: J.value,
|
|
6056
|
+
disabled: Ee.value,
|
|
6079
6057
|
style: {
|
|
6080
6058
|
fontSize: "16px",
|
|
6081
6059
|
resize: "none"
|
|
6082
6060
|
},
|
|
6083
|
-
class: j(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
6061
|
+
class: j(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", Z.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
6084
6062
|
onKeydown: handleKeydown
|
|
6085
|
-
}, null, 42,
|
|
6063
|
+
}, null, 42, bo)), [[pe, je.value]]), w("div", So, [
|
|
6086
6064
|
w("button", {
|
|
6087
6065
|
class: j(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6066
|
+
Ie.value ? "cursor-pointer" : "cursor-default",
|
|
6067
|
+
Z.value ? "text-theme-500" : "text-white/50",
|
|
6068
|
+
Ne.value || Fe.value ? "opacity-50 pointer-events-none" : ""
|
|
6091
6069
|
]]),
|
|
6092
|
-
disabled:
|
|
6093
|
-
"aria-label":
|
|
6094
|
-
title:
|
|
6095
|
-
onClick: r[8] || (r[8] = (e) =>
|
|
6096
|
-
}, [
|
|
6070
|
+
disabled: Ee.value || Ne.value || Fe.value || !Ie.value,
|
|
6071
|
+
"aria-label": Ie.value ? "Attach file" : "File attachments unavailable",
|
|
6072
|
+
title: Ie.value ? "Attach file" : "File attachments unavailable",
|
|
6073
|
+
onClick: r[8] || (r[8] = (e) => Ie.value && triggerFileInput())
|
|
6074
|
+
}, [Ne.value ? (R(), x("i", wo)) : (R(), x("i", To)), w("span", Eo, U(Ie.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Co),
|
|
6097
6075
|
r[33] || (r[33] = w("div", { class: "flex-1" }, null, -1)),
|
|
6098
|
-
w("div",
|
|
6099
|
-
|
|
6076
|
+
w("div", Do, [
|
|
6077
|
+
et.value && !tt.value && !ot.value ? (R(), x("button", {
|
|
6100
6078
|
key: 0,
|
|
6101
6079
|
"data-test": "messaging-record-discard-btn",
|
|
6102
|
-
class: j(["flex size-8 cursor-pointer items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11",
|
|
6080
|
+
class: j(["flex size-8 cursor-pointer items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", Z.value ? "text-theme-400" : "text-white/40"]),
|
|
6103
6081
|
"aria-label": "Discard recording",
|
|
6104
6082
|
title: "Discard recording",
|
|
6105
6083
|
onClick: r[9] || (r[9] = (e) => finishRecording({ cancelled: !0 }))
|
|
@@ -6107,27 +6085,27 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6107
6085
|
class: "i-tabler-x size-[18px]",
|
|
6108
6086
|
"aria-hidden": "true"
|
|
6109
6087
|
}, null, -1)])], 2)) : b("", !0),
|
|
6110
|
-
(
|
|
6088
|
+
($e.value || et.value) && !tt.value && !ot.value ? (R(), x("button", {
|
|
6111
6089
|
key: 1,
|
|
6112
6090
|
"data-test": "messaging-record-audio-btn",
|
|
6113
|
-
class: j(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] hover:opacity-70 pointer-coarse:size-11",
|
|
6114
|
-
"aria-label":
|
|
6115
|
-
title:
|
|
6116
|
-
onPointerdown:
|
|
6117
|
-
onPointerup:
|
|
6118
|
-
onPointercancel:
|
|
6091
|
+
class: j(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] hover:opacity-70 pointer-coarse:size-11", et.value ? Z.value ? "text-theme-900 scale-110" : "text-white scale-110" : Z.value ? "text-theme-500" : "text-white/60"]),
|
|
6092
|
+
"aria-label": at.value,
|
|
6093
|
+
title: at.value,
|
|
6094
|
+
onPointerdown: _e(onRecordPointerDown, ["prevent"]),
|
|
6095
|
+
onPointerup: _e(onRecordPointerUp, ["prevent"]),
|
|
6096
|
+
onPointercancel: _e(onRecordPointerCancel, ["prevent"]),
|
|
6119
6097
|
onClick: onRecordClick,
|
|
6120
|
-
onKeydown: r[10] || (r[10] = ge(
|
|
6121
|
-
}, [w("i", { class: j([
|
|
6122
|
-
|
|
6098
|
+
onKeydown: r[10] || (r[10] = ge(_e((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
6099
|
+
}, [w("i", { class: j([et.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), w("span", ko, U(at.value), 1)], 42, Oo)) : b("", !0),
|
|
6100
|
+
ut.value ? (R(), x("button", {
|
|
6123
6101
|
key: 2,
|
|
6124
6102
|
"data-test": "messaging-voice-start-btn",
|
|
6125
|
-
class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [
|
|
6126
|
-
disabled:
|
|
6127
|
-
"aria-label":
|
|
6128
|
-
title:
|
|
6103
|
+
class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [Z.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", dt.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
|
|
6104
|
+
disabled: dt.value,
|
|
6105
|
+
"aria-label": ft.value,
|
|
6106
|
+
title: ft.value,
|
|
6129
6107
|
onClick: r[11] || (r[11] = (e) => startVoiceConversation())
|
|
6130
|
-
}, [w("span",
|
|
6108
|
+
}, [w("span", jo, [(R(), x(m, null, V([
|
|
6131
6109
|
7,
|
|
6132
6110
|
13,
|
|
6133
6111
|
16,
|
|
@@ -6137,10 +6115,10 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6137
6115
|
key: e,
|
|
6138
6116
|
class: "w-[2px] rounded-full bg-current",
|
|
6139
6117
|
style: N({ height: `${e}px` })
|
|
6140
|
-
}, null, 4)), 64))]), r[31] || (r[31] = w("span", { class: "sr-only" }, "Start voice conversation", -1))], 10,
|
|
6118
|
+
}, null, 4)), 64))]), r[31] || (r[31] = w("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, Ao)) : et.value ? b("", !0) : (R(), x(m, { key: 3 }, [Ve.value ? (R(), x("button", {
|
|
6141
6119
|
key: 0,
|
|
6142
6120
|
"data-test": "messaging-secondary-stop-btn",
|
|
6143
|
-
class: j(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11",
|
|
6121
|
+
class: j(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Z.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
|
|
6144
6122
|
"aria-label": "Stop work",
|
|
6145
6123
|
title: "Stop work",
|
|
6146
6124
|
onClick: r[12] || (r[12] = (t) => e.chatController?.stopChatTurn())
|
|
@@ -6149,23 +6127,23 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6149
6127
|
"aria-hidden": "true"
|
|
6150
6128
|
}, null, -1), w("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : b("", !0), w("button", {
|
|
6151
6129
|
"data-test": "messaging-send-btn",
|
|
6152
|
-
"data-composer-action":
|
|
6153
|
-
class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11",
|
|
6154
|
-
disabled: !
|
|
6155
|
-
"aria-label":
|
|
6156
|
-
title:
|
|
6130
|
+
"data-composer-action": ze.value,
|
|
6131
|
+
class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Be.value ? Z.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : Z.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
6132
|
+
disabled: !Be.value,
|
|
6133
|
+
"aria-label": Qe.value,
|
|
6134
|
+
title: Qe.value,
|
|
6157
6135
|
onClick: r[13] || (r[13] = (e) => handleComposerAction())
|
|
6158
|
-
}, [
|
|
6136
|
+
}, [ze.value === "stop" ? (R(), x("i", No)) : (R(), x("i", Po)), w("span", Fo, U(Qe.value), 1)], 10, Mo)], 64))
|
|
6159
6137
|
])
|
|
6160
|
-
])], 10,
|
|
6161
|
-
e.centered && M.value.length > 0 ? (R(), x("p",
|
|
6162
|
-
], 64))], !0)], 10,
|
|
6163
|
-
|
|
6138
|
+
])], 10, yo),
|
|
6139
|
+
e.centered && M.value.length > 0 ? (R(), x("p", Io, U(e.bot.displayName.value) + " is AI and can make mistakes. ", 1)) : b("", !0)
|
|
6140
|
+
], 64))], !0)], 10, po),
|
|
6141
|
+
Ye.value ? (R(), y(Qi, {
|
|
6164
6142
|
key: 4,
|
|
6165
|
-
message:
|
|
6166
|
-
prompt:
|
|
6167
|
-
share:
|
|
6168
|
-
onClose: r[14] || (r[14] = (e) =>
|
|
6143
|
+
message: Xe.value,
|
|
6144
|
+
prompt: Ze.value,
|
|
6145
|
+
share: Ye.value,
|
|
6146
|
+
onClose: r[14] || (r[14] = (e) => Xe.value = void 0)
|
|
6169
6147
|
}, null, 8, [
|
|
6170
6148
|
"message",
|
|
6171
6149
|
"prompt",
|
|
@@ -6173,16 +6151,16 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6173
6151
|
])) : b("", !0)
|
|
6174
6152
|
], 2));
|
|
6175
6153
|
}
|
|
6176
|
-
}), [["__scopeId", "data-v-89d3bf69"]]),
|
|
6154
|
+
}), [["__scopeId", "data-v-89d3bf69"]]), Ro = { class: "bot-wrap" }, zo = {
|
|
6177
6155
|
key: 0,
|
|
6178
6156
|
class: "flex items-center justify-center h-full"
|
|
6179
|
-
},
|
|
6157
|
+
}, Bo = {
|
|
6180
6158
|
key: 2,
|
|
6181
6159
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
6182
6160
|
role: "status",
|
|
6183
6161
|
"aria-live": "polite",
|
|
6184
6162
|
"data-test": "bot-unavailable"
|
|
6185
|
-
},
|
|
6163
|
+
}, Vo = /* @__PURE__ */ D({
|
|
6186
6164
|
__name: "BotWrap",
|
|
6187
6165
|
props: {
|
|
6188
6166
|
sdk: {},
|
|
@@ -6202,31 +6180,25 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6202
6180
|
let t = o("BotWrap"), r = e, i = r.sdk || n.getInstance({
|
|
6203
6181
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
6204
6182
|
...r.apiBase && { apiBase: r.apiBase }
|
|
6205
|
-
}), a =
|
|
6183
|
+
}), a = H(!r.bot), s = H(r.bot), c = H();
|
|
6206
6184
|
async function loadBot() {
|
|
6207
|
-
if (r.bot) {
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
apiBase: i.apiBase
|
|
6225
|
-
}
|
|
6226
|
-
}), a.value = !1;
|
|
6227
|
-
return;
|
|
6228
|
-
}
|
|
6229
|
-
try {
|
|
6185
|
+
if (r.bot) t.debug("Bot provided via props, skipping fetch", {
|
|
6186
|
+
botId: r.bot.botId.value,
|
|
6187
|
+
handle: r.bot.handle.value
|
|
6188
|
+
}), a.value = !1;
|
|
6189
|
+
else if (!r.handle) c.value = "No handle or bot provided", t.warn("BotWrap mounted without handle or bot", {
|
|
6190
|
+
propsReceived: {
|
|
6191
|
+
handle: r.handle,
|
|
6192
|
+
bot: r.bot,
|
|
6193
|
+
context: r.clientContext ?? r.context,
|
|
6194
|
+
apiBase: r.apiBase
|
|
6195
|
+
},
|
|
6196
|
+
sdkState: {
|
|
6197
|
+
isDev: i.isDev,
|
|
6198
|
+
apiBase: i.apiBase
|
|
6199
|
+
}
|
|
6200
|
+
}), a.value = !1;
|
|
6201
|
+
else try {
|
|
6230
6202
|
a.value = !0, c.value = void 0, t.debug("Fetching public bot", { handle: r.handle });
|
|
6231
6203
|
let e = await i.user.getPublicBot({ handle: r.handle });
|
|
6232
6204
|
e ? (s.value = e, t.debug("Successfully fetched public bot", {
|
|
@@ -6278,15 +6250,15 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6278
6250
|
});
|
|
6279
6251
|
}
|
|
6280
6252
|
}
|
|
6281
|
-
return ne(loadBot), (t, n) => (R(), x("div",
|
|
6282
|
-
sdk:
|
|
6253
|
+
return ne(loadBot), (t, n) => (R(), x("div", Ro, [a.value ? (R(), x("div", zo, [w("div", { class: j(["size-6 animate-spin rounded-full border-b-2", r.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : s.value ? ce(t.$slots, "default", {
|
|
6254
|
+
sdk: ue(i),
|
|
6283
6255
|
bot: s.value,
|
|
6284
6256
|
context: e.clientContext ?? e.context,
|
|
6285
6257
|
firstMessage: e.firstMessage,
|
|
6286
6258
|
buttonText: e.buttonText,
|
|
6287
6259
|
buttonIcon: e.buttonIcon,
|
|
6288
6260
|
loading: a.value
|
|
6289
|
-
}, void 0, void 0, 1) : c.value ? (R(), x("div",
|
|
6261
|
+
}, void 0, void 0, 1) : c.value ? (R(), x("div", Bo, [n[0] || (n[0] = w("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), w("button", {
|
|
6290
6262
|
type: "button",
|
|
6291
6263
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
6292
6264
|
"data-test": "bot-unavailable-retry",
|
|
@@ -6294,7 +6266,6 @@ var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
|
6294
6266
|
}, " Try again ")])) : b("", !0)]));
|
|
6295
6267
|
}
|
|
6296
6268
|
});
|
|
6297
|
-
|
|
6298
|
-
export { Ci as a, Me as c, handleImageError as d, parseButtonTemplate as f, _e as h, Ni as i, Ae as l, Y as m, jo as n, Ve as o, BotChatController as p, ba as r, Pe as s, Fo as t, getBotAvatarUrl as u };
|
|
6269
|
+
export { ki as a, Ne as c, handleImageError as d, parseButtonTemplate as f, ve as h, zi as i, je as l, Se as m, Lo as n, He as o, BotChatController as p, Ea as r, Fe as s, Vo as t, getBotAvatarUrl as u };
|
|
6299
6270
|
|
|
6300
6271
|
//# sourceMappingURL=BotWrap.js.map
|