@sendbird/ai-agent-messenger-react 1.2.2 → 1.2.3
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/cjs/{DVFnHuzP.cjs → B3amOKMy.cjs} +1 -1
- package/dist/cjs/{tVaciR-_.cjs → BfJ7Izyu.cjs} +26 -26
- package/dist/cjs/{D_C06nOa.cjs → C-xAG8K6.cjs} +1 -1
- package/dist/cjs/{3obOzjh1.cjs → D3l33ZWe.cjs} +1 -1
- package/dist/cjs/{CdinIZGy.cjs → DKjB_ZFo.cjs} +1 -1
- package/dist/cjs/Dr0IKtV9.cjs +1 -0
- package/dist/es/{DLjpH35l.js → C5iCey_D.js} +531 -545
- package/dist/es/CDvzufwm.js +32 -0
- package/dist/es/{PXojwkiO.js → CSENM0Ja.js} +1 -1
- package/dist/es/{DRPdjwTV.js → Cj-eLEq_.js} +1 -1
- package/dist/es/{BMNdyD6n.js → DnQv_mT2.js} +1 -1
- package/dist/es/{BX7cHbkb.js → O53SSRM8.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/Cg6k0N51.cjs +0 -1
- package/dist/es/x6g8obrl.js +0 -22
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createContext as Te, useContext as
|
|
3
|
-
import wr, { SendbirdProduct as kr, DeviceOsPlatform as
|
|
4
|
-
import u, { css as $, ThemeProvider as Or, useTheme as
|
|
5
|
-
import { format as
|
|
2
|
+
import { createContext as Te, useContext as re, useEffect as D, useState as S, useId as bn, useRef as F, useCallback as U, useLayoutEffect as ce, forwardRef as Re, useImperativeHandle as vr, lazy as w, Suspense as Oe, useMemo as ve, Component as _r, Fragment as Bt, useReducer as Sr, Children as Tr } from "react";
|
|
3
|
+
import wr, { SendbirdProduct as kr, DeviceOsPlatform as Ft, SendbirdPlatform as Ar, ConnectionHandler as Qe, SendbirdError as Ir, SessionHandler as $r, LogLevel as xn, ConnectionState as Mr } from "@sendbird/chat";
|
|
4
|
+
import u, { css as $, ThemeProvider as Or, useTheme as Et, createGlobalStyle as Lr, StyleSheetManager as Rr, keyframes as En } from "styled-components";
|
|
5
|
+
import { format as Cn, isSameMinute as Ut, isSameDay as Dr } from "date-fns";
|
|
6
6
|
import { enUS as Nr } from "date-fns/locale/en-US";
|
|
7
7
|
import { AIAgentModule as Pr, ConversationStatus as W, ConversationType as Br } from "@sendbird/chat/aiAgent";
|
|
8
|
-
import { useGroupChannelMessages as Fr, useGroupChannelHandler as
|
|
9
|
-
import { GroupChannelModule as Hr, GroupChannelListOrder as
|
|
8
|
+
import { useGroupChannelMessages as Fr, useGroupChannelHandler as yn, useForceUpdate as Ur } from "@sendbird/uikit-tools";
|
|
9
|
+
import { GroupChannelModule as Hr, GroupChannelListOrder as vn, GroupChannelHandler as zr } from "@sendbird/chat/groupChannel";
|
|
10
10
|
import { renderer as Vr, parser as Wr, MessageProvider as Gr } from "@sendbird/react-uikit-message-template-view";
|
|
11
11
|
import { createMessageTemplate as jr } from "@sendbird/uikit-message-template";
|
|
12
|
-
import
|
|
12
|
+
import _n from "dompurify";
|
|
13
13
|
import { MessageMetaArray as Kr, SendingStatus as Zr } from "@sendbird/chat/message";
|
|
14
14
|
import { isSameDay as Yr } from "date-fns/isSameDay";
|
|
15
15
|
import { createPortal as qr } from "react-dom";
|
|
16
16
|
import Jr from "@emotion/is-prop-valid";
|
|
17
17
|
const j = (e, t) => {
|
|
18
18
|
const n = Te(null), o = ({ children: s, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof s == "function" ? s(l) : s), i = ({ children: s }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof s == "function" ? s(l) : s : null), a = () => {
|
|
19
|
-
const s =
|
|
19
|
+
const s = re(n);
|
|
20
20
|
if (!s)
|
|
21
21
|
throw new Error(`use${e}Context must be used within a ${e}Provider`);
|
|
22
22
|
return s;
|
|
@@ -33,7 +33,7 @@ function we(e) {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
function n({ children: a }) {
|
|
36
|
-
const [s, l] =
|
|
36
|
+
const [s, l] = S(() => e.template), [c, d] = S(e.components), m = {
|
|
37
37
|
Template: s,
|
|
38
38
|
updateTemplate: (g) => l(() => g),
|
|
39
39
|
components: c,
|
|
@@ -42,7 +42,7 @@ function we(e) {
|
|
|
42
42
|
return /* @__PURE__ */ r.createElement(t.Provider, { value: m }, a);
|
|
43
43
|
}
|
|
44
44
|
function o({ template: a, children: s }) {
|
|
45
|
-
const { updateTemplate: l } =
|
|
45
|
+
const { updateTemplate: l } = re(t);
|
|
46
46
|
return D(() => {
|
|
47
47
|
a && l(a);
|
|
48
48
|
}, [a]), /* @__PURE__ */ r.createElement(r.Fragment, null, s);
|
|
@@ -50,11 +50,11 @@ function we(e) {
|
|
|
50
50
|
function i({ children: a }) {
|
|
51
51
|
return /* @__PURE__ */ r.createElement(n, null, a);
|
|
52
52
|
}
|
|
53
|
-
return i.defaults = e, i.useContext = () =>
|
|
53
|
+
return i.defaults = e, i.useContext = () => re(t), i.Context = t, i.Template = o, Object.keys(e.components).forEach((a) => {
|
|
54
54
|
i[a] = function({
|
|
55
55
|
component: l
|
|
56
56
|
}) {
|
|
57
|
-
const { updateComponent: c } =
|
|
57
|
+
const { updateComponent: c } = re(t);
|
|
58
58
|
return D(() => {
|
|
59
59
|
l && c(a, l);
|
|
60
60
|
}, [l]), null;
|
|
@@ -72,15 +72,15 @@ function Qr() {
|
|
|
72
72
|
const e = /iPad|iPhone|iPod/.test(navigator.userAgent), t = /Android/.test(navigator.userAgent);
|
|
73
73
|
return e || t;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const Ht = (e) => {
|
|
76
76
|
try {
|
|
77
77
|
return JSON.parse(e === "" ? "{}" : e);
|
|
78
78
|
} catch {
|
|
79
79
|
return {};
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, et = {
|
|
82
82
|
isStreaming(e) {
|
|
83
|
-
const t =
|
|
83
|
+
const t = Ht(e.data);
|
|
84
84
|
return typeof t == "object" && !!t.stream;
|
|
85
85
|
},
|
|
86
86
|
isWelcomeMessage(e, t) {
|
|
@@ -88,7 +88,7 @@ const zt = (e) => {
|
|
|
88
88
|
if (((n = e.extendedMessagePayload) == null ? void 0 : n.bot_message_type) === "welcome")
|
|
89
89
|
return !0;
|
|
90
90
|
if ((e.isUserMessage() || e.isFileMessage()) && e.sender.userId === t) {
|
|
91
|
-
const o =
|
|
91
|
+
const o = Ht(e.data);
|
|
92
92
|
return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
|
|
93
93
|
}
|
|
94
94
|
return !1;
|
|
@@ -98,7 +98,7 @@ const zt = (e) => {
|
|
|
98
98
|
return ((t = e.extendedMessagePayload) == null ? void 0 : t.bot_message_type) === "generated";
|
|
99
99
|
},
|
|
100
100
|
checkExtendedFieldPresence(e) {
|
|
101
|
-
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(
|
|
101
|
+
const t = e.extendedMessagePayload || {}, n = (s) => s.some((l) => typeof t[l] < "u"), o = n(at.ui), i = n(at.trail), a = n(at.marking);
|
|
102
102
|
return { ui: o, trail: i, marking: a };
|
|
103
103
|
},
|
|
104
104
|
shouldScrollToBottom(e, t, n = !1) {
|
|
@@ -110,12 +110,12 @@ const zt = (e) => {
|
|
|
110
110
|
}
|
|
111
111
|
return !0;
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, at = {
|
|
114
114
|
ui: ["suggested_replies", "cta_button", "message_template", "csat"],
|
|
115
115
|
trail: ["groundedness", "manual", "function_calls"],
|
|
116
116
|
marking: ["is_hallucination", "is_moderated", "flagged_types"]
|
|
117
117
|
};
|
|
118
|
-
class
|
|
118
|
+
class Sn {
|
|
119
119
|
constructor(t) {
|
|
120
120
|
this.logger = t, this.subscribers = {};
|
|
121
121
|
}
|
|
@@ -142,9 +142,9 @@ const eo = () => {
|
|
|
142
142
|
return { promise: new Promise((o, i) => {
|
|
143
143
|
e = o, t = i;
|
|
144
144
|
}), resolve: e, reject: t };
|
|
145
|
-
}, to = "1.2.
|
|
146
|
-
var
|
|
147
|
-
class
|
|
145
|
+
}, to = "1.2.3", Ie = "sb-agent", no = to;
|
|
146
|
+
var Tn = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(Tn || {});
|
|
147
|
+
class wn {
|
|
148
148
|
constructor(t) {
|
|
149
149
|
this.level = t;
|
|
150
150
|
}
|
|
@@ -164,7 +164,7 @@ class kn {
|
|
|
164
164
|
this.level <= 4 && console.error(`[${Ie}/error]`, ...t);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function zt(e, t, n) {
|
|
168
168
|
const o = wr.init({
|
|
169
169
|
appId: e,
|
|
170
170
|
modules: [new Hr(), new Pr()],
|
|
@@ -179,7 +179,7 @@ function Vt(e, t, n) {
|
|
|
179
179
|
}
|
|
180
180
|
const {
|
|
181
181
|
Provider: ro,
|
|
182
|
-
useContext:
|
|
182
|
+
useContext: tt
|
|
183
183
|
} = j("AIAgent");
|
|
184
184
|
function oo({
|
|
185
185
|
appId: e,
|
|
@@ -194,11 +194,11 @@ function oo({
|
|
|
194
194
|
dispatcher: d,
|
|
195
195
|
extensions: m = {
|
|
196
196
|
platform: Ar.JS,
|
|
197
|
-
deviceOSPlatform: Qr() ?
|
|
197
|
+
deviceOSPlatform: Qr() ? Ft.MOBILE_WEB : Ft.WEB
|
|
198
198
|
}
|
|
199
199
|
}) {
|
|
200
|
-
const [g, p] =
|
|
201
|
-
const x = c ?? new
|
|
200
|
+
const [g, p] = S(() => {
|
|
201
|
+
const x = c ?? new wn(Tn.WARN), f = d ?? new Sn(x);
|
|
202
202
|
return {
|
|
203
203
|
appId: e,
|
|
204
204
|
aiAgentId: t,
|
|
@@ -207,13 +207,13 @@ function oo({
|
|
|
207
207
|
context: i,
|
|
208
208
|
logger: x,
|
|
209
209
|
dispatcher: f,
|
|
210
|
-
chatSDK: a ??
|
|
210
|
+
chatSDK: a ?? zt(e, m, s)
|
|
211
211
|
};
|
|
212
212
|
});
|
|
213
213
|
return D(() => {
|
|
214
214
|
p((x) => {
|
|
215
215
|
let f = x.logger, E = x.dispatcher, b = x.chatSDK;
|
|
216
|
-
return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b =
|
|
216
|
+
return c && c !== x.logger && (f = c), d && d !== x.dispatcher && (E = d), a && a !== x.chatSDK ? b = a : !a && x.chatSDK.appId !== e && (b = zt(e, m, { newInstance: !0, ...s })), {
|
|
217
217
|
...x,
|
|
218
218
|
appId: e,
|
|
219
219
|
aiAgentId: t,
|
|
@@ -261,7 +261,7 @@ function uo({
|
|
|
261
261
|
onAfterSendMessage: l = mt
|
|
262
262
|
}) {
|
|
263
263
|
var b;
|
|
264
|
-
const { chatSDK: c, logger: d, dispatcher: m } =
|
|
264
|
+
const { chatSDK: c, logger: d, dispatcher: m } = tt(), { channel: g, channelFetchError: p, fetchChannel: x } = mo(t), f = io(c, g, {
|
|
265
265
|
shouldCountNewMessages: () => !1,
|
|
266
266
|
onChannelDeleted: n,
|
|
267
267
|
onMessagesReceived: (C) => o == null ? void 0 : o(C),
|
|
@@ -310,14 +310,14 @@ function uo({
|
|
|
310
310
|
return /* @__PURE__ */ r.createElement(co, { value: E }, e);
|
|
311
311
|
}
|
|
312
312
|
function mo(e) {
|
|
313
|
-
const { chatSDK: t, logger: n } =
|
|
313
|
+
const { chatSDK: t, logger: n } = tt(), [o, i] = S(void 0), [a, s] = S(void 0);
|
|
314
314
|
async function l() {
|
|
315
315
|
if (n.debug("conversation.fetchChannel: start"), i(void 0), s(void 0), e)
|
|
316
316
|
try {
|
|
317
317
|
n.debug("conversation.fetchChannel: get channel", e);
|
|
318
318
|
const c = await t.groupChannel.getChannel(e);
|
|
319
319
|
i(c);
|
|
320
|
-
const d = new
|
|
320
|
+
const d = new Qe({ onReconnectSucceeded: () => c.refresh() });
|
|
321
321
|
t.addConnectionHandler("sba-refresh", d), n.debug("conversation.fetchChannel: fetched channel", c);
|
|
322
322
|
} catch (c) {
|
|
323
323
|
c instanceof Ir && s(c), n.error("conversation.fetchChannel: error", c);
|
|
@@ -339,7 +339,7 @@ class ho {
|
|
|
339
339
|
*/
|
|
340
340
|
constructor(t, { filter: n, limit: o = 20 }) {
|
|
341
341
|
var i, a, s, l, c;
|
|
342
|
-
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order =
|
|
342
|
+
this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = vn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
|
|
343
343
|
aiAgentChannelFilter: (i = this.filter) == null ? void 0 : i.aiAgentChannelFilter,
|
|
344
344
|
aiAgentConversationStatusFilter: (a = this.filter) == null ? void 0 : a.aiAgentConversationStatusFilter,
|
|
345
345
|
aiAgentIds: (s = this.filter) == null ? void 0 : s.aiAgentIds,
|
|
@@ -353,7 +353,7 @@ class ho {
|
|
|
353
353
|
onChannelDeleted: (d) => {
|
|
354
354
|
this._removeChannelsFromView([d]);
|
|
355
355
|
}
|
|
356
|
-
}), this._connectionHandler = new
|
|
356
|
+
}), this._connectionHandler = new Qe({
|
|
357
357
|
onReconnectSucceeded: () => {
|
|
358
358
|
this._isDefaultChangelogSyncTimestampUpdated && this._syncChannelChangelogs();
|
|
359
359
|
}
|
|
@@ -512,7 +512,7 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
512
512
|
const o = gt(e, t);
|
|
513
513
|
let i = 0, a = e.length - 1, s = Math.floor((i + a) / 2);
|
|
514
514
|
for (; i < a; ) {
|
|
515
|
-
const c =
|
|
515
|
+
const c = Vt(e[s], t, n);
|
|
516
516
|
if (c > 0)
|
|
517
517
|
a = s, s = Math.floor((i + a) / 2);
|
|
518
518
|
else if (c < 0)
|
|
@@ -520,12 +520,12 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
520
520
|
else
|
|
521
521
|
return { place: s, oldPosition: o };
|
|
522
522
|
}
|
|
523
|
-
return { place:
|
|
523
|
+
return { place: Vt(e[s], t, n) >= 0 ? s : s + 1, oldPosition: o };
|
|
524
524
|
}
|
|
525
525
|
return { place: e.length, oldPosition: -1 };
|
|
526
|
-
},
|
|
526
|
+
}, Vt = (e, t, n) => {
|
|
527
527
|
switch (n) {
|
|
528
|
-
case
|
|
528
|
+
case vn.LATEST_LAST_MESSAGE:
|
|
529
529
|
if (e.lastMessage && t.lastMessage) {
|
|
530
530
|
const o = t.lastMessage.createdAt - e.lastMessage.createdAt;
|
|
531
531
|
return o === 0 ? t.createdAt - e.createdAt : o;
|
|
@@ -535,8 +535,8 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
|
|
|
535
535
|
}
|
|
536
536
|
};
|
|
537
537
|
function po(e, t) {
|
|
538
|
-
var f, E, b, C, v, T,
|
|
539
|
-
const n =
|
|
538
|
+
var f, E, b, C, v, T, _, K;
|
|
539
|
+
const n = bn(), [o, i] = S(!1), [a, s] = S(null), [l, c] = S([]), [d, m] = S(null), g = F(!1), p = U(async () => {
|
|
540
540
|
if (!g.current && e.currentUser) {
|
|
541
541
|
g.current = !0, i(!1), s(null), c([]);
|
|
542
542
|
try {
|
|
@@ -565,7 +565,7 @@ function po(e, t) {
|
|
|
565
565
|
(b = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : b.join(),
|
|
566
566
|
(v = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : v.join(),
|
|
567
567
|
(T = t.filter) == null ? void 0 : T.deskChannelFilter,
|
|
568
|
-
(
|
|
568
|
+
(K = (_ = t.filter) == null ? void 0 : _.pinnedChannelUrls) == null ? void 0 : K.join(),
|
|
569
569
|
t.limit
|
|
570
570
|
]), x = U(async () => {
|
|
571
571
|
if (d)
|
|
@@ -575,7 +575,7 @@ function po(e, t) {
|
|
|
575
575
|
s(L);
|
|
576
576
|
}
|
|
577
577
|
}, [d]);
|
|
578
|
-
return D(() => (e.addConnectionHandler(n, new
|
|
578
|
+
return D(() => (e.addConnectionHandler(n, new Qe({ onConnected: () => p() })), () => e.removeConnectionHandler(n)), [e, n, p]), D(() => {
|
|
579
579
|
p();
|
|
580
580
|
}, [p]), D(() => () => {
|
|
581
581
|
g.current = !1, d == null || d.dispose();
|
|
@@ -590,7 +590,7 @@ const {
|
|
|
590
590
|
Provider: fo
|
|
591
591
|
} = j("AIAgentConversationList");
|
|
592
592
|
function bo({ conversationListFilter: e, children: t }) {
|
|
593
|
-
const { chatSDK: n, aiAgentId: o } =
|
|
593
|
+
const { chatSDK: n, aiAgentId: o } = tt(), i = po(n, {
|
|
594
594
|
filter: {
|
|
595
595
|
aiAgentIds: [o],
|
|
596
596
|
aiAgentConversationStatusFilter: [W.CLOSED],
|
|
@@ -611,11 +611,11 @@ const pt = {
|
|
|
611
611
|
WHITE: "#ffffff",
|
|
612
612
|
BLACK: "#000000"
|
|
613
613
|
};
|
|
614
|
-
function
|
|
614
|
+
function kn(e) {
|
|
615
615
|
return e.length === 4 ? `#${[...e.slice(1)].map((t) => t + t).join("")}` : e;
|
|
616
616
|
}
|
|
617
617
|
function xo(e) {
|
|
618
|
-
const t =
|
|
618
|
+
const t = kn(e);
|
|
619
619
|
return [
|
|
620
620
|
parseInt(t.slice(1, 3), 16),
|
|
621
621
|
// r
|
|
@@ -647,21 +647,21 @@ function yo(e, t, n) {
|
|
|
647
647
|
}
|
|
648
648
|
return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function He(e, t, n) {
|
|
651
651
|
const [o, i, a] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] = yo(s, m, d);
|
|
652
652
|
return Eo([Math.round(g), Math.round(p), Math.round(x)]);
|
|
653
653
|
}
|
|
654
654
|
function vo(e, t = "light") {
|
|
655
655
|
return {
|
|
656
|
-
extraDark:
|
|
657
|
-
dark:
|
|
656
|
+
extraDark: He(e, 0.6, 1.2),
|
|
657
|
+
dark: He(e, 0.85, 1.1),
|
|
658
658
|
main: e,
|
|
659
|
-
light:
|
|
660
|
-
extraLight:
|
|
659
|
+
light: He(e, t === "dark" ? 1.1 : 1.5, t === "dark" ? 0.95 : 0.9),
|
|
660
|
+
extraLight: He(e, t === "dark" ? 1.2 : 1.75, t === "dark" ? 0.9 : 0.8)
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
function ft(e) {
|
|
664
|
-
const t =
|
|
664
|
+
const t = kn(e), n = 149, o = +`0x${t[1]}${t[2]}`, i = +`0x${t[3]}${t[4]}`, a = +`0x${t[5]}${t[6]}`;
|
|
665
665
|
return o * 0.299 + i * 0.587 + a * 0.114 > n ? pt.BLACK : pt.WHITE;
|
|
666
666
|
}
|
|
667
667
|
function _o(e, t, n, o, i) {
|
|
@@ -719,7 +719,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
719
719
|
csat: {
|
|
720
720
|
background: e.background400
|
|
721
721
|
}
|
|
722
|
-
}),
|
|
722
|
+
}), ze = {
|
|
723
723
|
primary: {
|
|
724
724
|
extraDark: "#491389",
|
|
725
725
|
dark: "#6211c8",
|
|
@@ -772,7 +772,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
772
772
|
dark: "rgba(0, 0, 0, 0.55)",
|
|
773
773
|
light: "rgba(22, 22, 22, 0.32)"
|
|
774
774
|
}
|
|
775
|
-
},
|
|
775
|
+
}, lt = {
|
|
776
776
|
h1: { fontSize: 18, fontWeight: 700 },
|
|
777
777
|
h2: { fontSize: 16, fontWeight: 700 },
|
|
778
778
|
subtitle1: { fontSize: 16, fontWeight: 500 },
|
|
@@ -786,7 +786,7 @@ const So = (e, t, n, o, i) => ({
|
|
|
786
786
|
caption3: { fontSize: 11, fontWeight: 700 },
|
|
787
787
|
caption4: { fontSize: 11, fontWeight: 400 }
|
|
788
788
|
};
|
|
789
|
-
function
|
|
789
|
+
function Wt(e) {
|
|
790
790
|
const t = To(e), { colors: n, aiAgentColorVariables: o } = wo(e, t), i = Ao(e);
|
|
791
791
|
return {
|
|
792
792
|
selectedTheme: e.selectedTheme,
|
|
@@ -797,9 +797,9 @@ function Gt(e) {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
function To({ selectedTheme: e, palette: t, primary: n }) {
|
|
800
|
-
const o = t != null && t.primary ? t.primary : n ? n ===
|
|
800
|
+
const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : vo(n, e) : ze.primary;
|
|
801
801
|
return {
|
|
802
|
-
...
|
|
802
|
+
...ze,
|
|
803
803
|
primary: o,
|
|
804
804
|
...t
|
|
805
805
|
};
|
|
@@ -831,23 +831,23 @@ function ko(e, t, n) {
|
|
|
831
831
|
}
|
|
832
832
|
function Ao({ typography: e }) {
|
|
833
833
|
if (!e)
|
|
834
|
-
return
|
|
835
|
-
const t = { ...
|
|
834
|
+
return lt;
|
|
835
|
+
const t = { ...lt };
|
|
836
836
|
return Object.keys(e).forEach((n) => {
|
|
837
837
|
const o = e[n];
|
|
838
838
|
if (o && typeof o == "object") {
|
|
839
|
-
const i =
|
|
839
|
+
const i = lt[n], a = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
|
|
840
840
|
t[n] = ko(i, o, a);
|
|
841
841
|
}
|
|
842
842
|
}), t;
|
|
843
843
|
}
|
|
844
844
|
const {
|
|
845
845
|
Provider: Io,
|
|
846
|
-
useContext:
|
|
846
|
+
useContext: An
|
|
847
847
|
} = j("AIAgentTheme");
|
|
848
848
|
function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }) {
|
|
849
|
-
const [a, s] =
|
|
850
|
-
() =>
|
|
849
|
+
const [a, s] = S(
|
|
850
|
+
() => Wt({
|
|
851
851
|
selectedTheme: (o == null ? void 0 : o.theme) ?? "light",
|
|
852
852
|
palette: t,
|
|
853
853
|
typography: n,
|
|
@@ -863,7 +863,7 @@ function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
863
863
|
botMessageBackgroundContrast: void 0
|
|
864
864
|
};
|
|
865
865
|
!p.primary && (g != null && g.primaryColor) && (p.primary = g.primaryColor, p.primaryContrast = g.primaryContrastColor), !p.botMessageBackground && (g != null && g.botMessageBackgroundColor) && (p.botMessageBackground = g.botMessageBackgroundColor, p.botMessageBackgroundContrast = g.botMessageBackgroundContrastColor);
|
|
866
|
-
const x =
|
|
866
|
+
const x = Wt({ selectedTheme: m, palette: t, typography: n, ...p });
|
|
867
867
|
s(x), e == null || e.info("theme.update:", m);
|
|
868
868
|
},
|
|
869
869
|
[o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor, t, n, e]
|
|
@@ -872,14 +872,14 @@ function $o({ logger: e, palette: t, typography: n, appearance: o, children: i }
|
|
|
872
872
|
(o != null && o.theme || o != null && o.primaryColor || o != null && o.botMessageBackgroundColor) && l(a.selectedTheme);
|
|
873
873
|
}, [o == null ? void 0 : o.theme, o == null ? void 0 : o.primaryColor, o == null ? void 0 : o.botMessageBackgroundColor]), /* @__PURE__ */ r.createElement(Io, { value: { theme: a, updateTheme: l } }, i);
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const In = (e) => {
|
|
876
876
|
try {
|
|
877
877
|
const t = JSON.parse(e);
|
|
878
878
|
return typeof t == "string" ? JSON.stringify(t).slice(1, -1) : e.trim();
|
|
879
879
|
} catch {
|
|
880
880
|
return JSON.stringify(e).slice(1, -1);
|
|
881
881
|
}
|
|
882
|
-
},
|
|
882
|
+
}, De = (e) => JSON.parse(e), nt = (e) => JSON.parse(e);
|
|
883
883
|
function Mo(e, t) {
|
|
884
884
|
const [n, o] = t.split(",").map((i) => i.trim());
|
|
885
885
|
return e === "dark" && o || n;
|
|
@@ -894,7 +894,7 @@ function Oo(e) {
|
|
|
894
894
|
}
|
|
895
895
|
return n(e), t;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Ct({
|
|
898
898
|
template: e,
|
|
899
899
|
variables: t,
|
|
900
900
|
variableKeyPattern: n,
|
|
@@ -904,7 +904,7 @@ function yt({
|
|
|
904
904
|
if (!o && !["number", "boolean", "string"].includes(typeof s))
|
|
905
905
|
throw new Error("If transformer is not provided, value must be a {string, number, or boolean}");
|
|
906
906
|
const l = o ? o(s) : String(s), c = n(a);
|
|
907
|
-
return i.replace(c,
|
|
907
|
+
return i.replace(c, In(l));
|
|
908
908
|
}, e);
|
|
909
909
|
}
|
|
910
910
|
async function Lo({
|
|
@@ -918,7 +918,7 @@ async function Lo({
|
|
|
918
918
|
const l = await o(s);
|
|
919
919
|
return { regex: n(a), transformedValue: l };
|
|
920
920
|
})
|
|
921
|
-
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s,
|
|
921
|
+
)).reduce((a, { regex: s, transformedValue: l }) => a.replace(s, In(l)), e);
|
|
922
922
|
}
|
|
923
923
|
const Ro = (e) => ({
|
|
924
924
|
setTemplate: (t, n) => e.onSetTemplate(t, n),
|
|
@@ -928,7 +928,7 @@ const Ro = (e) => ({
|
|
|
928
928
|
clear: () => e.onClear()
|
|
929
929
|
}), {
|
|
930
930
|
Provider: Do,
|
|
931
|
-
useContext:
|
|
931
|
+
useContext: $n
|
|
932
932
|
} = j("MessageCacheTemplate");
|
|
933
933
|
function No({ logger: e, storage: t, children: n }) {
|
|
934
934
|
const o = U(
|
|
@@ -945,7 +945,7 @@ function No({ logger: e, storage: t, children: n }) {
|
|
|
945
945
|
try {
|
|
946
946
|
const { templates: l, token: c } = await s.aiAgent.getMessageTemplates({ limit: 20 });
|
|
947
947
|
for (const { template: d } of l) {
|
|
948
|
-
const { key: m } =
|
|
948
|
+
const { key: m } = De(d);
|
|
949
949
|
t.setTemplate(m, d);
|
|
950
950
|
}
|
|
951
951
|
t.setCachedToken(c);
|
|
@@ -975,10 +975,10 @@ function Po(e) {
|
|
|
975
975
|
}
|
|
976
976
|
const {
|
|
977
977
|
Provider: Bo,
|
|
978
|
-
useContext:
|
|
978
|
+
useContext: Mn
|
|
979
979
|
} = j("MessageTemplateFetching");
|
|
980
980
|
function Fo({ children: e, internalVariables: t }) {
|
|
981
|
-
const n = F({}), o = F({}), [i, a] =
|
|
981
|
+
const n = F({}), o = F({}), [i, a] = S({}), s = U((d, m) => {
|
|
982
982
|
a((g) => ({
|
|
983
983
|
...g,
|
|
984
984
|
[d]: { fetching: !1, error: !1, ...g[d], ...m }
|
|
@@ -1023,27 +1023,27 @@ function Fo({ children: e, internalVariables: t }) {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
return /* @__PURE__ */ r.createElement(Bo, { value: c }, e);
|
|
1025
1025
|
}
|
|
1026
|
-
const
|
|
1026
|
+
const rt = {
|
|
1027
1027
|
VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
|
|
1028
1028
|
VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
|
|
1029
1029
|
};
|
|
1030
|
-
function
|
|
1030
|
+
function de({ uiTemplateString: e, variables: t = {} }) {
|
|
1031
1031
|
const n = Oo(t);
|
|
1032
|
-
return
|
|
1032
|
+
return Ct({
|
|
1033
1033
|
template: e,
|
|
1034
1034
|
variables: n,
|
|
1035
|
-
variableKeyPattern: (o) =>
|
|
1035
|
+
variableKeyPattern: (o) => rt.VARIABLE(o)
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function ue({
|
|
1039
1039
|
theme: e,
|
|
1040
1040
|
uiTemplateString: t,
|
|
1041
1041
|
colorVariables: n = {}
|
|
1042
1042
|
}) {
|
|
1043
|
-
return
|
|
1043
|
+
return Ct({
|
|
1044
1044
|
template: t,
|
|
1045
1045
|
variables: n,
|
|
1046
|
-
variableKeyPattern: (o) =>
|
|
1046
|
+
variableKeyPattern: (o) => rt.VARIABLE(o),
|
|
1047
1047
|
variableValueTransformer: (o) => Mo(e, o)
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
@@ -1056,29 +1056,29 @@ function Uo({
|
|
|
1056
1056
|
onRequestTemplate: a
|
|
1057
1057
|
}) {
|
|
1058
1058
|
const l = Object.values(n).flat().map((d) => d.key);
|
|
1059
|
-
return [...new Set(l)].some((d) => !a(d)) ? null :
|
|
1059
|
+
return [...new Set(l)].some((d) => !a(d)) ? null : Ct({
|
|
1060
1060
|
template: t,
|
|
1061
1061
|
variables: n,
|
|
1062
|
-
variableKeyPattern: (d) =>
|
|
1062
|
+
variableKeyPattern: (d) => rt.VIEW_VARIABLE(d),
|
|
1063
1063
|
variableValueTransformer: (d) => {
|
|
1064
1064
|
const m = d.map(({ key: g, variables: p }) => {
|
|
1065
|
-
const x = a(g), { ui_template: f, color_variables: E } =
|
|
1065
|
+
const x = a(g), { ui_template: f, color_variables: E } = De(x);
|
|
1066
1066
|
let b = JSON.stringify(f);
|
|
1067
|
-
return b =
|
|
1067
|
+
return b = de({
|
|
1068
1068
|
uiTemplateString: b,
|
|
1069
1069
|
variables: i
|
|
1070
|
-
}), b =
|
|
1070
|
+
}), b = ue({
|
|
1071
1071
|
theme: e,
|
|
1072
1072
|
uiTemplateString: b,
|
|
1073
1073
|
colorVariables: E
|
|
1074
|
-
}), b =
|
|
1074
|
+
}), b = ue({
|
|
1075
1075
|
theme: e,
|
|
1076
1076
|
uiTemplateString: b,
|
|
1077
1077
|
colorVariables: o
|
|
1078
|
-
}), b =
|
|
1078
|
+
}), b = de({
|
|
1079
1079
|
uiTemplateString: b,
|
|
1080
1080
|
variables: p
|
|
1081
|
-
}),
|
|
1081
|
+
}), nt(b);
|
|
1082
1082
|
});
|
|
1083
1083
|
return JSON.stringify(m);
|
|
1084
1084
|
}
|
|
@@ -1095,26 +1095,26 @@ async function Ho({
|
|
|
1095
1095
|
return Lo({
|
|
1096
1096
|
template: t,
|
|
1097
1097
|
variables: n,
|
|
1098
|
-
variableKeyPattern: (s) =>
|
|
1098
|
+
variableKeyPattern: (s) => rt.VIEW_VARIABLE(s),
|
|
1099
1099
|
variableValueTransformer: async (s) => {
|
|
1100
1100
|
const l = s.map(async ({ key: d, variables: m }) => {
|
|
1101
|
-
const g = await a(d), { ui_template: p, color_variables: x } =
|
|
1101
|
+
const g = await a(d), { ui_template: p, color_variables: x } = De(g);
|
|
1102
1102
|
let f = JSON.stringify(p);
|
|
1103
|
-
return f =
|
|
1103
|
+
return f = de({
|
|
1104
1104
|
uiTemplateString: f,
|
|
1105
1105
|
variables: i
|
|
1106
|
-
}), f =
|
|
1106
|
+
}), f = ue({
|
|
1107
1107
|
theme: e,
|
|
1108
1108
|
uiTemplateString: f,
|
|
1109
1109
|
colorVariables: x
|
|
1110
|
-
}), f =
|
|
1110
|
+
}), f = ue({
|
|
1111
1111
|
theme: e,
|
|
1112
1112
|
uiTemplateString: f,
|
|
1113
1113
|
colorVariables: o
|
|
1114
|
-
}), f =
|
|
1114
|
+
}), f = de({
|
|
1115
1115
|
uiTemplateString: f,
|
|
1116
1116
|
variables: m
|
|
1117
|
-
}),
|
|
1117
|
+
}), nt(f);
|
|
1118
1118
|
}), c = await Promise.all(l);
|
|
1119
1119
|
return JSON.stringify(c);
|
|
1120
1120
|
}
|
|
@@ -1126,7 +1126,7 @@ const zo = ({
|
|
|
1126
1126
|
internalVariables: n,
|
|
1127
1127
|
...o
|
|
1128
1128
|
}) => {
|
|
1129
|
-
const { ui_template: i, color_variables: a } =
|
|
1129
|
+
const { ui_template: i, color_variables: a } = De(e);
|
|
1130
1130
|
let s = JSON.stringify(i);
|
|
1131
1131
|
if (Object.keys(o.viewVariables ?? {}).length > 0) {
|
|
1132
1132
|
const c = Uo({
|
|
@@ -1138,24 +1138,24 @@ const zo = ({
|
|
|
1138
1138
|
if (c === null) return null;
|
|
1139
1139
|
s = c;
|
|
1140
1140
|
}
|
|
1141
|
-
return s =
|
|
1141
|
+
return s = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
|
|
1142
1142
|
}, Vo = async ({
|
|
1143
1143
|
rawTemplate: e,
|
|
1144
1144
|
aiAgentColorVariables: t,
|
|
1145
1145
|
internalVariables: n,
|
|
1146
1146
|
...o
|
|
1147
1147
|
}) => {
|
|
1148
|
-
const { ui_template: i, color_variables: a } =
|
|
1148
|
+
const { ui_template: i, color_variables: a } = De(e);
|
|
1149
1149
|
let s = JSON.stringify(i);
|
|
1150
1150
|
return Object.keys(o.viewVariables ?? {}).length > 0 && (s = await Ho({
|
|
1151
1151
|
...o,
|
|
1152
1152
|
uiTemplateString: s,
|
|
1153
1153
|
aiAgentColorVariables: t,
|
|
1154
1154
|
internalVariables: n
|
|
1155
|
-
})), s =
|
|
1155
|
+
})), s = de({ ...o, uiTemplateString: s, variables: n }), s = ue({ ...o, uiTemplateString: s, colorVariables: a }), s = ue({ ...o, uiTemplateString: s, colorVariables: t }), s = de({ ...o, uiTemplateString: s }), nt(s);
|
|
1156
1156
|
}, Wo = (e) => {
|
|
1157
|
-
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } =
|
|
1158
|
-
return
|
|
1157
|
+
const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = Mn();
|
|
1158
|
+
return S(() => {
|
|
1159
1159
|
const o = e.onGetCachedTemplate(e.templateKey);
|
|
1160
1160
|
return o ? zo({
|
|
1161
1161
|
...e,
|
|
@@ -1168,7 +1168,7 @@ const zo = ({
|
|
|
1168
1168
|
}, Go = (e) => {
|
|
1169
1169
|
const [t] = Wo(e);
|
|
1170
1170
|
if (t) return t;
|
|
1171
|
-
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } =
|
|
1171
|
+
const { aiAgentColorVariables: n = {} } = e, { internalVariables: o, fetchTemplate: i, suspend: a } = Mn();
|
|
1172
1172
|
return a(e.templateKey, async () => {
|
|
1173
1173
|
const l = await i({ ...e, suspense: !0 });
|
|
1174
1174
|
return await Vo({
|
|
@@ -1178,8 +1178,8 @@ const zo = ({
|
|
|
1178
1178
|
internalVariables: o
|
|
1179
1179
|
});
|
|
1180
1180
|
}).value;
|
|
1181
|
-
}, jo = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}',
|
|
1182
|
-
|
|
1181
|
+
}, jo = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}', Ne = "en", Ko = /* @__PURE__ */ new Set([
|
|
1182
|
+
Ne,
|
|
1183
1183
|
"ko",
|
|
1184
1184
|
"es",
|
|
1185
1185
|
"pt",
|
|
@@ -1252,19 +1252,19 @@ const zo = ({
|
|
|
1252
1252
|
CONVERSATION_LIST__NO_CONVERSATIONS: "No conversations yet",
|
|
1253
1253
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: "MM/dd/yyyy",
|
|
1254
1254
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
|
|
1255
|
-
},
|
|
1255
|
+
}, yt = { language: "en", dateLocale: Yo, stringSet: qo }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1256
1256
|
__proto__: null,
|
|
1257
|
-
default:
|
|
1258
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1257
|
+
default: yt
|
|
1258
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, yt]]);
|
|
1259
1259
|
async function Xo(e) {
|
|
1260
|
-
if (
|
|
1261
|
-
return
|
|
1262
|
-
const t = Ko.has(e) ? e :
|
|
1260
|
+
if (Ye.has(e))
|
|
1261
|
+
return Ye.get(e);
|
|
1262
|
+
const t = Ko.has(e) ? e : Ne;
|
|
1263
1263
|
try {
|
|
1264
1264
|
const { default: n } = await Zo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Jo), "./languages/es.ts": () => import("./zI14HLvP.js"), "./languages/fr.ts": () => import("./B9V0T5ZP.js"), "./languages/hi.ts": () => import("./YRQ0vk5Q.js"), "./languages/it.ts": () => import("./BQWJPfGp.js"), "./languages/ja.ts": () => import("./sl-YrKkN.js"), "./languages/ko.ts": () => import("./B8c_rqvH.js"), "./languages/pt.ts": () => import("./BSz49qaD.js"), "./languages/tr.ts": () => import("./D_eZyIAR.js") }), `./languages/${t}.ts`, 3);
|
|
1265
|
-
return
|
|
1265
|
+
return Ye.set(e, n), n;
|
|
1266
1266
|
} catch {
|
|
1267
|
-
return
|
|
1267
|
+
return yt;
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
const {
|
|
@@ -1273,7 +1273,7 @@ const {
|
|
|
1273
1273
|
} = j("Localization");
|
|
1274
1274
|
function ei(e) {
|
|
1275
1275
|
var t;
|
|
1276
|
-
return ((t = e.split("-")) == null ? void 0 : t[0]) ??
|
|
1276
|
+
return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Ne;
|
|
1277
1277
|
}
|
|
1278
1278
|
function ti({
|
|
1279
1279
|
language: e = navigator.language,
|
|
@@ -1281,7 +1281,7 @@ function ti({
|
|
|
1281
1281
|
stringSet: n,
|
|
1282
1282
|
children: o
|
|
1283
1283
|
}) {
|
|
1284
|
-
const [i, a] =
|
|
1284
|
+
const [i, a] = S(Ye.get(Ne));
|
|
1285
1285
|
return D(() => {
|
|
1286
1286
|
const s = ei(e);
|
|
1287
1287
|
i.language !== s && (t == null || t.debug("localization.useEffect: update language", `${i.language} -> ${s}`), Xo(s).then(a));
|
|
@@ -1292,20 +1292,20 @@ function ti({
|
|
|
1292
1292
|
language: i.language,
|
|
1293
1293
|
stringSet: { ...i.stringSet, ...n },
|
|
1294
1294
|
dateLocale: i.dateLocale,
|
|
1295
|
-
format: (s, l, c) =>
|
|
1295
|
+
format: (s, l, c) => Cn(s, l, { locale: i.dateLocale, ...c })
|
|
1296
1296
|
}
|
|
1297
1297
|
},
|
|
1298
1298
|
o
|
|
1299
1299
|
);
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1301
|
+
const qe = "data-sb-agent-theme", Gt = (e) => (t, ...n) => {
|
|
1302
1302
|
let o = "";
|
|
1303
1303
|
return t.forEach((i, a) => {
|
|
1304
1304
|
o += i + (n[a] ?? "");
|
|
1305
|
-
}), `[${
|
|
1305
|
+
}), `[${qe}='${e}'] & { ${o} }`;
|
|
1306
1306
|
}, N = {
|
|
1307
|
-
light:
|
|
1308
|
-
dark:
|
|
1307
|
+
light: Gt("light"),
|
|
1308
|
+
dark: Gt("dark")
|
|
1309
1309
|
}, ni = $(({ theme: e }) => {
|
|
1310
1310
|
const { palette: t } = e;
|
|
1311
1311
|
return `
|
|
@@ -1358,7 +1358,7 @@ const Ye = "data-sb-agent-theme", jt = (e) => (t, ...n) => {
|
|
|
1358
1358
|
--sendbird-overlay-light: ${t.overlay.light};
|
|
1359
1359
|
}
|
|
1360
1360
|
`;
|
|
1361
|
-
}), ri = $`[${
|
|
1361
|
+
}), ri = $`[${qe}='light'] &{--sb-text-high-emphasis:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled:var(--sendbird-onlight-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-ondark-text-disabled);--sb-bg-50-600:var(--sendbird-background-50);--sb-bg-100-500:var(--sendbird-background-100);--sb-bg-200-400:var(--sendbird-background-200);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${qe}='dark'] &{--sb-text-high-emphasis:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled:var(--sendbird-ondark-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-onlight-text-disabled);--sb-bg-50-600:var(--sendbird-background-600);--sb-bg-100-500:var(--sendbird-background-500);--sb-bg-200-400:var(--sendbird-background-400);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`, h = {
|
|
1362
1362
|
color: {
|
|
1363
1363
|
primary: {
|
|
1364
1364
|
dark: "var(--sendbird-primary-dark)",
|
|
@@ -1416,18 +1416,18 @@ function si(e) {
|
|
|
1416
1416
|
);
|
|
1417
1417
|
}
|
|
1418
1418
|
function ai({ rootElement: e = document.body, children: t }) {
|
|
1419
|
-
const { theme: n, updateTheme: o } =
|
|
1420
|
-
return
|
|
1421
|
-
e.setAttribute(
|
|
1419
|
+
const { theme: n, updateTheme: o } = An();
|
|
1420
|
+
return ce(() => {
|
|
1421
|
+
e.setAttribute(qe, n.selectedTheme);
|
|
1422
1422
|
}, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(Or, { theme: n }, /* @__PURE__ */ r.createElement(oi, { value: { theme: n, updateTheme: o } }, t));
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function fe(e, t) {
|
|
1425
1425
|
const n = e.getRootNode({ composed: t });
|
|
1426
1426
|
return n instanceof ShadowRoot || n instanceof Document ? n : document;
|
|
1427
1427
|
}
|
|
1428
1428
|
const li = (e, t) => {
|
|
1429
1429
|
D(() => {
|
|
1430
|
-
const n =
|
|
1430
|
+
const n = fe(t) instanceof ShadowRoot, o = fe(t, !0);
|
|
1431
1431
|
if (!(n ? t : o).querySelector(`link[href*='${e}']`)) {
|
|
1432
1432
|
const a = o.createElement("link");
|
|
1433
1433
|
a.rel = "stylesheet", a.href = e, (n ? t : o.head).appendChild(a);
|
|
@@ -1435,49 +1435,49 @@ const li = (e, t) => {
|
|
|
1435
1435
|
}, [e, t]);
|
|
1436
1436
|
}, ci = (e, t = document.body) => {
|
|
1437
1437
|
D(() => {
|
|
1438
|
-
const n =
|
|
1438
|
+
const n = fe(t), i = n instanceof ShadowRoot ? t : n.head;
|
|
1439
1439
|
if (!i) return;
|
|
1440
1440
|
const a = `sba-${btoa(e).slice(0, 10)}`;
|
|
1441
1441
|
let s = i.querySelector(`style#${a}`);
|
|
1442
1442
|
s ? s.textContent !== e && (s.textContent = e) : (s = i.ownerDocument.createElement("style"), s.id = a, s.textContent = e, i.appendChild(s));
|
|
1443
1443
|
}, [e, t]);
|
|
1444
|
-
},
|
|
1445
|
-
ENTRY: `${
|
|
1446
|
-
MODAL_ROOT: `${
|
|
1447
|
-
WINDOW: `${
|
|
1448
|
-
LAUNCHER: `${
|
|
1449
|
-
},
|
|
1450
|
-
MODAL:
|
|
1444
|
+
}, vt = /iPad|iPhone|iPod/.test(navigator.userAgent), di = /Android/.test(navigator.userAgent), Pe = (e) => vt || di, Q = "sb-agent", oe = {
|
|
1445
|
+
ENTRY: `${Q}-entry`,
|
|
1446
|
+
MODAL_ROOT: `${Q}-modal-root`,
|
|
1447
|
+
WINDOW: `${Q}-window`,
|
|
1448
|
+
LAUNCHER: `${Q}-launcher`
|
|
1449
|
+
}, Ve = 2147483647, be = {
|
|
1450
|
+
MODAL: Ve - 1,
|
|
1451
1451
|
// FIXME: need to cover the case where the tooltip is on the top of the modal
|
|
1452
|
-
TOOLTIP:
|
|
1453
|
-
WINDOW:
|
|
1454
|
-
LAUNCHER:
|
|
1452
|
+
TOOLTIP: Ve - 2,
|
|
1453
|
+
WINDOW: Ve - 3,
|
|
1454
|
+
LAUNCHER: Ve - 4
|
|
1455
|
+
}, On = {
|
|
1456
|
+
SESSION: `@${Q}-session`,
|
|
1457
|
+
USER_DATA: `@${Q}-udata`
|
|
1455
1458
|
}, Ln = {
|
|
1456
|
-
SESSION: `@${X}-session`,
|
|
1457
|
-
USER_DATA: `@${X}-udata`
|
|
1458
|
-
}, Rn = {
|
|
1459
1459
|
DEFAULT_PRIMARY: "#742ddd",
|
|
1460
1460
|
WHITE: "#ffffff"
|
|
1461
|
-
},
|
|
1461
|
+
}, Rn = 36, ui = 100, mi = 25 * 1024 * 1024, Dn = ["application/pdf", "image/jpeg", "image/jpg", "image/png"], _t = "noopener noreferrer nofollow", We = {}, te = {
|
|
1462
1462
|
getItem: (e) => {
|
|
1463
1463
|
try {
|
|
1464
1464
|
return localStorage.getItem(e);
|
|
1465
1465
|
} catch {
|
|
1466
|
-
return
|
|
1466
|
+
return We[e] ?? null;
|
|
1467
1467
|
}
|
|
1468
1468
|
},
|
|
1469
1469
|
setItem: (e, t) => {
|
|
1470
1470
|
try {
|
|
1471
1471
|
localStorage.setItem(e, t);
|
|
1472
1472
|
} catch {
|
|
1473
|
-
|
|
1473
|
+
We[e] = t;
|
|
1474
1474
|
}
|
|
1475
1475
|
},
|
|
1476
1476
|
deleteItem: (e) => {
|
|
1477
1477
|
try {
|
|
1478
1478
|
localStorage.removeItem(e);
|
|
1479
1479
|
} catch {
|
|
1480
|
-
delete
|
|
1480
|
+
delete We[e];
|
|
1481
1481
|
}
|
|
1482
1482
|
},
|
|
1483
1483
|
getKeys: (e) => {
|
|
@@ -1489,16 +1489,16 @@ const li = (e, t) => {
|
|
|
1489
1489
|
}
|
|
1490
1490
|
return t;
|
|
1491
1491
|
} catch {
|
|
1492
|
-
return Object.keys(
|
|
1492
|
+
return Object.keys(We).filter((t) => t.startsWith(e));
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
};
|
|
1496
|
-
function
|
|
1496
|
+
function Nn(e) {
|
|
1497
1497
|
const { keyGenerator: t, keyParamsValidator: n } = e;
|
|
1498
1498
|
function o(s) {
|
|
1499
1499
|
try {
|
|
1500
1500
|
n && n(s);
|
|
1501
|
-
const l = t(s), c =
|
|
1501
|
+
const l = t(s), c = te.getItem(l);
|
|
1502
1502
|
return c ? JSON.parse(c) : null;
|
|
1503
1503
|
} catch {
|
|
1504
1504
|
return null;
|
|
@@ -1508,7 +1508,7 @@ function Pn(e) {
|
|
|
1508
1508
|
try {
|
|
1509
1509
|
n && n(s);
|
|
1510
1510
|
const c = t(s), d = JSON.stringify(l);
|
|
1511
|
-
|
|
1511
|
+
te.setItem(c, d);
|
|
1512
1512
|
} catch {
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
@@ -1516,16 +1516,16 @@ function Pn(e) {
|
|
|
1516
1516
|
try {
|
|
1517
1517
|
n && n(s);
|
|
1518
1518
|
const l = t(s);
|
|
1519
|
-
|
|
1519
|
+
te.deleteItem(l);
|
|
1520
1520
|
} catch {
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
1523
|
return { get: o, set: i, clear: a };
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const $e = Nn({
|
|
1526
1526
|
keyGenerator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1527
1527
|
const o = hi(`${e}/${t}/${n}`);
|
|
1528
|
-
return `${
|
|
1528
|
+
return `${On.USER_DATA}/${o}`;
|
|
1529
1529
|
},
|
|
1530
1530
|
keyParamsValidator: ({ appId: e, aiAgentId: t, userId: n }) => {
|
|
1531
1531
|
if (!e || !t || !n)
|
|
@@ -1538,11 +1538,11 @@ function hi(e) {
|
|
|
1538
1538
|
t = (t << 5) - t + e.charCodeAt(n), t |= 0;
|
|
1539
1539
|
return t.toString(16);
|
|
1540
1540
|
}
|
|
1541
|
-
const
|
|
1542
|
-
keyGenerator: ({ appId: e, aiAgentId: t }) => `${
|
|
1541
|
+
const Ge = Nn({
|
|
1542
|
+
keyGenerator: ({ appId: e, aiAgentId: t }) => `${On.SESSION}/${e}/${t}`
|
|
1543
1543
|
}), {
|
|
1544
1544
|
Provider: gi,
|
|
1545
|
-
Consumer:
|
|
1545
|
+
Consumer: Pn,
|
|
1546
1546
|
useContext: P
|
|
1547
1547
|
} = j("Agent");
|
|
1548
1548
|
function pi({
|
|
@@ -1553,7 +1553,7 @@ function pi({
|
|
|
1553
1553
|
enableAutoDisconnectInLauncher: i = !0,
|
|
1554
1554
|
...a
|
|
1555
1555
|
}) {
|
|
1556
|
-
const s =
|
|
1556
|
+
const s = tt(), [l, c] = S(!1), [d, m] = S(!1), g = {
|
|
1557
1557
|
opened: (t == null ? void 0 : t.opened) ?? l,
|
|
1558
1558
|
setOpened: (t == null ? void 0 : t.setOpened) ?? c,
|
|
1559
1559
|
expanded: (t == null ? void 0 : t.expanded) ?? d,
|
|
@@ -1575,7 +1575,7 @@ function pi({
|
|
|
1575
1575
|
);
|
|
1576
1576
|
}
|
|
1577
1577
|
function fi() {
|
|
1578
|
-
const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } =
|
|
1578
|
+
const { chatSDK: e, logger: t } = P(), { shouldSyncCachedTemplate: n, syncCachedTemplates: o, clearCachedTemplates: i } = $n(), a = U(
|
|
1579
1579
|
async (l, c, d) => {
|
|
1580
1580
|
if (t.debug("authManager.authenticate: session:", l.userId), c) {
|
|
1581
1581
|
const m = new $r({
|
|
@@ -1608,10 +1608,10 @@ function bi(e, t) {
|
|
|
1608
1608
|
const xi = 24 * 60 * 60 * 1e3, {
|
|
1609
1609
|
Provider: Ei,
|
|
1610
1610
|
useContext: z
|
|
1611
|
-
} = j("MessengerSession"), Ci =
|
|
1612
|
-
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } =
|
|
1611
|
+
} = j("MessengerSession"), Ci = Re(function({ userSessionInfo: e, children: t }, n) {
|
|
1612
|
+
const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } = An(), { authenticate: f, deauthenticate: E } = fi(), [b, C] = S(
|
|
1613
1613
|
void 0
|
|
1614
|
-
), [v, T] =
|
|
1614
|
+
), [v, T] = S(void 0), [_, K] = S(null), [L, se] = S(null), [xe, y] = S(null), B = s == null ? void 0 : s.forceCreateChannel;
|
|
1615
1615
|
function Ee() {
|
|
1616
1616
|
if (e && e.userId) {
|
|
1617
1617
|
c.debug("messengerSession.initialize: manual session info detected");
|
|
@@ -1620,33 +1620,33 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1620
1620
|
`messengerSession.initialize: missing required keys in userSessionInfo: ${I.join(", ")}`
|
|
1621
1621
|
), e;
|
|
1622
1622
|
}
|
|
1623
|
-
const A =
|
|
1624
|
-
return A ? A.expireAt - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"),
|
|
1623
|
+
const A = Ge.get({ appId: o, aiAgentId: i });
|
|
1624
|
+
return A ? A.expireAt - xi <= Date.now() ? (c.debug("messengerSession.initialize: auto session expired, clear cache"), Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: A.userId }), null) : (c.debug("messengerSession.initialize: auto session info detected"), A) : null;
|
|
1625
1625
|
}
|
|
1626
1626
|
const J = U(
|
|
1627
1627
|
(A, I) => {
|
|
1628
|
-
|
|
1628
|
+
$e.set({ appId: o, aiAgentId: i, userId: A }, { knownActiveChannelUrl: I });
|
|
1629
1629
|
},
|
|
1630
1630
|
[o, i]
|
|
1631
1631
|
), Ae = U(
|
|
1632
1632
|
(A) => {
|
|
1633
|
-
const I =
|
|
1633
|
+
const I = $e.get({ appId: o, aiAgentId: i, userId: A });
|
|
1634
1634
|
return I == null ? void 0 : I.knownActiveChannelUrl;
|
|
1635
1635
|
},
|
|
1636
1636
|
[o, i]
|
|
1637
|
-
),
|
|
1638
|
-
if (
|
|
1637
|
+
), it = U(async () => {
|
|
1638
|
+
if (_) {
|
|
1639
1639
|
c.debug("messengerSession.refreshActiveChannel: try to refresh active channel"), C(void 0);
|
|
1640
1640
|
const A = await a.aiAgent.requestMessengerSettings({
|
|
1641
1641
|
aiAgentId: i,
|
|
1642
|
-
userId:
|
|
1642
|
+
userId: _.userId,
|
|
1643
1643
|
language: d,
|
|
1644
1644
|
country: m,
|
|
1645
1645
|
context: g,
|
|
1646
1646
|
forceCreateChannel: B,
|
|
1647
|
-
knownActiveChannelUrl: Ae(
|
|
1647
|
+
knownActiveChannelUrl: Ae(_.userId)
|
|
1648
1648
|
});
|
|
1649
|
-
return J(
|
|
1649
|
+
return J(_.userId, A.active_channel.channel_url), C({ url: A.active_channel.channel_url, status: W.OPEN }), c.info(
|
|
1650
1650
|
"messengerSession.refreshActiveChannel: refreshed active channel",
|
|
1651
1651
|
A.active_channel.channel_url
|
|
1652
1652
|
), A.active_channel.channel_url;
|
|
@@ -1656,30 +1656,30 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1656
1656
|
a,
|
|
1657
1657
|
o,
|
|
1658
1658
|
i,
|
|
1659
|
-
|
|
1659
|
+
_ == null ? void 0 : _.userId,
|
|
1660
1660
|
d,
|
|
1661
1661
|
m,
|
|
1662
1662
|
g,
|
|
1663
1663
|
B,
|
|
1664
1664
|
Ae,
|
|
1665
1665
|
J
|
|
1666
|
-
]),
|
|
1666
|
+
]), st = U(
|
|
1667
1667
|
async (A) => {
|
|
1668
|
-
if (!(
|
|
1668
|
+
if (!(_ != null && _.userId))
|
|
1669
1669
|
throw new Error("Current user is not authenticated. Please authenticate first.");
|
|
1670
1670
|
const M = (await a.aiAgent.requestMessengerSettings({
|
|
1671
1671
|
...A,
|
|
1672
|
-
userId:
|
|
1672
|
+
userId: _.userId,
|
|
1673
1673
|
knownActiveChannelUrl: void 0
|
|
1674
1674
|
})).active_channel.channel_url;
|
|
1675
|
-
return
|
|
1676
|
-
{ userId:
|
|
1675
|
+
return $e.set(
|
|
1676
|
+
{ userId: _.userId, appId: o, aiAgentId: A.aiAgentId },
|
|
1677
1677
|
{ knownActiveChannelUrl: M }
|
|
1678
1678
|
), M;
|
|
1679
1679
|
},
|
|
1680
|
-
[
|
|
1680
|
+
[_ == null ? void 0 : _.userId]
|
|
1681
1681
|
);
|
|
1682
|
-
return
|
|
1682
|
+
return yn(a, {
|
|
1683
1683
|
onChannelChanged: (A) => {
|
|
1684
1684
|
var I;
|
|
1685
1685
|
A.isGroupChannel() && A.url === (b == null ? void 0 : b.url) && (c.info("messengerSession.channelChanged: channel.conversation", A.conversation), C({ url: A.url, status: ((I = A.conversation) == null ? void 0 : I.status) ?? W.OPEN }));
|
|
@@ -1688,8 +1688,8 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1688
1688
|
var H, Ce;
|
|
1689
1689
|
if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((H = a.currentUser) == null ? void 0 : H.userId)) {
|
|
1690
1690
|
c.info("messengerSession.onUserJoined: proactive channel joined", A.url);
|
|
1691
|
-
const
|
|
1692
|
-
C({ url: A.url, status:
|
|
1691
|
+
const ae = ((Ce = A.conversation) == null ? void 0 : Ce.status) ?? W.OPEN;
|
|
1692
|
+
C({ url: A.url, status: ae }), l.setOpened(!0), yi({
|
|
1693
1693
|
sound: document.hidden || !l.opened
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
@@ -1700,6 +1700,10 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1700
1700
|
return await a.groupChannel.getChannel(b.url);
|
|
1701
1701
|
};
|
|
1702
1702
|
return {
|
|
1703
|
+
chatSDK: a,
|
|
1704
|
+
deauthenticate: async () => {
|
|
1705
|
+
c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), K(null), se(null), y(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
|
|
1706
|
+
},
|
|
1703
1707
|
updateContext: async (I) => {
|
|
1704
1708
|
const H = await (await A()).updateContext(i, I);
|
|
1705
1709
|
return { ...H, context: H.context ?? {} };
|
|
@@ -1713,7 +1717,7 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1713
1717
|
return { ...M, context: M.context ?? {} };
|
|
1714
1718
|
}
|
|
1715
1719
|
};
|
|
1716
|
-
}, [b, a, i]), D(() => {
|
|
1720
|
+
}, [b, E, a, o, _, i]), D(() => {
|
|
1717
1721
|
async function A() {
|
|
1718
1722
|
c.debug("messengerSession.initialize: start");
|
|
1719
1723
|
const I = Ee(), M = await a.aiAgent.requestMessengerSettings({
|
|
@@ -1728,8 +1732,8 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1728
1732
|
c.debug("messengerSession.initialize: messenger settings response", M);
|
|
1729
1733
|
let H = null;
|
|
1730
1734
|
if (M.auto_created_user) {
|
|
1731
|
-
const { user_id:
|
|
1732
|
-
|
|
1735
|
+
const { user_id: Z, session_token: X, expire_at: ee } = M.auto_created_user;
|
|
1736
|
+
Ge.set({ appId: o, aiAgentId: i }, { userId: Z, authToken: X, expireAt: ee }), H = { userId: Z, authToken: X };
|
|
1733
1737
|
} else
|
|
1734
1738
|
H = {
|
|
1735
1739
|
userId: (I == null ? void 0 : I.userId) ?? "",
|
|
@@ -1737,16 +1741,16 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1737
1741
|
};
|
|
1738
1742
|
J(H.userId, M.active_channel.channel_url);
|
|
1739
1743
|
function Ce() {
|
|
1740
|
-
const
|
|
1741
|
-
x(
|
|
1742
|
-
const G = M.appearance.themes[
|
|
1744
|
+
const Z = M.appearance.selected_theme;
|
|
1745
|
+
x(Z, (ee) => {
|
|
1746
|
+
const G = M.appearance.themes[ee];
|
|
1743
1747
|
return {
|
|
1744
1748
|
primaryColor: G.primary_color,
|
|
1745
1749
|
botMessageBackgroundColor: G.bot_message_bg_color,
|
|
1746
1750
|
primaryContrastColor: G.primary_contrast_color,
|
|
1747
1751
|
botMessageBackgroundContrastColor: G.bot_message_bg_contrast_color
|
|
1748
1752
|
};
|
|
1749
|
-
}), T(void 0),
|
|
1753
|
+
}), T(void 0), K(H), se({
|
|
1750
1754
|
userId: M.bot.bot_userid,
|
|
1751
1755
|
profileUrl: M.bot.bot_profile_url,
|
|
1752
1756
|
nickname: M.bot.bot_nickname,
|
|
@@ -1757,17 +1761,17 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1757
1761
|
}), y({
|
|
1758
1762
|
type: M.launcher.image_type || "default_icon",
|
|
1759
1763
|
imageUrl: M.launcher.image_url
|
|
1760
|
-
}), M.launcher.auto_open && !
|
|
1764
|
+
}), M.launcher.auto_open && !Pe() && setTimeout(() => l.setOpened(!0), 500);
|
|
1761
1765
|
}
|
|
1762
|
-
function
|
|
1766
|
+
function ae() {
|
|
1763
1767
|
C({ url: M.active_channel.channel_url, status: W.OPEN });
|
|
1764
1768
|
}
|
|
1765
1769
|
try {
|
|
1766
1770
|
Ce();
|
|
1767
|
-
const
|
|
1768
|
-
await f(H, e == null ? void 0 : e.sessionHandler,
|
|
1769
|
-
} catch (
|
|
1770
|
-
|
|
1771
|
+
const Z = (X) => K((ee) => ee ? { ...ee, authToken: X } : null);
|
|
1772
|
+
await f(H, e == null ? void 0 : e.sessionHandler, Z), ae();
|
|
1773
|
+
} catch (Z) {
|
|
1774
|
+
Z instanceof Error && (c.error("messengerSession.initialize: failed to connect", Z), T(Z));
|
|
1771
1775
|
}
|
|
1772
1776
|
}
|
|
1773
1777
|
A().catch((I) => {
|
|
@@ -1775,14 +1779,14 @@ const xi = 24 * 60 * 60 * 1e3, {
|
|
|
1775
1779
|
});
|
|
1776
1780
|
}, [a, o, i, e == null ? void 0 : e.userId, e == null ? void 0 : e.authToken]), D(() => {
|
|
1777
1781
|
p != null && p.onRegisterDeauthenticateHandler && (c.debug("messengerSession: registering deauthenticate handler"), p.onRegisterDeauthenticateHandler(E));
|
|
1778
|
-
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !
|
|
1782
|
+
}, [p == null ? void 0 : p.onRegisterDeauthenticateHandler, E]), !_ || !L || !xe ? null : /* @__PURE__ */ r.createElement(
|
|
1779
1783
|
Ei,
|
|
1780
1784
|
{
|
|
1781
1785
|
value: {
|
|
1782
|
-
userSession:
|
|
1786
|
+
userSession: _,
|
|
1783
1787
|
activeChannel: b,
|
|
1784
|
-
refreshActiveChannel:
|
|
1785
|
-
createConversation:
|
|
1788
|
+
refreshActiveChannel: it,
|
|
1789
|
+
createConversation: st,
|
|
1786
1790
|
connectionError: v,
|
|
1787
1791
|
aiAgentInfo: { ...L, ...s == null ? void 0 : s.bot },
|
|
1788
1792
|
launcherInfo: { ...xe, ...s == null ? void 0 : s.launcher }
|
|
@@ -1799,7 +1803,7 @@ function yi({ sound: e }) {
|
|
|
1799
1803
|
new Audio(i.default).play();
|
|
1800
1804
|
});
|
|
1801
1805
|
}
|
|
1802
|
-
const
|
|
1806
|
+
const Y = (e) => {
|
|
1803
1807
|
const t = e;
|
|
1804
1808
|
return typeof t == "number" ? `${t}px` : t;
|
|
1805
1809
|
}, k = ({
|
|
@@ -1808,17 +1812,17 @@ const Z = (e) => {
|
|
|
1808
1812
|
color: n,
|
|
1809
1813
|
className: o,
|
|
1810
1814
|
...i
|
|
1811
|
-
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }),
|
|
1812
|
-
let n =
|
|
1813
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1815
|
+
}) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }), jt = /* @__PURE__ */ new WeakMap(), vi = (e, t) => {
|
|
1816
|
+
let n = jt.get(t);
|
|
1817
|
+
n || (n = /* @__PURE__ */ new Map(), jt.set(t, n));
|
|
1814
1818
|
const o = n.get(e);
|
|
1815
1819
|
if (o) return o;
|
|
1816
|
-
const i = t[e] ?? t.body1, a = $`font-size:${
|
|
1820
|
+
const i = t[e] ?? t.body1, a = $`font-size:${Y(i.fontSize)};font-weight:${i.fontWeight};${i.fontFamily ? `font-family: ${i.fontFamily};` : ""}
|
|
1817
1821
|
${i.lineHeight ? `line-height: ${i.lineHeight};` : "line-height: 100%;"}
|
|
1818
1822
|
`;
|
|
1819
1823
|
return n.set(e, a), a;
|
|
1820
|
-
}, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vi(e, t.typography)}color:${({ $color: e }) => e};`,
|
|
1821
|
-
function
|
|
1824
|
+
}, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vi(e, t.typography)}color:${({ $color: e }) => e};`, Be = 244, Bn = 640, Je = 26, Fn = 4, ie = 12, ke = 2, Si = 16, me = `${Q}-incoming-msg`, Ti = `${Q}-marked-text`;
|
|
1825
|
+
function St(e) {
|
|
1822
1826
|
switch (e) {
|
|
1823
1827
|
case "top":
|
|
1824
1828
|
case "middle":
|
|
@@ -1827,7 +1831,7 @@ function Tt(e) {
|
|
|
1827
1831
|
return Si;
|
|
1828
1832
|
}
|
|
1829
1833
|
}
|
|
1830
|
-
function
|
|
1834
|
+
function Tt(e, t) {
|
|
1831
1835
|
if (t) {
|
|
1832
1836
|
const [, n] = t.split("/");
|
|
1833
1837
|
if (n)
|
|
@@ -1840,7 +1844,7 @@ function wt(e, t) {
|
|
|
1840
1844
|
}
|
|
1841
1845
|
return "FILE";
|
|
1842
1846
|
}
|
|
1843
|
-
function
|
|
1847
|
+
function Un(e) {
|
|
1844
1848
|
return e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0;
|
|
1845
1849
|
}
|
|
1846
1850
|
const wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"]), ki = {
|
|
@@ -1887,26 +1891,26 @@ const wi = /* @__PURE__ */ new Set(["send", "chat", "message", "chevron-right"])
|
|
|
1887
1891
|
$size: t,
|
|
1888
1892
|
$color: o ?? h.color.primary.main
|
|
1889
1893
|
},
|
|
1890
|
-
/* @__PURE__ */ r.createElement(
|
|
1894
|
+
/* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(i, null))
|
|
1891
1895
|
);
|
|
1892
|
-
}, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) =>
|
|
1893
|
-
function
|
|
1896
|
+
}, Ai = $`[dir='rtl'] &{transform:scaleX(-1);}`, Ii = u.div`width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};display:inline-block;&:focus{outline:none;}svg{display:block;}[class*='fill']{fill:${({ $color: e }) => e};}[class*='stroke']{stroke:${({ $color: e }) => e};stroke-width:2px;stroke-linejoin:round;}${({ $rtlFlip: e }) => e && Ai};`;
|
|
1897
|
+
function wt({
|
|
1894
1898
|
name: e,
|
|
1895
1899
|
type: t = "FILE",
|
|
1896
1900
|
iconColor: n,
|
|
1897
1901
|
iconBackgroundColor: o,
|
|
1898
1902
|
onClick: i
|
|
1899
1903
|
}) {
|
|
1900
|
-
const { colors: a } =
|
|
1904
|
+
const { colors: a } = Et();
|
|
1901
1905
|
return /* @__PURE__ */ r.createElement($i, { onClick: i, $clickable: !!i }, /* @__PURE__ */ r.createElement(Oi, { $bgColor: o ?? a.base.primary }, /* @__PURE__ */ r.createElement(O, { type: "file-document", size: 24, color: n ?? a.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(Li, null, /* @__PURE__ */ r.createElement(Ri, { variant: "button", color: h.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(k, { color: h.themedColor.textMidEmphasis, variant: "caption3" }, t)));
|
|
1902
1906
|
}
|
|
1903
|
-
const $i = u.div`border-radius:12px;gap:8px;width:${
|
|
1907
|
+
const $i = u.div`border-radius:12px;gap:8px;width:${Be}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};${({ $clickable: e }) => e && Mi}`, Mi = $`cursor:pointer;&:hover{background-color:${h.themedColor.bg_100_500};}`, Oi = u.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, Li = u.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, Ri = u(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
|
|
1904
1908
|
function Di({ file: e, children: t, onClickFile: n }) {
|
|
1905
1909
|
return /* @__PURE__ */ r.createElement(Ni, null, /* @__PURE__ */ r.createElement(
|
|
1906
|
-
|
|
1910
|
+
wt,
|
|
1907
1911
|
{
|
|
1908
1912
|
name: e.name,
|
|
1909
|
-
type:
|
|
1913
|
+
type: Tt(e.name, e.type),
|
|
1910
1914
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
1911
1915
|
}
|
|
1912
1916
|
), t);
|
|
@@ -1916,21 +1920,21 @@ function Pi({ file: e, onClickMedia: t, children: n }) {
|
|
|
1916
1920
|
const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Ui, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Hi, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
|
|
1917
1921
|
if (o) {
|
|
1918
1922
|
const i = {
|
|
1919
|
-
id: `${
|
|
1923
|
+
id: `${me}-media-body`,
|
|
1920
1924
|
onClick: () => t == null ? void 0 : t(e)
|
|
1921
1925
|
};
|
|
1922
1926
|
return /* @__PURE__ */ r.createElement(Bi, null, /* @__PURE__ */ r.createElement(Fi, { ...i }, o()), n);
|
|
1923
1927
|
}
|
|
1924
1928
|
return null;
|
|
1925
1929
|
}
|
|
1926
|
-
const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${
|
|
1930
|
+
const Bi = u.div`display:flex;flex-direction:column;align-items:flex-start;gap:${ke}px;`, Fi = u.div`width:${Be}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${N.light`
|
|
1927
1931
|
background-color: ${h.color.background100};
|
|
1928
1932
|
`}
|
|
1929
1933
|
${N.dark`
|
|
1930
1934
|
background-color: ${h.color.background400};
|
|
1931
1935
|
`}
|
|
1932
1936
|
`, Ui = u.img`width:100%;height:100%;object-fit:cover;`, Hi = u.video`width:100%;height:100%;object-fit:cover;`, zi = "✱";
|
|
1933
|
-
function
|
|
1937
|
+
function Hn(e) {
|
|
1934
1938
|
const t = new RegExp(`${zi}+`, "g");
|
|
1935
1939
|
return e.replace(t, (n) => `<span id=${Ti} aria-label="masked-text">${n}</span>`);
|
|
1936
1940
|
}
|
|
@@ -1953,85 +1957,88 @@ function Wi(e) {
|
|
|
1953
1957
|
}), o < e.length && n.push({
|
|
1954
1958
|
type: "text",
|
|
1955
1959
|
value: e.slice(o).trim()
|
|
1956
|
-
}), n.map((i) => i.type !== "text" ? i : { ...i, value:
|
|
1960
|
+
}), n.map((i) => i.type !== "text" ? i : { ...i, value: Hn(i.value) });
|
|
1957
1961
|
}
|
|
1958
|
-
const Gi = w(async () => ({ default: (await import("./
|
|
1959
|
-
function
|
|
1962
|
+
const Gi = w(async () => ({ default: (await import("./CDvzufwm.js")).MarkdownText })), ji = w(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
1963
|
+
function Kt(e) {
|
|
1960
1964
|
var i, a;
|
|
1961
|
-
const t = e.maxBodyWidth ??
|
|
1962
|
-
id: `${
|
|
1965
|
+
const t = e.maxBodyWidth ?? Be, n = ve(() => Wi(e.message), [e.message]), o = {
|
|
1966
|
+
id: `${me}-text-body`,
|
|
1963
1967
|
$maxWidth: t,
|
|
1964
1968
|
$color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
|
|
1965
1969
|
$bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
|
|
1966
1970
|
};
|
|
1967
|
-
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(
|
|
1971
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Zt, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Zt, { ...o }, n.map((s, l) => s.type === "text" ? /* @__PURE__ */ r.createElement(Yt, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(Oe, { fallback: s.value }, /* @__PURE__ */ r.createElement(Gi, { onClickImage: (c) => {
|
|
1972
|
+
var d;
|
|
1973
|
+
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
1974
|
+
} }, s.value))) : s.type === "code" ? /* @__PURE__ */ r.createElement(Oe, { key: l, fallback: /* @__PURE__ */ r.createElement(Yt, { variant: "body3" }, s.value) }, /* @__PURE__ */ r.createElement(ji, { code: s.value, language: s.language })) : null), e.children);
|
|
1968
1975
|
}
|
|
1969
|
-
const
|
|
1976
|
+
const Zt = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => $`
|
|
1970
1977
|
color: ${t || e.colors.messageIncoming.text};
|
|
1971
1978
|
background-color: ${n || e.colors.messageIncoming.background};
|
|
1972
1979
|
`}
|
|
1973
1980
|
padding: 12px 0;
|
|
1974
1981
|
transition: max-width 0.3s;
|
|
1975
1982
|
overflow-wrap: break-word;
|
|
1976
|
-
`,
|
|
1983
|
+
`, Yt = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
1977
1984
|
function Ki(e) {
|
|
1978
|
-
const { stringSet: t } = R(), n =
|
|
1985
|
+
const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Kt, { ...e }) : null;
|
|
1979
1986
|
if (e.messageType === "user")
|
|
1980
1987
|
return n;
|
|
1981
1988
|
if (e.messageType === "file") {
|
|
1982
1989
|
const o = e.file;
|
|
1983
1990
|
return o.type.startsWith("image") || o.type.startsWith("video") ? /* @__PURE__ */ r.createElement(Pi, { ...e }, n) : /* @__PURE__ */ r.createElement(Di, { ...e }, n);
|
|
1984
1991
|
}
|
|
1985
|
-
return /* @__PURE__ */ r.createElement(
|
|
1992
|
+
return /* @__PURE__ */ r.createElement(Kt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
1986
1993
|
}
|
|
1987
|
-
const
|
|
1988
|
-
function
|
|
1989
|
-
return /* @__PURE__ */ r.createElement(Zi, { id: e, tabIndex: 0, onClick: o, $size:
|
|
1994
|
+
const kt = (e) => /* @__PURE__ */ r.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.0008 0.973633C10.6172 0.973633 9.49558 2.09527 9.49558 3.47888C9.49558 4.50705 10.115 5.39055 11.0009 5.77664V7.47887H13.0009V5.77653C13.8868 5.3904 14.5061 4.50696 14.5061 3.47888C14.5061 2.09527 13.3844 0.973633 12.0008 0.973633ZM0.250977 16.5788L0.250977 10.5789H2.25098L2.25098 16.5788H0.250977ZM21.7511 10.5789V16.5788H23.7511V10.5789H21.7511ZM18.251 7.47888H3.25097V18.9789C3.25097 20.3596 4.37026 21.4789 5.75097 21.4789H18.251C19.6317 21.4789 20.751 20.3596 20.751 18.9789V9.97887C20.751 8.59816 19.6317 7.47888 18.251 7.47888ZM9.78434 11.9539V15.2038C9.78434 15.7561 9.33663 16.2038 8.78434 16.2038C8.23206 16.2038 7.78434 15.7561 7.78434 15.2038V11.9539C7.78434 11.4016 8.23206 10.9539 8.78434 10.9539C9.33663 10.9539 9.78434 11.4016 9.78434 11.9539ZM16.2677 11.9539V15.2038C16.2677 15.7561 15.82 16.2038 15.2677 16.2038C14.7154 16.2038 14.2677 15.7561 14.2677 15.2038V11.9539C14.2677 11.4016 14.7154 10.9539 15.2677 10.9539C15.82 10.9539 16.2677 11.4016 16.2677 11.9539Z", fill: "#0D0D0D" }));
|
|
1995
|
+
function At({ id: e, src: t, size: n = 56, onClick: o, style: i }) {
|
|
1996
|
+
return /* @__PURE__ */ r.createElement(Zi, { id: e, tabIndex: 0, onClick: o, $size: Y(n), style: i }, t ? /* @__PURE__ */ r.createElement(Yi, { src: t }) : /* @__PURE__ */ r.createElement(O, { type: "user", size: n }));
|
|
1990
1997
|
}
|
|
1991
1998
|
const Zi = u.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${h.themedColor.bg_100_500};&:focus{outline:none;}`, Yi = u.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
|
|
1992
1999
|
function qi({ sender: e, isBotMessage: t }) {
|
|
1993
|
-
const n = `${
|
|
1994
|
-
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Ji, { id: n }, /* @__PURE__ */ r.createElement(
|
|
2000
|
+
const n = `${me}-sender-avatar`;
|
|
2001
|
+
return !e.profileUrl && t ? /* @__PURE__ */ r.createElement(Ji, { id: n }, /* @__PURE__ */ r.createElement(kt, null)) : /* @__PURE__ */ r.createElement(At, { id: n, size: Je, src: e.profileUrl });
|
|
1995
2002
|
}
|
|
1996
|
-
const Ji = u.div`flex-shrink:0;width:${
|
|
2003
|
+
const Ji = u.div`flex-shrink:0;width:${Je}px;height:${Je}px;box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary};path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}}`;
|
|
1997
2004
|
function Xi({ sender: e }) {
|
|
1998
|
-
return /* @__PURE__ */ r.createElement(Qi, { id: `${
|
|
2005
|
+
return /* @__PURE__ */ r.createElement(Qi, { id: `${me}-sender-name`, variant: "caption1", color: h.themedColor.textMidEmphasis }, e.nickname);
|
|
1999
2006
|
}
|
|
2000
2007
|
const Qi = u(k)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
|
|
2001
2008
|
function es({ createdAt: e }) {
|
|
2002
2009
|
const { stringSet: t, format: n } = R();
|
|
2003
|
-
return e ? /* @__PURE__ */ r.createElement(k, { id: `${
|
|
2010
|
+
return e ? /* @__PURE__ */ r.createElement(k, { id: `${me}-sent-time`, variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2004
2011
|
}
|
|
2005
2012
|
function ts({ customStyle: e }) {
|
|
2006
2013
|
return /* @__PURE__ */ r.createElement(ns, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(rs, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
|
|
2007
2014
|
}
|
|
2008
2015
|
const ns = u.div`align-items:center;border-radius:12px;display:flex;gap:6px;justify-content:center;padding:16px 12px;background-color:${({ theme: e, $bgColor: t }) => t || e.colors.messageIncoming.background};`, rs = u.span`animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px;background:${({ theme: e, $color: t }) => t || e.colors.messageIncoming.text};@keyframes blink{0%{opacity:0.12;transform:scale(1);}21.43%{opacity:0.38;transform:scale(1.2);}42.86%{opacity:0.12;transform:scale(1);}100%{opacity:0.12;transform:scale(1);}}&:nth-child(1){animation-delay:0.4s;}&:nth-child(2){animation-delay:0.6s;}&:nth-child(3){animation-delay:0.8s;}`;
|
|
2009
|
-
function
|
|
2016
|
+
function Le() {
|
|
2010
2017
|
}
|
|
2011
|
-
async function
|
|
2018
|
+
async function zn(e) {
|
|
2012
2019
|
let t = e;
|
|
2013
2020
|
t && (!t.startsWith("http://") && !t.startsWith("https://") && (t = "https://" + t), window.open(t, "_blank", "noopener,noreferrer"));
|
|
2014
2021
|
}
|
|
2015
|
-
function
|
|
2022
|
+
function Vn(e) {
|
|
2016
2023
|
return !e || !e.conversation ? !1 : e.conversation.status === W.CLOSED;
|
|
2017
2024
|
}
|
|
2018
|
-
function
|
|
2025
|
+
function Wn(e) {
|
|
2019
2026
|
return !e || !e.conversation ? !1 : e.conversation.status === W.OPEN;
|
|
2020
2027
|
}
|
|
2021
|
-
function
|
|
2028
|
+
function Gn(e) {
|
|
2022
2029
|
var n;
|
|
2023
2030
|
const t = (n = e == null ? void 0 : e.conversation) == null ? void 0 : n.handoff;
|
|
2024
2031
|
return !!(t != null && t.timestamp);
|
|
2025
2032
|
}
|
|
2026
2033
|
function os(e) {
|
|
2027
|
-
return
|
|
2034
|
+
return Wn(e) && !Gn(e);
|
|
2028
2035
|
}
|
|
2029
2036
|
function is({
|
|
2030
2037
|
extendedMessagePayload: e,
|
|
2031
|
-
onClickCTA: t = ({ url: n }) =>
|
|
2038
|
+
onClickCTA: t = ({ url: n }) => zn(n)
|
|
2032
2039
|
}) {
|
|
2033
2040
|
const n = e == null ? void 0 : e.cta_button;
|
|
2034
|
-
return n ? /* @__PURE__ */ r.createElement(ss, { id: `${
|
|
2041
|
+
return n ? /* @__PURE__ */ r.createElement(ss, { id: `${me}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(as, { variant: "button" }, n.label)) : null;
|
|
2035
2042
|
}
|
|
2036
2043
|
const ss = u.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${h.themedColor.textHighEmphasis};background-color:${h.color.background50};${N.dark`
|
|
2037
2044
|
background-color: ${h.color.ondark.textDisabled};
|
|
@@ -2050,7 +2057,7 @@ class cs extends _r {
|
|
|
2050
2057
|
return { hasError: !0 };
|
|
2051
2058
|
}
|
|
2052
2059
|
render() {
|
|
2053
|
-
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(
|
|
2060
|
+
return this.state.hasError ? this.props.errorFallback : /* @__PURE__ */ r.createElement(Oe, { fallback: this.props.loadingFallback }, this.props.children);
|
|
2054
2061
|
}
|
|
2055
2062
|
}
|
|
2056
2063
|
const ds = /* @__PURE__ */ new Set(["default"]), { MessageTemplate: us } = jr({
|
|
@@ -2072,7 +2079,7 @@ const hs = ({
|
|
|
2072
2079
|
extendedMessagePayload: e,
|
|
2073
2080
|
onGetCachedMessageTemplate: t = () => null,
|
|
2074
2081
|
onRequestMessageTemplate: n,
|
|
2075
|
-
onHandleTemplateInternalAction: o =
|
|
2082
|
+
onHandleTemplateInternalAction: o = Le
|
|
2076
2083
|
}) => {
|
|
2077
2084
|
const i = e == null ? void 0 : e.message_template;
|
|
2078
2085
|
if (!ds.has((i == null ? void 0 : i.type) ?? "default")) throw new Error("Unsupported template type");
|
|
@@ -2086,7 +2093,7 @@ const hs = ({
|
|
|
2086
2093
|
viewVariables: i == null ? void 0 : i.view_variables,
|
|
2087
2094
|
aiAgentColorVariables: s.aiAgentColorVariables
|
|
2088
2095
|
});
|
|
2089
|
-
return /* @__PURE__ */ r.createElement(gs, { id: `${
|
|
2096
|
+
return /* @__PURE__ */ r.createElement(gs, { id: `${me}-ext-message-template` }, /* @__PURE__ */ r.createElement(
|
|
2090
2097
|
Gr,
|
|
2091
2098
|
{
|
|
2092
2099
|
handleInternalAction: (c, d) => {
|
|
@@ -2101,8 +2108,8 @@ function ps({
|
|
|
2101
2108
|
onClickSuggestedReply: t,
|
|
2102
2109
|
suggestedRepliesDirection: n = "vertical"
|
|
2103
2110
|
}) {
|
|
2104
|
-
const [o, i] =
|
|
2105
|
-
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(fs, { id: `${
|
|
2111
|
+
const [o, i] = S(!1), a = (e == null ? void 0 : e.suggested_replies) ?? [];
|
|
2112
|
+
return a.length === 0 || o ? null : /* @__PURE__ */ r.createElement(fs, { id: `${me}-ext-suggested-replies`, $type: n }, a.map((s, l) => /* @__PURE__ */ r.createElement(
|
|
2106
2113
|
bs,
|
|
2107
2114
|
{
|
|
2108
2115
|
key: l,
|
|
@@ -2115,7 +2122,7 @@ function ps({
|
|
|
2115
2122
|
s
|
|
2116
2123
|
)));
|
|
2117
2124
|
}
|
|
2118
|
-
const fs = u.div`margin:16px 0;padding:0 ${
|
|
2125
|
+
const fs = u.div`margin:16px 0;padding:0 ${ie}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? xs : Es};`, bs = u(k)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${h.color.primary.main};border:1px solid ${h.color.primary.main};background-color:${h.themedColor.bg_50_600};&:hover{background-color:${h.themedColor.bg_100_500};}${({ $type: e, theme: t }) => $`
|
|
2119
2126
|
${e === "vertical" ? Cs : ys};
|
|
2120
2127
|
&:active {
|
|
2121
2128
|
background-color: ${t.colors.base.primary};
|
|
@@ -2123,7 +2130,7 @@ const fs = u.div`margin:16px 0;padding:0 ${oe}px;position:relative;display:flex;
|
|
|
2123
2130
|
}
|
|
2124
2131
|
`}
|
|
2125
2132
|
`, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, ys = $`white-space:nowrap;`;
|
|
2126
|
-
function
|
|
2133
|
+
function It(e) {
|
|
2127
2134
|
return e();
|
|
2128
2135
|
}
|
|
2129
2136
|
const _e = we({
|
|
@@ -2141,12 +2148,12 @@ const _e = we({
|
|
|
2141
2148
|
}
|
|
2142
2149
|
});
|
|
2143
2150
|
function vs(e) {
|
|
2144
|
-
return /* @__PURE__ */ r.createElement(
|
|
2151
|
+
return /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !1 });
|
|
2145
2152
|
}
|
|
2146
|
-
function
|
|
2153
|
+
function jn(e) {
|
|
2147
2154
|
var g, p, x, f;
|
|
2148
|
-
const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l =
|
|
2149
|
-
return /* @__PURE__ */ r.createElement(_s, { $marginBottom: n ? 0 :
|
|
2155
|
+
const { components: t } = _e.useContext(), n = !!e.isTyping, o = e.testerMode, i = !!((g = e.extendedMessagePayload) != null && g.message_template), a = !!((p = e.extendedMessagePayload) != null && p.cta_button), s = !!e.createdAt, l = It(() => e.messageType === "user" ? e.message.length > 0 : !0), c = e.groupType === "top" || e.groupType === "single", d = e.groupType === "bottom" || e.groupType === "single", m = o ? 0 : Je;
|
|
2156
|
+
return /* @__PURE__ */ r.createElement(_s, { $marginBottom: n ? 0 : St(e.groupType) }, c && /* @__PURE__ */ r.createElement(Ss, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, n && /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }), /* @__PURE__ */ r.createElement(t.MessageBody, { ...e }, a && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...e })))), i && /* @__PURE__ */ r.createElement(qt, { $startPadding: 0, $endPadding: 0, style: { marginTop: l ? ke : 0 } }, /* @__PURE__ */ r.createElement(
|
|
2150
2157
|
t.MessageTemplate,
|
|
2151
2158
|
{
|
|
2152
2159
|
...e,
|
|
@@ -2160,51 +2167,51 @@ function Kn(e) {
|
|
|
2160
2167
|
)),
|
|
2161
2168
|
messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(ct, { $extraStartPadding: m }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
|
|
2162
2169
|
}
|
|
2163
|
-
))), d && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(
|
|
2170
|
+
))), d && s && /* @__PURE__ */ r.createElement(Ts, { $extraStartPadding: m + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Bt, null, e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(qt, null, /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e })), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
|
|
2164
2171
|
}
|
|
2165
2172
|
const _s = u.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2166
|
-
`,
|
|
2173
|
+
`, ot = u.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2167
2174
|
padding-inline: ${e + n}px ${t}px;
|
|
2168
2175
|
`}
|
|
2169
|
-
`, Ss = u(
|
|
2176
|
+
`, Ss = u(ot)`display:flex;flex-direction:row;align-items:center;gap:8px;`, ct = u(ot)`display:flex;`, Ts = u(ot)`margin-top:${Fn}px;display:flex;align-items:flex-start;justify-content:flex-start;`, qt = u(ot)`display:flex;flex-direction:column;${({ $startPadding: e = ie, $endPadding: t = ie, $extraStartPadding: n = 0 }) => `
|
|
2170
2177
|
padding-inline: ${e + n}px ${t}px;
|
|
2171
2178
|
`}
|
|
2172
2179
|
`;
|
|
2173
2180
|
function ws({ file: e, children: t, onClickFile: n }) {
|
|
2174
2181
|
return /* @__PURE__ */ r.createElement(ks, null, /* @__PURE__ */ r.createElement(
|
|
2175
|
-
|
|
2182
|
+
wt,
|
|
2176
2183
|
{
|
|
2177
2184
|
name: e.name,
|
|
2178
|
-
type:
|
|
2185
|
+
type: Tt(e.name, e.type),
|
|
2179
2186
|
onClick: n && (() => n == null ? void 0 : n(e))
|
|
2180
2187
|
}
|
|
2181
2188
|
), t);
|
|
2182
2189
|
}
|
|
2183
|
-
const ks = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`,
|
|
2190
|
+
const ks = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Kn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(As, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(O, { type: "spinner", size: n })), As = u.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
|
|
2184
2191
|
function Is({ file: e, metadata: t, onClickMedia: n, children: o }) {
|
|
2185
|
-
const { aspectRatio: i, localFile: a } = t, [s] =
|
|
2192
|
+
const { aspectRatio: i, localFile: a } = t, [s] = S(() => a instanceof File ? URL.createObjectURL(a) : e.url), [l, c] = S(!1), d = {
|
|
2186
2193
|
onClick: () => n == null ? void 0 : n(e),
|
|
2187
2194
|
$ratio: i
|
|
2188
2195
|
};
|
|
2189
|
-
return /* @__PURE__ */ r.createElement($s, null, /* @__PURE__ */ r.createElement(Ms, { ...d }, !l && /* @__PURE__ */ r.createElement(
|
|
2196
|
+
return /* @__PURE__ */ r.createElement($s, null, /* @__PURE__ */ r.createElement(Ms, { ...d }, !l && /* @__PURE__ */ r.createElement(Kn, { size: 26 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: "textLowEmphasis", size: 26 })), /* @__PURE__ */ r.createElement(Os, { $loaded: l, src: s, alt: "image-message", onLoad: () => c(!0) })), o);
|
|
2190
2197
|
}
|
|
2191
|
-
const $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Ms = u.div`width:${
|
|
2198
|
+
const $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${ke}px;`, Ms = u.div`width:${Be}px;border-radius:12px;overflow:hidden;cursor:pointer;height:auto;aspect-ratio:${(e) => e.$ratio};position:relative;display:flex;align-items:center;justify-content:center;${N.light`
|
|
2192
2199
|
background-color: ${h.color.background100};
|
|
2193
2200
|
`}
|
|
2194
2201
|
${N.dark`
|
|
2195
2202
|
background-color: ${h.color.background400};
|
|
2196
2203
|
`}
|
|
2197
2204
|
`, Os = u.img`position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0;object-fit:cover;opacity:${(e) => e.$loaded ? 1 : 0};transition:opacity 0.5s ease;`;
|
|
2198
|
-
function
|
|
2205
|
+
function Jt(e) {
|
|
2199
2206
|
var n, o;
|
|
2200
2207
|
const t = ve(() => {
|
|
2201
|
-
const i = Vi(
|
|
2202
|
-
return
|
|
2208
|
+
const i = Vi(Hn(e.message));
|
|
2209
|
+
return _n.sanitize(i);
|
|
2203
2210
|
}, [e.message]);
|
|
2204
2211
|
return /* @__PURE__ */ r.createElement(
|
|
2205
2212
|
Ls,
|
|
2206
2213
|
{
|
|
2207
|
-
$maxWidth: e.maxBodyWidth ??
|
|
2214
|
+
$maxWidth: e.maxBodyWidth ?? Be,
|
|
2208
2215
|
$color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
|
|
2209
2216
|
$bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
|
|
2210
2217
|
},
|
|
@@ -2220,11 +2227,11 @@ const Ls = u.div`display:flex;flex-direction:column;border-radius:12px;overflow:
|
|
|
2220
2227
|
overflow-wrap: break-word;
|
|
2221
2228
|
`, Rs = u(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
|
|
2222
2229
|
function Ds(e) {
|
|
2223
|
-
const { stringSet: t } = R(), n =
|
|
2224
|
-
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Is, { ...e }, n) : /* @__PURE__ */ r.createElement(ws, { ...e }, n) : /* @__PURE__ */ r.createElement(
|
|
2230
|
+
const { stringSet: t } = R(), n = Un(e) ? /* @__PURE__ */ r.createElement(Jt, { ...e }) : null;
|
|
2231
|
+
return e.messageType === "user" ? n : e.messageType === "file" ? e.file.type.startsWith("image") ? /* @__PURE__ */ r.createElement(Is, { ...e }, n) : /* @__PURE__ */ r.createElement(ws, { ...e }, n) : /* @__PURE__ */ r.createElement(Jt, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
|
|
2225
2232
|
}
|
|
2226
2233
|
function Ns({ sendingStatus: e }) {
|
|
2227
|
-
const t =
|
|
2234
|
+
const t = Et();
|
|
2228
2235
|
switch (e) {
|
|
2229
2236
|
case "pending":
|
|
2230
2237
|
return /* @__PURE__ */ r.createElement(Ps, { size: 16 }, /* @__PURE__ */ r.createElement(O, { type: "spinner", color: t.colors.messageOutgoing.background, size: 16 }));
|
|
@@ -2237,12 +2244,12 @@ function Ns({ sendingStatus: e }) {
|
|
|
2237
2244
|
return /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(O, { type: "chevron-down" }));
|
|
2238
2245
|
}
|
|
2239
2246
|
}
|
|
2240
|
-
const Ps = u(
|
|
2247
|
+
const Ps = u(Kn)`margin-bottom:2px;width:16px;height:16px;`;
|
|
2241
2248
|
function Bs({ createdAt: e }) {
|
|
2242
2249
|
const { stringSet: t, format: n } = R();
|
|
2243
2250
|
return e ? /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
|
|
2244
2251
|
}
|
|
2245
|
-
const
|
|
2252
|
+
const $t = we({
|
|
2246
2253
|
template: Fs,
|
|
2247
2254
|
components: {
|
|
2248
2255
|
SendingStatus: Ns,
|
|
@@ -2251,27 +2258,27 @@ const Mt = we({
|
|
|
2251
2258
|
}
|
|
2252
2259
|
});
|
|
2253
2260
|
function Fs(e) {
|
|
2254
|
-
const { components: t } =
|
|
2255
|
-
return /* @__PURE__ */ r.createElement(Us, { $marginBottom:
|
|
2261
|
+
const { components: t } = $t.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
|
|
2262
|
+
return /* @__PURE__ */ r.createElement(Us, { $marginBottom: St(e.groupType) }, /* @__PURE__ */ r.createElement(Hs, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(zs, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
|
|
2256
2263
|
}
|
|
2257
2264
|
const Us = u.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
2258
|
-
`,
|
|
2259
|
-
`, Hs = u(
|
|
2265
|
+
`, Zn = u.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = ie, $endPadding: t = ie, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
|
|
2266
|
+
`, Hs = u(Zn)``, zs = u(Zn)`margin-top:${Fn}px;`;
|
|
2260
2267
|
function Vs(e) {
|
|
2261
|
-
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ws, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, Gs(
|
|
2268
|
+
return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Ws, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, Gs(_n.sanitize(e.message))));
|
|
2262
2269
|
}
|
|
2263
2270
|
const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color:inherit;}`, Gs = (e) => {
|
|
2264
2271
|
const t = /\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g, n = [];
|
|
2265
2272
|
let o = 0;
|
|
2266
2273
|
return e.replace(t, (i, a, s, l) => (n.push(e.slice(o, l)), n.push(
|
|
2267
|
-
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel:
|
|
2274
|
+
/* @__PURE__ */ r.createElement("a", { key: s, href: s, target: "_blank", rel: _t }, a)
|
|
2268
2275
|
), o = l + i.length, i)), n.push(e.slice(o)), n;
|
|
2269
2276
|
}, js = ({ submitted: e, defaultValue: t, value: n, onChange: o }) => {
|
|
2270
2277
|
const { stringSet: i } = R();
|
|
2271
2278
|
return D(() => {
|
|
2272
2279
|
typeof n > "u" && typeof t == "boolean" && (o == null || o(t));
|
|
2273
2280
|
}, [n, t]), /* @__PURE__ */ r.createElement(Ks, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, i.CSAT_CRE_TITLE), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
|
|
2274
|
-
|
|
2281
|
+
Xt,
|
|
2275
2282
|
{
|
|
2276
2283
|
checked: n === !0,
|
|
2277
2284
|
label: i.CSAT_CRE_SOLVED,
|
|
@@ -2279,7 +2286,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2279
2286
|
onClick: () => o == null ? void 0 : o(!0)
|
|
2280
2287
|
}
|
|
2281
2288
|
), /* @__PURE__ */ r.createElement(
|
|
2282
|
-
|
|
2289
|
+
Xt,
|
|
2283
2290
|
{
|
|
2284
2291
|
checked: n === !1,
|
|
2285
2292
|
label: i.CSAT_CRE_NOT_SOLVED,
|
|
@@ -2287,7 +2294,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2287
2294
|
onClick: () => o == null ? void 0 : o(!1)
|
|
2288
2295
|
}
|
|
2289
2296
|
)));
|
|
2290
|
-
},
|
|
2297
|
+
}, Xt = ({ onClick: e, checked: t, label: n, disabled: o }) => {
|
|
2291
2298
|
const i = t ? h.color.primary.main : o ? h.themedColor.textDisabled : h.themedColor.textLowEmphasis, a = t ? h.themedColor.textHighEmphasis : o ? h.themedColor.textLowEmphasis : h.themedColor.textHighEmphasis;
|
|
2292
2299
|
return /* @__PURE__ */ r.createElement(Zs, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(O, { size: 24, type: t ? "radio-on" : "radio-off", color: i }), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: a }, n));
|
|
2293
2300
|
}, Ks = u.div`display:flex;flex-direction:column;gap:8px;`, Zs = u.button`all:unset;display:flex;align-items:center;justify-content:flex-start;gap:2px;span{line-height:initial;}&:enabled{cursor:pointer;}`, Ys = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", id: "csat1", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08301 20C2.08301 10.1049 10.1046 2.08334 19.9997 2.08334C29.8948 2.08334 37.9163 10.1049 37.9163 20C37.9163 29.8952 29.8948 37.9167 19.9997 37.9167C10.1046 37.9167 2.08301 29.8952 2.08301 20Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5824 29.3328C13.1344 29.7473 13.918 29.636 14.3326 29.084C15.6269 27.3607 17.6835 26.25 19.9997 26.25C22.316 26.25 24.3727 27.3607 25.6668 29.084C26.0815 29.636 26.865 29.7473 27.4172 29.3328C27.9692 28.9182 28.0805 28.1347 27.6658 27.5825C25.9198 25.2577 23.1357 23.75 19.9997 23.75C16.8638 23.75 14.0797 25.2577 12.3336 27.5825C11.919 28.1347 12.0304 28.9182 12.5824 29.3328Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M28.4449 13.7707C29.1324 13.8328 29.64 14.4406 29.578 15.1281C29.516 15.8153 28.909 16.3221 28.2219 16.2608C28.2219 16.2608 28.0282 16.2502 27.9267 16.2487C27.7224 16.2457 27.4382 16.2509 27.1224 16.2833C26.7864 16.3177 26.4644 16.3782 26.1799 16.4662L26.304 16.86C26.7792 18.3675 25.5094 19.5813 24.2057 19.5813C23.504 19.5813 22.8319 19.2617 22.4295 18.6857C22.0025 18.0745 21.9417 17.241 22.4075 16.5344C22.7505 16.0143 23.2444 15.3831 23.8959 14.8657C24.8355 14.1195 26.0435 13.8809 26.867 13.7963C27.3024 13.7517 28.0149 13.7319 28.4449 13.7707Z", fill: "black", fillOpacity: 0.12 }), /* @__PURE__ */ r.createElement("path", { d: "M11.5553 13.7707C10.8677 13.8328 10.3601 14.4406 10.4221 15.1281C10.4842 15.8153 11.0912 16.3221 11.7782 16.2608C11.7782 16.2608 11.972 16.2502 12.0734 16.2487C12.2778 16.2457 12.562 16.2509 12.8778 16.2833C13.2137 16.3177 13.5357 16.3782 13.8203 16.4662L13.6962 16.86C13.2209 18.3675 14.4907 19.5813 15.7944 19.5813C16.4962 19.5813 17.1683 19.2617 17.5707 18.6857C17.9975 18.0745 18.0585 17.241 17.5925 16.5344C17.2497 16.0143 16.7557 15.3831 16.1043 14.8657C15.1646 14.1195 13.9566 13.8809 13.1331 13.7963C12.6978 13.7517 11.9853 13.7319 11.5553 13.7707Z", fill: "black", fillOpacity: 0.12 })), qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.08337 19.9999C2.08337 10.1048 10.1049 2.08325 20 2.08325C29.8952 2.08325 37.9167 10.1048 37.9167 19.9999C37.9167 29.8951 29.8952 37.9166 20 37.9166C10.1049 37.9166 2.08337 29.8951 2.08337 19.9999Z", fill: "url(#paint0_linear_159_173206)" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.5828 29.3328C13.1348 29.7473 13.9184 29.636 14.3329 29.084C15.6272 27.3607 17.6839 26.25 20 26.25C22.3164 26.25 24.373 27.3607 25.6672 29.084C26.0819 29.636 26.8654 29.7473 27.4175 29.3328C27.9695 28.9182 28.0809 28.1347 27.6662 27.5825C25.9202 25.2577 23.136 23.75 20 23.75C16.8642 23.75 14.0801 25.2577 12.334 27.5825C11.9194 28.1347 12.0308 28.9182 12.5828 29.3328Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M28.4454 13.7707C29.1329 13.8328 29.6405 14.4406 29.5785 15.1281C29.5165 15.8153 28.9095 16.3221 28.2224 16.2608C28.2224 16.2608 28.0287 16.2502 27.9272 16.2487C27.7229 16.2457 27.4387 16.2509 27.1229 16.2833C26.7869 16.3177 26.4649 16.3782 26.1804 16.4662L26.3045 16.86C26.7797 18.3675 25.5099 19.5813 24.2062 19.5813C23.5045 19.5813 22.8324 19.2617 22.43 18.6857C22.003 18.0745 21.9422 17.241 22.408 16.5344C22.751 16.0143 23.2449 15.3831 23.8964 14.8657C24.836 14.1195 26.044 13.8809 26.8675 13.7963C27.3029 13.7517 28.0154 13.7319 28.4454 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.5549 13.7707C10.8674 13.8328 10.3597 14.4406 10.4218 15.1281C10.4838 15.8153 11.0908 16.3221 11.7779 16.2608C11.7779 16.2608 11.9716 16.2502 12.073 16.2487C12.2774 16.2457 12.5616 16.2509 12.8774 16.2833C13.2134 16.3177 13.5353 16.3782 13.8199 16.4662L13.6958 16.86C13.2205 18.3675 14.4904 19.5813 15.794 19.5813C16.4958 19.5813 17.168 19.2617 17.5703 18.6857C17.9971 18.0745 18.0581 17.241 17.5921 16.5344C17.2493 16.0143 16.7553 15.3831 16.1039 14.8657C15.1643 14.1195 13.9562 13.8809 13.1327 13.7963C12.6974 13.7517 11.9849 13.7319 11.5549 13.7707Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("linearGradient", { id: "paint0_linear_159_173206", x1: 20, y1: 2.08325, x2: 20, y2: 37.9166, gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ r.createElement("stop", { stopColor: "#FF2D1D" }), /* @__PURE__ */ r.createElement("stop", { offset: 1, stopColor: "#FFA540" })))), Js = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M15 28.333C16.3927 27.2867 18.124 26.6667 20 26.6667C21.876 26.6667 23.6073 27.2867 25 28.333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 13.3511C11.667 13.3511 14.0161 13.139 15.3268 14.18M15.3268 14.18L14.8882 15.5711C14.7153 16.1199 15.1675 16.6667 15.7943 16.6667C16.4531 16.6667 16.8882 16.0723 16.549 15.5579C16.2483 15.102 15.8388 14.5866 15.3268 14.18ZM23.3337 13.3511C23.3337 13.3511 25.6827 13.139 26.9935 14.18M26.9935 14.18L26.555 15.5711C26.382 16.1199 26.8342 16.6667 27.461 16.6667C28.1198 16.6667 28.5548 16.0723 28.2157 15.5579C27.915 15.102 27.5055 14.5866 26.9935 14.18Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), Xs = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { d: "M14.249 27.334C15.851 26.13 17.844 25.417 20 25.417c2.156 0 4.149.714 5.751 1.917.553.415.664 1.199.25 1.751-.415.552-1.199.664-1.751.25-1.183-.889-2.652-1.416-4.25-1.416s-3.067.527-4.25 1.416c-.553.414-1.336.302-1.751-.25-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M23.445 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.125-.394c-.285-.088-.607-.148-.942-.182-.316-.033-.6-.038-.804-.035-.101.002-.242.01-.294.013Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { d: "M11.779 14.596c-.687.062-1.294-.445-1.356-1.132-.062-.687.445-1.295 1.132-1.357.082-.005.342-.02.482-.022.277-.004.662.002 1.097.047.823.085 2.031.323 2.97 1.07.652.518 1.146 1.15 1.489 1.67.466.706.405 1.54-.022 2.15-.402.576-1.074.896-1.775.896-1.304 0-2.573-1.214-2.098-2.722l.124-.394c-.284-.088-.606-.148-.941-.182-.316-.033-.6-.038-.804-.035-.101.002-.243.01-.294.013Z", fill: "#141B34" })), Qs = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M15 26.6667H25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), ea = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.75 26.667c0-.691.56-1.25 1.25-1.25h10c.69 0 1.25.559 1.25 1.25 0 .691-.56 1.25-1.25 1.25h-10c-.69 0-1.25-.559-1.25-1.25Z", fill: "#141B34" })), ta = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6667C29.2044 36.6667 36.6663 29.2048 36.6663 20C36.6663 10.7953 29.2044 3.33334 19.9997 3.33334C10.7949 3.33334 3.33301 10.7953 3.33301 20C3.33301 29.2048 10.7949 36.6667 19.9997 36.6667Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M13.333 25C14.8532 27.024 17.2735 28.3333 19.9997 28.3333C22.7258 28.3333 25.1462 27.024 26.6663 25", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M13.348 15H13.333M26.6663 15H26.6513", stroke: "black", strokeOpacity: 0.12, strokeWidth: 3.33333, strokeLinecap: "round", strokeLinejoin: "round" })), na = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.583 24.001c.552-.414 1.335-.302 1.75.25 1.294 1.723 3.35 2.834 5.667 2.834s4.373-1.11 5.667-2.834c.415-.552 1.199-.664 1.751-.25.552.415.664 1.199.25 1.751C25.92 28.076 23.136 29.584 20 29.584s-5.92-1.508-7.666-3.832c-.415-.552-.303-1.336.249-1.751Z", fill: "#141B34" }), /* @__PURE__ */ r.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.25 15c0-1.151.933-2.083 2.083-2.083h.015c1.151 0 2.084.933 2.084 2.083 0 1.151-.933 2.083-2.084 2.083h-.015c-1.15 0-2.083-.933-2.083-2.083ZM24.568 15c0-1.151.933-2.083 2.084-2.083h.015c1.151 0 2.083.933 2.083 2.083 0 1.151-.932 2.083-2.083 2.083h-.015c-1.151 0-2.084-.933-2.084-2.083Z", fill: "#141B34" })), ra = (e) => /* @__PURE__ */ r.createElement("svg", { width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M19.9997 36.6663C29.2044 36.6663 36.6663 29.2044 36.6663 19.9997C36.6663 10.7949 29.2044 3.33301 19.9997 3.33301C10.7949 3.33301 3.33301 10.7949 3.33301 19.9997C3.33301 29.2044 10.7949 36.6663 19.9997 36.6663Z", fill: "#E0E0E0" }), /* @__PURE__ */ r.createElement("path", { d: "M19.9997 30C23.16 30 25.8145 27.867 26.56 24.9832C26.9068 23.6413 26.4033 23.3333 25.0765 23.3333H14.9228C13.5959 23.3333 13.0925 23.6413 13.4393 24.9832C14.1848 27.867 16.8393 30 19.9997 30Z", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ r.createElement("path", { d: "M11.667 15.8333C11.667 14.4526 12.7863 13.3333 14.167 13.3333C15.5477 13.3333 16.667 14.4526 16.667 15.8333M23.3337 15.8333C23.3337 14.4526 24.453 13.3333 25.8337 13.3333C27.2143 13.3333 28.3337 14.4526 28.3337 15.8333", stroke: "black", strokeOpacity: 0.12, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })), oa = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 40, height: 40, viewBox: "0 0 40 40", fill: "none", ...e }, /* @__PURE__ */ r.createElement("path", { d: "M2.083 20C2.083 10.105 10.105 2.083 20 2.083c9.895 0 17.917 8.021 17.917 17.917 0 9.895-8.022 17.917-17.917 17.917C10.105 37.917 2.083 29.895 2.083 20Z", fill: "#FFD46E" }), /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip0_159_173224)" }, /* @__PURE__ */ r.createElement("g", { clipPath: "url(#clip1_159_173224)" }, /* @__PURE__ */ r.createElement("path", { d: "M20 30.624c3.752 0 6.904-2.532 7.789-5.956.412-1.593-.185-1.959-1.76-1.959H13.973c-1.575 0-2.173.366-1.761 1.959.885 3.424 4.037 5.956 7.788 5.956Z", fill: "#141B34" })), /* @__PURE__ */ r.createElement("mask", { id: "mask0_159_173224", style: {
|
|
@@ -2338,7 +2345,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2338
2345
|
isActive: (e) => 5 <= e,
|
|
2339
2346
|
getTooltip: (e) => e.CSAT5_RATING_SCORE_5
|
|
2340
2347
|
}
|
|
2341
|
-
], sa = () => ia,
|
|
2348
|
+
], sa = () => ia, Yn = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(bt, null, t, /* @__PURE__ */ r.createElement(ca, { $position: n }, /* @__PURE__ */ r.createElement(da, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(aa, { $position: n }))), aa = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
2342
2349
|
"svg",
|
|
2343
2350
|
{
|
|
2344
2351
|
style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
|
|
@@ -2352,9 +2359,9 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2352
2359
|
), la = {
|
|
2353
2360
|
top: $`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
2354
2361
|
bottom: $`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
2355
|
-
}, bt = u.div`position:relative;`, ca = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${
|
|
2362
|
+
}, bt = u.div`position:relative;`, ca = u.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${be.TOOLTIP};${({ $position: e }) => la[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${bt}:hover &,${bt}:focus-within &{opacity:1;}`, da = u(k)`padding:6px 8px;background:${h.themedColor.textHighEmphasis};color:${h.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, ua = ({ submitted: e, value: t, onChange: n }) => {
|
|
2356
2363
|
const { stringSet: o } = R(), i = sa(), a = typeof t == "number";
|
|
2357
|
-
return /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ha, null, i.map((s) => /* @__PURE__ */ r.createElement(
|
|
2364
|
+
return /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: h.themedColor.textMidEmphasis }, o.CSAT_RATING_TITLE), /* @__PURE__ */ r.createElement(ha, null, i.map((s) => /* @__PURE__ */ r.createElement(Yn, { disabled: e, key: s.value, label: s.getTooltip(o) }, /* @__PURE__ */ r.createElement(
|
|
2358
2365
|
ga,
|
|
2359
2366
|
{
|
|
2360
2367
|
disabled: e,
|
|
@@ -2398,7 +2405,7 @@ const Ws = u.div`text-align:center;text-wrap:pretty;a{text-decoration:none;color
|
|
|
2398
2405
|
const { stringSet: t } = R();
|
|
2399
2406
|
return e ? /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_SUBMITTED) : /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, t.CSAT_TITLE_UNSUBMITTED);
|
|
2400
2407
|
};
|
|
2401
|
-
var
|
|
2408
|
+
var ne = /* @__PURE__ */ ((e) => (e.AI_AGENT_CSAT_5 = "AI_AGENT_CSAT_5", e.AI_AGENT_CSAT_5_WITH_CRE = "AI_AGENT_CSAT_5_WITH_CRE", e.HELPDESK_CSAT_5 = "HELPDESK_CSAT_5", e))(ne || {});
|
|
2402
2409
|
const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
2403
2410
|
type: e,
|
|
2404
2411
|
renderSubmitButton: t,
|
|
@@ -2411,8 +2418,8 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
|
2411
2418
|
csat: n,
|
|
2412
2419
|
csatReason: o,
|
|
2413
2420
|
isResolved: i
|
|
2414
|
-
}), l = typeof n == "number" ? "submitted" : (e ===
|
|
2415
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(xa, { ...c }), e ===
|
|
2421
|
+
}), l = typeof n == "number" ? "submitted" : (e === ne.AI_AGENT_CSAT_5 || e === ne.HELPDESK_CSAT_5) && typeof a.csat == "number" || e === ne.AI_AGENT_CSAT_5_WITH_CRE && typeof a.csat == "number" && typeof a.isResolved == "boolean" ? "submittable" : "unsubmittable", c = { state: l, submitted: l === "submitted" };
|
|
2422
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ca, null, /* @__PURE__ */ r.createElement(xa, { ...c }), e === ne.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
|
|
2416
2423
|
js,
|
|
2417
2424
|
{
|
|
2418
2425
|
...c,
|
|
@@ -2435,16 +2442,16 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
|
2435
2442
|
if (e.messageType !== "admin.csat")
|
|
2436
2443
|
throw new Error("Invalid message type");
|
|
2437
2444
|
const t = Ur(), { stringSet: n } = R(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: m } = (o == null ? void 0 : o.csat) ?? {};
|
|
2438
|
-
if (!d || !m || !
|
|
2439
|
-
const g = m ===
|
|
2440
|
-
x.csat && !
|
|
2445
|
+
if (!d || !m || !ne[m]) return null;
|
|
2446
|
+
const g = m === ne.AI_AGENT_CSAT_5 || m === ne.AI_AGENT_CSAT_5_WITH_CRE || m === ne.HELPDESK_CSAT_5 ? dt : () => null, p = (x) => {
|
|
2447
|
+
x.csat && !Qt(s) ? c({
|
|
2441
2448
|
csatType: x.csatType,
|
|
2442
2449
|
csat: x.csat,
|
|
2443
2450
|
csatReason: x.csatReason,
|
|
2444
2451
|
isResolved: x.isResolved
|
|
2445
2452
|
}) : t();
|
|
2446
2453
|
};
|
|
2447
|
-
return /* @__PURE__ */ r.createElement(_a, null, !i &&
|
|
2454
|
+
return /* @__PURE__ */ r.createElement(_a, null, !i && Qt(s) ? /* @__PURE__ */ r.createElement(ya, null) : /* @__PURE__ */ r.createElement(
|
|
2448
2455
|
g,
|
|
2449
2456
|
{
|
|
2450
2457
|
type: m,
|
|
@@ -2455,10 +2462,10 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
|
|
|
2455
2462
|
}
|
|
2456
2463
|
));
|
|
2457
2464
|
}, _a = u.div`display:flex;flex-direction:column;background-color:${({ theme: e }) => e.colors.csat.background};border-radius:16px;gap:16px;padding:24px;`, Sa = u.button`all:unset;background-color:${({ theme: e }) => e.colors.base.primary};color:${({ theme: e }) => e.colors.base.primaryContrastContent};border-radius:6px;padding:10px 20px;display:flex;align-items:center;justify-content:center;cursor:pointer;&:hover{background-color:${h.color.primary.dark};}&:disabled{color:${h.color.ondark.textLowEmphasis};background-color:${h.themedColor.textDisabled};cursor:not-allowed;}`;
|
|
2458
|
-
function
|
|
2465
|
+
function Qt(e) {
|
|
2459
2466
|
return !!e && e < Date.now();
|
|
2460
2467
|
}
|
|
2461
|
-
const
|
|
2468
|
+
const Mt = we({
|
|
2462
2469
|
template: Ta,
|
|
2463
2470
|
components: {
|
|
2464
2471
|
AdminMessage: Vs,
|
|
@@ -2466,10 +2473,10 @@ const Ot = we({
|
|
|
2466
2473
|
}
|
|
2467
2474
|
});
|
|
2468
2475
|
function Ta(e) {
|
|
2469
|
-
const { components: t } =
|
|
2470
|
-
return /* @__PURE__ */ r.createElement(wa, { $marginBottom:
|
|
2476
|
+
const { components: t } = Mt.useContext(), n = It(() => e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null);
|
|
2477
|
+
return /* @__PURE__ */ r.createElement(wa, { $marginBottom: St(e.groupType) }, n);
|
|
2471
2478
|
}
|
|
2472
|
-
const wa = u.div`padding-inline:${
|
|
2479
|
+
const wa = u.div`padding-inline:${ie}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, en = {
|
|
2473
2480
|
file: "attach",
|
|
2474
2481
|
snippet: "snippet",
|
|
2475
2482
|
site: "website",
|
|
@@ -2497,10 +2504,10 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2497
2504
|
// Note: This component is used with the dashboard, so cssVars should not be used.
|
|
2498
2505
|
iconColor: p = "#000000",
|
|
2499
2506
|
textColor: x = "#000000",
|
|
2500
|
-
highlightColor: f =
|
|
2507
|
+
highlightColor: f = Ln.DEFAULT_PRIMARY
|
|
2501
2508
|
} = g;
|
|
2502
|
-
return /* @__PURE__ */ r.createElement(
|
|
2503
|
-
|
|
2509
|
+
return /* @__PURE__ */ r.createElement(tn, null, e && /* @__PURE__ */ r.createElement(tn, null, /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "actionbook", color: p })), /* @__PURE__ */ r.createElement(
|
|
2510
|
+
je,
|
|
2504
2511
|
{
|
|
2505
2512
|
$clickable: !!i,
|
|
2506
2513
|
$highlightColor: f,
|
|
@@ -2509,8 +2516,8 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2509
2516
|
onClick: () => i == null ? void 0 : i(e)
|
|
2510
2517
|
},
|
|
2511
2518
|
e.name
|
|
2512
|
-
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(
|
|
2513
|
-
|
|
2519
|
+
))), t == null ? void 0 : t.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "function", color: p })), /* @__PURE__ */ r.createElement(Xe, null, /* @__PURE__ */ r.createElement(
|
|
2520
|
+
je,
|
|
2514
2521
|
{
|
|
2515
2522
|
$clickable: !!i,
|
|
2516
2523
|
$highlightColor: f,
|
|
@@ -2519,11 +2526,11 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2519
2526
|
onClick: () => a == null ? void 0 : a(E)
|
|
2520
2527
|
},
|
|
2521
2528
|
E.name
|
|
2522
|
-
), /* @__PURE__ */ r.createElement(Ia, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: f }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: f }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.id }, /* @__PURE__ */ r.createElement(
|
|
2523
|
-
default: /* @__PURE__ */ r.createElement(O, { size: 16, type:
|
|
2529
|
+
), /* @__PURE__ */ r.createElement(Ia, { role: "button", onClick: () => s == null ? void 0 : s(E) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: f }, "View details"), /* @__PURE__ */ r.createElement(O, { type: "chevron-right", size: 16, color: f }))))), n == null ? void 0 : n.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.id }, /* @__PURE__ */ r.createElement(Ke, null, m({
|
|
2530
|
+
default: /* @__PURE__ */ r.createElement(O, { size: 16, type: en[E.source_type] ?? en.snippet, color: p }),
|
|
2524
2531
|
sourceType: E.source_type
|
|
2525
2532
|
})), /* @__PURE__ */ r.createElement(
|
|
2526
|
-
|
|
2533
|
+
je,
|
|
2527
2534
|
{
|
|
2528
2535
|
$clickable: !!l,
|
|
2529
2536
|
$highlightColor: f,
|
|
@@ -2532,8 +2539,8 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2532
2539
|
onClick: () => l == null ? void 0 : l(E)
|
|
2533
2540
|
},
|
|
2534
2541
|
E.preview_title
|
|
2535
|
-
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(
|
|
2536
|
-
|
|
2542
|
+
))), o == null ? void 0 : o.map((E) => /* @__PURE__ */ r.createElement(ut, { key: E.key }, /* @__PURE__ */ r.createElement(Ke, null, /* @__PURE__ */ r.createElement(O, { size: 16, type: "template", color: p })), /* @__PURE__ */ r.createElement(
|
|
2543
|
+
je,
|
|
2537
2544
|
{
|
|
2538
2545
|
$clickable: !!c,
|
|
2539
2546
|
$highlightColor: f,
|
|
@@ -2543,17 +2550,17 @@ const wa = u.div`padding-inline:${oe}px;margin-bottom:${({ $marginBottom: e }) =
|
|
|
2543
2550
|
},
|
|
2544
2551
|
E.name
|
|
2545
2552
|
))), d);
|
|
2546
|
-
}, Aa = u(k)`font-weight:400;`,
|
|
2553
|
+
}, Aa = u(k)`font-weight:400;`, je = u(Aa)`${({ $clickable: e, $highlightColor: t }) => e && $`
|
|
2547
2554
|
cursor: pointer;
|
|
2548
2555
|
text-decoration: underline;
|
|
2549
2556
|
&:hover {
|
|
2550
2557
|
color: ${t};
|
|
2551
2558
|
}
|
|
2552
2559
|
`}
|
|
2553
|
-
`,
|
|
2560
|
+
`, Ke = u.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Xe = u.div`display:flex;gap:8px;align-items:center;`, Ia = u(Xe)`cursor:pointer;gap:4px;`, ut = u(Xe)`flex-direction:row;align-items:center;`, tn = u.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, qn = Te(null);
|
|
2554
2561
|
function $a({ testerType: e, children: t }) {
|
|
2555
2562
|
return /* @__PURE__ */ r.createElement(
|
|
2556
|
-
|
|
2563
|
+
qn.Provider,
|
|
2557
2564
|
{
|
|
2558
2565
|
value: { testerType: e, isActionbookTester: e === "actionbook" }
|
|
2559
2566
|
},
|
|
@@ -2561,14 +2568,14 @@ function $a({ testerType: e, children: t }) {
|
|
|
2561
2568
|
t
|
|
2562
2569
|
);
|
|
2563
2570
|
}
|
|
2564
|
-
const
|
|
2565
|
-
const e =
|
|
2571
|
+
const Fe = () => {
|
|
2572
|
+
const e = re(qn);
|
|
2566
2573
|
if (!e) throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");
|
|
2567
2574
|
return e;
|
|
2568
2575
|
}, Ma = () => {
|
|
2569
|
-
const { isActionbookTester: e } =
|
|
2576
|
+
const { isActionbookTester: e } = Fe();
|
|
2570
2577
|
return /* @__PURE__ */ r.createElement(_e.Template, { template: e ? Oa : void 0 }, /* @__PURE__ */ r.createElement(_e.MessageLogs, { component: La }));
|
|
2571
|
-
}, Oa = (e) => /* @__PURE__ */ r.createElement(
|
|
2578
|
+
}, Oa = (e) => /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !0, maxBodyWidth: Bn }), La = ({ extendedMessagePayload: e = {} }) => {
|
|
2572
2579
|
const { handlers: t } = P(), { manual: n, groundedness: o, function_calls: i, agent_message_templates: a, is_thinking: s } = e;
|
|
2573
2580
|
return s || !n && !(o != null && o.length) && !(i != null && i.length) && !(a != null && a.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(Ra, null, /* @__PURE__ */ r.createElement(Da, { width: 4 }), /* @__PURE__ */ r.createElement(
|
|
2574
2581
|
ka,
|
|
@@ -2586,7 +2593,7 @@ const Be = () => {
|
|
|
2586
2593
|
bottomContent: /* @__PURE__ */ r.createElement(Na, { variant: "caption2", color: h.themedColor.textLowEmphasis }, "Only visible in the tester")
|
|
2587
2594
|
}
|
|
2588
2595
|
));
|
|
2589
|
-
}, Ra = u.div`display:flex;gap:16px;margin:16px ${
|
|
2596
|
+
}, Ra = u.div`display:flex;gap:16px;margin:16px ${ie}px 0;align-self:stretch;`, Da = u.div`width:${({ width: e }) => e}px;background-color:${h.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Na = u(k)`margin-top:5px;`, Pa = ({ publishSynchronous: e = !1 }) => {
|
|
2590
2597
|
const t = /* @__PURE__ */ new Set();
|
|
2591
2598
|
return {
|
|
2592
2599
|
publish: (n) => {
|
|
@@ -2598,18 +2605,18 @@ const Be = () => {
|
|
|
2598
2605
|
};
|
|
2599
2606
|
};
|
|
2600
2607
|
function Ba(e, t = []) {
|
|
2601
|
-
const n = F(null), o = F(0), i = F(0), [a] =
|
|
2602
|
-
return
|
|
2608
|
+
const n = F(null), o = F(0), i = F(0), [a] = S(() => Pa({ publishSynchronous: !0 })), [s, l] = S(!0);
|
|
2609
|
+
return ce(() => {
|
|
2603
2610
|
o.current = 0, i.current = 0, l(!0), n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
2604
|
-
}, t),
|
|
2611
|
+
}, t), ce(() => a.subscribe(({ type: c, data: d }) => {
|
|
2605
2612
|
const { resolve: m, animated: g } = d ?? {};
|
|
2606
2613
|
if (!n.current) return m == null ? void 0 : m();
|
|
2607
2614
|
if (c === "scrollToBottom" && (n.current.scroll ? n.current.scroll({
|
|
2608
2615
|
top: n.current.scrollHeight,
|
|
2609
|
-
behavior:
|
|
2616
|
+
behavior: nn(e, g)
|
|
2610
2617
|
}) : n.current.scrollTop = n.current.scrollHeight, i.current = 0, l(!0), m == null || m()), c === "scroll") {
|
|
2611
2618
|
const p = d == null ? void 0 : d.top, { scrollTop: x, scrollHeight: f, clientHeight: E } = n.current;
|
|
2612
|
-
n.current.scroll ? n.current.scroll({ top: p, behavior:
|
|
2619
|
+
n.current.scroll ? n.current.scroll({ top: p, behavior: nn(e, g) }) : typeof p == "number" && (n.current.scrollTop = p), i.current = Math.max(0, f - x - E), l(i.current === 0), m == null || m();
|
|
2613
2620
|
}
|
|
2614
2621
|
}), [e]), {
|
|
2615
2622
|
scrollRef: n,
|
|
@@ -2620,7 +2627,7 @@ function Ba(e, t = []) {
|
|
|
2620
2627
|
scrollPositionRef: o
|
|
2621
2628
|
};
|
|
2622
2629
|
}
|
|
2623
|
-
function
|
|
2630
|
+
function nn(e, t) {
|
|
2624
2631
|
return typeof t == "boolean" ? t ? "smooth" : "auto" : e;
|
|
2625
2632
|
}
|
|
2626
2633
|
function Fa(e) {
|
|
@@ -2636,12 +2643,12 @@ async function Ua(e) {
|
|
|
2636
2643
|
if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
|
|
2637
2644
|
const { width: t, height: n } = await Fa(e.file);
|
|
2638
2645
|
return new Kr({
|
|
2639
|
-
key:
|
|
2646
|
+
key: Jn,
|
|
2640
2647
|
value: [t, n]
|
|
2641
2648
|
});
|
|
2642
2649
|
}
|
|
2643
2650
|
}
|
|
2644
|
-
const
|
|
2651
|
+
const Jn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
2645
2652
|
const { agentPreviewConfigs: t, handlers: n } = P(), o = F(t == null ? void 0 : t.agentAttributes);
|
|
2646
2653
|
return o.current = t == null ? void 0 : t.agentAttributes, {
|
|
2647
2654
|
onBeforeSendMessage: async (i) => {
|
|
@@ -2669,13 +2676,13 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2669
2676
|
onNavigateToConversationList: n,
|
|
2670
2677
|
children: o
|
|
2671
2678
|
}) => {
|
|
2672
|
-
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } =
|
|
2679
|
+
const { aiAgentInfo: i, activeChannel: a, refreshActiveChannel: s } = z(), { testerType: l } = Fe(), c = Ba("smooth"), { onBeforeSendMessage: d, onAfterSendMessage: m } = Ha({
|
|
2673
2680
|
onScrollAfterSendMessage: () => {
|
|
2674
2681
|
c.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !1 } });
|
|
2675
2682
|
}
|
|
2676
2683
|
}), g = (x) => {
|
|
2677
2684
|
const f = x[x.length - 1];
|
|
2678
|
-
f &&
|
|
2685
|
+
f && et.shouldScrollToBottom(f, i.userId, !!l) && setTimeout(() => c.scrollPubSub.publish({ type: "scrollToBottom" }), 25);
|
|
2679
2686
|
}, p = U(async () => {
|
|
2680
2687
|
await s(), e && (t == null || t());
|
|
2681
2688
|
}, [s, e, t]);
|
|
@@ -2698,13 +2705,13 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2698
2705
|
o
|
|
2699
2706
|
)
|
|
2700
2707
|
);
|
|
2701
|
-
},
|
|
2702
|
-
onDrop:
|
|
2703
|
-
subscribe: () =>
|
|
2708
|
+
}, Ot = Te({
|
|
2709
|
+
onDrop: Le,
|
|
2710
|
+
subscribe: () => Le
|
|
2704
2711
|
}), xt = ({ children: e }) => {
|
|
2705
2712
|
const t = F(/* @__PURE__ */ new Set());
|
|
2706
2713
|
return /* @__PURE__ */ r.createElement(
|
|
2707
|
-
|
|
2714
|
+
Ot.Provider,
|
|
2708
2715
|
{
|
|
2709
2716
|
value: {
|
|
2710
2717
|
onDrop: (n) => {
|
|
@@ -2720,21 +2727,21 @@ const Xn = "KEY_IMG_ASPECT_RATIO", Ha = ({ onScrollAfterSendMessage: e }) => {
|
|
|
2720
2727
|
e
|
|
2721
2728
|
);
|
|
2722
2729
|
}, Ga = ({ onDropFiles: e }) => {
|
|
2723
|
-
const { subscribe: t } =
|
|
2730
|
+
const { subscribe: t } = re(Ot);
|
|
2724
2731
|
D(() => t(e), [e]);
|
|
2725
2732
|
};
|
|
2726
2733
|
xt.Consumer = ({ children: e }) => {
|
|
2727
|
-
const { onDrop: t } =
|
|
2734
|
+
const { onDrop: t } = re(Ot);
|
|
2728
2735
|
return e({ onDrop: t, onDragOver: (i) => i.preventDefault() });
|
|
2729
2736
|
};
|
|
2730
2737
|
const Jd = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(Ka, { className: n }, /* @__PURE__ */ r.createElement(O, { type: t, size: e, color: h.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, o), i), ja = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Ka = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Za = {
|
|
2731
|
-
loading: w(() => import("./
|
|
2732
|
-
error: w(() => import("./
|
|
2733
|
-
noChannels: w(() => import("./
|
|
2734
|
-
noMessages: w(() => import("./
|
|
2738
|
+
loading: w(() => import("./CSENM0Ja.js")),
|
|
2739
|
+
error: w(() => import("./Cj-eLEq_.js")),
|
|
2740
|
+
noChannels: w(() => import("./DnQv_mT2.js")),
|
|
2741
|
+
noMessages: w(() => import("./O53SSRM8.js"))
|
|
2735
2742
|
}, Se = ({ className: e, type: t = "loading", ...n }) => {
|
|
2736
2743
|
const o = Za[t];
|
|
2737
|
-
return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(
|
|
2744
|
+
return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
|
|
2738
2745
|
};
|
|
2739
2746
|
function Ya(e) {
|
|
2740
2747
|
return "sendingStatus" in e ? e.sendingStatus === "succeeded" ? String(e.messageId) : e.reqId : String(e.messageId);
|
|
@@ -2744,19 +2751,19 @@ const qa = (e, t, n, o = !0) => {
|
|
|
2744
2751
|
return "single";
|
|
2745
2752
|
const i = () => {
|
|
2746
2753
|
if (!t || !t.isUserMessage() && !t.isFileMessage()) return !1;
|
|
2747
|
-
const c = t.sender.userId === e.sender.userId, d =
|
|
2754
|
+
const c = t.sender.userId === e.sender.userId, d = Ut(t.createdAt, e.createdAt);
|
|
2748
2755
|
return c && d;
|
|
2749
2756
|
}, a = () => {
|
|
2750
2757
|
if (!n || !n.isUserMessage() && !n.isFileMessage()) return !1;
|
|
2751
|
-
const c = n.sender.userId === e.sender.userId, d =
|
|
2758
|
+
const c = n.sender.userId === e.sender.userId, d = Ut(n.createdAt, e.createdAt);
|
|
2752
2759
|
return c && d;
|
|
2753
2760
|
}, s = i(), l = a();
|
|
2754
2761
|
return s && l ? "middle" : s ? "bottom" : l ? "top" : "single";
|
|
2755
2762
|
};
|
|
2756
2763
|
function Ja(e, t) {
|
|
2757
|
-
return e.filter((n) =>
|
|
2764
|
+
return e.filter((n) => et.isWelcomeMessage(n, t));
|
|
2758
2765
|
}
|
|
2759
|
-
function
|
|
2766
|
+
function Xn(e, t) {
|
|
2760
2767
|
return Xa(e) === t;
|
|
2761
2768
|
}
|
|
2762
2769
|
function Xa(e) {
|
|
@@ -2767,81 +2774,60 @@ function Xa(e) {
|
|
|
2767
2774
|
function Qa(e) {
|
|
2768
2775
|
return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
|
|
2769
2776
|
}
|
|
2770
|
-
const
|
|
2777
|
+
const rn = (e) => !!e && "sender" in e, Qn = (e) => e.startsWith("image/"), er = (e) => e.startsWith("video/"), on = (e) => Qn(e) || er(e), Ze = {
|
|
2771
2778
|
isAdmin: (e) => e.isAdminMessage(),
|
|
2772
2779
|
isCSAT: (e) => {
|
|
2773
2780
|
var t;
|
|
2774
2781
|
return e.isAdminMessage() && !!((t = e.extendedMessagePayload) != null && t.csat);
|
|
2775
2782
|
},
|
|
2776
|
-
isIncoming: (e, t) =>
|
|
2777
|
-
isOutgoing: (e, t) =>
|
|
2778
|
-
},
|
|
2783
|
+
isIncoming: (e, t) => rn(e) && e.sender.userId !== t,
|
|
2784
|
+
isOutgoing: (e, t) => rn(e) && (e.sender.userId === t || e.sendingStatus === Zr.PENDING)
|
|
2785
|
+
}, tr = ({ rootElementId: e, visible: t, onClose: n, children: o }) => {
|
|
2779
2786
|
if (!t) return null;
|
|
2780
|
-
const { rootElement: i } = P(), a =
|
|
2787
|
+
const { rootElement: i } = P(), a = fe(i), s = fe(i, !0);
|
|
2781
2788
|
return qr(
|
|
2782
2789
|
/* @__PURE__ */ r.createElement(el, { onClick: n }, /* @__PURE__ */ r.createElement(tl, { onClick: (l) => l.stopPropagation() }, o)),
|
|
2783
|
-
a.getElementById(e) ?? a.getElementById(
|
|
2790
|
+
a.getElementById(e) ?? a.getElementById(oe.MODAL_ROOT) ?? s.body
|
|
2784
2791
|
);
|
|
2785
|
-
}, el = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${h.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${
|
|
2786
|
-
function
|
|
2792
|
+
}, el = u.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${h.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${be.MODAL};`, tl = u.div`border-radius:4px;overflow:hidden;box-shadow:0 16px 24px 2px rgba(13,13,13,0.12),0 6px 30px 5px rgba(13,13,13,0.08),0 6px 10px -5px rgba(13,13,13,0.04);z-index:${be.MODAL};`, nl = u.div`flex-shrink:0;width:${({ $size: e }) => Y(e)};height:${({ $size: e }) => Y(e)};background-color:${({ theme: e }) => e.colors.base.primary};box-sizing:border-box;padding:6px;border-radius:50%;display:flex;justify-content:center;align-items:center;}`, rl = u(kt)`path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent};}`;
|
|
2793
|
+
function nr({ size: e }) {
|
|
2787
2794
|
const { aiAgentInfo: t } = z();
|
|
2788
|
-
return t.profileUrl ? /* @__PURE__ */ r.createElement(
|
|
2795
|
+
return t.profileUrl ? /* @__PURE__ */ r.createElement(At, { size: e, src: t.profileUrl }) : /* @__PURE__ */ r.createElement(nl, { $size: e }, /* @__PURE__ */ r.createElement(rl, null));
|
|
2789
2796
|
}
|
|
2790
|
-
const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, il = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, sl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, al = u.div`margin-inline-end:8px;`, ll = u.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, cl = u.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, dl = u.div`display:flex;width:160px;justify-content:flex-end;`, ul = u.div`inset-inline-end:0;display:flex;flex-direction:row;`,
|
|
2791
|
-
const {
|
|
2797
|
+
const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, il = u.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${h.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, sl = u.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, al = u.div`margin-inline-end:8px;`, ll = u.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, cl = u.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, dl = u.div`display:flex;width:160px;justify-content:flex-end;`, ul = u.div`inset-inline-end:0;display:flex;flex-direction:row;`, rr = u.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, ml = u(rr)`border-inline-start:1px solid ${h.themedColor.textDisabled};`, hl = u.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, gl = u.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, pl = u.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, fl = u.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, bl = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
|
|
2798
|
+
const { type: i, url: a, name: s = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } = z();
|
|
2792
2799
|
return /* @__PURE__ */ r.createElement(
|
|
2793
2800
|
El,
|
|
2794
2801
|
{
|
|
2795
|
-
profileUrl:
|
|
2796
|
-
nickname:
|
|
2802
|
+
profileUrl: l ?? "",
|
|
2803
|
+
nickname: c ?? "",
|
|
2797
2804
|
type: i,
|
|
2798
2805
|
url: a,
|
|
2799
2806
|
name: s,
|
|
2800
|
-
onClose:
|
|
2801
|
-
isBotMessage:
|
|
2802
|
-
|
|
2803
|
-
disableDelete: l != null && l.replyCount ? l.replyCount > 0 : !1,
|
|
2804
|
-
onDownloadClick: n
|
|
2807
|
+
onClose: n,
|
|
2808
|
+
isBotMessage: d === m.userId,
|
|
2809
|
+
onDownloadClick: o
|
|
2805
2810
|
}
|
|
2806
2811
|
);
|
|
2807
|
-
}, xl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(
|
|
2812
|
+
}, xl = ({ profileUrl: e, isBotMessage: t }) => !e && t ? /* @__PURE__ */ r.createElement(nr, { size: 32 }) : /* @__PURE__ */ r.createElement(At, { size: 32, src: e }), El = ({
|
|
2808
2813
|
profileUrl: e,
|
|
2809
2814
|
isBotMessage: t,
|
|
2810
2815
|
nickname: n,
|
|
2811
2816
|
name: o,
|
|
2812
2817
|
type: i,
|
|
2813
2818
|
url: a,
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
onDelete: c,
|
|
2817
|
-
disableDelete: d,
|
|
2818
|
-
onDownloadClick: m
|
|
2819
|
+
onClose: s,
|
|
2820
|
+
onDownloadClick: l
|
|
2819
2821
|
}) => {
|
|
2820
|
-
const { stringSet:
|
|
2821
|
-
return /* @__PURE__ */ r.createElement(
|
|
2822
|
-
Et,
|
|
2823
|
-
{
|
|
2824
|
-
disabled: d,
|
|
2825
|
-
onClick: () => {
|
|
2826
|
-
d || c();
|
|
2827
|
-
}
|
|
2828
|
-
},
|
|
2829
|
-
/* @__PURE__ */ r.createElement(
|
|
2830
|
-
O,
|
|
2831
|
-
{
|
|
2832
|
-
type: "delete",
|
|
2833
|
-
color: d ? "gray" : h.themedColor.textHighEmphasis,
|
|
2834
|
-
size: 24
|
|
2835
|
-
}
|
|
2836
|
-
)
|
|
2837
|
-
)), /* @__PURE__ */ r.createElement(ml, { onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(hl, { onClick: (p) => p.currentTarget === p.target && l() }, tr(i) && /* @__PURE__ */ r.createElement(gl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), er(i) && /* @__PURE__ */ r.createElement(pl, { src: a, alt: o }), !sn(i) && /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, g.FILE_VIEWER__UNSUPPORT)))));
|
|
2822
|
+
const { stringSet: c } = R();
|
|
2823
|
+
return /* @__PURE__ */ r.createElement(tr, { onClose: s, visible: !0, rootElementId: oe.MODAL_ROOT }, /* @__PURE__ */ r.createElement(ol, null, /* @__PURE__ */ r.createElement(il, null, /* @__PURE__ */ r.createElement(sl, null, /* @__PURE__ */ r.createElement(al, null, /* @__PURE__ */ r.createElement(xl, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(ll, null, /* @__PURE__ */ r.createElement(k, { variant: "h2", color: h.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(cl, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(dl, null, on(i) && /* @__PURE__ */ r.createElement(ul, null, /* @__PURE__ */ r.createElement(rr, { as: "a", href: a, target: "_blank", rel: _t, onClick: l }, /* @__PURE__ */ r.createElement(O, { type: "download", color: h.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(ml, { onClick: s }, /* @__PURE__ */ r.createElement(O, { type: "close", color: h.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(hl, { onClick: (d) => d.currentTarget === d.target && s() }, er(i) && /* @__PURE__ */ r.createElement(gl, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: a, type: i })), Qn(i) && /* @__PURE__ */ r.createElement(pl, { src: a, alt: o }), !on(i) && /* @__PURE__ */ r.createElement(fl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
|
|
2838
2824
|
}, or = ({
|
|
2839
2825
|
className: e,
|
|
2840
2826
|
locale: t,
|
|
2841
2827
|
date: n = Date.now(),
|
|
2842
2828
|
formatString: o = "MMMM dd, yyyy",
|
|
2843
2829
|
style: i
|
|
2844
|
-
}) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis },
|
|
2830
|
+
}) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Cl = u.div`display:flex;justify-content:center;align-items:center;`, yl = Re(function(t, n) {
|
|
2845
2831
|
const {
|
|
2846
2832
|
messages: o,
|
|
2847
2833
|
renderMessage: i,
|
|
@@ -2851,28 +2837,28 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
2851
2837
|
onLoadPrev: c,
|
|
2852
2838
|
onLoadNext: d,
|
|
2853
2839
|
loadThreshold: m = 0.05,
|
|
2854
|
-
onScrollPosition: g =
|
|
2840
|
+
onScrollPosition: g = Le,
|
|
2855
2841
|
depsForResetScrollPositionToBottom: p,
|
|
2856
2842
|
scrollPositionRef: x,
|
|
2857
2843
|
scrollDistanceFromBottomRef: f,
|
|
2858
2844
|
stackDirection: E = "top"
|
|
2859
|
-
} = t, b = n && "current" in n ? n : { current: null }, C = F(!1), v = F(void 0), T = F(0),
|
|
2860
|
-
|
|
2845
|
+
} = t, b = n && "current" in n ? n : { current: null }, C = F(!1), v = F(void 0), T = F(0), _ = F(0), K = F(0), L = x ?? _, se = f ?? K;
|
|
2846
|
+
ce(() => {
|
|
2861
2847
|
b.current && (b.current.scrollTop = b.current.scrollHeight);
|
|
2862
|
-
}, p),
|
|
2848
|
+
}, p), ce(() => {
|
|
2863
2849
|
b.current && (v.current === "top" && (b.current.scrollTop = b.current.scrollHeight - L.current), v.current === "bottom" && (b.current.scrollTop = T.current), v.current = void 0);
|
|
2864
2850
|
}, [b.current, o.length]);
|
|
2865
2851
|
const xe = async () => {
|
|
2866
2852
|
if (!b.current) return;
|
|
2867
2853
|
const y = b.current;
|
|
2868
|
-
if (g(vl(y)), L.current = y.scrollHeight - y.scrollTop,
|
|
2854
|
+
if (g(vl(y)), L.current = y.scrollHeight - y.scrollTop, se.current = L.current - y.clientHeight, T.current = y.scrollTop, C.current) return;
|
|
2869
2855
|
const B = y.clientHeight * Math.min(Math.max(0, m), 1);
|
|
2870
2856
|
y.scrollTop <= B ? (C.current = !0, v.current = "top", await c(), C.current = !1) : y.scrollHeight - y.scrollTop - y.clientHeight <= B ? (C.current = !0, v.current = "bottom", await d(), C.current = !1) : v.current = void 0;
|
|
2871
2857
|
};
|
|
2872
2858
|
return /* @__PURE__ */ r.createElement(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((y, B) => i({ message: y, index: B })), s), /* @__PURE__ */ r.createElement(Tl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(wl, { id: "infinite-list-overlay" }, l)));
|
|
2873
|
-
}),
|
|
2859
|
+
}), sn = 50;
|
|
2874
2860
|
function vl(e) {
|
|
2875
|
-
return e.scrollTop <=
|
|
2861
|
+
return e.scrollTop <= sn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= sn ? "bottom" : "middle";
|
|
2876
2862
|
}
|
|
2877
2863
|
const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${h.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Tl = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, wl = u.div`pointer-events:auto;`, kl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Al, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(O, { size: 24, type: "chevron-down", color: h.color.primary.main })), Al = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${N.light`
|
|
2878
2864
|
background-color: ${h.color.background50};
|
|
@@ -2897,8 +2883,8 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2897
2883
|
outline: none;
|
|
2898
2884
|
}
|
|
2899
2885
|
`, ir = () => {
|
|
2900
|
-
const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] =
|
|
2901
|
-
return
|
|
2886
|
+
const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] = S([]);
|
|
2887
|
+
return yn(e, {
|
|
2902
2888
|
onTypingStatusUpdated(i) {
|
|
2903
2889
|
var a;
|
|
2904
2890
|
if (i.url === ((a = t.channel) == null ? void 0 : a.url)) {
|
|
@@ -2913,7 +2899,7 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
|
|
|
2913
2899
|
/**
|
|
2914
2900
|
* Returns a list of messages filtered according to business requirements.
|
|
2915
2901
|
*/
|
|
2916
|
-
filteredMessages: c.filter((p) => Qa(p) ? !1 : l.length > 0 ? !
|
|
2902
|
+
filteredMessages: c.filter((p) => Qa(p) ? !1 : l.length > 0 ? !et.isWelcomeMessage(p, t) : !0),
|
|
2917
2903
|
/**
|
|
2918
2904
|
* Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
|
|
2919
2905
|
*/
|
|
@@ -2957,7 +2943,7 @@ function Ml(e) {
|
|
|
2957
2943
|
return Array.isArray(n) && n.includes(t);
|
|
2958
2944
|
}
|
|
2959
2945
|
const Ol = ({ style: e }) => {
|
|
2960
|
-
const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } =
|
|
2946
|
+
const { stringSet: t } = R(), { chatSDK: n } = P(), { isActionbookTester: o } = Fe();
|
|
2961
2947
|
return Ml(n) || o ? null : /* @__PURE__ */ r.createElement(Ll, { variant: "caption2", style: e }, t.POWERED_BY + " ", /* @__PURE__ */ r.createElement(
|
|
2962
2948
|
Rl,
|
|
2963
2949
|
{
|
|
@@ -2965,7 +2951,7 @@ const Ol = ({ style: e }) => {
|
|
|
2965
2951
|
as: "a",
|
|
2966
2952
|
href: "https://sendbird.com?utm_medium=product&utm_source=aiagent&utm_campaign=fy26-glbl-ai-agent-poweredby",
|
|
2967
2953
|
"aria-label": "Learn more about Sendbird",
|
|
2968
|
-
rel:
|
|
2954
|
+
rel: _t,
|
|
2969
2955
|
target: "_blank"
|
|
2970
2956
|
},
|
|
2971
2957
|
"Sendbird"
|
|
@@ -2976,8 +2962,8 @@ const Ol = ({ style: e }) => {
|
|
|
2976
2962
|
text-decoration: none;
|
|
2977
2963
|
`, Dl = () => {
|
|
2978
2964
|
var c;
|
|
2979
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a =
|
|
2980
|
-
return
|
|
2965
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), { channelSource: n, goToActiveConversation: o, scrollSource: i } = q(), a = Vn(n.channel), l = t && ((c = n.channel) == null ? void 0 : c.url) === (t == null ? void 0 : t.url) && a;
|
|
2966
|
+
return ce(() => {
|
|
2981
2967
|
l && i.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
2982
2968
|
}, [l]), l ? /* @__PURE__ */ r.createElement(Nl, null, /* @__PURE__ */ r.createElement(
|
|
2983
2969
|
Pl,
|
|
@@ -2990,8 +2976,8 @@ const Ol = ({ style: e }) => {
|
|
|
2990
2976
|
e.START_NEW_CONVERSATION
|
|
2991
2977
|
)) : null;
|
|
2992
2978
|
}, Nl = u.div`display:flex;justify-content:center;margin:16px 0;`, Pl = u(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;user-select:none;`, Bl = !0, Fl = () => {
|
|
2993
|
-
const { Template: e } =
|
|
2994
|
-
const y =
|
|
2979
|
+
const { Template: e } = $t.useContext(), { Template: t } = _e.useContext(), { Template: n } = Mt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = P(), { stringSet: m, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: f, scrollSource: E } = q(), { isActionbookTester: b } = Fe(), { filteredMessages: C, shouldShowOriginalDate: v, renderAgentPreviewWelcomeMessages: T } = Il(), { storage: _ } = $n(), K = ir(), L = It(() => {
|
|
2980
|
+
const y = K[0];
|
|
2995
2981
|
if (!y) return null;
|
|
2996
2982
|
const B = y.userId === s.userId;
|
|
2997
2983
|
return { user: B ? s : y, isBot: B };
|
|
@@ -2999,7 +2985,7 @@ const Ol = ({ style: e }) => {
|
|
|
2999
2985
|
D(() => {
|
|
3000
2986
|
L && E.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
|
|
3001
2987
|
}, [!!L, E.scrollPubSub.publish]);
|
|
3002
|
-
const
|
|
2988
|
+
const se = (y, B = !1) => {
|
|
3003
2989
|
var Ee;
|
|
3004
2990
|
return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId === y.sender.userId)) ?? y.sender;
|
|
3005
2991
|
}, xe = () => {
|
|
@@ -3035,10 +3021,10 @@ const Ol = ({ style: e }) => {
|
|
|
3035
3021
|
), /* @__PURE__ */ r.createElement(Dl, null)),
|
|
3036
3022
|
overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(Hl, { onClick: () => E.scrollPubSub.publish({ type: "scrollToBottom" }) })),
|
|
3037
3023
|
renderMessage: ({ message: y, index: B }) => {
|
|
3038
|
-
const Ee = Ya(y), J = C[B - 1], Ae = C[B + 1],
|
|
3039
|
-
y.isFileMessage() && i(y);
|
|
3024
|
+
const Ee = Ya(y), J = C[B - 1], Ae = C[B + 1], it = C[C.length - 1], st = y === it, A = qa(y, J, Ae, Bl), I = !Yr((J == null ? void 0 : J.createdAt) ?? 0, y.createdAt) && v(B) && !b, M = (X) => {
|
|
3025
|
+
(y.isFileMessage() || y.isUserMessage()) && i({ file: X, sender: se(y, y.sender.userId === s.userId) });
|
|
3040
3026
|
}, H = () => {
|
|
3041
|
-
y.isFileMessage() &&
|
|
3027
|
+
y.isFileMessage() && zn(y.url);
|
|
3042
3028
|
}, Ce = I ? /* @__PURE__ */ r.createElement(
|
|
3043
3029
|
or,
|
|
3044
3030
|
{
|
|
@@ -3047,89 +3033,89 @@ const Ol = ({ style: e }) => {
|
|
|
3047
3033
|
locale: g,
|
|
3048
3034
|
formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
|
|
3049
3035
|
}
|
|
3050
|
-
) : null,
|
|
3051
|
-
maxBodyWidth: d.expanded ?
|
|
3036
|
+
) : null, ae = {
|
|
3037
|
+
maxBodyWidth: d.expanded ? Bn : void 0,
|
|
3052
3038
|
extendedMessagePayload: y.extendedMessagePayload,
|
|
3053
3039
|
createdAt: y.createdAt,
|
|
3054
3040
|
groupType: A,
|
|
3055
3041
|
onClickMedia: M,
|
|
3056
3042
|
onClickFile: H
|
|
3057
|
-
},
|
|
3058
|
-
var
|
|
3059
|
-
if (
|
|
3060
|
-
return
|
|
3043
|
+
}, Z = (() => {
|
|
3044
|
+
var X, ee;
|
|
3045
|
+
if (Ze.isAdmin(y))
|
|
3046
|
+
return Ze.isCSAT(y) ? p ? /* @__PURE__ */ r.createElement(
|
|
3061
3047
|
n,
|
|
3062
3048
|
{
|
|
3063
|
-
...
|
|
3049
|
+
...ae,
|
|
3064
3050
|
...p,
|
|
3065
3051
|
isResolvedWhenDeterminedByUser: zl(p),
|
|
3066
3052
|
messageType: "admin.csat",
|
|
3067
|
-
onSubmitCSAT: ({ csat: G, csatType:
|
|
3068
|
-
var
|
|
3069
|
-
G && ((
|
|
3053
|
+
onSubmitCSAT: ({ csat: G, csatType: he, csatReason: V, isResolved: le }) => {
|
|
3054
|
+
var ge;
|
|
3055
|
+
G && ((ge = x.channel) == null || ge.submitCSAT({ csat: G, csatType: he, csatReason: V, isResolved: le }));
|
|
3070
3056
|
}
|
|
3071
3057
|
}
|
|
3072
|
-
) : null : /* @__PURE__ */ r.createElement(n, { ...
|
|
3073
|
-
if (
|
|
3058
|
+
) : null : /* @__PURE__ */ r.createElement(n, { ...ae, messageType: "admin", message: y.message });
|
|
3059
|
+
if (Ze.isOutgoing(y, a.userId)) {
|
|
3074
3060
|
const G = {
|
|
3075
|
-
...
|
|
3061
|
+
...ae,
|
|
3076
3062
|
message: y.message,
|
|
3077
|
-
sender:
|
|
3063
|
+
sender: se(y),
|
|
3078
3064
|
sendingStatus: y.sendingStatus
|
|
3079
3065
|
};
|
|
3080
3066
|
if (y.isUserMessage())
|
|
3081
3067
|
return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...G });
|
|
3082
3068
|
if (y.isFileMessage()) {
|
|
3083
|
-
const [
|
|
3069
|
+
const [he, V] = ((X = y.metaArrays.find((le) => le.key === Jn)) == null ? void 0 : X.value) ?? [];
|
|
3084
3070
|
return /* @__PURE__ */ r.createElement(
|
|
3085
3071
|
e,
|
|
3086
3072
|
{
|
|
3087
3073
|
messageType: "file",
|
|
3088
3074
|
file: y,
|
|
3089
3075
|
metadata: {
|
|
3090
|
-
aspectRatio:
|
|
3091
|
-
localFile: (
|
|
3076
|
+
aspectRatio: he && V ? `${he}/${V}` : "1/1",
|
|
3077
|
+
localFile: (ee = y.messageParams) == null ? void 0 : ee.file
|
|
3092
3078
|
},
|
|
3093
3079
|
...G
|
|
3094
3080
|
}
|
|
3095
3081
|
);
|
|
3096
3082
|
}
|
|
3097
3083
|
}
|
|
3098
|
-
if (
|
|
3099
|
-
const G = y.sender.userId === s.userId,
|
|
3100
|
-
...
|
|
3101
|
-
sender:
|
|
3084
|
+
if (Ze.isIncoming(y, a.userId)) {
|
|
3085
|
+
const G = y.sender.userId === s.userId, he = {
|
|
3086
|
+
...ae,
|
|
3087
|
+
sender: se(y, G),
|
|
3102
3088
|
message: y.message,
|
|
3103
|
-
suggestedRepliesVisible:
|
|
3089
|
+
suggestedRepliesVisible: st,
|
|
3104
3090
|
suggestedRepliesDirection: l == null ? void 0 : l.suggestedRepliesDirection,
|
|
3105
3091
|
isBotMessage: G,
|
|
3106
3092
|
onClickSuggestedReply: async ({ reply: V }) => {
|
|
3107
3093
|
f.sendUserMessage({ message: V });
|
|
3108
3094
|
},
|
|
3109
3095
|
onRequestMessageTemplate: async (V) => {
|
|
3110
|
-
const { template:
|
|
3111
|
-
return
|
|
3096
|
+
const { template: le } = await c.aiAgent.getMessageTemplate(V);
|
|
3097
|
+
return _.setTemplate(V, le), le;
|
|
3112
3098
|
},
|
|
3113
|
-
onGetCachedMessageTemplate: (V) =>
|
|
3099
|
+
onGetCachedMessageTemplate: (V) => _.getTemplate(V),
|
|
3114
3100
|
onHandleTemplateInternalAction: (V) => {
|
|
3115
3101
|
if (V.type === "internal" && V.internalData) {
|
|
3116
|
-
const { method:
|
|
3117
|
-
|
|
3102
|
+
const { method: le, payload: ge } = V.internalData;
|
|
3103
|
+
le === "message.send" && (ge != null && ge.message) && f.sendUserMessage({ message: ge.message });
|
|
3118
3104
|
}
|
|
3119
3105
|
}
|
|
3120
3106
|
};
|
|
3121
3107
|
if (y.isUserMessage())
|
|
3122
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...
|
|
3108
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...he });
|
|
3123
3109
|
if (y.isFileMessage())
|
|
3124
|
-
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...
|
|
3110
|
+
return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...he });
|
|
3125
3111
|
}
|
|
3126
3112
|
})();
|
|
3127
|
-
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${
|
|
3113
|
+
return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${Q}-message-item` }, Ce, Z);
|
|
3128
3114
|
}
|
|
3129
3115
|
}
|
|
3130
3116
|
);
|
|
3131
3117
|
};
|
|
3132
|
-
return /* @__PURE__ */ r.createElement(Ul, { id: `${
|
|
3118
|
+
return /* @__PURE__ */ r.createElement(Ul, { id: `${Q}-message-list` }, xe(), o && /* @__PURE__ */ r.createElement(bl, { onClose: () => i(null), sender: o.sender, file: o.file }));
|
|
3133
3119
|
}, Ul = u.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Hl = u(kl)`position:absolute;bottom:20px;inset-inline-end:20px;`;
|
|
3134
3120
|
function zl(e) {
|
|
3135
3121
|
var t;
|
|
@@ -3144,7 +3130,7 @@ const Vl = () => {
|
|
|
3144
3130
|
}
|
|
3145
3131
|
return n.channel ? /* @__PURE__ */ r.createElement(Fl, null) : /* @__PURE__ */ r.createElement(Se, { type: "loading" });
|
|
3146
3132
|
}, sr = () => {
|
|
3147
|
-
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] =
|
|
3133
|
+
const { stringSet: e } = R(), { activeChannel: t } = z(), [n] = S(() => (t == null ? void 0 : t.status) === W.OPEN);
|
|
3148
3134
|
return n ? e.RETURN_TO_CONVERSATION : e.START_NEW_CONVERSATION;
|
|
3149
3135
|
}, Wl = () => {
|
|
3150
3136
|
const { stringSet: e } = R(), { goToActiveConversation: t } = q(), n = sr();
|
|
@@ -3162,13 +3148,13 @@ const Vl = () => {
|
|
|
3162
3148
|
background-color: ${h.color.background700};
|
|
3163
3149
|
`}
|
|
3164
3150
|
`, ar = Te(void 0), Kl = ({ children: e }) => {
|
|
3165
|
-
const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] =
|
|
3151
|
+
const { stringSet: t } = R(), { aiAgentInfo: n } = z(), { channelSource: o } = q(), [i, a] = S([]), [s, l] = S({
|
|
3166
3152
|
visible: !1,
|
|
3167
3153
|
title: "",
|
|
3168
3154
|
buttonText: t.BUTTON__OK
|
|
3169
|
-
}), c = (n == null ? void 0 : n.replyToFile) ||
|
|
3155
|
+
}), c = (n == null ? void 0 : n.replyToFile) || Gn(o.channel), d = (p) => {
|
|
3170
3156
|
if (!c) return;
|
|
3171
|
-
const x = p.filter((f) =>
|
|
3157
|
+
const x = p.filter((f) => Dn.includes(f.type));
|
|
3172
3158
|
if (x.length !== 0) {
|
|
3173
3159
|
if (x.some((f) => f.size > mi)) {
|
|
3174
3160
|
l((f) => ({
|
|
@@ -3217,8 +3203,8 @@ const Vl = () => {
|
|
|
3217
3203
|
e,
|
|
3218
3204
|
/* @__PURE__ */ r.createElement(Zl, { ...s, onClose: () => l((p) => ({ ...p, visible: !1, title: "" })) })
|
|
3219
3205
|
);
|
|
3220
|
-
},
|
|
3221
|
-
const e =
|
|
3206
|
+
}, Lt = () => {
|
|
3207
|
+
const e = re(ar);
|
|
3222
3208
|
if (!e)
|
|
3223
3209
|
throw new Error("useFileUpload must be used within FileUploadProvider");
|
|
3224
3210
|
return e;
|
|
@@ -3227,10 +3213,10 @@ const Vl = () => {
|
|
|
3227
3213
|
buttonText: t,
|
|
3228
3214
|
visible: n,
|
|
3229
3215
|
onClose: o
|
|
3230
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
3216
|
+
}) => /* @__PURE__ */ r.createElement(tr, { rootElementId: oe.WINDOW, visible: n, onClose: o }, /* @__PURE__ */ r.createElement(Yl, null, /* @__PURE__ */ r.createElement(Jl, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: h.themedColor.textHighEmphasis }, e)), /* @__PURE__ */ r.createElement(ql, null, /* @__PURE__ */ r.createElement(Xl, { onClick: o }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: h.themedColor.textHighEmphasisInverse }, t))))), Yl = u.div`width:100%;height:auto;padding-block:18px 24px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, ql = u.div`display:flex;flex-direction:row;justify-content:flex-end;`, Jl = u.div`margin-bottom:16px;`, Xl = u.button`display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:${h.themedColor.error};border:1px solid ${h.themedColor.error};padding:10px 16px;&:hover{background-color:${h.color.error.dark};border-color:${h.color.error.dark};}&:active{background-color:${h.color.error.extraDark};}`;
|
|
3231
3217
|
function Ql({ blurred: e, elementRef: t, document: n = window.document }) {
|
|
3232
3218
|
const o = F(!1);
|
|
3233
|
-
e && t.current && n.activeElement === t.current && (o.current = !0),
|
|
3219
|
+
e && t.current && n.activeElement === t.current && (o.current = !0), ce(() => {
|
|
3234
3220
|
var i;
|
|
3235
3221
|
!e && o.current && ((i = t.current) == null || i.focus(), o.current = !1);
|
|
3236
3222
|
}, [e]);
|
|
@@ -3255,18 +3241,18 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3255
3241
|
stroke: ${h.themedColor.bg_50_600};
|
|
3256
3242
|
}
|
|
3257
3243
|
`, rc = () => {
|
|
3258
|
-
const e =
|
|
3259
|
-
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(ec, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(tc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(nc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: h.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(
|
|
3244
|
+
const e = Pe(), [t, n] = S(), { files: o, removeFile: i, isFileUploadEnabled: a } = Lt();
|
|
3245
|
+
return !a || o.length === 0 ? null : /* @__PURE__ */ r.createElement(ec, null, o.map(({ preview: { type: s, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(tc, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(nc, { title: "Remove file", onClick: () => i(d) }, /* @__PURE__ */ r.createElement(O, { type: "close-filled", color: h.themedColor.textMidEmphasis })), s.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(wt, { name: l, type: Tt(l, s) }))));
|
|
3260
3246
|
}, oc = ({ channel: e, messages: t }) => {
|
|
3261
3247
|
const { stringSet: n } = R(), { aiAgentInfo: o } = z(), i = ic(), a = sc({
|
|
3262
3248
|
lastMessage: t[t.length - 1],
|
|
3263
3249
|
aiAgentUserId: o.userId
|
|
3264
3250
|
});
|
|
3265
|
-
return !e || !i ||
|
|
3251
|
+
return !e || !i || Vn(e) ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__DISABLED] : a ? [!0, n.MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE] : [!1, n.MESSAGE_INPUT__PLACE_HOLDER];
|
|
3266
3252
|
}, ic = () => {
|
|
3267
|
-
const e =
|
|
3253
|
+
const e = bn(), { chatSDK: t } = P(), [n, o] = S(!0);
|
|
3268
3254
|
return D(() => {
|
|
3269
|
-
const i = new
|
|
3255
|
+
const i = new Qe({
|
|
3270
3256
|
onDisconnected: () => o(!1),
|
|
3271
3257
|
onConnected: () => o(!0),
|
|
3272
3258
|
onReconnectSucceeded: () => o(!0)
|
|
@@ -3279,17 +3265,17 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3279
3265
|
lastMessage: e,
|
|
3280
3266
|
aiAgentUserId: t
|
|
3281
3267
|
}) => {
|
|
3282
|
-
const [n, o] =
|
|
3268
|
+
const [n, o] = S(!1), i = ir();
|
|
3283
3269
|
return D(() => {
|
|
3284
3270
|
if (!e) return;
|
|
3285
|
-
const a = i.some((l) => l.userId === t), s =
|
|
3271
|
+
const a = i.some((l) => l.userId === t), s = Xn(e, t) && et.isStreaming(e);
|
|
3286
3272
|
o(!!(s || a));
|
|
3287
3273
|
}, [i, e, t]), n;
|
|
3288
3274
|
}, lr = {
|
|
3289
3275
|
textArea: $`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
|
|
3290
3276
|
attachIcon: $`margin-bottom:4px;`
|
|
3291
|
-
}, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${
|
|
3292
|
-
const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } =
|
|
3277
|
+
}, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${vt && lr.attachIcon};`, lc = u.input`display:none;`, an = u.div`width:100%;position:relative;background-color:${h.themedColor.bg_100_500};border-radius:20px;`, ln = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, cn = u.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${h.themedColor.textHighEmphasis};resize:none;width:100%;height:${Rn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${vt && lr.textArea};&::placeholder{color:${h.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${h.themedColor.textDisabled};}}`, dn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, un = ({ disabled: e }) => {
|
|
3278
|
+
const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = Lt();
|
|
3293
3279
|
return !a || i.length > 0 ? null : /* @__PURE__ */ r.createElement(
|
|
3294
3280
|
ac,
|
|
3295
3281
|
{
|
|
@@ -3316,43 +3302,43 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3316
3302
|
const l = s.currentTarget.files;
|
|
3317
3303
|
l && n(Array.from(l)), s.target.value = "";
|
|
3318
3304
|
},
|
|
3319
|
-
accept:
|
|
3305
|
+
accept: Dn.join(",")
|
|
3320
3306
|
}
|
|
3321
3307
|
)
|
|
3322
3308
|
);
|
|
3323
3309
|
}, cc = () => {
|
|
3324
|
-
const e = F(null), [t, n] =
|
|
3310
|
+
const e = F(null), [t, n] = S(""), { rootElement: o } = P(), { channelSource: i, messageSource: a } = q(), [s, l] = oc({
|
|
3325
3311
|
channel: i.channel,
|
|
3326
3312
|
messages: a.messages
|
|
3327
|
-
}), { files: c, addFiles: d, clearFiles: m } =
|
|
3328
|
-
Ga({ onDropFiles: d }), Ql({ blurred: s, elementRef: e, document:
|
|
3313
|
+
}), { files: c, addFiles: d, clearFiles: m } = Lt();
|
|
3314
|
+
Ga({ onDropFiles: d }), Ql({ blurred: s, elementRef: e, document: fe(o) });
|
|
3329
3315
|
const g = t.trim().length > 0, p = c.length > 0, x = !s && (g || p), f = () => {
|
|
3330
3316
|
e.current && (e.current.value = "", e.current.style.height = ""), m(), n("");
|
|
3331
3317
|
}, E = async () => {
|
|
3332
|
-
const T = t.trim(),
|
|
3318
|
+
const T = t.trim(), _ = { message: T };
|
|
3333
3319
|
if (!(!T && !c.length)) {
|
|
3334
3320
|
if (c.length > 0) {
|
|
3335
|
-
const
|
|
3321
|
+
const K = c[0].file, L = { ..._, file: K };
|
|
3336
3322
|
a.sendFileMessage(L), f();
|
|
3337
3323
|
return;
|
|
3338
3324
|
}
|
|
3339
|
-
a.sendUserMessage(
|
|
3325
|
+
a.sendUserMessage(_), f();
|
|
3340
3326
|
}
|
|
3341
3327
|
}, b = (T) => {
|
|
3342
|
-
const
|
|
3343
|
-
|
|
3328
|
+
const _ = Array.from(T.clipboardData.files);
|
|
3329
|
+
_.length > 0 && (T.preventDefault(), d(_));
|
|
3344
3330
|
}, C = (T) => {
|
|
3345
3331
|
T.key !== "Enter" || T.nativeEvent.isComposing || T.shiftKey || (T.preventDefault(), E());
|
|
3346
3332
|
}, v = (T) => {
|
|
3347
3333
|
if (e.current) {
|
|
3348
3334
|
e.current.style.height = "";
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3335
|
+
const _ = Math.min(ui, e.current.scrollHeight);
|
|
3336
|
+
Rn < _ && (e.current.style.height = `${_}px`);
|
|
3351
3337
|
}
|
|
3352
3338
|
n(T.target.value);
|
|
3353
3339
|
};
|
|
3354
|
-
return s ? /* @__PURE__ */ r.createElement(
|
|
3355
|
-
|
|
3340
|
+
return s ? /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(cn, { disabled: !0, placeholder: l }), /* @__PURE__ */ r.createElement(un, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(dn, null, /* @__PURE__ */ r.createElement(an, null, /* @__PURE__ */ r.createElement(rc, null), /* @__PURE__ */ r.createElement(ln, null, /* @__PURE__ */ r.createElement(
|
|
3341
|
+
cn,
|
|
3356
3342
|
{
|
|
3357
3343
|
ref: e,
|
|
3358
3344
|
role: "textbox",
|
|
@@ -3363,7 +3349,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3363
3349
|
onChange: v,
|
|
3364
3350
|
onPaste: b
|
|
3365
3351
|
}
|
|
3366
|
-
), /* @__PURE__ */ r.createElement(
|
|
3352
|
+
), /* @__PURE__ */ r.createElement(un, null))), x && /* @__PURE__ */ r.createElement(cr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(O, { type: "send", color: h.color.primary.main, size: 20 })));
|
|
3367
3353
|
}, dc = u.div`padding:8px 16px;text-align:center;word-break:break-word;white-space:pre-wrap;line-height:1.43;letter-spacing:-0.2px;font-size:14px;font-weight:400;color:${h.themedColor.textLowEmphasis};&& a{font-weight:700;text-decoration:none;${N.light`
|
|
3368
3354
|
color: ${h.color.information.light};
|
|
3369
3355
|
`};
|
|
@@ -3371,16 +3357,16 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3371
3357
|
color: ${h.color.information.main};
|
|
3372
3358
|
`};
|
|
3373
3359
|
}
|
|
3374
|
-
`, uc = w(() => import("./
|
|
3360
|
+
`, uc = w(() => import("./CDvzufwm.js").then((e) => ({ default: e.MarkdownText }))), mc = () => {
|
|
3375
3361
|
const { aiAgentInfo: e } = z(), { messageSource: t } = q(), { userSession: n } = z();
|
|
3376
|
-
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) =>
|
|
3362
|
+
return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Xn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(dc, null, /* @__PURE__ */ r.createElement(uc, null, e.specialNotice));
|
|
3377
3363
|
}, hc = () => /* @__PURE__ */ r.createElement(gc, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(Kl, null, /* @__PURE__ */ r.createElement(cc, null))), gc = u.div`z-index:0;border:none;width:100%;`, pc = () => {
|
|
3378
3364
|
var a, s, l;
|
|
3379
3365
|
const { activeChannel: e } = z(), { channelSource: t } = q(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === W.CLOSED;
|
|
3380
3366
|
return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Wl, null) : /* @__PURE__ */ r.createElement(hc, null);
|
|
3381
3367
|
}, fc = () => {
|
|
3382
3368
|
var v;
|
|
3383
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p =
|
|
3369
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p = Pe() ? 24 : 16, x = () => {
|
|
3384
3370
|
e.setOpened(!1);
|
|
3385
3371
|
}, f = async () => {
|
|
3386
3372
|
try {
|
|
@@ -3392,7 +3378,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3392
3378
|
}, E = async () => {
|
|
3393
3379
|
m && await i.send(ao.CloseConversation({ channelUrl: m.url }));
|
|
3394
3380
|
}, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((v = m == null ? void 0 : m.conversation) != null && v.handoff) && b;
|
|
3395
|
-
return /* @__PURE__ */ r.createElement(yc, null, /* @__PURE__ */ r.createElement(vc, null, d && /* @__PURE__ */ r.createElement(
|
|
3381
|
+
return /* @__PURE__ */ r.createElement(yc, null, /* @__PURE__ */ r.createElement(vc, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: h.themedColor.textHighEmphasis })), b && /* @__PURE__ */ r.createElement(nr, { size: 34 }), /* @__PURE__ */ r.createElement(Sc, { variant: "h2", color: h.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(_c, null, C && /* @__PURE__ */ r.createElement(
|
|
3396
3382
|
Cc,
|
|
3397
3383
|
{
|
|
3398
3384
|
tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
|
|
@@ -3403,38 +3389,38 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3403
3389
|
), n && /* @__PURE__ */ r.createElement(
|
|
3404
3390
|
Ec,
|
|
3405
3391
|
{
|
|
3406
|
-
disabled: !
|
|
3392
|
+
disabled: !Wn(m),
|
|
3407
3393
|
size: p,
|
|
3408
3394
|
onClick: E
|
|
3409
3395
|
}
|
|
3410
3396
|
), o && /* @__PURE__ */ r.createElement(bc, { size: p }), /* @__PURE__ */ r.createElement(xc, { size: p, onClick: x })));
|
|
3411
3397
|
}, bc = ({ size: e, disabled: t }) => {
|
|
3412
3398
|
const { state: n } = P();
|
|
3413
|
-
return /* @__PURE__ */ r.createElement(
|
|
3414
|
-
}, xc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(
|
|
3399
|
+
return /* @__PURE__ */ r.createElement(Ue, { "aria-label": "expand", onClick: () => n.setExpanded(!n.expanded), disabled: t }, /* @__PURE__ */ r.createElement(O, { type: n.expanded ? "collapse" : "expand", size: e, color: h.themedColor.textHighEmphasis }));
|
|
3400
|
+
}, xc = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(O, { type: "close", size: e, color: h.themedColor.textHighEmphasis })), Ec = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Ue, { "aria-label": "close conversation", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(
|
|
3415
3401
|
O,
|
|
3416
3402
|
{
|
|
3417
3403
|
type: "refresh",
|
|
3418
3404
|
size: e,
|
|
3419
3405
|
color: t ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
|
|
3420
3406
|
}
|
|
3421
|
-
)), Cc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(
|
|
3407
|
+
)), Cc = ({ size: e, onClick: t, disabled: n, tooltipLabel: o }) => /* @__PURE__ */ r.createElement(Yn, { label: o, position: "bottom", disabled: n }, /* @__PURE__ */ r.createElement(Ue, { "aria-label": "agent", onClick: t, disabled: n }, /* @__PURE__ */ r.createElement(
|
|
3422
3408
|
O,
|
|
3423
3409
|
{
|
|
3424
3410
|
type: "agent",
|
|
3425
3411
|
size: e,
|
|
3426
3412
|
color: n ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
|
|
3427
3413
|
}
|
|
3428
|
-
))), yc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, vc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`,
|
|
3429
|
-
const { isActionbookTester: e } =
|
|
3414
|
+
))), yc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, vc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Tc = () => {
|
|
3415
|
+
const { isActionbookTester: e } = Fe();
|
|
3430
3416
|
return e ? null : /* @__PURE__ */ r.createElement(fc, null);
|
|
3431
|
-
},
|
|
3417
|
+
}, mn = ({
|
|
3432
3418
|
children: e,
|
|
3433
3419
|
onNavigateToConversationList: t,
|
|
3434
3420
|
closedChannelUrl: n,
|
|
3435
3421
|
onClearClosedChannelUrl: o
|
|
3436
3422
|
}) => {
|
|
3437
|
-
const { Template: i } =
|
|
3423
|
+
const { Template: i } = Rt.useContext();
|
|
3438
3424
|
return /* @__PURE__ */ r.createElement(
|
|
3439
3425
|
Wa,
|
|
3440
3426
|
{
|
|
@@ -3444,7 +3430,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3444
3430
|
},
|
|
3445
3431
|
/* @__PURE__ */ r.createElement(xt, null, /* @__PURE__ */ r.createElement(xt.Consumer, null, (a) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(kc, { ...a }, /* @__PURE__ */ r.createElement(i, null)), e)))
|
|
3446
3432
|
);
|
|
3447
|
-
},
|
|
3433
|
+
}, Rt = we({
|
|
3448
3434
|
template: wc,
|
|
3449
3435
|
components: {
|
|
3450
3436
|
Header: Tc,
|
|
@@ -3453,7 +3439,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
|
|
|
3453
3439
|
}
|
|
3454
3440
|
});
|
|
3455
3441
|
function wc() {
|
|
3456
|
-
const { components: e } =
|
|
3442
|
+
const { components: e } = Rt.useContext();
|
|
3457
3443
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3458
3444
|
}
|
|
3459
3445
|
const kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, {
|
|
@@ -3462,7 +3448,7 @@ const kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:
|
|
|
3462
3448
|
} = j("ConversationList");
|
|
3463
3449
|
function Ic({
|
|
3464
3450
|
conversationListFilter: e,
|
|
3465
|
-
onOpenConversationView: t =
|
|
3451
|
+
onOpenConversationView: t = Le,
|
|
3466
3452
|
children: n
|
|
3467
3453
|
}) {
|
|
3468
3454
|
return /* @__PURE__ */ r.createElement(bo, { conversationListFilter: e }, (o) => /* @__PURE__ */ r.createElement(Ac, { value: { ...o, onOpenConversationView: t } }, n));
|
|
@@ -3528,7 +3514,7 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3528
3514
|
const { stringSet: e } = R();
|
|
3529
3515
|
return /* @__PURE__ */ r.createElement(zc, null, /* @__PURE__ */ r.createElement(Vc, { variant: "h2", color: h.themedColor.textHighEmphasis }, e.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Wc, null));
|
|
3530
3516
|
}, zc = u.div`display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;flex-shrink:0;height:56px;position:relative;background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Vc = u(k)`padding:0 12px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Wc = u.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${h.themedColor.textDisabled};`, Gc = ({ conversationListFilter: e, children: t, onOpenConversationView: n }) => {
|
|
3531
|
-
const { Template: o } =
|
|
3517
|
+
const { Template: o } = Dt.useContext();
|
|
3532
3518
|
return /* @__PURE__ */ r.createElement(
|
|
3533
3519
|
Ic,
|
|
3534
3520
|
{
|
|
@@ -3538,7 +3524,7 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3538
3524
|
/* @__PURE__ */ r.createElement(Kc, null, /* @__PURE__ */ r.createElement(o, null)),
|
|
3539
3525
|
t
|
|
3540
3526
|
);
|
|
3541
|
-
},
|
|
3527
|
+
}, Dt = we({
|
|
3542
3528
|
template: jc,
|
|
3543
3529
|
components: {
|
|
3544
3530
|
Header: Hc,
|
|
@@ -3547,15 +3533,15 @@ const Mc = u.div`display:flex;flex-direction:row;align-items:center;position:rel
|
|
|
3547
3533
|
}
|
|
3548
3534
|
});
|
|
3549
3535
|
function jc() {
|
|
3550
|
-
const { components: e } =
|
|
3536
|
+
const { components: e } = Dt.useContext();
|
|
3551
3537
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(e.Header, null), /* @__PURE__ */ r.createElement(e.Body, null), /* @__PURE__ */ r.createElement(e.Footer, null));
|
|
3552
3538
|
}
|
|
3553
|
-
const Kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Zc = $`:where(#${
|
|
3554
|
-
|
|
3539
|
+
const Kc = u.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Zc = $`:where(#${oe.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Yc = [Zc, ni, ri], qc = (e, ...t) => Lr(e, ...Yc, ...t), Jc = qc``, Xc = Xr(
|
|
3540
|
+
Rt,
|
|
3555
3541
|
_e,
|
|
3542
|
+
$t,
|
|
3556
3543
|
Mt,
|
|
3557
|
-
|
|
3558
|
-
Nt,
|
|
3544
|
+
Dt,
|
|
3559
3545
|
ur
|
|
3560
3546
|
);
|
|
3561
3547
|
function Qc({
|
|
@@ -3570,7 +3556,7 @@ function Qc({
|
|
|
3570
3556
|
}) {
|
|
3571
3557
|
return ci(jo, t), /* @__PURE__ */ r.createElement(Rr, { target: t }, /* @__PURE__ */ r.createElement(si, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(Fo, { internalVariables: s == null ? void 0 : s.__internalVariables }, /* @__PURE__ */ r.createElement(ti, { stringSet: i, logger: n, language: o }, /* @__PURE__ */ r.createElement(Xc, null, a, /* @__PURE__ */ r.createElement(Jc, null))))));
|
|
3572
3558
|
}
|
|
3573
|
-
const
|
|
3559
|
+
const hn = {
|
|
3574
3560
|
key_payment_plan_container: {
|
|
3575
3561
|
color_variables: {},
|
|
3576
3562
|
created_at: 1232,
|
|
@@ -3755,16 +3741,16 @@ const gn = {
|
|
|
3755
3741
|
}
|
|
3756
3742
|
}
|
|
3757
3743
|
}
|
|
3758
|
-
}, mr =
|
|
3744
|
+
}, mr = Re(function({
|
|
3759
3745
|
rootElement: t = document.body,
|
|
3760
|
-
logLevel: n =
|
|
3746
|
+
logLevel: n = xn.WARN,
|
|
3761
3747
|
language: o = navigator.language,
|
|
3762
3748
|
userSessionInfo: i,
|
|
3763
3749
|
children: a,
|
|
3764
3750
|
...s
|
|
3765
3751
|
}, l) {
|
|
3766
3752
|
var c;
|
|
3767
|
-
return ye.level !== n && (ye.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id:
|
|
3753
|
+
return ye.level !== n && (ye.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(No, { logger: ye, storage: td }, /* @__PURE__ */ r.createElement(
|
|
3768
3754
|
Qc,
|
|
3769
3755
|
{
|
|
3770
3756
|
logger: ye,
|
|
@@ -3787,35 +3773,35 @@ const gn = {
|
|
|
3787
3773
|
dispatcher: ed,
|
|
3788
3774
|
chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
|
|
3789
3775
|
},
|
|
3790
|
-
/* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id:
|
|
3776
|
+
/* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: oe.MODAL_ROOT }))))
|
|
3791
3777
|
)
|
|
3792
3778
|
)));
|
|
3793
|
-
}), ye = new
|
|
3779
|
+
}), ye = new wn(xn.WARN), ed = new Sn(ye), Nt = "@sba/message-template", gn = (e) => `${Nt}/templates/${e}`, pn = () => `${Nt}/token`, td = Ro({
|
|
3794
3780
|
onSetTemplate: (e, t) => {
|
|
3795
|
-
|
|
3781
|
+
hn[e] || te.setItem(gn(e), t);
|
|
3796
3782
|
},
|
|
3797
3783
|
onGetTemplate: (e) => {
|
|
3798
|
-
const t =
|
|
3799
|
-
return t ? JSON.stringify(t) :
|
|
3784
|
+
const t = hn[e];
|
|
3785
|
+
return t ? JSON.stringify(t) : te.getItem(gn(e));
|
|
3800
3786
|
},
|
|
3801
3787
|
onSetCachedToken(e) {
|
|
3802
|
-
|
|
3788
|
+
te.setItem(pn(), e);
|
|
3803
3789
|
},
|
|
3804
3790
|
onGetCachedToken() {
|
|
3805
|
-
return
|
|
3791
|
+
return te.getItem(pn());
|
|
3806
3792
|
},
|
|
3807
3793
|
onClear: () => {
|
|
3808
|
-
|
|
3794
|
+
te.getKeys(Nt).forEach(te.deleteItem);
|
|
3809
3795
|
}
|
|
3810
3796
|
}), hr = ({ children: e, isOpened: t }) => {
|
|
3811
|
-
const { dir: n, rootElement: o } = P(), i =
|
|
3797
|
+
const { dir: n, rootElement: o } = P(), i = fe(o, !0);
|
|
3812
3798
|
return D(() => {
|
|
3813
3799
|
const a = "sb-agent-block-scroll";
|
|
3814
3800
|
return t ? i.body.classList.add(a) : i.body.classList.remove(a), () => {
|
|
3815
3801
|
i.body.classList.remove(a);
|
|
3816
3802
|
};
|
|
3817
3803
|
}, [i, t]), /* @__PURE__ */ r.createElement(nd, { dir: n, $visible: t }, e);
|
|
3818
|
-
}, nd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${
|
|
3804
|
+
}, nd = u.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${be.WINDOW};visibility:${({ $visible: e }) => e ? "visible" : "hidden"};`, rd = 48, od = 2 / 3;
|
|
3819
3805
|
function id({
|
|
3820
3806
|
className: e,
|
|
3821
3807
|
isOpened: t,
|
|
@@ -3832,7 +3818,7 @@ function id({
|
|
|
3832
3818
|
ld,
|
|
3833
3819
|
{
|
|
3834
3820
|
dir: a,
|
|
3835
|
-
id:
|
|
3821
|
+
id: oe.LAUNCHER,
|
|
3836
3822
|
className: e,
|
|
3837
3823
|
"aria-label": "Sendbird AIAgent Launcher",
|
|
3838
3824
|
onClick: n,
|
|
@@ -3840,11 +3826,11 @@ function id({
|
|
|
3840
3826
|
$backgroundColor: l,
|
|
3841
3827
|
$size: c
|
|
3842
3828
|
},
|
|
3843
|
-
/* @__PURE__ */ r.createElement(cd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(
|
|
3844
|
-
/* @__PURE__ */ r.createElement(dd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(
|
|
3829
|
+
/* @__PURE__ */ r.createElement(cd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Open, { url: i, isDefaultIcon: o === "default_icon" })),
|
|
3830
|
+
/* @__PURE__ */ r.createElement(dd, { $isOpened: t, $animated: s, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(fn.Close, { size: m }))
|
|
3845
3831
|
);
|
|
3846
3832
|
}
|
|
3847
|
-
const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, ad = $`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;filter:${({ $fillColor: e }) => e ===
|
|
3833
|
+
const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, ad = $`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;filter:${({ $fillColor: e }) => e === Ln.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, gr = $`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => $`
|
|
3848
3834
|
path {
|
|
3849
3835
|
fill: ${e};
|
|
3850
3836
|
}
|
|
@@ -3853,12 +3839,12 @@ const sd = $`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
3853
3839
|
}
|
|
3854
3840
|
`}
|
|
3855
3841
|
}
|
|
3856
|
-
`, ld = u.button`position:relative;padding:0;width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;background:${({ $backgroundColor: e }) => e};border-radius:50%;transition:all 0.3s cubic-bezier(0.31,-0.105,0.43,1.4);border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 16px 24px 2px rgba(33,33,33,0.12),0 6px 30px 5px rgba(33,33,33,0.08),0 6px 10px -5px rgba(33,33,33,0.04);${({ $animated: e }) => e && sd}`, pr = u.span`position:absolute;width:100%;height:100%;border-radius:50%;overflow:hidden;transition:transform 0.16s linear,opacity 0.08s linear,scale 0.16s linear;user-select:none;display:flex;justify-content:center;align-items:center;`, cd = u(pr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${ad}${gr}`, dd = u(pr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${gr}`,
|
|
3857
|
-
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(
|
|
3842
|
+
`, ld = u.button`position:relative;padding:0;width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;background:${({ $backgroundColor: e }) => e};border-radius:50%;transition:all 0.3s cubic-bezier(0.31,-0.105,0.43,1.4);border:none;display:flex;justify-content:center;align-items:center;box-shadow:0 16px 24px 2px rgba(33,33,33,0.12),0 6px 30px 5px rgba(33,33,33,0.08),0 6px 10px -5px rgba(33,33,33,0.04);${({ $animated: e }) => e && sd}`, pr = u.span`position:absolute;width:100%;height:100%;border-radius:50%;overflow:hidden;transition:transform 0.16s linear,opacity 0.08s linear,scale 0.16s linear;user-select:none;display:flex;justify-content:center;align-items:center;`, cd = u(pr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${ad}${gr}`, dd = u(pr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${gr}`, fn = {
|
|
3843
|
+
Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(kt, null),
|
|
3858
3844
|
Close: ({ size: e }) => /* @__PURE__ */ r.createElement(O, { size: e, type: "chevron-down" })
|
|
3859
3845
|
};
|
|
3860
3846
|
function fr({ className: e, size: t }) {
|
|
3861
|
-
const { colors: n } =
|
|
3847
|
+
const { colors: n } = Et(), { dir: o, state: i } = P(), { launcherInfo: a } = z();
|
|
3862
3848
|
return md(), /* @__PURE__ */ r.createElement(
|
|
3863
3849
|
id,
|
|
3864
3850
|
{
|
|
@@ -3894,7 +3880,7 @@ function md() {
|
|
|
3894
3880
|
}
|
|
3895
3881
|
const br = Te(null);
|
|
3896
3882
|
function hd() {
|
|
3897
|
-
const e =
|
|
3883
|
+
const e = re(br);
|
|
3898
3884
|
if (!e)
|
|
3899
3885
|
throw new Error("useNavigator() must be used within <Navigator />");
|
|
3900
3886
|
return e;
|
|
@@ -3903,7 +3889,7 @@ function xr({ children: e }) {
|
|
|
3903
3889
|
const t = hd();
|
|
3904
3890
|
return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
|
|
3905
3891
|
}
|
|
3906
|
-
const gd =
|
|
3892
|
+
const gd = En`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, pd = En`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, fd = $`animation-name:${gd};animation-duration:0.3s;animation-fill-mode:forwards;`, bd = $``, xd = $`animation-name:${pd};animation-duration:0.3s;animation-fill-mode:forwards;`, Ed = $`visibility:hidden;`, Cd = u.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
|
|
3907
3893
|
switch (e) {
|
|
3908
3894
|
case "entering":
|
|
3909
3895
|
return fd;
|
|
@@ -3920,7 +3906,7 @@ const gd = Cn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
|
|
|
3920
3906
|
z-index: 999;
|
|
3921
3907
|
` : $`z-index:1;pointer-events:none;`}
|
|
3922
3908
|
`;
|
|
3923
|
-
function
|
|
3909
|
+
function Me({ initialId: e, children: t }) {
|
|
3924
3910
|
const n = U((b, C) => {
|
|
3925
3911
|
c((v) => [...v, b]), m((v) => ({ ...v, [b]: !0 })), C != null && C.reset && f((v) => ({
|
|
3926
3912
|
...v,
|
|
@@ -3958,55 +3944,55 @@ function $e({ initialId: e, children: t }) {
|
|
|
3958
3944
|
), [t]), s = ve(() => {
|
|
3959
3945
|
const b = {};
|
|
3960
3946
|
return a.forEach((C) => {
|
|
3961
|
-
const { id: v, lazy: T, children:
|
|
3962
|
-
b[v] = { lazy: T, element: typeof
|
|
3947
|
+
const { id: v, lazy: T, children: _ } = C.props;
|
|
3948
|
+
b[v] = { lazy: T, element: typeof _ == "function" ? _(i) : _ };
|
|
3963
3949
|
}), b;
|
|
3964
|
-
}, [a]), [l, c] =
|
|
3950
|
+
}, [a]), [l, c] = S([e]), [d, m] = S(() => {
|
|
3965
3951
|
const b = {};
|
|
3966
3952
|
return Object.entries(s).forEach(([C, { lazy: v }]) => {
|
|
3967
3953
|
v === !1 && (b[C] = !0);
|
|
3968
3954
|
}), b[e] = !0, b;
|
|
3969
|
-
}), [g, p] =
|
|
3955
|
+
}), [g, p] = S(() => {
|
|
3970
3956
|
const b = {};
|
|
3971
3957
|
return Object.keys(s).forEach((C) => {
|
|
3972
3958
|
C === e ? b[C] = "entered" : b[C] = "exited";
|
|
3973
3959
|
}), b;
|
|
3974
|
-
}), [x, f] =
|
|
3960
|
+
}), [x, f] = S({}), E = l[l.length - 1];
|
|
3975
3961
|
return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(yd, null, Object.keys(s).map((b) => {
|
|
3976
|
-
var
|
|
3962
|
+
var _;
|
|
3977
3963
|
if (!d[b]) return null;
|
|
3978
3964
|
const C = g[b] || "exited", v = b === E, T = `${b}-${x[b] || 0}`;
|
|
3979
|
-
return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: v }, (
|
|
3965
|
+
return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: v }, (_ = s[b]) == null ? void 0 : _.element);
|
|
3980
3966
|
})));
|
|
3981
3967
|
}
|
|
3982
3968
|
const yd = u.div`position:relative;width:100%;height:100%;`;
|
|
3983
|
-
|
|
3984
|
-
const
|
|
3969
|
+
Me.Screen = xr;
|
|
3970
|
+
const pe = {
|
|
3985
3971
|
activeConv: "active-conv",
|
|
3986
3972
|
closedConv: "closed-conv",
|
|
3987
3973
|
convList: "conv-list"
|
|
3988
|
-
}, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(
|
|
3989
|
-
|
|
3974
|
+
}, Er = ({ setClosedChannelUrl: e, closedChannelUrl: t }) => /* @__PURE__ */ r.createElement(Me, { initialId: pe.activeConv }, /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.activeConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(mn, { onNavigateToConversationList: () => n.navigate(pe.convList, { reset: !0 }) })), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.closedConv }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3975
|
+
mn,
|
|
3990
3976
|
{
|
|
3991
3977
|
onNavigateToConversationList: () => n.pop(),
|
|
3992
3978
|
closedChannelUrl: t,
|
|
3993
3979
|
onClearClosedChannelUrl: () => e(void 0)
|
|
3994
3980
|
}
|
|
3995
|
-
)), /* @__PURE__ */ r.createElement(
|
|
3981
|
+
)), /* @__PURE__ */ r.createElement(Me.Screen, { id: pe.convList, lazy: !0 }, ({ navigation: n }) => /* @__PURE__ */ r.createElement(
|
|
3996
3982
|
Gc,
|
|
3997
3983
|
{
|
|
3998
3984
|
onOpenConversationView: (o, i) => {
|
|
3999
|
-
i === "closed" ? (e(o), n.navigate(
|
|
3985
|
+
i === "closed" ? (e(o), n.navigate(pe.closedConv, { reset: !0 })) : n.navigate(pe.activeConv);
|
|
4000
3986
|
}
|
|
4001
3987
|
}
|
|
4002
3988
|
)));
|
|
4003
3989
|
function vd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
|
|
4004
3990
|
const { dir: i } = P();
|
|
4005
|
-
return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id:
|
|
3991
|
+
return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id: oe.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
|
|
4006
3992
|
}
|
|
4007
|
-
const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${
|
|
4008
|
-
const o =
|
|
4009
|
-
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(
|
|
3993
|
+
const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, Xd = Re(function({ children: e, ...t }, n) {
|
|
3994
|
+
const o = Pe(), [i, a] = S(), s = o ? hr : vd;
|
|
3995
|
+
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(s, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(fr, null) }, /* @__PURE__ */ r.createElement(
|
|
4010
3996
|
Er,
|
|
4011
3997
|
{
|
|
4012
3998
|
closedChannelUrl: i,
|
|
@@ -4015,41 +4001,41 @@ const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end
|
|
|
4015
4001
|
)), e)));
|
|
4016
4002
|
}), {
|
|
4017
4003
|
Provider: kd,
|
|
4018
|
-
useContext:
|
|
4004
|
+
useContext: Pt
|
|
4019
4005
|
} = j("FixedMessengerStyle");
|
|
4020
4006
|
function Cr(e, t, n, o = 0) {
|
|
4021
4007
|
const { top: i, bottom: a, start: s, end: l } = n;
|
|
4022
4008
|
let c = "", d = "";
|
|
4023
4009
|
switch (e) {
|
|
4024
4010
|
case "start":
|
|
4025
|
-
d = `inset-inline-start: ${
|
|
4011
|
+
d = `inset-inline-start: ${Y(s)}`;
|
|
4026
4012
|
break;
|
|
4027
4013
|
case "end":
|
|
4028
|
-
d = `inset-inline-end: ${
|
|
4014
|
+
d = `inset-inline-end: ${Y(l)}`;
|
|
4029
4015
|
break;
|
|
4030
4016
|
}
|
|
4031
4017
|
switch (t) {
|
|
4032
4018
|
case "top":
|
|
4033
|
-
c = `top: calc(${
|
|
4019
|
+
c = `top: calc(${Y(i)} + ${o}px)`;
|
|
4034
4020
|
break;
|
|
4035
4021
|
case "bottom":
|
|
4036
|
-
c = `bottom: calc(${
|
|
4022
|
+
c = `bottom: calc(${Y(a)} + ${o}px)`;
|
|
4037
4023
|
break;
|
|
4038
4024
|
}
|
|
4039
4025
|
return $`${c};${d};`;
|
|
4040
4026
|
}
|
|
4041
4027
|
function Ad(e) {
|
|
4042
|
-
const { horizontal: t, vertical: n, margin: o, launcherSize: i } =
|
|
4028
|
+
const { horizontal: t, vertical: n, margin: o, launcherSize: i } = Pt();
|
|
4043
4029
|
return /* @__PURE__ */ r.createElement(Id, { ...e, size: i, $horizontal: t, $vertical: n, $margin: o });
|
|
4044
4030
|
}
|
|
4045
|
-
const Id = u(fr)`position:fixed;z-index:${
|
|
4031
|
+
const Id = u(fr)`position:fixed;z-index:${be.LAUNCHER};${({ $horizontal: e, $vertical: t, $margin: n }) => Cr(e, t, n)};`;
|
|
4046
4032
|
function $d({ isExpanded: e, isOpened: t, children: n }) {
|
|
4047
|
-
const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } =
|
|
4033
|
+
const { dir: o } = P(), { horizontal: i, vertical: a, margin: s, launcherSize: l } = Pt();
|
|
4048
4034
|
return /* @__PURE__ */ r.createElement(
|
|
4049
4035
|
Md,
|
|
4050
4036
|
{
|
|
4051
4037
|
dir: o,
|
|
4052
|
-
id:
|
|
4038
|
+
id: oe.WINDOW,
|
|
4053
4039
|
$isExpanded: e,
|
|
4054
4040
|
$isOpened: t,
|
|
4055
4041
|
$horizontal: i,
|
|
@@ -4068,12 +4054,12 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4068
4054
|
|
|
4069
4055
|
${({ $isOpened: e }) => e && Ld};
|
|
4070
4056
|
${({ $isExpanded: e }) => e && Od};
|
|
4071
|
-
`, Od = $`width:743px;height:723px;`, Ld = $`z-index:${
|
|
4072
|
-
const [o, i] =
|
|
4057
|
+
`, Od = $`width:743px;height:723px;`, Ld = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, yr = { top: 24, bottom: 24, start: 24, end: 24 }, Rd = Re(function({ children: e, ...t }, n) {
|
|
4058
|
+
const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(yr), [d, m] = S(48), g = Pe(), p = g ? hr : $d, { horizontal: x, vertical: f } = ve(() => {
|
|
4073
4059
|
const [E, b] = a.split("-");
|
|
4074
4060
|
return { horizontal: E === "start" ? "start" : "end", vertical: b === "top" ? "top" : "bottom" };
|
|
4075
4061
|
}, [a]);
|
|
4076
|
-
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(
|
|
4062
|
+
return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !g, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: E }) => /* @__PURE__ */ r.createElement(
|
|
4077
4063
|
kd,
|
|
4078
4064
|
{
|
|
4079
4065
|
value: { horizontal: x, vertical: f, margin: l, launcherSize: d, setPosition: s, setMargin: c, setLauncherSize: m }
|
|
@@ -4090,8 +4076,8 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4090
4076
|
)));
|
|
4091
4077
|
}), Dd = (e) => {
|
|
4092
4078
|
var i, a, s, l;
|
|
4093
|
-
const { setPosition: t, setMargin: n, setLauncherSize: o } =
|
|
4094
|
-
return
|
|
4079
|
+
const { setPosition: t, setMargin: n, setLauncherSize: o } = Pt();
|
|
4080
|
+
return ce(() => {
|
|
4095
4081
|
e.position && t(e.position), e.margin && n({ ...yr, ...e.margin }), e.launcherSize && o(e.launcherSize);
|
|
4096
4082
|
}, [
|
|
4097
4083
|
e.position,
|
|
@@ -4105,16 +4091,16 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
4105
4091
|
Style: Dd
|
|
4106
4092
|
});
|
|
4107
4093
|
export {
|
|
4108
|
-
|
|
4094
|
+
_t as A,
|
|
4109
4095
|
ao as C,
|
|
4110
4096
|
Xd as D,
|
|
4111
4097
|
Qd as F,
|
|
4112
4098
|
O as I,
|
|
4113
|
-
|
|
4099
|
+
Kn as L,
|
|
4114
4100
|
ka as M,
|
|
4115
|
-
|
|
4101
|
+
$t as O,
|
|
4116
4102
|
Jd as P,
|
|
4117
|
-
|
|
4103
|
+
Mt as S,
|
|
4118
4104
|
k as a,
|
|
4119
4105
|
mr as b,
|
|
4120
4106
|
h as c,
|
|
@@ -4123,13 +4109,13 @@ export {
|
|
|
4123
4109
|
R as f,
|
|
4124
4110
|
id as g,
|
|
4125
4111
|
_e as h,
|
|
4126
|
-
|
|
4112
|
+
ne as i,
|
|
4127
4113
|
ur as j,
|
|
4128
|
-
|
|
4129
|
-
|
|
4114
|
+
mn as k,
|
|
4115
|
+
Rt as l,
|
|
4130
4116
|
ed as m,
|
|
4131
4117
|
Gc as n,
|
|
4132
|
-
|
|
4133
|
-
|
|
4118
|
+
Dt as o,
|
|
4119
|
+
Tn as p,
|
|
4134
4120
|
P as u
|
|
4135
4121
|
};
|