@epam/statgpt-conversation-list 0.8.0-dev.10 → 0.8.0-dev.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -2,17 +2,17 @@ import e from "classnames";
2
2
  import t, { createContext as n, useCallback as r, useContext as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
3
3
  import { cloneDeep as l, omit as u, uniqBy as d } from "lodash";
4
4
  import { Button as f, Dropdown as p, HighlightText as m, IconButton as h, InlineAlert as g, InlineAlertType as _, Input as v, InputWithIcon as y, Loader as b, PopUpSize as x, PopUpState as S, Popup as C } from "@epam/statgpt-ui-components";
5
- import { IconCaretRightFilled as w, IconCheck as T, IconCopy as E, IconDotsVertical as D, IconInfoCircle as O, IconSearch as k, IconX as A } from "@tabler/icons-react";
6
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
7
- import P from "jszip";
8
- import { ONBOARDING_MODEL_POSTFIX as F, SHARE_CONVERSATION_ROUTE as ee, cleanConversationNames as I, getClearedConversationName as L, getConversationAttachments as R } from "@epam/statgpt-shared-toolkit";
9
- import { InvitationType as te, ShareTarget as z, getSharedConversationsRequest as ne } from "@epam/statgpt-dial-toolkit";
5
+ import { IconCaretRightFilled as w, IconCheck as T, IconCopy as E, IconDotsVertical as D, IconInfoCircle as O, IconSearch as ee, IconX as te } from "@tabler/icons-react";
6
+ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
7
+ import M from "jszip";
8
+ import { ONBOARDING_MODEL_POSTFIX as N, SHARE_CONVERSATION_ROUTE as P, cleanConversationNames as F, getClearedConversationName as I, getConversationAttachments as L } from "@epam/statgpt-shared-toolkit";
9
+ import { InvitationType as R, ShareTarget as z, getSharedConversationsRequest as B } from "@epam/statgpt-dial-toolkit";
10
10
  //#region libs/conversation-list/src/types/action-menu-item.ts
11
- var B = /* @__PURE__ */ function(e) {
11
+ var V = /* @__PURE__ */ function(e) {
12
12
  return e.DELETE = "delete", e.EXPORT = "export", e.SHARE = "share", e.RENAME = "rename", e;
13
- }({}), V = /* @__PURE__ */ function(e) {
13
+ }({}), H = /* @__PURE__ */ function(e) {
14
14
  return e.SHARED = "shared", e.TODAY = "today", e.YESTERDAY = "yesterday", e.WEEK = "week", e.EARLIER = "earlier", e;
15
- }({}), H = (e, t) => e?.resources?.filter((e) => e?.parentPath === t)?.map((e) => {
15
+ }({}), U = (e, t) => e?.resources?.filter((e) => e?.parentPath === t)?.map((e) => {
16
16
  let n = `${e?.bucket}/${t}`, r = e?.url?.split("/")?.slice(1)?.join("/");
17
17
  return {
18
18
  ...e,
@@ -20,32 +20,32 @@ var B = /* @__PURE__ */ function(e) {
20
20
  id: r,
21
21
  isShared: !0
22
22
  };
23
- }) || [], U = (e) => ({ [V.SHARED]: e }), re = {
24
- [V.TODAY]: [],
25
- [V.YESTERDAY]: [],
26
- [V.WEEK]: [],
27
- [V.EARLIER]: []
28
- }, W = (e, t) => e.toDateString() === t.toDateString(), G = (e, t) => W(t, new Date(e.getFullYear(), e.getMonth(), e.getDate() - 1)), ie = (e, t) => {
23
+ }) || [], W = (e) => ({ [H.SHARED]: e }), ne = {
24
+ [H.TODAY]: [],
25
+ [H.YESTERDAY]: [],
26
+ [H.WEEK]: [],
27
+ [H.EARLIER]: []
28
+ }, G = (e, t) => e.toDateString() === t.toDateString(), K = (e, t) => G(t, new Date(e.getFullYear(), e.getMonth(), e.getDate() - 1)), re = (e, t) => {
29
29
  let n = e.getTime() - t.getTime();
30
30
  return Math.floor(n / (1e3 * 60 * 60 * 24));
31
- }, ae = (e) => e.updatedAt || Number(e.id?.split("-").pop()), oe = (e) => {
32
- let t = /* @__PURE__ */ new Date(), n = l(re);
31
+ }, ie = (e) => e.updatedAt || Number(e.id?.split("-").pop()), ae = (e) => {
32
+ let t = /* @__PURE__ */ new Date(), n = l(ne);
33
33
  for (let r of e) if (r.updatedAt) {
34
34
  let e = new Date(r.updatedAt), i;
35
- i = W(t, e) ? n[V.TODAY] : G(t, e) ? n[V.YESTERDAY] : ie(t, e) <= 7 ? n[V.WEEK] : n[V.EARLIER], i?.some((e) => e.id === r.id) || i.push(r);
35
+ i = G(t, e) ? n[H.TODAY] : K(t, e) ? n[H.YESTERDAY] : re(t, e) <= 7 ? n[H.WEEK] : n[H.EARLIER], i?.some((e) => e.id === r.id) || i.push(r);
36
36
  }
37
37
  return n;
38
- }, K = (e) => e?.sort((e, t) => (ae(t) || 0) - (ae(e) || 0)), q = (e, t) => e === V.SHARED ? t?.shared || "Shared" : e === V.TODAY ? t?.today || "Today" : e === V.YESTERDAY ? t?.yesterday || "Yesterday" : e === V.WEEK ? t?.lastWeek || "Last week" : t?.earlier || "Earlier", J = n(null);
39
- function Y() {
40
- let e = i(J);
38
+ }, q = (e) => e?.sort((e, t) => (ie(t) || 0) - (ie(e) || 0)), J = (e, t) => e === H.SHARED ? t?.shared || "Shared" : e === H.TODAY ? t?.today || "Today" : e === H.YESTERDAY ? t?.yesterday || "Yesterday" : e === H.WEEK ? t?.lastWeek || "Last week" : t?.earlier || "Earlier", Y = n(null);
39
+ function X() {
40
+ let e = i(Y);
41
41
  if (!e) throw Error("useConversationStyles must be used within ConversationStylesContext.Provider");
42
42
  return e;
43
43
  }
44
44
  //#endregion
45
45
  //#region libs/conversation-list/src/components/ConversationDelete/ConversationDelete.tsx
46
- var X = ({ onCloseModal: e, deleteConversation: t, locale: n }) => {
47
- let { titles: r, disableModalDividers: i, isSmallModalButton: a } = Y();
48
- return /* @__PURE__ */ N(C, {
46
+ var Z = ({ onCloseModal: e, deleteConversation: t, locale: n }) => {
47
+ let { titles: r, disableModalDividers: i, isSmallModalButton: a } = X();
48
+ return /* @__PURE__ */ j(C, {
49
49
  heading: r?.deleteTitle ?? "Delete conversation",
50
50
  portalId: "delete-conversation",
51
51
  containerClassName: "delete-conversation-popup",
@@ -53,20 +53,20 @@ var X = ({ onCloseModal: e, deleteConversation: t, locale: n }) => {
53
53
  dividers: !i,
54
54
  onClose: e,
55
55
  closeButtonTitle: r?.close ?? "Cancel",
56
- children: [/* @__PURE__ */ M("div", {
56
+ children: [/* @__PURE__ */ A("div", {
57
57
  className: "px-6 py-4 sm:px-0",
58
58
  lang: n,
59
59
  children: r?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone."
60
- }), /* @__PURE__ */ N("div", {
60
+ }), /* @__PURE__ */ j("div", {
61
61
  className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3",
62
- children: [/* @__PURE__ */ M(f, {
62
+ children: [/* @__PURE__ */ A(f, {
63
63
  buttonClassName: "cancel-button",
64
64
  title: r?.cancel ?? "Cancel",
65
65
  isSmallButton: a,
66
66
  onClick: (t) => {
67
67
  t.stopPropagation(), e();
68
68
  }
69
- }), /* @__PURE__ */ M(f, {
69
+ }), /* @__PURE__ */ A(f, {
70
70
  buttonClassName: "text-button-primary text-button-primary-error",
71
71
  title: r?.delete ?? "Delete",
72
72
  isSmallButton: a,
@@ -76,11 +76,11 @@ var X = ({ onCloseModal: e, deleteConversation: t, locale: n }) => {
76
76
  })]
77
77
  })]
78
78
  });
79
- }, se = (e) => d(de(R(e)).map((e) => ({
79
+ }, oe = (e) => d(ue(L(e)).map((e) => ({
80
80
  ...e,
81
81
  relativePath: "",
82
82
  contentLength: 0
83
- })), (e) => Z(e.relativePath, e.name)), ce = (e) => e.endsWith("/"), le = (e) => {
83
+ })), (e) => Q(e.relativePath, e.name)), se = (e) => e.endsWith("/"), ce = (e) => {
84
84
  let t = e.toLowerCase();
85
85
  return [
86
86
  "data:",
@@ -93,15 +93,15 @@ var X = ({ onCloseModal: e, deleteConversation: t, locale: n }) => {
93
93
  "telnet://",
94
94
  "api/files"
95
95
  ].some((e) => t.startsWith(e));
96
- }, ue = (e) => {
97
- let t = Z(...e.split("/").map((e) => decodeURIComponent(e))), n = t.lastIndexOf("/");
96
+ }, le = (e) => {
97
+ let t = Q(...e.split("/").map((e) => decodeURIComponent(e))), n = t.lastIndexOf("/");
98
98
  return {
99
99
  absolutePath: t.slice(0, n),
100
100
  name: t.slice(n + 1)
101
101
  };
102
- }, de = (e) => e ? e.map((e) => {
103
- if (!e.url || le(e.url) || ce(e.url)) return null;
104
- let { absolutePath: t, name: n } = ue(e.url);
102
+ }, ue = (e) => e ? e.map((e) => {
103
+ if (!e.url || ce(e.url) || se(e.url)) return null;
104
+ let { absolutePath: t, name: n } = le(e.url);
105
105
  return {
106
106
  id: e.url,
107
107
  name: n,
@@ -110,44 +110,44 @@ var X = ({ onCloseModal: e, deleteConversation: t, locale: n }) => {
110
110
  absolutePath: t
111
111
  };
112
112
  }).filter(Boolean) : [];
113
- async function fe(e, t) {
114
- let n = se(e), r = new P();
113
+ async function de(e, t) {
114
+ let n = oe(e), r = new M();
115
115
  n.forEach((e) => {
116
- let n = t(`${encodeURI(Z(e.absolutePath, e.name))}`.replace("files/", "")), i = Z("res", pe(e.folderId), e.name);
116
+ let n = t(`${encodeURI(Q(e.absolutePath, e.name))}`.replace("files/", "")), i = Q("res", fe(e.folderId), e.name);
117
117
  r.file(i, n);
118
118
  });
119
119
  let i = {
120
120
  version: 5,
121
- history: [e].map(me) || [],
121
+ history: [e].map(pe) || [],
122
122
  folders: []
123
123
  }, a = JSON.stringify(i, null, 2);
124
124
  return r.file("conversations/conversations_history.json", a), await r.generateAsync({ type: "base64" });
125
125
  }
126
- var pe = (e) => {
126
+ var fe = (e) => {
127
127
  let t = e.split("/");
128
- return t.length > 2 ? Z(...t.slice(2)) : void 0;
129
- }, me = (e) => u(e, ["publicationInfo"]), Z = (...e) => e.filter(Boolean).join("/");
128
+ return t.length > 2 ? Q(...t.slice(2)) : void 0;
129
+ }, pe = (e) => u(e, ["publicationInfo"]), Q = (...e) => e.filter(Boolean).join("/");
130
130
  //#endregion
131
131
  //#region libs/conversation-list/src/utils/download.ts
132
- function he(e, t) {
132
+ function me(e, t) {
133
133
  let n = document.createElement("a");
134
134
  n.download = t, n.href = e, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(e);
135
135
  }
136
136
  //#endregion
137
137
  //#region node_modules/qrcode.react/lib/esm/index.js
138
- var ge = Object.defineProperty, Q = Object.getOwnPropertySymbols, _e = Object.prototype.hasOwnProperty, ve = Object.prototype.propertyIsEnumerable, ye = (e, t, n) => t in e ? ge(e, t, {
138
+ var he = Object.defineProperty, ge = Object.getOwnPropertySymbols, _e = Object.prototype.hasOwnProperty, ve = Object.prototype.propertyIsEnumerable, ye = (e, t, n) => t in e ? he(e, t, {
139
139
  enumerable: !0,
140
140
  configurable: !0,
141
141
  writable: !0,
142
142
  value: n
143
143
  }) : e[t] = n, be = (e, t) => {
144
144
  for (var n in t ||= {}) _e.call(t, n) && ye(e, n, t[n]);
145
- if (Q) for (var n of Q(t)) ve.call(t, n) && ye(e, n, t[n]);
145
+ if (ge) for (var n of ge(t)) ve.call(t, n) && ye(e, n, t[n]);
146
146
  return e;
147
147
  }, xe = (e, t) => {
148
148
  var n = {};
149
149
  for (var r in e) _e.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
150
- if (e != null && Q) for (var r of Q(e)) t.indexOf(r) < 0 && ve.call(e, r) && (n[r] = e[r]);
150
+ if (e != null && ge) for (var r of ge(e)) t.indexOf(r) < 0 && ve.call(e, r) && (n[r] = e[r]);
151
151
  return n;
152
152
  }, Se;
153
153
  ((e) => {
@@ -1091,162 +1091,162 @@ Be.displayName = "QRCodeSVG";
1091
1091
  //#endregion
1092
1092
  //#region libs/share-conversation/src/utils/shared-conversations.ts
1093
1093
  var Ve = (e, t) => ({
1094
- invitationType: te.LINK,
1094
+ invitationType: R.LINK,
1095
1095
  resources: [{ url: `conversations/${encodeURI(e)}` }, ...t]
1096
- }), He = (e) => `/${ee}/${e?.invitationLink?.split("/").at(-1) || ""}`, Ue = (e, t) => t?.find((t) => {
1096
+ }), He = (e) => `/${P}/${e?.invitationLink?.split("/").at(-1) || ""}`, Ue = (e, t) => t?.find((t) => {
1097
1097
  let n = e?.id?.split("/")?.pop(), r = t?.url?.split("/")?.pop() || "";
1098
1098
  return r === n || decodeURI(r) === n;
1099
- }), We = (e) => (e?.messages?.filter((e) => !!e?.custom_content?.attachments))?.flatMap((e) => e?.custom_content?.attachments?.map((e) => ({ url: e?.url || "" })) || [])?.filter((e) => !!e?.url) || [], Ge = ({ conversation: e, locale: t, onCloseModal: n, modalDividers: i, getConversation: l, generateConversationLink: u, chatExpiration: d, chatExpirationDays: p, close: m, chatWarning: h, shareLink: v, shareCopyLink: S, shareCopiedLink: w, shareDescription: D, shareRemoveAccessToUsers: k, chatName: A, getSharedConversations: j, revokeSharedConversations: P, baseUrl: F, id: I, clientSharedPage: L, clientSharedProp: R, shareAlertMessage: te }) => {
1100
- let [B, V] = c(null), [H, U] = c(), [re, W] = c(!1), [G, ie] = c(!1), [ae, oe] = c(), K = s(null), q = s(null), J = o(() => e?.id ? decodeURI(e.id) : I?.[0] && I?.[1] && t ? decodeURI(`${I[0]}/${t}/${I[1]}`) : null, [
1099
+ }), We = (e) => (e?.messages?.filter((e) => !!e?.custom_content?.attachments))?.flatMap((e) => e?.custom_content?.attachments?.map((e) => ({ url: e?.url || "" })) || [])?.filter((e) => !!e?.url) || [], Ge = ({ conversation: e, locale: t, onCloseModal: n, modalDividers: i, getConversation: l, generateConversationLink: u, chatExpiration: d, chatExpirationDays: p, close: m, chatWarning: h, shareLink: v, shareCopyLink: S, shareCopiedLink: w, shareDescription: D, shareRemoveAccessToUsers: ee, chatName: te, getSharedConversations: k, revokeSharedConversations: M, baseUrl: N, id: F, clientSharedPage: I, clientSharedProp: L, shareAlertMessage: R }) => {
1100
+ let [V, H] = c(null), [U, W] = c(), [ne, G] = c(!1), [K, re] = c(!1), [ie, ae] = c(), q = s(null), J = s(null), Y = o(() => e?.id ? decodeURI(e.id) : F?.[0] && F?.[1] && t ? decodeURI(`${F[0]}/${t}/${F[1]}`) : null, [
1101
1101
  e?.id,
1102
- I,
1102
+ F,
1103
1103
  t
1104
- ]), Y = o(() => {
1105
- if (!B) return "";
1106
- let e = F || window.location.origin;
1107
- return F && F !== window.location.origin && L && R ? `${e}/${L}?${R}=${B.split(`/${ee}/`)?.[1]}` : `${e}/${t}${B}`;
1104
+ ]), X = o(() => {
1105
+ if (!V) return "";
1106
+ let e = N || window.location.origin;
1107
+ return N && N !== window.location.origin && I && L ? `${e}/${I}?${L}=${V.split(`/${P}/`)?.[1]}` : `${e}/${t}${V}`;
1108
1108
  }, [
1109
- F,
1110
- B,
1109
+ N,
1110
+ V,
1111
1111
  t,
1112
- L,
1113
- R
1114
- ]), X = r(async (e) => {
1115
- let t = await j?.(ne(z.OTHERS));
1112
+ I,
1113
+ L
1114
+ ]), Z = r(async (e) => {
1115
+ let t = await k?.(B(z.OTHERS));
1116
1116
  if (t) return Ue({ id: e }, t.resources);
1117
- }, [j]);
1117
+ }, [k]);
1118
1118
  a(() => {
1119
- if (!J || K.current === J) return;
1120
- K.current = J, W(!1), q.current?.abort();
1119
+ if (!Y || q.current === Y) return;
1120
+ q.current = Y, G(!1), J.current?.abort();
1121
1121
  let e = new AbortController();
1122
- return q.current = e, (async () => {
1122
+ return J.current = e, (async () => {
1123
1123
  try {
1124
- let t = Ve(J, We(await l?.(J))), n = await u?.(t), r = await X(J);
1124
+ let t = Ve(Y, We(await l?.(Y))), n = await u?.(t), r = await Z(Y);
1125
1125
  if (e.signal.aborted || !n) return;
1126
- V(He(n)), U(r), W(!0);
1126
+ H(He(n)), W(r), G(!0);
1127
1127
  } catch (t) {
1128
1128
  if (e.signal.aborted) return;
1129
- W(!1), console.error("Error sharing conversation", t);
1129
+ G(!1), console.error("Error sharing conversation", t);
1130
1130
  }
1131
1131
  })(), () => {
1132
- e.abort(), K.current = null;
1132
+ e.abort(), q.current = null;
1133
1133
  };
1134
1134
  }, [
1135
- J,
1135
+ Y,
1136
1136
  u,
1137
1137
  l,
1138
- X
1138
+ Z
1139
1139
  ]);
1140
- let se = r(() => {
1141
- q.current?.abort(), K.current = null, n(), V(null), W(!1), ie(!1);
1142
- }, [n]), ce = r(() => {
1143
- ie(!0), navigator.clipboard.writeText(Y || "");
1144
- }, [Y]), le = async () => {
1140
+ let oe = r(() => {
1141
+ J.current?.abort(), q.current = null, n(), H(null), G(!1), re(!1);
1142
+ }, [n]), se = r(() => {
1143
+ re(!0), navigator.clipboard.writeText(X || "");
1144
+ }, [X]), ce = async () => {
1145
1145
  try {
1146
- if (oe(!0), H && await P?.({ resources: [H] }), J) {
1147
- let e = await X(J);
1148
- q.current?.signal.aborted || U(e);
1146
+ if (ae(!0), U && await M?.({ resources: [U] }), Y) {
1147
+ let e = await Z(Y);
1148
+ J.current?.signal.aborted || W(e);
1149
1149
  }
1150
1150
  } catch (e) {
1151
1151
  console.error("Error revoking shared conversation", e);
1152
1152
  } finally {
1153
- q.current?.signal.aborted || oe(!1);
1153
+ J.current?.signal.aborted || ae(!1);
1154
1154
  }
1155
- }, ue = r(() => /* @__PURE__ */ M(f, {
1156
- buttonClassName: G ? "text-button-secondary" : "text-button-primary",
1157
- iconBefore: M(G ? T : E, {
1155
+ }, le = r(() => /* @__PURE__ */ A(f, {
1156
+ buttonClassName: K ? "text-button-secondary" : "text-button-primary",
1157
+ iconBefore: A(K ? T : E, {
1158
1158
  width: 20,
1159
1159
  height: 20
1160
1160
  }),
1161
- title: G ? w ?? "Copied" : S ?? "Copy link",
1162
- disabled: G,
1163
- onClick: ce
1161
+ title: K ? w ?? "Copied" : S ?? "Copy link",
1162
+ disabled: K,
1163
+ onClick: se
1164
1164
  }), [
1165
- G,
1166
- ce,
1165
+ K,
1166
+ se,
1167
1167
  w,
1168
1168
  S
1169
1169
  ]);
1170
- return /* @__PURE__ */ N(C, {
1170
+ return /* @__PURE__ */ j(C, {
1171
1171
  heading: v ?? "Share link",
1172
1172
  portalId: "share",
1173
1173
  size: x.SM,
1174
1174
  dividers: i,
1175
- onClose: se,
1175
+ onClose: oe,
1176
1176
  closeButtonTitle: m ?? "Close",
1177
- children: [re ? /* @__PURE__ */ N("div", {
1177
+ children: [ne ? /* @__PURE__ */ j("div", {
1178
1178
  className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0",
1179
1179
  children: [
1180
- te ? /* @__PURE__ */ M(g, {
1180
+ R ? /* @__PURE__ */ A(g, {
1181
1181
  type: _.Note,
1182
- icon: /* @__PURE__ */ M(O, {
1182
+ icon: /* @__PURE__ */ A(O, {
1183
1183
  width: 16,
1184
1184
  height: 16
1185
1185
  }),
1186
- children: te
1186
+ children: R
1187
1187
  }) : null,
1188
- e?.name ? /* @__PURE__ */ N("div", {
1188
+ e?.name ? /* @__PURE__ */ j("div", {
1189
1189
  className: "share-info flex w-full",
1190
- children: [/* @__PURE__ */ M("p", {
1190
+ children: [/* @__PURE__ */ A("p", {
1191
1191
  className: "share-info-title body-1 mr-1 text-neutrals-800",
1192
- children: A ?? "Chat name:"
1193
- }), /* @__PURE__ */ M("h3", {
1192
+ children: te ?? "Chat name:"
1193
+ }), /* @__PURE__ */ A("h3", {
1194
1194
  className: "min-w-0 flex-1 truncate",
1195
1195
  title: e?.name,
1196
1196
  children: e?.name
1197
1197
  })]
1198
1198
  }) : null,
1199
- /* @__PURE__ */ N("div", {
1199
+ /* @__PURE__ */ j("div", {
1200
1200
  className: "share-info flex",
1201
- children: [/* @__PURE__ */ M("p", {
1201
+ children: [/* @__PURE__ */ A("p", {
1202
1202
  className: "share-info-title body-1 mr-1 text-neutrals-800",
1203
1203
  children: d ?? "Link expiration date:"
1204
- }), /* @__PURE__ */ N("h3", { children: ["3 ", p ?? "days"] })]
1204
+ }), /* @__PURE__ */ j("h3", { children: ["3 ", p ?? "days"] })]
1205
1205
  }),
1206
- /* @__PURE__ */ M(Be, {
1206
+ /* @__PURE__ */ A(Be, {
1207
1207
  className: "min-h-[200px] self-center rounded border border-neutrals-600 p-2",
1208
- value: Y,
1208
+ value: X,
1209
1209
  size: 200
1210
1210
  }),
1211
- /* @__PURE__ */ M("p", {
1211
+ /* @__PURE__ */ A("p", {
1212
1212
  className: "body-2 text-neutrals-1000",
1213
1213
  children: D ?? "Your name, special instructions, and any messages you add after sharing remain confidential."
1214
1214
  }),
1215
- /* @__PURE__ */ M(y, {
1215
+ /* @__PURE__ */ A(y, {
1216
1216
  containerClasses: "share-input-container",
1217
1217
  cssClass: "share-input",
1218
1218
  readonly: !0,
1219
- placeholder: Y,
1220
- value: Y,
1219
+ placeholder: X,
1220
+ value: X,
1221
1221
  inputId: "conversationLink",
1222
- iconAfterInput: ue()
1222
+ iconAfterInput: le()
1223
1223
  })
1224
1224
  ]
1225
- }) : /* @__PURE__ */ M("div", {
1225
+ }) : /* @__PURE__ */ A("div", {
1226
1226
  className: "flex items-center justify-center p-6",
1227
- children: /* @__PURE__ */ M(b, {})
1228
- }), re ? e && H ? /* @__PURE__ */ M("div", {
1227
+ children: /* @__PURE__ */ A(b, {})
1228
+ }), ne ? e && U ? /* @__PURE__ */ A("div", {
1229
1229
  className: "remove-access",
1230
- children: /* @__PURE__ */ M(f, {
1231
- title: k ?? "Remove access to all users",
1230
+ children: /* @__PURE__ */ A(f, {
1231
+ title: ee ?? "Remove access to all users",
1232
1232
  buttonClassName: "remove-access-button py-3 px-4",
1233
1233
  isSmallButton: !0,
1234
- disabled: ae,
1235
- onClick: le
1234
+ disabled: ie,
1235
+ onClick: ce
1236
1236
  })
1237
- }) : /* @__PURE__ */ M("p", {
1237
+ }) : /* @__PURE__ */ A("p", {
1238
1238
  className: "body-2 share-footer text-neutrals-800",
1239
1239
  children: h ?? "This chat has not been shared with anyone yet."
1240
- }) : /* @__PURE__ */ M("div", {})]
1240
+ }) : /* @__PURE__ */ A("div", {})]
1241
1241
  });
1242
1242
  }, Ke = ({ conversation: e, onCloseModal: t, renameConversation: n, locale: r }) => {
1243
- let { titles: i, disableModalDividers: a, isSmallModalButton: o } = Y(), [s, l] = c(e?.name || ""), u = (e) => {
1243
+ let { titles: i, disableModalDividers: a, isSmallModalButton: o } = X(), [s, l] = c(e?.name || ""), u = (e) => {
1244
1244
  l(e);
1245
1245
  }, d = () => {
1246
- let t = `${e?.folderId}/${encodeURIComponent(L(s))}-${(/* @__PURE__ */ new Date()).getTime()}`;
1246
+ let t = `${e?.folderId}/${encodeURIComponent(I(s))}-${(/* @__PURE__ */ new Date()).getTime()}`;
1247
1247
  n(`conversations/${e.id}`, `conversations/${t}`);
1248
1248
  };
1249
- return /* @__PURE__ */ N(C, {
1249
+ return /* @__PURE__ */ j(C, {
1250
1250
  heading: i?.renameTitle ?? "Rename conversation",
1251
1251
  portalId: "rename-conversation",
1252
1252
  containerClassName: "rename-conversation-popup",
@@ -1254,25 +1254,25 @@ var Ve = (e, t) => ({
1254
1254
  dividers: !a,
1255
1255
  onClose: t,
1256
1256
  closeButtonTitle: i?.close ?? "Cancel",
1257
- children: [/* @__PURE__ */ M("div", {
1257
+ children: [/* @__PURE__ */ A("div", {
1258
1258
  className: "px-6 py-4 sm:px-0",
1259
1259
  lang: r,
1260
- children: /* @__PURE__ */ M(v, {
1260
+ children: /* @__PURE__ */ A(v, {
1261
1261
  inputId: "rename",
1262
1262
  value: s,
1263
1263
  onChange: u,
1264
1264
  cssClass: "w-full"
1265
1265
  })
1266
- }), /* @__PURE__ */ N("div", {
1266
+ }), /* @__PURE__ */ j("div", {
1267
1267
  className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3",
1268
- children: [/* @__PURE__ */ M(f, {
1268
+ children: [/* @__PURE__ */ A(f, {
1269
1269
  buttonClassName: "cancel-button",
1270
1270
  title: i?.cancel ?? "Cancel",
1271
1271
  isSmallButton: o,
1272
1272
  onClick: (e) => {
1273
1273
  e.stopPropagation(), t();
1274
1274
  }
1275
- }), /* @__PURE__ */ M(f, {
1275
+ }), /* @__PURE__ */ A(f, {
1276
1276
  buttonClassName: "text-button-primary text-button-primary",
1277
1277
  title: i?.save ?? "Rename",
1278
1278
  isSmallButton: o,
@@ -1285,7 +1285,7 @@ var Ve = (e, t) => ({
1285
1285
  });
1286
1286
  }, qe = n(null);
1287
1287
  function Je({ children: e, value: t }) {
1288
- return /* @__PURE__ */ M(qe.Provider, {
1288
+ return /* @__PURE__ */ A(qe.Provider, {
1289
1289
  value: t,
1290
1290
  children: e
1291
1291
  });
@@ -1298,26 +1298,26 @@ function Ye() {
1298
1298
  //#endregion
1299
1299
  //#region libs/conversation-list/src/components/ActionMenu/ActionMenu.tsx
1300
1300
  var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1301
- let i = Y(), { locale: a, deleteConversation: s, renameConversation: l, getConversation: u, getFileBlob: d, shareConversationProps: f } = Ye(), m = o(() => {
1301
+ let i = X(), { locale: a, deleteConversation: s, renameConversation: l, getConversation: u, getFileBlob: d, shareConversationProps: f } = Ye(), m = o(() => {
1302
1302
  let t = [{
1303
- key: B.DELETE,
1303
+ key: V.DELETE,
1304
1304
  title: i?.titles?.delete ?? "Delete",
1305
- icon: i.actionsIcons?.[B.DELETE]
1305
+ icon: i.actionsIcons?.[V.DELETE]
1306
1306
  }];
1307
- return e?.model?.id?.endsWith(F) ? t : [
1307
+ return e?.model?.id?.endsWith(N) ? t : [
1308
1308
  ...e.isShared ? [] : [{
1309
- key: B.SHARE,
1309
+ key: V.SHARE,
1310
1310
  title: i?.titles?.share ?? "Share",
1311
- icon: i.actionsIcons?.[B.SHARE]
1311
+ icon: i.actionsIcons?.[V.SHARE]
1312
1312
  }, {
1313
- key: B.RENAME,
1313
+ key: V.RENAME,
1314
1314
  title: i?.titles?.rename ?? "Rename",
1315
- icon: i.actionsIcons?.[B.RENAME]
1315
+ icon: i.actionsIcons?.[V.RENAME]
1316
1316
  }],
1317
1317
  {
1318
- key: B.EXPORT,
1318
+ key: V.EXPORT,
1319
1319
  title: i?.titles?.export ?? "Export",
1320
- icon: i.actionsIcons?.[B.EXPORT]
1320
+ icon: i.actionsIcons?.[V.EXPORT]
1321
1321
  },
1322
1322
  ...t
1323
1323
  ];
@@ -1341,49 +1341,49 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1341
1341
  ]), E = r((e, t) => {
1342
1342
  l(e, t), w();
1343
1343
  }, [l, w]);
1344
- return /* @__PURE__ */ N(j, { children: [
1345
- /* @__PURE__ */ M(p, {
1344
+ return /* @__PURE__ */ j(k, { children: [
1345
+ /* @__PURE__ */ A(p, {
1346
1346
  containerClassName: "ml-3 hidden group-hover:flex",
1347
- triggerButton: t ?? /* @__PURE__ */ M(Ze, { disabled: n }),
1347
+ triggerButton: t ?? /* @__PURE__ */ A(Ze, { disabled: n }),
1348
1348
  options: m,
1349
1349
  openedClassName: "!flex action-menu-opened",
1350
1350
  onOptionSelect: (t) => {
1351
- t === B.DELETE && g(S.Opened), t === B.SHARE && v(S.Opened), t === B.RENAME && b(S.Opened), t === B.EXPORT && u(decodeURI(e.id)).then((e) => {
1352
- fe(e, d).then((e) => {
1353
- he(`data:application/zip;base64,${e}`, `chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`);
1351
+ t === V.DELETE && g(S.Opened), t === V.SHARE && v(S.Opened), t === V.RENAME && b(S.Opened), t === V.EXPORT && u(decodeURI(e.id)).then((e) => {
1352
+ de(e, d).then((e) => {
1353
+ me(`data:application/zip;base64,${e}`, `chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`);
1354
1354
  });
1355
1355
  });
1356
1356
  },
1357
1357
  disabled: n
1358
1358
  }),
1359
- h === S.Opened && /* @__PURE__ */ M(X, {
1359
+ h === S.Opened && /* @__PURE__ */ A(Z, {
1360
1360
  locale: a,
1361
1361
  deleteConversation: T,
1362
1362
  onCloseModal: x
1363
1363
  }),
1364
- _ === S.Opened && /* @__PURE__ */ M(Ge, {
1364
+ _ === S.Opened && /* @__PURE__ */ A(Ge, {
1365
1365
  conversation: e,
1366
1366
  locale: a,
1367
1367
  onCloseModal: C,
1368
1368
  ...f
1369
1369
  }),
1370
- y === S.Opened && /* @__PURE__ */ M(Ke, {
1370
+ y === S.Opened && /* @__PURE__ */ A(Ke, {
1371
1371
  conversation: e,
1372
1372
  locale: a,
1373
1373
  renameConversation: E,
1374
1374
  onCloseModal: w
1375
1375
  })
1376
1376
  ] });
1377
- }, Ze = ({ disabled: t }) => /* @__PURE__ */ M("div", {
1377
+ }, Ze = ({ disabled: t }) => /* @__PURE__ */ A("div", {
1378
1378
  className: e("flex items-center justify-center w-[24px]", t ? "cursor-not-allowed" : "cursor-pointer"),
1379
- children: /* @__PURE__ */ M(D, {
1379
+ children: /* @__PURE__ */ A(D, {
1380
1380
  width: 20,
1381
1381
  height: 20,
1382
1382
  stroke: 2,
1383
1383
  className: "text-primary"
1384
1384
  })
1385
1385
  }), Qe = ({ conversation: t, selectedConversationId: n, searchQuery: r, onConversationClick: i, isDisabled: o }) => {
1386
- let { titles: c, conversationItemIcon: l } = Y(), u = s(null), d = L(t?.name);
1386
+ let { titles: c, conversationItemIcon: l } = X(), u = s(null), d = I(t?.name);
1387
1387
  return a(() => {
1388
1388
  if (t?.id === n && u?.current) {
1389
1389
  let e = u.current.parentElement?.parentElement?.parentElement;
@@ -1395,104 +1395,107 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1395
1395
  });
1396
1396
  }
1397
1397
  }
1398
- }, [t, n]), /* @__PURE__ */ N("div", {
1398
+ }, [t, n]), /* @__PURE__ */ j("div", {
1399
1399
  ref: u,
1400
1400
  className: e("flex justify-between items-center py-2 px-3 border-transparent relative group border", "conversation-item", n === t?.id && "bg-hues-100 conversation-item-active", o ? "cursor-not-allowed" : "cursor-pointer hover:border-hues-600"),
1401
1401
  onClick: () => !o && i(t.folderId, t?.id),
1402
1402
  title: o ? c?.noActionsAllowed : d,
1403
- children: [/* @__PURE__ */ N("div", {
1403
+ children: [/* @__PURE__ */ j("div", {
1404
1404
  className: "flex min-w-0 flex-1 items-center",
1405
- children: [l || null, /* @__PURE__ */ M("h3", {
1405
+ children: [l || null, /* @__PURE__ */ A("h3", {
1406
1406
  className: e("truncate pb-px -mb-px font-semibold text-neutrals-1000 sm:body-2", "conversation-item-text", n === t?.id ? "conversation-item-text-active" : ""),
1407
1407
  title: o ? c?.noActionsAllowed : d,
1408
- children: r?.length ? /* @__PURE__ */ M(m, {
1408
+ children: r?.length ? /* @__PURE__ */ A(m, {
1409
1409
  text: d,
1410
1410
  highlightText: r
1411
1411
  }) : d
1412
1412
  })]
1413
- }), /* @__PURE__ */ M(Xe, {
1413
+ }), /* @__PURE__ */ A(Xe, {
1414
1414
  conversation: t,
1415
1415
  isDisabled: o
1416
1416
  })]
1417
1417
  });
1418
- }, $e = ({ handleConversationClick: t, selectedConversationId: n, groupLabel: i, groupedConversations: a, isDisabled: o }) => {
1419
- let { titles: s } = Y(), [l, u] = c(!1);
1420
- return /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ N("div", {
1418
+ }, $e = ({ handleConversationClick: t, selectedConversationId: n, groupLabel: r, groupedConversations: i, isDisabled: a, isCollapsed: o, onToggleCollapse: s }) => {
1419
+ let { titles: c } = X();
1420
+ return /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("div", {
1421
1421
  className: "conversation-group-items-title mb-3 inline-flex cursor-pointer items-center gap-1 text-neutrals-700",
1422
- onClick: r(() => {
1423
- u((e) => !e);
1424
- }, [u]),
1425
- children: [/* @__PURE__ */ M(w, { className: e("w-3 h-3 conversation-group-items-arrow", l ? "rotate-[90deg]" : "rotate-0") }), /* @__PURE__ */ M("span", {
1422
+ onClick: s,
1423
+ children: [/* @__PURE__ */ A(w, { className: e("w-3 h-3 conversation-group-items-arrow", o ? "rotate-[90deg]" : "rotate-0") }), /* @__PURE__ */ A("span", {
1426
1424
  className: "body-3 conversation-group-items-title-text",
1427
- children: q(i, s)
1425
+ children: J(r, c)
1428
1426
  })]
1429
- }), !l && /* @__PURE__ */ M("div", {
1427
+ }), !o && /* @__PURE__ */ A("div", {
1430
1428
  className: e("flex flex-col gap-y-3", "conversation-group-items"),
1431
- children: K(a).map((e) => /* @__PURE__ */ M(Qe, {
1432
- isDisabled: o,
1429
+ children: q(i).map((e) => /* @__PURE__ */ A(Qe, {
1430
+ isDisabled: a,
1433
1431
  conversation: e,
1434
1432
  selectedConversationId: n,
1435
1433
  onConversationClick: t
1436
1434
  }, e.id || e.name))
1437
- })] }, i);
1435
+ })] }, r);
1438
1436
  }, et = ({ searchQuery: e, isExpandedSearch: t, onSearchConversations: n, toggleSearchField: r }) => {
1439
- let { titles: i, searchIcon: a } = Y();
1440
- return /* @__PURE__ */ M(j, { children: t ? /* @__PURE__ */ M(y, {
1437
+ let { titles: i, searchIcon: a } = X();
1438
+ return /* @__PURE__ */ A(k, { children: t ? /* @__PURE__ */ A(y, {
1441
1439
  inputId: "conversations-search",
1442
1440
  placeholder: i?.searchPlaceholder ?? "Search",
1443
1441
  containerClasses: "conversation-list-search-input h-[40px] bg-transparent px-4 py-2 rounded-full border-neutrals-400 shadow-none",
1444
1442
  cssClass: "h-auto",
1445
1443
  value: e,
1446
- iconAfterInput: /* @__PURE__ */ M(h, {
1444
+ iconAfterInput: /* @__PURE__ */ A(h, {
1447
1445
  buttonClassName: "text-button-tertiary items-center p-0 ml-4 border-0 w-5 h-5",
1448
1446
  onClick: r,
1449
- icon: /* @__PURE__ */ M(A, {})
1447
+ icon: /* @__PURE__ */ A(te, {})
1450
1448
  }),
1451
1449
  onChange: n
1452
- }) : /* @__PURE__ */ M(f, {
1450
+ }) : /* @__PURE__ */ A(f, {
1453
1451
  buttonClassName: "text-button-tertiary p-0 search-button",
1454
- iconBefore: a || /* @__PURE__ */ M(k, { className: "size-5" }),
1452
+ iconBefore: a || /* @__PURE__ */ A(ee, { className: "size-5" }),
1455
1453
  onClick: r
1456
1454
  }) });
1457
1455
  }, tt = ({ conversations: e, selectedConversationId: t, searchQuery: n, handleConversationClick: r, isDisabled: i }) => {
1458
- let { titles: o } = Y(), [s, l] = c([]);
1456
+ let { titles: o } = X(), [s, l] = c([]);
1459
1457
  return a(() => {
1460
- l(K(e?.filter((e) => L(e?.name)?.includes(n || ""))));
1461
- }, [e, n]), /* @__PURE__ */ M(j, { children: s?.length ? s.map((e) => /* @__PURE__ */ M(Qe, {
1458
+ l(q(e?.filter((e) => I(e?.name)?.includes(n || ""))));
1459
+ }, [e, n]), /* @__PURE__ */ A(k, { children: s?.length ? s.map((e) => /* @__PURE__ */ A(Qe, {
1462
1460
  conversation: e,
1463
1461
  searchQuery: n,
1464
1462
  selectedConversationId: t,
1465
1463
  onConversationClick: r,
1466
1464
  isDisabled: i
1467
- }, e.id)) : /* @__PURE__ */ M("h3", {
1465
+ }, e.id)) : /* @__PURE__ */ A("h3", {
1468
1466
  className: "text-neutrals-800",
1469
1467
  children: o?.noConversation ?? "No conversations yet"
1470
1468
  }) });
1471
1469
  }, nt = () => {
1472
- let { titles: e } = Y();
1473
- return /* @__PURE__ */ N("div", {
1470
+ let { titles: e } = X();
1471
+ return /* @__PURE__ */ j("div", {
1474
1472
  className: "flex flex-col p-8 text-center",
1475
- children: [/* @__PURE__ */ M("p", {
1473
+ children: [/* @__PURE__ */ A("p", {
1476
1474
  className: "text-neutrals-800",
1477
1475
  children: e?.noConversation ?? "No conversations yet"
1478
- }), /* @__PURE__ */ M("p", {
1476
+ }), /* @__PURE__ */ A("p", {
1479
1477
  className: "mt-2 text-sm text-neutrals-800",
1480
1478
  children: e?.clickNewChat ?? "Click \"New Chat\" to start a conversation"
1481
1479
  })]
1482
1480
  });
1483
1481
  }, rt = ({ handleConversationClick: t, selectedConversationId: n, actions: i, children: s, isCollapsed: l, isStreaming: u, conversationStyles: d, conversations: f, locale: p, sharedConversations: m, setConversations: h, setSharedConversations: g, shareConversationProps: _, handleSelectedConversationRemove: v }) => {
1484
- let [y, x] = c({}), [S, C] = c(!0), [w, T] = c(""), [E, D] = c(!1), { getConversations: O, getSharedConversations: k, deleteConversation: A, renameConversation: j } = i, P = o(() => !!w?.length, [w]);
1482
+ let [y, x] = c({}), [S, C] = c(!0), [w, T] = c(""), [E, D] = c(!1), [O, ee] = c(/* @__PURE__ */ new Set()), te = r((e) => {
1483
+ ee((t) => {
1484
+ let n = new Set(t);
1485
+ return n.has(e) ? n.delete(e) : n.add(e), n;
1486
+ });
1487
+ }, []), { getConversations: k, getSharedConversations: M, deleteConversation: N, renameConversation: P } = i, I = o(() => !!w?.length, [w]);
1485
1488
  a(() => {
1486
1489
  x({
1487
- ...U(m),
1488
- ...oe(f)
1490
+ ...W(m),
1491
+ ...ae(f)
1489
1492
  });
1490
1493
  }, [f, m]), a(() => {
1491
1494
  async function e() {
1492
1495
  try {
1493
1496
  C(!0);
1494
- let e = await O(p), t = await k(ne(z.ME));
1495
- h(I(e)), g(I(H(t, p)));
1497
+ let e = await k(p), t = await M(B(z.ME));
1498
+ h(F(e)), g(F(U(t, p)));
1496
1499
  } catch (e) {
1497
1500
  console.error("Error loading conversation", e);
1498
1501
  } finally {
@@ -1501,91 +1504,93 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1501
1504
  }
1502
1505
  e();
1503
1506
  }, [
1504
- O,
1507
+ k,
1505
1508
  h,
1506
1509
  p,
1507
- k,
1510
+ M,
1508
1511
  g
1509
1512
  ]);
1510
- let F = r(async (e) => {
1513
+ let L = r(async (e) => {
1511
1514
  try {
1512
- await A(e);
1513
- let t = await O(p), r = await k(ne(z.ME));
1514
- h(I(t)), g(I(H(r, p))), n === e?.id && v();
1515
+ await N(e);
1516
+ let t = await k(p), r = await M(B(z.ME));
1517
+ h(F(t)), g(F(U(r, p))), n === e?.id && v();
1515
1518
  } catch (e) {
1516
1519
  console.error("Error deleting conversation", e);
1517
1520
  }
1518
1521
  }, [
1519
- A,
1520
- O,
1521
- p,
1522
+ N,
1522
1523
  k,
1524
+ p,
1525
+ M,
1523
1526
  h,
1524
1527
  g,
1525
1528
  n,
1526
1529
  v
1527
- ]), ee = r(async (e, t) => {
1530
+ ]), R = r(async (e, t) => {
1528
1531
  try {
1529
- C(!0), await j(e, t);
1530
- let n = await O(p), r = await k(ne(z.ME));
1531
- h(I(n)), g(I(H(r, p)));
1532
+ C(!0), await P(e, t);
1533
+ let n = await k(p), r = await M(B(z.ME));
1534
+ h(F(n)), g(F(U(r, p)));
1532
1535
  } catch (e) {
1533
1536
  console.error("Error renaming conversation", e);
1534
1537
  } finally {
1535
1538
  C(!1);
1536
1539
  }
1537
1540
  }, [
1538
- O,
1539
- p,
1540
1541
  k,
1542
+ p,
1543
+ M,
1541
1544
  h,
1542
1545
  g,
1543
- j
1544
- ]), L = r((e) => {
1546
+ P
1547
+ ]), V = r((e) => {
1545
1548
  T(e);
1546
- }, [T]), R = r(() => {
1549
+ }, [T]), H = r(() => {
1547
1550
  D((e) => !e), T("");
1548
1551
  }, [D]);
1549
- return S ? /* @__PURE__ */ M(b, {}) : /* @__PURE__ */ M(Je, {
1552
+ return S ? /* @__PURE__ */ A(b, {}) : /* @__PURE__ */ A(Je, {
1550
1553
  value: {
1551
1554
  locale: p,
1552
- deleteConversation: F,
1553
- renameConversation: ee,
1555
+ deleteConversation: L,
1556
+ renameConversation: R,
1554
1557
  getConversation: i.getConversation,
1555
1558
  getFileBlob: i.getFileBlob,
1556
1559
  shareConversationProps: _
1557
1560
  },
1558
- children: /* @__PURE__ */ N(J.Provider, {
1561
+ children: /* @__PURE__ */ j(Y.Provider, {
1559
1562
  value: d,
1560
1563
  children: [
1561
- !l && /* @__PURE__ */ N("div", {
1564
+ !l && /* @__PURE__ */ j("div", {
1562
1565
  className: e("flex justify-between items-center pr-6", E ? " pt-4 pb-0 sm:pt-10" : " pt-6 pb-2 sm:pt-10"),
1563
- children: [!E && /* @__PURE__ */ M("h3", {
1566
+ children: [!E && /* @__PURE__ */ A("h3", {
1564
1567
  className: "sm:body-2 text-neutrals-700",
1565
1568
  children: d?.titles?.allChats ?? "All Chats"
1566
- }), /* @__PURE__ */ M(et, {
1569
+ }), /* @__PURE__ */ A(et, {
1567
1570
  searchQuery: w,
1568
1571
  isExpandedSearch: E,
1569
- onSearchConversations: L,
1570
- toggleSearchField: R
1572
+ onSearchConversations: V,
1573
+ toggleSearchField: H
1571
1574
  })]
1572
1575
  }),
1573
- /* @__PURE__ */ M("div", {
1576
+ /* @__PURE__ */ A("div", {
1574
1577
  className: "scroll-hidden-container mt-4 flex min-h-0 flex-1 flex-col",
1575
- children: l ? null : /* @__PURE__ */ M("div", {
1576
- className: e("flex flex-col pr-4", P ? "gap-y-1" : "gap-y-6"),
1577
- children: f?.length === 0 && m?.length === 0 ? /* @__PURE__ */ M(nt, {}) : P ? /* @__PURE__ */ M(tt, {
1578
+ children: l ? null : /* @__PURE__ */ A("div", {
1579
+ className: e("flex flex-col pr-4", I ? "gap-y-1" : "gap-y-6"),
1580
+ children: f?.length === 0 && m?.length === 0 ? /* @__PURE__ */ A(nt, {}) : I ? /* @__PURE__ */ A(tt, {
1578
1581
  conversations: [...m, ...f],
1579
1582
  searchQuery: w,
1580
1583
  selectedConversationId: n,
1581
1584
  handleConversationClick: t,
1582
1585
  isDisabled: u
1583
- }) : Object.entries(y).map(([e, r]) => r?.length > 0 && /* @__PURE__ */ M($e, {
1586
+ }) : Object.entries(y).map(([e, r]) => r?.length > 0 && /* @__PURE__ */ A($e, {
1584
1587
  isDisabled: u,
1585
1588
  groupLabel: e,
1586
1589
  groupedConversations: r,
1587
1590
  handleConversationClick: t,
1588
- selectedConversationId: n
1591
+ selectedConversationId: n,
1592
+ isCollapsed: O.has(e),
1593
+ onToggleCollapse: () => te(e)
1589
1594
  }, e))
1590
1595
  })
1591
1596
  }),
@@ -1593,7 +1598,7 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1593
1598
  ]
1594
1599
  })
1595
1600
  });
1596
- }, it = ({ onCloseModal: e, disableModalDividers: t, signOut: n, isSmallButton: r, locale: i, titles: a }) => /* @__PURE__ */ N(C, {
1601
+ }, it = ({ onCloseModal: e, disableModalDividers: t, signOut: n, isSmallButton: r, locale: i, titles: a }) => /* @__PURE__ */ j(C, {
1597
1602
  heading: a?.popupTitle || "Log out?",
1598
1603
  portalId: "sign-out",
1599
1604
  containerClassName: "sign-out-popup",
@@ -1601,20 +1606,20 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1601
1606
  dividers: !t,
1602
1607
  onClose: e,
1603
1608
  closeButtonTitle: "Cancel",
1604
- children: [/* @__PURE__ */ M("div", {
1609
+ children: [/* @__PURE__ */ A("div", {
1605
1610
  className: "px-6 py-4 sm:px-0",
1606
1611
  lang: i,
1607
1612
  children: a?.popupText
1608
- }), /* @__PURE__ */ N("div", {
1613
+ }), /* @__PURE__ */ j("div", {
1609
1614
  className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3",
1610
- children: [/* @__PURE__ */ M(f, {
1615
+ children: [/* @__PURE__ */ A(f, {
1611
1616
  buttonClassName: "cancel-button",
1612
1617
  title: a?.popupCancel || "Cancel",
1613
1618
  isSmallButton: r,
1614
1619
  onClick: (t) => {
1615
1620
  t.stopPropagation(), e();
1616
1621
  }
1617
- }), /* @__PURE__ */ M(f, {
1622
+ }), /* @__PURE__ */ A(f, {
1618
1623
  buttonClassName: "text-button-primary",
1619
1624
  title: a?.popupApply || "Sign Out",
1620
1625
  isSmallButton: r,
@@ -1630,12 +1635,12 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1630
1635
  m(!1);
1631
1636
  }, []), y = r(() => {
1632
1637
  window.open(i || "#", "_blank", "noopener,noreferrer");
1633
- }, [i]), b = o(() => /* @__PURE__ */ N("div", {
1638
+ }, [i]), b = o(() => /* @__PURE__ */ j("div", {
1634
1639
  className: "flex items-center gap-2",
1635
- children: [/* @__PURE__ */ M("div", {
1640
+ children: [/* @__PURE__ */ A("div", {
1636
1641
  className: e("cursor-pointer flex items-center justify-center size-11 rounded-[100px] p-[10px] sm:h-[32px] sm:w-[32px] flex-shrink-0", a?.initialStyles),
1637
1642
  children: d
1638
- }), /* @__PURE__ */ M("p", {
1643
+ }), /* @__PURE__ */ A("p", {
1639
1644
  className: e("h3 cursor-pointer overflow-hidden text-ellipsis", a?.userNameStyles),
1640
1645
  children: (a?.showShortName ? g : t?.name) ?? t?.email ?? ""
1641
1646
  })]
@@ -1644,47 +1649,47 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1644
1649
  g,
1645
1650
  a,
1646
1651
  t
1647
- ]), x = o(() => /* @__PURE__ */ N("div", {
1652
+ ]), x = o(() => /* @__PURE__ */ j("div", {
1648
1653
  className: e("py-1", a?.dropDownStyles),
1649
1654
  children: [
1650
- a?.settingsIcon && /* @__PURE__ */ N("button", {
1655
+ a?.settingsIcon && /* @__PURE__ */ j("button", {
1651
1656
  className: e("p-2 items-center flex gap-1 text-primary fill-primary", a?.dropdownButtonTypographyStyles || "body-1", a?.dropdownButtonStyles),
1652
1657
  title: l?.settings,
1653
- children: [/* @__PURE__ */ M("span", {
1658
+ children: [/* @__PURE__ */ A("span", {
1654
1659
  className: "shrink-0",
1655
1660
  children: a?.settingsIcon
1656
- }), /* @__PURE__ */ M("span", {
1661
+ }), /* @__PURE__ */ A("span", {
1657
1662
  className: "min-w-0 break-words",
1658
1663
  children: l?.settings || "Settings"
1659
1664
  })]
1660
1665
  }),
1661
- a?.contactSupportIcon && /* @__PURE__ */ N("button", {
1666
+ a?.contactSupportIcon && /* @__PURE__ */ j("button", {
1662
1667
  className: e("p-2 items-center flex gap-1 text-primary fill-primary", a?.dropdownButtonTypographyStyles || "body-1", a?.dropdownButtonStyles),
1663
1668
  title: l?.contactSupport,
1664
1669
  onClick: y,
1665
- children: [/* @__PURE__ */ M("span", {
1670
+ children: [/* @__PURE__ */ A("span", {
1666
1671
  className: "shrink-0",
1667
1672
  children: a?.contactSupportIcon
1668
- }), /* @__PURE__ */ M("span", {
1673
+ }), /* @__PURE__ */ A("span", {
1669
1674
  className: "min-w-0 break-words",
1670
1675
  children: l?.contactSupport || "Contact support"
1671
1676
  })]
1672
1677
  }),
1673
- /* @__PURE__ */ M("div", { className: e("h-0 border-t border-neutrals-600 my-2", a?.showSeparator ? "block" : "hidden") }),
1674
- /* @__PURE__ */ N("button", {
1678
+ /* @__PURE__ */ A("div", { className: e("h-0 border-t border-neutrals-600 my-2", a?.showSeparator ? "block" : "hidden") }),
1679
+ /* @__PURE__ */ j("button", {
1675
1680
  className: e("p-2 items-center flex gap-1 text-primary fill-primary", a?.dropdownButtonTypographyStyles || "body-1", a?.dropdownButtonStyles),
1676
1681
  title: l?.signOut,
1677
1682
  onClick: _,
1678
1683
  children: [
1679
- /* @__PURE__ */ M("span", {
1684
+ /* @__PURE__ */ A("span", {
1680
1685
  className: "shrink-0",
1681
1686
  children: a?.signOutIcon
1682
1687
  }),
1683
- /* @__PURE__ */ M("span", {
1688
+ /* @__PURE__ */ A("span", {
1684
1689
  className: "min-w-0 break-words",
1685
1690
  children: l?.signOut || "Sign out"
1686
1691
  }),
1687
- f && /* @__PURE__ */ M(it, {
1692
+ f && /* @__PURE__ */ A(it, {
1688
1693
  onCloseModal: v,
1689
1694
  signOut: () => n?.(),
1690
1695
  locale: s,
@@ -1704,7 +1709,7 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1704
1709
  s,
1705
1710
  n
1706
1711
  ]);
1707
- if (t) return /* @__PURE__ */ M(p, {
1712
+ if (t) return /* @__PURE__ */ A(p, {
1708
1713
  containerClassName: e("transition-opacity group-hover:opacity-100 shrink w-full", a?.dropdownContainerClassName),
1709
1714
  triggerButton: b,
1710
1715
  content: x,
@@ -1712,4 +1717,4 @@ var Xe = ({ conversation: e, triggerButton: t, isDisabled: n }) => {
1712
1717
  });
1713
1718
  };
1714
1719
  //#endregion
1715
- export { Xe as ActionMenu, B as ActionMenuItem, rt as ConversationList, at as User, U as getSharedConversationsGroup, H as transformSharedConversations };
1720
+ export { Xe as ActionMenu, V as ActionMenuItem, rt as ConversationList, at as User, W as getSharedConversationsGroup, U as transformSharedConversations };