@sendbird/ai-agent-messenger-react 1.9.0 → 1.9.1

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.
@@ -2,14 +2,14 @@ var no = Object.defineProperty;
2
2
  var ro = (e, t, n) => t in e ? no(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var V = (e, t, n) => ro(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as r from "react";
5
- import { createContext as Ge, useContext as pe, useLayoutEffect as Ce, useState as T, useEffect as U, useRef as H, useCallback as O, useMemo as ne, forwardRef as We, useImperativeHandle as oo, useId as Ht, useReducer as so, PureComponent as io, Suspense as ao, lazy as L, Fragment as Xn, Children as lo } from "react";
5
+ import { createContext as We, useContext as pe, useLayoutEffect as Se, useState as T, useEffect as U, useRef as H, useCallback as O, useMemo as ne, forwardRef as Ge, useImperativeHandle as oo, useId as Vt, useReducer as so, PureComponent as io, Suspense as ao, lazy as L, Fragment as Xn, Children as lo } from "react";
6
6
  import co, { SendbirdChatOptions as uo, SendbirdProduct as mo, DeviceOsPlatform as gn, SendbirdPlatform as go, SessionHandler as ho, ConnectionHandler as mt, SendbirdError as po, LogLevel as Jn, ConnectionState as fo } from "@sendbird/chat";
7
- import h, { css as k, ThemeProvider as bo, useTheme as gt, createGlobalStyle as Eo, StyleSheetManager as xo, keyframes as Qn } from "styled-components";
7
+ import h, { css as I, ThemeProvider as bo, useTheme as gt, createGlobalStyle as Eo, StyleSheetManager as xo, keyframes as Qn } from "styled-components";
8
8
  import { differenceInMinutes as vo, isToday as yo, differenceInHours as _o, isSameMinute as hn, format as er, isSameDay as Co } from "date-fns";
9
9
  import { enUS as So } from "date-fns/locale/en-US";
10
10
  import { ConversationStatus as X, AIAgentModule as To, ConversationType as Ao, AIAgentMessageFeedbackRating as pn } from "@sendbird/chat/aiAgent";
11
- import { useGroupChannelMessages as wo, useGroupChannelHandler as ht, useForceUpdate as Io } from "@sendbird/uikit-tools";
12
- import { SendingStatus as Fe, MessageMetaArray as ko } from "@sendbird/chat/message";
11
+ import { useGroupChannelMessages as wo, useGroupChannelHandler as ht, useForceUpdate as ko } from "@sendbird/uikit-tools";
12
+ import { SendingStatus as Fe, MessageMetaArray as Io } from "@sendbird/chat/message";
13
13
  import { GroupChannelModule as $o, GroupChannelListOrder as tr, GroupChannelHandler as Mo } from "@sendbird/chat/groupChannel";
14
14
  import { createPortal as Oo } from "react-dom";
15
15
  import { renderer as Lo, parser as Do, MessageProvider as Ro } from "@sendbird/react-uikit-message-template-view";
@@ -18,7 +18,7 @@ import nr from "dompurify";
18
18
  import { isSameDay as Bo } from "date-fns/isSameDay";
19
19
  import Fo from "@emotion/is-prop-valid";
20
20
  const J = (e, t) => {
21
- const n = Ge(null), o = ({ children: a, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof a == "function" ? a(l) : a), s = ({ children: a }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof a == "function" ? a(l) : a : null), i = () => {
21
+ const n = We(null), o = ({ children: a, value: l }) => /* @__PURE__ */ r.createElement(n.Provider, { value: l }, typeof a == "function" ? a(l) : a), s = ({ children: a }) => /* @__PURE__ */ r.createElement(n.Consumer, null, (l) => l ? typeof a == "function" ? a(l) : a : null), i = () => {
22
22
  const a = pe(n);
23
23
  if (!a)
24
24
  throw new Error(`use${e}Context must be used within a ${e}Provider`);
@@ -27,7 +27,7 @@ const J = (e, t) => {
27
27
  return n.displayName = `${e}Context`, o.displayName = `${e}Provider`, s.displayName = `${e}Consumer`, i.displayName = `use${e}Context`, { Context: n, Provider: o, Consumer: s, useContext: i };
28
28
  };
29
29
  function Me(e) {
30
- const t = Ge({
30
+ const t = We({
31
31
  Template: e.template,
32
32
  updateTemplate: () => {
33
33
  },
@@ -46,7 +46,7 @@ function Me(e) {
46
46
  }
47
47
  function o({ template: i, children: a }) {
48
48
  const { updateTemplate: l } = pe(t);
49
- return Ce(() => {
49
+ return Se(() => {
50
50
  i && l(i);
51
51
  }, [i]), /* @__PURE__ */ r.createElement(r.Fragment, null, a);
52
52
  }
@@ -58,7 +58,7 @@ function Me(e) {
58
58
  component: l
59
59
  }) {
60
60
  const { updateComponent: c } = pe(t);
61
- return Ce(() => {
61
+ return Se(() => {
62
62
  l && c(i, l);
63
63
  }, [l]), null;
64
64
  };
@@ -69,7 +69,7 @@ function Po(...e) {
69
69
  return e.reduce((o, s) => /* @__PURE__ */ r.createElement(s, null, o), n);
70
70
  };
71
71
  }
72
- const Se = (e) => {
72
+ const Te = (e) => {
73
73
  var t, n;
74
74
  return !!(e != null && e.isAIAgent && ((t = e == null ? void 0 : e.conversation) == null ? void 0 : t.status) === X.CLOSED || e != null && e.isDesk && ((n = e == null ? void 0 : e.helpdeskInfo) == null ? void 0 : n.ticketStatus) === "closed");
75
75
  }, It = (e) => {
@@ -141,12 +141,12 @@ function zo(e) {
141
141
  const t = e.lastMessage;
142
142
  return t != null && t.isUserMessage() || t != null && t.isAdminMessage() ? t.message || "" : t != null && t.isFileMessage() ? t.message || t.name || "FILE" : e.name;
143
143
  }
144
- function Go(e, t, n) {
144
+ function Wo(e, t, n) {
145
145
  var a;
146
146
  const o = /* @__PURE__ */ new Date(), s = new Date(((a = e.lastMessage) == null ? void 0 : a.createdAt) || e.createdAt), i = vo(o, s);
147
147
  return i < 1 ? n.justNow : i < 60 ? n.minutesAgo(i) : yo(s) ? n.hoursAgo(_o(o, s)) : t(s, n.dateShortFormat);
148
148
  }
149
- const Wo = "1.9.0", Be = "sb-agent", jo = Wo, rr = "KEY_IMG_ASPECT_RATIO", qo = "*/*", F = {
149
+ const Go = "1.9.1", Be = "sb-agent", jo = Go, rr = "KEY_IMG_ASPECT_RATIO", qo = "*/*", F = {
150
150
  BODY_MAX_WIDTH: 244,
151
151
  WIDE_BODY_MAX_WIDTH: 640,
152
152
  AVATAR_SIZE: 26,
@@ -178,7 +178,7 @@ const Wo = "1.9.0", Be = "sb-agent", jo = Wo, rr = "KEY_IMG_ASPECT_RATIO", qo =
178
178
  },
179
179
  isIncoming: (e, t) => fe(e) && e.sender.userId !== t,
180
180
  isOutgoing: (e, t) => fe(e) && (e.sender.userId === t || e.sendingStatus === Fe.PENDING)
181
- }, or = (e) => e.startsWith("image/"), sr = (e) => e.startsWith("video/"), Vt = (e, t) => {
181
+ }, or = (e) => e.startsWith("image/"), sr = (e) => e.startsWith("video/"), zt = (e, t) => {
182
182
  if (e && !e.startsWith(".")) {
183
183
  const n = e.split(".").pop();
184
184
  if (n && n !== e)
@@ -190,7 +190,7 @@ const Wo = "1.9.0", Be = "sb-agent", jo = Wo, rr = "KEY_IMG_ASPECT_RATIO", qo =
190
190
  return n.toUpperCase();
191
191
  }
192
192
  return "FILE";
193
- }, ir = (e) => e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0, zt = (e) => {
193
+ }, ir = (e) => e.messageType === "file" ? e.message.length > 0 && e.file.name !== e.message : e.message.length > 0, Wt = (e) => {
194
194
  switch (e) {
195
195
  case "top":
196
196
  case "middle":
@@ -215,14 +215,14 @@ const Wo = "1.9.0", Be = "sb-agent", jo = Wo, rr = "KEY_IMG_ASPECT_RATIO", qo =
215
215
  type: "text",
216
216
  value: e.slice(s).trim()
217
217
  }), t ? o.map((i) => i.type !== "text" ? i : { ...i, value: t(i.value) }) : o;
218
- }, Xo = (e) => e.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]"), Jo = (e) => e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g, "$1\\_"), Qo = (e) => e.replace(/~~/g, "\\~\\~"), Gg = (e) => {
218
+ }, Xo = (e) => e.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]"), Jo = (e) => e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g, "$1\\_"), Qo = (e) => e.replace(/~~/g, "\\~\\~"), Wg = (e) => {
219
219
  let t = e;
220
220
  return t = Xo(t), t = Jo(t), t = Qo(t), t;
221
221
  }, es = typeof navigator < "u" && navigator.product === "ReactNative", bn = (e, t) => {
222
222
  const n = (o) => !t || t.length === 0 ? !0 : fe(o) && t.includes(o.sendingStatus);
223
223
  return es ? e.find(n) : e.findLast(n);
224
224
  };
225
- function Te() {
225
+ function Ae() {
226
226
  }
227
227
  function ts() {
228
228
  const e = typeof navigator < "u" ? navigator.userAgent : "", t = /iPad|iPhone|iPod/.test(e), n = /Android/.test(e);
@@ -234,15 +234,15 @@ function ns(e) {
234
234
  t = (t << 5) - t + e.charCodeAt(n), t |= 0;
235
235
  return t.toString(16);
236
236
  }
237
- const kt = (e) => {
237
+ const $t = (e) => {
238
238
  try {
239
239
  return JSON.parse(e === "" ? "{}" : e);
240
240
  } catch {
241
241
  return {};
242
242
  }
243
- }, Ae = {
243
+ }, be = {
244
244
  isStreaming(e) {
245
- const t = kt(e.data);
245
+ const t = $t(e.data);
246
246
  return typeof t == "object" && !!t.stream;
247
247
  },
248
248
  isWelcomeMessage(e, t) {
@@ -250,7 +250,7 @@ const kt = (e) => {
250
250
  if (((n = e.extendedMessagePayload) == null ? void 0 : n.bot_message_type) === "welcome")
251
251
  return !0;
252
252
  if (He(e, t)) {
253
- const o = kt(e.data);
253
+ const o = $t(e.data);
254
254
  return !(o != null && o.respond_mesg_id) && !(o != null && o.stream);
255
255
  }
256
256
  return !1;
@@ -264,7 +264,7 @@ const kt = (e) => {
264
264
  return !!((t = e.extendedMessagePayload) != null && t.feedback);
265
265
  },
266
266
  checkExtendedFieldPresence(e) {
267
- const t = e.extendedMessagePayload || {}, n = (a) => a.some((l) => typeof t[l] < "u"), o = n(vt.ui), s = n(vt.trail), i = n(vt.marking);
267
+ const t = e.extendedMessagePayload || {}, n = (a) => a.some((l) => typeof t[l] < "u"), o = n(yt.ui), s = n(yt.trail), i = n(yt.marking);
268
268
  return { ui: o, trail: s, marking: i };
269
269
  },
270
270
  shouldScrollToBottom(e, t, n = !1) {
@@ -276,20 +276,20 @@ const kt = (e) => {
276
276
  }
277
277
  return !0;
278
278
  }
279
- }, vt = {
279
+ }, yt = {
280
280
  ui: ["suggested_replies", "cta_button", "message_template", "csat"],
281
281
  trail: ["groundedness", "manual", "function_calls"],
282
282
  marking: ["is_hallucination", "is_moderated", "flagged_types"]
283
- }, yt = `@${Be}`, En = ({ appId: e, aiAgentId: t, storage: n }) => {
283
+ }, _t = `@${Be}`, En = ({ appId: e, aiAgentId: t, storage: n }) => {
284
284
  const o = {
285
- templateBase: `${yt}-template`,
285
+ templateBase: `${_t}-template`,
286
286
  template: (s) => `${o.templateBase}/templates/${s}`,
287
287
  templateToken: () => `${o.templateBase}-template/message-template/tokens`,
288
288
  messengerSession: (s) => {
289
289
  const i = ns(`${e}/${t}/${s}`);
290
- return `${yt}-udata/${i}`;
290
+ return `${_t}-udata/${i}`;
291
291
  },
292
- anonUserSession: () => `${yt}-session/${e}/${t}`
292
+ anonUserSession: () => `${_t}-session/${e}/${t}`
293
293
  };
294
294
  return {
295
295
  template: {
@@ -369,7 +369,7 @@ class ar {
369
369
  }
370
370
  }
371
371
  const rs = () => {
372
- let e = Te, t = Te;
372
+ let e = Ae, t = Ae;
373
373
  return { promise: new Promise((o, s) => {
374
374
  e = o, t = s;
375
375
  }), resolve: e, reject: t };
@@ -515,7 +515,7 @@ function is({
515
515
  }, [x.chatSDK]), os(x.chatSDK), /* @__PURE__ */ r.createElement(ss, { value: x }, m);
516
516
  }
517
517
  const as = (e, t, n) => wo(e, t, { ...n, strictStreamingOrder: !0 });
518
- var $t = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))($t || {});
518
+ var Mt = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(Mt || {});
519
519
  class ls {
520
520
  constructor(t = {}) {
521
521
  V(this, "payload");
@@ -534,7 +534,7 @@ class ds extends ls {
534
534
  V(this, "type", "conv.close");
535
535
  }
536
536
  }
537
- const Mt = {
537
+ const Ot = {
538
538
  DEFAULT_BOT_MSG_BG: "#eeeeee",
539
539
  WHITE: "#ffffff",
540
540
  BLACK: "#000000"
@@ -588,9 +588,9 @@ function ps(e, t = "light") {
588
588
  extraLight: et(e, t === "dark" ? 1.2 : 1.75, t === "dark" ? 0.9 : 0.8)
589
589
  };
590
590
  }
591
- function Ot(e) {
591
+ function Lt(e) {
592
592
  const t = dr(e), n = 149, o = +`0x${t[1]}${t[2]}`, s = +`0x${t[3]}${t[4]}`, i = +`0x${t[5]}${t[6]}`;
593
- return o * 0.299 + s * 0.587 + i * 0.114 > n ? Mt.BLACK : Mt.WHITE;
593
+ return o * 0.299 + s * 0.587 + i * 0.114 > n ? Ot.BLACK : Ot.WHITE;
594
594
  }
595
595
  function fs(e, t, n, o, s) {
596
596
  return {
@@ -702,7 +702,7 @@ const bs = (e, t, n, o, s) => ({
702
702
  dark: "rgba(0, 0, 0, 0.55)",
703
703
  light: "rgba(22, 22, 22, 0.32)"
704
704
  }
705
- }, _t = {
705
+ }, Ct = {
706
706
  h1: { fontSize: 18, fontWeight: 700 },
707
707
  h2: { fontSize: 16, fontWeight: 700 },
708
708
  subtitle1: { fontSize: 16, fontWeight: 500 },
@@ -735,7 +735,7 @@ function Es({ selectedTheme: e, palette: t, primary: n }) {
735
735
  };
736
736
  }
737
737
  function xs({ selectedTheme: e, primaryContrast: t, botMessageBackground: n, botMessageBackgroundContrast: o }, s) {
738
- const i = s.primary.main, a = t ?? Ot(i), l = n ?? Mt.DEFAULT_BOT_MSG_BG, c = o ?? Ot(l);
738
+ const i = s.primary.main, a = t ?? Lt(i), l = n ?? Ot.DEFAULT_BOT_MSG_BG, c = o ?? Lt(l);
739
739
  return {
740
740
  colors: (e === "light" ? fs : bs)(
741
741
  s,
@@ -761,12 +761,12 @@ function vs(e, t, n) {
761
761
  }
762
762
  function ys({ typography: e }) {
763
763
  if (!e)
764
- return _t;
765
- const t = { ..._t };
764
+ return Ct;
765
+ const t = { ...Ct };
766
766
  return Object.keys(e).forEach((n) => {
767
767
  const o = e[n];
768
768
  if (o && typeof o == "object") {
769
- const s = _t[n], i = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
769
+ const s = Ct[n], i = ["fontSize", "fontWeight", "fontFamily", "lineHeight"];
770
770
  t[n] = vs(s, o, i);
771
771
  }
772
772
  }), t;
@@ -899,7 +899,7 @@ function As() {
899
899
  } catch (l) {
900
900
  const c = l;
901
901
  if (e.isCacheEnabled) {
902
- if (ks(c))
902
+ if (Is(c))
903
903
  t.warn("useChatConnection.connect", "offline connect restricted", c.message, c.code), t.warn("useChatConnection.connect", "clear cached-data"), await e.clearCachedData().catch((d) => t.warn("useChatConnection.connect", "clear cached-data failure", d));
904
904
  else if (e.currentUser)
905
905
  return t.debug("useChatConnection.connect: end (offline), currentUser", e.currentUser), e.currentUser;
@@ -923,9 +923,9 @@ function ws(e, t) {
923
923
  });
924
924
  };
925
925
  }
926
- const Is = [400300, 400301, 400302, 400310];
927
- function ks(e) {
928
- return Is.some((t) => e.code === t);
926
+ const ks = [400300, 400301, 400302, 400310];
927
+ function Is(e) {
928
+ return ks.some((t) => e.code === t);
929
929
  }
930
930
  class $s {
931
931
  constructor({ userId: t, authToken: n, sessionHandler: o }) {
@@ -980,7 +980,7 @@ function Ls({
980
980
  E.debug("useAuthentication.authenticate: start");
981
981
  const C = g != null && g.userId ? y.messenger.getSettings(g.userId) : null;
982
982
  C != null && C.bot && (t(C), E.debug("useAuthentication.authenticate: cached messenger settings", C));
983
- const A = await v({
983
+ const w = await v({
984
984
  aiAgentId: c,
985
985
  userId: g == null ? void 0 : g.userId,
986
986
  language: d,
@@ -989,13 +989,13 @@ function Ls({
989
989
  forceCreateChannel: l,
990
990
  knownActiveChannelUrl: (B = C == null ? void 0 : C.active_channel) == null ? void 0 : B.channel_url
991
991
  });
992
- E.debug("useAuthentication.authenticate: messenger settings response", A);
992
+ E.debug("useAuthentication.authenticate: messenger settings response", w);
993
993
  let $ = null;
994
- if (A.auto_created_user)
994
+ if (w.auto_created_user)
995
995
  if (f === "manual")
996
996
  E.warn("Received auto created user info but current session is manual. Ignoring auto created user info."), $ = { userId: g.userId, authToken: g.authToken };
997
997
  else {
998
- const { user_id: Q, session_token: ee, expire_at: le } = A.auto_created_user;
998
+ const { user_id: Q, session_token: ee, expire_at: le } = w.auto_created_user;
999
999
  y.messenger.setAnonUser({ userId: Q, authToken: ee, expireAt: le }), $ = { userId: Q, authToken: ee };
1000
1000
  }
1001
1001
  else
@@ -1003,13 +1003,13 @@ function Ls({
1003
1003
  userId: (g == null ? void 0 : g.userId) ?? "",
1004
1004
  authToken: (g == null ? void 0 : g.authToken) ?? ""
1005
1005
  };
1006
- y.messenger.setSettings($.userId, A), t(A);
1006
+ y.messenger.setSettings($.userId, w), t(w);
1007
1007
  try {
1008
- await n(A, $), await x($, g == null ? void 0 : g.sessionHandler, i), await o(A, $);
1008
+ await n(w, $), await x($, g == null ? void 0 : g.sessionHandler, i), await o(w, $);
1009
1009
  } catch (Q) {
1010
1010
  throw Q instanceof Error && (s(Q), E.error("useAuthentication.authenticate: failed to connect", Q)), Q;
1011
1011
  }
1012
- return A;
1012
+ return w;
1013
1013
  }, [
1014
1014
  v,
1015
1015
  x,
@@ -1056,7 +1056,7 @@ function Rs(e) {
1056
1056
  }
1057
1057
  return n(e), t;
1058
1058
  }
1059
- function Wt({
1059
+ function jt({
1060
1060
  template: e,
1061
1061
  variables: t,
1062
1062
  variableKeyPattern: n,
@@ -1107,18 +1107,18 @@ const Bs = () => {
1107
1107
  };
1108
1108
  }, {
1109
1109
  Provider: Fs,
1110
- useContext: jt
1111
- } = J("AIAgentMessengerSession"), Ps = We(
1110
+ useContext: ft
1111
+ } = J("AIAgentMessengerSession"), Ps = Ge(
1112
1112
  function({ userSessionInfo: e, forceCreateChannel: t, children: n }, o) {
1113
1113
  const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: m, logger: p } = q(), { updateTheme: E } = Gt(), [y, x] = T(void 0), [b, f] = T(
1114
1114
  void 0
1115
- ), [g, v] = T(null), [_, M] = T(null), [C, A] = T(null), [$, B] = T(null), { updateBaseAttachmentRules: Q, createAttachmentRules: ee } = Ts(), { shouldSyncCachedTemplate: le, syncCachedTemplates: Ee } = Bs(), xe = ur(), { authenticate: ke, deauthenticate: j } = Ls({
1115
+ ), [g, v] = T(null), [_, M] = T(null), [C, w] = T(null), [$, B] = T(null), { updateBaseAttachmentRules: Q, createAttachmentRules: ee } = Ts(), { shouldSyncCachedTemplate: le, syncCachedTemplates: xe } = Bs(), ve = ur(), { authenticate: Ie, deauthenticate: j } = Ls({
1116
1116
  userSessionInfo: e,
1117
1117
  forceCreateChannel: t,
1118
1118
  onUpdateMessengerSettings: O(
1119
1119
  (P) => {
1120
- const { appearance: S, bot: R, launcher: W } = P;
1121
- E(S.selected_theme, S), A({
1120
+ const { appearance: S, bot: R, launcher: G } = P;
1121
+ E(S.selected_theme, S), w({
1122
1122
  userId: R.bot_userid,
1123
1123
  profileUrl: R.bot_profile_url,
1124
1124
  nickname: R.bot_nickname,
@@ -1130,8 +1130,8 @@ const Bs = () => {
1130
1130
  isUserFeedbackEnabled: P.bot.is_user_feedback_enabled ?? !1,
1131
1131
  isUserFeedbackCommentOptionEnabled: P.bot.is_user_feedback_comment_option_enabled ?? !1
1132
1132
  }), B({
1133
- type: W.image_type || "default_icon",
1134
- imageUrl: W.image_url
1133
+ type: G.image_type || "default_icon",
1134
+ imageUrl: G.image_url
1135
1135
  }), Q(P);
1136
1136
  },
1137
1137
  [E]
@@ -1141,9 +1141,9 @@ const Bs = () => {
1141
1141
  }, []),
1142
1142
  onPostAuth: O(
1143
1143
  async (P) => {
1144
- v(a.currentUser), le() && await Ee(), f({ url: P.active_channel.channel_url, status: X.OPEN });
1144
+ v(a.currentUser), le() && await xe(), f({ url: P.active_channel.channel_url, status: X.OPEN });
1145
1145
  },
1146
- [a, le, Ee]
1146
+ [a, le, xe]
1147
1147
  ),
1148
1148
  onErrorAuth: O((P) => {
1149
1149
  x(P);
@@ -1152,13 +1152,13 @@ const Bs = () => {
1152
1152
  M((S) => S ? { ...S, authToken: P } : null);
1153
1153
  }, []),
1154
1154
  onPostDeauth: O(() => {
1155
- m.template.clear(), m.messenger.clear(_ == null ? void 0 : _.userId), v(null), f(void 0), M(null), A(null), B(null);
1155
+ m.template.clear(), m.messenger.clear(_ == null ? void 0 : _.userId), v(null), f(void 0), M(null), w(null), B(null);
1156
1156
  }, [m.template.clear, m.messenger.clear, _])
1157
- }), w = O(async () => {
1157
+ }), A = O(async () => {
1158
1158
  var P;
1159
1159
  if (_) {
1160
1160
  p.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"), f(void 0);
1161
- const S = await xe({
1161
+ const S = await ve({
1162
1162
  aiAgentId: i,
1163
1163
  userId: _.userId,
1164
1164
  language: l,
@@ -1174,7 +1174,7 @@ const Bs = () => {
1174
1174
  } else
1175
1175
  throw p.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"), new Error("userSession is not ready");
1176
1176
  }, [
1177
- xe,
1177
+ ve,
1178
1178
  s,
1179
1179
  i,
1180
1180
  _ == null ? void 0 : _.userId,
@@ -1188,14 +1188,14 @@ const Bs = () => {
1188
1188
  async (P) => {
1189
1189
  if (!(_ != null && _.userId))
1190
1190
  throw new Error("Current user is not authenticated. Please authenticate first.");
1191
- const S = await xe({
1191
+ const S = await ve({
1192
1192
  ...P,
1193
1193
  userId: _.userId,
1194
1194
  knownActiveChannelUrl: void 0
1195
1195
  }), R = S.active_channel.channel_url;
1196
1196
  return m.messenger.setSettings(_.userId, S), R;
1197
1197
  },
1198
- [_ == null ? void 0 : _.userId, xe]
1198
+ [_ == null ? void 0 : _.userId, ve]
1199
1199
  );
1200
1200
  return ht(a, {
1201
1201
  onChannelChanged: (P) => {
@@ -1210,22 +1210,22 @@ const Bs = () => {
1210
1210
  return {
1211
1211
  activeChannel: b,
1212
1212
  chatSDK: a,
1213
- authenticate: ke,
1213
+ authenticate: Ie,
1214
1214
  deauthenticate: j,
1215
1215
  updateContext: async (S) => {
1216
- const W = await (await P()).updateContext(i, S);
1217
- return { ...W, context: W.context ?? {} };
1216
+ const G = await (await P()).updateContext(i, S);
1217
+ return { ...G, context: G.context ?? {} };
1218
1218
  },
1219
1219
  patchContext: async (S) => {
1220
- const W = await (await P()).patchContext(i, S);
1221
- return { ...W, context: W.context ?? {} };
1220
+ const G = await (await P()).patchContext(i, S);
1221
+ return { ...G, context: G.context ?? {} };
1222
1222
  },
1223
1223
  getContextObject: async () => {
1224
1224
  const R = await (await P()).getContextObject(i);
1225
1225
  return { ...R, context: R.context ?? {} };
1226
1226
  }
1227
1227
  };
1228
- }, [ke, j, b, a, i, p]), /* @__PURE__ */ r.createElement(
1228
+ }, [Ie, j, b, a, i, p]), /* @__PURE__ */ r.createElement(
1229
1229
  Fs,
1230
1230
  {
1231
1231
  value: {
@@ -1234,12 +1234,12 @@ const Bs = () => {
1234
1234
  userSession: _,
1235
1235
  activeChannel: b,
1236
1236
  setActiveChannel: f,
1237
- refreshActiveChannel: w,
1237
+ refreshActiveChannel: A,
1238
1238
  createConversation: ce,
1239
1239
  connectionError: y,
1240
1240
  aiAgentInfo: C,
1241
1241
  launcherInfo: $,
1242
- authenticate: ke,
1242
+ authenticate: Ie,
1243
1243
  deauthenticate: j,
1244
1244
  createAttachmentRules: ee
1245
1245
  }
@@ -1258,7 +1258,7 @@ const Bs = () => {
1258
1258
  }
1259
1259
  }), n;
1260
1260
  }, Us = ({ channel: e, messages: t }) => {
1261
- const { aiAgentInfo: n, userSession: o } = jt(), s = Hs(), i = Vs({
1261
+ const { aiAgentInfo: n, userSession: o } = ft(), s = Hs(), i = Vs({
1262
1262
  channel: e,
1263
1263
  lastMessage: bn(t, [Fe.SUCCEEDED]),
1264
1264
  aiAgentUserId: (n == null ? void 0 : n.userId) ?? ""
@@ -1270,14 +1270,14 @@ const Bs = () => {
1270
1270
  });
1271
1271
  if (!e || !s)
1272
1272
  return { disabled: !0, disabledBy: "unavailable" };
1273
- if (Se(e))
1273
+ if (Te(e))
1274
1274
  return { disabled: !0, disabledBy: "conversation_closed" };
1275
1275
  if (zs(e))
1276
1276
  return { disabled: !0, disabledBy: "form_active" };
1277
- const l = Gs(e);
1277
+ const l = Ws(e);
1278
1278
  return l ? { disabled: !0, disabledBy: l } : i || a ? { disabled: !0, disabledBy: "ai_responding" } : { disabled: !1, disabledBy: "" };
1279
1279
  }, Hs = () => {
1280
- const e = Ht(), { chatSDK: t } = q(), [n, o] = T(!0);
1280
+ const e = Vt(), { chatSDK: t } = q(), [n, o] = T(!0);
1281
1281
  return U(() => {
1282
1282
  const s = new mt({
1283
1283
  onDisconnected: () => o(!1),
@@ -1296,7 +1296,7 @@ const Bs = () => {
1296
1296
  const [o, s] = T(!1), i = gr(e);
1297
1297
  return U(() => {
1298
1298
  if (!t) return;
1299
- const a = i.some((c) => c.userId === n), l = He(t, n) && Ae.isStreaming(t);
1299
+ const a = i.some((c) => c.userId === n), l = He(t, n) && be.isStreaming(t);
1300
1300
  s(!!(l || a));
1301
1301
  }, [i, t, n]), o;
1302
1302
  }, zs = (e) => {
@@ -1305,10 +1305,10 @@ const Bs = () => {
1305
1305
  if (!t || !e) return !1;
1306
1306
  const n = t.extendedMessagePayload, o = n == null ? void 0 : n.form, s = o && !o.submitted_at && !o.canceled_at, i = e.isAIAgent && !!((a = e.conversation) != null && a.handedOverAt);
1307
1307
  return s && !i;
1308
- }, Gs = (e) => {
1308
+ }, Ws = (e) => {
1309
1309
  const t = e == null ? void 0 : e.lastMessage, n = t == null ? void 0 : t.extendedMessagePayload;
1310
1310
  return n == null ? void 0 : n.user_input_disabled_by;
1311
- }, Ws = 3e4, js = ({
1311
+ }, Gs = 3e4, js = ({
1312
1312
  shouldApply: e,
1313
1313
  lastMessage: t,
1314
1314
  isDisabledWhileAIResponding: n,
@@ -1322,7 +1322,7 @@ const Bs = () => {
1322
1322
  a.current && clearTimeout(a.current), i(!0), a.current = setTimeout(() => {
1323
1323
  i(!1), a.current = null;
1324
1324
  }, E);
1325
- }, m = Date.now() - l, p = Ws - m;
1325
+ }, m = Date.now() - l, p = Gs - m;
1326
1326
  return n || p <= 0 ? c() : d(p), () => {
1327
1327
  a.current && clearTimeout(a.current);
1328
1328
  };
@@ -1338,7 +1338,7 @@ function Ks({
1338
1338
  onMessagesUpdated: s,
1339
1339
  onConversationClosedViaDispatcher: i,
1340
1340
  onBeforeSendMessage: a,
1341
- onAfterSendMessage: l = Te,
1341
+ onAfterSendMessage: l = Ae,
1342
1342
  shouldMarkAsRead: c = !0,
1343
1343
  sortComparator: d
1344
1344
  }) {
@@ -1355,12 +1355,12 @@ function Ks({
1355
1355
  U(() => {
1356
1356
  m();
1357
1357
  }, [c]), U(() => {
1358
- const C = async (A) => {
1359
- const $ = typeof (A == null ? void 0 : A.channelUrl) == "string";
1360
- x && $ && A.channelUrl !== x.url || (E.debug("conversation.dispatcher: try to close conversation", x), x != null && x.conversation && x.conversation.status === X.OPEN && (await x.closeConversation(), i == null || i()));
1358
+ const C = async (w) => {
1359
+ const $ = typeof (w == null ? void 0 : w.channelUrl) == "string";
1360
+ x && $ && w.channelUrl !== x.url || (E.debug("conversation.dispatcher: try to close conversation", x), x != null && x.conversation && x.conversation.status === X.OPEN && (await x.closeConversation(), i == null || i()));
1361
1361
  };
1362
- return y.subscribe($t.ConversationClose, C), () => {
1363
- y.unsubscribe($t.ConversationClose, C);
1362
+ return y.subscribe(Mt.ConversationClose, C), () => {
1363
+ y.unsubscribe(Mt.ConversationClose, C);
1364
1364
  };
1365
1365
  }, [y, (M = x == null ? void 0 : x.conversation) == null ? void 0 : M.status, i]);
1366
1366
  const _ = {
@@ -1370,7 +1370,7 @@ function Ks({
1370
1370
  error: b,
1371
1371
  refetch: () => f(),
1372
1372
  closeConversation: async () => {
1373
- Se(x) || await (x == null ? void 0 : x.closeConversation());
1373
+ Te(x) || await (x == null ? void 0 : x.closeConversation());
1374
1374
  }
1375
1375
  },
1376
1376
  messageSource: {
@@ -1385,16 +1385,16 @@ function Ks({
1385
1385
  if ((($ = x == null ? void 0 : x.conversation) == null ? void 0 : $.status) === X.CLOSED)
1386
1386
  throw new Error("Conversation is closed");
1387
1387
  a && (C = await a(C));
1388
- const A = await g.sendUserMessage(C, l);
1389
- return l == null || l(A), A;
1388
+ const w = await g.sendUserMessage(C, l);
1389
+ return l == null || l(w), w;
1390
1390
  },
1391
1391
  sendFileMessage: async (C) => {
1392
1392
  var $;
1393
1393
  if ((($ = x == null ? void 0 : x.conversation) == null ? void 0 : $.status) === X.CLOSED)
1394
1394
  throw new Error("Conversation is closed");
1395
1395
  a && (C = await a(C));
1396
- const A = await g.sendFileMessage(C, l);
1397
- return l == null || l(A), A;
1396
+ const w = await g.sendFileMessage(C, l);
1397
+ return l == null || l(w), w;
1398
1398
  }
1399
1399
  },
1400
1400
  state: {
@@ -1404,27 +1404,31 @@ function Ks({
1404
1404
  return /* @__PURE__ */ r.createElement(qs, { value: _ }, e);
1405
1405
  }
1406
1406
  function Zs(e) {
1407
- const { chatSDK: t, logger: n } = q(), [o, s] = T(void 0), [i, a] = T(void 0);
1408
- async function l() {
1409
- if (n.debug("conversation.fetchChannel: start"), s(void 0), a(void 0), e)
1407
+ const { chatSDK: t, logger: n } = q(), { sdkUser: o } = ft(), [s, i] = T(void 0), [a, l] = T(void 0);
1408
+ async function c() {
1409
+ if (!o) {
1410
+ n.debug("conversation.fetchChannel: no sdk user, skip fetching channel");
1411
+ return;
1412
+ }
1413
+ if (n.debug("conversation.fetchChannel: start"), i(void 0), l(void 0), e)
1410
1414
  try {
1411
1415
  n.debug("conversation.fetchChannel: get channel", e);
1412
- const c = await t.groupChannel.getChannel(e);
1413
- s(c), n.debug("conversation.fetchChannel: fetched channel", c);
1414
- } catch (c) {
1415
- c instanceof po && a(c), n.error("conversation.fetchChannel: error", c);
1416
+ const d = await t.groupChannel.getChannel(e);
1417
+ i(d), n.debug("conversation.fetchChannel: fetched channel", d);
1418
+ } catch (d) {
1419
+ d instanceof po && l(d), n.error("conversation.fetchChannel: error", d);
1416
1420
  }
1417
1421
  }
1418
- return Ys(o), U(() => {
1419
- l();
1420
- }, [t, e]), {
1421
- channel: o,
1422
- channelFetchError: i,
1423
- fetchChannel: l
1422
+ return Ys(s), U(() => {
1423
+ c();
1424
+ }, [t, o, e]), {
1425
+ channel: s,
1426
+ channelFetchError: a,
1427
+ fetchChannel: c
1424
1428
  };
1425
1429
  }
1426
1430
  function Ys(e) {
1427
- const { chatSDK: t } = q(), { activeChannel: n, setActiveChannel: o } = jt(), s = Ht();
1431
+ const { chatSDK: t } = q(), { activeChannel: n, setActiveChannel: o } = ft(), s = Vt();
1428
1432
  U(() => {
1429
1433
  if (!e || !n) return;
1430
1434
  const i = new mt({
@@ -1537,7 +1541,7 @@ class Xs {
1537
1541
  }
1538
1542
  const d = o.get(c.url);
1539
1543
  if (d === void 0) continue;
1540
- const m = Lt(this._pinnedChannels, c);
1544
+ const m = Dt(this._pinnedChannels, c);
1541
1545
  m >= 0 ? (this._pinnedChannels.splice(m, 1), i.push(c)) : s.push(c);
1542
1546
  const E = this._pinnedChannels.findIndex((x) => (o.get(x.url) ?? 1 / 0) > d), y = E === -1 ? this._pinnedChannels.length : E;
1543
1547
  this._pinnedChannels.splice(y, 0, c);
@@ -1557,7 +1561,7 @@ class Xs {
1557
1561
  o.push(a.url);
1558
1562
  continue;
1559
1563
  }
1560
- const l = Lt(this._channels, a), c = l < 0;
1564
+ const l = Dt(this._channels, a), c = l < 0;
1561
1565
  !c && this._channels.splice(l, 1);
1562
1566
  const m = Js(this._channels, a, this._order).place, p = m === this._channels.length;
1563
1567
  c ? p ? (n || !this.hasMore) && (this._channels.push(a), s.push(a)) : (this._channels.splice(m, 0, a), s.push(a)) : (this._channels.splice(m, 0, a), i.push(a));
@@ -1636,9 +1640,9 @@ class Xs {
1636
1640
  this._isDisposed || (this._isDisposed = !0, this._collectionEventHandler = void 0, this._sdk.removeConnectionHandler(this._handlerId), this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId), this._pinnedChannels.length = 0, this._channels.length = 0);
1637
1641
  }
1638
1642
  }
1639
- const Lt = (e, t) => e.findIndex((n) => n.isIdentical(t)), Js = (e, t, n) => {
1643
+ const Dt = (e, t) => e.findIndex((n) => n.isIdentical(t)), Js = (e, t, n) => {
1640
1644
  if (e.length > 0) {
1641
- const o = Lt(e, t);
1645
+ const o = Dt(e, t);
1642
1646
  let s = 0, i = e.length - 1, a = Math.floor((s + i) / 2);
1643
1647
  for (; s < i; ) {
1644
1648
  const c = Sn(e[a], t, n);
@@ -1664,8 +1668,8 @@ const Lt = (e, t) => e.findIndex((n) => n.isIdentical(t)), Js = (e, t, n) => {
1664
1668
  }
1665
1669
  };
1666
1670
  function Qs(e, t) {
1667
- var x, b, f, g, v, _, M, C, A, $;
1668
- const n = Ht(), [o, s] = T(!1), [i, a] = T(null), [l, c] = T([]), [d, m] = T(null), p = H(!1), E = O(async () => {
1671
+ var x, b, f, g, v, _, M, C, w, $;
1672
+ const n = Vt(), [o, s] = T(!1), [i, a] = T(null), [l, c] = T([]), [d, m] = T(null), p = H(!1), E = O(async () => {
1669
1673
  if (!p.current && e.currentUser) {
1670
1674
  p.current = !0, s(!1), a(null), c([]);
1671
1675
  try {
@@ -1696,7 +1700,7 @@ function Qs(e, t) {
1696
1700
  (v = (g = t.filter) == null ? void 0 : g.aiAgentIds) == null ? void 0 : v.join(),
1697
1701
  (_ = t.filter) == null ? void 0 : _.deskChannelFilter,
1698
1702
  (C = (M = t.filter) == null ? void 0 : M.pinnedChannelUrls) == null ? void 0 : C.join(),
1699
- (A = t.filter) == null ? void 0 : A.copilotConversationOnly,
1703
+ (w = t.filter) == null ? void 0 : w.copilotConversationOnly,
1700
1704
  ($ = t.filter) == null ? void 0 : $.copilotSupportChannelUrl,
1701
1705
  t.limit
1702
1706
  ]), y = O(async () => {
@@ -1808,27 +1812,27 @@ function oi({ children: e, internalVariables: t }) {
1808
1812
  };
1809
1813
  return /* @__PURE__ */ r.createElement(ri, { value: c }, e);
1810
1814
  }
1811
- const ft = {
1815
+ const bt = {
1812
1816
  VARIABLE: (e) => new RegExp(`\\{${e}\\}`, "g"),
1813
1817
  VIEW_VARIABLE: (e) => new RegExp(`"{@${e}}"`, "g")
1814
1818
  };
1815
1819
  function we({ uiTemplateString: e, variables: t = {} }) {
1816
1820
  const n = Rs(t);
1817
- return Wt({
1821
+ return jt({
1818
1822
  template: e,
1819
1823
  variables: n,
1820
- variableKeyPattern: (o) => ft.VARIABLE(o)
1824
+ variableKeyPattern: (o) => bt.VARIABLE(o)
1821
1825
  });
1822
1826
  }
1823
- function Ie({
1827
+ function ke({
1824
1828
  theme: e,
1825
1829
  uiTemplateString: t,
1826
1830
  colorVariables: n = {}
1827
1831
  }) {
1828
- return Wt({
1832
+ return jt({
1829
1833
  template: t,
1830
1834
  variables: n,
1831
- variableKeyPattern: (o) => ft.VARIABLE(o),
1835
+ variableKeyPattern: (o) => bt.VARIABLE(o),
1832
1836
  variableValueTransformer: (o) => Ds(e, o)
1833
1837
  });
1834
1838
  }
@@ -1841,10 +1845,10 @@ function si({
1841
1845
  onRequestTemplate: i
1842
1846
  }) {
1843
1847
  const l = Object.values(n).flat().map((d) => d.key);
1844
- return [...new Set(l)].some((d) => !i(d)) ? null : Wt({
1848
+ return [...new Set(l)].some((d) => !i(d)) ? null : jt({
1845
1849
  template: t,
1846
1850
  variables: n,
1847
- variableKeyPattern: (d) => ft.VIEW_VARIABLE(d),
1851
+ variableKeyPattern: (d) => bt.VIEW_VARIABLE(d),
1848
1852
  variableValueTransformer: (d) => {
1849
1853
  const m = d.map(({ key: p, variables: E }) => {
1850
1854
  const y = i(p), { ui_template: x, color_variables: b } = Ze(y);
@@ -1852,11 +1856,11 @@ function si({
1852
1856
  return f = we({
1853
1857
  uiTemplateString: f,
1854
1858
  variables: s
1855
- }), f = Ie({
1859
+ }), f = ke({
1856
1860
  theme: e,
1857
1861
  uiTemplateString: f,
1858
1862
  colorVariables: b
1859
- }), f = Ie({
1863
+ }), f = ke({
1860
1864
  theme: e,
1861
1865
  uiTemplateString: f,
1862
1866
  colorVariables: o
@@ -1880,7 +1884,7 @@ async function ii({
1880
1884
  return Ns({
1881
1885
  template: t,
1882
1886
  variables: n,
1883
- variableKeyPattern: (a) => ft.VIEW_VARIABLE(a),
1887
+ variableKeyPattern: (a) => bt.VIEW_VARIABLE(a),
1884
1888
  variableValueTransformer: async (a) => {
1885
1889
  const l = a.map(async ({ key: d, variables: m }) => {
1886
1890
  const p = await i(d), { ui_template: E, color_variables: y } = Ze(p);
@@ -1888,11 +1892,11 @@ async function ii({
1888
1892
  return x = we({
1889
1893
  uiTemplateString: x,
1890
1894
  variables: s
1891
- }), x = Ie({
1895
+ }), x = ke({
1892
1896
  theme: e,
1893
1897
  uiTemplateString: x,
1894
1898
  colorVariables: y
1895
- }), x = Ie({
1899
+ }), x = ke({
1896
1900
  theme: e,
1897
1901
  uiTemplateString: x,
1898
1902
  colorVariables: o
@@ -1923,7 +1927,7 @@ const ai = ({
1923
1927
  if (c === null) return null;
1924
1928
  a = c;
1925
1929
  }
1926
- return a = we({ ...o, uiTemplateString: a, variables: n }), a = Ie({ ...o, uiTemplateString: a, colorVariables: i }), a = Ie({ ...o, uiTemplateString: a, colorVariables: t }), a = we({ ...o, uiTemplateString: a }), pt(a);
1930
+ return a = we({ ...o, uiTemplateString: a, variables: n }), a = ke({ ...o, uiTemplateString: a, colorVariables: i }), a = ke({ ...o, uiTemplateString: a, colorVariables: t }), a = we({ ...o, uiTemplateString: a }), pt(a);
1927
1931
  }, li = async ({
1928
1932
  rawTemplate: e,
1929
1933
  aiAgentColorVariables: t,
@@ -1937,7 +1941,7 @@ const ai = ({
1937
1941
  uiTemplateString: a,
1938
1942
  aiAgentColorVariables: t,
1939
1943
  internalVariables: n
1940
- })), a = we({ ...o, uiTemplateString: a, variables: n }), a = Ie({ ...o, uiTemplateString: a, colorVariables: i }), a = Ie({ ...o, uiTemplateString: a, colorVariables: t }), a = we({ ...o, uiTemplateString: a }), pt(a);
1944
+ })), a = we({ ...o, uiTemplateString: a, variables: n }), a = ke({ ...o, uiTemplateString: a, colorVariables: i }), a = ke({ ...o, uiTemplateString: a, colorVariables: t }), a = we({ ...o, uiTemplateString: a }), pt(a);
1941
1945
  }, ci = (e) => {
1942
1946
  const { aiAgentColorVariables: t = {} } = e, { internalVariables: n } = hr();
1943
1947
  return T(() => {
@@ -1965,7 +1969,7 @@ const ai = ({
1965
1969
  }).value;
1966
1970
  }, ui = "remove_powered_by", qt = (e, t) => {
1967
1971
  var s, i;
1968
- const { chatSDK: n } = q(), { aiAgentInfo: o } = jt();
1972
+ const { chatSDK: n } = q(), { aiAgentInfo: o } = ft();
1969
1973
  if (e === "handoff-button") {
1970
1974
  const a = !!((s = t == null ? void 0 : t.conversation) != null && s.handoff);
1971
1975
  return !!(t != null && t.isAIAgent) && !!(o != null && o.showHandoffButton) && a && It(t);
@@ -2250,7 +2254,7 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
2250
2254
  submitted: m === "submitted"
2251
2255
  }
2252
2256
  };
2253
- }, Ct = 5, Ci = (e) => e < 1e3 ? { speed: Ct * 0.5, chunkSize: 2 } : e < 2e3 ? { speed: Ct * 0.8, chunkSize: 2 } : { speed: Ct * 0.6, chunkSize: 3 }, Si = (e, t = !1) => {
2257
+ }, St = 5, Ci = (e) => e < 1e3 ? { speed: St * 0.5, chunkSize: 2 } : e < 2e3 ? { speed: St * 0.8, chunkSize: 2 } : { speed: St * 0.6, chunkSize: 3 }, Si = (e, t = !1) => {
2254
2258
  const [n, o] = T(0), s = H(null), i = H(0), a = H(0), l = H(t);
2255
2259
  return U(() => {
2256
2260
  if (!l.current) {
@@ -2316,8 +2320,20 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
2316
2320
  placeholder_no_messages: "No messages",
2317
2321
  placeholder_no_conversations: "No conversations yet",
2318
2322
  placeholder_something_went_wrong_retry_label: "Retry"
2323
+ },
2324
+ feedback: {
2325
+ title: "Submit feedback",
2326
+ good: "Good",
2327
+ bad: "Bad",
2328
+ comment_label: "Comment (optional)",
2329
+ comment_placeholder: "Leave a comment",
2330
+ cancel: "Cancel",
2331
+ submit: "Submit",
2332
+ save: "Save",
2333
+ edit: "Edit feedback",
2334
+ remove: "Remove feedback"
2319
2335
  }
2320
- }, Dt = {
2336
+ }, Rt = {
2321
2337
  language: "en",
2322
2338
  strings: Ai,
2323
2339
  dateLocale: So
@@ -2365,11 +2381,22 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
2365
2381
  FAILED_MESSAGE_RESEND: e.conversation.failed_message_resend,
2366
2382
  FAILED_MESSAGE_REMOVE: e.conversation.failed_message_remove,
2367
2383
  // File upload
2368
- FILE_UPLOAD_NO_SUPPORTED_FILES: e.conversation.file_upload_no_supported_files
2369
- }), Ii = (e) => {
2384
+ FILE_UPLOAD_NO_SUPPORTED_FILES: e.conversation.file_upload_no_supported_files,
2385
+ // Feedback
2386
+ FEEDBACK_TITLE: e.feedback.title,
2387
+ FEEDBACK_GOOD: e.feedback.good,
2388
+ FEEDBACK_BAD: e.feedback.bad,
2389
+ FEEDBACK_COMMENT_LABEL: e.feedback.comment_label,
2390
+ FEEDBACK_COMMENT_PLACEHOLDER: e.feedback.comment_placeholder,
2391
+ FEEDBACK_CANCEL: e.feedback.cancel,
2392
+ FEEDBACK_SUBMIT: e.feedback.submit,
2393
+ FEEDBACK_SAVE: e.feedback.save,
2394
+ FEEDBACK_EDIT: e.feedback.edit,
2395
+ FEEDBACK_REMOVE: e.feedback.remove
2396
+ }), ki = (e) => {
2370
2397
  var t;
2371
- return ((t = e.split("-")) == null ? void 0 : t[0]) ?? bt;
2372
- }, bt = "en", ki = /* @__PURE__ */ new Set([bt, "ko", "es", "pt", "fr", "hi", "it", "de", "tr", "ja"]), $i = (e, t, n) => {
2398
+ return ((t = e.split("-")) == null ? void 0 : t[0]) ?? Et;
2399
+ }, Et = "en", Ii = /* @__PURE__ */ new Set([Et, "ko", "es", "pt", "fr", "hi", "it", "de", "tr", "ja"]), $i = (e, t, n) => {
2373
2400
  const o = e[t];
2374
2401
  return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((s, i) => {
2375
2402
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -2381,7 +2408,7 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
2381
2408
  )
2382
2409
  );
2383
2410
  });
2384
- }, wn = wi(Dt.strings), Mi = {
2411
+ }, wn = wi(Rt.strings), Mi = {
2385
2412
  ...wn,
2386
2413
  // Channel
2387
2414
  CHANNEL_FROZEN: "Channel frozen",
@@ -2423,36 +2450,25 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
2423
2450
  FORM_VALIDATION_MIN_SELECT: (e) => `Select at least ${e} options`,
2424
2451
  FORM_VALIDATION_MAX_SELECT: (e) => `Select at most ${e} options`,
2425
2452
  FORM_VALIDATION_REGEX_FAILED: "Invalid format",
2426
- // Feedback
2427
- FEEDBACK_TITLE: "Submit feedback",
2428
- FEEDBACK_GOOD: "Good",
2429
- FEEDBACK_BAD: "Bad",
2430
- FEEDBACK_COMMENT_LABEL: "Comment (optional)",
2431
- FEEDBACK_COMMENT_PLACEHOLDER: "Leave a comment",
2432
- FEEDBACK_CANCEL: "Cancel",
2433
- FEEDBACK_SUBMIT: "Submit",
2434
- FEEDBACK_SAVE: "Save",
2435
- FEEDBACK_EDIT: "Edit feedback",
2436
- FEEDBACK_REMOVE: "Remove feedback",
2437
2453
  /** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/
2438
2454
  DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: wn.DATE_FORMAT__DATE_SHORT,
2439
2455
  /** @deprecated Unused string **/
2440
2456
  DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
2441
2457
  }, lt = {
2442
- language: Dt.language,
2443
- dateLocale: Dt.dateLocale,
2458
+ language: Rt.language,
2459
+ dateLocale: Rt.dateLocale,
2444
2460
  stringSet: Mi
2445
2461
  }, Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2446
2462
  __proto__: null,
2447
2463
  default: lt
2448
- }, Symbol.toStringTag, { value: "Module" })), Rt = /* @__PURE__ */ new Map([[bt, lt]]);
2464
+ }, Symbol.toStringTag, { value: "Module" })), Nt = /* @__PURE__ */ new Map([[Et, lt]]);
2449
2465
  async function Li(e) {
2450
- const t = Rt.get(e);
2466
+ const t = Nt.get(e);
2451
2467
  if (t) return t;
2452
2468
  try {
2453
- if (ki.has(e)) {
2454
- const { default: n } = await $i(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./BEAJr3rh.js"), "./languages/en.ts": () => Promise.resolve().then(() => Oi), "./languages/es.ts": () => import("./CQ0RwBWk.js"), "./languages/fr.ts": () => import("./zwa6qdDA.js"), "./languages/hi.ts": () => import("./B9G15Cky.js"), "./languages/it.ts": () => import("./CsPFZJ_9.js"), "./languages/ja.ts": () => import("./DFGf6Yhi.js"), "./languages/ko.ts": () => import("./mz33I9UA.js"), "./languages/pt.ts": () => import("./z2MSTxv_.js"), "./languages/tr.ts": () => import("./Co9gSKC2.js") }), `./languages/${e}.ts`, 3);
2455
- return Rt.set(e, n), n;
2469
+ if (Ii.has(e)) {
2470
+ const { default: n } = await $i(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DuyZf1Vo.js"), "./languages/en.ts": () => Promise.resolve().then(() => Oi), "./languages/es.ts": () => import("./DbVz_9m0.js"), "./languages/fr.ts": () => import("./BiYSaYUc.js"), "./languages/hi.ts": () => import("./DS-fbH3S.js"), "./languages/it.ts": () => import("./BqgL9sJP.js"), "./languages/ja.ts": () => import("./DXvyPOw8.js"), "./languages/ko.ts": () => import("./BNtwGyTL.js"), "./languages/pt.ts": () => import("./Nxjx0s3h.js"), "./languages/tr.ts": () => import("./BMhOEL86.js") }), `./languages/${e}.ts`, 3);
2471
+ return Nt.set(e, n), n;
2456
2472
  }
2457
2473
  return lt;
2458
2474
  } catch {
@@ -2468,9 +2484,9 @@ const {
2468
2484
  stringSet: n,
2469
2485
  children: o
2470
2486
  }) => {
2471
- const [s, i] = T(Rt.get(bt));
2487
+ const [s, i] = T(Nt.get(Et));
2472
2488
  return U(() => {
2473
- const a = Ii(e);
2489
+ const a = ki(e);
2474
2490
  s.language !== a && (t == null || t.debug("localization.useEffect: update language", { from: s.language, to: a }), Li(a).then(i));
2475
2491
  }, [e, t]), /* @__PURE__ */ r.createElement(
2476
2492
  Di,
@@ -2484,15 +2500,15 @@ const {
2484
2500
  },
2485
2501
  o
2486
2502
  );
2487
- }, ct = "data-sb-agent-theme", In = (e) => (t, ...n) => {
2503
+ }, ct = "data-sb-agent-theme", kn = (e) => (t, ...n) => {
2488
2504
  let o = "";
2489
2505
  return t.forEach((s, i) => {
2490
2506
  o += s + (n[i] ?? "");
2491
2507
  }), `[${ct}='${e}'] & { ${o} }`;
2492
2508
  }, N = {
2493
- light: In("light"),
2494
- dark: In("dark")
2495
- }, Ni = k(({ theme: e }) => {
2509
+ light: kn("light"),
2510
+ dark: kn("dark")
2511
+ }, Ni = I(({ theme: e }) => {
2496
2512
  const { palette: t } = e;
2497
2513
  return `
2498
2514
  :root,
@@ -2544,7 +2560,7 @@ const {
2544
2560
  --sendbird-overlay-light: ${t.overlay.light};
2545
2561
  }
2546
2562
  `;
2547
- }), Bi = k`[${ct}='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);}[${ct}='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);}`, u = {
2563
+ }), Bi = I`[${ct}='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);}[${ct}='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);}`, u = {
2548
2564
  color: {
2549
2565
  primary: {
2550
2566
  dark: "var(--sendbird-primary-dark)",
@@ -2606,7 +2622,7 @@ function Pi(e) {
2606
2622
  }
2607
2623
  function Ui({ rootElement: e = document.body, children: t }) {
2608
2624
  const { theme: n, updateTheme: o } = Gt();
2609
- return Ce(() => {
2625
+ return Se(() => {
2610
2626
  e.setAttribute(ct, n.selectedTheme);
2611
2627
  }, [e, n.selectedTheme]), /* @__PURE__ */ r.createElement(bo, { theme: n }, /* @__PURE__ */ r.createElement(Fi, { value: { theme: n, updateTheme: o, rootElement: e } }, t));
2612
2628
  }
@@ -2631,11 +2647,11 @@ const Hi = (e, t) => {
2631
2647
  a ? a.textContent !== e && (a.textContent = e) : (a = s.ownerDocument.createElement("style"), a.id = i, a.textContent = e, s.appendChild(a));
2632
2648
  }, [e, t]);
2633
2649
  }, Kt = /iPad|iPhone|iPod/.test(navigator.userAgent), zi = /Android/.test(navigator.userAgent), je = (e) => Kt || zi, {
2634
- Provider: Gi,
2650
+ Provider: Wi,
2635
2651
  Consumer: Er,
2636
2652
  useContext: K
2637
2653
  } = J("Messenger");
2638
- function Wi({
2654
+ function Gi({
2639
2655
  children: e,
2640
2656
  state: t,
2641
2657
  enableCloseConversationButton: n = !1,
@@ -2650,7 +2666,7 @@ function Wi({
2650
2666
  setExpanded: (t == null ? void 0 : t.setExpanded) ?? d
2651
2667
  };
2652
2668
  return /* @__PURE__ */ r.createElement(is, { ...i }, (p) => /* @__PURE__ */ r.createElement(
2653
- Gi,
2669
+ Wi,
2654
2670
  {
2655
2671
  value: {
2656
2672
  ...i,
@@ -2667,7 +2683,7 @@ function Wi({
2667
2683
  const {
2668
2684
  Provider: ji,
2669
2685
  useContext: te
2670
- } = J("MessengerSession"), qi = We(function({ children: e, ...t }, n) {
2686
+ } = J("MessengerSession"), qi = Ge(function({ children: e, ...t }, n) {
2671
2687
  return /* @__PURE__ */ r.createElement(Ps, { ref: n, ...t }, (o) => /* @__PURE__ */ r.createElement(Ki, { ...o }, e));
2672
2688
  }), Ki = ({ children: e, ...t }) => {
2673
2689
  const { chatSDK: n, logger: o, appId: s, aiAgentId: i, agentPreviewConfigs: a, state: l, handlers: c } = K(), { userSessionInfo: d, authenticate: m, setActiveChannel: p, userSession: E, aiAgentInfo: y, launcherInfo: x } = t, b = H(null);
@@ -2676,8 +2692,8 @@ const {
2676
2692
  var _, M, C;
2677
2693
  if (f.conversation && f.conversation.type === Ao.PROACTIVE && g.userId === ((_ = n.currentUser) == null ? void 0 : _.userId)) {
2678
2694
  o.info("messengerSession.onUserJoined: proactive channel joined", f.url);
2679
- const A = ((M = f.conversation) == null ? void 0 : M.status) ?? X.OPEN;
2680
- p({ url: f.url, status: A }), l.setOpened(!0), Zi({ sound: document.hidden || !l.opened }), (C = b.current) == null || C.call(b, { channel: f });
2695
+ const w = ((M = f.conversation) == null ? void 0 : M.status) ?? X.OPEN;
2696
+ p({ url: f.url, status: w }), l.setOpened(!0), Zi({ sound: document.hidden || !l.opened }), (C = b.current) == null || C.call(b, { channel: f });
2681
2697
  }
2682
2698
  }
2683
2699
  }), U(() => {
@@ -2712,7 +2728,7 @@ function Zi({ sound: e }) {
2712
2728
  const ae = (e) => {
2713
2729
  const t = e;
2714
2730
  return typeof t == "number" ? `${t}px` : t;
2715
- }, I = ({
2731
+ }, k = ({
2716
2732
  as: e,
2717
2733
  variant: t = "body1",
2718
2734
  color: n,
@@ -2729,16 +2745,16 @@ const ae = (e) => {
2729
2745
  $maxTextLines: o,
2730
2746
  ...i
2731
2747
  }
2732
- ), kn = /* @__PURE__ */ new WeakMap(), Yi = (e, t) => {
2733
- let n = kn.get(t);
2734
- n || (n = /* @__PURE__ */ new Map(), kn.set(t, n));
2748
+ ), In = /* @__PURE__ */ new WeakMap(), Yi = (e, t) => {
2749
+ let n = In.get(t);
2750
+ n || (n = /* @__PURE__ */ new Map(), In.set(t, n));
2735
2751
  const o = n.get(e);
2736
2752
  if (o) return o;
2737
- const s = t[e] ?? t.body1, i = k`font-size:${ae(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily ? `font-family: ${s.fontFamily};` : ""}
2753
+ const s = t[e] ?? t.body1, i = I`font-size:${ae(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily ? `font-family: ${s.fontFamily};` : ""}
2738
2754
  ${s.lineHeight ? `line-height: ${s.lineHeight};` : "line-height: 100%;"}
2739
2755
  `;
2740
2756
  return n.set(e, i), i;
2741
- }, Xi = (e) => e ? k`display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:${e};overflow:hidden;` : "", Ji = h.span`font-stretch:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => Yi(e, t.typography)}color:${({ $color: e }) => e};${({ $maxTextLines: e }) => Xi(e)}`;
2757
+ }, Xi = (e) => e ? I`display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:${e};overflow:hidden;` : "", Ji = h.span`font-stretch:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => Yi(e, t.typography)}color:${({ $color: e }) => e};${({ $maxTextLines: e }) => Xi(e)}`;
2742
2758
  class dt extends io {
2743
2759
  constructor(t) {
2744
2760
  super(t), this.state = {
@@ -2818,7 +2834,7 @@ const Qi = (e) => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3
2818
2834
  },
2819
2835
  /* @__PURE__ */ r.createElement(dt, { errorFallback: /* @__PURE__ */ r.createElement(la, null) }, /* @__PURE__ */ r.createElement(s, null))
2820
2836
  );
2821
- }, ia = k`[dir='rtl'] &{transform:scaleX(-1);}`, aa = h.div`width:${({ $size: e }) => ae(e)};height:${({ $size: e }) => ae(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 && ia};`, la = () => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64" }, /* @__PURE__ */ r.createElement("rect", { x: "8", y: "8", width: "48", height: "48", fill: "none", className: "stroke", rx: "4" }), /* @__PURE__ */ r.createElement("line", { x1: "20", y1: "20", x2: "44", y2: "44", className: "stroke" }), /* @__PURE__ */ r.createElement("line", { x1: "44", y1: "20", x2: "20", y2: "44", className: "stroke" }));
2837
+ }, ia = I`[dir='rtl'] &{transform:scaleX(-1);}`, aa = h.div`width:${({ $size: e }) => ae(e)};height:${({ $size: e }) => ae(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 && ia};`, la = () => /* @__PURE__ */ r.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64" }, /* @__PURE__ */ r.createElement("rect", { x: "8", y: "8", width: "48", height: "48", fill: "none", className: "stroke", rx: "4" }), /* @__PURE__ */ r.createElement("line", { x1: "20", y1: "20", x2: "44", y2: "44", className: "stroke" }), /* @__PURE__ */ r.createElement("line", { x1: "44", y1: "20", x2: "20", y2: "44", className: "stroke" }));
2822
2838
  function Zt({
2823
2839
  name: e,
2824
2840
  type: t = "FILE",
@@ -2827,15 +2843,15 @@ function Zt({
2827
2843
  onClick: s
2828
2844
  }) {
2829
2845
  const { colors: i } = gt();
2830
- return /* @__PURE__ */ r.createElement(ca, { onClick: s, $clickable: !!s }, /* @__PURE__ */ r.createElement(ua, { $bgColor: o ?? i.base.primary }, /* @__PURE__ */ r.createElement(D, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(ga, { variant: "button", color: u.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(I, { color: u.themedColor.textMidEmphasis, variant: "caption3" }, t)));
2846
+ return /* @__PURE__ */ r.createElement(ca, { onClick: s, $clickable: !!s }, /* @__PURE__ */ r.createElement(ua, { $bgColor: o ?? i.base.primary }, /* @__PURE__ */ r.createElement(D, { type: "file-document", size: 24, color: n ?? i.base.primaryContrastContent })), /* @__PURE__ */ r.createElement(ma, null, /* @__PURE__ */ r.createElement(ga, { variant: "button", color: u.themedColor.textHighEmphasis }, e), /* @__PURE__ */ r.createElement(k, { color: u.themedColor.textMidEmphasis, variant: "caption3" }, t)));
2831
2847
  }
2832
- const ca = h.div`border-radius:12px;gap:8px;width:${F.BODY_MAX_WIDTH}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${u.themedColor.textDisabled};background-color:${u.themedColor.bg_50_600};${({ $clickable: e }) => e && da}`, da = k`cursor:pointer;&:hover{background-color:${u.themedColor.bg_100_500};}`, ua = h.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, ma = h.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, ga = h(I)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
2848
+ const ca = h.div`border-radius:12px;gap:8px;width:${F.BODY_MAX_WIDTH}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${u.themedColor.textDisabled};background-color:${u.themedColor.bg_50_600};${({ $clickable: e }) => e && da}`, da = I`cursor:pointer;&:hover{background-color:${u.themedColor.bg_100_500};}`, ua = h.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({ $bgColor: e }) => e};`, ma = h.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`, ga = h(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;
2833
2849
  function ha({ file: e, children: t, onClickFile: n }) {
2834
2850
  return /* @__PURE__ */ r.createElement(pa, null, /* @__PURE__ */ r.createElement(
2835
2851
  Zt,
2836
2852
  {
2837
2853
  name: e.name,
2838
- type: Vt(e.name, e.type),
2854
+ type: zt(e.name, e.type),
2839
2855
  onClick: n && (() => n == null ? void 0 : n(e))
2840
2856
  }
2841
2857
  ), t);
@@ -2854,12 +2870,12 @@ const pa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
2854
2870
  }, xr = {
2855
2871
  DEFAULT_PRIMARY: "#742ddd",
2856
2872
  WHITE: "#ffffff"
2857
- }, vr = 36, fa = 100, Yt = "noopener noreferrer nofollow", be = `${oe}-incoming-msg`, ba = `${oe}-marked-text`;
2873
+ }, vr = 36, fa = 100, Yt = "noopener noreferrer nofollow", Ee = `${oe}-incoming-msg`, ba = `${oe}-marked-text`;
2858
2874
  function Ea({ file: e, onClickMedia: t, children: n }) {
2859
2875
  const o = () => e.type.startsWith("image") ? /* @__PURE__ */ r.createElement(ya, { src: e.url, alt: "image-message" }) : e.type.startsWith("video") ? /* @__PURE__ */ r.createElement(_a, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: e.url }), /* @__PURE__ */ r.createElement("track", { kind: "captions" })) : null;
2860
2876
  if (o) {
2861
2877
  const s = {
2862
- id: `${be}-media-body`,
2878
+ id: `${Ee}-media-body`,
2863
2879
  onClick: () => t == null ? void 0 : t(e)
2864
2880
  };
2865
2881
  return /* @__PURE__ */ r.createElement(xa, null, /* @__PURE__ */ r.createElement(va, { ...s }, o()), n);
@@ -2875,11 +2891,11 @@ const xa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
2875
2891
  `, ya = h.img`width:100%;height:100%;object-fit:cover;`, _a = h.video`width:100%;height:100%;object-fit:cover;`, Ca = "✱", yr = (e) => {
2876
2892
  const t = new RegExp(`(\`+)([^\`]+?)\\1|(${Ca}+)`, "g");
2877
2893
  return e.replace(t, (n, o, s, i) => o ? n : i ? `<span id=${ba} aria-label="masked-text">${i}</span>` : n);
2878
- }, Sa = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ta = L(async () => ({ default: (await import("./B2a3pL8a.js")).MarkdownText })), Aa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2894
+ }, Sa = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ta = L(async () => ({ default: (await import("./DINOaKB4.js")).MarkdownText })), Aa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2879
2895
  function $n(e) {
2880
2896
  var i, a;
2881
2897
  const t = e.maxBodyWidth ?? F.BODY_MAX_WIDTH, n = Si(e.message, e.isStreaming), o = ne(() => Yo(n, yr), [n]), s = {
2882
- id: `${be}-text-body`,
2898
+ id: `${Ee}-text-body`,
2883
2899
  $maxWidth: t,
2884
2900
  $color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
2885
2901
  $bgColor: (a = e.customStyle) == null ? void 0 : a.bubbleBackgroundColor
@@ -2889,14 +2905,14 @@ function $n(e) {
2889
2905
  return (m = e.onClickMedia) == null ? void 0 : m.call(e, { url: d, type: "image/*" });
2890
2906
  } }, l.value))) : l.type === "code" ? /* @__PURE__ */ r.createElement(dt, { key: c, fallback: /* @__PURE__ */ r.createElement(On, { variant: "body3" }, l.value) }, /* @__PURE__ */ r.createElement(Aa, { code: l.value, language: l.language })) : null), e.children);
2891
2907
  }
2892
- const Mn = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => k`
2908
+ const Mn = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
2893
2909
  color: ${t || e.colors.messageIncoming.text};
2894
2910
  background-color: ${n || e.colors.messageIncoming.background};
2895
2911
  `}
2896
2912
  padding: 12px 0;
2897
2913
  transition: max-width 0.3s;
2898
2914
  overflow-wrap: break-word;
2899
- `, On = h(I)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
2915
+ `, On = h(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
2900
2916
  function wa(e) {
2901
2917
  const { stringSet: t } = z(), n = ir(e) ? /* @__PURE__ */ r.createElement($n, { ...e }) : null;
2902
2918
  if (e.messageType === "user")
@@ -2908,21 +2924,21 @@ function wa(e) {
2908
2924
  return /* @__PURE__ */ r.createElement($n, { ...e, message: t.UNKNOWN__UNKNOWN_MESSAGE_TYPE });
2909
2925
  }
2910
2926
  function Xt({ id: e, src: t, size: n = 56, onClick: o, style: s }) {
2911
- return /* @__PURE__ */ r.createElement(Ia, { id: e, tabIndex: 0, onClick: o, $size: ae(n), style: s }, t ? /* @__PURE__ */ r.createElement(ka, { src: t }) : /* @__PURE__ */ r.createElement(D, { type: "user", size: n }));
2927
+ return /* @__PURE__ */ r.createElement(ka, { id: e, tabIndex: 0, onClick: o, $size: ae(n), style: s }, t ? /* @__PURE__ */ r.createElement(Ia, { src: t }) : /* @__PURE__ */ r.createElement(D, { type: "user", size: n }));
2912
2928
  }
2913
- const Ia = h.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${u.themedColor.bg_100_500};&:focus{outline:none;}`, ka = h.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
2929
+ const ka = h.div`border-radius:50%;display:inline-block;overflow:hidden;position:relative;flex-shrink:0;height:${(e) => e.$size};width:${(e) => e.$size};background-color:${u.themedColor.bg_100_500};&:focus{outline:none;}`, Ia = h.img`object-fit:cover;width:100%;height:100%;position:absolute;`;
2914
2930
  function $a({ sender: e, isBotMessage: t }) {
2915
- const n = `${be}-sender-avatar`;
2931
+ const n = `${Ee}-sender-avatar`;
2916
2932
  return t && !e.profileUrl ? /* @__PURE__ */ r.createElement(Ma, { id: n }, /* @__PURE__ */ r.createElement(D, { type: "bot-filled", size: "100%" })) : /* @__PURE__ */ r.createElement(Xt, { id: n, size: F.AVATAR_SIZE, src: e.profileUrl });
2917
2933
  }
2918
2934
  const Ma = h.div`flex-shrink:0;width:${F.AVATAR_SIZE}px;height:${F.AVATAR_SIZE}px;box-sizing:border-box;padding:4px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:${({ theme: e }) => e.colors.base.primary}!important;path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent}!important;}}`;
2919
2935
  function Oa({ sender: e }) {
2920
- return /* @__PURE__ */ r.createElement(La, { id: `${be}-sender-name`, variant: "caption1", color: u.themedColor.textMidEmphasis }, e.nickname);
2936
+ return /* @__PURE__ */ r.createElement(La, { id: `${Ee}-sender-name`, variant: "caption1", color: u.themedColor.textMidEmphasis }, e.nickname);
2921
2937
  }
2922
- const La = h(I)`text-align:start;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:5px;padding-inline:0 7px;`;
2938
+ const La = h(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;`;
2923
2939
  function Da({ createdAt: e }) {
2924
2940
  const { stringSet: t, format: n } = z();
2925
- return e ? /* @__PURE__ */ r.createElement(I, { id: `${be}-sent-time`, variant: "caption4", color: u.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
2941
+ return e ? /* @__PURE__ */ r.createElement(k, { id: `${Ee}-sent-time`, variant: "caption4", color: u.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
2926
2942
  }
2927
2943
  function Ra({ customStyle: e }) {
2928
2944
  return /* @__PURE__ */ r.createElement(Na, { $bgColor: e == null ? void 0 : e.bubbleBackgroundColor }, [0, 1, 2].map((t) => /* @__PURE__ */ r.createElement(Ba, { key: t, $color: e == null ? void 0 : e.bubbleContentColor })));
@@ -2937,18 +2953,18 @@ function Fa({
2937
2953
  onClickCTA: t = ({ url: n }) => Jt(n)
2938
2954
  }) {
2939
2955
  const n = e == null ? void 0 : e.cta_button;
2940
- return n ? /* @__PURE__ */ r.createElement(Pa, { id: `${be}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(Ua, { variant: "button" }, n.label)) : null;
2956
+ return n ? /* @__PURE__ */ r.createElement(Pa, { id: `${Ee}-ext-cta-button`, role: "button", onClick: () => t(n) }, /* @__PURE__ */ r.createElement(Ua, { variant: "button" }, n.label)) : null;
2941
2957
  }
2942
2958
  const Pa = h.div`display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:6px;padding:8px;color:${u.themedColor.textHighEmphasis};background-color:${u.color.background50};${N.dark`
2943
2959
  background-color: ${u.color.ondark.textDisabled};
2944
2960
  `}
2945
- `, Ua = h(I)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
2961
+ `, Ua = h(k)`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`;
2946
2962
  function Ha({
2947
2963
  extendedMessagePayload: e,
2948
2964
  onClickCitation: t = (n) => Jt(n.link)
2949
2965
  }) {
2950
2966
  const { stringSet: n } = z(), { theme: o } = Gt(), s = e == null ? void 0 : e.citations;
2951
- return !s || s.length === 0 ? null : /* @__PURE__ */ r.createElement(Va, { id: `${be}-ext-citation` }, /* @__PURE__ */ r.createElement(za, { variant: "caption1", color: o.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ r.createElement(Ga, null, s.map((i, a) => /* @__PURE__ */ r.createElement(
2967
+ return !s || s.length === 0 ? null : /* @__PURE__ */ r.createElement(Va, { id: `${Ee}-ext-citation` }, /* @__PURE__ */ r.createElement(za, { variant: "caption1", color: o.colors.messageIncoming.text }, n.CITATION_SOURCE_TITLE), /* @__PURE__ */ r.createElement(Wa, null, s.map((i, a) => /* @__PURE__ */ r.createElement(
2952
2968
  ja,
2953
2969
  {
2954
2970
  key: `${i.embedding_id}-${a}`,
@@ -2956,19 +2972,19 @@ function Ha({
2956
2972
  onClick: () => t(i)
2957
2973
  },
2958
2974
  /* @__PURE__ */ r.createElement(D, { type: "source", size: 16, color: o.colors.messageIncoming.text }),
2959
- /* @__PURE__ */ r.createElement(Wa, { variant: "body3", color: o.colors.messageIncoming.text }, i.title)
2975
+ /* @__PURE__ */ r.createElement(Ga, { variant: "body3", color: o.colors.messageIncoming.text }, i.title)
2960
2976
  ))));
2961
2977
  }
2962
- const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, za = h(I)`opacity:0.5;`, Ga = h.div`display:flex;flex-direction:column;gap:8px;`, Wa = h(I)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, ja = h.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`, Et = ({ style: e, rootElementId: t, visible: n, onClose: o, children: s }) => {
2978
+ const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;padding:8px 12px 6px;`, za = h(k)`opacity:0.5;`, Wa = h.div`display:flex;flex-direction:column;gap:8px;`, Ga = h(k)`text-decoration:underline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, ja = h.div`display:flex;align-items:center;gap:4px;cursor:pointer;&:hover{opacity:0.5;}`, xt = ({ style: e, rootElementId: t, visible: n, onClose: o, children: s }) => {
2963
2979
  if (!n) return null;
2964
2980
  const { rootElement: i } = br(), a = $e(i), l = $e(i, !0);
2965
2981
  return Oo(
2966
2982
  /* @__PURE__ */ r.createElement(qa, { onClick: o, style: e }, /* @__PURE__ */ r.createElement(Ka, { onClick: (c) => c.stopPropagation() }, s)),
2967
2983
  a.getElementById(t) ?? a.getElementById(se.MODAL_ROOT) ?? l.body
2968
2984
  );
2969
- }, qa = h.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${u.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${Oe.MODAL};`, Ka = h.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:${Oe.MODAL};`, Za = ({ visible: e, onClose: t, children: n }) => /* @__PURE__ */ r.createElement(Et, { rootElementId: se.WINDOW, visible: e, onClose: t }, /* @__PURE__ */ r.createElement(Ja, null, n)), Ya = ({ onClick: e, destructive: t, children: n }) => /* @__PURE__ */ r.createElement(Xa, { onClick: e, $destructive: t }, n), Pe = Object.assign(Za, {
2985
+ }, qa = h.div`position:fixed;top:0;left:0;width:100%;height:100%;background:${u.color.overlay.dark};display:flex;justify-content:center;align-items:center;z-index:${Oe.MODAL};`, Ka = h.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:${Oe.MODAL};`, Za = ({ visible: e, onClose: t, children: n }) => /* @__PURE__ */ r.createElement(xt, { rootElementId: se.WINDOW, visible: e, onClose: t }, /* @__PURE__ */ r.createElement(Ja, null, n)), Ya = ({ onClick: e, destructive: t, children: n }) => /* @__PURE__ */ r.createElement(Xa, { onClick: e, $destructive: t }, n), Pe = Object.assign(Za, {
2970
2986
  ActionItem: Ya
2971
- }), Xa = h.button`all:unset;width:100%;padding:14px 24px;text-align:start;cursor:pointer;color:${({ $destructive: e }) => e ? u.themedColor.error : u.themedColor.textHighEmphasis};`, Ja = h.div`position:absolute;left:0;right:0;bottom:0;border-radius:12px 12px 0 0;flex-direction:column;align-items:flex-end;margin:0 auto;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, Nt = (e) => `${e}-filled`, Qa = (e) => e === "good" ? pn.GOOD : pn.BAD, _r = k`&:hover{opacity:0.8;}&:active{opacity:0.6;}`, Ln = {
2987
+ }), Xa = h.button`all:unset;width:100%;padding:14px 24px;text-align:start;cursor:pointer;color:${({ $destructive: e }) => e ? u.themedColor.error : u.themedColor.textHighEmphasis};`, Ja = h.div`position:absolute;left:0;right:0;bottom:0;border-radius:12px 12px 0 0;flex-direction:column;align-items:flex-end;margin:0 auto;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, Bt = (e) => `${e}-filled`, Qa = (e) => e === "good" ? pn.GOOD : pn.BAD, _r = I`&:hover{opacity:0.8;}&:active{opacity:0.6;}`, Ln = {
2972
2988
  good: u.themedColor.secondary,
2973
2989
  bad: u.themedColor.error
2974
2990
  }, el = ({
@@ -2981,7 +2997,7 @@ const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
2981
2997
  isCommentEnabled: a = !1
2982
2998
  }) => {
2983
2999
  const { stringSet: l } = z(), [c, d] = T(o), [m, p] = T(s);
2984
- Ce(() => {
3000
+ Se(() => {
2985
3001
  e ? (d(o), p(s)) : (d(void 0), p(""));
2986
3002
  }, [e, o, s]);
2987
3003
  const E = () => {
@@ -2989,7 +3005,7 @@ const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
2989
3005
  }, y = () => {
2990
3006
  t();
2991
3007
  };
2992
- return e ? /* @__PURE__ */ r.createElement(Et, { rootElementId: se.WINDOW, visible: e, onClose: y }, /* @__PURE__ */ r.createElement(tl, null, /* @__PURE__ */ r.createElement(nl, null, /* @__PURE__ */ r.createElement(I, { variant: "h2", color: u.themedColor.textHighEmphasis }, l.FEEDBACK_TITLE)), /* @__PURE__ */ r.createElement(rl, null, /* @__PURE__ */ r.createElement(ol, null, ["good", "bad"].map((x) => {
3008
+ return e ? /* @__PURE__ */ r.createElement(xt, { rootElementId: se.WINDOW, visible: e, onClose: y }, /* @__PURE__ */ r.createElement(tl, null, /* @__PURE__ */ r.createElement(nl, null, /* @__PURE__ */ r.createElement(k, { variant: "h2", color: u.themedColor.textHighEmphasis }, l.FEEDBACK_TITLE)), /* @__PURE__ */ r.createElement(rl, null, /* @__PURE__ */ r.createElement(ol, null, ["good", "bad"].map((x) => {
2993
3009
  const b = c === x, f = x === "good" ? l.FEEDBACK_GOOD : l.FEEDBACK_BAD;
2994
3010
  return /* @__PURE__ */ r.createElement(
2995
3011
  sl,
@@ -3002,13 +3018,13 @@ const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
3002
3018
  /* @__PURE__ */ r.createElement(
3003
3019
  D,
3004
3020
  {
3005
- type: b ? Nt(x) : x,
3021
+ type: b ? Bt(x) : x,
3006
3022
  size: 24,
3007
3023
  color: b ? Ln[x] : u.themedColor.textLowEmphasis
3008
3024
  }
3009
3025
  ),
3010
3026
  /* @__PURE__ */ r.createElement(
3011
- I,
3027
+ k,
3012
3028
  {
3013
3029
  variant: "caption1",
3014
3030
  color: b ? Ln[x] : u.themedColor.textLowEmphasis
@@ -3016,7 +3032,7 @@ const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
3016
3032
  f
3017
3033
  )
3018
3034
  );
3019
- })), a && /* @__PURE__ */ r.createElement(il, null, /* @__PURE__ */ r.createElement(I, { variant: "caption3", color: u.themedColor.textHighEmphasis }, l.FEEDBACK_COMMENT_LABEL), /* @__PURE__ */ r.createElement(
3035
+ })), a && /* @__PURE__ */ r.createElement(il, null, /* @__PURE__ */ r.createElement(k, { variant: "caption3", color: u.themedColor.textHighEmphasis }, l.FEEDBACK_COMMENT_LABEL), /* @__PURE__ */ r.createElement(
3020
3036
  al,
3021
3037
  {
3022
3038
  placeholder: l.FEEDBACK_COMMENT_PLACEHOLDER,
@@ -3024,7 +3040,7 @@ const Va = h.div`display:flex;flex-direction:column;gap:8px;border-radius:8px;pa
3024
3040
  onChange: (x) => p(x.target.value),
3025
3041
  maxLength: 100
3026
3042
  }
3027
- ))), /* @__PURE__ */ r.createElement(ll, null, /* @__PURE__ */ r.createElement(cl, { onClick: y }, /* @__PURE__ */ r.createElement(I, { variant: "button", color: u.themedColor.textHighEmphasis }, l.FEEDBACK_CANCEL)), /* @__PURE__ */ r.createElement(dl, { onClick: E, disabled: !c }, /* @__PURE__ */ r.createElement(I, { variant: "button" }, n ? l.FEEDBACK_SAVE : l.FEEDBACK_SUBMIT))))) : null;
3043
+ ))), /* @__PURE__ */ r.createElement(ll, null, /* @__PURE__ */ r.createElement(cl, { onClick: y }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: u.themedColor.textHighEmphasis }, l.FEEDBACK_CANCEL)), /* @__PURE__ */ r.createElement(dl, { onClick: E, disabled: !c }, /* @__PURE__ */ r.createElement(k, { variant: "button" }, n ? l.FEEDBACK_SAVE : l.FEEDBACK_SUBMIT))))) : null;
3028
3044
  }, tl = h.div`width:280px;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};border-radius:12px;overflow:hidden;`, nl = h.div`padding:24px;`, rl = h.div`padding-inline:24px;display:flex;flex-direction:column;gap:24px;`, ol = h.div`display:flex;gap:4px;`, sl = h.button`width:114px;height:64px;border-radius:12px;border:1px solid ${u.themedColor.textDisabled};box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;gap:0;transition:background-color 0.2s;background-color:${({ $selected: e }) => e ? u.color.background100 : "transparent"};${({ $selected: e }) => N.dark`
3029
3045
  background-color: ${e ? u.color.background600 : "transparent"};
3030
3046
  `}
@@ -3057,10 +3073,10 @@ function ul({
3057
3073
  a == null || a(null), p(!1);
3058
3074
  }, C = () => {
3059
3075
  p(!1), y(f == null ? void 0 : f.rating), b((f == null ? void 0 : f.comment) ?? ""), d(!0);
3060
- }, A = ($) => {
3076
+ }, w = ($) => {
3061
3077
  a == null || a($);
3062
3078
  };
3063
- return t && g !== "none" ? /* @__PURE__ */ r.createElement(Rn, { $horizontal: !0 }, /* @__PURE__ */ r.createElement(ml, null, /* @__PURE__ */ r.createElement(D, { type: Nt(g), size: 12, color: Dn[g] })), (f == null ? void 0 : f.comment) && /* @__PURE__ */ r.createElement(Nn, { variant: "caption2", style: { lineHeight: "16px" } }, f.comment)) : /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Rn, null, /* @__PURE__ */ r.createElement(gl, null, ["good", "bad"].map(($) => {
3079
+ return t && g !== "none" ? /* @__PURE__ */ r.createElement(Rn, { $horizontal: !0 }, /* @__PURE__ */ r.createElement(ml, null, /* @__PURE__ */ r.createElement(D, { type: Bt(g), size: 12, color: Dn[g] })), (f == null ? void 0 : f.comment) && /* @__PURE__ */ r.createElement(Nn, { variant: "caption2", style: { lineHeight: "16px" } }, f.comment)) : /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Rn, null, /* @__PURE__ */ r.createElement(gl, null, ["good", "bad"].map(($) => {
3064
3080
  const B = g === $;
3065
3081
  return /* @__PURE__ */ r.createElement(
3066
3082
  hl,
@@ -3073,7 +3089,7 @@ function ul({
3073
3089
  /* @__PURE__ */ r.createElement(
3074
3090
  D,
3075
3091
  {
3076
- type: B ? Nt($) : $,
3092
+ type: B ? Bt($) : $,
3077
3093
  size: 14,
3078
3094
  color: B ? Dn[$] : u.themedColor.textMidEmphasis
3079
3095
  }
@@ -3087,7 +3103,7 @@ function ul({
3087
3103
  isEdit: g !== "none",
3088
3104
  initialRating: E,
3089
3105
  initialComment: x,
3090
- onSubmit: A,
3106
+ onSubmit: w,
3091
3107
  isCommentEnabled: s
3092
3108
  }
3093
3109
  ));
@@ -3098,15 +3114,15 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3098
3114
  `}
3099
3115
 
3100
3116
  ${_r}
3101
- `, Nn = h(I)`color:${u.themedColor.textMidEmphasis};${N.dark`
3117
+ `, Nn = h(k)`color:${u.themedColor.textMidEmphasis};${N.dark`
3102
3118
  color: ${u.themedColor.textHighEmphasis};
3103
3119
  `}
3104
3120
  `, Qt = ({ visible: e, title: t, description: n, confirmText: o = "OK", onConfirm: s, onClose: i }) => {
3105
3121
  const a = () => {
3106
3122
  s == null || s(), i();
3107
3123
  };
3108
- return /* @__PURE__ */ r.createElement(Et, { rootElementId: se.WINDOW, visible: e, onClose: i }, /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(fl, null, t && /* @__PURE__ */ r.createElement(I, { variant: "h1", color: u.themedColor.textHighEmphasis }, t), n && /* @__PURE__ */ r.createElement(bl, null, /* @__PURE__ */ r.createElement(I, { variant: "subtitle2", color: u.themedColor.textHighEmphasis }, n))), /* @__PURE__ */ r.createElement(El, null, /* @__PURE__ */ r.createElement(xl, { onClick: a }, /* @__PURE__ */ r.createElement(I, { variant: "button", color: u.themedColor.primary }, o)))));
3109
- }, pl = h.div`width:100%;height:auto;padding-block:24px 12px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, fl = h.div`margin-bottom:16px;`, bl = h.div`margin-top:8px;`, El = h.div`display:flex;flex-direction:row;justify-content:flex-end;`, xl = h.button`all:unset;display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:transparent;padding:10px 16px;`, en = k`width:100%;height:36px;border-radius:6px;cursor:pointer;transition:all 0.2s ease;padding:0 12px;border:none;outline:none;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Bn = h.button`${en};background-color:${u.themedColor.primary};color:${u.themedColor.textHighEmphasis};&:hover:not(:disabled){opacity:0.9;}`, vl = h.button`${en};color:${u.themedColor.primary};${N.light`
3124
+ return /* @__PURE__ */ r.createElement(xt, { rootElementId: se.WINDOW, visible: e, onClose: i }, /* @__PURE__ */ r.createElement(pl, null, /* @__PURE__ */ r.createElement(fl, null, t && /* @__PURE__ */ r.createElement(k, { variant: "h1", color: u.themedColor.textHighEmphasis }, t), n && /* @__PURE__ */ r.createElement(bl, null, /* @__PURE__ */ r.createElement(k, { variant: "subtitle2", color: u.themedColor.textHighEmphasis }, n))), /* @__PURE__ */ r.createElement(El, null, /* @__PURE__ */ r.createElement(xl, { onClick: a }, /* @__PURE__ */ r.createElement(k, { variant: "button", color: u.themedColor.primary }, o)))));
3125
+ }, pl = h.div`width:100%;height:auto;padding-block:24px 12px;padding-inline:24px;margin:0 auto;border-radius:4px;box-sizing:border-box;background-color:${({ theme: e }) => e.colors.base.modalContentBackground};`, fl = h.div`margin-bottom:16px;`, bl = h.div`margin-top:8px;`, El = h.div`display:flex;flex-direction:row;justify-content:flex-end;`, xl = h.button`all:unset;display:flex;justify-content:center;align-items:center;border-radius:4px;cursor:pointer;background-color:transparent;padding:10px 16px;`, en = I`width:100%;height:36px;border-radius:6px;cursor:pointer;transition:all 0.2s ease;padding:0 12px;border:none;outline:none;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Bn = h.button`${en};background-color:${u.themedColor.primary};color:${u.themedColor.textHighEmphasis};&:hover:not(:disabled){opacity:0.9;}`, vl = h.button`${en};color:${u.themedColor.primary};${N.light`
3110
3126
  background-color: ${u.color.background50};
3111
3127
  `};
3112
3128
  ${N.dark`
@@ -3147,10 +3163,10 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3147
3163
  return u.themedColor.textHighEmphasisInverse;
3148
3164
  }
3149
3165
  }, l = _l(n);
3150
- return /* @__PURE__ */ r.createElement(l, { onClick: t, disabled: o || s, className: i }, s ? /* @__PURE__ */ r.createElement(Cl, null, /* @__PURE__ */ r.createElement(D, { type: "spinner", size: 22, color: a() })) : /* @__PURE__ */ r.createElement(I, { variant: "button", color: a() }, e));
3151
- }, Tl = ({ children: e, className: t, style: n }) => /* @__PURE__ */ r.createElement(I, { variant: "caption4", color: u.themedColor.error, className: t, style: n }, e), Al = ({ children: e, className: t, style: n, required: o }) => {
3166
+ return /* @__PURE__ */ r.createElement(l, { onClick: t, disabled: o || s, className: i }, s ? /* @__PURE__ */ r.createElement(Cl, null, /* @__PURE__ */ r.createElement(D, { type: "spinner", size: 22, color: a() })) : /* @__PURE__ */ r.createElement(k, { variant: "button", color: a() }, e));
3167
+ }, Tl = ({ children: e, className: t, style: n }) => /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: u.themedColor.error, className: t, style: n }, e), Al = ({ children: e, className: t, style: n, required: o }) => {
3152
3168
  const { stringSet: s } = z();
3153
- return /* @__PURE__ */ r.createElement(I, { variant: "caption3", color: u.themedColor.textMidEmphasis, className: t, style: n }, e, !o && /* @__PURE__ */ r.createElement("span", { style: { color: u.themedColor.textLowEmphasis } }, ` (${s.OPTIONAL})`));
3169
+ return /* @__PURE__ */ r.createElement(k, { variant: "caption3", color: u.themedColor.textMidEmphasis, className: t, style: n }, e, !o && /* @__PURE__ */ r.createElement("span", { style: { color: u.themedColor.textLowEmphasis } }, ` (${s.OPTIONAL})`));
3154
3170
  }, wl = ({
3155
3171
  value: e,
3156
3172
  onChange: t,
@@ -3188,7 +3204,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3188
3204
  $submitted: s
3189
3205
  }
3190
3206
  );
3191
- }, Il = k`width:100%;height:36px;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:400;line-height:1.43;outline:none;transition:all 0.2s ease;&::placeholder{color:${u.themedColor.textLowEmphasis};}&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}`, kl = k`color:${u.themedColor.textHighEmphasis};border:1px solid transparent;cursor:not-allowed;${N.light`
3207
+ }, kl = I`width:100%;height:36px;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:400;line-height:1.43;outline:none;transition:all 0.2s ease;&::placeholder{color:${u.themedColor.textLowEmphasis};}&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}`, Il = I`color:${u.themedColor.textHighEmphasis};border:1px solid transparent;cursor:not-allowed;${N.light`
3192
3208
  background-color: ${u.color.ondark.textMidEmphasis};
3193
3209
  `}
3194
3210
  ${N.dark`
@@ -3198,13 +3214,13 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3198
3214
  &::placeholder {
3199
3215
  color: ${u.themedColor.textLowEmphasis};
3200
3216
  }
3201
- `, $l = k`border:1px solid ${u.themedColor.error};color:${u.themedColor.textHighEmphasis};${N.light`
3217
+ `, $l = I`border:1px solid ${u.themedColor.error};color:${u.themedColor.textHighEmphasis};${N.light`
3202
3218
  background-color: ${u.color.background50};
3203
3219
  `}
3204
3220
  ${N.dark`
3205
3221
  background-color: ${u.color.onlight.textLowEmphasis};
3206
3222
  `}
3207
- `, Ml = k`border:1px solid ${u.themedColor.textDisabled};color:${u.themedColor.textHighEmphasis};${N.light`
3223
+ `, Ml = I`border:1px solid ${u.themedColor.textDisabled};color:${u.themedColor.textHighEmphasis};${N.light`
3208
3224
  background-color: ${u.color.background50};
3209
3225
  `}
3210
3226
  ${N.dark`
@@ -3214,7 +3230,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3214
3230
  &:focus {
3215
3231
  border-color: ${u.themedColor.primary};
3216
3232
  }
3217
- `, Ol = h.input`${Il}${({ $error: e, $submitted: t }) => t ? kl : e ? $l : Ml}`, Ll = (e) => {
3233
+ `, Ol = h.input`${kl}${({ $error: e, $submitted: t }) => t ? Il : e ? $l : Ml}`, Ll = (e) => {
3218
3234
  if (e.multiple) {
3219
3235
  const { value: t = [], onChange: n, maxSelect: o, submitted: s = !1 } = e;
3220
3236
  return {
@@ -3256,15 +3272,15 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3256
3272
  $error: o,
3257
3273
  onClick: () => a(l.value)
3258
3274
  },
3259
- /* @__PURE__ */ r.createElement(I, { variant: "caption1", color: Dl(c, n) }, l.label)
3275
+ /* @__PURE__ */ r.createElement(k, { variant: "caption1", color: Dl(c, n) }, l.label)
3260
3276
  );
3261
3277
  }));
3262
- }, Dl = (e, t) => t ? e ? u.themedColor.textHighEmphasis : u.themedColor.textDisabled : e ? u.themedColor.primary : u.themedColor.textMidEmphasis, Rl = h.div`display:flex;flex-wrap:wrap;gap:4px 2px;`, Nl = k`display:inline-flex;align-items:center;padding:8px 12px;border-radius:15px;transition:all 0.2s ease;`, Bl = k`cursor:default;background-color:${u.color.ondark.textMidEmphasis};color:${u.themedColor.textHighEmphasis};${N.dark`
3278
+ }, Dl = (e, t) => t ? e ? u.themedColor.textHighEmphasis : u.themedColor.textDisabled : e ? u.themedColor.primary : u.themedColor.textMidEmphasis, Rl = h.div`display:flex;flex-wrap:wrap;gap:4px 2px;`, Nl = I`display:inline-flex;align-items:center;padding:8px 12px;border-radius:15px;transition:all 0.2s ease;`, Bl = I`cursor:default;background-color:${u.color.ondark.textMidEmphasis};color:${u.themedColor.textHighEmphasis};${N.dark`
3263
3279
  background-color: transparent;
3264
3280
  border: 1px solid white;
3265
3281
  color: white;
3266
3282
  `}
3267
- `, Fl = k`cursor:default;${N.light`
3283
+ `, Fl = I`cursor:default;${N.light`
3268
3284
  background-color: ${u.color.ondark.textMidEmphasis};
3269
3285
  color: ${u.themedColor.textDisabled};
3270
3286
  `}
@@ -3273,7 +3289,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3273
3289
  border: 1px solid ${u.color.onlight.textLowEmphasis};
3274
3290
  color: ${u.themedColor.textDisabled};
3275
3291
  `}
3276
- `, Pl = k`cursor:pointer;border:1px solid ${u.themedColor.primary};${N.light`
3292
+ `, Pl = I`cursor:pointer;border:1px solid ${u.themedColor.primary};${N.light`
3277
3293
  background-color: ${u.color.background50};
3278
3294
  color: ${u.themedColor.primary};
3279
3295
  `}
@@ -3281,7 +3297,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3281
3297
  background-color: ${u.color.onlight.textLowEmphasis};
3282
3298
  color: ${u.themedColor.primary};
3283
3299
  `}
3284
- `, Ul = k`cursor:pointer;border:1px solid ${u.themedColor.textDisabled};${N.light`
3300
+ `, Ul = I`cursor:pointer;border:1px solid ${u.themedColor.textDisabled};${N.light`
3285
3301
  background-color: ${u.color.background50};
3286
3302
  color: ${u.themedColor.textMidEmphasis};
3287
3303
  `}
@@ -3289,15 +3305,15 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3289
3305
  background-color: ${u.color.onlight.textLowEmphasis};
3290
3306
  color: ${u.themedColor.textMidEmphasis};
3291
3307
  `}
3292
- `, Hl = k`border-color:${u.themedColor.error}!important;`, Vl = h.div`${Nl}${({ $active: e, $submitted: t, $error: n }) => {
3308
+ `, Hl = I`border-color:${u.themedColor.error}!important;`, Vl = h.div`${Nl}${({ $active: e, $submitted: t, $error: n }) => {
3293
3309
  if (t)
3294
3310
  return e ? Bl : Fl;
3295
3311
  const o = e ? Pl : Ul;
3296
- return n ? k`
3312
+ return n ? I`
3297
3313
  ${o} ${Hl}
3298
3314
  ` : o;
3299
3315
  }}
3300
- `, zl = (e) => /* @__PURE__ */ r.createElement(Sr, { ...e, multiple: !1 }), Gl = (e) => /* @__PURE__ */ r.createElement(Sr, { ...e, multiple: !0 }), Wl = h.div`width:100%;height:1px;background-color:${u.themedColor.textDisabled};`, jl = ({ className: e }) => /* @__PURE__ */ r.createElement(Wl, { className: e }), ql = ({
3316
+ `, zl = (e) => /* @__PURE__ */ r.createElement(Sr, { ...e, multiple: !1 }), Wl = (e) => /* @__PURE__ */ r.createElement(Sr, { ...e, multiple: !0 }), Gl = h.div`width:100%;height:1px;background-color:${u.themedColor.textDisabled};`, jl = ({ className: e }) => /* @__PURE__ */ r.createElement(Gl, { className: e }), ql = ({
3301
3317
  value: e = "",
3302
3318
  onChange: t,
3303
3319
  placeholder: n,
@@ -3322,7 +3338,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3322
3338
  $submitted: i
3323
3339
  };
3324
3340
  return o === "multi-line" ? /* @__PURE__ */ r.createElement(Zl, { ...m }) : /* @__PURE__ */ r.createElement(Kl, { ...m });
3325
- }, Tr = k`width:100%;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:400;line-height:1.43;outline:none;transition:all 0.2s ease;&::placeholder{color:${u.themedColor.textLowEmphasis};}`, Ar = k`color:${u.themedColor.textHighEmphasis};border:1px solid transparent;cursor:not-allowed;${N.light`
3341
+ }, Tr = I`width:100%;padding:8px 12px;border-radius:6px;font-size:14px;font-weight:400;line-height:1.43;outline:none;transition:all 0.2s ease;&::placeholder{color:${u.themedColor.textLowEmphasis};}`, Ar = I`color:${u.themedColor.textHighEmphasis};border:1px solid transparent;cursor:not-allowed;${N.light`
3326
3342
  background-color: ${u.color.ondark.textMidEmphasis};
3327
3343
  `}
3328
3344
  ${N.dark`
@@ -3332,13 +3348,13 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3332
3348
  &::placeholder {
3333
3349
  color: ${u.themedColor.textLowEmphasis};
3334
3350
  }
3335
- `, wr = k`border:1px solid ${u.themedColor.error};color:${u.themedColor.textHighEmphasis};${N.light`
3351
+ `, wr = I`border:1px solid ${u.themedColor.error};color:${u.themedColor.textHighEmphasis};${N.light`
3336
3352
  background-color: ${u.color.background50};
3337
3353
  `}
3338
3354
  ${N.dark`
3339
3355
  background-color: ${u.color.onlight.textLowEmphasis};
3340
3356
  `}
3341
- `, Ir = k`border:1px solid ${u.themedColor.textDisabled};color:${u.themedColor.textHighEmphasis};${N.light`
3357
+ `, kr = I`border:1px solid ${u.themedColor.textDisabled};color:${u.themedColor.textHighEmphasis};${N.light`
3342
3358
  background-color: ${u.color.background50};
3343
3359
  `}
3344
3360
  ${N.dark`
@@ -3348,7 +3364,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3348
3364
  &:focus {
3349
3365
  border-color: ${u.themedColor.primary};
3350
3366
  }
3351
- `, Kl = h.input`${Tr};height:36px;${({ $error: e, $submitted: t }) => t ? Ar : e ? wr : Ir}`, Zl = h.textarea`${Tr};height:96px;resize:none;font-family:inherit;${({ $error: e, $submitted: t }) => t ? Ar : e ? wr : Ir}`, Yl = ({ children: e, className: t, style: n }) => /* @__PURE__ */ r.createElement(I, { variant: "button", color: u.themedColor.textHighEmphasis, className: t, style: n }, e), Z = {
3367
+ `, Kl = h.input`${Tr};height:36px;${({ $error: e, $submitted: t }) => t ? Ar : e ? wr : kr}`, Zl = h.textarea`${Tr};height:96px;resize:none;font-family:inherit;${({ $error: e, $submitted: t }) => t ? Ar : e ? wr : kr}`, Yl = ({ children: e, className: t, style: n }) => /* @__PURE__ */ r.createElement(k, { variant: "button", color: u.themedColor.textHighEmphasis, className: t, style: n }, e), Z = {
3352
3368
  Title: Yl,
3353
3369
  Label: Al,
3354
3370
  ErrorLabel: Tl,
@@ -3357,7 +3373,7 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3357
3373
  TextInput: ql,
3358
3374
  NumberInput: wl,
3359
3375
  SingleSelect: zl,
3360
- MultiSelect: Gl
3376
+ MultiSelect: Wl
3361
3377
  }, Xl = 1, Jl = /* @__PURE__ */ new Set(["text", "number", "single-select", "multi-select"]), Ql = (e) => {
3362
3378
  var f;
3363
3379
  const t = (f = e.extendedMessagePayload) == null ? void 0 : f.form;
@@ -3469,8 +3485,8 @@ const Rn = h.div`display:flex;flex-direction:${({ $horizontal: e }) => e ? "row"
3469
3485
  loading: o.canceling
3470
3486
  },
3471
3487
  n.BUTTON__CANCEL
3472
- ))), /* @__PURE__ */ r.createElement(Qt, { ...i, onClose: () => a({ visible: !1, title: "" }) })) : /* @__PURE__ */ r.createElement(Fn, { $maxWidth: e.maxBodyWidth ?? F.BODY_MAX_WIDTH }, /* @__PURE__ */ r.createElement(I, { variant: "body3" }, b.reason), b.cancelable && /* @__PURE__ */ r.createElement(Z.Button, { variant: "primary", onClick: x, loading: o.canceling }, n.BUTTON__CANCEL));
3473
- }, Fn = h.div`display:flex;flex-direction:column;gap:12px;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e }) => k`
3488
+ ))), /* @__PURE__ */ r.createElement(Qt, { ...i, onClose: () => a({ visible: !1, title: "" }) })) : /* @__PURE__ */ r.createElement(Fn, { $maxWidth: e.maxBodyWidth ?? F.BODY_MAX_WIDTH }, /* @__PURE__ */ r.createElement(k, { variant: "body3" }, b.reason), b.cancelable && /* @__PURE__ */ r.createElement(Z.Button, { variant: "primary", onClick: x, loading: o.canceling }, n.BUTTON__CANCEL));
3489
+ }, Fn = h.div`display:flex;flex-direction:column;gap:12px;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e }) => I`
3474
3490
  color: ${e.colors.messageIncoming.text};
3475
3491
  background-color: ${e.colors.messageIncoming.background};
3476
3492
  `}
@@ -3500,7 +3516,7 @@ const ac = ({
3500
3516
  extendedMessagePayload: e,
3501
3517
  onGetCachedMessageTemplate: t = () => null,
3502
3518
  onRequestMessageTemplate: n,
3503
- onHandleTemplateInternalAction: o = Te
3519
+ onHandleTemplateInternalAction: o = Ae
3504
3520
  }) => {
3505
3521
  const s = e == null ? void 0 : e.message_template;
3506
3522
  if (!oc.has((s == null ? void 0 : s.type) ?? "default")) throw new Error("Unsupported template type");
@@ -3514,7 +3530,7 @@ const ac = ({
3514
3530
  viewVariables: s == null ? void 0 : s.view_variables,
3515
3531
  aiAgentColorVariables: a.aiAgentColorVariables
3516
3532
  });
3517
- return /* @__PURE__ */ r.createElement(lc, { id: `${be}-ext-message-template` }, /* @__PURE__ */ r.createElement(
3533
+ return /* @__PURE__ */ r.createElement(lc, { id: `${Ee}-ext-message-template` }, /* @__PURE__ */ r.createElement(
3518
3534
  Ro,
3519
3535
  {
3520
3536
  handleInternalAction: (c, d) => {
@@ -3530,7 +3546,7 @@ function cc({
3530
3546
  suggestedRepliesDirection: n = "vertical"
3531
3547
  }) {
3532
3548
  const [o, s] = T(!1), i = (e == null ? void 0 : e.suggested_replies) ?? [];
3533
- return i.length === 0 || o ? null : /* @__PURE__ */ r.createElement(dc, { id: `${be}-ext-suggested-replies`, $type: n }, i.map((a, l) => /* @__PURE__ */ r.createElement(
3549
+ return i.length === 0 || o ? null : /* @__PURE__ */ r.createElement(dc, { id: `${Ee}-ext-suggested-replies`, $type: n }, i.map((a, l) => /* @__PURE__ */ r.createElement(
3534
3550
  uc,
3535
3551
  {
3536
3552
  key: l,
@@ -3543,14 +3559,14 @@ function cc({
3543
3559
  a
3544
3560
  )));
3545
3561
  }
3546
- const dc = h.div`margin:16px 0;padding:0 ${F.HORIZONTAL_PADDING}px;position:relative;display:flex;align-self:stretch;gap:8px;${({ $type: e }) => e === "vertical" ? mc : gc};`, uc = h(I)`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:${u.color.primary.main};border:1px solid ${u.color.primary.main};background-color:${u.themedColor.bg_50_600};&:hover{background-color:${u.themedColor.bg_100_500};}${({ $type: e, theme: t }) => k`
3562
+ const dc = h.div`margin:16px 0;padding:0 ${F.HORIZONTAL_PADDING}px;position:relative;display:flex;align-self:stretch;gap:8px;${({ $type: e }) => e === "vertical" ? mc : gc};`, uc = h(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:${u.color.primary.main};border:1px solid ${u.color.primary.main};background-color:${u.themedColor.bg_50_600};&:hover{background-color:${u.themedColor.bg_100_500};}${({ $type: e, theme: t }) => I`
3547
3563
  ${e === "vertical" ? hc : pc};
3548
3564
  &:active {
3549
3565
  background-color: ${t.colors.base.primary};
3550
3566
  color: ${t.colors.base.primaryContrastContent};
3551
3567
  }
3552
3568
  `}
3553
- `, mc = k`flex-direction:column;align-items:flex-end;`, gc = k`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, hc = k`max-width:calc(100% - 70px);white-space:pre-wrap;`, pc = k`white-space:nowrap;`, Ve = Me({
3569
+ `, mc = I`flex-direction:column;align-items:flex-end;`, gc = I`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, hc = I`max-width:calc(100% - 70px);white-space:pre-wrap;`, pc = I`white-space:nowrap;`, Ve = Me({
3554
3570
  template: fc,
3555
3571
  components: {
3556
3572
  SenderName: Oa,
@@ -3568,16 +3584,16 @@ const dc = h.div`margin:16px 0;padding:0 ${F.HORIZONTAL_PADDING}px;position:rela
3568
3584
  }
3569
3585
  });
3570
3586
  function fc(e) {
3571
- return /* @__PURE__ */ r.createElement(kr, { ...e, testerMode: !1 });
3587
+ return /* @__PURE__ */ r.createElement(Ir, { ...e, testerMode: !1 });
3572
3588
  }
3573
- function kr(e) {
3589
+ function Ir(e) {
3574
3590
  var E, y, x, b, f, g, v;
3575
3591
  const { components: t } = Ve.useContext(), n = !!e.isTyping, o = e.testerMode, s = !!((E = e.extendedMessagePayload) != null && E.form) && !((y = e.extendedMessagePayload) != null && y.form.canceled_at), i = !!((x = e.extendedMessagePayload) != null && x.message_template), a = !!((b = e.extendedMessagePayload) != null && b.cta_button), l = !!((f = e.extendedMessagePayload) != null && f.citations) && e.extendedMessagePayload.citations.length > 0, c = !!e.createdAt, d = e.groupType === "top" || e.groupType === "single", m = e.groupType === "bottom" || e.groupType === "single", p = o ? 0 : F.AVATAR_SIZE;
3576
- return /* @__PURE__ */ r.createElement(bc, { $marginBottom: n ? 0 : zt(e.groupType) }, d && /* @__PURE__ */ r.createElement(Ec, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(St, { $extraStartPadding: p }, 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 })), l && /* @__PURE__ */ r.createElement(t.Citation, { ...e }))), i && /* @__PURE__ */ r.createElement(Pn, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ r.createElement(
3592
+ return /* @__PURE__ */ r.createElement(bc, { $marginBottom: n ? 0 : Wt(e.groupType) }, d && /* @__PURE__ */ r.createElement(Ec, null, !o && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...e }), /* @__PURE__ */ r.createElement(t.SenderName, { ...e })), /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(Tt, { $extraStartPadding: p }, 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 })), l && /* @__PURE__ */ r.createElement(t.Citation, { ...e }))), i && /* @__PURE__ */ r.createElement(Pn, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ r.createElement(
3577
3593
  t.MessageTemplate,
3578
3594
  {
3579
3595
  ...e,
3580
- messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(St, { $extraStartPadding: p }, /* @__PURE__ */ r.createElement(
3596
+ messageTemplateErrorFallback: e.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(Tt, { $extraStartPadding: p }, /* @__PURE__ */ r.createElement(
3581
3597
  t.MessageBody,
3582
3598
  {
3583
3599
  ...e,
@@ -3585,7 +3601,7 @@ function kr(e) {
3585
3601
  message: ((v = (g = e.extendedMessagePayload) == null ? void 0 : g.message_template) == null ? void 0 : v.fallback_message) ?? "Cannot read this template."
3586
3602
  }
3587
3603
  )),
3588
- messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(St, { $extraStartPadding: p }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
3604
+ messageTemplateLoadingFallback: e.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(Tt, { $extraStartPadding: p }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...e }))
3589
3605
  }
3590
3606
  )), s && /* @__PURE__ */ r.createElement(Pn, { $extraStartPadding: p }, /* @__PURE__ */ r.createElement(t.Form, { ...e }))), m && c && /* @__PURE__ */ r.createElement(xc, { $extraStartPadding: p + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...e })), /* @__PURE__ */ r.createElement(Xn, null, !n && /* @__PURE__ */ r.createElement(Ye, { $extraStartPadding: p + 8 }, /* @__PURE__ */ r.createElement(t.Feedback, { ...e })), e.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...e }), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...e })));
3591
3607
  }
@@ -3593,7 +3609,7 @@ const bc = h.div`display:flex;flex-direction:column;align-items:flex-start;margi
3593
3609
  `, Ye = h.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = F.HORIZONTAL_PADDING, $endPadding: t = F.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
3594
3610
  padding-inline: ${e + n}px ${t}px;
3595
3611
  `}
3596
- `, Ec = h(Ye)`display:flex;flex-direction:row;align-items:center;gap:8px;`, St = h(Ye)`display:flex;`, xc = h(Ye)`margin-top:${F.BODY_TIME_GAP}px;display:flex;align-items:flex-start;justify-content:flex-start;`, Pn = h(Ye)`display:flex;${({ $startPadding: e = F.HORIZONTAL_PADDING, $endPadding: t = F.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
3612
+ `, Ec = h(Ye)`display:flex;flex-direction:row;align-items:center;gap:8px;`, Tt = h(Ye)`display:flex;`, xc = h(Ye)`margin-top:${F.BODY_TIME_GAP}px;display:flex;align-items:flex-start;justify-content:flex-start;`, Pn = h(Ye)`display:flex;${({ $startPadding: e = F.HORIZONTAL_PADDING, $endPadding: t = F.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
3597
3613
  padding-inline: ${e + n}px ${t}px;
3598
3614
  `}
3599
3615
  `, vc = h.div`display:flex;flex-direction:column;gap:${F.GAP_GROUPED}px;`;
@@ -3602,7 +3618,7 @@ function yc({ file: e, children: t, onClickFile: n, sendingStatus: o }) {
3602
3618
  if (!(!n || o === "failed"))
3603
3619
  return () => n == null ? void 0 : n(e);
3604
3620
  })();
3605
- return /* @__PURE__ */ r.createElement(_c, null, /* @__PURE__ */ r.createElement(Zt, { name: e.name, type: Vt(e.name, e.type), onClick: s }), t);
3621
+ return /* @__PURE__ */ r.createElement(_c, null, /* @__PURE__ */ r.createElement(Zt, { name: e.name, type: zt(e.name, e.type), onClick: s }), t);
3606
3622
  }
3607
3623
  const _c = h.div`display:flex;flex-direction:column;align-items:flex-end;gap:${F.GAP_GROUPED}px;`, tn = ({ className: e, children: t, size: n = 26 }) => /* @__PURE__ */ r.createElement(Cc, { className: e, $size: n }, t ?? /* @__PURE__ */ r.createElement(D, { type: "spinner", size: n })), Cc = h.div`display:flex;align-items:center;justify-content:center;width:${({ $size: e }) => ae(e)};height:${({ $size: e }) => ae(e)};animation:1s infinite linear;animation-name:rotate;@keyframes rotate{from{transform:rotate(0);}to{transform:rotate(360deg);}}`;
3608
3624
  function Sc({
@@ -3636,23 +3652,23 @@ function Un(e) {
3636
3652
  return nr.sanitize(s);
3637
3653
  }, [e.message]);
3638
3654
  return /* @__PURE__ */ r.createElement(
3639
- Ic,
3655
+ kc,
3640
3656
  {
3641
3657
  $maxWidth: e.maxBodyWidth ?? F.BODY_MAX_WIDTH,
3642
3658
  $color: (n = e.customStyle) == null ? void 0 : n.bubbleContentColor,
3643
3659
  $bgColor: (o = e.customStyle) == null ? void 0 : o.bubbleBackgroundColor
3644
3660
  },
3645
- /* @__PURE__ */ r.createElement(kc, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
3661
+ /* @__PURE__ */ r.createElement(Ic, { variant: "body3", dangerouslySetInnerHTML: { __html: t } })
3646
3662
  );
3647
3663
  }
3648
- const Ic = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => k`
3664
+ const kc = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
3649
3665
  color: ${t || e.colors.messageOutgoing.text};
3650
3666
  background-color: ${n || e.colors.messageOutgoing.background};
3651
3667
  `}
3652
3668
  padding: 12px 0;
3653
3669
  transition: max-width 0.3s;
3654
3670
  overflow-wrap: break-word;
3655
- `, kc = h(I)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
3671
+ `, Ic = h(k)`align-items:flex-start;line-height:140%;white-space:pre-wrap;padding:0 12px;`;
3656
3672
  function $c(e) {
3657
3673
  const { stringSet: t } = z(), n = () => {
3658
3674
  const s = ir(e) ? /* @__PURE__ */ r.createElement(Un, { ...e }) : null;
@@ -3684,7 +3700,7 @@ function Mc({ sendingStatus: e }) {
3684
3700
  const Oc = h(tn)`margin-bottom:2px;width:16px;height:16px;`;
3685
3701
  function Lc({ createdAt: e }) {
3686
3702
  const { stringSet: t, format: n } = z();
3687
- return e ? /* @__PURE__ */ r.createElement(I, { variant: "caption4", color: u.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
3703
+ return e ? /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: u.themedColor.textLowEmphasis }, n(e, t.DATE_FORMAT__MESSAGE_TIMESTAMP)) : null;
3688
3704
  }
3689
3705
  const nn = Me({
3690
3706
  template: Dc,
@@ -3696,13 +3712,13 @@ const nn = Me({
3696
3712
  });
3697
3713
  function Dc(e) {
3698
3714
  const { components: t } = nn.useContext(), n = e.sendingStatus === "succeeded", o = e.groupType === "bottom" || e.groupType === "single";
3699
- return /* @__PURE__ */ r.createElement(Rc, { $marginBottom: zt(e.groupType) }, /* @__PURE__ */ r.createElement(Nc, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(Bc, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
3715
+ return /* @__PURE__ */ r.createElement(Rc, { $marginBottom: Wt(e.groupType) }, /* @__PURE__ */ r.createElement(Nc, null, /* @__PURE__ */ r.createElement(t.MessageBody, { ...e })), o && /* @__PURE__ */ r.createElement(Bc, { $extraEndPadding: 8 }, n ? /* @__PURE__ */ r.createElement(t.SentTime, { ...e }) : /* @__PURE__ */ r.createElement(t.SendingStatus, { ...e })));
3700
3716
  }
3701
3717
  const Rc = h.div`display:flex;flex:1;flex-direction:column;align-items:flex-end;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
3702
3718
  `, $r = h.div`display:flex;align-self:stretch;justify-content:flex-end;${({ $startPadding: e = F.HORIZONTAL_PADDING, $endPadding: t = F.HORIZONTAL_PADDING, $extraEndPadding: n = 0 }) => `padding-inline: ${e}px ${t + n}px;`};
3703
3719
  `, Nc = h($r)``, Bc = h($r)`margin-top:${F.BODY_TIME_GAP}px;`;
3704
3720
  function Fc(e) {
3705
- return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Pc, null, /* @__PURE__ */ r.createElement(I, { variant: "caption2", color: u.themedColor.textMidEmphasis }, Uc(nr.sanitize(e.message))));
3721
+ return e.messageType !== "admin" ? null : /* @__PURE__ */ r.createElement(Pc, null, /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: u.themedColor.textMidEmphasis }, Uc(nr.sanitize(e.message))));
3706
3722
  }
3707
3723
  const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;padding-inline:${F.HORIZONTAL_PADDING}px;a{text-decoration:none;color:inherit;}`, Uc = (e) => {
3708
3724
  try {
@@ -3731,9 +3747,9 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3731
3747
  }, Mr = ({ onClick: e, checked: t, label: n, disabled: o, labelVariant: s = "caption2" }) => {
3732
3748
  const i = t ? u.themedColor.primary : o ? u.themedColor.textDisabled : u.themedColor.textLowEmphasis, a = t ? u.themedColor.textHighEmphasis : o ? u.themedColor.textLowEmphasis : u.themedColor.textHighEmphasis;
3733
3749
  return /* @__PURE__ */ r.createElement(zc, { onClick: e, disabled: o }, /* @__PURE__ */ r.createElement(Hc, null, /* @__PURE__ */ r.createElement(D, { size: 20, type: t ? "radio-on" : "radio-off", color: i })), /* @__PURE__ */ r.createElement(Vc, { variant: s, color: a }, n));
3734
- }, Hc = h.div`width:20px;height:20px;`, Vc = h(I)`line-height:20px;word-break:break-word;`, zc = h.button`all:unset;display:flex;align-items:flex-start;justify-content:flex-start;gap:2px;&:enabled{cursor:pointer;}`, Gc = ({ csatPayload: e, submitted: t, defaultValue: n, value: o, onChange: s }) => (U(() => {
3750
+ }, Hc = h.div`width:20px;height:20px;`, Vc = h(k)`line-height:20px;word-break:break-word;`, zc = h.button`all:unset;display:flex;align-items:flex-start;justify-content:flex-start;gap:2px;&:enabled{cursor:pointer;}`, Wc = ({ csatPayload: e, submitted: t, defaultValue: n, value: o, onChange: s }) => (U(() => {
3735
3751
  typeof o > "u" && typeof n == "boolean" && (s == null || s(n));
3736
- }, [o, n]), e.cre ? /* @__PURE__ */ r.createElement(Wc, null, /* @__PURE__ */ r.createElement(Z.Label, { required: e.cre.required }, e.cre.question), /* @__PURE__ */ r.createElement(jc, null, [
3752
+ }, [o, n]), e.cre ? /* @__PURE__ */ r.createElement(Gc, null, /* @__PURE__ */ r.createElement(Z.Label, { required: e.cre.required }, e.cre.question), /* @__PURE__ */ r.createElement(jc, null, [
3737
3753
  { label: e.cre.positive_label, value: !0 },
3738
3754
  { label: e.cre.negative_label, value: !1 }
3739
3755
  ].map((i) => /* @__PURE__ */ r.createElement(
@@ -3745,7 +3761,7 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3745
3761
  disabled: t,
3746
3762
  onClick: () => s == null ? void 0 : s(i.value)
3747
3763
  }
3748
- )))) : null), Wc = h.div`display:flex;flex-direction:column;gap:8px;`, jc = h.div`display:flex;flex-direction:column;gap:8px;`, qc = ({
3764
+ )))) : null), Gc = h.div`display:flex;flex-direction:column;gap:8px;`, jc = h.div`display:flex;flex-direction:column;gap:8px;`, qc = ({
3749
3765
  followUpItem: e,
3750
3766
  submitted: t,
3751
3767
  value: n = "",
@@ -3934,10 +3950,10 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3934
3950
  ), /* @__PURE__ */ r.createElement("defs", null, /* @__PURE__ */ r.createElement("clipPath", { id: "clip0_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: "15.83", height: "7.915", fill: "white", transform: "translate(12.085 22.709)" })), /* @__PURE__ */ r.createElement("clipPath", { id: "clip1_159_173224" }, /* @__PURE__ */ r.createElement("rect", { width: "15.83", height: "7.915", fill: "white", transform: "translate(12.085 22.709)" }))))
3935
3951
  ], Qc = ({ csatPayload: e, submitted: t, value: n, onChange: o }) => {
3936
3952
  const s = typeof n > "u";
3937
- return /* @__PURE__ */ r.createElement(td, null, /* @__PURE__ */ r.createElement(I, { variant: "caption3", color: u.themedColor.textMidEmphasis }, e.csat_question), /* @__PURE__ */ r.createElement(nd, null, e.csat_scores.map(({ label: i, image_url: a }, l) => {
3953
+ return /* @__PURE__ */ r.createElement(td, null, /* @__PURE__ */ r.createElement(k, { variant: "caption3", color: u.themedColor.textMidEmphasis }, e.csat_question), /* @__PURE__ */ r.createElement(nd, null, e.csat_scores.map(({ label: i, image_url: a }, l) => {
3938
3954
  const c = l + 1, d = n === c;
3939
3955
  return /* @__PURE__ */ r.createElement(rd, { key: l, disabled: t, onClick: () => o(c) }, /* @__PURE__ */ r.createElement(ed, { value: c, selected: s || d, label: i, src: a }), !!i && /* @__PURE__ */ r.createElement(
3940
- I,
3956
+ k,
3941
3957
  {
3942
3958
  color: d ? u.themedColor.textHighEmphasis : u.themedColor.textLowEmphasis,
3943
3959
  variant: "caption3"
@@ -3957,7 +3973,7 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3957
3973
  background-color: ${u.color.background500};
3958
3974
  `}
3959
3975
  }
3960
- `, sd = h.img`user-select:none;-webkit-user-drag:none;width:40px;height:40px;aspect-ratio:1;opacity:${({ $selected: e }) => e ? 1 : 0.38};`, id = ({ csatPayload: e }) => /* @__PURE__ */ r.createElement(I, { variant: "button", color: u.themedColor.textHighEmphasis }, e.title), Tt = ({
3976
+ `, sd = h.img`user-select:none;-webkit-user-drag:none;width:40px;height:40px;aspect-ratio:1;opacity:${({ $selected: e }) => e ? 1 : 0.38};`, id = ({ csatPayload: e }) => /* @__PURE__ */ r.createElement(k, { variant: "button", color: u.themedColor.textHighEmphasis }, e.title), At = ({
3961
3977
  csatPayload: e,
3962
3978
  type: t,
3963
3979
  renderSubmitButton: n,
@@ -3973,7 +3989,7 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
3973
3989
  initialIsResolved: i
3974
3990
  });
3975
3991
  return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(ad, null, /* @__PURE__ */ r.createElement(id, { ...y }), t === he.AI_AGENT_CSAT_5_WITH_CRE && /* @__PURE__ */ r.createElement(
3976
- Gc,
3992
+ Wc,
3977
3993
  {
3978
3994
  ...y,
3979
3995
  defaultValue: i,
@@ -4010,13 +4026,13 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
4010
4026
  });
4011
4027
  }, cd = () => {
4012
4028
  const { stringSet: e } = z();
4013
- return /* @__PURE__ */ r.createElement(I, { variant: "body2", color: u.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
4029
+ return /* @__PURE__ */ r.createElement(k, { variant: "body2", color: u.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
4014
4030
  }, dd = (e) => {
4015
4031
  if (e.messageType !== "admin.csat")
4016
4032
  throw new Error("Invalid message type");
4017
- const { extendedMessagePayload: t, onSubmitCSAT: n } = e, { csat: o, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: a } = e, l = Io(), c = ld(t == null ? void 0 : t.csat);
4033
+ const { extendedMessagePayload: t, onSubmitCSAT: n } = e, { csat: o, csatReason: s, csatExpireAt: i, isResolvedWhenDeterminedByUser: a } = e, l = ko(), c = ld(t == null ? void 0 : t.csat);
4018
4034
  if (!c || !c.visibility || !he[c.type]) return null;
4019
- const d = c.type === he.AI_AGENT_CSAT_5 || c.type === he.AI_AGENT_CSAT_5_WITH_CRE || c.type === he.HELPDESK_CSAT_5 ? Tt : () => null;
4035
+ const d = c.type === he.AI_AGENT_CSAT_5 || c.type === he.AI_AGENT_CSAT_5_WITH_CRE || c.type === he.HELPDESK_CSAT_5 ? At : () => null;
4020
4036
  return /* @__PURE__ */ r.createElement(ud, null, !o && fn(i) ? /* @__PURE__ */ r.createElement(cd, null) : /* @__PURE__ */ r.createElement(
4021
4037
  d,
4022
4038
  {
@@ -4041,7 +4057,7 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
4041
4057
  }) : l();
4042
4058
  }
4043
4059
  },
4044
- /* @__PURE__ */ r.createElement(I, { variant: "button" }, m === "submitted" ? c.csat_submitted_label : c.csat_submit_label)
4060
+ /* @__PURE__ */ r.createElement(k, { variant: "button" }, m === "submitted" ? c.csat_submitted_label : c.csat_submit_label)
4045
4061
  )
4046
4062
  }
4047
4063
  ));
@@ -4054,7 +4070,7 @@ const Pc = h.div`text-align:center;text-wrap:pretty;word-break:break-word;paddin
4054
4070
  });
4055
4071
  function gd(e) {
4056
4072
  const { components: t } = rn.useContext(), n = e.messageType === "admin" ? /* @__PURE__ */ r.createElement(t.AdminMessage, { ...e }) : e.messageType === "admin.csat" ? /* @__PURE__ */ r.createElement(t.CSATMessage, { ...e }) : null;
4057
- return /* @__PURE__ */ r.createElement(hd, { $marginBottom: zt(e.groupType) }, n);
4073
+ return /* @__PURE__ */ r.createElement(hd, { $marginBottom: Wt(e.groupType) }, n);
4058
4074
  }
4059
4075
  const hd = h.div`padding-inline:${F.HORIZONTAL_PADDING}px;margin-bottom:${({ $marginBottom: e }) => e}px;`, Hn = {
4060
4076
  file: "attach",
@@ -4097,7 +4113,7 @@ const hd = h.div`padding-inline:${F.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
4097
4113
  maxTextLines: 1
4098
4114
  },
4099
4115
  e.name
4100
- ))), t == null ? void 0 : t.map((b) => /* @__PURE__ */ r.createElement(At, { key: b.key }, /* @__PURE__ */ r.createElement(ot, null, /* @__PURE__ */ r.createElement(D, { size: 16, type: "function", color: E })), /* @__PURE__ */ r.createElement(ut, null, /* @__PURE__ */ r.createElement(
4116
+ ))), t == null ? void 0 : t.map((b) => /* @__PURE__ */ r.createElement(wt, { key: b.key }, /* @__PURE__ */ r.createElement(ot, null, /* @__PURE__ */ r.createElement(D, { size: 16, type: "function", color: E })), /* @__PURE__ */ r.createElement(ut, null, /* @__PURE__ */ r.createElement(
4101
4117
  rt,
4102
4118
  {
4103
4119
  $clickable: !!i,
@@ -4108,7 +4124,7 @@ const hd = h.div`padding-inline:${F.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
4108
4124
  maxTextLines: 1
4109
4125
  },
4110
4126
  b.name
4111
- ), a && /* @__PURE__ */ r.createElement(bd, { role: "button", onClick: () => a == null ? void 0 : a(b) }, /* @__PURE__ */ r.createElement(I, { variant: "body2", color: x }, "View details"), /* @__PURE__ */ r.createElement(D, { type: "chevron-right", size: 16, color: x }))))), n == null ? void 0 : n.map((b) => /* @__PURE__ */ r.createElement(At, { key: b.id }, /* @__PURE__ */ r.createElement(ot, null, m({
4127
+ ), a && /* @__PURE__ */ r.createElement(bd, { role: "button", onClick: () => a == null ? void 0 : a(b) }, /* @__PURE__ */ r.createElement(k, { variant: "body2", color: x }, "View details"), /* @__PURE__ */ r.createElement(D, { type: "chevron-right", size: 16, color: x }))))), n == null ? void 0 : n.map((b) => /* @__PURE__ */ r.createElement(wt, { key: b.id }, /* @__PURE__ */ r.createElement(ot, null, m({
4112
4128
  default: /* @__PURE__ */ r.createElement(D, { size: 16, type: Hn[b.source_type] ?? Hn.snippet, color: E }),
4113
4129
  sourceType: b.source_type
4114
4130
  })), /* @__PURE__ */ r.createElement(
@@ -4122,7 +4138,7 @@ const hd = h.div`padding-inline:${F.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
4122
4138
  maxTextLines: 1
4123
4139
  },
4124
4140
  b.preview_title
4125
- ))), o == null ? void 0 : o.map((b) => /* @__PURE__ */ r.createElement(At, { key: b.key }, /* @__PURE__ */ r.createElement(ot, null, /* @__PURE__ */ r.createElement(D, { size: 16, type: "template", color: E })), /* @__PURE__ */ r.createElement(
4141
+ ))), o == null ? void 0 : o.map((b) => /* @__PURE__ */ r.createElement(wt, { key: b.key }, /* @__PURE__ */ r.createElement(ot, null, /* @__PURE__ */ r.createElement(D, { size: 16, type: "template", color: E })), /* @__PURE__ */ r.createElement(
4126
4142
  rt,
4127
4143
  {
4128
4144
  $clickable: !!c,
@@ -4134,14 +4150,14 @@ const hd = h.div`padding-inline:${F.HORIZONTAL_PADDING}px;margin-bottom:${({ $ma
4134
4150
  },
4135
4151
  b.name
4136
4152
  ))), d);
4137
- }, fd = h(I)`font-weight:400;`, rt = h(fd)`${({ $clickable: e, $highlightColor: t }) => e && k`
4153
+ }, fd = h(k)`font-weight:400;`, rt = h(fd)`${({ $clickable: e, $highlightColor: t }) => e && I`
4138
4154
  cursor: pointer;
4139
4155
  text-decoration: underline;
4140
4156
  &:hover {
4141
4157
  color: ${t};
4142
4158
  }
4143
4159
  `}
4144
- `, ot = h.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, ut = h.div`display:flex;gap:8px;align-items:center;word-break:break-word;`, bd = h(ut)`cursor:pointer;gap:4px;`, At = h(ut)`flex-direction:row;align-items:center;`, Vn = h.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Or = Ge(null);
4160
+ `, ot = h.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`, ut = h.div`display:flex;gap:8px;align-items:center;word-break:break-word;`, bd = h(ut)`cursor:pointer;gap:4px;`, wt = h(ut)`flex-direction:row;align-items:center;`, Vn = h.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`, Or = We(null);
4145
4161
  function Ed({
4146
4162
  testerType: e,
4147
4163
  origin: t,
@@ -4163,7 +4179,7 @@ const Le = () => {
4163
4179
  }, xd = () => {
4164
4180
  const { isActionbookTester: e } = Le();
4165
4181
  return /* @__PURE__ */ r.createElement(Ve.Template, { template: e ? vd : void 0 }, /* @__PURE__ */ r.createElement(Ve.MessageLogs, { component: yd }));
4166
- }, vd = (e) => /* @__PURE__ */ r.createElement(kr, { ...e, testerMode: !0, maxBodyWidth: F.WIDE_BODY_MAX_WIDTH }), yd = ({ extendedMessagePayload: e = {} }) => {
4182
+ }, vd = (e) => /* @__PURE__ */ r.createElement(Ir, { ...e, testerMode: !0, maxBodyWidth: F.WIDE_BODY_MAX_WIDTH }), yd = ({ extendedMessagePayload: e = {} }) => {
4167
4183
  const { handlers: t } = K(), { manual: n, groundedness: o, function_calls: s, agent_message_templates: i, is_thinking: a } = e;
4168
4184
  return a || !n && !(o != null && o.length) && !(s != null && s.length) && !(i != null && i.length) ? /* @__PURE__ */ r.createElement(r.Fragment, null) : /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Cd, { width: 4 }), /* @__PURE__ */ r.createElement(
4169
4185
  pd,
@@ -4181,13 +4197,13 @@ const Le = () => {
4181
4197
  bottomContent: /* @__PURE__ */ r.createElement(Sd, { variant: "caption2", color: u.themedColor.textLowEmphasis }, "Only visible in the tester")
4182
4198
  }
4183
4199
  ));
4184
- }, _d = h.div`display:flex;gap:16px;margin:16px ${F.HORIZONTAL_PADDING}px 0;align-self:stretch;`, Cd = h.div`width:${({ width: e }) => e}px;background-color:${u.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Sd = h(I)`margin-top:5px;`, Td = (e) => {
4200
+ }, _d = h.div`display:flex;gap:16px;margin:16px ${F.HORIZONTAL_PADDING}px 0;align-self:stretch;`, Cd = h.div`width:${({ width: e }) => e}px;background-color:${u.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Sd = h(k)`margin-top:5px;`, Td = (e) => {
4185
4201
  const { chatSDK: t, handlers: n, logger: o } = K(), { aiAgentInfo: s } = te(), i = H(/* @__PURE__ */ new Set()), a = (m) => {
4186
4202
  if (!(n != null && n.onCustomEvent)) return;
4187
- fe(m) && m.sender.userId === s.userId && !Ae.isStreaming(m) && !i.current.has(m.messageId) && (o.debug("useCustomEventForMessageReceive: bot-message-received", m), n.onCustomEvent({ type: "bot-message-received", data: { message: m } }), i.current.add(m.messageId));
4203
+ fe(m) && m.sender.userId === s.userId && !be.isStreaming(m) && !i.current.has(m.messageId) && (o.debug("useCustomEventForMessageReceive: bot-message-received", m), n.onCustomEvent({ type: "bot-message-received", data: { message: m } }), i.current.add(m.messageId));
4188
4204
  }, l = (m) => {
4189
4205
  if (n != null && n.onCustomEvent && m.isAdminMessage() && m.customType === "user_action_required" && !i.current.has(m.messageId)) {
4190
- const p = kt(m.data);
4206
+ const p = $t(m.data);
4191
4207
  Array.isArray(p.history) && p.history.length === 0 && (o.debug("useCustomEventForMessageReceive: user_action_required", p), n.onCustomEvent({
4192
4208
  type: "user-action-requested",
4193
4209
  data: p
@@ -4217,20 +4233,20 @@ function Ad(e) {
4217
4233
  async function wd(e) {
4218
4234
  if ("file" in e && e.file instanceof File && e.file.type.startsWith("image/")) {
4219
4235
  const { width: t, height: n } = await Ad(e.file);
4220
- return new ko({
4236
+ return new Io({
4221
4237
  key: rr,
4222
4238
  value: [t, n]
4223
4239
  });
4224
4240
  }
4225
4241
  }
4226
- const Id = ({ onScrollAfterSendMessage: e }) => {
4242
+ const kd = ({ onScrollAfterSendMessage: e }) => {
4227
4243
  const { agentPreviewConfigs: t, handlers: n } = K(), o = H(t == null ? void 0 : t.agentAttributes);
4228
4244
  return o.current = t == null ? void 0 : t.agentAttributes, {
4229
4245
  onBeforeSendMessage: async (s) => {
4230
4246
  const i = await wd(s), a = {
4231
4247
  ...s,
4232
4248
  metaArrays: i ? [i] : void 0
4233
- }, l = kd(o.current);
4249
+ }, l = Id(o.current);
4234
4250
  return l ? { ...a, data: JSON.stringify(l) } : a;
4235
4251
  },
4236
4252
  onAfterSendMessage: (s) => {
@@ -4238,11 +4254,11 @@ const Id = ({ onScrollAfterSendMessage: e }) => {
4238
4254
  e(), (i = n == null ? void 0 : n.onMessageSend) == null || i.call(n, s.message), s.sendingStatus === Fe.SUCCEEDED ? (a = n == null ? void 0 : n.onCustomEvent) == null || a.call(n, { type: "message-sent-succeeded", data: { message: s } }) : s.sendingStatus === Fe.PENDING && ((l = n == null ? void 0 : n.onCustomEvent) == null || l.call(n, { type: "message-sent-pending", data: { message: s } }));
4239
4255
  }
4240
4256
  };
4241
- }, kd = (e) => {
4257
+ }, Id = (e) => {
4242
4258
  if (!e) return null;
4243
4259
  const t = {};
4244
4260
  return e.ai && Object.keys(e.ai).length > 0 && (t.ai_attrs = e.ai), e.safeguard && Object.keys(e.safeguard).length > 0 && (t.safeguard_attrs = e.safeguard), typeof e.use_prompt_cache == "boolean" && (t.use_prompt_cache = e.use_prompt_cache), Object.keys(t).length > 0 ? t : null;
4245
- }, Lr = 50, wt = Lr - 20, {
4261
+ }, Lr = 50, kt = Lr - 20, {
4246
4262
  Provider: $d,
4247
4263
  useContext: Md
4248
4264
  } = J("ConversationScroll"), zn = {
@@ -4266,42 +4282,42 @@ function Od({ scrollMode: e, children: t }) {
4266
4282
  const S = n.current;
4267
4283
  !S || !s.current.shouldUpdate || c((R) => {
4268
4284
  s.current.shouldUpdate = !1;
4269
- const { contentHeight: W, contentSnapshotHeight: de, shouldRecalc: ue } = s.current, re = S.clientHeight;
4270
- if (de > W)
4285
+ const { contentHeight: G, contentSnapshotHeight: de, shouldRecalc: ue } = s.current, re = S.clientHeight;
4286
+ if (de > G)
4271
4287
  return R;
4272
4288
  const De = C(S, { messageType: "outgoing" });
4273
- let ve = 0;
4289
+ let ye = 0;
4274
4290
  if (De) {
4275
- const ye = De.message.offsetTop - wt + re;
4276
- ve = Math.max(0, ye - W);
4291
+ const _e = De.message.offsetTop - kt + re;
4292
+ ye = Math.max(0, _e - G);
4277
4293
  } else {
4278
- const ye = W - de, qe = re - wt;
4279
- ve = Math.max(0, ye - qe);
4294
+ const _e = G - de, qe = re - kt;
4295
+ ye = Math.max(0, _e - qe);
4280
4296
  }
4281
- return R === 0 || ve !== R || ue ? (s.current.shouldRecalc = !1, ve) : R;
4297
+ return R === 0 || ye !== R || ue ? (s.current.shouldRecalc = !1, ye) : R;
4282
4298
  });
4283
4299
  }, C = O(
4284
4300
  (S, R) => {
4285
- const { messageType: W = "all" } = R ?? {}, de = Array.from(S.querySelectorAll(`#${oe}-message-item`));
4301
+ const { messageType: G = "all" } = R ?? {}, de = Array.from(S.querySelectorAll(`#${oe}-message-item`));
4286
4302
  let ue = de;
4287
- W === "outgoing" && (ue = de.filter((xt) => xt.getAttribute("data-layout-id") === "outgoingmessage"));
4303
+ G === "outgoing" && (ue = de.filter((vt) => vt.getAttribute("data-layout-id") === "outgoingmessage"));
4288
4304
  const re = ue[ue.length - 1];
4289
4305
  if (!re) return null;
4290
- const De = S.getBoundingClientRect(), ve = re.getBoundingClientRect(), ye = S.scrollTop + (ve.top - De.top), qe = ye + re.offsetHeight;
4306
+ const De = S.getBoundingClientRect(), ye = re.getBoundingClientRect(), _e = S.scrollTop + (ye.top - De.top), qe = _e + re.offsetHeight;
4291
4307
  return {
4292
4308
  message: re,
4293
- scrollTop: ye,
4309
+ scrollTop: _e,
4294
4310
  lastMessageBottom: qe
4295
4311
  };
4296
4312
  },
4297
4313
  []
4298
- ), A = O(() => {
4314
+ ), w = O(() => {
4299
4315
  const S = n.current;
4300
4316
  if (!S || g !== "fixed") return;
4301
4317
  const R = C(S);
4302
4318
  s.current.contentHeight = (R == null ? void 0 : R.lastMessageBottom) ?? S.scrollHeight, !i.current && s.current.contentSnapshotHeight > 0 && _();
4303
- const W = Math.max(0, S.scrollHeight - S.scrollTop - S.clientHeight);
4304
- m(W), M();
4319
+ const G = Math.max(0, S.scrollHeight - S.scrollTop - S.clientHeight);
4320
+ m(G), M();
4305
4321
  }, [g, C]), $ = O(() => {
4306
4322
  o.current && (o.current.disconnect(), o.current = null), s.current = zn, c(0), m(0);
4307
4323
  }, []), B = O((S = !0) => {
@@ -4313,36 +4329,36 @@ function Od({ scrollMode: e, children: t }) {
4313
4329
  }, []), Q = O(
4314
4330
  (S) => {
4315
4331
  S && (n.current = S, g === "fixed" && ($(), s.current.viewport = S.clientHeight, o.current = new MutationObserver(() => {
4316
- A();
4332
+ w();
4317
4333
  }), o.current.observe(S, {
4318
4334
  childList: !0,
4319
4335
  subtree: !0
4320
4336
  })));
4321
4337
  },
4322
- [g, A, $]
4338
+ [g, w, $]
4323
4339
  ), ee = O(() => {
4324
4340
  const S = n.current;
4325
4341
  if (!S) return;
4326
4342
  const R = C(S, { messageType: "outgoing" });
4327
4343
  R && (S.scrollTo({
4328
- top: R.message.offsetTop - wt,
4344
+ top: R.message.offsetTop - kt,
4329
4345
  behavior: "smooth"
4330
4346
  }), v(500));
4331
4347
  }, [C, v]), le = (S) => {
4332
- const { scrollHeight: R, scrollTop: W, clientHeight: de } = S.currentTarget, ue = Math.max(0, R - W - de);
4348
+ const { scrollHeight: R, scrollTop: G, clientHeight: de } = S.currentTarget, ue = Math.max(0, R - G - de);
4333
4349
  m(ue);
4334
- }, Ee = O(() => {
4350
+ }, xe = O(() => {
4335
4351
  g === "fixed" && (x(!0), _());
4336
- }, [g]), xe = O(() => {
4352
+ }, [g]), ve = O(() => {
4337
4353
  g === "fixed" ? setTimeout(() => ee(), 300) : B();
4338
- }, [g, ee]), ke = O(
4354
+ }, [g, ee]), Ie = O(
4339
4355
  (S) => {
4340
4356
  i.current = S, g === "fixed" && _();
4341
4357
  },
4342
4358
  [g]
4343
4359
  ), j = O((S) => {
4344
4360
  E(S);
4345
- }, []), w = O(
4361
+ }, []), A = O(
4346
4362
  (S) => {
4347
4363
  f(S), g === "auto" && S && B(!0);
4348
4364
  },
@@ -4362,11 +4378,11 @@ function Od({ scrollMode: e, children: t }) {
4362
4378
  },
4363
4379
  actions: {
4364
4380
  scrollToBottom: B,
4365
- onBeforeMessageSend: Ee,
4366
- onAfterMessageSend: xe,
4367
- onStreamingUpdate: ke,
4381
+ onBeforeMessageSend: xe,
4382
+ onAfterMessageSend: ve,
4383
+ onStreamingUpdate: Ie,
4368
4384
  onConversationClosed: j,
4369
- onTypingIndicatorUpdate: w
4385
+ onTypingIndicatorUpdate: A
4370
4386
  }
4371
4387
  }
4372
4388
  },
@@ -4375,7 +4391,7 @@ function Od({ scrollMode: e, children: t }) {
4375
4391
  }
4376
4392
  const {
4377
4393
  Provider: Ld,
4378
- Context: Wg,
4394
+ Context: Gg,
4379
4395
  useContext: ie
4380
4396
  } = J("Conversation"), Dd = ({ children: e }) => {
4381
4397
  var s;
@@ -4393,7 +4409,7 @@ const {
4393
4409
  children: s
4394
4410
  }) => {
4395
4411
  var v;
4396
- const { config: i } = q(), { activeChannel: a, refreshActiveChannel: l, aiAgentInfo: c } = te(), { testerType: d } = Le(), m = Md(), p = ((v = i == null ? void 0 : i.conversation) == null ? void 0 : v.scrollMode) ?? "auto", { onBeforeSendMessage: E, onAfterSendMessage: y } = Id({
4412
+ const { config: i } = q(), { activeChannel: a, refreshActiveChannel: l, aiAgentInfo: c } = te(), { testerType: d } = Le(), m = Md(), p = ((v = i == null ? void 0 : i.conversation) == null ? void 0 : v.scrollMode) ?? "auto", { onBeforeSendMessage: E, onAfterSendMessage: y } = kd({
4397
4413
  onScrollAfterSendMessage: () => {
4398
4414
  m.actions.onAfterMessageSend();
4399
4415
  }
@@ -4402,10 +4418,10 @@ const {
4402
4418
  [m.actions, E]
4403
4419
  ), f = O(
4404
4420
  (_) => {
4405
- const M = _.some((C) => Ae.isStreaming(C));
4421
+ const M = _.some((C) => be.isStreaming(C));
4406
4422
  if (m.actions.onStreamingUpdate(M), p === "auto") {
4407
4423
  const C = _[_.length - 1];
4408
- C && Ae.shouldScrollToBottom(C, c.userId, !!d) && setTimeout(() => m.actions.scrollToBottom(!0), 100);
4424
+ C && be.shouldScrollToBottom(C, c.userId, !!d) && setTimeout(() => m.actions.scrollToBottom(!0), 100);
4409
4425
  }
4410
4426
  },
4411
4427
  [m.actions, p, c.userId, d]
@@ -4431,10 +4447,10 @@ const {
4431
4447
  /* @__PURE__ */ r.createElement(Dd, null, s)
4432
4448
  )
4433
4449
  );
4434
- }, on = Ge({
4435
- onDrop: Te,
4436
- subscribe: () => Te
4437
- }), Bt = ({ children: e }) => {
4450
+ }, on = We({
4451
+ onDrop: Ae,
4452
+ subscribe: () => Ae
4453
+ }), Ft = ({ children: e }) => {
4438
4454
  const t = H(/* @__PURE__ */ new Set());
4439
4455
  return /* @__PURE__ */ r.createElement(
4440
4456
  on.Provider,
@@ -4456,39 +4472,39 @@ const {
4456
4472
  const { subscribe: t } = pe(on);
4457
4473
  U(() => t(e), [e]);
4458
4474
  };
4459
- Bt.Consumer = ({ children: e }) => {
4475
+ Ft.Consumer = ({ children: e }) => {
4460
4476
  const { onDrop: t } = pe(on);
4461
4477
  return e({ onDrop: t, onDragOver: (s) => s.preventDefault() });
4462
4478
  };
4463
- const sn = ({ iconSize: e = 64, icon: t, className: n, label: o, children: s }) => /* @__PURE__ */ r.createElement(Fd, { className: n }, t && /* @__PURE__ */ r.createElement(D, { type: t, size: e, color: u.themedColor.textLowEmphasis }), o && /* @__PURE__ */ r.createElement(I, { variant: "body1", color: u.themedColor.textMidEmphasis }, o), s), Bd = h.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Fd = h.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Pd = ({
4479
+ const sn = ({ iconSize: e = 64, icon: t, className: n, label: o, children: s }) => /* @__PURE__ */ r.createElement(Fd, { className: n }, t && /* @__PURE__ */ r.createElement(D, { type: t, size: e, color: u.themedColor.textLowEmphasis }), o && /* @__PURE__ */ r.createElement(k, { variant: "body1", color: u.themedColor.textMidEmphasis }, o), s), Bd = h.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Fd = h.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Pd = ({
4464
4480
  label: e = "Something went wrong",
4465
4481
  icon: t = "error",
4466
4482
  action: n,
4467
4483
  ...o
4468
- }) => /* @__PURE__ */ r.createElement(sn, { icon: t, label: e, ...o }, n && /* @__PURE__ */ r.createElement(Ud, { onClick: n.onClick, label: n.label ?? "Retry" })), Ud = ({ label: e, onClick: t }) => /* @__PURE__ */ r.createElement(Hd, { tabIndex: 0, onClick: t }, /* @__PURE__ */ r.createElement(D, { type: "refresh", size: 20 }), /* @__PURE__ */ r.createElement(I, { variant: "button", color: u.color.primary.main }, e)), Hd = h.button`all:unset;display:flex;cursor:pointer;gap:4px;align-items:center;justify-content:center;`, Vd = ({ iconSize: e = 48, className: t }) => /* @__PURE__ */ r.createElement(tn, { size: e, className: t }), zd = ({ label: e = "No channels", icon: t = "chat", ...n }) => /* @__PURE__ */ r.createElement(sn, { icon: t, label: e, ...n }), Gd = ({
4484
+ }) => /* @__PURE__ */ r.createElement(sn, { icon: t, label: e, ...o }, n && /* @__PURE__ */ r.createElement(Ud, { onClick: n.onClick, label: n.label ?? "Retry" })), Ud = ({ label: e, onClick: t }) => /* @__PURE__ */ r.createElement(Hd, { tabIndex: 0, onClick: t }, /* @__PURE__ */ r.createElement(D, { type: "refresh", size: 20 }), /* @__PURE__ */ r.createElement(k, { variant: "button", color: u.color.primary.main }, e)), Hd = h.button`all:unset;display:flex;cursor:pointer;gap:4px;align-items:center;justify-content:center;`, Vd = ({ iconSize: e = 48, className: t }) => /* @__PURE__ */ r.createElement(tn, { size: e, className: t }), zd = ({ label: e = "No channels", icon: t = "chat", ...n }) => /* @__PURE__ */ r.createElement(sn, { icon: t, label: e, ...n }), Wd = ({
4469
4485
  label: e = "No messages",
4470
4486
  icon: t = "message",
4471
4487
  ...n
4472
- }) => /* @__PURE__ */ r.createElement(sn, { icon: t, label: e, ...n }), Wd = (e) => {
4488
+ }) => /* @__PURE__ */ r.createElement(sn, { icon: t, label: e, ...n }), Gd = (e) => {
4473
4489
  const { components: t } = an.useContext(), n = e.type === "loading" ? /* @__PURE__ */ r.createElement(t.Loading, { ...e }) : e.type === "error" ? /* @__PURE__ */ r.createElement(t.Error, { ...e }) : e.type === "noChannels" ? /* @__PURE__ */ r.createElement(t.NoChannels, { ...e }) : e.type === "noMessages" ? /* @__PURE__ */ r.createElement(t.NoMessages, { ...e }) : null;
4474
4490
  return n && /* @__PURE__ */ r.createElement(Bd, null, n);
4475
4491
  }, an = Me({
4476
- template: Wd,
4492
+ template: Gd,
4477
4493
  components: {
4478
4494
  Loading: Vd,
4479
4495
  Error: Pd,
4480
4496
  NoChannels: zd,
4481
- NoMessages: Gd
4497
+ NoMessages: Wd
4482
4498
  }
4483
4499
  }), ze = (e) => {
4484
4500
  const { Template: t } = an.useContext();
4485
4501
  return /* @__PURE__ */ r.createElement(t, { ...e });
4486
- }, Gn = (e) => or(e) || sr(e);
4502
+ }, Wn = (e) => or(e) || sr(e);
4487
4503
  function jd(e) {
4488
4504
  return e.isAdminMessage() ? e.message === "The channel's custom_type was updated." : !1;
4489
4505
  }
4490
4506
  function qd(e, t) {
4491
- return e.filter((n) => Ae.isWelcomeMessage(n, t));
4507
+ return e.filter((n) => be.isWelcomeMessage(n, t));
4492
4508
  }
4493
4509
  const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, Zd = h.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${u.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, Yd = h.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, Xd = h.div`margin-inline-end:8px;`, Jd = h.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);}`, Qd = h.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;}`, eu = h.div`display:flex;width:160px;justify-content:flex-end;`, tu = h.div`inset-inline-end:0;display:flex;flex-direction:row;`, Dr = h.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, nu = h(Dr)`border-inline-start:1px solid ${u.themedColor.textDisabled};`, ru = h.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, ou = h.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, su = h.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, iu = h.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, au = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
4494
4510
  const { type: s, url: i, name: a = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } = te();
@@ -4516,14 +4532,14 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4516
4532
  onDownloadClick: l
4517
4533
  }) => {
4518
4534
  const { stringSet: c } = z();
4519
- return /* @__PURE__ */ r.createElement(Et, { onClose: a, visible: !0, rootElementId: se.MODAL_ROOT }, /* @__PURE__ */ r.createElement(Kd, null, /* @__PURE__ */ r.createElement(Zd, null, /* @__PURE__ */ r.createElement(Yd, null, /* @__PURE__ */ r.createElement(Xd, null, /* @__PURE__ */ r.createElement(lu, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(Jd, null, /* @__PURE__ */ r.createElement(I, { variant: "h2", color: u.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(Qd, null, /* @__PURE__ */ r.createElement(I, { variant: "body1", color: u.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(eu, null, Gn(s) && /* @__PURE__ */ r.createElement(tu, null, /* @__PURE__ */ r.createElement(Dr, { as: "a", href: i, target: "_blank", rel: Yt, onClick: l }, /* @__PURE__ */ r.createElement(D, { type: "download", color: u.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(nu, { onClick: a }, /* @__PURE__ */ r.createElement(D, { type: "close", color: u.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(ru, { onClick: (d) => d.currentTarget === d.target && a() }, sr(s) && /* @__PURE__ */ r.createElement(ou, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: i, type: s })), or(s) && /* @__PURE__ */ r.createElement(su, { src: i, alt: o }), !Gn(s) && /* @__PURE__ */ r.createElement(iu, null, /* @__PURE__ */ r.createElement(I, { variant: "h1", color: u.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
4535
+ return /* @__PURE__ */ r.createElement(xt, { onClose: a, visible: !0, rootElementId: se.MODAL_ROOT }, /* @__PURE__ */ r.createElement(Kd, null, /* @__PURE__ */ r.createElement(Zd, null, /* @__PURE__ */ r.createElement(Yd, null, /* @__PURE__ */ r.createElement(Xd, null, /* @__PURE__ */ r.createElement(lu, { profileUrl: e, isBotMessage: t })), /* @__PURE__ */ r.createElement(Jd, null, /* @__PURE__ */ r.createElement(k, { variant: "h2", color: u.themedColor.textHighEmphasis }, o)), /* @__PURE__ */ r.createElement(Qd, null, /* @__PURE__ */ r.createElement(k, { variant: "body1", color: u.color.ondark.textMidEmphasis }, n))), /* @__PURE__ */ r.createElement(eu, null, Wn(s) && /* @__PURE__ */ r.createElement(tu, null, /* @__PURE__ */ r.createElement(Dr, { as: "a", href: i, target: "_blank", rel: Yt, onClick: l }, /* @__PURE__ */ r.createElement(D, { type: "download", color: u.themedColor.textHighEmphasis, size: 24 }))), /* @__PURE__ */ r.createElement(nu, { onClick: a }, /* @__PURE__ */ r.createElement(D, { type: "close", color: u.themedColor.textHighEmphasis, size: 24 })))), /* @__PURE__ */ r.createElement(ru, { onClick: (d) => d.currentTarget === d.target && a() }, sr(s) && /* @__PURE__ */ r.createElement(ou, { controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: i, type: s })), or(s) && /* @__PURE__ */ r.createElement(su, { src: i, alt: o }), !Wn(s) && /* @__PURE__ */ r.createElement(iu, null, /* @__PURE__ */ r.createElement(k, { variant: "h1", color: u.themedColor.textHighEmphasis }, c.FILE_VIEWER__UNSUPPORT)))));
4520
4536
  }, du = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background-color:${({ theme: e }) => e.colors.base.primary}!important;path{fill:${({ theme: e }) => e.colors.base.primaryContrastContent}!important;}`, Rr = ({
4521
4537
  className: e,
4522
4538
  locale: t,
4523
4539
  date: n = Date.now(),
4524
4540
  formatString: o = "MMMM dd, yyyy",
4525
4541
  style: s
4526
- }) => /* @__PURE__ */ r.createElement(uu, { id: `${oe}-date-separator`, style: s, className: e }, /* @__PURE__ */ r.createElement(I, { variant: "caption4", color: u.themedColor.textMidEmphasis }, er(n, o, { locale: t }))), uu = h.div`display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word;`, mu = We(function(t, n) {
4542
+ }) => /* @__PURE__ */ r.createElement(uu, { id: `${oe}-date-separator`, style: s, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: u.themedColor.textMidEmphasis }, er(n, o, { locale: t }))), uu = h.div`display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word;`, mu = Ge(function(t, n) {
4527
4543
  const {
4528
4544
  messages: o,
4529
4545
  renderMessage: s,
@@ -4533,29 +4549,29 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4533
4549
  onLoadPrev: c,
4534
4550
  onLoadNext: d,
4535
4551
  loadThreshold: m = 0.05,
4536
- onScroll: p = Te,
4552
+ onScroll: p = Ae,
4537
4553
  depsForResetScrollPositionToBottom: E,
4538
4554
  stackDirection: y = "top",
4539
4555
  bottomSpacerHeight: x = 0
4540
4556
  } = t, b = H(null), f = O(
4541
- (A) => {
4542
- b.current = A, n && (typeof n == "function" ? n(A) : n.current = A);
4557
+ (w) => {
4558
+ b.current = w, n && (typeof n == "function" ? n(w) : n.current = w);
4543
4559
  },
4544
4560
  [n]
4545
4561
  ), g = H(!1), v = H(void 0), _ = H(0), M = H(0);
4546
- Ce(() => {
4562
+ Se(() => {
4547
4563
  b.current && (b.current.scrollTop = b.current.scrollHeight);
4548
- }, E), Ce(() => {
4564
+ }, E), Se(() => {
4549
4565
  b.current && (v.current === "top" && (b.current.scrollTop = b.current.scrollHeight - M.current), v.current === "bottom" && (b.current.scrollTop = _.current), v.current = void 0);
4550
4566
  }, [b.current, o.length]);
4551
- const C = async (A) => {
4552
- if (p == null || p(A), !b.current) return;
4567
+ const C = async (w) => {
4568
+ if (p == null || p(w), !b.current) return;
4553
4569
  const $ = b.current;
4554
4570
  if (M.current = $.scrollHeight - $.scrollTop, _.current = $.scrollTop, g.current) return;
4555
4571
  const B = $.clientHeight * Math.min(Math.max(0, m), 1);
4556
4572
  $.scrollTop <= B ? (g.current = !0, v.current = "top", await c(), g.current = !1) : $.scrollHeight - $.scrollTop - $.clientHeight <= B ? (g.current = !0, v.current = "bottom", await d(), g.current = !1) : v.current = void 0;
4557
4573
  };
4558
- return /* @__PURE__ */ r.createElement(gu, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(hu, { id: "infinite-list-inner", ref: f, onScroll: C }, y === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), i, o.map((A, $) => s({ message: A, index: $ })), a, x > 0 && /* @__PURE__ */ r.createElement("div", { style: { minHeight: x } })), /* @__PURE__ */ r.createElement(pu, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(fu, { id: "infinite-list-overlay" }, l)));
4574
+ return /* @__PURE__ */ r.createElement(gu, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(hu, { id: "infinite-list-inner", ref: f, onScroll: C }, y === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), i, o.map((w, $) => s({ message: w, index: $ })), a, x > 0 && /* @__PURE__ */ r.createElement("div", { style: { minHeight: x } })), /* @__PURE__ */ r.createElement(pu, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(fu, { id: "infinite-list-overlay" }, l)));
4559
4575
  }), gu = h.div`display:flex;position:relative;flex:1;overflow:hidden;`, hu = h.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${u.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, pu = h.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, fu = h.div`pointer-events:auto;`, bu = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Eu, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(D, { size: 24, type: "chevron-down", color: u.color.primary.main })), Eu = h.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`
4560
4576
  background-color: ${u.color.background50};
4561
4577
  &:hover {
@@ -4584,7 +4600,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4584
4600
  /**
4585
4601
  * Returns a list of messages filtered according to business requirements.
4586
4602
  */
4587
- filteredMessages: c.filter((E) => jd(E) ? !1 : l.length > 0 ? !Ae.isWelcomeMessage(E, t) : !0),
4603
+ filteredMessages: c.filter((E) => jd(E) ? !1 : l.length > 0 ? !be.isWelcomeMessage(E, t) : !0),
4588
4604
  /**
4589
4605
  * Determines whether to display the DateSeparator in the data list by comparing it with the welcome messages from Bot Studio.
4590
4606
  */
@@ -4635,13 +4651,13 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4635
4651
  },
4636
4652
  "Sendbird"
4637
4653
  ));
4638
- }, _u = h(I)`color:${u.themedColor.textLowEmphasis};text-align:center;`, Cu = vu(I)`
4654
+ }, _u = h(k)`color:${u.themedColor.textLowEmphasis};text-align:center;`, Cu = vu(k)`
4639
4655
  color: ${u.themedColor.textLowEmphasis};
4640
4656
  cursor: pointer;
4641
4657
  text-decoration: none;
4642
4658
  `, Su = () => {
4643
4659
  var a;
4644
- const { stringSet: e } = z(), { channelSource: t, goToActiveConversation: n, scrollSource: o } = ie(), s = Se(t.channel), i = H(s);
4660
+ const { stringSet: e } = z(), { channelSource: t, goToActiveConversation: n, scrollSource: o } = ie(), s = Te(t.channel), i = H(s);
4645
4661
  return U(() => {
4646
4662
  if (!i.current && s) {
4647
4663
  const d = setTimeout(() => {
@@ -4660,39 +4676,39 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4660
4676
  },
4661
4677
  e.TALK_TO_AGENT
4662
4678
  ));
4663
- }, Tu = h.div`display:flex;justify-content:center;margin-bottom:16px;`, Au = h(I)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${u.themedColor.textDisabled};cursor:pointer;user-select:none;`, wu = () => {
4679
+ }, Tu = h.div`display:flex;justify-content:center;margin-bottom:16px;`, Au = h(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${u.themedColor.textDisabled};cursor:pointer;user-select:none;`, wu = () => {
4664
4680
  const { Template: e } = nn.useContext(), { Template: t } = Ve.useContext(), { Template: n } = rn.useContext(), [o, s] = T(null), [i, a] = T(null), { userSession: l, aiAgentInfo: c } = te(), { cache: d, agentPreviewConfigs: m, chatSDK: p, state: E } = K(), { config: y } = q(), { stringSet: x, dateLocale: b } = z(), {
4665
4681
  conversation: f,
4666
4682
  channelSource: g,
4667
4683
  messageSource: v,
4668
4684
  scrollSource: _,
4669
4685
  state: { input: M }
4670
- } = ie(), { isActionbookTester: C } = Le(), { filteredMessages: A, shouldShowOriginalDate: $, renderAgentPreviewWelcomeMessages: B } = xu(), Q = gr(g.channel), ee = (() => {
4686
+ } = ie(), { isActionbookTester: C } = Le(), { filteredMessages: w, shouldShowOriginalDate: $, renderAgentPreviewWelcomeMessages: B } = xu(), Q = gr(g.channel), ee = (() => {
4671
4687
  const j = Q[0];
4672
4688
  if (!j) return null;
4673
- const w = j.userId === c.userId;
4674
- return { user: w ? c : j, isBot: w };
4689
+ const A = j.userId === c.userId;
4690
+ return { user: A ? c : j, isBot: A };
4675
4691
  })();
4676
4692
  U(() => {
4677
4693
  _.actions.onTypingIndicatorUpdate(!!ee);
4678
4694
  }, [!!ee, _.actions.onTypingIndicatorUpdate]);
4679
- const le = Se(g.channel);
4695
+ const le = Te(g.channel);
4680
4696
  U(() => {
4681
4697
  _.actions.onConversationClosed(le);
4682
4698
  }, [le, _.actions.onConversationClosed]);
4683
- const Ee = (j, w = !1) => {
4699
+ const xe = (j, A = !1) => {
4684
4700
  var ce;
4685
- return w ? c : ((ce = g.channel) == null ? void 0 : ce.members.find((P) => P.userId === j.sender.userId)) ?? j.sender;
4686
- }, xe = (j) => {
4701
+ return A ? c : ((ce = g.channel) == null ? void 0 : ce.members.find((P) => P.userId === j.sender.userId)) ?? j.sender;
4702
+ }, ve = (j) => {
4687
4703
  if (j.sendingStatus === "failed" && !M.disabled)
4688
4704
  return () => a(j);
4689
- }, ke = () => {
4705
+ }, Ie = () => {
4690
4706
  var j;
4691
4707
  if (!v.initialized)
4692
4708
  return /* @__PURE__ */ r.createElement(ze, { type: "loading" });
4693
4709
  if (v.messages.length === 0) {
4694
- const w = B();
4695
- return w ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, w) : /* @__PURE__ */ r.createElement(ze, { type: "noMessages", label: x.PLACE_HOLDER__NO_MESSAGES });
4710
+ const A = B();
4711
+ return A ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, A) : /* @__PURE__ */ r.createElement(ze, { type: "noMessages", label: x.PLACE_HOLDER__NO_MESSAGES });
4696
4712
  }
4697
4713
  return /* @__PURE__ */ r.createElement(
4698
4714
  mu,
@@ -4700,7 +4716,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4700
4716
  ref: _.ref,
4701
4717
  onScroll: _.props.onScroll,
4702
4718
  stackDirection: m == null ? void 0 : m.messageStackDirection,
4703
- messages: A,
4719
+ messages: w,
4704
4720
  onLoadPrev: v.loadPrevious,
4705
4721
  onLoadNext: v.loadNext,
4706
4722
  depsForResetScrollPositionToBottom: [v.initialized, v.messages.length !== 0],
@@ -4717,127 +4733,127 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4717
4733
  message: ""
4718
4734
  }
4719
4735
  )), ((j = y == null ? void 0 : y.conversation) == null ? void 0 : j.isTalkToAgentViewEnabled) && /* @__PURE__ */ r.createElement(Su, null)),
4720
- overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, _.state.shouldShowScrollButton && /* @__PURE__ */ r.createElement(ku, { onClick: () => _.actions.scrollToBottom(!0) })),
4721
- renderMessage: ({ message: w, index: ce }) => {
4722
- const P = Ko(w), S = A[ce - 1], R = A[ce + 1], W = A[A.length - 1], de = w === W, ue = Se(g.channel), re = He(w, c.userId), De = !(c.isUserFeedbackEnabled && re), ve = Zo(w, S, R, De), ye = !Bo((S == null ? void 0 : S.createdAt) ?? 0, w.createdAt) && $(ce) && !C, qe = (Qe) => {
4723
- (w.isFileMessage() || w.isUserMessage()) && s({ file: Qe, sender: Ee(w, w.sender.userId === c.userId) });
4724
- }, xt = () => {
4725
- w.isFileMessage() && Jt(w.url);
4726
- }, Qr = ye ? /* @__PURE__ */ r.createElement(
4736
+ overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, _.state.shouldShowScrollButton && /* @__PURE__ */ r.createElement(Iu, { onClick: () => _.actions.scrollToBottom(!0) })),
4737
+ renderMessage: ({ message: A, index: ce }) => {
4738
+ const P = Ko(A), S = w[ce - 1], R = w[ce + 1], G = w[w.length - 1], de = A === G, ue = Te(g.channel), re = He(A, c.userId), De = !(c.isUserFeedbackEnabled && re && !be.isWelcomeMessage(A)), ye = Zo(A, S, R, De), _e = !Bo((S == null ? void 0 : S.createdAt) ?? 0, A.createdAt) && $(ce) && !C, qe = (Qe) => {
4739
+ (A.isFileMessage() || A.isUserMessage()) && s({ file: Qe, sender: xe(A, A.sender.userId === c.userId) });
4740
+ }, vt = () => {
4741
+ A.isFileMessage() && Jt(A.url);
4742
+ }, Qr = _e ? /* @__PURE__ */ r.createElement(
4727
4743
  Rr,
4728
4744
  {
4729
4745
  style: { margin: "16px 0" },
4730
- date: w.createdAt,
4746
+ date: A.createdAt,
4731
4747
  locale: b,
4732
4748
  formatString: x.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
4733
4749
  }
4734
4750
  ) : null, Je = {
4735
4751
  maxBodyWidth: E.expanded ? F.WIDE_BODY_MAX_WIDTH : void 0,
4736
- extendedMessagePayload: w.extendedMessagePayload,
4737
- createdAt: w.createdAt,
4738
- groupType: ve,
4752
+ extendedMessagePayload: A.extendedMessagePayload,
4753
+ createdAt: A.createdAt,
4754
+ groupType: ye,
4739
4755
  onClickMedia: qe,
4740
- onClickFile: xt
4756
+ onClickFile: vt
4741
4757
  }, eo = () => {
4742
- if (Re.isOutgoing(w, l.userId))
4758
+ if (Re.isOutgoing(A, l.userId))
4743
4759
  return "outgoingmessage";
4744
- if (Re.isIncoming(w, l.userId))
4760
+ if (Re.isIncoming(A, l.userId))
4745
4761
  return "incomingmessage";
4746
4762
  }, to = (() => {
4747
4763
  var Qe, mn;
4748
- if (Re.isAdmin(w))
4749
- return Re.isCSAT(w) ? f ? /* @__PURE__ */ r.createElement(
4764
+ if (Re.isAdmin(A))
4765
+ return Re.isCSAT(A) ? f ? /* @__PURE__ */ r.createElement(
4750
4766
  n,
4751
4767
  {
4752
4768
  ...Je,
4753
4769
  ...f,
4754
4770
  isResolvedWhenDeterminedByUser: Uo(f),
4755
4771
  messageType: "admin.csat",
4756
- onSubmitCSAT: ({ csat: _e, ...G }) => {
4772
+ onSubmitCSAT: ({ csat: Ce, ...W }) => {
4757
4773
  var Y;
4758
- _e && ((Y = g.channel) == null || Y.submitCSAT({ csat: _e, ...G }));
4774
+ Ce && ((Y = g.channel) == null || Y.submitCSAT({ csat: Ce, ...W }));
4759
4775
  }
4760
4776
  }
4761
- ) : null : /* @__PURE__ */ r.createElement(n, { ...Je, messageType: "admin", message: w.message });
4762
- if (Re.isOutgoing(w, l.userId)) {
4763
- const _e = {
4777
+ ) : null : /* @__PURE__ */ r.createElement(n, { ...Je, messageType: "admin", message: A.message });
4778
+ if (Re.isOutgoing(A, l.userId)) {
4779
+ const Ce = {
4764
4780
  ...Je,
4765
- message: w.message,
4766
- sender: Ee(w),
4767
- sendingStatus: w.sendingStatus,
4768
- onClickFailedMessage: xe(w)
4781
+ message: A.message,
4782
+ sender: xe(A),
4783
+ sendingStatus: A.sendingStatus,
4784
+ onClickFailedMessage: ve(A)
4769
4785
  };
4770
- if (w.isUserMessage())
4771
- return /* @__PURE__ */ r.createElement(e, { messageType: "user", ..._e });
4772
- if (w.isFileMessage()) {
4773
- const [G, Y] = ((Qe = w.metaArrays.find((me) => me.key === rr)) == null ? void 0 : Qe.value) ?? [];
4786
+ if (A.isUserMessage())
4787
+ return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...Ce });
4788
+ if (A.isFileMessage()) {
4789
+ const [W, Y] = ((Qe = A.metaArrays.find((me) => me.key === rr)) == null ? void 0 : Qe.value) ?? [];
4774
4790
  return /* @__PURE__ */ r.createElement(
4775
4791
  e,
4776
4792
  {
4777
4793
  messageType: "file",
4778
- file: w,
4794
+ file: A,
4779
4795
  metadata: {
4780
- aspectRatio: G && Y ? `${G}/${Y}` : "1/1",
4781
- localFile: (mn = w.messageParams) == null ? void 0 : mn.file
4796
+ aspectRatio: W && Y ? `${W}/${Y}` : "1/1",
4797
+ localFile: (mn = A.messageParams) == null ? void 0 : mn.file
4782
4798
  },
4783
- ..._e
4799
+ ...Ce
4784
4800
  }
4785
4801
  );
4786
4802
  }
4787
4803
  }
4788
- if (Re.isIncoming(w, l.userId)) {
4789
- const _e = {
4804
+ if (Re.isIncoming(A, l.userId)) {
4805
+ const Ce = {
4790
4806
  ...Je,
4791
- sender: Ee(w, re),
4792
- message: w.message,
4807
+ sender: xe(A, re),
4808
+ message: A.message,
4793
4809
  suggestedRepliesVisible: de,
4794
4810
  suggestedRepliesDirection: m == null ? void 0 : m.suggestedRepliesDirection,
4795
4811
  isBotMessage: re,
4796
- isStreaming: Ae.isStreaming(w),
4812
+ isStreaming: be.isStreaming(A),
4797
4813
  isHandedOff: Ue(g.channel),
4798
4814
  isConversationClosed: ue,
4799
4815
  isFeedbackEnabled: c.isUserFeedbackEnabled,
4800
4816
  isFeedbackCommentEnabled: c.isUserFeedbackCommentOptionEnabled,
4801
- onClickSuggestedReply: async ({ reply: G }) => {
4802
- v.sendUserMessage({ message: G });
4817
+ onClickSuggestedReply: async ({ reply: W }) => {
4818
+ v.sendUserMessage({ message: W });
4803
4819
  },
4804
- onRequestMessageTemplate: async (G) => {
4805
- const { template: Y } = await p.aiAgent.getMessageTemplate(G);
4806
- return d.template.set(G, Y), Y;
4820
+ onRequestMessageTemplate: async (W) => {
4821
+ const { template: Y } = await p.aiAgent.getMessageTemplate(W);
4822
+ return d.template.set(W, Y), Y;
4807
4823
  },
4808
- onGetCachedMessageTemplate: (G) => d.template.get(G),
4809
- onHandleTemplateInternalAction: (G) => {
4810
- if (G.type === "internal" && G.internalData) {
4811
- const { method: Y, payload: me } = G.internalData;
4824
+ onGetCachedMessageTemplate: (W) => d.template.get(W),
4825
+ onHandleTemplateInternalAction: (W) => {
4826
+ if (W.type === "internal" && W.internalData) {
4827
+ const { method: Y, payload: me } = W.internalData;
4812
4828
  Y === "message.send" && (me != null && me.message) && v.sendUserMessage({ message: me.message });
4813
4829
  }
4814
4830
  },
4815
- onFeedbackUpdate: (G) => {
4831
+ onFeedbackUpdate: (W) => {
4816
4832
  const Y = {
4817
- messageId: w.messageId,
4818
- channelUrl: w.channelUrl
4833
+ messageId: A.messageId,
4834
+ channelUrl: A.channelUrl
4819
4835
  };
4820
- if (!G)
4836
+ if (!W)
4821
4837
  return p.aiAgent.deleteMessageFeedback(Y);
4822
- const me = { ...Y, rating: Qa(G.rating), comment: G.comment };
4823
- return Ae.hasFeedback(w) ? p.aiAgent.updateMessageFeedback(me) : p.aiAgent.createMessageFeedback(me);
4838
+ const me = { ...Y, rating: Qa(W.rating), comment: W.comment };
4839
+ return be.hasFeedback(A) ? p.aiAgent.updateMessageFeedback(me) : p.aiAgent.createMessageFeedback(me);
4824
4840
  },
4825
- onSubmitForm: ({ key: G, data: Y }) => p.aiAgent.submitForm({
4826
- messageId: w.messageId,
4827
- channelUrl: w.channelUrl,
4828
- formKey: G,
4841
+ onSubmitForm: ({ key: W, data: Y }) => p.aiAgent.submitForm({
4842
+ messageId: A.messageId,
4843
+ channelUrl: A.channelUrl,
4844
+ formKey: W,
4829
4845
  formData: Y
4830
4846
  }),
4831
- onCancelForm: ({ key: G }) => p.aiAgent.cancelForm({
4832
- messageId: w.messageId,
4833
- channelUrl: w.channelUrl,
4834
- formKey: G
4847
+ onCancelForm: ({ key: W }) => p.aiAgent.cancelForm({
4848
+ messageId: A.messageId,
4849
+ channelUrl: A.channelUrl,
4850
+ formKey: W
4835
4851
  })
4836
4852
  };
4837
- if (w.isUserMessage())
4838
- return /* @__PURE__ */ r.createElement(t, { messageType: "user", ..._e });
4839
- if (w.isFileMessage())
4840
- return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: w, ..._e });
4853
+ if (A.isUserMessage())
4854
+ return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...Ce });
4855
+ if (A.isFileMessage())
4856
+ return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: A, ...Ce });
4841
4857
  }
4842
4858
  })();
4843
4859
  return /* @__PURE__ */ r.createElement("div", { key: P, id: `${oe}-message-item`, "data-layout-id": eo() }, Qr, to);
@@ -4845,7 +4861,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4845
4861
  }
4846
4862
  );
4847
4863
  };
4848
- return /* @__PURE__ */ r.createElement(Iu, { id: `${oe}-message-list` }, ke(), o && /* @__PURE__ */ r.createElement(au, { onClose: () => s(null), sender: o.sender, file: o.file }), i && /* @__PURE__ */ r.createElement(Pe, { visible: !0, onClose: () => a(null) }, /* @__PURE__ */ r.createElement(
4864
+ return /* @__PURE__ */ r.createElement(ku, { id: `${oe}-message-list` }, Ie(), o && /* @__PURE__ */ r.createElement(au, { onClose: () => s(null), sender: o.sender, file: o.file }), i && /* @__PURE__ */ r.createElement(Pe, { visible: !0, onClose: () => a(null) }, /* @__PURE__ */ r.createElement(
4849
4865
  Pe.ActionItem,
4850
4866
  {
4851
4867
  onClick: () => {
@@ -4863,7 +4879,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4863
4879
  },
4864
4880
  x.FAILED_MESSAGE_REMOVE
4865
4881
  )));
4866
- }, Iu = h.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, ku = h(bu)`position:absolute;bottom:20px;inset-inline-end:20px;`, $u = () => {
4882
+ }, ku = h.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Iu = h(bu)`position:absolute;bottom:20px;inset-inline-end:20px;`, $u = () => {
4867
4883
  const { stringSet: e } = z(), { connectionError: t } = te(), { channelSource: n } = ie(), o = t || n.error;
4868
4884
  if (o) {
4869
4885
  const s = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
@@ -4873,8 +4889,8 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4873
4889
  }, Mu = () => {
4874
4890
  var s;
4875
4891
  const { origin: e } = Le(), { appId: t, aiAgentId: n } = q(), { channelSource: o } = ie();
4876
- return (s = o.channel) != null && s.conversation ? /* @__PURE__ */ r.createElement(Ou, null, /* @__PURE__ */ r.createElement(Ft, { style: { gap: 4 } }, /* @__PURE__ */ r.createElement(D, { color: u.themedColor.textLowEmphasis, size: 12, type: "show" }), /* @__PURE__ */ r.createElement(I, { as: "i", color: u.themedColor.textLowEmphasis, variant: "caption2" }, "Only visible in the tester")), /* @__PURE__ */ r.createElement(
4877
- Ft,
4892
+ return (s = o.channel) != null && s.conversation ? /* @__PURE__ */ r.createElement(Ou, null, /* @__PURE__ */ r.createElement(Pt, { style: { gap: 4 } }, /* @__PURE__ */ r.createElement(D, { color: u.themedColor.textLowEmphasis, size: 12, type: "show" }), /* @__PURE__ */ r.createElement(k, { as: "i", color: u.themedColor.textLowEmphasis, variant: "caption2" }, "Only visible in the tester")), /* @__PURE__ */ r.createElement(
4893
+ Pt,
4878
4894
  {
4879
4895
  role: "button",
4880
4896
  style: { gap: 4 },
@@ -4884,10 +4900,10 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4884
4900
  navigator.clipboard.writeText(l);
4885
4901
  }
4886
4902
  },
4887
- /* @__PURE__ */ r.createElement(I, { variant: "body3", color: u.themedColor.textHighEmphasis }, "Copy ", /* @__PURE__ */ r.createElement("span", { style: { color: u.themedColor.primary } }, "conversation link")),
4903
+ /* @__PURE__ */ r.createElement(k, { variant: "body3", color: u.themedColor.textHighEmphasis }, "Copy ", /* @__PURE__ */ r.createElement("span", { style: { color: u.themedColor.primary } }, "conversation link")),
4888
4904
  /* @__PURE__ */ r.createElement(D, { color: u.themedColor.primary, size: 14, type: "copy" })
4889
4905
  )) : null;
4890
- }, Ft = h.div`display:flex;justify-content:center;align-items:center;`, Ou = h(Ft)`flex-direction:column;padding-block:16px;background-color:${u.themedColor.bg_100_500};gap:8px;`, Nr = Ge(void 0), Lu = ({ children: e }) => {
4906
+ }, Pt = h.div`display:flex;justify-content:center;align-items:center;`, Ou = h(Pt)`flex-direction:column;padding-block:16px;background-color:${u.themedColor.bg_100_500};gap:8px;`, Nr = We(void 0), Lu = ({ children: e }) => {
4891
4907
  var b;
4892
4908
  const { chatSDK: t } = K(), { createAttachmentRules: n } = te(), { stringSet: o } = z(), { channelSource: s } = ie(), [i, a] = T([]), [l, c] = T({
4893
4909
  visible: !1,
@@ -4957,7 +4973,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
4957
4973
  };
4958
4974
  function Du({ blurred: e, elementRef: t, document: n = window.document }) {
4959
4975
  const o = H(!1);
4960
- e && t.current && n.activeElement === t.current && (o.current = !0), Ce(() => {
4976
+ e && t.current && n.activeElement === t.current && (o.current = !0), Se(() => {
4961
4977
  var s;
4962
4978
  !e && o.current && ((s = t.current) == null || s.focus(), o.current = !1);
4963
4979
  }, [e]);
@@ -4987,11 +5003,11 @@ const Ru = (e, t) => {
4987
5003
  }
4988
5004
  `, Pu = () => {
4989
5005
  const e = je(), [t, n] = T(), { files: o, removeFile: s, isFileUploadEnabled: i } = ln();
4990
- return !i || o.length === 0 ? null : /* @__PURE__ */ r.createElement(Nu, null, o.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(Bu, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(Fu, { title: "Remove file", onClick: () => s(d) }, /* @__PURE__ */ r.createElement(D, { type: "close-filled", color: u.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(Zt, { name: l, type: Vt(l, a) }))));
5006
+ return !i || o.length === 0 ? null : /* @__PURE__ */ r.createElement(Nu, null, o.map(({ preview: { type: a, name: l, url: c } }, d) => /* @__PURE__ */ r.createElement(Bu, { key: c, onMouseOver: () => n(d), onMouseLeave: () => n(void 0) }, (e || t === d) && /* @__PURE__ */ r.createElement(Fu, { title: "Remove file", onClick: () => s(d) }, /* @__PURE__ */ r.createElement(D, { type: "close-filled", color: u.themedColor.textMidEmphasis })), a.startsWith("image/") ? /* @__PURE__ */ r.createElement("img", { alt: "file-image", src: c }) : /* @__PURE__ */ r.createElement(Zt, { name: l, type: zt(l, a) }))));
4991
5007
  }, Br = {
4992
- textArea: k`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
4993
- attachIcon: k`margin-bottom:4px;`
4994
- }, Fr = h.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, Uu = h(Fr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${u.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${u.themedColor.bg_200_400};}}${Kt && Br.attachIcon};`, Hu = h.input`display:none;`, Wn = h.div`width:100%;position:relative;background-color:${u.themedColor.bg_100_500};border-radius:20px;`, jn = h.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, qn = h.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:${u.themedColor.textHighEmphasis};resize:none;width:100%;height:${vr}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${Kt && Br.textArea};&::placeholder{color:${u.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${u.themedColor.textDisabled};}}`, Kn = h.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, Zn = ({ disabled: e }) => {
5008
+ textArea: I`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
5009
+ attachIcon: I`margin-bottom:4px;`
5010
+ }, Fr = h.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, Uu = h(Fr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${u.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${u.themedColor.bg_200_400};}}${Kt && Br.attachIcon};`, Hu = h.input`display:none;`, Gn = h.div`width:100%;position:relative;background-color:${u.themedColor.bg_100_500};border-radius:20px;`, jn = h.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, qn = h.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:${u.themedColor.textHighEmphasis};resize:none;width:100%;height:${vr}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${Kt && Br.textArea};&::placeholder{color:${u.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${u.themedColor.textDisabled};}}`, Kn = h.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, Zn = ({ disabled: e }) => {
4995
5011
  const { stringSet: t } = z(), n = H(null), [o, s] = T(!1), { addFiles: i, clearFiles: a, files: l, isFileUploadEnabled: c, acceptableMimeTypes: d } = ln();
4996
5012
  return !c || l.length > 0 ? null : /* @__PURE__ */ r.createElement(
4997
5013
  Uu,
@@ -5053,29 +5069,29 @@ const Ru = (e, t) => {
5053
5069
  const y = t.trim().length > 0, x = c.length > 0, b = !p && (y || x), f = () => {
5054
5070
  e.current && (e.current.value = "", e.current.style.height = ""), m(), n("");
5055
5071
  }, g = async () => {
5056
- const C = t.trim(), A = { message: C };
5072
+ const C = t.trim(), w = { message: C };
5057
5073
  if (!(!C && !c.length)) {
5058
5074
  if (c.length > 0) {
5059
- const $ = c[0].file, B = { ...A, file: $ };
5075
+ const $ = c[0].file, B = { ...w, file: $ };
5060
5076
  a.sendFileMessage(B), f();
5061
5077
  return;
5062
5078
  }
5063
- a.sendUserMessage(A), f();
5079
+ a.sendUserMessage(w), f();
5064
5080
  }
5065
5081
  }, v = (C) => {
5066
- const A = Array.from(C.clipboardData.files);
5067
- A.length > 0 && (C.preventDefault(), d(A));
5082
+ const w = Array.from(C.clipboardData.files);
5083
+ w.length > 0 && (C.preventDefault(), d(w));
5068
5084
  }, _ = (C) => {
5069
5085
  C.key !== "Enter" || C.nativeEvent.isComposing || C.shiftKey || (C.preventDefault(), g());
5070
5086
  }, M = (C) => {
5071
5087
  if (e.current) {
5072
5088
  e.current.style.height = "";
5073
- const A = Math.min(fa, e.current.scrollHeight);
5074
- vr < A && (e.current.style.height = `${A}px`);
5089
+ const w = Math.min(fa, e.current.scrollHeight);
5090
+ vr < w && (e.current.style.height = `${w}px`);
5075
5091
  }
5076
5092
  n(C.target.value);
5077
5093
  };
5078
- return p ? /* @__PURE__ */ r.createElement(Kn, null, /* @__PURE__ */ r.createElement(Wn, null, /* @__PURE__ */ r.createElement(jn, null, /* @__PURE__ */ r.createElement(qn, { disabled: !0, placeholder: E }), /* @__PURE__ */ r.createElement(Zn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(Kn, null, /* @__PURE__ */ r.createElement(Wn, null, /* @__PURE__ */ r.createElement(Pu, null), /* @__PURE__ */ r.createElement(jn, null, /* @__PURE__ */ r.createElement(
5094
+ return p ? /* @__PURE__ */ r.createElement(Kn, null, /* @__PURE__ */ r.createElement(Gn, null, /* @__PURE__ */ r.createElement(jn, null, /* @__PURE__ */ r.createElement(qn, { disabled: !0, placeholder: E }), /* @__PURE__ */ r.createElement(Zn, { disabled: !0 })))) : /* @__PURE__ */ r.createElement(Kn, null, /* @__PURE__ */ r.createElement(Gn, null, /* @__PURE__ */ r.createElement(Pu, null), /* @__PURE__ */ r.createElement(jn, null, /* @__PURE__ */ r.createElement(
5079
5095
  qn,
5080
5096
  {
5081
5097
  ref: e,
@@ -5095,19 +5111,19 @@ const Ru = (e, t) => {
5095
5111
  color: ${u.color.information.main};
5096
5112
  `};
5097
5113
  }
5098
- `, Gu = L(() => import("./B2a3pL8a.js").then((e) => ({ default: e.MarkdownText }))), Wu = () => {
5114
+ `, Wu = L(() => import("./DINOaKB4.js").then((e) => ({ default: e.MarkdownText }))), Gu = () => {
5099
5115
  const { aiAgentInfo: e, userSession: t } = te(), { messageSource: n, channelSource: o } = ie(), [s, i] = T(null), a = qt("special-notice", o.channel), l = O(() => o.channel ? a ? n.messages.some((c) => He(c, (t == null ? void 0 : t.userId) ?? "")) : !0 : null, [o.channel, a, n.messages, t == null ? void 0 : t.userId]);
5100
5116
  return U(() => {
5101
5117
  s || i(l());
5102
- }, [l, s]), s ? null : /* @__PURE__ */ r.createElement(zu, null, /* @__PURE__ */ r.createElement(Gu, null, e.specialNotice));
5103
- }, ju = () => /* @__PURE__ */ r.createElement(qu, null, /* @__PURE__ */ r.createElement(Wu, null), /* @__PURE__ */ r.createElement(Lu, null, /* @__PURE__ */ r.createElement(Vu, null))), qu = h.div`z-index:0;border:none;width:100%;`, Ku = () => {
5118
+ }, [l, s]), s ? null : /* @__PURE__ */ r.createElement(zu, null, /* @__PURE__ */ r.createElement(Wu, null, e.specialNotice));
5119
+ }, ju = () => /* @__PURE__ */ r.createElement(qu, null, /* @__PURE__ */ r.createElement(Gu, null), /* @__PURE__ */ r.createElement(Lu, null, /* @__PURE__ */ r.createElement(Vu, null))), qu = h.div`z-index:0;border:none;width:100%;`, Ku = () => {
5104
5120
  var s;
5105
- const { testerType: e } = Le(), { channelSource: t } = ie(), n = Se(t.channel), o = !!e && ((s = t.channel) == null ? void 0 : s.isAIAgent);
5121
+ const { testerType: e } = Le(), { channelSource: t } = ie(), n = Te(t.channel), o = !!e && ((s = t.channel) == null ? void 0 : s.isAIAgent);
5106
5122
  return n && o ? /* @__PURE__ */ r.createElement(Mu, null) : /* @__PURE__ */ r.createElement(ju, null);
5107
5123
  }, Pr = ({ channel: e, size: t = 40 }) => {
5108
5124
  const { userSession: n, aiAgentInfo: o } = te(), { fallbackIcon: s, url: i } = fr({ channel: e, aiAgentInfo: o, userSession: n }), a = gt();
5109
5125
  return i ? /* @__PURE__ */ r.createElement(Xt, { src: i, size: t }) : /* @__PURE__ */ r.createElement(Zu, { $size: t, $bgColor: a.colors.base.primary }, /* @__PURE__ */ r.createElement(D, { type: s, size: t * 0.55, color: a.colors.base.primaryContrastContent }));
5110
- }, Zu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;border-radius:50%;background-color:${({ $bgColor: e }) => e};display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Yu = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(Pt, null, t, /* @__PURE__ */ r.createElement(Qu, { $position: n }, /* @__PURE__ */ r.createElement(em, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(Xu, { $position: n }))), Xu = ({ $position: e }) => /* @__PURE__ */ r.createElement(
5126
+ }, Zu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;border-radius:50%;background-color:${({ $bgColor: e }) => e};display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Yu = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(Ut, null, t, /* @__PURE__ */ r.createElement(Qu, { $position: n }, /* @__PURE__ */ r.createElement(em, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(Xu, { $position: n }))), Xu = ({ $position: e }) => /* @__PURE__ */ r.createElement(
5111
5127
  "svg",
5112
5128
  {
5113
5129
  style: { transform: e === "top" ? "rotate(0)" : "rotate(180deg)" },
@@ -5119,9 +5135,9 @@ const Ru = (e, t) => {
5119
5135
  },
5120
5136
  /* @__PURE__ */ r.createElement("path", { d: "M6 6L0 0h12L6 6Z", fill: u.themedColor.textHighEmphasis })
5121
5137
  ), Ju = {
5122
- top: k`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
5123
- bottom: k`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
5124
- }, Pt = h.div`position:relative;`, Qu = h.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Oe.TOOLTIP};${({ $position: e }) => Ju[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Pt}:hover &,${Pt}:focus-within &{opacity:1;}`, em = h(I)`padding:6px 8px;background:${u.themedColor.textHighEmphasis};color:${u.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, tm = () => {
5138
+ top: I`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
5139
+ bottom: I`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
5140
+ }, Ut = h.div`position:relative;`, Qu = h.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Oe.TOOLTIP};${({ $position: e }) => Ju[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Ut}:hover &,${Ut}:focus-within &{opacity:1;}`, em = h(k)`padding:6px 8px;background:${u.themedColor.textHighEmphasis};color:${u.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, tm = () => {
5125
5141
  const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = K(), { stringSet: i } = z(), { channelSource: a, onNavigateToConversationList: l } = ie(), { aiAgentInfo: c, userSession: d } = te(), m = a.channel, E = je() ? 24 : 16, y = fr({ channel: m, userSession: d, aiAgentInfo: c }), x = () => {
5126
5142
  e.setOpened(!1);
5127
5143
  }, b = async () => {
@@ -5167,7 +5183,7 @@ const Ru = (e, t) => {
5167
5183
  size: e,
5168
5184
  color: n ? u.themedColor.textDisabled : u.themedColor.textHighEmphasis
5169
5185
  }
5170
- ))), im = h.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, am = h.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, lm = h.div`display:flex;gap:10px;align-items:center;justify-content:center;`, cm = h(I)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Xe = h.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, dm = () => {
5186
+ ))), im = h.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, am = h.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, lm = h.div`display:flex;gap:10px;align-items:center;justify-content:center;`, cm = h(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Xe = h.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, dm = () => {
5171
5187
  const { isActionbookTester: e } = Le();
5172
5188
  return e ? null : /* @__PURE__ */ r.createElement(tm, null);
5173
5189
  }, um = ({
@@ -5189,7 +5205,7 @@ const Ru = (e, t) => {
5189
5205
  onClearChannelUrl: o ?? a,
5190
5206
  shouldMarkAsRead: s
5191
5207
  },
5192
- /* @__PURE__ */ r.createElement(Bt, null, /* @__PURE__ */ r.createElement(Bt.Consumer, null, (p) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(gm, { ...p }, /* @__PURE__ */ r.createElement(d, null)), e)))
5208
+ /* @__PURE__ */ r.createElement(Ft, null, /* @__PURE__ */ r.createElement(Ft.Consumer, null, (p) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(gm, { ...p }, /* @__PURE__ */ r.createElement(d, null)), e)))
5193
5209
  ));
5194
5210
  }, cn = Me({
5195
5211
  template: mm,
@@ -5211,7 +5227,7 @@ const gm = h.div`height:100%;width:100%;display:flex;flex-direction:column;flex:
5211
5227
  function pm({
5212
5228
  conversationListLimit: e,
5213
5229
  conversationListFilter: t,
5214
- onOpenConversationView: n = Te,
5230
+ onOpenConversationView: n = Ae,
5215
5231
  children: o
5216
5232
  }) {
5217
5233
  return /* @__PURE__ */ r.createElement(
@@ -5227,17 +5243,17 @@ const fm = ({ channel: e }) => /* @__PURE__ */ r.createElement(Pr, { channel: e
5227
5243
  template: bm,
5228
5244
  // Note: 리스트 변경되면 디자인 변경 가능성이 있어서 일단 컴포넌트는 비워둠
5229
5245
  components: {}
5230
- }), Ut = 99;
5246
+ }), Ht = 99;
5231
5247
  function bm(e) {
5232
- const { channel: t, onClick: n } = e, { stringSet: o, format: s } = z(), i = zo(t), a = Go(t, s, {
5248
+ const { channel: t, onClick: n } = e, { stringSet: o, format: s } = z(), i = zo(t), a = Wo(t, s, {
5233
5249
  justNow: o.DATE_FORMAT__JUST_NOW,
5234
5250
  minutesAgo: o.DATE_FORMAT__MINUTES_AGO,
5235
5251
  hoursAgo: o.DATE_FORMAT__HOURS_AGO,
5236
5252
  dateShortFormat: o.DATE_FORMAT__DATE_SHORT
5237
5253
  }), l = t.unreadMessageCount;
5238
- return /* @__PURE__ */ r.createElement(Em, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(xm, null, /* @__PURE__ */ r.createElement(fm, { ...e })), /* @__PURE__ */ r.createElement(vm, null, /* @__PURE__ */ r.createElement(ym, null, /* @__PURE__ */ r.createElement(I, { variant: "subtitle1", color: u.themedColor.textHighEmphasis, maxTextLines: 1 }, i), /* @__PURE__ */ r.createElement(_m, null, Se(t) && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(I, { variant: "caption1", color: u.themedColor.textMidEmphasis, maxTextLines: 1 }, o.CONVERSATION_LIST__ENDED), /* @__PURE__ */ r.createElement(Cm, null)), /* @__PURE__ */ r.createElement(I, { variant: "caption2", color: u.themedColor.textLowEmphasis, maxTextLines: 1 }, a))), l > 0 && /* @__PURE__ */ r.createElement(Sm, { $count: l }, /* @__PURE__ */ r.createElement(I, { variant: "caption3", color: u.themedColor.textHighEmphasisInverse }, l <= Ut ? l : `${Ut}+`))));
5254
+ return /* @__PURE__ */ r.createElement(Em, { role: "button", onClick: () => n == null ? void 0 : n() }, /* @__PURE__ */ r.createElement(xm, null, /* @__PURE__ */ r.createElement(fm, { ...e })), /* @__PURE__ */ r.createElement(vm, null, /* @__PURE__ */ r.createElement(ym, null, /* @__PURE__ */ r.createElement(k, { variant: "subtitle1", color: u.themedColor.textHighEmphasis, maxTextLines: 1 }, i), /* @__PURE__ */ r.createElement(_m, null, Te(t) && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(k, { variant: "caption1", color: u.themedColor.textMidEmphasis, maxTextLines: 1 }, o.CONVERSATION_LIST__ENDED), /* @__PURE__ */ r.createElement(Cm, null)), /* @__PURE__ */ r.createElement(k, { variant: "caption2", color: u.themedColor.textLowEmphasis, maxTextLines: 1 }, a))), l > 0 && /* @__PURE__ */ r.createElement(Sm, { $count: l }, /* @__PURE__ */ r.createElement(k, { variant: "caption3", color: u.themedColor.textHighEmphasisInverse }, l <= Ht ? l : `${Ht}+`))));
5239
5255
  }
5240
- const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;box-sizing:border-box;gap:16px;cursor:pointer;`, xm = h.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`, vm = h.div`display:flex;flex-direction:row;align-items:center;flex:1;padding-inline-end:16px;height:100%;gap:8px;border-bottom:1px solid ${u.themedColor.textDisabled};`, ym = h.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`, _m = h.div`display:flex;align-items:center;gap:6px;`, Cm = h.div`width:2px;height:2px;border-radius:1px;background-color:${u.themedColor.textLowEmphasis};`, Sm = h.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${u.themedColor.error};${({ $count: e }) => e <= Ut && k`
5256
+ const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;box-sizing:border-box;gap:16px;cursor:pointer;`, xm = h.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`, vm = h.div`display:flex;flex-direction:row;align-items:center;flex:1;padding-inline-end:16px;height:100%;gap:8px;border-bottom:1px solid ${u.themedColor.textDisabled};`, ym = h.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`, _m = h.div`display:flex;align-items:center;gap:6px;`, Cm = h.div`width:2px;height:2px;border-radius:1px;background-color:${u.themedColor.textLowEmphasis};`, Sm = h.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${u.themedColor.error};${({ $count: e }) => e <= Ht && I`
5241
5257
  width: 20px;
5242
5258
  `}
5243
5259
  `, Tm = ({ items: e, renderItem: t, onEndReached: n }) => {
@@ -5259,7 +5275,7 @@ const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
5259
5275
  {
5260
5276
  key: s.url,
5261
5277
  channel: s,
5262
- onClick: () => n(s.url, Se(s) ? "closed" : "open"),
5278
+ onClick: () => n(s.url, Te(s) ? "closed" : "open"),
5263
5279
  channelUrl: s.url,
5264
5280
  title: (a = (i = s.conversation) == null ? void 0 : i.topics) == null ? void 0 : a.join(", "),
5265
5281
  lastMessageTimestamp: (l = s.lastMessage) == null ? void 0 : l.createdAt
@@ -5271,10 +5287,10 @@ const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
5271
5287
  }
5272
5288
  }
5273
5289
  ) : /* @__PURE__ */ r.createElement(ze, { type: "loading" });
5274
- }, Im = () => {
5290
+ }, km = () => {
5275
5291
  const { stringSet: e } = z(), { language: t, countryCode: n, context: o } = K(), { aiAgentInfo: s, refreshActiveChannel: i, createConversation: a, setActiveChannel: l } = te(), { onOpenConversationView: c } = Ur();
5276
5292
  return /* @__PURE__ */ r.createElement(
5277
- km,
5293
+ Im,
5278
5294
  {
5279
5295
  role: "button",
5280
5296
  onClick: async () => {
@@ -5294,12 +5310,12 @@ const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
5294
5310
  },
5295
5311
  /* @__PURE__ */ r.createElement($m, { variant: "h1" }, e.TALK_TO_AGENT)
5296
5312
  );
5297
- }, km = h.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, $m = h(I)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Mm = () => {
5313
+ }, Im = h.div`background-color:${({ theme: e }) => e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`, $m = h(k)`color:${({ theme: e }) => e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`, Mm = () => {
5298
5314
  const { state: e } = K(), { stringSet: t } = z(), o = je() ? 24 : 16, s = () => {
5299
5315
  e.setOpened(!1);
5300
5316
  };
5301
5317
  return /* @__PURE__ */ r.createElement(Lm, null, /* @__PURE__ */ r.createElement(Dm, { variant: "h2", color: u.themedColor.textHighEmphasis }, t.CONVERSATION_LIST__HEADER_TITLE), /* @__PURE__ */ r.createElement(Rm, null, /* @__PURE__ */ r.createElement(Om, { size: o, onClick: s })), /* @__PURE__ */ r.createElement(Nm, null));
5302
- }, Om = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Bm, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(D, { type: "close", size: e, color: u.themedColor.textHighEmphasis })), Lm = h.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Dm = h(I)`padding:0 4px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Rm = h.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Nm = h.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${u.themedColor.textDisabled};`, Bm = h.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Fm = ({
5318
+ }, Om = ({ size: e, disabled: t, onClick: n }) => /* @__PURE__ */ r.createElement(Bm, { "aria-label": "close messenger", onClick: n, disabled: t }, /* @__PURE__ */ r.createElement(D, { type: "close", size: e, color: u.themedColor.textHighEmphasis })), Lm = h.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, Dm = h(k)`padding:0 4px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`, Rm = h.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Nm = h.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${u.themedColor.textDisabled};`, Bm = h.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Fm = ({
5303
5319
  conversationListLimit: e,
5304
5320
  conversationListFilter: t,
5305
5321
  children: n,
@@ -5321,14 +5337,14 @@ const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
5321
5337
  components: {
5322
5338
  Header: Mm,
5323
5339
  Body: wm,
5324
- Footer: Im
5340
+ Footer: km
5325
5341
  }
5326
5342
  });
5327
5343
  function Pm() {
5328
5344
  const { components: e } = dn.useContext();
5329
5345
  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));
5330
5346
  }
5331
- const Um = h.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Hm = k`:where(#${se.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Vm = [Hm, Ni, Bi], zm = (e, ...t) => Eo(e, ...Vm, ...t), Gm = zm``, Wm = Po(
5347
+ const Um = h.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({ theme: e }) => e.colors.base.background};`, Hm = I`:where(#${se.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`, Vm = [Hm, Ni, Bi], zm = (e, ...t) => Eo(e, ...Vm, ...t), Wm = zm``, Gm = Po(
5332
5348
  cn,
5333
5349
  Ve,
5334
5350
  nn,
@@ -5347,7 +5363,7 @@ function jm({
5347
5363
  messageTemplate: a,
5348
5364
  theme: l
5349
5365
  }) {
5350
- return Vi(Ti, t), /* @__PURE__ */ r.createElement(xo, { target: t }, /* @__PURE__ */ r.createElement(Pi, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(oi, { internalVariables: a == null ? void 0 : a.__internalVariables }, /* @__PURE__ */ r.createElement(Ri, { stringSet: s, logger: n, language: o }, /* @__PURE__ */ r.createElement(Wm, null, i, /* @__PURE__ */ r.createElement(Gm, null))))));
5366
+ return Vi(Ti, t), /* @__PURE__ */ r.createElement(xo, { target: t }, /* @__PURE__ */ r.createElement(Pi, { rootElement: t, logger: n, appearance: e, theme: l }, /* @__PURE__ */ r.createElement(oi, { internalVariables: a == null ? void 0 : a.__internalVariables }, /* @__PURE__ */ r.createElement(Ri, { stringSet: s, logger: n, language: o }, /* @__PURE__ */ r.createElement(Gm, null, i, /* @__PURE__ */ r.createElement(Wm, null))))));
5351
5367
  }
5352
5368
  const st = {}, it = {
5353
5369
  getItem: (e) => {
@@ -5383,7 +5399,7 @@ const st = {}, it = {
5383
5399
  return Object.keys(st).filter((t) => t.startsWith(e));
5384
5400
  }
5385
5401
  }
5386
- }, Vr = We(function({
5402
+ }, Vr = Ge(function({
5387
5403
  rootElement: t = document.body,
5388
5404
  logLevel: n = Jn.WARN,
5389
5405
  language: o = navigator.language,
@@ -5404,7 +5420,7 @@ const st = {}, it = {
5404
5420
  theme: a.theme
5405
5421
  },
5406
5422
  /* @__PURE__ */ r.createElement(
5407
- Wi,
5423
+ Gi,
5408
5424
  {
5409
5425
  rootElement: t,
5410
5426
  keyValueStorage: {
@@ -5455,7 +5471,7 @@ function Xm({
5455
5471
  backgroundColor: l,
5456
5472
  size: c = Zm
5457
5473
  }) {
5458
- const d = Ot(l), m = Math.round(c * Ym);
5474
+ const d = Lt(l), m = Math.round(c * Ym);
5459
5475
  return /* @__PURE__ */ r.createElement(
5460
5476
  eg,
5461
5477
  {
@@ -5472,7 +5488,7 @@ function Xm({
5472
5488
  /* @__PURE__ */ r.createElement(ng, { $isOpened: t, $animated: a, $fillColor: d, $iconSize: m }, /* @__PURE__ */ r.createElement(Yn.Close, { size: m }))
5473
5489
  );
5474
5490
  }
5475
- const Jm = k`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, Qm = k`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 === xr.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, Gr = k`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => k`
5491
+ const Jm = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`, Qm = I`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 === xr.WHITE ? "grayscale(100%) brightness(2000%)" : "grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`, Wr = I`svg{width:${({ $iconSize: e }) => e}px;height:${({ $iconSize: e }) => e}px;${({ $fillColor: e }) => I`
5476
5492
  path {
5477
5493
  fill: ${e};
5478
5494
  }
@@ -5481,7 +5497,7 @@ const Jm = k`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
5481
5497
  }
5482
5498
  `}
5483
5499
  }
5484
- `, eg = h.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 && Jm}`, Wr = h.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;`, tg = h(Wr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${Qm}${Gr}`, ng = h(Wr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${Gr}`, Yn = {
5500
+ `, eg = h.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 && Jm}`, Gr = h.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;`, tg = h(Gr)`opacity:${({ $isOpened: e }) => e ? 0 : 1};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(-90deg) scale(0)" : "rotate(0deg)")};${Qm}${Wr}`, ng = h(Gr)`scale:${({ $isOpened: e }) => e ? 1 : 0};transform:${({ $animated: e, $isOpened: t }) => e && (t ? "rotate(0deg)" : "rotate(-90deg)")};${Wr}`, Yn = {
5485
5501
  Open: (e) => e.url ? /* @__PURE__ */ r.createElement("img", { src: e.url, alt: "launcher-img", "data-default-icon": e.isDefaultIcon }) : /* @__PURE__ */ r.createElement(D, { size: e.size, type: "bot-filled" }),
5486
5502
  Close: ({ size: e }) => /* @__PURE__ */ r.createElement(D, { size: e, type: "chevron-down" })
5487
5503
  };
@@ -5520,7 +5536,7 @@ function og() {
5520
5536
  t.opened ? a() : (l(), n.debug("useSDKInactivityTimeout: schedule disconnect"));
5521
5537
  }, [o, e, t.opened]);
5522
5538
  }
5523
- const qr = Ge(null);
5539
+ const qr = We(null);
5524
5540
  function Kr() {
5525
5541
  const e = pe(qr);
5526
5542
  if (!e)
@@ -5531,7 +5547,7 @@ function Zr({ children: e }) {
5531
5547
  const t = Kr();
5532
5548
  return typeof e == "function" ? e(t) : /* @__PURE__ */ r.createElement(r.Fragment, null, e);
5533
5549
  }
5534
- const sg = Qn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, ig = Qn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, ag = k`animation-name:${sg};animation-duration:0.3s;animation-fill-mode:forwards;`, lg = k``, cg = k`animation-name:${ig};animation-duration:0.3s;animation-fill-mode:forwards;`, dg = k`visibility:hidden;`, ug = h.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
5550
+ const sg = Qn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY(0px);opacity:1;}`, ig = Qn`0%{transform:translateY(0px);opacity:1;}100%{transform:translateY(40px);opacity:0;}`, ag = I`animation-name:${sg};animation-duration:0.3s;animation-fill-mode:forwards;`, lg = I``, cg = I`animation-name:${ig};animation-duration:0.3s;animation-fill-mode:forwards;`, dg = I`visibility:hidden;`, ug = h.div`position:absolute;top:0;left:0;width:100%;height:100%;${({ $transitionState: e }) => {
5535
5551
  switch (e) {
5536
5552
  case "entering":
5537
5553
  return ag;
@@ -5544,9 +5560,9 @@ const sg = Qn`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
5544
5560
  default:
5545
5561
  return "";
5546
5562
  }
5547
- }}${({ $active: e }) => e ? k`
5563
+ }}${({ $active: e }) => e ? I`
5548
5564
  z-index: 999;
5549
- ` : k`z-index:1;pointer-events:none;`}
5565
+ ` : I`z-index:1;pointer-events:none;`}
5550
5566
  `;
5551
5567
  function at({ initialId: e, children: t }) {
5552
5568
  const [n, o] = T([e]), s = n[n.length - 1], i = O((f, g) => {
@@ -5653,7 +5669,7 @@ function hg({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
5653
5669
  const { dir: s } = K();
5654
5670
  return /* @__PURE__ */ r.createElement(pg, null, /* @__PURE__ */ r.createElement(fg, { dir: s, id: se.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
5655
5671
  }
5656
- const pg = h.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, fg = h.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 && Eg};${({ $isExpanded: e }) => e && bg};`, bg = k`width:743px;height:723px;`, Eg = k`z-index:${Oe.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;`, qg = We(function({ children: e, ...t }, n) {
5672
+ const pg = h.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, fg = h.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 && Eg};${({ $isExpanded: e }) => e && bg};`, bg = I`width:743px;height:723px;`, Eg = I`z-index:${Oe.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;`, qg = Ge(function({ children: e, ...t }, n) {
5657
5673
  const o = je(), [s, i] = T(), a = o ? zr : hg;
5658
5674
  return /* @__PURE__ */ r.createElement(Vr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Er, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(a, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(jr, null) }, /* @__PURE__ */ r.createElement(
5659
5675
  Yr,
@@ -5686,7 +5702,7 @@ function Xr(e, t, n, o = 0) {
5686
5702
  c = `bottom: calc(${ae(i)} + ${o}px)`;
5687
5703
  break;
5688
5704
  }
5689
- return k`${c};${d};`;
5705
+ return I`${c};${d};`;
5690
5706
  }
5691
5707
  function vg(e) {
5692
5708
  const { horizontal: t, vertical: n, margin: o, launcherSize: s } = un();
@@ -5718,7 +5734,7 @@ const Cg = h.div`background:${({ theme: e }) => e.colors.base.background};displa
5718
5734
 
5719
5735
  ${({ $isOpened: e }) => e && Tg};
5720
5736
  ${({ $isExpanded: e }) => e && Sg};
5721
- `, Sg = k`width:743px;height:723px;`, Tg = k`z-index:${Oe.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;`, Jr = { top: 24, bottom: 24, start: 24, end: 24 }, Ag = We(function({ children: e, ...t }, n) {
5737
+ `, Sg = I`width:743px;height:723px;`, Tg = I`z-index:${Oe.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;`, Jr = { top: 24, bottom: 24, start: 24, end: 24 }, Ag = Ge(function({ children: e, ...t }, n) {
5722
5738
  const [o, s] = T(), [i, a] = T("end-bottom"), [l, c] = T(Jr), [d, m] = T(48), p = je(), E = p ? zr : _g, { horizontal: y, vertical: x } = ne(() => {
5723
5739
  const [b, f] = i.split("-");
5724
5740
  return { horizontal: b === "start" ? "start" : "end", vertical: f === "top" ? "top" : "bottom" };
@@ -5742,7 +5758,7 @@ const Cg = h.div`background:${({ theme: e }) => e.colors.base.background};displa
5742
5758
  }), wg = (e) => {
5743
5759
  var s, i, a, l;
5744
5760
  const { setPosition: t, setMargin: n, setLauncherSize: o } = un();
5745
- return Ce(() => {
5761
+ return Se(() => {
5746
5762
  e.position && t(e.position), e.margin && n({ ...Jr, ...e.margin }), e.launcherSize && o(e.launcherSize);
5747
5763
  }, [
5748
5764
  e.position,
@@ -5770,13 +5786,13 @@ export {
5770
5786
  jm as b,
5771
5787
  u as c,
5772
5788
  te as d,
5773
- Gg as e,
5789
+ Wg as e,
5774
5790
  z as f,
5775
5791
  qm as g,
5776
5792
  qg as h,
5777
5793
  um as i,
5778
5794
  cn as j,
5779
- Wg as k,
5795
+ Gg as k,
5780
5796
  Rd as l,
5781
5797
  wi as m,
5782
5798
  ie as n,