@botpress/webchat 1.3.5 → 1.3.6
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/.turbo/turbo-build.log +5 -5
- package/dist/components/Composer.d.ts +1 -1
- package/dist/components/Header.d.ts +2 -1
- package/dist/index.js +213 -210
- package/dist/index.umd.cjs +94 -94
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -858,7 +858,7 @@ function J5(e, t) {
|
|
|
858
858
|
() => e.dispatchEvent(t)
|
|
859
859
|
);
|
|
860
860
|
}
|
|
861
|
-
const _k = "Avatar", [Q5,
|
|
861
|
+
const _k = "Avatar", [Q5, $xe] = n_(_k), [X5, wk] = Q5(_k), xk = /* @__PURE__ */ It((e, t) => {
|
|
862
862
|
const { __scopeAvatar: n, ...r } = e, [i, a] = At("idle");
|
|
863
863
|
return /* @__PURE__ */ en(X5, {
|
|
864
864
|
scope: n,
|
|
@@ -43953,7 +43953,7 @@ class oL extends i_ {
|
|
|
43953
43953
|
}, this._state;
|
|
43954
43954
|
}
|
|
43955
43955
|
}
|
|
43956
|
-
const
|
|
43956
|
+
const y1e = ({
|
|
43957
43957
|
clientId: e,
|
|
43958
43958
|
apiUrl: t = "https://webchat.botpress.cloud",
|
|
43959
43959
|
mode: n = "pushpin"
|
|
@@ -43983,33 +43983,35 @@ const g1e = ({
|
|
|
43983
43983
|
};
|
|
43984
43984
|
return /* @__PURE__ */ Q.jsx(MA.Provider, { value: { value: a, setValue: o, historyIndex: s, setHistoryIndex: u, sendMessage: c }, children: /* @__PURE__ */ Q.jsx("div", { "data-disabled": n.disableComposer, ...e, ...r == null ? void 0 : r.container, ref: t }) });
|
|
43985
43985
|
})
|
|
43986
|
-
), p_e = fu((
|
|
43986
|
+
), p_e = fu((e) => {
|
|
43987
43987
|
const {
|
|
43988
43988
|
state: t,
|
|
43989
|
-
theme: { composer: n }
|
|
43990
|
-
|
|
43989
|
+
theme: { composer: n },
|
|
43990
|
+
configuration: r
|
|
43991
|
+
} = _n(), { value: i, setValue: a, historyIndex: o, setHistoryIndex: s, sendMessage: u } = NA(), c = Mt(null), f = xo((m) => m.user), p = xo((m) => m.messageHistory);
|
|
43991
43992
|
return St(() => {
|
|
43992
|
-
|
|
43993
|
-
}, [
|
|
43993
|
+
c.current && (c.current.selectionStart = c.current.value.length, c.current.selectionEnd = c.current.value.length);
|
|
43994
|
+
}, [i]), /* @__PURE__ */ Q.jsx(
|
|
43994
43995
|
"textarea",
|
|
43995
43996
|
{
|
|
43996
43997
|
...n == null ? void 0 : n.input,
|
|
43998
|
+
placeholder: (r == null ? void 0 : r.composerPlaceholder) ?? "Type your message...",
|
|
43997
43999
|
disabled: t.disableComposer,
|
|
43998
|
-
ref:
|
|
43999
|
-
value:
|
|
44000
|
-
"data-has-value": !!
|
|
44001
|
-
onChange: (
|
|
44002
|
-
onKeyDown: (
|
|
44000
|
+
ref: c,
|
|
44001
|
+
value: i,
|
|
44002
|
+
"data-has-value": !!i,
|
|
44003
|
+
onChange: (m) => a(m.target.value),
|
|
44004
|
+
onKeyDown: (m) => {
|
|
44003
44005
|
if (!t.disableComposer) {
|
|
44004
|
-
if (
|
|
44005
|
-
|
|
44006
|
-
const
|
|
44007
|
-
|
|
44006
|
+
if (m.key === "Enter" && (m.preventDefault(), u()), m.key === "ArrowUp") {
|
|
44007
|
+
m.preventDefault();
|
|
44008
|
+
const h = p[(f == null ? void 0 : f.userId) ?? ""] ?? [];
|
|
44009
|
+
o < h.length - 1 && a(h[o + 1]), s(() => Math.min(o + 1, h.length - 1));
|
|
44008
44010
|
}
|
|
44009
|
-
if (
|
|
44010
|
-
|
|
44011
|
-
const
|
|
44012
|
-
|
|
44011
|
+
if (m.key === "ArrowDown") {
|
|
44012
|
+
m.preventDefault();
|
|
44013
|
+
const h = p[(f == null ? void 0 : f.userId) ?? ""] ?? [];
|
|
44014
|
+
a(o === 0 ? "" : h[o - 1]), s(() => Math.max(o - 1, -1));
|
|
44013
44015
|
}
|
|
44014
44016
|
}
|
|
44015
44017
|
},
|
|
@@ -44034,7 +44036,7 @@ const g1e = ({
|
|
|
44034
44036
|
/* @__PURE__ */ Q.jsx(Bs, { open: t, onOpenChange: n, children: /* @__PURE__ */ Q.jsx(Bs.Content, { title: r, children: a }) }),
|
|
44035
44037
|
e
|
|
44036
44038
|
] });
|
|
44037
|
-
},
|
|
44039
|
+
}, v1e = ({
|
|
44038
44040
|
theme: e = {},
|
|
44039
44041
|
renderers: t,
|
|
44040
44042
|
client: n,
|
|
@@ -45070,7 +45072,7 @@ var gwe = function(e) {
|
|
|
45070
45072
|
return null;
|
|
45071
45073
|
};
|
|
45072
45074
|
};
|
|
45073
|
-
const vL = "Dialog", [bL,
|
|
45075
|
+
const vL = "Dialog", [bL, b1e] = n_(vL), [_we, ao] = bL(vL), wwe = (e) => {
|
|
45074
45076
|
const { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s = Mt(null), u = Mt(null), [c = !1, f] = sL({
|
|
45075
45077
|
prop: r,
|
|
45076
45078
|
defaultProp: i,
|
|
@@ -45107,7 +45109,7 @@ const vL = "Dialog", [bL, v1e] = n_(vL), [_we, ao] = bL(vL), wwe = (e) => {
|
|
|
45107
45109
|
ref: a,
|
|
45108
45110
|
onClick: Ha(e.onClick, i.onOpenToggle)
|
|
45109
45111
|
}));
|
|
45110
|
-
}), Ewe = "DialogPortal", [
|
|
45112
|
+
}), Ewe = "DialogPortal", [_1e, _L] = bL(Ewe, {
|
|
45111
45113
|
forceMount: void 0
|
|
45112
45114
|
}), t_ = "DialogOverlay", Cwe = /* @__PURE__ */ It((e, t) => {
|
|
45113
45115
|
const n = _L(t_, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = ao(t_, e.__scopeDialog);
|
|
@@ -45306,12 +45308,12 @@ const zwe = It(({ children: e, ...t }, n) => {
|
|
|
45306
45308
|
] })
|
|
45307
45309
|
});
|
|
45308
45310
|
}, [t]), /* @__PURE__ */ Q.jsx(Q.Fragment, {});
|
|
45309
|
-
},
|
|
45311
|
+
}, w1e = It(({ children: e, onClick: t, ...n }, r) => {
|
|
45310
45312
|
const {
|
|
45311
45313
|
theme: { fab: i }
|
|
45312
45314
|
} = _n(), { container: a, icon: o } = i ?? {};
|
|
45313
45315
|
return /* @__PURE__ */ Q.jsx("div", { ...n, ...a, ref: r, onClick: t, children: /* @__PURE__ */ Q.jsx("div", { ...o }) });
|
|
45314
|
-
}), EL = "Collapsible", [Zwe,
|
|
45316
|
+
}), EL = "Collapsible", [Zwe, x1e] = n_(EL), [Wwe, xx] = Zwe(EL), Hwe = /* @__PURE__ */ It((e, t) => {
|
|
45315
45317
|
const { __scopeCollapsible: n, open: r, defaultOpen: i, disabled: a, onOpenChange: o, ...s } = e, [u = !1, c] = sL({
|
|
45316
45318
|
prop: r,
|
|
45317
45319
|
defaultProp: i,
|
|
@@ -45398,51 +45400,100 @@ const zwe = It(({ children: e, ...t }, n) => {
|
|
|
45398
45400
|
function Sx(e) {
|
|
45399
45401
|
return e ? "open" : "closed";
|
|
45400
45402
|
}
|
|
45401
|
-
const Jwe = Hwe, Qwe = Kwe, Xwe = Gwe, exe = (e) => /* @__PURE__ */ j.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 16 16", ...e }, /* @__PURE__ */ j.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667" })), txe =
|
|
45403
|
+
const Jwe = Hwe, Qwe = Kwe, Xwe = Gwe, exe = (e) => /* @__PURE__ */ j.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", viewBox: "0 0 16 16", ...e }, /* @__PURE__ */ j.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667" })), txe = ({ ...e }) => {
|
|
45404
|
+
var o, s;
|
|
45405
|
+
const {
|
|
45406
|
+
theme: { header: t, modal: n },
|
|
45407
|
+
client: r
|
|
45408
|
+
} = _n(), { showModal: i } = jA(), a = (u) => {
|
|
45409
|
+
var c, f, p, m;
|
|
45410
|
+
u.stopPropagation(), i({
|
|
45411
|
+
title: "Restart Conversation",
|
|
45412
|
+
content: /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
|
|
45413
|
+
/* @__PURE__ */ Q.jsx("p", { ...(f = (c = n == null ? void 0 : n.dialog) == null ? void 0 : c.newConversation) == null ? void 0 : f.text, children: "Are you sure you want to restart a new conversation?" }),
|
|
45414
|
+
/* @__PURE__ */ Q.jsx(Bs.Close, { asChild: !0, children: /* @__PURE__ */ Q.jsx("button", { ...(m = (p = n == null ? void 0 : n.dialog) == null ? void 0 : p.newConversation) == null ? void 0 : m.button, onClick: r == null ? void 0 : r.restartConversation, children: "Restart" }) })
|
|
45415
|
+
] })
|
|
45416
|
+
});
|
|
45417
|
+
};
|
|
45418
|
+
return /* @__PURE__ */ Q.jsx(
|
|
45419
|
+
v8,
|
|
45420
|
+
{
|
|
45421
|
+
...e,
|
|
45422
|
+
...(s = (o = t == null ? void 0 : t.content) == null ? void 0 : o.actions) == null ? void 0 : s.icons,
|
|
45423
|
+
role: "button",
|
|
45424
|
+
tabIndex: 0,
|
|
45425
|
+
onClick: a,
|
|
45426
|
+
onKeyDown: (u) => {
|
|
45427
|
+
u.key === "Enter" && a(u);
|
|
45428
|
+
}
|
|
45429
|
+
}
|
|
45430
|
+
);
|
|
45431
|
+
}, nxe = ({ ...e }) => {
|
|
45432
|
+
var i, a;
|
|
45433
|
+
const {
|
|
45434
|
+
theme: { header: t },
|
|
45435
|
+
closeWindow: n
|
|
45436
|
+
} = _n(), r = (o) => {
|
|
45437
|
+
o.stopPropagation(), n == null || n();
|
|
45438
|
+
};
|
|
45439
|
+
return /* @__PURE__ */ Q.jsx(
|
|
45440
|
+
SL,
|
|
45441
|
+
{
|
|
45442
|
+
...e,
|
|
45443
|
+
...(a = (i = t == null ? void 0 : t.content) == null ? void 0 : i.actions) == null ? void 0 : a.icons,
|
|
45444
|
+
role: "button",
|
|
45445
|
+
tabIndex: 0,
|
|
45446
|
+
onClick: r,
|
|
45447
|
+
onKeyDown: (o) => {
|
|
45448
|
+
o.key === "Enter" && r(o);
|
|
45449
|
+
}
|
|
45450
|
+
}
|
|
45451
|
+
);
|
|
45452
|
+
}, rxe = fu(
|
|
45402
45453
|
It(({ defaultOpen: e, ...t }, n) => {
|
|
45403
45454
|
const {
|
|
45404
45455
|
theme: { header: r }
|
|
45405
45456
|
} = _n(), [i, a] = At(!!e);
|
|
45406
45457
|
return /* @__PURE__ */ Q.jsx(Jwe, { open: i, onOpenChange: a, ...t, ...r == null ? void 0 : r.container, ref: n });
|
|
45407
45458
|
})
|
|
45408
|
-
),
|
|
45459
|
+
), ixe = It((e, t) => {
|
|
45409
45460
|
var r;
|
|
45410
45461
|
const {
|
|
45411
45462
|
theme: { header: n }
|
|
45412
45463
|
} = _n();
|
|
45413
45464
|
return /* @__PURE__ */ Q.jsx(Qwe, { ...e, ...(r = n == null ? void 0 : n.content) == null ? void 0 : r.container, ref: t });
|
|
45414
|
-
}),
|
|
45465
|
+
}), axe = It((e, t) => {
|
|
45415
45466
|
var r;
|
|
45416
45467
|
const {
|
|
45417
45468
|
theme: { header: n }
|
|
45418
45469
|
} = _n();
|
|
45419
45470
|
return /* @__PURE__ */ Q.jsx(Xwe, { ...e, ...(r = n == null ? void 0 : n.expandedContent) == null ? void 0 : r.container, ref: t });
|
|
45420
|
-
}),
|
|
45471
|
+
}), oxe = It(({ src: e, children: t }, n) => {
|
|
45421
45472
|
var a;
|
|
45422
45473
|
const {
|
|
45423
45474
|
theme: { header: r },
|
|
45424
45475
|
client: i
|
|
45425
45476
|
} = _n();
|
|
45426
45477
|
return /* @__PURE__ */ Q.jsx(Ok, { ref: n, userId: i == null ? void 0 : i.clientId, children: t, src: e, ...(a = r == null ? void 0 : r.content) == null ? void 0 : a.avatar });
|
|
45427
|
-
}),
|
|
45478
|
+
}), sxe = It((e, t) => {
|
|
45428
45479
|
var r;
|
|
45429
45480
|
const {
|
|
45430
45481
|
theme: { header: n }
|
|
45431
45482
|
} = _n();
|
|
45432
45483
|
return /* @__PURE__ */ Q.jsx("h2", { ...e, ...(r = n == null ? void 0 : n.content) == null ? void 0 : r.title, ref: t });
|
|
45433
|
-
}),
|
|
45484
|
+
}), lxe = It((e, t) => {
|
|
45434
45485
|
var r;
|
|
45435
45486
|
const {
|
|
45436
45487
|
theme: { header: n }
|
|
45437
45488
|
} = _n();
|
|
45438
45489
|
return /* @__PURE__ */ Q.jsx("p", { ...e, ...(r = n == null ? void 0 : n.content) == null ? void 0 : r.description, ref: t });
|
|
45439
|
-
}),
|
|
45490
|
+
}), uxe = It((e, t) => {
|
|
45440
45491
|
var r, i;
|
|
45441
45492
|
const {
|
|
45442
45493
|
theme: { header: n }
|
|
45443
45494
|
} = _n();
|
|
45444
45495
|
return /* @__PURE__ */ Q.jsx("div", { ...e, ...(i = (r = n == null ? void 0 : n.content) == null ? void 0 : r.actions) == null ? void 0 : i.container, ref: t });
|
|
45445
|
-
}),
|
|
45496
|
+
}), cxe = ({ icon: e, title: t, link: n, ...r }) => {
|
|
45446
45497
|
var s, u, c, f, p, m, h, y, v, x, b, w;
|
|
45447
45498
|
const {
|
|
45448
45499
|
theme: { header: i }
|
|
@@ -45476,15 +45527,76 @@ const Jwe = Hwe, Qwe = Kwe, Xwe = Gwe, exe = (e) => /* @__PURE__ */ j.createElem
|
|
|
45476
45527
|
]
|
|
45477
45528
|
}
|
|
45478
45529
|
);
|
|
45479
|
-
}, bi = Object.assign(
|
|
45480
|
-
Content:
|
|
45481
|
-
ExpandedContent:
|
|
45482
|
-
Avatar:
|
|
45483
|
-
Description:
|
|
45484
|
-
Title:
|
|
45485
|
-
Actions:
|
|
45486
|
-
DescriptionItem:
|
|
45487
|
-
}),
|
|
45530
|
+
}, bi = Object.assign(rxe, {
|
|
45531
|
+
Content: ixe,
|
|
45532
|
+
ExpandedContent: axe,
|
|
45533
|
+
Avatar: oxe,
|
|
45534
|
+
Description: lxe,
|
|
45535
|
+
Title: sxe,
|
|
45536
|
+
Actions: uxe,
|
|
45537
|
+
DescriptionItem: cxe
|
|
45538
|
+
}), dxe = () => {
|
|
45539
|
+
var r, i, a, o, s, u, c, f, p, m, h, y, v, x, b;
|
|
45540
|
+
const { configuration: e, closeWindow: t } = _n(), n = !!((r = e.email) != null && r.title) || !!((i = e.phone) != null && i.title) || !!((a = e.website) != null && a.title) || !!((o = e.termsOfService) != null && o.link) || !!((s = e.privacyPolicy) != null && s.link);
|
|
45541
|
+
return /* @__PURE__ */ Q.jsxs(bi, { open: n ? void 0 : !1, "data-disabled": n ? void 0 : "", children: [
|
|
45542
|
+
/* @__PURE__ */ Q.jsxs(bi.Content, { children: [
|
|
45543
|
+
/* @__PURE__ */ Q.jsx(bi.Avatar, { src: e.botAvatar, children: e.botName || "Bot" }),
|
|
45544
|
+
/* @__PURE__ */ Q.jsx(bi.Title, { children: e.botName || "Bot" }),
|
|
45545
|
+
/* @__PURE__ */ Q.jsx(bi.Description, { children: e.botDescription }),
|
|
45546
|
+
/* @__PURE__ */ Q.jsxs(bi.Actions, { children: [
|
|
45547
|
+
/* @__PURE__ */ Q.jsx(txe, {}),
|
|
45548
|
+
t && /* @__PURE__ */ Q.jsx(nxe, {})
|
|
45549
|
+
] })
|
|
45550
|
+
] }),
|
|
45551
|
+
/* @__PURE__ */ Q.jsxs(bi.ExpandedContent, { children: [
|
|
45552
|
+
/* @__PURE__ */ Q.jsx(
|
|
45553
|
+
bi.DescriptionItem,
|
|
45554
|
+
{
|
|
45555
|
+
"data-email": "",
|
|
45556
|
+
icon: xV,
|
|
45557
|
+
title: (u = e.email) == null ? void 0 : u.title,
|
|
45558
|
+
link: (c = e.email) == null ? void 0 : c.link
|
|
45559
|
+
}
|
|
45560
|
+
),
|
|
45561
|
+
/* @__PURE__ */ Q.jsx(
|
|
45562
|
+
bi.DescriptionItem,
|
|
45563
|
+
{
|
|
45564
|
+
"data-phone": "",
|
|
45565
|
+
icon: RV,
|
|
45566
|
+
title: (f = e.phone) == null ? void 0 : f.title,
|
|
45567
|
+
link: (p = e.phone) == null ? void 0 : p.link
|
|
45568
|
+
}
|
|
45569
|
+
),
|
|
45570
|
+
/* @__PURE__ */ Q.jsx(
|
|
45571
|
+
bi.DescriptionItem,
|
|
45572
|
+
{
|
|
45573
|
+
"data-website": "",
|
|
45574
|
+
link: (m = e.website) == null ? void 0 : m.link,
|
|
45575
|
+
icon: CV,
|
|
45576
|
+
title: (h = e.website) == null ? void 0 : h.title
|
|
45577
|
+
}
|
|
45578
|
+
),
|
|
45579
|
+
/* @__PURE__ */ Q.jsx(
|
|
45580
|
+
bi.DescriptionItem,
|
|
45581
|
+
{
|
|
45582
|
+
"data-terms": "",
|
|
45583
|
+
link: (y = e.termsOfService) == null ? void 0 : y.link,
|
|
45584
|
+
icon: bV,
|
|
45585
|
+
title: (v = e.termsOfService) == null ? void 0 : v.title
|
|
45586
|
+
}
|
|
45587
|
+
),
|
|
45588
|
+
/* @__PURE__ */ Q.jsx(
|
|
45589
|
+
bi.DescriptionItem,
|
|
45590
|
+
{
|
|
45591
|
+
"data-privacy": "",
|
|
45592
|
+
link: (x = e.privacyPolicy) == null ? void 0 : x.link,
|
|
45593
|
+
icon: kV,
|
|
45594
|
+
title: (b = e.privacyPolicy) == null ? void 0 : b.title
|
|
45595
|
+
}
|
|
45596
|
+
)
|
|
45597
|
+
] })
|
|
45598
|
+
] });
|
|
45599
|
+
}, fxe = fu(({ ...e }) => {
|
|
45488
45600
|
const {
|
|
45489
45601
|
theme: { loadingIndicator: t }
|
|
45490
45602
|
} = _n();
|
|
@@ -45814,8 +45926,8 @@ var OL = { exports: {} };
|
|
|
45814
45926
|
}, R.en = C[T], R.Ls = C, R.p = {}, R;
|
|
45815
45927
|
});
|
|
45816
45928
|
})(OL);
|
|
45817
|
-
var
|
|
45818
|
-
const ty = /* @__PURE__ */ Wo(
|
|
45929
|
+
var pxe = OL.exports;
|
|
45930
|
+
const ty = /* @__PURE__ */ Wo(pxe);
|
|
45819
45931
|
var TL = { exports: {} };
|
|
45820
45932
|
(function(e, t) {
|
|
45821
45933
|
(function(n, r) {
|
|
@@ -45829,8 +45941,8 @@ var TL = { exports: {} };
|
|
|
45829
45941
|
};
|
|
45830
45942
|
});
|
|
45831
45943
|
})(TL);
|
|
45832
|
-
var
|
|
45833
|
-
const
|
|
45944
|
+
var hxe = TL.exports;
|
|
45945
|
+
const mxe = /* @__PURE__ */ Wo(hxe);
|
|
45834
45946
|
var kL = { exports: {} };
|
|
45835
45947
|
(function(e, t) {
|
|
45836
45948
|
(function(n, r) {
|
|
@@ -45844,11 +45956,11 @@ var kL = { exports: {} };
|
|
|
45844
45956
|
};
|
|
45845
45957
|
});
|
|
45846
45958
|
})(kL);
|
|
45847
|
-
var
|
|
45848
|
-
const
|
|
45849
|
-
ty.extend(
|
|
45850
|
-
ty.extend(
|
|
45851
|
-
function
|
|
45959
|
+
var gxe = kL.exports;
|
|
45960
|
+
const yxe = /* @__PURE__ */ Wo(gxe);
|
|
45961
|
+
ty.extend(mxe);
|
|
45962
|
+
ty.extend(yxe);
|
|
45963
|
+
function vxe(e, t = "day") {
|
|
45852
45964
|
if (!e || e.length === 0)
|
|
45853
45965
|
return [];
|
|
45854
45966
|
const n = [];
|
|
@@ -45867,15 +45979,15 @@ function gk(e) {
|
|
|
45867
45979
|
timestamp: e,
|
|
45868
45980
|
block: {
|
|
45869
45981
|
type: "text",
|
|
45870
|
-
text:
|
|
45982
|
+
text: bxe(e)
|
|
45871
45983
|
}
|
|
45872
45984
|
};
|
|
45873
45985
|
}
|
|
45874
|
-
function
|
|
45986
|
+
function bxe(e, t = !1) {
|
|
45875
45987
|
const n = ty(e), r = "h:mma";
|
|
45876
45988
|
return n.isToday() ? t ? `Today • ${n.format(r)}` : "Today" : n.isYesterday() ? t ? `Yesterday • ${n.format(r)}` : "Yesterday" : t ? n.format(`YYYY-MM-DD • ${r}`) : n.format("YYYY-MM-DD");
|
|
45877
45989
|
}
|
|
45878
|
-
const yk = 10 * 1e3,
|
|
45990
|
+
const yk = 10 * 1e3, _xe = fu(({ scrollDownButton: e, ...t }) => {
|
|
45879
45991
|
var w, S, A, T, C, D, z, K;
|
|
45880
45992
|
const {
|
|
45881
45993
|
messages: n,
|
|
@@ -45884,7 +45996,7 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
45884
45996
|
configuration: a,
|
|
45885
45997
|
messageContainerRef: o,
|
|
45886
45998
|
theme: { messageList: s }
|
|
45887
|
-
} = _n(), u = Ts(() =>
|
|
45999
|
+
} = _n(), u = Ts(() => vxe(n), [n]), [c, f] = At(!0), { y: p } = zG(o), [m, h] = At(!1), [y, v] = ZG(), x = () => {
|
|
45888
46000
|
if (!o.current)
|
|
45889
46001
|
return;
|
|
45890
46002
|
const { scrollHeight: R } = o.current;
|
|
@@ -45932,129 +46044,19 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
45932
46044
|
] })
|
|
45933
46045
|
] }),
|
|
45934
46046
|
u.map((R, B) => /* @__PURE__ */ Q.jsx(mk, { scroll: x, ...R }, B)),
|
|
45935
|
-
m && /* @__PURE__ */ Q.jsx(mk, { scroll: x, direction: "incoming", children: /* @__PURE__ */ Q.jsx(
|
|
45936
|
-
] });
|
|
45937
|
-
}), vxe = ({ ...e }) => {
|
|
45938
|
-
var o, s;
|
|
45939
|
-
const {
|
|
45940
|
-
theme: { header: t, modal: n },
|
|
45941
|
-
client: r
|
|
45942
|
-
} = _n(), { showModal: i } = jA(), a = (u) => {
|
|
45943
|
-
var c, f, p, m;
|
|
45944
|
-
u.stopPropagation(), i({
|
|
45945
|
-
title: "Restart Conversation",
|
|
45946
|
-
content: /* @__PURE__ */ Q.jsxs(Q.Fragment, { children: [
|
|
45947
|
-
/* @__PURE__ */ Q.jsx("p", { ...(f = (c = n == null ? void 0 : n.dialog) == null ? void 0 : c.newConversation) == null ? void 0 : f.text, children: "Are you sure you want to restart a new conversation?" }),
|
|
45948
|
-
/* @__PURE__ */ Q.jsx(Bs.Close, { asChild: !0, children: /* @__PURE__ */ Q.jsx("button", { ...(m = (p = n == null ? void 0 : n.dialog) == null ? void 0 : p.newConversation) == null ? void 0 : m.button, onClick: r == null ? void 0 : r.restartConversation, children: "Restart" }) })
|
|
45949
|
-
] })
|
|
45950
|
-
});
|
|
45951
|
-
};
|
|
45952
|
-
return /* @__PURE__ */ Q.jsx(
|
|
45953
|
-
v8,
|
|
45954
|
-
{
|
|
45955
|
-
...e,
|
|
45956
|
-
...(s = (o = t == null ? void 0 : t.content) == null ? void 0 : o.actions) == null ? void 0 : s.icons,
|
|
45957
|
-
role: "button",
|
|
45958
|
-
tabIndex: 0,
|
|
45959
|
-
onClick: a,
|
|
45960
|
-
onKeyDown: (u) => {
|
|
45961
|
-
u.key === "Enter" && a(u);
|
|
45962
|
-
}
|
|
45963
|
-
}
|
|
45964
|
-
);
|
|
45965
|
-
}, bxe = ({ ...e }) => {
|
|
45966
|
-
var i, a;
|
|
45967
|
-
const {
|
|
45968
|
-
theme: { header: t },
|
|
45969
|
-
closeWindow: n
|
|
45970
|
-
} = _n(), r = (o) => {
|
|
45971
|
-
o.stopPropagation(), n == null || n();
|
|
45972
|
-
};
|
|
45973
|
-
return /* @__PURE__ */ Q.jsx(
|
|
45974
|
-
SL,
|
|
45975
|
-
{
|
|
45976
|
-
...e,
|
|
45977
|
-
...(a = (i = t == null ? void 0 : t.content) == null ? void 0 : i.actions) == null ? void 0 : a.icons,
|
|
45978
|
-
role: "button",
|
|
45979
|
-
tabIndex: 0,
|
|
45980
|
-
onClick: r,
|
|
45981
|
-
onKeyDown: (o) => {
|
|
45982
|
-
o.key === "Enter" && r(o);
|
|
45983
|
-
}
|
|
45984
|
-
}
|
|
45985
|
-
);
|
|
45986
|
-
}, x1e = () => {
|
|
45987
|
-
var r, i, a, o, s, u, c, f, p, m, h, y, v, x, b;
|
|
45988
|
-
const { configuration: e, closeWindow: t } = _n(), n = !!((r = e.email) != null && r.title) || !!((i = e.phone) != null && i.title) || !!((a = e.website) != null && a.title) || !!((o = e.termsOfService) != null && o.link) || !!((s = e.privacyPolicy) != null && s.link);
|
|
45989
|
-
return /* @__PURE__ */ Q.jsxs(zwe, { children: [
|
|
45990
|
-
/* @__PURE__ */ Q.jsxs(bi, { open: n ? void 0 : !1, "data-disabled": n ? void 0 : "", children: [
|
|
45991
|
-
/* @__PURE__ */ Q.jsxs(bi.Content, { children: [
|
|
45992
|
-
/* @__PURE__ */ Q.jsx(bi.Avatar, { src: e.botAvatar, children: e.botName || "Bot" }),
|
|
45993
|
-
/* @__PURE__ */ Q.jsx(bi.Title, { children: e.botName || "Bot" }),
|
|
45994
|
-
/* @__PURE__ */ Q.jsx(bi.Description, { children: e.botDescription }),
|
|
45995
|
-
/* @__PURE__ */ Q.jsxs(bi.Actions, { children: [
|
|
45996
|
-
/* @__PURE__ */ Q.jsx(vxe, {}),
|
|
45997
|
-
t && /* @__PURE__ */ Q.jsx(bxe, {})
|
|
45998
|
-
] })
|
|
45999
|
-
] }),
|
|
46000
|
-
/* @__PURE__ */ Q.jsxs(bi.ExpandedContent, { children: [
|
|
46001
|
-
/* @__PURE__ */ Q.jsx(
|
|
46002
|
-
bi.DescriptionItem,
|
|
46003
|
-
{
|
|
46004
|
-
"data-email": "",
|
|
46005
|
-
icon: xV,
|
|
46006
|
-
title: (u = e.email) == null ? void 0 : u.title,
|
|
46007
|
-
link: (c = e.email) == null ? void 0 : c.link
|
|
46008
|
-
}
|
|
46009
|
-
),
|
|
46010
|
-
/* @__PURE__ */ Q.jsx(
|
|
46011
|
-
bi.DescriptionItem,
|
|
46012
|
-
{
|
|
46013
|
-
"data-phone": "",
|
|
46014
|
-
icon: RV,
|
|
46015
|
-
title: (f = e.phone) == null ? void 0 : f.title,
|
|
46016
|
-
link: (p = e.phone) == null ? void 0 : p.link
|
|
46017
|
-
}
|
|
46018
|
-
),
|
|
46019
|
-
/* @__PURE__ */ Q.jsx(
|
|
46020
|
-
bi.DescriptionItem,
|
|
46021
|
-
{
|
|
46022
|
-
"data-website": "",
|
|
46023
|
-
link: (m = e.website) == null ? void 0 : m.link,
|
|
46024
|
-
icon: CV,
|
|
46025
|
-
title: (h = e.website) == null ? void 0 : h.title
|
|
46026
|
-
}
|
|
46027
|
-
),
|
|
46028
|
-
/* @__PURE__ */ Q.jsx(
|
|
46029
|
-
bi.DescriptionItem,
|
|
46030
|
-
{
|
|
46031
|
-
"data-terms": "",
|
|
46032
|
-
link: (y = e.termsOfService) == null ? void 0 : y.link,
|
|
46033
|
-
icon: bV,
|
|
46034
|
-
title: (v = e.termsOfService) == null ? void 0 : v.title
|
|
46035
|
-
}
|
|
46036
|
-
),
|
|
46037
|
-
/* @__PURE__ */ Q.jsx(
|
|
46038
|
-
bi.DescriptionItem,
|
|
46039
|
-
{
|
|
46040
|
-
"data-privacy": "",
|
|
46041
|
-
link: (x = e.privacyPolicy) == null ? void 0 : x.link,
|
|
46042
|
-
icon: kV,
|
|
46043
|
-
title: (b = e.privacyPolicy) == null ? void 0 : b.title
|
|
46044
|
-
}
|
|
46045
|
-
)
|
|
46046
|
-
] })
|
|
46047
|
-
] }),
|
|
46048
|
-
/* @__PURE__ */ Q.jsx(yxe, {}),
|
|
46049
|
-
/* @__PURE__ */ Q.jsxs(f_e, { children: [
|
|
46050
|
-
/* @__PURE__ */ Q.jsx(p_e, { placeholder: e.composerPlaceholder || "Type your message" }),
|
|
46051
|
-
/* @__PURE__ */ Q.jsx(h_e, {})
|
|
46052
|
-
] })
|
|
46047
|
+
m && /* @__PURE__ */ Q.jsx(mk, { scroll: x, direction: "incoming", children: /* @__PURE__ */ Q.jsx(fxe, {}) })
|
|
46053
46048
|
] });
|
|
46054
|
-
},
|
|
46049
|
+
}), S1e = () => /* @__PURE__ */ Q.jsxs(zwe, { children: [
|
|
46050
|
+
/* @__PURE__ */ Q.jsx(dxe, {}),
|
|
46051
|
+
/* @__PURE__ */ Q.jsx(_xe, {}),
|
|
46052
|
+
/* @__PURE__ */ Q.jsxs(f_e, { children: [
|
|
46053
|
+
/* @__PURE__ */ Q.jsx(p_e, {}),
|
|
46054
|
+
/* @__PURE__ */ Q.jsx(h_e, {})
|
|
46055
|
+
] })
|
|
46056
|
+
] }), pc = te.object({
|
|
46055
46057
|
title: te.string(),
|
|
46056
46058
|
link: te.string().optional()
|
|
46057
|
-
}),
|
|
46059
|
+
}), wxe = te.object({
|
|
46058
46060
|
composerPlaceholder: te.string().optional(),
|
|
46059
46061
|
botName: te.string().optional(),
|
|
46060
46062
|
botAvatar: te.string().optional(),
|
|
@@ -46064,7 +46066,7 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
46064
46066
|
phone: pc.optional(),
|
|
46065
46067
|
privacyPolicy: pc.optional(),
|
|
46066
46068
|
termsOfService: pc.optional()
|
|
46067
|
-
}),
|
|
46069
|
+
}), xxe = te.enum([
|
|
46068
46070
|
"heading1",
|
|
46069
46071
|
"heading2",
|
|
46070
46072
|
"heading3",
|
|
@@ -46078,16 +46080,16 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
46078
46080
|
"listItem",
|
|
46079
46081
|
"lineBreak",
|
|
46080
46082
|
"pre"
|
|
46081
|
-
]),
|
|
46083
|
+
]), Sxe = te.object({}).passthrough().transform((e) => e), Ze = te.object({
|
|
46082
46084
|
className: te.string().optional(),
|
|
46083
|
-
style:
|
|
46085
|
+
style: Sxe.optional()
|
|
46084
46086
|
}), Tb = te.object({
|
|
46085
46087
|
container: Ze.optional(),
|
|
46086
46088
|
image: Ze.optional(),
|
|
46087
46089
|
fallback: Ze.optional()
|
|
46088
|
-
}),
|
|
46090
|
+
}), Exe = te.object({
|
|
46089
46091
|
button: Ze.optional(),
|
|
46090
|
-
text: te.record(
|
|
46092
|
+
text: te.record(xxe, Ze.optional()),
|
|
46091
46093
|
image: te.object({
|
|
46092
46094
|
image: Ze.optional(),
|
|
46093
46095
|
placeholder: Ze.optional()
|
|
@@ -46124,7 +46126,7 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
46124
46126
|
item: Ze.optional()
|
|
46125
46127
|
}).optional()
|
|
46126
46128
|
}).optional()
|
|
46127
|
-
}),
|
|
46129
|
+
}), Cxe = te.object({
|
|
46128
46130
|
container: Ze.optional(),
|
|
46129
46131
|
modal: te.object({
|
|
46130
46132
|
overlay: Ze.optional(),
|
|
@@ -46208,20 +46210,20 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
46208
46210
|
message: te.object({
|
|
46209
46211
|
container: Ze.optional(),
|
|
46210
46212
|
avatar: Tb.optional(),
|
|
46211
|
-
blocks:
|
|
46213
|
+
blocks: Exe.optional()
|
|
46212
46214
|
}).optional(),
|
|
46213
46215
|
loadingIndicator: te.object({
|
|
46214
46216
|
container: Ze.optional(),
|
|
46215
46217
|
loader: Ze.optional()
|
|
46216
46218
|
}).optional()
|
|
46217
|
-
}),
|
|
46219
|
+
}), Oxe = te.enum(["opened", "closed", "initial"]), Txe = te.object({
|
|
46218
46220
|
data: te.record(te.string()).optional()
|
|
46219
|
-
}),
|
|
46220
|
-
configuration:
|
|
46221
|
-
theme:
|
|
46221
|
+
}), kxe = te.enum(["messaging", "pushpin"]), Axe = te.object({
|
|
46222
|
+
configuration: wxe.optional().catch(void 0),
|
|
46223
|
+
theme: Cxe.optional().catch(void 0),
|
|
46222
46224
|
style: te.string().optional().catch(void 0),
|
|
46223
|
-
user:
|
|
46224
|
-
}),
|
|
46225
|
+
user: Txe.optional().catch(void 0)
|
|
46226
|
+
}), E1e = Axe.extend({
|
|
46225
46227
|
clientId: te.string(),
|
|
46226
46228
|
botId: te.string(),
|
|
46227
46229
|
selector: te.string().optional().catch(void 0),
|
|
@@ -46229,9 +46231,9 @@ const yk = 10 * 1e3, yxe = fu(({ scrollDownButton: e, ...t }) => {
|
|
|
46229
46231
|
fabScriptUrl: te.string().optional().catch(void 0),
|
|
46230
46232
|
messagingUrl: te.string().optional().catch(void 0),
|
|
46231
46233
|
pushpinUrl: te.string().optional().catch(void 0),
|
|
46232
|
-
clientMode:
|
|
46233
|
-
defaultState:
|
|
46234
|
-
}),
|
|
46234
|
+
clientMode: kxe.optional().catch(void 0),
|
|
46235
|
+
defaultState: Oxe.optional().catch(void 0)
|
|
46236
|
+
}), C1e = ({
|
|
46235
46237
|
clientId: e,
|
|
46236
46238
|
apiUrl: t = "https://webchat.botpress.cloud",
|
|
46237
46239
|
mode: n = "pushpin"
|
|
@@ -46249,31 +46251,32 @@ export {
|
|
|
46249
46251
|
h_e as ComposerButton,
|
|
46250
46252
|
p_e as ComposerInput,
|
|
46251
46253
|
zwe as Container,
|
|
46252
|
-
|
|
46253
|
-
|
|
46254
|
-
|
|
46254
|
+
w1e as Fab,
|
|
46255
|
+
dxe as Header,
|
|
46256
|
+
bi as HeaderRoot,
|
|
46257
|
+
fxe as LoadingIndicator,
|
|
46255
46258
|
mk as Message,
|
|
46256
|
-
|
|
46259
|
+
_xe as MessageList,
|
|
46257
46260
|
Bs as Modal,
|
|
46258
46261
|
m_e as ModalProvider,
|
|
46259
|
-
|
|
46260
|
-
|
|
46261
|
-
|
|
46262
|
+
txe as RestartConversation,
|
|
46263
|
+
S1e as Webchat,
|
|
46264
|
+
v1e as WebchatProvider,
|
|
46262
46265
|
Tb as avatarThemeSchema,
|
|
46263
|
-
|
|
46264
|
-
|
|
46265
|
-
|
|
46266
|
-
|
|
46267
|
-
|
|
46266
|
+
Exe as blockThemeSchema,
|
|
46267
|
+
kxe as clientModePropsSchema,
|
|
46268
|
+
Axe as configPropsSchema,
|
|
46269
|
+
wxe as configurationSchema,
|
|
46270
|
+
Sxe as cssStyleSchema,
|
|
46268
46271
|
pc as descriptionItemSchema,
|
|
46269
|
-
|
|
46270
|
-
|
|
46271
|
-
|
|
46272
|
+
C1e as getClient,
|
|
46273
|
+
E1e as initPropsSchema,
|
|
46274
|
+
xxe as markdownTypeSchema,
|
|
46272
46275
|
IP as renderers,
|
|
46273
|
-
|
|
46276
|
+
Oxe as statePropsSchema,
|
|
46274
46277
|
Ze as styleOptionSchema,
|
|
46275
|
-
|
|
46276
|
-
|
|
46278
|
+
Cxe as themeSchema,
|
|
46279
|
+
y1e as useClient,
|
|
46277
46280
|
_n as useWebchatContext,
|
|
46278
|
-
|
|
46281
|
+
Txe as userPropsSchema
|
|
46279
46282
|
};
|