@sendbird/ai-agent-messenger-react 1.2.3 → 1.2.5

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.
@@ -1,12 +1,12 @@
1
1
  import * as r from "react";
2
- import { createContext as Te, useContext as re, useEffect as D, useState as S, useId as bn, useRef as F, useCallback as U, useLayoutEffect as ce, forwardRef as Re, useImperativeHandle as vr, lazy as w, Suspense as Oe, useMemo as ve, Component as _r, Fragment as Bt, useReducer as Sr, Children as Tr } from "react";
2
+ import { createContext as Te, useContext as re, useEffect as D, useState as S, useId as bn, useRef as F, useCallback as U, useLayoutEffect as ce, forwardRef as Re, useImperativeHandle as yr, lazy as w, Suspense as Oe, useMemo as ye, Component as _r, Fragment as Bt, useReducer as Sr, Children as Tr } from "react";
3
3
  import wr, { SendbirdProduct as kr, DeviceOsPlatform as Ft, SendbirdPlatform as Ar, ConnectionHandler as Qe, SendbirdError as Ir, SessionHandler as $r, LogLevel as xn, ConnectionState as Mr } from "@sendbird/chat";
4
4
  import u, { css as $, ThemeProvider as Or, useTheme as Et, createGlobalStyle as Lr, StyleSheetManager as Rr, keyframes as En } from "styled-components";
5
5
  import { format as Cn, isSameMinute as Ut, isSameDay as Dr } from "date-fns";
6
6
  import { enUS as Nr } from "date-fns/locale/en-US";
7
7
  import { AIAgentModule as Pr, ConversationStatus as W, ConversationType as Br } from "@sendbird/chat/aiAgent";
8
- import { useGroupChannelMessages as Fr, useGroupChannelHandler as yn, useForceUpdate as Ur } from "@sendbird/uikit-tools";
9
- import { GroupChannelModule as Hr, GroupChannelListOrder as vn, GroupChannelHandler as zr } from "@sendbird/chat/groupChannel";
8
+ import { useGroupChannelMessages as Fr, useGroupChannelHandler as vn, useForceUpdate as Ur } from "@sendbird/uikit-tools";
9
+ import { GroupChannelModule as Hr, GroupChannelListOrder as yn, GroupChannelHandler as zr } from "@sendbird/chat/groupChannel";
10
10
  import { renderer as Vr, parser as Wr, MessageProvider as Gr } from "@sendbird/react-uikit-message-template-view";
11
11
  import { createMessageTemplate as jr } from "@sendbird/uikit-message-template";
12
12
  import _n from "dompurify";
@@ -142,7 +142,7 @@ const eo = () => {
142
142
  return { promise: new Promise((o, i) => {
143
143
  e = o, t = i;
144
144
  }), resolve: e, reject: t };
145
- }, to = "1.2.3", Ie = "sb-agent", no = to;
145
+ }, to = "1.2.5", Ie = "sb-agent", no = to;
146
146
  var Tn = /* @__PURE__ */ ((e) => (e[e.VERBOSE = 0] = "VERBOSE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.NONE = 5] = "NONE", e))(Tn || {});
147
147
  class wn {
148
148
  constructor(t) {
@@ -269,9 +269,9 @@ function uo({
269
269
  logger: d
270
270
  });
271
271
  D(() => {
272
- const C = async (v) => {
273
- const T = typeof (v == null ? void 0 : v.channelUrl) == "string";
274
- g && T && v.channelUrl !== g.url || (d.debug("conversation.dispatcher: try to close conversation", g), g != null && g.conversation && g.conversation.status === W.OPEN && (await g.closeConversation(), a == null || a()));
272
+ const C = async (y) => {
273
+ const T = typeof (y == null ? void 0 : y.channelUrl) == "string";
274
+ g && T && y.channelUrl !== g.url || (d.debug("conversation.dispatcher: try to close conversation", g), g != null && g.conversation && g.conversation.status === W.OPEN && (await g.closeConversation(), a == null || a()));
275
275
  };
276
276
  return m.subscribe(ht.ConversationClose, C), () => {
277
277
  m.unsubscribe(ht.ConversationClose, C);
@@ -294,16 +294,16 @@ function uo({
294
294
  if (((T = g == null ? void 0 : g.conversation) == null ? void 0 : T.status) === W.CLOSED)
295
295
  throw new Error("Conversation is closed");
296
296
  s && (C = await s(C));
297
- const v = await f.sendUserMessage(C, l);
298
- return l == null || l(v), v;
297
+ const y = await f.sendUserMessage(C, l);
298
+ return l == null || l(y), y;
299
299
  },
300
300
  sendFileMessage: async (C) => {
301
301
  var T;
302
302
  if (((T = g == null ? void 0 : g.conversation) == null ? void 0 : T.status) === W.CLOSED)
303
303
  throw new Error("Conversation is closed");
304
304
  s && (C = await s(C));
305
- const v = await f.sendFileMessage(C, l);
306
- return l == null || l(v), v;
305
+ const y = await f.sendFileMessage(C, l);
306
+ return l == null || l(y), y;
307
307
  }
308
308
  }
309
309
  };
@@ -339,7 +339,7 @@ class ho {
339
339
  */
340
340
  constructor(t, { filter: n, limit: o = 20 }) {
341
341
  var i, a, s, l, c;
342
- this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = vn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
342
+ this._isDisposed = !1, this._handlerId = `handler-id-${Date.now()}`, this._order = yn.LATEST_LAST_MESSAGE, this.filter = n, this._sdk = t, this._pinnedChannels = [], this._channels = [], this._limit = o, this._query = this._sdk.aiAgent.createMyGroupChannelListQuery({
343
343
  aiAgentChannelFilter: (i = this.filter) == null ? void 0 : i.aiAgentChannelFilter,
344
344
  aiAgentConversationStatusFilter: (a = this.filter) == null ? void 0 : a.aiAgentConversationStatusFilter,
345
345
  aiAgentIds: (s = this.filter) == null ? void 0 : s.aiAgentIds,
@@ -446,7 +446,7 @@ class ho {
446
446
  for (const b of t)
447
447
  o.has(b.url) ? i.push(b) : a.push(b);
448
448
  const s = this._upsertPinnedChannelsToArray(i), l = this._upsertRegularChannelsToArray(a, n), c = s.addedChannels.concat(l.addedChannels), d = s.updatedChannels.concat(l.updatedChannels), m = s.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);
449
- c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, c)), d.length > 0 && ((E = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsUpdated) == null || E.call(f, d)), m.length > 0 && this._removeChannelsFromView(m);
449
+ c.length > 0 && ((x = (p = this._collectionEventHandler) == null ? void 0 : p.onChannelsAdded) == null || x.call(p, {}, c)), d.length > 0 && ((E = (f = this._collectionEventHandler) == null ? void 0 : f.onChannelsUpdated) == null || E.call(f, {}, d)), m.length > 0 && this._removeChannelsFromView(m);
450
450
  }
451
451
  /**
452
452
  * Removes channels from the collection by their URLs.
@@ -463,7 +463,7 @@ class ho {
463
463
  const c = this._channels.findIndex((d) => d.url === l);
464
464
  c >= 0 && (o.push(l), this._channels.splice(c, 1));
465
465
  }
466
- o.length > 0 && ((s = (a = this._collectionEventHandler) == null ? void 0 : a.onChannelsDeleted) == null || s.call(a, o));
466
+ o.length > 0 && ((s = (a = this._collectionEventHandler) == null ? void 0 : a.onChannelsDeleted) == null || s.call(a, {}, o));
467
467
  }
468
468
  /**
469
469
  * Gets all channels in the collection.
@@ -496,7 +496,7 @@ class ho {
496
496
  * Sets the event handler for collection updates.
497
497
  * @param handler - Event handler for channel collection changes
498
498
  */
499
- setGroupChannelCollectionHandler(t) {
499
+ setConversationListCollectionHandler(t) {
500
500
  this._collectionEventHandler = t;
501
501
  }
502
502
  /**
@@ -525,7 +525,7 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
525
525
  return { place: e.length, oldPosition: -1 };
526
526
  }, Vt = (e, t, n) => {
527
527
  switch (n) {
528
- case vn.LATEST_LAST_MESSAGE:
528
+ case yn.LATEST_LAST_MESSAGE:
529
529
  if (e.lastMessage && t.lastMessage) {
530
530
  const o = t.lastMessage.createdAt - e.lastMessage.createdAt;
531
531
  return o === 0 ? t.createdAt - e.createdAt : o;
@@ -535,14 +535,14 @@ const gt = (e, t) => e.findIndex((n) => n.isIdentical(t)), go = (e, t, n) => {
535
535
  }
536
536
  };
537
537
  function po(e, t) {
538
- var f, E, b, C, v, T, _, K;
538
+ var f, E, b, C, y, T, _, K;
539
539
  const n = bn(), [o, i] = S(!1), [a, s] = S(null), [l, c] = S([]), [d, m] = S(null), g = F(!1), p = U(async () => {
540
540
  if (!g.current && e.currentUser) {
541
541
  g.current = !0, i(!1), s(null), c([]);
542
542
  try {
543
543
  d == null || d.dispose();
544
544
  const L = new ho(e, t);
545
- L.setGroupChannelCollectionHandler({
545
+ L.setConversationListCollectionHandler({
546
546
  onChannelsAdded: () => {
547
547
  c(L.channels);
548
548
  },
@@ -563,7 +563,7 @@ function po(e, t) {
563
563
  e,
564
564
  (f = t.filter) == null ? void 0 : f.aiAgentChannelFilter,
565
565
  (b = (E = t.filter) == null ? void 0 : E.aiAgentConversationStatusFilter) == null ? void 0 : b.join(),
566
- (v = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : v.join(),
566
+ (y = (C = t.filter) == null ? void 0 : C.aiAgentIds) == null ? void 0 : y.join(),
567
567
  (T = t.filter) == null ? void 0 : T.deskChannelFilter,
568
568
  (K = (_ = t.filter) == null ? void 0 : _.pinnedChannelUrls) == null ? void 0 : K.join(),
569
569
  t.limit
@@ -635,7 +635,7 @@ function Co(e, t, n) {
635
635
  const c = (o + i) / 2;
636
636
  return o !== i && (l = c > 0.5 ? a / (2 - o - i) : a / (o + i)), o === e ? s = (t - n) / a + (t < n ? 6 : 0) : o === t ? s = (n - e) / a + 2 : o === n && (s = (e - t) / a + 4), s /= 6, [s, l, c];
637
637
  }
638
- function yo(e, t, n) {
638
+ function vo(e, t, n) {
639
639
  let o, i, a;
640
640
  if (t === 0)
641
641
  o = i = a = n;
@@ -648,10 +648,10 @@ function yo(e, t, n) {
648
648
  return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
649
649
  }
650
650
  function He(e, t, n) {
651
- const [o, i, a] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] = yo(s, m, d);
651
+ const [o, i, a] = xo(e), [s, l, c] = Co(o, i, a), d = Math.max(0, Math.min(1, c * t)), m = Math.max(0, Math.min(1, l * n)), [g, p, x] = vo(s, m, d);
652
652
  return Eo([Math.round(g), Math.round(p), Math.round(x)]);
653
653
  }
654
- function vo(e, t = "light") {
654
+ function yo(e, t = "light") {
655
655
  return {
656
656
  extraDark: He(e, 0.6, 1.2),
657
657
  dark: He(e, 0.85, 1.1),
@@ -797,7 +797,7 @@ function Wt(e) {
797
797
  };
798
798
  }
799
799
  function To({ selectedTheme: e, palette: t, primary: n }) {
800
- const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : vo(n, e) : ze.primary;
800
+ const o = t != null && t.primary ? t.primary : n ? n === ze.primary.main ? ze.primary : yo(n, e) : ze.primary;
801
801
  return {
802
802
  ...ze,
803
803
  primary: o,
@@ -1252,10 +1252,10 @@ const zo = ({
1252
1252
  CONVERSATION_LIST__NO_CONVERSATIONS: "No conversations yet",
1253
1253
  DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: "MM/dd/yyyy",
1254
1254
  DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
1255
- }, yt = { language: "en", dateLocale: Yo, stringSet: qo }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1255
+ }, vt = { language: "en", dateLocale: Yo, stringSet: qo }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1256
1256
  __proto__: null,
1257
- default: yt
1258
- }, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, yt]]);
1257
+ default: vt
1258
+ }, Symbol.toStringTag, { value: "Module" })), Ye = /* @__PURE__ */ new Map([[Ne, vt]]);
1259
1259
  async function Xo(e) {
1260
1260
  if (Ye.has(e))
1261
1261
  return Ye.get(e);
@@ -1264,7 +1264,7 @@ async function Xo(e) {
1264
1264
  const { default: n } = await Zo(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DvjrAXLD.js"), "./languages/en.ts": () => Promise.resolve().then(() => Jo), "./languages/es.ts": () => import("./zI14HLvP.js"), "./languages/fr.ts": () => import("./B9V0T5ZP.js"), "./languages/hi.ts": () => import("./YRQ0vk5Q.js"), "./languages/it.ts": () => import("./BQWJPfGp.js"), "./languages/ja.ts": () => import("./sl-YrKkN.js"), "./languages/ko.ts": () => import("./B8c_rqvH.js"), "./languages/pt.ts": () => import("./BSz49qaD.js"), "./languages/tr.ts": () => import("./D_eZyIAR.js") }), `./languages/${t}.ts`, 3);
1265
1265
  return Ye.set(e, n), n;
1266
1266
  } catch {
1267
- return yt;
1267
+ return vt;
1268
1268
  }
1269
1269
  }
1270
1270
  const {
@@ -1441,7 +1441,7 @@ const li = (e, t) => {
1441
1441
  let s = i.querySelector(`style#${a}`);
1442
1442
  s ? s.textContent !== e && (s.textContent = e) : (s = i.ownerDocument.createElement("style"), s.id = a, s.textContent = e, i.appendChild(s));
1443
1443
  }, [e, t]);
1444
- }, vt = /iPad|iPhone|iPod/.test(navigator.userAgent), di = /Android/.test(navigator.userAgent), Pe = (e) => vt || di, Q = "sb-agent", oe = {
1444
+ }, yt = /iPad|iPhone|iPod/.test(navigator.userAgent), di = /Android/.test(navigator.userAgent), Pe = (e) => yt || di, Q = "sb-agent", oe = {
1445
1445
  ENTRY: `${Q}-entry`,
1446
1446
  MODAL_ROOT: `${Q}-modal-root`,
1447
1447
  WINDOW: `${Q}-window`,
@@ -1611,7 +1611,7 @@ const xi = 24 * 60 * 60 * 1e3, {
1611
1611
  } = j("MessengerSession"), Ci = Re(function({ userSessionInfo: e, children: t }, n) {
1612
1612
  const { appId: o, aiAgentId: i, chatSDK: a, agentPreviewConfigs: s, state: l, logger: c, language: d, countryCode: m, context: g, handlers: p } = P(), { updateTheme: x } = An(), { authenticate: f, deauthenticate: E } = fi(), [b, C] = S(
1613
1613
  void 0
1614
- ), [v, T] = S(void 0), [_, K] = S(null), [L, se] = S(null), [xe, y] = S(null), B = s == null ? void 0 : s.forceCreateChannel;
1614
+ ), [y, T] = S(void 0), [_, K] = S(null), [L, se] = S(null), [xe, v] = S(null), B = s == null ? void 0 : s.forceCreateChannel;
1615
1615
  function Ee() {
1616
1616
  if (e && e.userId) {
1617
1617
  c.debug("messengerSession.initialize: manual session info detected");
@@ -1679,7 +1679,7 @@ const xi = 24 * 60 * 60 * 1e3, {
1679
1679
  },
1680
1680
  [_ == null ? void 0 : _.userId]
1681
1681
  );
1682
- return yn(a, {
1682
+ return vn(a, {
1683
1683
  onChannelChanged: (A) => {
1684
1684
  var I;
1685
1685
  A.isGroupChannel() && A.url === (b == null ? void 0 : b.url) && (c.info("messengerSession.channelChanged: channel.conversation", A.conversation), C({ url: A.url, status: ((I = A.conversation) == null ? void 0 : I.status) ?? W.OPEN }));
@@ -1689,20 +1689,21 @@ const xi = 24 * 60 * 60 * 1e3, {
1689
1689
  if (A.conversation && A.conversation.type === Br.PROACTIVE && I.userId === ((H = a.currentUser) == null ? void 0 : H.userId)) {
1690
1690
  c.info("messengerSession.onUserJoined: proactive channel joined", A.url);
1691
1691
  const ae = ((Ce = A.conversation) == null ? void 0 : Ce.status) ?? W.OPEN;
1692
- C({ url: A.url, status: ae }), l.setOpened(!0), yi({
1692
+ C({ url: A.url, status: ae }), l.setOpened(!0), vi({
1693
1693
  sound: document.hidden || !l.opened
1694
1694
  });
1695
1695
  }
1696
1696
  }
1697
- }), vr(n, () => {
1697
+ }), yr(n, () => {
1698
1698
  const A = async () => {
1699
1699
  if (!b) throw new Error("No active conversation. Please start a conversation first.");
1700
1700
  return await a.groupChannel.getChannel(b.url);
1701
1701
  };
1702
1702
  return {
1703
+ activeChannel: b,
1703
1704
  chatSDK: a,
1704
1705
  deauthenticate: async () => {
1705
- c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), K(null), se(null), y(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
1706
+ c.debug("messengerSession.deauthenticate: start"), await E(), C(void 0), K(null), se(null), v(null), _ && (Ge.clear({ appId: o, aiAgentId: i }), $e.clear({ appId: o, aiAgentId: i, userId: _.userId }), c.debug("messengerSession.deauthenticate: cleared user session cache")), c.debug("messengerSession.deauthenticate: completed");
1706
1707
  },
1707
1708
  updateContext: async (I) => {
1708
1709
  const H = await (await A()).updateContext(i, I);
@@ -1758,7 +1759,7 @@ const xi = 24 * 60 * 60 * 1e3, {
1758
1759
  specialNotice: M.bot.special_notice,
1759
1760
  specialNoticeEnabled: M.bot.is_special_notice_enabled,
1760
1761
  showHandoffButton: M.bot.show_handoff_button ?? !0
1761
- }), y({
1762
+ }), v({
1762
1763
  type: M.launcher.image_type || "default_icon",
1763
1764
  imageUrl: M.launcher.image_url
1764
1765
  }), M.launcher.auto_open && !Pe() && setTimeout(() => l.setOpened(!0), 500);
@@ -1787,7 +1788,7 @@ const xi = 24 * 60 * 60 * 1e3, {
1787
1788
  activeChannel: b,
1788
1789
  refreshActiveChannel: it,
1789
1790
  createConversation: st,
1790
- connectionError: v,
1791
+ connectionError: y,
1791
1792
  aiAgentInfo: { ...L, ...s == null ? void 0 : s.bot },
1792
1793
  launcherInfo: { ...xe, ...s == null ? void 0 : s.launcher }
1793
1794
  }
@@ -1795,7 +1796,7 @@ const xi = 24 * 60 * 60 * 1e3, {
1795
1796
  t
1796
1797
  );
1797
1798
  });
1798
- function yi({ sound: e }) {
1799
+ function vi({ sound: e }) {
1799
1800
  const t = "🔔You have received a new message", n = document.title, o = setInterval(() => {
1800
1801
  document.title = document.title === t ? n : t;
1801
1802
  }, 750);
@@ -1812,7 +1813,7 @@ const Y = (e) => {
1812
1813
  color: n,
1813
1814
  className: o,
1814
1815
  ...i
1815
- }) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }), jt = /* @__PURE__ */ new WeakMap(), vi = (e, t) => {
1816
+ }) => /* @__PURE__ */ r.createElement(_i, { as: e, $variant: t, className: o, $color: n, ...i }), jt = /* @__PURE__ */ new WeakMap(), yi = (e, t) => {
1816
1817
  let n = jt.get(t);
1817
1818
  n || (n = /* @__PURE__ */ new Map(), jt.set(t, n));
1818
1819
  const o = n.get(e);
@@ -1821,7 +1822,7 @@ const Y = (e) => {
1821
1822
  ${i.lineHeight ? `line-height: ${i.lineHeight};` : "line-height: 100%;"}
1822
1823
  `;
1823
1824
  return n.set(e, a), a;
1824
- }, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => vi(e, t.typography)}color:${({ $color: e }) => e};`, Be = 244, Bn = 640, Je = 26, Fn = 4, ie = 12, ke = 2, Si = 16, me = `${Q}-incoming-msg`, Ti = `${Q}-marked-text`;
1825
+ }, _i = u.span`font-stretch:normal;font-style:normal;letter-spacing:normal;${({ $variant: e, theme: t }) => yi(e, t.typography)}color:${({ $color: e }) => e};`, Be = 244, Bn = 640, Je = 26, Fn = 4, ie = 12, ke = 2, Si = 16, me = `${Q}-incoming-msg`, Ti = `${Q}-marked-text`;
1825
1826
  function St(e) {
1826
1827
  switch (e) {
1827
1828
  case "top":
@@ -1959,10 +1960,10 @@ function Wi(e) {
1959
1960
  value: e.slice(o).trim()
1960
1961
  }), n.map((i) => i.type !== "text" ? i : { ...i, value: Hn(i.value) });
1961
1962
  }
1962
- const Gi = w(async () => ({ default: (await import("./CDvzufwm.js")).MarkdownText })), ji = w(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
1963
+ const Gi = w(async () => ({ default: (await import("./7Dvv5RpD.js")).MarkdownText })), ji = w(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
1963
1964
  function Kt(e) {
1964
1965
  var i, a;
1965
- const t = e.maxBodyWidth ?? Be, n = ve(() => Wi(e.message), [e.message]), o = {
1966
+ const t = e.maxBodyWidth ?? Be, n = ye(() => Wi(e.message), [e.message]), o = {
1966
1967
  id: `${me}-text-body`,
1967
1968
  $maxWidth: t,
1968
1969
  $color: (i = e.customStyle) == null ? void 0 : i.bubbleContentColor,
@@ -2123,18 +2124,18 @@ function ps({
2123
2124
  )));
2124
2125
  }
2125
2126
  const fs = u.div`margin:16px 0;padding:0 ${ie}px;position:relative;display:flex;gap:8px;${({ $type: e }) => e === "vertical" ? xs : Es};`, bs = u(k)`box-sizing:border-box;padding:8px 12px;display:flex;align-items:center;border-radius:20px / clamp(20px,5%,100px);cursor:pointer;word-break:break-word;color:${h.color.primary.main};border:1px solid ${h.color.primary.main};background-color:${h.themedColor.bg_50_600};&:hover{background-color:${h.themedColor.bg_100_500};}${({ $type: e, theme: t }) => $`
2126
- ${e === "vertical" ? Cs : ys};
2127
+ ${e === "vertical" ? Cs : vs};
2127
2128
  &:active {
2128
2129
  background-color: ${t.colors.base.primary};
2129
2130
  color: ${t.colors.base.primaryContrastContent};
2130
2131
  }
2131
2132
  `}
2132
- `, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, ys = $`white-space:nowrap;`;
2133
+ `, xs = $`flex-direction:column;align-items:flex-end;`, Es = $`flex-direction:row;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}`, Cs = $`max-width:calc(100% - 70px);white-space:pre-wrap;`, vs = $`white-space:nowrap;`;
2133
2134
  function It(e) {
2134
2135
  return e();
2135
2136
  }
2136
2137
  const _e = we({
2137
- template: vs,
2138
+ template: ys,
2138
2139
  components: {
2139
2140
  SenderName: Xi,
2140
2141
  SenderAvatar: qi,
@@ -2147,7 +2148,7 @@ const _e = we({
2147
2148
  MessageLogs: ls
2148
2149
  }
2149
2150
  });
2150
- function vs(e) {
2151
+ function ys(e) {
2151
2152
  return /* @__PURE__ */ r.createElement(jn, { ...e, testerMode: !1 });
2152
2153
  }
2153
2154
  function jn(e) {
@@ -2204,7 +2205,7 @@ const $s = u.div`display:flex;flex-direction:column;align-items:flex-end;gap:${k
2204
2205
  `, Os = u.img`position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0;object-fit:cover;opacity:${(e) => e.$loaded ? 1 : 0};transition:opacity 0.5s ease;`;
2205
2206
  function Jt(e) {
2206
2207
  var n, o;
2207
- const t = ve(() => {
2208
+ const t = ye(() => {
2208
2209
  const i = Vi(Hn(e.message));
2209
2210
  return _n.sanitize(i);
2210
2211
  }, [e.message]);
@@ -2435,10 +2436,10 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
2435
2436
  onChange: (d) => s({ csatReason: d })
2436
2437
  }
2437
2438
  )), l !== "submitted" && t({ state: l, params: a }));
2438
- }, Ca = u.div`display:flex;flex-direction:column;gap:12px;`, ya = () => {
2439
+ }, Ca = u.div`display:flex;flex-direction:column;gap:12px;`, va = () => {
2439
2440
  const { stringSet: e } = R();
2440
2441
  return /* @__PURE__ */ r.createElement(k, { variant: "body2", color: h.themedColor.textMidEmphasis, style: { textAlign: "center" } }, e.CSAT_SUBMISSION_EXPIRED);
2441
- }, va = (e) => {
2442
+ }, ya = (e) => {
2442
2443
  if (e.messageType !== "admin.csat")
2443
2444
  throw new Error("Invalid message type");
2444
2445
  const t = Ur(), { stringSet: n } = R(), { extendedMessagePayload: o, csat: i, csatReason: a, csatExpireAt: s, isResolvedWhenDeterminedByUser: l, onSubmitCSAT: c } = e, { visibility: d, type: m } = (o == null ? void 0 : o.csat) ?? {};
@@ -2451,7 +2452,7 @@ const Ea = (e) => Sr((t, n) => ({ ...t, ...n }), e), dt = ({
2451
2452
  isResolved: x.isResolved
2452
2453
  }) : t();
2453
2454
  };
2454
- return /* @__PURE__ */ r.createElement(_a, null, !i && Qt(s) ? /* @__PURE__ */ r.createElement(ya, null) : /* @__PURE__ */ r.createElement(
2455
+ return /* @__PURE__ */ r.createElement(_a, null, !i && Qt(s) ? /* @__PURE__ */ r.createElement(va, null) : /* @__PURE__ */ r.createElement(
2455
2456
  g,
2456
2457
  {
2457
2458
  type: m,
@@ -2469,7 +2470,7 @@ const Mt = we({
2469
2470
  template: Ta,
2470
2471
  components: {
2471
2472
  AdminMessage: Vs,
2472
- CSATMessage: va
2473
+ CSATMessage: ya
2473
2474
  }
2474
2475
  });
2475
2476
  function Ta(e) {
@@ -2735,10 +2736,10 @@ xt.Consumer = ({ children: e }) => {
2735
2736
  return e({ onDrop: t, onDragOver: (i) => i.preventDefault() });
2736
2737
  };
2737
2738
  const Jd = ({ iconSize: e = 64, icon: t, className: n, label: o, children: i }) => /* @__PURE__ */ r.createElement(Ka, { className: n }, /* @__PURE__ */ r.createElement(O, { type: t, size: e, color: h.themedColor.textLowEmphasis }), /* @__PURE__ */ r.createElement(k, { variant: "body1", color: h.themedColor.textMidEmphasis }, o), i), ja = u.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`, Ka = u.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`, Za = {
2738
- loading: w(() => import("./CSENM0Ja.js")),
2739
- error: w(() => import("./Cj-eLEq_.js")),
2740
- noChannels: w(() => import("./DnQv_mT2.js")),
2741
- noMessages: w(() => import("./O53SSRM8.js"))
2739
+ loading: w(() => import("./BsmWumox.js")),
2740
+ error: w(() => import("./mlHVKYk3.js")),
2741
+ noChannels: w(() => import("./ClNlgaQQ.js")),
2742
+ noMessages: w(() => import("./DPH4j4kU.js"))
2742
2743
  }, Se = ({ className: e, type: t = "loading", ...n }) => {
2743
2744
  const o = Za[t];
2744
2745
  return /* @__PURE__ */ r.createElement(ja, { className: e }, /* @__PURE__ */ r.createElement(Oe, { fallback: null }, /* @__PURE__ */ r.createElement(o, { ...n })));
@@ -2827,7 +2828,7 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
2827
2828
  date: n = Date.now(),
2828
2829
  formatString: o = "MMMM dd, yyyy",
2829
2830
  style: i
2830
- }) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Cl = u.div`display:flex;justify-content:center;align-items:center;`, yl = Re(function(t, n) {
2831
+ }) => /* @__PURE__ */ r.createElement(Cl, { style: i, className: e }, /* @__PURE__ */ r.createElement(k, { variant: "caption4", color: h.themedColor.textMidEmphasis }, Cn(n, o, { locale: t }))), Cl = u.div`display:flex;justify-content:center;align-items:center;`, vl = Re(function(t, n) {
2831
2832
  const {
2832
2833
  messages: o,
2833
2834
  renderMessage: i,
@@ -2842,22 +2843,22 @@ const ol = u.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
2842
2843
  scrollPositionRef: x,
2843
2844
  scrollDistanceFromBottomRef: f,
2844
2845
  stackDirection: E = "top"
2845
- } = t, b = n && "current" in n ? n : { current: null }, C = F(!1), v = F(void 0), T = F(0), _ = F(0), K = F(0), L = x ?? _, se = f ?? K;
2846
+ } = t, b = n && "current" in n ? n : { current: null }, C = F(!1), y = F(void 0), T = F(0), _ = F(0), K = F(0), L = x ?? _, se = f ?? K;
2846
2847
  ce(() => {
2847
2848
  b.current && (b.current.scrollTop = b.current.scrollHeight);
2848
2849
  }, p), ce(() => {
2849
- b.current && (v.current === "top" && (b.current.scrollTop = b.current.scrollHeight - L.current), v.current === "bottom" && (b.current.scrollTop = T.current), v.current = void 0);
2850
+ b.current && (y.current === "top" && (b.current.scrollTop = b.current.scrollHeight - L.current), y.current === "bottom" && (b.current.scrollTop = T.current), y.current = void 0);
2850
2851
  }, [b.current, o.length]);
2851
2852
  const xe = async () => {
2852
2853
  if (!b.current) return;
2853
- const y = b.current;
2854
- if (g(vl(y)), L.current = y.scrollHeight - y.scrollTop, se.current = L.current - y.clientHeight, T.current = y.scrollTop, C.current) return;
2855
- const B = y.clientHeight * Math.min(Math.max(0, m), 1);
2856
- y.scrollTop <= B ? (C.current = !0, v.current = "top", await c(), C.current = !1) : y.scrollHeight - y.scrollTop - y.clientHeight <= B ? (C.current = !0, v.current = "bottom", await d(), C.current = !1) : v.current = void 0;
2854
+ const v = b.current;
2855
+ if (g(yl(v)), L.current = v.scrollHeight - v.scrollTop, se.current = L.current - v.clientHeight, T.current = v.scrollTop, C.current) return;
2856
+ const B = v.clientHeight * Math.min(Math.max(0, m), 1);
2857
+ v.scrollTop <= B ? (C.current = !0, y.current = "top", await c(), C.current = !1) : v.scrollHeight - v.scrollTop - v.clientHeight <= B ? (C.current = !0, y.current = "bottom", await d(), C.current = !1) : y.current = void 0;
2857
2858
  };
2858
- return /* @__PURE__ */ r.createElement(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((y, B) => i({ message: y, index: B })), s), /* @__PURE__ */ r.createElement(Tl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(wl, { id: "infinite-list-overlay" }, l)));
2859
+ return /* @__PURE__ */ r.createElement(_l, { id: "infinite-list-container" }, /* @__PURE__ */ r.createElement(Sl, { id: "infinite-list-inner", ref: b, onScroll: xe }, E === "bottom" && /* @__PURE__ */ r.createElement("div", { style: { flexGrow: 1 } }), a, o.map((v, B) => i({ message: v, index: B })), s), /* @__PURE__ */ r.createElement(Tl, { id: "infinite-list-overlay-container" }, /* @__PURE__ */ r.createElement(wl, { id: "infinite-list-overlay" }, l)));
2859
2860
  }), sn = 50;
2860
- function vl(e) {
2861
+ function yl(e) {
2861
2862
  return e.scrollTop <= sn ? "top" : e.scrollHeight - (e.scrollTop + e.clientHeight) <= sn ? "bottom" : "middle";
2862
2863
  }
2863
2864
  const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${h.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`, Tl = u.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`, wl = u.div`pointer-events:auto;`, kl = ({ className: e, onClick: t }) => /* @__PURE__ */ r.createElement(Al, { className: e, onClick: t, tabIndex: 0 }, /* @__PURE__ */ r.createElement(O, { size: 24, type: "chevron-down", color: h.color.primary.main })), Al = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${N.light`
@@ -2884,7 +2885,7 @@ const _l = u.div`display:flex;position:relative;flex:1;overflow:hidden;`, Sl = u
2884
2885
  }
2885
2886
  `, ir = () => {
2886
2887
  const { chatSDK: e } = P(), { channelSource: t } = q(), [n, o] = S([]);
2887
- return yn(e, {
2888
+ return vn(e, {
2888
2889
  onTypingStatusUpdated(i) {
2889
2890
  var a;
2890
2891
  if (i.url === ((a = t.channel) == null ? void 0 : a.url)) {
@@ -2976,32 +2977,32 @@ const Ol = ({ style: e }) => {
2976
2977
  e.START_NEW_CONVERSATION
2977
2978
  )) : null;
2978
2979
  }, Nl = u.div`display:flex;justify-content:center;margin:16px 0;`, Pl = u(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${h.themedColor.textDisabled};cursor:pointer;user-select:none;`, Bl = !0, Fl = () => {
2979
- const { Template: e } = $t.useContext(), { Template: t } = _e.useContext(), { Template: n } = Mt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = P(), { stringSet: m, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: f, scrollSource: E } = q(), { isActionbookTester: b } = Fe(), { filteredMessages: C, shouldShowOriginalDate: v, renderAgentPreviewWelcomeMessages: T } = Il(), { storage: _ } = $n(), K = ir(), L = It(() => {
2980
- const y = K[0];
2981
- if (!y) return null;
2982
- const B = y.userId === s.userId;
2983
- return { user: B ? s : y, isBot: B };
2980
+ const { Template: e } = $t.useContext(), { Template: t } = _e.useContext(), { Template: n } = Mt.useContext(), [o, i] = S(null), { userSession: a, aiAgentInfo: s } = z(), { agentPreviewConfigs: l, chatSDK: c, state: d } = P(), { stringSet: m, dateLocale: g } = R(), { conversation: p, channelSource: x, messageSource: f, scrollSource: E } = q(), { isActionbookTester: b } = Fe(), { filteredMessages: C, shouldShowOriginalDate: y, renderAgentPreviewWelcomeMessages: T } = Il(), { storage: _ } = $n(), K = ir(), L = It(() => {
2981
+ const v = K[0];
2982
+ if (!v) return null;
2983
+ const B = v.userId === s.userId;
2984
+ return { user: B ? s : v, isBot: B };
2984
2985
  });
2985
2986
  D(() => {
2986
2987
  L && E.scrollPubSub.publish({ type: "scrollToBottom", data: { animated: !0 } });
2987
2988
  }, [!!L, E.scrollPubSub.publish]);
2988
- const se = (y, B = !1) => {
2989
+ const se = (v, B = !1) => {
2989
2990
  var Ee;
2990
- return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId === y.sender.userId)) ?? y.sender;
2991
+ return B ? s : ((Ee = x.channel) == null ? void 0 : Ee.members.find((J) => J.userId === v.sender.userId)) ?? v.sender;
2991
2992
  }, xe = () => {
2992
2993
  if (!f.initialized)
2993
2994
  return /* @__PURE__ */ r.createElement(Se, { type: "loading" });
2994
2995
  if (f.messages.length === 0) {
2995
- const y = T();
2996
- return y ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, y) : /* @__PURE__ */ r.createElement(Se, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
2996
+ const v = T();
2997
+ return v ? /* @__PURE__ */ r.createElement("div", { style: { width: "100%" } }, v) : /* @__PURE__ */ r.createElement(Se, { type: "noMessages", label: m.PLACE_HOLDER__NO_MESSAGES });
2997
2998
  }
2998
2999
  return /* @__PURE__ */ r.createElement(
2999
- yl,
3000
+ vl,
3000
3001
  {
3001
3002
  ref: E.scrollRef,
3002
3003
  scrollPositionRef: E.scrollPositionRef,
3003
3004
  scrollDistanceFromBottomRef: E.scrollDistanceFromBottomRef,
3004
- onScrollPosition: (y) => E.setIsScrollBottomReached(y === "bottom"),
3005
+ onScrollPosition: (v) => E.setIsScrollBottomReached(v === "bottom"),
3005
3006
  stackDirection: l == null ? void 0 : l.messageStackDirection,
3006
3007
  messages: C,
3007
3008
  onLoadPrev: f.loadPrevious,
@@ -3020,30 +3021,30 @@ const Ol = ({ style: e }) => {
3020
3021
  }
3021
3022
  ), /* @__PURE__ */ r.createElement(Dl, null)),
3022
3023
  overlayArea: /* @__PURE__ */ r.createElement(r.Fragment, null, !E.isScrollBottomReached && /* @__PURE__ */ r.createElement(Hl, { onClick: () => E.scrollPubSub.publish({ type: "scrollToBottom" }) })),
3023
- renderMessage: ({ message: y, index: B }) => {
3024
- const Ee = Ya(y), J = C[B - 1], Ae = C[B + 1], it = C[C.length - 1], st = y === it, A = qa(y, J, Ae, Bl), I = !Yr((J == null ? void 0 : J.createdAt) ?? 0, y.createdAt) && v(B) && !b, M = (X) => {
3025
- (y.isFileMessage() || y.isUserMessage()) && i({ file: X, sender: se(y, y.sender.userId === s.userId) });
3024
+ renderMessage: ({ message: v, index: B }) => {
3025
+ const Ee = Ya(v), J = C[B - 1], Ae = C[B + 1], it = C[C.length - 1], st = v === it, A = qa(v, J, Ae, Bl), I = !Yr((J == null ? void 0 : J.createdAt) ?? 0, v.createdAt) && y(B) && !b, M = (X) => {
3026
+ (v.isFileMessage() || v.isUserMessage()) && i({ file: X, sender: se(v, v.sender.userId === s.userId) });
3026
3027
  }, H = () => {
3027
- y.isFileMessage() && zn(y.url);
3028
+ v.isFileMessage() && zn(v.url);
3028
3029
  }, Ce = I ? /* @__PURE__ */ r.createElement(
3029
3030
  or,
3030
3031
  {
3031
3032
  style: { margin: "16px 0" },
3032
- date: y.createdAt,
3033
+ date: v.createdAt,
3033
3034
  locale: g,
3034
3035
  formatString: m.DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR
3035
3036
  }
3036
3037
  ) : null, ae = {
3037
3038
  maxBodyWidth: d.expanded ? Bn : void 0,
3038
- extendedMessagePayload: y.extendedMessagePayload,
3039
- createdAt: y.createdAt,
3039
+ extendedMessagePayload: v.extendedMessagePayload,
3040
+ createdAt: v.createdAt,
3040
3041
  groupType: A,
3041
3042
  onClickMedia: M,
3042
3043
  onClickFile: H
3043
3044
  }, Z = (() => {
3044
3045
  var X, ee;
3045
- if (Ze.isAdmin(y))
3046
- return Ze.isCSAT(y) ? p ? /* @__PURE__ */ r.createElement(
3046
+ if (Ze.isAdmin(v))
3047
+ return Ze.isCSAT(v) ? p ? /* @__PURE__ */ r.createElement(
3047
3048
  n,
3048
3049
  {
3049
3050
  ...ae,
@@ -3055,37 +3056,37 @@ const Ol = ({ style: e }) => {
3055
3056
  G && ((ge = x.channel) == null || ge.submitCSAT({ csat: G, csatType: he, csatReason: V, isResolved: le }));
3056
3057
  }
3057
3058
  }
3058
- ) : null : /* @__PURE__ */ r.createElement(n, { ...ae, messageType: "admin", message: y.message });
3059
- if (Ze.isOutgoing(y, a.userId)) {
3059
+ ) : null : /* @__PURE__ */ r.createElement(n, { ...ae, messageType: "admin", message: v.message });
3060
+ if (Ze.isOutgoing(v, a.userId)) {
3060
3061
  const G = {
3061
3062
  ...ae,
3062
- message: y.message,
3063
- sender: se(y),
3064
- sendingStatus: y.sendingStatus
3063
+ message: v.message,
3064
+ sender: se(v),
3065
+ sendingStatus: v.sendingStatus
3065
3066
  };
3066
- if (y.isUserMessage())
3067
+ if (v.isUserMessage())
3067
3068
  return /* @__PURE__ */ r.createElement(e, { messageType: "user", ...G });
3068
- if (y.isFileMessage()) {
3069
- const [he, V] = ((X = y.metaArrays.find((le) => le.key === Jn)) == null ? void 0 : X.value) ?? [];
3069
+ if (v.isFileMessage()) {
3070
+ const [he, V] = ((X = v.metaArrays.find((le) => le.key === Jn)) == null ? void 0 : X.value) ?? [];
3070
3071
  return /* @__PURE__ */ r.createElement(
3071
3072
  e,
3072
3073
  {
3073
3074
  messageType: "file",
3074
- file: y,
3075
+ file: v,
3075
3076
  metadata: {
3076
3077
  aspectRatio: he && V ? `${he}/${V}` : "1/1",
3077
- localFile: (ee = y.messageParams) == null ? void 0 : ee.file
3078
+ localFile: (ee = v.messageParams) == null ? void 0 : ee.file
3078
3079
  },
3079
3080
  ...G
3080
3081
  }
3081
3082
  );
3082
3083
  }
3083
3084
  }
3084
- if (Ze.isIncoming(y, a.userId)) {
3085
- const G = y.sender.userId === s.userId, he = {
3085
+ if (Ze.isIncoming(v, a.userId)) {
3086
+ const G = v.sender.userId === s.userId, he = {
3086
3087
  ...ae,
3087
- sender: se(y, G),
3088
- message: y.message,
3088
+ sender: se(v, G),
3089
+ message: v.message,
3089
3090
  suggestedRepliesVisible: st,
3090
3091
  suggestedRepliesDirection: l == null ? void 0 : l.suggestedRepliesDirection,
3091
3092
  isBotMessage: G,
@@ -3104,10 +3105,10 @@ const Ol = ({ style: e }) => {
3104
3105
  }
3105
3106
  }
3106
3107
  };
3107
- if (y.isUserMessage())
3108
+ if (v.isUserMessage())
3108
3109
  return /* @__PURE__ */ r.createElement(t, { messageType: "user", ...he });
3109
- if (y.isFileMessage())
3110
- return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: y, ...he });
3110
+ if (v.isFileMessage())
3111
+ return /* @__PURE__ */ r.createElement(t, { messageType: "file", file: v, ...he });
3111
3112
  }
3112
3113
  })();
3113
3114
  return /* @__PURE__ */ r.createElement("div", { key: Ee, id: `${Q}-message-item` }, Ce, Z);
@@ -3274,7 +3275,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3274
3275
  }, lr = {
3275
3276
  textArea: $`min-height:40px;height:40px;font-size:16px;line-height:24px;`,
3276
3277
  attachIcon: $`margin-bottom:4px;`
3277
- }, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${vt && lr.attachIcon};`, lc = u.input`display:none;`, an = u.div`width:100%;position:relative;background-color:${h.themedColor.bg_100_500};border-radius:20px;`, ln = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, cn = u.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${h.themedColor.textHighEmphasis};resize:none;width:100%;height:${Rn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${vt && lr.textArea};&::placeholder{color:${h.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${h.themedColor.textDisabled};}}`, dn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, un = ({ disabled: e }) => {
3278
+ }, cr = u.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:32px;height:32px;`, ac = u(cr)`flex-shrink:0;margin-inline-end:12px;margin-bottom:2px;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover{path{fill:${h.themedColor.textHighEmphasis};}}&:active{border-radius:4px;background-color:${h.themedColor.bg_200_400};}}${yt && lr.attachIcon};`, lc = u.input`display:none;`, an = u.div`width:100%;position:relative;background-color:${h.themedColor.bg_100_500};border-radius:20px;`, ln = u.div`display:flex;flex-direction:row;align-items:flex-end;position:relative;`, cn = u.textarea`all:unset;display:block;flex:1;min-width:0;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;font-size:14px;line-height:20px;color:${h.themedColor.textHighEmphasis};resize:none;width:100%;height:${Rn}px;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden;${yt && lr.textArea};&::placeholder{color:${h.themedColor.textLowEmphasis};}&:disabled{cursor:not-allowed;&::placeholder{color:${h.themedColor.textDisabled};}}`, dn = u.div`padding:12px 16px;position:relative;display:flex;align-items:center;`, un = ({ disabled: e }) => {
3278
3279
  const t = F(null), { addFiles: n, clearFiles: o, files: i, isFileUploadEnabled: a } = Lt();
3279
3280
  return !a || i.length > 0 ? null : /* @__PURE__ */ r.createElement(
3280
3281
  ac,
@@ -3329,7 +3330,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3329
3330
  _.length > 0 && (T.preventDefault(), d(_));
3330
3331
  }, C = (T) => {
3331
3332
  T.key !== "Enter" || T.nativeEvent.isComposing || T.shiftKey || (T.preventDefault(), E());
3332
- }, v = (T) => {
3333
+ }, y = (T) => {
3333
3334
  if (e.current) {
3334
3335
  e.current.style.height = "";
3335
3336
  const _ = Math.min(ui, e.current.scrollHeight);
@@ -3346,7 +3347,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3346
3347
  placeholder: l,
3347
3348
  maxLength: 5e3,
3348
3349
  onKeyDown: C,
3349
- onChange: v,
3350
+ onChange: y,
3350
3351
  onPaste: b
3351
3352
  }
3352
3353
  ), /* @__PURE__ */ r.createElement(un, null))), x && /* @__PURE__ */ r.createElement(cr, { onClick: () => E() }, /* @__PURE__ */ r.createElement(O, { type: "send", color: h.color.primary.main, size: 20 })));
@@ -3357,7 +3358,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3357
3358
  color: ${h.color.information.main};
3358
3359
  `};
3359
3360
  }
3360
- `, uc = w(() => import("./CDvzufwm.js").then((e) => ({ default: e.MarkdownText }))), mc = () => {
3361
+ `, uc = w(() => import("./7Dvv5RpD.js").then((e) => ({ default: e.MarkdownText }))), mc = () => {
3361
3362
  const { aiAgentInfo: e } = z(), { messageSource: t } = q(), { userSession: n } = z();
3362
3363
  return !e.specialNoticeEnabled || !e.specialNotice || !(t.initialized && !t.messages.some((i) => Xn(i, n.userId))) ? null : /* @__PURE__ */ r.createElement(dc, null, /* @__PURE__ */ r.createElement(uc, null, e.specialNotice));
3363
3364
  }, hc = () => /* @__PURE__ */ r.createElement(gc, null, /* @__PURE__ */ r.createElement(mc, null), /* @__PURE__ */ r.createElement(Kl, null, /* @__PURE__ */ r.createElement(cc, null))), gc = u.div`z-index:0;border:none;width:100%;`, pc = () => {
@@ -3365,7 +3366,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3365
3366
  const { activeChannel: e } = z(), { channelSource: t } = q(), n = ((s = (a = t.channel) == null ? void 0 : a.conversation) == null ? void 0 : s.status) === W.CLOSED;
3366
3367
  return !(((l = t.channel) == null ? void 0 : l.url) === (e == null ? void 0 : e.url)) && n ? /* @__PURE__ */ r.createElement(Wl, null) : /* @__PURE__ */ r.createElement(hc, null);
3367
3368
  }, fc = () => {
3368
- var v;
3369
+ var y;
3369
3370
  const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: i } = P(), { stringSet: a } = R(), { aiAgentInfo: s, activeChannel: l } = z(), { channelSource: c, onNavigateToConversationList: d } = q(), m = c.channel, p = Pe() ? 24 : 16, x = () => {
3370
3371
  e.setOpened(!1);
3371
3372
  }, f = async () => {
@@ -3377,8 +3378,8 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3377
3378
  }
3378
3379
  }, E = async () => {
3379
3380
  m && await i.send(ao.CloseConversation({ channelUrl: m.url }));
3380
- }, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((v = m == null ? void 0 : m.conversation) != null && v.handoff) && b;
3381
- return /* @__PURE__ */ r.createElement(yc, null, /* @__PURE__ */ r.createElement(vc, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: h.themedColor.textHighEmphasis })), b && /* @__PURE__ */ r.createElement(nr, { size: 34 }), /* @__PURE__ */ r.createElement(Sc, { variant: "h2", color: h.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(_c, null, C && /* @__PURE__ */ r.createElement(
3381
+ }, b = l && (m == null ? void 0 : m.url) === l.url, C = s.showHandoffButton && !!((y = m == null ? void 0 : m.conversation) != null && y.handoff) && b;
3382
+ return /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(yc, null, d && /* @__PURE__ */ r.createElement(Ue, { onClick: () => d() }, /* @__PURE__ */ r.createElement(O, { type: "menu", size: 24, color: h.themedColor.textHighEmphasis })), b && /* @__PURE__ */ r.createElement(nr, { size: 34 }), /* @__PURE__ */ r.createElement(Sc, { variant: "h2", color: h.themedColor.textHighEmphasis }, s.nickname || (m == null ? void 0 : m.name))), /* @__PURE__ */ r.createElement(_c, null, C && /* @__PURE__ */ r.createElement(
3382
3383
  Cc,
3383
3384
  {
3384
3385
  tooltipLabel: a.HEADER_BUTTON__AGENT_HANDOFF,
@@ -3411,7 +3412,7 @@ const ec = u.div`&::-webkit-scrollbar{display:none;}overflow-x:auto;display:flex
3411
3412
  size: e,
3412
3413
  color: n ? h.themedColor.textDisabled : h.themedColor.textHighEmphasis
3413
3414
  }
3414
- ))), yc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, vc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Tc = () => {
3415
+ ))), vc = u.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${h.themedColor.textDisabled};background-color:${({ theme: e }) => e.colors.base.headerBackground};`, yc = u.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`, _c = u.div`display:flex;gap:10px;align-items:center;justify-content:center;`, Sc = u(k)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`, Ue = u.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`, Tc = () => {
3415
3416
  const { isActionbookTester: e } = Fe();
3416
3417
  return e ? null : /* @__PURE__ */ r.createElement(fc, null);
3417
3418
  }, mn = ({
@@ -3750,10 +3751,10 @@ const hn = {
3750
3751
  ...s
3751
3752
  }, l) {
3752
3753
  var c;
3753
- return ye.level !== n && (ye.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(No, { logger: ye, storage: td }, /* @__PURE__ */ r.createElement(
3754
+ return ve.level !== n && (ve.level = n), li("https://fonts.googleapis.com/css2?family=Roboto&display=swap", t), /* @__PURE__ */ r.createElement("div", { id: oe.ENTRY, style: { width: "fit-content", height: "fit-content", ...s.entryStyle } }, /* @__PURE__ */ r.createElement(No, { logger: ve, storage: td }, /* @__PURE__ */ r.createElement(
3754
3755
  Qc,
3755
3756
  {
3756
- logger: ye,
3757
+ logger: ve,
3757
3758
  rootElement: t,
3758
3759
  appearance: (c = s.agentPreviewConfigs) == null ? void 0 : c.appearance,
3759
3760
  stringSet: s.stringSet,
@@ -3769,14 +3770,14 @@ const hn = {
3769
3770
  language: o,
3770
3771
  countryCode: s.countryCode,
3771
3772
  context: s.context,
3772
- logger: ye,
3773
+ logger: ve,
3773
3774
  dispatcher: ed,
3774
3775
  chatParams: { customApiHost: s.customApiHost, customWebSocketHost: s.customWebSocketHost }
3775
3776
  },
3776
3777
  /* @__PURE__ */ r.createElement(pi, { rootElement: t, ...s }, /* @__PURE__ */ r.createElement(Ci, { ref: l, userSessionInfo: i }, /* @__PURE__ */ r.createElement($a, { ...s._UNSAFE_INTERNAL_dashboardTester }, a, /* @__PURE__ */ r.createElement("div", { id: oe.MODAL_ROOT }))))
3777
3778
  )
3778
3779
  )));
3779
- }), ye = new wn(xn.WARN), ed = new Sn(ye), Nt = "@sba/message-template", gn = (e) => `${Nt}/templates/${e}`, pn = () => `${Nt}/token`, td = Ro({
3780
+ }), ve = new wn(xn.WARN), ed = new Sn(ve), Nt = "@sba/message-template", gn = (e) => `${Nt}/templates/${e}`, pn = () => `${Nt}/token`, td = Ro({
3780
3781
  onSetTemplate: (e, t) => {
3781
3782
  hn[e] || te.setItem(gn(e), t);
3782
3783
  },
@@ -3908,15 +3909,15 @@ const gd = En`0%{transform:translateY(40px);opacity:0;}100%{transform:translateY
3908
3909
  `;
3909
3910
  function Me({ initialId: e, children: t }) {
3910
3911
  const n = U((b, C) => {
3911
- c((v) => [...v, b]), m((v) => ({ ...v, [b]: !0 })), C != null && C.reset && f((v) => ({
3912
- ...v,
3913
- [b]: (v[b] || 0) + 1
3914
- })), p((v) => ({
3915
- ...v,
3912
+ c((y) => [...y, b]), m((y) => ({ ...y, [b]: !0 })), C != null && C.reset && f((y) => ({
3913
+ ...y,
3914
+ [b]: (y[b] || 0) + 1
3915
+ })), p((y) => ({
3916
+ ...y,
3916
3917
  [b]: "entering"
3917
3918
  })), setTimeout(() => {
3918
- p((v) => ({
3919
- ...v,
3919
+ p((y) => ({
3920
+ ...y,
3920
3921
  [b]: "entered"
3921
3922
  }));
3922
3923
  }, 300);
@@ -3924,33 +3925,33 @@ function Me({ initialId: e, children: t }) {
3924
3925
  c((b) => {
3925
3926
  if (b.length <= 1) return b;
3926
3927
  const C = b[b.length - 1];
3927
- return p((v) => ({
3928
- ...v,
3928
+ return p((y) => ({
3929
+ ...y,
3929
3930
  [C]: "exiting"
3930
3931
  })), setTimeout(() => {
3931
- p((v) => ({
3932
- ...v,
3932
+ p((y) => ({
3933
+ ...y,
3933
3934
  [C]: "exited"
3934
- })), c((v) => v.slice(0, -1));
3935
+ })), c((y) => y.slice(0, -1));
3935
3936
  }, 300), b;
3936
3937
  });
3937
- }, []), i = ve(() => ({
3938
+ }, []), i = ye(() => ({
3938
3939
  navigation: {
3939
3940
  navigate: n,
3940
3941
  pop: o
3941
3942
  }
3942
- }), [n, o]), a = ve(() => Tr.toArray(t).filter(
3943
+ }), [n, o]), a = ye(() => Tr.toArray(t).filter(
3943
3944
  (b) => b.type === xr
3944
- ), [t]), s = ve(() => {
3945
+ ), [t]), s = ye(() => {
3945
3946
  const b = {};
3946
3947
  return a.forEach((C) => {
3947
- const { id: v, lazy: T, children: _ } = C.props;
3948
- b[v] = { lazy: T, element: typeof _ == "function" ? _(i) : _ };
3948
+ const { id: y, lazy: T, children: _ } = C.props;
3949
+ b[y] = { lazy: T, element: typeof _ == "function" ? _(i) : _ };
3949
3950
  }), b;
3950
3951
  }, [a]), [l, c] = S([e]), [d, m] = S(() => {
3951
3952
  const b = {};
3952
- return Object.entries(s).forEach(([C, { lazy: v }]) => {
3953
- v === !1 && (b[C] = !0);
3953
+ return Object.entries(s).forEach(([C, { lazy: y }]) => {
3954
+ y === !1 && (b[C] = !0);
3954
3955
  }), b[e] = !0, b;
3955
3956
  }), [g, p] = S(() => {
3956
3957
  const b = {};
@@ -3958,14 +3959,14 @@ function Me({ initialId: e, children: t }) {
3958
3959
  C === e ? b[C] = "entered" : b[C] = "exited";
3959
3960
  }), b;
3960
3961
  }), [x, f] = S({}), E = l[l.length - 1];
3961
- return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(yd, null, Object.keys(s).map((b) => {
3962
+ return /* @__PURE__ */ r.createElement(br.Provider, { value: i }, /* @__PURE__ */ r.createElement(vd, null, Object.keys(s).map((b) => {
3962
3963
  var _;
3963
3964
  if (!d[b]) return null;
3964
- const C = g[b] || "exited", v = b === E, T = `${b}-${x[b] || 0}`;
3965
- return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: v }, (_ = s[b]) == null ? void 0 : _.element);
3965
+ const C = g[b] || "exited", y = b === E, T = `${b}-${x[b] || 0}`;
3966
+ return /* @__PURE__ */ r.createElement(Cd, { key: T, $transitionState: C, $active: y }, (_ = s[b]) == null ? void 0 : _.element);
3966
3967
  })));
3967
3968
  }
3968
- const yd = u.div`position:relative;width:100%;height:100%;`;
3969
+ const vd = u.div`position:relative;width:100%;height:100%;`;
3969
3970
  Me.Screen = xr;
3970
3971
  const pe = {
3971
3972
  activeConv: "active-conv",
@@ -3986,12 +3987,12 @@ const pe = {
3986
3987
  }
3987
3988
  }
3988
3989
  )));
3989
- function vd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
3990
+ function yd({ isExpanded: e, isOpened: t, children: n, launcher: o }) {
3990
3991
  const { dir: i } = P();
3991
3992
  return /* @__PURE__ */ r.createElement(_d, null, /* @__PURE__ */ r.createElement(Sd, { dir: i, id: oe.WINDOW, $isExpanded: e, $isOpened: t }, n), o);
3992
3993
  }
3993
3994
  const _d = u.div`display:flex;flex-direction:column;gap:8px;align-items:flex-end;`, Sd = u.div`background:${({ theme: e }) => e.colors.base.background};display:flex;overscroll-behavior:none;-webkit-overflow-scrolling:auto;height:640px;min-height:80px;width:400px;max-width:80vw;max-height:80vh;box-shadow:0px 16px 24px 2px rgba(33,33,33,0.12),0px 6px 30px 5px rgba(33,33,33,0.08),0px 6px 10px -5px rgba(33,33,33,0.04);border-radius:16px;overflow:hidden;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 150ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;transform:scale(0.15);opacity:0;transform-origin:right bottom;[dir='rtl'] &:not([dir='ltr']),&[dir='rtl']{transform-origin:left bottom;}${({ $isOpened: e }) => e && wd};${({ $isExpanded: e }) => e && Td};`, Td = $`width:743px;height:723px;`, wd = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, Xd = Re(function({ children: e, ...t }, n) {
3994
- const o = Pe(), [i, a] = S(), s = o ? hr : vd;
3995
+ const o = Pe(), [i, a] = S(), s = o ? hr : yd;
3995
3996
  return /* @__PURE__ */ r.createElement(mr, { enableExpandButton: !o, ref: n, ...t }, /* @__PURE__ */ r.createElement(Pn, null, ({ state: l }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(s, { isExpanded: l.expanded, isOpened: l.opened, launcher: /* @__PURE__ */ r.createElement(fr, null) }, /* @__PURE__ */ r.createElement(
3996
3997
  Er,
3997
3998
  {
@@ -4054,8 +4055,8 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
4054
4055
 
4055
4056
  ${({ $isOpened: e }) => e && Ld};
4056
4057
  ${({ $isExpanded: e }) => e && Od};
4057
- `, Od = $`width:743px;height:723px;`, Ld = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, yr = { top: 24, bottom: 24, start: 24, end: 24 }, Rd = Re(function({ children: e, ...t }, n) {
4058
- const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(yr), [d, m] = S(48), g = Pe(), p = g ? hr : $d, { horizontal: x, vertical: f } = ve(() => {
4058
+ `, Od = $`width:743px;height:723px;`, Ld = $`z-index:${be.WINDOW};pointer-events:all;transform:scale(1);opacity:1;transition:width 200ms ease 0s,height 200ms ease 0s,max-height 200ms ease 0s,transform 300ms cubic-bezier(0,1.2,1,1) 0s,opacity 83ms ease-out 0s;`, vr = { top: 24, bottom: 24, start: 24, end: 24 }, Rd = Re(function({ children: e, ...t }, n) {
4059
+ const [o, i] = S(), [a, s] = S("end-bottom"), [l, c] = S(vr), [d, m] = S(48), g = Pe(), p = g ? hr : $d, { horizontal: x, vertical: f } = ye(() => {
4059
4060
  const [E, b] = a.split("-");
4060
4061
  return { horizontal: E === "start" ? "start" : "end", vertical: b === "top" ? "top" : "bottom" };
4061
4062
  }, [a]);
@@ -4078,7 +4079,7 @@ const Md = u.div`background:${({ theme: e }) => e.colors.base.background};displa
4078
4079
  var i, a, s, l;
4079
4080
  const { setPosition: t, setMargin: n, setLauncherSize: o } = Pt();
4080
4081
  return ce(() => {
4081
- e.position && t(e.position), e.margin && n({ ...yr, ...e.margin }), e.launcherSize && o(e.launcherSize);
4082
+ e.position && t(e.position), e.margin && n({ ...vr, ...e.margin }), e.launcherSize && o(e.launcherSize);
4082
4083
  }, [
4083
4084
  e.position,
4084
4085
  (i = e.margin) == null ? void 0 : i.top,