@pagelines/sdk 1.0.509 → 1.0.511
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +172 -172
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/AgentController.d.ts +1 -1
- package/dist/clients/ChatClient.d.ts +2 -2
- package/dist/sdkClient.js +23 -23
- package/dist/sdkClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -227,29 +227,29 @@ Current User:
|
|
|
227
227
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
|
|
228
228
|
const l = `stream-${Date.now()}`;
|
|
229
229
|
let o = !1;
|
|
230
|
-
const d = /* @__PURE__ */ p((g) => {
|
|
230
|
+
const d = /* @__PURE__ */ p((g, x = "assistant") => {
|
|
231
231
|
o || (o = !0, this.sharedMessages.value = [
|
|
232
232
|
...this.sharedMessages.value,
|
|
233
|
-
{ id: l, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
233
|
+
{ id: l, text: "", sender: x === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
234
234
|
]);
|
|
235
|
-
const
|
|
236
|
-
|
|
235
|
+
const k = this.sharedMessages.value, _ = k[k.length - 1];
|
|
236
|
+
_?.id === l && (_.text += g, this.sharedMessages.value = [...k]);
|
|
237
237
|
}, "onDelta"), c = /* @__PURE__ */ p((g) => {
|
|
238
238
|
if (!o) {
|
|
239
|
-
|
|
239
|
+
m("empty_stream — assistant returned no content");
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
let _ =
|
|
242
|
+
const x = this.sharedMessages.value, k = x[x.length - 1];
|
|
243
|
+
if (k?.id === l && k.sender === "agent" && k.text) {
|
|
244
|
+
let _ = k.text;
|
|
245
245
|
for (const z of Us)
|
|
246
246
|
z.pattern.test(_) && (console.debug(`[chat] filtered directive: ${z.label}`), _ = _.replace(z.pattern, "").trim(), z.pattern.lastIndex = 0);
|
|
247
|
-
_ ? _ !==
|
|
247
|
+
_ ? _ !== k.text && (k.text = _, this.sharedMessages.value = [...x]) : this.sharedMessages.value = x.slice(0, -1);
|
|
248
248
|
}
|
|
249
249
|
g && (this.conversationId = g), this.updateState(this.textState, { isThinking: !1 });
|
|
250
|
-
}, "onDone"),
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
250
|
+
}, "onDone"), m = /* @__PURE__ */ p((g) => {
|
|
251
|
+
const x = this.sharedMessages.value, k = x[x.length - 1];
|
|
252
|
+
if (k?.id === l && !k.text && (this.sharedMessages.value = x.slice(0, -1)), typeof g == "object" && g.code && g.error) {
|
|
253
253
|
const { bucket: te, actionUrl: oe, actionLabel: se, help: O } = g;
|
|
254
254
|
if (te !== void 0 || Fs.has(g.code)) {
|
|
255
255
|
const re = te ?? (os.has(g.code) ? "account" : "error"), ie = {
|
|
@@ -277,7 +277,7 @@ Current User:
|
|
|
277
277
|
history: this.buildHistory(),
|
|
278
278
|
onDelta: d,
|
|
279
279
|
onDone: c,
|
|
280
|
-
onError:
|
|
280
|
+
onError: m,
|
|
281
281
|
onStatus: u
|
|
282
282
|
}) : s.chat.chatStreamPublic({
|
|
283
283
|
handle: this._agent.handle.value,
|
|
@@ -287,15 +287,15 @@ Current User:
|
|
|
287
287
|
context: this.getDynamicSettings().context || void 0,
|
|
288
288
|
onDelta: d,
|
|
289
289
|
onDone: c,
|
|
290
|
-
onError:
|
|
290
|
+
onError: m,
|
|
291
291
|
onStatus: u
|
|
292
292
|
});
|
|
293
293
|
await Promise.race([
|
|
294
294
|
g,
|
|
295
|
-
new Promise((
|
|
295
|
+
new Promise((x, k) => setTimeout(() => k(new Error("timed out")), Bs))
|
|
296
296
|
]);
|
|
297
297
|
} catch (g) {
|
|
298
|
-
|
|
298
|
+
m(g.message || "Something went wrong");
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
buildHistory() {
|
|
@@ -425,17 +425,17 @@ const Hs = {
|
|
|
425
425
|
}, { deep: !0 });
|
|
426
426
|
function o(u, g) {
|
|
427
427
|
g.preventDefault(), l.value = !0;
|
|
428
|
-
const
|
|
429
|
-
if (
|
|
430
|
-
s.value =
|
|
428
|
+
const x = (g.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
429
|
+
if (x.length === e.length)
|
|
430
|
+
s.value = x.split(""), setTimeout(() => {
|
|
431
431
|
r.value[e.length - 1]?.focus(), l.value = !1;
|
|
432
432
|
}, 10);
|
|
433
433
|
else {
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}), s.value =
|
|
438
|
-
const _ = Math.min(u +
|
|
434
|
+
const k = [...s.value];
|
|
435
|
+
x.split("").slice(0, e.length - u).forEach((z, te) => {
|
|
436
|
+
k[u + te] = z;
|
|
437
|
+
}), s.value = k;
|
|
438
|
+
const _ = Math.min(u + x.length, e.length - 1);
|
|
439
439
|
setTimeout(() => {
|
|
440
440
|
r.value[_]?.focus(), l.value = !1;
|
|
441
441
|
}, 10);
|
|
@@ -443,37 +443,37 @@ const Hs = {
|
|
|
443
443
|
}
|
|
444
444
|
p(o, "onPaste");
|
|
445
445
|
function d(u, g) {
|
|
446
|
-
const
|
|
447
|
-
s.value[u] =
|
|
446
|
+
const x = g.target.value.slice(-1).replace(/\D/g, "");
|
|
447
|
+
s.value[u] = x, x && u < e.length - 1 && r.value[u + 1]?.focus();
|
|
448
448
|
}
|
|
449
449
|
p(d, "onInput");
|
|
450
450
|
function c(u, g) {
|
|
451
451
|
g.key === "Backspace" ? (g.preventDefault(), s.value[u] = "", u > 0 && r.value[u - 1]?.focus()) : g.key === "ArrowLeft" && u > 0 ? r.value[u - 1]?.focus() : g.key === "ArrowRight" && u < e.length - 1 && r.value[u + 1]?.focus();
|
|
452
452
|
}
|
|
453
453
|
p(c, "onKeydown");
|
|
454
|
-
function
|
|
454
|
+
function m(u) {
|
|
455
455
|
if (r.value[u]?.select(), !l.value && s.value[u])
|
|
456
456
|
for (let g = u; g < e.length; g++)
|
|
457
457
|
s.value[g] = "";
|
|
458
458
|
}
|
|
459
|
-
return p(
|
|
460
|
-
(y(!0), T(ye, null, ot(a.length, (
|
|
461
|
-
key:
|
|
459
|
+
return p(m, "onFocus"), (u, g) => (y(), T("div", js, [
|
|
460
|
+
(y(!0), T(ye, null, ot(a.length, (x) => ss((y(), T("input", {
|
|
461
|
+
key: x,
|
|
462
462
|
ref_for: !0,
|
|
463
|
-
ref: /* @__PURE__ */ p((
|
|
464
|
-
"onUpdate:modelValue": /* @__PURE__ */ p((
|
|
463
|
+
ref: /* @__PURE__ */ p((k) => r.value[x - 1] = k, "ref"),
|
|
464
|
+
"onUpdate:modelValue": /* @__PURE__ */ p((k) => s.value[x - 1] = k, "onUpdate:modelValue"),
|
|
465
465
|
type: "text",
|
|
466
466
|
inputmode: "numeric",
|
|
467
467
|
autocomplete: "one-time-code",
|
|
468
468
|
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
469
469
|
style: { "font-size": "16px" },
|
|
470
470
|
maxlength: "1",
|
|
471
|
-
onInput: /* @__PURE__ */ p((
|
|
472
|
-
onKeydown: /* @__PURE__ */ p((
|
|
473
|
-
onPaste: /* @__PURE__ */ p((
|
|
474
|
-
onFocus: /* @__PURE__ */ p((
|
|
471
|
+
onInput: /* @__PURE__ */ p((k) => d(x - 1, k), "onInput"),
|
|
472
|
+
onKeydown: /* @__PURE__ */ p((k) => c(x - 1, k), "onKeydown"),
|
|
473
|
+
onPaste: /* @__PURE__ */ p((k) => o(x - 1, k), "onPaste"),
|
|
474
|
+
onFocus: /* @__PURE__ */ p((k) => m(x - 1), "onFocus")
|
|
475
475
|
}, null, 40, Ws)), [
|
|
476
|
-
[rs, s.value[
|
|
476
|
+
[rs, s.value[x - 1]]
|
|
477
477
|
])), 128))
|
|
478
478
|
]));
|
|
479
479
|
}
|
|
@@ -741,11 +741,11 @@ function ps() {
|
|
|
741
741
|
Node: o,
|
|
742
742
|
Element: d,
|
|
743
743
|
NodeFilter: c,
|
|
744
|
-
NamedNodeMap:
|
|
744
|
+
NamedNodeMap: m = a.NamedNodeMap || a.MozNamedAttrMap,
|
|
745
745
|
HTMLFormElement: u,
|
|
746
746
|
DOMParser: g,
|
|
747
|
-
trustedTypes:
|
|
748
|
-
} = a,
|
|
747
|
+
trustedTypes: x
|
|
748
|
+
} = a, k = d.prototype, _ = je(k, "cloneNode"), z = je(k, "remove"), te = je(k, "nextSibling"), oe = je(k, "childNodes"), se = je(k, "parentNode");
|
|
749
749
|
if (typeof l == "function") {
|
|
750
750
|
const S = e.createElement("template");
|
|
751
751
|
S.content && S.content.ownerDocument && (e = S.content.ownerDocument);
|
|
@@ -796,7 +796,7 @@ function ps() {
|
|
|
796
796
|
enumerable: !0,
|
|
797
797
|
value: !1
|
|
798
798
|
}
|
|
799
|
-
})),
|
|
799
|
+
})), w = null, M = null;
|
|
800
800
|
const N = Object.seal(Ge(null, {
|
|
801
801
|
tagCheck: {
|
|
802
802
|
writable: !0,
|
|
@@ -833,16 +833,16 @@ function ps() {
|
|
|
833
833
|
if (Be && Be === i)
|
|
834
834
|
return;
|
|
835
835
|
(!i || typeof i != "object") && (i = {}), i = ee(i), tt = // eslint-disable-next-line unicorn/prefer-includes
|
|
836
|
-
As.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Es : i.PARSER_MEDIA_TYPE, W = tt === "application/xhtml+xml" ? qt : ct, F = $(i, "ALLOWED_TAGS") && K(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, W) : Qe, H = $(i, "ALLOWED_ATTR") && K(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, W) : C, Ut = $(i, "ALLOWED_NAMESPACES") && K(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : Ts, Nt = $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) ? R(ee(kn), i.ADD_URI_SAFE_ATTR, W) : kn, xn = $(i, "ADD_DATA_URI_TAGS") && K(i.ADD_DATA_URI_TAGS) ? R(ee(bn), i.ADD_DATA_URI_TAGS, W) : bn, fe = $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, W) : Pt,
|
|
836
|
+
As.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Es : i.PARSER_MEDIA_TYPE, W = tt === "application/xhtml+xml" ? qt : ct, F = $(i, "ALLOWED_TAGS") && K(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, W) : Qe, H = $(i, "ALLOWED_ATTR") && K(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, W) : C, Ut = $(i, "ALLOWED_NAMESPACES") && K(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : Ts, Nt = $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) ? R(ee(kn), i.ADD_URI_SAFE_ATTR, W) : kn, xn = $(i, "ADD_DATA_URI_TAGS") && K(i.ADD_DATA_URI_TAGS) ? R(ee(bn), i.ADD_DATA_URI_TAGS, W) : bn, fe = $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, W) : Pt, w = $(i, "FORBID_TAGS") && K(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, W) : ee({}), M = $(i, "FORBID_ATTR") && K(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, W) : ee({}), $e = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? ee(i.USE_PROFILES) : i.USE_PROFILES : !1, xe = i.ALLOW_ARIA_ATTR !== !1, ze = i.ALLOW_DATA_ATTR !== !1, Pe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Re = i.SAFE_FOR_TEMPLATES || !1, Je = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, Ne = i.RETURN_DOM || !1, gt = i.RETURN_DOM_FRAGMENT || !1, mt = i.RETURN_TRUSTED_TYPE || !1, Ot = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, zt = i.KEEP_CONTENT !== !1, et = i.IN_PLACE || !1, ft = cr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : us, Ue = typeof i.NAMESPACE == "string" ? i.NAMESPACE : ge, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ee(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? ee(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
837
837
|
const h = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? ee(i.CUSTOM_ELEMENT_HANDLING) : Ge(null);
|
|
838
|
-
if (f = Ge(null), $(h, "tagNameCheck") && wn(h.tagNameCheck) && (f.tagNameCheck = h.tagNameCheck), $(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (f.attributeNameCheck = h.attributeNameCheck), $(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Re && (ze = !1), gt && (Ne = !0), $e && (F = R({}, jn), H = Ge(null), $e.html === !0 && (R(F, Gn), R(H, Wn)), $e.svg === !0 && (R(F, Vt), R(H, Xt), R(H, wt)), $e.svgFilters === !0 && (R(F, Yt), R(H, Xt), R(H, wt)), $e.mathMl === !0 && (R(F, Zt), R(H, qn), R(H, wt))), N.tagCheck = null, N.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? N.tagCheck = i.ADD_TAGS : K(i.ADD_TAGS) && (F === Qe && (F = ee(F)), R(F, i.ADD_TAGS, W))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? N.attributeCheck = i.ADD_ATTR : K(i.ADD_ATTR) && (H === C && (H = ee(H)), R(H, i.ADD_ATTR, W))), $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) && R(Nt, i.ADD_URI_SAFE_ATTR, W), $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.FORBID_CONTENTS, W)), $(i, "ADD_FORBID_CONTENTS") && K(i.ADD_FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.ADD_FORBID_CONTENTS, W)), zt && (F["#text"] = !0), Ce && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete
|
|
838
|
+
if (f = Ge(null), $(h, "tagNameCheck") && wn(h.tagNameCheck) && (f.tagNameCheck = h.tagNameCheck), $(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (f.attributeNameCheck = h.attributeNameCheck), $(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Re && (ze = !1), gt && (Ne = !0), $e && (F = R({}, jn), H = Ge(null), $e.html === !0 && (R(F, Gn), R(H, Wn)), $e.svg === !0 && (R(F, Vt), R(H, Xt), R(H, wt)), $e.svgFilters === !0 && (R(F, Yt), R(H, Xt), R(H, wt)), $e.mathMl === !0 && (R(F, Zt), R(H, qn), R(H, wt))), N.tagCheck = null, N.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? N.tagCheck = i.ADD_TAGS : K(i.ADD_TAGS) && (F === Qe && (F = ee(F)), R(F, i.ADD_TAGS, W))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? N.attributeCheck = i.ADD_ATTR : K(i.ADD_ATTR) && (H === C && (H = ee(H)), R(H, i.ADD_ATTR, W))), $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) && R(Nt, i.ADD_URI_SAFE_ATTR, W), $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.FORBID_CONTENTS, W)), $(i, "ADD_FORBID_CONTENTS") && K(i.ADD_FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.ADD_FORBID_CONTENTS, W)), zt && (F["#text"] = !0), Ce && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete w.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
839
839
|
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
840
840
|
throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
841
841
|
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
842
842
|
throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
843
843
|
O = i.TRUSTED_TYPES_POLICY, ce = O.createHTML("");
|
|
844
844
|
} else
|
|
845
|
-
O === void 0 && (O = vr(
|
|
845
|
+
O === void 0 && (O = vr(x, r)), O !== null && typeof ce == "string" && (ce = O.createHTML(""));
|
|
846
846
|
Q && Q(i), Be = i;
|
|
847
847
|
}, "_parseConfig"), vn = R({}, [...Vt, ...Yt, ...ur]), yn = R({}, [...Zt, ...hr]), Rs = /* @__PURE__ */ p(function(i) {
|
|
848
848
|
let h = se(i);
|
|
@@ -917,7 +917,7 @@ function ps() {
|
|
|
917
917
|
null
|
|
918
918
|
);
|
|
919
919
|
}, "_createNodeIterator"), Gt = /* @__PURE__ */ p(function(i) {
|
|
920
|
-
return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof
|
|
920
|
+
return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof m) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
|
|
921
921
|
}, "_isClobbered"), jt = /* @__PURE__ */ p(function(i) {
|
|
922
922
|
return typeof o == "function" && i instanceof o;
|
|
923
923
|
}, "_isNode");
|
|
@@ -937,8 +937,8 @@ function ps() {
|
|
|
937
937
|
allowedTags: F
|
|
938
938
|
}), Je && i.hasChildNodes() && !jt(i.firstElementChild) && V(/<[/\w!]/g, i.innerHTML) && V(/<[/\w!]/g, i.textContent) || Je && i.namespaceURI === ge && b === "style" && jt(i.firstElementChild) || i.nodeType === at.progressingInstruction || Je && i.nodeType === at.comment && V(/<[/\w]/g, i.data))
|
|
939
939
|
return ue(i), !0;
|
|
940
|
-
if (
|
|
941
|
-
if (!
|
|
940
|
+
if (w[b] || !(N.tagCheck instanceof Function && N.tagCheck(b)) && !F[b]) {
|
|
941
|
+
if (!w[b] && _n(b) && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, b) || f.tagNameCheck instanceof Function && f.tagNameCheck(b)))
|
|
942
942
|
return !1;
|
|
943
943
|
if (zt && !fe[b]) {
|
|
944
944
|
const P = se(i) || i.parentNode, Z = oe(i) || i.childNodes;
|
|
@@ -1036,8 +1036,8 @@ function ps() {
|
|
|
1036
1036
|
Ie(G, i);
|
|
1037
1037
|
continue;
|
|
1038
1038
|
}
|
|
1039
|
-
if (O && typeof
|
|
1040
|
-
switch (
|
|
1039
|
+
if (O && typeof x == "object" && typeof x.getAttributeType == "function" && !J)
|
|
1040
|
+
switch (x.getAttributeType(In, he)) {
|
|
1041
1041
|
case "TrustedHTML": {
|
|
1042
1042
|
q = O.createHTML(q);
|
|
1043
1043
|
break;
|
|
@@ -1072,7 +1072,7 @@ function ps() {
|
|
|
1072
1072
|
const ae = S.nodeName;
|
|
1073
1073
|
if (typeof ae == "string") {
|
|
1074
1074
|
const he = W(ae);
|
|
1075
|
-
if (!F[he] ||
|
|
1075
|
+
if (!F[he] || w[he])
|
|
1076
1076
|
throw kt("root node is forbidden and cannot be sanitized in-place");
|
|
1077
1077
|
}
|
|
1078
1078
|
} else if (S instanceof o)
|
|
@@ -1299,27 +1299,27 @@ var We, St = (We = class {
|
|
|
1299
1299
|
else if (!o) d.push(n[c]);
|
|
1300
1300
|
else break;
|
|
1301
1301
|
n = n.slice(c);
|
|
1302
|
-
let
|
|
1303
|
-
`), u =
|
|
1302
|
+
let m = d.join(`
|
|
1303
|
+
`), u = m.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1304
1304
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1305
1305
|
r = r ? `${r}
|
|
1306
|
-
${
|
|
1306
|
+
${m}` : m, s = s ? `${s}
|
|
1307
1307
|
${u}` : u;
|
|
1308
1308
|
let g = this.lexer.state.top;
|
|
1309
1309
|
if (this.lexer.state.top = !0, this.lexer.blockTokens(u, l, !0), this.lexer.state.top = g, n.length === 0) break;
|
|
1310
|
-
let
|
|
1311
|
-
if (
|
|
1312
|
-
if (
|
|
1313
|
-
let
|
|
1310
|
+
let x = l.at(-1);
|
|
1311
|
+
if (x?.type === "code") break;
|
|
1312
|
+
if (x?.type === "blockquote") {
|
|
1313
|
+
let k = x, _ = k.raw + `
|
|
1314
1314
|
` + n.join(`
|
|
1315
1315
|
`), z = this.blockquote(_);
|
|
1316
|
-
l[l.length - 1] = z, r = r.substring(0, r.length -
|
|
1316
|
+
l[l.length - 1] = z, r = r.substring(0, r.length - k.raw.length) + z.raw, s = s.substring(0, s.length - k.text.length) + z.text;
|
|
1317
1317
|
break;
|
|
1318
|
-
} else if (
|
|
1319
|
-
let
|
|
1318
|
+
} else if (x?.type === "list") {
|
|
1319
|
+
let k = x, _ = k.raw + `
|
|
1320
1320
|
` + n.join(`
|
|
1321
1321
|
`), z = this.list(_);
|
|
1322
|
-
l[l.length - 1] = z, r = r.substring(0, r.length -
|
|
1322
|
+
l[l.length - 1] = z, r = r.substring(0, r.length - x.raw.length) + z.raw, s = s.substring(0, s.length - k.raw.length) + z.raw, n = _.substring(l.at(-1).raw.length).split(`
|
|
1323
1323
|
`);
|
|
1324
1324
|
continue;
|
|
1325
1325
|
}
|
|
@@ -1334,31 +1334,31 @@ ${u}` : u;
|
|
|
1334
1334
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
1335
1335
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1336
1336
|
for (; t; ) {
|
|
1337
|
-
let c = !1,
|
|
1337
|
+
let c = !1, m = "", u = "";
|
|
1338
1338
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1339
|
-
|
|
1339
|
+
m = e[0], t = t.substring(m.length);
|
|
1340
1340
|
let g = li(e[2].split(`
|
|
1341
|
-
`, 1)[0], e[1].length),
|
|
1342
|
-
`, 1)[0],
|
|
1343
|
-
if (this.options.pedantic ? (_ = 2, u = g.trimStart()) :
|
|
1344
|
-
`, t = t.substring(
|
|
1341
|
+
`, 1)[0], e[1].length), x = t.split(`
|
|
1342
|
+
`, 1)[0], k = !g.trim(), _ = 0;
|
|
1343
|
+
if (this.options.pedantic ? (_ = 2, u = g.trimStart()) : k ? _ = e[1].length + 1 : (_ = g.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, u = g.slice(_), _ += e[1].length), k && this.rules.other.blankLine.test(x) && (m += x + `
|
|
1344
|
+
`, t = t.substring(x.length + 1), c = !0), !c) {
|
|
1345
1345
|
let z = this.rules.other.nextBulletRegex(_), te = this.rules.other.hrRegex(_), oe = this.rules.other.fencesBeginRegex(_), se = this.rules.other.headingBeginRegex(_), O = this.rules.other.htmlBeginRegex(_), ce = this.rules.other.blockquoteBeginRegex(_);
|
|
1346
1346
|
for (; t; ) {
|
|
1347
1347
|
let re = t.split(`
|
|
1348
1348
|
`, 1)[0], ie;
|
|
1349
|
-
if (
|
|
1350
|
-
if (ie.search(this.rules.other.nonSpaceChar) >= _ || !
|
|
1349
|
+
if (x = re, this.options.pedantic ? (x = x.replace(this.rules.other.listReplaceNesting, " "), ie = x) : ie = x.replace(this.rules.other.tabCharGlobal, " "), oe.test(x) || se.test(x) || O.test(x) || ce.test(x) || z.test(x) || te.test(x)) break;
|
|
1350
|
+
if (ie.search(this.rules.other.nonSpaceChar) >= _ || !x.trim()) u += `
|
|
1351
1351
|
` + ie.slice(_);
|
|
1352
1352
|
else {
|
|
1353
|
-
if (
|
|
1353
|
+
if (k || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || oe.test(g) || se.test(g) || te.test(g)) break;
|
|
1354
1354
|
u += `
|
|
1355
|
-
` +
|
|
1355
|
+
` + x;
|
|
1356
1356
|
}
|
|
1357
|
-
|
|
1357
|
+
k = !x.trim(), m += re + `
|
|
1358
1358
|
`, t = t.substring(re.length + 1), g = ie.slice(_);
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1361
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(m) && (o = !0)), s.items.push({ type: "list_item", raw: m, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), s.raw += m;
|
|
1362
1362
|
}
|
|
1363
1363
|
let d = s.items.at(-1);
|
|
1364
1364
|
if (d) d.raw = d.raw.trimEnd(), d.text = d.text.trimEnd();
|
|
@@ -1373,20 +1373,20 @@ ${u}` : u;
|
|
|
1373
1373
|
break;
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
|
-
let
|
|
1377
|
-
if (
|
|
1378
|
-
let u = { type: "checkbox", raw:
|
|
1376
|
+
let m = this.rules.other.listTaskCheckbox.exec(c.raw);
|
|
1377
|
+
if (m) {
|
|
1378
|
+
let u = { type: "checkbox", raw: m[0] + " ", checked: m[0] !== "[ ]" };
|
|
1379
1379
|
c.checked = u.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = u.raw + c.tokens[0].raw, c.tokens[0].text = u.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(u)) : c.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : c.tokens.unshift(u);
|
|
1380
1380
|
}
|
|
1381
1381
|
}
|
|
1382
1382
|
if (!s.loose) {
|
|
1383
|
-
let
|
|
1383
|
+
let m = c.tokens.filter((g) => g.type === "space"), u = m.length > 0 && m.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
1384
1384
|
s.loose = u;
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
1387
|
if (s.loose) for (let c of s.items) {
|
|
1388
1388
|
c.loose = !0;
|
|
1389
|
-
for (let
|
|
1389
|
+
for (let m of c.tokens) m.type === "text" && (m.type = "paragraph");
|
|
1390
1390
|
}
|
|
1391
1391
|
return s;
|
|
1392
1392
|
}
|
|
@@ -1485,8 +1485,8 @@ ${u}` : u;
|
|
|
1485
1485
|
emStrong(t, e, n = "") {
|
|
1486
1486
|
let r = this.rules.inline.emStrongLDelim.exec(t);
|
|
1487
1487
|
if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1488
|
-
let s = [...r[0]].length - 1, l, o, d = s, c = 0,
|
|
1489
|
-
for (
|
|
1488
|
+
let s = [...r[0]].length - 1, l, o, d = s, c = 0, m = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1489
|
+
for (m.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = m.exec(e)) !== null; ) {
|
|
1490
1490
|
if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
|
|
1491
1491
|
if (o = [...l].length, r[3] || r[4]) {
|
|
1492
1492
|
d += o;
|
|
@@ -1499,11 +1499,11 @@ ${u}` : u;
|
|
|
1499
1499
|
o = Math.min(o, o + d + c);
|
|
1500
1500
|
let u = [...r[0]][0].length, g = t.slice(0, s + r.index + u + o);
|
|
1501
1501
|
if (Math.min(s, o) % 2) {
|
|
1502
|
-
let
|
|
1503
|
-
return { type: "em", raw: g, text:
|
|
1502
|
+
let k = g.slice(1, -1);
|
|
1503
|
+
return { type: "em", raw: g, text: k, tokens: this.lexer.inlineTokens(k) };
|
|
1504
1504
|
}
|
|
1505
|
-
let
|
|
1506
|
-
return { type: "strong", raw: g, text:
|
|
1505
|
+
let x = g.slice(2, -2);
|
|
1506
|
+
return { type: "strong", raw: g, text: x, tokens: this.lexer.inlineTokens(x) };
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
@@ -1530,7 +1530,7 @@ ${u}` : u;
|
|
|
1530
1530
|
}
|
|
1531
1531
|
if (d -= o, d > 0) continue;
|
|
1532
1532
|
o = Math.min(o, o + d);
|
|
1533
|
-
let
|
|
1533
|
+
let m = [...r[0]][0].length, u = t.slice(0, s + r.index + m + o), g = u.slice(s, -s);
|
|
1534
1534
|
return { type: "del", raw: u, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
@@ -1664,8 +1664,8 @@ ${u}` : u;
|
|
|
1664
1664
|
let l = t;
|
|
1665
1665
|
if (this.options.extensions?.startBlock) {
|
|
1666
1666
|
let o = 1 / 0, d = t.slice(1), c;
|
|
1667
|
-
this.options.extensions.startBlock.forEach((
|
|
1668
|
-
c =
|
|
1667
|
+
this.options.extensions.startBlock.forEach((m) => {
|
|
1668
|
+
c = m.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
1669
1669
|
}), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
|
|
1670
1670
|
}
|
|
1671
1671
|
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
|
|
@@ -1758,14 +1758,14 @@ ${u}` : u;
|
|
|
1758
1758
|
t = t.substring(c.raw.length), e.push(c);
|
|
1759
1759
|
continue;
|
|
1760
1760
|
}
|
|
1761
|
-
let
|
|
1761
|
+
let m = t;
|
|
1762
1762
|
if (this.options.extensions?.startInline) {
|
|
1763
|
-
let u = 1 / 0, g = t.slice(1),
|
|
1764
|
-
this.options.extensions.startInline.forEach((
|
|
1765
|
-
|
|
1766
|
-
}), u < 1 / 0 && u >= 0 && (
|
|
1763
|
+
let u = 1 / 0, g = t.slice(1), x;
|
|
1764
|
+
this.options.extensions.startInline.forEach((k) => {
|
|
1765
|
+
x = k.call({ lexer: this }, g), typeof x == "number" && x >= 0 && (u = Math.min(u, x));
|
|
1766
|
+
}), u < 1 / 0 && u >= 0 && (m = t.substring(0, u + 1));
|
|
1767
1767
|
}
|
|
1768
|
-
if (c = this.tokenizer.inlineText(
|
|
1768
|
+
if (c = this.tokenizer.inlineText(m)) {
|
|
1769
1769
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1770
1770
|
let u = e.at(-1);
|
|
1771
1771
|
u?.type === "text" ? (u.raw += c.raw, u.text += c.text) : e.push(c);
|
|
@@ -2169,9 +2169,9 @@ ${t}</tr>
|
|
|
2169
2169
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
2170
2170
|
if (["options", "parser"].includes(l)) continue;
|
|
2171
2171
|
let o = l, d = n.renderer[o], c = s[o];
|
|
2172
|
-
s[o] = (...
|
|
2173
|
-
let u = d.apply(s,
|
|
2174
|
-
return u === !1 && (u = c.apply(s,
|
|
2172
|
+
s[o] = (...m) => {
|
|
2173
|
+
let u = d.apply(s, m);
|
|
2174
|
+
return u === !1 && (u = c.apply(s, m)), u || "";
|
|
2175
2175
|
};
|
|
2176
2176
|
}
|
|
2177
2177
|
r.renderer = s;
|
|
@@ -2182,9 +2182,9 @@ ${t}</tr>
|
|
|
2182
2182
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2183
2183
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2184
2184
|
let o = l, d = n.tokenizer[o], c = s[o];
|
|
2185
|
-
s[o] = (...
|
|
2186
|
-
let u = d.apply(s,
|
|
2187
|
-
return u === !1 && (u = c.apply(s,
|
|
2185
|
+
s[o] = (...m) => {
|
|
2186
|
+
let u = d.apply(s, m);
|
|
2187
|
+
return u === !1 && (u = c.apply(s, m)), u;
|
|
2188
2188
|
};
|
|
2189
2189
|
}
|
|
2190
2190
|
r.tokenizer = s;
|
|
@@ -2195,20 +2195,20 @@ ${t}</tr>
|
|
|
2195
2195
|
if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
|
|
2196
2196
|
if (["options", "block"].includes(l)) continue;
|
|
2197
2197
|
let o = l, d = n.hooks[o], c = s[o];
|
|
2198
|
-
ut.passThroughHooks.has(l) ? s[o] = (
|
|
2198
|
+
ut.passThroughHooks.has(l) ? s[o] = (m) => {
|
|
2199
2199
|
if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2200
|
-
let g = await d.call(s,
|
|
2200
|
+
let g = await d.call(s, m);
|
|
2201
2201
|
return c.call(s, g);
|
|
2202
2202
|
})();
|
|
2203
|
-
let u = d.call(s,
|
|
2203
|
+
let u = d.call(s, m);
|
|
2204
2204
|
return c.call(s, u);
|
|
2205
|
-
} : s[o] = (...
|
|
2205
|
+
} : s[o] = (...m) => {
|
|
2206
2206
|
if (this.defaults.async) return (async () => {
|
|
2207
|
-
let g = await d.apply(s,
|
|
2208
|
-
return g === !1 && (g = await c.apply(s,
|
|
2207
|
+
let g = await d.apply(s, m);
|
|
2208
|
+
return g === !1 && (g = await c.apply(s, m)), g;
|
|
2209
2209
|
})();
|
|
2210
|
-
let u = d.apply(s,
|
|
2211
|
-
return u === !1 && (u = c.apply(s,
|
|
2210
|
+
let u = d.apply(s, m);
|
|
2211
|
+
return u === !1 && (u = c.apply(s, m)), u;
|
|
2212
2212
|
};
|
|
2213
2213
|
}
|
|
2214
2214
|
r.hooks = s;
|
|
@@ -2241,8 +2241,8 @@ ${t}</tr>
|
|
|
2241
2241
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2242
2242
|
let o = s.hooks ? await s.hooks.preprocess(e) : e, d = await (s.hooks ? await s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(d) : d;
|
|
2243
2243
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2244
|
-
let
|
|
2245
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
2244
|
+
let m = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
|
|
2245
|
+
return s.hooks ? await s.hooks.postprocess(m) : m;
|
|
2246
2246
|
})().catch(l);
|
|
2247
2247
|
try {
|
|
2248
2248
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
@@ -2371,7 +2371,7 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2371
2371
|
}), s.observe(n.value));
|
|
2372
2372
|
}), as(() => {
|
|
2373
2373
|
s?.disconnect();
|
|
2374
|
-
}), (c,
|
|
2374
|
+
}), (c, m) => (y(), T("div", {
|
|
2375
2375
|
ref_key: "viewport",
|
|
2376
2376
|
ref: e,
|
|
2377
2377
|
class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
@@ -2446,21 +2446,21 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2446
2446
|
), r = U(() => {
|
|
2447
2447
|
const C = { ...t[a.scope] };
|
|
2448
2448
|
return a.scope === "org" && a.scopeName && (C.label = a.scopeName, C.tooltip = `Visible to ${a.scopeName} members`), C;
|
|
2449
|
-
}), s = Y(""), l = Y(!1), o = Y(), d = Y(), c = Y(),
|
|
2449
|
+
}), s = Y(""), l = Y(!1), o = Y(), d = Y(), c = Y(), m = Y([]), u = Y(!1);
|
|
2450
2450
|
function g(C) {
|
|
2451
2451
|
return C ? /\[[^\]]+\]\([^)]+\)/.test(C) : !1;
|
|
2452
2452
|
}
|
|
2453
2453
|
p(g, "containsMarkdownLink");
|
|
2454
|
-
function
|
|
2455
|
-
const
|
|
2456
|
-
return !M || M.sender !==
|
|
2454
|
+
function x(C, f) {
|
|
2455
|
+
const w = C[f], M = C[f + 1];
|
|
2456
|
+
return !M || M.sender !== w.sender;
|
|
2457
2457
|
}
|
|
2458
|
-
p(
|
|
2459
|
-
const
|
|
2458
|
+
p(x, "shouldShowAvatar");
|
|
2459
|
+
const k = U(() => a.chatController?.textState.value), _ = U(() => k.value?.isConnected ?? !1), z = U(() => k.value?.isThinking ?? !1), te = U(() => k.value?.connectionStatus === "disconnected" && !!k.value?.error), oe = U(() => k.value?.connectionStatus !== "connected" && !k.value?.error), se = U(() => k.value?.error), O = U(() => a.chatController?.sharedMessages.value ?? []), ce = U(() => {
|
|
2460
2460
|
if (!z.value) return;
|
|
2461
2461
|
const C = O.value, f = C[C.length - 1];
|
|
2462
2462
|
return f?.sender === "agent" ? f.id : void 0;
|
|
2463
|
-
}), re = U(() => z.value ? ce.value === void 0 : !1), ie = U(() =>
|
|
2463
|
+
}), re = U(() => z.value ? ce.value === void 0 : !1), ie = U(() => k.value?.accountGated ?? !1), Ee = U(() => !_.value || ie.value), Ct = U(() => te.value ? "Agent is offline" : oe.value ? "Connecting..." : ie.value ? "Resolve the billing issue above to continue" : "Message"), pt = U(() => (s.value.trim() || m.value.length > 0) && !Ee.value && !u.value), A = U(() => a.variant === "light"), _e = U(
|
|
2464
2464
|
() => A.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2465
2465
|
), we = U(() => A.value ? "text-theme-300" : "text-white/30");
|
|
2466
2466
|
Et(async () => {
|
|
@@ -2471,11 +2471,11 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2471
2471
|
}
|
|
2472
2472
|
p(Oe, "startNewConversation");
|
|
2473
2473
|
async function Ke() {
|
|
2474
|
-
const C = s.value.trim(), f =
|
|
2474
|
+
const C = s.value.trim(), f = m.value.length > 0;
|
|
2475
2475
|
if (!C && !f || !a.chatController || !_.value || u.value)
|
|
2476
2476
|
return;
|
|
2477
|
-
const
|
|
2478
|
-
s.value = "",
|
|
2477
|
+
const w = s.value, M = f ? [...m.value] : void 0;
|
|
2478
|
+
s.value = "", m.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(w, M);
|
|
2479
2479
|
}
|
|
2480
2480
|
p(Ke, "sendMessage");
|
|
2481
2481
|
async function It(C) {
|
|
@@ -2495,12 +2495,12 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2495
2495
|
}
|
|
2496
2496
|
p(Mt, "triggerFileInput");
|
|
2497
2497
|
async function ft(C) {
|
|
2498
|
-
const f = C.target,
|
|
2499
|
-
if (!(!
|
|
2498
|
+
const f = C.target, w = f.files?.[0];
|
|
2499
|
+
if (!(!w || !a.uploadFn)) {
|
|
2500
2500
|
u.value = !0;
|
|
2501
2501
|
try {
|
|
2502
|
-
const M = await a.uploadFn(
|
|
2503
|
-
|
|
2502
|
+
const M = await a.uploadFn(w);
|
|
2503
|
+
m.value = [...m.value, M];
|
|
2504
2504
|
} catch (M) {
|
|
2505
2505
|
const N = M instanceof Error ? M.message : "Couldn't attach that file.";
|
|
2506
2506
|
a.chatController?.notify(`Upload failed — ${N}`);
|
|
@@ -2511,7 +2511,7 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2511
2511
|
}
|
|
2512
2512
|
p(ft, "handleFileSelect");
|
|
2513
2513
|
function F(C) {
|
|
2514
|
-
|
|
2514
|
+
m.value = m.value.filter((f, w) => w !== C);
|
|
2515
2515
|
}
|
|
2516
2516
|
p(F, "removeAttachment");
|
|
2517
2517
|
function Qe(C, f) {
|
|
@@ -2519,17 +2519,17 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2519
2519
|
const Pe = C[f];
|
|
2520
2520
|
return Pe?.timestamp ? H(new Date(Pe.timestamp)) : null;
|
|
2521
2521
|
}
|
|
2522
|
-
const
|
|
2523
|
-
if (!
|
|
2524
|
-
const N = new Date(
|
|
2522
|
+
const w = C[f - 1], M = C[f];
|
|
2523
|
+
if (!w?.timestamp || !M?.timestamp) return null;
|
|
2524
|
+
const N = new Date(w.timestamp).getTime();
|
|
2525
2525
|
return new Date(M.timestamp).getTime() - N > 36e5 ? H(new Date(M.timestamp)) : null;
|
|
2526
2526
|
}
|
|
2527
2527
|
p(Qe, "shouldShowTimeDivider");
|
|
2528
2528
|
function H(C) {
|
|
2529
|
-
const f = /* @__PURE__ */ new Date(),
|
|
2529
|
+
const f = /* @__PURE__ */ new Date(), w = C.toDateString() === f.toDateString(), M = new Date(f);
|
|
2530
2530
|
M.setDate(M.getDate() - 1);
|
|
2531
2531
|
const N = C.toDateString() === M.toDateString(), xe = C.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2532
|
-
if (
|
|
2532
|
+
if (w) return xe;
|
|
2533
2533
|
if (N) return `Yesterday, ${xe}`;
|
|
2534
2534
|
const ze = C.getFullYear() === f.getFullYear();
|
|
2535
2535
|
return `${C.toLocaleDateString("en-US", {
|
|
@@ -2594,13 +2594,13 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2594
2594
|
class: E(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
|
|
2595
2595
|
}, ne(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
|
|
2596
2596
|
n.value.length > 0 && !Ee.value ? (y(), T("div", ki, [
|
|
2597
|
-
(y(!0), T(ye, null, ot(n.value, (
|
|
2598
|
-
key:
|
|
2597
|
+
(y(!0), T(ye, null, ot(n.value, (w) => (y(), T("button", {
|
|
2598
|
+
key: w,
|
|
2599
2599
|
type: "button",
|
|
2600
2600
|
"data-test": "chat-starter-prompt",
|
|
2601
2601
|
class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", A.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"]),
|
|
2602
|
-
onClick: /* @__PURE__ */ p((M) => It(
|
|
2603
|
-
}, ne(
|
|
2602
|
+
onClick: /* @__PURE__ */ p((M) => It(w), "onClick")
|
|
2603
|
+
}, ne(w), 11, wi))), 128))
|
|
2604
2604
|
])) : B("", !0),
|
|
2605
2605
|
v("div", {
|
|
2606
2606
|
class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", A.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
@@ -2623,8 +2623,8 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2623
2623
|
v("span", null, "New chat", -1)
|
|
2624
2624
|
])], 2)
|
|
2625
2625
|
])) : B("", !0),
|
|
2626
|
-
(y(!0), T(ye, null, ot(O.value, (
|
|
2627
|
-
key:
|
|
2626
|
+
(y(!0), T(ye, null, ot(O.value, (w, M) => (y(), T(ye, {
|
|
2627
|
+
key: w.id
|
|
2628
2628
|
}, [
|
|
2629
2629
|
Qe(O.value, M) ? (y(), T("div", Ti, [
|
|
2630
2630
|
v("div", {
|
|
@@ -2637,46 +2637,46 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2637
2637
|
class: E(["flex-1 h-px", _e.value])
|
|
2638
2638
|
}, null, 2)
|
|
2639
2639
|
])) : B("", !0),
|
|
2640
|
-
|
|
2640
|
+
w.sender === "system" ? (y(), T("div", {
|
|
2641
2641
|
key: 1,
|
|
2642
2642
|
"data-test": "messaging-system-msg",
|
|
2643
|
-
"data-issue-code":
|
|
2644
|
-
"data-issue-bucket":
|
|
2643
|
+
"data-issue-code": w.issue?.code,
|
|
2644
|
+
"data-issue-bucket": w.issue?.bucket,
|
|
2645
2645
|
class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", A.value ? "text-theme-500" : "text-white/70"])
|
|
2646
2646
|
}, [
|
|
2647
2647
|
v("i", {
|
|
2648
|
-
class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0",
|
|
2648
|
+
class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", w.issue?.bucket === "account" ? A.value ? "text-amber-500" : "text-amber-300" : A.value ? "text-red-500" : "text-red-300"])
|
|
2649
2649
|
}, null, 2),
|
|
2650
2650
|
v("div", Ai, [
|
|
2651
2651
|
Fe(ns, {
|
|
2652
|
-
text:
|
|
2652
|
+
text: w.text,
|
|
2653
2653
|
inverted: !A.value
|
|
2654
2654
|
}, null, 8, ["text", "inverted"]),
|
|
2655
|
-
|
|
2655
|
+
w.issue?.help ? (y(), T("span", {
|
|
2656
2656
|
key: 0,
|
|
2657
2657
|
class: E(["text-[12px]", A.value ? "text-theme-400" : "text-white/55"])
|
|
2658
|
-
}, ne(
|
|
2659
|
-
|
|
2658
|
+
}, ne(w.issue.help), 3)) : B("", !0),
|
|
2659
|
+
w.issue?.actionUrl && !g(w.text) ? (y(), T("a", {
|
|
2660
2660
|
key: 1,
|
|
2661
|
-
href:
|
|
2661
|
+
href: w.issue.actionUrl,
|
|
2662
2662
|
"data-test": "messaging-system-msg-action",
|
|
2663
2663
|
class: E(["text-[12px] font-medium inline-flex items-center gap-1", A.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
|
|
2664
2664
|
}, [
|
|
2665
|
-
nt(ne(
|
|
2665
|
+
nt(ne(w.issue.actionLabel) + " ", 1),
|
|
2666
2666
|
f[9] || (f[9] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2667
2667
|
], 10, Ei)) : B("", !0)
|
|
2668
2668
|
])
|
|
2669
2669
|
], 10, Si)) : (y(), T("div", {
|
|
2670
2670
|
key: 2,
|
|
2671
|
-
"data-test":
|
|
2671
|
+
"data-test": w.sender === "agent" ? "messaging-assistant-msg" : w.sender === "user" ? "messaging-user-msg" : void 0,
|
|
2672
2672
|
class: E(["flex gap-2 items-end", {
|
|
2673
|
-
"justify-end":
|
|
2674
|
-
"justify-start":
|
|
2675
|
-
"mb-4":
|
|
2673
|
+
"justify-end": w.sender === "user",
|
|
2674
|
+
"justify-start": w.sender === "agent",
|
|
2675
|
+
"mb-4": x(O.value, M)
|
|
2676
2676
|
}])
|
|
2677
2677
|
}, [
|
|
2678
|
-
|
|
2679
|
-
|
|
2678
|
+
w.sender === "agent" ? (y(), T("div", Ri, [
|
|
2679
|
+
x(O.value, M) ? (y(), T("img", {
|
|
2680
2680
|
key: 0,
|
|
2681
2681
|
src: a.agent.avatarUrl.value,
|
|
2682
2682
|
alt: a.agent.displayName.value,
|
|
@@ -2684,13 +2684,13 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2684
2684
|
}, null, 10, Ci)) : B("", !0)
|
|
2685
2685
|
])) : B("", !0),
|
|
2686
2686
|
v("div", {
|
|
2687
|
-
class: E(
|
|
2687
|
+
class: E(w.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2688
2688
|
}, [
|
|
2689
|
-
|
|
2689
|
+
w.attachments?.length ? (y(), T("div", {
|
|
2690
2690
|
key: 0,
|
|
2691
|
-
class: E(["mb-1 space-y-1",
|
|
2691
|
+
class: E(["mb-1 space-y-1", w.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2692
2692
|
}, [
|
|
2693
|
-
(y(!0), T(ye, null, ot(
|
|
2693
|
+
(y(!0), T(ye, null, ot(w.attachments, (N, xe) => (y(), T(ye, { key: xe }, [
|
|
2694
2694
|
N.type === "image" ? (y(), T("img", {
|
|
2695
2695
|
key: 0,
|
|
2696
2696
|
src: N.url,
|
|
@@ -2713,16 +2713,16 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2713
2713
|
], 10, Mi))
|
|
2714
2714
|
], 64))), 128))
|
|
2715
2715
|
], 2)) : B("", !0),
|
|
2716
|
-
|
|
2716
|
+
w.text ? (y(), T("div", {
|
|
2717
2717
|
key: 1,
|
|
2718
2718
|
class: E(["rounded-2xl px-3.5 py-2", [
|
|
2719
|
-
|
|
2719
|
+
w.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : A.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
|
|
2720
2720
|
]])
|
|
2721
2721
|
}, [
|
|
2722
2722
|
Fe(ns, {
|
|
2723
|
-
text:
|
|
2724
|
-
inverted:
|
|
2725
|
-
streaming:
|
|
2723
|
+
text: w.text,
|
|
2724
|
+
inverted: w.sender === "user" || !A.value,
|
|
2725
|
+
streaming: w.id === ce.value,
|
|
2726
2726
|
onClick: f[0] || (f[0] = Ls(() => {
|
|
2727
2727
|
}, ["stop"]))
|
|
2728
2728
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
@@ -2751,22 +2751,22 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2751
2751
|
v("div", {
|
|
2752
2752
|
class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", A.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2753
2753
|
}, [
|
|
2754
|
-
|
|
2755
|
-
(y(!0), T(ye, null, ot(
|
|
2754
|
+
m.value.length > 0 ? (y(), T("div", zi, [
|
|
2755
|
+
(y(!0), T(ye, null, ot(m.value, (w, M) => (y(), T("div", {
|
|
2756
2756
|
key: M,
|
|
2757
2757
|
class: "relative shrink-0 group"
|
|
2758
2758
|
}, [
|
|
2759
|
-
|
|
2759
|
+
w.type === "image" ? (y(), T("img", {
|
|
2760
2760
|
key: 0,
|
|
2761
|
-
src:
|
|
2762
|
-
alt:
|
|
2761
|
+
src: w.url,
|
|
2762
|
+
alt: w.name,
|
|
2763
2763
|
class: E(["size-14 rounded-xl object-cover border", A.value ? "border-black/10" : "border-white/20"])
|
|
2764
2764
|
}, null, 10, Pi)) : (y(), T("div", {
|
|
2765
2765
|
key: 1,
|
|
2766
2766
|
class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", A.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2767
2767
|
}, [
|
|
2768
2768
|
f[11] || (f[11] = v("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2769
|
-
v("span", Ni, ne(
|
|
2769
|
+
v("span", Ni, ne(w.name), 1)
|
|
2770
2770
|
], 2)),
|
|
2771
2771
|
v("button", {
|
|
2772
2772
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
|
|
@@ -2798,14 +2798,14 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2798
2798
|
u.value ? "opacity-50 pointer-events-none" : ""
|
|
2799
2799
|
]]),
|
|
2800
2800
|
disabled: Ee.value || u.value || !a.uploadFn,
|
|
2801
|
-
onClick: f[1] || (f[1] = (
|
|
2801
|
+
onClick: f[1] || (f[1] = (w) => a.uploadFn && Mt())
|
|
2802
2802
|
}, [
|
|
2803
2803
|
u.value ? (y(), T("i", Fi)) : (y(), T("i", Hi))
|
|
2804
2804
|
], 10, Bi),
|
|
2805
2805
|
ss(v("textarea", {
|
|
2806
2806
|
ref_key: "textarea",
|
|
2807
2807
|
ref: d,
|
|
2808
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
2808
|
+
"onUpdate:modelValue": f[2] || (f[2] = (w) => s.value = w),
|
|
2809
2809
|
"data-test": "messaging-input",
|
|
2810
2810
|
rows: "1",
|
|
2811
2811
|
enterkeyhint: "send",
|
|
@@ -2814,8 +2814,8 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2814
2814
|
style: { fontSize: "16px", resize: "none" },
|
|
2815
2815
|
class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", A.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2816
2816
|
onKeydown: Dt,
|
|
2817
|
-
onFocus: f[3] || (f[3] = (
|
|
2818
|
-
onBlur: f[4] || (f[4] = (
|
|
2817
|
+
onFocus: f[3] || (f[3] = (w) => l.value = !0),
|
|
2818
|
+
onBlur: f[4] || (f[4] = (w) => l.value = !1)
|
|
2819
2819
|
}, null, 42, Gi), [
|
|
2820
2820
|
[rs, s.value]
|
|
2821
2821
|
]),
|
|
@@ -2823,7 +2823,7 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
|
|
|
2823
2823
|
"data-test": "messaging-send-btn",
|
|
2824
2824
|
class: E(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", pt.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : A.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
2825
2825
|
disabled: !pt.value,
|
|
2826
|
-
onClick: f[5] || (f[5] = (
|
|
2826
|
+
onClick: f[5] || (f[5] = (w) => Ke())
|
|
2827
2827
|
}, [...f[13] || (f[13] = [
|
|
2828
2828
|
v("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2829
2829
|
])], 10, ji)
|