@pagelines/sdk 1.0.709 → 1.0.711
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 +876 -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,83 @@ ${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 = ["onClick"], _r = /* @__PURE__ */ x({
|
|
3476
|
+
__name: "ChatCardBlock",
|
|
3477
|
+
props: {
|
|
3478
|
+
spec: {},
|
|
3479
|
+
inverted: { type: Boolean }
|
|
3480
|
+
},
|
|
3481
|
+
emits: ["action"],
|
|
3482
|
+
setup(e, { emit: t }) {
|
|
3483
|
+
let n = e, r = t, i = p(() => {
|
|
3484
|
+
if (!n.spec.body) return "";
|
|
3485
|
+
let e = g.parse(n.spec.body, { async: !1 });
|
|
3486
|
+
return Qt.sanitize(e, { ADD_ATTR: ["target"] });
|
|
3487
|
+
}), a = p(() => n.inverted ? "rgba(255, 255, 255, 0.16)" : "rgba(0, 0, 0, 0.1)"), o = p(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = p(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = p(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), u = p(() => n.inverted ? `inset 0 0 0 1px ${a.value}` : `inset 0 0 0 1px ${a.value}, 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05)`);
|
|
3488
|
+
function actionStyle(e) {
|
|
3489
|
+
return e === "primary" ? {
|
|
3490
|
+
background: n.inverted ? "rgba(255, 255, 255, 0.92)" : "var(--color-theme-900)",
|
|
3491
|
+
color: n.inverted ? "var(--color-theme-900)" : "#fff"
|
|
3492
|
+
} : e === "destructive" ? {
|
|
3493
|
+
background: "transparent",
|
|
3494
|
+
color: "#D93025"
|
|
3495
|
+
} : {
|
|
3496
|
+
background: "transparent",
|
|
3497
|
+
color: s.value
|
|
3498
|
+
};
|
|
3499
|
+
}
|
|
3500
|
+
return (t, n) => (T(), _("div", {
|
|
3501
|
+
"data-test": "chat-card",
|
|
3502
|
+
class: "my-6 w-full max-w-[55ch] self-start overflow-hidden rounded-[20px]",
|
|
3503
|
+
style: C({ boxShadow: u.value }),
|
|
3504
|
+
"aria-label": e.spec.title
|
|
3505
|
+
}, [
|
|
3506
|
+
v("div", {
|
|
3507
|
+
class: "px-4 pb-3 pt-3.5",
|
|
3508
|
+
style: C(i.value ? { borderBottom: `1px solid ${o.value}` } : void 0)
|
|
3509
|
+
}, [v("div", {
|
|
3510
|
+
class: "text-[14px] font-semibold leading-tight",
|
|
3511
|
+
style: C({ color: s.value })
|
|
3512
|
+
}, P(e.spec.title), 5)], 4),
|
|
3513
|
+
i.value ? (T(), _("div", {
|
|
3514
|
+
key: 0,
|
|
3515
|
+
class: "chat-msg-prose px-4 py-3.5 text-[14px] leading-relaxed",
|
|
3516
|
+
style: C({ color: c.value }),
|
|
3517
|
+
innerHTML: i.value
|
|
3518
|
+
}, null, 12, hr)) : h("", !0),
|
|
3519
|
+
e.spec.actions?.length ? (T(), _("div", {
|
|
3520
|
+
key: 1,
|
|
3521
|
+
class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
|
|
3522
|
+
style: C({ borderTop: `1px solid ${o.value}` })
|
|
3523
|
+
}, [(T(!0), _(f, null, A(e.spec.actions, (e) => (T(), _("button", {
|
|
3524
|
+
key: e.label,
|
|
3525
|
+
type: "button",
|
|
3526
|
+
"data-test": "chat-card-action",
|
|
3527
|
+
class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
|
|
3528
|
+
style: C(actionStyle(e.style)),
|
|
3529
|
+
onClick: (t) => r("action", e.reply)
|
|
3530
|
+
}, P(e.label), 13, gr))), 128))], 4)) : h("", !0)
|
|
3531
|
+
], 12, mr));
|
|
3532
|
+
}
|
|
3533
|
+
}), vr = 112, yr = 52, br = 14, xr = 54, Sr = 34, Cr = 260;
|
|
3476
3534
|
function nodeWidthFor(e) {
|
|
3477
3535
|
let { orientation: t, maxRows: n, maxWidth: r } = e;
|
|
3478
|
-
if (t === "horizontal" || !r) return
|
|
3479
|
-
let i = r -
|
|
3480
|
-
return Math.min(
|
|
3536
|
+
if (t === "horizontal" || !r) return vr;
|
|
3537
|
+
let i = r - br * 2 - (n - 1) * xr;
|
|
3538
|
+
return Math.min(Cr, Math.max(vr, Math.floor(i / n)));
|
|
3481
3539
|
}
|
|
3482
3540
|
function orientationFor(e) {
|
|
3483
3541
|
return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
@@ -3514,11 +3572,11 @@ function buildLayout(e, t, n) {
|
|
|
3514
3572
|
orientation: t,
|
|
3515
3573
|
maxRows: o,
|
|
3516
3574
|
...n === void 0 ? {} : { maxWidth: n }
|
|
3517
|
-
}), u = t === "horizontal" ?
|
|
3575
|
+
}), u = t === "horizontal" ? br * 2 + s * c + (s - 1) * xr : br * 2 + o * c + (o - 1) * xr, f = t === "horizontal" ? br * 2 + o * yr + (o - 1) * Sr : br * 2 + s * yr + (s - 1) * Sr, p = [];
|
|
3518
3576
|
for (let [e, [, n]] of a.entries()) {
|
|
3519
|
-
let r = (o - n.length) * (t === "horizontal" ? 86 : c +
|
|
3577
|
+
let r = (o - n.length) * (t === "horizontal" ? 86 : c + xr) / 2;
|
|
3520
3578
|
for (let [i, a] of n.entries()) {
|
|
3521
|
-
let n = t === "horizontal" ?
|
|
3579
|
+
let n = t === "horizontal" ? br + e * (c + xr) : br + r + i * (c + xr), o = t === "horizontal" ? br + r + i * 86 : br + e * 86;
|
|
3522
3580
|
p.push({
|
|
3523
3581
|
id: a.id,
|
|
3524
3582
|
label: a.label,
|
|
@@ -3527,7 +3585,7 @@ function buildLayout(e, t, n) {
|
|
|
3527
3585
|
x: n,
|
|
3528
3586
|
y: o,
|
|
3529
3587
|
width: c,
|
|
3530
|
-
height:
|
|
3588
|
+
height: yr
|
|
3531
3589
|
});
|
|
3532
3590
|
}
|
|
3533
3591
|
}
|
|
@@ -3604,14 +3662,14 @@ function formatChatVisualTick(e) {
|
|
|
3604
3662
|
let { prefix: r, suffix: i } = affixes(n);
|
|
3605
3663
|
return `${r}${formatChatVisualValue({ value: t })}${i}`;
|
|
3606
3664
|
}
|
|
3607
|
-
var
|
|
3665
|
+
var wr = 5.4, Tr = 10, Er = 15, Dr = 16;
|
|
3608
3666
|
function planChatVisualXLabels(e) {
|
|
3609
3667
|
let { labels: t, plotWidth: n } = e;
|
|
3610
3668
|
if (!t.length || n <= 0) return {
|
|
3611
3669
|
mode: "horizontal",
|
|
3612
3670
|
entries: []
|
|
3613
3671
|
};
|
|
3614
|
-
let r = t.map((e) => e.length >
|
|
3672
|
+
let r = t.map((e) => e.length > Dr ? `${e.slice(0, Dr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
|
|
3615
3673
|
if (i === 0) return {
|
|
3616
3674
|
mode: "horizontal",
|
|
3617
3675
|
entries: [{
|
|
@@ -3619,14 +3677,14 @@ function planChatVisualXLabels(e) {
|
|
|
3619
3677
|
text: r[0]
|
|
3620
3678
|
}]
|
|
3621
3679
|
};
|
|
3622
|
-
if ((Math.max(...r.map((e) => e.length *
|
|
3680
|
+
if ((Math.max(...r.map((e) => e.length * wr)) + Tr) * t.length <= n) return {
|
|
3623
3681
|
mode: "horizontal",
|
|
3624
3682
|
entries: r.map((e, t) => ({
|
|
3625
3683
|
index: t,
|
|
3626
3684
|
text: e
|
|
3627
3685
|
}))
|
|
3628
3686
|
};
|
|
3629
|
-
let a = Math.max(2, Math.floor(n /
|
|
3687
|
+
let a = Math.max(2, Math.floor(n / Er));
|
|
3630
3688
|
if (t.length <= a) return {
|
|
3631
3689
|
mode: "angled",
|
|
3632
3690
|
entries: r.map((e, t) => ({
|
|
@@ -3646,22 +3704,22 @@ function planChatVisualXLabels(e) {
|
|
|
3646
3704
|
}
|
|
3647
3705
|
//#endregion
|
|
3648
3706
|
//#region agent/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3649
|
-
var
|
|
3707
|
+
var Or = [
|
|
3650
3708
|
"data-visual-type",
|
|
3651
3709
|
"data-chart-type",
|
|
3652
3710
|
"data-stacking",
|
|
3653
3711
|
"data-diagram-type",
|
|
3654
3712
|
"aria-label"
|
|
3655
|
-
],
|
|
3713
|
+
], kr = { class: "mb-2.5" }, Ar = ["aria-label"], jr = {
|
|
3656
3714
|
key: 0,
|
|
3657
3715
|
"data-test": "chat-visual-horizontal-bars",
|
|
3658
3716
|
class: "grid gap-3"
|
|
3659
|
-
},
|
|
3717
|
+
}, Mr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Nr = ["viewBox"], Pr = [
|
|
3660
3718
|
"x1",
|
|
3661
3719
|
"x2",
|
|
3662
3720
|
"y1",
|
|
3663
3721
|
"y2"
|
|
3664
|
-
],
|
|
3722
|
+
], Fr = ["x", "y"], Ir = [
|
|
3665
3723
|
"data-row-index",
|
|
3666
3724
|
"data-series-index",
|
|
3667
3725
|
"data-data-key",
|
|
@@ -3669,56 +3727,56 @@ var Cr = [
|
|
|
3669
3727
|
"y",
|
|
3670
3728
|
"width",
|
|
3671
3729
|
"height"
|
|
3672
|
-
],
|
|
3730
|
+
], Lr = ["data-trend-key", "d"], Rr = ["d"], zr = ["cx", "cy"], Br = ["cx", "cy"], Vr = [
|
|
3673
3731
|
"x",
|
|
3674
3732
|
"y",
|
|
3675
3733
|
"text-anchor",
|
|
3676
3734
|
"transform"
|
|
3677
|
-
],
|
|
3735
|
+
], Hr = {
|
|
3678
3736
|
key: 2,
|
|
3679
3737
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3680
|
-
},
|
|
3738
|
+
}, Ur = {
|
|
3681
3739
|
key: 1,
|
|
3682
3740
|
class: "grid gap-3"
|
|
3683
|
-
},
|
|
3741
|
+
}, Wr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Gr = { class: "shrink-0 tabular-nums" }, Kr = {
|
|
3684
3742
|
key: 2,
|
|
3685
3743
|
class: "overflow-x-auto"
|
|
3686
|
-
},
|
|
3744
|
+
}, qr = ["viewBox", "aria-label"], Jr = [
|
|
3687
3745
|
"data-from",
|
|
3688
3746
|
"data-to",
|
|
3689
3747
|
"x1",
|
|
3690
3748
|
"y1",
|
|
3691
3749
|
"x2",
|
|
3692
3750
|
"y2"
|
|
3693
|
-
],
|
|
3751
|
+
], Yr = ["cx", "cy"], Xr = ["x", "y"], Zr = [
|
|
3694
3752
|
"data-node-id",
|
|
3695
3753
|
"data-node-kind",
|
|
3696
3754
|
"transform"
|
|
3697
|
-
],
|
|
3755
|
+
], Qr = ["points"], $r = ["width", "height"], ei = ["width", "height"], ti = {
|
|
3698
3756
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3699
3757
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3700
|
-
},
|
|
3758
|
+
}, ni = /* @__PURE__ */ x({
|
|
3701
3759
|
__name: "ChatVisualBlock",
|
|
3702
3760
|
props: {
|
|
3703
3761
|
result: {},
|
|
3704
3762
|
inverted: { type: Boolean }
|
|
3705
3763
|
},
|
|
3706
3764
|
setup(e) {
|
|
3707
|
-
let t = e, n =
|
|
3708
|
-
|
|
3765
|
+
let t = e, n = k(), r = se(360), i;
|
|
3766
|
+
ie(() => {
|
|
3709
3767
|
typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
|
|
3710
3768
|
let t = e[0]?.contentRect.width;
|
|
3711
3769
|
t && (r.value = Math.round(t));
|
|
3712
3770
|
}), i.observe(n.value));
|
|
3713
|
-
}),
|
|
3714
|
-
let a =
|
|
3771
|
+
}), re(() => i?.disconnect());
|
|
3772
|
+
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
3773
|
function isCartesianChart(e) {
|
|
3716
3774
|
return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
|
|
3717
3775
|
}
|
|
3718
3776
|
function isPieChart(e) {
|
|
3719
3777
|
return e?.chartType === "pie";
|
|
3720
3778
|
}
|
|
3721
|
-
let
|
|
3779
|
+
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
3780
|
function numericValue(e) {
|
|
3723
3781
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
3724
3782
|
}
|
|
@@ -3750,8 +3808,8 @@ var Cr = [
|
|
|
3750
3808
|
intercept: (r - s * n) / t
|
|
3751
3809
|
};
|
|
3752
3810
|
}
|
|
3753
|
-
let
|
|
3754
|
-
let e = [], t =
|
|
3811
|
+
let ne = p(() => {
|
|
3812
|
+
let e = [], t = m.value;
|
|
3755
3813
|
if (!t) return e;
|
|
3756
3814
|
if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
|
|
3757
3815
|
let r = 0, i = 0;
|
|
@@ -3780,8 +3838,8 @@ var Cr = [
|
|
|
3780
3838
|
let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
|
|
3781
3839
|
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
3840
|
}
|
|
3783
|
-
let
|
|
3784
|
-
let e =
|
|
3841
|
+
let S = p(() => {
|
|
3842
|
+
let e = ne.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
|
|
3785
3843
|
if (n === t) return {
|
|
3786
3844
|
min: 0,
|
|
3787
3845
|
max: t || 1,
|
|
@@ -3794,8 +3852,8 @@ var Cr = [
|
|
|
3794
3852
|
max: a,
|
|
3795
3853
|
ticks: o
|
|
3796
3854
|
};
|
|
3797
|
-
}),
|
|
3798
|
-
let e =
|
|
3855
|
+
}), ae = p(() => resolveSharedSeriesFormat({ series: te.value })), oe = p(() => {
|
|
3856
|
+
let e = m.value;
|
|
3799
3857
|
if (!e) return {
|
|
3800
3858
|
mode: "horizontal",
|
|
3801
3859
|
entries: []
|
|
@@ -3805,8 +3863,8 @@ var Cr = [
|
|
|
3805
3863
|
labels: e.data.map((e) => String(e?.[t] ?? "")),
|
|
3806
3864
|
plotWidth: Math.max(200, a.value - 42)
|
|
3807
3865
|
});
|
|
3808
|
-
}),
|
|
3809
|
-
let e =
|
|
3866
|
+
}), j = p(() => {
|
|
3867
|
+
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
3868
|
return {
|
|
3811
3869
|
width: a.value,
|
|
3812
3870
|
height: 168 + (r ? 36 : 0),
|
|
@@ -3817,7 +3875,7 @@ var Cr = [
|
|
|
3817
3875
|
};
|
|
3818
3876
|
});
|
|
3819
3877
|
function labelCenterX(e, t) {
|
|
3820
|
-
let n =
|
|
3878
|
+
let n = m.value, r = j.value;
|
|
3821
3879
|
if (n?.chartType === "bar") {
|
|
3822
3880
|
let n = r.width - r.left - r.right;
|
|
3823
3881
|
return r.left + (e + .5) * (n / Math.max(t, 1));
|
|
@@ -3825,22 +3883,22 @@ var Cr = [
|
|
|
3825
3883
|
return xForIndex(e, t);
|
|
3826
3884
|
}
|
|
3827
3885
|
function xForIndex(e, t) {
|
|
3828
|
-
let n =
|
|
3886
|
+
let n = j.value, r = n.width - n.left - n.right;
|
|
3829
3887
|
return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
|
|
3830
3888
|
}
|
|
3831
3889
|
function yForValue(e) {
|
|
3832
|
-
let { min: t, max: n } =
|
|
3890
|
+
let { min: t, max: n } = S.value, r = j.value, i = r.height - r.top - r.bottom;
|
|
3833
3891
|
return r.top + (n - e) / (n - t || 1) * i;
|
|
3834
3892
|
}
|
|
3835
3893
|
function pathForSeries(e) {
|
|
3836
|
-
let t =
|
|
3894
|
+
let t = m.value;
|
|
3837
3895
|
return t ? t.data.map((n, r) => {
|
|
3838
3896
|
let i = numericValue(n[e]) ?? 0;
|
|
3839
3897
|
return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
|
|
3840
3898
|
}).join(" ") : "";
|
|
3841
3899
|
}
|
|
3842
|
-
let
|
|
3843
|
-
let e =
|
|
3900
|
+
let ue = p(() => {
|
|
3901
|
+
let e = m.value;
|
|
3844
3902
|
if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
|
|
3845
3903
|
let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
|
|
3846
3904
|
if (!n || !t.length) return null;
|
|
@@ -3850,11 +3908,11 @@ var Cr = [
|
|
|
3850
3908
|
dataKey: e.trendLine.dataKey,
|
|
3851
3909
|
seriesIndex: s
|
|
3852
3910
|
};
|
|
3853
|
-
}),
|
|
3854
|
-
let e =
|
|
3911
|
+
}), de = p(() => {
|
|
3912
|
+
let e = m.value;
|
|
3855
3913
|
if (!e || e.chartType !== "bar") return [];
|
|
3856
|
-
let t =
|
|
3857
|
-
if (
|
|
3914
|
+
let t = j.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
|
|
3915
|
+
if (x.value) {
|
|
3858
3916
|
let r = Math.max(4, Math.min(24, n * .42));
|
|
3859
3917
|
return e.data.flatMap((i, a) => {
|
|
3860
3918
|
let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
|
|
@@ -3887,12 +3945,12 @@ var Cr = [
|
|
|
3887
3945
|
dataKey: e.dataKey
|
|
3888
3946
|
};
|
|
3889
3947
|
}));
|
|
3890
|
-
}),
|
|
3891
|
-
let e =
|
|
3948
|
+
}), F = p(() => {
|
|
3949
|
+
let e = m.value;
|
|
3892
3950
|
if (!e) return [];
|
|
3893
3951
|
let t = e.data;
|
|
3894
3952
|
if (!t.length) return [];
|
|
3895
|
-
let n = t.length - 1, r =
|
|
3953
|
+
let n = t.length - 1, r = oe.value, i = r.mode === "angled";
|
|
3896
3954
|
return r.entries.map(({ index: e, text: r }) => ({
|
|
3897
3955
|
key: `${e}`,
|
|
3898
3956
|
label: r,
|
|
@@ -3900,9 +3958,9 @@ var Cr = [
|
|
|
3900
3958
|
anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
|
|
3901
3959
|
angled: i
|
|
3902
3960
|
})).filter((e) => e.label);
|
|
3903
|
-
}),
|
|
3904
|
-
let e =
|
|
3905
|
-
if (!e || e.chartType !== "bar" || e.series.length !== 1 ||
|
|
3961
|
+
}), pe = p(() => {
|
|
3962
|
+
let e = m.value;
|
|
3963
|
+
if (!e || e.chartType !== "bar" || e.series.length !== 1 || x.value) return [];
|
|
3906
3964
|
let t = e.series[0], n = e.data.map((n, r) => {
|
|
3907
3965
|
let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
|
|
3908
3966
|
return !i || a === null ? null : {
|
|
@@ -3923,8 +3981,8 @@ var Cr = [
|
|
|
3923
3981
|
width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
|
|
3924
3982
|
seriesIndex: 0
|
|
3925
3983
|
}));
|
|
3926
|
-
}),
|
|
3927
|
-
let e =
|
|
3984
|
+
}), he = p(() => {
|
|
3985
|
+
let e = m.value;
|
|
3928
3986
|
if (!e?.data.length) return [];
|
|
3929
3987
|
let t = e.data[e.data.length - 1];
|
|
3930
3988
|
return e.series.map((e, n) => {
|
|
@@ -3939,8 +3997,8 @@ var Cr = [
|
|
|
3939
3997
|
seriesIndex: n
|
|
3940
3998
|
};
|
|
3941
3999
|
});
|
|
3942
|
-
}),
|
|
3943
|
-
let e =
|
|
4000
|
+
}), I = p(() => {
|
|
4001
|
+
let e = m.value;
|
|
3944
4002
|
if (!e?.data.length || e.chartType !== "line") return [];
|
|
3945
4003
|
let t = e.data.length - 1, n = e.data[t];
|
|
3946
4004
|
return e.series.map((r, i) => {
|
|
@@ -3952,8 +4010,8 @@ var Cr = [
|
|
|
3952
4010
|
seriesIndex: i
|
|
3953
4011
|
};
|
|
3954
4012
|
}).filter((e) => e !== null);
|
|
3955
|
-
}),
|
|
3956
|
-
let e =
|
|
4013
|
+
}), R = p(() => {
|
|
4014
|
+
let e = b.value;
|
|
3957
4015
|
if (!e) return [];
|
|
3958
4016
|
let t = e.data.map((t) => ({
|
|
3959
4017
|
name: String(t[e.nameKey] ?? ""),
|
|
@@ -3968,17 +4026,17 @@ var Cr = [
|
|
|
3968
4026
|
series: r
|
|
3969
4027
|
})
|
|
3970
4028
|
}));
|
|
3971
|
-
}),
|
|
4029
|
+
}), z = p(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), _e = [
|
|
3972
4030
|
"var(--color-theme-900)",
|
|
3973
4031
|
"var(--color-primary-500)",
|
|
3974
4032
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
3975
|
-
],
|
|
4033
|
+
], ve = [
|
|
3976
4034
|
"rgba(255, 255, 255, 0.92)",
|
|
3977
4035
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
3978
4036
|
"rgba(255, 255, 255, 0.55)"
|
|
3979
4037
|
];
|
|
3980
4038
|
function seriesColor(e) {
|
|
3981
|
-
let n = t.inverted ?
|
|
4039
|
+
let n = t.inverted ? ve : _e;
|
|
3982
4040
|
return n[e % n.length];
|
|
3983
4041
|
}
|
|
3984
4042
|
function diagramNodeFill(e) {
|
|
@@ -3987,82 +4045,82 @@ var Cr = [
|
|
|
3987
4045
|
function diagramNodeStroke(e) {
|
|
3988
4046
|
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
4047
|
}
|
|
3990
|
-
let
|
|
3991
|
-
return (e, r) => o.value ? (
|
|
4048
|
+
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)");
|
|
4049
|
+
return (e, r) => o.value ? (T(), _("section", {
|
|
3992
4050
|
key: 0,
|
|
3993
4051
|
"data-test": "chat-visual",
|
|
3994
4052
|
"data-visual-type": o.value.visualType,
|
|
3995
4053
|
"data-chart-type": s.value?.chartType,
|
|
3996
|
-
"data-stacking":
|
|
4054
|
+
"data-stacking": x.value ? "stacked" : void 0,
|
|
3997
4055
|
"data-diagram-type": c.value?.diagramType,
|
|
3998
4056
|
class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
|
|
3999
|
-
style:
|
|
4057
|
+
style: C({ boxShadow: `inset 0 0 0 1px ${W.value}` }),
|
|
4000
4058
|
"aria-label": o.value.meta.title
|
|
4001
4059
|
}, [
|
|
4002
|
-
|
|
4060
|
+
v("header", kr, [v("h4", {
|
|
4003
4061
|
class: "text-[13px] font-semibold leading-tight",
|
|
4004
|
-
style:
|
|
4005
|
-
},
|
|
4062
|
+
style: C({ color: B.value })
|
|
4063
|
+
}, P(o.value.meta.title), 5), o.value.meta.description ? (T(), _("p", {
|
|
4006
4064
|
key: 0,
|
|
4007
4065
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
4008
|
-
style:
|
|
4009
|
-
},
|
|
4010
|
-
|
|
4066
|
+
style: C({ color: ye.value })
|
|
4067
|
+
}, P(o.value.meta.description), 5)) : h("", !0)]),
|
|
4068
|
+
v("div", {
|
|
4011
4069
|
ref_key: "bodyEl",
|
|
4012
4070
|
ref: n
|
|
4013
|
-
}, [
|
|
4071
|
+
}, [m.value ? (T(), _("div", {
|
|
4014
4072
|
key: 0,
|
|
4015
4073
|
role: "img",
|
|
4016
4074
|
"aria-label": o.value.meta.title
|
|
4017
|
-
}, [
|
|
4075
|
+
}, [pe.value.length ? (T(), _("div", jr, [(T(!0), _(f, null, A(pe.value, (e) => (T(), _("div", {
|
|
4018
4076
|
key: e.key,
|
|
4019
4077
|
"data-test": "chat-visual-horizontal-bar",
|
|
4020
4078
|
class: "min-w-0"
|
|
4021
|
-
}, [
|
|
4079
|
+
}, [v("div", Mr, [v("span", {
|
|
4022
4080
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4023
|
-
style:
|
|
4024
|
-
},
|
|
4081
|
+
style: C({ color: B.value })
|
|
4082
|
+
}, P(e.label), 5), v("span", {
|
|
4025
4083
|
class: "shrink-0 font-semibold tabular-nums",
|
|
4026
|
-
style:
|
|
4027
|
-
},
|
|
4084
|
+
style: C({ color: B.value })
|
|
4085
|
+
}, P(e.value), 5)]), v("div", {
|
|
4028
4086
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4029
|
-
style:
|
|
4030
|
-
}, [
|
|
4087
|
+
style: C({ background: we.value })
|
|
4088
|
+
}, [v("div", {
|
|
4031
4089
|
class: "h-full rounded-full",
|
|
4032
|
-
style:
|
|
4090
|
+
style: C({
|
|
4033
4091
|
width: `${e.width}%`,
|
|
4034
4092
|
background: seriesColor(e.seriesIndex)
|
|
4035
4093
|
})
|
|
4036
|
-
}, null, 4)], 4)]))), 128))])) : (
|
|
4094
|
+
}, null, 4)], 4)]))), 128))])) : (T(), _("svg", {
|
|
4037
4095
|
key: 1,
|
|
4038
4096
|
class: "block h-auto w-full overflow-visible",
|
|
4039
|
-
viewBox: `0 0 ${
|
|
4040
|
-
style:
|
|
4097
|
+
viewBox: `0 0 ${j.value.width} ${j.value.height}`,
|
|
4098
|
+
style: C({ aspectRatio: `${j.value.width} / ${j.value.height}` }),
|
|
4041
4099
|
preserveAspectRatio: "xMidYMid meet",
|
|
4042
4100
|
"aria-hidden": "true"
|
|
4043
4101
|
}, [
|
|
4044
|
-
(
|
|
4102
|
+
(T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("line", {
|
|
4045
4103
|
key: `grid-${e}`,
|
|
4046
|
-
x1:
|
|
4047
|
-
x2:
|
|
4104
|
+
x1: j.value.left,
|
|
4105
|
+
x2: j.value.width - j.value.right,
|
|
4048
4106
|
y1: yForValue(e),
|
|
4049
4107
|
y2: yForValue(e),
|
|
4050
4108
|
"stroke-width": "1",
|
|
4051
4109
|
"vector-effect": "non-scaling-stroke",
|
|
4052
|
-
style:
|
|
4053
|
-
}, null, 12,
|
|
4054
|
-
|
|
4110
|
+
style: C({ stroke: e === 0 ? U.value : be.value })
|
|
4111
|
+
}, null, 12, Pr))), 128)),
|
|
4112
|
+
v("g", null, [(T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("text", {
|
|
4055
4113
|
key: `y-${e}`,
|
|
4056
|
-
x:
|
|
4114
|
+
x: j.value.left - 7,
|
|
4057
4115
|
y: yForValue(e) + 3,
|
|
4058
4116
|
"text-anchor": "end",
|
|
4059
4117
|
"font-size": "9.5",
|
|
4060
|
-
style:
|
|
4061
|
-
},
|
|
4118
|
+
style: C({ fill: H.value })
|
|
4119
|
+
}, P(ce(formatChatVisualTick)({
|
|
4062
4120
|
value: e,
|
|
4063
|
-
shared:
|
|
4064
|
-
})), 13,
|
|
4065
|
-
|
|
4121
|
+
shared: ae.value
|
|
4122
|
+
})), 13, Fr))), 128))]),
|
|
4123
|
+
m.value.chartType === "bar" ? (T(!0), _(f, { key: 0 }, A(de.value, (e) => (T(), _("rect", {
|
|
4066
4124
|
key: e.key,
|
|
4067
4125
|
"data-test": "chat-visual-bar",
|
|
4068
4126
|
"data-row-index": e.rowIndex,
|
|
@@ -4073,22 +4131,22 @@ var Cr = [
|
|
|
4073
4131
|
width: e.width,
|
|
4074
4132
|
height: e.height,
|
|
4075
4133
|
rx: "2.5",
|
|
4076
|
-
style:
|
|
4077
|
-
}, null, 12,
|
|
4078
|
-
|
|
4134
|
+
style: C({ fill: seriesColor(e.seriesIndex) })
|
|
4135
|
+
}, null, 12, Ir))), 128)) : (T(), _(f, { key: 1 }, [
|
|
4136
|
+
ue.value ? (T(), _("path", {
|
|
4079
4137
|
key: 0,
|
|
4080
4138
|
"data-test": "chat-visual-trend-line",
|
|
4081
|
-
"data-trend-key":
|
|
4082
|
-
d:
|
|
4139
|
+
"data-trend-key": ue.value.dataKey,
|
|
4140
|
+
d: ue.value.path,
|
|
4083
4141
|
fill: "none",
|
|
4084
4142
|
"stroke-width": "1.4",
|
|
4085
4143
|
"stroke-linecap": "round",
|
|
4086
4144
|
"stroke-linejoin": "round",
|
|
4087
4145
|
"stroke-dasharray": "4 3",
|
|
4088
4146
|
"vector-effect": "non-scaling-stroke",
|
|
4089
|
-
style:
|
|
4090
|
-
}, null, 12,
|
|
4091
|
-
(
|
|
4147
|
+
style: C({ stroke: seriesColor(ue.value.seriesIndex) })
|
|
4148
|
+
}, null, 12, Lr)) : h("", !0),
|
|
4149
|
+
(T(!0), _(f, null, A(te.value, (e, t) => (T(), _("g", { key: e.dataKey }, [m.value.chartType === "line" ? (T(), _("path", {
|
|
4092
4150
|
key: 0,
|
|
4093
4151
|
d: pathForSeries(e.dataKey),
|
|
4094
4152
|
fill: "none",
|
|
@@ -4096,74 +4154,74 @@ var Cr = [
|
|
|
4096
4154
|
"stroke-linecap": "round",
|
|
4097
4155
|
"stroke-linejoin": "round",
|
|
4098
4156
|
"vector-effect": "non-scaling-stroke",
|
|
4099
|
-
style:
|
|
4100
|
-
}, null, 12,
|
|
4157
|
+
style: C({ stroke: seriesColor(t) })
|
|
4158
|
+
}, null, 12, Rr)) : h("", !0), (T(!0), _(f, null, A(u.value, (n, r) => (T(), _(f, { key: `${e.dataKey}-${r}` }, [m.value.chartType === "scatter" ? (T(), _("circle", {
|
|
4101
4159
|
key: 0,
|
|
4102
|
-
cx: xForIndex(r,
|
|
4160
|
+
cx: xForIndex(r, u.value.length),
|
|
4103
4161
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4104
4162
|
r: "2.6",
|
|
4105
|
-
style:
|
|
4106
|
-
}, null, 12,
|
|
4107
|
-
(
|
|
4163
|
+
style: C({ fill: seriesColor(t) })
|
|
4164
|
+
}, null, 12, zr)) : h("", !0)], 64))), 128))]))), 128)),
|
|
4165
|
+
(T(!0), _(f, null, A(I.value, (e) => (T(), _("circle", {
|
|
4108
4166
|
key: `marker-${e.key}`,
|
|
4109
4167
|
cx: e.cx,
|
|
4110
4168
|
cy: e.cy,
|
|
4111
4169
|
r: "3",
|
|
4112
|
-
style:
|
|
4113
|
-
}, null, 12,
|
|
4170
|
+
style: C({ fill: seriesColor(e.seriesIndex) })
|
|
4171
|
+
}, null, 12, Br))), 128))
|
|
4114
4172
|
], 64)),
|
|
4115
|
-
(
|
|
4173
|
+
(T(!0), _(f, null, A(F.value, (e) => (T(), _("text", {
|
|
4116
4174
|
key: e.key,
|
|
4117
4175
|
x: e.x,
|
|
4118
|
-
y: e.angled ?
|
|
4176
|
+
y: e.angled ? j.value.height - j.value.bottom + 12 : j.value.height - 6,
|
|
4119
4177
|
"text-anchor": e.anchor,
|
|
4120
4178
|
"font-size": "9.5",
|
|
4121
|
-
transform: e.angled ? `rotate(${
|
|
4122
|
-
style:
|
|
4123
|
-
},
|
|
4124
|
-
], 12,
|
|
4179
|
+
transform: e.angled ? `rotate(${ce(-40)} ${e.x} ${j.value.height - j.value.bottom + 12})` : void 0,
|
|
4180
|
+
style: C({ fill: H.value })
|
|
4181
|
+
}, P(e.label), 13, Vr))), 128))
|
|
4182
|
+
], 12, Nr)), he.value.length > 1 || m.value.chartType !== "bar" ? (T(), _("div", Hr, [(T(!0), _(f, null, A(he.value, (e) => (T(), _("div", {
|
|
4125
4183
|
key: e.key,
|
|
4126
4184
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4127
4185
|
}, [
|
|
4128
|
-
|
|
4186
|
+
v("span", {
|
|
4129
4187
|
class: "size-2.5 shrink-0 rounded-full",
|
|
4130
|
-
style:
|
|
4188
|
+
style: C({ background: seriesColor(e.seriesIndex) })
|
|
4131
4189
|
}, null, 4),
|
|
4132
|
-
|
|
4133
|
-
|
|
4190
|
+
v("span", { style: C({ color: ye.value }) }, P(e.label), 5),
|
|
4191
|
+
v("span", {
|
|
4134
4192
|
class: "font-semibold tabular-nums",
|
|
4135
|
-
style:
|
|
4136
|
-
},
|
|
4137
|
-
]))), 128))])) :
|
|
4193
|
+
style: C({ color: B.value })
|
|
4194
|
+
}, P(e.value), 5)
|
|
4195
|
+
]))), 128))])) : h("", !0)], 8, Ar)) : b.value ? (T(), _("div", Ur, [(T(!0), _(f, null, A(R.value, (e, t) => (T(), _("div", { key: e.key }, [v("div", Wr, [v("span", {
|
|
4138
4196
|
class: "truncate font-medium",
|
|
4139
|
-
style:
|
|
4140
|
-
},
|
|
4197
|
+
style: C({ color: B.value })
|
|
4198
|
+
}, P(e.name), 5), v("span", Gr, [v("span", {
|
|
4141
4199
|
class: "font-semibold",
|
|
4142
|
-
style:
|
|
4143
|
-
},
|
|
4200
|
+
style: C({ color: B.value })
|
|
4201
|
+
}, P(e.display), 5), v("span", {
|
|
4144
4202
|
class: "ml-1.5",
|
|
4145
|
-
style:
|
|
4146
|
-
},
|
|
4203
|
+
style: C({ color: ye.value })
|
|
4204
|
+
}, P(Math.round(e.percent * 100)) + "%", 5)])]), v("div", {
|
|
4147
4205
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4148
|
-
style:
|
|
4149
|
-
}, [
|
|
4206
|
+
style: C({ background: we.value })
|
|
4207
|
+
}, [v("div", {
|
|
4150
4208
|
class: "h-full rounded-full",
|
|
4151
|
-
style:
|
|
4209
|
+
style: C({
|
|
4152
4210
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4153
4211
|
background: seriesColor(t)
|
|
4154
4212
|
})
|
|
4155
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4213
|
+
}, null, 4)], 4)]))), 128))])) : c.value && z.value ? (T(), _("div", Kr, [(T(), _("svg", {
|
|
4156
4214
|
"data-test": "chat-visual-diagram-svg",
|
|
4157
4215
|
class: "block h-auto overflow-visible",
|
|
4158
|
-
viewBox: `0 0 ${
|
|
4159
|
-
style:
|
|
4160
|
-
width: `${
|
|
4161
|
-
aspectRatio: `${
|
|
4216
|
+
viewBox: `0 0 ${z.value.width} ${z.value.height}`,
|
|
4217
|
+
style: C({
|
|
4218
|
+
width: `${z.value.width}px`,
|
|
4219
|
+
aspectRatio: `${z.value.width} / ${z.value.height}`
|
|
4162
4220
|
}),
|
|
4163
4221
|
role: "img",
|
|
4164
4222
|
"aria-label": o.value.meta.title
|
|
4165
4223
|
}, [
|
|
4166
|
-
(
|
|
4224
|
+
(T(!0), _(f, null, A(z.value.edges, (e) => (T(), _("line", {
|
|
4167
4225
|
key: e.key,
|
|
4168
4226
|
"data-test": "chat-visual-diagram-edge",
|
|
4169
4227
|
"data-from": e.from,
|
|
@@ -4175,98 +4233,99 @@ var Cr = [
|
|
|
4175
4233
|
"stroke-width": "1.4",
|
|
4176
4234
|
"stroke-linecap": "round",
|
|
4177
4235
|
"vector-effect": "non-scaling-stroke",
|
|
4178
|
-
style:
|
|
4179
|
-
}, null, 12,
|
|
4180
|
-
(
|
|
4236
|
+
style: C({ stroke: Ce.value })
|
|
4237
|
+
}, null, 12, Jr))), 128)),
|
|
4238
|
+
(T(!0), _(f, null, A(z.value.edges, (e) => (T(), _("circle", {
|
|
4181
4239
|
key: `${e.key}-dot`,
|
|
4182
4240
|
cx: e.x2,
|
|
4183
4241
|
cy: e.y2,
|
|
4184
4242
|
r: "2.4",
|
|
4185
|
-
style:
|
|
4186
|
-
}, null, 12,
|
|
4187
|
-
(
|
|
4243
|
+
style: C({ fill: Ce.value })
|
|
4244
|
+
}, null, 12, Yr))), 128)),
|
|
4245
|
+
(T(!0), _(f, null, A(z.value.edges.filter((e) => e.label), (e) => (T(), _("foreignObject", {
|
|
4188
4246
|
key: `${e.key}-label`,
|
|
4189
4247
|
x: e.labelX - 55,
|
|
4190
4248
|
y: e.labelY - 12,
|
|
4191
4249
|
width: "110",
|
|
4192
4250
|
height: "24"
|
|
4193
|
-
}, [
|
|
4251
|
+
}, [v("div", {
|
|
4194
4252
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
4195
4253
|
class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
|
|
4196
|
-
style:
|
|
4254
|
+
style: C({
|
|
4197
4255
|
color: ye.value,
|
|
4198
4256
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4199
4257
|
})
|
|
4200
|
-
},
|
|
4201
|
-
(
|
|
4258
|
+
}, P(e.label), 5)], 8, Xr))), 128)),
|
|
4259
|
+
(T(!0), _(f, null, A(z.value.nodes, (e) => (T(), _("g", {
|
|
4202
4260
|
key: e.id,
|
|
4203
4261
|
"data-test": "chat-visual-diagram-node",
|
|
4204
4262
|
"data-node-id": e.id,
|
|
4205
4263
|
"data-node-kind": e.kind,
|
|
4206
4264
|
transform: `translate(${e.x} ${e.y})`
|
|
4207
|
-
}, [e.kind === "decision" ? (
|
|
4265
|
+
}, [e.kind === "decision" ? (T(), _("polygon", {
|
|
4208
4266
|
key: 0,
|
|
4209
4267
|
points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
|
|
4210
4268
|
"stroke-width": "1",
|
|
4211
4269
|
"vector-effect": "non-scaling-stroke",
|
|
4212
|
-
style:
|
|
4270
|
+
style: C({
|
|
4213
4271
|
fill: diagramNodeFill(e.kind),
|
|
4214
4272
|
stroke: diagramNodeStroke(e.kind)
|
|
4215
4273
|
})
|
|
4216
|
-
}, null, 12,
|
|
4274
|
+
}, null, 12, Qr)) : (T(), _("rect", {
|
|
4217
4275
|
key: 1,
|
|
4218
4276
|
width: e.width,
|
|
4219
4277
|
height: e.height,
|
|
4220
4278
|
rx: "12",
|
|
4221
4279
|
"stroke-width": "1",
|
|
4222
4280
|
"vector-effect": "non-scaling-stroke",
|
|
4223
|
-
style:
|
|
4281
|
+
style: C({
|
|
4224
4282
|
fill: diagramNodeFill(e.kind),
|
|
4225
4283
|
stroke: diagramNodeStroke(e.kind)
|
|
4226
4284
|
})
|
|
4227
|
-
}, null, 12,
|
|
4285
|
+
}, null, 12, $r)), (T(), _("foreignObject", {
|
|
4228
4286
|
x: "8",
|
|
4229
4287
|
y: "5",
|
|
4230
4288
|
width: e.width - 16,
|
|
4231
4289
|
height: e.height - 10
|
|
4232
|
-
}, [
|
|
4290
|
+
}, [v("div", ti, [v("div", {
|
|
4233
4291
|
class: "line-clamp-2 text-[13px] font-semibold leading-tight",
|
|
4234
|
-
style:
|
|
4235
|
-
},
|
|
4292
|
+
style: C({ color: B.value })
|
|
4293
|
+
}, P(e.label), 5), e.detail ? (T(), _("div", {
|
|
4236
4294
|
key: 0,
|
|
4237
4295
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4238
|
-
style:
|
|
4239
|
-
},
|
|
4240
|
-
], 12,
|
|
4241
|
-
o.value.meta.footer ? (
|
|
4296
|
+
style: C({ color: ye.value })
|
|
4297
|
+
}, P(e.detail), 5)) : h("", !0)])], 8, ei))], 8, Zr))), 128))
|
|
4298
|
+
], 12, qr))])) : h("", !0)], 512),
|
|
4299
|
+
o.value.meta.footer ? (T(), _("footer", {
|
|
4242
4300
|
key: 0,
|
|
4243
4301
|
class: "mt-3 text-[11px] leading-snug",
|
|
4244
|
-
style:
|
|
4245
|
-
},
|
|
4246
|
-
], 12,
|
|
4302
|
+
style: C({ color: H.value })
|
|
4303
|
+
}, P(o.value.meta.footer), 5)) : h("", !0)
|
|
4304
|
+
], 12, Or)) : h("", !0);
|
|
4247
4305
|
}
|
|
4248
|
-
}),
|
|
4306
|
+
}), ri = ["innerHTML"], ii = /* @__PURE__ */ x({
|
|
4249
4307
|
__name: "ChatRichText",
|
|
4250
4308
|
props: {
|
|
4251
4309
|
text: {},
|
|
4252
4310
|
inverted: { type: Boolean },
|
|
4253
4311
|
streaming: { type: Boolean }
|
|
4254
4312
|
},
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4313
|
+
emits: ["action"],
|
|
4314
|
+
setup(e, { emit: t }) {
|
|
4315
|
+
let n = e, r = t, i = se(n.text), a;
|
|
4316
|
+
de([() => n.text, () => n.streaming], ([e, t]) => {
|
|
4317
|
+
if (!t) {
|
|
4318
|
+
a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
|
|
4260
4319
|
return;
|
|
4261
4320
|
}
|
|
4262
|
-
|
|
4263
|
-
|
|
4321
|
+
a === void 0 && (a = requestAnimationFrame(() => {
|
|
4322
|
+
a = void 0, i.value = n.text;
|
|
4264
4323
|
}));
|
|
4265
|
-
}),
|
|
4266
|
-
|
|
4324
|
+
}), re(() => {
|
|
4325
|
+
a !== void 0 && cancelAnimationFrame(a);
|
|
4267
4326
|
});
|
|
4268
|
-
let
|
|
4269
|
-
|
|
4327
|
+
let o = new g.Renderer();
|
|
4328
|
+
o.link = ({ href: e, text: t }) => {
|
|
4270
4329
|
let n = e.trim();
|
|
4271
4330
|
if (!n || n === "#") return t;
|
|
4272
4331
|
let r = !1;
|
|
@@ -4279,7 +4338,7 @@ var Cr = [
|
|
|
4279
4338
|
}, g.setOptions({
|
|
4280
4339
|
breaks: !0,
|
|
4281
4340
|
gfm: !0,
|
|
4282
|
-
renderer:
|
|
4341
|
+
renderer: o
|
|
4283
4342
|
});
|
|
4284
4343
|
function renderMarkdown(e) {
|
|
4285
4344
|
if (!e) return "";
|
|
@@ -4338,147 +4397,170 @@ var Cr = [
|
|
|
4338
4397
|
height: e.target.naturalHeight || null
|
|
4339
4398
|
});
|
|
4340
4399
|
}
|
|
4341
|
-
let
|
|
4400
|
+
let s = /```(?:pl-visual|pl-platform-visual|pl-card)[ \t]*(?:\r?\n|$)/;
|
|
4342
4401
|
function richTextSegments(e) {
|
|
4343
|
-
let { text: t, streaming: n } = e, r = [], i = /```(
|
|
4344
|
-
for (;
|
|
4345
|
-
let e = renderMarkdown(t.slice(
|
|
4402
|
+
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);
|
|
4403
|
+
for (; f !== null;) {
|
|
4404
|
+
let e = renderMarkdown(t.slice(a, f.index));
|
|
4346
4405
|
e && r.push({
|
|
4347
4406
|
kind: "markdown",
|
|
4348
|
-
key: `md-${
|
|
4407
|
+
key: `md-${o}`,
|
|
4349
4408
|
html: e
|
|
4350
4409
|
});
|
|
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({
|
|
4410
|
+
let n = f[1], s = f[2].trim();
|
|
4411
|
+
if (n === "pl-card") {
|
|
4412
|
+
let e = c(s);
|
|
4413
|
+
e.ok ? r.push({
|
|
4414
|
+
kind: "card",
|
|
4415
|
+
key: `card-${o}`,
|
|
4416
|
+
spec: e.spec
|
|
4417
|
+
}) : (typeof console < "u" && console.warn("[pl-card] parse_failed", {
|
|
4418
|
+
reason: e.reason,
|
|
4419
|
+
message: e.message,
|
|
4420
|
+
payloadChars: s.length
|
|
4421
|
+
}), r.push({
|
|
4367
4422
|
kind: "markdown",
|
|
4368
|
-
key: `
|
|
4369
|
-
html:
|
|
4423
|
+
key: `card-${o}`,
|
|
4424
|
+
html: renderMarkdown(`\`\`\`\n${s}\n\`\`\``)
|
|
4425
|
+
}));
|
|
4426
|
+
} else {
|
|
4427
|
+
let e = u(s);
|
|
4428
|
+
if (e.ok) r.push({
|
|
4429
|
+
kind: "visual",
|
|
4430
|
+
key: `visual-${o}`,
|
|
4431
|
+
result: e
|
|
4370
4432
|
});
|
|
4433
|
+
else {
|
|
4434
|
+
typeof console < "u" && console.warn("[pl-visual] parse_failed", {
|
|
4435
|
+
reason: e.reason,
|
|
4436
|
+
message: e.message,
|
|
4437
|
+
hasFallbackMarkdown: !!e.fallbackMarkdown,
|
|
4438
|
+
payloadChars: s.length,
|
|
4439
|
+
...visualPayloadShape(s)
|
|
4440
|
+
});
|
|
4441
|
+
let t = e.fallbackMarkdown ? renderMarkdown(e.fallbackMarkdown) : "";
|
|
4442
|
+
t && r.push({
|
|
4443
|
+
kind: "markdown",
|
|
4444
|
+
key: `visual-${o}`,
|
|
4445
|
+
html: t
|
|
4446
|
+
});
|
|
4447
|
+
}
|
|
4371
4448
|
}
|
|
4372
|
-
|
|
4449
|
+
a = f.index + f[0].length, o += 1, f = i.exec(t);
|
|
4373
4450
|
}
|
|
4374
|
-
let
|
|
4375
|
-
if (
|
|
4376
|
-
let e = renderMarkdown(
|
|
4451
|
+
let p = t.slice(a), m = n ? s.exec(p) : null;
|
|
4452
|
+
if (m) {
|
|
4453
|
+
let e = renderMarkdown(p.slice(0, m.index));
|
|
4377
4454
|
return e && r.push({
|
|
4378
4455
|
kind: "markdown",
|
|
4379
|
-
key: `md-${
|
|
4456
|
+
key: `md-${o}`,
|
|
4380
4457
|
html: e
|
|
4381
4458
|
}), r.push({
|
|
4382
4459
|
kind: "pending-visual",
|
|
4383
|
-
key: `pending-${
|
|
4460
|
+
key: `pending-${o}`
|
|
4384
4461
|
}), r;
|
|
4385
4462
|
}
|
|
4386
|
-
let
|
|
4387
|
-
return
|
|
4463
|
+
let h = renderMarkdown(p);
|
|
4464
|
+
return h && r.push({
|
|
4388
4465
|
kind: "markdown",
|
|
4389
|
-
key: `md-${
|
|
4390
|
-
html:
|
|
4466
|
+
key: `md-${o}`,
|
|
4467
|
+
html: h
|
|
4391
4468
|
}), r;
|
|
4392
4469
|
}
|
|
4393
|
-
let
|
|
4394
|
-
let e =
|
|
4470
|
+
let h = p(() => {
|
|
4471
|
+
let e = i.value;
|
|
4395
4472
|
return e ? richTextSegments({
|
|
4396
4473
|
text: e,
|
|
4397
|
-
streaming: !!
|
|
4474
|
+
streaming: !!n.streaming
|
|
4398
4475
|
}) : [];
|
|
4399
4476
|
});
|
|
4400
|
-
return (t, n) => (
|
|
4477
|
+
return (t, n) => (T(), _("div", {
|
|
4401
4478
|
class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:max-w-[65ch] @sm/chat:text-[16px] @sm/chat:leading-relaxed",
|
|
4402
4479
|
onErrorCapture: onRichTextAssetError
|
|
4403
|
-
}, [(
|
|
4480
|
+
}, [(T(!0), _(f, null, A(h.value, (t) => (T(), _(f, { key: t.key }, [t.kind === "markdown" ? (T(), _("div", {
|
|
4404
4481
|
key: 0,
|
|
4405
|
-
class:
|
|
4482
|
+
class: S(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4406
4483
|
innerHTML: t.html
|
|
4407
|
-
}, null, 10,
|
|
4484
|
+
}, null, 10, ri)) : t.kind === "visual" ? (T(), m(ni, {
|
|
4408
4485
|
key: 1,
|
|
4409
4486
|
result: t.result,
|
|
4410
4487
|
inverted: e.inverted
|
|
4411
|
-
}, null, 8, ["result", "inverted"])) : (
|
|
4488
|
+
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (T(), m(_r, {
|
|
4412
4489
|
key: 2,
|
|
4490
|
+
spec: t.spec,
|
|
4491
|
+
inverted: e.inverted,
|
|
4492
|
+
onAction: n[0] || (n[0] = (e) => r("action", e))
|
|
4493
|
+
}, null, 8, ["spec", "inverted"])) : (T(), _("div", {
|
|
4494
|
+
key: 3,
|
|
4413
4495
|
"data-test": "chat-visual-pending",
|
|
4414
4496
|
role: "status",
|
|
4415
4497
|
class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
|
|
4416
|
-
style:
|
|
4498
|
+
style: C({
|
|
4417
4499
|
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
4500
|
color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
|
|
4419
4501
|
})
|
|
4420
|
-
}, [...n[
|
|
4502
|
+
}, [...n[1] || (n[1] = [v("span", {
|
|
4421
4503
|
class: "size-2 shrink-0 animate-pulse rounded-full",
|
|
4422
4504
|
style: { background: "currentcolor" }
|
|
4423
|
-
}, null, -1),
|
|
4505
|
+
}, null, -1), te(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4424
4506
|
}
|
|
4425
|
-
}),
|
|
4507
|
+
}), ai = 80, oi = 600, si = /* @__PURE__ */ x({
|
|
4426
4508
|
__name: "ChatScroller",
|
|
4427
4509
|
setup(e, { expose: t }) {
|
|
4428
|
-
let n =
|
|
4510
|
+
let n = k(), r = k(), i = k(!0), a, o = 0;
|
|
4429
4511
|
function scrollToBottom() {
|
|
4430
4512
|
let e = n.value;
|
|
4431
4513
|
e && (e.scrollTop = e.scrollHeight);
|
|
4432
4514
|
}
|
|
4433
4515
|
function onScroll() {
|
|
4434
4516
|
let e = n.value;
|
|
4435
|
-
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
4517
|
+
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= ai);
|
|
4436
4518
|
}
|
|
4437
4519
|
function markUserGesture() {
|
|
4438
|
-
o = Date.now() +
|
|
4520
|
+
o = Date.now() + oi;
|
|
4439
4521
|
}
|
|
4440
4522
|
function pin() {
|
|
4441
4523
|
i.value = !0, scrollToBottom();
|
|
4442
4524
|
}
|
|
4443
|
-
return t({ pin }),
|
|
4525
|
+
return t({ pin }), ie(() => {
|
|
4444
4526
|
requestAnimationFrame(() => {
|
|
4445
4527
|
scrollToBottom(), requestAnimationFrame(scrollToBottom);
|
|
4446
4528
|
}), r.value && (a = new ResizeObserver(() => {
|
|
4447
4529
|
i.value && Date.now() > o && scrollToBottom();
|
|
4448
4530
|
}), a.observe(r.value), n.value && a.observe(n.value));
|
|
4449
|
-
}),
|
|
4531
|
+
}), re(() => {
|
|
4450
4532
|
a?.disconnect();
|
|
4451
|
-
}), (e, t) => (
|
|
4533
|
+
}), (e, t) => (T(), _("div", {
|
|
4452
4534
|
ref_key: "viewport",
|
|
4453
4535
|
ref: n,
|
|
4454
|
-
class:
|
|
4536
|
+
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
4537
|
onScrollPassive: onScroll,
|
|
4456
4538
|
onWheelPassive: markUserGesture,
|
|
4457
4539
|
onTouchstartPassive: markUserGesture
|
|
4458
|
-
}, [
|
|
4540
|
+
}, [v("div", {
|
|
4459
4541
|
ref_key: "content",
|
|
4460
4542
|
ref: r,
|
|
4461
4543
|
class: "flex-1 flex flex-col"
|
|
4462
|
-
}, [
|
|
4544
|
+
}, [oe(e.$slots, "default")], 512)], 34));
|
|
4463
4545
|
}
|
|
4464
|
-
}),
|
|
4546
|
+
}), ci = {
|
|
4465
4547
|
key: 0,
|
|
4466
4548
|
class: "pb-4"
|
|
4467
|
-
},
|
|
4549
|
+
}, li = {
|
|
4468
4550
|
key: 1,
|
|
4469
4551
|
"data-test": "messaging-sdk-header",
|
|
4470
4552
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4471
|
-
},
|
|
4553
|
+
}, ui = { class: "min-w-0 flex-1" }, di = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, fi = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, pi = {
|
|
4472
4554
|
key: 0,
|
|
4473
4555
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4474
|
-
},
|
|
4556
|
+
}, mi = {
|
|
4475
4557
|
key: 0,
|
|
4476
4558
|
"data-test": "messaging-empty-state",
|
|
4477
4559
|
class: "flex flex-col items-center justify-center px-4"
|
|
4478
|
-
},
|
|
4560
|
+
}, hi = ["title"], gi = {
|
|
4479
4561
|
key: 0,
|
|
4480
4562
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4481
|
-
},
|
|
4563
|
+
}, _i = ["data-journal-outcome"], vi = [
|
|
4482
4564
|
"data-message-id",
|
|
4483
4565
|
"data-message-sender",
|
|
4484
4566
|
"data-conversation-id",
|
|
@@ -4489,7 +4571,7 @@ var Cr = [
|
|
|
4489
4571
|
"data-issue-action-label",
|
|
4490
4572
|
"data-issue-action-url",
|
|
4491
4573
|
"data-streaming"
|
|
4492
|
-
],
|
|
4574
|
+
], yi = { class: "max-w-[85%] min-w-0" }, bi = ["href"], xi = [
|
|
4493
4575
|
"data-message-id",
|
|
4494
4576
|
"data-message-sender",
|
|
4495
4577
|
"data-conversation-id",
|
|
@@ -4498,7 +4580,7 @@ var Cr = [
|
|
|
4498
4580
|
"data-issue-code",
|
|
4499
4581
|
"data-issue-bucket",
|
|
4500
4582
|
"data-streaming"
|
|
4501
|
-
],
|
|
4583
|
+
], Si = [
|
|
4502
4584
|
"data-test",
|
|
4503
4585
|
"data-message-id",
|
|
4504
4586
|
"data-message-sender",
|
|
@@ -4506,51 +4588,51 @@ var Cr = [
|
|
|
4506
4588
|
"data-message-sequence",
|
|
4507
4589
|
"data-system-kind",
|
|
4508
4590
|
"data-streaming"
|
|
4509
|
-
],
|
|
4591
|
+
], Ci = ["src", "alt"], wi = ["src"], Ti = ["href"], Ei = {
|
|
4510
4592
|
key: 0,
|
|
4511
4593
|
"data-test": "messaging-message-text-part"
|
|
4512
|
-
},
|
|
4594
|
+
}, Di = [
|
|
4513
4595
|
"src",
|
|
4514
4596
|
"alt",
|
|
4515
4597
|
"data-attachment-placement"
|
|
4516
|
-
],
|
|
4598
|
+
], Oi = ["src", "data-attachment-placement"], ki = ["href", "data-attachment-placement"], Ai = ["data-journal-outcome"], ji = {
|
|
4517
4599
|
key: 2,
|
|
4518
4600
|
"data-test": "messaging-tool-activity-tail",
|
|
4519
4601
|
"aria-label": "Assistant is still working",
|
|
4520
4602
|
class: "mb-4 grid h-[17px] w-5 place-items-center"
|
|
4521
|
-
},
|
|
4603
|
+
}, Mi = ["data-journal-outcome"], Ni = ["data-working-description"], Pi = { class: "truncate" }, Fi = ["data-issue-code"], Ii = ["href"], Li = {
|
|
4522
4604
|
key: 3,
|
|
4523
4605
|
"data-test": "messaging-thinking-indicator",
|
|
4524
4606
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
4525
|
-
},
|
|
4607
|
+
}, Ri = ["src", "alt"], zi = { class: "max-w-20 truncate" }, Bi = ["onClick"], Vi = {
|
|
4526
4608
|
key: 0,
|
|
4527
4609
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
4528
|
-
},
|
|
4610
|
+
}, Hi = ["data-composer-action"], Ui = ["placeholder", "disabled"], Wi = { class: "font-mono text-sm tabular-nums" }, Gi = { class: "mt-2.5 flex items-center" }, Ki = [
|
|
4529
4611
|
"disabled",
|
|
4530
4612
|
"aria-label",
|
|
4531
4613
|
"title"
|
|
4532
|
-
],
|
|
4614
|
+
], qi = {
|
|
4533
4615
|
key: 0,
|
|
4534
4616
|
class: "i-svg-spinners-ring-resize size-5"
|
|
4535
|
-
},
|
|
4617
|
+
}, Ji = {
|
|
4536
4618
|
key: 1,
|
|
4537
4619
|
class: "i-tabler-plus size-5"
|
|
4538
|
-
},
|
|
4620
|
+
}, Yi = { class: "sr-only" }, Xi = { class: "flex items-center gap-2" }, Zi = ["aria-label", "title"], Qi = { class: "sr-only" }, $i = [
|
|
4539
4621
|
"data-composer-action",
|
|
4540
4622
|
"disabled",
|
|
4541
4623
|
"aria-label",
|
|
4542
4624
|
"title"
|
|
4543
|
-
],
|
|
4625
|
+
], ea = {
|
|
4544
4626
|
key: 0,
|
|
4545
4627
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
4546
|
-
},
|
|
4628
|
+
}, ta = {
|
|
4547
4629
|
key: 1,
|
|
4548
4630
|
class: "i-tabler-arrow-up size-[17px]"
|
|
4549
|
-
},
|
|
4631
|
+
}, na = { class: "sr-only" }, ra = {
|
|
4550
4632
|
key: 2,
|
|
4551
4633
|
"data-test": "messaging-suggested-prompts",
|
|
4552
4634
|
class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
|
|
4553
|
-
},
|
|
4635
|
+
}, ia = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, aa = ["disabled", "onClick"], oa = ["aria-expanded"], sa = /* @__PURE__ */ x({
|
|
4554
4636
|
__name: "ElAgentChat",
|
|
4555
4637
|
props: {
|
|
4556
4638
|
chatController: {},
|
|
@@ -4588,10 +4670,10 @@ var Cr = [
|
|
|
4588
4670
|
label: "Public",
|
|
4589
4671
|
tooltip: "Anyone with the link can see this"
|
|
4590
4672
|
}
|
|
4591
|
-
}, n =
|
|
4673
|
+
}, n = p(() => {
|
|
4592
4674
|
let n = { ...t[e.scope] };
|
|
4593
4675
|
return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
|
|
4594
|
-
}), r =
|
|
4676
|
+
}), r = k(!1), i = k(), a = k(), o = k();
|
|
4595
4677
|
function containsMarkdownLink(e) {
|
|
4596
4678
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
4597
4679
|
}
|
|
@@ -4602,23 +4684,23 @@ var Cr = [
|
|
|
4602
4684
|
let n = e[t], r = e[t + 1];
|
|
4603
4685
|
return !r || r.sender !== n.sender;
|
|
4604
4686
|
}
|
|
4605
|
-
let s =
|
|
4606
|
-
for (let e =
|
|
4607
|
-
let t =
|
|
4687
|
+
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(() => {
|
|
4688
|
+
for (let e = j.value.length - 1; e >= 0; e--) {
|
|
4689
|
+
let t = j.value[e];
|
|
4608
4690
|
if (t?.kind === "text") return t.id;
|
|
4609
4691
|
}
|
|
4610
|
-
}),
|
|
4692
|
+
}), ce = p(() => e.chatController?.liveStreamMessageId?.value), R = p(() => {
|
|
4611
4693
|
let t = e.chatController?.sharedMessages.value ?? [];
|
|
4612
|
-
return
|
|
4613
|
-
}),
|
|
4694
|
+
return j.value.length && ce.value ? t.filter((e) => e.id !== ce.value) : t;
|
|
4695
|
+
}), z = p(() => {
|
|
4614
4696
|
if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
|
|
4615
|
-
}),
|
|
4616
|
-
if (!
|
|
4617
|
-
let e =
|
|
4697
|
+
}), ve = p(() => e.chatController?.workJournal?.value), B = p(() => {
|
|
4698
|
+
if (!ve.value && !j.value.length) return;
|
|
4699
|
+
let e = R.value, t = e[e.length - 1];
|
|
4618
4700
|
if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
4619
|
-
}), ye =
|
|
4701
|
+
}), ye = p(() => {
|
|
4620
4702
|
let t = {};
|
|
4621
|
-
for (let n of
|
|
4703
|
+
for (let n of R.value) {
|
|
4622
4704
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
4623
4705
|
let r = e.chatController?.workJournalFor?.({
|
|
4624
4706
|
activities: n.toolActivities,
|
|
@@ -4678,42 +4760,45 @@ var Cr = [
|
|
|
4678
4760
|
text: t.slice(i)
|
|
4679
4761
|
}), r;
|
|
4680
4762
|
}
|
|
4681
|
-
let H =
|
|
4682
|
-
if (!
|
|
4683
|
-
let e =
|
|
4763
|
+
let H = p(() => s.value?.transientIssue), be = p(() => {
|
|
4764
|
+
if (!u.value) return;
|
|
4765
|
+
let e = R.value, t = e[e.length - 1];
|
|
4684
4766
|
return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
|
|
4685
|
-
}), U =
|
|
4767
|
+
}), 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
4768
|
text: "",
|
|
4687
4769
|
pendingAttachments: [],
|
|
4688
4770
|
isUploading: !1
|
|
4689
|
-
}), Te =
|
|
4771
|
+
}), Te = p({
|
|
4690
4772
|
get: () => we.value.text,
|
|
4691
4773
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
4692
|
-
}), Ee =
|
|
4693
|
-
|
|
4774
|
+
}), 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");
|
|
4775
|
+
ie(async () => {
|
|
4694
4776
|
e.chatController && !c.value && await e.chatController.startTextConversation();
|
|
4695
|
-
}),
|
|
4777
|
+
}), ae(() => {
|
|
4696
4778
|
e.chatController?.voiceRecorder?.teardown();
|
|
4697
4779
|
});
|
|
4698
4780
|
async function sendMessage() {
|
|
4699
|
-
!e.chatController ||
|
|
4781
|
+
!e.chatController || je.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
|
|
4782
|
+
}
|
|
4783
|
+
async function handleCardAction(t) {
|
|
4784
|
+
!e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t));
|
|
4700
4785
|
}
|
|
4701
4786
|
async function sendSuggestedPrompt(t) {
|
|
4702
4787
|
!e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t.prompt));
|
|
4703
4788
|
}
|
|
4704
4789
|
async function handleComposerAction() {
|
|
4705
|
-
e.chatController && (
|
|
4790
|
+
e.chatController && (je.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
|
|
4706
4791
|
}
|
|
4707
4792
|
async function handleKeydown(e) {
|
|
4708
4793
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
|
|
4709
4794
|
}
|
|
4710
4795
|
function focusComposer(e) {
|
|
4711
|
-
|
|
4796
|
+
Ie.value || W.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
|
|
4712
4797
|
}
|
|
4713
4798
|
function adjustTextareaHeight() {
|
|
4714
4799
|
a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
|
|
4715
4800
|
}
|
|
4716
|
-
|
|
4801
|
+
de(Te, () => ne(() => adjustTextareaHeight()));
|
|
4717
4802
|
function triggerFileInput() {
|
|
4718
4803
|
o.value?.click();
|
|
4719
4804
|
}
|
|
@@ -4757,59 +4842,59 @@ var Cr = [
|
|
|
4757
4842
|
...o ? {} : { year: "numeric" }
|
|
4758
4843
|
})}, ${a}`;
|
|
4759
4844
|
}
|
|
4760
|
-
return (t, s) => (
|
|
4761
|
-
e.showHeader && !
|
|
4845
|
+
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" : ""]) }, [
|
|
4846
|
+
e.showHeader && !K.value ? (T(), _("div", ci, [b(Pe, {
|
|
4762
4847
|
agent: e.agent,
|
|
4763
4848
|
"is-online": c.value
|
|
4764
|
-
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (
|
|
4849
|
+
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (T(), _("div", li, [v("div", { class: S(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
|
|
4765
4850
|
b(ze, {
|
|
4766
4851
|
agent: e.agent,
|
|
4767
|
-
"is-light":
|
|
4852
|
+
"is-light": K.value,
|
|
4768
4853
|
class: "size-10"
|
|
4769
4854
|
}, null, 8, ["agent", "is-light"]),
|
|
4770
|
-
|
|
4771
|
-
e.headerMeta ? (
|
|
4772
|
-
], 2)])) :
|
|
4773
|
-
|
|
4855
|
+
v("div", ui, [v("div", di, P(e.agent.displayName.value), 1), v("div", fi, P(e.agent.title.value || "Assistant"), 1)]),
|
|
4856
|
+
e.headerMeta ? (T(), _("span", pi, P(e.headerMeta), 1)) : h("", !0)
|
|
4857
|
+
], 2)])) : h("", !0),
|
|
4858
|
+
C.value ? (T(), _("div", {
|
|
4774
4859
|
key: 2,
|
|
4775
|
-
class:
|
|
4776
|
-
}, [b(
|
|
4860
|
+
class: S(["py-16 flex flex-col items-center justify-center gap-2 text-sm", K.value ? "text-theme-400" : "text-theme-600"])
|
|
4861
|
+
}, [b(_e, { class: "size-4" })], 2)) : e.setupHint ? (T(), _("div", {
|
|
4777
4862
|
key: 3,
|
|
4778
|
-
class:
|
|
4779
|
-
}, [s[20] || (s[20] =
|
|
4780
|
-
b(
|
|
4863
|
+
class: S(["flex items-center justify-center gap-1.5 py-2 text-[11px]", He.value])
|
|
4864
|
+
}, [s[20] || (s[20] = v("i", { class: "i-tabler-tool size-3" }, null, -1)), v("span", null, P(e.setupHint), 1)], 2)) : h("", !0),
|
|
4865
|
+
b(si, {
|
|
4781
4866
|
ref_key: "chatScroller",
|
|
4782
4867
|
ref: i,
|
|
4783
|
-
class:
|
|
4868
|
+
class: S(R.value.length === 0 ? "flex-none" : "flex-1")
|
|
4784
4869
|
}, {
|
|
4785
|
-
default:
|
|
4786
|
-
|
|
4870
|
+
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" : ""]) }, [
|
|
4871
|
+
R.value.length === 0 && !C.value ? (T(), _("div", mi, [oe(t.$slots, "empty-heading", {
|
|
4787
4872
|
agent: e.agent,
|
|
4788
|
-
isLight:
|
|
4873
|
+
isLight: K.value
|
|
4789
4874
|
}, () => [b(ze, {
|
|
4790
4875
|
agent: e.agent,
|
|
4791
|
-
"is-light":
|
|
4876
|
+
"is-light": K.value,
|
|
4792
4877
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
4793
|
-
}, null, 8, ["agent", "is-light"]),
|
|
4794
|
-
class:
|
|
4878
|
+
}, 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", {
|
|
4879
|
+
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
4880
|
title: n.value.tooltip
|
|
4796
|
-
}, [
|
|
4797
|
-
(
|
|
4798
|
-
shouldShowTimeDivider(
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
])) :
|
|
4803
|
-
messageWorkJournal(e) ? (
|
|
4881
|
+
}, [v("i", { class: S([n.value.icon, "size-3"]) }, null, 2), v("span", null, P(n.value.label), 1)], 10, hi)], 64))])) : h("", !0),
|
|
4882
|
+
(T(!0), _(f, null, A(R.value, (e, t) => (T(), _(f, { key: e.id }, [
|
|
4883
|
+
shouldShowTimeDivider(R.value, t) ? (T(), _("div", gi, [
|
|
4884
|
+
v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2),
|
|
4885
|
+
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),
|
|
4886
|
+
v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2)
|
|
4887
|
+
])) : h("", !0),
|
|
4888
|
+
messageWorkJournal(e) ? (T(), _("div", {
|
|
4804
4889
|
key: 1,
|
|
4805
4890
|
"data-test": "messaging-message-tool-activity",
|
|
4806
4891
|
"data-journal-outcome": messageWorkJournal(e)?.outcome,
|
|
4807
4892
|
class: "mb-4 w-full"
|
|
4808
4893
|
}, [b(qe, {
|
|
4809
4894
|
model: messageWorkJournal(e),
|
|
4810
|
-
"is-light":
|
|
4811
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4812
|
-
isSystemExplainerMessage(e) ? (
|
|
4895
|
+
"is-light": K.value
|
|
4896
|
+
}, null, 8, ["model", "is-light"])], 8, _i)) : h("", !0),
|
|
4897
|
+
isSystemExplainerMessage(e) ? (T(), _("div", {
|
|
4813
4898
|
key: 2,
|
|
4814
4899
|
"data-test": "messaging-system-msg",
|
|
4815
4900
|
"data-message-id": e.id,
|
|
@@ -4823,27 +4908,28 @@ var Cr = [
|
|
|
4823
4908
|
"data-issue-action-url": e.issue?.actionUrl,
|
|
4824
4909
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4825
4910
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4826
|
-
}, [
|
|
4911
|
+
}, [v("div", yi, [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(ii, {
|
|
4827
4912
|
key: 0,
|
|
4828
4913
|
text: e.text,
|
|
4829
|
-
inverted: !
|
|
4914
|
+
inverted: !K.value,
|
|
4830
4915
|
streaming: e.id === be.value,
|
|
4831
|
-
onClick: s[0] || (s[0] =
|
|
4916
|
+
onClick: s[0] || (s[0] = I(() => {}, ["stop"])),
|
|
4917
|
+
onAction: handleCardAction
|
|
4832
4918
|
}, null, 8, [
|
|
4833
4919
|
"text",
|
|
4834
4920
|
"inverted",
|
|
4835
4921
|
"streaming"
|
|
4836
|
-
])) : e.issue?.help ? (
|
|
4922
|
+
])) : e.issue?.help ? (T(), m(ii, {
|
|
4837
4923
|
key: 1,
|
|
4838
4924
|
text: e.issue.help,
|
|
4839
|
-
inverted: !
|
|
4840
|
-
}, null, 8, ["text", "inverted"])) :
|
|
4925
|
+
inverted: !K.value
|
|
4926
|
+
}, null, 8, ["text", "inverted"])) : h("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (T(), _("a", {
|
|
4841
4927
|
key: 2,
|
|
4842
4928
|
href: e.issue.actionUrl,
|
|
4843
4929
|
"data-test": "messaging-system-msg-action",
|
|
4844
|
-
class:
|
|
4845
|
-
onClick: s[1] || (s[1] =
|
|
4846
|
-
}, [
|
|
4930
|
+
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"]),
|
|
4931
|
+
onClick: s[1] || (s[1] = I(() => {}, ["stop"]))
|
|
4932
|
+
}, [te(P(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, bi)) : h("", !0)], 2)])], 8, vi)) : e.sender === "system" ? (T(), _("div", {
|
|
4847
4933
|
key: 3,
|
|
4848
4934
|
"data-test": "messaging-system-status-msg",
|
|
4849
4935
|
"data-message-id": e.id,
|
|
@@ -4854,12 +4940,12 @@ var Cr = [
|
|
|
4854
4940
|
"data-issue-code": e.issue?.code,
|
|
4855
4941
|
"data-issue-bucket": e.issue?.bucket,
|
|
4856
4942
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4857
|
-
class:
|
|
4858
|
-
}, [s[22] || (s[22] =
|
|
4943
|
+
class: S(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", K.value ? "text-theme-500" : "text-white/60"])
|
|
4944
|
+
}, [s[22] || (s[22] = v("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b(ii, {
|
|
4859
4945
|
text: e.text,
|
|
4860
|
-
inverted: !
|
|
4861
|
-
onClick: s[2] || (s[2] =
|
|
4862
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
4946
|
+
inverted: !K.value,
|
|
4947
|
+
onClick: s[2] || (s[2] = I(() => {}, ["stop"]))
|
|
4948
|
+
}, null, 8, ["text", "inverted"])], 10, xi)) : (T(), _("div", {
|
|
4863
4949
|
key: 4,
|
|
4864
4950
|
"data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
|
|
4865
4951
|
"data-message-id": e.id,
|
|
@@ -4868,160 +4954,162 @@ var Cr = [
|
|
|
4868
4954
|
"data-message-sequence": e.sequence,
|
|
4869
4955
|
"data-system-kind": e.systemKind,
|
|
4870
4956
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4871
|
-
class:
|
|
4957
|
+
class: S(["flex gap-2 items-end", {
|
|
4872
4958
|
"justify-end": e.sender === "user",
|
|
4873
4959
|
"justify-start": e.sender === "agent",
|
|
4874
|
-
"mb-6": isGroupEnd(
|
|
4960
|
+
"mb-6": isGroupEnd(R.value, t)
|
|
4875
4961
|
}])
|
|
4876
|
-
}, [
|
|
4962
|
+
}, [v("div", {
|
|
4877
4963
|
"data-test": "messaging-message-body",
|
|
4878
|
-
class:
|
|
4879
|
-
}, [blockAttachmentsForMessage(e).length ? (
|
|
4964
|
+
class: S(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0 @sm/chat:pr-[1em] @lg/chat:pr-[2em]")
|
|
4965
|
+
}, [blockAttachmentsForMessage(e).length ? (T(), _("div", {
|
|
4880
4966
|
key: 0,
|
|
4881
|
-
class:
|
|
4882
|
-
}, [(
|
|
4967
|
+
class: S(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
|
|
4968
|
+
}, [(T(!0), _(f, null, A(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (T(), _(f, { key: attachmentKey(e, t) }, [e.type === "image" ? (T(), _("img", {
|
|
4883
4969
|
key: 0,
|
|
4884
4970
|
src: e.src,
|
|
4885
4971
|
alt: e.filename,
|
|
4886
4972
|
"data-test": "messaging-attachment",
|
|
4887
4973
|
"data-attachment-placement": "block",
|
|
4888
4974
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4889
|
-
}, null, 8,
|
|
4975
|
+
}, null, 8, Ci)) : e.type === "audio" ? (T(), _("audio", {
|
|
4890
4976
|
key: 1,
|
|
4891
4977
|
src: e.src,
|
|
4892
4978
|
controls: "",
|
|
4893
4979
|
"data-test": "messaging-attachment",
|
|
4894
4980
|
"data-attachment-placement": "block",
|
|
4895
4981
|
class: "max-w-full"
|
|
4896
|
-
}, null, 8,
|
|
4982
|
+
}, null, 8, wi)) : (T(), _("a", {
|
|
4897
4983
|
key: 2,
|
|
4898
4984
|
href: e.src,
|
|
4899
4985
|
target: "_blank",
|
|
4900
4986
|
rel: "noopener",
|
|
4901
4987
|
"data-test": "messaging-attachment",
|
|
4902
4988
|
"data-attachment-placement": "block",
|
|
4903
|
-
class:
|
|
4904
|
-
}, [s[23] || (s[23] =
|
|
4989
|
+
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"])
|
|
4990
|
+
}, [s[23] || (s[23] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(e.filename), 1)], 10, Ti))], 64))), 128))], 2)) : h("", !0), messageRenderParts(e).length ? (T(), _("div", {
|
|
4905
4991
|
key: 1,
|
|
4906
4992
|
"data-test": "messaging-message-content",
|
|
4907
|
-
class:
|
|
4908
|
-
}, [(
|
|
4993
|
+
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")
|
|
4994
|
+
}, [(T(!0), _(f, null, A(messageRenderParts(e), (t) => (T(), _(f, { key: t.key }, [t.kind === "text" && t.text ? (T(), _("div", Ei, [b(ii, {
|
|
4909
4995
|
text: t.text,
|
|
4910
|
-
inverted: e.sender === "user" || !
|
|
4996
|
+
inverted: e.sender === "user" || !K.value,
|
|
4911
4997
|
streaming: e.id === be.value,
|
|
4912
|
-
onClick: s[3] || (s[3] =
|
|
4998
|
+
onClick: s[3] || (s[3] = I(() => {}, ["stop"])),
|
|
4999
|
+
onAction: handleCardAction
|
|
4913
5000
|
}, null, 8, [
|
|
4914
5001
|
"text",
|
|
4915
5002
|
"inverted",
|
|
4916
5003
|
"streaming"
|
|
4917
|
-
])])) : t.kind === "attachment" && t.attachment.type === "image" ? (
|
|
5004
|
+
])])) : t.kind === "attachment" && t.attachment.type === "image" ? (T(), _("img", {
|
|
4918
5005
|
key: 1,
|
|
4919
5006
|
src: t.attachment.src,
|
|
4920
5007
|
alt: t.attachment.filename,
|
|
4921
5008
|
"data-test": "messaging-attachment",
|
|
4922
5009
|
"data-attachment-placement": t.placement,
|
|
4923
5010
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4924
|
-
}, null, 8,
|
|
5011
|
+
}, null, 8, Di)) : t.kind === "attachment" && t.attachment.type === "audio" ? (T(), _("audio", {
|
|
4925
5012
|
key: 2,
|
|
4926
5013
|
src: t.attachment.src,
|
|
4927
5014
|
controls: "",
|
|
4928
5015
|
"data-test": "messaging-attachment",
|
|
4929
5016
|
"data-attachment-placement": t.placement,
|
|
4930
5017
|
class: "my-2 max-w-full"
|
|
4931
|
-
}, null, 8,
|
|
5018
|
+
}, null, 8, Oi)) : t.kind === "attachment" ? (T(), _("a", {
|
|
4932
5019
|
key: 3,
|
|
4933
5020
|
href: t.attachment.src,
|
|
4934
5021
|
target: "_blank",
|
|
4935
5022
|
rel: "noopener",
|
|
4936
5023
|
"data-test": "messaging-attachment",
|
|
4937
5024
|
"data-attachment-placement": t.placement,
|
|
4938
|
-
class:
|
|
4939
|
-
}, [s[24] || (s[24] =
|
|
4940
|
-
e.id ===
|
|
5025
|
+
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"])
|
|
5026
|
+
}, [s[24] || (s[24] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(t.attachment.filename), 1)], 10, ki)) : h("", !0)], 64))), 128))], 2)) : h("", !0)], 2)], 10, Si)),
|
|
5027
|
+
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
5028
|
key: 0,
|
|
4942
5029
|
"data-test": "messaging-tool-activity",
|
|
4943
5030
|
"data-journal-outcome": e.journal.outcome,
|
|
4944
5031
|
class: "mb-4 w-full"
|
|
4945
5032
|
}, [b(qe, {
|
|
4946
5033
|
model: e.journal,
|
|
4947
|
-
"is-light":
|
|
4948
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5034
|
+
"is-light": K.value
|
|
5035
|
+
}, null, 8, ["model", "is-light"])], 8, Ai)) : e.kind === "text" && e.content ? (T(), _("div", {
|
|
4949
5036
|
key: 1,
|
|
4950
5037
|
"data-test": "messaging-live-text-block",
|
|
4951
|
-
class:
|
|
4952
|
-
}, [b(
|
|
5038
|
+
class: S(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", K.value ? "text-theme-800" : "text-white/95"])
|
|
5039
|
+
}, [b(ii, {
|
|
4953
5040
|
text: e.content,
|
|
4954
|
-
inverted: !
|
|
4955
|
-
streaming: e.id ===
|
|
4956
|
-
onClick: s[4] || (s[4] =
|
|
5041
|
+
inverted: !K.value,
|
|
5042
|
+
streaming: e.id === se.value,
|
|
5043
|
+
onClick: s[4] || (s[4] = I(() => {}, ["stop"])),
|
|
5044
|
+
onAction: handleCardAction
|
|
4957
5045
|
}, null, 8, [
|
|
4958
5046
|
"text",
|
|
4959
5047
|
"inverted",
|
|
4960
5048
|
"streaming"
|
|
4961
|
-
])], 2)) : (
|
|
5049
|
+
])], 2)) : (T(), _("div", ji, [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
5050
|
key: 1,
|
|
4963
5051
|
"data-test": "messaging-tool-activity",
|
|
4964
|
-
"data-journal-outcome":
|
|
5052
|
+
"data-journal-outcome": ve.value.outcome,
|
|
4965
5053
|
class: "mb-4 w-full"
|
|
4966
5054
|
}, [b(qe, {
|
|
4967
|
-
model:
|
|
4968
|
-
"is-light":
|
|
4969
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5055
|
+
model: ve.value,
|
|
5056
|
+
"is-light": K.value
|
|
5057
|
+
}, null, 8, ["model", "is-light"])], 8, Mi)) : h("", !0)], 64)) : h("", !0)
|
|
4970
5058
|
], 64))), 128)),
|
|
4971
|
-
|
|
5059
|
+
z.value ? (T(), _("div", {
|
|
4972
5060
|
key: 1,
|
|
4973
5061
|
"data-test": "messaging-working-state",
|
|
4974
|
-
"data-working-description":
|
|
4975
|
-
class:
|
|
4976
|
-
}, [s[25] || (s[25] =
|
|
5062
|
+
"data-working-description": z.value,
|
|
5063
|
+
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"])
|
|
5064
|
+
}, [s[25] || (s[25] = v("i", {
|
|
4977
5065
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4978
5066
|
"aria-hidden": "true"
|
|
4979
|
-
}, null, -1)),
|
|
4980
|
-
H.value ? (
|
|
5067
|
+
}, null, -1)), v("span", Pi, P(z.value), 1)], 10, Ni)) : h("", !0),
|
|
5068
|
+
H.value ? (T(), _("div", {
|
|
4981
5069
|
key: 2,
|
|
4982
5070
|
"data-test": "messaging-transient-issue",
|
|
4983
5071
|
"data-issue-code": H.value.code,
|
|
4984
|
-
class:
|
|
5072
|
+
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
5073
|
}, [
|
|
4986
|
-
s[26] || (s[26] =
|
|
5074
|
+
s[26] || (s[26] = v("i", {
|
|
4987
5075
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
4988
5076
|
"aria-hidden": "true"
|
|
4989
5077
|
}, null, -1)),
|
|
4990
|
-
|
|
4991
|
-
H.value.actionUrl && H.value.actionLabel ? (
|
|
5078
|
+
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)]),
|
|
5079
|
+
H.value.actionUrl && H.value.actionLabel ? (T(), _("a", {
|
|
4992
5080
|
key: 0,
|
|
4993
5081
|
href: H.value.actionUrl,
|
|
4994
5082
|
class: "shrink-0 underline underline-offset-2",
|
|
4995
|
-
onClick: s[5] || (s[5] =
|
|
4996
|
-
},
|
|
4997
|
-
], 10,
|
|
4998
|
-
U.value ? (
|
|
4999
|
-
class:
|
|
5083
|
+
onClick: s[5] || (s[5] = I(() => {}, ["stop"]))
|
|
5084
|
+
}, P(H.value.actionLabel), 9, Ii)) : h("", !0)
|
|
5085
|
+
], 10, Fi)) : h("", !0),
|
|
5086
|
+
U.value ? (T(), _("div", Li, [v("i", {
|
|
5087
|
+
class: S(["i-svg-spinners-3-dots-bounce size-7", K.value ? "text-theme-400" : "text-white/50"]),
|
|
5000
5088
|
"aria-hidden": "true"
|
|
5001
|
-
}, null, 2)])) :
|
|
5089
|
+
}, null, 2)])) : h("", !0)
|
|
5002
5090
|
], 2)]),
|
|
5003
5091
|
_: 3
|
|
5004
5092
|
}, 8, ["class"]),
|
|
5005
|
-
|
|
5006
|
-
Ee.value.length > 0 ? (
|
|
5093
|
+
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"]]) }, [
|
|
5094
|
+
Ee.value.length > 0 ? (T(), _("div", {
|
|
5007
5095
|
key: 0,
|
|
5008
|
-
class:
|
|
5009
|
-
}, [(
|
|
5096
|
+
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" : ""])
|
|
5097
|
+
}, [(T(!0), _(f, null, A(Ee.value, (e, t) => (T(), _("div", {
|
|
5010
5098
|
key: t,
|
|
5011
5099
|
class: "relative shrink-0 group"
|
|
5012
|
-
}, [e.type === "image" ? (
|
|
5100
|
+
}, [e.type === "image" ? (T(), _("img", {
|
|
5013
5101
|
key: 0,
|
|
5014
5102
|
src: e.src,
|
|
5015
5103
|
alt: e.filename,
|
|
5016
|
-
class:
|
|
5017
|
-
}, null, 10,
|
|
5104
|
+
class: S(["size-14 rounded-xl object-cover border", K.value ? "border-black/10" : "border-white/20"])
|
|
5105
|
+
}, null, 10, Ri)) : (T(), _("div", {
|
|
5018
5106
|
key: 1,
|
|
5019
|
-
class:
|
|
5020
|
-
}, [s[27] || (s[27] =
|
|
5107
|
+
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"])
|
|
5108
|
+
}, [s[27] || (s[27] = v("i", { class: "i-tabler-file size-4" }, null, -1)), v("span", zi, P(e.filename), 1)], 2)), v("button", {
|
|
5021
5109
|
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
5110
|
onClick: (e) => removeAttachment(t)
|
|
5023
|
-
}, [...s[28] || (s[28] = [
|
|
5024
|
-
|
|
5111
|
+
}, [...s[28] || (s[28] = [v("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Bi)]))), 128)), De.value ? (T(), _("div", Vi, [b(_e, { class: "size-5" })])) : h("", !0)], 2)) : h("", !0),
|
|
5112
|
+
G.value ? (T(), _("input", {
|
|
5025
5113
|
key: 1,
|
|
5026
5114
|
ref_key: "fileInput",
|
|
5027
5115
|
ref: o,
|
|
@@ -5029,21 +5117,21 @@ var Cr = [
|
|
|
5029
5117
|
accept: "image/*,audio/*,video/*",
|
|
5030
5118
|
class: "hidden",
|
|
5031
5119
|
onChange: handleFileSelect
|
|
5032
|
-
}, null, 544)) :
|
|
5033
|
-
|
|
5120
|
+
}, null, 544)) : h("", !0),
|
|
5121
|
+
v("div", {
|
|
5034
5122
|
"data-test": "messaging-composer",
|
|
5035
|
-
"data-composer-action":
|
|
5036
|
-
class:
|
|
5123
|
+
"data-composer-action": je.value,
|
|
5124
|
+
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
5125
|
onClick: focusComposer
|
|
5038
|
-
}, [
|
|
5126
|
+
}, [Ie.value ? (T(), _("div", {
|
|
5039
5127
|
key: 1,
|
|
5040
5128
|
"data-test": "messaging-recording-state",
|
|
5041
|
-
class:
|
|
5129
|
+
class: S(["flex min-w-0 items-center gap-2 py-1", K.value ? "text-theme-700" : "text-white/80"])
|
|
5042
5130
|
}, [
|
|
5043
|
-
s[29] || (s[29] =
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
], 2)) :
|
|
5131
|
+
s[29] || (s[29] = v("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5132
|
+
v("span", Wi, P(Le.value), 1),
|
|
5133
|
+
v("span", { class: S(["min-w-0 truncate text-sm", K.value ? "text-theme-400" : "text-white/45"]) }, P(Re.value), 3)
|
|
5134
|
+
], 2)) : pe((T(), _("textarea", {
|
|
5047
5135
|
key: 0,
|
|
5048
5136
|
ref_key: "textarea",
|
|
5049
5137
|
ref: a,
|
|
@@ -5057,77 +5145,77 @@ var Cr = [
|
|
|
5057
5145
|
fontSize: "16px",
|
|
5058
5146
|
resize: "none"
|
|
5059
5147
|
},
|
|
5060
|
-
class:
|
|
5148
|
+
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
5149
|
onKeydown: handleKeydown,
|
|
5062
5150
|
onFocus: s[7] || (s[7] = (e) => r.value = !0),
|
|
5063
5151
|
onBlur: s[8] || (s[8] = (e) => r.value = !1)
|
|
5064
|
-
}, null, 42,
|
|
5065
|
-
|
|
5066
|
-
class:
|
|
5067
|
-
|
|
5068
|
-
|
|
5152
|
+
}, null, 42, Ui)), [[ue, Te.value]]), v("div", Gi, [
|
|
5153
|
+
v("button", {
|
|
5154
|
+
class: S(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
|
|
5155
|
+
G.value ? "cursor-pointer" : "cursor-default",
|
|
5156
|
+
K.value ? "text-theme-500" : "text-white/50",
|
|
5069
5157
|
De.value || ke.value ? "opacity-50 pointer-events-none" : ""
|
|
5070
5158
|
]]),
|
|
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
|
-
|
|
5159
|
+
disabled: W.value || De.value || ke.value || !G.value,
|
|
5160
|
+
"aria-label": G.value ? "Attach file" : "File attachments unavailable",
|
|
5161
|
+
title: G.value ? "Attach file" : "File attachments unavailable",
|
|
5162
|
+
onClick: s[9] || (s[9] = (e) => G.value && triggerFileInput())
|
|
5163
|
+
}, [De.value ? (T(), _("i", qi)) : (T(), _("i", Ji)), v("span", Yi, P(G.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Ki),
|
|
5164
|
+
s[30] || (s[30] = v("div", { class: "flex-1" }, null, -1)),
|
|
5165
|
+
v("div", Xi, [Fe.value || Ie.value ? (T(), _("button", {
|
|
5078
5166
|
key: 0,
|
|
5079
5167
|
"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] =
|
|
5168
|
+
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"]),
|
|
5169
|
+
"aria-label": Be.value,
|
|
5170
|
+
title: Be.value,
|
|
5171
|
+
onPointerdown: s[10] || (s[10] = I((e) => startRecording(), ["prevent"])),
|
|
5172
|
+
onPointerup: s[11] || (s[11] = I((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
|
|
5173
|
+
onPointercancel: s[12] || (s[12] = I((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
|
|
5086
5174
|
onKeydown: [
|
|
5087
|
-
s[13] || (s[13] =
|
|
5088
|
-
s[15] || (s[15] =
|
|
5089
|
-
s[17] || (s[17] =
|
|
5175
|
+
s[13] || (s[13] = he(I((e) => startRecording(), ["prevent"]), ["enter"])),
|
|
5176
|
+
s[15] || (s[15] = he(I((e) => startRecording(), ["prevent"]), ["space"])),
|
|
5177
|
+
s[17] || (s[17] = he(I((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5090
5178
|
],
|
|
5091
|
-
onKeyup: [s[14] || (s[14] =
|
|
5092
|
-
}, [
|
|
5179
|
+
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"]))]
|
|
5180
|
+
}, [v("i", { class: S([Ie.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), v("span", Qi, P(Be.value), 1)], 42, Zi)) : h("", !0), Ie.value ? h("", !0) : (T(), _("button", {
|
|
5093
5181
|
key: 1,
|
|
5094
5182
|
"data-test": "messaging-send-btn",
|
|
5095
|
-
"data-composer-action":
|
|
5096
|
-
class:
|
|
5097
|
-
disabled: !
|
|
5098
|
-
"aria-label":
|
|
5099
|
-
title:
|
|
5183
|
+
"data-composer-action": je.value,
|
|
5184
|
+
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"]),
|
|
5185
|
+
disabled: !Me.value,
|
|
5186
|
+
"aria-label": Ne.value,
|
|
5187
|
+
title: Ne.value,
|
|
5100
5188
|
onClick: s[18] || (s[18] = (e) => handleComposerAction())
|
|
5101
|
-
}, [
|
|
5102
|
-
])], 10,
|
|
5103
|
-
|
|
5189
|
+
}, [je.value === "stop" ? (T(), _("i", ea)) : (T(), _("i", ta)), v("span", na, P(Ne.value), 1)], 10, $i))])
|
|
5190
|
+
])], 10, Hi),
|
|
5191
|
+
R.value.length === 0 && e.suggestedPrompts.length > 0 ? (T(), _("div", ra, [v("div", ia, [(T(!0), _(f, null, A(e.suggestedPrompts, (e, t) => (T(), _("button", {
|
|
5104
5192
|
key: e.id,
|
|
5105
5193
|
type: "button",
|
|
5106
5194
|
disabled: W.value,
|
|
5107
5195
|
"data-test": "messaging-suggested-prompt",
|
|
5108
|
-
class:
|
|
5196
|
+
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
5197
|
onClick: (t) => sendSuggestedPrompt(e)
|
|
5110
|
-
},
|
|
5198
|
+
}, P(e.label), 11, aa))), 128)), e.suggestedPrompts.length > 3 ? (T(), _("button", {
|
|
5111
5199
|
key: 0,
|
|
5112
5200
|
type: "button",
|
|
5113
5201
|
"data-test": "messaging-suggested-prompts-more",
|
|
5114
|
-
"aria-expanded":
|
|
5202
|
+
"aria-expanded": re.value,
|
|
5115
5203
|
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
|
-
}, [
|
|
5204
|
+
onClick: s[19] || (s[19] = (e) => re.value = !re.value)
|
|
5205
|
+
}, [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, oa)) : h("", !0)])])) : h("", !0)
|
|
5118
5206
|
], 2)
|
|
5119
5207
|
], 2));
|
|
5120
5208
|
}
|
|
5121
|
-
}),
|
|
5209
|
+
}), ca = { class: "agent-wrap" }, la = {
|
|
5122
5210
|
key: 0,
|
|
5123
5211
|
class: "flex items-center justify-center h-full"
|
|
5124
|
-
},
|
|
5212
|
+
}, ua = {
|
|
5125
5213
|
key: 2,
|
|
5126
5214
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5127
5215
|
role: "status",
|
|
5128
5216
|
"aria-live": "polite",
|
|
5129
5217
|
"data-test": "agent-unavailable"
|
|
5130
|
-
},
|
|
5218
|
+
}, da = /* @__PURE__ */ x({
|
|
5131
5219
|
__name: "AgentWrap",
|
|
5132
5220
|
props: {
|
|
5133
5221
|
sdk: {},
|
|
@@ -5147,7 +5235,7 @@ var Cr = [
|
|
|
5147
5235
|
let r = a("AgentWrap"), i = e, o = i.sdk || t.getInstance({
|
|
5148
5236
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
5149
5237
|
...i.apiBase && { apiBase: i.apiBase }
|
|
5150
|
-
}), s =
|
|
5238
|
+
}), s = se(!i.agent), c = se(i.agent ? new n({ config: i.agent }) : void 0), u = se();
|
|
5151
5239
|
async function loadAgent() {
|
|
5152
5240
|
if (i.agent) {
|
|
5153
5241
|
r.debug("Agent provided via props, skipping fetch", {
|
|
@@ -5223,23 +5311,23 @@ var Cr = [
|
|
|
5223
5311
|
});
|
|
5224
5312
|
}
|
|
5225
5313
|
}
|
|
5226
|
-
return
|
|
5227
|
-
sdk:
|
|
5314
|
+
return ie(loadAgent), (t, n) => (T(), _("div", ca, [s.value ? (T(), _("div", la, [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", {
|
|
5315
|
+
sdk: ce(o),
|
|
5228
5316
|
agent: c.value,
|
|
5229
5317
|
context: e.clientContext ?? e.context,
|
|
5230
5318
|
firstMessage: e.firstMessage,
|
|
5231
5319
|
buttonText: e.buttonText,
|
|
5232
5320
|
buttonIcon: e.buttonIcon,
|
|
5233
5321
|
loading: s.value
|
|
5234
|
-
}, void 0, void 0, 1) : u.value ? (
|
|
5322
|
+
}, void 0, void 0, 1) : u.value ? (T(), _("div", ua, [n[0] || (n[0] = v("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), v("button", {
|
|
5235
5323
|
type: "button",
|
|
5236
5324
|
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
5325
|
"data-test": "agent-unavailable-retry",
|
|
5238
5326
|
onClick: loadAgent
|
|
5239
|
-
}, " Try again ")])) :
|
|
5327
|
+
}, " Try again ")])) : h("", !0)]));
|
|
5240
5328
|
}
|
|
5241
5329
|
});
|
|
5242
5330
|
//#endregion
|
|
5243
|
-
export {
|
|
5331
|
+
export { ke as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, sa as n, De as o, n as p, ii as r, Te as s, da as t, parseButtonTemplate as u };
|
|
5244
5332
|
|
|
5245
5333
|
//# sourceMappingURL=AgentWrap.js.map
|