@pagelines/sdk 1.0.479 → 1.0.481
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +78 -78
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent.js +9 -9
- package/dist/agent.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Mn = Object.defineProperty;
|
|
2
2
|
var _s = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var p = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
|
|
4
|
-
var
|
|
4
|
+
var C = (a, t, e) => _s(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
import { defineComponent as Oe, openBlock as T, createElementBlock as S, createElementVNode as y, normalizeClass as A, ref as te, watch as ct, computed as G, createCommentVNode as B, renderSlot as ns, onMounted as nn, Fragment as Se, renderList as at, withDirectives as ss, vModelText as rs, unref as Qt, toDisplayString as ie, nextTick as Wt, createVNode as qt, createTextVNode as et, withModifiers as Rs, shallowRef as Is } from "vue";
|
|
6
|
-
import { SettingsObject as
|
|
6
|
+
import { SettingsObject as Cs, Agent as Tt, getDefaultAvatarUrl as is, createLogger as Ds } from "@pagelines/core";
|
|
7
7
|
import { P as Ms } from "./sdkClient.js";
|
|
8
8
|
const Ls = { class: "spinner max-w-sm" }, Os = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
@@ -33,23 +33,23 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
|
|
|
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
|
-
], Ps = 9e4, dn = class dn extends
|
|
36
|
+
], Ps = 9e4, dn = class dn extends Cs {
|
|
37
37
|
constructor(e) {
|
|
38
38
|
super("AgentChatController", e);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
C(this, "isTextMode", !1);
|
|
40
|
+
C(this, "lastMessage", { hash: "", time: 0 });
|
|
41
|
+
C(this, "isConnecting", !1);
|
|
42
42
|
// Chat conversation tracking (server-managed persistence)
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
C(this, "conversationId");
|
|
44
|
+
C(this, "textState", te({
|
|
45
45
|
isActive: !1,
|
|
46
46
|
isConnected: !1,
|
|
47
47
|
isThinking: !1,
|
|
48
48
|
connectionStatus: "disconnected"
|
|
49
49
|
}));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
C(this, "agentMode", te("self"));
|
|
51
|
+
C(this, "sharedMessages", te([]));
|
|
52
|
+
C(this, "_agent");
|
|
53
53
|
this._agent = e.agent instanceof Tt ? e.agent : new Tt({ config: e.agent }), this.setupModeWatcher();
|
|
54
54
|
}
|
|
55
55
|
get chatEnabled() {
|
|
@@ -299,7 +299,7 @@ function Pn(a) {
|
|
|
299
299
|
p(Pn, "handleImageError");
|
|
300
300
|
function ji(a) {
|
|
301
301
|
const { template: t, agent: e } = a;
|
|
302
|
-
return t.replace(/{name}/g, e.name || "
|
|
302
|
+
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
303
303
|
}
|
|
304
304
|
p(ji, "parseButtonTemplate");
|
|
305
305
|
const Ns = {
|
|
@@ -361,7 +361,7 @@ const Ns = {
|
|
|
361
361
|
return (n, r) => (T(), S("input", {
|
|
362
362
|
type: "email",
|
|
363
363
|
autocomplete: "email",
|
|
364
|
-
placeholder: "Enter
|
|
364
|
+
placeholder: "Enter your email",
|
|
365
365
|
value: a.modelValue,
|
|
366
366
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
|
|
367
367
|
style: { "font-size": "16px" },
|
|
@@ -491,7 +491,7 @@ const Ns = {
|
|
|
491
491
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
492
492
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
493
493
|
]])
|
|
494
|
-
}, ie(a.layout === "horizontal" ? a.agent.title.value || "
|
|
494
|
+
}, ie(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
|
|
495
495
|
])
|
|
496
496
|
], 2));
|
|
497
497
|
}
|
|
@@ -728,9 +728,9 @@ function cs() {
|
|
|
728
728
|
MUSTACHE_EXPR: I,
|
|
729
729
|
ERB_EXPR: Ie,
|
|
730
730
|
TMPLIT_EXPR: ve,
|
|
731
|
-
DATA_ATTR:
|
|
731
|
+
DATA_ATTR: Ct,
|
|
732
732
|
ARIA_ATTR: Ye,
|
|
733
|
-
IS_SCRIPT_OR_DATA:
|
|
733
|
+
IS_SCRIPT_OR_DATA: Dt,
|
|
734
734
|
ATTR_WHITESPACE: pt,
|
|
735
735
|
CUSTOM_ELEMENT: dt
|
|
736
736
|
} = Vn;
|
|
@@ -774,7 +774,7 @@ function cs() {
|
|
|
774
774
|
value: null
|
|
775
775
|
}
|
|
776
776
|
}));
|
|
777
|
-
let L = !0, Z = !0, we = !1, Xe = !0, he = !1, Ke = !0,
|
|
777
|
+
let L = !0, Z = !0, we = !1, Xe = !0, he = !1, Ke = !0, Ce = !1, Mt = !1, Lt = !1, Pe = !1, mt = !1, bt = !1, fn = !0, gn = !1;
|
|
778
778
|
const mn = "user-content-";
|
|
779
779
|
let Ot = !0, Qe = !1, Ne = {}, be = null;
|
|
780
780
|
const zt = R({}, ["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"]);
|
|
@@ -796,9 +796,9 @@ function cs() {
|
|
|
796
796
|
if (Be && Be === i)
|
|
797
797
|
return;
|
|
798
798
|
(!i || typeof i != "object") && (i = {}), i = re(i), Je = // eslint-disable-next-line unicorn/prefer-includes
|
|
799
|
-
vs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ts : i.PARSER_MEDIA_TYPE, q = Je === "application/xhtml+xml" ? Vt : lt, F = $(i, "ALLOWED_TAGS") && ee(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : gt, W = $(i, "ALLOWED_ATTR") && ee(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : Ze, $t = $(i, "ALLOWED_NAMESPACES") && ee(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Vt) : ws, Pt = $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, q) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && ee(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, q) : xn, be = $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : zt, _ = $(i, "FORBID_TAGS") && ee(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : re({}), b = $(i, "FORBID_ATTR") && ee(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : re({}), Ne = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, L = i.ALLOW_ARIA_ATTR !== !1, Z = i.ALLOW_DATA_ATTR !== !1, we = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Xe = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, he = i.SAFE_FOR_TEMPLATES || !1, Ke = i.SAFE_FOR_XML !== !1,
|
|
799
|
+
vs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ts : i.PARSER_MEDIA_TYPE, q = Je === "application/xhtml+xml" ? Vt : lt, F = $(i, "ALLOWED_TAGS") && ee(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : gt, W = $(i, "ALLOWED_ATTR") && ee(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : Ze, $t = $(i, "ALLOWED_NAMESPACES") && ee(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Vt) : ws, Pt = $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, q) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && ee(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, q) : xn, be = $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : zt, _ = $(i, "FORBID_TAGS") && ee(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : re({}), b = $(i, "FORBID_ATTR") && ee(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : re({}), Ne = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, L = i.ALLOW_ARIA_ATTR !== !1, Z = i.ALLOW_DATA_ATTR !== !1, we = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Xe = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, he = i.SAFE_FOR_TEMPLATES || !1, Ke = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, Pe = i.RETURN_DOM || !1, mt = i.RETURN_DOM_FRAGMENT || !1, bt = i.RETURN_TRUSTED_TYPE || !1, Lt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Ot = i.KEEP_CONTENT !== !1, Qe = i.IN_PLACE || !1, ft = rr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : ls, $e = typeof i.NAMESPACE == "string" ? i.NAMESPACE : xe, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
800
800
|
const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : Fe(null);
|
|
801
|
-
if (P = Fe(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), he && (Z = !1), mt && (Pe = !0), Ne && (F = R({}, jn), W = Fe(null), Ne.html === !0 && (R(F, Gn), R(W, Wn)), Ne.svg === !0 && (R(F, Yt), R(W, Kt), R(W, yt)), Ne.svgFilters === !0 && (R(F, Zt), R(W, Kt), R(W, yt)), Ne.mathMl === !0 && (R(F, Xt), R(W, qn), R(W, yt))), m.tagCheck = null, m.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? m.tagCheck = i.ADD_TAGS : ee(i.ADD_TAGS) && (F === gt && (F = re(F)), R(F, i.ADD_TAGS, q))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? m.attributeCheck = i.ADD_ATTR : ee(i.ADD_ATTR) && (W === Ze && (W = re(W)), R(W, i.ADD_ATTR, q))), $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, q), $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.FORBID_CONTENTS, q)), $(i, "ADD_FORBID_CONTENTS") && ee(i.ADD_FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.ADD_FORBID_CONTENTS, q)), Ot && (F["#text"] = !0),
|
|
801
|
+
if (P = Fe(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), he && (Z = !1), mt && (Pe = !0), Ne && (F = R({}, jn), W = Fe(null), Ne.html === !0 && (R(F, Gn), R(W, Wn)), Ne.svg === !0 && (R(F, Yt), R(W, Kt), R(W, yt)), Ne.svgFilters === !0 && (R(F, Zt), R(W, Kt), R(W, yt)), Ne.mathMl === !0 && (R(F, Xt), R(W, qn), R(W, yt))), m.tagCheck = null, m.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? m.tagCheck = i.ADD_TAGS : ee(i.ADD_TAGS) && (F === gt && (F = re(F)), R(F, i.ADD_TAGS, q))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? m.attributeCheck = i.ADD_ATTR : ee(i.ADD_ATTR) && (W === Ze && (W = re(W)), R(W, i.ADD_ATTR, q))), $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, q), $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.FORBID_CONTENTS, q)), $(i, "ADD_FORBID_CONTENTS") && ee(i.ADD_FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.ADD_FORBID_CONTENTS, q)), Ot && (F["#text"] = !0), Ce && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete _.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
802
802
|
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
803
803
|
throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
804
804
|
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -824,7 +824,7 @@ function cs() {
|
|
|
824
824
|
} catch {
|
|
825
825
|
O(i);
|
|
826
826
|
}
|
|
827
|
-
}, "_forceRemove"),
|
|
827
|
+
}, "_forceRemove"), De = /* @__PURE__ */ p(function(i, u) {
|
|
828
828
|
try {
|
|
829
829
|
nt(t.removed, {
|
|
830
830
|
attribute: u.getAttributeNode(i),
|
|
@@ -870,7 +870,7 @@ function cs() {
|
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
872
|
const Q = u.body || u.documentElement;
|
|
873
|
-
return i && k && Q.insertBefore(e.createTextNode(k), Q.childNodes[0] || null), $e === xe ? Re.call(u,
|
|
873
|
+
return i && k && Q.insertBefore(e.createTextNode(k), Q.childNodes[0] || null), $e === xe ? Re.call(u, Ce ? "html" : "body")[0] : Ce ? u.documentElement : Q;
|
|
874
874
|
}, "_initDocument"), Sn = /* @__PURE__ */ p(function(i) {
|
|
875
875
|
return V.call(
|
|
876
876
|
i.ownerDocument || i,
|
|
@@ -923,7 +923,7 @@ function cs() {
|
|
|
923
923
|
}, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, u, k) {
|
|
924
924
|
if (b[u] || fn && (u === "id" || u === "name") && (k in e || k in Ss))
|
|
925
925
|
return !1;
|
|
926
|
-
if (!(Z && !b[u] && K(
|
|
926
|
+
if (!(Z && !b[u] && K(Ct, u))) {
|
|
927
927
|
if (!(L && K(Ye, u))) {
|
|
928
928
|
if (!(m.attributeCheck instanceof Function && m.attributeCheck(u, i))) {
|
|
929
929
|
if (!W[u] || b[u]) {
|
|
@@ -938,7 +938,7 @@ function cs() {
|
|
|
938
938
|
} else if (!Pt[u]) {
|
|
939
939
|
if (!K(ft, Ue(k, pt, ""))) {
|
|
940
940
|
if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Un(k, "data:") === 0 && bn[i])) {
|
|
941
|
-
if (!(we && !K(
|
|
941
|
+
if (!(we && !K(Dt, Ue(k, pt, "")))) {
|
|
942
942
|
if (k)
|
|
943
943
|
return !1;
|
|
944
944
|
}
|
|
@@ -973,34 +973,34 @@ function cs() {
|
|
|
973
973
|
value: ce
|
|
974
974
|
} = Q, de = q(H), jt = ce;
|
|
975
975
|
let X = H === "value" ? jt : Qs(jt);
|
|
976
|
-
if (k.attrName = de, k.attrValue = X, k.keepAttr = !0, k.forceKeepAttr = void 0, ye(Y.uponSanitizeAttribute, i, k), X = k.attrValue, gn && (de === "id" || de === "name") && Un(X, mn) !== 0 && (
|
|
977
|
-
|
|
976
|
+
if (k.attrName = de, k.attrValue = X, k.keepAttr = !0, k.forceKeepAttr = void 0, ye(Y.uponSanitizeAttribute, i, k), X = k.attrValue, gn && (de === "id" || de === "name") && Un(X, mn) !== 0 && (De(H, i), X = mn + X), Ke && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, X)) {
|
|
977
|
+
De(H, i);
|
|
978
978
|
continue;
|
|
979
979
|
}
|
|
980
980
|
if (de === "attributename" && Bn(X, "href")) {
|
|
981
|
-
|
|
981
|
+
De(H, i);
|
|
982
982
|
continue;
|
|
983
983
|
}
|
|
984
984
|
if (k.forceKeepAttr)
|
|
985
985
|
continue;
|
|
986
986
|
if (!k.keepAttr) {
|
|
987
|
-
|
|
987
|
+
De(H, i);
|
|
988
988
|
continue;
|
|
989
989
|
}
|
|
990
990
|
if (!Xe && K(/\/>/i, X)) {
|
|
991
|
-
|
|
991
|
+
De(H, i);
|
|
992
992
|
continue;
|
|
993
993
|
}
|
|
994
|
-
he && tt([I, Ie, ve], (
|
|
995
|
-
X = Ue(X,
|
|
994
|
+
he && tt([I, Ie, ve], (Dn) => {
|
|
995
|
+
X = Ue(X, Dn, " ");
|
|
996
996
|
});
|
|
997
|
-
const
|
|
998
|
-
if (!En(
|
|
999
|
-
|
|
997
|
+
const Cn = q(i.nodeName);
|
|
998
|
+
if (!En(Cn, de, X)) {
|
|
999
|
+
De(H, i);
|
|
1000
1000
|
continue;
|
|
1001
1001
|
}
|
|
1002
1002
|
if (z && typeof g == "object" && typeof g.getAttributeType == "function" && !se)
|
|
1003
|
-
switch (g.getAttributeType(
|
|
1003
|
+
switch (g.getAttributeType(Cn, de)) {
|
|
1004
1004
|
case "TrustedHTML": {
|
|
1005
1005
|
X = z.createHTML(X);
|
|
1006
1006
|
break;
|
|
@@ -1014,7 +1014,7 @@ function cs() {
|
|
|
1014
1014
|
try {
|
|
1015
1015
|
se ? i.setAttributeNS(se, H, X) : i.setAttribute(H, X), Ht(i) ? pe(i) : $n(t.removed);
|
|
1016
1016
|
} catch {
|
|
1017
|
-
|
|
1017
|
+
De(H, i);
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
ye(Y.afterSanitizeAttributes, i, null);
|
|
@@ -1041,7 +1041,7 @@ function cs() {
|
|
|
1041
1041
|
} else if (v instanceof l)
|
|
1042
1042
|
u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === rt.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
|
|
1043
1043
|
else {
|
|
1044
|
-
if (!Pe && !he && !
|
|
1044
|
+
if (!Pe && !he && !Ce && // eslint-disable-next-line unicorn/prefer-includes
|
|
1045
1045
|
v.indexOf("<") === -1)
|
|
1046
1046
|
return z && bt ? z.createHTML(v) : v;
|
|
1047
1047
|
if (u = Tn(v), !u)
|
|
@@ -1068,8 +1068,8 @@ function cs() {
|
|
|
1068
1068
|
Q = u;
|
|
1069
1069
|
return (W.shadowroot || W.shadowrootmode) && (Q = It.call(n, Q, !0)), Q;
|
|
1070
1070
|
}
|
|
1071
|
-
let se =
|
|
1072
|
-
return
|
|
1071
|
+
let se = Ce ? u.outerHTML : u.innerHTML;
|
|
1072
|
+
return Ce && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(os, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1073
1073
|
` + se), he && tt([I, Ie, ve], (ce) => {
|
|
1074
1074
|
se = Ue(se, ce, " ");
|
|
1075
1075
|
}), z && bt ? z.createHTML(se) : se;
|
|
@@ -1108,22 +1108,22 @@ function us(a) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
p(us, "G");
|
|
1110
1110
|
var Me = { exec: /* @__PURE__ */ p(() => null, "exec") };
|
|
1111
|
-
function
|
|
1111
|
+
function D(a, t = "") {
|
|
1112
1112
|
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((r, s) => {
|
|
1113
1113
|
let o = typeof s == "string" ? s : s.source;
|
|
1114
1114
|
return o = o.replace(J.caret, "$1"), e = e.replace(r, o), n;
|
|
1115
1115
|
}, "replace"), getRegex: /* @__PURE__ */ p(() => new RegExp(e, t), "getRegex") };
|
|
1116
1116
|
return n;
|
|
1117
1117
|
}
|
|
1118
|
-
p(
|
|
1118
|
+
p(D, "k");
|
|
1119
1119
|
var xr = ((a = "") => {
|
|
1120
1120
|
try {
|
|
1121
1121
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
1122
1122
|
} catch {
|
|
1123
1123
|
return !1;
|
|
1124
1124
|
}
|
|
1125
|
-
})(), J = { 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__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, kr = /^(?:[ \t]*(?:\n|$))+/, wr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, yr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ut = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, vr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, hs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ps =
|
|
1126
|
-
]`).replace("lheading", ps).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() },
|
|
1125
|
+
})(), J = { 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__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, kr = /^(?:[ \t]*(?:\n|$))+/, wr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, yr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ut = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, vr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, hs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ps = D(hs).replace(/bull/g, rn).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(), Tr = D(hs).replace(/bull/g, rn).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(), an = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Sr = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ar = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Er = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rn).getRegex(), _t = "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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _r = D("^ {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", on).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ds = D(an).replace("hr", ut).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]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex(), Rr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ds).getRegex(), cn = { blockquote: Rr, code: wr, def: Ar, fences: yr, heading: vr, hr: ut, html: _r, lheading: ps, list: Er, newline: kr, paragraph: ds, table: Me, text: Sr }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ut).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", _t).getRegex(), Ir = { ...cn, lheading: Tr, table: Zn, paragraph: D(an).replace("hr", ut).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").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", _t).getRegex() }, Cr = { ...cn, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", on).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: Me, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(an).replace("hr", ut).replace("heading", ` *#{1,6} *[^
|
|
1126
|
+
]`).replace("lheading", ps).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Dr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, fs = /^( {2,}|\\)\n(?!\s*$)/, Lr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ve = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, un = /[^\s\p{P}\p{S}]/u, Or = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), gs = /(?!~)[\p{P}\p{S}]/u, zr = /(?!~)[\s\p{P}\p{S}]/u, Pr = /(?:[^\s\p{P}\p{S}]|~)/u, Nr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ms = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $r = D(ms, "u").replace(/punct/g, Ve).getRegex(), Br = D(ms, "u").replace(/punct/g, gs).getRegex(), bs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ur = D(bs, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), Fr = D(bs, "gu").replace(/notPunctSpace/g, Pr).replace(/punctSpace/g, zr).replace(/punct/g, gs).getRegex(), Hr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), Gr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ve).getRegex(), jr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Wr = D(jr, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), qr = D(/\\(punct)/, "gu").replace(/punct/g, Ve).getRegex(), Vr = D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Yr = D(on).replace("(?:-->|$)", "-->").getRegex(), Zr = D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Yr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), St = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Xr = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", St).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), xs = D(/^!?\[(label)\]\[(ref)\]/).replace("label", St).replace("ref", ln).getRegex(), ks = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), Kr = D("reflink|nolink(?!\\()", "g").replace("reflink", xs).replace("nolink", ks).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, hn = { _backpedal: Me, anyPunctuation: qr, autolink: Vr, blockSkip: Nr, br: fs, code: Mr, del: Me, delLDelim: Me, delRDelim: Me, emStrongLDelim: $r, emStrongRDelimAst: Ur, emStrongRDelimUnd: Hr, escape: Dr, link: Xr, nolink: ks, punctuation: Or, reflink: xs, reflinkSearch: Kr, tag: Zr, text: Lr, url: Me }, Qr = { ...hn, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", St).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", St).getRegex() }, tn = { ...hn, emStrongRDelimAst: Fr, emStrongLDelim: Br, delLDelim: Gr, delRDelim: Wr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).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: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, Jr = { ...tn, br: D(fs).replace("{2,}", "*").getRegex(), text: D(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: cn, gfm: Ir, pedantic: Cr }, it = { normal: hn, gfm: tn, breaks: Jr, pedantic: Qr }, ei = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Kn = /* @__PURE__ */ p((a) => ei[a], "de");
|
|
1127
1127
|
function ke(a, t) {
|
|
1128
1128
|
if (t) {
|
|
1129
1129
|
if (J.escapeTest.test(a)) return a.replace(J.escapeReplace, Kn);
|
|
@@ -1210,9 +1210,9 @@ function si(a, t, e) {
|
|
|
1210
1210
|
p(si, "rt");
|
|
1211
1211
|
var Ge, At = (Ge = class {
|
|
1212
1212
|
constructor(t) {
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1213
|
+
C(this, "options");
|
|
1214
|
+
C(this, "rules");
|
|
1215
|
+
C(this, "lexer");
|
|
1216
1216
|
this.options = t || ze;
|
|
1217
1217
|
}
|
|
1218
1218
|
space(t) {
|
|
@@ -1529,11 +1529,11 @@ ${h}` : h;
|
|
|
1529
1529
|
}
|
|
1530
1530
|
}, p(Ge, "w"), Ge), Ee, fe = (Ee = class {
|
|
1531
1531
|
constructor(t) {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1532
|
+
C(this, "tokens");
|
|
1533
|
+
C(this, "options");
|
|
1534
|
+
C(this, "state");
|
|
1535
|
+
C(this, "inlineQueue");
|
|
1536
|
+
C(this, "tokenizer");
|
|
1537
1537
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ze, this.options.tokenizer = this.options.tokenizer || new At(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1538
1538
|
let e = { other: J, block: vt.normal, inline: it.normal };
|
|
1539
1539
|
this.options.pedantic ? (e.block = vt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
|
|
@@ -1748,8 +1748,8 @@ ${h}` : h;
|
|
|
1748
1748
|
}
|
|
1749
1749
|
}, p(Ee, "l"), Ee), je, Et = (je = class {
|
|
1750
1750
|
constructor(t) {
|
|
1751
|
-
|
|
1752
|
-
|
|
1751
|
+
C(this, "options");
|
|
1752
|
+
C(this, "parser");
|
|
1753
1753
|
this.options = t || ze;
|
|
1754
1754
|
}
|
|
1755
1755
|
space(t) {
|
|
@@ -1896,9 +1896,9 @@ ${t}</tr>
|
|
|
1896
1896
|
}
|
|
1897
1897
|
}, p(We, "L"), We), _e, ge = (_e = class {
|
|
1898
1898
|
constructor(t) {
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1899
|
+
C(this, "options");
|
|
1900
|
+
C(this, "renderer");
|
|
1901
|
+
C(this, "textRenderer");
|
|
1902
1902
|
this.options = t || ze, this.options.renderer = this.options.renderer || new Et(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new pn();
|
|
1903
1903
|
}
|
|
1904
1904
|
static parse(t, e) {
|
|
@@ -2047,8 +2047,8 @@ ${t}</tr>
|
|
|
2047
2047
|
}
|
|
2048
2048
|
}, p(_e, "l"), _e), Ae, ot = (Ae = class {
|
|
2049
2049
|
constructor(t) {
|
|
2050
|
-
|
|
2051
|
-
|
|
2050
|
+
C(this, "options");
|
|
2051
|
+
C(this, "block");
|
|
2052
2052
|
this.options = t || ze;
|
|
2053
2053
|
}
|
|
2054
2054
|
preprocess(t) {
|
|
@@ -2069,18 +2069,18 @@ ${t}</tr>
|
|
|
2069
2069
|
provideParser(t = this.block) {
|
|
2070
2070
|
return t ? ge.parse : ge.parseInline;
|
|
2071
2071
|
}
|
|
2072
|
-
}, p(Ae, "P"),
|
|
2072
|
+
}, p(Ae, "P"), C(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), qe, ri = (qe = class {
|
|
2073
2073
|
constructor(...t) {
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2074
|
+
C(this, "defaults", sn());
|
|
2075
|
+
C(this, "options", this.setOptions);
|
|
2076
|
+
C(this, "parse", this.parseMarkdown(!0));
|
|
2077
|
+
C(this, "parseInline", this.parseMarkdown(!1));
|
|
2078
|
+
C(this, "Parser", ge);
|
|
2079
|
+
C(this, "Renderer", Et);
|
|
2080
|
+
C(this, "TextRenderer", pn);
|
|
2081
|
+
C(this, "Lexer", fe);
|
|
2082
|
+
C(this, "Tokenizer", At);
|
|
2083
|
+
C(this, "Hooks", ot);
|
|
2084
2084
|
this.use(...t);
|
|
2085
2085
|
}
|
|
2086
2086
|
walkTokens(t, e) {
|
|
@@ -2286,7 +2286,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2286
2286
|
}, Ei = ["src", "alt"], _i = {
|
|
2287
2287
|
key: 0,
|
|
2288
2288
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2289
|
-
}, Ri = ["src", "alt"], Ii = { class: "max-w-20 truncate" },
|
|
2289
|
+
}, Ri = ["src", "alt"], Ii = { class: "max-w-20 truncate" }, Ci = ["onClick"], Di = {
|
|
2290
2290
|
key: 0,
|
|
2291
2291
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2292
2292
|
}, Mi = ["disabled"], Li = {
|
|
@@ -2361,10 +2361,10 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2361
2361
|
console.error("Failed to start text conversation:", _);
|
|
2362
2362
|
}
|
|
2363
2363
|
});
|
|
2364
|
-
function
|
|
2364
|
+
function Ct() {
|
|
2365
2365
|
a.chatController?.newConversation();
|
|
2366
2366
|
}
|
|
2367
|
-
p(
|
|
2367
|
+
p(Ct, "startNewConversation");
|
|
2368
2368
|
async function Ye() {
|
|
2369
2369
|
const _ = c.value.trim(), b = w.value.length > 0;
|
|
2370
2370
|
if (!_ && !b || !a.chatController || !ae.value || E.value)
|
|
@@ -2378,10 +2378,10 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
2380
|
p(Ye, "sendMessage");
|
|
2381
|
-
async function
|
|
2381
|
+
async function Dt(_) {
|
|
2382
2382
|
Re.value || (c.value = _, await Ye());
|
|
2383
2383
|
}
|
|
2384
|
-
p(
|
|
2384
|
+
p(Dt, "sendStarterPrompt");
|
|
2385
2385
|
async function pt(_) {
|
|
2386
2386
|
_.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Ye());
|
|
2387
2387
|
}
|
|
@@ -2504,7 +2504,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2504
2504
|
type: "button",
|
|
2505
2505
|
"data-test": "chat-starter-prompt",
|
|
2506
2506
|
class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", I.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
|
|
2507
|
-
onClick: /* @__PURE__ */ p((L) =>
|
|
2507
|
+
onClick: /* @__PURE__ */ p((L) => Dt(m), "onClick")
|
|
2508
2508
|
}, ie(m), 11, hi))), 128))
|
|
2509
2509
|
])) : B("", !0),
|
|
2510
2510
|
y("div", {
|
|
@@ -2522,7 +2522,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2522
2522
|
type: "button",
|
|
2523
2523
|
"data-test": "chat-new-session",
|
|
2524
2524
|
class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", I.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
|
|
2525
|
-
onClick:
|
|
2525
|
+
onClick: Ct
|
|
2526
2526
|
}, [...b[8] || (b[8] = [
|
|
2527
2527
|
y("i", { class: "i-tabler-refresh size-3" }, null, -1),
|
|
2528
2528
|
y("span", null, "New chat", -1)
|
|
@@ -2671,9 +2671,9 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2671
2671
|
onClick: /* @__PURE__ */ p((Z) => W(L), "onClick")
|
|
2672
2672
|
}, [...b[12] || (b[12] = [
|
|
2673
2673
|
y("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2674
|
-
])], 8,
|
|
2674
|
+
])], 8, Ci)
|
|
2675
2675
|
]))), 128)),
|
|
2676
|
-
E.value ? (T(), S("div",
|
|
2676
|
+
E.value ? (T(), S("div", Di, [
|
|
2677
2677
|
qt(Ln, { class: "size-5" })
|
|
2678
2678
|
])) : B("", !0)
|
|
2679
2679
|
])) : B("", !0),
|
|
@@ -2759,7 +2759,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2759
2759
|
apiBase: {}
|
|
2760
2760
|
},
|
|
2761
2761
|
setup(a) {
|
|
2762
|
-
const t =
|
|
2762
|
+
const t = Ds("AgentWrap"), e = a, n = e.sdk || Ms.getInstance({
|
|
2763
2763
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2764
2764
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2765
2765
|
}), r = te(!e.agent), s = Is(e.agent ? new Tt({ config: e.agent }) : void 0), o = te();
|