@pagelines/sdk 1.0.614 → 1.0.615
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.
|
@@ -2,7 +2,7 @@ var Gn = Object.defineProperty;
|
|
|
2
2
|
var Fs = (a, t, e) => t in a ? Gn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var h = (a, t) => Gn(a, "name", { value: t, configurable: !0 });
|
|
4
4
|
var B = (a, t, e) => Fs(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
-
import { defineComponent as ze, openBlock as m, createElementBlock as x, createElementVNode as w, normalizeClass as
|
|
5
|
+
import { defineComponent as ze, openBlock as m, createElementBlock as x, createElementVNode as w, normalizeClass as $, ref as xe, watch as Bt, computed as I, createCommentVNode as j, renderSlot as fn, onMounted as Wt, unref as cn, Fragment as ae, toDisplayString as Z, normalizeStyle as ne, renderList as me, shallowRef as fs, onBeforeUnmount as gs, createBlock as un, nextTick as Bs, createVNode as rt, withCtx as Us, withModifiers as wt, createTextVNode as Nt, withDirectives as Hs, vModelText as Gs } from "vue";
|
|
6
6
|
import { SettingsObject as js, Agent as Ut, getDefaultAvatarUrl as ms, parseChatVisualFencePayload as Ws, createLogger as qs } from "@pagelines/core";
|
|
7
7
|
import { P as Vs } from "./sdkClient.js";
|
|
8
8
|
const Ys = { class: "spinner max-w-sm" }, Ks = {
|
|
@@ -18,7 +18,7 @@ const Ys = { class: "spinner max-w-sm" }, Ks = {
|
|
|
18
18
|
return (t, e) => (m(), x("div", Ys, [
|
|
19
19
|
(m(), x("svg", Ks, [
|
|
20
20
|
w("circle", {
|
|
21
|
-
class:
|
|
21
|
+
class: $([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -33,7 +33,7 @@ const Ys = { class: "spinner max-w-sm" }, Ks = {
|
|
|
33
33
|
}), Zs = [
|
|
34
34
|
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
35
35
|
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
36
|
-
], Xs = 9e4, xs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Qs = /* @__PURE__ */ new Set([...xs, "EMPTY_STREAM", "RATE_LIMIT"]),
|
|
36
|
+
], Xs = 9e4, xs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Qs = /* @__PURE__ */ new Set([...xs, "EMPTY_STREAM", "RATE_LIMIT"]), ks = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]);
|
|
37
37
|
function Js(a) {
|
|
38
38
|
if (!(a.bucket !== void 0 || Qs.has(a.code)))
|
|
39
39
|
return { surface: "hard" };
|
|
@@ -42,7 +42,7 @@ function Js(a) {
|
|
|
42
42
|
...a.actionUrl ? { actionUrl: a.actionUrl } : {},
|
|
43
43
|
...a.help ? { help: a.help } : {}
|
|
44
44
|
};
|
|
45
|
-
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } :
|
|
45
|
+
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : ks.has(a.code) ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "agent_deleted" } : { surface: "transient", issue: { code: a.code, message: a.error, ...n } };
|
|
46
46
|
}
|
|
47
47
|
h(Js, "presentChatStreamError");
|
|
48
48
|
const Sn = class Sn extends js {
|
|
@@ -243,32 +243,32 @@ Current User:
|
|
|
243
243
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0 });
|
|
244
244
|
const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
|
|
245
245
|
let u = !1, c = !1;
|
|
246
|
-
const v = /* @__PURE__ */ h(() => l === this.activeTurnGeneration, "isCurrentTurn"),
|
|
246
|
+
const v = /* @__PURE__ */ h(() => l === this.activeTurnGeneration, "isCurrentTurn"), b = /* @__PURE__ */ h((M, P = "assistant") => {
|
|
247
247
|
if (!v())
|
|
248
248
|
return;
|
|
249
249
|
this.updateState(this.textState, { workingDescription: void 0 }), u || (u = !0, this.sharedMessages.value = [
|
|
250
250
|
...this.sharedMessages.value,
|
|
251
|
-
{ id: o, text: "", sender:
|
|
251
|
+
{ id: o, text: "", sender: P === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
252
252
|
]);
|
|
253
|
-
const
|
|
254
|
-
q?.id === o && (q.text +=
|
|
255
|
-
}, "onDelta"),
|
|
253
|
+
const F = this.sharedMessages.value, q = F[F.length - 1];
|
|
254
|
+
q?.id === o && (q.text += M, this.sharedMessages.value = [...F]);
|
|
255
|
+
}, "onDelta"), A = /* @__PURE__ */ h((M) => {
|
|
256
256
|
if (!v())
|
|
257
257
|
return;
|
|
258
258
|
c = !0, u = !0, this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("completed");
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
259
|
+
const P = this.sharedMessages.value, F = P.findIndex((q) => q.id === M.id);
|
|
260
|
+
if (F >= 0)
|
|
261
261
|
this.sharedMessages.value = [
|
|
262
|
-
...
|
|
263
|
-
|
|
264
|
-
...
|
|
262
|
+
...P.slice(0, F),
|
|
263
|
+
M,
|
|
264
|
+
...P.slice(F + 1)
|
|
265
265
|
];
|
|
266
266
|
else {
|
|
267
|
-
const q =
|
|
268
|
-
this.sharedMessages.value = q?.id === o ? [...
|
|
267
|
+
const q = P[P.length - 1];
|
|
268
|
+
this.sharedMessages.value = q?.id === o ? [...P.slice(0, -1), M] : [...P, M];
|
|
269
269
|
}
|
|
270
|
-
|
|
271
|
-
}, "onMessage"), E = /* @__PURE__ */ h((
|
|
270
|
+
M.sender === "system" && M.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : M.sender === "system" && M.issue?.code && ks.has(M.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
271
|
+
}, "onMessage"), E = /* @__PURE__ */ h((M) => {
|
|
272
272
|
if (!v())
|
|
273
273
|
return;
|
|
274
274
|
if (!u && !c) {
|
|
@@ -276,47 +276,47 @@ Current User:
|
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
this.finishToolActivities("completed");
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
let q =
|
|
279
|
+
const P = this.sharedMessages.value, F = P[P.length - 1];
|
|
280
|
+
if (F?.id === o && F.sender === "agent" && F.text) {
|
|
281
|
+
let q = F.text;
|
|
282
282
|
for (const H of Zs)
|
|
283
283
|
H.pattern.test(q) && (console.debug(`[chat] filtered directive: ${H.label}`), q = q.replace(H.pattern, "").trim(), H.pattern.lastIndex = 0);
|
|
284
|
-
q ? q !==
|
|
284
|
+
q ? q !== F.text && (F.text = q, this.sharedMessages.value = [...P]) : this.sharedMessages.value = P.slice(0, -1);
|
|
285
285
|
}
|
|
286
|
-
|
|
287
|
-
}, "onDone"), G = /* @__PURE__ */ h((
|
|
286
|
+
M && (this.conversationId = M), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
287
|
+
}, "onDone"), G = /* @__PURE__ */ h((M) => {
|
|
288
288
|
if (!v())
|
|
289
289
|
return;
|
|
290
290
|
this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("failed");
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
const J = Js(
|
|
294
|
-
J.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: J.issue }) : J.surface === "transcript" ? (this.addMessage(
|
|
291
|
+
const P = this.sharedMessages.value, F = P[P.length - 1];
|
|
292
|
+
if (F?.id === o && !F.text && (this.sharedMessages.value = P.slice(0, -1)), typeof M == "object" && M.code && M.error) {
|
|
293
|
+
const J = Js(M);
|
|
294
|
+
J.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: J.issue }) : J.surface === "transcript" ? (this.addMessage(M.error, "system", void 0, J.issue), this.updateState(this.textState, {
|
|
295
295
|
isThinking: !1,
|
|
296
296
|
...J.sendBlockedReason ? { sendBlockedReason: J.sendBlockedReason } : {}
|
|
297
|
-
})) : this.handleError(new Error(
|
|
297
|
+
})) : this.handleError(new Error(M.error));
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
const q = typeof
|
|
300
|
+
const q = typeof M == "string" ? M : M.error, H = this.mapChatError(q);
|
|
301
301
|
this.isTransientError(q) ? (this.logger.warn("Chat turn failed (transient):", { raw: q, friendly: H }), this.addMessage(H, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(H), q);
|
|
302
|
-
}, "onError"), R = /* @__PURE__ */ h((
|
|
302
|
+
}, "onError"), R = /* @__PURE__ */ h((M) => {
|
|
303
303
|
if (!v())
|
|
304
304
|
return;
|
|
305
|
-
const
|
|
306
|
-
this.updateState(this.textState, { workingDescription:
|
|
307
|
-
}, "onStatus"), X = /* @__PURE__ */ h((
|
|
308
|
-
v() && this.updateToolActivity(
|
|
305
|
+
const P = M.trim();
|
|
306
|
+
this.updateState(this.textState, { workingDescription: P || void 0 });
|
|
307
|
+
}, "onStatus"), X = /* @__PURE__ */ h((M) => {
|
|
308
|
+
v() && this.updateToolActivity(M);
|
|
309
309
|
}, "onToolActivity"), Q = /* @__PURE__ */ h(() => {
|
|
310
310
|
v() && this.updateState(this.textState, { workingDescription: void 0 });
|
|
311
311
|
}, "onWorkingEnd");
|
|
312
312
|
try {
|
|
313
|
-
const
|
|
313
|
+
const M = i ? i({
|
|
314
314
|
message: e,
|
|
315
315
|
attachments: n,
|
|
316
316
|
conversationId: this.conversationId,
|
|
317
317
|
history: this.buildHistory(),
|
|
318
|
-
onDelta:
|
|
319
|
-
onMessage:
|
|
318
|
+
onDelta: b,
|
|
319
|
+
onMessage: A,
|
|
320
320
|
onDone: E,
|
|
321
321
|
onError: G,
|
|
322
322
|
onStatus: R,
|
|
@@ -328,8 +328,8 @@ Current User:
|
|
|
328
328
|
attachments: n,
|
|
329
329
|
anonymousId: s.user.generateAnonId(),
|
|
330
330
|
context: this.getDynamicSettings().context || void 0,
|
|
331
|
-
onDelta:
|
|
332
|
-
onMessage:
|
|
331
|
+
onDelta: b,
|
|
332
|
+
onMessage: A,
|
|
333
333
|
onDone: E,
|
|
334
334
|
onError: G,
|
|
335
335
|
onStatus: R,
|
|
@@ -337,11 +337,11 @@ Current User:
|
|
|
337
337
|
onWorkingEnd: Q
|
|
338
338
|
});
|
|
339
339
|
await Promise.race([
|
|
340
|
-
|
|
341
|
-
new Promise((
|
|
340
|
+
M,
|
|
341
|
+
new Promise((P, F) => setTimeout(() => F(new Error("timed out")), Xs))
|
|
342
342
|
]);
|
|
343
|
-
} catch (
|
|
344
|
-
G(
|
|
343
|
+
} catch (M) {
|
|
344
|
+
G(M.message || "Something went wrong");
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
async stopChatTurn() {
|
|
@@ -426,23 +426,23 @@ const ei = {
|
|
|
426
426
|
lg: "size-5"
|
|
427
427
|
})[a.size]);
|
|
428
428
|
return (i, s) => (m(), x("button", {
|
|
429
|
-
class:
|
|
429
|
+
class: $(["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, e.value]])
|
|
430
430
|
}, [
|
|
431
431
|
a.loading ? (m(), x("div", ei, [...s[0] || (s[0] = [
|
|
432
432
|
w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
433
|
-
])])) :
|
|
433
|
+
])])) : j("", !0),
|
|
434
434
|
w("span", {
|
|
435
|
-
class:
|
|
435
|
+
class: $(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
436
436
|
}, [
|
|
437
437
|
a.icon ? (m(), x("i", {
|
|
438
438
|
key: 0,
|
|
439
|
-
class:
|
|
440
|
-
}, null, 2)) :
|
|
439
|
+
class: $([a.icon, n.value])
|
|
440
|
+
}, null, 2)) : j("", !0),
|
|
441
441
|
fn(i.$slots, "default"),
|
|
442
442
|
a.iconAfter ? (m(), x("i", {
|
|
443
443
|
key: 1,
|
|
444
|
-
class:
|
|
445
|
-
}, null, 2)) :
|
|
444
|
+
class: $([a.iconAfter, n.value])
|
|
445
|
+
}, null, 2)) : j("", !0)
|
|
446
446
|
], 2)
|
|
447
447
|
], 2));
|
|
448
448
|
}
|
|
@@ -517,13 +517,13 @@ const ei = {
|
|
|
517
517
|
},
|
|
518
518
|
setup(a) {
|
|
519
519
|
return (t, e) => (m(), x("div", {
|
|
520
|
-
class:
|
|
520
|
+
class: $(["flex gap-4", [
|
|
521
521
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
522
522
|
]])
|
|
523
523
|
}, [
|
|
524
524
|
w("div", si, [
|
|
525
525
|
w("div", {
|
|
526
|
-
class:
|
|
526
|
+
class: $(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
527
527
|
}, [
|
|
528
528
|
w("img", {
|
|
529
529
|
src: a.agent.avatarUrl.value,
|
|
@@ -545,13 +545,13 @@ const ei = {
|
|
|
545
545
|
]),
|
|
546
546
|
w("div", li, [
|
|
547
547
|
w("h1", {
|
|
548
|
-
class:
|
|
548
|
+
class: $(["font-light text-white mb-1 truncate", [
|
|
549
549
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
550
550
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
551
551
|
]])
|
|
552
552
|
}, Z(a.agent.displayName.value), 3),
|
|
553
553
|
w("p", {
|
|
554
|
-
class:
|
|
554
|
+
class: $(["font-light line-clamp-1", [
|
|
555
555
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
556
556
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
557
557
|
]])
|
|
@@ -606,9 +606,9 @@ function pi(a, t) {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
h(pi, "_unsupportedIterableToArray");
|
|
609
|
-
const
|
|
610
|
-
let
|
|
611
|
-
|
|
609
|
+
const bs = Object.entries, Kn = Object.setPrototypeOf, fi = Object.isFrozen, gi = Object.getPrototypeOf, mi = Object.getOwnPropertyDescriptor;
|
|
610
|
+
let ke = Object.freeze, Te = Object.seal, ht = Object.create, vs = typeof Reflect < "u" && Reflect, hn = vs.apply, dn = vs.construct;
|
|
611
|
+
ke || (ke = /* @__PURE__ */ h(function(t) {
|
|
612
612
|
return t;
|
|
613
613
|
}, "freeze"));
|
|
614
614
|
Te || (Te = /* @__PURE__ */ h(function(t) {
|
|
@@ -624,7 +624,7 @@ dn || (dn = /* @__PURE__ */ h(function(t) {
|
|
|
624
624
|
n[i - 1] = arguments[i];
|
|
625
625
|
return new t(...n);
|
|
626
626
|
}, "construct"));
|
|
627
|
-
const lt = le(Array.prototype.forEach), xi = le(Array.prototype.lastIndexOf), Zn = le(Array.prototype.pop), ot = le(Array.prototype.push),
|
|
627
|
+
const lt = le(Array.prototype.forEach), xi = le(Array.prototype.lastIndexOf), Zn = le(Array.prototype.pop), ot = le(Array.prototype.push), ki = le(Array.prototype.splice), ge = Array.isArray, _t = le(String.prototype.toLowerCase), sn = le(String.prototype.toString), Xn = le(String.prototype.match), ct = le(String.prototype.replace), Qn = le(String.prototype.indexOf), bi = le(String.prototype.trim), vi = le(Number.prototype.toString), yi = le(Boolean.prototype.toString), Jn = typeof BigInt > "u" ? null : le(BigInt.prototype.toString), es = typeof Symbol > "u" ? null : le(Symbol.prototype.toString), ie = le(Object.prototype.hasOwnProperty), Tt = le(Object.prototype.toString), ue = le(RegExp.prototype.test), St = wi(TypeError);
|
|
628
628
|
function le(a) {
|
|
629
629
|
return function(t) {
|
|
630
630
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -666,7 +666,7 @@ function Ti(a) {
|
|
|
666
666
|
h(Ti, "cleanArray");
|
|
667
667
|
function he(a) {
|
|
668
668
|
const t = ht(null);
|
|
669
|
-
for (const n of
|
|
669
|
+
for (const n of bs(a)) {
|
|
670
670
|
var e = di(n, 2);
|
|
671
671
|
const i = e[0], s = e[1];
|
|
672
672
|
ie(a, i) && (ge(s) ? t[i] = Ti(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = he(s) : t[i] = s);
|
|
@@ -729,7 +729,7 @@ function Ai(a) {
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
h(Ai, "isRegex");
|
|
732
|
-
const ts =
|
|
732
|
+
const ts = ke(["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"]), an = ke(["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"]), rn = ke(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), _i = ke(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), ln = ke(["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"]), Ei = ke(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ns = ke(["#text"]), ss = ke(["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"]), on = ke(["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", "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-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"]), is = ke(["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"]), zt = ke(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ri = Te(/{{[\w\W]*|^[\w\W]*}}/g), Ci = Te(/<%[\w\W]*|^[\w\W]*%>/g), Ii = Te(/\${[\w\W]*/g), Di = Te(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mi = Te(/^aria-[\-\w]+$/), as = Te(
|
|
733
733
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
734
734
|
// eslint-disable-line no-useless-escape
|
|
735
735
|
), $i = Te(/^(?:\w+script|data):/i), Li = Te(
|
|
@@ -795,20 +795,20 @@ function ys() {
|
|
|
795
795
|
a.DocumentFragment;
|
|
796
796
|
const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, u = a.NodeFilter, c = a.NamedNodeMap;
|
|
797
797
|
c === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
798
|
-
const v = a.DOMParser,
|
|
798
|
+
const v = a.DOMParser, b = a.trustedTypes, A = o.prototype, E = Oe(A, "cloneNode"), G = Oe(A, "remove"), R = Oe(A, "nextSibling"), X = Oe(A, "childNodes"), Q = Oe(A, "parentNode"), M = Oe(A, "shadowRoot"), P = Oe(A, "attributes"), F = l && l.prototype ? Oe(l.prototype, "nodeType") : null, q = l && l.prototype ? Oe(l.prototype, "nodeName") : null;
|
|
799
799
|
if (typeof s == "function") {
|
|
800
800
|
const C = e.createElement("template");
|
|
801
801
|
C.content && C.content.ownerDocument && (e = C.content.ownerDocument);
|
|
802
802
|
}
|
|
803
803
|
let H, J = "";
|
|
804
|
-
const
|
|
804
|
+
const Re = e, pe = Re.implementation, ve = Re.createNodeIterator, xt = Re.createDocumentFragment, Pe = Re.getElementsByTagName, Be = n.importNode;
|
|
805
805
|
let se = rs();
|
|
806
|
-
t.isSupported = typeof
|
|
807
|
-
const Ue = Ri,
|
|
806
|
+
t.isSupported = typeof bs == "function" && typeof Q == "function" && pe && pe.createHTMLDocument !== void 0;
|
|
807
|
+
const Ue = Ri, be = Ci, ce = Ii, Ce = Di, N = Mi, Je = $i, He = Li, et = Ni;
|
|
808
808
|
let Ge = as, ee = null;
|
|
809
|
-
const
|
|
809
|
+
const Ye = z({}, [...ts, ...an, ...rn, ...ln, ...ns]);
|
|
810
810
|
let g = null;
|
|
811
|
-
const
|
|
811
|
+
const _ = z({}, [...ss, ...on, ...is, ...zt]);
|
|
812
812
|
let p = Object.seal(ht(null, {
|
|
813
813
|
tagNameCheck: {
|
|
814
814
|
writable: !0,
|
|
@@ -843,9 +843,9 @@ function ys() {
|
|
|
843
843
|
value: null
|
|
844
844
|
}
|
|
845
845
|
}));
|
|
846
|
-
let y = !0,
|
|
846
|
+
let y = !0, k = !0, f = !1, L = !0, V = !1, fe = !0, ye = !1, Ie = !1, kt = !1, tt = !1, Ct = !1, It = !1, An = !0, _n = !1;
|
|
847
847
|
const En = "user-content-";
|
|
848
|
-
let Yt = !0,
|
|
848
|
+
let Yt = !0, bt = !1, nt = {}, De = null;
|
|
849
849
|
const Kt = z({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
850
850
|
let Rn = null;
|
|
851
851
|
const Cn = z({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
@@ -865,17 +865,17 @@ function ys() {
|
|
|
865
865
|
if (it && it === r)
|
|
866
866
|
return;
|
|
867
867
|
(!r || typeof r != "object") && (r = {}), r = he(r), vt = // eslint-disable-next-line unicorn/prefer-includes
|
|
868
|
-
Ls.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? Os : r.PARSER_MEDIA_TYPE, re = vt === "application/xhtml+xml" ? sn : _t, ee = ie(r, "ALLOWED_TAGS") && ge(r.ALLOWED_TAGS) ? z({}, r.ALLOWED_TAGS, re) :
|
|
868
|
+
Ls.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? Os : r.PARSER_MEDIA_TYPE, re = vt === "application/xhtml+xml" ? sn : _t, ee = ie(r, "ALLOWED_TAGS") && ge(r.ALLOWED_TAGS) ? z({}, r.ALLOWED_TAGS, re) : Ye, g = ie(r, "ALLOWED_ATTR") && ge(r.ALLOWED_ATTR) ? z({}, r.ALLOWED_ATTR, re) : _, Qt = ie(r, "ALLOWED_NAMESPACES") && ge(r.ALLOWED_NAMESPACES) ? z({}, r.ALLOWED_NAMESPACES, sn) : Ms, Zt = ie(r, "ADD_URI_SAFE_ATTR") && ge(r.ADD_URI_SAFE_ATTR) ? z(he(In), r.ADD_URI_SAFE_ATTR, re) : In, Rn = ie(r, "ADD_DATA_URI_TAGS") && ge(r.ADD_DATA_URI_TAGS) ? z(he(Cn), r.ADD_DATA_URI_TAGS, re) : Cn, De = ie(r, "FORBID_CONTENTS") && ge(r.FORBID_CONTENTS) ? z({}, r.FORBID_CONTENTS, re) : Kt, S = ie(r, "FORBID_TAGS") && ge(r.FORBID_TAGS) ? z({}, r.FORBID_TAGS, re) : he({}), D = ie(r, "FORBID_ATTR") && ge(r.FORBID_ATTR) ? z({}, r.FORBID_ATTR, re) : he({}), nt = ie(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? he(r.USE_PROFILES) : r.USE_PROFILES : !1, y = r.ALLOW_ARIA_ATTR !== !1, k = r.ALLOW_DATA_ATTR !== !1, f = r.ALLOW_UNKNOWN_PROTOCOLS || !1, L = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = r.SAFE_FOR_TEMPLATES || !1, fe = r.SAFE_FOR_XML !== !1, ye = r.WHOLE_DOCUMENT || !1, tt = r.RETURN_DOM || !1, Ct = r.RETURN_DOM_FRAGMENT || !1, It = r.RETURN_TRUSTED_TYPE || !1, kt = r.FORCE_BODY || !1, An = r.SANITIZE_DOM !== !1, _n = r.SANITIZE_NAMED_PROPS || !1, Yt = r.KEEP_CONTENT !== !1, bt = r.IN_PLACE || !1, Ge = Ai(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : as, st = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Me, Jt = ie(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? he(r.MATHML_TEXT_INTEGRATION_POINTS) : z({}, ["mi", "mo", "mn", "ms", "mtext"]), en = ie(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? he(r.HTML_INTEGRATION_POINTS) : z({}, ["annotation-xml"]);
|
|
869
869
|
const d = ie(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? he(r.CUSTOM_ELEMENT_HANDLING) : ht(null);
|
|
870
|
-
if (p = ht(null), ie(d, "tagNameCheck") && Dn(d.tagNameCheck) && (p.tagNameCheck = d.tagNameCheck), ie(d, "attributeNameCheck") && Dn(d.attributeNameCheck) && (p.attributeNameCheck = d.attributeNameCheck), ie(d, "allowCustomizedBuiltInElements") && typeof d.allowCustomizedBuiltInElements == "boolean" && (p.allowCustomizedBuiltInElements = d.allowCustomizedBuiltInElements), V && (
|
|
870
|
+
if (p = ht(null), ie(d, "tagNameCheck") && Dn(d.tagNameCheck) && (p.tagNameCheck = d.tagNameCheck), ie(d, "attributeNameCheck") && Dn(d.attributeNameCheck) && (p.attributeNameCheck = d.attributeNameCheck), ie(d, "allowCustomizedBuiltInElements") && typeof d.allowCustomizedBuiltInElements == "boolean" && (p.allowCustomizedBuiltInElements = d.allowCustomizedBuiltInElements), V && (k = !1), Ct && (tt = !0), nt && (ee = z({}, ns), g = ht(null), nt.html === !0 && (z(ee, ts), z(g, ss)), nt.svg === !0 && (z(ee, an), z(g, on), z(g, zt)), nt.svgFilters === !0 && (z(ee, rn), z(g, on), z(g, zt)), nt.mathMl === !0 && (z(ee, ln), z(g, is), z(g, zt))), O.tagCheck = null, O.attributeCheck = null, ie(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? O.tagCheck = r.ADD_TAGS : ge(r.ADD_TAGS) && (ee === Ye && (ee = he(ee)), z(ee, r.ADD_TAGS, re))), ie(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? O.attributeCheck = r.ADD_ATTR : ge(r.ADD_ATTR) && (g === _ && (g = he(g)), z(g, r.ADD_ATTR, re))), ie(r, "ADD_URI_SAFE_ATTR") && ge(r.ADD_URI_SAFE_ATTR) && z(Zt, r.ADD_URI_SAFE_ATTR, re), ie(r, "FORBID_CONTENTS") && ge(r.FORBID_CONTENTS) && (De === Kt && (De = he(De)), z(De, r.FORBID_CONTENTS, re)), ie(r, "ADD_FORBID_CONTENTS") && ge(r.ADD_FORBID_CONTENTS) && (De === Kt && (De = he(De)), z(De, r.ADD_FORBID_CONTENTS, re)), Yt && (ee["#text"] = !0), ye && z(ee, ["html", "head", "body"]), ee.table && (z(ee, ["tbody"]), delete S.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
871
871
|
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
872
872
|
throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
873
873
|
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
874
874
|
throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
875
875
|
H = r.TRUSTED_TYPES_POLICY, J = H.createHTML("");
|
|
876
876
|
} else
|
|
877
|
-
H === void 0 && (H = Pi(
|
|
878
|
-
(se.uponSanitizeElement.length > 0 || se.uponSanitizeAttribute.length > 0) && ee ===
|
|
877
|
+
H === void 0 && (H = Pi(b, i)), H !== null && typeof J == "string" && (J = H.createHTML(""));
|
|
878
|
+
(se.uponSanitizeElement.length > 0 || se.uponSanitizeAttribute.length > 0) && ee === Ye && (ee = he(ee)), se.uponSanitizeAttribute.length > 0 && g === _ && (g = he(g)), ke && ke(r), it = r;
|
|
879
879
|
}, "_parseConfig"), Mn = z({}, [...an, ...rn, ..._i]), $n = z({}, [...ln, ...Ei]), zs = /* @__PURE__ */ h(function(r) {
|
|
880
880
|
let d = Q(r);
|
|
881
881
|
(!d || !d.tagName) && (d = {
|
|
@@ -884,7 +884,7 @@ function ys() {
|
|
|
884
884
|
});
|
|
885
885
|
const T = _t(r.tagName), K = _t(d.tagName);
|
|
886
886
|
return Qt[r.namespaceURI] ? r.namespaceURI === Mt ? d.namespaceURI === Me ? T === "svg" : d.namespaceURI === Dt ? T === "svg" && (K === "annotation-xml" || Jt[K]) : !!Mn[T] : r.namespaceURI === Dt ? d.namespaceURI === Me ? T === "math" : d.namespaceURI === Mt ? T === "math" && en[K] : !!$n[T] : r.namespaceURI === Me ? d.namespaceURI === Mt && !en[K] || d.namespaceURI === Dt && !Jt[K] ? !1 : !$n[T] && ($s[T] || !Mn[T]) : !!(vt === "application/xhtml+xml" && Qt[r.namespaceURI]) : !1;
|
|
887
|
-
}, "_checkValidNamespace"),
|
|
887
|
+
}, "_checkValidNamespace"), Se = /* @__PURE__ */ h(function(r) {
|
|
888
888
|
ot(t.removed, {
|
|
889
889
|
element: r
|
|
890
890
|
});
|
|
@@ -893,7 +893,7 @@ function ys() {
|
|
|
893
893
|
} catch {
|
|
894
894
|
G(r);
|
|
895
895
|
}
|
|
896
|
-
}, "_forceRemove"),
|
|
896
|
+
}, "_forceRemove"), Ke = /* @__PURE__ */ h(function(r, d) {
|
|
897
897
|
try {
|
|
898
898
|
ot(t.removed, {
|
|
899
899
|
attribute: d.getAttributeNode(r),
|
|
@@ -908,7 +908,7 @@ function ys() {
|
|
|
908
908
|
if (d.removeAttribute(r), r === "is")
|
|
909
909
|
if (tt || Ct)
|
|
910
910
|
try {
|
|
911
|
-
|
|
911
|
+
Se(d);
|
|
912
912
|
} catch {
|
|
913
913
|
}
|
|
914
914
|
else
|
|
@@ -918,7 +918,7 @@ function ys() {
|
|
|
918
918
|
}
|
|
919
919
|
}, "_removeAttribute"), Ln = /* @__PURE__ */ h(function(r) {
|
|
920
920
|
let d = null, T = null;
|
|
921
|
-
if (
|
|
921
|
+
if (kt)
|
|
922
922
|
r = "<remove></remove>" + r;
|
|
923
923
|
else {
|
|
924
924
|
const te = Xn(r, /^[\r\n\t ]+/);
|
|
@@ -960,7 +960,7 @@ function ys() {
|
|
|
960
960
|
let T = d.nextNode();
|
|
961
961
|
for (; T; ) {
|
|
962
962
|
let K = T.data;
|
|
963
|
-
lt([Ue,
|
|
963
|
+
lt([Ue, be, ce], (U) => {
|
|
964
964
|
K = ct(K, U, " ");
|
|
965
965
|
}), T.data = K, T = d.nextNode();
|
|
966
966
|
}
|
|
@@ -971,14 +971,14 @@ function ys() {
|
|
|
971
971
|
// makes the direct read diverge from the cached read; a clean form
|
|
972
972
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
973
973
|
// canonical NamedNodeMap.
|
|
974
|
-
r.attributes !==
|
|
974
|
+
r.attributes !== P(r) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
975
975
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
976
976
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
977
977
|
// the named child element. Cheap addition — nodeType is read from
|
|
978
978
|
// an internal slot, no serialization cost — and removes a residual
|
|
979
979
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
980
980
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
981
|
-
r.nodeType !==
|
|
981
|
+
r.nodeType !== F(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
982
982
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
983
983
|
// form.childNodes from a clobbered form return the named child
|
|
984
984
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -991,18 +991,18 @@ function ys() {
|
|
|
991
991
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
992
992
|
r.childNodes !== X(r);
|
|
993
993
|
}, "_isClobbered"), yt = /* @__PURE__ */ h(function(r) {
|
|
994
|
-
if (!
|
|
994
|
+
if (!F || typeof r != "object" || r === null)
|
|
995
995
|
return !1;
|
|
996
996
|
try {
|
|
997
|
-
return
|
|
997
|
+
return F(r) === Le.documentFragment;
|
|
998
998
|
} catch {
|
|
999
999
|
return !1;
|
|
1000
1000
|
}
|
|
1001
1001
|
}, "_isDocumentFragment"), Lt = /* @__PURE__ */ h(function(r) {
|
|
1002
|
-
if (!
|
|
1002
|
+
if (!F || typeof r != "object" || r === null)
|
|
1003
1003
|
return !1;
|
|
1004
1004
|
try {
|
|
1005
|
-
return typeof
|
|
1005
|
+
return typeof F(r) == "number";
|
|
1006
1006
|
} catch {
|
|
1007
1007
|
return !1;
|
|
1008
1008
|
}
|
|
@@ -1016,13 +1016,13 @@ function ys() {
|
|
|
1016
1016
|
const zn = /* @__PURE__ */ h(function(r) {
|
|
1017
1017
|
let d = null;
|
|
1018
1018
|
if (Fe(se.beforeSanitizeElements, r, null), $t(r))
|
|
1019
|
-
return
|
|
1019
|
+
return Se(r), !0;
|
|
1020
1020
|
const T = re(r.nodeName);
|
|
1021
1021
|
if (Fe(se.uponSanitizeElement, r, {
|
|
1022
1022
|
tagName: T,
|
|
1023
1023
|
allowedTags: ee
|
|
1024
1024
|
}), fe && r.hasChildNodes() && !Lt(r.firstElementChild) && ue(/<[/\w!]/g, r.innerHTML) && ue(/<[/\w!]/g, r.textContent) || fe && r.namespaceURI === Me && T === "style" && Lt(r.firstElementChild) || r.nodeType === Le.progressingInstruction || fe && r.nodeType === Le.comment && ue(/<[/\w]/g, r.data))
|
|
1025
|
-
return
|
|
1025
|
+
return Se(r), !0;
|
|
1026
1026
|
if (S[T] || !(O.tagCheck instanceof Function && O.tagCheck(T)) && !ee[T]) {
|
|
1027
1027
|
if (!S[T] && Fn(T) && (p.tagNameCheck instanceof RegExp && ue(p.tagNameCheck, T) || p.tagNameCheck instanceof Function && p.tagNameCheck(T)))
|
|
1028
1028
|
return !1;
|
|
@@ -1031,14 +1031,14 @@ function ys() {
|
|
|
1031
1031
|
if (te && U) {
|
|
1032
1032
|
const we = te.length;
|
|
1033
1033
|
for (let $e = we - 1; $e >= 0; --$e) {
|
|
1034
|
-
const
|
|
1035
|
-
U.insertBefore(
|
|
1034
|
+
const Ae = E(te[$e], !0);
|
|
1035
|
+
U.insertBefore(Ae, R(r));
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
return
|
|
1039
|
+
return Se(r), !0;
|
|
1040
1040
|
}
|
|
1041
|
-
return (
|
|
1041
|
+
return (F ? F(r) : r.nodeType) === Le.element && !zs(r) || (T === "noscript" || T === "noembed" || T === "noframes") && ue(/<\/no(script|embed|frames)/i, r.innerHTML) ? (Se(r), !0) : (V && r.nodeType === Le.text && (d = r.textContent, lt([Ue, be, ce], (U) => {
|
|
1042
1042
|
d = ct(d, U, " ");
|
|
1043
1043
|
}), r.textContent !== d && (ot(t.removed, {
|
|
1044
1044
|
element: r.cloneNode()
|
|
@@ -1047,7 +1047,7 @@ function ys() {
|
|
|
1047
1047
|
if (D[d] || An && (d === "id" || d === "name") && (T in e || T in Ns))
|
|
1048
1048
|
return !1;
|
|
1049
1049
|
const K = g[d] || O.attributeCheck instanceof Function && O.attributeCheck(d, r);
|
|
1050
|
-
if (!(
|
|
1050
|
+
if (!(k && !D[d] && ue(Ce, d))) {
|
|
1051
1051
|
if (!(y && ue(N, d))) {
|
|
1052
1052
|
if (!K || D[d]) {
|
|
1053
1053
|
if (
|
|
@@ -1061,7 +1061,7 @@ function ys() {
|
|
|
1061
1061
|
} else if (!Zt[d]) {
|
|
1062
1062
|
if (!ue(Ge, ct(T, He, ""))) {
|
|
1063
1063
|
if (!((d === "src" || d === "xlink:href" || d === "href") && r !== "script" && Qn(T, "data:") === 0 && Rn[r])) {
|
|
1064
|
-
if (!(f && !ue(
|
|
1064
|
+
if (!(f && !ue(Je, ct(T, He, "")))) {
|
|
1065
1065
|
if (T)
|
|
1066
1066
|
return !1;
|
|
1067
1067
|
}
|
|
@@ -1072,7 +1072,7 @@ function ys() {
|
|
|
1072
1072
|
}
|
|
1073
1073
|
return !0;
|
|
1074
1074
|
}, "_isValidAttribute"), Ps = z({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Fn = /* @__PURE__ */ h(function(r) {
|
|
1075
|
-
return !Ps[_t(r)] && ue(
|
|
1075
|
+
return !Ps[_t(r)] && ue(et, r);
|
|
1076
1076
|
}, "_isBasicCustomElement"), Bn = /* @__PURE__ */ h(function(r) {
|
|
1077
1077
|
Fe(se.beforeSanitizeAttributes, r, null);
|
|
1078
1078
|
const d = r.attributes;
|
|
@@ -1087,36 +1087,36 @@ function ys() {
|
|
|
1087
1087
|
};
|
|
1088
1088
|
let K = d.length;
|
|
1089
1089
|
for (; K--; ) {
|
|
1090
|
-
const U = d[K], te = U.name, we = U.namespaceURI, $e = U.value,
|
|
1091
|
-
let oe = te === "value" ? nn :
|
|
1092
|
-
if (T.attrName =
|
|
1093
|
-
|
|
1090
|
+
const U = d[K], te = U.name, we = U.namespaceURI, $e = U.value, Ae = re(te), nn = $e;
|
|
1091
|
+
let oe = te === "value" ? nn : bi(nn);
|
|
1092
|
+
if (T.attrName = Ae, T.attrValue = oe, T.keepAttr = !0, T.forceKeepAttr = void 0, Fe(se.uponSanitizeAttribute, r, T), oe = T.attrValue, _n && (Ae === "id" || Ae === "name") && Qn(oe, En) !== 0 && (Ke(te, r), oe = En + oe), fe && ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, oe)) {
|
|
1093
|
+
Ke(te, r);
|
|
1094
1094
|
continue;
|
|
1095
1095
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
|
|
1096
|
+
if (Ae === "attributename" && Xn(oe, "href")) {
|
|
1097
|
+
Ke(te, r);
|
|
1098
1098
|
continue;
|
|
1099
1099
|
}
|
|
1100
1100
|
if (T.forceKeepAttr)
|
|
1101
1101
|
continue;
|
|
1102
1102
|
if (!T.keepAttr) {
|
|
1103
|
-
|
|
1103
|
+
Ke(te, r);
|
|
1104
1104
|
continue;
|
|
1105
1105
|
}
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
1106
|
+
if (!L && ue(/\/>/i, oe)) {
|
|
1107
|
+
Ke(te, r);
|
|
1108
1108
|
continue;
|
|
1109
1109
|
}
|
|
1110
|
-
V && lt([Ue,
|
|
1110
|
+
V && lt([Ue, be, ce], (Hn) => {
|
|
1111
1111
|
oe = ct(oe, Hn, " ");
|
|
1112
1112
|
});
|
|
1113
1113
|
const Un = re(r.nodeName);
|
|
1114
|
-
if (!Pn(Un,
|
|
1115
|
-
|
|
1114
|
+
if (!Pn(Un, Ae, oe)) {
|
|
1115
|
+
Ke(te, r);
|
|
1116
1116
|
continue;
|
|
1117
1117
|
}
|
|
1118
|
-
if (H && typeof
|
|
1119
|
-
switch (
|
|
1118
|
+
if (H && typeof b == "object" && typeof b.getAttributeType == "function" && !we)
|
|
1119
|
+
switch (b.getAttributeType(Un, Ae)) {
|
|
1120
1120
|
case "TrustedHTML": {
|
|
1121
1121
|
oe = H.createHTML(oe);
|
|
1122
1122
|
break;
|
|
@@ -1128,9 +1128,9 @@ function ys() {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
if (oe !== nn)
|
|
1130
1130
|
try {
|
|
1131
|
-
we ? r.setAttributeNS(we, te, oe) : r.setAttribute(te, oe), $t(r) ?
|
|
1131
|
+
we ? r.setAttributeNS(we, te, oe) : r.setAttribute(te, oe), $t(r) ? Se(r) : Zn(t.removed);
|
|
1132
1132
|
} catch {
|
|
1133
|
-
|
|
1133
|
+
Ke(te, r);
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
1136
|
Fe(se.afterSanitizeAttributes, r, null);
|
|
@@ -1138,15 +1138,15 @@ function ys() {
|
|
|
1138
1138
|
let d = null;
|
|
1139
1139
|
const T = On(r);
|
|
1140
1140
|
for (Fe(se.beforeSanitizeShadowDOM, r, null); d = T.nextNode(); )
|
|
1141
|
-
if (Fe(se.uponSanitizeShadowNode, d, null), zn(d), Bn(d), yt(d.content) && Ot(d.content), (
|
|
1142
|
-
const U =
|
|
1141
|
+
if (Fe(se.uponSanitizeShadowNode, d, null), zn(d), Bn(d), yt(d.content) && Ot(d.content), (F ? F(d) : d.nodeType) === Le.element) {
|
|
1142
|
+
const U = M ? M(d) : d.shadowRoot;
|
|
1143
1143
|
yt(U) && (at(U), Ot(U));
|
|
1144
1144
|
}
|
|
1145
1145
|
Fe(se.afterSanitizeShadowDOM, r, null);
|
|
1146
1146
|
}, "_sanitizeShadowDOM"), at = /* @__PURE__ */ h(function(r) {
|
|
1147
|
-
const d =
|
|
1147
|
+
const d = F ? F(r) : r.nodeType;
|
|
1148
1148
|
if (d === Le.element) {
|
|
1149
|
-
const U =
|
|
1149
|
+
const U = M ? M(r) : r.shadowRoot;
|
|
1150
1150
|
yt(U) && (at(U), Ot(U));
|
|
1151
1151
|
}
|
|
1152
1152
|
const T = X ? X(r) : r.childNodes;
|
|
@@ -1172,11 +1172,11 @@ function ys() {
|
|
|
1172
1172
|
throw St("dirty is not a string, aborting");
|
|
1173
1173
|
if (!t.isSupported)
|
|
1174
1174
|
return C;
|
|
1175
|
-
if (Ie || tn(r), t.removed = [], typeof C == "string" && (
|
|
1175
|
+
if (Ie || tn(r), t.removed = [], typeof C == "string" && (bt = !1), bt) {
|
|
1176
1176
|
const $e = q ? q(C) : C.nodeName;
|
|
1177
1177
|
if (typeof $e == "string") {
|
|
1178
|
-
const
|
|
1179
|
-
if (!ee[
|
|
1178
|
+
const Ae = re($e);
|
|
1179
|
+
if (!ee[Ae] || S[Ae])
|
|
1180
1180
|
throw St("root node is forbidden and cannot be sanitized in-place");
|
|
1181
1181
|
}
|
|
1182
1182
|
if ($t(C))
|
|
@@ -1191,11 +1191,11 @@ function ys() {
|
|
|
1191
1191
|
if (d = Ln(C), !d)
|
|
1192
1192
|
return tt ? null : It ? J : "";
|
|
1193
1193
|
}
|
|
1194
|
-
d &&
|
|
1195
|
-
const te = On(
|
|
1194
|
+
d && kt && Se(d.firstChild);
|
|
1195
|
+
const te = On(bt ? C : d);
|
|
1196
1196
|
for (; K = te.nextNode(); )
|
|
1197
1197
|
zn(K), Bn(K), yt(K.content) && Ot(K.content);
|
|
1198
|
-
if (
|
|
1198
|
+
if (bt)
|
|
1199
1199
|
return V && Nn(C), C;
|
|
1200
1200
|
if (tt) {
|
|
1201
1201
|
if (V && Nn(d), Ct)
|
|
@@ -1207,7 +1207,7 @@ function ys() {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
let we = ye ? d.outerHTML : d.innerHTML;
|
|
1209
1209
|
return ye && ee["!doctype"] && d.ownerDocument && d.ownerDocument.doctype && d.ownerDocument.doctype.name && ue(Oi, d.ownerDocument.doctype.name) && (we = "<!DOCTYPE " + d.ownerDocument.doctype.name + `>
|
|
1210
|
-
` + we), V && lt([Ue,
|
|
1210
|
+
` + we), V && lt([Ue, be, ce], ($e) => {
|
|
1211
1211
|
we = ct(we, $e, " ");
|
|
1212
1212
|
}), H && It ? H.createHTML(we) : we;
|
|
1213
1213
|
}, t.setConfig = function() {
|
|
@@ -1224,7 +1224,7 @@ function ys() {
|
|
|
1224
1224
|
}, t.removeHook = function(C, r) {
|
|
1225
1225
|
if (r !== void 0) {
|
|
1226
1226
|
const d = xi(se[C], r);
|
|
1227
|
-
return d === -1 ? void 0 :
|
|
1227
|
+
return d === -1 ? void 0 : ki(se[C], d, 1)[0];
|
|
1228
1228
|
}
|
|
1229
1229
|
return Zn(se[C]);
|
|
1230
1230
|
}, t.removeHooks = function(C) {
|
|
@@ -1239,12 +1239,12 @@ function gn() {
|
|
|
1239
1239
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1240
1240
|
}
|
|
1241
1241
|
h(gn, "M");
|
|
1242
|
-
var
|
|
1242
|
+
var Qe = gn();
|
|
1243
1243
|
function ws(a) {
|
|
1244
|
-
|
|
1244
|
+
Qe = a;
|
|
1245
1245
|
}
|
|
1246
1246
|
h(ws, "N");
|
|
1247
|
-
var
|
|
1247
|
+
var Ze = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1248
1248
|
function ut(a) {
|
|
1249
1249
|
let t = [];
|
|
1250
1250
|
return (e) => {
|
|
@@ -1253,22 +1253,22 @@ function ut(a) {
|
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
1255
|
h(ut, "E");
|
|
1256
|
-
function
|
|
1256
|
+
function W(a, t = "") {
|
|
1257
1257
|
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((i, s) => {
|
|
1258
1258
|
let l = typeof s == "string" ? s : s.source;
|
|
1259
1259
|
return l = l.replace(de.caret, "$1"), e = e.replace(i, l), n;
|
|
1260
1260
|
}, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
|
|
1261
1261
|
return n;
|
|
1262
1262
|
}
|
|
1263
|
-
h(
|
|
1263
|
+
h(W, "d");
|
|
1264
1264
|
var Bi = ((a = "") => {
|
|
1265
1265
|
try {
|
|
1266
1266
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
1267
1267
|
} catch {
|
|
1268
1268
|
return !1;
|
|
1269
1269
|
}
|
|
1270
|
-
})(), de = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: ut((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: ut((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: ut((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: ut((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: ut((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: ut((a) => new RegExp(`^ {0,${a}}>`)) }, Ui = /^(?:[ \t]*(?:\n|$))+/, Hi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Gi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Rt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, mn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ts = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ss =
|
|
1271
|
-
]`).replace("lheading", Ss).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ji = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ea = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _s = /^( {2,}|\\)\n(?!\s*$)/, ta = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, mt = /[\p{P}\p{S}]/u, Vt = /[\s\p{P}\p{S}]/u, yn = /[^\s\p{P}\p{S}]/u, na =
|
|
1270
|
+
})(), de = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: ut((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: ut((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: ut((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: ut((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: ut((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: ut((a) => new RegExp(`^ {0,${a}}>`)) }, Ui = /^(?:[ \t]*(?:\n|$))+/, Hi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Gi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Rt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, mn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ts = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ss = W(Ts).replace(/bull/g, mn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Wi = W(Ts).replace(/bull/g, mn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), xn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, qi = /^[^\n]+/, kn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Vi = W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", kn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Yi = W(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, mn).getRegex(), qt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", bn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ki = W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", bn).replace("tag", qt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), As = W(xn).replace("hr", Rt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", qt).getRegex(), Zi = W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", As).getRegex(), vn = { blockquote: Zi, code: Hi, def: Vi, fences: Gi, heading: ji, hr: Rt, html: Ki, lheading: Ss, list: Yi, newline: Ui, paragraph: As, table: Ze, text: qi }, ls = W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Rt).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", qt).getRegex(), Xi = { ...vn, lheading: Wi, table: ls, paragraph: W(xn).replace("hr", Rt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ls).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", qt).getRegex() }, Qi = { ...vn, html: W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", bn).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(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Ze, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: W(xn).replace("hr", Rt).replace("heading", ` *#{1,6} *[^
|
|
1271
|
+
]`).replace("lheading", Ss).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ji = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ea = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _s = /^( {2,}|\\)\n(?!\s*$)/, ta = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, mt = /[\p{P}\p{S}]/u, Vt = /[\s\p{P}\p{S}]/u, yn = /[^\s\p{P}\p{S}]/u, na = W(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Vt).getRegex(), Es = /(?!~)[\p{P}\p{S}]/u, sa = /(?!~)[\s\p{P}\p{S}]/u, ia = /(?:[^\s\p{P}\p{S}]|~)/u, aa = W(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Bi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ra = W(Rs, "u").replace(/punct/g, mt).getRegex(), la = W(Rs, "u").replace(/punct/g, Es).getRegex(), Cs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", oa = W(Cs, "gu").replace(/notPunctSpace/g, yn).replace(/punctSpace/g, Vt).replace(/punct/g, mt).getRegex(), ca = W(Cs, "gu").replace(/notPunctSpace/g, ia).replace(/punctSpace/g, sa).replace(/punct/g, Es).getRegex(), ua = W("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, yn).replace(/punctSpace/g, Vt).replace(/punct/g, mt).getRegex(), ha = W(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, mt).getRegex(), da = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", pa = W(da, "gu").replace(/notPunctSpace/g, yn).replace(/punctSpace/g, Vt).replace(/punct/g, mt).getRegex(), fa = W(/\\(punct)/, "gu").replace(/punct/g, mt).getRegex(), ga = W(/^<(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(), ma = W(bn).replace("(?:-->|$)", "-->").getRegex(), xa = W("^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", ma).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ht = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ka = W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Ht).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Is = W(/^!?\[(label)\]\[(ref)\]/).replace("label", Ht).replace("ref", kn).getRegex(), Ds = W(/^!?\[(ref)\](?:\[\])?/).replace("ref", kn).getRegex(), ba = W("reflink|nolink(?!\\()", "g").replace("reflink", Is).replace("nolink", Ds).getRegex(), os = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, wn = { _backpedal: Ze, anyPunctuation: fa, autolink: ga, blockSkip: aa, br: _s, code: ea, del: Ze, delLDelim: Ze, delRDelim: Ze, emStrongLDelim: ra, emStrongRDelimAst: oa, emStrongRDelimUnd: ua, escape: Ji, link: ka, nolink: Ds, punctuation: na, reflink: Is, reflinkSearch: ba, tag: xa, text: ta, url: Ze }, va = { ...wn, link: W(/^!?\[(label)\]\((.*?)\)/).replace("label", Ht).getRegex(), reflink: W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ht).getRegex() }, pn = { ...wn, emStrongRDelimAst: ca, emStrongLDelim: la, delLDelim: ha, delRDelim: pa, url: W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", os).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: W(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", os).getRegex() }, ya = { ...pn, br: W(_s).replace("{2,}", "*").getRegex(), text: W(pn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Pt = { normal: vn, gfm: Xi, pedantic: Qi }, At = { normal: wn, gfm: pn, breaks: ya, pedantic: va }, wa = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, cs = /* @__PURE__ */ h((a) => wa[a], "ge");
|
|
1272
1272
|
function Ne(a, t) {
|
|
1273
1273
|
if (t) {
|
|
1274
1274
|
if (de.escapeTest.test(a)) return a.replace(de.escapeReplace, cs);
|
|
@@ -1358,7 +1358,7 @@ var dt, Gt = (dt = class {
|
|
|
1358
1358
|
B(this, "options");
|
|
1359
1359
|
B(this, "rules");
|
|
1360
1360
|
B(this, "lexer");
|
|
1361
|
-
this.options = t ||
|
|
1361
|
+
this.options = t || Qe;
|
|
1362
1362
|
}
|
|
1363
1363
|
space(t) {
|
|
1364
1364
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -1408,13 +1408,13 @@ var dt, Gt = (dt = class {
|
|
|
1408
1408
|
else break;
|
|
1409
1409
|
n = n.slice(c);
|
|
1410
1410
|
let v = u.join(`
|
|
1411
|
-
`),
|
|
1411
|
+
`), b = v.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1412
1412
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1413
1413
|
i = i ? `${i}
|
|
1414
1414
|
${v}` : v, s = s ? `${s}
|
|
1415
|
-
${
|
|
1416
|
-
let
|
|
1417
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
1415
|
+
${b}` : b;
|
|
1416
|
+
let A = this.lexer.state.top;
|
|
1417
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(b, l, !0), this.lexer.state.top = A, n.length === 0) break;
|
|
1418
1418
|
let E = l.at(-1);
|
|
1419
1419
|
if (E?.type === "code") break;
|
|
1420
1420
|
if (E?.type === "blockquote") {
|
|
@@ -1442,31 +1442,31 @@ ${k}` : k;
|
|
|
1442
1442
|
n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
|
|
1443
1443
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1444
1444
|
for (; t; ) {
|
|
1445
|
-
let c = !1, v = "",
|
|
1445
|
+
let c = !1, v = "", b = "";
|
|
1446
1446
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1447
1447
|
v = e[0], t = t.substring(v.length);
|
|
1448
|
-
let
|
|
1448
|
+
let A = Sa(e[2].split(`
|
|
1449
1449
|
`, 1)[0], e[1].length), E = t.split(`
|
|
1450
|
-
`, 1)[0], G = !
|
|
1451
|
-
if (this.options.pedantic ? (R = 2,
|
|
1450
|
+
`, 1)[0], G = !A.trim(), R = 0;
|
|
1451
|
+
if (this.options.pedantic ? (R = 2, b = A.trimStart()) : G ? R = e[1].length + 1 : (R = A.search(this.rules.other.nonSpaceChar), R = R > 4 ? 1 : R, b = A.slice(R), R += e[1].length), G && this.rules.other.blankLine.test(E) && (v += E + `
|
|
1452
1452
|
`, t = t.substring(E.length + 1), c = !0), !c) {
|
|
1453
|
-
let X = this.rules.other.nextBulletRegex(R), Q = this.rules.other.hrRegex(R),
|
|
1453
|
+
let X = this.rules.other.nextBulletRegex(R), Q = this.rules.other.hrRegex(R), M = this.rules.other.fencesBeginRegex(R), P = this.rules.other.headingBeginRegex(R), F = this.rules.other.htmlBeginRegex(R), q = this.rules.other.blockquoteBeginRegex(R);
|
|
1454
1454
|
for (; t; ) {
|
|
1455
1455
|
let H = t.split(`
|
|
1456
1456
|
`, 1)[0], J;
|
|
1457
|
-
if (E = H, this.options.pedantic ? (E = E.replace(this.rules.other.listReplaceNesting, " "), J = E) : J = E.replace(this.rules.other.tabCharGlobal, " "),
|
|
1458
|
-
if (J.search(this.rules.other.nonSpaceChar) >= R || !E.trim())
|
|
1457
|
+
if (E = H, this.options.pedantic ? (E = E.replace(this.rules.other.listReplaceNesting, " "), J = E) : J = E.replace(this.rules.other.tabCharGlobal, " "), M.test(E) || P.test(E) || F.test(E) || q.test(E) || X.test(E) || Q.test(E)) break;
|
|
1458
|
+
if (J.search(this.rules.other.nonSpaceChar) >= R || !E.trim()) b += `
|
|
1459
1459
|
` + J.slice(R);
|
|
1460
1460
|
else {
|
|
1461
|
-
if (G ||
|
|
1462
|
-
|
|
1461
|
+
if (G || A.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || M.test(A) || P.test(A) || Q.test(A)) break;
|
|
1462
|
+
b += `
|
|
1463
1463
|
` + E;
|
|
1464
1464
|
}
|
|
1465
1465
|
G = !E.trim(), v += H + `
|
|
1466
|
-
`, t = t.substring(H.length + 1),
|
|
1466
|
+
`, t = t.substring(H.length + 1), A = J.slice(R);
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(v) && (o = !0)), s.items.push({ type: "list_item", raw: v, task: !!this.options.gfm && this.rules.other.listIsTask.test(
|
|
1469
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(v) && (o = !0)), s.items.push({ type: "list_item", raw: v, task: !!this.options.gfm && this.rules.other.listIsTask.test(b), loose: !1, text: b, tokens: [] }), s.raw += v;
|
|
1470
1470
|
}
|
|
1471
1471
|
let u = s.items.at(-1);
|
|
1472
1472
|
if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
|
|
@@ -1477,19 +1477,19 @@ ${k}` : k;
|
|
|
1477
1477
|
let v = c.tokens[0];
|
|
1478
1478
|
if (c.task && (v?.type === "text" || v?.type === "paragraph")) {
|
|
1479
1479
|
c.text = c.text.replace(this.rules.other.listReplaceTask, ""), v.raw = v.raw.replace(this.rules.other.listReplaceTask, ""), v.text = v.text.replace(this.rules.other.listReplaceTask, "");
|
|
1480
|
-
for (let
|
|
1481
|
-
this.lexer.inlineQueue[
|
|
1480
|
+
for (let A = this.lexer.inlineQueue.length - 1; A >= 0; A--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[A].src)) {
|
|
1481
|
+
this.lexer.inlineQueue[A].src = this.lexer.inlineQueue[A].src.replace(this.rules.other.listReplaceTask, "");
|
|
1482
1482
|
break;
|
|
1483
1483
|
}
|
|
1484
|
-
let
|
|
1485
|
-
if (
|
|
1486
|
-
let
|
|
1487
|
-
c.checked =
|
|
1484
|
+
let b = this.rules.other.listTaskCheckbox.exec(c.raw);
|
|
1485
|
+
if (b) {
|
|
1486
|
+
let A = { type: "checkbox", raw: b[0] + " ", checked: b[0] !== "[ ]" };
|
|
1487
|
+
c.checked = A.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = A.raw + c.tokens[0].raw, c.tokens[0].text = A.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(A)) : c.tokens.unshift({ type: "paragraph", raw: A.raw, text: A.raw, tokens: [A] }) : c.tokens.unshift(A);
|
|
1488
1488
|
}
|
|
1489
1489
|
} else c.task && (c.task = !1);
|
|
1490
1490
|
if (!s.loose) {
|
|
1491
|
-
let
|
|
1492
|
-
s.loose =
|
|
1491
|
+
let b = c.tokens.filter((E) => E.type === "space"), A = b.length > 0 && b.some((E) => this.rules.other.anyLine.test(E.raw));
|
|
1492
|
+
s.loose = A;
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
if (s.loose) for (let c of s.items) {
|
|
@@ -1605,13 +1605,13 @@ ${k}` : k;
|
|
|
1605
1605
|
}
|
|
1606
1606
|
if (u -= o, u > 0) continue;
|
|
1607
1607
|
o = Math.min(o, o + u + c);
|
|
1608
|
-
let
|
|
1608
|
+
let b = [...i[0]][0].length, A = t.slice(0, s + i.index + b + o);
|
|
1609
1609
|
if (Math.min(s, o) % 2) {
|
|
1610
|
-
let G =
|
|
1611
|
-
return { type: "em", raw:
|
|
1610
|
+
let G = A.slice(1, -1);
|
|
1611
|
+
return { type: "em", raw: A, text: G, tokens: this.lexer.inlineTokens(G) };
|
|
1612
1612
|
}
|
|
1613
|
-
let E =
|
|
1614
|
-
return { type: "strong", raw:
|
|
1613
|
+
let E = A.slice(2, -2);
|
|
1614
|
+
return { type: "strong", raw: A, text: E, tokens: this.lexer.inlineTokens(E) };
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
@@ -1638,8 +1638,8 @@ ${k}` : k;
|
|
|
1638
1638
|
}
|
|
1639
1639
|
if (u -= o, u > 0) continue;
|
|
1640
1640
|
o = Math.min(o, o + u);
|
|
1641
|
-
let v = [...i[0]][0].length,
|
|
1642
|
-
return { type: "del", raw:
|
|
1641
|
+
let v = [...i[0]][0].length, b = t.slice(0, s + i.index + v + o), A = b.slice(s, -s);
|
|
1642
|
+
return { type: "del", raw: b, text: A, tokens: this.lexer.inlineTokens(A) };
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
@@ -1672,14 +1672,14 @@ ${k}` : k;
|
|
|
1672
1672
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
|
-
}, h(dt, "w"), dt), qe,
|
|
1675
|
+
}, h(dt, "w"), dt), qe, _e = (qe = class {
|
|
1676
1676
|
constructor(t) {
|
|
1677
1677
|
B(this, "tokens");
|
|
1678
1678
|
B(this, "options");
|
|
1679
1679
|
B(this, "state");
|
|
1680
1680
|
B(this, "inlineQueue");
|
|
1681
1681
|
B(this, "tokenizer");
|
|
1682
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
1682
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Qe, this.options.tokenizer = this.options.tokenizer || new Gt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1683
1683
|
let e = { other: de, block: Pt.normal, inline: At.normal };
|
|
1684
1684
|
this.options.pedantic ? (e.block = Pt.pedantic, e.inline = At.pedantic) : this.options.gfm && (e.block = Pt.gfm, this.options.breaks ? e.inline = At.breaks : e.inline = At.gfm), this.tokenizer.rules = e;
|
|
1685
1685
|
}
|
|
@@ -1823,7 +1823,7 @@ ${k}` : k;
|
|
|
1823
1823
|
}
|
|
1824
1824
|
l || (o = ""), l = !1;
|
|
1825
1825
|
let c;
|
|
1826
|
-
if (this.options.extensions?.inline?.some((
|
|
1826
|
+
if (this.options.extensions?.inline?.some((b) => (c = b.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
|
|
1827
1827
|
if (c = this.tokenizer.escape(t)) {
|
|
1828
1828
|
t = t.substring(c.raw.length), e.push(c);
|
|
1829
1829
|
continue;
|
|
@@ -1838,8 +1838,8 @@ ${k}` : k;
|
|
|
1838
1838
|
}
|
|
1839
1839
|
if (c = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
1840
1840
|
t = t.substring(c.raw.length);
|
|
1841
|
-
let
|
|
1842
|
-
c.type === "text" &&
|
|
1841
|
+
let b = e.at(-1);
|
|
1842
|
+
c.type === "text" && b?.type === "text" ? (b.raw += c.raw, b.text += c.text) : e.push(c);
|
|
1843
1843
|
continue;
|
|
1844
1844
|
}
|
|
1845
1845
|
if (c = this.tokenizer.emStrong(t, n, o)) {
|
|
@@ -1868,15 +1868,15 @@ ${k}` : k;
|
|
|
1868
1868
|
}
|
|
1869
1869
|
let v = t;
|
|
1870
1870
|
if (this.options.extensions?.startInline) {
|
|
1871
|
-
let
|
|
1871
|
+
let b = 1 / 0, A = t.slice(1), E;
|
|
1872
1872
|
this.options.extensions.startInline.forEach((G) => {
|
|
1873
|
-
E = G.call({ lexer: this },
|
|
1874
|
-
}),
|
|
1873
|
+
E = G.call({ lexer: this }, A), typeof E == "number" && E >= 0 && (b = Math.min(b, E));
|
|
1874
|
+
}), b < 1 / 0 && b >= 0 && (v = t.substring(0, b + 1));
|
|
1875
1875
|
}
|
|
1876
1876
|
if (c = this.tokenizer.inlineText(v)) {
|
|
1877
1877
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1878
|
-
let
|
|
1879
|
-
|
|
1878
|
+
let b = e.at(-1);
|
|
1879
|
+
b?.type === "text" ? (b.raw += c.raw, b.text += c.text) : e.push(c);
|
|
1880
1880
|
continue;
|
|
1881
1881
|
}
|
|
1882
1882
|
if (t) {
|
|
@@ -1895,7 +1895,7 @@ ${k}` : k;
|
|
|
1895
1895
|
constructor(t) {
|
|
1896
1896
|
B(this, "options");
|
|
1897
1897
|
B(this, "parser");
|
|
1898
|
-
this.options = t ||
|
|
1898
|
+
this.options = t || Qe;
|
|
1899
1899
|
}
|
|
1900
1900
|
space(t) {
|
|
1901
1901
|
return "";
|
|
@@ -2039,12 +2039,12 @@ ${t}</tr>
|
|
|
2039
2039
|
checkbox({ raw: t }) {
|
|
2040
2040
|
return t;
|
|
2041
2041
|
}
|
|
2042
|
-
}, h(ft, "L"), ft), Ve,
|
|
2042
|
+
}, h(ft, "L"), ft), Ve, Ee = (Ve = class {
|
|
2043
2043
|
constructor(t) {
|
|
2044
2044
|
B(this, "options");
|
|
2045
2045
|
B(this, "renderer");
|
|
2046
2046
|
B(this, "textRenderer");
|
|
2047
|
-
this.options = t ||
|
|
2047
|
+
this.options = t || Qe, this.options.renderer = this.options.renderer || new jt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Tn();
|
|
2048
2048
|
}
|
|
2049
2049
|
static parse(t, e) {
|
|
2050
2050
|
return new Ve(e).parse(t);
|
|
@@ -2194,7 +2194,7 @@ ${t}</tr>
|
|
|
2194
2194
|
constructor(t) {
|
|
2195
2195
|
B(this, "options");
|
|
2196
2196
|
B(this, "block");
|
|
2197
|
-
this.options = t ||
|
|
2197
|
+
this.options = t || Qe;
|
|
2198
2198
|
}
|
|
2199
2199
|
preprocess(t) {
|
|
2200
2200
|
return t;
|
|
@@ -2209,10 +2209,10 @@ ${t}</tr>
|
|
|
2209
2209
|
return t;
|
|
2210
2210
|
}
|
|
2211
2211
|
provideLexer(t = this.block) {
|
|
2212
|
-
return t ?
|
|
2212
|
+
return t ? _e.lex : _e.lexInline;
|
|
2213
2213
|
}
|
|
2214
2214
|
provideParser(t = this.block) {
|
|
2215
|
-
return t ?
|
|
2215
|
+
return t ? Ee.parse : Ee.parseInline;
|
|
2216
2216
|
}
|
|
2217
2217
|
}, h(We, "P"), B(We, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), B(We, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), We), gt, _a = (gt = class {
|
|
2218
2218
|
constructor(...t) {
|
|
@@ -2220,10 +2220,10 @@ ${t}</tr>
|
|
|
2220
2220
|
B(this, "options", this.setOptions);
|
|
2221
2221
|
B(this, "parse", this.parseMarkdown(!0));
|
|
2222
2222
|
B(this, "parseInline", this.parseMarkdown(!1));
|
|
2223
|
-
B(this, "Parser",
|
|
2223
|
+
B(this, "Parser", Ee);
|
|
2224
2224
|
B(this, "Renderer", jt);
|
|
2225
2225
|
B(this, "TextRenderer", Tn);
|
|
2226
|
-
B(this, "Lexer",
|
|
2226
|
+
B(this, "Lexer", _e);
|
|
2227
2227
|
B(this, "Tokenizer", Gt);
|
|
2228
2228
|
B(this, "Hooks", Et);
|
|
2229
2229
|
this.use(...t);
|
|
@@ -2278,8 +2278,8 @@ ${t}</tr>
|
|
|
2278
2278
|
if (["options", "parser"].includes(l)) continue;
|
|
2279
2279
|
let o = l, u = n.renderer[o], c = s[o];
|
|
2280
2280
|
s[o] = (...v) => {
|
|
2281
|
-
let
|
|
2282
|
-
return
|
|
2281
|
+
let b = u.apply(s, v);
|
|
2282
|
+
return b === !1 && (b = c.apply(s, v)), b || "";
|
|
2283
2283
|
};
|
|
2284
2284
|
}
|
|
2285
2285
|
i.renderer = s;
|
|
@@ -2291,8 +2291,8 @@ ${t}</tr>
|
|
|
2291
2291
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2292
2292
|
let o = l, u = n.tokenizer[o], c = s[o];
|
|
2293
2293
|
s[o] = (...v) => {
|
|
2294
|
-
let
|
|
2295
|
-
return
|
|
2294
|
+
let b = u.apply(s, v);
|
|
2295
|
+
return b === !1 && (b = c.apply(s, v)), b;
|
|
2296
2296
|
};
|
|
2297
2297
|
}
|
|
2298
2298
|
i.tokenizer = s;
|
|
@@ -2305,18 +2305,18 @@ ${t}</tr>
|
|
|
2305
2305
|
let o = l, u = n.hooks[o], c = s[o];
|
|
2306
2306
|
Et.passThroughHooks.has(l) ? s[o] = (v) => {
|
|
2307
2307
|
if (this.defaults.async && Et.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2308
|
-
let
|
|
2309
|
-
return c.call(s,
|
|
2308
|
+
let A = await u.call(s, v);
|
|
2309
|
+
return c.call(s, A);
|
|
2310
2310
|
})();
|
|
2311
|
-
let
|
|
2312
|
-
return c.call(s,
|
|
2311
|
+
let b = u.call(s, v);
|
|
2312
|
+
return c.call(s, b);
|
|
2313
2313
|
} : s[o] = (...v) => {
|
|
2314
2314
|
if (this.defaults.async) return (async () => {
|
|
2315
|
-
let
|
|
2316
|
-
return
|
|
2315
|
+
let A = await u.apply(s, v);
|
|
2316
|
+
return A === !1 && (A = await c.apply(s, v)), A;
|
|
2317
2317
|
})();
|
|
2318
|
-
let
|
|
2319
|
-
return
|
|
2318
|
+
let b = u.apply(s, v);
|
|
2319
|
+
return b === !1 && (b = c.apply(s, v)), b;
|
|
2320
2320
|
};
|
|
2321
2321
|
}
|
|
2322
2322
|
i.hooks = s;
|
|
@@ -2335,10 +2335,10 @@ ${t}</tr>
|
|
|
2335
2335
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
2336
2336
|
}
|
|
2337
2337
|
lexer(t, e) {
|
|
2338
|
-
return
|
|
2338
|
+
return _e.lex(t, e ?? this.defaults);
|
|
2339
2339
|
}
|
|
2340
2340
|
parser(t, e) {
|
|
2341
|
-
return
|
|
2341
|
+
return Ee.parse(t, e ?? this.defaults);
|
|
2342
2342
|
}
|
|
2343
2343
|
parseMarkdown(t) {
|
|
2344
2344
|
return (e, n) => {
|
|
@@ -2347,16 +2347,16 @@ ${t}</tr>
|
|
|
2347
2347
|
if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
|
|
2348
2348
|
if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
2349
2349
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2350
|
-
let o = s.hooks ? await s.hooks.preprocess(e) : e, u = await (s.hooks ? await s.hooks.provideLexer(t) : t ?
|
|
2350
|
+
let o = s.hooks ? await s.hooks.preprocess(e) : e, u = await (s.hooks ? await s.hooks.provideLexer(t) : t ? _e.lex : _e.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(u) : u;
|
|
2351
2351
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2352
|
-
let v = await (s.hooks ? await s.hooks.provideParser(t) : t ?
|
|
2352
|
+
let v = await (s.hooks ? await s.hooks.provideParser(t) : t ? Ee.parse : Ee.parseInline)(c, s);
|
|
2353
2353
|
return s.hooks ? await s.hooks.postprocess(v) : v;
|
|
2354
2354
|
})().catch(l);
|
|
2355
2355
|
try {
|
|
2356
2356
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
2357
|
-
let o = (s.hooks ? s.hooks.provideLexer(t) : t ?
|
|
2357
|
+
let o = (s.hooks ? s.hooks.provideLexer(t) : t ? _e.lex : _e.lexInline)(e, s);
|
|
2358
2358
|
s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
|
|
2359
|
-
let u = (s.hooks ? s.hooks.provideParser(t) : t ?
|
|
2359
|
+
let u = (s.hooks ? s.hooks.provideParser(t) : t ? Ee.parse : Ee.parseInline)(o, s);
|
|
2360
2360
|
return s.hooks && (u = s.hooks.postprocess(u)), u;
|
|
2361
2361
|
} catch (o) {
|
|
2362
2362
|
return l(o);
|
|
@@ -2374,29 +2374,29 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
2374
2374
|
throw n;
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
|
-
}, h(gt, "q"), gt),
|
|
2377
|
+
}, h(gt, "q"), gt), Xe = new _a();
|
|
2378
2378
|
function Y(a, t) {
|
|
2379
|
-
return
|
|
2379
|
+
return Xe.parse(a, t);
|
|
2380
2380
|
}
|
|
2381
2381
|
h(Y, "g");
|
|
2382
2382
|
Y.options = Y.setOptions = function(a) {
|
|
2383
|
-
return
|
|
2383
|
+
return Xe.setOptions(a), Y.defaults = Xe.defaults, ws(Y.defaults), Y;
|
|
2384
2384
|
};
|
|
2385
2385
|
Y.getDefaults = gn;
|
|
2386
|
-
Y.defaults =
|
|
2386
|
+
Y.defaults = Qe;
|
|
2387
2387
|
Y.use = function(...a) {
|
|
2388
|
-
return
|
|
2388
|
+
return Xe.use(...a), Y.defaults = Xe.defaults, ws(Y.defaults), Y;
|
|
2389
2389
|
};
|
|
2390
2390
|
Y.walkTokens = function(a, t) {
|
|
2391
|
-
return
|
|
2391
|
+
return Xe.walkTokens(a, t);
|
|
2392
2392
|
};
|
|
2393
|
-
Y.parseInline =
|
|
2394
|
-
Y.Parser =
|
|
2395
|
-
Y.parser =
|
|
2393
|
+
Y.parseInline = Xe.parseInline;
|
|
2394
|
+
Y.Parser = Ee;
|
|
2395
|
+
Y.parser = Ee.parse;
|
|
2396
2396
|
Y.Renderer = jt;
|
|
2397
2397
|
Y.TextRenderer = Tn;
|
|
2398
|
-
Y.Lexer =
|
|
2399
|
-
Y.lexer =
|
|
2398
|
+
Y.Lexer = _e;
|
|
2399
|
+
Y.lexer = _e.lex;
|
|
2400
2400
|
Y.Tokenizer = Gt;
|
|
2401
2401
|
Y.Hooks = Et;
|
|
2402
2402
|
Y.parse = Y;
|
|
@@ -2405,8 +2405,8 @@ Y.setOptions;
|
|
|
2405
2405
|
Y.use;
|
|
2406
2406
|
Y.walkTokens;
|
|
2407
2407
|
Y.parseInline;
|
|
2408
|
-
|
|
2409
|
-
|
|
2408
|
+
Ee.parse;
|
|
2409
|
+
_e.lex;
|
|
2410
2410
|
const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-label"], Ra = { class: "mb-2.5" }, Ca = ["aria-label"], Ia = ["viewBox"], Da = ["x1", "x2", "y1", "y2"], Ma = ["x", "y"], $a = ["x", "y", "width", "height"], La = ["d"], Oa = ["cx", "cy"], Na = ["cx", "cy"], za = ["x", "y", "text-anchor"], Pa = {
|
|
2411
2411
|
key: 0,
|
|
2412
2412
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
@@ -2430,104 +2430,104 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2430
2430
|
}
|
|
2431
2431
|
h(l, "isPieChart");
|
|
2432
2432
|
const o = I(() => n.value?.data ?? []), u = I(() => s(n.value) ? n.value : null), c = I(() => u.value?.series ?? []), v = I(() => l(n.value) ? n.value : null);
|
|
2433
|
-
function
|
|
2433
|
+
function b(g) {
|
|
2434
2434
|
return typeof g == "number" && Number.isFinite(g) ? g : null;
|
|
2435
2435
|
}
|
|
2436
|
-
h(
|
|
2437
|
-
const
|
|
2438
|
-
const g = [],
|
|
2439
|
-
if (!
|
|
2440
|
-
for (const p of
|
|
2441
|
-
for (const S of
|
|
2442
|
-
const D =
|
|
2436
|
+
h(b, "numericValue");
|
|
2437
|
+
const A = I(() => {
|
|
2438
|
+
const g = [], _ = u.value;
|
|
2439
|
+
if (!_) return g;
|
|
2440
|
+
for (const p of _.data)
|
|
2441
|
+
for (const S of _.series) {
|
|
2442
|
+
const D = b(p[S.dataKey]);
|
|
2443
2443
|
D !== null && g.push(D);
|
|
2444
2444
|
}
|
|
2445
2445
|
return g;
|
|
2446
2446
|
});
|
|
2447
|
-
function E(g,
|
|
2447
|
+
function E(g, _) {
|
|
2448
2448
|
const p = g > 0 ? g : 1, S = Math.floor(Math.log10(p)), D = p / 10 ** S;
|
|
2449
2449
|
let O;
|
|
2450
|
-
return
|
|
2450
|
+
return _ ? O = D < 1.5 ? 1 : D < 3 ? 2 : D < 7 ? 5 : 10 : O = D <= 1 ? 1 : D <= 2 ? 2 : D <= 5 ? 5 : 10, O * 10 ** S;
|
|
2451
2451
|
}
|
|
2452
2452
|
h(E, "niceNum");
|
|
2453
2453
|
const G = I(() => {
|
|
2454
|
-
const g =
|
|
2455
|
-
if (p ===
|
|
2456
|
-
return { min: 0, max:
|
|
2457
|
-
const S = 4, D = E(
|
|
2458
|
-
for (let
|
|
2459
|
-
f.push(Number(
|
|
2460
|
-
return { min: y, max:
|
|
2454
|
+
const g = A.value, _ = g.length ? Math.max(...g) : 1, p = g.length ? Math.min(0, ...g) : 0;
|
|
2455
|
+
if (p === _)
|
|
2456
|
+
return { min: 0, max: _ || 1, ticks: [0, _ || 1] };
|
|
2457
|
+
const S = 4, D = E(_ - p, !1), O = E(D / (S - 1), !0), y = Math.floor(p / O) * O, k = Math.ceil(_ / O) * O, f = [];
|
|
2458
|
+
for (let L = y; L <= k + O * 0.5; L += O)
|
|
2459
|
+
f.push(Number(L.toFixed(6)));
|
|
2460
|
+
return { min: y, max: k, ticks: f };
|
|
2461
2461
|
}), R = { width: 360, height: 168, left: 30, right: 12, top: 10, bottom: 24 };
|
|
2462
|
-
function X(g,
|
|
2462
|
+
function X(g, _) {
|
|
2463
2463
|
const p = R.width - R.left - R.right;
|
|
2464
|
-
return
|
|
2464
|
+
return _ <= 1 ? R.left + p / 2 : R.left + p * g / (_ - 1);
|
|
2465
2465
|
}
|
|
2466
2466
|
h(X, "xForIndex");
|
|
2467
2467
|
function Q(g) {
|
|
2468
|
-
const { min:
|
|
2469
|
-
return R.top + (p - g) / (p -
|
|
2468
|
+
const { min: _, max: p } = G.value, S = R.height - R.top - R.bottom;
|
|
2469
|
+
return R.top + (p - g) / (p - _ || 1) * S;
|
|
2470
2470
|
}
|
|
2471
2471
|
h(Q, "yForValue");
|
|
2472
|
-
function
|
|
2473
|
-
const
|
|
2474
|
-
return
|
|
2475
|
-
const D =
|
|
2476
|
-
return `${S === 0 ? "M" : "L"} ${X(S,
|
|
2472
|
+
function M(g) {
|
|
2473
|
+
const _ = u.value;
|
|
2474
|
+
return _ ? _.data.map((p, S) => {
|
|
2475
|
+
const D = b(p[g]) ?? 0;
|
|
2476
|
+
return `${S === 0 ? "M" : "L"} ${X(S, _.data.length).toFixed(1)} ${Q(D).toFixed(1)}`;
|
|
2477
2477
|
}).join(" ") : "";
|
|
2478
2478
|
}
|
|
2479
|
-
h(
|
|
2480
|
-
const
|
|
2479
|
+
h(M, "pathForSeries");
|
|
2480
|
+
const P = I(() => {
|
|
2481
2481
|
const g = u.value;
|
|
2482
2482
|
if (!g || g.chartType !== "bar") return [];
|
|
2483
|
-
const p = (R.width - R.left - R.right) / Math.max(g.data.length, 1), S = Math.max(g.series.length, 1), D = S > 1 ? 2 : 0, O = Math.max(3, Math.min(20, (p * 0.62 - D * (S - 1)) / S)), y = O * S + D * (S - 1),
|
|
2484
|
-
return g.data.flatMap((f,
|
|
2485
|
-
const ye =
|
|
2483
|
+
const p = (R.width - R.left - R.right) / Math.max(g.data.length, 1), S = Math.max(g.series.length, 1), D = S > 1 ? 2 : 0, O = Math.max(3, Math.min(20, (p * 0.62 - D * (S - 1)) / S)), y = O * S + D * (S - 1), k = Q(0);
|
|
2484
|
+
return g.data.flatMap((f, L) => g.series.map((V, fe) => {
|
|
2485
|
+
const ye = b(f[V.dataKey]) ?? 0, Ie = Q(ye), kt = R.left + L * p + (p - y) / 2 + fe * (O + D);
|
|
2486
2486
|
return {
|
|
2487
|
-
key: `${
|
|
2488
|
-
x:
|
|
2489
|
-
y: Math.min(Ie,
|
|
2487
|
+
key: `${L}-${V.dataKey}`,
|
|
2488
|
+
x: kt,
|
|
2489
|
+
y: Math.min(Ie, k),
|
|
2490
2490
|
width: O,
|
|
2491
|
-
height: Math.max(1.5, Math.abs(
|
|
2491
|
+
height: Math.max(1.5, Math.abs(k - Ie)),
|
|
2492
2492
|
seriesIndex: fe
|
|
2493
2493
|
};
|
|
2494
2494
|
}));
|
|
2495
|
-
}),
|
|
2495
|
+
}), F = I(() => {
|
|
2496
2496
|
const g = u.value;
|
|
2497
2497
|
if (!g) return [];
|
|
2498
|
-
const
|
|
2499
|
-
if (!
|
|
2500
|
-
const p = g.xKey, S =
|
|
2498
|
+
const _ = g.data;
|
|
2499
|
+
if (!_.length) return [];
|
|
2500
|
+
const p = g.xKey, S = _.length - 1, D = S <= 6 ? 1 : Math.ceil(S / 4), O = /* @__PURE__ */ new Set([0, S]);
|
|
2501
2501
|
for (let y = 0; y <= S; y += D)
|
|
2502
2502
|
O.add(y);
|
|
2503
|
-
return [...O].sort((y,
|
|
2503
|
+
return [...O].sort((y, k) => y - k).map((y) => ({
|
|
2504
2504
|
key: `${y}`,
|
|
2505
|
-
label: String(
|
|
2506
|
-
x: X(y,
|
|
2505
|
+
label: String(_[y]?.[p] ?? ""),
|
|
2506
|
+
x: X(y, _.length),
|
|
2507
2507
|
anchor: y === 0 ? "start" : y === S ? "end" : "middle"
|
|
2508
2508
|
})).filter((y) => y.label);
|
|
2509
2509
|
});
|
|
2510
2510
|
function q(g) {
|
|
2511
|
-
const
|
|
2512
|
-
return
|
|
2511
|
+
const _ = Math.abs(g);
|
|
2512
|
+
return _ >= 1e6 ? `${(g / 1e6).toFixed(1).replace(/\.0$/, "")}M` : _ >= 1e3 ? `${(g / 1e3).toFixed(1).replace(/\.0$/, "")}k` : Number.isInteger(g) ? `${g}` : g.toFixed(1);
|
|
2513
2513
|
}
|
|
2514
2514
|
h(q, "formatValue");
|
|
2515
2515
|
function H(g) {
|
|
2516
|
-
const
|
|
2517
|
-
if (
|
|
2518
|
-
return `${p}${
|
|
2519
|
-
if (
|
|
2520
|
-
const O = Math.floor(
|
|
2516
|
+
const _ = Math.round(Math.abs(g)), p = g < 0 ? "-" : "";
|
|
2517
|
+
if (_ < 60)
|
|
2518
|
+
return `${p}${_}s`;
|
|
2519
|
+
if (_ < 3600) {
|
|
2520
|
+
const O = Math.floor(_ / 60), y = _ % 60;
|
|
2521
2521
|
return y ? `${p}${O}m ${y}s` : `${p}${O}m`;
|
|
2522
2522
|
}
|
|
2523
|
-
const S = Math.floor(
|
|
2523
|
+
const S = Math.floor(_ / 3600), D = Math.floor(_ % 3600 / 60);
|
|
2524
2524
|
return D ? `${p}${S}h ${D}m` : `${p}${S}h`;
|
|
2525
2525
|
}
|
|
2526
2526
|
h(H, "formatDuration");
|
|
2527
|
-
function J(g,
|
|
2528
|
-
const p =
|
|
2527
|
+
function J(g, _) {
|
|
2528
|
+
const p = _?.valuePrefix ?? (_?.valueFormat === "currency" ? "$" : ""), S = _?.valueSuffix ?? (_?.valueFormat === "percent" ? "%" : "");
|
|
2529
2529
|
let D;
|
|
2530
|
-
switch (
|
|
2530
|
+
switch (_?.valueFormat) {
|
|
2531
2531
|
case "integer":
|
|
2532
2532
|
D = `${Math.round(g)}`;
|
|
2533
2533
|
break;
|
|
@@ -2543,12 +2543,12 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2543
2543
|
return `${p}${D}${S}`;
|
|
2544
2544
|
}
|
|
2545
2545
|
h(J, "formatSeriesValue");
|
|
2546
|
-
const
|
|
2546
|
+
const Re = I(() => {
|
|
2547
2547
|
const g = u.value;
|
|
2548
2548
|
if (!g?.data.length) return [];
|
|
2549
|
-
const
|
|
2549
|
+
const _ = g.data[g.data.length - 1];
|
|
2550
2550
|
return g.series.map((p, S) => {
|
|
2551
|
-
const D =
|
|
2551
|
+
const D = b(_?.[p.dataKey]);
|
|
2552
2552
|
return {
|
|
2553
2553
|
key: p.dataKey,
|
|
2554
2554
|
label: p.label || p.dataKey,
|
|
@@ -2559,47 +2559,47 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2559
2559
|
}), pe = I(() => {
|
|
2560
2560
|
const g = u.value;
|
|
2561
2561
|
if (!g?.data.length || g.chartType !== "line") return [];
|
|
2562
|
-
const
|
|
2562
|
+
const _ = g.data.length - 1, p = g.data[_];
|
|
2563
2563
|
return g.series.map((S, D) => {
|
|
2564
|
-
const O =
|
|
2565
|
-
return O === null ? null : { key: S.dataKey, cx: X(
|
|
2564
|
+
const O = b(p?.[S.dataKey]);
|
|
2565
|
+
return O === null ? null : { key: S.dataKey, cx: X(_, g.data.length), cy: Q(O), seriesIndex: D };
|
|
2566
2566
|
}).filter((S) => S !== null);
|
|
2567
2567
|
}), ve = I(() => {
|
|
2568
2568
|
const g = v.value;
|
|
2569
2569
|
if (!g) return [];
|
|
2570
|
-
const
|
|
2570
|
+
const _ = g.data.map((S) => ({
|
|
2571
2571
|
name: String(S[g.nameKey] ?? ""),
|
|
2572
|
-
value:
|
|
2573
|
-
})).filter((S) => S.name && S.value >= 0).sort((S, D) => D.value - S.value), p =
|
|
2574
|
-
return
|
|
2572
|
+
value: b(S[g.valueKey]) ?? 0
|
|
2573
|
+
})).filter((S) => S.name && S.value >= 0).sort((S, D) => D.value - S.value), p = _.reduce((S, D) => S + D.value, 0) || 1;
|
|
2574
|
+
return _.map((S, D) => ({
|
|
2575
2575
|
...S,
|
|
2576
2576
|
key: `${D}-${S.name}`,
|
|
2577
2577
|
percent: S.value / p
|
|
2578
2578
|
}));
|
|
2579
2579
|
}), xt = I(() => {
|
|
2580
2580
|
const g = /* @__PURE__ */ new Map();
|
|
2581
|
-
for (const
|
|
2582
|
-
g.set(
|
|
2581
|
+
for (const _ of i.value?.nodes ?? [])
|
|
2582
|
+
g.set(_.id, _);
|
|
2583
2583
|
return g;
|
|
2584
2584
|
}), Pe = I(() => {
|
|
2585
2585
|
const g = i.value;
|
|
2586
2586
|
if (!g?.edges.length) return [];
|
|
2587
|
-
const
|
|
2587
|
+
const _ = new Set(g.edges.map((f) => f.to)), p = g.edges.find((f) => !_.has(f.from)) ?? g.edges[0];
|
|
2588
2588
|
if (!p) return [];
|
|
2589
|
-
const S = [], D = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ h((f) => `${f.from}->${f.to}`, "edgeKey"), y = /* @__PURE__ */ h((f,
|
|
2589
|
+
const S = [], D = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ h((f) => `${f.from}->${f.to}`, "edgeKey"), y = /* @__PURE__ */ h((f, L) => {
|
|
2590
2590
|
const V = xt.value.get(f);
|
|
2591
|
-
V && S.push({ key: `node-${f}-${S.length}`, label: V.label, note:
|
|
2591
|
+
V && S.push({ key: `node-${f}-${S.length}`, label: V.label, note: L });
|
|
2592
2592
|
}, "pushStep");
|
|
2593
|
-
let
|
|
2594
|
-
for (;
|
|
2595
|
-
const f = g.edges.find((
|
|
2596
|
-
if (y(
|
|
2593
|
+
let k = p.from;
|
|
2594
|
+
for (; k; ) {
|
|
2595
|
+
const f = g.edges.find((L) => L.from === k && !D.has(O(L)));
|
|
2596
|
+
if (y(k, f?.label), !f)
|
|
2597
2597
|
break;
|
|
2598
|
-
D.add(O(f)),
|
|
2598
|
+
D.add(O(f)), k = f.to;
|
|
2599
2599
|
}
|
|
2600
2600
|
for (const f of g.edges) {
|
|
2601
|
-
const
|
|
2602
|
-
D.has(
|
|
2601
|
+
const L = O(f);
|
|
2602
|
+
D.has(L) || (y(f.from, f.label), y(f.to, void 0));
|
|
2603
2603
|
}
|
|
2604
2604
|
return S;
|
|
2605
2605
|
}), Be = I(() => i.value?.nodes ?? []), se = [
|
|
@@ -2611,20 +2611,20 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2611
2611
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
2612
2612
|
"rgba(255, 255, 255, 0.55)"
|
|
2613
2613
|
];
|
|
2614
|
-
function
|
|
2615
|
-
const
|
|
2616
|
-
return
|
|
2614
|
+
function be(g) {
|
|
2615
|
+
const _ = t.inverted ? Ue : se;
|
|
2616
|
+
return _[g % _.length];
|
|
2617
2617
|
}
|
|
2618
|
-
h(
|
|
2619
|
-
const ce = I(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"),
|
|
2620
|
-
return (g,
|
|
2618
|
+
h(be, "seriesColor");
|
|
2619
|
+
const ce = I(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), Ce = I(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), N = I(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), Je = I(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), He = I(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), et = I(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), Ge = I(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), ee = I(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)"), Ye = I(() => t.inverted ? "transparent" : "var(--color-theme-0)");
|
|
2620
|
+
return (g, _) => e.value ? (m(), x("section", {
|
|
2621
2621
|
key: 0,
|
|
2622
2622
|
"data-test": "chat-visual",
|
|
2623
2623
|
"data-visual-type": e.value.visualType,
|
|
2624
2624
|
"data-chart-type": n.value?.chartType,
|
|
2625
2625
|
"data-diagram-type": i.value?.diagramType,
|
|
2626
2626
|
class: "my-6 w-full border-y py-5",
|
|
2627
|
-
style: ne({ borderColor:
|
|
2627
|
+
style: ne({ borderColor: et.value }),
|
|
2628
2628
|
"aria-label": e.value.meta.title
|
|
2629
2629
|
}, [
|
|
2630
2630
|
w("header", Ra, [
|
|
@@ -2635,8 +2635,8 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2635
2635
|
e.value.meta.description ? (m(), x("p", {
|
|
2636
2636
|
key: 0,
|
|
2637
2637
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
2638
|
-
style: ne({ color:
|
|
2639
|
-
}, Z(e.value.meta.description), 5)) :
|
|
2638
|
+
style: ne({ color: Ce.value })
|
|
2639
|
+
}, Z(e.value.meta.description), 5)) : j("", !0)
|
|
2640
2640
|
]),
|
|
2641
2641
|
u.value ? (m(), x("div", {
|
|
2642
2642
|
key: 0,
|
|
@@ -2658,7 +2658,7 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2658
2658
|
y2: Q(p),
|
|
2659
2659
|
"stroke-width": "1",
|
|
2660
2660
|
"vector-effect": "non-scaling-stroke",
|
|
2661
|
-
style: ne({ stroke: p === 0 ? He.value :
|
|
2661
|
+
style: ne({ stroke: p === 0 ? He.value : Je.value })
|
|
2662
2662
|
}, null, 12, Da))), 128)),
|
|
2663
2663
|
w("g", null, [
|
|
2664
2664
|
(m(!0), x(ae, null, me(G.value.ticks, (p) => (m(), x("text", {
|
|
@@ -2670,38 +2670,38 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2670
2670
|
style: ne({ fill: N.value })
|
|
2671
2671
|
}, Z(q(p)), 13, Ma))), 128))
|
|
2672
2672
|
]),
|
|
2673
|
-
u.value.chartType === "bar" ? (m(!0), x(ae, { key: 0 }, me(
|
|
2673
|
+
u.value.chartType === "bar" ? (m(!0), x(ae, { key: 0 }, me(P.value, (p) => (m(), x("rect", {
|
|
2674
2674
|
key: p.key,
|
|
2675
2675
|
x: p.x,
|
|
2676
2676
|
y: p.y,
|
|
2677
2677
|
width: p.width,
|
|
2678
2678
|
height: p.height,
|
|
2679
2679
|
rx: "2.5",
|
|
2680
|
-
style: ne({ fill:
|
|
2680
|
+
style: ne({ fill: be(p.seriesIndex) })
|
|
2681
2681
|
}, null, 12, $a))), 128)) : (m(), x(ae, { key: 1 }, [
|
|
2682
2682
|
(m(!0), x(ae, null, me(c.value, (p, S) => (m(), x("g", {
|
|
2683
2683
|
key: p.dataKey
|
|
2684
2684
|
}, [
|
|
2685
2685
|
u.value.chartType === "line" ? (m(), x("path", {
|
|
2686
2686
|
key: 0,
|
|
2687
|
-
d:
|
|
2687
|
+
d: M(p.dataKey),
|
|
2688
2688
|
fill: "none",
|
|
2689
2689
|
"stroke-width": "2",
|
|
2690
2690
|
"stroke-linecap": "round",
|
|
2691
2691
|
"stroke-linejoin": "round",
|
|
2692
2692
|
"vector-effect": "non-scaling-stroke",
|
|
2693
|
-
style: ne({ stroke:
|
|
2694
|
-
}, null, 12, La)) :
|
|
2693
|
+
style: ne({ stroke: be(S) })
|
|
2694
|
+
}, null, 12, La)) : j("", !0),
|
|
2695
2695
|
(m(!0), x(ae, null, me(o.value, (D, O) => (m(), x(ae, {
|
|
2696
2696
|
key: `${p.dataKey}-${O}`
|
|
2697
2697
|
}, [
|
|
2698
2698
|
u.value.chartType === "scatter" ? (m(), x("circle", {
|
|
2699
2699
|
key: 0,
|
|
2700
2700
|
cx: X(O, o.value.length),
|
|
2701
|
-
cy: Q(
|
|
2701
|
+
cy: Q(b(D[p.dataKey]) ?? 0),
|
|
2702
2702
|
r: "2.6",
|
|
2703
|
-
style: ne({ fill:
|
|
2704
|
-
}, null, 12, Oa)) :
|
|
2703
|
+
style: ne({ fill: be(S) })
|
|
2704
|
+
}, null, 12, Oa)) : j("", !0)
|
|
2705
2705
|
], 64))), 128))
|
|
2706
2706
|
]))), 128)),
|
|
2707
2707
|
(m(!0), x(ae, null, me(pe.value, (p) => (m(), x("circle", {
|
|
@@ -2709,10 +2709,10 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2709
2709
|
cx: p.cx,
|
|
2710
2710
|
cy: p.cy,
|
|
2711
2711
|
r: "3",
|
|
2712
|
-
style: ne({ fill:
|
|
2712
|
+
style: ne({ fill: be(p.seriesIndex) })
|
|
2713
2713
|
}, null, 12, Na))), 128))
|
|
2714
2714
|
], 64)),
|
|
2715
|
-
(m(!0), x(ae, null, me(
|
|
2715
|
+
(m(!0), x(ae, null, me(F.value, (p) => (m(), x("text", {
|
|
2716
2716
|
key: p.key,
|
|
2717
2717
|
x: p.x,
|
|
2718
2718
|
y: R.height - 6,
|
|
@@ -2721,24 +2721,24 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2721
2721
|
style: ne({ fill: N.value })
|
|
2722
2722
|
}, Z(p.label), 13, za))), 128))
|
|
2723
2723
|
], 12, Ia)),
|
|
2724
|
-
|
|
2725
|
-
(m(!0), x(ae, null, me(
|
|
2724
|
+
Re.value.length > 1 || u.value.chartType !== "bar" ? (m(), x("div", Pa, [
|
|
2725
|
+
(m(!0), x(ae, null, me(Re.value, (p) => (m(), x("div", {
|
|
2726
2726
|
key: p.key,
|
|
2727
2727
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
2728
2728
|
}, [
|
|
2729
2729
|
w("span", {
|
|
2730
2730
|
class: "size-2.5 shrink-0 rounded-full",
|
|
2731
|
-
style: ne({ background:
|
|
2731
|
+
style: ne({ background: be(p.seriesIndex) })
|
|
2732
2732
|
}, null, 4),
|
|
2733
2733
|
w("span", {
|
|
2734
|
-
style: ne({ color:
|
|
2734
|
+
style: ne({ color: Ce.value })
|
|
2735
2735
|
}, Z(p.label), 5),
|
|
2736
2736
|
w("span", {
|
|
2737
2737
|
class: "font-semibold tabular-nums",
|
|
2738
2738
|
style: ne({ color: ce.value })
|
|
2739
2739
|
}, Z(p.value), 5)
|
|
2740
2740
|
]))), 128))
|
|
2741
|
-
])) :
|
|
2741
|
+
])) : j("", !0)
|
|
2742
2742
|
], 8, Ca)) : v.value ? (m(), x("div", Fa, [
|
|
2743
2743
|
(m(!0), x(ae, null, me(ve.value, (p, S) => (m(), x("div", {
|
|
2744
2744
|
key: p.key
|
|
@@ -2750,7 +2750,7 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2750
2750
|
}, Z(p.name), 5),
|
|
2751
2751
|
w("span", {
|
|
2752
2752
|
class: "tabular-nums",
|
|
2753
|
-
style: ne({ color:
|
|
2753
|
+
style: ne({ color: Ce.value })
|
|
2754
2754
|
}, Z(Math.round(p.percent * 100)) + "%", 5)
|
|
2755
2755
|
]),
|
|
2756
2756
|
w("div", {
|
|
@@ -2759,7 +2759,7 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2759
2759
|
}, [
|
|
2760
2760
|
w("div", {
|
|
2761
2761
|
class: "h-full rounded-full",
|
|
2762
|
-
style: ne({ width: `${Math.max(2, p.percent * 100)}%`, background:
|
|
2762
|
+
style: ne({ width: `${Math.max(2, p.percent * 100)}%`, background: be(S) })
|
|
2763
2763
|
}, null, 4)
|
|
2764
2764
|
], 4)
|
|
2765
2765
|
]))), 128))
|
|
@@ -2771,13 +2771,13 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2771
2771
|
w("div", Ha, [
|
|
2772
2772
|
w("span", {
|
|
2773
2773
|
class: "grid size-5 place-items-center rounded-full border text-[10px] font-semibold leading-none",
|
|
2774
|
-
style: ne({ borderColor: Ge.value, color:
|
|
2774
|
+
style: ne({ borderColor: Ge.value, color: Ce.value, background: Ye.value })
|
|
2775
2775
|
}, Z(S + 1), 5),
|
|
2776
2776
|
S !== Pe.value.length - 1 ? (m(), x("span", {
|
|
2777
2777
|
key: 0,
|
|
2778
2778
|
class: "w-px flex-1",
|
|
2779
2779
|
style: ne({ background: Ge.value, minHeight: "1.1rem" })
|
|
2780
|
-
}, null, 4)) :
|
|
2780
|
+
}, null, 4)) : j("", !0)
|
|
2781
2781
|
]),
|
|
2782
2782
|
w("div", Ga, [
|
|
2783
2783
|
w("div", {
|
|
@@ -2787,26 +2787,21 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2787
2787
|
p.note ? (m(), x("div", {
|
|
2788
2788
|
key: 0,
|
|
2789
2789
|
class: "mt-0.5 text-[11px] leading-snug",
|
|
2790
|
-
style: ne({ color:
|
|
2791
|
-
}, Z(p.note), 5)) :
|
|
2790
|
+
style: ne({ color: Ce.value })
|
|
2791
|
+
}, Z(p.note), 5)) : j("", !0)
|
|
2792
2792
|
])
|
|
2793
2793
|
]))), 128)) : (m(!0), x(ae, { key: 1 }, me(Be.value, (p) => (m(), x("div", {
|
|
2794
2794
|
key: p.id,
|
|
2795
2795
|
class: "mb-1.5 rounded-xl border px-2.5 py-2 text-[12px] font-medium leading-tight",
|
|
2796
2796
|
style: ne({ borderColor: Ge.value, color: ce.value })
|
|
2797
2797
|
}, Z(p.label), 5))), 128))
|
|
2798
|
-
])) :
|
|
2798
|
+
])) : j("", !0),
|
|
2799
2799
|
e.value.meta.footer ? (m(), x("footer", {
|
|
2800
2800
|
key: 3,
|
|
2801
2801
|
class: "mt-3 text-[11px] leading-snug",
|
|
2802
2802
|
style: ne({ color: N.value })
|
|
2803
|
-
}, Z(e.value.meta.footer), 5)) :
|
|
2804
|
-
], 12, Ea)) : (
|
|
2805
|
-
key: 1,
|
|
2806
|
-
"data-test": "chat-visual-fallback",
|
|
2807
|
-
class: "mt-3 mb-2 w-full border-y py-2 text-[12px] leading-snug",
|
|
2808
|
-
style: ne({ borderColor: Ye.value, color: Se.value })
|
|
2809
|
-
}, " Visual unavailable. Showing the written answer instead. ", 4));
|
|
2803
|
+
}, Z(e.value.meta.footer), 5)) : j("", !0)
|
|
2804
|
+
], 12, Ea)) : j("", !0);
|
|
2810
2805
|
}
|
|
2811
2806
|
}), Wa = { class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed" }, qa = ["innerHTML"], Ft = /* @__PURE__ */ ze({
|
|
2812
2807
|
__name: "ChatRichText",
|
|
@@ -2837,14 +2832,14 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2837
2832
|
const v = u.trim();
|
|
2838
2833
|
if (!v || v === "#")
|
|
2839
2834
|
return c;
|
|
2840
|
-
let
|
|
2835
|
+
let b = !1;
|
|
2841
2836
|
if (typeof window < "u")
|
|
2842
2837
|
try {
|
|
2843
|
-
|
|
2838
|
+
b = new URL(u, window.location.href).origin === window.location.origin;
|
|
2844
2839
|
} catch {
|
|
2845
|
-
|
|
2840
|
+
b = !1;
|
|
2846
2841
|
}
|
|
2847
|
-
return
|
|
2842
|
+
return b ? `<a href="${u}">${c}</a>` : `<a href="${u}" target="_blank" rel="noopener noreferrer">${c}</a>`;
|
|
2848
2843
|
}, Y.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
2849
2844
|
function s(u) {
|
|
2850
2845
|
if (!u) return "";
|
|
@@ -2854,17 +2849,22 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2854
2849
|
h(s, "renderMarkdown");
|
|
2855
2850
|
function l(u) {
|
|
2856
2851
|
const c = [], v = /```pl-visual[ \t]*\r?\n([\s\S]*?)```/g;
|
|
2857
|
-
let
|
|
2852
|
+
let b = 0, A = 0, E = v.exec(u);
|
|
2858
2853
|
for (; E !== null; ) {
|
|
2859
|
-
const X = u.slice(
|
|
2860
|
-
Q && c.push({ kind: "markdown", key: `md-${
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
result:
|
|
2864
|
-
|
|
2854
|
+
const X = u.slice(b, E.index), Q = s(X);
|
|
2855
|
+
Q && c.push({ kind: "markdown", key: `md-${A}`, html: Q });
|
|
2856
|
+
const M = Ws(E[1].trim());
|
|
2857
|
+
if (M.ok)
|
|
2858
|
+
c.push({ kind: "visual", key: `visual-${A}`, result: M });
|
|
2859
|
+
else {
|
|
2860
|
+
typeof console < "u" && console.warn(`[pl-visual] ${M.reason}: ${M.message}`);
|
|
2861
|
+
const P = M.fallbackMarkdown ? s(M.fallbackMarkdown) : "";
|
|
2862
|
+
P && c.push({ kind: "markdown", key: `visual-${A}`, html: P });
|
|
2863
|
+
}
|
|
2864
|
+
b = E.index + E[0].length, A += 1, E = v.exec(u);
|
|
2865
2865
|
}
|
|
2866
|
-
const G = u.slice(
|
|
2867
|
-
return R && c.push({ kind: "markdown", key: `md-${
|
|
2866
|
+
const G = u.slice(b), R = s(G);
|
|
2867
|
+
return R && c.push({ kind: "markdown", key: `md-${A}`, html: R }), c;
|
|
2868
2868
|
}
|
|
2869
2869
|
h(l, "richTextSegments");
|
|
2870
2870
|
const o = I(() => {
|
|
@@ -2877,7 +2877,7 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2877
2877
|
}, [
|
|
2878
2878
|
v.kind === "markdown" ? (m(), x("div", {
|
|
2879
2879
|
key: 0,
|
|
2880
|
-
class:
|
|
2880
|
+
class: $(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
2881
2881
|
innerHTML: v.html
|
|
2882
2882
|
}, null, 10, qa)) : (m(), un(ja, {
|
|
2883
2883
|
key: 1,
|
|
@@ -2940,7 +2940,7 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2940
2940
|
}, nr = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-issue-action-label", "data-issue-action-url", "data-streaming"], sr = { class: "max-w-[85%] min-w-0" }, ir = ["href"], ar = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], rr = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], lr = {
|
|
2941
2941
|
key: 0,
|
|
2942
2942
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2943
|
-
}, or = ["src", "alt"], cr = ["src", "alt"], ur = ["src"], hr = ["href"], dr = ["data-tool-activity-status"], pr = { class: "truncate" }, fr = ["data-working-description"], gr = { class: "truncate" }, mr = ["data-tool-activity-status"], xr = { class: "truncate" },
|
|
2943
|
+
}, or = ["src", "alt"], cr = ["src", "alt"], ur = ["src"], hr = ["href"], dr = ["data-tool-activity-status"], pr = { class: "truncate" }, fr = ["data-working-description"], gr = { class: "truncate" }, mr = ["data-tool-activity-status"], xr = { class: "truncate" }, kr = ["data-issue-code"], br = ["href"], vr = {
|
|
2944
2944
|
key: 4,
|
|
2945
2945
|
"data-test": "messaging-thinking-indicator",
|
|
2946
2946
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
@@ -2987,62 +2987,62 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
2987
2987
|
return y ? /\[[^\]]+\]\([^)]+\)/.test(y) : !1;
|
|
2988
2988
|
}
|
|
2989
2989
|
h(v, "containsMarkdownLink");
|
|
2990
|
-
function
|
|
2990
|
+
function b(y) {
|
|
2991
2991
|
return y.sender === "system" && (!!y.issue || y.id === ve.value);
|
|
2992
2992
|
}
|
|
2993
|
-
h(
|
|
2994
|
-
function
|
|
2995
|
-
const f = y[
|
|
2996
|
-
return
|
|
2993
|
+
h(b, "isSystemExplainerMessage");
|
|
2994
|
+
function A(y, k) {
|
|
2995
|
+
const f = y[k], L = y[k + 1];
|
|
2996
|
+
return !L || L.sender !== f.sender;
|
|
2997
2997
|
}
|
|
2998
|
-
h(
|
|
2999
|
-
const E = I(() => a.chatController?.textState.value), G = I(() => E.value?.isConnected ?? !1), R = I(() => E.value?.isThinking ?? !1), X = I(() => E.value?.connectionStatus === "disconnected" && !!E.value?.error), Q = I(() => E.value?.connectionStatus !== "connected" && !E.value?.error),
|
|
2998
|
+
h(A, "shouldShowAvatar");
|
|
2999
|
+
const E = I(() => a.chatController?.textState.value), G = I(() => E.value?.isConnected ?? !1), R = I(() => E.value?.isThinking ?? !1), X = I(() => E.value?.connectionStatus === "disconnected" && !!E.value?.error), Q = I(() => E.value?.connectionStatus !== "connected" && !E.value?.error), M = I(() => E.value?.error), P = I(() => a.chatController?.sharedMessages.value ?? []), F = I(() => E.value?.workingDescription?.trim() || void 0), q = I(() => R.value ? E.value?.toolActivities ?? [] : []), H = I(() => J(q.value));
|
|
3000
3000
|
function J(y) {
|
|
3001
3001
|
if (!y?.length)
|
|
3002
3002
|
return;
|
|
3003
|
-
const
|
|
3004
|
-
if (
|
|
3005
|
-
return { status: "started", icon: "i-tabler-loader-2 animate-spin", label:
|
|
3006
|
-
const f =
|
|
3003
|
+
const k = Re(y, "started");
|
|
3004
|
+
if (k)
|
|
3005
|
+
return { status: "started", icon: "i-tabler-loader-2 animate-spin", label: k.label };
|
|
3006
|
+
const f = Re(y, "failed");
|
|
3007
3007
|
if (f)
|
|
3008
3008
|
return { status: "failed", icon: "i-tabler-alert-circle text-theme-500", label: f.label };
|
|
3009
|
-
const
|
|
3010
|
-
if (
|
|
3009
|
+
const L = y.filter((V) => V.status === "completed").length;
|
|
3010
|
+
if (L > 0)
|
|
3011
3011
|
return {
|
|
3012
3012
|
status: "completed",
|
|
3013
3013
|
icon: "i-tabler-circle-check-filled text-primary-500",
|
|
3014
|
-
label:
|
|
3014
|
+
label: L === 1 ? "1 action completed" : `${L} actions completed`
|
|
3015
3015
|
};
|
|
3016
3016
|
}
|
|
3017
3017
|
h(J, "toolActivityLineFor");
|
|
3018
|
-
function
|
|
3018
|
+
function Re(y, k) {
|
|
3019
3019
|
for (let f = y.length - 1; f >= 0; f--) {
|
|
3020
|
-
const
|
|
3021
|
-
if (
|
|
3022
|
-
return
|
|
3020
|
+
const L = y[f];
|
|
3021
|
+
if (L?.status === k)
|
|
3022
|
+
return L;
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
|
-
h(
|
|
3025
|
+
h(Re, "lastToolActivityWithStatus");
|
|
3026
3026
|
const pe = I(() => E.value?.transientIssue), ve = I(() => {
|
|
3027
3027
|
if (!R.value) return;
|
|
3028
|
-
const y =
|
|
3029
|
-
return
|
|
3030
|
-
}), xt = I(() => !R.value ||
|
|
3028
|
+
const y = P.value, k = y[y.length - 1];
|
|
3029
|
+
return k?.sender === "agent" || k?.sender === "system" ? k.id : void 0;
|
|
3030
|
+
}), xt = I(() => !R.value || F.value ? !1 : ve.value === void 0), Pe = I(() => E.value?.sendBlockedReason), Be = I(() => !G.value || Pe.value !== void 0), se = I(() => X.value ? "Agent is offline" : Q.value ? "Connecting..." : Pe.value === "agent_deleted" ? "This assistant was deleted" : Pe.value === "account" ? "Resolve the billing issue above to continue" : "Message"), Ue = I(() => (n.value.trim() || u.value.length > 0) && !Be.value && !c.value && !R.value), be = I(() => !!a.chatController && R.value && !c.value), ce = I(() => be.value ? "stop" : Ue.value ? "send" : "idle"), Ce = I(() => ce.value !== "idle"), N = I(() => a.variant === "light"), Je = I(
|
|
3031
3031
|
() => N.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
3032
3032
|
), He = I(() => N.value ? "text-theme-300" : "text-white/30");
|
|
3033
3033
|
Wt(async () => {
|
|
3034
3034
|
a.chatController && !G.value && await a.chatController.startTextConversation();
|
|
3035
3035
|
});
|
|
3036
|
-
async function
|
|
3037
|
-
const y = n.value.trim(),
|
|
3038
|
-
if (!y && !
|
|
3036
|
+
async function et() {
|
|
3037
|
+
const y = n.value.trim(), k = u.value.length > 0;
|
|
3038
|
+
if (!y && !k || !a.chatController || Be.value || c.value || R.value)
|
|
3039
3039
|
return;
|
|
3040
|
-
const f = n.value,
|
|
3041
|
-
n.value = "", u.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(f,
|
|
3040
|
+
const f = n.value, L = k ? [...u.value] : void 0;
|
|
3041
|
+
n.value = "", u.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(f, L);
|
|
3042
3042
|
}
|
|
3043
|
-
h(
|
|
3043
|
+
h(et, "sendMessage");
|
|
3044
3044
|
async function Ge() {
|
|
3045
|
-
!a.chatController || !
|
|
3045
|
+
!a.chatController || !be.value || await a.chatController.stopChatTurn();
|
|
3046
3046
|
}
|
|
3047
3047
|
h(Ge, "stopMessage");
|
|
3048
3048
|
async function ee() {
|
|
@@ -3050,59 +3050,59 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3050
3050
|
await Ge();
|
|
3051
3051
|
return;
|
|
3052
3052
|
}
|
|
3053
|
-
ce.value === "send" && await
|
|
3053
|
+
ce.value === "send" && await et();
|
|
3054
3054
|
}
|
|
3055
3055
|
h(ee, "handleComposerAction");
|
|
3056
|
-
async function
|
|
3057
|
-
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), await
|
|
3056
|
+
async function Ye(y) {
|
|
3057
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), await et());
|
|
3058
3058
|
}
|
|
3059
|
-
h(
|
|
3059
|
+
h(Ye, "handleKeydown");
|
|
3060
3060
|
function g() {
|
|
3061
3061
|
l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
|
|
3062
3062
|
}
|
|
3063
3063
|
h(g, "adjustTextareaHeight"), Bt(n, () => Bs(() => g()));
|
|
3064
|
-
function
|
|
3064
|
+
function _() {
|
|
3065
3065
|
o.value?.click();
|
|
3066
3066
|
}
|
|
3067
|
-
h(
|
|
3067
|
+
h(_, "triggerFileInput");
|
|
3068
3068
|
async function p(y) {
|
|
3069
|
-
const
|
|
3069
|
+
const k = y.target, f = k.files?.[0];
|
|
3070
3070
|
if (!(!f || !a.uploadFn)) {
|
|
3071
3071
|
c.value = !0;
|
|
3072
3072
|
try {
|
|
3073
|
-
const
|
|
3074
|
-
u.value = [...u.value,
|
|
3075
|
-
} catch (
|
|
3076
|
-
const V =
|
|
3073
|
+
const L = await a.uploadFn(f);
|
|
3074
|
+
u.value = [...u.value, L];
|
|
3075
|
+
} catch (L) {
|
|
3076
|
+
const V = L instanceof Error ? L.message : "Couldn't attach that file.";
|
|
3077
3077
|
a.chatController?.notify(`Upload failed — ${V}`);
|
|
3078
3078
|
} finally {
|
|
3079
|
-
c.value = !1,
|
|
3079
|
+
c.value = !1, k.value = "";
|
|
3080
3080
|
}
|
|
3081
3081
|
}
|
|
3082
3082
|
}
|
|
3083
3083
|
h(p, "handleFileSelect");
|
|
3084
3084
|
function S(y) {
|
|
3085
|
-
u.value = u.value.filter((
|
|
3085
|
+
u.value = u.value.filter((k, f) => f !== y);
|
|
3086
3086
|
}
|
|
3087
3087
|
h(S, "removeAttachment");
|
|
3088
|
-
function D(y,
|
|
3089
|
-
if (
|
|
3090
|
-
const Ie = y[
|
|
3088
|
+
function D(y, k) {
|
|
3089
|
+
if (k === 0) {
|
|
3090
|
+
const Ie = y[k];
|
|
3091
3091
|
return Ie?.timestamp ? O(new Date(Ie.timestamp)) : null;
|
|
3092
3092
|
}
|
|
3093
|
-
const f = y[
|
|
3094
|
-
if (!f?.timestamp ||
|
|
3093
|
+
const f = y[k - 1], L = y[k];
|
|
3094
|
+
if (!f?.timestamp || !L?.timestamp) return null;
|
|
3095
3095
|
const V = new Date(f.timestamp).getTime();
|
|
3096
|
-
return new Date(
|
|
3096
|
+
return new Date(L.timestamp).getTime() - V > 36e5 ? O(new Date(L.timestamp)) : null;
|
|
3097
3097
|
}
|
|
3098
3098
|
h(D, "shouldShowTimeDivider");
|
|
3099
3099
|
function O(y) {
|
|
3100
|
-
const
|
|
3101
|
-
|
|
3102
|
-
const V = y.toDateString() ===
|
|
3100
|
+
const k = /* @__PURE__ */ new Date(), f = y.toDateString() === k.toDateString(), L = new Date(k);
|
|
3101
|
+
L.setDate(L.getDate() - 1);
|
|
3102
|
+
const V = y.toDateString() === L.toDateString(), fe = y.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
3103
3103
|
if (f) return fe;
|
|
3104
3104
|
if (V) return `Yesterday, ${fe}`;
|
|
3105
|
-
const ye = y.getFullYear() ===
|
|
3105
|
+
const ye = y.getFullYear() === k.getFullYear();
|
|
3106
3106
|
return `${y.toLocaleDateString("en-US", {
|
|
3107
3107
|
weekday: "long",
|
|
3108
3108
|
month: "short",
|
|
@@ -3110,8 +3110,8 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3110
3110
|
...ye ? {} : { year: "numeric" }
|
|
3111
3111
|
})}, ${fe}`;
|
|
3112
3112
|
}
|
|
3113
|
-
return h(O, "formatTimeDivider"), (y,
|
|
3114
|
-
N.value ?
|
|
3113
|
+
return h(O, "formatTimeDivider"), (y, k) => (m(), x("div", Ka, [
|
|
3114
|
+
N.value ? j("", !0) : (m(), x("div", Za, [
|
|
3115
3115
|
rt(oi, {
|
|
3116
3116
|
agent: a.agent,
|
|
3117
3117
|
"is-online": G.value
|
|
@@ -3119,24 +3119,24 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3119
3119
|
])),
|
|
3120
3120
|
X.value ? (m(), x("div", {
|
|
3121
3121
|
key: 1,
|
|
3122
|
-
class:
|
|
3122
|
+
class: $(["py-16 flex flex-col items-center justify-center gap-3 text-sm", N.value ? "text-theme-400" : "text-white/60"])
|
|
3123
3123
|
}, [
|
|
3124
3124
|
w("i", {
|
|
3125
|
-
class:
|
|
3125
|
+
class: $(["i-heroicons-cloud-arrow-down size-8", N.value ? "text-theme-300" : "text-white/40"])
|
|
3126
3126
|
}, null, 2),
|
|
3127
|
-
w("span", null, Z(
|
|
3127
|
+
w("span", null, Z(M.value), 1)
|
|
3128
3128
|
], 2)) : Q.value ? (m(), x("div", {
|
|
3129
3129
|
key: 2,
|
|
3130
|
-
class:
|
|
3130
|
+
class: $(["py-16 flex flex-col items-center justify-center gap-2 text-sm", N.value ? "text-theme-400" : "text-theme-600"])
|
|
3131
3131
|
}, [
|
|
3132
3132
|
rt(jn, { class: "size-4" })
|
|
3133
3133
|
], 2)) : a.setupHint ? (m(), x("div", {
|
|
3134
3134
|
key: 3,
|
|
3135
|
-
class:
|
|
3135
|
+
class: $(["flex items-center justify-center gap-1.5 py-2 text-[11px]", He.value])
|
|
3136
3136
|
}, [
|
|
3137
|
-
|
|
3137
|
+
k[10] || (k[10] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
3138
3138
|
w("span", null, Z(a.setupHint), 1)
|
|
3139
|
-
], 2)) :
|
|
3139
|
+
], 2)) : j("", !0),
|
|
3140
3140
|
rt(Ya, {
|
|
3141
3141
|
ref_key: "chatScroller",
|
|
3142
3142
|
ref: s,
|
|
@@ -3144,53 +3144,53 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3144
3144
|
}, {
|
|
3145
3145
|
default: Us(() => [
|
|
3146
3146
|
w("div", {
|
|
3147
|
-
class:
|
|
3147
|
+
class: $(P.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3" : "pt-4 pb-[120px] px-3 space-y-2")
|
|
3148
3148
|
}, [
|
|
3149
|
-
|
|
3149
|
+
P.value.length === 0 && !Q.value && !X.value ? (m(), x("div", Xa, [
|
|
3150
3150
|
w("div", Qa, [
|
|
3151
3151
|
w("img", {
|
|
3152
3152
|
src: a.agent.avatarUrl.value,
|
|
3153
3153
|
alt: a.agent.displayName.value,
|
|
3154
|
-
class:
|
|
3154
|
+
class: $(["size-full rounded-full object-cover ring-1", N.value ? "ring-black/5" : "ring-white/10"])
|
|
3155
3155
|
}, null, 10, Ja),
|
|
3156
3156
|
G.value ? (m(), x("span", {
|
|
3157
3157
|
key: 0,
|
|
3158
|
-
class:
|
|
3159
|
-
}, [...
|
|
3158
|
+
class: $(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", N.value ? "bg-white" : "bg-theme-900"])
|
|
3159
|
+
}, [...k[11] || (k[11] = [
|
|
3160
3160
|
w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
3161
|
-
])], 2)) :
|
|
3161
|
+
])], 2)) : j("", !0)
|
|
3162
3162
|
]),
|
|
3163
3163
|
w("div", {
|
|
3164
|
-
class:
|
|
3164
|
+
class: $(["text-base @sm/chat:text-lg font-semibold", N.value ? "text-theme-900" : "text-white"])
|
|
3165
3165
|
}, Z(a.agent.displayName.value), 3),
|
|
3166
3166
|
w("p", {
|
|
3167
|
-
class:
|
|
3167
|
+
class: $(["mt-1 text-center text-xs @sm/chat:text-sm", He.value])
|
|
3168
3168
|
}, Z(a.emptyStateMessage || "Type your message to get started."), 3),
|
|
3169
3169
|
w("div", {
|
|
3170
|
-
class:
|
|
3170
|
+
class: $(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", N.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
3171
3171
|
title: e.value.tooltip
|
|
3172
3172
|
}, [
|
|
3173
3173
|
w("i", {
|
|
3174
|
-
class:
|
|
3174
|
+
class: $([e.value.icon, "size-3"])
|
|
3175
3175
|
}, null, 2),
|
|
3176
3176
|
w("span", null, Z(e.value.label), 1)
|
|
3177
3177
|
], 10, er)
|
|
3178
|
-
])) :
|
|
3179
|
-
(m(!0), x(ae, null, me(
|
|
3178
|
+
])) : j("", !0),
|
|
3179
|
+
(m(!0), x(ae, null, me(P.value, (f, L) => (m(), x(ae, {
|
|
3180
3180
|
key: f.id
|
|
3181
3181
|
}, [
|
|
3182
|
-
D(
|
|
3182
|
+
D(P.value, L) ? (m(), x("div", tr, [
|
|
3183
3183
|
w("div", {
|
|
3184
|
-
class:
|
|
3184
|
+
class: $(["flex-1 h-px", Je.value])
|
|
3185
3185
|
}, null, 2),
|
|
3186
3186
|
w("span", {
|
|
3187
|
-
class:
|
|
3188
|
-
}, Z(D(
|
|
3187
|
+
class: $(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", He.value])
|
|
3188
|
+
}, Z(D(P.value, L)), 3),
|
|
3189
3189
|
w("div", {
|
|
3190
|
-
class:
|
|
3190
|
+
class: $(["flex-1 h-px", Je.value])
|
|
3191
3191
|
}, null, 2)
|
|
3192
|
-
])) :
|
|
3193
|
-
|
|
3192
|
+
])) : j("", !0),
|
|
3193
|
+
b(f) ? (m(), x("div", {
|
|
3194
3194
|
key: 1,
|
|
3195
3195
|
"data-test": "messaging-system-msg",
|
|
3196
3196
|
"data-message-id": f.id,
|
|
@@ -3207,34 +3207,34 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3207
3207
|
}, [
|
|
3208
3208
|
w("div", sr, [
|
|
3209
3209
|
w("div", {
|
|
3210
|
-
class:
|
|
3210
|
+
class: $(["mb-1 pl-1 text-[11px] font-medium", N.value ? "text-theme-500" : "text-white/45"])
|
|
3211
3211
|
}, " System Message ", 2),
|
|
3212
3212
|
w("div", {
|
|
3213
|
-
class:
|
|
3213
|
+
class: $(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", N.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
3214
3214
|
}, [
|
|
3215
3215
|
f.text ? (m(), un(Ft, {
|
|
3216
3216
|
key: 0,
|
|
3217
3217
|
text: f.text,
|
|
3218
3218
|
inverted: !N.value,
|
|
3219
3219
|
streaming: f.id === ve.value,
|
|
3220
|
-
onClick:
|
|
3220
|
+
onClick: k[0] || (k[0] = wt(() => {
|
|
3221
3221
|
}, ["stop"]))
|
|
3222
3222
|
}, null, 8, ["text", "inverted", "streaming"])) : f.issue?.help ? (m(), un(Ft, {
|
|
3223
3223
|
key: 1,
|
|
3224
3224
|
text: f.issue.help,
|
|
3225
3225
|
inverted: !N.value
|
|
3226
|
-
}, null, 8, ["text", "inverted"])) :
|
|
3226
|
+
}, null, 8, ["text", "inverted"])) : j("", !0),
|
|
3227
3227
|
f.issue?.actionUrl && !v(f.text) ? (m(), x("a", {
|
|
3228
3228
|
key: 2,
|
|
3229
3229
|
href: f.issue.actionUrl,
|
|
3230
3230
|
"data-test": "messaging-system-msg-action",
|
|
3231
|
-
class:
|
|
3232
|
-
onClick:
|
|
3231
|
+
class: $(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", N.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
3232
|
+
onClick: k[1] || (k[1] = wt(() => {
|
|
3233
3233
|
}, ["stop"]))
|
|
3234
3234
|
}, [
|
|
3235
3235
|
Nt(Z(f.issue.actionLabel) + " ", 1),
|
|
3236
|
-
|
|
3237
|
-
], 10, ir)) :
|
|
3236
|
+
k[12] || (k[12] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
3237
|
+
], 10, ir)) : j("", !0)
|
|
3238
3238
|
], 2)
|
|
3239
3239
|
])
|
|
3240
3240
|
], 8, nr)) : f.sender === "system" ? (m(), x("div", {
|
|
@@ -3248,13 +3248,13 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3248
3248
|
"data-issue-code": f.issue?.code,
|
|
3249
3249
|
"data-issue-bucket": f.issue?.bucket,
|
|
3250
3250
|
"data-streaming": f.id === ve.value ? "true" : void 0,
|
|
3251
|
-
class:
|
|
3251
|
+
class: $(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", N.value ? "text-theme-500" : "text-white/60"])
|
|
3252
3252
|
}, [
|
|
3253
|
-
|
|
3253
|
+
k[13] || (k[13] = w("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
3254
3254
|
rt(Ft, {
|
|
3255
3255
|
text: f.text,
|
|
3256
3256
|
inverted: !N.value,
|
|
3257
|
-
onClick:
|
|
3257
|
+
onClick: k[2] || (k[2] = wt(() => {
|
|
3258
3258
|
}, ["stop"]))
|
|
3259
3259
|
}, null, 8, ["text", "inverted"])
|
|
3260
3260
|
], 10, ar)) : (m(), x("div", {
|
|
@@ -3266,26 +3266,28 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3266
3266
|
"data-message-sequence": f.sequence,
|
|
3267
3267
|
"data-system-kind": f.systemKind,
|
|
3268
3268
|
"data-streaming": f.id === ve.value ? "true" : void 0,
|
|
3269
|
-
class:
|
|
3269
|
+
class: $(["flex gap-2 items-end", {
|
|
3270
3270
|
"justify-end": f.sender === "user",
|
|
3271
3271
|
"justify-start": f.sender === "agent",
|
|
3272
|
-
|
|
3272
|
+
// Group-aware rhythm: tight (space-y) within a speaker's turn,
|
|
3273
|
+
// generous at the boundary between speakers (end of a group).
|
|
3274
|
+
"mb-6": A(P.value, L)
|
|
3273
3275
|
}])
|
|
3274
3276
|
}, [
|
|
3275
3277
|
f.sender === "agent" ? (m(), x("div", lr, [
|
|
3276
|
-
|
|
3278
|
+
A(P.value, L) ? (m(), x("img", {
|
|
3277
3279
|
key: 0,
|
|
3278
3280
|
src: a.agent.avatarUrl.value,
|
|
3279
3281
|
alt: a.agent.displayName.value,
|
|
3280
|
-
class:
|
|
3281
|
-
}, null, 10, or)) :
|
|
3282
|
-
])) :
|
|
3282
|
+
class: $(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", N.value ? "ring-1 ring-black/5" : ""])
|
|
3283
|
+
}, null, 10, or)) : j("", !0)
|
|
3284
|
+
])) : j("", !0),
|
|
3283
3285
|
w("div", {
|
|
3284
|
-
class:
|
|
3286
|
+
class: $(f.sender === "user" ? "max-w-[75%]" : "max-w-[92%]")
|
|
3285
3287
|
}, [
|
|
3286
3288
|
f.attachments?.length ? (m(), x("div", {
|
|
3287
3289
|
key: 0,
|
|
3288
|
-
class:
|
|
3290
|
+
class: $(["mb-1 space-y-1", f.sender === "user" ? "flex flex-col items-end" : ""])
|
|
3289
3291
|
}, [
|
|
3290
3292
|
(m(!0), x(ae, null, me(f.attachments, (V, fe) => (m(), x(ae, { key: fe }, [
|
|
3291
3293
|
V.type === "image" ? (m(), x("img", {
|
|
@@ -3303,73 +3305,73 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3303
3305
|
href: V.src,
|
|
3304
3306
|
target: "_blank",
|
|
3305
3307
|
rel: "noopener",
|
|
3306
|
-
class:
|
|
3308
|
+
class: $(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", N.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
3307
3309
|
}, [
|
|
3308
|
-
|
|
3310
|
+
k[14] || (k[14] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
3309
3311
|
Nt(" " + Z(V.filename), 1)
|
|
3310
3312
|
], 10, hr))
|
|
3311
3313
|
], 64))), 128))
|
|
3312
|
-
], 2)) :
|
|
3314
|
+
], 2)) : j("", !0),
|
|
3313
3315
|
f.text ? (m(), x("div", {
|
|
3314
3316
|
key: 1,
|
|
3315
|
-
class:
|
|
3316
|
-
f.sender === "user" ? "bg-primary-500 text-white
|
|
3317
|
-
|
|
3317
|
+
class: $(
|
|
3318
|
+
f.sender === "user" ? "rounded-2xl rounded-br-[4px] px-3.5 py-2 bg-primary-500 text-white" : N.value ? "text-theme-800" : "text-white/95"
|
|
3319
|
+
)
|
|
3318
3320
|
}, [
|
|
3319
3321
|
rt(Ft, {
|
|
3320
3322
|
text: f.text,
|
|
3321
3323
|
inverted: f.sender === "user" || !N.value,
|
|
3322
3324
|
streaming: f.id === ve.value,
|
|
3323
|
-
onClick:
|
|
3325
|
+
onClick: k[3] || (k[3] = wt(() => {
|
|
3324
3326
|
}, ["stop"]))
|
|
3325
3327
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
3326
|
-
], 2)) :
|
|
3328
|
+
], 2)) : j("", !0),
|
|
3327
3329
|
J(f.toolActivities) ? (m(), x("div", {
|
|
3328
3330
|
key: 2,
|
|
3329
3331
|
"data-test": "messaging-message-tool-activity",
|
|
3330
3332
|
"data-tool-activity-status": J(f.toolActivities)?.status,
|
|
3331
|
-
class:
|
|
3333
|
+
class: $(["mt-1 flex items-center gap-1.5 pl-2 pr-3 text-[12px] leading-none", N.value ? "text-theme-500" : "text-white/45"])
|
|
3332
3334
|
}, [
|
|
3333
3335
|
w("i", {
|
|
3334
|
-
class:
|
|
3336
|
+
class: $(["size-3.5 shrink-0 opacity-80", J(f.toolActivities)?.icon]),
|
|
3335
3337
|
"aria-hidden": "true"
|
|
3336
3338
|
}, null, 2),
|
|
3337
3339
|
w("span", pr, Z(J(f.toolActivities)?.label), 1)
|
|
3338
|
-
], 10, dr)) :
|
|
3340
|
+
], 10, dr)) : j("", !0)
|
|
3339
3341
|
], 2)
|
|
3340
3342
|
], 10, rr))
|
|
3341
3343
|
], 64))), 128)),
|
|
3342
|
-
|
|
3344
|
+
F.value ? (m(), x("div", {
|
|
3343
3345
|
key: 1,
|
|
3344
3346
|
"data-test": "messaging-working-state",
|
|
3345
|
-
"data-working-description":
|
|
3346
|
-
class:
|
|
3347
|
+
"data-working-description": F.value,
|
|
3348
|
+
class: $(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", N.value ? "text-theme-500" : "text-white/45"])
|
|
3347
3349
|
}, [
|
|
3348
|
-
|
|
3350
|
+
k[15] || (k[15] = w("i", {
|
|
3349
3351
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
3350
3352
|
"aria-hidden": "true"
|
|
3351
3353
|
}, null, -1)),
|
|
3352
|
-
w("span", gr, Z(
|
|
3353
|
-
], 10, fr)) :
|
|
3354
|
+
w("span", gr, Z(F.value), 1)
|
|
3355
|
+
], 10, fr)) : j("", !0),
|
|
3354
3356
|
H.value ? (m(), x("div", {
|
|
3355
3357
|
key: 2,
|
|
3356
3358
|
"data-test": "messaging-tool-activity",
|
|
3357
3359
|
"data-tool-activity-status": H.value.status,
|
|
3358
|
-
class:
|
|
3360
|
+
class: $(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", N.value ? "text-theme-500" : "text-white/45"])
|
|
3359
3361
|
}, [
|
|
3360
3362
|
w("i", {
|
|
3361
|
-
class:
|
|
3363
|
+
class: $(["size-3.5 shrink-0 opacity-80", H.value.icon]),
|
|
3362
3364
|
"aria-hidden": "true"
|
|
3363
3365
|
}, null, 2),
|
|
3364
3366
|
w("span", xr, Z(H.value.label), 1)
|
|
3365
|
-
], 10, mr)) :
|
|
3367
|
+
], 10, mr)) : j("", !0),
|
|
3366
3368
|
pe.value ? (m(), x("div", {
|
|
3367
3369
|
key: 3,
|
|
3368
3370
|
"data-test": "messaging-transient-issue",
|
|
3369
3371
|
"data-issue-code": pe.value.code,
|
|
3370
|
-
class:
|
|
3372
|
+
class: $(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", N.value ? "text-theme-600" : "text-white/60"])
|
|
3371
3373
|
}, [
|
|
3372
|
-
|
|
3374
|
+
k[16] || (k[16] = w("i", {
|
|
3373
3375
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
3374
3376
|
"aria-hidden": "true"
|
|
3375
3377
|
}, null, -1)),
|
|
@@ -3377,65 +3379,65 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3377
3379
|
Nt(Z(pe.value.message), 1),
|
|
3378
3380
|
pe.value.help ? (m(), x(ae, { key: 0 }, [
|
|
3379
3381
|
Nt(Z(pe.value.help), 1)
|
|
3380
|
-
], 64)) :
|
|
3382
|
+
], 64)) : j("", !0)
|
|
3381
3383
|
]),
|
|
3382
3384
|
pe.value.actionUrl && pe.value.actionLabel ? (m(), x("a", {
|
|
3383
3385
|
key: 0,
|
|
3384
3386
|
href: pe.value.actionUrl,
|
|
3385
3387
|
class: "shrink-0 underline underline-offset-2",
|
|
3386
|
-
onClick:
|
|
3388
|
+
onClick: k[4] || (k[4] = wt(() => {
|
|
3387
3389
|
}, ["stop"]))
|
|
3388
|
-
}, Z(pe.value.actionLabel), 9,
|
|
3389
|
-
], 10,
|
|
3390
|
+
}, Z(pe.value.actionLabel), 9, br)) : j("", !0)
|
|
3391
|
+
], 10, kr)) : j("", !0),
|
|
3390
3392
|
xt.value ? (m(), x("div", vr, [
|
|
3391
3393
|
w("img", {
|
|
3392
3394
|
src: a.agent.avatarUrl.value,
|
|
3393
3395
|
alt: a.agent.displayName.value,
|
|
3394
|
-
class:
|
|
3396
|
+
class: $(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", N.value ? "ring-1 ring-black/5" : ""])
|
|
3395
3397
|
}, null, 10, yr),
|
|
3396
3398
|
w("div", {
|
|
3397
|
-
class:
|
|
3399
|
+
class: $(["rounded-2xl px-3.5 py-2.5 flex items-center", N.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
3398
3400
|
}, [
|
|
3399
3401
|
w("i", {
|
|
3400
|
-
class:
|
|
3402
|
+
class: $(["i-svg-spinners-3-dots-bounce size-7", N.value ? "text-theme-400" : "text-white/50"])
|
|
3401
3403
|
}, null, 2)
|
|
3402
3404
|
], 2)
|
|
3403
|
-
])) :
|
|
3405
|
+
])) : j("", !0)
|
|
3404
3406
|
], 2)
|
|
3405
3407
|
]),
|
|
3406
3408
|
_: 1
|
|
3407
3409
|
}, 512),
|
|
3408
3410
|
w("div", {
|
|
3409
|
-
class:
|
|
3411
|
+
class: $(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", N.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
3410
3412
|
}, [
|
|
3411
3413
|
u.value.length > 0 ? (m(), x("div", wr, [
|
|
3412
|
-
(m(!0), x(ae, null, me(u.value, (f,
|
|
3413
|
-
key:
|
|
3414
|
+
(m(!0), x(ae, null, me(u.value, (f, L) => (m(), x("div", {
|
|
3415
|
+
key: L,
|
|
3414
3416
|
class: "relative shrink-0 group"
|
|
3415
3417
|
}, [
|
|
3416
3418
|
f.type === "image" ? (m(), x("img", {
|
|
3417
3419
|
key: 0,
|
|
3418
3420
|
src: f.src,
|
|
3419
3421
|
alt: f.filename,
|
|
3420
|
-
class:
|
|
3422
|
+
class: $(["size-14 rounded-xl object-cover border", N.value ? "border-black/10" : "border-white/20"])
|
|
3421
3423
|
}, null, 10, Tr)) : (m(), x("div", {
|
|
3422
3424
|
key: 1,
|
|
3423
|
-
class:
|
|
3425
|
+
class: $(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", N.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
3424
3426
|
}, [
|
|
3425
|
-
|
|
3427
|
+
k[17] || (k[17] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
3426
3428
|
w("span", Sr, Z(f.filename), 1)
|
|
3427
3429
|
], 2)),
|
|
3428
3430
|
w("button", {
|
|
3429
3431
|
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",
|
|
3430
|
-
onClick: /* @__PURE__ */ h((V) => S(
|
|
3431
|
-
}, [...
|
|
3432
|
+
onClick: /* @__PURE__ */ h((V) => S(L), "onClick")
|
|
3433
|
+
}, [...k[18] || (k[18] = [
|
|
3432
3434
|
w("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
3433
3435
|
])], 8, Ar)
|
|
3434
3436
|
]))), 128)),
|
|
3435
3437
|
c.value ? (m(), x("div", _r, [
|
|
3436
3438
|
rt(jn, { class: "size-5" })
|
|
3437
|
-
])) :
|
|
3438
|
-
])) :
|
|
3439
|
+
])) : j("", !0)
|
|
3440
|
+
])) : j("", !0),
|
|
3439
3441
|
a.uploadFn ? (m(), x("input", {
|
|
3440
3442
|
key: 1,
|
|
3441
3443
|
ref_key: "fileInput",
|
|
@@ -3444,45 +3446,45 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3444
3446
|
accept: "image/*,audio/*,video/*",
|
|
3445
3447
|
class: "hidden",
|
|
3446
3448
|
onChange: p
|
|
3447
|
-
}, null, 544)) :
|
|
3449
|
+
}, null, 544)) : j("", !0),
|
|
3448
3450
|
w("div", {
|
|
3449
|
-
class:
|
|
3451
|
+
class: $(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", N.value ? i.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : i.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
3450
3452
|
}, [
|
|
3451
3453
|
w("button", {
|
|
3452
|
-
class:
|
|
3454
|
+
class: $(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
3453
3455
|
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
3454
3456
|
N.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
3455
3457
|
c.value ? "opacity-50 pointer-events-none" : ""
|
|
3456
3458
|
]]),
|
|
3457
3459
|
disabled: Be.value || c.value || !a.uploadFn,
|
|
3458
|
-
onClick:
|
|
3460
|
+
onClick: k[5] || (k[5] = (f) => a.uploadFn && _())
|
|
3459
3461
|
}, [
|
|
3460
3462
|
c.value ? (m(), x("i", Rr)) : (m(), x("i", Cr))
|
|
3461
3463
|
], 10, Er),
|
|
3462
3464
|
Hs(w("textarea", {
|
|
3463
3465
|
ref_key: "textarea",
|
|
3464
3466
|
ref: l,
|
|
3465
|
-
"onUpdate:modelValue":
|
|
3467
|
+
"onUpdate:modelValue": k[6] || (k[6] = (f) => n.value = f),
|
|
3466
3468
|
"data-test": "messaging-input",
|
|
3467
3469
|
rows: "1",
|
|
3468
3470
|
enterkeyhint: "send",
|
|
3469
3471
|
placeholder: se.value,
|
|
3470
3472
|
disabled: Be.value,
|
|
3471
3473
|
style: { fontSize: "16px", resize: "none" },
|
|
3472
|
-
class:
|
|
3473
|
-
onKeydown:
|
|
3474
|
-
onFocus:
|
|
3475
|
-
onBlur:
|
|
3474
|
+
class: $(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", N.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
3475
|
+
onKeydown: Ye,
|
|
3476
|
+
onFocus: k[7] || (k[7] = (f) => i.value = !0),
|
|
3477
|
+
onBlur: k[8] || (k[8] = (f) => i.value = !1)
|
|
3476
3478
|
}, null, 42, Ir), [
|
|
3477
3479
|
[Gs, n.value]
|
|
3478
3480
|
]),
|
|
3479
3481
|
w("button", {
|
|
3480
3482
|
"data-test": "messaging-send-btn",
|
|
3481
3483
|
"data-composer-action": ce.value,
|
|
3482
|
-
class:
|
|
3483
|
-
disabled: !
|
|
3484
|
+
class: $(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", Ce.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : N.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
3485
|
+
disabled: !Ce.value,
|
|
3484
3486
|
"aria-label": ce.value === "stop" ? "Stop reply" : "Send message",
|
|
3485
|
-
onClick:
|
|
3487
|
+
onClick: k[9] || (k[9] = (f) => ee())
|
|
3486
3488
|
}, [
|
|
3487
3489
|
ce.value === "stop" ? (m(), x("i", Mr)) : (m(), x("i", $r))
|
|
3488
3490
|
], 10, Dr)
|
|
@@ -3599,7 +3601,7 @@ const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-la
|
|
|
3599
3601
|
buttonText: a.buttonText,
|
|
3600
3602
|
buttonIcon: a.buttonIcon,
|
|
3601
3603
|
loading: i.value
|
|
3602
|
-
}) :
|
|
3604
|
+
}) : j("", !0)
|
|
3603
3605
|
]));
|
|
3604
3606
|
}
|
|
3605
3607
|
});
|