@doderasoftware/restify-ai 0.1.0-beta.2 → 0.1.0-beta.3
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/restify-ai.js +170 -170
- package/dist/restify-ai.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/restify-ai.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var zs = Object.defineProperty;
|
|
2
2
|
var Hs = (n, e, t) => e in n ? zs(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var W = (n, e, t) => Hs(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { ref as q, nextTick as Oe, onUnmounted as yt, computed as O, onMounted as xt, watch as Ue, isRef as Fs, onBeforeUnmount as Bs, defineComponent as he, createElementBlock as v, openBlock as k, normalizeClass as T, renderSlot as me, createElementVNode as p, createCommentVNode as B, Fragment as
|
|
4
|
+
import { ref as q, nextTick as Oe, onUnmounted as yt, computed as O, onMounted as xt, watch as Ue, isRef as Fs, onBeforeUnmount as Bs, defineComponent as he, createElementBlock as v, openBlock as k, normalizeClass as T, renderSlot as me, createElementVNode as p, createCommentVNode as B, Fragment as be, renderList as Ne, toDisplayString as N, createBlock as Me, resolveDynamicComponent as nn, withCtx as Ce, createVNode as ge, normalizeStyle as un, Transition as mt, withModifiers as et, unref as D, withDirectives as Us, vModelText as qs, createStaticVNode as Nn, createTextVNode as js, Teleport as Ws, normalizeProps as Pn, guardReactiveProps as zn } from "vue";
|
|
5
5
|
import { defineStore as Ks } from "pinia";
|
|
6
6
|
let qe = null;
|
|
7
7
|
const Vs = q(null), rs = {
|
|
@@ -190,7 +190,7 @@ var Js = function(n, e) {
|
|
|
190
190
|
const sn = "text/event-stream", er = 1e3, Bn = "last-event-id";
|
|
191
191
|
function tr(n, e) {
|
|
192
192
|
var { signal: t, headers: s, onopen: r, onmessage: o, onclose: i, onerror: a, openWhenHidden: c, fetch: u } = e, d = Js(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
193
|
-
return new Promise((g,
|
|
193
|
+
return new Promise((g, b) => {
|
|
194
194
|
const y = Object.assign({}, s);
|
|
195
195
|
y.accept || (y.accept = sn);
|
|
196
196
|
let h;
|
|
@@ -205,13 +205,13 @@ function tr(n, e) {
|
|
|
205
205
|
t == null || t.addEventListener("abort", () => {
|
|
206
206
|
S(), g();
|
|
207
207
|
});
|
|
208
|
-
const C = u ?? window.fetch,
|
|
208
|
+
const C = u ?? window.fetch, w = r ?? nr;
|
|
209
209
|
async function z() {
|
|
210
210
|
var F;
|
|
211
211
|
h = new AbortController();
|
|
212
212
|
try {
|
|
213
213
|
const V = await C(n, Object.assign(Object.assign({}, d), { headers: y, signal: h.signal }));
|
|
214
|
-
await
|
|
214
|
+
await w(V), await Qs(V.body, Zs(Ys((E) => {
|
|
215
215
|
E ? y[Bn] = E : delete y[Bn];
|
|
216
216
|
}, (E) => {
|
|
217
217
|
m = E;
|
|
@@ -222,7 +222,7 @@ function tr(n, e) {
|
|
|
222
222
|
const E = (F = a == null ? void 0 : a(V)) !== null && F !== void 0 ? F : m;
|
|
223
223
|
window.clearTimeout(f), f = window.setTimeout(z, E);
|
|
224
224
|
} catch (E) {
|
|
225
|
-
S(),
|
|
225
|
+
S(), b(E);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -456,7 +456,7 @@ const We = Ks("restifyAiStore", {
|
|
|
456
456
|
mentions: t,
|
|
457
457
|
timestamp: Date.now()
|
|
458
458
|
}), g.forEach((h) => this.registerUploadedFile(h)), $t(this.chatHistory), this.sending = !0, this.chatHistory.length >= this.chatHistoryLimit && ((y = r.onError) == null || y.call(r, new Error("Chat history limit reached")));
|
|
459
|
-
const
|
|
459
|
+
const b = async () => {
|
|
460
460
|
var h, A, m;
|
|
461
461
|
try {
|
|
462
462
|
const f = this.chatHistory.map((L) => ({
|
|
@@ -476,7 +476,7 @@ const We = Ks("restifyAiStore", {
|
|
|
476
476
|
var ne;
|
|
477
477
|
(ne = L.attachments) == null || ne.forEach(C);
|
|
478
478
|
}), g.forEach(C);
|
|
479
|
-
const
|
|
479
|
+
const w = Object.values(S), z = this.chatHistory.length;
|
|
480
480
|
this.chatHistory.push({
|
|
481
481
|
id: crypto.randomUUID(),
|
|
482
482
|
role: nt.Assistant,
|
|
@@ -495,7 +495,7 @@ const We = Ks("restifyAiStore", {
|
|
|
495
495
|
question: n,
|
|
496
496
|
history: f,
|
|
497
497
|
stream: !0,
|
|
498
|
-
...
|
|
498
|
+
...w.length > 0 && { files: w },
|
|
499
499
|
...t.length > 0 && { mentions: t },
|
|
500
500
|
...this.supportRequestMode && { contact_support: !0 }
|
|
501
501
|
};
|
|
@@ -546,7 +546,7 @@ const We = Ks("restifyAiStore", {
|
|
|
546
546
|
} catch (f) {
|
|
547
547
|
i = !0;
|
|
548
548
|
const S = this.chatHistory.length - 1;
|
|
549
|
-
return this.chatHistory.splice(S, 1), f.name === "AbortError" ? !0 : d < c && (a.shouldRetry ? a.shouldRetry(f, d) : !0) ? (d++, await rr(u * d),
|
|
549
|
+
return this.chatHistory.splice(S, 1), f.name === "AbortError" ? !0 : d < c && (a.shouldRetry ? a.shouldRetry(f, d) : !0) ? (d++, await rr(u * d), b()) : (this.error = {
|
|
550
550
|
message: f.message || "Network error occurred. Please try again.",
|
|
551
551
|
failedQuestion: n,
|
|
552
552
|
failedAttachments: g,
|
|
@@ -560,7 +560,7 @@ const We = Ks("restifyAiStore", {
|
|
|
560
560
|
this.sending = !1;
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
|
-
return
|
|
563
|
+
return b();
|
|
564
564
|
},
|
|
565
565
|
cancelRequest() {
|
|
566
566
|
it == null || it.abort(), this.chatHistory = this.chatHistory.map((n) => ({
|
|
@@ -631,8 +631,8 @@ const We = Ks("restifyAiStore", {
|
|
|
631
631
|
};
|
|
632
632
|
(o = e.onFileUploadStart) == null || o.call(e, s);
|
|
633
633
|
try {
|
|
634
|
-
const u = await e.getAuthToken(), d = e.getCustomHeaders ? await e.getCustomHeaders() : {}, g = It(e.endpoints.uploadFile),
|
|
635
|
-
|
|
634
|
+
const u = await e.getAuthToken(), d = e.getCustomHeaders ? await e.getCustomHeaders() : {}, g = It(e.endpoints.uploadFile), b = new FormData();
|
|
635
|
+
b.append("file", n);
|
|
636
636
|
const y = await new Promise((h, A) => {
|
|
637
637
|
const m = new XMLHttpRequest();
|
|
638
638
|
m.upload.addEventListener("progress", (f) => {
|
|
@@ -645,14 +645,14 @@ const We = Ks("restifyAiStore", {
|
|
|
645
645
|
var f, S;
|
|
646
646
|
if (m.status >= 200 && m.status < 300)
|
|
647
647
|
try {
|
|
648
|
-
const C = JSON.parse(m.responseText),
|
|
648
|
+
const C = JSON.parse(m.responseText), w = {
|
|
649
649
|
...s,
|
|
650
650
|
url: C.url || ((f = C.data) == null ? void 0 : f.url),
|
|
651
651
|
extractedText: C.extracted_text || ((S = C.data) == null ? void 0 : S.extracted_text),
|
|
652
652
|
uploading: !1,
|
|
653
653
|
progress: 100
|
|
654
654
|
};
|
|
655
|
-
h(
|
|
655
|
+
h(w);
|
|
656
656
|
} catch {
|
|
657
657
|
A(new Error("Failed to parse upload response"));
|
|
658
658
|
}
|
|
@@ -662,7 +662,7 @@ const We = Ks("restifyAiStore", {
|
|
|
662
662
|
A(new Error("Upload failed"));
|
|
663
663
|
}), m.open("POST", g), u && m.setRequestHeader("Authorization", `Bearer ${u}`), Object.entries(d).forEach(([f, S]) => {
|
|
664
664
|
m.setRequestHeader(f, S);
|
|
665
|
-
}), m.send(
|
|
665
|
+
}), m.send(b);
|
|
666
666
|
});
|
|
667
667
|
return (i = e.onFileUploadComplete) == null || i.call(e, y), y;
|
|
668
668
|
} catch (u) {
|
|
@@ -862,14 +862,14 @@ function ye(n, e) {
|
|
|
862
862
|
return n.replace(xr, jn);
|
|
863
863
|
return n;
|
|
864
864
|
}
|
|
865
|
-
const
|
|
865
|
+
const br = /(^|[^\[])\^/g;
|
|
866
866
|
function j(n, e) {
|
|
867
867
|
let t = typeof n == "string" ? n : n.source;
|
|
868
868
|
e = e || "";
|
|
869
869
|
const s = {
|
|
870
870
|
replace: (r, o) => {
|
|
871
871
|
let i = typeof o == "string" ? o : o.source;
|
|
872
|
-
return i = i.replace(
|
|
872
|
+
return i = i.replace(br, "$1"), t = t.replace(r, i), s;
|
|
873
873
|
},
|
|
874
874
|
getRegex: () => new RegExp(t, e)
|
|
875
875
|
};
|
|
@@ -911,7 +911,7 @@ function at(n, e, t) {
|
|
|
911
911
|
r++;
|
|
912
912
|
return n.slice(0, s - r);
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function wr(n, e) {
|
|
915
915
|
if (n.indexOf(e[1]) === -1)
|
|
916
916
|
return -1;
|
|
917
917
|
let t = 0;
|
|
@@ -1054,8 +1054,8 @@ class Pt {
|
|
|
1054
1054
|
r = r ? `${r}
|
|
1055
1055
|
${d}` : d, o = o ? `${o}
|
|
1056
1056
|
${g}` : g;
|
|
1057
|
-
const
|
|
1058
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(g, i, !0), this.lexer.state.top =
|
|
1057
|
+
const b = this.lexer.state.top;
|
|
1058
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(g, i, !0), this.lexer.state.top = b, s.length === 0)
|
|
1059
1059
|
break;
|
|
1060
1060
|
const y = i[i.length - 1];
|
|
1061
1061
|
if ((y == null ? void 0 : y.type) === "code")
|
|
@@ -1104,27 +1104,27 @@ ${g}` : g;
|
|
|
1104
1104
|
break;
|
|
1105
1105
|
u = t[0], e = e.substring(u.length);
|
|
1106
1106
|
let g = t[2].split(`
|
|
1107
|
-
`, 1)[0].replace(/^\t+/, (f) => " ".repeat(3 * f.length)),
|
|
1107
|
+
`, 1)[0].replace(/^\t+/, (f) => " ".repeat(3 * f.length)), b = e.split(`
|
|
1108
1108
|
`, 1)[0], y = !g.trim(), h = 0;
|
|
1109
|
-
if (this.options.pedantic ? (h = 2, d = g.trimStart()) : y ? h = t[1].length + 1 : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, d = g.slice(h), h += t[1].length), y && /^[ \t]*$/.test(
|
|
1110
|
-
`, e = e.substring(
|
|
1111
|
-
const f = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), S = new RegExp(`^ {0,${Math.min(3, h - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), C = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:\`\`\`|~~~)`),
|
|
1109
|
+
if (this.options.pedantic ? (h = 2, d = g.trimStart()) : y ? h = t[1].length + 1 : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, d = g.slice(h), h += t[1].length), y && /^[ \t]*$/.test(b) && (u += b + `
|
|
1110
|
+
`, e = e.substring(b.length + 1), c = !0), !c) {
|
|
1111
|
+
const f = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), S = new RegExp(`^ {0,${Math.min(3, h - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), C = new RegExp(`^ {0,${Math.min(3, h - 1)}}(?:\`\`\`|~~~)`), w = new RegExp(`^ {0,${Math.min(3, h - 1)}}#`), z = new RegExp(`^ {0,${Math.min(3, h - 1)}}<(?:[a-z].*>|!--)`, "i");
|
|
1112
1112
|
for (; e; ) {
|
|
1113
1113
|
const F = e.split(`
|
|
1114
1114
|
`, 1)[0];
|
|
1115
1115
|
let V;
|
|
1116
|
-
if (
|
|
1116
|
+
if (b = F, this.options.pedantic ? (b = b.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), V = b) : V = b.replace(/\t/g, " "), C.test(b) || w.test(b) || z.test(b) || f.test(b) || S.test(b))
|
|
1117
1117
|
break;
|
|
1118
|
-
if (V.search(/[^ ]/) >= h || !
|
|
1118
|
+
if (V.search(/[^ ]/) >= h || !b.trim())
|
|
1119
1119
|
d += `
|
|
1120
1120
|
` + V.slice(h);
|
|
1121
1121
|
else {
|
|
1122
|
-
if (y || g.replace(/\t/g, " ").search(/[^ ]/) >= 4 || C.test(g) ||
|
|
1122
|
+
if (y || g.replace(/\t/g, " ").search(/[^ ]/) >= 4 || C.test(g) || w.test(g) || S.test(g))
|
|
1123
1123
|
break;
|
|
1124
1124
|
d += `
|
|
1125
|
-
` +
|
|
1125
|
+
` + b;
|
|
1126
1126
|
}
|
|
1127
|
-
!y && !
|
|
1127
|
+
!y && !b.trim() && (y = !0), u += F + `
|
|
1128
1128
|
`, e = e.substring(F.length + 1), g = V.slice(h);
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
@@ -1274,7 +1274,7 @@ ${g}` : g;
|
|
|
1274
1274
|
if ((s.length - i.length) % 2 === 0)
|
|
1275
1275
|
return;
|
|
1276
1276
|
} else {
|
|
1277
|
-
const i =
|
|
1277
|
+
const i = wr(t[2], "()");
|
|
1278
1278
|
if (i > -1) {
|
|
1279
1279
|
const c = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
|
|
1280
1280
|
t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, c).trim(), t[3] = "";
|
|
@@ -1328,7 +1328,7 @@ ${g}` : g;
|
|
|
1328
1328
|
if (u -= c, u > 0)
|
|
1329
1329
|
continue;
|
|
1330
1330
|
c = Math.min(c, c + u + d);
|
|
1331
|
-
const
|
|
1331
|
+
const b = [...r[0]][0].length, y = e.slice(0, i + r.index + b + c);
|
|
1332
1332
|
if (Math.min(i, c) % 2) {
|
|
1333
1333
|
const A = y.slice(1, -1);
|
|
1334
1334
|
return {
|
|
@@ -1466,7 +1466,7 @@ const Tr = /^(?:[ \t]*(?:\n|$))+/, Sr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
|
|
|
1466
1466
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1467
1467
|
paragraph: j(pn).replace("hr", kt).replace("heading", ` *#{1,6} *[^
|
|
1468
1468
|
]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1469
|
-
}, xs = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, _r = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ks = /^( {2,}|\\)\n(?!\s*$)/, Or = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
1469
|
+
}, xs = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, _r = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ks = /^( {2,}|\\)\n(?!\s*$)/, Or = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, bt = "\\p{P}\\p{S}", Nr = j(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, bt).getRegex(), Pr = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, zr = j(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, bt).getRegex(), Hr = j("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, bt).getRegex(), Fr = j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, bt).getRegex(), Br = j(/\\([punct])/, "gu").replace(/punct/g, bt).getRegex(), Ur = j(/^<(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(), qr = j(fn).replace("(?:-->|$)", "-->").getRegex(), jr = j("^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", qr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Wr = j(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", zt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), bs = j(/^!?\[(label)\]\[(ref)\]/).replace("label", zt).replace("ref", hn).getRegex(), ws = j(/^!?\[(ref)\](?:\[\])?/).replace("ref", hn).getRegex(), Kr = j("reflink|nolink(?!\\()", "g").replace("reflink", bs).replace("nolink", ws).getRegex(), mn = {
|
|
1470
1470
|
_backpedal: ft,
|
|
1471
1471
|
// only used for GFM url
|
|
1472
1472
|
anyPunctuation: Br,
|
|
@@ -1480,9 +1480,9 @@ const Tr = /^(?:[ \t]*(?:\n|$))+/, Sr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
|
|
|
1480
1480
|
emStrongRDelimUnd: Fr,
|
|
1481
1481
|
escape: xs,
|
|
1482
1482
|
link: Wr,
|
|
1483
|
-
nolink:
|
|
1483
|
+
nolink: ws,
|
|
1484
1484
|
punctuation: Nr,
|
|
1485
|
-
reflink:
|
|
1485
|
+
reflink: bs,
|
|
1486
1486
|
reflinkSearch: Kr,
|
|
1487
1487
|
tag: jr,
|
|
1488
1488
|
text: Or,
|
|
@@ -1714,9 +1714,9 @@ class xe {
|
|
|
1714
1714
|
if (o = e, this.options.extensions && this.options.extensions.startInline) {
|
|
1715
1715
|
let d = 1 / 0;
|
|
1716
1716
|
const g = e.slice(1);
|
|
1717
|
-
let
|
|
1717
|
+
let b;
|
|
1718
1718
|
this.options.extensions.startInline.forEach((y) => {
|
|
1719
|
-
|
|
1719
|
+
b = y.call({ lexer: this }, g), typeof b == "number" && b >= 0 && (d = Math.min(d, b));
|
|
1720
1720
|
}), d < 1 / 0 && d >= 0 && (o = e.substring(0, d + 1));
|
|
1721
1721
|
}
|
|
1722
1722
|
if (s = this.tokenizer.inlineText(o)) {
|
|
@@ -2209,7 +2209,7 @@ class Qr {
|
|
|
2209
2209
|
const a = i, c = s.hooks[a], u = o[a];
|
|
2210
2210
|
gt.passThroughHooks.has(i) ? o[a] = (d) => {
|
|
2211
2211
|
if (this.defaults.async)
|
|
2212
|
-
return Promise.resolve(c.call(o, d)).then((
|
|
2212
|
+
return Promise.resolve(c.call(o, d)).then((b) => u.call(o, b));
|
|
2213
2213
|
const g = c.call(o, d);
|
|
2214
2214
|
return u.call(o, g);
|
|
2215
2215
|
} : o[a] = (...d) => {
|
|
@@ -2317,7 +2317,7 @@ const {
|
|
|
2317
2317
|
} = Object;
|
|
2318
2318
|
let {
|
|
2319
2319
|
freeze: de,
|
|
2320
|
-
seal:
|
|
2320
|
+
seal: we,
|
|
2321
2321
|
create: on
|
|
2322
2322
|
} = Object, {
|
|
2323
2323
|
apply: an,
|
|
@@ -2326,7 +2326,7 @@ let {
|
|
|
2326
2326
|
de || (de = function(e) {
|
|
2327
2327
|
return e;
|
|
2328
2328
|
});
|
|
2329
|
-
|
|
2329
|
+
we || (we = function(e) {
|
|
2330
2330
|
return e;
|
|
2331
2331
|
});
|
|
2332
2332
|
an || (an = function(e, t) {
|
|
@@ -2396,13 +2396,13 @@ function pt(n, e) {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
return t;
|
|
2398
2398
|
}
|
|
2399
|
-
const Yn = de(["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"]), Xt = de(["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"]), Jt = de(["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"]), oo = de(["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"]), en = de(["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"]), io = de(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Xn = de(["#text"]), Jn = de(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), tn = de(["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"]), es = de(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), Ot = de(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ao =
|
|
2399
|
+
const Yn = de(["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"]), Xt = de(["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"]), Jt = de(["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"]), oo = de(["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"]), en = de(["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"]), io = de(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Xn = de(["#text"]), Jn = de(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), tn = de(["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"]), es = de(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), Ot = de(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ao = we(/\{\{[\w\W]*|[\w\W]*\}\}/gm), lo = we(/<%[\w\W]*|[\w\W]*%>/gm), uo = we(/\$\{[\w\W]*/gm), co = we(/^data-[\-\w.\u00B7-\uFFFF]+$/), po = we(/^aria-[\-\w]+$/), Ts = we(
|
|
2400
2400
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
2401
2401
|
// eslint-disable-line no-useless-escape
|
|
2402
|
-
), ho =
|
|
2402
|
+
), ho = we(/^(?:\w+script|data):/i), fo = we(
|
|
2403
2403
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
2404
2404
|
// eslint-disable-line no-control-regex
|
|
2405
|
-
), Ss =
|
|
2405
|
+
), Ss = we(/^html$/i), go = we(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
2406
2406
|
var ts = /* @__PURE__ */ Object.freeze({
|
|
2407
2407
|
__proto__: null,
|
|
2408
2408
|
ARIA_ATTR: po,
|
|
@@ -2473,14 +2473,14 @@ function As() {
|
|
|
2473
2473
|
NodeFilter: u,
|
|
2474
2474
|
NamedNodeMap: d = n.NamedNodeMap || n.MozNamedAttrMap,
|
|
2475
2475
|
HTMLFormElement: g,
|
|
2476
|
-
DOMParser:
|
|
2476
|
+
DOMParser: b,
|
|
2477
2477
|
trustedTypes: y
|
|
2478
2478
|
} = n, h = c.prototype, A = pt(h, "cloneNode"), m = pt(h, "remove"), f = pt(h, "nextSibling"), S = pt(h, "childNodes"), C = pt(h, "parentNode");
|
|
2479
2479
|
if (typeof i == "function") {
|
|
2480
2480
|
const $ = t.createElement("template");
|
|
2481
2481
|
$.content && $.content.ownerDocument && (t = $.content.ownerDocument);
|
|
2482
2482
|
}
|
|
2483
|
-
let
|
|
2483
|
+
let w, z = "";
|
|
2484
2484
|
const {
|
|
2485
2485
|
implementation: F,
|
|
2486
2486
|
createNodeIterator: V,
|
|
@@ -2498,7 +2498,7 @@ function As() {
|
|
|
2498
2498
|
DATA_ATTR: ze,
|
|
2499
2499
|
ARIA_ATTR: Re,
|
|
2500
2500
|
IS_SCRIPT_OR_DATA: He,
|
|
2501
|
-
ATTR_WHITESPACE:
|
|
2501
|
+
ATTR_WHITESPACE: wt,
|
|
2502
2502
|
CUSTOM_ELEMENT: Bt
|
|
2503
2503
|
} = ts;
|
|
2504
2504
|
let {
|
|
@@ -2544,8 +2544,8 @@ function As() {
|
|
|
2544
2544
|
let St = !0, Ge = !0, _ = !1, K = !0, G = !1, te = !0, X = !1, J = !1, ue = !1, Se = !1, At = !1, Ct = !1, xn = !0, kn = !1;
|
|
2545
2545
|
const Ls = "user-content-";
|
|
2546
2546
|
let Ut = !0, rt = !1, Qe = {}, Ze = null;
|
|
2547
|
-
const
|
|
2548
|
-
let
|
|
2547
|
+
const bn = H({}, ["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"]);
|
|
2548
|
+
let wn = null;
|
|
2549
2549
|
const vn = H({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
2550
2550
|
let qt = null;
|
|
2551
2551
|
const Tn = H({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Et = "http://www.w3.org/1998/Math/MathML", Mt = "http://www.w3.org/2000/svg", Ie = "http://www.w3.org/1999/xhtml";
|
|
@@ -2562,14 +2562,14 @@ function As() {
|
|
|
2562
2562
|
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2563
2563
|
if (!(Xe && Xe === l)) {
|
|
2564
2564
|
if ((!l || typeof l != "object") && (l = {}), l = _e(l), ot = // eslint-disable-next-line unicorn/prefer-includes
|
|
2565
|
-
Ds.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? _s : l.PARSER_MEDIA_TYPE, oe = ot === "application/xhtml+xml" ? Zt : Nt, Y = ve(l, "ALLOWED_TAGS") ? H({}, l.ALLOWED_TAGS, oe) : st, se = ve(l, "ALLOWED_ATTR") ? H({}, l.ALLOWED_ATTR, oe) : Tt, Wt = ve(l, "ALLOWED_NAMESPACES") ? H({}, l.ALLOWED_NAMESPACES, Zt) : Is, qt = ve(l, "ADD_URI_SAFE_ATTR") ? H(_e(Tn), l.ADD_URI_SAFE_ATTR, oe) : Tn,
|
|
2565
|
+
Ds.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? _s : l.PARSER_MEDIA_TYPE, oe = ot === "application/xhtml+xml" ? Zt : Nt, Y = ve(l, "ALLOWED_TAGS") ? H({}, l.ALLOWED_TAGS, oe) : st, se = ve(l, "ALLOWED_ATTR") ? H({}, l.ALLOWED_ATTR, oe) : Tt, Wt = ve(l, "ALLOWED_NAMESPACES") ? H({}, l.ALLOWED_NAMESPACES, Zt) : Is, qt = ve(l, "ADD_URI_SAFE_ATTR") ? H(_e(Tn), l.ADD_URI_SAFE_ATTR, oe) : Tn, wn = ve(l, "ADD_DATA_URI_TAGS") ? H(_e(vn), l.ADD_DATA_URI_TAGS, oe) : vn, Ze = ve(l, "FORBID_CONTENTS") ? H({}, l.FORBID_CONTENTS, oe) : bn, Fe = ve(l, "FORBID_TAGS") ? H({}, l.FORBID_TAGS, oe) : _e({}), Ve = ve(l, "FORBID_ATTR") ? H({}, l.FORBID_ATTR, oe) : _e({}), Qe = ve(l, "USE_PROFILES") ? l.USE_PROFILES : !1, St = l.ALLOW_ARIA_ATTR !== !1, Ge = l.ALLOW_DATA_ATTR !== !1, _ = l.ALLOW_UNKNOWN_PROTOCOLS || !1, K = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = l.SAFE_FOR_TEMPLATES || !1, te = l.SAFE_FOR_XML !== !1, X = l.WHOLE_DOCUMENT || !1, Se = l.RETURN_DOM || !1, At = l.RETURN_DOM_FRAGMENT || !1, Ct = l.RETURN_TRUSTED_TYPE || !1, ue = l.FORCE_BODY || !1, xn = l.SANITIZE_DOM !== !1, kn = l.SANITIZE_NAMED_PROPS || !1, Ut = l.KEEP_CONTENT !== !1, rt = l.IN_PLACE || !1, vt = l.ALLOWED_URI_REGEXP || Ts, Ye = l.NAMESPACE || Ie, Rt = l.MATHML_TEXT_INTEGRATION_POINTS || Rt, Lt = l.HTML_INTEGRATION_POINTS || Lt, Z = l.CUSTOM_ELEMENT_HANDLING || {}, l.CUSTOM_ELEMENT_HANDLING && Sn(l.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Z.tagNameCheck = l.CUSTOM_ELEMENT_HANDLING.tagNameCheck), l.CUSTOM_ELEMENT_HANDLING && Sn(l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Z.attributeNameCheck = l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Z.allowCustomizedBuiltInElements = l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), G && (Ge = !1), At && (Se = !0), Qe && (Y = H({}, Xn), se = [], Qe.html === !0 && (H(Y, Yn), H(se, Jn)), Qe.svg === !0 && (H(Y, Xt), H(se, tn), H(se, Ot)), Qe.svgFilters === !0 && (H(Y, Jt), H(se, tn), H(se, Ot)), Qe.mathMl === !0 && (H(Y, en), H(se, es), H(se, Ot))), l.ADD_TAGS && (typeof l.ADD_TAGS == "function" ? Le.tagCheck = l.ADD_TAGS : (Y === st && (Y = _e(Y)), H(Y, l.ADD_TAGS, oe))), l.ADD_ATTR && (typeof l.ADD_ATTR == "function" ? Le.attributeCheck = l.ADD_ATTR : (se === Tt && (se = _e(se)), H(se, l.ADD_ATTR, oe))), l.ADD_URI_SAFE_ATTR && H(qt, l.ADD_URI_SAFE_ATTR, oe), l.FORBID_CONTENTS && (Ze === bn && (Ze = _e(Ze)), H(Ze, l.FORBID_CONTENTS, oe)), Ut && (Y["#text"] = !0), X && H(Y, ["html", "head", "body"]), Y.table && (H(Y, ["tbody"]), delete Fe.tbody), l.TRUSTED_TYPES_POLICY) {
|
|
2566
2566
|
if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
2567
2567
|
throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2568
2568
|
if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
2569
2569
|
throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2570
|
-
|
|
2570
|
+
w = l.TRUSTED_TYPES_POLICY, z = w.createHTML("");
|
|
2571
2571
|
} else
|
|
2572
|
-
|
|
2572
|
+
w === void 0 && (w = yo(y, r)), w !== null && typeof z == "string" && (z = w.createHTML(""));
|
|
2573
2573
|
de && de(l), Xe = l;
|
|
2574
2574
|
}
|
|
2575
2575
|
}, An = H({}, [...Xt, ...Jt, ...oo]), Cn = H({}, [...en, ...io]), Ns = function(l) {
|
|
@@ -2621,10 +2621,10 @@ function As() {
|
|
|
2621
2621
|
R = re && re[0];
|
|
2622
2622
|
}
|
|
2623
2623
|
ot === "application/xhtml+xml" && Ye === Ie && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
|
|
2624
|
-
const Q =
|
|
2624
|
+
const Q = w ? w.createHTML(l) : l;
|
|
2625
2625
|
if (Ye === Ie)
|
|
2626
2626
|
try {
|
|
2627
|
-
x = new
|
|
2627
|
+
x = new b().parseFromString(Q, ot);
|
|
2628
2628
|
} catch {
|
|
2629
2629
|
}
|
|
2630
2630
|
if (!x || !x.documentElement) {
|
|
@@ -2700,9 +2700,9 @@ function As() {
|
|
|
2700
2700
|
x === "is" && Z.allowCustomizedBuiltInElements && (Z.tagNameCheck instanceof RegExp && ce(Z.tagNameCheck, R) || Z.tagNameCheck instanceof Function && Z.tagNameCheck(R)))
|
|
2701
2701
|
) return !1;
|
|
2702
2702
|
} else if (!qt[x]) {
|
|
2703
|
-
if (!ce(vt, ct(R,
|
|
2704
|
-
if (!((x === "src" || x === "xlink:href" || x === "href") && l !== "script" && to(R, "data:") === 0 &&
|
|
2705
|
-
if (!(_ && !ce(He, ct(R,
|
|
2703
|
+
if (!ce(vt, ct(R, wt, ""))) {
|
|
2704
|
+
if (!((x === "src" || x === "xlink:href" || x === "href") && l !== "script" && to(R, "data:") === 0 && wn[l])) {
|
|
2705
|
+
if (!(_ && !ce(He, ct(R, wt, "")))) {
|
|
2706
2706
|
if (R)
|
|
2707
2707
|
return !1;
|
|
2708
2708
|
}
|
|
@@ -2763,14 +2763,14 @@ function As() {
|
|
|
2763
2763
|
Be(re, l);
|
|
2764
2764
|
continue;
|
|
2765
2765
|
}
|
|
2766
|
-
if (
|
|
2766
|
+
if (w && typeof y == "object" && typeof y.getAttributeType == "function" && !fe)
|
|
2767
2767
|
switch (y.getAttributeType(_n, Je)) {
|
|
2768
2768
|
case "TrustedHTML": {
|
|
2769
|
-
ie =
|
|
2769
|
+
ie = w.createHTML(ie);
|
|
2770
2770
|
break;
|
|
2771
2771
|
}
|
|
2772
2772
|
case "TrustedScriptURL": {
|
|
2773
|
-
ie =
|
|
2773
|
+
ie = w.createScriptURL(ie);
|
|
2774
2774
|
break;
|
|
2775
2775
|
}
|
|
2776
2776
|
}
|
|
@@ -2810,7 +2810,7 @@ function As() {
|
|
|
2810
2810
|
else {
|
|
2811
2811
|
if (!Se && !G && !X && // eslint-disable-next-line unicorn/prefer-includes
|
|
2812
2812
|
$.indexOf("<") === -1)
|
|
2813
|
-
return
|
|
2813
|
+
return w && Ct ? w.createHTML($) : $;
|
|
2814
2814
|
if (x = En($), !x)
|
|
2815
2815
|
return Se ? null : Ct ? z : "";
|
|
2816
2816
|
}
|
|
@@ -2832,7 +2832,7 @@ function As() {
|
|
|
2832
2832
|
return X && Y["!doctype"] && x.ownerDocument && x.ownerDocument.doctype && x.ownerDocument.doctype.name && ce(Ss, x.ownerDocument.doctype.name) && (fe = "<!DOCTYPE " + x.ownerDocument.doctype.name + `>
|
|
2833
2833
|
` + fe), G && _t([L, ne, Te], (De) => {
|
|
2834
2834
|
fe = ct(fe, De, " ");
|
|
2835
|
-
}),
|
|
2835
|
+
}), w && Ct ? w.createHTML(fe) : fe;
|
|
2836
2836
|
}, e.setConfig = function() {
|
|
2837
2837
|
let $ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2838
2838
|
Kt($), J = !0;
|
|
@@ -2905,7 +2905,7 @@ function ko() {
|
|
|
2905
2905
|
}
|
|
2906
2906
|
};
|
|
2907
2907
|
}
|
|
2908
|
-
function
|
|
2908
|
+
function ba() {
|
|
2909
2909
|
let n = null;
|
|
2910
2910
|
function e(o) {
|
|
2911
2911
|
const i = o || document.querySelector("[data-rai-chat-container]");
|
|
@@ -2944,7 +2944,7 @@ function wa() {
|
|
|
2944
2944
|
cleanupAutoScroll: r
|
|
2945
2945
|
};
|
|
2946
2946
|
}
|
|
2947
|
-
function
|
|
2947
|
+
function wa() {
|
|
2948
2948
|
const n = We(), e = O(() => n.error), t = O(() => {
|
|
2949
2949
|
var o, i;
|
|
2950
2950
|
return ((o = e.value) == null ? void 0 : o.message) !== null && ((i = e.value) == null ? void 0 : i.message) !== void 0;
|
|
@@ -2993,12 +2993,12 @@ const Ee = [], Es = {
|
|
|
2993
2993
|
return (n == null ? void 0 : n.defaultSuggestions) || [];
|
|
2994
2994
|
}
|
|
2995
2995
|
};
|
|
2996
|
-
function
|
|
2996
|
+
function bo() {
|
|
2997
2997
|
Ee.length = 0;
|
|
2998
2998
|
const n = ee();
|
|
2999
2999
|
n != null && n.suggestionProviders && Ee.push(...n.suggestionProviders), Ee.push(Es);
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3001
|
+
function wo(n, e) {
|
|
3002
3002
|
const t = [...Ee].sort((s, r) => (r.priority || 0) - (s.priority || 0));
|
|
3003
3003
|
for (const s of t)
|
|
3004
3004
|
if (s.matcher && s.matcher(n, e) || s.routes && s.routes.some((o) => o.endsWith("*") ? n.startsWith(o.slice(0, -1)) : n === o || n.startsWith(o + "/")))
|
|
@@ -3006,8 +3006,8 @@ function bo(n, e) {
|
|
|
3006
3006
|
return Es;
|
|
3007
3007
|
}
|
|
3008
3008
|
function vo(n, e) {
|
|
3009
|
-
Ee.length === 0 &&
|
|
3010
|
-
const t =
|
|
3009
|
+
Ee.length === 0 && bo();
|
|
3010
|
+
const t = wo(n, e), s = e || {
|
|
3011
3011
|
pageType: "default",
|
|
3012
3012
|
routePath: n
|
|
3013
3013
|
};
|
|
@@ -3120,8 +3120,8 @@ function Co(n) {
|
|
|
3120
3120
|
const c = a.target, u = c.tagName === "INPUT" || c.tagName === "TEXTAREA", d = c.isContentEditable, g = c.closest("[data-ai-input]");
|
|
3121
3121
|
if (!((u || d) && !g) && Ao(a, o)) {
|
|
3122
3122
|
a.preventDefault(), a.stopPropagation();
|
|
3123
|
-
const
|
|
3124
|
-
if (
|
|
3123
|
+
const b = ee();
|
|
3124
|
+
if (b != null && b.canToggle && !b.canToggle())
|
|
3125
3125
|
return;
|
|
3126
3126
|
s.value = !s.value, e();
|
|
3127
3127
|
}
|
|
@@ -3165,12 +3165,12 @@ function Eo(n, e) {
|
|
|
3165
3165
|
i();
|
|
3166
3166
|
const u = e == null ? void 0 : e(), d = (u == null ? void 0 : u.messages) ?? r(), g = (u == null ? void 0 : u.intervals) ?? o();
|
|
3167
3167
|
t.value = d[0] || le("loadingText");
|
|
3168
|
-
let
|
|
3168
|
+
let b = 0;
|
|
3169
3169
|
for (let y = 1; y < d.length; y++) {
|
|
3170
|
-
|
|
3170
|
+
b += g[y] || 2e3;
|
|
3171
3171
|
const h = y, A = window.setTimeout(() => {
|
|
3172
3172
|
n() && (t.value = d[h]);
|
|
3173
|
-
},
|
|
3173
|
+
}, b);
|
|
3174
3174
|
s.push(A);
|
|
3175
3175
|
}
|
|
3176
3176
|
}
|
|
@@ -3203,12 +3203,12 @@ function Mo(n) {
|
|
|
3203
3203
|
return ((C = s()) == null ? void 0 : C.showWarningAt) ?? c.value - 2;
|
|
3204
3204
|
}), d = O(() => Math.max(0, c.value - e())), g = O(
|
|
3205
3205
|
() => d.value <= c.value - u.value && d.value > 0
|
|
3206
|
-
),
|
|
3207
|
-
var C,
|
|
3208
|
-
return a.value.isReached ? ((C = r()) == null ? void 0 : C.historyLimitReachedTitle) ?? "Chat Limit Reached" : ((
|
|
3206
|
+
), b = O(() => d.value === 0), y = O(() => {
|
|
3207
|
+
var C, w;
|
|
3208
|
+
return a.value.isReached ? ((C = r()) == null ? void 0 : C.historyLimitReachedTitle) ?? "Chat Limit Reached" : ((w = r()) == null ? void 0 : w.historyLimitWarningTitle) ?? "Approaching Chat Limit";
|
|
3209
3209
|
}), h = O(() => {
|
|
3210
|
-
var C,
|
|
3211
|
-
return a.value.isReached ? ((C = s()) == null ? void 0 : C.limitMessage) ?? ((
|
|
3210
|
+
var C, w, z, F;
|
|
3211
|
+
return a.value.isReached ? ((C = s()) == null ? void 0 : C.limitMessage) ?? ((w = r()) == null ? void 0 : w.historyLimitReachedMessage) ?? "You have reached the maximum number of messages in this conversation. Start a new chat to continue." : ((z = s()) == null ? void 0 : z.warningMessage) ?? ((F = r()) == null ? void 0 : F.historyLimitWarningMessage) ?? `You have ${d.value} message${d.value === 1 ? "" : "s"} remaining in this conversation.`;
|
|
3212
3212
|
});
|
|
3213
3213
|
function A() {
|
|
3214
3214
|
a.value.showWarning = !1, a.value.isReached = !1, a.value.pendingMessage = null;
|
|
@@ -3219,13 +3219,13 @@ function Mo(n) {
|
|
|
3219
3219
|
if (C != null && C.onLimitReached && !await C.onLimitReached())
|
|
3220
3220
|
return a.value.isReached = !1, null;
|
|
3221
3221
|
if (o(), i(), a.value.isReached = !1, a.value.pendingMessage) {
|
|
3222
|
-
const
|
|
3223
|
-
return a.value.pendingMessage = null,
|
|
3222
|
+
const w = a.value.pendingMessage;
|
|
3223
|
+
return a.value.pendingMessage = null, w;
|
|
3224
3224
|
}
|
|
3225
3225
|
return null;
|
|
3226
3226
|
}
|
|
3227
3227
|
function f() {
|
|
3228
|
-
return
|
|
3228
|
+
return b.value ? (a.value.isReached = !0, a.value.showWarning = !0, !1) : (g.value && !a.value.showWarning && (a.value.showWarning = !0), !0);
|
|
3229
3229
|
}
|
|
3230
3230
|
function S(C) {
|
|
3231
3231
|
a.value.pendingMessage = C;
|
|
@@ -3256,7 +3256,7 @@ function Ro() {
|
|
|
3256
3256
|
const M = typeof E == "string" ? parseInt(E, 10) : E;
|
|
3257
3257
|
return Number.isNaN(M) ? "" : M >= 1024 * 1024 ? `${(M / (1024 * 1024)).toFixed(1)} MB` : M >= 1024 ? `${Math.round(M / 1024)} KB` : `${M} B`;
|
|
3258
3258
|
}
|
|
3259
|
-
function
|
|
3259
|
+
function b(E) {
|
|
3260
3260
|
var Te;
|
|
3261
3261
|
const M = crypto.randomUUID(), I = E.type.startsWith("image/") ? URL.createObjectURL(E) : void 0, P = ee(), L = !!((Te = P == null ? void 0 : P.endpoints) != null && Te.uploadFile), ne = {
|
|
3262
3262
|
id: M,
|
|
@@ -3315,7 +3315,7 @@ function Ro() {
|
|
|
3315
3315
|
const M = Array.from(E);
|
|
3316
3316
|
for (const I of M) {
|
|
3317
3317
|
if (e.value.length >= r) break;
|
|
3318
|
-
I.size > o ||
|
|
3318
|
+
I.size > o || b(I);
|
|
3319
3319
|
}
|
|
3320
3320
|
}
|
|
3321
3321
|
function S(E) {
|
|
@@ -3325,7 +3325,7 @@ function Ro() {
|
|
|
3325
3325
|
function C(E) {
|
|
3326
3326
|
S(E) && (s.value += 1, t.value = !0);
|
|
3327
3327
|
}
|
|
3328
|
-
function
|
|
3328
|
+
function w(E) {
|
|
3329
3329
|
S(E) || E.preventDefault();
|
|
3330
3330
|
}
|
|
3331
3331
|
function z(E) {
|
|
@@ -3361,7 +3361,7 @@ function Ro() {
|
|
|
3361
3361
|
handleFileSelect: V,
|
|
3362
3362
|
// Drag & Drop
|
|
3363
3363
|
handleDragEnter: C,
|
|
3364
|
-
handleDragOver:
|
|
3364
|
+
handleDragOver: w,
|
|
3365
3365
|
handleDragLeave: z,
|
|
3366
3366
|
handleDrop: F
|
|
3367
3367
|
};
|
|
@@ -3387,15 +3387,15 @@ function Lo(n, e, t) {
|
|
|
3387
3387
|
for (const S of m)
|
|
3388
3388
|
try {
|
|
3389
3389
|
const C = await S.search(A);
|
|
3390
|
-
f.push(...C.map((
|
|
3390
|
+
f.push(...C.map((w) => ({ ...w, type: S.type })));
|
|
3391
3391
|
} catch (C) {
|
|
3392
3392
|
console.warn(`Mention provider ${S.type} failed:`, C);
|
|
3393
3393
|
}
|
|
3394
3394
|
r.value = f.slice(0, 10), s.value = f.length > 0, o.value = 0;
|
|
3395
3395
|
}
|
|
3396
3396
|
function g(A) {
|
|
3397
|
-
const { startPos: m } = i.value, f = n(), S = t(), C = f.slice(0, m),
|
|
3398
|
-
e(`${C}@${z} ${
|
|
3397
|
+
const { startPos: m } = i.value, f = n(), S = t(), C = f.slice(0, m), w = f.slice((S == null ? void 0 : S.selectionStart) || m), z = A.name || A.label || A.title || A.id;
|
|
3398
|
+
e(`${C}@${z} ${w}`), a.value.push({
|
|
3399
3399
|
id: A.id,
|
|
3400
3400
|
name: z,
|
|
3401
3401
|
type: A.type,
|
|
@@ -3407,7 +3407,7 @@ function Lo(n, e, t) {
|
|
|
3407
3407
|
F == null || F.setSelectionRange(V, V);
|
|
3408
3408
|
}, 0);
|
|
3409
3409
|
}
|
|
3410
|
-
function
|
|
3410
|
+
function b(A) {
|
|
3411
3411
|
if (!s.value || r.value.length === 0)
|
|
3412
3412
|
return !1;
|
|
3413
3413
|
if (A.key === "ArrowDown")
|
|
@@ -3436,7 +3436,7 @@ function Lo(n, e, t) {
|
|
|
3436
3436
|
// Actions
|
|
3437
3437
|
checkForMentions: u,
|
|
3438
3438
|
handleMentionSelect: g,
|
|
3439
|
-
handleMentionKeyDown:
|
|
3439
|
+
handleMentionKeyDown: b,
|
|
3440
3440
|
clearMentions: y,
|
|
3441
3441
|
getMentions: h
|
|
3442
3442
|
};
|
|
@@ -3473,7 +3473,7 @@ function Io(n, e, t, s, r) {
|
|
|
3473
3473
|
const y = s(), h = e(), A = t(), m = n();
|
|
3474
3474
|
y && !h && A && m.length > 0 ? o.value = !0 : o.value = !1;
|
|
3475
3475
|
}
|
|
3476
|
-
function
|
|
3476
|
+
function b() {
|
|
3477
3477
|
o.value = !1, i.value = -1;
|
|
3478
3478
|
}
|
|
3479
3479
|
return {
|
|
@@ -3483,7 +3483,7 @@ function Io(n, e, t, s, r) {
|
|
|
3483
3483
|
handleSuggestionKeyDown: u,
|
|
3484
3484
|
handleSuggestionClick: d,
|
|
3485
3485
|
updateSuggestionsVisibility: g,
|
|
3486
|
-
hideSuggestions:
|
|
3486
|
+
hideSuggestions: b
|
|
3487
3487
|
};
|
|
3488
3488
|
}
|
|
3489
3489
|
function $o(n, e = 300) {
|
|
@@ -3597,10 +3597,10 @@ const Do = /* @__PURE__ */ he({
|
|
|
3597
3597
|
function u(m, f) {
|
|
3598
3598
|
let S = 0;
|
|
3599
3599
|
const C = Object.keys(i.value);
|
|
3600
|
-
for (const
|
|
3601
|
-
if (
|
|
3600
|
+
for (const w of C) {
|
|
3601
|
+
if (w === m)
|
|
3602
3602
|
return S + f;
|
|
3603
|
-
S += i.value[
|
|
3603
|
+
S += i.value[w].length;
|
|
3604
3604
|
}
|
|
3605
3605
|
return S;
|
|
3606
3606
|
}
|
|
@@ -3610,7 +3610,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3610
3610
|
function g(m) {
|
|
3611
3611
|
o.value = m, r("update:selectedIndex", m);
|
|
3612
3612
|
}
|
|
3613
|
-
function
|
|
3613
|
+
function b(m) {
|
|
3614
3614
|
const f = a(m.type);
|
|
3615
3615
|
return cn(m, f);
|
|
3616
3616
|
}
|
|
@@ -3638,13 +3638,13 @@ const Do = /* @__PURE__ */ he({
|
|
|
3638
3638
|
p("div", {
|
|
3639
3639
|
class: T(["p-2", s.value.container])
|
|
3640
3640
|
}, [
|
|
3641
|
-
(k(!0), v(
|
|
3641
|
+
(k(!0), v(be, null, Ne(i.value, (S, C) => (k(), v(be, { key: C }, [
|
|
3642
3642
|
Object.keys(i.value).length > 1 ? (k(), v("div", {
|
|
3643
3643
|
key: 0,
|
|
3644
3644
|
class: T(["px-3 py-1.5 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide", s.value.groupHeader])
|
|
3645
3645
|
}, N(c(C)), 3)) : B("", !0),
|
|
3646
|
-
(k(!0), v(
|
|
3647
|
-
key:
|
|
3646
|
+
(k(!0), v(be, null, Ne(S, (w, z) => (k(), v("button", {
|
|
3647
|
+
key: w.id,
|
|
3648
3648
|
type: "button",
|
|
3649
3649
|
class: T(["w-full flex items-center gap-3 px-3 py-2 rounded-lg text-left transition-colors mb-0.5", [
|
|
3650
3650
|
s.value.item,
|
|
@@ -3653,27 +3653,27 @@ const Do = /* @__PURE__ */ he({
|
|
|
3653
3653
|
"hover:bg-gray-50 dark:hover:bg-gray-700": u(C, z) !== o.value
|
|
3654
3654
|
}
|
|
3655
3655
|
]]),
|
|
3656
|
-
onClick: (F) => d(
|
|
3656
|
+
onClick: (F) => d(w),
|
|
3657
3657
|
onMouseenter: (F) => g(u(C, z))
|
|
3658
3658
|
}, [
|
|
3659
3659
|
me(m.$slots, "item-icon", {
|
|
3660
|
-
item:
|
|
3660
|
+
item: w,
|
|
3661
3661
|
type: C
|
|
3662
3662
|
}, () => [
|
|
3663
3663
|
p("span", {
|
|
3664
|
-
class: T(["w-8 h-8 flex items-center justify-center rounded-full text-xs font-semibold flex-shrink-0", [s.value.itemIcon, h(
|
|
3665
|
-
}, N(A(w
|
|
3664
|
+
class: T(["w-8 h-8 flex items-center justify-center rounded-full text-xs font-semibold flex-shrink-0", [s.value.itemIcon, h(w.type)]])
|
|
3665
|
+
}, N(A(b(w))), 3)
|
|
3666
3666
|
]),
|
|
3667
3667
|
p("div", {
|
|
3668
3668
|
class: T(["flex-1 min-w-0", s.value.itemContent])
|
|
3669
3669
|
}, [
|
|
3670
3670
|
p("p", {
|
|
3671
3671
|
class: T(["text-sm font-medium text-gray-900 dark:text-gray-100 truncate", s.value.itemName])
|
|
3672
|
-
}, N(w
|
|
3673
|
-
y(
|
|
3672
|
+
}, N(b(w)), 3),
|
|
3673
|
+
y(w) ? (k(), v("p", {
|
|
3674
3674
|
key: 0,
|
|
3675
3675
|
class: T(["text-xs text-gray-500 dark:text-gray-400 truncate", s.value.itemSubtitle])
|
|
3676
|
-
}, N(y(
|
|
3676
|
+
}, N(y(w)), 3)) : B("", !0)
|
|
3677
3677
|
], 2)
|
|
3678
3678
|
], 42, _o))), 128))
|
|
3679
3679
|
], 64))), 128))
|
|
@@ -3796,7 +3796,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3796
3796
|
function g() {
|
|
3797
3797
|
a.value = !a.value;
|
|
3798
3798
|
}
|
|
3799
|
-
function
|
|
3799
|
+
function b(f) {
|
|
3800
3800
|
return (f.type || "").startsWith("image/") ? !0 : /(png|jpe?g|gif|webp)$/i.test(f.name || "");
|
|
3801
3801
|
}
|
|
3802
3802
|
const y = O(() => {
|
|
@@ -3835,7 +3835,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3835
3835
|
class: T(["flex gap-3 justify-end", o.value.userMessage])
|
|
3836
3836
|
}, [
|
|
3837
3837
|
p("div", {
|
|
3838
|
-
class: T(["rounded-2xl px-4 py-3 bg-primary text-white max-w-fit", o.value.userBubble])
|
|
3838
|
+
class: T(["rounded-2xl px-4 py-3 bg-primary-500 text-white max-w-fit", o.value.userBubble])
|
|
3839
3839
|
}, [
|
|
3840
3840
|
n.message.message ? (k(), v("p", {
|
|
3841
3841
|
key: 0,
|
|
@@ -3850,18 +3850,18 @@ const Do = /* @__PURE__ */ he({
|
|
|
3850
3850
|
key: 2,
|
|
3851
3851
|
class: T(["mt-3 space-y-2", o.value.attachmentsContainer])
|
|
3852
3852
|
}, [
|
|
3853
|
-
(k(!0), v(
|
|
3854
|
-
key:
|
|
3855
|
-
href:
|
|
3856
|
-
target:
|
|
3853
|
+
(k(!0), v(be, null, Ne(c.value, (w) => (k(), Me(nn(w.url ? "a" : "div"), {
|
|
3854
|
+
key: w.id,
|
|
3855
|
+
href: w.url || void 0,
|
|
3856
|
+
target: w.url ? "_blank" : void 0,
|
|
3857
3857
|
rel: "noopener noreferrer",
|
|
3858
|
-
class: T(["flex items-center gap-3 rounded-xl border border-white/20 bg-white/10 p-2 transition", [o.value.attachmentItem,
|
|
3858
|
+
class: T(["flex items-center gap-3 rounded-xl border border-white/20 bg-white/10 p-2 transition", [o.value.attachmentItem, w.url ? "hover:bg-white/20 cursor-pointer" : ""]])
|
|
3859
3859
|
}, {
|
|
3860
3860
|
default: Ce(() => [
|
|
3861
3861
|
p("div", Ho, [
|
|
3862
|
-
|
|
3862
|
+
w.url && b(w) ? (k(), v("img", {
|
|
3863
3863
|
key: 0,
|
|
3864
|
-
src:
|
|
3864
|
+
src: w.url,
|
|
3865
3865
|
class: "object-cover h-full w-full",
|
|
3866
3866
|
alt: ""
|
|
3867
3867
|
}, null, 8, Fo)) : (k(), v("svg", Bo, [...S[0] || (S[0] = [
|
|
@@ -3874,17 +3874,17 @@ const Do = /* @__PURE__ */ he({
|
|
|
3874
3874
|
])]))
|
|
3875
3875
|
]),
|
|
3876
3876
|
p("div", Uo, [
|
|
3877
|
-
p("p", qo, N(
|
|
3878
|
-
p("p", jo, N(h(
|
|
3877
|
+
p("p", qo, N(w.name || r("attachment")), 1),
|
|
3878
|
+
p("p", jo, N(h(w.size)), 1)
|
|
3879
3879
|
]),
|
|
3880
|
-
|
|
3880
|
+
w.url ? (k(), v("span", Wo, N(r("openAttachment")), 1)) : B("", !0)
|
|
3881
3881
|
]),
|
|
3882
3882
|
_: 2
|
|
3883
3883
|
}, 1032, ["href", "target", "class"]))), 128))
|
|
3884
3884
|
], 2)) : B("", !0)
|
|
3885
3885
|
], 2),
|
|
3886
3886
|
p("div", {
|
|
3887
|
-
class: T(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary overflow-hidden", o.value.userAvatar])
|
|
3887
|
+
class: T(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary-500 overflow-hidden", o.value.userAvatar])
|
|
3888
3888
|
}, [
|
|
3889
3889
|
y.value ? (k(), v("img", {
|
|
3890
3890
|
key: 0,
|
|
@@ -3940,18 +3940,18 @@ const Do = /* @__PURE__ */ he({
|
|
|
3940
3940
|
key: 2,
|
|
3941
3941
|
class: T(["mt-4 space-y-2", o.value.attachmentsContainer])
|
|
3942
3942
|
}, [
|
|
3943
|
-
(k(!0), v(
|
|
3944
|
-
key:
|
|
3945
|
-
href:
|
|
3946
|
-
target:
|
|
3943
|
+
(k(!0), v(be, null, Ne(c.value, (w) => (k(), Me(nn(w.url ? "a" : "div"), {
|
|
3944
|
+
key: w.id,
|
|
3945
|
+
href: w.url || void 0,
|
|
3946
|
+
target: w.url ? "_blank" : void 0,
|
|
3947
3947
|
rel: "noopener noreferrer",
|
|
3948
|
-
class: T(["flex items-center gap-3 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 p-3 transition", [o.value.attachmentItem,
|
|
3948
|
+
class: T(["flex items-center gap-3 rounded-xl border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 p-3 transition", [o.value.attachmentItem, w.url ? "hover:bg-white dark:hover:bg-gray-600 cursor-pointer" : ""]])
|
|
3949
3949
|
}, {
|
|
3950
3950
|
default: Ce(() => [
|
|
3951
3951
|
p("div", Yo, [
|
|
3952
|
-
|
|
3952
|
+
w.url && b(w) ? (k(), v("img", {
|
|
3953
3953
|
key: 0,
|
|
3954
|
-
src:
|
|
3954
|
+
src: w.url,
|
|
3955
3955
|
class: "object-cover h-full w-full",
|
|
3956
3956
|
alt: ""
|
|
3957
3957
|
}, null, 8, Xo)) : (k(), v("svg", Jo, [...S[3] || (S[3] = [
|
|
@@ -3964,10 +3964,10 @@ const Do = /* @__PURE__ */ he({
|
|
|
3964
3964
|
])]))
|
|
3965
3965
|
]),
|
|
3966
3966
|
p("div", ei, [
|
|
3967
|
-
p("p", ti, N(
|
|
3968
|
-
p("p", ni, N(h(
|
|
3967
|
+
p("p", ti, N(w.name || r("attachment")), 1),
|
|
3968
|
+
p("p", ni, N(h(w.size)), 1)
|
|
3969
3969
|
]),
|
|
3970
|
-
|
|
3970
|
+
w.url ? (k(), v("span", si, N(r("openAttachment")), 1)) : B("", !0)
|
|
3971
3971
|
]),
|
|
3972
3972
|
_: 2
|
|
3973
3973
|
}, 1032, ["href", "target", "class"]))), 128))
|
|
@@ -3988,7 +3988,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
3988
3988
|
for (const [s, r] of e)
|
|
3989
3989
|
t[s] = r;
|
|
3990
3990
|
return t;
|
|
3991
|
-
}, oi = /* @__PURE__ */ Rs(ri, [["__scopeId", "data-v-
|
|
3991
|
+
}, oi = /* @__PURE__ */ Rs(ri, [["__scopeId", "data-v-b5ba399c"]]), ii = { class: "text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide" }, ai = { class: "space-y-2" }, li = ["src"], ui = {
|
|
3992
3992
|
key: 1,
|
|
3993
3993
|
class: "w-5 h-5 text-gray-500 dark:text-gray-400",
|
|
3994
3994
|
fill: "none",
|
|
@@ -4018,7 +4018,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4018
4018
|
}, [
|
|
4019
4019
|
p("p", ii, N(((s = n.texts) == null ? void 0 : s.attachedFiles) || "Attached files"), 1),
|
|
4020
4020
|
p("ul", ai, [
|
|
4021
|
-
(k(!0), v(
|
|
4021
|
+
(k(!0), v(be, null, Ne(n.attachments, (r) => (k(), v("li", {
|
|
4022
4022
|
key: r.id,
|
|
4023
4023
|
class: T(["flex items-center gap-3 rounded-xl bg-white dark:bg-gray-700 p-2 shadow-sm border border-gray-100 dark:border-gray-600", n.ui.attachmentItem])
|
|
4024
4024
|
}, [
|
|
@@ -4075,7 +4075,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4075
4075
|
], 2);
|
|
4076
4076
|
};
|
|
4077
4077
|
}
|
|
4078
|
-
}), yi = { class: "py-1" }, xi = ["onClick", "onMouseenter"], ki = { class: "flex items-start gap-3" },
|
|
4078
|
+
}), yi = { class: "py-1" }, xi = ["onClick", "onMouseenter"], ki = { class: "flex items-start gap-3" }, bi = { class: "flex-1 min-w-0" }, wi = { class: "text-sm font-medium text-gray-900 dark:text-gray-100" }, vi = { class: "text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2" }, Ti = /* @__PURE__ */ he({
|
|
4079
4079
|
__name: "SuggestionsDropdown",
|
|
4080
4080
|
props: {
|
|
4081
4081
|
suggestions: {},
|
|
@@ -4100,7 +4100,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4100
4100
|
class: T(["absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-lg max-h-80 overflow-y-auto z-10", n.ui.suggestionsDropdown])
|
|
4101
4101
|
}, [
|
|
4102
4102
|
p("ul", yi, [
|
|
4103
|
-
(k(!0), v(
|
|
4103
|
+
(k(!0), v(be, null, Ne(n.suggestions, (o, i) => (k(), v("li", {
|
|
4104
4104
|
key: o.id,
|
|
4105
4105
|
class: T(["px-4 py-3 cursor-pointer transition-colors border-b border-gray-100 dark:border-gray-700 last:border-b-0", [
|
|
4106
4106
|
n.ui.suggestionItem,
|
|
@@ -4113,8 +4113,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4113
4113
|
onMouseenter: (a) => s.$emit("hover", i)
|
|
4114
4114
|
}, [
|
|
4115
4115
|
p("div", ki, [
|
|
4116
|
-
p("div",
|
|
4117
|
-
p("p",
|
|
4116
|
+
p("div", bi, [
|
|
4117
|
+
p("p", wi, N(o.title), 1),
|
|
4118
4118
|
p("p", vi, N(o.description), 1)
|
|
4119
4119
|
])
|
|
4120
4120
|
])
|
|
@@ -4148,7 +4148,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4148
4148
|
},
|
|
4149
4149
|
emits: ["toggle-support-mode", "click"],
|
|
4150
4150
|
setup(n) {
|
|
4151
|
-
const e = n, t = O(() => e.sending ? [e.ui.stopButton || "bg-red-500 text-white hover:bg-red-600"] : e.canSend ? [e.ui.sendButtonActive || "bg-primary text-white hover:bg-primary
|
|
4151
|
+
const e = n, t = O(() => e.sending ? [e.ui.stopButton || "bg-red-500 text-white hover:bg-red-600"] : e.canSend ? [e.ui.sendButtonActive || "bg-primary-500 text-white hover:bg-primary-600"] : [e.ui.sendButtonDisabled || "bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed opacity-60"]);
|
|
4152
4152
|
return (s, r) => {
|
|
4153
4153
|
var o, i, a;
|
|
4154
4154
|
return k(), v("div", Si, [
|
|
@@ -4271,21 +4271,21 @@ const Do = /* @__PURE__ */ he({
|
|
|
4271
4271
|
return (I = i.value) == null ? void 0 : I.focus();
|
|
4272
4272
|
});
|
|
4273
4273
|
}
|
|
4274
|
-
), { adjustTextareaHeight:
|
|
4274
|
+
), { adjustTextareaHeight: b } = $o(() => i.value), y = O(() => t.supportRequestMode ? t.supportPlaceholder : t.placeholder), h = O(() => t.showSupportModeToggle ? t.supportRequestMode ? { paddingLeft: "3rem", paddingRight: "8rem" } : { paddingLeft: "3rem", paddingRight: "6rem" } : { paddingLeft: "3rem", paddingRight: "3.5rem" }), A = O(() => {
|
|
4275
4275
|
var I;
|
|
4276
4276
|
return (((I = o.value) == null ? void 0 : I.trim()) ?? "").length >= t.minLength ? !0 : u.hasAttachments.value;
|
|
4277
4277
|
}), m = O(
|
|
4278
4278
|
() => !t.disabled && !t.sending && A.value && !u.isUploading.value
|
|
4279
4279
|
);
|
|
4280
4280
|
Ue(() => t.modelValue, (M) => {
|
|
4281
|
-
o.value = M, Oe(
|
|
4281
|
+
o.value = M, Oe(b);
|
|
4282
4282
|
}), Ue(o, (M) => {
|
|
4283
|
-
r("update:modelValue", M), Oe(
|
|
4283
|
+
r("update:modelValue", M), Oe(b), d.checkForMentions(M), g.updateSuggestionsVisibility();
|
|
4284
4284
|
}), Ue(() => t.suggestions, () => {
|
|
4285
4285
|
g.updateSuggestionsVisibility();
|
|
4286
4286
|
});
|
|
4287
4287
|
function f() {
|
|
4288
|
-
|
|
4288
|
+
b();
|
|
4289
4289
|
}
|
|
4290
4290
|
function S(M) {
|
|
4291
4291
|
if (!d.handleMentionKeyDown(M) && !g.handleSuggestionKeyDown(M) && M.key === "Enter") {
|
|
@@ -4301,9 +4301,9 @@ const Do = /* @__PURE__ */ he({
|
|
|
4301
4301
|
attachments: M,
|
|
4302
4302
|
mentions: P,
|
|
4303
4303
|
isSupportRequest: t.supportRequestMode
|
|
4304
|
-
}), o.value = "", u.clearAttachments(), d.clearMentions(), Oe(
|
|
4304
|
+
}), o.value = "", u.clearAttachments(), d.clearMentions(), Oe(b);
|
|
4305
4305
|
}
|
|
4306
|
-
function
|
|
4306
|
+
function w() {
|
|
4307
4307
|
t.sending ? r("cancel") : m.value && C();
|
|
4308
4308
|
}
|
|
4309
4309
|
function z() {
|
|
@@ -4322,7 +4322,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4322
4322
|
}, 200);
|
|
4323
4323
|
}
|
|
4324
4324
|
return xt(() => {
|
|
4325
|
-
Oe(
|
|
4325
|
+
Oe(b);
|
|
4326
4326
|
}), (M, I) => {
|
|
4327
4327
|
var P;
|
|
4328
4328
|
return k(), v("div", {
|
|
@@ -4460,7 +4460,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4460
4460
|
ui: s.value,
|
|
4461
4461
|
texts: n.texts,
|
|
4462
4462
|
onToggleSupportMode: I[4] || (I[4] = (L) => M.$emit("toggle-support-mode")),
|
|
4463
|
-
onClick:
|
|
4463
|
+
onClick: w
|
|
4464
4464
|
}, null, 8, ["sending", "can-send", "support-request-mode", "show-support-mode-toggle", "ui", "texts"])
|
|
4465
4465
|
], 2)
|
|
4466
4466
|
], 2),
|
|
@@ -4486,26 +4486,26 @@ const Do = /* @__PURE__ */ he({
|
|
|
4486
4486
|
},
|
|
4487
4487
|
emits: ["item-click"],
|
|
4488
4488
|
setup(n, { emit: e }) {
|
|
4489
|
-
const t = n, s = e, r = (
|
|
4489
|
+
const t = n, s = e, r = (b) => {
|
|
4490
4490
|
var h;
|
|
4491
|
-
return (h = t.texts) != null && h[
|
|
4491
|
+
return (h = t.texts) != null && h[b] ? t.texts[b] : le({
|
|
4492
4492
|
aiName: "aiName",
|
|
4493
4493
|
title: "emptyStateTitle",
|
|
4494
4494
|
description: "emptyStateDescription"
|
|
4495
|
-
}[
|
|
4495
|
+
}[b]);
|
|
4496
4496
|
}, o = O(() => t.ui || {}), { suggestions: i, resolvePrompt: a } = Ms();
|
|
4497
|
-
function c(
|
|
4497
|
+
function c(b) {
|
|
4498
4498
|
const y = {
|
|
4499
|
-
...
|
|
4500
|
-
prompt: a(
|
|
4499
|
+
...b,
|
|
4500
|
+
prompt: a(b)
|
|
4501
4501
|
};
|
|
4502
4502
|
s("item-click", y);
|
|
4503
4503
|
}
|
|
4504
|
-
function u(
|
|
4505
|
-
return
|
|
4504
|
+
function u(b) {
|
|
4505
|
+
return b.gradientClass ? b.gradientClass : b.className ? b.className : "bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900";
|
|
4506
4506
|
}
|
|
4507
|
-
function d(
|
|
4508
|
-
const y =
|
|
4507
|
+
function d(b) {
|
|
4508
|
+
const y = b.category || "default", h = {
|
|
4509
4509
|
hr: "bg-blue-100 dark:bg-blue-900/30",
|
|
4510
4510
|
finance: "bg-green-100 dark:bg-green-900/30",
|
|
4511
4511
|
analytics: "bg-purple-100 dark:bg-purple-900/30",
|
|
@@ -4514,8 +4514,8 @@ const Do = /* @__PURE__ */ he({
|
|
|
4514
4514
|
};
|
|
4515
4515
|
return h[y] || h.default;
|
|
4516
4516
|
}
|
|
4517
|
-
function g(
|
|
4518
|
-
const y =
|
|
4517
|
+
function g(b) {
|
|
4518
|
+
const y = b.category || "default", h = {
|
|
4519
4519
|
hr: "text-blue-600 dark:text-blue-400",
|
|
4520
4520
|
finance: "text-green-600 dark:text-green-400",
|
|
4521
4521
|
analytics: "text-purple-600 dark:text-purple-400",
|
|
@@ -4524,7 +4524,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4524
4524
|
};
|
|
4525
4525
|
return h[y] || h.default;
|
|
4526
4526
|
}
|
|
4527
|
-
return (
|
|
4527
|
+
return (b, y) => (k(), v("div", {
|
|
4528
4528
|
class: T(["flex items-center justify-center p-4 h-full", o.value.root])
|
|
4529
4529
|
}, [
|
|
4530
4530
|
p("div", {
|
|
@@ -4561,7 +4561,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4561
4561
|
p("div", {
|
|
4562
4562
|
class: T(["mb-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-3", o.value.grid])
|
|
4563
4563
|
}, [
|
|
4564
|
-
(k(!0), v(
|
|
4564
|
+
(k(!0), v(be, null, Ne(D(i), (h, A) => (k(), v("button", {
|
|
4565
4565
|
key: h.id || A,
|
|
4566
4566
|
class: T(["group relative overflow-hidden rounded-xl border border-gray-300 dark:border-gray-600 p-4 text-left transition-all hover:shadow-md hover:scale-[1.02]", [o.value.suggestionCard, u(h)]]),
|
|
4567
4567
|
onClick: (m) => c(h)
|
|
@@ -4647,7 +4647,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4647
4647
|
n.isSetupMode ? (k(), v("div", Ui, [...t[5] || (t[5] = [
|
|
4648
4648
|
p("span", { class: "flex h-2 w-2 rounded-full bg-amber-500 animate-pulse" }, null, -1),
|
|
4649
4649
|
p("span", { class: "text-sm font-medium text-gray-700 dark:text-gray-300" }, "Setup Required", -1)
|
|
4650
|
-
])])) : (k(), v(
|
|
4650
|
+
])])) : (k(), v(be, { key: 0 }, [
|
|
4651
4651
|
n.showNewChatButton && n.hasHistory ? (k(), v("button", {
|
|
4652
4652
|
key: 0,
|
|
4653
4653
|
type: "button",
|
|
@@ -4791,7 +4791,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4791
4791
|
p("span", null, N(n.t("title") || D(le)("aiName")), 1)
|
|
4792
4792
|
])
|
|
4793
4793
|
]),
|
|
4794
|
-
(k(!0), v(
|
|
4794
|
+
(k(!0), v(be, null, Ne(n.messages, (i, a) => me(e.$slots, "message", {
|
|
4795
4795
|
key: i.id || a,
|
|
4796
4796
|
message: i,
|
|
4797
4797
|
isUser: i.role === "user",
|
|
@@ -4807,7 +4807,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4807
4807
|
n.quota.remaining === 0 ? (k(), v("div", Ji, [
|
|
4808
4808
|
p("button", {
|
|
4809
4809
|
type: "button",
|
|
4810
|
-
class: "inline-flex items-center gap-2 px-6 py-3 bg-primary text-white rounded-lg hover:bg-primary
|
|
4810
|
+
class: "inline-flex items-center gap-2 px-6 py-3 bg-primary-500 text-white rounded-lg hover:bg-primary-600 transition-all shadow-sm",
|
|
4811
4811
|
onClick: t[1] || (t[1] = (i) => e.$emit("contact-support"))
|
|
4812
4812
|
}, [
|
|
4813
4813
|
t[4] || (t[4] = p("svg", {
|
|
@@ -4864,7 +4864,7 @@ const Do = /* @__PURE__ */ he({
|
|
|
4864
4864
|
},
|
|
4865
4865
|
emits: ["copy"],
|
|
4866
4866
|
setup(n) {
|
|
4867
|
-
return (e, t) => (k(), v(
|
|
4867
|
+
return (e, t) => (k(), v(be, null, [
|
|
4868
4868
|
t[4] || (t[4] = Nn('<div class="w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mb-5"><svg class="w-7 h-7 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09Z"></path></svg></div><h2 class="text-lg font-semibold text-gray-900 dark:text-white mb-1"> Almost there! </h2><p class="text-sm text-gray-500 dark:text-gray-400 mb-6 max-w-sm text-center"> Configure the plugin in your app entry file to start using AI. </p>', 3)),
|
|
4869
4869
|
p("div", na, [
|
|
4870
4870
|
p("div", sa, [
|
|
@@ -4925,7 +4925,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
4925
4925
|
return e.icon === "warning" ? (r = e.ui) == null ? void 0 : r.historyLimitModal : (o = e.ui) == null ? void 0 : o.closeConfirmModal;
|
|
4926
4926
|
}), s = O(() => {
|
|
4927
4927
|
var i, a;
|
|
4928
|
-
const r = e.confirmVariant === "danger" ? "bg-red-600 hover:bg-red-700" : "bg-primary hover:bg-primary
|
|
4928
|
+
const r = e.confirmVariant === "danger" ? "bg-red-600 hover:bg-red-700" : "bg-primary-500 hover:bg-primary-600", o = e.confirmVariant === "danger" ? (i = e.ui) == null ? void 0 : i.closeConfirmButton : (a = e.ui) == null ? void 0 : a.historyLimitButton;
|
|
4929
4929
|
return [r, o];
|
|
4930
4930
|
});
|
|
4931
4931
|
return (r, o) => (k(), Me(mt, {
|
|
@@ -5028,7 +5028,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
5028
5028
|
}
|
|
5029
5029
|
return le(_, K);
|
|
5030
5030
|
}
|
|
5031
|
-
const i = We(), a = q(""), c = q(null), u = q(!1), d = q(!1), g = q(!1), { loadingMessage:
|
|
5031
|
+
const i = We(), a = q(""), c = q(null), u = q(!1), d = q(!1), g = q(!1), { loadingMessage: b, startLoadingText: y, resetLoadingText: h } = Eo(
|
|
5032
5032
|
() => i.sending,
|
|
5033
5033
|
() => t.loadingText
|
|
5034
5034
|
), {
|
|
@@ -5037,7 +5037,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
5037
5037
|
historyLimitDialogTitle: f,
|
|
5038
5038
|
historyLimitDialogMessage: S,
|
|
5039
5039
|
dismissHistoryLimitWarning: C,
|
|
5040
|
-
handleHistoryLimitAction:
|
|
5040
|
+
handleHistoryLimitAction: w,
|
|
5041
5041
|
checkHistoryLimit: z,
|
|
5042
5042
|
setPendingMessage: F
|
|
5043
5043
|
} = Mo({
|
|
@@ -5091,7 +5091,7 @@ app.<span class="text-yellow-300">use</span>(RestifyAiPlugin, {
|
|
|
5091
5091
|
function He() {
|
|
5092
5092
|
t.confirmClose && !V.value && i.chatHistory.length > 0 ? g.value = !0 : (r.value = !1, s("close"));
|
|
5093
5093
|
}
|
|
5094
|
-
function
|
|
5094
|
+
function wt() {
|
|
5095
5095
|
g.value = !1, i.clearChatHistory(), r.value = !1, s("close");
|
|
5096
5096
|
}
|
|
5097
5097
|
function Bt() {
|
|
@@ -5127,7 +5127,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5127
5127
|
}, 2e3);
|
|
5128
5128
|
}
|
|
5129
5129
|
async function Fe() {
|
|
5130
|
-
const _ = await
|
|
5130
|
+
const _ = await w();
|
|
5131
5131
|
_ && (await Oe(), await Ve(_.message, _.attachments, _.mentions, _.isSupportRequest));
|
|
5132
5132
|
}
|
|
5133
5133
|
async function Ve(_, K, G, te) {
|
|
@@ -5231,7 +5231,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5231
5231
|
onCopy: Z
|
|
5232
5232
|
}, null, 8, ["copied"])
|
|
5233
5233
|
], !0)
|
|
5234
|
-
])) : (k(), v(
|
|
5234
|
+
])) : (k(), v(be, { key: 1 }, [
|
|
5235
5235
|
D(i).chatHistory.length === 0 ? (k(), v("div", ha, [
|
|
5236
5236
|
me(_.$slots, "empty-state", {
|
|
5237
5237
|
suggestions: P.value,
|
|
@@ -5247,7 +5247,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5247
5247
|
}, [
|
|
5248
5248
|
ge(ta, {
|
|
5249
5249
|
messages: D(i).chatHistory,
|
|
5250
|
-
"loading-message": D(
|
|
5250
|
+
"loading-message": D(b),
|
|
5251
5251
|
quota: D(i).quota,
|
|
5252
5252
|
error: D(i).error,
|
|
5253
5253
|
ui: n.ui,
|
|
@@ -5307,7 +5307,7 @@ app.use(RestifyAiPlugin, {
|
|
|
5307
5307
|
"cancel-text": o("cancel"),
|
|
5308
5308
|
ui: n.ui,
|
|
5309
5309
|
"confirm-variant": "danger",
|
|
5310
|
-
onConfirm:
|
|
5310
|
+
onConfirm: wt,
|
|
5311
5311
|
onCancel: K[2] || (K[2] = (J) => g.value = !1)
|
|
5312
5312
|
}, null, 8, ["show", "title", "message", "confirm-text", "cancel-text", "ui"]),
|
|
5313
5313
|
ge(ss, {
|
|
@@ -5424,9 +5424,9 @@ export {
|
|
|
5424
5424
|
Cs as useAiContext,
|
|
5425
5425
|
Sa as useAiDrawerShortcut,
|
|
5426
5426
|
Ms as useAiSuggestions,
|
|
5427
|
-
|
|
5427
|
+
wa as useChatErrorHandling,
|
|
5428
5428
|
ko as useChatMarkdown,
|
|
5429
|
-
|
|
5429
|
+
ba as useChatScroll,
|
|
5430
5430
|
Co as useKeyboardShortcut,
|
|
5431
5431
|
ka as useMentionParsing,
|
|
5432
5432
|
Ta as usePageAiContext,
|