@opencx/widget-react 4.0.56 → 4.0.58
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +141 -136
- package/dist/index.js.map +1 -1
- package/dist/src/components/Header.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as r, jsxs as d, Fragment as J } from "react/jsx-runtime";
|
|
2
2
|
import * as me from "@radix-ui/react-popover";
|
|
3
3
|
import * as ee from "react";
|
|
4
|
-
import L, { memo as rr, forwardRef as yt, useState as
|
|
4
|
+
import L, { memo as rr, forwardRef as yt, useState as P, cloneElement as kt, createContext as or, useEffect as se, useContext as nr, useRef as B, useCallback as G, useMemo as Ct, createElement as ct } from "react";
|
|
5
5
|
import { useWidget as O, useConfig as z, useSessions as U, useMessages as A, useWidgetRouter as H, useDocumentDir as ke, useWidgetTrigger as Z, useModes as zt, useCsat as Nt, useUploadFiles as sr, useIsAwaitingBotReply as St, useContact as _t, WidgetProvider as ar, WidgetTriggerProvider as ir } from "@opencx/widget-react-headless";
|
|
6
6
|
import { X as lr, ZoomOut as cr, ZoomIn as dr, RotateCcw as pr, FileText as It, FileSpreadsheet as Tt, CircleDashedIcon as mr, XIcon as Ce, SquareXIcon as hr, SquareCheckBigIcon as gr, SquareCheckIcon as ur, ShrinkIcon as wr, Minimize2Icon as fr, MinimizeIcon as xr, Maximize2Icon as vr, MaximizeIcon as br, ExpandIcon as yr, CircleXIcon as kr, CircleCheckBigIcon as Cr, CircleCheckIcon as Mt, CheckCheckIcon as zr, CheckIcon as Nr, ChevronLeftIcon as Sr, LoaderIcon as _r, ArrowUpIcon as Dt, PaperclipIcon as dt, CircleDashed as Ir, AlertCircle as Tr, Loader2 as Mr, FileAudio2Icon as Dr, FileVideo2Icon as Er, FileIcon as Rr, UserRoundIcon as Pr, ChevronRightIcon as jr, SendHorizontal as Or, ChevronDownIcon as Ar } from "lucide-react";
|
|
7
7
|
import { clsx as Fr } from "clsx";
|
|
8
8
|
import { twMerge as Hr } from "tailwind-merge";
|
|
9
|
-
import { motion as re, AnimatePresence as
|
|
9
|
+
import { motion as re, AnimatePresence as D } from "framer-motion";
|
|
10
10
|
import { Slot as Wr } from "@radix-ui/react-slot";
|
|
11
11
|
import { cva as Lr } from "class-variance-authority";
|
|
12
12
|
import Et from "remark-gfm";
|
|
@@ -61,20 +61,20 @@ const Q = {
|
|
|
61
61
|
}, Y = rr(
|
|
62
62
|
yt(
|
|
63
63
|
({ children: e, className: o, scale: t = 1.02, off: n = !1 }, s) => {
|
|
64
|
-
const [i, a] =
|
|
64
|
+
const [i, a] = P(!1), [l, c] = P({ x: 0, y: 0 });
|
|
65
65
|
if (n || /translate/.test(
|
|
66
66
|
e.props.className || ""
|
|
67
67
|
)) return e;
|
|
68
68
|
const v = (x) => {
|
|
69
|
-
var
|
|
70
|
-
const { clientX: C, clientY:
|
|
69
|
+
var R, g;
|
|
70
|
+
const { clientX: C, clientY: T } = x, y = x.currentTarget.getBoundingClientRect(), N = C - (y.left + y.width / 2), _ = T - (y.top + y.height / 2), E = Math.max(
|
|
71
71
|
-1,
|
|
72
|
-
Math.min(1,
|
|
72
|
+
Math.min(1, N / (y.width / 2))
|
|
73
73
|
), w = Math.max(
|
|
74
74
|
-1,
|
|
75
|
-
Math.min(1,
|
|
76
|
-
),
|
|
77
|
-
c({ x:
|
|
75
|
+
Math.min(1, _ / (y.height / 2))
|
|
76
|
+
), M = E * Q.x, j = w * Q.y;
|
|
77
|
+
c({ x: M, y: j }), (g = (R = e.props).onMouseMove) == null || g.call(R, x);
|
|
78
78
|
}, b = () => {
|
|
79
79
|
var x, C;
|
|
80
80
|
a(!0), (C = (x = e.props).onMouseEnter) == null || C.call(x);
|
|
@@ -183,7 +183,7 @@ const Jr = Lr(
|
|
|
183
183
|
size: "default"
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
),
|
|
186
|
+
), S = ee.forwardRef(
|
|
187
187
|
({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, i) => /* @__PURE__ */ r(Y, { ref: i, children: /* @__PURE__ */ r(
|
|
188
188
|
n ? Wr : "button",
|
|
189
189
|
{
|
|
@@ -194,10 +194,10 @@ const Jr = Lr(
|
|
|
194
194
|
}
|
|
195
195
|
) })
|
|
196
196
|
);
|
|
197
|
-
|
|
197
|
+
S.displayName = "Button";
|
|
198
198
|
const Ot = or(null);
|
|
199
199
|
function eo({ children: e }) {
|
|
200
|
-
const [o, t] =
|
|
200
|
+
const [o, t] = P(!1), [n, s] = P(null), i = (l) => {
|
|
201
201
|
s(l), t(!0);
|
|
202
202
|
}, a = () => {
|
|
203
203
|
t(!1), setTimeout(() => {
|
|
@@ -243,7 +243,7 @@ function to() {
|
|
|
243
243
|
s
|
|
244
244
|
);
|
|
245
245
|
};
|
|
246
|
-
}, []), /* @__PURE__ */ r(
|
|
246
|
+
}, []), /* @__PURE__ */ r(D, { mode: "wait", children: o && t && /* @__PURE__ */ r(
|
|
247
247
|
k,
|
|
248
248
|
{
|
|
249
249
|
overrides: {
|
|
@@ -275,7 +275,7 @@ function ze({
|
|
|
275
275
|
children: [
|
|
276
276
|
e,
|
|
277
277
|
t && /* @__PURE__ */ d(
|
|
278
|
-
|
|
278
|
+
S,
|
|
279
279
|
{
|
|
280
280
|
size: "fit",
|
|
281
281
|
className: "rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",
|
|
@@ -366,22 +366,22 @@ function $t({
|
|
|
366
366
|
src: e,
|
|
367
367
|
alt: o
|
|
368
368
|
}) {
|
|
369
|
-
const [t, n] =
|
|
369
|
+
const [t, n] = P(1), [s, i] = P({ x: 0, y: 0 }), [a, l] = P(!1), c = B({ x: 0, y: 0 }), p = B({ x: 0, y: 0 }), v = B(null), b = B(null), u = B(!1), h = (w) => Math.min(gt, Math.max(ht, w)), x = G(() => {
|
|
370
370
|
n(1), i({ x: 0, y: 0 });
|
|
371
371
|
}, []), C = G(() => {
|
|
372
372
|
n((w) => h(w + le));
|
|
373
|
-
}, []),
|
|
373
|
+
}, []), T = G(() => {
|
|
374
374
|
n((w) => {
|
|
375
|
-
const
|
|
376
|
-
return
|
|
375
|
+
const M = h(w - le);
|
|
376
|
+
return M <= 1 && i({ x: 0, y: 0 }), M;
|
|
377
377
|
});
|
|
378
378
|
}, []);
|
|
379
379
|
G((w) => {
|
|
380
380
|
w.preventDefault(), w.stopPropagation();
|
|
381
|
-
const
|
|
382
|
-
n((
|
|
383
|
-
const
|
|
384
|
-
return
|
|
381
|
+
const M = w.deltaY > 0 ? -le : le;
|
|
382
|
+
n((j) => {
|
|
383
|
+
const R = h(j + M);
|
|
384
|
+
return R <= 1 && i({ x: 0, y: 0 }), R;
|
|
385
385
|
});
|
|
386
386
|
}, []);
|
|
387
387
|
const y = G(
|
|
@@ -389,24 +389,24 @@ function $t({
|
|
|
389
389
|
w.preventDefault(), u.current = !1, l(!0), c.current = { x: w.clientX, y: w.clientY }, p.current = { ...s }, w.target.setPointerCapture(w.pointerId);
|
|
390
390
|
},
|
|
391
391
|
[s]
|
|
392
|
-
),
|
|
392
|
+
), N = G(
|
|
393
393
|
(w) => {
|
|
394
394
|
if (!a) return;
|
|
395
|
-
const
|
|
396
|
-
if ((Math.abs(
|
|
397
|
-
const
|
|
398
|
-
x: p.current.x +
|
|
399
|
-
y: p.current.y +
|
|
395
|
+
const M = w.clientX - c.current.x, j = w.clientY - c.current.y;
|
|
396
|
+
if ((Math.abs(M) > 3 || Math.abs(j) > 3) && (u.current = !0), t <= 1) return;
|
|
397
|
+
const R = {
|
|
398
|
+
x: p.current.x + M / t,
|
|
399
|
+
y: p.current.y + j / t
|
|
400
400
|
};
|
|
401
401
|
i(
|
|
402
|
-
oo(
|
|
402
|
+
oo(R, t, v.current, b.current)
|
|
403
403
|
);
|
|
404
404
|
},
|
|
405
405
|
[a, t]
|
|
406
|
-
),
|
|
406
|
+
), _ = G(() => {
|
|
407
407
|
const w = u.current;
|
|
408
|
-
l(!1), !w && n((
|
|
409
|
-
}, []),
|
|
408
|
+
l(!1), !w && n((M) => M > 1 ? (i({ x: 0, y: 0 }), 1) : ro);
|
|
409
|
+
}, []), E = t > 1;
|
|
410
410
|
return /* @__PURE__ */ d(
|
|
411
411
|
"div",
|
|
412
412
|
{
|
|
@@ -419,14 +419,14 @@ function $t({
|
|
|
419
419
|
ref: v,
|
|
420
420
|
className: m(
|
|
421
421
|
"overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",
|
|
422
|
-
|
|
422
|
+
E && "size-full"
|
|
423
423
|
),
|
|
424
424
|
onPointerDown: y,
|
|
425
|
-
onPointerMove:
|
|
426
|
-
onPointerUp:
|
|
427
|
-
onPointerCancel:
|
|
425
|
+
onPointerMove: N,
|
|
426
|
+
onPointerUp: _,
|
|
427
|
+
onPointerCancel: _,
|
|
428
428
|
style: {
|
|
429
|
-
cursor: a ? "grabbing" :
|
|
429
|
+
cursor: a ? "grabbing" : E ? "grab" : "zoom-in",
|
|
430
430
|
touchAction: "none"
|
|
431
431
|
},
|
|
432
432
|
children: /* @__PURE__ */ r(
|
|
@@ -448,13 +448,13 @@ function $t({
|
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
450
|
/* @__PURE__ */ d("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100", children: [
|
|
451
|
-
/* @__PURE__ */ r(we, { onClick:
|
|
451
|
+
/* @__PURE__ */ r(we, { onClick: T, label: "Zoom out", disabled: t <= ht, children: /* @__PURE__ */ r(cr, { className: "size-3.5" }) }),
|
|
452
452
|
/* @__PURE__ */ d("span", { className: "text-white text-xs font-medium min-w-[3ch] text-center tabular-nums", children: [
|
|
453
453
|
Math.round(t * 100),
|
|
454
454
|
"%"
|
|
455
455
|
] }),
|
|
456
456
|
/* @__PURE__ */ r(we, { onClick: C, label: "Zoom in", disabled: t >= gt, children: /* @__PURE__ */ r(dr, { className: "size-3.5" }) }),
|
|
457
|
-
|
|
457
|
+
E && /* @__PURE__ */ d(J, { children: [
|
|
458
458
|
/* @__PURE__ */ r("div", { className: "w-px h-4 bg-white/30 mx-0.5" }),
|
|
459
459
|
/* @__PURE__ */ r(we, { onClick: x, label: "Reset zoom", children: /* @__PURE__ */ r(pr, { className: "size-3.5" }) })
|
|
460
460
|
] })
|
|
@@ -778,7 +778,7 @@ function ve({
|
|
|
778
778
|
] });
|
|
779
779
|
}
|
|
780
780
|
function ao({ agent: e }) {
|
|
781
|
-
return /* @__PURE__ */ r(
|
|
781
|
+
return /* @__PURE__ */ r(D, { children: /* @__PURE__ */ d(
|
|
782
782
|
k,
|
|
783
783
|
{
|
|
784
784
|
...f("chat/bot_loading/root"),
|
|
@@ -855,17 +855,17 @@ const ce = {
|
|
|
855
855
|
transitionDuration: "1000ms"
|
|
856
856
|
};
|
|
857
857
|
function K() {
|
|
858
|
-
var b, u, h, x, C,
|
|
858
|
+
var b, u, h, x, C, T, y, N, _, E, w, M, j, R, g, I, ie, Re, Pe, je, Oe, Ae, Fe, He, We, Le, $e, Be, Ye, Ue, Xe, qe, Ve, Ge, Ze, Ke, Qe, Je, et, tt, rt, ot, nt, st, at, it, lt;
|
|
859
859
|
const { dir: e } = ke(), { isSmallScreen: o } = $(), { theme: t, inline: n } = z(), s = (q) => n ? "100%" : q, i = (q, ge) => o ? `100dv${q}` : ge, a = (q, ge) => s(i(q, ge)), l = {
|
|
860
860
|
zIndex: ((b = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : b.zIndex) ?? 1e7,
|
|
861
861
|
offset: {
|
|
862
862
|
bottom: ((h = (u = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : u.offset) == null ? void 0 : h.bottom) ?? 20,
|
|
863
863
|
right: ((C = (x = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : x.offset) == null ? void 0 : C.right) ?? (e === "ltr" ? 20 : "initial"),
|
|
864
|
-
left: ((y = (
|
|
864
|
+
left: ((y = (T = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : T.offset) == null ? void 0 : y.left) ?? (e === "rtl" ? 20 : "initial")
|
|
865
865
|
},
|
|
866
866
|
size: {
|
|
867
|
-
button: ((
|
|
868
|
-
icon: ((w = (
|
|
867
|
+
button: ((_ = (N = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : N.size) == null ? void 0 : _.button) ?? 48,
|
|
868
|
+
icon: ((w = (E = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : E.size) == null ? void 0 : w.icon) ?? 24
|
|
869
869
|
}
|
|
870
870
|
}, c = (() => {
|
|
871
871
|
const q = e === "ltr" ? l.offset.right : l.offset.left;
|
|
@@ -875,12 +875,12 @@ function K() {
|
|
|
875
875
|
primaryColor: (t == null ? void 0 : t.primaryColor) ?? "hsl(0 0% 9%)",
|
|
876
876
|
widgetTrigger: l,
|
|
877
877
|
widgetContentContainer: {
|
|
878
|
-
borderRadius: o ? "0px" : ((
|
|
879
|
-
zIndex: ((
|
|
880
|
-
outline: ((
|
|
878
|
+
borderRadius: o ? "0px" : ((M = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : M.borderRadius) ?? "32px",
|
|
879
|
+
zIndex: ((j = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : j.zIndex) ?? l.zIndex + 1,
|
|
880
|
+
outline: ((R = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : R.outline) ?? "none",
|
|
881
881
|
// was: '1px solid'
|
|
882
882
|
outlineColor: ((g = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : g.outlineColor) ?? "hsl(0 0% 50% / .5)",
|
|
883
|
-
boxShadow: ((
|
|
883
|
+
boxShadow: ((I = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : I.boxShadow) ?? "0 0px 100px 0px rgb(0 0 0 / 0.25)",
|
|
884
884
|
transitionProperty: ((ie = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : ie.transitionProperty) ?? "all",
|
|
885
885
|
transitionTimingFunction: ((Re = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Re.transitionTimingFunction) ?? ce.transitionTimingFunction,
|
|
886
886
|
transitionDuration: ((Pe = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Pe.transitionDuration) ?? ce.transitionDuration,
|
|
@@ -1175,7 +1175,7 @@ function uo() {
|
|
|
1175
1175
|
toSessionsScreen: t
|
|
1176
1176
|
} = H();
|
|
1177
1177
|
return o !== "chat" || e != null && e.chatScreenOnly ? null : /* @__PURE__ */ r(
|
|
1178
|
-
|
|
1178
|
+
S,
|
|
1179
1179
|
{
|
|
1180
1180
|
variant: "ghost",
|
|
1181
1181
|
size: "fit",
|
|
@@ -1190,7 +1190,7 @@ function wo({
|
|
|
1190
1190
|
}) {
|
|
1191
1191
|
const { setIsOpen: o } = Z(), { isSmallScreen: t } = $(), n = X();
|
|
1192
1192
|
return t && e.hideOnSmallScreen || !t && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
|
|
1193
|
-
|
|
1193
|
+
S,
|
|
1194
1194
|
{
|
|
1195
1195
|
variant: "ghost",
|
|
1196
1196
|
size: "fit",
|
|
@@ -1206,7 +1206,7 @@ function wo({
|
|
|
1206
1206
|
function be({
|
|
1207
1207
|
button: e
|
|
1208
1208
|
}) {
|
|
1209
|
-
const [o, t] =
|
|
1209
|
+
const [o, t] = P(!1), {
|
|
1210
1210
|
routerState: { screen: n }
|
|
1211
1211
|
} = H(), { isSmallScreen: s } = $(), { theme: i } = K(), { setWidth: a, setHeight: l } = Vt(), c = X();
|
|
1212
1212
|
if (n !== "chat" && n !== "sessions") return null;
|
|
@@ -1236,7 +1236,7 @@ function be({
|
|
|
1236
1236
|
}), (u = e.onClicked) == null || u.call(e, c);
|
|
1237
1237
|
};
|
|
1238
1238
|
return s && e.hideOnSmallScreen || !s && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
|
|
1239
|
-
|
|
1239
|
+
S,
|
|
1240
1240
|
{
|
|
1241
1241
|
variant: "ghost",
|
|
1242
1242
|
size: "fit",
|
|
@@ -1254,13 +1254,14 @@ function be({
|
|
|
1254
1254
|
function Gt({
|
|
1255
1255
|
button: e
|
|
1256
1256
|
}) {
|
|
1257
|
-
var
|
|
1258
|
-
const { close: o } = he(), { widgetCtx: t } = O(), { setIsOpen: n } = Z(), { resolveSession: s, sessionState: i } = U(), { isSmallScreen: a } = $(), l = X(), c = !i.session, p = ((
|
|
1259
|
-
const { success:
|
|
1260
|
-
if (o(), !
|
|
1257
|
+
var T, y;
|
|
1258
|
+
const { close: o } = he(), { widgetCtx: t } = O(), { setIsOpen: n } = Z(), { resolveSession: s, sessionState: i } = U(), { isSmallScreen: a } = $(), l = X(), c = !i.session, p = ((T = i.session) == null ? void 0 : T.isOpened) === !1, v = e.onResolved || "stay-in-chat", b = e.behaviorBeforeSessionCreation || "disabled", u = e.behaviorIfSessionIsResolved || "disabled", h = !!(i.isResolvingSession || c && b === "disabled" || p && u === "disabled"), x = async () => {
|
|
1259
|
+
const { success: N, error: _ } = await s();
|
|
1260
|
+
if (o(), !N)
|
|
1261
|
+
return console.error(_), !1;
|
|
1261
1262
|
switch (v) {
|
|
1262
1263
|
case "stay-in-chat":
|
|
1263
|
-
|
|
1264
|
+
break;
|
|
1264
1265
|
case "close-widget":
|
|
1265
1266
|
n(!1);
|
|
1266
1267
|
break;
|
|
@@ -1274,6 +1275,7 @@ function Gt({
|
|
|
1274
1275
|
F(v, Gt.name);
|
|
1275
1276
|
break;
|
|
1276
1277
|
}
|
|
1278
|
+
return !0;
|
|
1277
1279
|
}, C = () => {
|
|
1278
1280
|
if (c)
|
|
1279
1281
|
switch (b) {
|
|
@@ -1314,15 +1316,15 @@ function Gt({
|
|
|
1314
1316
|
Ne,
|
|
1315
1317
|
{
|
|
1316
1318
|
trigger: /* @__PURE__ */ r(
|
|
1317
|
-
|
|
1319
|
+
S,
|
|
1318
1320
|
{
|
|
1319
1321
|
variant: "ghost",
|
|
1320
1322
|
size: "fit",
|
|
1321
1323
|
className: "rounded-full",
|
|
1322
1324
|
disabled: h,
|
|
1323
1325
|
onClick: () => {
|
|
1324
|
-
var
|
|
1325
|
-
return (
|
|
1326
|
+
var N;
|
|
1327
|
+
return (N = e.onClicked) == null ? void 0 : N.call(e, l);
|
|
1326
1328
|
},
|
|
1327
1329
|
children: /* @__PURE__ */ r(ne, { name: e.icon })
|
|
1328
1330
|
}
|
|
@@ -1332,7 +1334,7 @@ function Gt({
|
|
|
1332
1334
|
/* @__PURE__ */ r(Ft, { children: /* @__PURE__ */ r(Lt, { children: e.confirmation.description || "Are you sure you want to close this conversation?" }) }),
|
|
1333
1335
|
/* @__PURE__ */ d(Ht, { children: [
|
|
1334
1336
|
/* @__PURE__ */ r(
|
|
1335
|
-
|
|
1337
|
+
S,
|
|
1336
1338
|
{
|
|
1337
1339
|
variant: "secondary",
|
|
1338
1340
|
onClick: o,
|
|
@@ -1341,10 +1343,13 @@ function Gt({
|
|
|
1341
1343
|
}
|
|
1342
1344
|
),
|
|
1343
1345
|
/* @__PURE__ */ r(
|
|
1344
|
-
|
|
1346
|
+
S,
|
|
1345
1347
|
{
|
|
1346
1348
|
variant: "destructive",
|
|
1347
|
-
onClick:
|
|
1349
|
+
onClick: async () => {
|
|
1350
|
+
var _, E;
|
|
1351
|
+
await x() && ((E = (_ = e.confirmation) == null ? void 0 : _.onResolved) == null || E.call(_, l));
|
|
1352
|
+
},
|
|
1348
1353
|
disabled: i.isResolvingSession,
|
|
1349
1354
|
children: e.confirmation.confirmButtonText || "Yes"
|
|
1350
1355
|
}
|
|
@@ -1353,14 +1358,14 @@ function Gt({
|
|
|
1353
1358
|
] })
|
|
1354
1359
|
}
|
|
1355
1360
|
) : /* @__PURE__ */ r(
|
|
1356
|
-
|
|
1361
|
+
S,
|
|
1357
1362
|
{
|
|
1358
1363
|
variant: "ghost",
|
|
1359
1364
|
size: "fit",
|
|
1360
1365
|
className: "rounded-full",
|
|
1361
1366
|
onClick: () => {
|
|
1362
|
-
var
|
|
1363
|
-
p || c ? C() : x(), (
|
|
1367
|
+
var N;
|
|
1368
|
+
p || c ? C() : x(), (N = e.onClicked) == null || N.call(e, l);
|
|
1364
1369
|
},
|
|
1365
1370
|
disabled: h,
|
|
1366
1371
|
children: /* @__PURE__ */ r(ne, { name: e.icon })
|
|
@@ -1435,7 +1440,7 @@ function vo() {
|
|
|
1435
1440
|
};
|
|
1436
1441
|
}
|
|
1437
1442
|
function bo() {
|
|
1438
|
-
const e = X(), { activeMode: o, Component: t } = zt(), { sendMessage: n } = A(), { createStateCheckpoint: s } = U(), [i, a] =
|
|
1443
|
+
const e = X(), { activeMode: o, Component: t } = zt(), { sendMessage: n } = A(), { createStateCheckpoint: s } = U(), [i, a] = P(!1), l = async (c) => {
|
|
1439
1444
|
try {
|
|
1440
1445
|
a(!0), await n(c);
|
|
1441
1446
|
} catch (p) {
|
|
@@ -1520,7 +1525,7 @@ function ko() {
|
|
|
1520
1525
|
isCsatSubmitted: s,
|
|
1521
1526
|
submittedScore: i,
|
|
1522
1527
|
submittedFeedback: a
|
|
1523
|
-
} = Nt(), [l, c] =
|
|
1528
|
+
} = Nt(), [l, c] = P(null), [p, v] = P(null), b = (h) => {
|
|
1524
1529
|
c((x) => x === h ? null : h);
|
|
1525
1530
|
}, u = () => {
|
|
1526
1531
|
l && t({
|
|
@@ -1529,7 +1534,7 @@ function ko() {
|
|
|
1529
1534
|
});
|
|
1530
1535
|
};
|
|
1531
1536
|
return !n && !s ? null : /* @__PURE__ */ d("div", { className: "w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden", children: [
|
|
1532
|
-
/* @__PURE__ */ r(
|
|
1537
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: n && !l ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: o("csat_title") }) }, "csat-requested-title") : s ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: o("csat_submitted_title") }) }, "csat-submitted-title") : null }),
|
|
1533
1538
|
/* @__PURE__ */ r(
|
|
1534
1539
|
"div",
|
|
1535
1540
|
{
|
|
@@ -1540,7 +1545,7 @@ function ko() {
|
|
|
1540
1545
|
s && "gap-0 justify-center"
|
|
1541
1546
|
),
|
|
1542
1547
|
children: yo.map((h) => /* @__PURE__ */ r(
|
|
1543
|
-
|
|
1548
|
+
S,
|
|
1544
1549
|
{
|
|
1545
1550
|
variant: h.value === l ? "secondary" : "ghost",
|
|
1546
1551
|
size: "selfless",
|
|
@@ -1561,7 +1566,7 @@ function ko() {
|
|
|
1561
1566
|
))
|
|
1562
1567
|
}
|
|
1563
1568
|
),
|
|
1564
|
-
/* @__PURE__ */ r(
|
|
1569
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: (l || i) && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ d("div", { className: "pb-2 px-2 flex items-end", children: [
|
|
1565
1570
|
/* @__PURE__ */ r(
|
|
1566
1571
|
"textarea",
|
|
1567
1572
|
{
|
|
@@ -1583,7 +1588,7 @@ function ko() {
|
|
|
1583
1588
|
}
|
|
1584
1589
|
),
|
|
1585
1590
|
/* @__PURE__ */ r(
|
|
1586
|
-
|
|
1591
|
+
S,
|
|
1587
1592
|
{
|
|
1588
1593
|
size: "fit",
|
|
1589
1594
|
onClick: u,
|
|
@@ -1615,7 +1620,7 @@ function Ee({
|
|
|
1615
1620
|
i && n({ content: i });
|
|
1616
1621
|
};
|
|
1617
1622
|
return /* @__PURE__ */ r(
|
|
1618
|
-
|
|
1623
|
+
S,
|
|
1619
1624
|
{
|
|
1620
1625
|
...f("chat/suggested_reply_btn"),
|
|
1621
1626
|
size: "sm",
|
|
@@ -1646,13 +1651,13 @@ function Co() {
|
|
|
1646
1651
|
}
|
|
1647
1652
|
function xt() {
|
|
1648
1653
|
const { sessionState: e } = U(), { chatFooterItems: o } = z(), t = !!e.session && !e.session.isOpened, n = !t;
|
|
1649
|
-
return /* @__PURE__ */ r(
|
|
1654
|
+
return /* @__PURE__ */ r(D, { mode: "wait", children: o == null ? void 0 : o.map((s, i) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(Se, { children: s.message }) }) }, `${s.message}-${i}`)) });
|
|
1650
1655
|
}
|
|
1651
1656
|
function zo({
|
|
1652
1657
|
file: { status: e, file: o, error: t },
|
|
1653
1658
|
onCancel: n
|
|
1654
1659
|
}) {
|
|
1655
|
-
const [s, i] =
|
|
1660
|
+
const [s, i] = P(
|
|
1656
1661
|
null
|
|
1657
1662
|
);
|
|
1658
1663
|
se(() => {
|
|
@@ -1720,38 +1725,38 @@ function zo({
|
|
|
1720
1725
|
);
|
|
1721
1726
|
}
|
|
1722
1727
|
function No() {
|
|
1723
|
-
var
|
|
1724
|
-
const { isSmallScreen: e } = $(), o = B(null), { sendMessage: t } = A(), { sessionState: n } = U(), { disableSendingWhenAwaitingAIReply: s } = z(), { t: i } = V(), [a, l] =
|
|
1728
|
+
var R;
|
|
1729
|
+
const { isSmallScreen: e } = $(), o = B(null), { sendMessage: t } = A(), { sessionState: n } = U(), { disableSendingWhenAwaitingAIReply: s } = z(), { t: i } = V(), [a, l] = P(""), {
|
|
1725
1730
|
allFiles: c,
|
|
1726
1731
|
emptyTheFiles: p,
|
|
1727
1732
|
handleCancelUpload: v,
|
|
1728
1733
|
appendFiles: b,
|
|
1729
1734
|
isUploading: u,
|
|
1730
1735
|
successFiles: h
|
|
1731
|
-
} = sr(), x = !!((
|
|
1736
|
+
} = sr(), x = !!((R = n.session) != null && R.isHandedOff), { isAwaitingBotReply: C } = St(), T = s !== !1 && C, y = (g) => {
|
|
1732
1737
|
b(g);
|
|
1733
|
-
},
|
|
1734
|
-
if (
|
|
1738
|
+
}, N = !a.trim() && h.length === 0, _ = async () => {
|
|
1739
|
+
if (T || N) return;
|
|
1735
1740
|
u && console.info("please wait for the file(s) to upload");
|
|
1736
1741
|
const g = a.trim();
|
|
1737
1742
|
t({
|
|
1738
1743
|
content: g,
|
|
1739
1744
|
attachments: h.flatMap(
|
|
1740
|
-
(
|
|
1745
|
+
(I) => I.fileUrl ? [
|
|
1741
1746
|
{
|
|
1742
|
-
url:
|
|
1743
|
-
type:
|
|
1744
|
-
name:
|
|
1745
|
-
id:
|
|
1746
|
-
size:
|
|
1747
|
+
url: I.fileUrl,
|
|
1748
|
+
type: I.file.type,
|
|
1749
|
+
name: I.file.name,
|
|
1750
|
+
id: I.id,
|
|
1751
|
+
size: I.file.size
|
|
1747
1752
|
}
|
|
1748
1753
|
] : []
|
|
1749
1754
|
)
|
|
1750
1755
|
}), l(""), p();
|
|
1751
1756
|
}, {
|
|
1752
|
-
getRootProps:
|
|
1757
|
+
getRootProps: E,
|
|
1753
1758
|
getInputProps: w,
|
|
1754
|
-
open:
|
|
1759
|
+
open: M
|
|
1755
1760
|
} = Ur({
|
|
1756
1761
|
onDrop: y,
|
|
1757
1762
|
noClick: !0,
|
|
@@ -1772,16 +1777,16 @@ function No() {
|
|
|
1772
1777
|
"application/pdf": [".pdf"],
|
|
1773
1778
|
...mt
|
|
1774
1779
|
}
|
|
1775
|
-
}),
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1780
|
+
}), j = (g) => {
|
|
1781
|
+
const I = g.clipboardData;
|
|
1782
|
+
I && I.files.length > 0 && y(Array.from(I.files));
|
|
1778
1783
|
};
|
|
1779
1784
|
return /* @__PURE__ */ d(
|
|
1780
1785
|
"div",
|
|
1781
1786
|
{
|
|
1782
1787
|
...f("chat/input_box/root"),
|
|
1783
1788
|
className: "p-2 relative space-y-1",
|
|
1784
|
-
...
|
|
1789
|
+
...E(),
|
|
1785
1790
|
children: [
|
|
1786
1791
|
/* @__PURE__ */ r("input", { ...w() }),
|
|
1787
1792
|
/* @__PURE__ */ d(
|
|
@@ -1807,7 +1812,7 @@ function No() {
|
|
|
1807
1812
|
{
|
|
1808
1813
|
...f("chat/input_box/attachments_container"),
|
|
1809
1814
|
className: "flex items-center gap-1",
|
|
1810
|
-
children: /* @__PURE__ */ r(
|
|
1815
|
+
children: /* @__PURE__ */ r(D, { mode: "popLayout", children: c.map((g) => /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(
|
|
1811
1816
|
zo,
|
|
1812
1817
|
{
|
|
1813
1818
|
onCancel: () => v(g.id),
|
|
@@ -1820,7 +1825,7 @@ function No() {
|
|
|
1820
1825
|
"textarea",
|
|
1821
1826
|
{
|
|
1822
1827
|
...f("chat/input_box/textarea"),
|
|
1823
|
-
onPaste:
|
|
1828
|
+
onPaste: j,
|
|
1824
1829
|
ref: o,
|
|
1825
1830
|
id: "chat-input",
|
|
1826
1831
|
value: a,
|
|
@@ -1838,7 +1843,7 @@ function No() {
|
|
|
1838
1843
|
),
|
|
1839
1844
|
onChange: (g) => l(g.target.value),
|
|
1840
1845
|
onKeyDown: async (g) => {
|
|
1841
|
-
g.key === "Enter" && !g.shiftKey && (g.preventDefault(),
|
|
1846
|
+
g.key === "Enter" && !g.shiftKey && (g.preventDefault(), _());
|
|
1842
1847
|
},
|
|
1843
1848
|
placeholder: i("write_a_message_placeholder")
|
|
1844
1849
|
}
|
|
@@ -1854,27 +1859,27 @@ function No() {
|
|
|
1854
1859
|
align: "start",
|
|
1855
1860
|
content: "attach images, PDFs, or spreadsheets (maximum size 5mb)",
|
|
1856
1861
|
children: /* @__PURE__ */ r(
|
|
1857
|
-
|
|
1862
|
+
S,
|
|
1858
1863
|
{
|
|
1859
|
-
onClick:
|
|
1864
|
+
onClick: M,
|
|
1860
1865
|
size: "fit",
|
|
1861
1866
|
variant: "ghost",
|
|
1862
1867
|
className: m(
|
|
1863
1868
|
"rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"
|
|
1864
1869
|
),
|
|
1865
|
-
children: /* @__PURE__ */ r(
|
|
1870
|
+
children: /* @__PURE__ */ r(D, { mode: "wait", children: T ? /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(dt, { className: "size-4 opacity-50" }) }, "paper-clip-disabled") : /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(dt, { className: "size-4" }) }, "paper-clip") })
|
|
1866
1871
|
}
|
|
1867
1872
|
)
|
|
1868
1873
|
}
|
|
1869
1874
|
),
|
|
1870
1875
|
/* @__PURE__ */ r(oe, { content: "send message", side: "top", align: "end", children: /* @__PURE__ */ r(
|
|
1871
|
-
|
|
1876
|
+
S,
|
|
1872
1877
|
{
|
|
1873
1878
|
size: "fit",
|
|
1874
|
-
onClick:
|
|
1875
|
-
disabled:
|
|
1879
|
+
onClick: _,
|
|
1880
|
+
disabled: T || u || N,
|
|
1876
1881
|
className: "rounded-full size-8 flex items-center justify-center p-0",
|
|
1877
|
-
children: /* @__PURE__ */ r(
|
|
1882
|
+
children: /* @__PURE__ */ r(D, { mode: "wait", children: T || u ? /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(Ir, { className: "size-4 animate-spin animate-iteration-infinite" }) }, "loading") : /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(Dt, { className: "size-4" }) }, "send") })
|
|
1878
1883
|
}
|
|
1879
1884
|
) })
|
|
1880
1885
|
] })
|
|
@@ -1887,13 +1892,13 @@ function No() {
|
|
|
1887
1892
|
}
|
|
1888
1893
|
function vt() {
|
|
1889
1894
|
const { widgetCtx: e } = O(), { router: o } = z(), { canCreateNewSession: t } = U(), { toSessionsScreen: n } = H(), { t: s } = V();
|
|
1890
|
-
return /* @__PURE__ */ r(J, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(
|
|
1895
|
+
return /* @__PURE__ */ r(J, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(S, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(S, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
|
|
1891
1896
|
}
|
|
1892
1897
|
function So() {
|
|
1893
1898
|
const { t: e } = V(), { isCsatRequested: o, isCsatSubmitted: t } = Nt();
|
|
1894
|
-
return /* @__PURE__ */ r("div", { className: "p-2", children: /* @__PURE__ */ r("div", { className: "p-2 bg-muted rounded-3xl", children: /* @__PURE__ */ r(
|
|
1899
|
+
return /* @__PURE__ */ r("div", { className: "p-2", children: /* @__PURE__ */ r("div", { className: "p-2 bg-muted rounded-3xl", children: /* @__PURE__ */ r(D, { mode: "wait", children: o || t ? /* @__PURE__ */ d(W, { children: [
|
|
1895
1900
|
/* @__PURE__ */ r(ko, {}),
|
|
1896
|
-
/* @__PURE__ */ r(
|
|
1901
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: t && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(vt, {}) }, "new-conv-or-back-to-convs-button") })
|
|
1897
1902
|
] }, "csat") : /* @__PURE__ */ d(W, { children: [
|
|
1898
1903
|
/* @__PURE__ */ d("div", { className: "ps-2 flex items-center gap-1 pb-2", children: [
|
|
1899
1904
|
/* @__PURE__ */ r(Mt, { className: "size-4 text-emerald-600" }),
|
|
@@ -1905,7 +1910,7 @@ function So() {
|
|
|
1905
1910
|
function _o() {
|
|
1906
1911
|
var a;
|
|
1907
1912
|
const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = z(), { sessionState: n } = U(), { messagesState: s } = A(), i = s.messages.length === 0;
|
|
1908
|
-
return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(
|
|
1913
|
+
return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(D, { mode: "wait", children: n.session && !((a = n.session) != null && a.isOpened) ? /* @__PURE__ */ d(W, { children: [
|
|
1909
1914
|
/* @__PURE__ */ r(So, {}),
|
|
1910
1915
|
/* @__PURE__ */ r(xt, {})
|
|
1911
1916
|
] }, "session-closed") : /* @__PURE__ */ d(W, { children: [
|
|
@@ -2250,7 +2255,7 @@ function Wo() {
|
|
|
2250
2255
|
/* @__PURE__ */ r(Oo, {}),
|
|
2251
2256
|
/* @__PURE__ */ r(Fo, {}),
|
|
2252
2257
|
i.map((p, v) => {
|
|
2253
|
-
var h, x, C,
|
|
2258
|
+
var h, x, C, T;
|
|
2254
2259
|
const b = (h = p == null ? void 0 : p[0]) == null ? void 0 : h.type, u = (x = p[0]) == null ? void 0 : x.id;
|
|
2255
2260
|
if (!b || !u) return null;
|
|
2256
2261
|
if (Ro(p))
|
|
@@ -2267,7 +2272,7 @@ function Wo() {
|
|
|
2267
2272
|
));
|
|
2268
2273
|
}
|
|
2269
2274
|
if (jo(p)) {
|
|
2270
|
-
const y = (
|
|
2275
|
+
const y = (T = p[0]) == null ? void 0 : T.agent;
|
|
2271
2276
|
return /* @__PURE__ */ r(
|
|
2272
2277
|
pe,
|
|
2273
2278
|
{
|
|
@@ -2323,7 +2328,7 @@ function Lo() {
|
|
|
2323
2328
|
},
|
|
2324
2329
|
children: /* @__PURE__ */ d("div", { className: "size-full justify-between flex flex-col", children: [
|
|
2325
2330
|
/* @__PURE__ */ r(Zt, {}),
|
|
2326
|
-
/* @__PURE__ */ r(
|
|
2331
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: e ? /* @__PURE__ */ r(
|
|
2327
2332
|
k,
|
|
2328
2333
|
{
|
|
2329
2334
|
className: "flex flex-col items-center justify-center w-full flex-1",
|
|
@@ -2451,7 +2456,7 @@ function bt({
|
|
|
2451
2456
|
}) {
|
|
2452
2457
|
const { bot: t, humanAgent: n } = z(), { toChatScreen: s } = H(), i = e.assignee.kind === "human" ? (n == null ? void 0 : n.name) || e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", a = e.assignee.kind === "human" ? (n == null ? void 0 : n.avatarUrl) || e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatarUrl) || (t == null ? void 0 : t.avatar) || "";
|
|
2453
2458
|
return /* @__PURE__ */ d(
|
|
2454
|
-
|
|
2459
|
+
S,
|
|
2455
2460
|
{
|
|
2456
2461
|
variant: "ghost",
|
|
2457
2462
|
size: "lg",
|
|
@@ -2462,13 +2467,13 @@ function bt({
|
|
|
2462
2467
|
onClick: () => s(e.id),
|
|
2463
2468
|
children: [
|
|
2464
2469
|
/* @__PURE__ */ d("div", { className: "flex-1 flex gap-2 items-center", children: [
|
|
2465
|
-
/* @__PURE__ */ r(
|
|
2470
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ d(_e, { className: "size-10", children: [
|
|
2466
2471
|
/* @__PURE__ */ r(Ie, { src: a, alt: "Agent Icon" }),
|
|
2467
2472
|
/* @__PURE__ */ r(Te, { children: /* @__PURE__ */ r(Pr, { className: "size-4" }) })
|
|
2468
2473
|
] }) }) }),
|
|
2469
2474
|
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
2470
|
-
/* @__PURE__ */ r(
|
|
2471
|
-
/* @__PURE__ */ r(
|
|
2475
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: /* @__PURE__ */ r(k, { snapExit: !0, children: i }, i) }),
|
|
2476
|
+
/* @__PURE__ */ r(D, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(
|
|
2472
2477
|
Yt,
|
|
2473
2478
|
{
|
|
2474
2479
|
remarkPlugins: [Et],
|
|
@@ -2491,7 +2496,7 @@ function Uo() {
|
|
|
2491
2496
|
closedSessions: i,
|
|
2492
2497
|
canCreateNewSession: a
|
|
2493
2498
|
} = U();
|
|
2494
|
-
return /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col overflow-scroll py-2 px-2", children: /* @__PURE__ */ r(
|
|
2499
|
+
return /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col overflow-scroll py-2 px-2", children: /* @__PURE__ */ r(D, { mode: "wait", children: n ? /* @__PURE__ */ r(
|
|
2495
2500
|
k,
|
|
2496
2501
|
{
|
|
2497
2502
|
className: "flex-1 flex items-center justify-center",
|
|
@@ -2503,7 +2508,7 @@ function Uo() {
|
|
|
2503
2508
|
{
|
|
2504
2509
|
className: "flex-1 flex flex-col gap-2 relative",
|
|
2505
2510
|
children: t.length ? /* @__PURE__ */ d(J, { children: [
|
|
2506
|
-
/* @__PURE__ */ d(
|
|
2511
|
+
/* @__PURE__ */ d(D, { children: [
|
|
2507
2512
|
s.length > 0 && /* @__PURE__ */ r(
|
|
2508
2513
|
k,
|
|
2509
2514
|
{
|
|
@@ -2537,7 +2542,7 @@ function Uo() {
|
|
|
2537
2542
|
)
|
|
2538
2543
|
] }),
|
|
2539
2544
|
a && /* @__PURE__ */ r("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ ct(
|
|
2540
|
-
|
|
2545
|
+
S,
|
|
2541
2546
|
{
|
|
2542
2547
|
...f("sessions/new_conversation_btn"),
|
|
2543
2548
|
size: "lg",
|
|
@@ -2550,7 +2555,7 @@ function Uo() {
|
|
|
2550
2555
|
] }) : /* @__PURE__ */ d("div", { className: "flex-1 flex flex-col gap-2 items-center", children: [
|
|
2551
2556
|
/* @__PURE__ */ r("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ r("p", { className: "text-muted-foreground", children: e("no_conversations_yet") }) }),
|
|
2552
2557
|
/* @__PURE__ */ ct(
|
|
2553
|
-
|
|
2558
|
+
S,
|
|
2554
2559
|
{
|
|
2555
2560
|
...f("sessions/new_conversation_btn"),
|
|
2556
2561
|
size: "lg",
|
|
@@ -2642,7 +2647,7 @@ const Vo = ue.object({
|
|
|
2642
2647
|
email: ue.string().email()
|
|
2643
2648
|
});
|
|
2644
2649
|
function Go() {
|
|
2645
|
-
var y,
|
|
2650
|
+
var y, N, _, E, w, M, j, R;
|
|
2646
2651
|
const {
|
|
2647
2652
|
widgetCtx: { org: e }
|
|
2648
2653
|
} = O(), { setIsOpen: o } = Z(), { createUnverifiedContact: t } = _t(), { isSmallScreen: n } = $(), s = z(), { theme: i } = K(), { t: a } = V(), { observedElementRef: l } = qo();
|
|
@@ -2650,16 +2655,16 @@ function Go() {
|
|
|
2650
2655
|
height: void 0,
|
|
2651
2656
|
width: i.screens.welcome.width
|
|
2652
2657
|
});
|
|
2653
|
-
const [c, p] =
|
|
2658
|
+
const [c, p] = P(((y = s.prefillUserData) == null ? void 0 : y.name) || ""), [v, b] = P(((N = s.prefillUserData) == null ? void 0 : N.email) || ""), u = (s.extraDataCollectionFields || []).filter(
|
|
2654
2659
|
(g) => g !== "name" && g !== "email" && !!g
|
|
2655
|
-
), [h, x] =
|
|
2660
|
+
), [h, x] = P({}), [C, T] = Xr(
|
|
2656
2661
|
async (g) => {
|
|
2657
2662
|
g.preventDefault();
|
|
2658
|
-
const
|
|
2659
|
-
|
|
2663
|
+
const I = Vo.safeParse({ name: c, email: v });
|
|
2664
|
+
I.success && await t(
|
|
2660
2665
|
{
|
|
2661
|
-
email:
|
|
2662
|
-
non_verified_name:
|
|
2666
|
+
email: I.data.email,
|
|
2667
|
+
non_verified_name: I.data.name
|
|
2663
2668
|
},
|
|
2664
2669
|
// Only pass extra data if there is any
|
|
2665
2670
|
Object.values(h).filter(Boolean).length ? h : void 0
|
|
@@ -2700,18 +2705,18 @@ function Go() {
|
|
|
2700
2705
|
"text-primary-foreground"
|
|
2701
2706
|
),
|
|
2702
2707
|
children: [
|
|
2703
|
-
n && /* @__PURE__ */ r(k, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(
|
|
2704
|
-
/* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (
|
|
2708
|
+
n && /* @__PURE__ */ r(k, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(S, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(Ce, { className: "size-4" }) }) }),
|
|
2709
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (_ = s.assets) != null && _.organizationLogo ? /* @__PURE__ */ r(
|
|
2705
2710
|
"img",
|
|
2706
2711
|
{
|
|
2707
|
-
src: (
|
|
2712
|
+
src: (E = s.assets) == null ? void 0 : E.organizationLogo,
|
|
2708
2713
|
alt: "Company Logo",
|
|
2709
2714
|
className: "h-8 w-auto object-contain"
|
|
2710
2715
|
}
|
|
2711
2716
|
) : /* @__PURE__ */ r("h2", { className: "font-bold text-sm", children: e.name }) }),
|
|
2712
2717
|
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
2713
|
-
/* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((
|
|
2714
|
-
/* @__PURE__ */ r("p", { className: "text-sm", children: ((
|
|
2718
|
+
/* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((M = (w = s.textContent) == null ? void 0 : w.welcomeScreen) == null ? void 0 : M.title) || a("welcome_screen_title") }),
|
|
2719
|
+
/* @__PURE__ */ r("p", { className: "text-sm", children: ((R = (j = s.textContent) == null ? void 0 : j.welcomeScreen) == null ? void 0 : R.description) || a("welcome_screen_description") })
|
|
2715
2720
|
] })
|
|
2716
2721
|
]
|
|
2717
2722
|
}
|
|
@@ -2726,7 +2731,7 @@ function Go() {
|
|
|
2726
2731
|
"rounded-3xl"
|
|
2727
2732
|
),
|
|
2728
2733
|
children: [
|
|
2729
|
-
/* @__PURE__ */ d("form", { onSubmit:
|
|
2734
|
+
/* @__PURE__ */ d("form", { onSubmit: T, className: "space-y-2", children: [
|
|
2730
2735
|
/* @__PURE__ */ r(
|
|
2731
2736
|
de,
|
|
2732
2737
|
{
|
|
@@ -2752,16 +2757,16 @@ function Go() {
|
|
|
2752
2757
|
de,
|
|
2753
2758
|
{
|
|
2754
2759
|
value: h[g],
|
|
2755
|
-
onChange: (
|
|
2760
|
+
onChange: (I) => x((ie) => ({
|
|
2756
2761
|
...ie,
|
|
2757
|
-
[g]:
|
|
2762
|
+
[g]: I.target.value
|
|
2758
2763
|
})),
|
|
2759
2764
|
placeholder: `${g} (${a("optional")})`
|
|
2760
2765
|
},
|
|
2761
2766
|
g
|
|
2762
2767
|
)),
|
|
2763
2768
|
/* @__PURE__ */ d(
|
|
2764
|
-
|
|
2769
|
+
S,
|
|
2765
2770
|
{
|
|
2766
2771
|
disabled: C.loading,
|
|
2767
2772
|
className: "w-full",
|
|
@@ -2787,7 +2792,7 @@ function er() {
|
|
|
2787
2792
|
const {
|
|
2788
2793
|
routerState: { screen: e }
|
|
2789
2794
|
} = H();
|
|
2790
|
-
return /* @__PURE__ */ r("div", { className: "relative bg-background size-full", children: /* @__PURE__ */ r(
|
|
2795
|
+
return /* @__PURE__ */ r("div", { className: "relative bg-background size-full", children: /* @__PURE__ */ r(D, { mode: "wait", children: (() => {
|
|
2791
2796
|
switch (e) {
|
|
2792
2797
|
case "welcome":
|
|
2793
2798
|
return /* @__PURE__ */ r(
|
|
@@ -2827,7 +2832,7 @@ function er() {
|
|
|
2827
2832
|
}
|
|
2828
2833
|
})() }) });
|
|
2829
2834
|
}
|
|
2830
|
-
const Zo = "4.0.
|
|
2835
|
+
const Zo = "4.0.58", Ko = `<!DOCTYPE html>
|
|
2831
2836
|
<html>
|
|
2832
2837
|
<head>
|
|
2833
2838
|
<style>
|
|
@@ -3066,7 +3071,7 @@ function tn() {
|
|
|
3066
3071
|
"bg-primary",
|
|
3067
3072
|
"text-primary-foreground"
|
|
3068
3073
|
),
|
|
3069
|
-
children: /* @__PURE__ */ r(
|
|
3074
|
+
children: /* @__PURE__ */ r(D, { mode: "wait", children: e ? /* @__PURE__ */ r(
|
|
3070
3075
|
k,
|
|
3071
3076
|
{
|
|
3072
3077
|
snapExit: !0,
|