@pagelines/sdk 1.0.708 → 1.0.710
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/AgentWrap.js +872 -788
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/ui/ChatCardBlock.vue.d.ts +12 -0
- package/dist/agent/ui/ChatRichText.vue.d.ts +5 -1
- package/dist/contract.js +166 -127
- package/dist/contract.js.map +1 -1
- package/dist/widget.js +1 -1
- package/package.json +1 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./rolldown-runtime.js";
|
|
2
2
|
import { s as e, t } from "./sdkClient.js";
|
|
3
|
-
import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s,
|
|
4
|
-
import { Fragment as
|
|
3
|
+
import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatCardFencePayload as c, parseChatVisualFencePayload as u } from "@pagelines/core";
|
|
4
|
+
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as _, createElementVNode as v, createTextVNode as te, createVNode as b, defineComponent as x, nextTick as ne, normalizeClass as S, normalizeStyle as C, onBeforeUnmount as re, onMounted as ie, onUnmounted as ae, openBlock as T, ref as k, renderList as A, renderSlot as oe, resolveDynamicComponent as j, shallowRef as se, toDisplayString as P, unref as ce, vModelText as ue, watch as de, withCtx as F, withDirectives as pe, withKeys as he, withModifiers as I } from "vue";
|
|
5
5
|
//#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var R = { class: "spinner max-w-sm" }, z = {
|
|
7
7
|
class: "ring-circular h-full w-full origin-center",
|
|
8
8
|
viewBox: "25 25 50 50"
|
|
9
|
-
},
|
|
9
|
+
}, _e = /* @__PURE__ */ x({
|
|
10
10
|
__name: "FSpinner",
|
|
11
11
|
props: {
|
|
12
12
|
width: {
|
|
@@ -19,8 +19,8 @@ var de = { class: "spinner max-w-sm" }, B = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
setup(e) {
|
|
22
|
-
return (t, n) => (
|
|
23
|
-
class:
|
|
22
|
+
return (t, n) => (T(), _("div", R, [(T(), _("svg", z, [v("circle", {
|
|
23
|
+
class: S([e.colorMode, "ring-path"]),
|
|
24
24
|
cx: "50",
|
|
25
25
|
cy: "50",
|
|
26
26
|
r: "20",
|
|
@@ -30,7 +30,7 @@ var de = { class: "spinner max-w-sm" }, B = {
|
|
|
30
30
|
"stroke-miterlimit": "30"
|
|
31
31
|
}, null, 2)]))]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), ve = [
|
|
34
34
|
{
|
|
35
35
|
mode: "self",
|
|
36
36
|
label: "Overview",
|
|
@@ -70,10 +70,10 @@ function recorderMimeType() {
|
|
|
70
70
|
}
|
|
71
71
|
var VoiceRecorderController = class extends i {
|
|
72
72
|
constructor(t) {
|
|
73
|
-
super("VoiceRecorderController", t), e(this, "state",
|
|
73
|
+
super("VoiceRecorderController", t), e(this, "state", k({
|
|
74
74
|
phase: "idle",
|
|
75
75
|
elapsedMs: 0
|
|
76
|
-
})), e(this, "isActive",
|
|
76
|
+
})), e(this, "isActive", p(() => this.state.value.phase !== "idle")), e(this, "isBusy", p(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", p(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", p(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
|
|
77
77
|
}
|
|
78
78
|
get canUseBrowserRecording() {
|
|
79
79
|
return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
|
|
@@ -185,7 +185,7 @@ var VoiceRecorderController = class extends i {
|
|
|
185
185
|
function durableJournalOutcome(e) {
|
|
186
186
|
return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
|
|
187
187
|
}
|
|
188
|
-
var
|
|
188
|
+
var B = {
|
|
189
189
|
waiting: "Waiting for results",
|
|
190
190
|
finishing: "Finishing up",
|
|
191
191
|
completed: "Work complete",
|
|
@@ -193,7 +193,7 @@ var _e = {
|
|
|
193
193
|
stopped: "Stopped",
|
|
194
194
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
195
195
|
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
196
|
-
},
|
|
196
|
+
}, ye = 15e3, H = 6e4, be = 3;
|
|
197
197
|
function toMs(e) {
|
|
198
198
|
if (!e) return;
|
|
199
199
|
let t = Date.parse(e);
|
|
@@ -209,7 +209,7 @@ function milestoneRows(e, t) {
|
|
|
209
209
|
let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
|
|
210
210
|
for (let e of n) {
|
|
211
211
|
let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
|
|
212
|
-
if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <=
|
|
212
|
+
if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= ye) {
|
|
213
213
|
n.count += 1, n.lastMs = eventMs(e);
|
|
214
214
|
continue;
|
|
215
215
|
}
|
|
@@ -230,12 +230,12 @@ function milestoneRows(e, t) {
|
|
|
230
230
|
}));
|
|
231
231
|
}
|
|
232
232
|
function splitRows(e) {
|
|
233
|
-
return e.length <=
|
|
233
|
+
return e.length <= be ? {
|
|
234
234
|
visibleRows: e,
|
|
235
235
|
hiddenRows: []
|
|
236
236
|
} : {
|
|
237
|
-
visibleRows: e.slice(e.length -
|
|
238
|
-
hiddenRows: e.slice(0, e.length -
|
|
237
|
+
visibleRows: e.slice(e.length - be),
|
|
238
|
+
hiddenRows: e.slice(0, e.length - be)
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
function buildWorkJournalModel(e) {
|
|
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
|
|
|
247
247
|
terminal: {
|
|
248
248
|
id: "work-complete",
|
|
249
249
|
tone: "completed",
|
|
250
|
-
label:
|
|
250
|
+
label: B.completed
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
if (n === "failed") {
|
|
@@ -261,7 +261,7 @@ function buildWorkJournalModel(e) {
|
|
|
261
261
|
terminal: {
|
|
262
262
|
id: "work-failed",
|
|
263
263
|
tone: "failed",
|
|
264
|
-
label:
|
|
264
|
+
label: B.failed,
|
|
265
265
|
...o && e?.note ? { note: e.note } : {}
|
|
266
266
|
}
|
|
267
267
|
};
|
|
@@ -275,25 +275,25 @@ function buildWorkJournalModel(e) {
|
|
|
275
275
|
terminal: {
|
|
276
276
|
id: "work-stopped",
|
|
277
277
|
tone: "stopped",
|
|
278
|
-
label:
|
|
278
|
+
label: B.stopped
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), u = 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) => {
|
|
283
283
|
let n = toMs(t.startedAt) ?? toMs(t.endedAt);
|
|
284
284
|
return n === void 0 ? e : Math.min(e, n);
|
|
285
|
-
}, Infinity), h = p +
|
|
285
|
+
}, Infinity), h = p + ye, _ = (Number.isFinite(m) ? m : p) + H, v = r >= h, te = u || v ? {
|
|
286
286
|
id: u?.activityId ?? "work-active",
|
|
287
287
|
tone: "active",
|
|
288
|
-
label: v ? u ?
|
|
289
|
-
} : void 0,
|
|
288
|
+
label: v ? u ? B.waiting : B.finishing : u.label
|
|
289
|
+
} : void 0, b = v && r >= _ ? i ? B.notifyHint : B.leaveHint : void 0, x = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
|
|
290
290
|
return {
|
|
291
291
|
outcome: n,
|
|
292
292
|
visibleRows: s,
|
|
293
293
|
hiddenRows: c,
|
|
294
|
-
...
|
|
295
|
-
...
|
|
296
|
-
...
|
|
294
|
+
...te ? { terminal: te } : {},
|
|
295
|
+
...b ? { hint: b } : {},
|
|
296
|
+
...x === void 0 ? {} : { nextBoundaryAtMs: x }
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
function buildLiveTurnBlocks(e) {
|
|
@@ -352,17 +352,17 @@ function buildLiveTurnBlocks(e) {
|
|
|
352
352
|
}
|
|
353
353
|
//#endregion
|
|
354
354
|
//#region agent/AgentController.ts
|
|
355
|
-
var
|
|
356
|
-
...
|
|
355
|
+
var U = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Se = /* @__PURE__ */ new Set([
|
|
356
|
+
...U,
|
|
357
357
|
"EMPTY_STREAM",
|
|
358
358
|
"RATE_LIMIT"
|
|
359
|
-
]),
|
|
359
|
+
]), W = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Ce = {
|
|
360
360
|
CREDIT_LIMIT: "billing_budget_reached",
|
|
361
361
|
OVERAGE_CAP: "billing_runaway_cap"
|
|
362
362
|
};
|
|
363
363
|
function presentChatStreamError(e) {
|
|
364
|
-
if (!(e.bucket !== void 0 ||
|
|
365
|
-
let t = e.bucket ?? (
|
|
364
|
+
if (!(e.bucket !== void 0 || Se.has(e.code))) return { surface: "hard" };
|
|
365
|
+
let t = e.bucket ?? (U.has(e.code) ? "account" : "error"), n = {
|
|
366
366
|
...e.actionLabel ? { actionLabel: e.actionLabel } : {},
|
|
367
367
|
...e.actionUrl ? { actionUrl: e.actionUrl } : {},
|
|
368
368
|
...e.help ? { help: e.help } : {}
|
|
@@ -375,7 +375,7 @@ function presentChatStreamError(e) {
|
|
|
375
375
|
...n
|
|
376
376
|
},
|
|
377
377
|
sendBlockedReason: "account"
|
|
378
|
-
} :
|
|
378
|
+
} : W.has(e.code) ? {
|
|
379
379
|
surface: "transcript",
|
|
380
380
|
issue: {
|
|
381
381
|
code: e.code,
|
|
@@ -393,7 +393,7 @@ function presentChatStreamError(e) {
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
function transcriptMessageForChatStreamError(e) {
|
|
396
|
-
let t =
|
|
396
|
+
let t = Ce[e.code];
|
|
397
397
|
return t ? r[t].oneLine : e.error;
|
|
398
398
|
}
|
|
399
399
|
var AgentChatController = class extends i {
|
|
@@ -401,16 +401,16 @@ var AgentChatController = class extends i {
|
|
|
401
401
|
super("AgentChatController", t), e(this, "isTextMode", !1), e(this, "lastMessage", {
|
|
402
402
|
hash: "",
|
|
403
403
|
time: 0
|
|
404
|
-
}), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs",
|
|
404
|
+
}), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", se(Date.now())), e(this, "toolActivityTiming", se({})), e(this, "lastVisibleProgressAtMs", se()), e(this, "liveSegments", se([])), e(this, "liveStreamMessageId", se(void 0)), e(this, "conversationId", void 0), e(this, "textState", k({
|
|
405
405
|
isActive: !1,
|
|
406
406
|
isConnected: !1,
|
|
407
407
|
isThinking: !1,
|
|
408
408
|
connectionStatus: "disconnected"
|
|
409
|
-
})), e(this, "agentMode",
|
|
409
|
+
})), e(this, "agentMode", k("self")), e(this, "sharedMessages", k([])), e(this, "composerState", k({
|
|
410
410
|
text: "",
|
|
411
411
|
pendingAttachments: [],
|
|
412
412
|
isUploading: !1
|
|
413
|
-
})), e(this, "workJournal",
|
|
413
|
+
})), e(this, "workJournal", p(() => {
|
|
414
414
|
let e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
|
|
415
415
|
if (!e) return;
|
|
416
416
|
let t = this.textState.value.toolActivities;
|
|
@@ -421,7 +421,7 @@ var AgentChatController = class extends i {
|
|
|
421
421
|
canNotifyOnCompletion: !1,
|
|
422
422
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
423
423
|
});
|
|
424
|
-
})), e(this, "liveTurnBlocks",
|
|
424
|
+
})), e(this, "liveTurnBlocks", p(() => {
|
|
425
425
|
if (!this.textState.value.isThinking) return [];
|
|
426
426
|
let e = this.textState.value.toolActivities ?? [], t = this.liveSegments.value;
|
|
427
427
|
return !t.length && !e.length ? [] : buildLiveTurnBlocks({
|
|
@@ -431,14 +431,14 @@ var AgentChatController = class extends i {
|
|
|
431
431
|
canNotifyOnCompletion: !1,
|
|
432
432
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
433
433
|
});
|
|
434
|
-
})), e(this, "canUseComposer",
|
|
434
|
+
})), e(this, "canUseComposer", p(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading && !this.textState.value.isThinking)), e(this, "canAttachFile", p(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", p(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
|
|
435
435
|
getCanRecord: () => this.canRecordAudio.value,
|
|
436
436
|
getUploadFn: () => {
|
|
437
437
|
let e = this.settings.uploadFileFn;
|
|
438
438
|
return e ? (t) => e({ file: t }) : void 0;
|
|
439
439
|
},
|
|
440
440
|
getChatController: () => this
|
|
441
|
-
})), e(this, "canSend",
|
|
441
|
+
})), e(this, "canSend", p(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", p(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", p(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle")), e(this, "_agent", void 0), this._agent = t.agent instanceof n ? t.agent : new n({ config: t.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
|
|
442
442
|
}
|
|
443
443
|
get chatEnabled() {
|
|
444
444
|
let e = this._agent.state.value.lifecycle;
|
|
@@ -577,7 +577,7 @@ Current User:
|
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
579
|
setupBoundaryWatcher() {
|
|
580
|
-
|
|
580
|
+
de(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
|
|
581
581
|
this.scheduleBoundary(e);
|
|
582
582
|
});
|
|
583
583
|
}
|
|
@@ -639,12 +639,12 @@ Current User:
|
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
641
|
setupModeWatcher() {
|
|
642
|
-
|
|
642
|
+
de(this.agentMode, async (e, t) => {
|
|
643
643
|
this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
646
|
setupAvailabilityWatcher() {
|
|
647
|
-
|
|
647
|
+
de(() => this.chatEnabled, (e) => {
|
|
648
648
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
649
649
|
if (e) {
|
|
650
650
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -779,7 +779,7 @@ Current User:
|
|
|
779
779
|
let e = i[i.length - 1];
|
|
780
780
|
this.sharedMessages.value = e?.id === a ? [...i.slice(0, -1), r] : [...i, r];
|
|
781
781
|
}
|
|
782
|
-
r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code &&
|
|
782
|
+
r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && W.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
783
783
|
}, onDone = (e) => {
|
|
784
784
|
if (!isCurrentTurn()) return;
|
|
785
785
|
if (!o && !c) {
|
|
@@ -949,10 +949,10 @@ function parseButtonTemplate(e) {
|
|
|
949
949
|
}
|
|
950
950
|
//#endregion
|
|
951
951
|
//#region agent/ui/ElAgentButton.vue?vue&type=script&setup=true&lang.ts
|
|
952
|
-
var
|
|
952
|
+
var we = {
|
|
953
953
|
key: 0,
|
|
954
954
|
class: "absolute inset-0 flex items-center justify-center"
|
|
955
|
-
},
|
|
955
|
+
}, Te = /* @__PURE__ */ x({
|
|
956
956
|
__name: "ElAgentButton",
|
|
957
957
|
props: {
|
|
958
958
|
theme: { default: "primary" },
|
|
@@ -965,40 +965,40 @@ var Ce = {
|
|
|
965
965
|
iconAfter: {}
|
|
966
966
|
},
|
|
967
967
|
setup(e) {
|
|
968
|
-
let t =
|
|
968
|
+
let t = p(() => ({
|
|
969
969
|
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
970
970
|
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
971
971
|
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
972
972
|
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",
|
|
973
973
|
dark: "bg-theme-900 border-transparent hover:bg-theme-800"
|
|
974
|
-
})[e.theme]), n =
|
|
974
|
+
})[e.theme]), n = p(() => ({
|
|
975
975
|
sm: "px-4 py-2 text-sm",
|
|
976
976
|
md: "px-6 py-3 text-base",
|
|
977
977
|
lg: "px-8 py-4 text-base"
|
|
978
|
-
})[e.size]), r =
|
|
978
|
+
})[e.size]), r = p(() => ({
|
|
979
979
|
sm: "size-4",
|
|
980
980
|
md: "size-4",
|
|
981
981
|
lg: "size-5"
|
|
982
982
|
})[e.size]);
|
|
983
|
-
return (i, a) => (
|
|
984
|
-
e.icon ? (
|
|
983
|
+
return (i, a) => (T(), _("button", { class: S(["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 ? (T(), _("div", we, [...a[0] || (a[0] = [v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : h("", !0), v("span", { class: S(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
|
|
984
|
+
e.icon ? (T(), _("i", {
|
|
985
985
|
key: 0,
|
|
986
|
-
class:
|
|
987
|
-
}, null, 2)) :
|
|
988
|
-
|
|
989
|
-
e.iconAfter ? (
|
|
986
|
+
class: S([e.icon, r.value])
|
|
987
|
+
}, null, 2)) : h("", !0),
|
|
988
|
+
oe(i.$slots, "default"),
|
|
989
|
+
e.iconAfter ? (T(), _("i", {
|
|
990
990
|
key: 1,
|
|
991
|
-
class:
|
|
992
|
-
}, null, 2)) :
|
|
991
|
+
class: S([e.iconAfter, r.value])
|
|
992
|
+
}, null, 2)) : h("", !0)
|
|
993
993
|
], 2)], 2));
|
|
994
994
|
}
|
|
995
|
-
}),
|
|
995
|
+
}), Ee = ["value"], De = /* @__PURE__ */ x({
|
|
996
996
|
__name: "AgentInputEmail",
|
|
997
997
|
props: { modelValue: { default: "" } },
|
|
998
998
|
emits: ["update:modelValue"],
|
|
999
999
|
setup(e, { emit: t }) {
|
|
1000
1000
|
let n = t;
|
|
1001
|
-
return (t, r) => (
|
|
1001
|
+
return (t, r) => (T(), _("input", {
|
|
1002
1002
|
name: "username",
|
|
1003
1003
|
type: "email",
|
|
1004
1004
|
inputmode: "email",
|
|
@@ -1011,9 +1011,9 @@ var Ce = {
|
|
|
1011
1011
|
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",
|
|
1012
1012
|
style: { "font-size": "16px" },
|
|
1013
1013
|
onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
|
|
1014
|
-
}, null, 40,
|
|
1014
|
+
}, null, 40, Ee));
|
|
1015
1015
|
}
|
|
1016
|
-
}),
|
|
1016
|
+
}), Oe = ["placeholder", "value"], ke = /* @__PURE__ */ x({
|
|
1017
1017
|
__name: "AgentInputOneTimeCode",
|
|
1018
1018
|
props: {
|
|
1019
1019
|
modelValue: {},
|
|
@@ -1022,15 +1022,15 @@ var Ce = {
|
|
|
1022
1022
|
},
|
|
1023
1023
|
emits: ["update:modelValue", "autoSubmit"],
|
|
1024
1024
|
setup(e, { emit: t }) {
|
|
1025
|
-
let n = e, r = t, i =
|
|
1026
|
-
|
|
1025
|
+
let n = e, r = t, i = k(null), a = p(() => "0".repeat(n.length));
|
|
1026
|
+
ie(() => {
|
|
1027
1027
|
n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
|
|
1028
1028
|
});
|
|
1029
1029
|
function onInput(e) {
|
|
1030
1030
|
let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
|
|
1031
1031
|
r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
|
|
1032
1032
|
}
|
|
1033
|
-
return (t, n) => (
|
|
1033
|
+
return (t, n) => (T(), _("input", {
|
|
1034
1034
|
ref_key: "input",
|
|
1035
1035
|
ref: i,
|
|
1036
1036
|
name: "one-time-code",
|
|
@@ -1046,9 +1046,9 @@ var Ce = {
|
|
|
1046
1046
|
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",
|
|
1047
1047
|
style: { "font-size": "16px" },
|
|
1048
1048
|
onInput
|
|
1049
|
-
}, null, 40,
|
|
1049
|
+
}, null, 40, Oe));
|
|
1050
1050
|
}
|
|
1051
|
-
}),
|
|
1051
|
+
}), G = { class: "relative flex-shrink-0" }, Ae = ["src", "alt"], je = { class: "absolute top-1 right-1" }, Me = {
|
|
1052
1052
|
key: 1,
|
|
1053
1053
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
1054
1054
|
}, Ne = { class: "min-w-0" }, Pe = /* @__PURE__ */ x({
|
|
@@ -1063,15 +1063,15 @@ var Ce = {
|
|
|
1063
1063
|
layout: { default: "centered" }
|
|
1064
1064
|
},
|
|
1065
1065
|
setup(e) {
|
|
1066
|
-
return (t, n) => (
|
|
1066
|
+
return (t, n) => (T(), _("div", { class: S(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [v("div", G, [v("div", { class: S(["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"]) }, [v("img", {
|
|
1067
1067
|
src: e.agent.avatarUrl.value,
|
|
1068
1068
|
alt: e.agent.displayName.value,
|
|
1069
1069
|
class: "w-full h-full object-cover",
|
|
1070
|
-
onError: n[0] || (n[0] = (...e) =>
|
|
1071
|
-
}, null, 40, Ae)], 2),
|
|
1070
|
+
onError: n[0] || (n[0] = (...e) => ce(handleImageError) && ce(handleImageError)(...e))
|
|
1071
|
+
}, null, 40, Ae)], 2), v("div", je, [e.isOnline ? (T(), _(f, { key: 0 }, [n[1] || (n[1] = v("div", {
|
|
1072
1072
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1073
1073
|
style: { "animation-duration": "3s" }
|
|
1074
|
-
}, null, -1)), n[2] || (n[2] =
|
|
1074
|
+
}, null, -1)), n[2] || (n[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (T(), _("div", Me))])]), v("div", Ne, [v("h1", { class: S(["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" : ""]]) }, P(e.agent.displayName.value), 3), v("p", { class: S(["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"]]) }, P(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
|
|
1075
1075
|
}
|
|
1076
1076
|
}), Fe = { class: "relative shrink-0 rounded-full" }, Ie = ["src", "alt"], Le = ["src", "alt"], Re = ["aria-label"], ze = /* @__PURE__ */ x({
|
|
1077
1077
|
__name: "AgentAvatar",
|
|
@@ -1092,7 +1092,7 @@ var Ce = {
|
|
|
1092
1092
|
amber: "bg-amber-500",
|
|
1093
1093
|
red: "bg-red-500",
|
|
1094
1094
|
grey: "bg-theme-300"
|
|
1095
|
-
}, n =
|
|
1095
|
+
}, n = p(() => {
|
|
1096
1096
|
let n = e.agent.state.value;
|
|
1097
1097
|
return e.showStatus && n.lifecycle !== "unknown" ? t[n.color] : null;
|
|
1098
1098
|
}), r = {
|
|
@@ -1100,32 +1100,32 @@ var Ce = {
|
|
|
1100
1100
|
height: "clamp(7px, 14%, 14px)",
|
|
1101
1101
|
top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
|
|
1102
1102
|
right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
|
|
1103
|
-
}, i =
|
|
1104
|
-
return (t, a) => (
|
|
1105
|
-
|
|
1103
|
+
}, i = p(() => e.isLight ? "ring-white" : "ring-theme-900");
|
|
1104
|
+
return (t, a) => (T(), _("div", Fe, [
|
|
1105
|
+
v("img", {
|
|
1106
1106
|
src: e.agent.avatarUrl.value,
|
|
1107
1107
|
alt: e.agent.displayName.value,
|
|
1108
|
-
class:
|
|
1108
|
+
class: S(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
|
|
1109
1109
|
}, null, 10, Ie),
|
|
1110
|
-
e.agent.ownerMarkUrl.value ? (
|
|
1110
|
+
e.agent.ownerMarkUrl.value ? (T(), _("img", {
|
|
1111
1111
|
key: 0,
|
|
1112
1112
|
src: e.agent.ownerMarkUrl.value,
|
|
1113
1113
|
alt: e.agent.owner.value?.fullName ? `Owned by ${e.agent.owner.value.fullName}` : "Owner",
|
|
1114
|
-
class:
|
|
1115
|
-
}, null, 10, Le)) :
|
|
1116
|
-
n.value ? (
|
|
1114
|
+
class: S(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
|
|
1115
|
+
}, null, 10, Le)) : h("", !0),
|
|
1116
|
+
n.value ? (T(), _("span", {
|
|
1117
1117
|
key: 1,
|
|
1118
1118
|
role: "status",
|
|
1119
1119
|
"aria-label": e.agent.state.value.tooltip,
|
|
1120
|
-
class:
|
|
1120
|
+
class: S(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
|
|
1121
1121
|
style: r
|
|
1122
|
-
}, null, 10, Re)) :
|
|
1123
|
-
n.value && e.agent.state.value.lifecycle === "running" ? (
|
|
1122
|
+
}, null, 10, Re)) : h("", !0),
|
|
1123
|
+
n.value && e.agent.state.value.lifecycle === "running" ? (T(), _("span", {
|
|
1124
1124
|
key: 2,
|
|
1125
1125
|
"aria-hidden": "true",
|
|
1126
|
-
class:
|
|
1126
|
+
class: S(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
|
|
1127
1127
|
style: r
|
|
1128
|
-
}, null, 2)) :
|
|
1128
|
+
}, null, 2)) : h("", !0)
|
|
1129
1129
|
]));
|
|
1130
1130
|
}
|
|
1131
1131
|
}), Be = {
|
|
@@ -1133,7 +1133,7 @@ var Ce = {
|
|
|
1133
1133
|
class: "sr-only",
|
|
1134
1134
|
role: "status",
|
|
1135
1135
|
"aria-live": "polite"
|
|
1136
|
-
},
|
|
1136
|
+
}, K = ["aria-expanded", "disabled"], Ve = ["aria-expanded"], He = {
|
|
1137
1137
|
class: "flex w-5 shrink-0 justify-center self-stretch",
|
|
1138
1138
|
"aria-hidden": "true"
|
|
1139
1139
|
}, Ue = ["data-journal-row"], We = {
|
|
@@ -1149,18 +1149,18 @@ var Ce = {
|
|
|
1149
1149
|
isLight: { type: Boolean }
|
|
1150
1150
|
},
|
|
1151
1151
|
setup(e) {
|
|
1152
|
-
let t = e, n =
|
|
1152
|
+
let t = e, n = se(!1);
|
|
1153
1153
|
function toggle() {
|
|
1154
1154
|
n.value = !n.value;
|
|
1155
1155
|
}
|
|
1156
|
-
let r =
|
|
1156
|
+
let r = p(() => t.model.outcome === "completed"), i = p(() => t.model.hiddenRows.length), a = p(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = p(() => {
|
|
1157
1157
|
let e = t.model;
|
|
1158
1158
|
return r.value ? n.value ? e.hiddenRows : [] : [
|
|
1159
1159
|
...n.value ? e.hiddenRows : [],
|
|
1160
1160
|
...e.visibleRows,
|
|
1161
1161
|
...e.terminal ? [e.terminal] : []
|
|
1162
1162
|
];
|
|
1163
|
-
}), s =
|
|
1163
|
+
}), s = p(() => t.isLight ? {
|
|
1164
1164
|
spine: "bg-theme-200",
|
|
1165
1165
|
dashed: "border-theme-300",
|
|
1166
1166
|
doneMark: "text-theme-400",
|
|
@@ -1176,7 +1176,7 @@ var Ce = {
|
|
|
1176
1176
|
stoppedSquare: "bg-white/55",
|
|
1177
1177
|
muted: "text-white/55",
|
|
1178
1178
|
ring: "focus-visible:ring-white"
|
|
1179
|
-
}), c =
|
|
1179
|
+
}), c = p(() => {
|
|
1180
1180
|
let e = t.isLight;
|
|
1181
1181
|
return {
|
|
1182
1182
|
done: {
|
|
@@ -1219,64 +1219,64 @@ var Ce = {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
};
|
|
1221
1221
|
});
|
|
1222
|
-
return (t,
|
|
1223
|
-
a.value ? (
|
|
1224
|
-
r.value ? (
|
|
1222
|
+
return (t, u) => (T(), _("div", { class: S(["w-full py-0.5", s.value.muted]) }, [
|
|
1223
|
+
a.value ? (T(), _("span", Be, P(a.value), 1)) : h("", !0),
|
|
1224
|
+
r.value ? (T(), _("button", {
|
|
1225
1225
|
key: 1,
|
|
1226
1226
|
type: "button",
|
|
1227
1227
|
"data-test": "messaging-tool-activity-summary",
|
|
1228
1228
|
"data-journal-disclosure": "",
|
|
1229
1229
|
"aria-expanded": n.value,
|
|
1230
1230
|
disabled: i.value === 0,
|
|
1231
|
-
class:
|
|
1231
|
+
class: S(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
|
|
1232
1232
|
onClick: toggle
|
|
1233
1233
|
}, [
|
|
1234
|
-
|
|
1234
|
+
u[0] || (u[0] = v("i", {
|
|
1235
1235
|
"data-journal-station": "completed",
|
|
1236
1236
|
class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
|
|
1237
1237
|
"aria-hidden": "true"
|
|
1238
1238
|
}, null, -1)),
|
|
1239
|
-
|
|
1240
|
-
i.value ? (
|
|
1239
|
+
v("span", { class: S(["text-[12.5px] font-medium leading-none", s.value.muted]) }, P(e.model.terminal?.label), 3),
|
|
1240
|
+
i.value ? (T(), _("i", {
|
|
1241
1241
|
key: 0,
|
|
1242
|
-
class:
|
|
1242
|
+
class: S(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
|
|
1243
1243
|
"aria-hidden": "true"
|
|
1244
|
-
}, null, 2)) :
|
|
1245
|
-
], 10,
|
|
1244
|
+
}, null, 2)) : h("", !0)
|
|
1245
|
+
], 10, K)) : i.value ? (T(), _("button", {
|
|
1246
1246
|
key: 2,
|
|
1247
1247
|
type: "button",
|
|
1248
1248
|
"data-test": "messaging-tool-activity-summary",
|
|
1249
1249
|
"data-journal-disclosure": "",
|
|
1250
1250
|
"aria-expanded": n.value,
|
|
1251
|
-
class:
|
|
1251
|
+
class: S(["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]),
|
|
1252
1252
|
onClick: toggle
|
|
1253
|
-
}, [
|
|
1253
|
+
}, [v("span", He, [v("span", {
|
|
1254
1254
|
"data-journal-spine": "dashed",
|
|
1255
|
-
class:
|
|
1256
|
-
}, null, 2)]),
|
|
1257
|
-
class:
|
|
1255
|
+
class: S(["w-0 border-l border-dashed", s.value.dashed])
|
|
1256
|
+
}, null, 2)]), v("span", { class: S(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [te(P(i.value) + " earlier updates ", 1), v("i", {
|
|
1257
|
+
class: S(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1258
1258
|
"aria-hidden": "true"
|
|
1259
|
-
}, null, 2)], 2)], 10,
|
|
1260
|
-
(
|
|
1259
|
+
}, null, 2)], 2)], 10, Ve)) : h("", !0),
|
|
1260
|
+
(T(!0), _(f, null, A(o.value, (e, t) => (T(), _("div", {
|
|
1261
1261
|
key: e.id,
|
|
1262
1262
|
"data-test": "messaging-tool-activity-row",
|
|
1263
1263
|
"data-journal-row": e.tone,
|
|
1264
|
-
class:
|
|
1265
|
-
}, [
|
|
1264
|
+
class: S([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
|
|
1265
|
+
}, [v("div", We, [v("span", Ge, [(T(), m(j(c.value[e.tone].station.tag), {
|
|
1266
1266
|
"data-journal-station": e.tone,
|
|
1267
|
-
class:
|
|
1268
|
-
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ?
|
|
1267
|
+
class: S(c.value[e.tone].station.class)
|
|
1268
|
+
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? h("", !0) : (T(), _("span", {
|
|
1269
1269
|
key: 0,
|
|
1270
|
-
class:
|
|
1271
|
-
}, null, 2))]),
|
|
1270
|
+
class: S(["w-px flex-1", s.value.spine])
|
|
1271
|
+
}, null, 2))]), v("div", { class: S(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [v("span", { class: S(["relative block leading-snug", c.value[e.tone].label]) }, [te(P(e.label), 1), c.value[e.tone].statusWord ? (T(), _("span", Ke, ", " + P(c.value[e.tone].statusWord), 1)) : h("", !0)], 2), e.note ? (T(), _("p", {
|
|
1272
1272
|
key: 0,
|
|
1273
|
-
class:
|
|
1274
|
-
},
|
|
1275
|
-
!r.value && e.model.hint ? (
|
|
1273
|
+
class: S(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
|
|
1274
|
+
}, P(e.note), 3)) : h("", !0)], 2)], 10, Ue))), 128)),
|
|
1275
|
+
!r.value && e.model.hint ? (T(), _("p", {
|
|
1276
1276
|
key: 3,
|
|
1277
1277
|
"data-test": "messaging-tool-activity-hint",
|
|
1278
|
-
class:
|
|
1279
|
-
},
|
|
1278
|
+
class: S(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
|
|
1279
|
+
}, P(e.model.hint), 3)) : h("", !0)
|
|
1280
1280
|
], 2));
|
|
1281
1281
|
}
|
|
1282
1282
|
});
|
|
@@ -1321,10 +1321,10 @@ function _unsupportedIterableToArray(e, t) {
|
|
|
1321
1321
|
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;
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
|
-
var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor,
|
|
1325
|
-
|
|
1324
|
+
var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, q = Object.freeze, J = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
|
|
1325
|
+
q || (q = function freeze(e) {
|
|
1326
1326
|
return e;
|
|
1327
|
-
}),
|
|
1327
|
+
}), J || (J = function seal(e) {
|
|
1328
1328
|
return e;
|
|
1329
1329
|
}), tt || (tt = function apply(e, t) {
|
|
1330
1330
|
var n = [...arguments].slice(2);
|
|
@@ -1332,7 +1332,7 @@ K || (K = function freeze(e) {
|
|
|
1332
1332
|
}), nt || (nt = function construct(e) {
|
|
1333
1333
|
return new e(...[...arguments].slice(1));
|
|
1334
1334
|
});
|
|
1335
|
-
var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString),
|
|
1335
|
+
var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), X = unapply(Object.prototype.hasOwnProperty), bt = unapply(Object.prototype.toString), Z = unapply(RegExp.prototype.test), xt = unconstruct(TypeError);
|
|
1336
1336
|
function unapply(e) {
|
|
1337
1337
|
return function(t) {
|
|
1338
1338
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1360,7 +1360,7 @@ function addToSet(e, t) {
|
|
|
1360
1360
|
return e;
|
|
1361
1361
|
}
|
|
1362
1362
|
function cleanArray(e) {
|
|
1363
|
-
for (let t = 0; t < e.length; t++)
|
|
1363
|
+
for (let t = 0; t < e.length; t++) X(e, t) || (e[t] = null);
|
|
1364
1364
|
return e;
|
|
1365
1365
|
}
|
|
1366
1366
|
function clone(e) {
|
|
@@ -1368,7 +1368,7 @@ function clone(e) {
|
|
|
1368
1368
|
for (let r of Je(e)) {
|
|
1369
1369
|
var n = _slicedToArray(r, 2);
|
|
1370
1370
|
let i = n[0], a = n[1];
|
|
1371
|
-
|
|
1371
|
+
X(e, i) && (lt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
|
|
1372
1372
|
}
|
|
1373
1373
|
return t;
|
|
1374
1374
|
}
|
|
@@ -1409,12 +1409,12 @@ function lookupGetter(e, t) {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
function isRegex(e) {
|
|
1411
1411
|
try {
|
|
1412
|
-
return
|
|
1412
|
+
return Z(e, ""), !0;
|
|
1413
1413
|
} catch {
|
|
1414
1414
|
return !1;
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
var St =
|
|
1417
|
+
var St = q(/* @__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(".")), Ct = q(/* @__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(".")), wt = q([
|
|
1418
1418
|
"feBlend",
|
|
1419
1419
|
"feColorMatrix",
|
|
1420
1420
|
"feComponentTransfer",
|
|
@@ -1440,7 +1440,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1440
1440
|
"feSpotLight",
|
|
1441
1441
|
"feTile",
|
|
1442
1442
|
"feTurbulence"
|
|
1443
|
-
]), Tt =
|
|
1443
|
+
]), Tt = q([
|
|
1444
1444
|
"animate",
|
|
1445
1445
|
"color-profile",
|
|
1446
1446
|
"cursor",
|
|
@@ -1463,7 +1463,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1463
1463
|
"solidcolor",
|
|
1464
1464
|
"unknown",
|
|
1465
1465
|
"use"
|
|
1466
|
-
]), Et =
|
|
1466
|
+
]), Et = q(/* @__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(".")), Dt = q([
|
|
1467
1467
|
"maction",
|
|
1468
1468
|
"maligngroup",
|
|
1469
1469
|
"malignmark",
|
|
@@ -1479,13 +1479,13 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1479
1479
|
"annotation-xml",
|
|
1480
1480
|
"mprescripts",
|
|
1481
1481
|
"none"
|
|
1482
|
-
]), Ot =
|
|
1482
|
+
]), Ot = q(["#text"]), kt = q(/* @__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(".")), At = q(/* @__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.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.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(".")), jt = q(/* @__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(".")), Mt = q([
|
|
1483
1483
|
"xlink:href",
|
|
1484
1484
|
"xml:id",
|
|
1485
1485
|
"xlink:title",
|
|
1486
1486
|
"xml:space",
|
|
1487
1487
|
"xmlns:xlink"
|
|
1488
|
-
]), Nt =
|
|
1488
|
+
]), Nt = J(/{{[\w\W]*|^[\w\W]*}}/g), Pt = J(/<%[\w\W]*|^[\w\W]*%>/g), Ft = J(/\${[\w\W]*/g), It = J(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lt = J(/^aria-[\-\w]+$/), Rt = J(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zt = J(/^(?:\w+script|data):/i), Bt = J(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vt = J(/^html$/i), Ht = J(/^[a-z][.\w]*(-[.\w]+)+$/i), Ut = J(/<[/\w!]/g), Wt = J(/<[/\w]/g), Gt = J(/<\/no(script|embed|frames)/i), Kt = J(/\/>/i), qt = {
|
|
1489
1489
|
element: 1,
|
|
1490
1490
|
attribute: 2,
|
|
1491
1491
|
text: 3,
|
|
@@ -1530,7 +1530,7 @@ var St = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1530
1530
|
uponSanitizeShadowNode: []
|
|
1531
1531
|
};
|
|
1532
1532
|
}, Zt = function _resolveSetOption(e, t, n, r) {
|
|
1533
|
-
return
|
|
1533
|
+
return X(e, t) && lt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1534
1534
|
};
|
|
1535
1535
|
function createDOMPurify() {
|
|
1536
1536
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jt(), DOMPurify = (e) => createDOMPurify(e);
|
|
@@ -1539,32 +1539,32 @@ function createDOMPurify() {
|
|
|
1539
1539
|
e.DocumentFragment;
|
|
1540
1540
|
let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
|
|
1541
1541
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
1542
|
-
let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"),
|
|
1542
|
+
let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), te = lookupGetter(f, "shadowRoot"), b = lookupGetter(f, "attributes"), x = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, ne = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
|
|
1543
1543
|
if (typeof i == "function") {
|
|
1544
1544
|
let e = t.createElement("template");
|
|
1545
1545
|
e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
|
|
1546
1546
|
}
|
|
1547
|
-
let
|
|
1548
|
-
if (
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1547
|
+
let S, C = "", re, ie = !1, ae = 0, T = function _assertNotInTrustedTypesPolicy() {
|
|
1548
|
+
if (ae > 0) throw xt("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.");
|
|
1549
|
+
}, k = function _createTrustedHTML(e) {
|
|
1550
|
+
T(), ae++;
|
|
1551
1551
|
try {
|
|
1552
|
-
return
|
|
1552
|
+
return S.createHTML(e);
|
|
1553
1553
|
} finally {
|
|
1554
|
-
|
|
1554
|
+
ae--;
|
|
1555
1555
|
}
|
|
1556
|
-
},
|
|
1557
|
-
|
|
1556
|
+
}, A = function _createTrustedScriptURL(e) {
|
|
1557
|
+
T(), ae++;
|
|
1558
1558
|
try {
|
|
1559
|
-
return
|
|
1559
|
+
return S.createScriptURL(e);
|
|
1560
1560
|
} finally {
|
|
1561
|
-
|
|
1561
|
+
ae--;
|
|
1562
1562
|
}
|
|
1563
|
-
},
|
|
1564
|
-
return
|
|
1565
|
-
},
|
|
1566
|
-
DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" &&
|
|
1567
|
-
let
|
|
1563
|
+
}, oe = function _getDefaultTrustedTypesPolicy() {
|
|
1564
|
+
return ie || (re = Yt(u, r), ie = !0), re;
|
|
1565
|
+
}, j = t, se = j.implementation, P = j.createNodeIterator, ce = j.createDocumentFragment, ue = j.getElementsByTagName, de = n.importNode, F = Xt();
|
|
1566
|
+
DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && se && se.createHTMLDocument !== void 0;
|
|
1567
|
+
let pe = Nt, he = Pt, I = Ft, R = It, z = Lt, _e = zt, ve = Bt, B = Ht, ye = Rt, H = null, be = addToSet({}, [
|
|
1568
1568
|
...St,
|
|
1569
1569
|
...Ct,
|
|
1570
1570
|
...wt,
|
|
@@ -1607,14 +1607,14 @@ function createDOMPurify() {
|
|
|
1607
1607
|
enumerable: !0,
|
|
1608
1608
|
value: null
|
|
1609
1609
|
}
|
|
1610
|
-
})), Ee = !0, De = !0, Oe = !1, ke = !0,
|
|
1610
|
+
})), Ee = !0, De = !0, Oe = !1, ke = !0, G = !1, Ae = !0, je = !1, Me = !1, Ne = null, Pe = null, Fe = !1, Ie = !1, Le = !1, Re = !1, ze = !0, Be = !1, K = "user-content-", Ve = !0, He = !1, Ue = {}, We = null, Ge = 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(".")), Ke = null, qe = addToSet({}, [
|
|
1611
1611
|
"audio",
|
|
1612
1612
|
"video",
|
|
1613
1613
|
"img",
|
|
1614
1614
|
"source",
|
|
1615
1615
|
"image",
|
|
1616
1616
|
"track"
|
|
1617
|
-
]),
|
|
1617
|
+
]), Ye = null, Xe = addToSet({}, [
|
|
1618
1618
|
"alt",
|
|
1619
1619
|
"class",
|
|
1620
1620
|
"for",
|
|
@@ -1629,69 +1629,69 @@ function createDOMPurify() {
|
|
|
1629
1629
|
"value",
|
|
1630
1630
|
"style",
|
|
1631
1631
|
"xmlns"
|
|
1632
|
-
]),
|
|
1632
|
+
]), Ze = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", et = "http://www.w3.org/1999/xhtml", tt = et, nt = !1, gt = null, _t = addToSet({}, [
|
|
1633
|
+
Ze,
|
|
1633
1634
|
Qe,
|
|
1634
|
-
et
|
|
1635
|
-
|
|
1636
|
-
], dt), yt = K([
|
|
1635
|
+
et
|
|
1636
|
+
], dt), vt = q([
|
|
1637
1637
|
"mi",
|
|
1638
1638
|
"mo",
|
|
1639
1639
|
"mn",
|
|
1640
1640
|
"ms",
|
|
1641
1641
|
"mtext"
|
|
1642
|
-
]),
|
|
1642
|
+
]), yt = addToSet({}, vt), bt = q(["annotation-xml"]), Qt = addToSet({}, bt), $t = addToSet({}, [
|
|
1643
1643
|
"title",
|
|
1644
1644
|
"style",
|
|
1645
1645
|
"font",
|
|
1646
1646
|
"a",
|
|
1647
1647
|
"script"
|
|
1648
|
-
]),
|
|
1648
|
+
]), en = null, tn = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
|
|
1649
1649
|
return e instanceof RegExp || e instanceof Function;
|
|
1650
1650
|
}, on = function _parseConfig() {
|
|
1651
1651
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1652
1652
|
if (nn && nn === e) return;
|
|
1653
|
-
(!e || typeof e != "object") && (e = {}), e = clone(e),
|
|
1653
|
+
(!e || typeof e != "object") && (e = {}), e = clone(e), en = tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = en === "application/xhtml+xml" ? dt : ut, H = Zt(e, "ALLOWED_TAGS", be, { transform: Q }), U = Zt(e, "ALLOWED_ATTR", Se, { transform: Q }), gt = Zt(e, "ALLOWED_NAMESPACES", _t, { transform: dt }), Ye = Zt(e, "ADD_URI_SAFE_ATTR", Xe, {
|
|
1654
1654
|
transform: Q,
|
|
1655
|
-
base:
|
|
1656
|
-
}),
|
|
1655
|
+
base: Xe
|
|
1656
|
+
}), Ke = Zt(e, "ADD_DATA_URI_TAGS", qe, {
|
|
1657
1657
|
transform: Q,
|
|
1658
|
-
base:
|
|
1659
|
-
}),
|
|
1660
|
-
let t =
|
|
1661
|
-
if (W = $e(null),
|
|
1658
|
+
base: qe
|
|
1659
|
+
}), We = Zt(e, "FORBID_CONTENTS", Ge, { transform: Q }), Ce = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), we = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), Ue = X(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ee = e.ALLOW_ARIA_ATTR !== !1, De = e.ALLOW_DATA_ATTR !== !1, Oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ke = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, je = e.WHOLE_DOCUMENT || !1, Ie = e.RETURN_DOM || !1, Le = e.RETURN_DOM_FRAGMENT || !1, Re = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, Ve = e.KEEP_CONTENT !== !1, He = e.IN_PLACE || !1, ye = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : et, yt = X(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, vt), Qt = X(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, bt);
|
|
1660
|
+
let t = X(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : $e(null);
|
|
1661
|
+
if (W = $e(null), X(t, "tagNameCheck") && an(t.tagNameCheck) && (W.tagNameCheck = t.tagNameCheck), X(t, "attributeNameCheck") && an(t.attributeNameCheck) && (W.attributeNameCheck = t.attributeNameCheck), X(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), J(W), G && (De = !1), Le && (Ie = !0), Ue && (H = addToSet({}, Ot), U = $e(null), Ue.html === !0 && (addToSet(H, St), addToSet(U, kt)), Ue.svg === !0 && (addToSet(H, Ct), addToSet(U, At), addToSet(U, Mt)), Ue.svgFilters === !0 && (addToSet(H, wt), addToSet(U, At), addToSet(U, Mt)), Ue.mathMl === !0 && (addToSet(H, Et), addToSet(U, jt), addToSet(U, Mt))), Te.tagCheck = null, Te.attributeCheck = null, X(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Te.tagCheck = e.ADD_TAGS : lt(e.ADD_TAGS) && (H === be && (H = clone(H)), addToSet(H, e.ADD_TAGS, Q))), X(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Te.attributeCheck = e.ADD_ATTR : lt(e.ADD_ATTR) && (U === Se && (U = clone(U)), addToSet(U, e.ADD_ATTR, Q))), X(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(Ye, e.ADD_URI_SAFE_ATTR, Q), X(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (We === Ge && (We = clone(We)), addToSet(We, e.FORBID_CONTENTS, Q)), X(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (We === Ge && (We = clone(We)), addToSet(We, e.ADD_FORBID_CONTENTS, Q)), Ve && (H["#text"] = !0), je && addToSet(H, [
|
|
1662
1662
|
"html",
|
|
1663
1663
|
"head",
|
|
1664
1664
|
"body"
|
|
1665
1665
|
]), H.table && (addToSet(H, ["tbody"]), delete Ce.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1666
1666
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1667
1667
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1668
|
-
let t =
|
|
1669
|
-
|
|
1668
|
+
let t = S;
|
|
1669
|
+
S = e.TRUSTED_TYPES_POLICY;
|
|
1670
1670
|
try {
|
|
1671
|
-
|
|
1671
|
+
C = k("");
|
|
1672
1672
|
} catch (e) {
|
|
1673
|
-
throw
|
|
1673
|
+
throw S = t, e;
|
|
1674
1674
|
}
|
|
1675
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
1676
|
-
|
|
1675
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = oe()), S && typeof C == "string" && (C = k("")));
|
|
1676
|
+
q && q(e), nn = e;
|
|
1677
1677
|
}, sn = addToSet({}, [
|
|
1678
1678
|
...Ct,
|
|
1679
1679
|
...wt,
|
|
1680
1680
|
...Tt
|
|
1681
1681
|
]), cn = addToSet({}, [...Et, ...Dt]), ln = function _checkSvgNamespace(e, t, n) {
|
|
1682
|
-
return t.namespaceURI ===
|
|
1682
|
+
return t.namespaceURI === et ? e === "svg" : t.namespaceURI === Ze ? e === "svg" && (n === "annotation-xml" || yt[n]) : !!sn[e];
|
|
1683
1683
|
}, un = function _checkMathMlNamespace(e, t, n) {
|
|
1684
|
-
return t.namespaceURI ===
|
|
1684
|
+
return t.namespaceURI === et ? e === "math" : t.namespaceURI === Qe ? e === "math" && Qt[n] : !!cn[e];
|
|
1685
1685
|
}, dn = function _checkHtmlNamespace(e, t, n) {
|
|
1686
|
-
return t.namespaceURI ===
|
|
1686
|
+
return t.namespaceURI === Qe && !Qt[n] || t.namespaceURI === Ze && !yt[n] ? !1 : !cn[e] && ($t[e] || !sn[e]);
|
|
1687
1687
|
}, fn = function _checkValidNamespace(e) {
|
|
1688
1688
|
let t = v(e);
|
|
1689
1689
|
(!t || !t.tagName) && (t = {
|
|
1690
|
-
namespaceURI:
|
|
1690
|
+
namespaceURI: tt,
|
|
1691
1691
|
tagName: "template"
|
|
1692
1692
|
});
|
|
1693
1693
|
let n = ut(e.tagName), r = ut(t.tagName);
|
|
1694
|
-
return
|
|
1694
|
+
return gt[e.namespaceURI] ? e.namespaceURI === Qe ? ln(n, t, r) : e.namespaceURI === Ze ? un(n, t, r) : e.namespaceURI === et ? dn(n, t, r) : !!(en === "application/xhtml+xml" && gt[e.namespaceURI]) : !1;
|
|
1695
1695
|
}, pn = function _forceRemove(e) {
|
|
1696
1696
|
st(DOMPurify.removed, { element: e });
|
|
1697
1697
|
try {
|
|
@@ -1712,7 +1712,7 @@ function createDOMPurify() {
|
|
|
1712
1712
|
} catch {}
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
|
-
let n =
|
|
1715
|
+
let n = b(e);
|
|
1716
1716
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
1717
1717
|
let r = n[t], i = r && r.name;
|
|
1718
1718
|
if (typeof i == "string") try {
|
|
@@ -1731,14 +1731,14 @@ function createDOMPurify() {
|
|
|
1731
1731
|
from: t
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
1734
|
-
if (t.removeAttribute(e), e === "is") if (
|
|
1734
|
+
if (t.removeAttribute(e), e === "is") if (Ie || Le) try {
|
|
1735
1735
|
pn(t);
|
|
1736
1736
|
} catch {}
|
|
1737
1737
|
else try {
|
|
1738
1738
|
t.setAttribute(e, "");
|
|
1739
1739
|
} catch {}
|
|
1740
1740
|
}, gn = function _stripDisallowedAttributes(e) {
|
|
1741
|
-
let t =
|
|
1741
|
+
let t = b(e);
|
|
1742
1742
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
1743
1743
|
let r = t[n], i = r && r.name;
|
|
1744
1744
|
if (!(typeof i != "string" || U[Q(i)])) try {
|
|
@@ -1749,23 +1749,23 @@ function createDOMPurify() {
|
|
|
1749
1749
|
let t = [e];
|
|
1750
1750
|
for (; t.length > 0;) {
|
|
1751
1751
|
let e = t.pop();
|
|
1752
|
-
(
|
|
1752
|
+
(x ? x(e) : e.nodeType) === qt.element && gn(e);
|
|
1753
1753
|
let n = _(e);
|
|
1754
1754
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
1755
1755
|
}
|
|
1756
1756
|
}, vn = function _neutralizePatchLinkage(e) {
|
|
1757
|
-
if (!
|
|
1757
|
+
if (!Ae) return;
|
|
1758
1758
|
let t = [e];
|
|
1759
1759
|
for (; t.length > 0;) {
|
|
1760
|
-
let e = t.pop(), n =
|
|
1761
|
-
if (n === qt.processingInstruction || n === qt.comment &&
|
|
1760
|
+
let e = t.pop(), n = x ? x(e) : e.nodeType;
|
|
1761
|
+
if (n === qt.processingInstruction || n === qt.comment && Z(Wt, e.data)) {
|
|
1762
1762
|
try {
|
|
1763
1763
|
m(e);
|
|
1764
1764
|
} catch {}
|
|
1765
1765
|
continue;
|
|
1766
1766
|
}
|
|
1767
1767
|
if (n === qt.element) {
|
|
1768
|
-
let t = e, n = Q(
|
|
1768
|
+
let t = e, n = Q(ne ? ne(e) : e.nodeName);
|
|
1769
1769
|
try {
|
|
1770
1770
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
1771
1771
|
} catch {}
|
|
@@ -1775,50 +1775,50 @@ function createDOMPurify() {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
}, yn = function _initDocument(e) {
|
|
1777
1777
|
let n = null, r = null;
|
|
1778
|
-
if (
|
|
1778
|
+
if (Fe) e = "<remove></remove>" + e;
|
|
1779
1779
|
else {
|
|
1780
1780
|
let t = ft(e, /^[\r\n\t ]+/);
|
|
1781
1781
|
r = t && t[0];
|
|
1782
1782
|
}
|
|
1783
|
-
|
|
1784
|
-
let i =
|
|
1785
|
-
if (
|
|
1786
|
-
n = new c().parseFromString(i,
|
|
1783
|
+
en === "application/xhtml+xml" && tt === et && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1784
|
+
let i = S ? k(e) : e;
|
|
1785
|
+
if (tt === et) try {
|
|
1786
|
+
n = new c().parseFromString(i, en);
|
|
1787
1787
|
} catch {}
|
|
1788
1788
|
if (!n || !n.documentElement) {
|
|
1789
|
-
n =
|
|
1789
|
+
n = se.createDocument(tt, "template", null);
|
|
1790
1790
|
try {
|
|
1791
|
-
n.documentElement.innerHTML =
|
|
1791
|
+
n.documentElement.innerHTML = nt ? C : i;
|
|
1792
1792
|
} catch {}
|
|
1793
1793
|
}
|
|
1794
1794
|
let a = n.body || n.documentElement;
|
|
1795
|
-
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null),
|
|
1795
|
+
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), tt === et ? ue.call(n, je ? "html" : "body")[0] : je ? n.documentElement : a;
|
|
1796
1796
|
}, bn = function _createNodeIterator(e) {
|
|
1797
|
-
return
|
|
1797
|
+
return P.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
|
|
1798
1798
|
}, xn = function _stripTemplateExpressions(e) {
|
|
1799
|
-
return e = pt(e,
|
|
1799
|
+
return e = pt(e, pe, " "), e = pt(e, he, " "), e = pt(e, I, " "), e;
|
|
1800
1800
|
}, Sn = function _scrubTemplateExpressions(e) {
|
|
1801
1801
|
e.normalize();
|
|
1802
|
-
let t =
|
|
1802
|
+
let t = P.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
|
|
1803
1803
|
for (; n;) n.data = xn(n.data), n = t.nextNode();
|
|
1804
1804
|
let r = e.querySelectorAll?.call(e, "template");
|
|
1805
1805
|
r && rt(r, (e) => {
|
|
1806
1806
|
wn(e.content) && Sn(e.content);
|
|
1807
1807
|
});
|
|
1808
1808
|
}, Cn = function _isClobbered(e) {
|
|
1809
|
-
let t =
|
|
1810
|
-
return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !==
|
|
1809
|
+
let t = ne ? ne(e) : null;
|
|
1810
|
+
return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== b(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== x(e) || e.childNodes !== _(e);
|
|
1811
1811
|
}, wn = function _isDocumentFragment(e) {
|
|
1812
|
-
if (!
|
|
1812
|
+
if (!x || typeof e != "object" || !e) return !1;
|
|
1813
1813
|
try {
|
|
1814
|
-
return
|
|
1814
|
+
return x(e) === qt.documentFragment;
|
|
1815
1815
|
} catch {
|
|
1816
1816
|
return !1;
|
|
1817
1817
|
}
|
|
1818
1818
|
}, Tn = function _isNode(e) {
|
|
1819
|
-
if (!
|
|
1819
|
+
if (!x || typeof e != "object" || !e) return !1;
|
|
1820
1820
|
try {
|
|
1821
|
-
return typeof
|
|
1821
|
+
return typeof x(e) == "number";
|
|
1822
1822
|
} catch {
|
|
1823
1823
|
return !1;
|
|
1824
1824
|
}
|
|
@@ -1829,46 +1829,46 @@ function createDOMPurify() {
|
|
|
1829
1829
|
});
|
|
1830
1830
|
}
|
|
1831
1831
|
let En = function _isUnsafeNode(e, t) {
|
|
1832
|
-
return !!(
|
|
1832
|
+
return !!(Ae && e.hasChildNodes() && !Tn(e.firstElementChild) && Z(Ut, e.textContent) && Z(Ut, e.innerHTML) || Ae && e.namespaceURI === et && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || Ae && e.nodeType === qt.comment && Z(Wt, e.data));
|
|
1833
1833
|
}, Dn = function _sanitizeDisallowedNode(e, t) {
|
|
1834
|
-
if (!Ce[t] && jn(t) && (W.tagNameCheck instanceof RegExp &&
|
|
1835
|
-
if (
|
|
1834
|
+
if (!Ce[t] && jn(t) && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, t) || W.tagNameCheck instanceof Function && W.tagNameCheck(t))) return !1;
|
|
1835
|
+
if (Ve && !We[t]) {
|
|
1836
1836
|
let t = v(e), n = _(e);
|
|
1837
1837
|
if (n && t) {
|
|
1838
1838
|
let r = n.length;
|
|
1839
1839
|
for (let i = r - 1; i >= 0; --i) {
|
|
1840
|
-
let r =
|
|
1840
|
+
let r = He ? n[i] : p(n[i], !0);
|
|
1841
1841
|
t.insertBefore(r, h(e));
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
1845
1845
|
return pn(e), !0;
|
|
1846
1846
|
}, On = function _sanitizeElements(e, t) {
|
|
1847
|
-
if (_executeHooks(
|
|
1847
|
+
if (_executeHooks(F.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
|
|
1848
1848
|
if (Cn(e)) return pn(e), !0;
|
|
1849
|
-
let n = Q(
|
|
1850
|
-
if (_executeHooks(
|
|
1849
|
+
let n = Q(ne ? ne(e) : e.nodeName);
|
|
1850
|
+
if (_executeHooks(F.uponSanitizeElement, e, {
|
|
1851
1851
|
tagName: n,
|
|
1852
1852
|
allowedTags: H
|
|
1853
1853
|
}), e !== t && v(e) === null) return !0;
|
|
1854
1854
|
if (En(e, n)) return pn(e), !0;
|
|
1855
1855
|
if (Ce[n] || !(Te.tagCheck instanceof Function && Te.tagCheck(n)) && !H[n]) {
|
|
1856
1856
|
let t = Dn(e, n);
|
|
1857
|
-
return t === !1 && _executeHooks(
|
|
1857
|
+
return t === !1 && _executeHooks(F.afterSanitizeElements, e, null), t;
|
|
1858
1858
|
}
|
|
1859
|
-
if ((
|
|
1860
|
-
if (
|
|
1859
|
+
if ((x ? x(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Z(Gt, e.innerHTML)) return pn(e), !0;
|
|
1860
|
+
if (G && e.nodeType === qt.text) {
|
|
1861
1861
|
let t = xn(e.textContent);
|
|
1862
1862
|
e.textContent !== t && (st(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1863
1863
|
}
|
|
1864
|
-
return _executeHooks(
|
|
1864
|
+
return _executeHooks(F.afterSanitizeElements, e, null), !1;
|
|
1865
1865
|
}, kn = function _isValidAttribute(e, n, r) {
|
|
1866
|
-
if (we[n] ||
|
|
1866
|
+
if (we[n] || Ae && n === "patchsrc" || Ae && n === "for" && e !== "label" && e !== "output" || ze && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
|
|
1867
1867
|
let i = U[n] || Te.attributeCheck instanceof Function && Te.attributeCheck(n, e);
|
|
1868
|
-
if (!(De &&
|
|
1868
|
+
if (!(De && Z(R, n)) && !(Ee && Z(z, n))) {
|
|
1869
1869
|
if (!i) {
|
|
1870
|
-
if (!(jn(e) && (W.tagNameCheck instanceof RegExp &&
|
|
1871
|
-
} else if (!
|
|
1870
|
+
if (!(jn(e) && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, e) || W.tagNameCheck instanceof Function && W.tagNameCheck(e)) && (W.attributeNameCheck instanceof RegExp && Z(W.attributeNameCheck, n) || W.attributeNameCheck instanceof Function && W.attributeNameCheck(n, e)) || n === "is" && W.allowCustomizedBuiltInElements && (W.tagNameCheck instanceof RegExp && Z(W.tagNameCheck, r) || W.tagNameCheck instanceof Function && W.tagNameCheck(r)))) return !1;
|
|
1871
|
+
} else if (!Ye[n] && !Z(ye, pt(r, ve, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && Ke[e]) && !(Oe && !Z(_e, pt(r, ve, ""))) && r) return !1;
|
|
1872
1872
|
}
|
|
1873
1873
|
return !0;
|
|
1874
1874
|
}, An = addToSet({}, [
|
|
@@ -1881,11 +1881,11 @@ function createDOMPurify() {
|
|
|
1881
1881
|
"font-face-uri",
|
|
1882
1882
|
"missing-glyph"
|
|
1883
1883
|
]), jn = function _isBasicCustomElement(e) {
|
|
1884
|
-
return !An[ut(e)] &&
|
|
1884
|
+
return !An[ut(e)] && Z(B, e);
|
|
1885
1885
|
}, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1886
|
-
if (
|
|
1887
|
-
case "TrustedHTML": return
|
|
1888
|
-
case "TrustedScriptURL": return
|
|
1886
|
+
if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
1887
|
+
case "TrustedHTML": return k(r);
|
|
1888
|
+
case "TrustedScriptURL": return A(r);
|
|
1889
1889
|
}
|
|
1890
1890
|
return r;
|
|
1891
1891
|
}, Nn = function _setAttributeValue(e, t, n, r) {
|
|
@@ -1895,7 +1895,7 @@ function createDOMPurify() {
|
|
|
1895
1895
|
hn(t, e);
|
|
1896
1896
|
}
|
|
1897
1897
|
}, Pn = function _sanitizeAttributes(e) {
|
|
1898
|
-
_executeHooks(
|
|
1898
|
+
_executeHooks(F.beforeSanitizeAttributes, e, null);
|
|
1899
1899
|
let t = e.attributes;
|
|
1900
1900
|
if (!t || Cn(e)) return;
|
|
1901
1901
|
let n = {
|
|
@@ -1907,7 +1907,7 @@ function createDOMPurify() {
|
|
|
1907
1907
|
}, r = t.length, i = Q(e.nodeName);
|
|
1908
1908
|
for (; r--;) {
|
|
1909
1909
|
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : ht(f);
|
|
1910
|
-
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(
|
|
1910
|
+
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(F.uponSanitizeAttribute, e, n), p = n.attrValue, Be && (u === "id" || u === "name") && mt(p, K) !== 0 && (hn(o, e), p = K + p), Ae && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
|
|
1911
1911
|
hn(o, e);
|
|
1912
1912
|
continue;
|
|
1913
1913
|
}
|
|
@@ -1920,25 +1920,25 @@ function createDOMPurify() {
|
|
|
1920
1920
|
hn(o, e);
|
|
1921
1921
|
continue;
|
|
1922
1922
|
}
|
|
1923
|
-
if (!ke &&
|
|
1923
|
+
if (!ke && Z(Kt, p)) {
|
|
1924
1924
|
hn(o, e);
|
|
1925
1925
|
continue;
|
|
1926
1926
|
}
|
|
1927
|
-
if (
|
|
1927
|
+
if (G && (p = xn(p)), !kn(i, u, p)) {
|
|
1928
1928
|
hn(o, e);
|
|
1929
1929
|
continue;
|
|
1930
1930
|
}
|
|
1931
1931
|
p = Mn(i, u, s, p), p !== f && Nn(e, o, s, p);
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
|
-
_executeHooks(
|
|
1934
|
+
_executeHooks(F.afterSanitizeAttributes, e, null);
|
|
1935
1935
|
}, Fn = function _sanitizeShadowDOM(e) {
|
|
1936
1936
|
let t = null, n = bn(e);
|
|
1937
|
-
for (_executeHooks(
|
|
1938
|
-
let e =
|
|
1937
|
+
for (_executeHooks(F.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(F.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (x ? x(t) : t.nodeType) === qt.element) {
|
|
1938
|
+
let e = te(t);
|
|
1939
1939
|
wn(e) && (In(e), Fn(e));
|
|
1940
1940
|
}
|
|
1941
|
-
_executeHooks(
|
|
1941
|
+
_executeHooks(F.afterSanitizeShadowDOM, e, null);
|
|
1942
1942
|
}, In = function _sanitizeAttachedShadowRoots(e) {
|
|
1943
1943
|
let t = [{
|
|
1944
1944
|
node: e,
|
|
@@ -1950,13 +1950,13 @@ function createDOMPurify() {
|
|
|
1950
1950
|
Fn(e.shadow);
|
|
1951
1951
|
continue;
|
|
1952
1952
|
}
|
|
1953
|
-
let n = e.node, r = (
|
|
1953
|
+
let n = e.node, r = (x ? x(n) : n.nodeType) === qt.element, i = _(n);
|
|
1954
1954
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
1955
1955
|
node: i[e],
|
|
1956
1956
|
shadow: null
|
|
1957
1957
|
});
|
|
1958
1958
|
if (r) {
|
|
1959
|
-
let e =
|
|
1959
|
+
let e = ne ? ne(n) : null;
|
|
1960
1960
|
if (typeof e == "string" && Q(e) === "template") {
|
|
1961
1961
|
let e = n.content;
|
|
1962
1962
|
wn(e) && t.push({
|
|
@@ -1966,7 +1966,7 @@ function createDOMPurify() {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
1968
|
if (r) {
|
|
1969
|
-
let e =
|
|
1969
|
+
let e = te(n);
|
|
1970
1970
|
wn(e) && t.push({
|
|
1971
1971
|
node: null,
|
|
1972
1972
|
shadow: e
|
|
@@ -1979,13 +1979,13 @@ function createDOMPurify() {
|
|
|
1979
1979
|
};
|
|
1980
1980
|
return DOMPurify.sanitize = function(e) {
|
|
1981
1981
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
|
|
1982
|
-
if (
|
|
1982
|
+
if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw xt("dirty is not a string, aborting");
|
|
1983
1983
|
if (!DOMPurify.isSupported) return e;
|
|
1984
|
-
|
|
1985
|
-
let s =
|
|
1984
|
+
Me ? (H = Ne, U = Pe) : on(t), (F.uponSanitizeElement.length > 0 || F.uponSanitizeAttribute.length > 0) && (H = clone(H)), F.uponSanitizeAttribute.length > 0 && (U = clone(U)), DOMPurify.removed = [];
|
|
1985
|
+
let s = He && typeof e != "string" && Tn(e);
|
|
1986
1986
|
if (s) {
|
|
1987
1987
|
vn(e);
|
|
1988
|
-
let t =
|
|
1988
|
+
let t = ne ? ne(e) : e.nodeName;
|
|
1989
1989
|
if (typeof t == "string") {
|
|
1990
1990
|
let n = Q(t);
|
|
1991
1991
|
if (!H[n] || Ce[n]) throw mn(e), xt("root node is forbidden and cannot be sanitized in-place");
|
|
@@ -1998,10 +1998,10 @@ function createDOMPurify() {
|
|
|
1998
1998
|
}
|
|
1999
1999
|
} else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === qt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
|
|
2000
2000
|
else {
|
|
2001
|
-
if (!
|
|
2002
|
-
if (r = yn(e), !r) return
|
|
2001
|
+
if (!Ie && !G && !je && e.indexOf("<") === -1) return S && Re ? k(e) : e;
|
|
2002
|
+
if (r = yn(e), !r) return Ie ? null : Re ? C : "";
|
|
2003
2003
|
}
|
|
2004
|
-
r &&
|
|
2004
|
+
r && Fe && pn(r.firstChild);
|
|
2005
2005
|
let c = s ? e : r, u = bn(c);
|
|
2006
2006
|
try {
|
|
2007
2007
|
for (; a = u.nextNode();) On(a, c), Pn(a), wn(a.content) && Fn(a.content);
|
|
@@ -2012,37 +2012,37 @@ function createDOMPurify() {
|
|
|
2012
2012
|
}
|
|
2013
2013
|
if (s) return rt(DOMPurify.removed, (e) => {
|
|
2014
2014
|
e.element && _n(e.element);
|
|
2015
|
-
}),
|
|
2016
|
-
if (
|
|
2017
|
-
if (
|
|
2015
|
+
}), G && Sn(e), e;
|
|
2016
|
+
if (Ie) {
|
|
2017
|
+
if (G && Sn(r), Le) for (o = ce.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
|
|
2018
2018
|
else o = r;
|
|
2019
|
-
return (U.shadowroot || U.shadowrootmode) && (o =
|
|
2019
|
+
return (U.shadowroot || U.shadowrootmode) && (o = de.call(n, o, !0)), o;
|
|
2020
2020
|
}
|
|
2021
|
-
let f =
|
|
2022
|
-
return
|
|
2021
|
+
let f = je ? r.outerHTML : r.innerHTML;
|
|
2022
|
+
return je && H["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Z(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), G && (f = xn(f)), S && Re ? k(f) : f;
|
|
2023
2023
|
}, DOMPurify.setConfig = function() {
|
|
2024
2024
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2025
|
-
on(e),
|
|
2025
|
+
on(e), Me = !0, Ne = H, Pe = U;
|
|
2026
2026
|
}, DOMPurify.clearConfig = function() {
|
|
2027
|
-
nn = null,
|
|
2027
|
+
nn = null, Me = !1, Ne = null, Pe = null, S = re, C = "";
|
|
2028
2028
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2029
2029
|
nn || on({});
|
|
2030
2030
|
let r = Q(e), i = Q(t);
|
|
2031
2031
|
return kn(r, i, n);
|
|
2032
2032
|
}, DOMPurify.addHook = function(e, t) {
|
|
2033
|
-
typeof t == "function" &&
|
|
2033
|
+
typeof t == "function" && X(F, e) && st(F[e], t);
|
|
2034
2034
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2035
|
-
if (
|
|
2035
|
+
if (X(F, e)) {
|
|
2036
2036
|
if (t !== void 0) {
|
|
2037
|
-
let n = it(
|
|
2038
|
-
return n === -1 ? void 0 : ct(
|
|
2037
|
+
let n = it(F[e], t);
|
|
2038
|
+
return n === -1 ? void 0 : ct(F[e], n, 1)[0];
|
|
2039
2039
|
}
|
|
2040
|
-
return at(
|
|
2040
|
+
return at(F[e]);
|
|
2041
2041
|
}
|
|
2042
2042
|
}, DOMPurify.removeHooks = function(e) {
|
|
2043
|
-
|
|
2043
|
+
X(F, e) && (F[e] = []);
|
|
2044
2044
|
}, DOMPurify.removeAllHooks = function() {
|
|
2045
|
-
|
|
2045
|
+
F = Xt();
|
|
2046
2046
|
}, DOMPurify;
|
|
2047
2047
|
}
|
|
2048
2048
|
var Qt = createDOMPurify(), _Class;
|
|
@@ -2076,7 +2076,7 @@ function d(e, t = "") {
|
|
|
2076
2076
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
2077
2077
|
replace: (e, t) => {
|
|
2078
2078
|
let i = typeof t == "string" ? t : t.source;
|
|
2079
|
-
return i = i.replace(
|
|
2079
|
+
return i = i.replace(Q.caret, "$1"), n = n.replace(e, i), r;
|
|
2080
2080
|
},
|
|
2081
2081
|
getRegex: () => new RegExp(n, t)
|
|
2082
2082
|
};
|
|
@@ -2088,7 +2088,7 @@ var tn = ((e = "") => {
|
|
|
2088
2088
|
} catch {
|
|
2089
2089
|
return !1;
|
|
2090
2090
|
}
|
|
2091
|
-
})(),
|
|
2091
|
+
})(), Q = {
|
|
2092
2092
|
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
2093
2093
|
outputLinkReplace: /\\([\[\]])/g,
|
|
2094
2094
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -2145,112 +2145,112 @@ var tn = ((e = "") => {
|
|
|
2145
2145
|
headingBeginRegex: E((e) => RegExp(`^ {0,${e}}#`)),
|
|
2146
2146
|
htmlBeginRegex: E((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
|
|
2147
2147
|
blockquoteBeginRegex: E((e) => RegExp(`^ {0,${e}}>`))
|
|
2148
|
-
},
|
|
2149
|
-
blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
2150
|
-
code:
|
|
2151
|
-
def:
|
|
2152
|
-
fences:
|
|
2153
|
-
heading:
|
|
2154
|
-
hr:
|
|
2155
|
-
html:
|
|
2156
|
-
lheading: ln,
|
|
2157
|
-
list: hn,
|
|
2158
|
-
newline: Q,
|
|
2159
|
-
paragraph: yn,
|
|
2160
|
-
table: en,
|
|
2161
|
-
text: fn
|
|
2162
|
-
}, Sn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", an).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", gn).getRegex(), Cn = {
|
|
2163
|
-
...xn,
|
|
2148
|
+
}, nn = /^(?:[ \t]*(?:\n|$))+/, rn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, an = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, on = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, sn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, cn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ln = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, un = d(ln).replace(/bull/g, cn).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}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), dn = d(ln).replace(/bull/g, cn).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}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), fn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, pn = /^[^\n]+/, mn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, hn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", mn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, cn).getRegex(), _n = "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", vn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, yn = d("^ {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][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", vn).replace("tag", _n).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(fn).replace("hr", on).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _n).getRegex(), bn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), xn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), Sn = {
|
|
2149
|
+
blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xn).getRegex(),
|
|
2150
|
+
code: rn,
|
|
2151
|
+
def: hn,
|
|
2152
|
+
fences: an,
|
|
2153
|
+
heading: sn,
|
|
2154
|
+
hr: on,
|
|
2155
|
+
html: yn,
|
|
2164
2156
|
lheading: un,
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2157
|
+
list: gn,
|
|
2158
|
+
newline: nn,
|
|
2159
|
+
paragraph: bn,
|
|
2160
|
+
table: en,
|
|
2161
|
+
text: pn
|
|
2162
|
+
}, Cn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", on).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _n).getRegex(), wn = {
|
|
2163
|
+
...Sn,
|
|
2164
|
+
lheading: dn,
|
|
2165
|
+
table: Cn,
|
|
2166
|
+
paragraph: d(fn).replace("hr", on).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Cn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _n).getRegex()
|
|
2167
|
+
}, Tn = {
|
|
2168
|
+
...Sn,
|
|
2169
|
+
html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", vn).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(),
|
|
2170
2170
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2171
2171
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2172
2172
|
fences: en,
|
|
2173
2173
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2174
|
-
paragraph: d(
|
|
2175
|
-
},
|
|
2174
|
+
paragraph: d(fn).replace("hr", on).replace("heading", " *#{1,6} *[^\n]").replace("lheading", un).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
2175
|
+
}, En = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Dn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, On = /^( {2,}|\\)\n(?!\s*$)/, kn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, An = /[\p{P}\p{S}]/u, jn = /[\s\p{P}\p{S}]/u, Mn = /[^\s\p{P}\p{S}]/u, Nn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, jn).getRegex(), Pn = /(?!~)[\p{P}\p{S}]/u, Fn = /(?!~)[\s\p{P}\p{S}]/u, In = /(?:[^\s\p{P}\p{S}]|~)/u, Ln = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", tn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, zn = d(Rn, "u").replace(/punct/g, An).getRegex(), Bn = d(Rn, "u").replace(/punct/g, Pn).getRegex(), Vn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hn = d(Vn, "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), Un = d(Vn, "gu").replace(/notPunctSpace/g, In).replace(/punctSpace/g, Fn).replace(/punct/g, Pn).getRegex(), Wn = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), Gn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, An).getRegex(), Kn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Mn).replace(/punctSpace/g, jn).replace(/punct/g, An).getRegex(), qn = d(/\\(punct)/, "gu").replace(/punct/g, An).getRegex(), Jn = d(/^<(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(), Yn = d(vn).replace("(?:-->|$)", "-->").getRegex(), Xn = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Yn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Zn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Qn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Zn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), $n = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Zn).replace("ref", mn).getRegex(), er = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", mn).getRegex(), tr = d("reflink|nolink(?!\\()", "g").replace("reflink", $n).replace("nolink", er).getRegex(), nr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, rr = {
|
|
2176
2176
|
_backpedal: en,
|
|
2177
|
-
anyPunctuation:
|
|
2178
|
-
autolink:
|
|
2179
|
-
blockSkip:
|
|
2180
|
-
br:
|
|
2181
|
-
code:
|
|
2177
|
+
anyPunctuation: qn,
|
|
2178
|
+
autolink: Jn,
|
|
2179
|
+
blockSkip: Ln,
|
|
2180
|
+
br: On,
|
|
2181
|
+
code: Dn,
|
|
2182
2182
|
del: en,
|
|
2183
2183
|
delLDelim: en,
|
|
2184
2184
|
delRDelim: en,
|
|
2185
|
-
emStrongLDelim:
|
|
2186
|
-
emStrongRDelimAst:
|
|
2187
|
-
emStrongRDelimUnd:
|
|
2188
|
-
escape:
|
|
2189
|
-
link:
|
|
2190
|
-
nolink:
|
|
2191
|
-
punctuation:
|
|
2192
|
-
reflink:
|
|
2193
|
-
reflinkSearch:
|
|
2194
|
-
tag:
|
|
2195
|
-
text:
|
|
2185
|
+
emStrongLDelim: zn,
|
|
2186
|
+
emStrongRDelimAst: Hn,
|
|
2187
|
+
emStrongRDelimUnd: Wn,
|
|
2188
|
+
escape: En,
|
|
2189
|
+
link: Qn,
|
|
2190
|
+
nolink: er,
|
|
2191
|
+
punctuation: Nn,
|
|
2192
|
+
reflink: $n,
|
|
2193
|
+
reflinkSearch: tr,
|
|
2194
|
+
tag: Xn,
|
|
2195
|
+
text: kn,
|
|
2196
2196
|
url: en
|
|
2197
|
-
}, rr = {
|
|
2198
|
-
...nr,
|
|
2199
|
-
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Xn).getRegex(),
|
|
2200
|
-
reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Xn).getRegex()
|
|
2201
2197
|
}, ir = {
|
|
2202
|
-
...
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2198
|
+
...rr,
|
|
2199
|
+
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Zn).getRegex(),
|
|
2200
|
+
reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Zn).getRegex()
|
|
2201
|
+
}, ar = {
|
|
2202
|
+
...rr,
|
|
2203
|
+
emStrongRDelimAst: Un,
|
|
2204
|
+
emStrongLDelim: Bn,
|
|
2205
|
+
delLDelim: Gn,
|
|
2206
|
+
delRDelim: Kn,
|
|
2207
|
+
url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", nr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
2208
2208
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2209
2209
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
2210
|
-
text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",
|
|
2211
|
-
}, ar = {
|
|
2212
|
-
...ir,
|
|
2213
|
-
br: d(Dn).replace("{2,}", "*").getRegex(),
|
|
2214
|
-
text: d(ir.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2210
|
+
text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", nr).getRegex()
|
|
2215
2211
|
}, or = {
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2212
|
+
...ar,
|
|
2213
|
+
br: d(On).replace("{2,}", "*").getRegex(),
|
|
2214
|
+
text: d(ar.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2219
2215
|
}, sr = {
|
|
2220
|
-
normal:
|
|
2221
|
-
gfm:
|
|
2222
|
-
|
|
2223
|
-
pedantic: rr
|
|
2216
|
+
normal: Sn,
|
|
2217
|
+
gfm: wn,
|
|
2218
|
+
pedantic: Tn
|
|
2224
2219
|
}, cr = {
|
|
2220
|
+
normal: rr,
|
|
2221
|
+
gfm: ar,
|
|
2222
|
+
breaks: or,
|
|
2223
|
+
pedantic: ir
|
|
2224
|
+
}, lr = {
|
|
2225
2225
|
"&": "&",
|
|
2226
2226
|
"<": "<",
|
|
2227
2227
|
">": ">",
|
|
2228
2228
|
"\"": """,
|
|
2229
2229
|
"'": "'"
|
|
2230
|
-
}, ge = (e) =>
|
|
2230
|
+
}, ge = (e) => lr[e];
|
|
2231
2231
|
function O(e, t) {
|
|
2232
2232
|
if (t) {
|
|
2233
|
-
if (
|
|
2234
|
-
} else if (
|
|
2233
|
+
if (Q.escapeTest.test(e)) return e.replace(Q.escapeReplace, ge);
|
|
2234
|
+
} else if (Q.escapeTestNoEncode.test(e)) return e.replace(Q.escapeReplaceNoEncode, ge);
|
|
2235
2235
|
return e;
|
|
2236
2236
|
}
|
|
2237
2237
|
function V(e) {
|
|
2238
2238
|
try {
|
|
2239
|
-
e = encodeURI(e).replace(
|
|
2239
|
+
e = encodeURI(e).replace(Q.percentDecode, "%");
|
|
2240
2240
|
} catch {
|
|
2241
2241
|
return null;
|
|
2242
2242
|
}
|
|
2243
2243
|
return e;
|
|
2244
2244
|
}
|
|
2245
2245
|
function Y(e, t) {
|
|
2246
|
-
let n = e.replace(
|
|
2246
|
+
let n = e.replace(Q.findPipe, (e, t, n) => {
|
|
2247
2247
|
let r = !1, i = t;
|
|
2248
2248
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
2249
2249
|
return r ? "|" : " |";
|
|
2250
|
-
}).split(
|
|
2250
|
+
}).split(Q.splitPipe), r = 0;
|
|
2251
2251
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
2252
2252
|
else for (; n.length < t;) n.push("");
|
|
2253
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
2253
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(Q.slashPipe, "|");
|
|
2254
2254
|
return n;
|
|
2255
2255
|
}
|
|
2256
2256
|
function $(e, t, n) {
|
|
@@ -2267,7 +2267,7 @@ function $(e, t, n) {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
function ee(e) {
|
|
2269
2269
|
let t = e.split("\n"), n = t.length - 1;
|
|
2270
|
-
for (; n >= 0 &&
|
|
2270
|
+
for (; n >= 0 && Q.blankLine.test(t[n]);) n--;
|
|
2271
2271
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
2272
2272
|
}
|
|
2273
2273
|
function fe(e, t) {
|
|
@@ -2762,7 +2762,7 @@ ${c}` : c;
|
|
|
2762
2762
|
};
|
|
2763
2763
|
}
|
|
2764
2764
|
}
|
|
2765
|
-
},
|
|
2765
|
+
}, ur = class l {
|
|
2766
2766
|
constructor(t) {
|
|
2767
2767
|
e(this, "tokens", void 0), e(this, "options", void 0), e(this, "state", void 0), e(this, "inlineQueue", void 0), e(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = t || $t, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2768
2768
|
inLink: !1,
|
|
@@ -2770,16 +2770,16 @@ ${c}` : c;
|
|
|
2770
2770
|
top: !0
|
|
2771
2771
|
};
|
|
2772
2772
|
let n = {
|
|
2773
|
-
other:
|
|
2774
|
-
block:
|
|
2775
|
-
inline:
|
|
2773
|
+
other: Q,
|
|
2774
|
+
block: sr.normal,
|
|
2775
|
+
inline: cr.normal
|
|
2776
2776
|
};
|
|
2777
|
-
this.options.pedantic ? (n.block =
|
|
2777
|
+
this.options.pedantic ? (n.block = sr.pedantic, n.inline = cr.pedantic) : this.options.gfm && (n.block = sr.gfm, this.options.breaks ? n.inline = cr.breaks : n.inline = cr.gfm), this.tokenizer.rules = n;
|
|
2778
2778
|
}
|
|
2779
2779
|
static get rules() {
|
|
2780
2780
|
return {
|
|
2781
|
-
block:
|
|
2782
|
-
inline:
|
|
2781
|
+
block: sr,
|
|
2782
|
+
inline: cr
|
|
2783
2783
|
};
|
|
2784
2784
|
}
|
|
2785
2785
|
static lex(e, t) {
|
|
@@ -2789,7 +2789,7 @@ ${c}` : c;
|
|
|
2789
2789
|
return new l(t).inlineTokens(e);
|
|
2790
2790
|
}
|
|
2791
2791
|
lex(e) {
|
|
2792
|
-
e = e.replace(
|
|
2792
|
+
e = e.replace(Q.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
2793
2793
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
2794
2794
|
let t = this.inlineQueue[e];
|
|
2795
2795
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -2797,7 +2797,7 @@ ${c}` : c;
|
|
|
2797
2797
|
return this.inlineQueue = [], this.tokens;
|
|
2798
2798
|
}
|
|
2799
2799
|
blockTokens(e, t = [], n = !1) {
|
|
2800
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
2800
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(Q.tabCharGlobal, " ").replace(Q.spaceLine, ""));
|
|
2801
2801
|
let r = Infinity;
|
|
2802
2802
|
for (; e;) {
|
|
2803
2803
|
if (e.length < r) r = e.length;
|
|
@@ -2987,7 +2987,7 @@ ${c}` : c;
|
|
|
2987
2987
|
return "";
|
|
2988
2988
|
}
|
|
2989
2989
|
code({ text: e, lang: t, escaped: n }) {
|
|
2990
|
-
let r = (t || "").match(
|
|
2990
|
+
let r = (t || "").match(Q.notSpaceStart)?.[0], i = e.replace(Q.endingNewline, "") + "\n";
|
|
2991
2991
|
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";
|
|
2992
2992
|
}
|
|
2993
2993
|
blockquote({ tokens: e }) {
|
|
@@ -3115,7 +3115,7 @@ ${e}</tr>
|
|
|
3115
3115
|
checkbox({ raw: e }) {
|
|
3116
3116
|
return e;
|
|
3117
3117
|
}
|
|
3118
|
-
},
|
|
3118
|
+
}, dr = class l {
|
|
3119
3119
|
constructor(t) {
|
|
3120
3120
|
e(this, "options", void 0), e(this, "renderer", void 0), e(this, "textRenderer", void 0), this.options = t || $t, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
|
|
3121
3121
|
}
|
|
@@ -3263,7 +3263,7 @@ ${e}</tr>
|
|
|
3263
3263
|
}
|
|
3264
3264
|
return n;
|
|
3265
3265
|
}
|
|
3266
|
-
},
|
|
3266
|
+
}, fr = (_Class = class {
|
|
3267
3267
|
constructor(t) {
|
|
3268
3268
|
e(this, "options", void 0), e(this, "block", void 0), this.options = t || $t;
|
|
3269
3269
|
}
|
|
@@ -3280,10 +3280,10 @@ ${e}</tr>
|
|
|
3280
3280
|
return e;
|
|
3281
3281
|
}
|
|
3282
3282
|
provideLexer(e = this.block) {
|
|
3283
|
-
return e ?
|
|
3283
|
+
return e ? ur.lex : ur.lexInline;
|
|
3284
3284
|
}
|
|
3285
3285
|
provideParser(e = this.block) {
|
|
3286
|
-
return e ?
|
|
3286
|
+
return e ? dr.parse : dr.parseInline;
|
|
3287
3287
|
}
|
|
3288
3288
|
}, e(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
3289
3289
|
"preprocess",
|
|
@@ -3296,7 +3296,7 @@ ${e}</tr>
|
|
|
3296
3296
|
"processAllTokens"
|
|
3297
3297
|
])), _Class), D = class {
|
|
3298
3298
|
constructor(...t) {
|
|
3299
|
-
e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser",
|
|
3299
|
+
e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser", dr), e(this, "Renderer", y), e(this, "TextRenderer", L), e(this, "Lexer", ur), e(this, "Tokenizer", w), e(this, "Hooks", fr), this.use(...t);
|
|
3300
3300
|
}
|
|
3301
3301
|
walkTokens(e, t) {
|
|
3302
3302
|
let n = [];
|
|
@@ -3375,13 +3375,13 @@ ${e}</tr>
|
|
|
3375
3375
|
n.tokenizer = t;
|
|
3376
3376
|
}
|
|
3377
3377
|
if (e.hooks) {
|
|
3378
|
-
let t = this.defaults.hooks || new
|
|
3378
|
+
let t = this.defaults.hooks || new fr();
|
|
3379
3379
|
for (let n in e.hooks) {
|
|
3380
3380
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
3381
3381
|
if (["options", "block"].includes(n)) continue;
|
|
3382
3382
|
let r = n, i = e.hooks[r], a = t[r];
|
|
3383
|
-
|
|
3384
|
-
if (this.defaults.async &&
|
|
3383
|
+
fr.passThroughHooks.has(n) ? t[r] = (e) => {
|
|
3384
|
+
if (this.defaults.async && fr.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
3385
3385
|
let n = await i.call(t, e);
|
|
3386
3386
|
return a.call(t, n);
|
|
3387
3387
|
})();
|
|
@@ -3418,10 +3418,10 @@ ${e}</tr>
|
|
|
3418
3418
|
}, this;
|
|
3419
3419
|
}
|
|
3420
3420
|
lexer(e, t) {
|
|
3421
|
-
return
|
|
3421
|
+
return ur.lex(e, t ?? this.defaults);
|
|
3422
3422
|
}
|
|
3423
3423
|
parser(e, t) {
|
|
3424
|
-
return
|
|
3424
|
+
return dr.parse(e, t ?? this.defaults);
|
|
3425
3425
|
}
|
|
3426
3426
|
parseMarkdown(e) {
|
|
3427
3427
|
return (t, n) => {
|
|
@@ -3433,16 +3433,16 @@ ${e}</tr>
|
|
|
3433
3433
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
3434
3434
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
3435
3435
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
3436
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
3436
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? ur.lex : ur.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
3437
3437
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
3438
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
3438
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? dr.parse : dr.parseInline)(a, i);
|
|
3439
3439
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
3440
3440
|
})().catch(a);
|
|
3441
3441
|
try {
|
|
3442
3442
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
3443
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
3443
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? ur.lex : ur.lexInline)(t, i);
|
|
3444
3444
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
3445
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
3445
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? dr.parse : dr.parseInline)(n, i);
|
|
3446
3446
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
3447
3447
|
} catch (e) {
|
|
3448
3448
|
return a(e);
|
|
@@ -3459,25 +3459,79 @@ ${e}</tr>
|
|
|
3459
3459
|
throw n;
|
|
3460
3460
|
};
|
|
3461
3461
|
}
|
|
3462
|
-
},
|
|
3462
|
+
}, pr = new D();
|
|
3463
3463
|
function g(e, t) {
|
|
3464
|
-
return
|
|
3464
|
+
return pr.parse(e, t);
|
|
3465
3465
|
}
|
|
3466
3466
|
g.options = g.setOptions = function(e) {
|
|
3467
|
-
return
|
|
3467
|
+
return pr.setOptions(e), g.defaults = pr.defaults, N(g.defaults), g;
|
|
3468
3468
|
}, g.getDefaults = M, g.defaults = $t, g.use = function(...e) {
|
|
3469
|
-
return
|
|
3469
|
+
return pr.use(...e), g.defaults = pr.defaults, N(g.defaults), g;
|
|
3470
3470
|
}, g.walkTokens = function(e, t) {
|
|
3471
|
-
return
|
|
3472
|
-
}, g.parseInline =
|
|
3471
|
+
return pr.walkTokens(e, t);
|
|
3472
|
+
}, g.parseInline = pr.parseInline, g.Parser = dr, g.parser = dr.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = ur, g.lexer = ur.lex, g.Tokenizer = w, g.Hooks = fr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, dr.parse, ur.lex;
|
|
3473
3473
|
//#endregion
|
|
3474
|
-
//#region agent/ui/
|
|
3475
|
-
var
|
|
3474
|
+
//#region agent/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3475
|
+
var mr = ["aria-label"], hr = ["innerHTML"], gr = {
|
|
3476
|
+
key: 1,
|
|
3477
|
+
class: "mt-4 flex flex-wrap gap-2"
|
|
3478
|
+
}, _r = ["onClick"], vr = /* @__PURE__ */ x({
|
|
3479
|
+
__name: "ChatCardBlock",
|
|
3480
|
+
props: {
|
|
3481
|
+
spec: {},
|
|
3482
|
+
inverted: { type: Boolean }
|
|
3483
|
+
},
|
|
3484
|
+
emits: ["action"],
|
|
3485
|
+
setup(e, { emit: t }) {
|
|
3486
|
+
let n = e, r = t, i = p(() => {
|
|
3487
|
+
if (!n.spec.body) return "";
|
|
3488
|
+
let e = g.parse(n.spec.body, { async: !1 });
|
|
3489
|
+
return Qt.sanitize(e, { ADD_ATTR: ["target"] });
|
|
3490
|
+
}), a = p(() => n.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), o = p(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), s = p(() => n.inverted ? "rgba(255, 255, 255, 0.7)" : "var(--color-theme-700)");
|
|
3491
|
+
function actionStyle(e) {
|
|
3492
|
+
return e === "primary" ? {
|
|
3493
|
+
background: "var(--color-primary-500)",
|
|
3494
|
+
color: "#fff"
|
|
3495
|
+
} : e === "destructive" ? {
|
|
3496
|
+
background: "color-mix(in oklch, var(--color-theme-900) 6%, transparent)",
|
|
3497
|
+
color: "var(--color-red-600, #dc2626)"
|
|
3498
|
+
} : {
|
|
3499
|
+
background: "color-mix(in oklch, var(--color-theme-900) 6%, transparent)",
|
|
3500
|
+
color: "var(--color-theme-900)"
|
|
3501
|
+
};
|
|
3502
|
+
}
|
|
3503
|
+
return (t, n) => (T(), _("div", {
|
|
3504
|
+
"data-test": "chat-card",
|
|
3505
|
+
class: "my-6 w-full rounded-[20px] px-5 pb-4 pt-4",
|
|
3506
|
+
style: C({ boxShadow: `inset 0 0 0 1px ${a.value}` }),
|
|
3507
|
+
"aria-label": e.spec.title
|
|
3508
|
+
}, [
|
|
3509
|
+
v("div", {
|
|
3510
|
+
class: "text-[14px] font-semibold leading-tight",
|
|
3511
|
+
style: C({ color: o.value })
|
|
3512
|
+
}, P(e.spec.title), 5),
|
|
3513
|
+
i.value ? (T(), _("div", {
|
|
3514
|
+
key: 0,
|
|
3515
|
+
class: "chat-msg-prose mt-2 text-[13px] leading-relaxed",
|
|
3516
|
+
style: C({ color: s.value }),
|
|
3517
|
+
innerHTML: i.value
|
|
3518
|
+
}, null, 12, hr)) : h("", !0),
|
|
3519
|
+
e.spec.actions?.length ? (T(), _("div", gr, [(T(!0), _(f, null, A(e.spec.actions, (e) => (T(), _("button", {
|
|
3520
|
+
key: e.label,
|
|
3521
|
+
type: "button",
|
|
3522
|
+
"data-test": "chat-card-action",
|
|
3523
|
+
class: "rounded-full px-4 py-2 text-[13px] font-medium transition-colors duration-150 active:opacity-80",
|
|
3524
|
+
style: C(actionStyle(e.style)),
|
|
3525
|
+
onClick: (t) => r("action", e.reply)
|
|
3526
|
+
}, P(e.label), 13, _r))), 128))])) : h("", !0)
|
|
3527
|
+
], 12, mr));
|
|
3528
|
+
}
|
|
3529
|
+
}), yr = 112, br = 52, xr = 14, Sr = 54, Cr = 34, wr = 260;
|
|
3476
3530
|
function nodeWidthFor(e) {
|
|
3477
3531
|
let { orientation: t, maxRows: n, maxWidth: r } = e;
|
|
3478
|
-
if (t === "horizontal" || !r) return
|
|
3479
|
-
let i = r -
|
|
3480
|
-
return Math.min(
|
|
3532
|
+
if (t === "horizontal" || !r) return yr;
|
|
3533
|
+
let i = r - xr * 2 - (n - 1) * Sr;
|
|
3534
|
+
return Math.min(wr, Math.max(yr, Math.floor(i / n)));
|
|
3481
3535
|
}
|
|
3482
3536
|
function orientationFor(e) {
|
|
3483
3537
|
return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
@@ -3514,11 +3568,11 @@ function buildLayout(e, t, n) {
|
|
|
3514
3568
|
orientation: t,
|
|
3515
3569
|
maxRows: o,
|
|
3516
3570
|
...n === void 0 ? {} : { maxWidth: n }
|
|
3517
|
-
}), u = t === "horizontal" ?
|
|
3571
|
+
}), u = t === "horizontal" ? xr * 2 + s * c + (s - 1) * Sr : xr * 2 + o * c + (o - 1) * Sr, f = t === "horizontal" ? xr * 2 + o * br + (o - 1) * Cr : xr * 2 + s * br + (s - 1) * Cr, p = [];
|
|
3518
3572
|
for (let [e, [, n]] of a.entries()) {
|
|
3519
|
-
let r = (o - n.length) * (t === "horizontal" ? 86 : c +
|
|
3573
|
+
let r = (o - n.length) * (t === "horizontal" ? 86 : c + Sr) / 2;
|
|
3520
3574
|
for (let [i, a] of n.entries()) {
|
|
3521
|
-
let n = t === "horizontal" ?
|
|
3575
|
+
let n = t === "horizontal" ? xr + e * (c + Sr) : xr + r + i * (c + Sr), o = t === "horizontal" ? xr + r + i * 86 : xr + e * 86;
|
|
3522
3576
|
p.push({
|
|
3523
3577
|
id: a.id,
|
|
3524
3578
|
label: a.label,
|
|
@@ -3527,7 +3581,7 @@ function buildLayout(e, t, n) {
|
|
|
3527
3581
|
x: n,
|
|
3528
3582
|
y: o,
|
|
3529
3583
|
width: c,
|
|
3530
|
-
height:
|
|
3584
|
+
height: br
|
|
3531
3585
|
});
|
|
3532
3586
|
}
|
|
3533
3587
|
}
|
|
@@ -3604,14 +3658,14 @@ function formatChatVisualTick(e) {
|
|
|
3604
3658
|
let { prefix: r, suffix: i } = affixes(n);
|
|
3605
3659
|
return `${r}${formatChatVisualValue({ value: t })}${i}`;
|
|
3606
3660
|
}
|
|
3607
|
-
var
|
|
3661
|
+
var Tr = 5.4, Er = 10, Dr = 15, Or = 16;
|
|
3608
3662
|
function planChatVisualXLabels(e) {
|
|
3609
3663
|
let { labels: t, plotWidth: n } = e;
|
|
3610
3664
|
if (!t.length || n <= 0) return {
|
|
3611
3665
|
mode: "horizontal",
|
|
3612
3666
|
entries: []
|
|
3613
3667
|
};
|
|
3614
|
-
let r = t.map((e) => e.length >
|
|
3668
|
+
let r = t.map((e) => e.length > Or ? `${e.slice(0, Or - 1).trimEnd()}\u2026` : e), i = t.length - 1;
|
|
3615
3669
|
if (i === 0) return {
|
|
3616
3670
|
mode: "horizontal",
|
|
3617
3671
|
entries: [{
|
|
@@ -3619,14 +3673,14 @@ function planChatVisualXLabels(e) {
|
|
|
3619
3673
|
text: r[0]
|
|
3620
3674
|
}]
|
|
3621
3675
|
};
|
|
3622
|
-
if ((Math.max(...r.map((e) => e.length *
|
|
3676
|
+
if ((Math.max(...r.map((e) => e.length * Tr)) + Er) * t.length <= n) return {
|
|
3623
3677
|
mode: "horizontal",
|
|
3624
3678
|
entries: r.map((e, t) => ({
|
|
3625
3679
|
index: t,
|
|
3626
3680
|
text: e
|
|
3627
3681
|
}))
|
|
3628
3682
|
};
|
|
3629
|
-
let a = Math.max(2, Math.floor(n /
|
|
3683
|
+
let a = Math.max(2, Math.floor(n / Dr));
|
|
3630
3684
|
if (t.length <= a) return {
|
|
3631
3685
|
mode: "angled",
|
|
3632
3686
|
entries: r.map((e, t) => ({
|
|
@@ -3646,22 +3700,22 @@ function planChatVisualXLabels(e) {
|
|
|
3646
3700
|
}
|
|
3647
3701
|
//#endregion
|
|
3648
3702
|
//#region agent/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3649
|
-
var
|
|
3703
|
+
var kr = [
|
|
3650
3704
|
"data-visual-type",
|
|
3651
3705
|
"data-chart-type",
|
|
3652
3706
|
"data-stacking",
|
|
3653
3707
|
"data-diagram-type",
|
|
3654
3708
|
"aria-label"
|
|
3655
|
-
],
|
|
3709
|
+
], Ar = { class: "mb-2.5" }, jr = ["aria-label"], Mr = {
|
|
3656
3710
|
key: 0,
|
|
3657
3711
|
"data-test": "chat-visual-horizontal-bars",
|
|
3658
3712
|
class: "grid gap-3"
|
|
3659
|
-
},
|
|
3713
|
+
}, Nr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Pr = ["viewBox"], Fr = [
|
|
3660
3714
|
"x1",
|
|
3661
3715
|
"x2",
|
|
3662
3716
|
"y1",
|
|
3663
3717
|
"y2"
|
|
3664
|
-
],
|
|
3718
|
+
], Ir = ["x", "y"], Lr = [
|
|
3665
3719
|
"data-row-index",
|
|
3666
3720
|
"data-series-index",
|
|
3667
3721
|
"data-data-key",
|
|
@@ -3669,56 +3723,56 @@ var Cr = [
|
|
|
3669
3723
|
"y",
|
|
3670
3724
|
"width",
|
|
3671
3725
|
"height"
|
|
3672
|
-
],
|
|
3726
|
+
], Rr = ["data-trend-key", "d"], zr = ["d"], Br = ["cx", "cy"], Vr = ["cx", "cy"], Hr = [
|
|
3673
3727
|
"x",
|
|
3674
3728
|
"y",
|
|
3675
3729
|
"text-anchor",
|
|
3676
3730
|
"transform"
|
|
3677
|
-
],
|
|
3731
|
+
], Ur = {
|
|
3678
3732
|
key: 2,
|
|
3679
3733
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3680
|
-
},
|
|
3734
|
+
}, Wr = {
|
|
3681
3735
|
key: 1,
|
|
3682
3736
|
class: "grid gap-3"
|
|
3683
|
-
},
|
|
3737
|
+
}, Gr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Kr = { class: "shrink-0 tabular-nums" }, qr = {
|
|
3684
3738
|
key: 2,
|
|
3685
3739
|
class: "overflow-x-auto"
|
|
3686
|
-
},
|
|
3740
|
+
}, Jr = ["viewBox", "aria-label"], Yr = [
|
|
3687
3741
|
"data-from",
|
|
3688
3742
|
"data-to",
|
|
3689
3743
|
"x1",
|
|
3690
3744
|
"y1",
|
|
3691
3745
|
"x2",
|
|
3692
3746
|
"y2"
|
|
3693
|
-
],
|
|
3747
|
+
], Xr = ["cx", "cy"], Zr = ["x", "y"], Qr = [
|
|
3694
3748
|
"data-node-id",
|
|
3695
3749
|
"data-node-kind",
|
|
3696
3750
|
"transform"
|
|
3697
|
-
],
|
|
3751
|
+
], $r = ["points"], ei = ["width", "height"], ti = ["width", "height"], ni = {
|
|
3698
3752
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3699
3753
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3700
|
-
},
|
|
3754
|
+
}, ri = /* @__PURE__ */ x({
|
|
3701
3755
|
__name: "ChatVisualBlock",
|
|
3702
3756
|
props: {
|
|
3703
3757
|
result: {},
|
|
3704
3758
|
inverted: { type: Boolean }
|
|
3705
3759
|
},
|
|
3706
3760
|
setup(e) {
|
|
3707
|
-
let t = e, n =
|
|
3708
|
-
|
|
3761
|
+
let t = e, n = k(), r = se(360), i;
|
|
3762
|
+
ie(() => {
|
|
3709
3763
|
typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
|
|
3710
3764
|
let t = e[0]?.contentRect.width;
|
|
3711
3765
|
t && (r.value = Math.round(t));
|
|
3712
3766
|
}), i.observe(n.value));
|
|
3713
|
-
}),
|
|
3714
|
-
let a =
|
|
3767
|
+
}), re(() => i?.disconnect());
|
|
3768
|
+
let a = p(() => Math.min(720, Math.max(280, r.value))), o = p(() => t.result.ok ? t.result.spec : null), s = p(() => o.value?.visualType === "chart" ? o.value : null), c = p(() => o.value?.visualType === "diagram" ? o.value : null);
|
|
3715
3769
|
function isCartesianChart(e) {
|
|
3716
3770
|
return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
|
|
3717
3771
|
}
|
|
3718
3772
|
function isPieChart(e) {
|
|
3719
3773
|
return e?.chartType === "pie";
|
|
3720
3774
|
}
|
|
3721
|
-
let
|
|
3775
|
+
let u = p(() => s.value?.data ?? []), m = p(() => isCartesianChart(s.value) ? s.value : null), te = p(() => m.value?.series ?? []), b = p(() => isPieChart(s.value) ? s.value : null), x = p(() => m.value?.chartType === "bar" && m.value.stacking === "stacked");
|
|
3722
3776
|
function numericValue(e) {
|
|
3723
3777
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
3724
3778
|
}
|
|
@@ -3750,8 +3804,8 @@ var Cr = [
|
|
|
3750
3804
|
intercept: (r - s * n) / t
|
|
3751
3805
|
};
|
|
3752
3806
|
}
|
|
3753
|
-
let
|
|
3754
|
-
let e = [], t =
|
|
3807
|
+
let ne = p(() => {
|
|
3808
|
+
let e = [], t = m.value;
|
|
3755
3809
|
if (!t) return e;
|
|
3756
3810
|
if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
|
|
3757
3811
|
let r = 0, i = 0;
|
|
@@ -3780,8 +3834,8 @@ var Cr = [
|
|
|
3780
3834
|
let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
|
|
3781
3835
|
return a = t ? i < 1.5 ? 1 : i < 3 ? 2 : i < 7 ? 5 : 10 : i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10, a * 10 ** r;
|
|
3782
3836
|
}
|
|
3783
|
-
let
|
|
3784
|
-
let e =
|
|
3837
|
+
let S = p(() => {
|
|
3838
|
+
let e = ne.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
|
|
3785
3839
|
if (n === t) return {
|
|
3786
3840
|
min: 0,
|
|
3787
3841
|
max: t || 1,
|
|
@@ -3794,8 +3848,8 @@ var Cr = [
|
|
|
3794
3848
|
max: a,
|
|
3795
3849
|
ticks: o
|
|
3796
3850
|
};
|
|
3797
|
-
}),
|
|
3798
|
-
let e =
|
|
3851
|
+
}), ae = p(() => resolveSharedSeriesFormat({ series: te.value })), oe = p(() => {
|
|
3852
|
+
let e = m.value;
|
|
3799
3853
|
if (!e) return {
|
|
3800
3854
|
mode: "horizontal",
|
|
3801
3855
|
entries: []
|
|
@@ -3805,8 +3859,8 @@ var Cr = [
|
|
|
3805
3859
|
labels: e.data.map((e) => String(e?.[t] ?? "")),
|
|
3806
3860
|
plotWidth: Math.max(200, a.value - 42)
|
|
3807
3861
|
});
|
|
3808
|
-
}),
|
|
3809
|
-
let e =
|
|
3862
|
+
}), j = p(() => {
|
|
3863
|
+
let e = ae.value?.valueFormat, t = !!(ae.value && (e === "currency" || e === "percent" || ae.value.valuePrefix || ae.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = oe.value.mode === "angled";
|
|
3810
3864
|
return {
|
|
3811
3865
|
width: a.value,
|
|
3812
3866
|
height: 168 + (r ? 36 : 0),
|
|
@@ -3817,7 +3871,7 @@ var Cr = [
|
|
|
3817
3871
|
};
|
|
3818
3872
|
});
|
|
3819
3873
|
function labelCenterX(e, t) {
|
|
3820
|
-
let n =
|
|
3874
|
+
let n = m.value, r = j.value;
|
|
3821
3875
|
if (n?.chartType === "bar") {
|
|
3822
3876
|
let n = r.width - r.left - r.right;
|
|
3823
3877
|
return r.left + (e + .5) * (n / Math.max(t, 1));
|
|
@@ -3825,22 +3879,22 @@ var Cr = [
|
|
|
3825
3879
|
return xForIndex(e, t);
|
|
3826
3880
|
}
|
|
3827
3881
|
function xForIndex(e, t) {
|
|
3828
|
-
let n =
|
|
3882
|
+
let n = j.value, r = n.width - n.left - n.right;
|
|
3829
3883
|
return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
|
|
3830
3884
|
}
|
|
3831
3885
|
function yForValue(e) {
|
|
3832
|
-
let { min: t, max: n } =
|
|
3886
|
+
let { min: t, max: n } = S.value, r = j.value, i = r.height - r.top - r.bottom;
|
|
3833
3887
|
return r.top + (n - e) / (n - t || 1) * i;
|
|
3834
3888
|
}
|
|
3835
3889
|
function pathForSeries(e) {
|
|
3836
|
-
let t =
|
|
3890
|
+
let t = m.value;
|
|
3837
3891
|
return t ? t.data.map((n, r) => {
|
|
3838
3892
|
let i = numericValue(n[e]) ?? 0;
|
|
3839
3893
|
return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
|
|
3840
3894
|
}).join(" ") : "";
|
|
3841
3895
|
}
|
|
3842
|
-
let
|
|
3843
|
-
let e =
|
|
3896
|
+
let ue = p(() => {
|
|
3897
|
+
let e = m.value;
|
|
3844
3898
|
if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
|
|
3845
3899
|
let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
|
|
3846
3900
|
if (!n || !t.length) return null;
|
|
@@ -3850,11 +3904,11 @@ var Cr = [
|
|
|
3850
3904
|
dataKey: e.trendLine.dataKey,
|
|
3851
3905
|
seriesIndex: s
|
|
3852
3906
|
};
|
|
3853
|
-
}),
|
|
3854
|
-
let e =
|
|
3907
|
+
}), de = p(() => {
|
|
3908
|
+
let e = m.value;
|
|
3855
3909
|
if (!e || e.chartType !== "bar") return [];
|
|
3856
|
-
let t =
|
|
3857
|
-
if (
|
|
3910
|
+
let t = j.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
|
|
3911
|
+
if (x.value) {
|
|
3858
3912
|
let r = Math.max(4, Math.min(24, n * .42));
|
|
3859
3913
|
return e.data.flatMap((i, a) => {
|
|
3860
3914
|
let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
|
|
@@ -3887,12 +3941,12 @@ var Cr = [
|
|
|
3887
3941
|
dataKey: e.dataKey
|
|
3888
3942
|
};
|
|
3889
3943
|
}));
|
|
3890
|
-
}),
|
|
3891
|
-
let e =
|
|
3944
|
+
}), F = p(() => {
|
|
3945
|
+
let e = m.value;
|
|
3892
3946
|
if (!e) return [];
|
|
3893
3947
|
let t = e.data;
|
|
3894
3948
|
if (!t.length) return [];
|
|
3895
|
-
let n = t.length - 1, r =
|
|
3949
|
+
let n = t.length - 1, r = oe.value, i = r.mode === "angled";
|
|
3896
3950
|
return r.entries.map(({ index: e, text: r }) => ({
|
|
3897
3951
|
key: `${e}`,
|
|
3898
3952
|
label: r,
|
|
@@ -3900,9 +3954,9 @@ var Cr = [
|
|
|
3900
3954
|
anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
|
|
3901
3955
|
angled: i
|
|
3902
3956
|
})).filter((e) => e.label);
|
|
3903
|
-
}),
|
|
3904
|
-
let e =
|
|
3905
|
-
if (!e || e.chartType !== "bar" || e.series.length !== 1 ||
|
|
3957
|
+
}), pe = p(() => {
|
|
3958
|
+
let e = m.value;
|
|
3959
|
+
if (!e || e.chartType !== "bar" || e.series.length !== 1 || x.value) return [];
|
|
3906
3960
|
let t = e.series[0], n = e.data.map((n, r) => {
|
|
3907
3961
|
let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
|
|
3908
3962
|
return !i || a === null ? null : {
|
|
@@ -3923,8 +3977,8 @@ var Cr = [
|
|
|
3923
3977
|
width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
|
|
3924
3978
|
seriesIndex: 0
|
|
3925
3979
|
}));
|
|
3926
|
-
}),
|
|
3927
|
-
let e =
|
|
3980
|
+
}), he = p(() => {
|
|
3981
|
+
let e = m.value;
|
|
3928
3982
|
if (!e?.data.length) return [];
|
|
3929
3983
|
let t = e.data[e.data.length - 1];
|
|
3930
3984
|
return e.series.map((e, n) => {
|
|
@@ -3939,8 +3993,8 @@ var Cr = [
|
|
|
3939
3993
|
seriesIndex: n
|
|
3940
3994
|
};
|
|
3941
3995
|
});
|
|
3942
|
-
}),
|
|
3943
|
-
let e =
|
|
3996
|
+
}), I = p(() => {
|
|
3997
|
+
let e = m.value;
|
|
3944
3998
|
if (!e?.data.length || e.chartType !== "line") return [];
|
|
3945
3999
|
let t = e.data.length - 1, n = e.data[t];
|
|
3946
4000
|
return e.series.map((r, i) => {
|
|
@@ -3952,8 +4006,8 @@ var Cr = [
|
|
|
3952
4006
|
seriesIndex: i
|
|
3953
4007
|
};
|
|
3954
4008
|
}).filter((e) => e !== null);
|
|
3955
|
-
}),
|
|
3956
|
-
let e =
|
|
4009
|
+
}), R = p(() => {
|
|
4010
|
+
let e = b.value;
|
|
3957
4011
|
if (!e) return [];
|
|
3958
4012
|
let t = e.data.map((t) => ({
|
|
3959
4013
|
name: String(t[e.nameKey] ?? ""),
|
|
@@ -3968,17 +4022,17 @@ var Cr = [
|
|
|
3968
4022
|
series: r
|
|
3969
4023
|
})
|
|
3970
4024
|
}));
|
|
3971
|
-
}),
|
|
4025
|
+
}), z = p(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), _e = [
|
|
3972
4026
|
"var(--color-theme-900)",
|
|
3973
4027
|
"var(--color-primary-500)",
|
|
3974
4028
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
3975
|
-
],
|
|
4029
|
+
], ve = [
|
|
3976
4030
|
"rgba(255, 255, 255, 0.92)",
|
|
3977
4031
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
3978
4032
|
"rgba(255, 255, 255, 0.55)"
|
|
3979
4033
|
];
|
|
3980
4034
|
function seriesColor(e) {
|
|
3981
|
-
let n = t.inverted ?
|
|
4035
|
+
let n = t.inverted ? ve : _e;
|
|
3982
4036
|
return n[e % n.length];
|
|
3983
4037
|
}
|
|
3984
4038
|
function diagramNodeFill(e) {
|
|
@@ -3987,82 +4041,82 @@ var Cr = [
|
|
|
3987
4041
|
function diagramNodeStroke(e) {
|
|
3988
4042
|
return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Se.value;
|
|
3989
4043
|
}
|
|
3990
|
-
let
|
|
3991
|
-
return (e, r) => o.value ? (
|
|
4044
|
+
let B = p(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = p(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = p(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = p(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = p(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = p(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = p(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Ce = p(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = p(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
4045
|
+
return (e, r) => o.value ? (T(), _("section", {
|
|
3992
4046
|
key: 0,
|
|
3993
4047
|
"data-test": "chat-visual",
|
|
3994
4048
|
"data-visual-type": o.value.visualType,
|
|
3995
4049
|
"data-chart-type": s.value?.chartType,
|
|
3996
|
-
"data-stacking":
|
|
4050
|
+
"data-stacking": x.value ? "stacked" : void 0,
|
|
3997
4051
|
"data-diagram-type": c.value?.diagramType,
|
|
3998
4052
|
class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
|
|
3999
|
-
style:
|
|
4053
|
+
style: C({ boxShadow: `inset 0 0 0 1px ${W.value}` }),
|
|
4000
4054
|
"aria-label": o.value.meta.title
|
|
4001
4055
|
}, [
|
|
4002
|
-
|
|
4056
|
+
v("header", Ar, [v("h4", {
|
|
4003
4057
|
class: "text-[13px] font-semibold leading-tight",
|
|
4004
|
-
style:
|
|
4005
|
-
},
|
|
4058
|
+
style: C({ color: B.value })
|
|
4059
|
+
}, P(o.value.meta.title), 5), o.value.meta.description ? (T(), _("p", {
|
|
4006
4060
|
key: 0,
|
|
4007
4061
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
4008
|
-
style:
|
|
4009
|
-
},
|
|
4010
|
-
|
|
4062
|
+
style: C({ color: ye.value })
|
|
4063
|
+
}, P(o.value.meta.description), 5)) : h("", !0)]),
|
|
4064
|
+
v("div", {
|
|
4011
4065
|
ref_key: "bodyEl",
|
|
4012
4066
|
ref: n
|
|
4013
|
-
}, [
|
|
4067
|
+
}, [m.value ? (T(), _("div", {
|
|
4014
4068
|
key: 0,
|
|
4015
4069
|
role: "img",
|
|
4016
4070
|
"aria-label": o.value.meta.title
|
|
4017
|
-
}, [
|
|
4071
|
+
}, [pe.value.length ? (T(), _("div", Mr, [(T(!0), _(f, null, A(pe.value, (e) => (T(), _("div", {
|
|
4018
4072
|
key: e.key,
|
|
4019
4073
|
"data-test": "chat-visual-horizontal-bar",
|
|
4020
4074
|
class: "min-w-0"
|
|
4021
|
-
}, [
|
|
4075
|
+
}, [v("div", Nr, [v("span", {
|
|
4022
4076
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4023
|
-
style:
|
|
4024
|
-
},
|
|
4077
|
+
style: C({ color: B.value })
|
|
4078
|
+
}, P(e.label), 5), v("span", {
|
|
4025
4079
|
class: "shrink-0 font-semibold tabular-nums",
|
|
4026
|
-
style:
|
|
4027
|
-
},
|
|
4080
|
+
style: C({ color: B.value })
|
|
4081
|
+
}, P(e.value), 5)]), v("div", {
|
|
4028
4082
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4029
|
-
style:
|
|
4030
|
-
}, [
|
|
4083
|
+
style: C({ background: we.value })
|
|
4084
|
+
}, [v("div", {
|
|
4031
4085
|
class: "h-full rounded-full",
|
|
4032
|
-
style:
|
|
4086
|
+
style: C({
|
|
4033
4087
|
width: `${e.width}%`,
|
|
4034
4088
|
background: seriesColor(e.seriesIndex)
|
|
4035
4089
|
})
|
|
4036
|
-
}, null, 4)], 4)]))), 128))])) : (
|
|
4090
|
+
}, null, 4)], 4)]))), 128))])) : (T(), _("svg", {
|
|
4037
4091
|
key: 1,
|
|
4038
4092
|
class: "block h-auto w-full overflow-visible",
|
|
4039
|
-
viewBox: `0 0 ${
|
|
4040
|
-
style:
|
|
4093
|
+
viewBox: `0 0 ${j.value.width} ${j.value.height}`,
|
|
4094
|
+
style: C({ aspectRatio: `${j.value.width} / ${j.value.height}` }),
|
|
4041
4095
|
preserveAspectRatio: "xMidYMid meet",
|
|
4042
4096
|
"aria-hidden": "true"
|
|
4043
4097
|
}, [
|
|
4044
|
-
(
|
|
4098
|
+
(T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("line", {
|
|
4045
4099
|
key: `grid-${e}`,
|
|
4046
|
-
x1:
|
|
4047
|
-
x2:
|
|
4100
|
+
x1: j.value.left,
|
|
4101
|
+
x2: j.value.width - j.value.right,
|
|
4048
4102
|
y1: yForValue(e),
|
|
4049
4103
|
y2: yForValue(e),
|
|
4050
4104
|
"stroke-width": "1",
|
|
4051
4105
|
"vector-effect": "non-scaling-stroke",
|
|
4052
|
-
style:
|
|
4053
|
-
}, null, 12,
|
|
4054
|
-
|
|
4106
|
+
style: C({ stroke: e === 0 ? U.value : be.value })
|
|
4107
|
+
}, null, 12, Fr))), 128)),
|
|
4108
|
+
v("g", null, [(T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("text", {
|
|
4055
4109
|
key: `y-${e}`,
|
|
4056
|
-
x:
|
|
4110
|
+
x: j.value.left - 7,
|
|
4057
4111
|
y: yForValue(e) + 3,
|
|
4058
4112
|
"text-anchor": "end",
|
|
4059
4113
|
"font-size": "9.5",
|
|
4060
|
-
style:
|
|
4061
|
-
},
|
|
4114
|
+
style: C({ fill: H.value })
|
|
4115
|
+
}, P(ce(formatChatVisualTick)({
|
|
4062
4116
|
value: e,
|
|
4063
|
-
shared:
|
|
4064
|
-
})), 13,
|
|
4065
|
-
|
|
4117
|
+
shared: ae.value
|
|
4118
|
+
})), 13, Ir))), 128))]),
|
|
4119
|
+
m.value.chartType === "bar" ? (T(!0), _(f, { key: 0 }, A(de.value, (e) => (T(), _("rect", {
|
|
4066
4120
|
key: e.key,
|
|
4067
4121
|
"data-test": "chat-visual-bar",
|
|
4068
4122
|
"data-row-index": e.rowIndex,
|
|
@@ -4073,22 +4127,22 @@ var Cr = [
|
|
|
4073
4127
|
width: e.width,
|
|
4074
4128
|
height: e.height,
|
|
4075
4129
|
rx: "2.5",
|
|
4076
|
-
style:
|
|
4077
|
-
}, null, 12,
|
|
4078
|
-
|
|
4130
|
+
style: C({ fill: seriesColor(e.seriesIndex) })
|
|
4131
|
+
}, null, 12, Lr))), 128)) : (T(), _(f, { key: 1 }, [
|
|
4132
|
+
ue.value ? (T(), _("path", {
|
|
4079
4133
|
key: 0,
|
|
4080
4134
|
"data-test": "chat-visual-trend-line",
|
|
4081
|
-
"data-trend-key":
|
|
4082
|
-
d:
|
|
4135
|
+
"data-trend-key": ue.value.dataKey,
|
|
4136
|
+
d: ue.value.path,
|
|
4083
4137
|
fill: "none",
|
|
4084
4138
|
"stroke-width": "1.4",
|
|
4085
4139
|
"stroke-linecap": "round",
|
|
4086
4140
|
"stroke-linejoin": "round",
|
|
4087
4141
|
"stroke-dasharray": "4 3",
|
|
4088
4142
|
"vector-effect": "non-scaling-stroke",
|
|
4089
|
-
style:
|
|
4090
|
-
}, null, 12,
|
|
4091
|
-
(
|
|
4143
|
+
style: C({ stroke: seriesColor(ue.value.seriesIndex) })
|
|
4144
|
+
}, null, 12, Rr)) : h("", !0),
|
|
4145
|
+
(T(!0), _(f, null, A(te.value, (e, t) => (T(), _("g", { key: e.dataKey }, [m.value.chartType === "line" ? (T(), _("path", {
|
|
4092
4146
|
key: 0,
|
|
4093
4147
|
d: pathForSeries(e.dataKey),
|
|
4094
4148
|
fill: "none",
|
|
@@ -4096,74 +4150,74 @@ var Cr = [
|
|
|
4096
4150
|
"stroke-linecap": "round",
|
|
4097
4151
|
"stroke-linejoin": "round",
|
|
4098
4152
|
"vector-effect": "non-scaling-stroke",
|
|
4099
|
-
style:
|
|
4100
|
-
}, null, 12,
|
|
4153
|
+
style: C({ stroke: seriesColor(t) })
|
|
4154
|
+
}, null, 12, zr)) : h("", !0), (T(!0), _(f, null, A(u.value, (n, r) => (T(), _(f, { key: `${e.dataKey}-${r}` }, [m.value.chartType === "scatter" ? (T(), _("circle", {
|
|
4101
4155
|
key: 0,
|
|
4102
|
-
cx: xForIndex(r,
|
|
4156
|
+
cx: xForIndex(r, u.value.length),
|
|
4103
4157
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4104
4158
|
r: "2.6",
|
|
4105
|
-
style:
|
|
4106
|
-
}, null, 12,
|
|
4107
|
-
(
|
|
4159
|
+
style: C({ fill: seriesColor(t) })
|
|
4160
|
+
}, null, 12, Br)) : h("", !0)], 64))), 128))]))), 128)),
|
|
4161
|
+
(T(!0), _(f, null, A(I.value, (e) => (T(), _("circle", {
|
|
4108
4162
|
key: `marker-${e.key}`,
|
|
4109
4163
|
cx: e.cx,
|
|
4110
4164
|
cy: e.cy,
|
|
4111
4165
|
r: "3",
|
|
4112
|
-
style:
|
|
4113
|
-
}, null, 12,
|
|
4166
|
+
style: C({ fill: seriesColor(e.seriesIndex) })
|
|
4167
|
+
}, null, 12, Vr))), 128))
|
|
4114
4168
|
], 64)),
|
|
4115
|
-
(
|
|
4169
|
+
(T(!0), _(f, null, A(F.value, (e) => (T(), _("text", {
|
|
4116
4170
|
key: e.key,
|
|
4117
4171
|
x: e.x,
|
|
4118
|
-
y: e.angled ?
|
|
4172
|
+
y: e.angled ? j.value.height - j.value.bottom + 12 : j.value.height - 6,
|
|
4119
4173
|
"text-anchor": e.anchor,
|
|
4120
4174
|
"font-size": "9.5",
|
|
4121
|
-
transform: e.angled ? `rotate(${
|
|
4122
|
-
style:
|
|
4123
|
-
},
|
|
4124
|
-
], 12,
|
|
4175
|
+
transform: e.angled ? `rotate(${ce(-40)} ${e.x} ${j.value.height - j.value.bottom + 12})` : void 0,
|
|
4176
|
+
style: C({ fill: H.value })
|
|
4177
|
+
}, P(e.label), 13, Hr))), 128))
|
|
4178
|
+
], 12, Pr)), he.value.length > 1 || m.value.chartType !== "bar" ? (T(), _("div", Ur, [(T(!0), _(f, null, A(he.value, (e) => (T(), _("div", {
|
|
4125
4179
|
key: e.key,
|
|
4126
4180
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4127
4181
|
}, [
|
|
4128
|
-
|
|
4182
|
+
v("span", {
|
|
4129
4183
|
class: "size-2.5 shrink-0 rounded-full",
|
|
4130
|
-
style:
|
|
4184
|
+
style: C({ background: seriesColor(e.seriesIndex) })
|
|
4131
4185
|
}, null, 4),
|
|
4132
|
-
|
|
4133
|
-
|
|
4186
|
+
v("span", { style: C({ color: ye.value }) }, P(e.label), 5),
|
|
4187
|
+
v("span", {
|
|
4134
4188
|
class: "font-semibold tabular-nums",
|
|
4135
|
-
style:
|
|
4136
|
-
},
|
|
4137
|
-
]))), 128))])) :
|
|
4189
|
+
style: C({ color: B.value })
|
|
4190
|
+
}, P(e.value), 5)
|
|
4191
|
+
]))), 128))])) : h("", !0)], 8, jr)) : b.value ? (T(), _("div", Wr, [(T(!0), _(f, null, A(R.value, (e, t) => (T(), _("div", { key: e.key }, [v("div", Gr, [v("span", {
|
|
4138
4192
|
class: "truncate font-medium",
|
|
4139
|
-
style:
|
|
4140
|
-
},
|
|
4193
|
+
style: C({ color: B.value })
|
|
4194
|
+
}, P(e.name), 5), v("span", Kr, [v("span", {
|
|
4141
4195
|
class: "font-semibold",
|
|
4142
|
-
style:
|
|
4143
|
-
},
|
|
4196
|
+
style: C({ color: B.value })
|
|
4197
|
+
}, P(e.display), 5), v("span", {
|
|
4144
4198
|
class: "ml-1.5",
|
|
4145
|
-
style:
|
|
4146
|
-
},
|
|
4199
|
+
style: C({ color: ye.value })
|
|
4200
|
+
}, P(Math.round(e.percent * 100)) + "%", 5)])]), v("div", {
|
|
4147
4201
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4148
|
-
style:
|
|
4149
|
-
}, [
|
|
4202
|
+
style: C({ background: we.value })
|
|
4203
|
+
}, [v("div", {
|
|
4150
4204
|
class: "h-full rounded-full",
|
|
4151
|
-
style:
|
|
4205
|
+
style: C({
|
|
4152
4206
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4153
4207
|
background: seriesColor(t)
|
|
4154
4208
|
})
|
|
4155
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4209
|
+
}, null, 4)], 4)]))), 128))])) : c.value && z.value ? (T(), _("div", qr, [(T(), _("svg", {
|
|
4156
4210
|
"data-test": "chat-visual-diagram-svg",
|
|
4157
4211
|
class: "block h-auto overflow-visible",
|
|
4158
|
-
viewBox: `0 0 ${
|
|
4159
|
-
style:
|
|
4160
|
-
width: `${
|
|
4161
|
-
aspectRatio: `${
|
|
4212
|
+
viewBox: `0 0 ${z.value.width} ${z.value.height}`,
|
|
4213
|
+
style: C({
|
|
4214
|
+
width: `${z.value.width}px`,
|
|
4215
|
+
aspectRatio: `${z.value.width} / ${z.value.height}`
|
|
4162
4216
|
}),
|
|
4163
4217
|
role: "img",
|
|
4164
4218
|
"aria-label": o.value.meta.title
|
|
4165
4219
|
}, [
|
|
4166
|
-
(
|
|
4220
|
+
(T(!0), _(f, null, A(z.value.edges, (e) => (T(), _("line", {
|
|
4167
4221
|
key: e.key,
|
|
4168
4222
|
"data-test": "chat-visual-diagram-edge",
|
|
4169
4223
|
"data-from": e.from,
|
|
@@ -4175,98 +4229,99 @@ var Cr = [
|
|
|
4175
4229
|
"stroke-width": "1.4",
|
|
4176
4230
|
"stroke-linecap": "round",
|
|
4177
4231
|
"vector-effect": "non-scaling-stroke",
|
|
4178
|
-
style:
|
|
4179
|
-
}, null, 12,
|
|
4180
|
-
(
|
|
4232
|
+
style: C({ stroke: Ce.value })
|
|
4233
|
+
}, null, 12, Yr))), 128)),
|
|
4234
|
+
(T(!0), _(f, null, A(z.value.edges, (e) => (T(), _("circle", {
|
|
4181
4235
|
key: `${e.key}-dot`,
|
|
4182
4236
|
cx: e.x2,
|
|
4183
4237
|
cy: e.y2,
|
|
4184
4238
|
r: "2.4",
|
|
4185
|
-
style:
|
|
4186
|
-
}, null, 12,
|
|
4187
|
-
(
|
|
4239
|
+
style: C({ fill: Ce.value })
|
|
4240
|
+
}, null, 12, Xr))), 128)),
|
|
4241
|
+
(T(!0), _(f, null, A(z.value.edges.filter((e) => e.label), (e) => (T(), _("foreignObject", {
|
|
4188
4242
|
key: `${e.key}-label`,
|
|
4189
4243
|
x: e.labelX - 55,
|
|
4190
4244
|
y: e.labelY - 12,
|
|
4191
4245
|
width: "110",
|
|
4192
4246
|
height: "24"
|
|
4193
|
-
}, [
|
|
4247
|
+
}, [v("div", {
|
|
4194
4248
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
4195
4249
|
class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
|
|
4196
|
-
style:
|
|
4250
|
+
style: C({
|
|
4197
4251
|
color: ye.value,
|
|
4198
4252
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4199
4253
|
})
|
|
4200
|
-
},
|
|
4201
|
-
(
|
|
4254
|
+
}, P(e.label), 5)], 8, Zr))), 128)),
|
|
4255
|
+
(T(!0), _(f, null, A(z.value.nodes, (e) => (T(), _("g", {
|
|
4202
4256
|
key: e.id,
|
|
4203
4257
|
"data-test": "chat-visual-diagram-node",
|
|
4204
4258
|
"data-node-id": e.id,
|
|
4205
4259
|
"data-node-kind": e.kind,
|
|
4206
4260
|
transform: `translate(${e.x} ${e.y})`
|
|
4207
|
-
}, [e.kind === "decision" ? (
|
|
4261
|
+
}, [e.kind === "decision" ? (T(), _("polygon", {
|
|
4208
4262
|
key: 0,
|
|
4209
4263
|
points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
|
|
4210
4264
|
"stroke-width": "1",
|
|
4211
4265
|
"vector-effect": "non-scaling-stroke",
|
|
4212
|
-
style:
|
|
4266
|
+
style: C({
|
|
4213
4267
|
fill: diagramNodeFill(e.kind),
|
|
4214
4268
|
stroke: diagramNodeStroke(e.kind)
|
|
4215
4269
|
})
|
|
4216
|
-
}, null, 12,
|
|
4270
|
+
}, null, 12, $r)) : (T(), _("rect", {
|
|
4217
4271
|
key: 1,
|
|
4218
4272
|
width: e.width,
|
|
4219
4273
|
height: e.height,
|
|
4220
4274
|
rx: "12",
|
|
4221
4275
|
"stroke-width": "1",
|
|
4222
4276
|
"vector-effect": "non-scaling-stroke",
|
|
4223
|
-
style:
|
|
4277
|
+
style: C({
|
|
4224
4278
|
fill: diagramNodeFill(e.kind),
|
|
4225
4279
|
stroke: diagramNodeStroke(e.kind)
|
|
4226
4280
|
})
|
|
4227
|
-
}, null, 12,
|
|
4281
|
+
}, null, 12, ei)), (T(), _("foreignObject", {
|
|
4228
4282
|
x: "8",
|
|
4229
4283
|
y: "5",
|
|
4230
4284
|
width: e.width - 16,
|
|
4231
4285
|
height: e.height - 10
|
|
4232
|
-
}, [
|
|
4286
|
+
}, [v("div", ni, [v("div", {
|
|
4233
4287
|
class: "line-clamp-2 text-[13px] font-semibold leading-tight",
|
|
4234
|
-
style:
|
|
4235
|
-
},
|
|
4288
|
+
style: C({ color: B.value })
|
|
4289
|
+
}, P(e.label), 5), e.detail ? (T(), _("div", {
|
|
4236
4290
|
key: 0,
|
|
4237
4291
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4238
|
-
style:
|
|
4239
|
-
},
|
|
4240
|
-
], 12,
|
|
4241
|
-
o.value.meta.footer ? (
|
|
4292
|
+
style: C({ color: ye.value })
|
|
4293
|
+
}, P(e.detail), 5)) : h("", !0)])], 8, ti))], 8, Qr))), 128))
|
|
4294
|
+
], 12, Jr))])) : h("", !0)], 512),
|
|
4295
|
+
o.value.meta.footer ? (T(), _("footer", {
|
|
4242
4296
|
key: 0,
|
|
4243
4297
|
class: "mt-3 text-[11px] leading-snug",
|
|
4244
|
-
style:
|
|
4245
|
-
},
|
|
4246
|
-
], 12,
|
|
4298
|
+
style: C({ color: H.value })
|
|
4299
|
+
}, P(o.value.meta.footer), 5)) : h("", !0)
|
|
4300
|
+
], 12, kr)) : h("", !0);
|
|
4247
4301
|
}
|
|
4248
|
-
}),
|
|
4302
|
+
}), ii = ["innerHTML"], ai = /* @__PURE__ */ x({
|
|
4249
4303
|
__name: "ChatRichText",
|
|
4250
4304
|
props: {
|
|
4251
4305
|
text: {},
|
|
4252
4306
|
inverted: { type: Boolean },
|
|
4253
4307
|
streaming: { type: Boolean }
|
|
4254
4308
|
},
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4309
|
+
emits: ["action"],
|
|
4310
|
+
setup(e, { emit: t }) {
|
|
4311
|
+
let n = e, r = t, i = se(n.text), a;
|
|
4312
|
+
de([() => n.text, () => n.streaming], ([e, t]) => {
|
|
4313
|
+
if (!t) {
|
|
4314
|
+
a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
|
|
4260
4315
|
return;
|
|
4261
4316
|
}
|
|
4262
|
-
|
|
4263
|
-
|
|
4317
|
+
a === void 0 && (a = requestAnimationFrame(() => {
|
|
4318
|
+
a = void 0, i.value = n.text;
|
|
4264
4319
|
}));
|
|
4265
|
-
}),
|
|
4266
|
-
|
|
4320
|
+
}), re(() => {
|
|
4321
|
+
a !== void 0 && cancelAnimationFrame(a);
|
|
4267
4322
|
});
|
|
4268
|
-
let
|
|
4269
|
-
|
|
4323
|
+
let o = new g.Renderer();
|
|
4324
|
+
o.link = ({ href: e, text: t }) => {
|
|
4270
4325
|
let n = e.trim();
|
|
4271
4326
|
if (!n || n === "#") return t;
|
|
4272
4327
|
let r = !1;
|
|
@@ -4279,7 +4334,7 @@ var Cr = [
|
|
|
4279
4334
|
}, g.setOptions({
|
|
4280
4335
|
breaks: !0,
|
|
4281
4336
|
gfm: !0,
|
|
4282
|
-
renderer:
|
|
4337
|
+
renderer: o
|
|
4283
4338
|
});
|
|
4284
4339
|
function renderMarkdown(e) {
|
|
4285
4340
|
if (!e) return "";
|
|
@@ -4338,147 +4393,170 @@ var Cr = [
|
|
|
4338
4393
|
height: e.target.naturalHeight || null
|
|
4339
4394
|
});
|
|
4340
4395
|
}
|
|
4341
|
-
let
|
|
4396
|
+
let s = /```(?:pl-visual|pl-platform-visual|pl-card)[ \t]*(?:\r?\n|$)/;
|
|
4342
4397
|
function richTextSegments(e) {
|
|
4343
|
-
let { text: t, streaming: n } = e, r = [], i = /```(
|
|
4344
|
-
for (;
|
|
4345
|
-
let e = renderMarkdown(t.slice(
|
|
4398
|
+
let { text: t, streaming: n } = e, r = [], i = /```(pl-visual|pl-platform-visual|pl-card)[ \t]*\r?\n([\s\S]*?)```/g, a = 0, o = 0, f = i.exec(t);
|
|
4399
|
+
for (; f !== null;) {
|
|
4400
|
+
let e = renderMarkdown(t.slice(a, f.index));
|
|
4346
4401
|
e && r.push({
|
|
4347
4402
|
kind: "markdown",
|
|
4348
|
-
key: `md-${
|
|
4403
|
+
key: `md-${o}`,
|
|
4349
4404
|
html: e
|
|
4350
4405
|
});
|
|
4351
|
-
let n =
|
|
4352
|
-
if (n
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
typeof console < "u" && console.warn("[pl-
|
|
4359
|
-
reason:
|
|
4360
|
-
message:
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
...visualPayloadShape(u[1].trim())
|
|
4364
|
-
});
|
|
4365
|
-
let e = n.fallbackMarkdown ? renderMarkdown(n.fallbackMarkdown) : "";
|
|
4366
|
-
e && r.push({
|
|
4406
|
+
let n = f[1], s = f[2].trim();
|
|
4407
|
+
if (n === "pl-card") {
|
|
4408
|
+
let e = c(s);
|
|
4409
|
+
e.ok ? r.push({
|
|
4410
|
+
kind: "card",
|
|
4411
|
+
key: `card-${o}`,
|
|
4412
|
+
spec: e.spec
|
|
4413
|
+
}) : (typeof console < "u" && console.warn("[pl-card] parse_failed", {
|
|
4414
|
+
reason: e.reason,
|
|
4415
|
+
message: e.message,
|
|
4416
|
+
payloadChars: s.length
|
|
4417
|
+
}), r.push({
|
|
4367
4418
|
kind: "markdown",
|
|
4368
|
-
key: `
|
|
4369
|
-
html:
|
|
4419
|
+
key: `card-${o}`,
|
|
4420
|
+
html: renderMarkdown(`\`\`\`\n${s}\n\`\`\``)
|
|
4421
|
+
}));
|
|
4422
|
+
} else {
|
|
4423
|
+
let e = u(s);
|
|
4424
|
+
if (e.ok) r.push({
|
|
4425
|
+
kind: "visual",
|
|
4426
|
+
key: `visual-${o}`,
|
|
4427
|
+
result: e
|
|
4370
4428
|
});
|
|
4429
|
+
else {
|
|
4430
|
+
typeof console < "u" && console.warn("[pl-visual] parse_failed", {
|
|
4431
|
+
reason: e.reason,
|
|
4432
|
+
message: e.message,
|
|
4433
|
+
hasFallbackMarkdown: !!e.fallbackMarkdown,
|
|
4434
|
+
payloadChars: s.length,
|
|
4435
|
+
...visualPayloadShape(s)
|
|
4436
|
+
});
|
|
4437
|
+
let t = e.fallbackMarkdown ? renderMarkdown(e.fallbackMarkdown) : "";
|
|
4438
|
+
t && r.push({
|
|
4439
|
+
kind: "markdown",
|
|
4440
|
+
key: `visual-${o}`,
|
|
4441
|
+
html: t
|
|
4442
|
+
});
|
|
4443
|
+
}
|
|
4371
4444
|
}
|
|
4372
|
-
|
|
4445
|
+
a = f.index + f[0].length, o += 1, f = i.exec(t);
|
|
4373
4446
|
}
|
|
4374
|
-
let
|
|
4375
|
-
if (
|
|
4376
|
-
let e = renderMarkdown(
|
|
4447
|
+
let p = t.slice(a), m = n ? s.exec(p) : null;
|
|
4448
|
+
if (m) {
|
|
4449
|
+
let e = renderMarkdown(p.slice(0, m.index));
|
|
4377
4450
|
return e && r.push({
|
|
4378
4451
|
kind: "markdown",
|
|
4379
|
-
key: `md-${
|
|
4452
|
+
key: `md-${o}`,
|
|
4380
4453
|
html: e
|
|
4381
4454
|
}), r.push({
|
|
4382
4455
|
kind: "pending-visual",
|
|
4383
|
-
key: `pending-${
|
|
4456
|
+
key: `pending-${o}`
|
|
4384
4457
|
}), r;
|
|
4385
4458
|
}
|
|
4386
|
-
let
|
|
4387
|
-
return
|
|
4459
|
+
let h = renderMarkdown(p);
|
|
4460
|
+
return h && r.push({
|
|
4388
4461
|
kind: "markdown",
|
|
4389
|
-
key: `md-${
|
|
4390
|
-
html:
|
|
4462
|
+
key: `md-${o}`,
|
|
4463
|
+
html: h
|
|
4391
4464
|
}), r;
|
|
4392
4465
|
}
|
|
4393
|
-
let
|
|
4394
|
-
let e =
|
|
4466
|
+
let h = p(() => {
|
|
4467
|
+
let e = i.value;
|
|
4395
4468
|
return e ? richTextSegments({
|
|
4396
4469
|
text: e,
|
|
4397
|
-
streaming: !!
|
|
4470
|
+
streaming: !!n.streaming
|
|
4398
4471
|
}) : [];
|
|
4399
4472
|
});
|
|
4400
|
-
return (t, n) => (
|
|
4473
|
+
return (t, n) => (T(), _("div", {
|
|
4401
4474
|
class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:max-w-[65ch] @sm/chat:text-[16px] @sm/chat:leading-relaxed",
|
|
4402
4475
|
onErrorCapture: onRichTextAssetError
|
|
4403
|
-
}, [(
|
|
4476
|
+
}, [(T(!0), _(f, null, A(h.value, (t) => (T(), _(f, { key: t.key }, [t.kind === "markdown" ? (T(), _("div", {
|
|
4404
4477
|
key: 0,
|
|
4405
|
-
class:
|
|
4478
|
+
class: S(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4406
4479
|
innerHTML: t.html
|
|
4407
|
-
}, null, 10,
|
|
4480
|
+
}, null, 10, ii)) : t.kind === "visual" ? (T(), m(ri, {
|
|
4408
4481
|
key: 1,
|
|
4409
4482
|
result: t.result,
|
|
4410
4483
|
inverted: e.inverted
|
|
4411
|
-
}, null, 8, ["result", "inverted"])) : (
|
|
4484
|
+
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (T(), m(vr, {
|
|
4412
4485
|
key: 2,
|
|
4486
|
+
spec: t.spec,
|
|
4487
|
+
inverted: e.inverted,
|
|
4488
|
+
onAction: n[0] || (n[0] = (e) => r("action", e))
|
|
4489
|
+
}, null, 8, ["spec", "inverted"])) : (T(), _("div", {
|
|
4490
|
+
key: 3,
|
|
4413
4491
|
"data-test": "chat-visual-pending",
|
|
4414
4492
|
role: "status",
|
|
4415
4493
|
class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
|
|
4416
|
-
style:
|
|
4494
|
+
style: C({
|
|
4417
4495
|
boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
|
|
4418
4496
|
color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
|
|
4419
4497
|
})
|
|
4420
|
-
}, [...n[
|
|
4498
|
+
}, [...n[1] || (n[1] = [v("span", {
|
|
4421
4499
|
class: "size-2 shrink-0 animate-pulse rounded-full",
|
|
4422
4500
|
style: { background: "currentcolor" }
|
|
4423
|
-
}, null, -1),
|
|
4501
|
+
}, null, -1), te(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4424
4502
|
}
|
|
4425
|
-
}),
|
|
4503
|
+
}), oi = 80, si = 600, ci = /* @__PURE__ */ x({
|
|
4426
4504
|
__name: "ChatScroller",
|
|
4427
4505
|
setup(e, { expose: t }) {
|
|
4428
|
-
let n =
|
|
4506
|
+
let n = k(), r = k(), i = k(!0), a, o = 0;
|
|
4429
4507
|
function scrollToBottom() {
|
|
4430
4508
|
let e = n.value;
|
|
4431
4509
|
e && (e.scrollTop = e.scrollHeight);
|
|
4432
4510
|
}
|
|
4433
4511
|
function onScroll() {
|
|
4434
4512
|
let e = n.value;
|
|
4435
|
-
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
4513
|
+
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= oi);
|
|
4436
4514
|
}
|
|
4437
4515
|
function markUserGesture() {
|
|
4438
|
-
o = Date.now() +
|
|
4516
|
+
o = Date.now() + si;
|
|
4439
4517
|
}
|
|
4440
4518
|
function pin() {
|
|
4441
4519
|
i.value = !0, scrollToBottom();
|
|
4442
4520
|
}
|
|
4443
|
-
return t({ pin }),
|
|
4521
|
+
return t({ pin }), ie(() => {
|
|
4444
4522
|
requestAnimationFrame(() => {
|
|
4445
4523
|
scrollToBottom(), requestAnimationFrame(scrollToBottom);
|
|
4446
4524
|
}), r.value && (a = new ResizeObserver(() => {
|
|
4447
4525
|
i.value && Date.now() > o && scrollToBottom();
|
|
4448
4526
|
}), a.observe(r.value), n.value && a.observe(n.value));
|
|
4449
|
-
}),
|
|
4527
|
+
}), re(() => {
|
|
4450
4528
|
a?.disconnect();
|
|
4451
|
-
}), (e, t) => (
|
|
4529
|
+
}), (e, t) => (T(), _("div", {
|
|
4452
4530
|
ref_key: "viewport",
|
|
4453
4531
|
ref: n,
|
|
4454
|
-
class:
|
|
4532
|
+
class: S(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
|
|
4455
4533
|
onScrollPassive: onScroll,
|
|
4456
4534
|
onWheelPassive: markUserGesture,
|
|
4457
4535
|
onTouchstartPassive: markUserGesture
|
|
4458
|
-
}, [
|
|
4536
|
+
}, [v("div", {
|
|
4459
4537
|
ref_key: "content",
|
|
4460
4538
|
ref: r,
|
|
4461
4539
|
class: "flex-1 flex flex-col"
|
|
4462
|
-
}, [
|
|
4540
|
+
}, [oe(e.$slots, "default")], 512)], 34));
|
|
4463
4541
|
}
|
|
4464
|
-
}),
|
|
4542
|
+
}), li = {
|
|
4465
4543
|
key: 0,
|
|
4466
4544
|
class: "pb-4"
|
|
4467
|
-
},
|
|
4545
|
+
}, ui = {
|
|
4468
4546
|
key: 1,
|
|
4469
4547
|
"data-test": "messaging-sdk-header",
|
|
4470
4548
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4471
|
-
},
|
|
4549
|
+
}, di = { class: "min-w-0 flex-1" }, fi = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, pi = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, mi = {
|
|
4472
4550
|
key: 0,
|
|
4473
4551
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4474
|
-
},
|
|
4552
|
+
}, hi = {
|
|
4475
4553
|
key: 0,
|
|
4476
4554
|
"data-test": "messaging-empty-state",
|
|
4477
4555
|
class: "flex flex-col items-center justify-center px-4"
|
|
4478
|
-
},
|
|
4556
|
+
}, gi = ["title"], _i = {
|
|
4479
4557
|
key: 0,
|
|
4480
4558
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4481
|
-
},
|
|
4559
|
+
}, vi = ["data-journal-outcome"], yi = [
|
|
4482
4560
|
"data-message-id",
|
|
4483
4561
|
"data-message-sender",
|
|
4484
4562
|
"data-conversation-id",
|
|
@@ -4489,7 +4567,7 @@ var Cr = [
|
|
|
4489
4567
|
"data-issue-action-label",
|
|
4490
4568
|
"data-issue-action-url",
|
|
4491
4569
|
"data-streaming"
|
|
4492
|
-
],
|
|
4570
|
+
], bi = { class: "max-w-[85%] min-w-0" }, xi = ["href"], Si = [
|
|
4493
4571
|
"data-message-id",
|
|
4494
4572
|
"data-message-sender",
|
|
4495
4573
|
"data-conversation-id",
|
|
@@ -4498,7 +4576,7 @@ var Cr = [
|
|
|
4498
4576
|
"data-issue-code",
|
|
4499
4577
|
"data-issue-bucket",
|
|
4500
4578
|
"data-streaming"
|
|
4501
|
-
],
|
|
4579
|
+
], Ci = [
|
|
4502
4580
|
"data-test",
|
|
4503
4581
|
"data-message-id",
|
|
4504
4582
|
"data-message-sender",
|
|
@@ -4506,51 +4584,51 @@ var Cr = [
|
|
|
4506
4584
|
"data-message-sequence",
|
|
4507
4585
|
"data-system-kind",
|
|
4508
4586
|
"data-streaming"
|
|
4509
|
-
],
|
|
4587
|
+
], wi = ["src", "alt"], Ti = ["src"], Ei = ["href"], Di = {
|
|
4510
4588
|
key: 0,
|
|
4511
4589
|
"data-test": "messaging-message-text-part"
|
|
4512
|
-
},
|
|
4590
|
+
}, Oi = [
|
|
4513
4591
|
"src",
|
|
4514
4592
|
"alt",
|
|
4515
4593
|
"data-attachment-placement"
|
|
4516
|
-
],
|
|
4594
|
+
], ki = ["src", "data-attachment-placement"], Ai = ["href", "data-attachment-placement"], ji = ["data-journal-outcome"], Mi = {
|
|
4517
4595
|
key: 2,
|
|
4518
4596
|
"data-test": "messaging-tool-activity-tail",
|
|
4519
4597
|
"aria-label": "Assistant is still working",
|
|
4520
4598
|
class: "mb-4 grid h-[17px] w-5 place-items-center"
|
|
4521
|
-
},
|
|
4599
|
+
}, Ni = ["data-journal-outcome"], Pi = ["data-working-description"], Fi = { class: "truncate" }, Ii = ["data-issue-code"], Li = ["href"], Ri = {
|
|
4522
4600
|
key: 3,
|
|
4523
4601
|
"data-test": "messaging-thinking-indicator",
|
|
4524
4602
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
4525
|
-
},
|
|
4603
|
+
}, zi = ["src", "alt"], Bi = { class: "max-w-20 truncate" }, Vi = ["onClick"], Hi = {
|
|
4526
4604
|
key: 0,
|
|
4527
4605
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
4528
|
-
},
|
|
4606
|
+
}, Ui = ["data-composer-action"], Wi = ["placeholder", "disabled"], Gi = { class: "font-mono text-sm tabular-nums" }, Ki = { class: "mt-2.5 flex items-center" }, qi = [
|
|
4529
4607
|
"disabled",
|
|
4530
4608
|
"aria-label",
|
|
4531
4609
|
"title"
|
|
4532
|
-
],
|
|
4610
|
+
], Ji = {
|
|
4533
4611
|
key: 0,
|
|
4534
4612
|
class: "i-svg-spinners-ring-resize size-5"
|
|
4535
|
-
},
|
|
4613
|
+
}, Yi = {
|
|
4536
4614
|
key: 1,
|
|
4537
4615
|
class: "i-tabler-plus size-5"
|
|
4538
|
-
},
|
|
4616
|
+
}, Xi = { class: "sr-only" }, Zi = { class: "flex items-center gap-2" }, Qi = ["aria-label", "title"], $i = { class: "sr-only" }, ea = [
|
|
4539
4617
|
"data-composer-action",
|
|
4540
4618
|
"disabled",
|
|
4541
4619
|
"aria-label",
|
|
4542
4620
|
"title"
|
|
4543
|
-
],
|
|
4621
|
+
], ta = {
|
|
4544
4622
|
key: 0,
|
|
4545
4623
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
4546
|
-
},
|
|
4624
|
+
}, na = {
|
|
4547
4625
|
key: 1,
|
|
4548
4626
|
class: "i-tabler-arrow-up size-[17px]"
|
|
4549
|
-
},
|
|
4627
|
+
}, ra = { class: "sr-only" }, ia = {
|
|
4550
4628
|
key: 2,
|
|
4551
4629
|
"data-test": "messaging-suggested-prompts",
|
|
4552
4630
|
class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
|
|
4553
|
-
},
|
|
4631
|
+
}, aa = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, oa = ["disabled", "onClick"], sa = ["aria-expanded"], ca = /* @__PURE__ */ x({
|
|
4554
4632
|
__name: "ElAgentChat",
|
|
4555
4633
|
props: {
|
|
4556
4634
|
chatController: {},
|
|
@@ -4588,10 +4666,10 @@ var Cr = [
|
|
|
4588
4666
|
label: "Public",
|
|
4589
4667
|
tooltip: "Anyone with the link can see this"
|
|
4590
4668
|
}
|
|
4591
|
-
}, n =
|
|
4669
|
+
}, n = p(() => {
|
|
4592
4670
|
let n = { ...t[e.scope] };
|
|
4593
4671
|
return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
|
|
4594
|
-
}), r =
|
|
4672
|
+
}), r = k(!1), i = k(), a = k(), o = k();
|
|
4595
4673
|
function containsMarkdownLink(e) {
|
|
4596
4674
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
4597
4675
|
}
|
|
@@ -4602,23 +4680,23 @@ var Cr = [
|
|
|
4602
4680
|
let n = e[t], r = e[t + 1];
|
|
4603
4681
|
return !r || r.sender !== n.sender;
|
|
4604
4682
|
}
|
|
4605
|
-
let s =
|
|
4606
|
-
for (let e =
|
|
4607
|
-
let t =
|
|
4683
|
+
let s = p(() => e.chatController?.textState.value), c = p(() => s.value?.isConnected ?? !1), u = p(() => s.value?.isThinking ?? !1), x = p(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), C = p(() => s.value?.connectionStatus !== "connected" && !s.value?.error), re = k(!1), j = p(() => e.chatController?.liveTurnBlocks?.value ?? []), se = p(() => {
|
|
4684
|
+
for (let e = j.value.length - 1; e >= 0; e--) {
|
|
4685
|
+
let t = j.value[e];
|
|
4608
4686
|
if (t?.kind === "text") return t.id;
|
|
4609
4687
|
}
|
|
4610
|
-
}),
|
|
4688
|
+
}), ce = p(() => e.chatController?.liveStreamMessageId?.value), R = p(() => {
|
|
4611
4689
|
let t = e.chatController?.sharedMessages.value ?? [];
|
|
4612
|
-
return
|
|
4613
|
-
}),
|
|
4690
|
+
return j.value.length && ce.value ? t.filter((e) => e.id !== ce.value) : t;
|
|
4691
|
+
}), z = p(() => {
|
|
4614
4692
|
if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
|
|
4615
|
-
}),
|
|
4616
|
-
if (!
|
|
4617
|
-
let e =
|
|
4693
|
+
}), ve = p(() => e.chatController?.workJournal?.value), B = p(() => {
|
|
4694
|
+
if (!ve.value && !j.value.length) return;
|
|
4695
|
+
let e = R.value, t = e[e.length - 1];
|
|
4618
4696
|
if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
4619
|
-
}), ye =
|
|
4697
|
+
}), ye = p(() => {
|
|
4620
4698
|
let t = {};
|
|
4621
|
-
for (let n of
|
|
4699
|
+
for (let n of R.value) {
|
|
4622
4700
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
4623
4701
|
let r = e.chatController?.workJournalFor?.({
|
|
4624
4702
|
activities: n.toolActivities,
|
|
@@ -4678,42 +4756,45 @@ var Cr = [
|
|
|
4678
4756
|
text: t.slice(i)
|
|
4679
4757
|
}), r;
|
|
4680
4758
|
}
|
|
4681
|
-
let H =
|
|
4682
|
-
if (!
|
|
4683
|
-
let e =
|
|
4759
|
+
let H = p(() => s.value?.transientIssue), be = p(() => {
|
|
4760
|
+
if (!u.value) return;
|
|
4761
|
+
let e = R.value, t = e[e.length - 1];
|
|
4684
4762
|
return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
|
|
4685
|
-
}), U =
|
|
4763
|
+
}), U = p(() => !u.value || z.value || ve.value || j.value.length ? !1 : be.value === void 0), Se = p(() => s.value?.sendBlockedReason), W = p(() => Se.value === "agent_deleted"), Ce = p(() => x.value ? `${e.agent.displayName.value || e.agent.name.value || "Assistant"} is offline` : C.value ? "Connecting..." : Se.value === "agent_deleted" ? "This assistant was deleted" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = p(() => e.chatController?.composerState?.value ?? {
|
|
4686
4764
|
text: "",
|
|
4687
4765
|
pendingAttachments: [],
|
|
4688
4766
|
isUploading: !1
|
|
4689
|
-
}), Te =
|
|
4767
|
+
}), Te = p({
|
|
4690
4768
|
get: () => we.value.text,
|
|
4691
4769
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
4692
|
-
}), Ee =
|
|
4693
|
-
|
|
4770
|
+
}), Ee = p(() => we.value.pendingAttachments), De = p(() => we.value.isUploading), Oe = p(() => e.chatController?.voiceRecorder), ke = p(() => Oe.value?.isBusy.value ?? !1), G = p(() => e.chatController?.canAttachFile?.value ?? !1), Ae = p(() => e.chatController?.canRecordAudio?.value ?? !1), je = p(() => e.chatController?.composerAction?.value ?? "idle"), Me = p(() => je.value !== "idle"), Ne = p(() => je.value === "stop" ? "Stop reply" : "Send message"), Fe = p(() => Ae.value && !ke.value && !!Oe.value?.canUseBrowserRecording), Ie = p(() => Oe.value?.isActive.value ?? !1), Le = p(() => Oe.value?.elapsedLabel.value ?? "0:00"), Re = p(() => Oe.value?.statusText.value ?? "Release to send"), Be = p(() => Oe.value?.state.value.phase === "sending" ? "Sending voice message" : Ie.value ? "Release to send voice message" : "Hold to record voice message"), K = p(() => e.variant === "light"), Ve = p(() => K.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), He = p(() => K.value ? "text-theme-300" : "text-white/30");
|
|
4771
|
+
ie(async () => {
|
|
4694
4772
|
e.chatController && !c.value && await e.chatController.startTextConversation();
|
|
4695
|
-
}),
|
|
4773
|
+
}), ae(() => {
|
|
4696
4774
|
e.chatController?.voiceRecorder?.teardown();
|
|
4697
4775
|
});
|
|
4698
4776
|
async function sendMessage() {
|
|
4699
|
-
!e.chatController ||
|
|
4777
|
+
!e.chatController || je.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
|
|
4778
|
+
}
|
|
4779
|
+
async function handleCardAction(t) {
|
|
4780
|
+
!e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t));
|
|
4700
4781
|
}
|
|
4701
4782
|
async function sendSuggestedPrompt(t) {
|
|
4702
4783
|
!e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t.prompt));
|
|
4703
4784
|
}
|
|
4704
4785
|
async function handleComposerAction() {
|
|
4705
|
-
e.chatController && (
|
|
4786
|
+
e.chatController && (je.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
|
|
4706
4787
|
}
|
|
4707
4788
|
async function handleKeydown(e) {
|
|
4708
4789
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
|
|
4709
4790
|
}
|
|
4710
4791
|
function focusComposer(e) {
|
|
4711
|
-
|
|
4792
|
+
Ie.value || W.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
|
|
4712
4793
|
}
|
|
4713
4794
|
function adjustTextareaHeight() {
|
|
4714
4795
|
a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
|
|
4715
4796
|
}
|
|
4716
|
-
|
|
4797
|
+
de(Te, () => ne(() => adjustTextareaHeight()));
|
|
4717
4798
|
function triggerFileInput() {
|
|
4718
4799
|
o.value?.click();
|
|
4719
4800
|
}
|
|
@@ -4757,59 +4838,59 @@ var Cr = [
|
|
|
4757
4838
|
...o ? {} : { year: "numeric" }
|
|
4758
4839
|
})}, ${a}`;
|
|
4759
4840
|
}
|
|
4760
|
-
return (t, s) => (
|
|
4761
|
-
e.showHeader && !
|
|
4841
|
+
return (t, s) => (T(), _("div", { class: S(["@container/chat relative flex h-full flex-col", R.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""]) }, [
|
|
4842
|
+
e.showHeader && !K.value ? (T(), _("div", li, [b(Pe, {
|
|
4762
4843
|
agent: e.agent,
|
|
4763
4844
|
"is-online": c.value
|
|
4764
|
-
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (
|
|
4845
|
+
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (T(), _("div", ui, [v("div", { class: S(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
|
|
4765
4846
|
b(ze, {
|
|
4766
4847
|
agent: e.agent,
|
|
4767
|
-
"is-light":
|
|
4848
|
+
"is-light": K.value,
|
|
4768
4849
|
class: "size-10"
|
|
4769
4850
|
}, null, 8, ["agent", "is-light"]),
|
|
4770
|
-
|
|
4771
|
-
e.headerMeta ? (
|
|
4772
|
-
], 2)])) :
|
|
4773
|
-
|
|
4851
|
+
v("div", di, [v("div", fi, P(e.agent.displayName.value), 1), v("div", pi, P(e.agent.title.value || "Assistant"), 1)]),
|
|
4852
|
+
e.headerMeta ? (T(), _("span", mi, P(e.headerMeta), 1)) : h("", !0)
|
|
4853
|
+
], 2)])) : h("", !0),
|
|
4854
|
+
C.value ? (T(), _("div", {
|
|
4774
4855
|
key: 2,
|
|
4775
|
-
class:
|
|
4776
|
-
}, [b(
|
|
4856
|
+
class: S(["py-16 flex flex-col items-center justify-center gap-2 text-sm", K.value ? "text-theme-400" : "text-theme-600"])
|
|
4857
|
+
}, [b(_e, { class: "size-4" })], 2)) : e.setupHint ? (T(), _("div", {
|
|
4777
4858
|
key: 3,
|
|
4778
|
-
class:
|
|
4779
|
-
}, [s[20] || (s[20] =
|
|
4780
|
-
b(
|
|
4859
|
+
class: S(["flex items-center justify-center gap-1.5 py-2 text-[11px]", He.value])
|
|
4860
|
+
}, [s[20] || (s[20] = v("i", { class: "i-tabler-tool size-3" }, null, -1)), v("span", null, P(e.setupHint), 1)], 2)) : h("", !0),
|
|
4861
|
+
b(ci, {
|
|
4781
4862
|
ref_key: "chatScroller",
|
|
4782
4863
|
ref: i,
|
|
4783
|
-
class:
|
|
4864
|
+
class: S(R.value.length === 0 ? "flex-none" : "flex-1")
|
|
4784
4865
|
}, {
|
|
4785
|
-
default:
|
|
4786
|
-
|
|
4866
|
+
default: F(() => [v("div", { class: S([R.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-[120px] px-3 space-y-2" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? R.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
4867
|
+
R.value.length === 0 && !C.value ? (T(), _("div", hi, [oe(t.$slots, "empty-heading", {
|
|
4787
4868
|
agent: e.agent,
|
|
4788
|
-
isLight:
|
|
4869
|
+
isLight: K.value
|
|
4789
4870
|
}, () => [b(ze, {
|
|
4790
4871
|
agent: e.agent,
|
|
4791
|
-
"is-light":
|
|
4872
|
+
"is-light": K.value,
|
|
4792
4873
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
4793
|
-
}, null, 8, ["agent", "is-light"]),
|
|
4794
|
-
class:
|
|
4874
|
+
}, null, 8, ["agent", "is-light"]), v("div", { class: S(["text-base @sm/chat:text-lg font-semibold", K.value ? "text-theme-900" : "text-white"]) }, P(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? h("", !0) : (T(), _(f, { key: 0 }, [v("p", { class: S(["mt-1 text-center text-xs @sm/chat:text-sm", He.value]) }, P(e.emptyStateMessage || "Type your message to get started."), 3), v("div", {
|
|
4875
|
+
class: S(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", K.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
4795
4876
|
title: n.value.tooltip
|
|
4796
|
-
}, [
|
|
4797
|
-
(
|
|
4798
|
-
shouldShowTimeDivider(
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
])) :
|
|
4803
|
-
messageWorkJournal(e) ? (
|
|
4877
|
+
}, [v("i", { class: S([n.value.icon, "size-3"]) }, null, 2), v("span", null, P(n.value.label), 1)], 10, gi)], 64))])) : h("", !0),
|
|
4878
|
+
(T(!0), _(f, null, A(R.value, (e, t) => (T(), _(f, { key: e.id }, [
|
|
4879
|
+
shouldShowTimeDivider(R.value, t) ? (T(), _("div", _i, [
|
|
4880
|
+
v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2),
|
|
4881
|
+
v("span", { class: S(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", He.value]) }, P(shouldShowTimeDivider(R.value, t)), 3),
|
|
4882
|
+
v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2)
|
|
4883
|
+
])) : h("", !0),
|
|
4884
|
+
messageWorkJournal(e) ? (T(), _("div", {
|
|
4804
4885
|
key: 1,
|
|
4805
4886
|
"data-test": "messaging-message-tool-activity",
|
|
4806
4887
|
"data-journal-outcome": messageWorkJournal(e)?.outcome,
|
|
4807
4888
|
class: "mb-4 w-full"
|
|
4808
4889
|
}, [b(qe, {
|
|
4809
4890
|
model: messageWorkJournal(e),
|
|
4810
|
-
"is-light":
|
|
4811
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4812
|
-
isSystemExplainerMessage(e) ? (
|
|
4891
|
+
"is-light": K.value
|
|
4892
|
+
}, null, 8, ["model", "is-light"])], 8, vi)) : h("", !0),
|
|
4893
|
+
isSystemExplainerMessage(e) ? (T(), _("div", {
|
|
4813
4894
|
key: 2,
|
|
4814
4895
|
"data-test": "messaging-system-msg",
|
|
4815
4896
|
"data-message-id": e.id,
|
|
@@ -4823,27 +4904,28 @@ var Cr = [
|
|
|
4823
4904
|
"data-issue-action-url": e.issue?.actionUrl,
|
|
4824
4905
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4825
4906
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4826
|
-
}, [
|
|
4907
|
+
}, [v("div", bi, [v("div", { class: S(["mb-1 pl-1 text-[11px] font-medium", K.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), v("div", { class: S(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", K.value ? "bg-theme-25 border-theme-200 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (T(), m(ai, {
|
|
4827
4908
|
key: 0,
|
|
4828
4909
|
text: e.text,
|
|
4829
|
-
inverted: !
|
|
4910
|
+
inverted: !K.value,
|
|
4830
4911
|
streaming: e.id === be.value,
|
|
4831
|
-
onClick: s[0] || (s[0] =
|
|
4912
|
+
onClick: s[0] || (s[0] = I(() => {}, ["stop"])),
|
|
4913
|
+
onAction: handleCardAction
|
|
4832
4914
|
}, null, 8, [
|
|
4833
4915
|
"text",
|
|
4834
4916
|
"inverted",
|
|
4835
4917
|
"streaming"
|
|
4836
|
-
])) : e.issue?.help ? (
|
|
4918
|
+
])) : e.issue?.help ? (T(), m(ai, {
|
|
4837
4919
|
key: 1,
|
|
4838
4920
|
text: e.issue.help,
|
|
4839
|
-
inverted: !
|
|
4840
|
-
}, null, 8, ["text", "inverted"])) :
|
|
4921
|
+
inverted: !K.value
|
|
4922
|
+
}, null, 8, ["text", "inverted"])) : h("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (T(), _("a", {
|
|
4841
4923
|
key: 2,
|
|
4842
4924
|
href: e.issue.actionUrl,
|
|
4843
4925
|
"data-test": "messaging-system-msg-action",
|
|
4844
|
-
class:
|
|
4845
|
-
onClick: s[1] || (s[1] =
|
|
4846
|
-
}, [
|
|
4926
|
+
class: S(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", K.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
4927
|
+
onClick: s[1] || (s[1] = I(() => {}, ["stop"]))
|
|
4928
|
+
}, [te(P(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, xi)) : h("", !0)], 2)])], 8, yi)) : e.sender === "system" ? (T(), _("div", {
|
|
4847
4929
|
key: 3,
|
|
4848
4930
|
"data-test": "messaging-system-status-msg",
|
|
4849
4931
|
"data-message-id": e.id,
|
|
@@ -4854,12 +4936,12 @@ var Cr = [
|
|
|
4854
4936
|
"data-issue-code": e.issue?.code,
|
|
4855
4937
|
"data-issue-bucket": e.issue?.bucket,
|
|
4856
4938
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4857
|
-
class:
|
|
4858
|
-
}, [s[22] || (s[22] =
|
|
4939
|
+
class: S(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", K.value ? "text-theme-500" : "text-white/60"])
|
|
4940
|
+
}, [s[22] || (s[22] = v("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b(ai, {
|
|
4859
4941
|
text: e.text,
|
|
4860
|
-
inverted: !
|
|
4861
|
-
onClick: s[2] || (s[2] =
|
|
4862
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
4942
|
+
inverted: !K.value,
|
|
4943
|
+
onClick: s[2] || (s[2] = I(() => {}, ["stop"]))
|
|
4944
|
+
}, null, 8, ["text", "inverted"])], 10, Si)) : (T(), _("div", {
|
|
4863
4945
|
key: 4,
|
|
4864
4946
|
"data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
|
|
4865
4947
|
"data-message-id": e.id,
|
|
@@ -4868,160 +4950,162 @@ var Cr = [
|
|
|
4868
4950
|
"data-message-sequence": e.sequence,
|
|
4869
4951
|
"data-system-kind": e.systemKind,
|
|
4870
4952
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4871
|
-
class:
|
|
4953
|
+
class: S(["flex gap-2 items-end", {
|
|
4872
4954
|
"justify-end": e.sender === "user",
|
|
4873
4955
|
"justify-start": e.sender === "agent",
|
|
4874
|
-
"mb-6": isGroupEnd(
|
|
4956
|
+
"mb-6": isGroupEnd(R.value, t)
|
|
4875
4957
|
}])
|
|
4876
|
-
}, [
|
|
4958
|
+
}, [v("div", {
|
|
4877
4959
|
"data-test": "messaging-message-body",
|
|
4878
|
-
class:
|
|
4879
|
-
}, [blockAttachmentsForMessage(e).length ? (
|
|
4960
|
+
class: S(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0 @sm/chat:pr-[1em] @lg/chat:pr-[2em]")
|
|
4961
|
+
}, [blockAttachmentsForMessage(e).length ? (T(), _("div", {
|
|
4880
4962
|
key: 0,
|
|
4881
|
-
class:
|
|
4882
|
-
}, [(
|
|
4963
|
+
class: S(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
|
|
4964
|
+
}, [(T(!0), _(f, null, A(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (T(), _(f, { key: attachmentKey(e, t) }, [e.type === "image" ? (T(), _("img", {
|
|
4883
4965
|
key: 0,
|
|
4884
4966
|
src: e.src,
|
|
4885
4967
|
alt: e.filename,
|
|
4886
4968
|
"data-test": "messaging-attachment",
|
|
4887
4969
|
"data-attachment-placement": "block",
|
|
4888
4970
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4889
|
-
}, null, 8,
|
|
4971
|
+
}, null, 8, wi)) : e.type === "audio" ? (T(), _("audio", {
|
|
4890
4972
|
key: 1,
|
|
4891
4973
|
src: e.src,
|
|
4892
4974
|
controls: "",
|
|
4893
4975
|
"data-test": "messaging-attachment",
|
|
4894
4976
|
"data-attachment-placement": "block",
|
|
4895
4977
|
class: "max-w-full"
|
|
4896
|
-
}, null, 8,
|
|
4978
|
+
}, null, 8, Ti)) : (T(), _("a", {
|
|
4897
4979
|
key: 2,
|
|
4898
4980
|
href: e.src,
|
|
4899
4981
|
target: "_blank",
|
|
4900
4982
|
rel: "noopener",
|
|
4901
4983
|
"data-test": "messaging-attachment",
|
|
4902
4984
|
"data-attachment-placement": "block",
|
|
4903
|
-
class:
|
|
4904
|
-
}, [s[23] || (s[23] =
|
|
4985
|
+
class: S(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4986
|
+
}, [s[23] || (s[23] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(e.filename), 1)], 10, Ei))], 64))), 128))], 2)) : h("", !0), messageRenderParts(e).length ? (T(), _("div", {
|
|
4905
4987
|
key: 1,
|
|
4906
4988
|
"data-test": "messaging-message-content",
|
|
4907
|
-
class:
|
|
4908
|
-
}, [(
|
|
4989
|
+
class: S(e.sender === "user" ? K.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : K.value ? "text-theme-800" : "text-white/95")
|
|
4990
|
+
}, [(T(!0), _(f, null, A(messageRenderParts(e), (t) => (T(), _(f, { key: t.key }, [t.kind === "text" && t.text ? (T(), _("div", Di, [b(ai, {
|
|
4909
4991
|
text: t.text,
|
|
4910
|
-
inverted: e.sender === "user" || !
|
|
4992
|
+
inverted: e.sender === "user" || !K.value,
|
|
4911
4993
|
streaming: e.id === be.value,
|
|
4912
|
-
onClick: s[3] || (s[3] =
|
|
4994
|
+
onClick: s[3] || (s[3] = I(() => {}, ["stop"])),
|
|
4995
|
+
onAction: handleCardAction
|
|
4913
4996
|
}, null, 8, [
|
|
4914
4997
|
"text",
|
|
4915
4998
|
"inverted",
|
|
4916
4999
|
"streaming"
|
|
4917
|
-
])])) : t.kind === "attachment" && t.attachment.type === "image" ? (
|
|
5000
|
+
])])) : t.kind === "attachment" && t.attachment.type === "image" ? (T(), _("img", {
|
|
4918
5001
|
key: 1,
|
|
4919
5002
|
src: t.attachment.src,
|
|
4920
5003
|
alt: t.attachment.filename,
|
|
4921
5004
|
"data-test": "messaging-attachment",
|
|
4922
5005
|
"data-attachment-placement": t.placement,
|
|
4923
5006
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4924
|
-
}, null, 8,
|
|
5007
|
+
}, null, 8, Oi)) : t.kind === "attachment" && t.attachment.type === "audio" ? (T(), _("audio", {
|
|
4925
5008
|
key: 2,
|
|
4926
5009
|
src: t.attachment.src,
|
|
4927
5010
|
controls: "",
|
|
4928
5011
|
"data-test": "messaging-attachment",
|
|
4929
5012
|
"data-attachment-placement": t.placement,
|
|
4930
5013
|
class: "my-2 max-w-full"
|
|
4931
|
-
}, null, 8,
|
|
5014
|
+
}, null, 8, ki)) : t.kind === "attachment" ? (T(), _("a", {
|
|
4932
5015
|
key: 3,
|
|
4933
5016
|
href: t.attachment.src,
|
|
4934
5017
|
target: "_blank",
|
|
4935
5018
|
rel: "noopener",
|
|
4936
5019
|
"data-test": "messaging-attachment",
|
|
4937
5020
|
"data-attachment-placement": t.placement,
|
|
4938
|
-
class:
|
|
4939
|
-
}, [s[24] || (s[24] =
|
|
4940
|
-
e.id ===
|
|
5021
|
+
class: S(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", K.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5022
|
+
}, [s[24] || (s[24] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(t.attachment.filename), 1)], 10, Ai)) : h("", !0)], 64))), 128))], 2)) : h("", !0)], 2)], 10, Ci)),
|
|
5023
|
+
e.id === B.value ? (T(), _(f, { key: 5 }, [j.value.length ? (T(!0), _(f, { key: 0 }, A(j.value, (e) => (T(), _(f, { key: e.id }, [e.kind === "work" ? (T(), _("div", {
|
|
4941
5024
|
key: 0,
|
|
4942
5025
|
"data-test": "messaging-tool-activity",
|
|
4943
5026
|
"data-journal-outcome": e.journal.outcome,
|
|
4944
5027
|
class: "mb-4 w-full"
|
|
4945
5028
|
}, [b(qe, {
|
|
4946
5029
|
model: e.journal,
|
|
4947
|
-
"is-light":
|
|
4948
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5030
|
+
"is-light": K.value
|
|
5031
|
+
}, null, 8, ["model", "is-light"])], 8, ji)) : e.kind === "text" && e.content ? (T(), _("div", {
|
|
4949
5032
|
key: 1,
|
|
4950
5033
|
"data-test": "messaging-live-text-block",
|
|
4951
|
-
class:
|
|
4952
|
-
}, [b(
|
|
5034
|
+
class: S(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", K.value ? "text-theme-800" : "text-white/95"])
|
|
5035
|
+
}, [b(ai, {
|
|
4953
5036
|
text: e.content,
|
|
4954
|
-
inverted: !
|
|
4955
|
-
streaming: e.id ===
|
|
4956
|
-
onClick: s[4] || (s[4] =
|
|
5037
|
+
inverted: !K.value,
|
|
5038
|
+
streaming: e.id === se.value,
|
|
5039
|
+
onClick: s[4] || (s[4] = I(() => {}, ["stop"])),
|
|
5040
|
+
onAction: handleCardAction
|
|
4957
5041
|
}, null, 8, [
|
|
4958
5042
|
"text",
|
|
4959
5043
|
"inverted",
|
|
4960
5044
|
"streaming"
|
|
4961
|
-
])], 2)) : (
|
|
5045
|
+
])], 2)) : (T(), _("div", Mi, [b(_e, { class: S(["size-3.5", K.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : ve.value ? (T(), _("div", {
|
|
4962
5046
|
key: 1,
|
|
4963
5047
|
"data-test": "messaging-tool-activity",
|
|
4964
|
-
"data-journal-outcome":
|
|
5048
|
+
"data-journal-outcome": ve.value.outcome,
|
|
4965
5049
|
class: "mb-4 w-full"
|
|
4966
5050
|
}, [b(qe, {
|
|
4967
|
-
model:
|
|
4968
|
-
"is-light":
|
|
4969
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5051
|
+
model: ve.value,
|
|
5052
|
+
"is-light": K.value
|
|
5053
|
+
}, null, 8, ["model", "is-light"])], 8, Ni)) : h("", !0)], 64)) : h("", !0)
|
|
4970
5054
|
], 64))), 128)),
|
|
4971
|
-
|
|
5055
|
+
z.value ? (T(), _("div", {
|
|
4972
5056
|
key: 1,
|
|
4973
5057
|
"data-test": "messaging-working-state",
|
|
4974
|
-
"data-working-description":
|
|
4975
|
-
class:
|
|
4976
|
-
}, [s[25] || (s[25] =
|
|
5058
|
+
"data-working-description": z.value,
|
|
5059
|
+
class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", K.value ? "text-theme-500" : "text-white/45"])
|
|
5060
|
+
}, [s[25] || (s[25] = v("i", {
|
|
4977
5061
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4978
5062
|
"aria-hidden": "true"
|
|
4979
|
-
}, null, -1)),
|
|
4980
|
-
H.value ? (
|
|
5063
|
+
}, null, -1)), v("span", Fi, P(z.value), 1)], 10, Pi)) : h("", !0),
|
|
5064
|
+
H.value ? (T(), _("div", {
|
|
4981
5065
|
key: 2,
|
|
4982
5066
|
"data-test": "messaging-transient-issue",
|
|
4983
5067
|
"data-issue-code": H.value.code,
|
|
4984
|
-
class:
|
|
5068
|
+
class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", K.value ? "text-theme-600" : "text-white/60"])
|
|
4985
5069
|
}, [
|
|
4986
|
-
s[26] || (s[26] =
|
|
5070
|
+
s[26] || (s[26] = v("i", {
|
|
4987
5071
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
4988
5072
|
"aria-hidden": "true"
|
|
4989
5073
|
}, null, -1)),
|
|
4990
|
-
|
|
4991
|
-
H.value.actionUrl && H.value.actionLabel ? (
|
|
5074
|
+
v("span", null, [te(P(H.value.message), 1), H.value.help ? (T(), _(f, { key: 0 }, [te(P(H.value.help), 1)], 64)) : h("", !0)]),
|
|
5075
|
+
H.value.actionUrl && H.value.actionLabel ? (T(), _("a", {
|
|
4992
5076
|
key: 0,
|
|
4993
5077
|
href: H.value.actionUrl,
|
|
4994
5078
|
class: "shrink-0 underline underline-offset-2",
|
|
4995
|
-
onClick: s[5] || (s[5] =
|
|
4996
|
-
},
|
|
4997
|
-
], 10,
|
|
4998
|
-
U.value ? (
|
|
4999
|
-
class:
|
|
5079
|
+
onClick: s[5] || (s[5] = I(() => {}, ["stop"]))
|
|
5080
|
+
}, P(H.value.actionLabel), 9, Li)) : h("", !0)
|
|
5081
|
+
], 10, Ii)) : h("", !0),
|
|
5082
|
+
U.value ? (T(), _("div", Ri, [v("i", {
|
|
5083
|
+
class: S(["i-svg-spinners-3-dots-bounce size-7", K.value ? "text-theme-400" : "text-white/50"]),
|
|
5000
5084
|
"aria-hidden": "true"
|
|
5001
|
-
}, null, 2)])) :
|
|
5085
|
+
}, null, 2)])) : h("", !0)
|
|
5002
5086
|
], 2)]),
|
|
5003
5087
|
_: 3
|
|
5004
5088
|
}, 8, ["class"]),
|
|
5005
|
-
|
|
5006
|
-
Ee.value.length > 0 ? (
|
|
5089
|
+
v("div", { class: S(["left-0 right-0 z-30 px-5 pb-4 pt-3", [R.value.length === 0 ? "relative shrink-0" : "absolute bottom-0", K.value ? "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"]]) }, [
|
|
5090
|
+
Ee.value.length > 0 ? (T(), _("div", {
|
|
5007
5091
|
key: 0,
|
|
5008
|
-
class:
|
|
5009
|
-
}, [(
|
|
5092
|
+
class: S(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
|
|
5093
|
+
}, [(T(!0), _(f, null, A(Ee.value, (e, t) => (T(), _("div", {
|
|
5010
5094
|
key: t,
|
|
5011
5095
|
class: "relative shrink-0 group"
|
|
5012
|
-
}, [e.type === "image" ? (
|
|
5096
|
+
}, [e.type === "image" ? (T(), _("img", {
|
|
5013
5097
|
key: 0,
|
|
5014
5098
|
src: e.src,
|
|
5015
5099
|
alt: e.filename,
|
|
5016
|
-
class:
|
|
5017
|
-
}, null, 10,
|
|
5100
|
+
class: S(["size-14 rounded-xl object-cover border", K.value ? "border-black/10" : "border-white/20"])
|
|
5101
|
+
}, null, 10, zi)) : (T(), _("div", {
|
|
5018
5102
|
key: 1,
|
|
5019
|
-
class:
|
|
5020
|
-
}, [s[27] || (s[27] =
|
|
5103
|
+
class: S(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", K.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
5104
|
+
}, [s[27] || (s[27] = v("i", { class: "i-tabler-file size-4" }, null, -1)), v("span", Bi, P(e.filename), 1)], 2)), v("button", {
|
|
5021
5105
|
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 cursor-pointer",
|
|
5022
5106
|
onClick: (e) => removeAttachment(t)
|
|
5023
|
-
}, [...s[28] || (s[28] = [
|
|
5024
|
-
|
|
5107
|
+
}, [...s[28] || (s[28] = [v("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Vi)]))), 128)), De.value ? (T(), _("div", Hi, [b(_e, { class: "size-5" })])) : h("", !0)], 2)) : h("", !0),
|
|
5108
|
+
G.value ? (T(), _("input", {
|
|
5025
5109
|
key: 1,
|
|
5026
5110
|
ref_key: "fileInput",
|
|
5027
5111
|
ref: o,
|
|
@@ -5029,21 +5113,21 @@ var Cr = [
|
|
|
5029
5113
|
accept: "image/*,audio/*,video/*",
|
|
5030
5114
|
class: "hidden",
|
|
5031
5115
|
onChange: handleFileSelect
|
|
5032
|
-
}, null, 544)) :
|
|
5033
|
-
|
|
5116
|
+
}, null, 544)) : h("", !0),
|
|
5117
|
+
v("div", {
|
|
5034
5118
|
"data-test": "messaging-composer",
|
|
5035
|
-
"data-composer-action":
|
|
5036
|
-
class:
|
|
5119
|
+
"data-composer-action": je.value,
|
|
5120
|
+
class: S(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", K.value ? r.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-300" : "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 backdrop-blur-xl ring-1 ring-white/25" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25"]]),
|
|
5037
5121
|
onClick: focusComposer
|
|
5038
|
-
}, [
|
|
5122
|
+
}, [Ie.value ? (T(), _("div", {
|
|
5039
5123
|
key: 1,
|
|
5040
5124
|
"data-test": "messaging-recording-state",
|
|
5041
|
-
class:
|
|
5125
|
+
class: S(["flex min-w-0 items-center gap-2 py-1", K.value ? "text-theme-700" : "text-white/80"])
|
|
5042
5126
|
}, [
|
|
5043
|
-
s[29] || (s[29] =
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
], 2)) :
|
|
5127
|
+
s[29] || (s[29] = v("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5128
|
+
v("span", Gi, P(Le.value), 1),
|
|
5129
|
+
v("span", { class: S(["min-w-0 truncate text-sm", K.value ? "text-theme-400" : "text-white/45"]) }, P(Re.value), 3)
|
|
5130
|
+
], 2)) : pe((T(), _("textarea", {
|
|
5047
5131
|
key: 0,
|
|
5048
5132
|
ref_key: "textarea",
|
|
5049
5133
|
ref: a,
|
|
@@ -5057,77 +5141,77 @@ var Cr = [
|
|
|
5057
5141
|
fontSize: "16px",
|
|
5058
5142
|
resize: "none"
|
|
5059
5143
|
},
|
|
5060
|
-
class:
|
|
5144
|
+
class: S(["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", K.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
5061
5145
|
onKeydown: handleKeydown,
|
|
5062
5146
|
onFocus: s[7] || (s[7] = (e) => r.value = !0),
|
|
5063
5147
|
onBlur: s[8] || (s[8] = (e) => r.value = !1)
|
|
5064
|
-
}, null, 42,
|
|
5065
|
-
|
|
5066
|
-
class:
|
|
5067
|
-
|
|
5068
|
-
|
|
5148
|
+
}, null, 42, Wi)), [[ue, Te.value]]), v("div", Ki, [
|
|
5149
|
+
v("button", {
|
|
5150
|
+
class: S(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
|
|
5151
|
+
G.value ? "cursor-pointer" : "cursor-default",
|
|
5152
|
+
K.value ? "text-theme-500" : "text-white/50",
|
|
5069
5153
|
De.value || ke.value ? "opacity-50 pointer-events-none" : ""
|
|
5070
5154
|
]]),
|
|
5071
|
-
disabled: W.value || De.value || ke.value || !
|
|
5072
|
-
"aria-label":
|
|
5073
|
-
title:
|
|
5074
|
-
onClick: s[9] || (s[9] = (e) =>
|
|
5075
|
-
}, [De.value ? (
|
|
5076
|
-
s[30] || (s[30] =
|
|
5077
|
-
|
|
5155
|
+
disabled: W.value || De.value || ke.value || !G.value,
|
|
5156
|
+
"aria-label": G.value ? "Attach file" : "File attachments unavailable",
|
|
5157
|
+
title: G.value ? "Attach file" : "File attachments unavailable",
|
|
5158
|
+
onClick: s[9] || (s[9] = (e) => G.value && triggerFileInput())
|
|
5159
|
+
}, [De.value ? (T(), _("i", Ji)) : (T(), _("i", Yi)), v("span", Xi, P(G.value ? "Attach file" : "File attachments unavailable"), 1)], 10, qi),
|
|
5160
|
+
s[30] || (s[30] = v("div", { class: "flex-1" }, null, -1)),
|
|
5161
|
+
v("div", Zi, [Fe.value || Ie.value ? (T(), _("button", {
|
|
5078
5162
|
key: 0,
|
|
5079
5163
|
"data-test": "messaging-record-audio-btn",
|
|
5080
|
-
class:
|
|
5081
|
-
"aria-label":
|
|
5082
|
-
title:
|
|
5083
|
-
onPointerdown: s[10] || (s[10] =
|
|
5084
|
-
onPointerup: s[11] || (s[11] =
|
|
5085
|
-
onPointercancel: s[12] || (s[12] =
|
|
5164
|
+
class: S(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Ie.value ? K.value ? "text-theme-900 scale-110" : "text-white scale-110" : K.value ? "text-theme-500" : "text-white/60"]),
|
|
5165
|
+
"aria-label": Be.value,
|
|
5166
|
+
title: Be.value,
|
|
5167
|
+
onPointerdown: s[10] || (s[10] = I((e) => startRecording(), ["prevent"])),
|
|
5168
|
+
onPointerup: s[11] || (s[11] = I((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
|
|
5169
|
+
onPointercancel: s[12] || (s[12] = I((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
|
|
5086
5170
|
onKeydown: [
|
|
5087
|
-
s[13] || (s[13] =
|
|
5088
|
-
s[15] || (s[15] =
|
|
5089
|
-
s[17] || (s[17] =
|
|
5171
|
+
s[13] || (s[13] = he(I((e) => startRecording(), ["prevent"]), ["enter"])),
|
|
5172
|
+
s[15] || (s[15] = he(I((e) => startRecording(), ["prevent"]), ["space"])),
|
|
5173
|
+
s[17] || (s[17] = he(I((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5090
5174
|
],
|
|
5091
|
-
onKeyup: [s[14] || (s[14] =
|
|
5092
|
-
}, [
|
|
5175
|
+
onKeyup: [s[14] || (s[14] = he(I((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[16] || (s[16] = he(I((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
|
|
5176
|
+
}, [v("i", { class: S([Ie.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), v("span", $i, P(Be.value), 1)], 42, Qi)) : h("", !0), Ie.value ? h("", !0) : (T(), _("button", {
|
|
5093
5177
|
key: 1,
|
|
5094
5178
|
"data-test": "messaging-send-btn",
|
|
5095
|
-
"data-composer-action":
|
|
5096
|
-
class:
|
|
5097
|
-
disabled: !
|
|
5098
|
-
"aria-label":
|
|
5099
|
-
title:
|
|
5179
|
+
"data-composer-action": je.value,
|
|
5180
|
+
class: S(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Me.value ? K.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" : K.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
5181
|
+
disabled: !Me.value,
|
|
5182
|
+
"aria-label": Ne.value,
|
|
5183
|
+
title: Ne.value,
|
|
5100
5184
|
onClick: s[18] || (s[18] = (e) => handleComposerAction())
|
|
5101
|
-
}, [
|
|
5102
|
-
])], 10,
|
|
5103
|
-
|
|
5185
|
+
}, [je.value === "stop" ? (T(), _("i", ta)) : (T(), _("i", na)), v("span", ra, P(Ne.value), 1)], 10, ea))])
|
|
5186
|
+
])], 10, Ui),
|
|
5187
|
+
R.value.length === 0 && e.suggestedPrompts.length > 0 ? (T(), _("div", ia, [v("div", aa, [(T(!0), _(f, null, A(e.suggestedPrompts, (e, t) => (T(), _("button", {
|
|
5104
5188
|
key: e.id,
|
|
5105
5189
|
type: "button",
|
|
5106
5190
|
disabled: W.value,
|
|
5107
5191
|
"data-test": "messaging-suggested-prompt",
|
|
5108
|
-
class:
|
|
5192
|
+
class: S(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", [W.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900", !re.value && t >= 3 ? "max-sm:hidden" : ""]]),
|
|
5109
5193
|
onClick: (t) => sendSuggestedPrompt(e)
|
|
5110
|
-
},
|
|
5194
|
+
}, P(e.label), 11, oa))), 128)), e.suggestedPrompts.length > 3 ? (T(), _("button", {
|
|
5111
5195
|
key: 0,
|
|
5112
5196
|
type: "button",
|
|
5113
5197
|
"data-test": "messaging-suggested-prompts-more",
|
|
5114
|
-
"aria-expanded":
|
|
5198
|
+
"aria-expanded": re.value,
|
|
5115
5199
|
class: "flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-2xl px-4 py-3 text-[14px] font-medium text-theme-600 ring-1 ring-theme-200 transition-colors hover:bg-theme-50 hover:text-theme-900 sm:hidden",
|
|
5116
|
-
onClick: s[19] || (s[19] = (e) =>
|
|
5117
|
-
}, [
|
|
5200
|
+
onClick: s[19] || (s[19] = (e) => re.value = !re.value)
|
|
5201
|
+
}, [te(P(re.value ? "See less" : "See more") + " ", 1), v("i", { class: S(["i-tabler-chevron-down size-4 transition-transform", re.value ? "rotate-180" : ""]) }, null, 2)], 8, sa)) : h("", !0)])])) : h("", !0)
|
|
5118
5202
|
], 2)
|
|
5119
5203
|
], 2));
|
|
5120
5204
|
}
|
|
5121
|
-
}),
|
|
5205
|
+
}), la = { class: "agent-wrap" }, ua = {
|
|
5122
5206
|
key: 0,
|
|
5123
5207
|
class: "flex items-center justify-center h-full"
|
|
5124
|
-
},
|
|
5208
|
+
}, da = {
|
|
5125
5209
|
key: 2,
|
|
5126
5210
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5127
5211
|
role: "status",
|
|
5128
5212
|
"aria-live": "polite",
|
|
5129
5213
|
"data-test": "agent-unavailable"
|
|
5130
|
-
},
|
|
5214
|
+
}, fa = /* @__PURE__ */ x({
|
|
5131
5215
|
__name: "AgentWrap",
|
|
5132
5216
|
props: {
|
|
5133
5217
|
sdk: {},
|
|
@@ -5147,7 +5231,7 @@ var Cr = [
|
|
|
5147
5231
|
let r = a("AgentWrap"), i = e, o = i.sdk || t.getInstance({
|
|
5148
5232
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
5149
5233
|
...i.apiBase && { apiBase: i.apiBase }
|
|
5150
|
-
}), s =
|
|
5234
|
+
}), s = se(!i.agent), c = se(i.agent ? new n({ config: i.agent }) : void 0), u = se();
|
|
5151
5235
|
async function loadAgent() {
|
|
5152
5236
|
if (i.agent) {
|
|
5153
5237
|
r.debug("Agent provided via props, skipping fetch", {
|
|
@@ -5223,23 +5307,23 @@ var Cr = [
|
|
|
5223
5307
|
});
|
|
5224
5308
|
}
|
|
5225
5309
|
}
|
|
5226
|
-
return
|
|
5227
|
-
sdk:
|
|
5310
|
+
return ie(loadAgent), (t, n) => (T(), _("div", la, [s.value ? (T(), _("div", ua, [v("div", { class: S(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? oe(t.$slots, "default", {
|
|
5311
|
+
sdk: ce(o),
|
|
5228
5312
|
agent: c.value,
|
|
5229
5313
|
context: e.clientContext ?? e.context,
|
|
5230
5314
|
firstMessage: e.firstMessage,
|
|
5231
5315
|
buttonText: e.buttonText,
|
|
5232
5316
|
buttonIcon: e.buttonIcon,
|
|
5233
5317
|
loading: s.value
|
|
5234
|
-
}, void 0, void 0, 1) : u.value ? (
|
|
5318
|
+
}, void 0, void 0, 1) : u.value ? (T(), _("div", da, [n[0] || (n[0] = v("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), v("button", {
|
|
5235
5319
|
type: "button",
|
|
5236
5320
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5237
5321
|
"data-test": "agent-unavailable-retry",
|
|
5238
5322
|
onClick: loadAgent
|
|
5239
|
-
}, " Try again ")])) :
|
|
5323
|
+
}, " Try again ")])) : h("", !0)]));
|
|
5240
5324
|
}
|
|
5241
5325
|
});
|
|
5242
5326
|
//#endregion
|
|
5243
|
-
export {
|
|
5327
|
+
export { ke as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, ca as n, De as o, n as p, ai as r, Te as s, fa as t, parseButtonTemplate as u };
|
|
5244
5328
|
|
|
5245
5329
|
//# sourceMappingURL=AgentWrap.js.map
|