@pagelines/sdk 1.0.701 → 1.0.703
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 +375 -391
- package/dist/AgentWrap.js.map +1 -1
- package/dist/contract.js +2 -2
- package/dist/contract.js.map +1 -1
- package/package.json +1 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -3,10 +3,10 @@ import { s as e, t } from "./sdkClient.js";
|
|
|
3
3
|
import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatVisualFencePayload as c } from "@pagelines/core";
|
|
4
4
|
import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as A, renderList as j, renderSlot as ie, resolveDynamicComponent as ae, shallowRef as P, toDisplayString as F, unref as oe, vModelText as I, watch as se, withCtx as ce, withDirectives as R, withKeys as ue, withModifiers as z } from "vue";
|
|
5
5
|
//#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var de = { class: "spinner max-w-sm" },
|
|
6
|
+
var de = { class: "spinner max-w-sm" }, B = {
|
|
7
7
|
class: "ring-circular h-full w-full origin-center",
|
|
8
8
|
viewBox: "25 25 50 50"
|
|
9
|
-
},
|
|
9
|
+
}, pe = /* @__PURE__ */ x({
|
|
10
10
|
__name: "FSpinner",
|
|
11
11
|
props: {
|
|
12
12
|
width: {
|
|
@@ -19,7 +19,7 @@ var de = { class: "spinner max-w-sm" }, pe = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
setup(e) {
|
|
22
|
-
return (t, n) => (k(), h("div", de, [(k(), h("svg",
|
|
22
|
+
return (t, n) => (k(), h("div", de, [(k(), h("svg", B, [_("circle", {
|
|
23
23
|
class: C([e.colorMode, "ring-path"]),
|
|
24
24
|
cx: "50",
|
|
25
25
|
cy: "50",
|
|
@@ -30,7 +30,7 @@ var de = { class: "spinner max-w-sm" }, pe = {
|
|
|
30
30
|
"stroke-miterlimit": "30"
|
|
31
31
|
}, null, 2)]))]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), he = [
|
|
34
34
|
{
|
|
35
35
|
mode: "self",
|
|
36
36
|
label: "Overview",
|
|
@@ -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 _e = {
|
|
189
189
|
waiting: "Waiting for results",
|
|
190
190
|
finishing: "Finishing up",
|
|
191
191
|
completed: "Work complete",
|
|
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
|
|
|
247
247
|
terminal: {
|
|
248
248
|
id: "work-complete",
|
|
249
249
|
tone: "completed",
|
|
250
|
-
label:
|
|
250
|
+
label: _e.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: _e.failed,
|
|
265
265
|
...o && e?.note ? { note: e.note } : {}
|
|
266
266
|
}
|
|
267
267
|
};
|
|
@@ -275,7 +275,7 @@ function buildWorkJournalModel(e) {
|
|
|
275
275
|
terminal: {
|
|
276
276
|
id: "work-stopped",
|
|
277
277
|
tone: "stopped",
|
|
278
|
-
label:
|
|
278
|
+
label: _e.stopped
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
281
|
}
|
|
@@ -285,8 +285,8 @@ function buildWorkJournalModel(e) {
|
|
|
285
285
|
}, Infinity), h = p + ve, _ = (Number.isFinite(m) ? m : p) + ye, v = r >= h, b = u || v ? {
|
|
286
286
|
id: u?.activityId ?? "work-active",
|
|
287
287
|
tone: "active",
|
|
288
|
-
label: v ? u ?
|
|
289
|
-
} : void 0, x = v && r >= _ ? i ?
|
|
288
|
+
label: v ? u ? _e.waiting : _e.finishing : u.label
|
|
289
|
+
} : void 0, x = v && r >= _ ? i ? _e.notifyHint : _e.leaveHint : void 0, S = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
|
|
290
290
|
return {
|
|
291
291
|
outcome: n,
|
|
292
292
|
visibleRows: s,
|
|
@@ -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 Ce = {
|
|
953
953
|
key: 0,
|
|
954
954
|
class: "absolute inset-0 flex items-center justify-center"
|
|
955
|
-
},
|
|
955
|
+
}, we = /* @__PURE__ */ x({
|
|
956
956
|
__name: "ElAgentButton",
|
|
957
957
|
props: {
|
|
958
958
|
theme: { default: "primary" },
|
|
@@ -980,7 +980,7 @@ var G = {
|
|
|
980
980
|
md: "size-4",
|
|
981
981
|
lg: "size-5"
|
|
982
982
|
})[e.size]);
|
|
983
|
-
return (i, a) => (k(), h("button", { class: C(["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 ? (k(), h("div",
|
|
983
|
+
return (i, a) => (k(), h("button", { class: C(["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 ? (k(), h("div", Ce, [...a[0] || (a[0] = [_("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : m("", !0), _("span", { class: C(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
|
|
984
984
|
e.icon ? (k(), h("i", {
|
|
985
985
|
key: 0,
|
|
986
986
|
class: C([e.icon, r.value])
|
|
@@ -992,7 +992,7 @@ var G = {
|
|
|
992
992
|
}, null, 2)) : m("", !0)
|
|
993
993
|
], 2)], 2));
|
|
994
994
|
}
|
|
995
|
-
}),
|
|
995
|
+
}), Te = ["value"], Ee = /* @__PURE__ */ x({
|
|
996
996
|
__name: "AgentInputEmail",
|
|
997
997
|
props: { modelValue: { default: "" } },
|
|
998
998
|
emits: ["update:modelValue"],
|
|
@@ -1011,9 +1011,9 @@ var G = {
|
|
|
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, Te));
|
|
1015
1015
|
}
|
|
1016
|
-
}),
|
|
1016
|
+
}), De = ["placeholder", "value"], Oe = /* @__PURE__ */ x({
|
|
1017
1017
|
__name: "AgentInputOneTimeCode",
|
|
1018
1018
|
props: {
|
|
1019
1019
|
modelValue: {},
|
|
@@ -1046,12 +1046,12 @@ var G = {
|
|
|
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, De));
|
|
1050
1050
|
}
|
|
1051
|
-
}),
|
|
1051
|
+
}), ke = { 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({
|
|
1055
1055
|
__name: "ElModeHeader",
|
|
1056
1056
|
props: {
|
|
1057
1057
|
agent: {},
|
|
@@ -1063,17 +1063,17 @@ var G = {
|
|
|
1063
1063
|
layout: { default: "centered" }
|
|
1064
1064
|
},
|
|
1065
1065
|
setup(e) {
|
|
1066
|
-
return (t, n) => (k(), h("div", { class: C(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [_("div",
|
|
1066
|
+
return (t, n) => (k(), h("div", { class: C(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [_("div", ke, [_("div", { class: C(["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"]) }, [_("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
1070
|
onError: n[0] || (n[0] = (...e) => oe(handleImageError) && oe(handleImageError)(...e))
|
|
1071
|
-
}, null, 40,
|
|
1071
|
+
}, null, 40, Ae)], 2), _("div", je, [e.isOnline ? (k(), h(u, { key: 0 }, [n[1] || (n[1] = _("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] = _("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (k(), h("div",
|
|
1074
|
+
}, null, -1)), n[2] || (n[2] = _("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (k(), h("div", Me))])]), _("div", Ne, [_("h1", { class: C(["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" : ""]]) }, F(e.agent.displayName.value), 3), _("p", { class: C(["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"]]) }, F(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",
|
|
1078
1078
|
props: {
|
|
1079
1079
|
agent: {},
|
|
@@ -1101,25 +1101,25 @@ var G = {
|
|
|
1101
1101
|
top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
|
|
1102
1102
|
right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
|
|
1103
1103
|
}, i = f(() => e.isLight ? "ring-white" : "ring-theme-900");
|
|
1104
|
-
return (t, a) => (k(), h("div",
|
|
1104
|
+
return (t, a) => (k(), h("div", Fe, [
|
|
1105
1105
|
_("img", {
|
|
1106
1106
|
src: e.agent.avatarUrl.value,
|
|
1107
1107
|
alt: e.agent.displayName.value,
|
|
1108
1108
|
class: C(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
|
|
1109
|
-
}, null, 10,
|
|
1109
|
+
}, null, 10, Ie),
|
|
1110
1110
|
e.agent.ownerMarkUrl.value ? (k(), h("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
1114
|
class: C(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
|
|
1115
|
-
}, null, 10,
|
|
1115
|
+
}, null, 10, Le)) : m("", !0),
|
|
1116
1116
|
n.value ? (k(), h("span", {
|
|
1117
1117
|
key: 1,
|
|
1118
1118
|
role: "status",
|
|
1119
1119
|
"aria-label": e.agent.state.value.tooltip,
|
|
1120
1120
|
class: C(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
|
|
1121
1121
|
style: r
|
|
1122
|
-
}, null, 10,
|
|
1122
|
+
}, null, 10, Re)) : m("", !0),
|
|
1123
1123
|
n.value && e.agent.state.value.lifecycle === "running" ? (k(), h("span", {
|
|
1124
1124
|
key: 2,
|
|
1125
1125
|
"aria-hidden": "true",
|
|
@@ -1128,21 +1128,21 @@ var G = {
|
|
|
1128
1128
|
}, null, 2)) : m("", !0)
|
|
1129
1129
|
]));
|
|
1130
1130
|
}
|
|
1131
|
-
}),
|
|
1131
|
+
}), Be = {
|
|
1132
1132
|
key: 0,
|
|
1133
1133
|
class: "sr-only",
|
|
1134
1134
|
role: "status",
|
|
1135
1135
|
"aria-live": "polite"
|
|
1136
|
-
},
|
|
1136
|
+
}, Ve = ["aria-expanded", "disabled"], G = ["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 = {
|
|
1140
1140
|
class: "flex w-5 shrink-0 flex-col items-center self-stretch",
|
|
1141
1141
|
"aria-hidden": "true"
|
|
1142
|
-
}, Ge = { class: "flex h-[17px] shrink-0 items-center" },
|
|
1142
|
+
}, Ge = { class: "flex h-[17px] shrink-0 items-center" }, Ke = {
|
|
1143
1143
|
key: 0,
|
|
1144
1144
|
class: "sr-only"
|
|
1145
|
-
},
|
|
1145
|
+
}, qe = /* @__PURE__ */ x({
|
|
1146
1146
|
__name: "AgentToolActivityGroup",
|
|
1147
1147
|
props: {
|
|
1148
1148
|
model: {},
|
|
@@ -1220,7 +1220,7 @@ var G = {
|
|
|
1220
1220
|
};
|
|
1221
1221
|
});
|
|
1222
1222
|
return (t, f) => (k(), h("div", { class: C(["w-full py-0.5", s.value.muted]) }, [
|
|
1223
|
-
a.value ? (k(), h("span",
|
|
1223
|
+
a.value ? (k(), h("span", Be, F(a.value), 1)) : m("", !0),
|
|
1224
1224
|
r.value ? (k(), h("button", {
|
|
1225
1225
|
key: 1,
|
|
1226
1226
|
type: "button",
|
|
@@ -1242,7 +1242,7 @@ var G = {
|
|
|
1242
1242
|
class: C(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
|
|
1243
1243
|
"aria-hidden": "true"
|
|
1244
1244
|
}, null, 2)) : m("", !0)
|
|
1245
|
-
], 10,
|
|
1245
|
+
], 10, Ve)) : i.value ? (k(), h("button", {
|
|
1246
1246
|
key: 2,
|
|
1247
1247
|
type: "button",
|
|
1248
1248
|
"data-test": "messaging-tool-activity-summary",
|
|
@@ -1256,7 +1256,7 @@ var G = {
|
|
|
1256
1256
|
}, null, 2)]), _("span", { class: C(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [v(F(i.value) + " earlier updates ", 1), _("i", {
|
|
1257
1257
|
class: C(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1258
1258
|
"aria-hidden": "true"
|
|
1259
|
-
}, null, 2)], 2)], 10,
|
|
1259
|
+
}, null, 2)], 2)], 10, G)) : m("", !0),
|
|
1260
1260
|
(k(!0), h(u, null, j(o.value, (e, t) => (k(), h("div", {
|
|
1261
1261
|
key: e.id,
|
|
1262
1262
|
"data-test": "messaging-tool-activity-row",
|
|
@@ -1268,7 +1268,7 @@ var G = {
|
|
|
1268
1268
|
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? m("", !0) : (k(), h("span", {
|
|
1269
1269
|
key: 0,
|
|
1270
1270
|
class: C(["w-px flex-1", s.value.spine])
|
|
1271
|
-
}, null, 2))]), _("div", { class: C(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [_("span", { class: C(["relative block leading-snug", c.value[e.tone].label]) }, [v(F(e.label), 1), c.value[e.tone].statusWord ? (k(), h("span",
|
|
1271
|
+
}, null, 2))]), _("div", { class: C(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [_("span", { class: C(["relative block leading-snug", c.value[e.tone].label]) }, [v(F(e.label), 1), c.value[e.tone].statusWord ? (k(), h("span", Ke, ", " + F(c.value[e.tone].statusWord), 1)) : m("", !0)], 2), e.note ? (k(), h("p", {
|
|
1272
1272
|
key: 0,
|
|
1273
1273
|
class: C(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
|
|
1274
1274
|
}, F(e.note), 3)) : m("", !0)], 2)], 10, Ue))), 128)),
|
|
@@ -1321,86 +1321,86 @@ 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
|
|
1325
|
-
|
|
1324
|
+
var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, K = Object.freeze, q = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
|
|
1325
|
+
K || (K = function freeze(e) {
|
|
1326
1326
|
return e;
|
|
1327
|
-
}),
|
|
1327
|
+
}), q || (q = function seal(e) {
|
|
1328
1328
|
return e;
|
|
1329
|
-
}),
|
|
1329
|
+
}), tt || (tt = function apply(e, t) {
|
|
1330
1330
|
var n = [...arguments].slice(2);
|
|
1331
1331
|
return e.apply(t, n);
|
|
1332
|
-
}),
|
|
1332
|
+
}), nt || (nt = function construct(e) {
|
|
1333
1333
|
return new e(...[...arguments].slice(1));
|
|
1334
1334
|
});
|
|
1335
|
-
var
|
|
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), J = unapply(Object.prototype.hasOwnProperty), bt = unapply(Object.prototype.toString), X = 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);
|
|
1339
1339
|
var n = [...arguments].slice(1);
|
|
1340
|
-
return
|
|
1340
|
+
return tt(e, t, n);
|
|
1341
1341
|
};
|
|
1342
1342
|
}
|
|
1343
1343
|
function unconstruct(e) {
|
|
1344
1344
|
return function() {
|
|
1345
|
-
return
|
|
1345
|
+
return nt(e, [...arguments]);
|
|
1346
1346
|
};
|
|
1347
1347
|
}
|
|
1348
1348
|
function addToSet(e, t) {
|
|
1349
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1350
|
-
if (
|
|
1349
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ut;
|
|
1350
|
+
if (Ye && Ye(e, null), !lt(t)) return e;
|
|
1351
1351
|
let r = t.length;
|
|
1352
1352
|
for (; r--;) {
|
|
1353
1353
|
let i = t[r];
|
|
1354
1354
|
if (typeof i == "string") {
|
|
1355
1355
|
let e = n(i);
|
|
1356
|
-
e !== i && (
|
|
1356
|
+
e !== i && (Xe(t) || (t[r] = e), i = e);
|
|
1357
1357
|
}
|
|
1358
1358
|
e[i] = !0;
|
|
1359
1359
|
}
|
|
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++) J(e, t) || (e[t] = null);
|
|
1364
1364
|
return e;
|
|
1365
1365
|
}
|
|
1366
1366
|
function clone(e) {
|
|
1367
|
-
let t =
|
|
1368
|
-
for (let r of
|
|
1367
|
+
let t = $e(null);
|
|
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
|
+
J(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
|
}
|
|
1375
1375
|
function stringifyValue(e) {
|
|
1376
1376
|
switch (typeof e) {
|
|
1377
1377
|
case "string": return e;
|
|
1378
|
-
case "number": return
|
|
1379
|
-
case "boolean": return
|
|
1380
|
-
case "bigint": return
|
|
1381
|
-
case "symbol": return
|
|
1382
|
-
case "undefined": return
|
|
1378
|
+
case "number": return gt(e);
|
|
1379
|
+
case "boolean": return _t(e);
|
|
1380
|
+
case "bigint": return vt ? vt(e) : "0";
|
|
1381
|
+
case "symbol": return yt ? yt(e) : "Symbol()";
|
|
1382
|
+
case "undefined": return bt(e);
|
|
1383
1383
|
case "function":
|
|
1384
1384
|
case "object": {
|
|
1385
|
-
if (e === null) return
|
|
1385
|
+
if (e === null) return bt(e);
|
|
1386
1386
|
let t = e, n = lookupGetter(t, "toString");
|
|
1387
1387
|
if (typeof n == "function") {
|
|
1388
1388
|
let e = n(t);
|
|
1389
|
-
return typeof e == "string" ? e :
|
|
1389
|
+
return typeof e == "string" ? e : bt(e);
|
|
1390
1390
|
}
|
|
1391
|
-
return
|
|
1391
|
+
return bt(e);
|
|
1392
1392
|
}
|
|
1393
|
-
default: return
|
|
1393
|
+
default: return bt(e);
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
1396
|
function lookupGetter(e, t) {
|
|
1397
1397
|
for (; e !== null;) {
|
|
1398
|
-
let n =
|
|
1398
|
+
let n = Qe(e, t);
|
|
1399
1399
|
if (n) {
|
|
1400
1400
|
if (n.get) return unapply(n.get);
|
|
1401
1401
|
if (typeof n.value == "function") return unapply(n.value);
|
|
1402
1402
|
}
|
|
1403
|
-
e =
|
|
1403
|
+
e = Ze(e);
|
|
1404
1404
|
}
|
|
1405
1405
|
function fallbackValue() {
|
|
1406
1406
|
return null;
|
|
@@ -1409,12 +1409,12 @@ function lookupGetter(e, t) {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
function isRegex(e) {
|
|
1411
1411
|
try {
|
|
1412
|
-
return
|
|
1412
|
+
return X(e, ""), !0;
|
|
1413
1413
|
} catch {
|
|
1414
1414
|
return !1;
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
var
|
|
1417
|
+
var St = K(/* @__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 = K(/* @__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 = K([
|
|
1418
1418
|
"feBlend",
|
|
1419
1419
|
"feColorMatrix",
|
|
1420
1420
|
"feComponentTransfer",
|
|
@@ -1440,7 +1440,7 @@ var xt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1440
1440
|
"feSpotLight",
|
|
1441
1441
|
"feTile",
|
|
1442
1442
|
"feTurbulence"
|
|
1443
|
-
]),
|
|
1443
|
+
]), Tt = K([
|
|
1444
1444
|
"animate",
|
|
1445
1445
|
"color-profile",
|
|
1446
1446
|
"cursor",
|
|
@@ -1463,7 +1463,7 @@ var xt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1463
1463
|
"solidcolor",
|
|
1464
1464
|
"unknown",
|
|
1465
1465
|
"use"
|
|
1466
|
-
]),
|
|
1466
|
+
]), Et = K(/* @__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 = K([
|
|
1467
1467
|
"maction",
|
|
1468
1468
|
"maligngroup",
|
|
1469
1469
|
"malignmark",
|
|
@@ -1479,13 +1479,13 @@ var xt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1479
1479
|
"annotation-xml",
|
|
1480
1480
|
"mprescripts",
|
|
1481
1481
|
"none"
|
|
1482
|
-
]),
|
|
1482
|
+
]), Ot = K(["#text"]), kt = K(/* @__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 = K(/* @__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 = K(/* @__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 = K([
|
|
1483
1483
|
"xlink:href",
|
|
1484
1484
|
"xml:id",
|
|
1485
1485
|
"xlink:title",
|
|
1486
1486
|
"xml:space",
|
|
1487
1487
|
"xmlns:xlink"
|
|
1488
|
-
]),
|
|
1488
|
+
]), Nt = q(/{{[\w\W]*|^[\w\W]*}}/g), Pt = q(/<%[\w\W]*|^[\w\W]*%>/g), Ft = q(/\${[\w\W]*/g), It = q(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lt = q(/^aria-[\-\w]+$/), Rt = q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zt = q(/^(?:\w+script|data):/i), Bt = q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vt = q(/^html$/i), Ht = q(/^[a-z][.\w]*(-[.\w]+)+$/i), Ut = q(/<[/\w!]/g), Wt = q(/<[/\w]/g), Gt = q(/<\/no(script|embed|frames)/i), Kt = q(/\/>/i), qt = {
|
|
1489
1489
|
element: 1,
|
|
1490
1490
|
attribute: 2,
|
|
1491
1491
|
text: 3,
|
|
@@ -1498,9 +1498,9 @@ var xt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1498
1498
|
documentType: 10,
|
|
1499
1499
|
documentFragment: 11,
|
|
1500
1500
|
notation: 12
|
|
1501
|
-
},
|
|
1501
|
+
}, Jt = function getGlobal() {
|
|
1502
1502
|
return typeof window > "u" ? null : window;
|
|
1503
|
-
},
|
|
1503
|
+
}, Yt = function _createTrustedTypesPolicy(e, t) {
|
|
1504
1504
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
1505
1505
|
let n = null, r = "data-tt-policy-suffix";
|
|
1506
1506
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -1517,7 +1517,7 @@ var xt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1517
1517
|
} catch {
|
|
1518
1518
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
1519
1519
|
}
|
|
1520
|
-
},
|
|
1520
|
+
}, Xt = function _createHooksMap() {
|
|
1521
1521
|
return {
|
|
1522
1522
|
afterSanitizeAttributes: [],
|
|
1523
1523
|
afterSanitizeElements: [],
|
|
@@ -1529,12 +1529,12 @@ var xt = q(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1529
1529
|
uponSanitizeElement: [],
|
|
1530
1530
|
uponSanitizeShadowNode: []
|
|
1531
1531
|
};
|
|
1532
|
-
},
|
|
1533
|
-
return
|
|
1532
|
+
}, Zt = function _resolveSetOption(e, t, n, r) {
|
|
1533
|
+
return J(e, t) && lt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1534
1534
|
};
|
|
1535
1535
|
function createDOMPurify() {
|
|
1536
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1537
|
-
if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !==
|
|
1536
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jt(), DOMPurify = (e) => createDOMPurify(e);
|
|
1537
|
+
if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== qt.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
|
|
1538
1538
|
let t = e.document, n = t, r = n.currentScript;
|
|
1539
1539
|
e.DocumentFragment;
|
|
1540
1540
|
let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
|
|
@@ -1545,7 +1545,7 @@ function createDOMPurify() {
|
|
|
1545
1545
|
e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
|
|
1546
1546
|
}
|
|
1547
1547
|
let T, te = "", ne, re = !1, k = 0, A = function _assertNotInTrustedTypesPolicy() {
|
|
1548
|
-
if (k > 0) throw
|
|
1548
|
+
if (k > 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
1549
|
}, j = function _createTrustedHTML(e) {
|
|
1550
1550
|
A(), k++;
|
|
1551
1551
|
try {
|
|
@@ -1561,21 +1561,21 @@ function createDOMPurify() {
|
|
|
1561
1561
|
k--;
|
|
1562
1562
|
}
|
|
1563
1563
|
}, ae = function _getDefaultTrustedTypesPolicy() {
|
|
1564
|
-
return re || (ne =
|
|
1565
|
-
}, P = t, F = P.implementation, oe = P.createNodeIterator, I = P.createDocumentFragment, se = P.getElementsByTagName, ce = n.importNode, R =
|
|
1566
|
-
DOMPurify.isSupported = typeof
|
|
1567
|
-
let ue =
|
|
1568
|
-
...xt,
|
|
1564
|
+
return re || (ne = Yt(u, r), re = !0), ne;
|
|
1565
|
+
}, P = t, F = P.implementation, oe = P.createNodeIterator, I = P.createDocumentFragment, se = P.getElementsByTagName, ce = n.importNode, R = Xt();
|
|
1566
|
+
DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && F && F.createHTMLDocument !== void 0;
|
|
1567
|
+
let ue = Nt, z = Pt, de = Ft, B = It, pe = Lt, he = zt, _e = Bt, ve = Ht, ye = Rt, H = null, be = addToSet({}, [
|
|
1569
1568
|
...St,
|
|
1570
1569
|
...Ct,
|
|
1571
|
-
...
|
|
1572
|
-
...
|
|
1570
|
+
...wt,
|
|
1571
|
+
...Et,
|
|
1572
|
+
...Ot
|
|
1573
1573
|
]), U = null, Se = addToSet({}, [
|
|
1574
|
-
...Ot,
|
|
1575
1574
|
...kt,
|
|
1576
1575
|
...At,
|
|
1577
|
-
...jt
|
|
1578
|
-
|
|
1576
|
+
...jt,
|
|
1577
|
+
...Mt
|
|
1578
|
+
]), W = Object.seal($e(null, {
|
|
1579
1579
|
tagNameCheck: {
|
|
1580
1580
|
writable: !0,
|
|
1581
1581
|
configurable: !1,
|
|
@@ -1594,7 +1594,7 @@ function createDOMPurify() {
|
|
|
1594
1594
|
enumerable: !0,
|
|
1595
1595
|
value: !1
|
|
1596
1596
|
}
|
|
1597
|
-
})),
|
|
1597
|
+
})), Ce = null, we = null, Te = Object.seal($e(null, {
|
|
1598
1598
|
tagCheck: {
|
|
1599
1599
|
writable: !0,
|
|
1600
1600
|
configurable: !1,
|
|
@@ -1607,14 +1607,14 @@ function createDOMPurify() {
|
|
|
1607
1607
|
enumerable: !0,
|
|
1608
1608
|
value: null
|
|
1609
1609
|
}
|
|
1610
|
-
})),
|
|
1610
|
+
})), Ee = !0, De = !0, Oe = !1, ke = !0, Ae = !1, je = !0, Me = !1, Ne = !1, Pe = null, Fe = null, Ie = !1, Le = !1, Re = !1, ze = !1, Be = !0, Ve = !1, G = "user-content-", He = !0, Ue = !1, We = {}, Ge = null, Ke = 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(".")), qe = null, Ye = addToSet({}, [
|
|
1611
1611
|
"audio",
|
|
1612
1612
|
"video",
|
|
1613
1613
|
"img",
|
|
1614
1614
|
"source",
|
|
1615
1615
|
"image",
|
|
1616
1616
|
"track"
|
|
1617
|
-
]),
|
|
1617
|
+
]), Xe = null, Ze = addToSet({}, [
|
|
1618
1618
|
"alt",
|
|
1619
1619
|
"class",
|
|
1620
1620
|
"for",
|
|
@@ -1629,42 +1629,42 @@ function createDOMPurify() {
|
|
|
1629
1629
|
"value",
|
|
1630
1630
|
"style",
|
|
1631
1631
|
"xmlns"
|
|
1632
|
-
]),
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
],
|
|
1632
|
+
]), Qe = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", tt = "http://www.w3.org/1999/xhtml", nt = tt, gt = !1, _t = null, vt = addToSet({}, [
|
|
1633
|
+
Qe,
|
|
1634
|
+
et,
|
|
1635
|
+
tt
|
|
1636
|
+
], dt), yt = K([
|
|
1637
1637
|
"mi",
|
|
1638
1638
|
"mo",
|
|
1639
1639
|
"mn",
|
|
1640
1640
|
"ms",
|
|
1641
1641
|
"mtext"
|
|
1642
|
-
]),
|
|
1642
|
+
]), bt = addToSet({}, yt), Qt = K(["annotation-xml"]), $t = addToSet({}, Qt), en = addToSet({}, [
|
|
1643
1643
|
"title",
|
|
1644
1644
|
"style",
|
|
1645
1645
|
"font",
|
|
1646
1646
|
"a",
|
|
1647
1647
|
"script"
|
|
1648
|
-
]),
|
|
1648
|
+
]), tn = null, Z = ["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), tn = Z.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = tn === "application/xhtml+xml" ? dt : ut, H = Zt(e, "ALLOWED_TAGS", be, { transform: Q }), U = Zt(e, "ALLOWED_ATTR", Se, { transform: Q }), _t = Zt(e, "ALLOWED_NAMESPACES", vt, { transform: dt }), Xe = Zt(e, "ADD_URI_SAFE_ATTR", Ze, {
|
|
1654
1654
|
transform: Q,
|
|
1655
|
-
base:
|
|
1656
|
-
}),
|
|
1655
|
+
base: Ze
|
|
1656
|
+
}), qe = Zt(e, "ADD_DATA_URI_TAGS", Ye, {
|
|
1657
1657
|
transform: Q,
|
|
1658
|
-
base:
|
|
1659
|
-
}), Ge =
|
|
1660
|
-
let t =
|
|
1661
|
-
if (W =
|
|
1658
|
+
base: Ye
|
|
1659
|
+
}), Ge = Zt(e, "FORBID_CONTENTS", Ke, { transform: Q }), Ce = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), we = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), We = J(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, Ae = e.SAFE_FOR_TEMPLATES || !1, je = e.SAFE_FOR_XML !== !1, Me = e.WHOLE_DOCUMENT || !1, Le = e.RETURN_DOM || !1, Re = e.RETURN_DOM_FRAGMENT || !1, ze = e.RETURN_TRUSTED_TYPE || !1, Ie = e.FORCE_BODY || !1, Be = e.SANITIZE_DOM !== !1, Ve = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, ye = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, nt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : tt, bt = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, yt), $t = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, Qt);
|
|
1660
|
+
let t = J(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), J(t, "tagNameCheck") && an(t.tagNameCheck) && (W.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && an(t.attributeNameCheck) && (W.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), q(W), Ae && (De = !1), Re && (Le = !0), We && (H = addToSet({}, Ot), U = $e(null), We.html === !0 && (addToSet(H, St), addToSet(U, kt)), We.svg === !0 && (addToSet(H, Ct), addToSet(U, At), addToSet(U, Mt)), We.svgFilters === !0 && (addToSet(H, wt), addToSet(U, At), addToSet(U, Mt)), We.mathMl === !0 && (addToSet(H, Et), addToSet(U, jt), addToSet(U, Mt))), Te.tagCheck = null, Te.attributeCheck = null, J(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))), J(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))), J(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(Xe, e.ADD_URI_SAFE_ATTR, Q), J(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.FORBID_CONTENTS, Q)), J(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.ADD_FORBID_CONTENTS, Q)), He && (H["#text"] = !0), Me && addToSet(H, [
|
|
1662
1662
|
"html",
|
|
1663
1663
|
"head",
|
|
1664
1664
|
"body"
|
|
1665
|
-
]), H.table && (addToSet(H, ["tbody"]), delete
|
|
1666
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
1667
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
1665
|
+
]), H.table && (addToSet(H, ["tbody"]), delete Ce.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1666
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1667
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1668
1668
|
let t = T;
|
|
1669
1669
|
T = e.TRUSTED_TYPES_POLICY;
|
|
1670
1670
|
try {
|
|
@@ -1673,40 +1673,40 @@ function createDOMPurify() {
|
|
|
1673
1673
|
throw T = t, e;
|
|
1674
1674
|
}
|
|
1675
1675
|
} else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, te = "") : (T === void 0 && (T = ae()), T && typeof te == "string" && (te = j("")));
|
|
1676
|
-
|
|
1676
|
+
K && K(e), nn = e;
|
|
1677
1677
|
}, sn = addToSet({}, [
|
|
1678
|
-
...St,
|
|
1679
1678
|
...Ct,
|
|
1680
|
-
...wt
|
|
1681
|
-
|
|
1682
|
-
|
|
1679
|
+
...wt,
|
|
1680
|
+
...Tt
|
|
1681
|
+
]), cn = addToSet({}, [...Et, ...Dt]), ln = function _checkSvgNamespace(e, t, n) {
|
|
1682
|
+
return t.namespaceURI === tt ? e === "svg" : t.namespaceURI === Qe ? e === "svg" && (n === "annotation-xml" || bt[n]) : !!sn[e];
|
|
1683
1683
|
}, un = function _checkMathMlNamespace(e, t, n) {
|
|
1684
|
-
return t.namespaceURI ===
|
|
1684
|
+
return t.namespaceURI === tt ? e === "math" : t.namespaceURI === et ? e === "math" && $t[n] : !!cn[e];
|
|
1685
1685
|
}, dn = function _checkHtmlNamespace(e, t, n) {
|
|
1686
|
-
return t.namespaceURI ===
|
|
1686
|
+
return t.namespaceURI === et && !$t[n] || t.namespaceURI === Qe && !bt[n] ? !1 : !cn[e] && (en[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: nt,
|
|
1691
1691
|
tagName: "template"
|
|
1692
1692
|
});
|
|
1693
|
-
let n =
|
|
1694
|
-
return
|
|
1693
|
+
let n = ut(e.tagName), r = ut(t.tagName);
|
|
1694
|
+
return _t[e.namespaceURI] ? e.namespaceURI === et ? ln(n, t, r) : e.namespaceURI === Qe ? un(n, t, r) : e.namespaceURI === tt ? dn(n, t, r) : !!(tn === "application/xhtml+xml" && _t[e.namespaceURI]) : !1;
|
|
1695
1695
|
}, pn = function _forceRemove(e) {
|
|
1696
|
-
|
|
1696
|
+
st(DOMPurify.removed, { element: e });
|
|
1697
1697
|
try {
|
|
1698
1698
|
v(e).removeChild(e);
|
|
1699
1699
|
} catch {
|
|
1700
|
-
if (m(e), !v(e)) throw
|
|
1700
|
+
if (m(e), !v(e)) throw xt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
1701
1701
|
}
|
|
1702
1702
|
}, mn = function _neutralizeRoot(e) {
|
|
1703
1703
|
_n(e);
|
|
1704
1704
|
let t = _(e);
|
|
1705
1705
|
if (t) {
|
|
1706
1706
|
let e = [];
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
}),
|
|
1707
|
+
rt(t, (t) => {
|
|
1708
|
+
st(e, t);
|
|
1709
|
+
}), rt(e, (e) => {
|
|
1710
1710
|
try {
|
|
1711
1711
|
m(e);
|
|
1712
1712
|
} catch {}
|
|
@@ -1721,17 +1721,17 @@ function createDOMPurify() {
|
|
|
1721
1721
|
}
|
|
1722
1722
|
}, hn = function _removeAttribute(e, t) {
|
|
1723
1723
|
try {
|
|
1724
|
-
|
|
1724
|
+
st(DOMPurify.removed, {
|
|
1725
1725
|
attribute: t.getAttributeNode(e),
|
|
1726
1726
|
from: t
|
|
1727
1727
|
});
|
|
1728
1728
|
} catch {
|
|
1729
|
-
|
|
1729
|
+
st(DOMPurify.removed, {
|
|
1730
1730
|
attribute: null,
|
|
1731
1731
|
from: t
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
1734
|
-
if (t.removeAttribute(e), e === "is") if (
|
|
1734
|
+
if (t.removeAttribute(e), e === "is") if (Le || Re) try {
|
|
1735
1735
|
pn(t);
|
|
1736
1736
|
} catch {}
|
|
1737
1737
|
else try {
|
|
@@ -1749,22 +1749,22 @@ function createDOMPurify() {
|
|
|
1749
1749
|
let t = [e];
|
|
1750
1750
|
for (; t.length > 0;) {
|
|
1751
1751
|
let e = t.pop();
|
|
1752
|
-
(S ? S(e) : e.nodeType) ===
|
|
1752
|
+
(S ? S(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 (!je) return;
|
|
1758
1758
|
let t = [e];
|
|
1759
1759
|
for (; t.length > 0;) {
|
|
1760
1760
|
let e = t.pop(), n = S ? S(e) : e.nodeType;
|
|
1761
|
-
if (n ===
|
|
1761
|
+
if (n === qt.processingInstruction || n === qt.comment && X(Wt, e.data)) {
|
|
1762
1762
|
try {
|
|
1763
1763
|
m(e);
|
|
1764
1764
|
} catch {}
|
|
1765
1765
|
continue;
|
|
1766
1766
|
}
|
|
1767
|
-
if (n ===
|
|
1767
|
+
if (n === qt.element) {
|
|
1768
1768
|
let t = e, n = Q(C ? C(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");
|
|
@@ -1775,34 +1775,34 @@ function createDOMPurify() {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
}, yn = function _initDocument(e) {
|
|
1777
1777
|
let n = null, r = null;
|
|
1778
|
-
if (
|
|
1778
|
+
if (Ie) e = "<remove></remove>" + e;
|
|
1779
1779
|
else {
|
|
1780
|
-
let t =
|
|
1780
|
+
let t = ft(e, /^[\r\n\t ]+/);
|
|
1781
1781
|
r = t && t[0];
|
|
1782
1782
|
}
|
|
1783
|
-
|
|
1783
|
+
tn === "application/xhtml+xml" && nt === tt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1784
1784
|
let i = T ? j(e) : e;
|
|
1785
|
-
if (
|
|
1786
|
-
n = new c().parseFromString(i,
|
|
1785
|
+
if (nt === tt) try {
|
|
1786
|
+
n = new c().parseFromString(i, tn);
|
|
1787
1787
|
} catch {}
|
|
1788
1788
|
if (!n || !n.documentElement) {
|
|
1789
|
-
n = F.createDocument(
|
|
1789
|
+
n = F.createDocument(nt, "template", null);
|
|
1790
1790
|
try {
|
|
1791
|
-
n.documentElement.innerHTML =
|
|
1791
|
+
n.documentElement.innerHTML = gt ? te : 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), nt === tt ? se.call(n, Me ? "html" : "body")[0] : Me ? n.documentElement : a;
|
|
1796
1796
|
}, bn = function _createNodeIterator(e) {
|
|
1797
1797
|
return oe.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 =
|
|
1799
|
+
return e = pt(e, ue, " "), e = pt(e, z, " "), e = pt(e, de, " "), e;
|
|
1800
1800
|
}, Sn = function _scrubTemplateExpressions(e) {
|
|
1801
1801
|
e.normalize();
|
|
1802
1802
|
let t = oe.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
|
-
r &&
|
|
1805
|
+
r && rt(r, (e) => {
|
|
1806
1806
|
wn(e.content) && Sn(e.content);
|
|
1807
1807
|
});
|
|
1808
1808
|
}, Cn = function _isClobbered(e) {
|
|
@@ -1811,7 +1811,7 @@ function createDOMPurify() {
|
|
|
1811
1811
|
}, wn = function _isDocumentFragment(e) {
|
|
1812
1812
|
if (!S || typeof e != "object" || !e) return !1;
|
|
1813
1813
|
try {
|
|
1814
|
-
return S(e) ===
|
|
1814
|
+
return S(e) === qt.documentFragment;
|
|
1815
1815
|
} catch {
|
|
1816
1816
|
return !1;
|
|
1817
1817
|
}
|
|
@@ -1824,14 +1824,14 @@ function createDOMPurify() {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
};
|
|
1826
1826
|
function _executeHooks(e, t, n) {
|
|
1827
|
-
e.length !== 0 &&
|
|
1827
|
+
e.length !== 0 && rt(e, (e) => {
|
|
1828
1828
|
e.call(DOMPurify, t, n, nn);
|
|
1829
1829
|
});
|
|
1830
1830
|
}
|
|
1831
1831
|
let En = function _isUnsafeNode(e, t) {
|
|
1832
|
-
return !!(
|
|
1832
|
+
return !!(je && e.hasChildNodes() && !Tn(e.firstElementChild) && X(Ut, e.textContent) && X(Ut, e.innerHTML) || je && e.namespaceURI === tt && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || je && e.nodeType === qt.comment && X(Wt, e.data));
|
|
1833
1833
|
}, Dn = function _sanitizeDisallowedNode(e, t) {
|
|
1834
|
-
if (!
|
|
1834
|
+
if (!Ce[t] && jn(t) && (W.tagNameCheck instanceof RegExp && X(W.tagNameCheck, t) || W.tagNameCheck instanceof Function && W.tagNameCheck(t))) return !1;
|
|
1835
1835
|
if (He && !Ge[t]) {
|
|
1836
1836
|
let t = v(e), n = _(e);
|
|
1837
1837
|
if (n && t) {
|
|
@@ -1852,23 +1852,23 @@ function createDOMPurify() {
|
|
|
1852
1852
|
allowedTags: H
|
|
1853
1853
|
}), e !== t && v(e) === null) return !0;
|
|
1854
1854
|
if (En(e, n)) return pn(e), !0;
|
|
1855
|
-
if (
|
|
1855
|
+
if (Ce[n] || !(Te.tagCheck instanceof Function && Te.tagCheck(n)) && !H[n]) {
|
|
1856
1856
|
let t = Dn(e, n);
|
|
1857
1857
|
return t === !1 && _executeHooks(R.afterSanitizeElements, e, null), t;
|
|
1858
1858
|
}
|
|
1859
|
-
if ((S ? S(e) : e.nodeType) ===
|
|
1860
|
-
if (
|
|
1859
|
+
if ((S ? S(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && X(Gt, e.innerHTML)) return pn(e), !0;
|
|
1860
|
+
if (Ae && e.nodeType === qt.text) {
|
|
1861
1861
|
let t = xn(e.textContent);
|
|
1862
|
-
e.textContent !== t && (
|
|
1862
|
+
e.textContent !== t && (st(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1863
1863
|
}
|
|
1864
1864
|
return _executeHooks(R.afterSanitizeElements, e, null), !1;
|
|
1865
1865
|
}, kn = function _isValidAttribute(e, n, r) {
|
|
1866
|
-
if (
|
|
1867
|
-
let i = U[n] ||
|
|
1868
|
-
if (!(
|
|
1866
|
+
if (we[n] || je && n === "patchsrc" || je && n === "for" && e !== "label" && e !== "output" || Be && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
|
|
1867
|
+
let i = U[n] || Te.attributeCheck instanceof Function && Te.attributeCheck(n, e);
|
|
1868
|
+
if (!(De && X(B, n)) && !(Ee && X(pe, n))) {
|
|
1869
1869
|
if (!i) {
|
|
1870
|
-
if (!(jn(e) && (W.tagNameCheck instanceof RegExp &&
|
|
1871
|
-
} else if (!
|
|
1870
|
+
if (!(jn(e) && (W.tagNameCheck instanceof RegExp && X(W.tagNameCheck, e) || W.tagNameCheck instanceof Function && W.tagNameCheck(e)) && (W.attributeNameCheck instanceof RegExp && X(W.attributeNameCheck, n) || W.attributeNameCheck instanceof Function && W.attributeNameCheck(n, e)) || n === "is" && W.allowCustomizedBuiltInElements && (W.tagNameCheck instanceof RegExp && X(W.tagNameCheck, r) || W.tagNameCheck instanceof Function && W.tagNameCheck(r)))) return !1;
|
|
1871
|
+
} else if (!Xe[n] && !X(ye, pt(r, _e, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && qe[e]) && !(Oe && !X(he, pt(r, _e, ""))) && r) return !1;
|
|
1872
1872
|
}
|
|
1873
1873
|
return !0;
|
|
1874
1874
|
}, An = addToSet({}, [
|
|
@@ -1881,7 +1881,7 @@ function createDOMPurify() {
|
|
|
1881
1881
|
"font-face-uri",
|
|
1882
1882
|
"missing-glyph"
|
|
1883
1883
|
]), jn = function _isBasicCustomElement(e) {
|
|
1884
|
-
return !An[
|
|
1884
|
+
return !An[ut(e)] && X(ve, e);
|
|
1885
1885
|
}, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1886
1886
|
if (T && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
1887
1887
|
case "TrustedHTML": return j(r);
|
|
@@ -1890,7 +1890,7 @@ function createDOMPurify() {
|
|
|
1890
1890
|
return r;
|
|
1891
1891
|
}, Nn = function _setAttributeValue(e, t, n, r) {
|
|
1892
1892
|
try {
|
|
1893
|
-
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Cn(e) ? pn(e) :
|
|
1893
|
+
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Cn(e) ? pn(e) : at(DOMPurify.removed);
|
|
1894
1894
|
} catch {
|
|
1895
1895
|
hn(t, e);
|
|
1896
1896
|
}
|
|
@@ -1906,12 +1906,12 @@ function createDOMPurify() {
|
|
|
1906
1906
|
forceKeepAttr: void 0
|
|
1907
1907
|
}, r = t.length, i = Q(e.nodeName);
|
|
1908
1908
|
for (; r--;) {
|
|
1909
|
-
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f :
|
|
1910
|
-
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(R.uponSanitizeAttribute, e, n), p = n.attrValue,
|
|
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(R.uponSanitizeAttribute, e, n), p = n.attrValue, Ve && (u === "id" || u === "name") && mt(p, G) !== 0 && (hn(o, e), p = G + p), je && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
|
|
1911
1911
|
hn(o, e);
|
|
1912
1912
|
continue;
|
|
1913
1913
|
}
|
|
1914
|
-
if (u === "attributename" &&
|
|
1914
|
+
if (u === "attributename" && ft(p, "href")) {
|
|
1915
1915
|
hn(o, e);
|
|
1916
1916
|
continue;
|
|
1917
1917
|
}
|
|
@@ -1920,11 +1920,11 @@ function createDOMPurify() {
|
|
|
1920
1920
|
hn(o, e);
|
|
1921
1921
|
continue;
|
|
1922
1922
|
}
|
|
1923
|
-
if (!
|
|
1923
|
+
if (!ke && X(Kt, p)) {
|
|
1924
1924
|
hn(o, e);
|
|
1925
1925
|
continue;
|
|
1926
1926
|
}
|
|
1927
|
-
if (
|
|
1927
|
+
if (Ae && (p = xn(p)), !kn(i, u, p)) {
|
|
1928
1928
|
hn(o, e);
|
|
1929
1929
|
continue;
|
|
1930
1930
|
}
|
|
@@ -1934,7 +1934,7 @@ function createDOMPurify() {
|
|
|
1934
1934
|
_executeHooks(R.afterSanitizeAttributes, e, null);
|
|
1935
1935
|
}, Fn = function _sanitizeShadowDOM(e) {
|
|
1936
1936
|
let t = null, n = bn(e);
|
|
1937
|
-
for (_executeHooks(R.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(R.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (S ? S(t) : t.nodeType) ===
|
|
1937
|
+
for (_executeHooks(R.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(R.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (S ? S(t) : t.nodeType) === qt.element) {
|
|
1938
1938
|
let e = b(t);
|
|
1939
1939
|
wn(e) && (In(e), Fn(e));
|
|
1940
1940
|
}
|
|
@@ -1950,7 +1950,7 @@ function createDOMPurify() {
|
|
|
1950
1950
|
Fn(e.shadow);
|
|
1951
1951
|
continue;
|
|
1952
1952
|
}
|
|
1953
|
-
let n = e.node, r = (S ? S(n) : n.nodeType) ===
|
|
1953
|
+
let n = e.node, r = (S ? S(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
|
|
@@ -1979,73 +1979,73 @@ 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 (gt = !e, gt && (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
|
-
|
|
1984
|
+
Ne ? (H = Pe, U = Fe) : on(t), (R.uponSanitizeElement.length > 0 || R.uponSanitizeAttribute.length > 0) && (H = clone(H)), R.uponSanitizeAttribute.length > 0 && (U = clone(U)), DOMPurify.removed = [];
|
|
1985
1985
|
let s = Ue && typeof e != "string" && Tn(e);
|
|
1986
1986
|
if (s) {
|
|
1987
1987
|
vn(e);
|
|
1988
1988
|
let t = C ? C(e) : e.nodeName;
|
|
1989
1989
|
if (typeof t == "string") {
|
|
1990
1990
|
let n = Q(t);
|
|
1991
|
-
if (!H[n] ||
|
|
1991
|
+
if (!H[n] || Ce[n]) throw mn(e), xt("root node is forbidden and cannot be sanitized in-place");
|
|
1992
1992
|
}
|
|
1993
|
-
if (Cn(e)) throw mn(e),
|
|
1993
|
+
if (Cn(e)) throw mn(e), xt("root node is clobbered and cannot be sanitized in-place");
|
|
1994
1994
|
try {
|
|
1995
1995
|
In(e);
|
|
1996
1996
|
} catch (t) {
|
|
1997
1997
|
throw mn(e), t;
|
|
1998
1998
|
}
|
|
1999
|
-
} else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType ===
|
|
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 (!Le && !Ae && !Me && e.indexOf("<") === -1) return T && ze ? j(e) : e;
|
|
2002
|
+
if (r = yn(e), !r) return Le ? null : ze ? te : "";
|
|
2003
2003
|
}
|
|
2004
|
-
r &&
|
|
2004
|
+
r && Ie && 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);
|
|
2008
2008
|
} catch (t) {
|
|
2009
|
-
throw s && (mn(e),
|
|
2009
|
+
throw s && (mn(e), rt(DOMPurify.removed, (e) => {
|
|
2010
2010
|
e.element && _n(e.element);
|
|
2011
2011
|
})), t;
|
|
2012
2012
|
}
|
|
2013
|
-
if (s) return
|
|
2013
|
+
if (s) return rt(DOMPurify.removed, (e) => {
|
|
2014
2014
|
e.element && _n(e.element);
|
|
2015
|
-
}),
|
|
2016
|
-
if (
|
|
2017
|
-
if (
|
|
2015
|
+
}), Ae && Sn(e), e;
|
|
2016
|
+
if (Le) {
|
|
2017
|
+
if (Ae && Sn(r), Re) for (o = I.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
|
|
2018
2018
|
else o = r;
|
|
2019
2019
|
return (U.shadowroot || U.shadowrootmode) && (o = ce.call(n, o, !0)), o;
|
|
2020
2020
|
}
|
|
2021
|
-
let f =
|
|
2022
|
-
return
|
|
2021
|
+
let f = Me ? r.outerHTML : r.innerHTML;
|
|
2022
|
+
return Me && H["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && X(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), Ae && (f = xn(f)), T && ze ? j(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), Ne = !0, Pe = H, Fe = U;
|
|
2026
2026
|
}, DOMPurify.clearConfig = function() {
|
|
2027
|
-
nn = null,
|
|
2027
|
+
nn = null, Ne = !1, Pe = null, Fe = null, T = ne, te = "";
|
|
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" && J(R, e) && st(R[e], t);
|
|
2034
2034
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2035
|
-
if (
|
|
2035
|
+
if (J(R, e)) {
|
|
2036
2036
|
if (t !== void 0) {
|
|
2037
|
-
let n =
|
|
2038
|
-
return n === -1 ? void 0 :
|
|
2037
|
+
let n = it(R[e], t);
|
|
2038
|
+
return n === -1 ? void 0 : ct(R[e], n, 1)[0];
|
|
2039
2039
|
}
|
|
2040
|
-
return
|
|
2040
|
+
return at(R[e]);
|
|
2041
2041
|
}
|
|
2042
2042
|
}, DOMPurify.removeHooks = function(e) {
|
|
2043
|
-
|
|
2043
|
+
J(R, e) && (R[e] = []);
|
|
2044
2044
|
}, DOMPurify.removeAllHooks = function() {
|
|
2045
|
-
R =
|
|
2045
|
+
R = Xt();
|
|
2046
2046
|
}, DOMPurify;
|
|
2047
2047
|
}
|
|
2048
|
-
var
|
|
2048
|
+
var Qt = createDOMPurify(), _Class;
|
|
2049
2049
|
function M() {
|
|
2050
2050
|
return {
|
|
2051
2051
|
async: !1,
|
|
@@ -2060,11 +2060,11 @@ function M() {
|
|
|
2060
2060
|
walkTokens: null
|
|
2061
2061
|
};
|
|
2062
2062
|
}
|
|
2063
|
-
var
|
|
2063
|
+
var $t = M();
|
|
2064
2064
|
function N(e) {
|
|
2065
|
-
|
|
2065
|
+
$t = e;
|
|
2066
2066
|
}
|
|
2067
|
-
var
|
|
2067
|
+
var en = { exec: () => null };
|
|
2068
2068
|
function E(e) {
|
|
2069
2069
|
let t = [];
|
|
2070
2070
|
return (n) => {
|
|
@@ -2076,19 +2076,19 @@ 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(Z.caret, "$1"), n = n.replace(e, i), r;
|
|
2080
2080
|
},
|
|
2081
2081
|
getRegex: () => new RegExp(n, t)
|
|
2082
2082
|
};
|
|
2083
2083
|
return r;
|
|
2084
2084
|
}
|
|
2085
|
-
var
|
|
2085
|
+
var tn = ((e = "") => {
|
|
2086
2086
|
try {
|
|
2087
2087
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
2088
2088
|
} catch {
|
|
2089
2089
|
return !1;
|
|
2090
2090
|
}
|
|
2091
|
-
})(),
|
|
2091
|
+
})(), Z = {
|
|
2092
2092
|
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
2093
2093
|
outputLinkReplace: /\\([\[\]])/g,
|
|
2094
2094
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -2157,7 +2157,7 @@ var en = ((e = "") => {
|
|
|
2157
2157
|
list: hn,
|
|
2158
2158
|
newline: Q,
|
|
2159
2159
|
paragraph: yn,
|
|
2160
|
-
table:
|
|
2160
|
+
table: en,
|
|
2161
2161
|
text: fn
|
|
2162
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
2163
|
...xn,
|
|
@@ -2169,19 +2169,19 @@ var en = ((e = "") => {
|
|
|
2169
2169
|
html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", _n).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
|
-
fences:
|
|
2172
|
+
fences: en,
|
|
2173
2173
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2174
2174
|
paragraph: d(dn).replace("hr", an).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ln).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
2175
|
-
}, Tn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, En = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Dn = /^( {2,}|\\)\n(?!\s*$)/, On = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, kn = /[\p{P}\p{S}]/u, An = /[\s\p{P}\p{S}]/u, jn = /[^\s\p{P}\p{S}]/u, Mn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, An).getRegex(), Nn = /(?!~)[\p{P}\p{S}]/u, Pn = /(?!~)[\s\p{P}\p{S}]/u, Fn = /(?:[^\s\p{P}\p{S}]|~)/u, In = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",
|
|
2176
|
-
_backpedal:
|
|
2175
|
+
}, Tn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, En = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Dn = /^( {2,}|\\)\n(?!\s*$)/, On = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, kn = /[\p{P}\p{S}]/u, An = /[\s\p{P}\p{S}]/u, jn = /[^\s\p{P}\p{S}]/u, Mn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, An).getRegex(), Nn = /(?!~)[\p{P}\p{S}]/u, Pn = /(?!~)[\s\p{P}\p{S}]/u, Fn = /(?:[^\s\p{P}\p{S}]|~)/u, In = 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(), Ln = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Rn = d(Ln, "u").replace(/punct/g, kn).getRegex(), zn = d(Ln, "u").replace(/punct/g, Nn).getRegex(), Bn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Vn = d(Bn, "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Hn = d(Bn, "gu").replace(/notPunctSpace/g, Fn).replace(/punctSpace/g, Pn).replace(/punct/g, Nn).getRegex(), Un = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Wn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, kn).getRegex(), Gn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Kn = d(/\\(punct)/, "gu").replace(/punct/g, kn).getRegex(), qn = 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(), Jn = d(_n).replace("(?:-->|$)", "-->").getRegex(), Yn = 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", Jn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Xn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Zn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Xn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Qn = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Xn).replace("ref", pn).getRegex(), $n = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), er = d("reflink|nolink(?!\\()", "g").replace("reflink", Qn).replace("nolink", $n).getRegex(), tr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, nr = {
|
|
2176
|
+
_backpedal: en,
|
|
2177
2177
|
anyPunctuation: Kn,
|
|
2178
2178
|
autolink: qn,
|
|
2179
2179
|
blockSkip: In,
|
|
2180
2180
|
br: Dn,
|
|
2181
2181
|
code: En,
|
|
2182
|
-
del:
|
|
2183
|
-
delLDelim:
|
|
2184
|
-
delRDelim:
|
|
2182
|
+
del: en,
|
|
2183
|
+
delLDelim: en,
|
|
2184
|
+
delRDelim: en,
|
|
2185
2185
|
emStrongLDelim: Rn,
|
|
2186
2186
|
emStrongRDelimAst: Vn,
|
|
2187
2187
|
emStrongRDelimUnd: Un,
|
|
@@ -2193,7 +2193,7 @@ var en = ((e = "") => {
|
|
|
2193
2193
|
reflinkSearch: er,
|
|
2194
2194
|
tag: Yn,
|
|
2195
2195
|
text: On,
|
|
2196
|
-
url:
|
|
2196
|
+
url: en
|
|
2197
2197
|
}, rr = {
|
|
2198
2198
|
...nr,
|
|
2199
2199
|
link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Xn).getRegex(),
|
|
@@ -2230,27 +2230,27 @@ var en = ((e = "") => {
|
|
|
2230
2230
|
}, ge = (e) => cr[e];
|
|
2231
2231
|
function O(e, t) {
|
|
2232
2232
|
if (t) {
|
|
2233
|
-
if (
|
|
2234
|
-
} else if (
|
|
2233
|
+
if (Z.escapeTest.test(e)) return e.replace(Z.escapeReplace, ge);
|
|
2234
|
+
} else if (Z.escapeTestNoEncode.test(e)) return e.replace(Z.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(Z.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(Z.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(Z.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(Z.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 && Z.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) {
|
|
@@ -2312,7 +2312,7 @@ function ot(e, t, n) {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
var w = class {
|
|
2314
2314
|
constructor(t) {
|
|
2315
|
-
e(this, "options", void 0), e(this, "rules", void 0), e(this, "lexer", void 0), this.options = t ||
|
|
2315
|
+
e(this, "options", void 0), e(this, "rules", void 0), e(this, "lexer", void 0), this.options = t || $t;
|
|
2316
2316
|
}
|
|
2317
2317
|
space(e) {
|
|
2318
2318
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -2764,13 +2764,13 @@ ${c}` : c;
|
|
|
2764
2764
|
}
|
|
2765
2765
|
}, lr = class l {
|
|
2766
2766
|
constructor(t) {
|
|
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 ||
|
|
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,
|
|
2769
2769
|
inRawBlock: !1,
|
|
2770
2770
|
top: !0
|
|
2771
2771
|
};
|
|
2772
2772
|
let n = {
|
|
2773
|
-
other:
|
|
2773
|
+
other: Z,
|
|
2774
2774
|
block: or.normal,
|
|
2775
2775
|
inline: sr.normal
|
|
2776
2776
|
};
|
|
@@ -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(Z.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(Z.tabCharGlobal, " ").replace(Z.spaceLine, ""));
|
|
2801
2801
|
let r = Infinity;
|
|
2802
2802
|
for (; e;) {
|
|
2803
2803
|
if (e.length < r) r = e.length;
|
|
@@ -2981,13 +2981,13 @@ ${c}` : c;
|
|
|
2981
2981
|
}
|
|
2982
2982
|
}, y = class {
|
|
2983
2983
|
constructor(t) {
|
|
2984
|
-
e(this, "options", void 0), e(this, "parser", void 0), this.options = t ||
|
|
2984
|
+
e(this, "options", void 0), e(this, "parser", void 0), this.options = t || $t;
|
|
2985
2985
|
}
|
|
2986
2986
|
space(e) {
|
|
2987
2987
|
return "";
|
|
2988
2988
|
}
|
|
2989
2989
|
code({ text: e, lang: t, escaped: n }) {
|
|
2990
|
-
let r = (t || "").match(
|
|
2990
|
+
let r = (t || "").match(Z.notSpaceStart)?.[0], i = e.replace(Z.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 }) {
|
|
@@ -3117,7 +3117,7 @@ ${e}</tr>
|
|
|
3117
3117
|
}
|
|
3118
3118
|
}, ur = class l {
|
|
3119
3119
|
constructor(t) {
|
|
3120
|
-
e(this, "options", void 0), e(this, "renderer", void 0), e(this, "textRenderer", void 0), this.options = t ||
|
|
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
|
}
|
|
3122
3122
|
static parse(e, t) {
|
|
3123
3123
|
return new l(t).parse(e);
|
|
@@ -3265,7 +3265,7 @@ ${e}</tr>
|
|
|
3265
3265
|
}
|
|
3266
3266
|
}, dr = (_Class = class {
|
|
3267
3267
|
constructor(t) {
|
|
3268
|
-
e(this, "options", void 0), e(this, "block", void 0), this.options = t ||
|
|
3268
|
+
e(this, "options", void 0), e(this, "block", void 0), this.options = t || $t;
|
|
3269
3269
|
}
|
|
3270
3270
|
preprocess(e) {
|
|
3271
3271
|
return e;
|
|
@@ -3465,7 +3465,7 @@ function g(e, t) {
|
|
|
3465
3465
|
}
|
|
3466
3466
|
g.options = g.setOptions = function(e) {
|
|
3467
3467
|
return fr.setOptions(e), g.defaults = fr.defaults, N(g.defaults), g;
|
|
3468
|
-
}, g.getDefaults = M, g.defaults =
|
|
3468
|
+
}, g.getDefaults = M, g.defaults = $t, g.use = function(...e) {
|
|
3469
3469
|
return fr.use(...e), g.defaults = fr.defaults, N(g.defaults), g;
|
|
3470
3470
|
}, g.walkTokens = function(e, t) {
|
|
3471
3471
|
return fr.walkTokens(e, t);
|
|
@@ -3952,7 +3952,7 @@ var Cr = [
|
|
|
3952
3952
|
seriesIndex: i
|
|
3953
3953
|
};
|
|
3954
3954
|
}).filter((e) => e !== null);
|
|
3955
|
-
}),
|
|
3955
|
+
}), B = f(() => {
|
|
3956
3956
|
let e = x.value;
|
|
3957
3957
|
if (!e) return [];
|
|
3958
3958
|
let t = e.data.map((t) => ({
|
|
@@ -3968,17 +3968,17 @@ var Cr = [
|
|
|
3968
3968
|
series: r
|
|
3969
3969
|
})
|
|
3970
3970
|
}));
|
|
3971
|
-
}),
|
|
3971
|
+
}), pe = f(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), he = [
|
|
3972
3972
|
"var(--color-theme-900)",
|
|
3973
3973
|
"var(--color-primary-500)",
|
|
3974
3974
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
3975
|
-
],
|
|
3975
|
+
], _e = [
|
|
3976
3976
|
"rgba(255, 255, 255, 0.92)",
|
|
3977
3977
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
3978
3978
|
"rgba(255, 255, 255, 0.55)"
|
|
3979
3979
|
];
|
|
3980
3980
|
function seriesColor(e) {
|
|
3981
|
-
let n = t.inverted ?
|
|
3981
|
+
let n = t.inverted ? _e : he;
|
|
3982
3982
|
return n[e % n.length];
|
|
3983
3983
|
}
|
|
3984
3984
|
function diagramNodeFill(e) {
|
|
@@ -3987,7 +3987,7 @@ var Cr = [
|
|
|
3987
3987
|
function diagramNodeStroke(e) {
|
|
3988
3988
|
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
3989
|
}
|
|
3990
|
-
let ve = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"),
|
|
3990
|
+
let ve = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), Ce = f(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = f(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
3991
3991
|
return (e, r) => o.value ? (k(), h("section", {
|
|
3992
3992
|
key: 0,
|
|
3993
3993
|
"data-test": "chat-visual",
|
|
@@ -4026,7 +4026,7 @@ var Cr = [
|
|
|
4026
4026
|
style: T({ color: ve.value })
|
|
4027
4027
|
}, F(e.value), 5)]), _("div", {
|
|
4028
4028
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4029
|
-
style: T({ background:
|
|
4029
|
+
style: T({ background: we.value })
|
|
4030
4030
|
}, [_("div", {
|
|
4031
4031
|
class: "h-full rounded-full",
|
|
4032
4032
|
style: T({
|
|
@@ -4134,7 +4134,7 @@ var Cr = [
|
|
|
4134
4134
|
class: "font-semibold tabular-nums",
|
|
4135
4135
|
style: T({ color: ve.value })
|
|
4136
4136
|
}, F(e.value), 5)
|
|
4137
|
-
]))), 128))])) : m("", !0)], 8, Tr)) : x.value ? (k(), h("div", Rr, [(k(!0), h(u, null, j(
|
|
4137
|
+
]))), 128))])) : m("", !0)], 8, Tr)) : x.value ? (k(), h("div", Rr, [(k(!0), h(u, null, j(B.value, (e, t) => (k(), h("div", { key: e.key }, [_("div", zr, [_("span", {
|
|
4138
4138
|
class: "truncate font-medium",
|
|
4139
4139
|
style: T({ color: ve.value })
|
|
4140
4140
|
}, F(e.name), 5), _("span", Br, [_("span", {
|
|
@@ -4145,25 +4145,25 @@ var Cr = [
|
|
|
4145
4145
|
style: T({ color: ye.value })
|
|
4146
4146
|
}, F(Math.round(e.percent * 100)) + "%", 5)])]), _("div", {
|
|
4147
4147
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4148
|
-
style: T({ background:
|
|
4148
|
+
style: T({ background: we.value })
|
|
4149
4149
|
}, [_("div", {
|
|
4150
4150
|
class: "h-full rounded-full",
|
|
4151
4151
|
style: T({
|
|
4152
4152
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4153
4153
|
background: seriesColor(t)
|
|
4154
4154
|
})
|
|
4155
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4155
|
+
}, null, 4)], 4)]))), 128))])) : c.value && pe.value ? (k(), h("div", Vr, [(k(), h("svg", {
|
|
4156
4156
|
"data-test": "chat-visual-diagram-svg",
|
|
4157
4157
|
class: "block h-auto overflow-visible",
|
|
4158
|
-
viewBox: `0 0 ${
|
|
4158
|
+
viewBox: `0 0 ${pe.value.width} ${pe.value.height}`,
|
|
4159
4159
|
style: T({
|
|
4160
|
-
width: `${
|
|
4161
|
-
aspectRatio: `${
|
|
4160
|
+
width: `${pe.value.width}px`,
|
|
4161
|
+
aspectRatio: `${pe.value.width} / ${pe.value.height}`
|
|
4162
4162
|
}),
|
|
4163
4163
|
role: "img",
|
|
4164
4164
|
"aria-label": o.value.meta.title
|
|
4165
4165
|
}, [
|
|
4166
|
-
(k(!0), h(u, null, j(
|
|
4166
|
+
(k(!0), h(u, null, j(pe.value.edges, (e) => (k(), h("line", {
|
|
4167
4167
|
key: e.key,
|
|
4168
4168
|
"data-test": "chat-visual-diagram-edge",
|
|
4169
4169
|
"data-from": e.from,
|
|
@@ -4175,16 +4175,16 @@ var Cr = [
|
|
|
4175
4175
|
"stroke-width": "1.4",
|
|
4176
4176
|
"stroke-linecap": "round",
|
|
4177
4177
|
"vector-effect": "non-scaling-stroke",
|
|
4178
|
-
style: T({ stroke:
|
|
4178
|
+
style: T({ stroke: Ce.value })
|
|
4179
4179
|
}, null, 12, Ur))), 128)),
|
|
4180
|
-
(k(!0), h(u, null, j(
|
|
4180
|
+
(k(!0), h(u, null, j(pe.value.edges, (e) => (k(), h("circle", {
|
|
4181
4181
|
key: `${e.key}-dot`,
|
|
4182
4182
|
cx: e.x2,
|
|
4183
4183
|
cy: e.y2,
|
|
4184
4184
|
r: "2.4",
|
|
4185
|
-
style: T({ fill:
|
|
4185
|
+
style: T({ fill: Ce.value })
|
|
4186
4186
|
}, null, 12, Wr))), 128)),
|
|
4187
|
-
(k(!0), h(u, null, j(
|
|
4187
|
+
(k(!0), h(u, null, j(pe.value.edges.filter((e) => e.label), (e) => (k(), h("foreignObject", {
|
|
4188
4188
|
key: `${e.key}-label`,
|
|
4189
4189
|
x: e.labelX - 55,
|
|
4190
4190
|
y: e.labelY - 12,
|
|
@@ -4198,7 +4198,7 @@ var Cr = [
|
|
|
4198
4198
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4199
4199
|
})
|
|
4200
4200
|
}, F(e.label), 5)], 8, Gr))), 128)),
|
|
4201
|
-
(k(!0), h(u, null, j(
|
|
4201
|
+
(k(!0), h(u, null, j(pe.value.nodes, (e) => (k(), h("g", {
|
|
4202
4202
|
key: e.id,
|
|
4203
4203
|
"data-test": "chat-visual-diagram-node",
|
|
4204
4204
|
"data-node-id": e.id,
|
|
@@ -4284,7 +4284,7 @@ var Cr = [
|
|
|
4284
4284
|
function renderMarkdown(e) {
|
|
4285
4285
|
if (!e) return "";
|
|
4286
4286
|
let t = g.parse(e, { async: !1 });
|
|
4287
|
-
return
|
|
4287
|
+
return Qt.sanitize(t, {
|
|
4288
4288
|
ADD_ATTR: ["target"],
|
|
4289
4289
|
ADD_DATA_URI_TAGS: ["img"]
|
|
4290
4290
|
});
|
|
@@ -4520,11 +4520,7 @@ var Cr = [
|
|
|
4520
4520
|
}, Mi = ["src", "alt"], Ni = { class: "max-w-20 truncate" }, Pi = ["onClick"], Fi = {
|
|
4521
4521
|
key: 0,
|
|
4522
4522
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
4523
|
-
}, Ii = [
|
|
4524
|
-
"data-composer-action",
|
|
4525
|
-
"data-offline",
|
|
4526
|
-
"title"
|
|
4527
|
-
], Li = ["placeholder", "disabled"], Ri = { class: "font-mono text-sm tabular-nums" }, zi = { class: "mt-2.5 flex items-center" }, Bi = [
|
|
4523
|
+
}, Ii = ["data-composer-action"], Li = ["placeholder", "disabled"], Ri = { class: "font-mono text-sm tabular-nums" }, zi = { class: "mt-2.5 flex items-center" }, Bi = [
|
|
4528
4524
|
"disabled",
|
|
4529
4525
|
"aria-label",
|
|
4530
4526
|
"title"
|
|
@@ -4549,7 +4545,7 @@ var Cr = [
|
|
|
4549
4545
|
key: 2,
|
|
4550
4546
|
"data-test": "messaging-suggested-prompts",
|
|
4551
4547
|
class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
|
|
4552
|
-
}, Qi = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, $i = ["disabled", "onClick"], ea = ["aria-expanded"], ta =
|
|
4548
|
+
}, Qi = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, $i = ["disabled", "onClick"], ea = ["aria-expanded"], ta = /* @__PURE__ */ x({
|
|
4553
4549
|
__name: "ElAgentChat",
|
|
4554
4550
|
props: {
|
|
4555
4551
|
chatController: {},
|
|
@@ -4595,39 +4591,29 @@ var Cr = [
|
|
|
4595
4591
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
4596
4592
|
}
|
|
4597
4593
|
function isSystemExplainerMessage(e) {
|
|
4598
|
-
return e.sender === "system" && (!!e.issue || e.id ===
|
|
4594
|
+
return e.sender === "system" && (!!e.issue || e.id === be.value);
|
|
4599
4595
|
}
|
|
4600
4596
|
function isGroupEnd(e, t) {
|
|
4601
4597
|
let n = e[t], r = e[t + 1];
|
|
4602
4598
|
return !r || r.sender !== n.sender;
|
|
4603
4599
|
}
|
|
4604
|
-
let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), ae = A(!1), P
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
ae.value = !1;
|
|
4608
|
-
return;
|
|
4609
|
-
}
|
|
4610
|
-
P = setTimeout(() => {
|
|
4611
|
-
ae.value = !0;
|
|
4612
|
-
}, ta);
|
|
4613
|
-
}, { immediate: !0 }), re(() => clearTimeout(P));
|
|
4614
|
-
let oe = f(() => T.value && ae.value), de = f(() => te.value || T.value && !ae.value), pe = A(!1), _e = f(() => oe.value ? `Can't reach ${e.agent.displayName.value || "your assistant"} right now. Your messages are safe. This usually clears on its own.` : void 0), B = f(() => e.chatController?.liveTurnBlocks?.value ?? []), ve = f(() => {
|
|
4615
|
-
for (let e = B.value.length - 1; e >= 0; e--) {
|
|
4616
|
-
let t = B.value[e];
|
|
4600
|
+
let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), ae = A(!1), P = f(() => e.chatController?.liveTurnBlocks?.value ?? []), oe = f(() => {
|
|
4601
|
+
for (let e = P.value.length - 1; e >= 0; e--) {
|
|
4602
|
+
let t = P.value[e];
|
|
4617
4603
|
if (t?.kind === "text") return t.id;
|
|
4618
4604
|
}
|
|
4619
|
-
}),
|
|
4605
|
+
}), de = f(() => e.chatController?.liveStreamMessageId?.value), B = f(() => {
|
|
4620
4606
|
let t = e.chatController?.sharedMessages.value ?? [];
|
|
4621
|
-
return
|
|
4622
|
-
}),
|
|
4607
|
+
return P.value.length && de.value ? t.filter((e) => e.id !== de.value) : t;
|
|
4608
|
+
}), he = f(() => {
|
|
4623
4609
|
if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
|
|
4624
|
-
}),
|
|
4625
|
-
if (!
|
|
4626
|
-
let e =
|
|
4610
|
+
}), _e = f(() => e.chatController?.workJournal?.value), ve = f(() => {
|
|
4611
|
+
if (!_e.value && !P.value.length) return;
|
|
4612
|
+
let e = B.value, t = e[e.length - 1];
|
|
4627
4613
|
if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
4628
|
-
}),
|
|
4614
|
+
}), ye = f(() => {
|
|
4629
4615
|
let t = {};
|
|
4630
|
-
for (let n of
|
|
4616
|
+
for (let n of B.value) {
|
|
4631
4617
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
4632
4618
|
let r = e.chatController?.workJournalFor?.({
|
|
4633
4619
|
activities: n.toolActivities,
|
|
@@ -4639,7 +4625,7 @@ var Cr = [
|
|
|
4639
4625
|
return t;
|
|
4640
4626
|
});
|
|
4641
4627
|
function messageWorkJournal(e) {
|
|
4642
|
-
return
|
|
4628
|
+
return ye.value[e.id];
|
|
4643
4629
|
}
|
|
4644
4630
|
function inlineOffset(e, t) {
|
|
4645
4631
|
return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
|
|
@@ -4687,57 +4673,57 @@ var Cr = [
|
|
|
4687
4673
|
text: t.slice(i)
|
|
4688
4674
|
}), r;
|
|
4689
4675
|
}
|
|
4690
|
-
let
|
|
4676
|
+
let H = f(() => s.value?.transientIssue), be = f(() => {
|
|
4691
4677
|
if (!x.value) return;
|
|
4692
|
-
let e =
|
|
4678
|
+
let e = B.value, t = e[e.length - 1];
|
|
4693
4679
|
return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
|
|
4694
|
-
}),
|
|
4680
|
+
}), U = f(() => !x.value || he.value || _e.value || P.value.length ? !1 : be.value === void 0), Se = f(() => s.value?.sendBlockedReason), W = f(() => Se.value !== void 0), Ce = f(() => T.value ? `${e.agent.displayName.value || e.agent.name.value || "Assistant"} is offline` : te.value ? "Connecting..." : Se.value === "agent_deleted" ? "This assistant was deleted" : Se.value === "account" ? "Open billing to keep chatting" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = f(() => e.chatController?.composerState?.value ?? {
|
|
4695
4681
|
text: "",
|
|
4696
4682
|
pendingAttachments: [],
|
|
4697
4683
|
isUploading: !1
|
|
4698
|
-
}),
|
|
4699
|
-
get: () =>
|
|
4684
|
+
}), Te = f({
|
|
4685
|
+
get: () => we.value.text,
|
|
4700
4686
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
4701
|
-
}),
|
|
4687
|
+
}), Ee = f(() => we.value.pendingAttachments), De = f(() => we.value.isUploading), Oe = f(() => e.chatController?.voiceRecorder), ke = f(() => Oe.value?.isBusy.value ?? !1), Ae = f(() => e.chatController?.canAttachFile?.value ?? !1), je = f(() => e.chatController?.canRecordAudio?.value ?? !1), Me = f(() => e.chatController?.composerAction?.value ?? "idle"), Ne = f(() => Me.value !== "idle"), Fe = f(() => Me.value === "stop" ? "Stop reply" : "Send message"), Ie = f(() => je.value && !ke.value && !!Oe.value?.canUseBrowserRecording), Le = f(() => Oe.value?.isActive.value ?? !1), Re = f(() => Oe.value?.elapsedLabel.value ?? "0:00"), Be = f(() => Oe.value?.statusText.value ?? "Release to send"), Ve = f(() => Oe.value?.state.value.phase === "sending" ? "Sending voice message" : Le.value ? "Release to send voice message" : "Hold to record voice message"), G = f(() => e.variant === "light"), He = f(() => G.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), Ue = f(() => G.value ? "text-theme-300" : "text-white/30");
|
|
4702
4688
|
ne(async () => {
|
|
4703
4689
|
e.chatController && !c.value && await e.chatController.startTextConversation();
|
|
4704
4690
|
}), re(() => {
|
|
4705
4691
|
e.chatController?.voiceRecorder?.teardown();
|
|
4706
4692
|
});
|
|
4707
4693
|
async function sendMessage() {
|
|
4708
|
-
!e.chatController ||
|
|
4694
|
+
!e.chatController || Me.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
|
|
4709
4695
|
}
|
|
4710
4696
|
async function sendSuggestedPrompt(t) {
|
|
4711
|
-
!e.chatController ||
|
|
4697
|
+
!e.chatController || W.value || (i.value?.pin(), await e.chatController.sendChatMessage(t.prompt));
|
|
4712
4698
|
}
|
|
4713
4699
|
async function handleComposerAction() {
|
|
4714
|
-
e.chatController && (
|
|
4700
|
+
e.chatController && (Me.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
|
|
4715
4701
|
}
|
|
4716
4702
|
async function handleKeydown(e) {
|
|
4717
4703
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
|
|
4718
4704
|
}
|
|
4719
4705
|
function focusComposer(e) {
|
|
4720
|
-
|
|
4706
|
+
Le.value || W.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
|
|
4721
4707
|
}
|
|
4722
4708
|
function adjustTextareaHeight() {
|
|
4723
4709
|
a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
|
|
4724
4710
|
}
|
|
4725
|
-
se(
|
|
4711
|
+
se(Te, () => S(() => adjustTextareaHeight()));
|
|
4726
4712
|
function triggerFileInput() {
|
|
4727
4713
|
o.value?.click();
|
|
4728
4714
|
}
|
|
4729
4715
|
async function handleFileSelect(t) {
|
|
4730
4716
|
let n = t.target, r = n.files?.[0];
|
|
4731
|
-
!r || !e.chatController ||
|
|
4717
|
+
!r || !e.chatController || ke.value || (await e.chatController.attachFile({ file: r }), n.value = "");
|
|
4732
4718
|
}
|
|
4733
4719
|
function removeAttachment(t) {
|
|
4734
4720
|
e.chatController?.removeAttachment({ index: t });
|
|
4735
4721
|
}
|
|
4736
4722
|
function startRecording() {
|
|
4737
|
-
|
|
4723
|
+
Oe.value?.start();
|
|
4738
4724
|
}
|
|
4739
4725
|
function finishRecording(e) {
|
|
4740
|
-
|
|
4726
|
+
Oe.value?.finish(e);
|
|
4741
4727
|
}
|
|
4742
4728
|
function shouldShowTimeDivider(e, t) {
|
|
4743
4729
|
if (t === 0) {
|
|
@@ -4766,57 +4752,57 @@ var Cr = [
|
|
|
4766
4752
|
...o ? {} : { year: "numeric" }
|
|
4767
4753
|
})}, ${a}`;
|
|
4768
4754
|
}
|
|
4769
|
-
return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col",
|
|
4770
|
-
e.showHeader && !
|
|
4755
|
+
return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col", B.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""]) }, [
|
|
4756
|
+
e.showHeader && !G.value ? (k(), h("div", ni, [b(Pe, {
|
|
4771
4757
|
agent: e.agent,
|
|
4772
4758
|
"is-online": c.value
|
|
4773
4759
|
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div", ri, [_("div", { class: C(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
|
|
4774
|
-
b(
|
|
4760
|
+
b(ze, {
|
|
4775
4761
|
agent: e.agent,
|
|
4776
|
-
"is-light":
|
|
4762
|
+
"is-light": G.value,
|
|
4777
4763
|
class: "size-10"
|
|
4778
4764
|
}, null, 8, ["agent", "is-light"]),
|
|
4779
4765
|
_("div", ii, [_("div", ai, F(e.agent.displayName.value), 1), _("div", oi, F(e.agent.title.value || "Assistant"), 1)]),
|
|
4780
4766
|
e.headerMeta ? (k(), h("span", si, F(e.headerMeta), 1)) : m("", !0)
|
|
4781
4767
|
], 2)])) : m("", !0),
|
|
4782
|
-
|
|
4768
|
+
te.value ? (k(), h("div", {
|
|
4783
4769
|
key: 2,
|
|
4784
|
-
class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm",
|
|
4785
|
-
}, [b(
|
|
4770
|
+
class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm", G.value ? "text-theme-400" : "text-theme-600"])
|
|
4771
|
+
}, [b(pe, { class: "size-4" })], 2)) : e.setupHint ? (k(), h("div", {
|
|
4786
4772
|
key: 3,
|
|
4787
|
-
class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]",
|
|
4773
|
+
class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Ue.value])
|
|
4788
4774
|
}, [s[20] || (s[20] = _("i", { class: "i-tabler-tool size-3" }, null, -1)), _("span", null, F(e.setupHint), 1)], 2)) : m("", !0),
|
|
4789
4775
|
b(ti, {
|
|
4790
4776
|
ref_key: "chatScroller",
|
|
4791
4777
|
ref: i,
|
|
4792
|
-
class: C(
|
|
4778
|
+
class: C(B.value.length === 0 ? "flex-none" : "flex-1")
|
|
4793
4779
|
}, {
|
|
4794
|
-
default: ce(() => [_("div", { class: C([
|
|
4795
|
-
|
|
4780
|
+
default: ce(() => [_("div", { class: C([B.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? B.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
4781
|
+
B.value.length === 0 && !te.value ? (k(), h("div", ci, [ie(t.$slots, "empty-heading", {
|
|
4796
4782
|
agent: e.agent,
|
|
4797
|
-
isLight:
|
|
4798
|
-
}, () => [b(
|
|
4783
|
+
isLight: G.value
|
|
4784
|
+
}, () => [b(ze, {
|
|
4799
4785
|
agent: e.agent,
|
|
4800
|
-
"is-light":
|
|
4786
|
+
"is-light": G.value,
|
|
4801
4787
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
4802
|
-
}, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold",
|
|
4803
|
-
class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]",
|
|
4788
|
+
}, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold", G.value ? "text-theme-900" : "text-white"]) }, F(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? m("", !0) : (k(), h(u, { key: 0 }, [_("p", { class: C(["mt-1 text-center text-xs @sm/chat:text-sm", Ue.value]) }, F(e.emptyStateMessage || "Type your message to get started."), 3), _("div", {
|
|
4789
|
+
class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", G.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
4804
4790
|
title: n.value.tooltip
|
|
4805
4791
|
}, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, F(n.value.label), 1)], 10, li)], 64))])) : m("", !0),
|
|
4806
|
-
(k(!0), h(u, null, j(
|
|
4807
|
-
shouldShowTimeDivider(
|
|
4808
|
-
_("div", { class: C(["flex-1 h-px",
|
|
4809
|
-
_("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase",
|
|
4810
|
-
_("div", { class: C(["flex-1 h-px",
|
|
4792
|
+
(k(!0), h(u, null, j(B.value, (e, t) => (k(), h(u, { key: e.id }, [
|
|
4793
|
+
shouldShowTimeDivider(B.value, t) ? (k(), h("div", ui, [
|
|
4794
|
+
_("div", { class: C(["flex-1 h-px", He.value]) }, null, 2),
|
|
4795
|
+
_("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Ue.value]) }, F(shouldShowTimeDivider(B.value, t)), 3),
|
|
4796
|
+
_("div", { class: C(["flex-1 h-px", He.value]) }, null, 2)
|
|
4811
4797
|
])) : m("", !0),
|
|
4812
4798
|
messageWorkJournal(e) ? (k(), h("div", {
|
|
4813
4799
|
key: 1,
|
|
4814
4800
|
"data-test": "messaging-message-tool-activity",
|
|
4815
4801
|
"data-journal-outcome": messageWorkJournal(e)?.outcome,
|
|
4816
4802
|
class: "mb-4 w-full"
|
|
4817
|
-
}, [b(
|
|
4803
|
+
}, [b(qe, {
|
|
4818
4804
|
model: messageWorkJournal(e),
|
|
4819
|
-
"is-light":
|
|
4805
|
+
"is-light": G.value
|
|
4820
4806
|
}, null, 8, ["model", "is-light"])], 8, di)) : m("", !0),
|
|
4821
4807
|
isSystemExplainerMessage(e) ? (k(), h("div", {
|
|
4822
4808
|
key: 2,
|
|
@@ -4830,13 +4816,13 @@ var Cr = [
|
|
|
4830
4816
|
"data-issue-bucket": e.issue?.bucket,
|
|
4831
4817
|
"data-issue-action-label": e.issue?.actionLabel,
|
|
4832
4818
|
"data-issue-action-url": e.issue?.actionUrl,
|
|
4833
|
-
"data-streaming": e.id ===
|
|
4819
|
+
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4834
4820
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4835
|
-
}, [_("div", pi, [_("div", { class: C(["mb-1 pl-1 text-[11px] font-medium",
|
|
4821
|
+
}, [_("div", pi, [_("div", { class: C(["mb-1 pl-1 text-[11px] font-medium", G.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), _("div", { class: C(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", G.value ? "bg-theme-25 border-theme-100 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (k(), p($r, {
|
|
4836
4822
|
key: 0,
|
|
4837
4823
|
text: e.text,
|
|
4838
|
-
inverted: !
|
|
4839
|
-
streaming: e.id ===
|
|
4824
|
+
inverted: !G.value,
|
|
4825
|
+
streaming: e.id === be.value,
|
|
4840
4826
|
onClick: s[0] || (s[0] = z(() => {}, ["stop"]))
|
|
4841
4827
|
}, null, 8, [
|
|
4842
4828
|
"text",
|
|
@@ -4845,12 +4831,12 @@ var Cr = [
|
|
|
4845
4831
|
])) : e.issue?.help ? (k(), p($r, {
|
|
4846
4832
|
key: 1,
|
|
4847
4833
|
text: e.issue.help,
|
|
4848
|
-
inverted: !
|
|
4834
|
+
inverted: !G.value
|
|
4849
4835
|
}, null, 8, ["text", "inverted"])) : m("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (k(), h("a", {
|
|
4850
4836
|
key: 2,
|
|
4851
4837
|
href: e.issue.actionUrl,
|
|
4852
4838
|
"data-test": "messaging-system-msg-action",
|
|
4853
|
-
class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1",
|
|
4839
|
+
class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", G.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
4854
4840
|
onClick: s[1] || (s[1] = z(() => {}, ["stop"]))
|
|
4855
4841
|
}, [v(F(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, mi)) : m("", !0)], 2)])], 8, fi)) : e.sender === "system" ? (k(), h("div", {
|
|
4856
4842
|
key: 3,
|
|
@@ -4862,11 +4848,11 @@ var Cr = [
|
|
|
4862
4848
|
"data-system-kind": e.systemKind,
|
|
4863
4849
|
"data-issue-code": e.issue?.code,
|
|
4864
4850
|
"data-issue-bucket": e.issue?.bucket,
|
|
4865
|
-
"data-streaming": e.id ===
|
|
4866
|
-
class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed",
|
|
4851
|
+
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4852
|
+
class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", G.value ? "text-theme-500" : "text-white/60"])
|
|
4867
4853
|
}, [s[22] || (s[22] = _("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b($r, {
|
|
4868
4854
|
text: e.text,
|
|
4869
|
-
inverted: !
|
|
4855
|
+
inverted: !G.value,
|
|
4870
4856
|
onClick: s[2] || (s[2] = z(() => {}, ["stop"]))
|
|
4871
4857
|
}, null, 8, ["text", "inverted"])], 10, hi)) : (k(), h("div", {
|
|
4872
4858
|
key: 4,
|
|
@@ -4876,11 +4862,11 @@ var Cr = [
|
|
|
4876
4862
|
"data-conversation-id": e.conversationId,
|
|
4877
4863
|
"data-message-sequence": e.sequence,
|
|
4878
4864
|
"data-system-kind": e.systemKind,
|
|
4879
|
-
"data-streaming": e.id ===
|
|
4865
|
+
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4880
4866
|
class: C(["flex gap-2 items-end", {
|
|
4881
4867
|
"justify-end": e.sender === "user",
|
|
4882
4868
|
"justify-start": e.sender === "agent",
|
|
4883
|
-
"mb-6": isGroupEnd(
|
|
4869
|
+
"mb-6": isGroupEnd(B.value, t)
|
|
4884
4870
|
}])
|
|
4885
4871
|
}, [_("div", {
|
|
4886
4872
|
"data-test": "messaging-message-body",
|
|
@@ -4909,15 +4895,15 @@ var Cr = [
|
|
|
4909
4895
|
rel: "noopener",
|
|
4910
4896
|
"data-test": "messaging-attachment",
|
|
4911
4897
|
"data-attachment-placement": "block",
|
|
4912
|
-
class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
4898
|
+
class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4913
4899
|
}, [s[23] || (s[23] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(e.filename), 1)], 10, yi))], 64))), 128))], 2)) : m("", !0), messageRenderParts(e).length ? (k(), h("div", {
|
|
4914
4900
|
key: 1,
|
|
4915
4901
|
"data-test": "messaging-message-content",
|
|
4916
|
-
class: C(e.sender === "user" ?
|
|
4902
|
+
class: C(e.sender === "user" ? G.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" : G.value ? "text-theme-800" : "text-white/95")
|
|
4917
4903
|
}, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div", bi, [b($r, {
|
|
4918
4904
|
text: t.text,
|
|
4919
|
-
inverted: e.sender === "user" || !
|
|
4920
|
-
streaming: e.id ===
|
|
4905
|
+
inverted: e.sender === "user" || !G.value,
|
|
4906
|
+
streaming: e.id === be.value,
|
|
4921
4907
|
onClick: s[3] || (s[3] = z(() => {}, ["stop"]))
|
|
4922
4908
|
}, null, 8, [
|
|
4923
4909
|
"text",
|
|
@@ -4944,93 +4930,93 @@ var Cr = [
|
|
|
4944
4930
|
rel: "noopener",
|
|
4945
4931
|
"data-test": "messaging-attachment",
|
|
4946
4932
|
"data-attachment-placement": t.placement,
|
|
4947
|
-
class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
4933
|
+
class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4948
4934
|
}, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(t.attachment.filename), 1)], 10, Ci)) : m("", !0)], 64))), 128))], 2)) : m("", !0)], 2)], 10, gi)),
|
|
4949
|
-
e.id ===
|
|
4935
|
+
e.id === ve.value ? (k(), h(u, { key: 5 }, [P.value.length ? (k(!0), h(u, { key: 0 }, j(P.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
|
|
4950
4936
|
key: 0,
|
|
4951
4937
|
"data-test": "messaging-tool-activity",
|
|
4952
4938
|
"data-journal-outcome": e.journal.outcome,
|
|
4953
4939
|
class: "mb-4 w-full"
|
|
4954
|
-
}, [b(
|
|
4940
|
+
}, [b(qe, {
|
|
4955
4941
|
model: e.journal,
|
|
4956
|
-
"is-light":
|
|
4942
|
+
"is-light": G.value
|
|
4957
4943
|
}, null, 8, ["model", "is-light"])], 8, wi)) : e.kind === "text" && e.content ? (k(), h("div", {
|
|
4958
4944
|
key: 1,
|
|
4959
4945
|
"data-test": "messaging-live-text-block",
|
|
4960
|
-
class: C(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]",
|
|
4946
|
+
class: C(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", G.value ? "text-theme-800" : "text-white/95"])
|
|
4961
4947
|
}, [b($r, {
|
|
4962
4948
|
text: e.content,
|
|
4963
|
-
inverted: !
|
|
4964
|
-
streaming: e.id ===
|
|
4949
|
+
inverted: !G.value,
|
|
4950
|
+
streaming: e.id === oe.value,
|
|
4965
4951
|
onClick: s[4] || (s[4] = z(() => {}, ["stop"]))
|
|
4966
4952
|
}, null, 8, [
|
|
4967
4953
|
"text",
|
|
4968
4954
|
"inverted",
|
|
4969
4955
|
"streaming"
|
|
4970
|
-
])], 2)) : (k(), h("div", Ti, [b(
|
|
4956
|
+
])], 2)) : (k(), h("div", Ti, [b(pe, { class: C(["size-3.5", G.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : _e.value ? (k(), h("div", {
|
|
4971
4957
|
key: 1,
|
|
4972
4958
|
"data-test": "messaging-tool-activity",
|
|
4973
|
-
"data-journal-outcome":
|
|
4959
|
+
"data-journal-outcome": _e.value.outcome,
|
|
4974
4960
|
class: "mb-4 w-full"
|
|
4975
|
-
}, [b(
|
|
4976
|
-
model:
|
|
4977
|
-
"is-light":
|
|
4961
|
+
}, [b(qe, {
|
|
4962
|
+
model: _e.value,
|
|
4963
|
+
"is-light": G.value
|
|
4978
4964
|
}, null, 8, ["model", "is-light"])], 8, Ei)) : m("", !0)], 64)) : m("", !0)
|
|
4979
4965
|
], 64))), 128)),
|
|
4980
|
-
|
|
4966
|
+
he.value ? (k(), h("div", {
|
|
4981
4967
|
key: 1,
|
|
4982
4968
|
"data-test": "messaging-working-state",
|
|
4983
|
-
"data-working-description":
|
|
4984
|
-
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none",
|
|
4969
|
+
"data-working-description": he.value,
|
|
4970
|
+
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", G.value ? "text-theme-500" : "text-white/45"])
|
|
4985
4971
|
}, [s[25] || (s[25] = _("i", {
|
|
4986
4972
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4987
4973
|
"aria-hidden": "true"
|
|
4988
|
-
}, null, -1)), _("span", Oi, F(
|
|
4989
|
-
|
|
4974
|
+
}, null, -1)), _("span", Oi, F(he.value), 1)], 10, Di)) : m("", !0),
|
|
4975
|
+
H.value ? (k(), h("div", {
|
|
4990
4976
|
key: 2,
|
|
4991
4977
|
"data-test": "messaging-transient-issue",
|
|
4992
|
-
"data-issue-code":
|
|
4993
|
-
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug",
|
|
4978
|
+
"data-issue-code": H.value.code,
|
|
4979
|
+
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", G.value ? "text-theme-600" : "text-white/60"])
|
|
4994
4980
|
}, [
|
|
4995
4981
|
s[26] || (s[26] = _("i", {
|
|
4996
4982
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
4997
4983
|
"aria-hidden": "true"
|
|
4998
4984
|
}, null, -1)),
|
|
4999
|
-
_("span", null, [v(F(
|
|
5000
|
-
|
|
4985
|
+
_("span", null, [v(F(H.value.message), 1), H.value.help ? (k(), h(u, { key: 0 }, [v(F(H.value.help), 1)], 64)) : m("", !0)]),
|
|
4986
|
+
H.value.actionUrl && H.value.actionLabel ? (k(), h("a", {
|
|
5001
4987
|
key: 0,
|
|
5002
|
-
href:
|
|
4988
|
+
href: H.value.actionUrl,
|
|
5003
4989
|
class: "shrink-0 underline underline-offset-2",
|
|
5004
4990
|
onClick: s[5] || (s[5] = z(() => {}, ["stop"]))
|
|
5005
|
-
}, F(
|
|
4991
|
+
}, F(H.value.actionLabel), 9, Ai)) : m("", !0)
|
|
5006
4992
|
], 10, ki)) : m("", !0),
|
|
5007
|
-
|
|
5008
|
-
class: C(["i-svg-spinners-3-dots-bounce size-7",
|
|
4993
|
+
U.value ? (k(), h("div", ji, [_("i", {
|
|
4994
|
+
class: C(["i-svg-spinners-3-dots-bounce size-7", G.value ? "text-theme-400" : "text-white/50"]),
|
|
5009
4995
|
"aria-hidden": "true"
|
|
5010
4996
|
}, null, 2)])) : m("", !0)
|
|
5011
4997
|
], 2)]),
|
|
5012
4998
|
_: 3
|
|
5013
4999
|
}, 8, ["class"]),
|
|
5014
|
-
_("div", { class: C(["left-0 right-0 z-30 px-5 pb-4 pt-3", [
|
|
5015
|
-
|
|
5000
|
+
_("div", { class: C(["left-0 right-0 z-30 px-5 pb-4 pt-3", [B.value.length === 0 ? "relative shrink-0" : "absolute bottom-0", G.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"]]) }, [
|
|
5001
|
+
Ee.value.length > 0 ? (k(), h("div", {
|
|
5016
5002
|
key: 0,
|
|
5017
5003
|
class: C(["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" : ""])
|
|
5018
|
-
}, [(k(!0), h(u, null, j(
|
|
5004
|
+
}, [(k(!0), h(u, null, j(Ee.value, (e, t) => (k(), h("div", {
|
|
5019
5005
|
key: t,
|
|
5020
5006
|
class: "relative shrink-0 group"
|
|
5021
5007
|
}, [e.type === "image" ? (k(), h("img", {
|
|
5022
5008
|
key: 0,
|
|
5023
5009
|
src: e.src,
|
|
5024
5010
|
alt: e.filename,
|
|
5025
|
-
class: C(["size-14 rounded-xl object-cover border",
|
|
5011
|
+
class: C(["size-14 rounded-xl object-cover border", G.value ? "border-black/10" : "border-white/20"])
|
|
5026
5012
|
}, null, 10, Mi)) : (k(), h("div", {
|
|
5027
5013
|
key: 1,
|
|
5028
|
-
class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border",
|
|
5014
|
+
class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", G.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
5029
5015
|
}, [s[27] || (s[27] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span", Ni, F(e.filename), 1)], 2)), _("button", {
|
|
5030
5016
|
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",
|
|
5031
5017
|
onClick: (e) => removeAttachment(t)
|
|
5032
|
-
}, [...s[28] || (s[28] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Pi)]))), 128)),
|
|
5033
|
-
|
|
5018
|
+
}, [...s[28] || (s[28] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Pi)]))), 128)), De.value ? (k(), h("div", Fi, [b(pe, { class: "size-5" })])) : m("", !0)], 2)) : m("", !0),
|
|
5019
|
+
Ae.value ? (k(), h("input", {
|
|
5034
5020
|
key: 1,
|
|
5035
5021
|
ref_key: "fileInput",
|
|
5036
5022
|
ref: o,
|
|
@@ -5041,56 +5027,54 @@ var Cr = [
|
|
|
5041
5027
|
}, null, 544)) : m("", !0),
|
|
5042
5028
|
_("div", {
|
|
5043
5029
|
"data-test": "messaging-composer",
|
|
5044
|
-
"data-composer-action":
|
|
5045
|
-
"
|
|
5046
|
-
title: _e.value,
|
|
5047
|
-
class: C(["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"]]),
|
|
5030
|
+
"data-composer-action": Me.value,
|
|
5031
|
+
class: C(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", G.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"]]),
|
|
5048
5032
|
onClick: focusComposer
|
|
5049
|
-
}, [
|
|
5033
|
+
}, [Le.value ? (k(), h("div", {
|
|
5050
5034
|
key: 1,
|
|
5051
5035
|
"data-test": "messaging-recording-state",
|
|
5052
|
-
class: C(["flex min-w-0 items-center gap-2 py-1",
|
|
5036
|
+
class: C(["flex min-w-0 items-center gap-2 py-1", G.value ? "text-theme-700" : "text-white/80"])
|
|
5053
5037
|
}, [
|
|
5054
5038
|
s[29] || (s[29] = _("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5055
|
-
_("span", Ri, F(
|
|
5056
|
-
_("span", { class: C(["min-w-0 truncate text-sm",
|
|
5039
|
+
_("span", Ri, F(Re.value), 1),
|
|
5040
|
+
_("span", { class: C(["min-w-0 truncate text-sm", G.value ? "text-theme-400" : "text-white/45"]) }, F(Be.value), 3)
|
|
5057
5041
|
], 2)) : R((k(), h("textarea", {
|
|
5058
5042
|
key: 0,
|
|
5059
5043
|
ref_key: "textarea",
|
|
5060
5044
|
ref: a,
|
|
5061
|
-
"onUpdate:modelValue": s[6] || (s[6] = (e) =>
|
|
5045
|
+
"onUpdate:modelValue": s[6] || (s[6] = (e) => Te.value = e),
|
|
5062
5046
|
"data-test": "messaging-input",
|
|
5063
5047
|
rows: "1",
|
|
5064
5048
|
enterkeyhint: "send",
|
|
5065
|
-
placeholder:
|
|
5066
|
-
disabled:
|
|
5049
|
+
placeholder: Ce.value,
|
|
5050
|
+
disabled: W.value,
|
|
5067
5051
|
style: {
|
|
5068
5052
|
fontSize: "16px",
|
|
5069
5053
|
resize: "none"
|
|
5070
5054
|
},
|
|
5071
|
-
class: C(["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",
|
|
5055
|
+
class: C(["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", G.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
5072
5056
|
onKeydown: handleKeydown,
|
|
5073
5057
|
onFocus: s[7] || (s[7] = (e) => r.value = !0),
|
|
5074
5058
|
onBlur: s[8] || (s[8] = (e) => r.value = !1)
|
|
5075
|
-
}, null, 42, Li)), [[I,
|
|
5059
|
+
}, null, 42, Li)), [[I, Te.value]]), _("div", zi, [
|
|
5076
5060
|
_("button", {
|
|
5077
5061
|
class: C(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5062
|
+
Ae.value ? "cursor-pointer" : "cursor-default",
|
|
5063
|
+
G.value ? "text-theme-500" : "text-white/50",
|
|
5064
|
+
De.value || ke.value ? "opacity-50 pointer-events-none" : ""
|
|
5081
5065
|
]]),
|
|
5082
|
-
disabled:
|
|
5083
|
-
"aria-label":
|
|
5084
|
-
title:
|
|
5085
|
-
onClick: s[9] || (s[9] = (e) =>
|
|
5086
|
-
}, [
|
|
5066
|
+
disabled: W.value || De.value || ke.value || !Ae.value,
|
|
5067
|
+
"aria-label": Ae.value ? "Attach file" : "File attachments unavailable",
|
|
5068
|
+
title: Ae.value ? "Attach file" : "File attachments unavailable",
|
|
5069
|
+
onClick: s[9] || (s[9] = (e) => Ae.value && triggerFileInput())
|
|
5070
|
+
}, [De.value ? (k(), h("i", Vi)) : (k(), h("i", Hi)), _("span", Ui, F(Ae.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Bi),
|
|
5087
5071
|
s[30] || (s[30] = _("div", { class: "flex-1" }, null, -1)),
|
|
5088
|
-
_("div", Wi, [
|
|
5072
|
+
_("div", Wi, [Ie.value || Le.value ? (k(), h("button", {
|
|
5089
5073
|
key: 0,
|
|
5090
5074
|
"data-test": "messaging-record-audio-btn",
|
|
5091
|
-
class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70",
|
|
5092
|
-
"aria-label":
|
|
5093
|
-
title:
|
|
5075
|
+
class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Le.value ? G.value ? "text-theme-900 scale-110" : "text-white scale-110" : G.value ? "text-theme-500" : "text-white/60"]),
|
|
5076
|
+
"aria-label": Ve.value,
|
|
5077
|
+
title: Ve.value,
|
|
5094
5078
|
onPointerdown: s[10] || (s[10] = z((e) => startRecording(), ["prevent"])),
|
|
5095
5079
|
onPointerup: s[11] || (s[11] = z((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
|
|
5096
5080
|
onPointercancel: s[12] || (s[12] = z((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
|
|
@@ -5100,45 +5084,45 @@ var Cr = [
|
|
|
5100
5084
|
s[17] || (s[17] = ue(z((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5101
5085
|
],
|
|
5102
5086
|
onKeyup: [s[14] || (s[14] = ue(z((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[16] || (s[16] = ue(z((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
|
|
5103
|
-
}, [_("i", { class: C([
|
|
5087
|
+
}, [_("i", { class: C([Le.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span", Ki, F(Ve.value), 1)], 42, Gi)) : m("", !0), Le.value ? m("", !0) : (k(), h("button", {
|
|
5104
5088
|
key: 1,
|
|
5105
5089
|
"data-test": "messaging-send-btn",
|
|
5106
|
-
"data-composer-action":
|
|
5107
|
-
class: C(["flex size-8 items-center justify-center rounded-full transition-colors duration-150",
|
|
5108
|
-
disabled: !
|
|
5109
|
-
"aria-label":
|
|
5110
|
-
title:
|
|
5090
|
+
"data-composer-action": Me.value,
|
|
5091
|
+
class: C(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Ne.value ? G.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" : G.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
5092
|
+
disabled: !Ne.value,
|
|
5093
|
+
"aria-label": Fe.value,
|
|
5094
|
+
title: Fe.value,
|
|
5111
5095
|
onClick: s[18] || (s[18] = (e) => handleComposerAction())
|
|
5112
|
-
}, [
|
|
5096
|
+
}, [Me.value === "stop" ? (k(), h("i", Ji)) : (k(), h("i", Yi)), _("span", Xi, F(Fe.value), 1)], 10, qi))])
|
|
5113
5097
|
])], 10, Ii),
|
|
5114
|
-
|
|
5098
|
+
B.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", Zi, [_("div", Qi, [(k(!0), h(u, null, j(e.suggestedPrompts, (e, t) => (k(), h("button", {
|
|
5115
5099
|
key: e.id,
|
|
5116
5100
|
type: "button",
|
|
5117
|
-
disabled:
|
|
5101
|
+
disabled: W.value,
|
|
5118
5102
|
"data-test": "messaging-suggested-prompt",
|
|
5119
|
-
class: C(["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]", [
|
|
5103
|
+
class: C(["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", !ae.value && t >= 3 ? "max-sm:hidden" : ""]]),
|
|
5120
5104
|
onClick: (t) => sendSuggestedPrompt(e)
|
|
5121
5105
|
}, F(e.label), 11, $i))), 128)), e.suggestedPrompts.length > 3 ? (k(), h("button", {
|
|
5122
5106
|
key: 0,
|
|
5123
5107
|
type: "button",
|
|
5124
5108
|
"data-test": "messaging-suggested-prompts-more",
|
|
5125
|
-
"aria-expanded":
|
|
5109
|
+
"aria-expanded": ae.value,
|
|
5126
5110
|
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",
|
|
5127
|
-
onClick: s[19] || (s[19] = (e) =>
|
|
5128
|
-
}, [v(F(
|
|
5111
|
+
onClick: s[19] || (s[19] = (e) => ae.value = !ae.value)
|
|
5112
|
+
}, [v(F(ae.value ? "See less" : "See more") + " ", 1), _("i", { class: C(["i-tabler-chevron-down size-4 transition-transform", ae.value ? "rotate-180" : ""]) }, null, 2)], 8, ea)) : m("", !0)])])) : m("", !0)
|
|
5129
5113
|
], 2)
|
|
5130
5114
|
], 2));
|
|
5131
5115
|
}
|
|
5132
|
-
}),
|
|
5116
|
+
}), na = { class: "agent-wrap" }, ra = {
|
|
5133
5117
|
key: 0,
|
|
5134
5118
|
class: "flex items-center justify-center h-full"
|
|
5135
|
-
},
|
|
5119
|
+
}, ia = {
|
|
5136
5120
|
key: 2,
|
|
5137
5121
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5138
5122
|
role: "status",
|
|
5139
5123
|
"aria-live": "polite",
|
|
5140
5124
|
"data-test": "agent-unavailable"
|
|
5141
|
-
},
|
|
5125
|
+
}, aa = /* @__PURE__ */ x({
|
|
5142
5126
|
__name: "AgentWrap",
|
|
5143
5127
|
props: {
|
|
5144
5128
|
sdk: {},
|
|
@@ -5234,7 +5218,7 @@ var Cr = [
|
|
|
5234
5218
|
});
|
|
5235
5219
|
}
|
|
5236
5220
|
}
|
|
5237
|
-
return ne(loadAgent), (t, n) => (k(), h("div",
|
|
5221
|
+
return ne(loadAgent), (t, n) => (k(), h("div", na, [s.value ? (k(), h("div", ra, [_("div", { class: C(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ie(t.$slots, "default", {
|
|
5238
5222
|
sdk: oe(o),
|
|
5239
5223
|
agent: c.value,
|
|
5240
5224
|
context: e.clientContext ?? e.context,
|
|
@@ -5242,7 +5226,7 @@ var Cr = [
|
|
|
5242
5226
|
buttonText: e.buttonText,
|
|
5243
5227
|
buttonIcon: e.buttonIcon,
|
|
5244
5228
|
loading: s.value
|
|
5245
|
-
}, void 0, void 0, 1) : u.value ? (k(), h("div",
|
|
5229
|
+
}, void 0, void 0, 1) : u.value ? (k(), h("div", ia, [n[0] || (n[0] = _("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), _("button", {
|
|
5246
5230
|
type: "button",
|
|
5247
5231
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5248
5232
|
"data-test": "agent-unavailable-retry",
|
|
@@ -5251,6 +5235,6 @@ var Cr = [
|
|
|
5251
5235
|
}
|
|
5252
5236
|
});
|
|
5253
5237
|
//#endregion
|
|
5254
|
-
export {
|
|
5238
|
+
export { Oe as a, getAgentAvatarUrl as c, AgentChatController as d, he as f, Pe as i, handleImageError as l, pe as m, ta as n, Ee as o, n as p, $r as r, we as s, aa as t, parseButtonTemplate as u };
|
|
5255
5239
|
|
|
5256
5240
|
//# sourceMappingURL=AgentWrap.js.map
|