bstp-agent-widget 0.2.46 → 0.2.48
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/agent-widget.js +83 -62
- package/dist/agent-widget.js.map +1 -1
- package/dist/bstp-agent-widget.css +1 -1
- package/package.json +1 -1
- package/src/lib/index.d.ts +4 -0
package/dist/agent-widget.js
CHANGED
|
@@ -15691,12 +15691,15 @@ var ub = ({ ...e }) => {
|
|
|
15691
15691
|
};
|
|
15692
15692
|
ub.Body = cb, ub.Footer = lb;
|
|
15693
15693
|
var db = {
|
|
15694
|
-
root: "
|
|
15695
|
-
inner: "
|
|
15696
|
-
content: "
|
|
15697
|
-
header: "
|
|
15698
|
-
|
|
15699
|
-
|
|
15694
|
+
root: "_root_1i7u8_1",
|
|
15695
|
+
inner: "_inner_1i7u8_6",
|
|
15696
|
+
content: "_content_1i7u8_12",
|
|
15697
|
+
header: "_header_1i7u8_20",
|
|
15698
|
+
headerMeta: "_headerMeta_1i7u8_32",
|
|
15699
|
+
statusDot: "_statusDot_1i7u8_39",
|
|
15700
|
+
topSubHeader: "_topSubHeader_1i7u8_46",
|
|
15701
|
+
body: "_body_1i7u8_57",
|
|
15702
|
+
title: "_title_1i7u8_62"
|
|
15700
15703
|
};
|
|
15701
15704
|
//#endregion
|
|
15702
15705
|
//#region node_modules/marked/lib/marked.esm.js
|
|
@@ -23747,8 +23750,8 @@ function YO({ ...e }) {
|
|
|
23747
23750
|
}
|
|
23748
23751
|
//#endregion
|
|
23749
23752
|
//#region src/components/AgentChat/AgentChatDrawer.tsx
|
|
23750
|
-
function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0 }) {
|
|
23751
|
-
let
|
|
23753
|
+
function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1 }) {
|
|
23754
|
+
let A = Math.max(280, S + b.offset), j = _.hasCustomerToken && _.hasGenaiToken;
|
|
23752
23755
|
return f(() => {
|
|
23753
23756
|
if (typeof document > "u") return;
|
|
23754
23757
|
let t = document.documentElement;
|
|
@@ -23756,13 +23759,13 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23756
23759
|
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23757
23760
|
return;
|
|
23758
23761
|
}
|
|
23759
|
-
return t.style.setProperty("--agent-widget-drawer-width", `${
|
|
23762
|
+
return t.style.setProperty("--agent-widget-drawer-width", `${A}px`), () => {
|
|
23760
23763
|
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23761
23764
|
};
|
|
23762
|
-
}, [e,
|
|
23765
|
+
}, [e, A]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
|
|
23763
23766
|
opened: e,
|
|
23764
23767
|
onClose: t,
|
|
23765
|
-
size:
|
|
23768
|
+
size: A,
|
|
23766
23769
|
zIndex: n,
|
|
23767
23770
|
withinPortal: r,
|
|
23768
23771
|
overlayProps: i ? {
|
|
@@ -23784,32 +23787,47 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23784
23787
|
},
|
|
23785
23788
|
styles: { content: {
|
|
23786
23789
|
marginTop: C,
|
|
23787
|
-
|
|
23790
|
+
marginRight: D,
|
|
23791
|
+
height: `calc(100dvh - ${C}px)`,
|
|
23792
|
+
borderRadius: O,
|
|
23793
|
+
boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none"
|
|
23788
23794
|
} },
|
|
23789
|
-
title: /* @__PURE__ */
|
|
23790
|
-
|
|
23791
|
-
|
|
23792
|
-
|
|
23793
|
-
|
|
23794
|
-
|
|
23795
|
-
|
|
23796
|
-
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23801
|
-
|
|
23802
|
-
|
|
23803
|
-
children: _.hasCustomerToken ? "cust✓" : "cust✗"
|
|
23804
|
-
}),
|
|
23805
|
-
/* @__PURE__ */ T(Xd, {
|
|
23806
|
-
size: "xs",
|
|
23807
|
-
c: _.hasGenaiToken ? "green" : "red",
|
|
23808
|
-
children: _.hasGenaiToken ? "genai✓" : "genai✗"
|
|
23809
|
-
})
|
|
23810
|
-
]
|
|
23811
|
-
}) }),
|
|
23795
|
+
title: /* @__PURE__ */ E(Y, { children: [/* @__PURE__ */ T(Xd, {
|
|
23796
|
+
className: db.title,
|
|
23797
|
+
children: g
|
|
23798
|
+
}), /* @__PURE__ */ E(Y, {
|
|
23799
|
+
className: db.headerMeta,
|
|
23800
|
+
children: [/* @__PURE__ */ T(Y, {
|
|
23801
|
+
className: db.statusDot,
|
|
23802
|
+
style: { background: j ? "#22c55e" : "#ef4444" }
|
|
23803
|
+
}), /* @__PURE__ */ E(Xd, {
|
|
23804
|
+
size: "10",
|
|
23805
|
+
c: "dimmed",
|
|
23806
|
+
children: [j ? "Online" : "Offline", " · Billing Intelligence"]
|
|
23807
|
+
})]
|
|
23808
|
+
})] }),
|
|
23812
23809
|
children: [
|
|
23810
|
+
/* @__PURE__ */ E(Y, {
|
|
23811
|
+
className: db.topSubHeader,
|
|
23812
|
+
children: [/* @__PURE__ */ T(Xd, {
|
|
23813
|
+
size: "10",
|
|
23814
|
+
fw: 700,
|
|
23815
|
+
c: "white",
|
|
23816
|
+
children: "Exceeder SelfCare agent"
|
|
23817
|
+
}), /* @__PURE__ */ E(kl, {
|
|
23818
|
+
gap: 8,
|
|
23819
|
+
wrap: "nowrap",
|
|
23820
|
+
children: [/* @__PURE__ */ T(Xd, {
|
|
23821
|
+
size: "10",
|
|
23822
|
+
c: _.hasCustomerToken ? "white" : "rgba(255,255,255,0.65)",
|
|
23823
|
+
children: "Billing Dispute"
|
|
23824
|
+
}), /* @__PURE__ */ T(Xd, {
|
|
23825
|
+
size: "10",
|
|
23826
|
+
c: _.hasGenaiToken ? "white" : "rgba(255,255,255,0.65)",
|
|
23827
|
+
children: "Active"
|
|
23828
|
+
})]
|
|
23829
|
+
})]
|
|
23830
|
+
}),
|
|
23813
23831
|
/* @__PURE__ */ E(ub.Body, { children: [l && /* @__PURE__ */ T(Xd, {
|
|
23814
23832
|
size: "xs",
|
|
23815
23833
|
c: "red",
|
|
@@ -29120,59 +29138,62 @@ var XF = 1e4, ZF = {
|
|
|
29120
29138
|
};
|
|
29121
29139
|
function QF({ ui: e }) {
|
|
29122
29140
|
YF();
|
|
29123
|
-
let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = {
|
|
29141
|
+
let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = e?.drawerRightOffset ?? 0, u = e?.drawerBorderRadius ?? 0, d = e?.drawerShadow ?? !1, f = {
|
|
29124
29142
|
bottom: e?.fabBottomOffset ?? ZF.bottom,
|
|
29125
29143
|
right: e?.fabRightOffset ?? ZF.right
|
|
29126
|
-
}, { messages:
|
|
29144
|
+
}, { messages: p, composerText: m, setComposerText: h, isLoading: g, error: v, sendMessage: y, sendInitialMessage: b, canSend: x } = zF(), { runtimeInfo: S, refreshRuntimeInfo: C } = BF(), D = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), O = VF({ axis: "y" }), k = VF({
|
|
29127
29145
|
axis: "x",
|
|
29128
29146
|
direction: -1
|
|
29129
|
-
}),
|
|
29147
|
+
}), A = UF([p.length, g]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = WF({
|
|
29130
29148
|
lang: GF(),
|
|
29131
29149
|
continuous: !0,
|
|
29132
29150
|
pauseOnSubmit: !0,
|
|
29133
|
-
onTextChange:
|
|
29134
|
-
}),
|
|
29151
|
+
onTextChange: h
|
|
29152
|
+
}), ee = _(() => /* @__PURE__ */ T(Xd, {
|
|
29135
29153
|
fw: 800,
|
|
29136
|
-
children: "Agent Chat"
|
|
29137
|
-
}), []),
|
|
29138
|
-
n(), await
|
|
29154
|
+
children: e?.drawerTitle ?? e?.fabButtonLabel ?? "Agent Chat"
|
|
29155
|
+
}), [e?.drawerTitle, e?.fabButtonLabel]), te = async () => {
|
|
29156
|
+
n(), await C(), await b();
|
|
29139
29157
|
};
|
|
29140
29158
|
return /* @__PURE__ */ E(w, { children: [!t && /* @__PURE__ */ T(nk, {
|
|
29141
|
-
onClick: () => void
|
|
29159
|
+
onClick: () => void te(),
|
|
29142
29160
|
zIndex: i,
|
|
29143
|
-
position:
|
|
29161
|
+
position: f,
|
|
29144
29162
|
color: e?.accentColor,
|
|
29145
29163
|
label: e?.fabButtonLabel
|
|
29146
29164
|
}), /* @__PURE__ */ T(XO, {
|
|
29147
29165
|
opened: t,
|
|
29148
29166
|
onClose: () => {
|
|
29149
|
-
|
|
29167
|
+
j && P(), r();
|
|
29150
29168
|
},
|
|
29151
29169
|
zIndex: i,
|
|
29152
29170
|
withinPortal: a,
|
|
29153
29171
|
withOverlay: o,
|
|
29154
29172
|
topOffset: c,
|
|
29155
29173
|
drawerBaseWidth: s,
|
|
29156
|
-
|
|
29157
|
-
|
|
29158
|
-
|
|
29159
|
-
|
|
29160
|
-
|
|
29161
|
-
|
|
29174
|
+
drawerRightOffset: l,
|
|
29175
|
+
drawerBorderRadius: u,
|
|
29176
|
+
drawerShadow: d,
|
|
29177
|
+
messages: p,
|
|
29178
|
+
composerText: m,
|
|
29179
|
+
onComposerTextChange: h,
|
|
29180
|
+
isLoading: g,
|
|
29181
|
+
error: v,
|
|
29182
|
+
canSend: x,
|
|
29162
29183
|
onSubmit: () => {
|
|
29163
|
-
|
|
29184
|
+
j && P(), F(), y(m);
|
|
29164
29185
|
},
|
|
29165
|
-
isListening:
|
|
29166
|
-
isVoiceSupported:
|
|
29186
|
+
isListening: j,
|
|
29187
|
+
isVoiceSupported: M,
|
|
29167
29188
|
onToggleVoice: () => {
|
|
29168
|
-
|
|
29189
|
+
j ? P() : (h(""), N());
|
|
29169
29190
|
},
|
|
29170
|
-
drawerTitle:
|
|
29171
|
-
runtimeInfo:
|
|
29172
|
-
scrollViewportRef:
|
|
29173
|
-
drawerDraggable:
|
|
29174
|
-
drawerResizableWidth:
|
|
29175
|
-
drawerResizableHeight:
|
|
29191
|
+
drawerTitle: ee,
|
|
29192
|
+
runtimeInfo: S,
|
|
29193
|
+
scrollViewportRef: A,
|
|
29194
|
+
drawerDraggable: D,
|
|
29195
|
+
drawerResizableWidth: k,
|
|
29196
|
+
drawerResizableHeight: O
|
|
29176
29197
|
})] });
|
|
29177
29198
|
}
|
|
29178
29199
|
//#endregion
|