@opencx/widget 3.0.81 → 3.0.83
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/designs.cjs +4 -4
- package/dist/designs.cjs.map +1 -1
- package/dist/designs.js +147 -89
- package/dist/designs.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/src/designs/translation/es.locale.d.ts +2 -0
- package/dist/src/designs/translation/index.d.ts +1 -0
- package/dist/src/headless/core/__tests__/test-utils.d.ts +3 -0
- package/dist/src/headless/core/api/api-caller.d.ts +3 -0
- package/dist/src/headless/core/api/schema.d.ts +5 -0
- package/dist/src/headless/core/context/message.ctx.d.ts +1 -0
- package/dist/src/headless/core/types/widget-config.d.ts +7 -0
- package/dist/src/headless/react/hooks/useMessages.d.ts +1 -0
- package/dist/{useWidgetTrigger-ims5I4zH.js → useWidgetTrigger-CiXxBOLI.js} +3 -3
- package/dist/{useWidgetTrigger-ims5I4zH.js.map → useWidgetTrigger-CiXxBOLI.js.map} +1 -1
- package/dist/{useWidgetTrigger-DL9e5ISu.cjs → useWidgetTrigger-ClIdKwZT.cjs} +2 -2
- package/dist/{useWidgetTrigger-DL9e5ISu.cjs.map → useWidgetTrigger-ClIdKwZT.cjs.map} +1 -1
- package/dist/{widget.ctx-sL-dW2kY.cjs → widget.ctx-CoJrM0OY.cjs} +2 -2
- package/dist/widget.ctx-CoJrM0OY.cjs.map +1 -0
- package/dist/{widget.ctx-DRC-z8Ql.js → widget.ctx-r2Nzp00O.js} +45 -40
- package/dist/widget.ctx-r2Nzp00O.js.map +1 -0
- package/dist-embed/script.js +3 -3
- package/dist-embed/script.js.map +1 -1
- package/package.json +1 -1
- package/dist/widget.ctx-DRC-z8Ql.js.map +0 -1
- package/dist/widget.ctx-sL-dW2kY.cjs.map +0 -1
package/dist/designs.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fragment as Qa, jsx as b, jsxs as U } from "react/jsx-runtime";
|
|
|
2
2
|
import * as Un from "@radix-ui/react-popover";
|
|
3
3
|
import * as Te from "react";
|
|
4
4
|
import an, { forwardRef as zr, useState as Fe, useImperativeHandle as Au, useRef as cn, useCallback as Cu, useMemo as Yr, useEffect as Ot, memo as ku, cloneElement as Nu, createElement as Ai } from "react";
|
|
5
|
-
import { l as Ci, m as Iu, a as We, u as mt, d as dn, g as zn, i as Su, c as Xa, h as Lt, e as Yn, j as hn, b as Ou, _ as Lu, W as Ru, k as Du } from "./useWidgetTrigger-
|
|
5
|
+
import { l as Ci, m as Iu, a as We, u as mt, d as dn, g as zn, i as Su, c as Xa, h as Lt, e as Yn, j as hn, b as Ou, _ as Lu, W as Ru, k as Du } from "./useWidgetTrigger-CiXxBOLI.js";
|
|
6
6
|
import * as Ue from "@radix-ui/react-dialog";
|
|
7
7
|
import { X as vu, PaperclipIcon as Pu, ImageIcon as Mu, CircleDashed as Bu, ArrowUpIcon as Fu, CircleCheckIcon as Hu, XIcon as jr, AlertCircle as Uu, Loader2 as zu, FileAudio2Icon as Yu, FileVideo2Icon as ju, FileIcon as Wu, ChevronRight as qu, Check as Vu, Circle as Gu, ChevronLeftIcon as Qu, EllipsisVerticalIcon as Xu, MessageCirclePlusIcon as Ku, LoaderIcon as $u, SendHorizontal as Ju, UserRoundIcon as Zu, ChevronRightIcon as el, ChevronDownIcon as tl } from "lucide-react";
|
|
8
8
|
import { clsx as Ka } from "clsx";
|
|
@@ -18289,15 +18289,73 @@ const gi = () => {
|
|
|
18289
18289
|
"this-was-helpful": "Isso foi útil",
|
|
18290
18290
|
optional: "Opcional",
|
|
18291
18291
|
"no-conversations-yet": "Nenhuma conversa ainda"
|
|
18292
|
+
}, $b = {
|
|
18293
|
+
ok: "OK",
|
|
18294
|
+
yes: "Sí",
|
|
18295
|
+
no: "No",
|
|
18296
|
+
agree: "De acuerdo",
|
|
18297
|
+
cancel: "Cancelar",
|
|
18298
|
+
"yes-exit": "Sí, salir",
|
|
18299
|
+
"yes-reset": "Sí, restablecer",
|
|
18300
|
+
"no-cancel": "No, cancelar",
|
|
18301
|
+
"are-you-sure": "¿Estás seguro?",
|
|
18302
|
+
recording: "Grabando...",
|
|
18303
|
+
"thank-you": "Gracias",
|
|
18304
|
+
"sorry-try-again": "Lo sentimos, intenta de nuevo",
|
|
18305
|
+
"error-occurred": "Ocurrió un error",
|
|
18306
|
+
"please-try-again": "Por favor, inténtalo de nuevo",
|
|
18307
|
+
"write-a-message": "Escribe un mensaje...",
|
|
18308
|
+
"send-message": "Enviar mensaje",
|
|
18309
|
+
connected: "Conectado",
|
|
18310
|
+
connecting: "Conectando",
|
|
18311
|
+
reconnecting: "Reconectando",
|
|
18312
|
+
reconnected: "Reconectado",
|
|
18313
|
+
disconnecting: "Desconectando",
|
|
18314
|
+
disconnected: "Desconectado",
|
|
18315
|
+
error: "Error",
|
|
18316
|
+
"persist-session": "Persistir sesión",
|
|
18317
|
+
settings: "Configuración",
|
|
18318
|
+
close: "Cerrar",
|
|
18319
|
+
help: "Ayuda",
|
|
18320
|
+
chat: "Chat",
|
|
18321
|
+
send: "Enviar",
|
|
18322
|
+
copy: "Copiar",
|
|
18323
|
+
copied: "Copiado",
|
|
18324
|
+
"sound-effects": "Efectos de sonido",
|
|
18325
|
+
language: "Idioma",
|
|
18326
|
+
select: "Seleccionar",
|
|
18327
|
+
agent: "Agente",
|
|
18328
|
+
user: "Usuario",
|
|
18329
|
+
bot: "Bot",
|
|
18330
|
+
"close-widget": "Cerrar widget",
|
|
18331
|
+
"got-any-questions": "¿Tienes alguna pregunta? ¡Chatea con nosotros!",
|
|
18332
|
+
"typical-response-time": "Normalmente respondemos en menos de 1 minuto",
|
|
18333
|
+
"session-closed-lead": "¡Tu problema fue resuelto!",
|
|
18334
|
+
"create-new-ticket": "Crear nuevo ticket",
|
|
18335
|
+
exit: "Salir",
|
|
18336
|
+
"reset-conversation": "Restablecer conversación",
|
|
18337
|
+
"new-conversation": "Nueva conversación",
|
|
18338
|
+
"welcome-title": "Bienvenido a nuestro chat de soporte",
|
|
18339
|
+
"welcome-description": "¡Estamos aquí para ayudarte! Inicia una conversación y responderemos lo antes posible.",
|
|
18340
|
+
"your-name": "Tu nombre",
|
|
18341
|
+
"your-email": "Tu correo electrónico",
|
|
18342
|
+
"start-chat": "Hablar con soporte",
|
|
18343
|
+
"starting-chat": "Conectando...",
|
|
18344
|
+
"hello-greeting": "¡Hola! ¿Cómo podemos ayudarte hoy?",
|
|
18345
|
+
"i-need-more-help": "Necesito más ayuda",
|
|
18346
|
+
"this-was-helpful": "Esto fue útil",
|
|
18347
|
+
optional: "Opcional",
|
|
18348
|
+
"no-conversations-yet": "Sin conversaciones aún"
|
|
18292
18349
|
}, uu = {
|
|
18293
18350
|
en: Gb,
|
|
18294
18351
|
ar: qb,
|
|
18295
18352
|
nl: Xb,
|
|
18296
18353
|
fr: Qb,
|
|
18297
18354
|
de: Vb,
|
|
18298
|
-
pt: Kb
|
|
18299
|
-
|
|
18300
|
-
|
|
18355
|
+
pt: Kb,
|
|
18356
|
+
es: $b
|
|
18357
|
+
}, Jb = Object.keys(uu), Zb = (e) => Jb.includes(e);
|
|
18358
|
+
function eE(e, t) {
|
|
18301
18359
|
const n = uu[t];
|
|
18302
18360
|
return n && n[e] || "";
|
|
18303
18361
|
}
|
|
@@ -18306,9 +18364,9 @@ function Ut() {
|
|
|
18306
18364
|
widgetCtx: { config: e }
|
|
18307
18365
|
} = mt();
|
|
18308
18366
|
return Yr(() => {
|
|
18309
|
-
const n =
|
|
18367
|
+
const n = Zb(e.language) ? e.language : "en";
|
|
18310
18368
|
return {
|
|
18311
|
-
get: (r) =>
|
|
18369
|
+
get: (r) => eE(r, n),
|
|
18312
18370
|
lang: n
|
|
18313
18371
|
};
|
|
18314
18372
|
}, [e.language]);
|
|
@@ -18334,7 +18392,7 @@ function bi({
|
|
|
18334
18392
|
}
|
|
18335
18393
|
);
|
|
18336
18394
|
}
|
|
18337
|
-
function
|
|
18395
|
+
function tE() {
|
|
18338
18396
|
const e = Ut(), t = [
|
|
18339
18397
|
e.get("i-need-more-help"),
|
|
18340
18398
|
e.get("this-was-helpful")
|
|
@@ -18355,7 +18413,7 @@ function eE() {
|
|
|
18355
18413
|
}
|
|
18356
18414
|
);
|
|
18357
18415
|
}
|
|
18358
|
-
function
|
|
18416
|
+
function nE({
|
|
18359
18417
|
file: { status: e, file: t, error: n },
|
|
18360
18418
|
onCancel: r
|
|
18361
18419
|
}) {
|
|
@@ -18426,7 +18484,7 @@ function tE({
|
|
|
18426
18484
|
}
|
|
18427
18485
|
);
|
|
18428
18486
|
}
|
|
18429
|
-
function
|
|
18487
|
+
function rE() {
|
|
18430
18488
|
var j;
|
|
18431
18489
|
const { isSmallScreen: e } = Ht(), t = cn(null), { sendMessage: n } = dn(), { sessionState: r } = zn(), i = Ut(), a = gi(), [s, u] = Fe(""), {
|
|
18432
18490
|
allFiles: l,
|
|
@@ -18512,7 +18570,7 @@ function nE() {
|
|
|
18512
18570
|
...ne("chat/input_box/attachments_container"),
|
|
18513
18571
|
className: "flex items-center gap-1",
|
|
18514
18572
|
children: /* @__PURE__ */ b(Ne, { mode: "popLayout", children: l.map((z) => /* @__PURE__ */ b(ie, { snapExit: !0, children: /* @__PURE__ */ b(
|
|
18515
|
-
|
|
18573
|
+
nE,
|
|
18516
18574
|
{
|
|
18517
18575
|
onCancel: () => d(z.id),
|
|
18518
18576
|
file: z
|
|
@@ -18591,7 +18649,7 @@ function nE() {
|
|
|
18591
18649
|
}
|
|
18592
18650
|
);
|
|
18593
18651
|
}
|
|
18594
|
-
function
|
|
18652
|
+
function iE() {
|
|
18595
18653
|
const { widgetCtx: e } = mt(), t = Ut();
|
|
18596
18654
|
return /* @__PURE__ */ b("div", { className: "p-2", children: /* @__PURE__ */ U("div", { className: "p-2 bg-muted rounded-3xl space-y-2", children: [
|
|
18597
18655
|
/* @__PURE__ */ U("div", { className: "pl-2 flex items-center gap-1", children: [
|
|
@@ -18601,7 +18659,7 @@ function rE() {
|
|
|
18601
18659
|
/* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(Ie, { onClick: e.resetChat, className: "rounded-2xl w-full", children: t.get("new-conversation") }) })
|
|
18602
18660
|
] }) });
|
|
18603
18661
|
}
|
|
18604
|
-
function
|
|
18662
|
+
function aE() {
|
|
18605
18663
|
var a;
|
|
18606
18664
|
const { initialQuestions: e, initialQuestionsPosition: t } = We(), { sessionState: n } = zn(), { messagesState: r } = dn(), i = r.messages.length === 0;
|
|
18607
18665
|
return /* @__PURE__ */ b("footer", { children: /* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(Ne, { mode: "wait", children: n.session && !((a = n.session) != null && a.isOpened) ? /* @__PURE__ */ b(
|
|
@@ -18613,7 +18671,7 @@ function iE() {
|
|
|
18613
18671
|
animate: { height: "auto" },
|
|
18614
18672
|
exit: { height: 0 }
|
|
18615
18673
|
},
|
|
18616
|
-
children: /* @__PURE__ */ b(
|
|
18674
|
+
children: /* @__PURE__ */ b(iE, {})
|
|
18617
18675
|
},
|
|
18618
18676
|
"session-closed"
|
|
18619
18677
|
) : /* @__PURE__ */ U(
|
|
@@ -18626,7 +18684,7 @@ function iE() {
|
|
|
18626
18684
|
exit: { height: 0 }
|
|
18627
18685
|
},
|
|
18628
18686
|
children: [
|
|
18629
|
-
r.lastAIResMightSolveUserIssue && /* @__PURE__ */ b(
|
|
18687
|
+
r.lastAIResMightSolveUserIssue && /* @__PURE__ */ b(tE, {}),
|
|
18630
18688
|
i && e && t !== "below-initial-messages" && /* @__PURE__ */ b("div", { className: "flex items-center flex-row justify-end gap-2 flex-wrap px-2", children: e == null ? void 0 : e.map((s, u) => /* @__PURE__ */ b(
|
|
18631
18689
|
bi,
|
|
18632
18690
|
{
|
|
@@ -18634,13 +18692,13 @@ function iE() {
|
|
|
18634
18692
|
},
|
|
18635
18693
|
`${s}-${u}`
|
|
18636
18694
|
)) }),
|
|
18637
|
-
/* @__PURE__ */ b(
|
|
18695
|
+
/* @__PURE__ */ b(rE, {})
|
|
18638
18696
|
]
|
|
18639
18697
|
},
|
|
18640
18698
|
"chat-input"
|
|
18641
18699
|
) }) }) });
|
|
18642
18700
|
}
|
|
18643
|
-
const
|
|
18701
|
+
const sE = fe.Root, oE = fe.Trigger, uE = fe.Group, lE = Te.forwardRef(({ className: e, inset: t, children: n, ...r }, i) => /* @__PURE__ */ U(
|
|
18644
18702
|
fe.SubTrigger,
|
|
18645
18703
|
{
|
|
18646
18704
|
ref: i,
|
|
@@ -18656,8 +18714,8 @@ const aE = fe.Root, sE = fe.Trigger, oE = fe.Group, uE = Te.forwardRef(({ classN
|
|
|
18656
18714
|
]
|
|
18657
18715
|
}
|
|
18658
18716
|
));
|
|
18659
|
-
|
|
18660
|
-
const
|
|
18717
|
+
lE.displayName = fe.SubTrigger.displayName;
|
|
18718
|
+
const cE = Te.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ b(
|
|
18661
18719
|
fe.SubContent,
|
|
18662
18720
|
{
|
|
18663
18721
|
ref: n,
|
|
@@ -18668,7 +18726,7 @@ const lE = Te.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ b(
|
|
|
18668
18726
|
...t
|
|
18669
18727
|
}
|
|
18670
18728
|
));
|
|
18671
|
-
|
|
18729
|
+
cE.displayName = fe.SubContent.displayName;
|
|
18672
18730
|
const lu = Te.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ b(
|
|
18673
18731
|
fe.Content,
|
|
18674
18732
|
{
|
|
@@ -18696,7 +18754,7 @@ const cu = Te.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ *
|
|
|
18696
18754
|
}
|
|
18697
18755
|
) }));
|
|
18698
18756
|
cu.displayName = fe.Item.displayName;
|
|
18699
|
-
const
|
|
18757
|
+
const dE = Te.forwardRef(({ className: e, children: t, checked: n, ...r }, i) => /* @__PURE__ */ U(
|
|
18700
18758
|
fe.CheckboxItem,
|
|
18701
18759
|
{
|
|
18702
18760
|
ref: i,
|
|
@@ -18712,8 +18770,8 @@ const cE = Te.forwardRef(({ className: e, children: t, checked: n, ...r }, i) =>
|
|
|
18712
18770
|
]
|
|
18713
18771
|
}
|
|
18714
18772
|
));
|
|
18715
|
-
|
|
18716
|
-
const
|
|
18773
|
+
dE.displayName = fe.CheckboxItem.displayName;
|
|
18774
|
+
const hE = Te.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ U(
|
|
18717
18775
|
fe.RadioItem,
|
|
18718
18776
|
{
|
|
18719
18777
|
ref: r,
|
|
@@ -18728,8 +18786,8 @@ const dE = Te.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE_
|
|
|
18728
18786
|
]
|
|
18729
18787
|
}
|
|
18730
18788
|
));
|
|
18731
|
-
|
|
18732
|
-
const
|
|
18789
|
+
hE.displayName = fe.RadioItem.displayName;
|
|
18790
|
+
const fE = Te.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ b(
|
|
18733
18791
|
fe.Label,
|
|
18734
18792
|
{
|
|
18735
18793
|
ref: r,
|
|
@@ -18741,8 +18799,8 @@ const hE = Te.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ *
|
|
|
18741
18799
|
...n
|
|
18742
18800
|
}
|
|
18743
18801
|
));
|
|
18744
|
-
|
|
18745
|
-
const
|
|
18802
|
+
fE.displayName = fe.Label.displayName;
|
|
18803
|
+
const pE = Te.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ b(
|
|
18746
18804
|
fe.Separator,
|
|
18747
18805
|
{
|
|
18748
18806
|
ref: n,
|
|
@@ -18750,7 +18808,7 @@ const fE = Te.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ b(
|
|
|
18750
18808
|
...t
|
|
18751
18809
|
}
|
|
18752
18810
|
));
|
|
18753
|
-
|
|
18811
|
+
pE.displayName = fe.Separator.displayName;
|
|
18754
18812
|
function du({
|
|
18755
18813
|
className: e,
|
|
18756
18814
|
...t
|
|
@@ -18763,11 +18821,11 @@ function du({
|
|
|
18763
18821
|
}
|
|
18764
18822
|
);
|
|
18765
18823
|
}
|
|
18766
|
-
function
|
|
18824
|
+
function mE() {
|
|
18767
18825
|
const e = Ut(), [t, n] = Fe(!1), { toChatScreen: r } = Lt();
|
|
18768
|
-
return /* @__PURE__ */ U(
|
|
18769
|
-
/* @__PURE__ */ b(
|
|
18770
|
-
/* @__PURE__ */ b(lu, { align: "end", className: "min-w-56", children: /* @__PURE__ */ b(
|
|
18826
|
+
return /* @__PURE__ */ U(sE, { open: t, onOpenChange: n, children: [
|
|
18827
|
+
/* @__PURE__ */ b(oE, { asChild: !0, children: /* @__PURE__ */ b(Ie, { variant: "ghost", size: "fit", className: "rounded-full", children: /* @__PURE__ */ b(Xu, { className: "size-4" }) }) }),
|
|
18828
|
+
/* @__PURE__ */ b(lu, { align: "end", className: "min-w-56", children: /* @__PURE__ */ b(uE, { children: /* @__PURE__ */ U(
|
|
18771
18829
|
cu,
|
|
18772
18830
|
{
|
|
18773
18831
|
onSelect: () => {
|
|
@@ -18788,7 +18846,7 @@ function pE() {
|
|
|
18788
18846
|
) }) })
|
|
18789
18847
|
] });
|
|
18790
18848
|
}
|
|
18791
|
-
function
|
|
18849
|
+
function gE() {
|
|
18792
18850
|
const { setIsOpen: e } = hn(), { isSmallScreen: t } = Ht();
|
|
18793
18851
|
return t ? /* @__PURE__ */ b(
|
|
18794
18852
|
Ie,
|
|
@@ -18801,7 +18859,7 @@ function mE() {
|
|
|
18801
18859
|
}
|
|
18802
18860
|
) : null;
|
|
18803
18861
|
}
|
|
18804
|
-
function
|
|
18862
|
+
function bE() {
|
|
18805
18863
|
var i;
|
|
18806
18864
|
const { data: e } = Yn(), {
|
|
18807
18865
|
routerState: { screen: t }
|
|
@@ -18835,7 +18893,7 @@ function hu() {
|
|
|
18835
18893
|
default:
|
|
18836
18894
|
return;
|
|
18837
18895
|
}
|
|
18838
|
-
})(), a =
|
|
18896
|
+
})(), a = bE();
|
|
18839
18897
|
return /* @__PURE__ */ b("header", { ...i, className: "py-2 px-4 shrink-0", children: /* @__PURE__ */ U(
|
|
18840
18898
|
"div",
|
|
18841
18899
|
{
|
|
@@ -18853,13 +18911,13 @@ function hu() {
|
|
|
18853
18911
|
}
|
|
18854
18912
|
),
|
|
18855
18913
|
/* @__PURE__ */ b("div", { className: W("flex-1", e === "sessions" && "pl-2"), children: /* @__PURE__ */ b(Ne, { mode: "wait", children: n ? /* @__PURE__ */ b(ie, { snapExit: !0, children: /* @__PURE__ */ b(du, { className: "h-5 w-1/2" }) }, "skeleton") : /* @__PURE__ */ b(ie, { children: /* @__PURE__ */ b("h2", { className: "font-semibold", children: a }) }, "organization-name") }) }),
|
|
18856
|
-
/* @__PURE__ */ b(
|
|
18857
|
-
/* @__PURE__ */ b(
|
|
18914
|
+
/* @__PURE__ */ b(mE, {}),
|
|
18915
|
+
/* @__PURE__ */ b(gE, {})
|
|
18858
18916
|
]
|
|
18859
18917
|
}
|
|
18860
18918
|
) });
|
|
18861
18919
|
}
|
|
18862
|
-
function
|
|
18920
|
+
function EE({
|
|
18863
18921
|
isFirstInGroup: e,
|
|
18864
18922
|
isLastInGroup: t,
|
|
18865
18923
|
isAloneInGroup: n,
|
|
@@ -18939,7 +18997,7 @@ function Ga({
|
|
|
18939
18997
|
...ne("chat/agent_msg_group/avatar_and_msgs/msgs"),
|
|
18940
18998
|
className: W("flex-1 flex flex-col gap-1"),
|
|
18941
18999
|
children: e.map((r, i, a) => /* @__PURE__ */ b(
|
|
18942
|
-
|
|
19000
|
+
EE,
|
|
18943
19001
|
{
|
|
18944
19002
|
isFirstInGroup: i === 0,
|
|
18945
19003
|
isLastInGroup: i === a.length - 1,
|
|
@@ -18972,7 +19030,7 @@ function Ga({
|
|
|
18972
19030
|
}
|
|
18973
19031
|
);
|
|
18974
19032
|
}
|
|
18975
|
-
function
|
|
19033
|
+
function TE({
|
|
18976
19034
|
message: e,
|
|
18977
19035
|
isFirstInGroup: t,
|
|
18978
19036
|
isLastInGroup: n,
|
|
@@ -19012,7 +19070,7 @@ function EE({
|
|
|
19012
19070
|
}
|
|
19013
19071
|
);
|
|
19014
19072
|
}
|
|
19015
|
-
function
|
|
19073
|
+
function wE({
|
|
19016
19074
|
messages: e
|
|
19017
19075
|
}) {
|
|
19018
19076
|
return /* @__PURE__ */ b(
|
|
@@ -19021,7 +19079,7 @@ function TE({
|
|
|
19021
19079
|
...ne("chat/user_msg_group/root"),
|
|
19022
19080
|
className: W("group", "flex flex-col gap-1 justify-end items-end"),
|
|
19023
19081
|
children: e.map((t, n, r) => /* @__PURE__ */ b(
|
|
19024
|
-
|
|
19082
|
+
TE,
|
|
19025
19083
|
{
|
|
19026
19084
|
message: t,
|
|
19027
19085
|
isFirstInGroup: n === 0,
|
|
@@ -19033,7 +19091,7 @@ function TE({
|
|
|
19033
19091
|
}
|
|
19034
19092
|
);
|
|
19035
19093
|
}
|
|
19036
|
-
function
|
|
19094
|
+
function xE(e) {
|
|
19037
19095
|
const t = [];
|
|
19038
19096
|
let n = null;
|
|
19039
19097
|
return e.forEach((r) => {
|
|
@@ -19041,23 +19099,23 @@ function wE(e) {
|
|
|
19041
19099
|
(!n || ((i = n[0]) == null ? void 0 : i.type) !== r.type) && (n = [], t.push(n)), ((a = n[0]) == null ? void 0 : a.type) === "FROM_AGENT" && r.type === "FROM_AGENT" && ((s = r.agent) == null ? void 0 : s.id) !== ((u = n[0].agent) == null ? void 0 : u.id) && (n = [], t.push(n)), n.push(r);
|
|
19042
19100
|
}), t;
|
|
19043
19101
|
}
|
|
19044
|
-
function
|
|
19102
|
+
function yE(e) {
|
|
19045
19103
|
var t;
|
|
19046
19104
|
return ((t = e == null ? void 0 : e[0]) == null ? void 0 : t.type) === "FROM_USER";
|
|
19047
19105
|
}
|
|
19048
|
-
function
|
|
19106
|
+
function _E(e) {
|
|
19049
19107
|
var t;
|
|
19050
19108
|
return ((t = e == null ? void 0 : e[0]) == null ? void 0 : t.type) === "FROM_BOT";
|
|
19051
19109
|
}
|
|
19052
|
-
function
|
|
19110
|
+
function AE(e) {
|
|
19053
19111
|
var t;
|
|
19054
19112
|
return ((t = e == null ? void 0 : e[0]) == null ? void 0 : t.type) === "FROM_AGENT";
|
|
19055
19113
|
}
|
|
19056
|
-
function
|
|
19114
|
+
function CE() {
|
|
19057
19115
|
const {
|
|
19058
19116
|
messagesState: { messages: e }
|
|
19059
19117
|
} = dn(), { isAwaitingBotReply: t } = Xa(), { componentStore: n } = mt(), r = We(), { initialQuestions: i, initialQuestionsPosition: a } = r, s = Yr(
|
|
19060
|
-
() =>
|
|
19118
|
+
() => xE(e),
|
|
19061
19119
|
[e]
|
|
19062
19120
|
), u = r.persistentInitialMessages || [], l = !r.initialMessages || r.initialMessages.length === 0 ? ["Hello, how can I help you?"] : r.initialMessages, c = n.getComponent(
|
|
19063
19121
|
"loading"
|
|
@@ -19121,9 +19179,9 @@ function AE() {
|
|
|
19121
19179
|
var y, k, _;
|
|
19122
19180
|
const f = (y = m == null ? void 0 : m[0]) == null ? void 0 : y.type, E = (k = m[0]) == null ? void 0 : k.id;
|
|
19123
19181
|
if (!f || !E) return null;
|
|
19124
|
-
if (
|
|
19125
|
-
return /* @__PURE__ */ b(
|
|
19126
|
-
if (
|
|
19182
|
+
if (yE(m))
|
|
19183
|
+
return /* @__PURE__ */ b(wE, { messages: m }, E);
|
|
19184
|
+
if (_E(m) || AE(m)) {
|
|
19127
19185
|
const S = (_ = m[0]) == null ? void 0 : _.agent;
|
|
19128
19186
|
return /* @__PURE__ */ b(
|
|
19129
19187
|
Ga,
|
|
@@ -19160,7 +19218,7 @@ function Ei({
|
|
|
19160
19218
|
));
|
|
19161
19219
|
}, [n, t, e, r]);
|
|
19162
19220
|
}
|
|
19163
|
-
function
|
|
19221
|
+
function kE() {
|
|
19164
19222
|
const {
|
|
19165
19223
|
messagesState: { isInitialFetchLoading: e }
|
|
19166
19224
|
} = dn(), {
|
|
@@ -19201,8 +19259,8 @@ function CE() {
|
|
|
19201
19259
|
className: "flex flex-col w-full flex-1 overflow-auto",
|
|
19202
19260
|
snapExit: !0,
|
|
19203
19261
|
children: [
|
|
19204
|
-
/* @__PURE__ */ b(
|
|
19205
|
-
/* @__PURE__ */ b(
|
|
19262
|
+
/* @__PURE__ */ b(CE, {}),
|
|
19263
|
+
/* @__PURE__ */ b(aE, {})
|
|
19206
19264
|
]
|
|
19207
19265
|
},
|
|
19208
19266
|
r
|
|
@@ -19234,7 +19292,7 @@ const Ln = Te.forwardRef(
|
|
|
19234
19292
|
}
|
|
19235
19293
|
);
|
|
19236
19294
|
Ln.displayName = "Input";
|
|
19237
|
-
function
|
|
19295
|
+
function NE({ className: e }) {
|
|
19238
19296
|
return /* @__PURE__ */ b(
|
|
19239
19297
|
"svg",
|
|
19240
19298
|
{
|
|
@@ -19278,7 +19336,7 @@ function pu({ className: e }) {
|
|
|
19278
19336
|
/* @__PURE__ */ b("span", { children: "Powered by" }),
|
|
19279
19337
|
/* @__PURE__ */ b("span", { children: " " }),
|
|
19280
19338
|
/* @__PURE__ */ U("span", { className: "flex items-center gap-[1px]", children: [
|
|
19281
|
-
/* @__PURE__ */ b("span", { children: /* @__PURE__ */ b(
|
|
19339
|
+
/* @__PURE__ */ b("span", { children: /* @__PURE__ */ b(NE, { className: "size-3 inline-block" }) }),
|
|
19282
19340
|
/* @__PURE__ */ b("span", { className: "font-semibold", children: "open" })
|
|
19283
19341
|
] })
|
|
19284
19342
|
]
|
|
@@ -19287,7 +19345,7 @@ function pu({ className: e }) {
|
|
|
19287
19345
|
}
|
|
19288
19346
|
);
|
|
19289
19347
|
}
|
|
19290
|
-
function
|
|
19348
|
+
function IE() {
|
|
19291
19349
|
const { contentIframeRef: e } = mt(), t = cn(null);
|
|
19292
19350
|
return Ot(() => {
|
|
19293
19351
|
const n = e == null ? void 0 : e.current;
|
|
@@ -19309,13 +19367,13 @@ function NE() {
|
|
|
19309
19367
|
}
|
|
19310
19368
|
}, [e]), { observedElementRef: t };
|
|
19311
19369
|
}
|
|
19312
|
-
const
|
|
19370
|
+
const SE = nr.object({
|
|
19313
19371
|
name: nr.string().min(2),
|
|
19314
19372
|
email: nr.string().email()
|
|
19315
19373
|
});
|
|
19316
|
-
function
|
|
19374
|
+
function OE() {
|
|
19317
19375
|
var _, S, L, M, F, I, j, z, Y;
|
|
19318
|
-
const { setIsOpen: e } = hn(), { createUnverifiedContact: t } = Ou(), { isSmallScreen: n } = Ht(), r = We(), { theme: i } = wn(), a = Ut(), { data: s } = Yn(), { observedElementRef: u } =
|
|
19376
|
+
const { setIsOpen: e } = hn(), { createUnverifiedContact: t } = Ou(), { isSmallScreen: n } = Ht(), r = We(), { theme: i } = wn(), a = Ut(), { data: s } = Yn(), { observedElementRef: u } = IE();
|
|
19319
19377
|
Ei({
|
|
19320
19378
|
height: void 0,
|
|
19321
19379
|
width: i.screens.welcome.width
|
|
@@ -19325,7 +19383,7 @@ function SE() {
|
|
|
19325
19383
|
), [f, E] = Fe({}), [y, k] = Lu(
|
|
19326
19384
|
async (C) => {
|
|
19327
19385
|
C.preventDefault();
|
|
19328
|
-
const H =
|
|
19386
|
+
const H = SE.safeParse({ name: l, email: d });
|
|
19329
19387
|
H.success && await t(
|
|
19330
19388
|
{
|
|
19331
19389
|
email: H.data.email,
|
|
@@ -19462,7 +19520,7 @@ function SE() {
|
|
|
19462
19520
|
}
|
|
19463
19521
|
);
|
|
19464
19522
|
}
|
|
19465
|
-
function
|
|
19523
|
+
function LE({ session: e }) {
|
|
19466
19524
|
const { bot: t } = We(), { toChatScreen: n } = Lt(), r = e.assignee.kind === "human" ? e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", i = e.assignee.kind === "human" ? e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatar) || "";
|
|
19467
19525
|
return /* @__PURE__ */ U(
|
|
19468
19526
|
Ie,
|
|
@@ -19495,7 +19553,7 @@ function OE({ session: e }) {
|
|
|
19495
19553
|
}
|
|
19496
19554
|
);
|
|
19497
19555
|
}
|
|
19498
|
-
function
|
|
19556
|
+
function RE() {
|
|
19499
19557
|
const e = Ut(), { toChatScreen: t } = Lt(), {
|
|
19500
19558
|
sessionsState: { data: n, isInitialFetchLoading: r }
|
|
19501
19559
|
} = zn();
|
|
@@ -19511,7 +19569,7 @@ function LE() {
|
|
|
19511
19569
|
{
|
|
19512
19570
|
className: "flex-1 flex flex-col gap-2 relative",
|
|
19513
19571
|
children: n.length ? /* @__PURE__ */ U(Qa, { children: [
|
|
19514
|
-
/* @__PURE__ */ b(Ne, { children: n.map((i, a) => /* @__PURE__ */ b(ie, { snapExit: !0, children: /* @__PURE__ */ b(
|
|
19572
|
+
/* @__PURE__ */ b(Ne, { children: n.map((i, a) => /* @__PURE__ */ b(ie, { snapExit: !0, children: /* @__PURE__ */ b(LE, { session: i }) }, `${i.id}-${a}`)) }),
|
|
19515
19573
|
/* @__PURE__ */ b("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ Ai(
|
|
19516
19574
|
Ie,
|
|
19517
19575
|
{
|
|
@@ -19541,7 +19599,7 @@ function LE() {
|
|
|
19541
19599
|
"sessions"
|
|
19542
19600
|
) }) });
|
|
19543
19601
|
}
|
|
19544
|
-
function
|
|
19602
|
+
function DE() {
|
|
19545
19603
|
const { theme: e } = wn();
|
|
19546
19604
|
return Ei({
|
|
19547
19605
|
width: e.screens.sessions.width,
|
|
@@ -19564,14 +19622,14 @@ function RE() {
|
|
|
19564
19622
|
children: [
|
|
19565
19623
|
/* @__PURE__ */ U("div", { className: "size-full flex flex-col", children: [
|
|
19566
19624
|
/* @__PURE__ */ b(hu, {}),
|
|
19567
|
-
/* @__PURE__ */ b(
|
|
19625
|
+
/* @__PURE__ */ b(RE, {})
|
|
19568
19626
|
] }),
|
|
19569
19627
|
/* @__PURE__ */ b(pu, {})
|
|
19570
19628
|
]
|
|
19571
19629
|
}
|
|
19572
19630
|
);
|
|
19573
19631
|
}
|
|
19574
|
-
function
|
|
19632
|
+
function vE() {
|
|
19575
19633
|
Yn();
|
|
19576
19634
|
const {
|
|
19577
19635
|
routerState: { screen: e }
|
|
@@ -19587,7 +19645,7 @@ function DE() {
|
|
|
19587
19645
|
fadeIn: "right",
|
|
19588
19646
|
className: "size-full",
|
|
19589
19647
|
snapExit: !0,
|
|
19590
|
-
children: /* @__PURE__ */ b(
|
|
19648
|
+
children: /* @__PURE__ */ b(OE, {})
|
|
19591
19649
|
},
|
|
19592
19650
|
e
|
|
19593
19651
|
);
|
|
@@ -19598,7 +19656,7 @@ function DE() {
|
|
|
19598
19656
|
fadeIn: "right",
|
|
19599
19657
|
className: "size-full",
|
|
19600
19658
|
snapExit: !0,
|
|
19601
|
-
children: /* @__PURE__ */ b(
|
|
19659
|
+
children: /* @__PURE__ */ b(DE, {})
|
|
19602
19660
|
},
|
|
19603
19661
|
e
|
|
19604
19662
|
);
|
|
@@ -19609,7 +19667,7 @@ function DE() {
|
|
|
19609
19667
|
fadeIn: "right",
|
|
19610
19668
|
className: "size-full",
|
|
19611
19669
|
snapExit: !0,
|
|
19612
|
-
children: /* @__PURE__ */ b(
|
|
19670
|
+
children: /* @__PURE__ */ b(kE, {})
|
|
19613
19671
|
},
|
|
19614
19672
|
e
|
|
19615
19673
|
);
|
|
@@ -19619,7 +19677,7 @@ function DE() {
|
|
|
19619
19677
|
})() })
|
|
19620
19678
|
] });
|
|
19621
19679
|
}
|
|
19622
|
-
const
|
|
19680
|
+
const PE = `<!DOCTYPE html>
|
|
19623
19681
|
<html>
|
|
19624
19682
|
<head>
|
|
19625
19683
|
<style>
|
|
@@ -19637,7 +19695,7 @@ html, body {
|
|
|
19637
19695
|
<body>
|
|
19638
19696
|
</body>
|
|
19639
19697
|
</html>`;
|
|
19640
|
-
function
|
|
19698
|
+
function ME() {
|
|
19641
19699
|
const { isOpen: e } = hn(), { version: t, contentIframeRef: n } = mt(), { cssOverrides: r } = We(), { theme: i, cssVars: a, computed: s } = wn();
|
|
19642
19700
|
return /* @__PURE__ */ b(
|
|
19643
19701
|
Un.Content,
|
|
@@ -19676,7 +19734,7 @@ function PE() {
|
|
|
19676
19734
|
hi,
|
|
19677
19735
|
{
|
|
19678
19736
|
ref: n,
|
|
19679
|
-
initialContent:
|
|
19737
|
+
initialContent: PE,
|
|
19680
19738
|
allowFullScreen: !0,
|
|
19681
19739
|
title: "OpenCX Live Chat",
|
|
19682
19740
|
style: {
|
|
@@ -19727,7 +19785,7 @@ function PE() {
|
|
|
19727
19785
|
className: W(
|
|
19728
19786
|
"antialiased font-sans size-full overflow-hidden isolate relative text-secondary-foreground"
|
|
19729
19787
|
),
|
|
19730
|
-
children: /* @__PURE__ */ b(
|
|
19788
|
+
children: /* @__PURE__ */ b(vE, {})
|
|
19731
19789
|
}
|
|
19732
19790
|
)
|
|
19733
19791
|
}
|
|
@@ -19742,7 +19800,7 @@ function PE() {
|
|
|
19742
19800
|
}
|
|
19743
19801
|
);
|
|
19744
19802
|
}
|
|
19745
|
-
function
|
|
19803
|
+
function BE({
|
|
19746
19804
|
className: e,
|
|
19747
19805
|
style: t
|
|
19748
19806
|
}) {
|
|
@@ -19777,7 +19835,7 @@ function ME({
|
|
|
19777
19835
|
}
|
|
19778
19836
|
);
|
|
19779
19837
|
}
|
|
19780
|
-
const
|
|
19838
|
+
const FE = `<!DOCTYPE html>
|
|
19781
19839
|
<html>
|
|
19782
19840
|
<head>
|
|
19783
19841
|
<style>
|
|
@@ -19794,13 +19852,13 @@ html, body {
|
|
|
19794
19852
|
<body>
|
|
19795
19853
|
</body>
|
|
19796
19854
|
</html>`;
|
|
19797
|
-
function
|
|
19855
|
+
function HE() {
|
|
19798
19856
|
var a, s;
|
|
19799
19857
|
const { isOpen: e } = hn(), { cssOverrides: t, assets: n } = We(), { theme: r, cssVars: i } = wn();
|
|
19800
19858
|
return /* @__PURE__ */ U(
|
|
19801
19859
|
hi,
|
|
19802
19860
|
{
|
|
19803
|
-
initialContent:
|
|
19861
|
+
initialContent: FE,
|
|
19804
19862
|
style: {
|
|
19805
19863
|
height: `calc(${r.widgetTrigger.size.button}px + ${St.x * 2}px)`,
|
|
19806
19864
|
width: `calc(${r.widgetTrigger.size.button}px + ${St.y * 2}px)`,
|
|
@@ -19897,7 +19955,7 @@ function FE() {
|
|
|
19897
19955
|
}
|
|
19898
19956
|
}
|
|
19899
19957
|
) : /* @__PURE__ */ b(
|
|
19900
|
-
|
|
19958
|
+
BE,
|
|
19901
19959
|
{
|
|
19902
19960
|
style: {
|
|
19903
19961
|
width: r.widgetTrigger.size.icon,
|
|
@@ -19919,7 +19977,7 @@ function FE() {
|
|
|
19919
19977
|
}
|
|
19920
19978
|
);
|
|
19921
19979
|
}
|
|
19922
|
-
function
|
|
19980
|
+
function UE() {
|
|
19923
19981
|
return /* @__PURE__ */ b(
|
|
19924
19982
|
Un.Anchor,
|
|
19925
19983
|
{
|
|
@@ -19927,15 +19985,15 @@ function HE() {
|
|
|
19927
19985
|
}
|
|
19928
19986
|
);
|
|
19929
19987
|
}
|
|
19930
|
-
function
|
|
19988
|
+
function zE() {
|
|
19931
19989
|
const { isOpen: e, setIsOpen: t } = hn();
|
|
19932
19990
|
return /* @__PURE__ */ U(Un.Root, { open: e, onOpenChange: t, children: [
|
|
19991
|
+
/* @__PURE__ */ b(UE, {}),
|
|
19933
19992
|
/* @__PURE__ */ b(HE, {}),
|
|
19934
|
-
/* @__PURE__ */ b(
|
|
19935
|
-
/* @__PURE__ */ b(PE, {})
|
|
19993
|
+
/* @__PURE__ */ b(ME, {})
|
|
19936
19994
|
] });
|
|
19937
19995
|
}
|
|
19938
|
-
const
|
|
19996
|
+
const YE = [
|
|
19939
19997
|
{
|
|
19940
19998
|
key: "loading",
|
|
19941
19999
|
component: Hb
|
|
@@ -19952,7 +20010,7 @@ const zE = [
|
|
|
19952
20010
|
key: "agent_message",
|
|
19953
20011
|
component: Hn
|
|
19954
20012
|
}
|
|
19955
|
-
],
|
|
20013
|
+
], jE = {
|
|
19956
20014
|
get: async (e) => localStorage.getItem(e),
|
|
19957
20015
|
set: async (e, t) => {
|
|
19958
20016
|
localStorage.setItem(e, t);
|
|
@@ -19961,7 +20019,7 @@ const zE = [
|
|
|
19961
20019
|
localStorage.removeItem(e);
|
|
19962
20020
|
}
|
|
19963
20021
|
};
|
|
19964
|
-
function
|
|
20022
|
+
function t2({
|
|
19965
20023
|
options: e,
|
|
19966
20024
|
components: t = [],
|
|
19967
20025
|
loadingComponent: n
|
|
@@ -19969,15 +20027,15 @@ function e2({
|
|
|
19969
20027
|
return /* @__PURE__ */ b(
|
|
19970
20028
|
Ru,
|
|
19971
20029
|
{
|
|
19972
|
-
components: [...
|
|
20030
|
+
components: [...YE, ...t],
|
|
19973
20031
|
options: e,
|
|
19974
|
-
storage:
|
|
20032
|
+
storage: jE,
|
|
19975
20033
|
loadingComponent: n,
|
|
19976
|
-
children: /* @__PURE__ */ b(Du, { children: /* @__PURE__ */ b(
|
|
20034
|
+
children: /* @__PURE__ */ b(Du, { children: /* @__PURE__ */ b(zE, {}) })
|
|
19977
20035
|
}
|
|
19978
20036
|
);
|
|
19979
20037
|
}
|
|
19980
20038
|
export {
|
|
19981
|
-
|
|
20039
|
+
t2 as Widget
|
|
19982
20040
|
};
|
|
19983
20041
|
//# sourceMappingURL=designs.js.map
|