@epam/statgpt-conversation-list 0.4.0-rc.9 → 0.4.0

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.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +912 -866
  3. package/package.json +4 -4
package/index.mjs CHANGED
@@ -1,110 +1,110 @@
1
- import { jsxs as y, jsx as m, Fragment as q } from "react/jsx-runtime";
2
- import k from "classnames";
3
- import x, { useState as T, useMemo as J, useEffect as ee, useCallback as B, useRef as ze } from "react";
4
- import { cloneDeep as $e, uniqBy as _e, omit as He } from "lodash";
5
- import { Popup as ae, PopUpSize as le, Button as Q, Loader as we, InputWithIcon as Ne, Input as Ye, PopUpState as z, Dropdown as Re, HighlightText as Qe, IconButton as Ge } from "@epam/statgpt-ui-components";
6
- import { IconCheck as je, IconCopy as We, IconDotsVertical as Ve, IconCaretRightFilled as Xe, IconX as Ke, IconSearch as Ze } from "@tabler/icons-react";
7
- import Je from "jszip";
8
- import { getConversationAttachments as qe, SHARE_CONVERSATION_ROUTE as ve, getClearedConversationName as fe, ONBOARDING_MODEL_POSTFIX as et, cleanConversationNames as K } from "@epam/statgpt-shared-toolkit";
9
- import { InvitationType as tt, getSharedConversationsRequest as re, ShareTarget as se } from "@epam/statgpt-dial-toolkit";
10
- var U = /* @__PURE__ */ ((o) => (o.DELETE = "delete", o.EXPORT = "export", o.SHARE = "share", o.RENAME = "rename", o))(U || {}), F = /* @__PURE__ */ ((o) => (o.SHARED = "shared", o.TODAY = "today", o.YESTERDAY = "yesterday", o.WEEK = "week", o.EARLIER = "earlier", o))(F || {});
11
- const ue = (o, s) => o?.resources?.filter((r) => r?.parentPath === s)?.map((r) => {
12
- const l = `${r?.bucket}/${s}`, c = r?.url?.split("/")?.slice(1)?.join("/");
1
+ import { jsxs as M, jsx as h, Fragment as te } from "react/jsx-runtime";
2
+ import B from "classnames";
3
+ import D, { useState as k, useRef as me, useMemo as X, useCallback as O, useEffect as ne } from "react";
4
+ import { cloneDeep as Ye, uniqBy as Qe, omit as Ge } from "lodash";
5
+ import { Popup as le, PopUpSize as ce, Button as j, Loader as Re, InputWithIcon as ye, Input as je, PopUpState as $, Dropdown as Me, HighlightText as We, IconButton as Ve } from "@epam/statgpt-ui-components";
6
+ import { IconCheck as Xe, IconCopy as Ke, IconDotsVertical as Ze, IconCaretRightFilled as Je, IconX as qe, IconSearch as et } from "@tabler/icons-react";
7
+ import tt from "jszip";
8
+ import { getConversationAttachments as nt, SHARE_CONVERSATION_ROUTE as be, getClearedConversationName as Ee, ONBOARDING_MODEL_POSTFIX as ot, cleanConversationNames as J } from "@epam/statgpt-shared-toolkit";
9
+ import { InvitationType as rt, getSharedConversationsRequest as se, ShareTarget as ie } from "@epam/statgpt-dial-toolkit";
10
+ var _ = /* @__PURE__ */ ((o) => (o.DELETE = "delete", o.EXPORT = "export", o.SHARE = "share", o.RENAME = "rename", o))(_ || {}), U = /* @__PURE__ */ ((o) => (o.SHARED = "shared", o.TODAY = "today", o.YESTERDAY = "yesterday", o.WEEK = "week", o.EARLIER = "earlier", o))(U || {});
11
+ const fe = (o, r) => o?.resources?.filter((s) => s?.parentPath === r)?.map((s) => {
12
+ const a = `${s?.bucket}/${r}`, d = s?.url?.split("/")?.slice(1)?.join("/");
13
13
  return {
14
- ...r,
15
- folderId: l,
16
- id: c,
14
+ ...s,
15
+ folderId: a,
16
+ id: d,
17
17
  isShared: !0
18
18
  };
19
- }) || [], nt = (o) => ({
20
- [F.SHARED]: o
21
- }), ot = {
22
- [F.TODAY]: [],
23
- [F.YESTERDAY]: [],
24
- [F.WEEK]: [],
25
- [F.EARLIER]: []
26
- }, Me = (o, s) => o.toDateString() === s.toDateString(), rt = (o, s) => {
27
- const r = new Date(
19
+ }) || [], st = (o) => ({
20
+ [U.SHARED]: o
21
+ }), it = {
22
+ [U.TODAY]: [],
23
+ [U.YESTERDAY]: [],
24
+ [U.WEEK]: [],
25
+ [U.EARLIER]: []
26
+ }, Ae = (o, r) => o.toDateString() === r.toDateString(), at = (o, r) => {
27
+ const s = new Date(
28
28
  o.getFullYear(),
29
29
  o.getMonth(),
30
30
  o.getDate() - 1
31
31
  );
32
- return Me(s, r);
33
- }, st = (o, s) => {
34
- const r = o.getTime() - s.getTime();
35
- return Math.floor(r / (1e3 * 60 * 60 * 24));
36
- }, Ce = (o) => o.updatedAt || Number(o.id?.split("-").pop()), it = (o) => {
37
- const s = /* @__PURE__ */ new Date(), r = $e(ot);
38
- for (const l of o)
39
- if (l.updatedAt) {
40
- const c = new Date(l.updatedAt);
41
- let d;
42
- Me(s, c) ? d = r[F.TODAY] : rt(s, c) ? d = r[F.YESTERDAY] : st(s, c) <= 7 ? d = r[F.WEEK] : d = r[F.EARLIER], d?.some(
43
- (f) => f.id === l.id
44
- ) || d.push(l);
32
+ return Ae(r, s);
33
+ }, lt = (o, r) => {
34
+ const s = o.getTime() - r.getTime();
35
+ return Math.floor(s / (1e3 * 60 * 60 * 24));
36
+ }, Ne = (o) => o.updatedAt || Number(o.id?.split("-").pop()), ct = (o) => {
37
+ const r = /* @__PURE__ */ new Date(), s = Ye(it);
38
+ for (const a of o)
39
+ if (a.updatedAt) {
40
+ const d = new Date(a.updatedAt);
41
+ let c;
42
+ Ae(r, d) ? c = s[U.TODAY] : at(r, d) ? c = s[U.YESTERDAY] : lt(r, d) <= 7 ? c = s[U.WEEK] : c = s[U.EARLIER], c?.some(
43
+ (f) => f.id === a.id
44
+ ) || c.push(a);
45
45
  }
46
- return r;
47
- }, ye = (o) => o?.sort(
48
- (s, r) => (Ce(r) || 0) - (Ce(s) || 0)
49
- ), at = (o, s) => o === F.SHARED ? s?.shared || "Shared" : o === F.TODAY ? s?.today || "Today" : o === F.YESTERDAY ? s?.yesterday || "Yesterday" : o === F.WEEK ? s?.lastWeek || "Last week" : s?.earlier || "Earlier", lt = ({
46
+ return s;
47
+ }, Ie = (o) => o?.sort(
48
+ (r, s) => (Ne(s) || 0) - (Ne(r) || 0)
49
+ ), dt = (o, r) => o === U.SHARED ? r?.shared || "Shared" : o === U.TODAY ? r?.today || "Today" : o === U.YESTERDAY ? r?.yesterday || "Yesterday" : o === U.WEEK ? r?.lastWeek || "Last week" : r?.earlier || "Earlier", ut = ({
50
50
  onCloseModal: o,
51
- disableModalDividers: s,
52
- deleteConversation: r,
53
- isSmallButton: l,
54
- titles: c,
55
- locale: d
56
- }) => /* @__PURE__ */ y(
57
- ae,
51
+ disableModalDividers: r,
52
+ deleteConversation: s,
53
+ isSmallButton: a,
54
+ titles: d,
55
+ locale: c
56
+ }) => /* @__PURE__ */ M(
57
+ le,
58
58
  {
59
- heading: c?.deleteTitle ?? "Delete conversation",
59
+ heading: d?.deleteTitle ?? "Delete conversation",
60
60
  portalId: "delete-conversation",
61
61
  containerClassName: "delete-conversation-popup",
62
- size: le.SM,
63
- dividers: !s,
62
+ size: ce.SM,
63
+ dividers: !r,
64
64
  onClose: o,
65
- closeButtonTitle: c?.close ?? "Cancel",
65
+ closeButtonTitle: d?.close ?? "Cancel",
66
66
  children: [
67
- /* @__PURE__ */ m("div", { className: "px-6 py-4 sm:px-0", lang: d, children: c?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
68
- /* @__PURE__ */ y("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
69
- /* @__PURE__ */ m(
70
- Q,
67
+ /* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: c, children: d?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
68
+ /* @__PURE__ */ M("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
69
+ /* @__PURE__ */ h(
70
+ j,
71
71
  {
72
72
  buttonClassName: "cancel-button",
73
- title: c?.cancel ?? "Cancel",
74
- isSmallButton: l,
73
+ title: d?.cancel ?? "Cancel",
74
+ isSmallButton: a,
75
75
  onClick: (f) => {
76
76
  f.stopPropagation(), o();
77
77
  }
78
78
  }
79
79
  ),
80
- /* @__PURE__ */ m(
81
- Q,
80
+ /* @__PURE__ */ h(
81
+ j,
82
82
  {
83
83
  buttonClassName: "text-button-primary text-button-primary-error",
84
- title: c?.delete ?? "Delete",
85
- isSmallButton: l,
84
+ title: d?.delete ?? "Delete",
85
+ isSmallButton: a,
86
86
  onClick: (f) => {
87
- f.stopPropagation(), r();
87
+ f.stopPropagation(), s();
88
88
  }
89
89
  }
90
90
  )
91
91
  ] })
92
92
  ]
93
93
  }
94
- ), ct = (o) => {
95
- const s = mt(
96
- qe(o)
97
- ).map((r) => ({
98
- ...r,
94
+ ), ht = (o) => {
95
+ const r = gt(
96
+ nt(o)
97
+ ).map((s) => ({
98
+ ...s,
99
99
  relativePath: "",
100
100
  contentLength: 0
101
101
  }));
102
- return _e(
103
- s,
104
- (r) => te(r.relativePath, r.name)
102
+ return Qe(
103
+ r,
104
+ (s) => oe(s.relativePath, s.name)
105
105
  );
106
- }, dt = (o) => o.endsWith("/"), ut = (o) => {
107
- const s = o.toLowerCase();
106
+ }, pt = (o) => o.endsWith("/"), ft = (o) => {
107
+ const r = o.toLowerCase();
108
108
  return [
109
109
  "data:",
110
110
  "//",
@@ -115,67 +115,67 @@ const ue = (o, s) => o?.resources?.filter((r) => r?.parentPath === s)?.map((r) =
115
115
  "mailto:",
116
116
  "telnet://",
117
117
  "api/files"
118
- ].some((r) => s.startsWith(r));
119
- }, ht = (o) => {
120
- const s = te(
121
- ...o.split("/").map((l) => decodeURIComponent(l))
122
- ), r = s.lastIndexOf("/");
118
+ ].some((s) => r.startsWith(s));
119
+ }, mt = (o) => {
120
+ const r = oe(
121
+ ...o.split("/").map((a) => decodeURIComponent(a))
122
+ ), s = r.lastIndexOf("/");
123
123
  return {
124
- absolutePath: s.slice(0, r),
125
- name: s.slice(r + 1)
124
+ absolutePath: r.slice(0, s),
125
+ name: r.slice(s + 1)
126
126
  };
127
- }, mt = (o) => o ? o.map((s) => {
128
- if (!s.url || ut(s.url) || dt(s.url))
127
+ }, gt = (o) => o ? o.map((r) => {
128
+ if (!r.url || ft(r.url) || pt(r.url))
129
129
  return null;
130
- const { absolutePath: r, name: l } = ht(s.url);
130
+ const { absolutePath: s, name: a } = mt(r.url);
131
131
  return {
132
- id: s.url,
133
- name: l,
134
- contentType: s.type,
135
- folderId: r,
136
- absolutePath: r
132
+ id: r.url,
133
+ name: a,
134
+ contentType: r.type,
135
+ folderId: s,
136
+ absolutePath: s
137
137
  };
138
138
  }).filter(Boolean) : [];
139
- async function ft(o, s) {
140
- const r = ct(o), l = new Je();
141
- r.forEach((p) => {
142
- const e = encodeURI(te(p.absolutePath, p.name)), n = s(`${e}`.replace("files/", "")), t = pt(p.folderId), i = te("res", t, p.name);
143
- l.file(i, n);
139
+ async function Ct(o, r) {
140
+ const s = ht(o), a = new tt();
141
+ s.forEach((m) => {
142
+ const e = encodeURI(oe(m.absolutePath, m.name)), n = r(`${e}`.replace("files/", "")), t = Et(m.folderId), i = oe("res", t, m.name);
143
+ a.file(i, n);
144
144
  });
145
- const c = {
145
+ const d = {
146
146
  version: 5,
147
- history: [o].map(gt) || [],
147
+ history: [o].map(wt) || [],
148
148
  folders: []
149
- }, d = JSON.stringify(c, null, 2);
150
- return l.file("conversations/conversations_history.json", d), await l.generateAsync({ type: "base64" });
149
+ }, c = JSON.stringify(d, null, 2);
150
+ return a.file("conversations/conversations_history.json", c), await a.generateAsync({ type: "base64" });
151
151
  }
152
- const pt = (o) => {
153
- const s = o.split("/");
154
- return s.length > 2 ? te(...s.slice(2)) : void 0;
155
- }, gt = (o) => He(o, ["publicationInfo"]), te = (...o) => o.filter(Boolean).join("/");
156
- function Ct(o, s) {
157
- const r = document.createElement("a");
158
- r.download = s, r.href = o, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(o);
152
+ const Et = (o) => {
153
+ const r = o.split("/");
154
+ return r.length > 2 ? oe(...r.slice(2)) : void 0;
155
+ }, wt = (o) => Ge(o, ["publicationInfo"]), oe = (...o) => o.filter(Boolean).join("/");
156
+ function Nt(o, r) {
157
+ const s = document.createElement("a");
158
+ s.download = r, s.href = o, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
159
159
  }
160
- var Et = Object.defineProperty, ie = Object.getOwnPropertySymbols, Ae = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable, Ee = (o, s, r) => s in o ? Et(o, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[s] = r, he = (o, s) => {
161
- for (var r in s || (s = {}))
162
- Ae.call(s, r) && Ee(o, r, s[r]);
163
- if (ie)
164
- for (var r of ie(s))
165
- Ie.call(s, r) && Ee(o, r, s[r]);
160
+ var vt = Object.defineProperty, ae = Object.getOwnPropertySymbols, Se = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable, ve = (o, r, s) => r in o ? vt(o, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[r] = s, ge = (o, r) => {
161
+ for (var s in r || (r = {}))
162
+ Se.call(r, s) && ve(o, s, r[s]);
163
+ if (ae)
164
+ for (var s of ae(r))
165
+ xe.call(r, s) && ve(o, s, r[s]);
166
166
  return o;
167
- }, me = (o, s) => {
168
- var r = {};
169
- for (var l in o)
170
- Ae.call(o, l) && s.indexOf(l) < 0 && (r[l] = o[l]);
171
- if (o != null && ie)
172
- for (var l of ie(o))
173
- s.indexOf(l) < 0 && Ie.call(o, l) && (r[l] = o[l]);
174
- return r;
167
+ }, Ce = (o, r) => {
168
+ var s = {};
169
+ for (var a in o)
170
+ Se.call(o, a) && r.indexOf(a) < 0 && (s[a] = o[a]);
171
+ if (o != null && ae)
172
+ for (var a of ae(o))
173
+ r.indexOf(a) < 0 && xe.call(o, a) && (s[a] = o[a]);
174
+ return s;
175
175
  };
176
- var X;
176
+ var K;
177
177
  ((o) => {
178
- const s = class w {
178
+ const r = class w {
179
179
  /*-- Constructor (low level) and fields --*/
180
180
  // Creates a new QR Code with the given version number,
181
181
  // error correction level, data codeword bytes, and mask number.
@@ -187,14 +187,14 @@ var X;
187
187
  if (i < -1 || i > 7)
188
188
  throw new RangeError("Mask value out of range");
189
189
  this.size = e * 4 + 17;
190
- let a = [];
190
+ let l = [];
191
191
  for (let u = 0; u < this.size; u++)
192
- a.push(!1);
192
+ l.push(!1);
193
193
  for (let u = 0; u < this.size; u++)
194
- this.modules.push(a.slice()), this.isFunction.push(a.slice());
194
+ this.modules.push(l.slice()), this.isFunction.push(l.slice());
195
195
  this.drawFunctionPatterns();
196
- const h = this.addEccAndInterleave(t);
197
- if (this.drawCodewords(h), i == -1) {
196
+ const p = this.addEccAndInterleave(t);
197
+ if (this.drawCodewords(p), i == -1) {
198
198
  let u = 1e9;
199
199
  for (let E = 0; E < 8; E++) {
200
200
  this.applyMask(E), this.drawFormatBits(E);
@@ -202,7 +202,7 @@ var X;
202
202
  g < u && (i = E, u = g), this.applyMask(E);
203
203
  }
204
204
  }
205
- c(0 <= i && i <= 7), this.mask = i, this.applyMask(i), this.drawFormatBits(i), this.isFunction = [];
205
+ d(0 <= i && i <= 7), this.mask = i, this.applyMask(i), this.drawFormatBits(i), this.isFunction = [];
206
206
  }
207
207
  /*-- Static factory functions (high level) --*/
208
208
  // Returns a QR Code representing the given Unicode text string at the given error correction level.
@@ -232,36 +232,36 @@ var X;
232
232
  // This function allows the user to create a custom sequence of segments that switches
233
233
  // between modes (such as alphanumeric and byte) to encode text in less space.
234
234
  // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
235
- static encodeSegments(e, n, t = 1, i = 40, a = -1, h = !0) {
236
- if (!(w.MIN_VERSION <= t && t <= i && i <= w.MAX_VERSION) || a < -1 || a > 7)
235
+ static encodeSegments(e, n, t = 1, i = 40, l = -1, p = !0) {
236
+ if (!(w.MIN_VERSION <= t && t <= i && i <= w.MAX_VERSION) || l < -1 || l > 7)
237
237
  throw new RangeError("Invalid value");
238
238
  let u, E;
239
239
  for (u = t; ; u++) {
240
- const C = w.getNumDataCodewords(u, n) * 8, R = f.getTotalBits(e, u);
241
- if (R <= C) {
242
- E = R;
240
+ const C = w.getNumDataCodewords(u, n) * 8, v = f.getTotalBits(e, u);
241
+ if (v <= C) {
242
+ E = v;
243
243
  break;
244
244
  }
245
245
  if (u >= i)
246
246
  throw new RangeError("Data too long");
247
247
  }
248
248
  for (const C of [w.Ecc.MEDIUM, w.Ecc.QUARTILE, w.Ecc.HIGH])
249
- h && E <= w.getNumDataCodewords(u, C) * 8 && (n = C);
249
+ p && E <= w.getNumDataCodewords(u, C) * 8 && (n = C);
250
250
  let g = [];
251
251
  for (const C of e) {
252
- r(C.mode.modeBits, 4, g), r(C.numChars, C.mode.numCharCountBits(u), g);
253
- for (const R of C.getData())
254
- g.push(R);
252
+ s(C.mode.modeBits, 4, g), s(C.numChars, C.mode.numCharCountBits(u), g);
253
+ for (const v of C.getData())
254
+ g.push(v);
255
255
  }
256
- c(g.length == E);
257
- const v = w.getNumDataCodewords(u, n) * 8;
258
- c(g.length <= v), r(0, Math.min(4, v - g.length), g), r(0, (8 - g.length % 8) % 8, g), c(g.length % 8 == 0);
259
- for (let C = 236; g.length < v; C ^= 253)
260
- r(C, 8, g);
256
+ d(g.length == E);
257
+ const R = w.getNumDataCodewords(u, n) * 8;
258
+ d(g.length <= R), s(0, Math.min(4, R - g.length), g), s(0, (8 - g.length % 8) % 8, g), d(g.length % 8 == 0);
259
+ for (let C = 236; g.length < R; C ^= 253)
260
+ s(C, 8, g);
261
261
  let N = [];
262
262
  for (; N.length * 8 < g.length; )
263
263
  N.push(0);
264
- return g.forEach((C, R) => N[R >>> 3] |= C << 7 - (R & 7)), new w(u, n, N, a);
264
+ return g.forEach((C, v) => N[v >>> 3] |= C << 7 - (v & 7)), new w(u, n, N, l);
265
265
  }
266
266
  /*-- Accessor methods --*/
267
267
  // Returns the color of the module (pixel) at the given coordinates, which is false
@@ -291,19 +291,19 @@ var X;
291
291
  drawFormatBits(e) {
292
292
  const n = this.errorCorrectionLevel.formatBits << 3 | e;
293
293
  let t = n;
294
- for (let a = 0; a < 10; a++)
294
+ for (let l = 0; l < 10; l++)
295
295
  t = t << 1 ^ (t >>> 9) * 1335;
296
296
  const i = (n << 10 | t) ^ 21522;
297
- c(i >>> 15 == 0);
298
- for (let a = 0; a <= 5; a++)
299
- this.setFunctionModule(8, a, l(i, a));
300
- this.setFunctionModule(8, 7, l(i, 6)), this.setFunctionModule(8, 8, l(i, 7)), this.setFunctionModule(7, 8, l(i, 8));
301
- for (let a = 9; a < 15; a++)
302
- this.setFunctionModule(14 - a, 8, l(i, a));
303
- for (let a = 0; a < 8; a++)
304
- this.setFunctionModule(this.size - 1 - a, 8, l(i, a));
305
- for (let a = 8; a < 15; a++)
306
- this.setFunctionModule(8, this.size - 15 + a, l(i, a));
297
+ d(i >>> 15 == 0);
298
+ for (let l = 0; l <= 5; l++)
299
+ this.setFunctionModule(8, l, a(i, l));
300
+ this.setFunctionModule(8, 7, a(i, 6)), this.setFunctionModule(8, 8, a(i, 7)), this.setFunctionModule(7, 8, a(i, 8));
301
+ for (let l = 9; l < 15; l++)
302
+ this.setFunctionModule(14 - l, 8, a(i, l));
303
+ for (let l = 0; l < 8; l++)
304
+ this.setFunctionModule(this.size - 1 - l, 8, a(i, l));
305
+ for (let l = 8; l < 15; l++)
306
+ this.setFunctionModule(8, this.size - 15 + l, a(i, l));
307
307
  this.setFunctionModule(8, this.size - 8, !0);
308
308
  }
309
309
  // Draws two copies of the version bits (with its own error correction code),
@@ -315,10 +315,10 @@ var X;
315
315
  for (let t = 0; t < 12; t++)
316
316
  e = e << 1 ^ (e >>> 11) * 7973;
317
317
  const n = this.version << 12 | e;
318
- c(n >>> 18 == 0);
318
+ d(n >>> 18 == 0);
319
319
  for (let t = 0; t < 18; t++) {
320
- const i = l(n, t), a = this.size - 11 + t % 3, h = Math.floor(t / 3);
321
- this.setFunctionModule(a, h, i), this.setFunctionModule(h, a, i);
320
+ const i = a(n, t), l = this.size - 11 + t % 3, p = Math.floor(t / 3);
321
+ this.setFunctionModule(l, p, i), this.setFunctionModule(p, l, i);
322
322
  }
323
323
  }
324
324
  // Draws a 9*9 finder pattern including the border separator,
@@ -326,8 +326,8 @@ var X;
326
326
  drawFinderPattern(e, n) {
327
327
  for (let t = -4; t <= 4; t++)
328
328
  for (let i = -4; i <= 4; i++) {
329
- const a = Math.max(Math.abs(i), Math.abs(t)), h = e + i, u = n + t;
330
- 0 <= h && h < this.size && 0 <= u && u < this.size && this.setFunctionModule(h, u, a != 2 && a != 4);
329
+ const l = Math.max(Math.abs(i), Math.abs(t)), p = e + i, u = n + t;
330
+ 0 <= p && p < this.size && 0 <= u && u < this.size && this.setFunctionModule(p, u, l != 2 && l != 4);
331
331
  }
332
332
  }
333
333
  // Draws a 5*5 alignment pattern, with the center module
@@ -349,21 +349,21 @@ var X;
349
349
  const n = this.version, t = this.errorCorrectionLevel;
350
350
  if (e.length != w.getNumDataCodewords(n, t))
351
351
  throw new RangeError("Invalid argument");
352
- const i = w.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n], a = w.ECC_CODEWORDS_PER_BLOCK[t.ordinal][n], h = Math.floor(w.getNumRawDataModules(n) / 8), u = i - h % i, E = Math.floor(h / i);
352
+ const i = w.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n], l = w.ECC_CODEWORDS_PER_BLOCK[t.ordinal][n], p = Math.floor(w.getNumRawDataModules(n) / 8), u = i - p % i, E = Math.floor(p / i);
353
353
  let g = [];
354
- const v = w.reedSolomonComputeDivisor(a);
355
- for (let C = 0, R = 0; C < i; C++) {
356
- let S = e.slice(R, R + E - a + (C < u ? 0 : 1));
357
- R += S.length;
358
- const D = w.reedSolomonComputeRemainder(S, v);
359
- C < u && S.push(0), g.push(S.concat(D));
354
+ const R = w.reedSolomonComputeDivisor(l);
355
+ for (let C = 0, v = 0; C < i; C++) {
356
+ let I = e.slice(v, v + E - l + (C < u ? 0 : 1));
357
+ v += I.length;
358
+ const T = w.reedSolomonComputeRemainder(I, R);
359
+ C < u && I.push(0), g.push(I.concat(T));
360
360
  }
361
361
  let N = [];
362
362
  for (let C = 0; C < g[0].length; C++)
363
- g.forEach((R, S) => {
364
- (C != E - a || S >= u) && N.push(R[C]);
363
+ g.forEach((v, I) => {
364
+ (C != E - l || I >= u) && N.push(v[C]);
365
365
  });
366
- return c(N.length == h), N;
366
+ return d(N.length == p), N;
367
367
  }
368
368
  // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
369
369
  // data area of this QR Code. Function modules need to be marked off before this is called.
@@ -374,12 +374,12 @@ var X;
374
374
  for (let t = this.size - 1; t >= 1; t -= 2) {
375
375
  t == 6 && (t = 5);
376
376
  for (let i = 0; i < this.size; i++)
377
- for (let a = 0; a < 2; a++) {
378
- const h = t - a, E = (t + 1 & 2) == 0 ? this.size - 1 - i : i;
379
- !this.isFunction[E][h] && n < e.length * 8 && (this.modules[E][h] = l(e[n >>> 3], 7 - (n & 7)), n++);
377
+ for (let l = 0; l < 2; l++) {
378
+ const p = t - l, E = (t + 1 & 2) == 0 ? this.size - 1 - i : i;
379
+ !this.isFunction[E][p] && n < e.length * 8 && (this.modules[E][p] = a(e[n >>> 3], 7 - (n & 7)), n++);
380
380
  }
381
381
  }
382
- c(n == e.length * 8);
382
+ d(n == e.length * 8);
383
383
  }
384
384
  // XORs the codeword modules in this QR Code with the given mask pattern.
385
385
  // The function modules must be marked and the codeword bits must be drawn
@@ -427,28 +427,28 @@ var X;
427
427
  // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
428
428
  getPenaltyScore() {
429
429
  let e = 0;
430
- for (let a = 0; a < this.size; a++) {
431
- let h = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
430
+ for (let l = 0; l < this.size; l++) {
431
+ let p = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
432
432
  for (let g = 0; g < this.size; g++)
433
- this.modules[a][g] == h ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), h || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), h = this.modules[a][g], u = 1);
434
- e += this.finderPenaltyTerminateAndCount(h, u, E) * w.PENALTY_N3;
433
+ this.modules[l][g] == p ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), p || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), p = this.modules[l][g], u = 1);
434
+ e += this.finderPenaltyTerminateAndCount(p, u, E) * w.PENALTY_N3;
435
435
  }
436
- for (let a = 0; a < this.size; a++) {
437
- let h = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
436
+ for (let l = 0; l < this.size; l++) {
437
+ let p = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
438
438
  for (let g = 0; g < this.size; g++)
439
- this.modules[g][a] == h ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), h || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), h = this.modules[g][a], u = 1);
440
- e += this.finderPenaltyTerminateAndCount(h, u, E) * w.PENALTY_N3;
439
+ this.modules[g][l] == p ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), p || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), p = this.modules[g][l], u = 1);
440
+ e += this.finderPenaltyTerminateAndCount(p, u, E) * w.PENALTY_N3;
441
441
  }
442
- for (let a = 0; a < this.size - 1; a++)
443
- for (let h = 0; h < this.size - 1; h++) {
444
- const u = this.modules[a][h];
445
- u == this.modules[a][h + 1] && u == this.modules[a + 1][h] && u == this.modules[a + 1][h + 1] && (e += w.PENALTY_N2);
442
+ for (let l = 0; l < this.size - 1; l++)
443
+ for (let p = 0; p < this.size - 1; p++) {
444
+ const u = this.modules[l][p];
445
+ u == this.modules[l][p + 1] && u == this.modules[l + 1][p] && u == this.modules[l + 1][p + 1] && (e += w.PENALTY_N2);
446
446
  }
447
447
  let n = 0;
448
- for (const a of this.modules)
449
- n = a.reduce((h, u) => h + (u ? 1 : 0), n);
448
+ for (const l of this.modules)
449
+ n = l.reduce((p, u) => p + (u ? 1 : 0), n);
450
450
  const t = this.size * this.size, i = Math.ceil(Math.abs(n * 20 - t * 10) / t) - 1;
451
- return c(0 <= i && i <= 9), e += i * w.PENALTY_N4, c(0 <= e && e <= 2568888), e;
451
+ return d(0 <= i && i <= 9), e += i * w.PENALTY_N4, d(0 <= e && e <= 2568888), e;
452
452
  }
453
453
  /*-- Private helper functions --*/
454
454
  // Returns an ascending list of positions of alignment patterns for this version number.
@@ -476,7 +476,7 @@ var X;
476
476
  const t = Math.floor(e / 7) + 2;
477
477
  n -= (25 * t - 10) * t - 55, e >= 7 && (n -= 36);
478
478
  }
479
- return c(208 <= n && n <= 29648), n;
479
+ return d(208 <= n && n <= 29648), n;
480
480
  }
481
481
  // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
482
482
  // QR Code of the given version number and error correction level, with remainder bits discarded.
@@ -495,8 +495,8 @@ var X;
495
495
  n.push(1);
496
496
  let t = 1;
497
497
  for (let i = 0; i < e; i++) {
498
- for (let a = 0; a < n.length; a++)
499
- n[a] = w.reedSolomonMultiply(n[a], t), a + 1 < n.length && (n[a] ^= n[a + 1]);
498
+ for (let l = 0; l < n.length; l++)
499
+ n[l] = w.reedSolomonMultiply(n[l], t), l + 1 < n.length && (n[l] ^= n[l + 1]);
500
500
  t = w.reedSolomonMultiply(t, 2);
501
501
  }
502
502
  return n;
@@ -505,8 +505,8 @@ var X;
505
505
  static reedSolomonComputeRemainder(e, n) {
506
506
  let t = n.map((i) => 0);
507
507
  for (const i of e) {
508
- const a = i ^ t.shift();
509
- t.push(0), n.forEach((h, u) => t[u] ^= w.reedSolomonMultiply(h, a));
508
+ const l = i ^ t.shift();
509
+ t.push(0), n.forEach((p, u) => t[u] ^= w.reedSolomonMultiply(p, l));
510
510
  }
511
511
  return t;
512
512
  }
@@ -518,13 +518,13 @@ var X;
518
518
  let t = 0;
519
519
  for (let i = 7; i >= 0; i--)
520
520
  t = t << 1 ^ (t >>> 7) * 285, t ^= (n >>> i & 1) * e;
521
- return c(t >>> 8 == 0), t;
521
+ return d(t >>> 8 == 0), t;
522
522
  }
523
523
  // Can only be called immediately after a light run is added, and
524
524
  // returns either 0, 1, or 2. A helper function for getPenaltyScore().
525
525
  finderPenaltyCountPatterns(e) {
526
526
  const n = e[1];
527
- c(n <= this.size * 3);
527
+ d(n <= this.size * 3);
528
528
  const t = n > 0 && e[2] == n && e[3] == n * 3 && e[4] == n && e[5] == n;
529
529
  return (t && e[0] >= n * 4 && e[6] >= n ? 1 : 0) + (t && e[6] >= n * 4 && e[0] >= n ? 1 : 0);
530
530
  }
@@ -537,7 +537,7 @@ var X;
537
537
  n[0] == 0 && (e += this.size), n.pop(), n.unshift(e);
538
538
  }
539
539
  };
540
- s.MIN_VERSION = 1, s.MAX_VERSION = 40, s.PENALTY_N1 = 3, s.PENALTY_N2 = 3, s.PENALTY_N3 = 40, s.PENALTY_N4 = 10, s.ECC_CODEWORDS_PER_BLOCK = [
540
+ r.MIN_VERSION = 1, r.MAX_VERSION = 40, r.PENALTY_N1 = 3, r.PENALTY_N2 = 3, r.PENALTY_N3 = 40, r.PENALTY_N4 = 10, r.ECC_CODEWORDS_PER_BLOCK = [
541
541
  // Version: (note that index 0 is for padding, and is set to an illegal value)
542
542
  //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
543
543
  [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
@@ -548,7 +548,7 @@ var X;
548
548
  // Quartile
549
549
  [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
550
550
  // High
551
- ], s.NUM_ERROR_CORRECTION_BLOCKS = [
551
+ ], r.NUM_ERROR_CORRECTION_BLOCKS = [
552
552
  // Version: (note that index 0 is for padding, and is set to an illegal value)
553
553
  //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
554
554
  [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
@@ -559,21 +559,21 @@ var X;
559
559
  // Quartile
560
560
  [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
561
561
  // High
562
- ], o.QrCode = s;
563
- function r(p, e, n) {
564
- if (e < 0 || e > 31 || p >>> e)
562
+ ], o.QrCode = r;
563
+ function s(m, e, n) {
564
+ if (e < 0 || e > 31 || m >>> e)
565
565
  throw new RangeError("Value out of range");
566
566
  for (let t = e - 1; t >= 0; t--)
567
- n.push(p >>> t & 1);
567
+ n.push(m >>> t & 1);
568
568
  }
569
- function l(p, e) {
570
- return (p >>> e & 1) != 0;
569
+ function a(m, e) {
570
+ return (m >>> e & 1) != 0;
571
571
  }
572
- function c(p) {
573
- if (!p)
572
+ function d(m) {
573
+ if (!m)
574
574
  throw new Error("Assertion error");
575
575
  }
576
- const d = class I {
576
+ const c = class A {
577
577
  /*-- Constructor (low level) and fields --*/
578
578
  // Creates a new QR Code segment with the given attributes and data.
579
579
  // The character count (numChars) must agree with the mode and the bit buffer length,
@@ -590,37 +590,37 @@ var X;
590
590
  static makeBytes(e) {
591
591
  let n = [];
592
592
  for (const t of e)
593
- r(t, 8, n);
594
- return new I(I.Mode.BYTE, e.length, n);
593
+ s(t, 8, n);
594
+ return new A(A.Mode.BYTE, e.length, n);
595
595
  }
596
596
  // Returns a segment representing the given string of decimal digits encoded in numeric mode.
597
597
  static makeNumeric(e) {
598
- if (!I.isNumeric(e))
598
+ if (!A.isNumeric(e))
599
599
  throw new RangeError("String contains non-numeric characters");
600
600
  let n = [];
601
601
  for (let t = 0; t < e.length; ) {
602
602
  const i = Math.min(e.length - t, 3);
603
- r(parseInt(e.substring(t, t + i), 10), i * 3 + 1, n), t += i;
603
+ s(parseInt(e.substring(t, t + i), 10), i * 3 + 1, n), t += i;
604
604
  }
605
- return new I(I.Mode.NUMERIC, e.length, n);
605
+ return new A(A.Mode.NUMERIC, e.length, n);
606
606
  }
607
607
  // Returns a segment representing the given text string encoded in alphanumeric mode.
608
608
  // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
609
609
  // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
610
610
  static makeAlphanumeric(e) {
611
- if (!I.isAlphanumeric(e))
611
+ if (!A.isAlphanumeric(e))
612
612
  throw new RangeError("String contains unencodable characters in alphanumeric mode");
613
613
  let n = [], t;
614
614
  for (t = 0; t + 2 <= e.length; t += 2) {
615
- let i = I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)) * 45;
616
- i += I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t + 1)), r(i, 11, n);
615
+ let i = A.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)) * 45;
616
+ i += A.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t + 1)), s(i, 11, n);
617
617
  }
618
- return t < e.length && r(I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)), 6, n), new I(I.Mode.ALPHANUMERIC, e.length, n);
618
+ return t < e.length && s(A.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)), 6, n), new A(A.Mode.ALPHANUMERIC, e.length, n);
619
619
  }
620
620
  // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
621
621
  // The result may use various segment modes and switch modes to optimize the length of the bit stream.
622
622
  static makeSegments(e) {
623
- return e == "" ? [] : I.isNumeric(e) ? [I.makeNumeric(e)] : I.isAlphanumeric(e) ? [I.makeAlphanumeric(e)] : [I.makeBytes(I.toUtf8ByteArray(e))];
623
+ return e == "" ? [] : A.isNumeric(e) ? [A.makeNumeric(e)] : A.isAlphanumeric(e) ? [A.makeAlphanumeric(e)] : [A.makeBytes(A.toUtf8ByteArray(e))];
624
624
  }
625
625
  // Returns a segment representing an Extended Channel Interpretation
626
626
  // (ECI) designator with the given assignment value.
@@ -629,25 +629,25 @@ var X;
629
629
  if (e < 0)
630
630
  throw new RangeError("ECI assignment value out of range");
631
631
  if (e < 128)
632
- r(e, 8, n);
632
+ s(e, 8, n);
633
633
  else if (e < 16384)
634
- r(2, 2, n), r(e, 14, n);
634
+ s(2, 2, n), s(e, 14, n);
635
635
  else if (e < 1e6)
636
- r(6, 3, n), r(e, 21, n);
636
+ s(6, 3, n), s(e, 21, n);
637
637
  else
638
638
  throw new RangeError("ECI assignment value out of range");
639
- return new I(I.Mode.ECI, 0, n);
639
+ return new A(A.Mode.ECI, 0, n);
640
640
  }
641
641
  // Tests whether the given string can be encoded as a segment in numeric mode.
642
642
  // A string is encodable iff each character is in the range 0 to 9.
643
643
  static isNumeric(e) {
644
- return I.NUMERIC_REGEX.test(e);
644
+ return A.NUMERIC_REGEX.test(e);
645
645
  }
646
646
  // Tests whether the given string can be encoded as a segment in alphanumeric mode.
647
647
  // A string is encodable iff each character is in the following set: 0 to 9, A to Z
648
648
  // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
649
649
  static isAlphanumeric(e) {
650
- return I.ALPHANUMERIC_REGEX.test(e);
650
+ return A.ALPHANUMERIC_REGEX.test(e);
651
651
  }
652
652
  /*-- Methods --*/
653
653
  // Returns a new copy of the data bits of this segment.
@@ -659,10 +659,10 @@ var X;
659
659
  static getTotalBits(e, n) {
660
660
  let t = 0;
661
661
  for (const i of e) {
662
- const a = i.mode.numCharCountBits(n);
663
- if (i.numChars >= 1 << a)
662
+ const l = i.mode.numCharCountBits(n);
663
+ if (i.numChars >= 1 << l)
664
664
  return 1 / 0;
665
- t += 4 + a + i.bitData.length;
665
+ t += 4 + l + i.bitData.length;
666
666
  }
667
667
  return t;
668
668
  }
@@ -675,152 +675,152 @@ var X;
675
675
  return n;
676
676
  }
677
677
  };
678
- d.NUMERIC_REGEX = /^[0-9]*$/, d.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, d.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
679
- let f = d;
680
- o.QrSegment = d;
681
- })(X || (X = {}));
678
+ c.NUMERIC_REGEX = /^[0-9]*$/, c.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, c.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
679
+ let f = c;
680
+ o.QrSegment = c;
681
+ })(K || (K = {}));
682
682
  ((o) => {
683
- ((s) => {
684
- const r = class {
683
+ ((r) => {
684
+ const s = class {
685
685
  // The QR Code can tolerate about 30% erroneous codewords
686
686
  /*-- Constructor and fields --*/
687
- constructor(c, d) {
688
- this.ordinal = c, this.formatBits = d;
687
+ constructor(d, c) {
688
+ this.ordinal = d, this.formatBits = c;
689
689
  }
690
690
  };
691
- r.LOW = new r(0, 1), r.MEDIUM = new r(1, 0), r.QUARTILE = new r(2, 3), r.HIGH = new r(3, 2), s.Ecc = r;
691
+ s.LOW = new s(0, 1), s.MEDIUM = new s(1, 0), s.QUARTILE = new s(2, 3), s.HIGH = new s(3, 2), r.Ecc = s;
692
692
  })(o.QrCode || (o.QrCode = {}));
693
- })(X || (X = {}));
693
+ })(K || (K = {}));
694
694
  ((o) => {
695
- ((s) => {
696
- const r = class {
695
+ ((r) => {
696
+ const s = class {
697
697
  /*-- Constructor and fields --*/
698
- constructor(c, d) {
699
- this.modeBits = c, this.numBitsCharCount = d;
698
+ constructor(d, c) {
699
+ this.modeBits = d, this.numBitsCharCount = c;
700
700
  }
701
701
  /*-- Method --*/
702
702
  // (Package-private) Returns the bit width of the character count field for a segment in
703
703
  // this mode in a QR Code at the given version number. The result is in the range [0, 16].
704
- numCharCountBits(c) {
705
- return this.numBitsCharCount[Math.floor((c + 7) / 17)];
704
+ numCharCountBits(d) {
705
+ return this.numBitsCharCount[Math.floor((d + 7) / 17)];
706
706
  }
707
707
  };
708
- r.NUMERIC = new r(1, [10, 12, 14]), r.ALPHANUMERIC = new r(2, [9, 11, 13]), r.BYTE = new r(4, [8, 16, 16]), r.KANJI = new r(8, [8, 10, 12]), r.ECI = new r(7, [0, 0, 0]), s.Mode = r;
708
+ s.NUMERIC = new s(1, [10, 12, 14]), s.ALPHANUMERIC = new s(2, [9, 11, 13]), s.BYTE = new s(4, [8, 16, 16]), s.KANJI = new s(8, [8, 10, 12]), s.ECI = new s(7, [0, 0, 0]), r.Mode = s;
709
709
  })(o.QrSegment || (o.QrSegment = {}));
710
- })(X || (X = {}));
711
- var Z = X;
712
- var wt = {
713
- L: Z.QrCode.Ecc.LOW,
714
- M: Z.QrCode.Ecc.MEDIUM,
715
- Q: Z.QrCode.Ecc.QUARTILE,
716
- H: Z.QrCode.Ecc.HIGH
717
- }, be = 128, Se = "L", xe = "#FFFFFF", Pe = "#000000", De = !1, Oe = 1, Nt = 4, Rt = 0, vt = 0.1;
718
- function Te(o, s = 0) {
719
- const r = [];
720
- return o.forEach(function(l, c) {
721
- let d = null;
722
- l.forEach(function(f, p) {
723
- if (!f && d !== null) {
724
- r.push(
725
- `M${d + s} ${c + s}h${p - d}v1H${d + s}z`
726
- ), d = null;
710
+ })(K || (K = {}));
711
+ var q = K;
712
+ var Rt = {
713
+ L: q.QrCode.Ecc.LOW,
714
+ M: q.QrCode.Ecc.MEDIUM,
715
+ Q: q.QrCode.Ecc.QUARTILE,
716
+ H: q.QrCode.Ecc.HIGH
717
+ }, Pe = 128, De = "L", Te = "#FFFFFF", Oe = "#000000", Le = !1, ke = 1, yt = 4, Mt = 0, bt = 0.1;
718
+ function Be(o, r = 0) {
719
+ const s = [];
720
+ return o.forEach(function(a, d) {
721
+ let c = null;
722
+ a.forEach(function(f, m) {
723
+ if (!f && c !== null) {
724
+ s.push(
725
+ `M${c + r} ${d + r}h${m - c}v1H${c + r}z`
726
+ ), c = null;
727
727
  return;
728
728
  }
729
- if (p === l.length - 1) {
729
+ if (m === a.length - 1) {
730
730
  if (!f)
731
731
  return;
732
- d === null ? r.push(`M${p + s},${c + s} h1v1H${p + s}z`) : r.push(
733
- `M${d + s},${c + s} h${p + 1 - d}v1H${d + s}z`
732
+ c === null ? s.push(`M${m + r},${d + r} h1v1H${m + r}z`) : s.push(
733
+ `M${c + r},${d + r} h${m + 1 - c}v1H${c + r}z`
734
734
  );
735
735
  return;
736
736
  }
737
- f && d === null && (d = p);
737
+ f && c === null && (c = m);
738
738
  });
739
- }), r.join("");
739
+ }), s.join("");
740
740
  }
741
- function Le(o, s) {
742
- return o.slice().map((r, l) => l < s.y || l >= s.y + s.h ? r : r.map((c, d) => d < s.x || d >= s.x + s.w ? c : !1));
741
+ function Fe(o, r) {
742
+ return o.slice().map((s, a) => a < r.y || a >= r.y + r.h ? s : s.map((d, c) => c < r.x || c >= r.x + r.w ? d : !1));
743
743
  }
744
- function Mt(o, s, r, l) {
745
- if (l == null)
744
+ function At(o, r, s, a) {
745
+ if (a == null)
746
746
  return null;
747
- const c = o.length + r * 2, d = Math.floor(s * vt), f = c / s, p = (l.width || d) * f, e = (l.height || d) * f, n = l.x == null ? o.length / 2 - p / 2 : l.x * f, t = l.y == null ? o.length / 2 - e / 2 : l.y * f, i = l.opacity == null ? 1 : l.opacity;
748
- let a = null;
749
- if (l.excavate) {
750
- let u = Math.floor(n), E = Math.floor(t), g = Math.ceil(p + n - u), v = Math.ceil(e + t - E);
751
- a = { x: u, y: E, w: g, h: v };
747
+ const d = o.length + s * 2, c = Math.floor(r * bt), f = d / r, m = (a.width || c) * f, e = (a.height || c) * f, n = a.x == null ? o.length / 2 - m / 2 : a.x * f, t = a.y == null ? o.length / 2 - e / 2 : a.y * f, i = a.opacity == null ? 1 : a.opacity;
748
+ let l = null;
749
+ if (a.excavate) {
750
+ let u = Math.floor(n), E = Math.floor(t), g = Math.ceil(m + n - u), R = Math.ceil(e + t - E);
751
+ l = { x: u, y: E, w: g, h: R };
752
752
  }
753
- const h = l.crossOrigin;
754
- return { x: n, y: t, h: e, w: p, excavation: a, opacity: i, crossOrigin: h };
753
+ const p = a.crossOrigin;
754
+ return { x: n, y: t, h: e, w: m, excavation: l, opacity: i, crossOrigin: p };
755
755
  }
756
- function yt(o, s) {
757
- return s != null ? Math.max(Math.floor(s), 0) : o ? Nt : Rt;
756
+ function It(o, r) {
757
+ return r != null ? Math.max(Math.floor(r), 0) : o ? yt : Mt;
758
758
  }
759
- function Be({
759
+ function Ue({
760
760
  value: o,
761
- level: s,
762
- minVersion: r,
763
- includeMargin: l,
764
- marginSize: c,
765
- imageSettings: d,
761
+ level: r,
762
+ minVersion: s,
763
+ includeMargin: a,
764
+ marginSize: d,
765
+ imageSettings: c,
766
766
  size: f,
767
- boostLevel: p
767
+ boostLevel: m
768
768
  }) {
769
- let e = x.useMemo(() => {
770
- const u = (Array.isArray(o) ? o : [o]).reduce((E, g) => (E.push(...Z.QrSegment.makeSegments(g)), E), []);
771
- return Z.QrCode.encodeSegments(
769
+ let e = D.useMemo(() => {
770
+ const u = (Array.isArray(o) ? o : [o]).reduce((E, g) => (E.push(...q.QrSegment.makeSegments(g)), E), []);
771
+ return q.QrCode.encodeSegments(
772
772
  u,
773
- wt[s],
774
- r,
773
+ Rt[r],
774
+ s,
775
775
  void 0,
776
776
  void 0,
777
- p
777
+ m
778
778
  );
779
- }, [o, s, r, p]);
780
- const { cells: n, margin: t, numCells: i, calculatedImageSettings: a } = x.useMemo(() => {
781
- let h = e.getModules();
782
- const u = yt(l, c), E = h.length + u * 2, g = Mt(
783
- h,
779
+ }, [o, r, s, m]);
780
+ const { cells: n, margin: t, numCells: i, calculatedImageSettings: l } = D.useMemo(() => {
781
+ let p = e.getModules();
782
+ const u = It(a, d), E = p.length + u * 2, g = At(
783
+ p,
784
784
  f,
785
785
  u,
786
- d
786
+ c
787
787
  );
788
788
  return {
789
- cells: h,
789
+ cells: p,
790
790
  margin: u,
791
791
  numCells: E,
792
792
  calculatedImageSettings: g
793
793
  };
794
- }, [e, f, d, l, c]);
794
+ }, [e, f, c, a, d]);
795
795
  return {
796
796
  qrcode: e,
797
797
  margin: t,
798
798
  cells: n,
799
799
  numCells: i,
800
- calculatedImageSettings: a
800
+ calculatedImageSettings: l
801
801
  };
802
802
  }
803
- var At = (function() {
803
+ var St = (function() {
804
804
  try {
805
805
  new Path2D().addPath(new Path2D());
806
806
  } catch {
807
807
  return !1;
808
808
  }
809
809
  return !0;
810
- })(), It = x.forwardRef(
811
- function(s, r) {
812
- const l = s, {
813
- value: c,
814
- size: d = be,
815
- level: f = Se,
816
- bgColor: p = xe,
817
- fgColor: e = Pe,
818
- includeMargin: n = De,
819
- minVersion: t = Oe,
810
+ })(), xt = D.forwardRef(
811
+ function(r, s) {
812
+ const a = r, {
813
+ value: d,
814
+ size: c = Pe,
815
+ level: f = De,
816
+ bgColor: m = Te,
817
+ fgColor: e = Oe,
818
+ includeMargin: n = Le,
819
+ minVersion: t = ke,
820
820
  boostLevel: i,
821
- marginSize: a,
822
- imageSettings: h
823
- } = l, E = me(l, [
821
+ marginSize: l,
822
+ imageSettings: p
823
+ } = a, E = Ce(a, [
824
824
  "value",
825
825
  "size",
826
826
  "level",
@@ -831,92 +831,92 @@ var At = (function() {
831
831
  "boostLevel",
832
832
  "marginSize",
833
833
  "imageSettings"
834
- ]), { style: g } = E, v = me(E, ["style"]), N = h?.src, C = x.useRef(null), R = x.useRef(null), S = x.useCallback(
835
- ($) => {
836
- C.current = $, typeof r == "function" ? r($) : r && (r.current = $);
834
+ ]), { style: g } = E, R = Ce(E, ["style"]), N = p?.src, C = D.useRef(null), v = D.useRef(null), I = D.useCallback(
835
+ (Y) => {
836
+ C.current = Y, typeof s == "function" ? s(Y) : s && (s.current = Y);
837
837
  },
838
- [r]
839
- ), [D, A] = x.useState(!1), { margin: O, cells: _, numCells: H, calculatedImageSettings: P } = Be({
840
- value: c,
838
+ [s]
839
+ ), [T, b] = D.useState(!1), { margin: L, cells: H, numCells: Q, calculatedImageSettings: x } = Ue({
840
+ value: d,
841
841
  level: f,
842
842
  minVersion: t,
843
843
  boostLevel: i,
844
844
  includeMargin: n,
845
- marginSize: a,
846
- imageSettings: h,
847
- size: d
845
+ marginSize: l,
846
+ imageSettings: p,
847
+ size: c
848
848
  });
849
- x.useEffect(() => {
849
+ D.useEffect(() => {
850
850
  if (C.current != null) {
851
- const $ = C.current, M = $.getContext("2d");
852
- if (!M)
851
+ const Y = C.current, y = Y.getContext("2d");
852
+ if (!y)
853
853
  return;
854
- let b = _;
855
- const L = R.current, W = P != null && L !== null && L.complete && L.naturalHeight !== 0 && L.naturalWidth !== 0;
856
- W && P.excavation != null && (b = Le(
857
- _,
858
- P.excavation
854
+ let S = H;
855
+ const P = v.current, F = x != null && P !== null && P.complete && P.naturalHeight !== 0 && P.naturalWidth !== 0;
856
+ F && x.excavation != null && (S = Fe(
857
+ H,
858
+ x.excavation
859
859
  ));
860
- const ne = window.devicePixelRatio || 1;
861
- $.height = $.width = d * ne;
862
- const oe = d / H * ne;
863
- M.scale(oe, oe), M.fillStyle = p, M.fillRect(0, 0, H, H), M.fillStyle = e, At ? M.fill(new Path2D(Te(b, O))) : _.forEach(function(V, G) {
864
- V.forEach(function(ce, de) {
865
- ce && M.fillRect(de + O, G + O, 1, 1);
860
+ const W = window.devicePixelRatio || 1;
861
+ Y.height = Y.width = c * W;
862
+ const Z = c / Q * W;
863
+ y.scale(Z, Z), y.fillStyle = m, y.fillRect(0, 0, Q, Q), y.fillStyle = e, St ? y.fill(new Path2D(Be(S, L))) : H.forEach(function(de, re) {
864
+ de.forEach(function(ue, he) {
865
+ ue && y.fillRect(he + L, re + L, 1, 1);
866
866
  });
867
- }), P && (M.globalAlpha = P.opacity), W && M.drawImage(
868
- L,
869
- P.x + O,
870
- P.y + O,
871
- P.w,
872
- P.h
867
+ }), x && (y.globalAlpha = x.opacity), F && y.drawImage(
868
+ P,
869
+ x.x + L,
870
+ x.y + L,
871
+ x.w,
872
+ x.h
873
873
  );
874
874
  }
875
- }), x.useEffect(() => {
876
- A(!1);
875
+ }), D.useEffect(() => {
876
+ b(!1);
877
877
  }, [N]);
878
- const Y = he({ height: d, width: d }, g);
879
- let j = null;
880
- return N != null && (j = /* @__PURE__ */ x.createElement(
878
+ const G = ge({ height: c, width: c }, g);
879
+ let V = null;
880
+ return N != null && (V = /* @__PURE__ */ D.createElement(
881
881
  "img",
882
882
  {
883
883
  src: N,
884
884
  key: N,
885
885
  style: { display: "none" },
886
886
  onLoad: () => {
887
- A(!0);
887
+ b(!0);
888
888
  },
889
- ref: R,
890
- crossOrigin: P?.crossOrigin
889
+ ref: v,
890
+ crossOrigin: x?.crossOrigin
891
891
  }
892
- )), /* @__PURE__ */ x.createElement(x.Fragment, null, /* @__PURE__ */ x.createElement(
892
+ )), /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement(
893
893
  "canvas",
894
- he({
895
- style: Y,
896
- height: d,
897
- width: d,
898
- ref: S,
894
+ ge({
895
+ style: G,
896
+ height: c,
897
+ width: c,
898
+ ref: I,
899
899
  role: "img"
900
- }, v)
901
- ), j);
900
+ }, R)
901
+ ), V);
902
902
  }
903
903
  );
904
- It.displayName = "QRCodeCanvas";
905
- var ke = x.forwardRef(
906
- function(s, r) {
907
- const l = s, {
908
- value: c,
909
- size: d = be,
910
- level: f = Se,
911
- bgColor: p = xe,
912
- fgColor: e = Pe,
913
- includeMargin: n = De,
914
- minVersion: t = Oe,
904
+ xt.displayName = "QRCodeCanvas";
905
+ var ze = D.forwardRef(
906
+ function(r, s) {
907
+ const a = r, {
908
+ value: d,
909
+ size: c = Pe,
910
+ level: f = De,
911
+ bgColor: m = Te,
912
+ fgColor: e = Oe,
913
+ includeMargin: n = Le,
914
+ minVersion: t = ke,
915
915
  boostLevel: i,
916
- title: a,
917
- marginSize: h,
916
+ title: l,
917
+ marginSize: p,
918
918
  imageSettings: u
919
- } = l, E = me(l, [
919
+ } = a, E = Ce(a, [
920
920
  "value",
921
921
  "size",
922
922
  "level",
@@ -928,21 +928,21 @@ var ke = x.forwardRef(
928
928
  "title",
929
929
  "marginSize",
930
930
  "imageSettings"
931
- ]), { margin: g, cells: v, numCells: N, calculatedImageSettings: C } = Be({
932
- value: c,
931
+ ]), { margin: g, cells: R, numCells: N, calculatedImageSettings: C } = Ue({
932
+ value: d,
933
933
  level: f,
934
934
  minVersion: t,
935
935
  boostLevel: i,
936
936
  includeMargin: n,
937
- marginSize: h,
937
+ marginSize: p,
938
938
  imageSettings: u,
939
- size: d
939
+ size: c
940
940
  });
941
- let R = v, S = null;
942
- u != null && C != null && (C.excavation != null && (R = Le(
943
- v,
941
+ let v = R, I = null;
942
+ u != null && C != null && (C.excavation != null && (v = Fe(
943
+ R,
944
944
  C.excavation
945
- )), S = /* @__PURE__ */ x.createElement(
945
+ )), I = /* @__PURE__ */ D.createElement(
946
946
  "image",
947
947
  {
948
948
  href: u.src,
@@ -955,142 +955,166 @@ var ke = x.forwardRef(
955
955
  crossOrigin: C.crossOrigin
956
956
  }
957
957
  ));
958
- const D = Te(R, g);
959
- return /* @__PURE__ */ x.createElement(
958
+ const T = Be(v, g);
959
+ return /* @__PURE__ */ D.createElement(
960
960
  "svg",
961
- he({
962
- height: d,
963
- width: d,
961
+ ge({
962
+ height: c,
963
+ width: c,
964
964
  viewBox: `0 0 ${N} ${N}`,
965
- ref: r,
965
+ ref: s,
966
966
  role: "img"
967
967
  }, E),
968
- !!a && /* @__PURE__ */ x.createElement("title", null, a),
969
- /* @__PURE__ */ x.createElement(
968
+ !!l && /* @__PURE__ */ D.createElement("title", null, l),
969
+ /* @__PURE__ */ D.createElement(
970
970
  "path",
971
971
  {
972
- fill: p,
972
+ fill: m,
973
973
  d: `M0,0 h${N}v${N}H0z`,
974
974
  shapeRendering: "crispEdges"
975
975
  }
976
976
  ),
977
- /* @__PURE__ */ x.createElement("path", { fill: e, d: D, shapeRendering: "crispEdges" }),
978
- S
977
+ /* @__PURE__ */ D.createElement("path", { fill: e, d: T, shapeRendering: "crispEdges" }),
978
+ I
979
979
  );
980
980
  }
981
981
  );
982
- ke.displayName = "QRCodeSVG";
983
- const bt = (o, s) => ({
984
- invitationType: tt.LINK,
982
+ ze.displayName = "QRCodeSVG";
983
+ const Pt = (o, r) => ({
984
+ invitationType: rt.LINK,
985
985
  resources: [
986
986
  {
987
987
  url: `conversations/${encodeURI(o)}`
988
988
  },
989
- ...s
989
+ ...r
990
990
  ]
991
- }), St = (o) => {
992
- const s = o?.invitationLink?.split("/").at(-1) || "";
993
- return `/${ve}/${s}`;
994
- }, xt = (o, s) => s?.find((r) => {
995
- const l = o?.id?.split("/")?.pop(), c = r?.url?.split("/")?.pop() || "";
996
- return c === l || decodeURI(c) === l;
997
- }), Pt = (o) => o?.messages?.filter(
998
- (r) => !!r?.custom_content?.attachments
999
- )?.flatMap((r) => r?.custom_content?.attachments?.map((l) => ({
1000
- url: l?.url || ""
1001
- })) || [])?.filter((r) => !!r?.url) || [], Dt = ({
991
+ }), Dt = (o) => {
992
+ const r = o?.invitationLink?.split("/").at(-1) || "";
993
+ return `/${be}/${r}`;
994
+ }, Tt = (o, r) => r?.find((s) => {
995
+ const a = o?.id?.split("/")?.pop(), d = s?.url?.split("/")?.pop() || "";
996
+ return d === a || decodeURI(d) === a;
997
+ }), Ot = (o) => o?.messages?.filter(
998
+ (s) => !!s?.custom_content?.attachments
999
+ )?.flatMap((s) => s?.custom_content?.attachments?.map((a) => ({
1000
+ url: a?.url || ""
1001
+ })) || [])?.filter((s) => !!s?.url) || [], Lt = ({
1002
1002
  conversation: o,
1003
- locale: s,
1004
- onCloseModal: r,
1005
- modalDividers: l,
1006
- getConversation: c,
1007
- generateConversationLink: d,
1003
+ locale: r,
1004
+ onCloseModal: s,
1005
+ modalDividers: a,
1006
+ getConversation: d,
1007
+ generateConversationLink: c,
1008
1008
  chatExpiration: f,
1009
- chatExpirationDays: p,
1009
+ chatExpirationDays: m,
1010
1010
  close: e,
1011
1011
  chatWarning: n,
1012
1012
  shareLink: t,
1013
1013
  shareCopyLink: i,
1014
- shareCopiedLink: a,
1015
- shareDescription: h,
1014
+ shareCopiedLink: l,
1015
+ shareDescription: p,
1016
1016
  shareRemoveAccessToUsers: u,
1017
1017
  chatName: E,
1018
1018
  getSharedConversations: g,
1019
- revokeSharedConversations: v,
1019
+ revokeSharedConversations: R,
1020
1020
  baseUrl: N,
1021
1021
  id: C,
1022
- clientSharedPage: R,
1023
- clientSharedProp: S
1022
+ clientSharedPage: v,
1023
+ clientSharedProp: I
1024
1024
  }) => {
1025
- const [D, A] = T(null), [O, _] = T(), [H, P] = T(!1), [Y, j] = T(!1), [$, M] = T(), b = J(() => {
1026
- const V = N || window.location.origin;
1027
- if (N && N !== window.location.origin && R && S) {
1028
- const G = D?.split(`/${ve}/`)?.[1];
1029
- return `${V}/${R}?${S}=${G}`;
1025
+ const [T, b] = k(null), [L, H] = k(), [Q, x] = k(!1), [G, V] = k(!1), [Y, y] = k(), S = me(null), P = me(null), F = X(() => o?.id ? decodeURI(o.id) : C?.[0] && C?.[1] && r ? decodeURI(`${C[0]}/${r}/${C[1]}`) : null, [o?.id, C, r]), W = X(() => {
1026
+ if (!T)
1027
+ return "";
1028
+ const z = N || window.location.origin;
1029
+ if (N && N !== window.location.origin && v && I) {
1030
+ const ee = T.split(
1031
+ `/${be}/`
1032
+ )?.[1];
1033
+ return `${z}/${v}?${I}=${ee}`;
1030
1034
  }
1031
- return `${V}/${s}${D}`;
1032
- }, [N, D, s, R, S]);
1033
- ee(() => {
1034
- (async () => {
1035
- try {
1036
- const G = decodeURI(o ? o?.id : `${C?.[0]}/${s}/${C?.[1]}`), ce = `${decodeURI(G)}`, de = await c?.(ce), Ue = bt(
1037
- G,
1038
- Pt(de)
1039
- ), pe = await d?.(Ue), ge = await g?.(
1040
- re(se.OTHERS)
1035
+ return `${z}/${r}${T}`;
1036
+ }, [N, T, r, v, I]), Z = O(
1037
+ async (z) => {
1038
+ const ee = await g?.(
1039
+ se(ie.OTHERS)
1040
+ );
1041
+ if (ee)
1042
+ return Tt(
1043
+ { id: z },
1044
+ ee.resources
1041
1045
  );
1042
- pe && ge && (P(!0), A(St(pe)), _(
1043
- xt(
1044
- o,
1045
- ge?.resources
1046
- )
1047
- ));
1048
- } catch (G) {
1049
- P(!1), console.error("Error sharing conversation", G);
1046
+ },
1047
+ [g]
1048
+ );
1049
+ ne(() => {
1050
+ if (!F || S.current === F)
1051
+ return;
1052
+ S.current = F, x(!1), P.current?.abort();
1053
+ const z = new AbortController();
1054
+ return P.current = z, (async () => {
1055
+ try {
1056
+ const pe = await d?.(F), $e = Pt(
1057
+ F,
1058
+ Ot(pe)
1059
+ ), we = await c?.($e), He = await Z(F);
1060
+ if (z.signal.aborted || !we)
1061
+ return;
1062
+ b(Dt(we)), H(He), x(!0);
1063
+ } catch (pe) {
1064
+ if (z.signal.aborted)
1065
+ return;
1066
+ x(!1), console.error("Error sharing conversation", pe);
1050
1067
  }
1051
- })();
1068
+ })(), () => {
1069
+ z.abort(), S.current = null;
1070
+ };
1052
1071
  }, [
1053
- o,
1054
- d,
1072
+ F,
1055
1073
  c,
1056
- g,
1057
- C,
1058
- s
1074
+ d,
1075
+ Z
1059
1076
  ]);
1060
- const L = B(() => {
1061
- r(), A(null), P(!1), j(!1);
1062
- }, [r]), W = B(() => {
1063
- j(!0), navigator.clipboard.writeText(b || "");
1064
- }, [b]), ne = async () => {
1077
+ const de = O(() => {
1078
+ P.current?.abort(), S.current = null, s(), b(null), x(!1), V(!1);
1079
+ }, [s]), re = O(() => {
1080
+ V(!0), navigator.clipboard.writeText(W || "");
1081
+ }, [W]), ue = async () => {
1065
1082
  try {
1066
- M(!0), O && await v?.({ resources: [O] });
1067
- } catch (V) {
1068
- M(!1), console.error("Error revoking shared conversation", V);
1083
+ if (y(!0), L && await R?.({
1084
+ resources: [L]
1085
+ }), F) {
1086
+ const z = await Z(F);
1087
+ P.current?.signal.aborted || H(z);
1088
+ }
1089
+ } catch (z) {
1090
+ console.error("Error revoking shared conversation", z);
1091
+ } finally {
1092
+ P.current?.signal.aborted || y(!1);
1069
1093
  }
1070
- }, oe = B(() => /* @__PURE__ */ m(
1071
- Q,
1094
+ }, he = O(() => /* @__PURE__ */ h(
1095
+ j,
1072
1096
  {
1073
- buttonClassName: Y ? "text-button-secondary" : "text-button-primary",
1074
- iconBefore: Y ? /* @__PURE__ */ m(je, { width: 20, height: 20 }) : /* @__PURE__ */ m(We, { width: 20, height: 20 }),
1075
- title: Y ? a ?? "Copied" : i ?? "Copy link",
1076
- disabled: Y,
1077
- onClick: W
1097
+ buttonClassName: G ? "text-button-secondary" : "text-button-primary",
1098
+ iconBefore: G ? /* @__PURE__ */ h(Xe, { width: 20, height: 20 }) : /* @__PURE__ */ h(Ke, { width: 20, height: 20 }),
1099
+ title: G ? l ?? "Copied" : i ?? "Copy link",
1100
+ disabled: G,
1101
+ onClick: re
1078
1102
  }
1079
- ), [Y, W, a, i]);
1080
- return /* @__PURE__ */ y(
1081
- ae,
1103
+ ), [G, re, l, i]);
1104
+ return /* @__PURE__ */ M(
1105
+ le,
1082
1106
  {
1083
1107
  heading: t ?? "Share link",
1084
1108
  portalId: "share",
1085
- size: le.SM,
1086
- dividers: l,
1087
- onClose: L,
1109
+ size: ce.SM,
1110
+ dividers: a,
1111
+ onClose: de,
1088
1112
  closeButtonTitle: e ?? "Close",
1089
1113
  children: [
1090
- H ? /* @__PURE__ */ y("div", { className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0", children: [
1091
- o?.name ? /* @__PURE__ */ y("div", { className: "share-info flex w-full", children: [
1092
- /* @__PURE__ */ m("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: E ?? "Chat name:" }),
1093
- /* @__PURE__ */ m(
1114
+ Q ? /* @__PURE__ */ M("div", { className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0", children: [
1115
+ o?.name ? /* @__PURE__ */ M("div", { className: "share-info flex w-full", children: [
1116
+ /* @__PURE__ */ h("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: E ?? "Chat name:" }),
1117
+ /* @__PURE__ */ h(
1094
1118
  "h3",
1095
1119
  {
1096
1120
  className: "min-w-0 flex-1 truncate",
@@ -1099,105 +1123,105 @@ const bt = (o, s) => ({
1099
1123
  }
1100
1124
  )
1101
1125
  ] }) : null,
1102
- /* @__PURE__ */ y("div", { className: "share-info flex", children: [
1103
- /* @__PURE__ */ m("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: f ?? "Link expiration date:" }),
1104
- /* @__PURE__ */ y("h3", { children: [
1126
+ /* @__PURE__ */ M("div", { className: "share-info flex", children: [
1127
+ /* @__PURE__ */ h("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: f ?? "Link expiration date:" }),
1128
+ /* @__PURE__ */ M("h3", { children: [
1105
1129
  "3 ",
1106
- p ?? "days"
1130
+ m ?? "days"
1107
1131
  ] })
1108
1132
  ] }),
1109
- /* @__PURE__ */ m(
1110
- ke,
1133
+ /* @__PURE__ */ h(
1134
+ ze,
1111
1135
  {
1112
1136
  className: "min-h-[200px] self-center rounded border border-neutrals-600 p-2",
1113
- value: b,
1137
+ value: W,
1114
1138
  size: 200
1115
1139
  }
1116
1140
  ),
1117
- /* @__PURE__ */ m("p", { className: "body-2 text-neutrals-1000", children: h ?? "Your name, special instructions, and any messages you add after sharing remain confidential." }),
1118
- /* @__PURE__ */ m(
1119
- Ne,
1141
+ /* @__PURE__ */ h("p", { className: "body-2 text-neutrals-1000", children: p ?? "Your name, special instructions, and any messages you add after sharing remain confidential." }),
1142
+ /* @__PURE__ */ h(
1143
+ ye,
1120
1144
  {
1121
1145
  containerClasses: "share-input-container",
1122
1146
  cssClass: "share-input",
1123
1147
  readonly: !0,
1124
- placeholder: b,
1125
- value: b,
1148
+ placeholder: W,
1149
+ value: W,
1126
1150
  inputId: "conversationLink",
1127
- iconAfterInput: oe()
1151
+ iconAfterInput: he()
1128
1152
  }
1129
1153
  )
1130
- ] }) : /* @__PURE__ */ m("div", { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ m(we, {}) }),
1131
- H ? o && O ? /* @__PURE__ */ m("div", { className: "remove-access", children: /* @__PURE__ */ m(
1132
- Q,
1154
+ ] }) : /* @__PURE__ */ h("div", { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ h(Re, {}) }),
1155
+ Q ? o && L ? /* @__PURE__ */ h("div", { className: "remove-access", children: /* @__PURE__ */ h(
1156
+ j,
1133
1157
  {
1134
1158
  title: u ?? "Remove access to all users",
1135
1159
  buttonClassName: "remove-access-button py-3 px-4",
1136
1160
  isSmallButton: !0,
1137
- disabled: $,
1138
- onClick: ne
1161
+ disabled: Y,
1162
+ onClick: ue
1139
1163
  }
1140
- ) }) : /* @__PURE__ */ m("p", { className: "body-2 share-footer text-neutrals-800", children: n ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ m("div", {})
1164
+ ) }) : /* @__PURE__ */ h("p", { className: "body-2 share-footer text-neutrals-800", children: n ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ h("div", {})
1141
1165
  ]
1142
1166
  }
1143
1167
  );
1144
- }, Ot = ({
1168
+ }, kt = ({
1145
1169
  conversation: o,
1146
- onCloseModal: s,
1147
- renameConversation: r,
1148
- locale: l,
1149
- disableModalDividers: c,
1150
- titles: d,
1170
+ onCloseModal: r,
1171
+ renameConversation: s,
1172
+ locale: a,
1173
+ disableModalDividers: d,
1174
+ titles: c,
1151
1175
  isSmallButton: f
1152
1176
  }) => {
1153
- const [p, e] = T(o?.name || ""), n = (i) => {
1177
+ const [m, e] = k(o?.name || ""), n = (i) => {
1154
1178
  e(i);
1155
1179
  }, t = () => {
1156
- const i = `${o?.folderId}/${encodeURIComponent(fe(p))}-${(/* @__PURE__ */ new Date()).getTime()}`;
1157
- r(
1180
+ const i = `${o?.folderId}/${encodeURIComponent(Ee(m))}-${(/* @__PURE__ */ new Date()).getTime()}`;
1181
+ s(
1158
1182
  `conversations/${o.id}`,
1159
1183
  `conversations/${i}`
1160
1184
  );
1161
1185
  };
1162
- return /* @__PURE__ */ y(
1163
- ae,
1186
+ return /* @__PURE__ */ M(
1187
+ le,
1164
1188
  {
1165
- heading: d?.renameTitle ?? "Rename conversation",
1189
+ heading: c?.renameTitle ?? "Rename conversation",
1166
1190
  portalId: "rename-conversation",
1167
1191
  containerClassName: "rename-conversation-popup",
1168
- size: le.SM,
1169
- dividers: !c,
1170
- onClose: s,
1171
- closeButtonTitle: d?.close ?? "Cancel",
1192
+ size: ce.SM,
1193
+ dividers: !d,
1194
+ onClose: r,
1195
+ closeButtonTitle: c?.close ?? "Cancel",
1172
1196
  children: [
1173
- /* @__PURE__ */ m("div", { className: "px-6 py-4 sm:px-0", lang: l, children: /* @__PURE__ */ m(
1174
- Ye,
1197
+ /* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: a, children: /* @__PURE__ */ h(
1198
+ je,
1175
1199
  {
1176
1200
  inputId: "rename",
1177
- value: p,
1201
+ value: m,
1178
1202
  onChange: n,
1179
1203
  cssClass: "w-full"
1180
1204
  }
1181
1205
  ) }),
1182
- /* @__PURE__ */ y("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1183
- /* @__PURE__ */ m(
1184
- Q,
1206
+ /* @__PURE__ */ M("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1207
+ /* @__PURE__ */ h(
1208
+ j,
1185
1209
  {
1186
1210
  buttonClassName: "cancel-button",
1187
- title: d?.cancel ?? "Cancel",
1211
+ title: c?.cancel ?? "Cancel",
1188
1212
  isSmallButton: f,
1189
1213
  onClick: (i) => {
1190
- i.stopPropagation(), s();
1214
+ i.stopPropagation(), r();
1191
1215
  }
1192
1216
  }
1193
1217
  ),
1194
- /* @__PURE__ */ m(
1195
- Q,
1218
+ /* @__PURE__ */ h(
1219
+ j,
1196
1220
  {
1197
1221
  buttonClassName: "text-button-primary text-button-primary",
1198
- title: d?.save ?? "Rename",
1222
+ title: c?.save ?? "Rename",
1199
1223
  isSmallButton: f,
1200
- disabled: !p,
1224
+ disabled: !m,
1201
1225
  onClick: (i) => {
1202
1226
  i.stopPropagation(), t();
1203
1227
  }
@@ -1207,78 +1231,78 @@ const bt = (o, s) => ({
1207
1231
  ]
1208
1232
  }
1209
1233
  );
1210
- }, Tt = ({
1234
+ }, Bt = ({
1211
1235
  conversation: o,
1212
- conversationStyles: s,
1213
- shareConversationProps: r,
1214
- onConversationDelete: l,
1215
- getConversation: c,
1216
- getFileBlob: d,
1236
+ conversationStyles: r,
1237
+ shareConversationProps: s,
1238
+ onConversationDelete: a,
1239
+ getConversation: d,
1240
+ getFileBlob: c,
1217
1241
  renameConversation: f,
1218
- triggerButton: p,
1242
+ triggerButton: m,
1219
1243
  locale: e,
1220
1244
  isDisabled: n
1221
1245
  }) => {
1222
- const t = J(() => {
1223
- const A = [
1246
+ const t = X(() => {
1247
+ const b = [
1224
1248
  {
1225
- key: U.DELETE,
1226
- title: s?.titles?.delete ?? "Delete",
1227
- icon: s.actionsIcons?.[U.DELETE]
1249
+ key: _.DELETE,
1250
+ title: r?.titles?.delete ?? "Delete",
1251
+ icon: r.actionsIcons?.[_.DELETE]
1228
1252
  }
1229
1253
  ];
1230
- return o?.model?.id?.endsWith(et) ? A : [
1254
+ return o?.model?.id?.endsWith(ot) ? b : [
1231
1255
  ...o.isShared ? [] : [
1232
1256
  {
1233
- key: U.SHARE,
1234
- title: s?.titles?.share ?? "Share",
1235
- icon: s.actionsIcons?.[U.SHARE]
1257
+ key: _.SHARE,
1258
+ title: r?.titles?.share ?? "Share",
1259
+ icon: r.actionsIcons?.[_.SHARE]
1236
1260
  },
1237
1261
  {
1238
- key: U.RENAME,
1239
- title: s?.titles?.rename ?? "Rename",
1240
- icon: s.actionsIcons?.[U.RENAME]
1262
+ key: _.RENAME,
1263
+ title: r?.titles?.rename ?? "Rename",
1264
+ icon: r.actionsIcons?.[_.RENAME]
1241
1265
  }
1242
1266
  ],
1243
1267
  {
1244
- key: U.EXPORT,
1245
- title: s?.titles?.export ?? "Export",
1246
- icon: s.actionsIcons?.[U.EXPORT]
1268
+ key: _.EXPORT,
1269
+ title: r?.titles?.export ?? "Export",
1270
+ icon: r.actionsIcons?.[_.EXPORT]
1247
1271
  },
1248
- ...A
1272
+ ...b
1249
1273
  ];
1250
1274
  }, [
1251
1275
  o.isShared,
1252
1276
  o?.model?.id,
1253
- s.titles,
1254
- s.actionsIcons
1255
- ]), [i, a] = T(z.Closed), [h, u] = T(z.Closed), [E, g] = T(z.Closed), v = B(() => {
1256
- a(z.Closed);
1257
- }, [a]), N = B(() => {
1258
- u(z.Closed);
1259
- }, [u]), C = B(() => {
1260
- g(z.Closed);
1261
- }, [g]), R = B(() => {
1262
- l(o), v();
1263
- }, [o, l, v]), S = B(
1264
- (A, O) => {
1265
- f(A, O), C();
1277
+ r.titles,
1278
+ r.actionsIcons
1279
+ ]), [i, l] = k($.Closed), [p, u] = k($.Closed), [E, g] = k($.Closed), R = O(() => {
1280
+ l($.Closed);
1281
+ }, [l]), N = O(() => {
1282
+ u($.Closed);
1283
+ }, [u]), C = O(() => {
1284
+ g($.Closed);
1285
+ }, [g]), v = O(() => {
1286
+ a(o), R();
1287
+ }, [o, a, R]), I = O(
1288
+ (b, L) => {
1289
+ f(b, L), C();
1266
1290
  },
1267
1291
  [f, C]
1268
1292
  );
1269
- return /* @__PURE__ */ y(q, { children: [
1270
- /* @__PURE__ */ m(
1271
- Re,
1293
+ return /* @__PURE__ */ M(te, { children: [
1294
+ /* @__PURE__ */ h(
1295
+ Me,
1272
1296
  {
1273
1297
  containerClassName: "ml-3 group-hover:visible invisible",
1274
- triggerButton: p ?? /* @__PURE__ */ m(Lt, { disabled: n }),
1298
+ triggerButton: m ?? /* @__PURE__ */ h(Ft, { disabled: n }),
1275
1299
  options: t,
1276
1300
  openedClassName: "action-menu-opened",
1277
- onOptionSelect: (A) => {
1278
- A === U.DELETE && a(z.Opened), A === U.SHARE && u(z.Opened), A === U.RENAME && g(z.Opened), A === U.EXPORT && c(decodeURI(o.id)).then((O) => {
1279
- ft(O, d).then((_) => {
1280
- Ct(
1281
- `data:application/zip;base64,${_}`,
1301
+ onOptionSelect: (b) => {
1302
+ b === _.DELETE && l($.Opened), b === _.SHARE && u($.Opened), b === _.RENAME && g($.Opened), b === _.EXPORT && d(decodeURI(o.id)).then((L) => {
1303
+ Ct(L, c).then((H) => {
1304
+ Nt(
1305
+ `data:application/zip;base64,${H}`,
1282
1306
  `chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`
1283
1307
  );
1284
1308
  });
@@ -1287,48 +1311,48 @@ const bt = (o, s) => ({
1287
1311
  disabled: n
1288
1312
  }
1289
1313
  ),
1290
- i === z.Opened && /* @__PURE__ */ m(
1291
- lt,
1314
+ i === $.Opened && /* @__PURE__ */ h(
1315
+ ut,
1292
1316
  {
1293
- titles: s.titles,
1317
+ titles: r.titles,
1294
1318
  locale: e,
1295
- disableModalDividers: s.disableModalDividers,
1296
- isSmallButton: s.isSmallModalButton,
1297
- deleteConversation: R,
1298
- onCloseModal: v
1319
+ disableModalDividers: r.disableModalDividers,
1320
+ isSmallButton: r.isSmallModalButton,
1321
+ deleteConversation: v,
1322
+ onCloseModal: R
1299
1323
  }
1300
1324
  ),
1301
- h === z.Opened && /* @__PURE__ */ m(
1302
- Dt,
1325
+ p === $.Opened && /* @__PURE__ */ h(
1326
+ Lt,
1303
1327
  {
1304
1328
  conversation: o,
1305
1329
  locale: e,
1306
1330
  onCloseModal: N,
1307
- ...r
1331
+ ...s
1308
1332
  }
1309
1333
  ),
1310
- E === z.Opened && /* @__PURE__ */ m(
1311
- Ot,
1334
+ E === $.Opened && /* @__PURE__ */ h(
1335
+ kt,
1312
1336
  {
1313
1337
  conversation: o,
1314
1338
  locale: e,
1315
- titles: s.titles,
1316
- renameConversation: S,
1339
+ titles: r.titles,
1340
+ renameConversation: I,
1317
1341
  onCloseModal: C,
1318
- disableModalDividers: s.disableModalDividers,
1319
- isSmallButton: s.isSmallModalButton
1342
+ disableModalDividers: r.disableModalDividers,
1343
+ isSmallButton: r.isSmallModalButton
1320
1344
  }
1321
1345
  )
1322
1346
  ] });
1323
- }, Lt = ({ disabled: o }) => /* @__PURE__ */ m(
1347
+ }, Ft = ({ disabled: o }) => /* @__PURE__ */ h(
1324
1348
  "div",
1325
1349
  {
1326
- className: k(
1350
+ className: B(
1327
1351
  "flex items-center justify-center w-[24px]",
1328
1352
  o ? "cursor-not-allowed" : "cursor-pointer"
1329
1353
  ),
1330
- children: /* @__PURE__ */ m(
1331
- Ve,
1354
+ children: /* @__PURE__ */ h(
1355
+ Ze,
1332
1356
  {
1333
1357
  width: 20,
1334
1358
  height: 20,
@@ -1337,73 +1361,73 @@ const bt = (o, s) => ({
1337
1361
  }
1338
1362
  )
1339
1363
  }
1340
- ), Fe = ({
1364
+ ), _e = ({
1341
1365
  conversation: o,
1342
- selectedConversationId: s,
1343
- searchQuery: r,
1344
- onConversationClick: l,
1345
- actions: c,
1346
- locale: d,
1366
+ selectedConversationId: r,
1367
+ searchQuery: s,
1368
+ onConversationClick: a,
1369
+ actions: d,
1370
+ locale: c,
1347
1371
  isDisabled: f,
1348
- conversationStyles: p,
1372
+ conversationStyles: m,
1349
1373
  shareConversationProps: e
1350
1374
  }) => {
1351
- const n = ze(null), t = fe(o?.name);
1352
- return ee(() => {
1353
- if (o?.id === s && n?.current) {
1375
+ const n = me(null), t = Ee(o?.name);
1376
+ return ne(() => {
1377
+ if (o?.id === r && n?.current) {
1354
1378
  const i = n.current.parentElement?.parentElement?.parentElement;
1355
1379
  if (i) {
1356
- const a = n.current.getBoundingClientRect(), h = i.getBoundingClientRect(), u = a.height, E = h.height, v = a.top - h.top + i.scrollTop - (E / 2 - u / 2);
1380
+ const l = n.current.getBoundingClientRect(), p = i.getBoundingClientRect(), u = l.height, E = p.height, R = l.top - p.top + i.scrollTop - (E / 2 - u / 2);
1357
1381
  i.scrollTo({
1358
- top: v,
1382
+ top: R,
1359
1383
  behavior: "smooth"
1360
1384
  });
1361
1385
  }
1362
1386
  }
1363
- }, [o, s]), /* @__PURE__ */ y(
1387
+ }, [o, r]), /* @__PURE__ */ M(
1364
1388
  "div",
1365
1389
  {
1366
1390
  ref: n,
1367
- className: k(
1391
+ className: B(
1368
1392
  "flex justify-between items-center py-2 px-3 border-transparent relative group border",
1369
1393
  "conversation-item",
1370
- s === o?.id && "bg-hues-100 conversation-item-active",
1394
+ r === o?.id && "bg-hues-100 conversation-item-active",
1371
1395
  f ? "cursor-not-allowed" : "cursor-pointer hover:border-hues-600"
1372
1396
  ),
1373
- onClick: () => !f && l(o.folderId, o?.id),
1374
- title: f ? p?.titles?.noActionsAllowed : t,
1397
+ onClick: () => !f && a(o.folderId, o?.id),
1398
+ title: f ? m?.titles?.noActionsAllowed : t,
1375
1399
  children: [
1376
- /* @__PURE__ */ y("div", { className: "flex min-w-0 flex-1 items-center", children: [
1377
- p.conversationItemIcon ? p.conversationItemIcon : null,
1378
- /* @__PURE__ */ m(
1400
+ /* @__PURE__ */ M("div", { className: "flex min-w-0 flex-1 items-center", children: [
1401
+ m.conversationItemIcon ? m.conversationItemIcon : null,
1402
+ /* @__PURE__ */ h(
1379
1403
  "h3",
1380
1404
  {
1381
- className: k(
1405
+ className: B(
1382
1406
  "truncate font-semibold text-neutrals-1000 sm:body-2",
1383
1407
  "conversation-item-text",
1384
- s === o?.id ? "conversation-item-text-active" : ""
1408
+ r === o?.id ? "conversation-item-text-active" : ""
1385
1409
  ),
1386
- title: f ? p?.titles?.noActionsAllowed : t,
1387
- children: r?.length ? /* @__PURE__ */ m(
1388
- Qe,
1410
+ title: f ? m?.titles?.noActionsAllowed : t,
1411
+ children: s?.length ? /* @__PURE__ */ h(
1412
+ We,
1389
1413
  {
1390
1414
  text: t,
1391
- highlightText: r
1415
+ highlightText: s
1392
1416
  }
1393
1417
  ) : t
1394
1418
  }
1395
1419
  )
1396
1420
  ] }),
1397
- /* @__PURE__ */ m(
1398
- Tt,
1421
+ /* @__PURE__ */ h(
1422
+ Bt,
1399
1423
  {
1400
- locale: d,
1401
- conversationStyles: p,
1424
+ locale: c,
1425
+ conversationStyles: m,
1402
1426
  conversation: o,
1403
- onConversationDelete: c.deleteConversation,
1404
- getConversation: c.getConversation,
1405
- getFileBlob: c.getFileBlob,
1406
- renameConversation: c.renameConversation,
1427
+ onConversationDelete: d.deleteConversation,
1428
+ getConversation: d.getConversation,
1429
+ getFileBlob: d.getFileBlob,
1430
+ renameConversation: d.renameConversation,
1407
1431
  shareConversationProps: e,
1408
1432
  isDisabled: f
1409
1433
  }
@@ -1411,446 +1435,467 @@ const bt = (o, s) => ({
1411
1435
  ]
1412
1436
  }
1413
1437
  );
1414
- }, Bt = ({
1438
+ }, Ut = ({
1415
1439
  handleConversationClick: o,
1416
- actions: s,
1417
- selectedConversationId: r,
1418
- groupLabel: l,
1419
- conversationStyles: c,
1420
- groupedConversations: d,
1440
+ actions: r,
1441
+ selectedConversationId: s,
1442
+ groupLabel: a,
1443
+ conversationStyles: d,
1444
+ groupedConversations: c,
1421
1445
  shareConversationProps: f,
1422
- locale: p,
1446
+ locale: m,
1423
1447
  isDisabled: e
1424
1448
  }) => {
1425
- const [n, t] = T(!1), i = B(() => {
1426
- t((a) => !a);
1449
+ const [n, t] = k(!1), i = O(() => {
1450
+ t((l) => !l);
1427
1451
  }, [t]);
1428
- return /* @__PURE__ */ y("div", { children: [
1429
- /* @__PURE__ */ y(
1452
+ return /* @__PURE__ */ M("div", { children: [
1453
+ /* @__PURE__ */ M(
1430
1454
  "div",
1431
1455
  {
1432
1456
  className: "conversation-group-items-title mb-3 inline-flex cursor-pointer items-center gap-1 text-neutrals-700",
1433
1457
  onClick: i,
1434
1458
  children: [
1435
- /* @__PURE__ */ m(
1436
- Xe,
1459
+ /* @__PURE__ */ h(
1460
+ Je,
1437
1461
  {
1438
- className: k(
1462
+ className: B(
1439
1463
  "w-3 h-3 conversation-group-items-arrow",
1440
1464
  n ? "rotate-[90deg]" : "rotate-0"
1441
1465
  )
1442
1466
  }
1443
1467
  ),
1444
- /* @__PURE__ */ m("span", { className: "body-3 conversation-group-items-title-text", children: at(l, c?.titles) })
1468
+ /* @__PURE__ */ h("span", { className: "body-3 conversation-group-items-title-text", children: dt(a, d?.titles) })
1445
1469
  ]
1446
1470
  }
1447
1471
  ),
1448
- !n && /* @__PURE__ */ m(
1472
+ !n && /* @__PURE__ */ h(
1449
1473
  "div",
1450
1474
  {
1451
- className: k(
1475
+ className: B(
1452
1476
  "flex flex-col gap-y-3",
1453
1477
  "conversation-group-items"
1454
1478
  ),
1455
- children: ye(d).map(
1456
- (a) => /* @__PURE__ */ m(
1457
- Fe,
1479
+ children: Ie(c).map(
1480
+ (l) => /* @__PURE__ */ h(
1481
+ _e,
1458
1482
  {
1459
- locale: p,
1483
+ locale: m,
1460
1484
  isDisabled: e,
1461
- conversationStyles: c,
1462
- conversation: a,
1463
- selectedConversationId: r,
1485
+ conversationStyles: d,
1486
+ conversation: l,
1487
+ selectedConversationId: s,
1464
1488
  onConversationClick: o,
1465
- actions: s,
1489
+ actions: r,
1466
1490
  shareConversationProps: f
1467
1491
  },
1468
- a.id || a.name
1492
+ l.id || l.name
1469
1493
  )
1470
1494
  )
1471
1495
  }
1472
1496
  )
1473
- ] }, l);
1474
- }, kt = ({
1497
+ ] }, a);
1498
+ }, zt = ({
1475
1499
  searchQuery: o,
1476
- isExpandedSearch: s,
1477
- titles: r,
1478
- searchIcon: l,
1479
- onSearchConversations: c,
1480
- toggleSearchField: d
1481
- }) => /* @__PURE__ */ m(q, { children: s ? /* @__PURE__ */ m(
1482
- Ne,
1500
+ isExpandedSearch: r,
1501
+ titles: s,
1502
+ searchIcon: a,
1503
+ onSearchConversations: d,
1504
+ toggleSearchField: c
1505
+ }) => /* @__PURE__ */ h(te, { children: r ? /* @__PURE__ */ h(
1506
+ ye,
1483
1507
  {
1484
1508
  inputId: "conversations-search",
1485
- placeholder: r?.searchPlaceholder ?? "Search",
1509
+ placeholder: s?.searchPlaceholder ?? "Search",
1486
1510
  containerClasses: "conversation-list-search-input h-[40px] bg-transparent px-4 py-2 rounded-full border-neutrals-400 shadow-none",
1487
1511
  cssClass: "h-auto",
1488
1512
  value: o,
1489
- iconAfterInput: /* @__PURE__ */ m(
1490
- Ge,
1513
+ iconAfterInput: /* @__PURE__ */ h(
1514
+ Ve,
1491
1515
  {
1492
1516
  buttonClassName: "text-button-tertiary items-center p-0 ml-4 border-0 w-5 h-5",
1493
- onClick: d,
1494
- icon: /* @__PURE__ */ m(Ke, {})
1517
+ onClick: c,
1518
+ icon: /* @__PURE__ */ h(qe, {})
1495
1519
  }
1496
1520
  ),
1497
- onChange: c
1521
+ onChange: d
1498
1522
  }
1499
- ) : /* @__PURE__ */ m(
1500
- Q,
1523
+ ) : /* @__PURE__ */ h(
1524
+ j,
1501
1525
  {
1502
1526
  buttonClassName: "text-button-tertiary p-0 search-button",
1503
- iconBefore: l || /* @__PURE__ */ m(Ze, { className: "size-5" }),
1504
- onClick: d
1527
+ iconBefore: a || /* @__PURE__ */ h(et, { className: "size-5" }),
1528
+ onClick: c
1505
1529
  }
1506
- ) }), Ft = ({
1530
+ ) }), _t = ({
1507
1531
  conversations: o,
1508
- selectedConversationId: s,
1509
- searchQuery: r,
1510
- conversationStyles: l,
1511
- handleConversationClick: c,
1512
- actions: d,
1532
+ selectedConversationId: r,
1533
+ searchQuery: s,
1534
+ conversationStyles: a,
1535
+ handleConversationClick: d,
1536
+ actions: c,
1513
1537
  locale: f,
1514
- shareConversationProps: p,
1538
+ shareConversationProps: m,
1515
1539
  isDisabled: e
1516
1540
  }) => {
1517
- const [n, t] = T([]);
1518
- return ee(() => {
1541
+ const [n, t] = k([]);
1542
+ return ne(() => {
1519
1543
  t(
1520
- ye(
1544
+ Ie(
1521
1545
  o?.filter(
1522
- (i) => fe(i?.name)?.includes(
1523
- r || ""
1546
+ (i) => Ee(i?.name)?.includes(
1547
+ s || ""
1524
1548
  )
1525
1549
  )
1526
1550
  )
1527
1551
  );
1528
- }, [o, r]), /* @__PURE__ */ m(q, { children: n?.length ? n.map((i) => /* @__PURE__ */ m(
1529
- Fe,
1552
+ }, [o, s]), /* @__PURE__ */ h(te, { children: n?.length ? n.map((i) => /* @__PURE__ */ h(
1553
+ _e,
1530
1554
  {
1531
1555
  locale: f,
1532
- conversationStyles: l,
1556
+ conversationStyles: a,
1533
1557
  conversation: i,
1534
- searchQuery: r,
1535
- selectedConversationId: s,
1536
- onConversationClick: c,
1537
- actions: d,
1538
- shareConversationProps: p,
1558
+ searchQuery: s,
1559
+ selectedConversationId: r,
1560
+ onConversationClick: d,
1561
+ actions: c,
1562
+ shareConversationProps: m,
1539
1563
  isDisabled: e
1540
1564
  },
1541
1565
  i.id
1542
- )) : /* @__PURE__ */ m("h3", { className: "text-neutrals-800", children: l?.titles?.noConversation ?? "No conversations yet" }) });
1543
- }, Ut = ({ titles: o }) => /* @__PURE__ */ y("div", { className: "flex flex-col p-8 text-center", children: [
1544
- /* @__PURE__ */ m("p", { className: "text-neutrals-800", children: o?.noConversation ?? "No conversations yet" }),
1545
- /* @__PURE__ */ m("p", { className: "mt-2 text-sm text-neutrals-800", children: o?.clickNewChat ?? 'Click "New Chat" to start a conversation' })
1546
- ] }), Zt = ({
1566
+ )) : /* @__PURE__ */ h("h3", { className: "text-neutrals-800", children: a?.titles?.noConversation ?? "No conversations yet" }) });
1567
+ }, $t = ({ titles: o }) => /* @__PURE__ */ M("div", { className: "flex flex-col p-8 text-center", children: [
1568
+ /* @__PURE__ */ h("p", { className: "text-neutrals-800", children: o?.noConversation ?? "No conversations yet" }),
1569
+ /* @__PURE__ */ h("p", { className: "mt-2 text-sm text-neutrals-800", children: o?.clickNewChat ?? 'Click "New Chat" to start a conversation' })
1570
+ ] }), en = ({
1547
1571
  handleConversationClick: o,
1548
- selectedConversationId: s,
1549
- actions: r,
1550
- children: l,
1551
- isCollapsed: c,
1552
- isStreaming: d,
1572
+ selectedConversationId: r,
1573
+ actions: s,
1574
+ children: a,
1575
+ isCollapsed: d,
1576
+ isStreaming: c,
1553
1577
  conversationStyles: f,
1554
- conversations: p,
1578
+ conversations: m,
1555
1579
  locale: e,
1556
1580
  sharedConversations: n,
1557
1581
  setConversations: t,
1558
1582
  setSharedConversations: i,
1559
- shareConversationProps: a,
1560
- handleSelectedConversationRemove: h
1583
+ shareConversationProps: l,
1584
+ handleSelectedConversationRemove: p
1561
1585
  }) => {
1562
- const [u, E] = T({}), [g, v] = T(!0), [N, C] = T(""), [R, S] = T(!1), {
1563
- getConversations: D,
1564
- getSharedConversations: A,
1565
- deleteConversation: O,
1566
- renameConversation: _
1567
- } = r, H = J(() => !!N?.length, [N]);
1568
- ee(() => {
1586
+ const [u, E] = k({}), [g, R] = k(!0), [N, C] = k(""), [v, I] = k(!1), {
1587
+ getConversations: T,
1588
+ getSharedConversations: b,
1589
+ deleteConversation: L,
1590
+ renameConversation: H
1591
+ } = s, Q = X(() => !!N?.length, [N]);
1592
+ ne(() => {
1569
1593
  E({
1570
- ...nt(n),
1571
- ...it(p)
1594
+ ...st(n),
1595
+ ...ct(m)
1572
1596
  });
1573
- }, [p, n]), ee(() => {
1574
- async function M() {
1597
+ }, [m, n]), ne(() => {
1598
+ async function y() {
1575
1599
  try {
1576
- v(!0);
1577
- const b = await D(e), L = await A(
1578
- re(se.ME)
1600
+ R(!0);
1601
+ const S = await T(e), P = await b(
1602
+ se(ie.ME)
1579
1603
  );
1580
- t(K(b)), i(
1581
- K(
1582
- ue(L, e)
1604
+ t(J(S)), i(
1605
+ J(
1606
+ fe(P, e)
1583
1607
  )
1584
1608
  );
1585
- } catch (b) {
1586
- console.error("Error loading conversation", b);
1609
+ } catch (S) {
1610
+ console.error("Error loading conversation", S);
1587
1611
  } finally {
1588
- v(!1);
1612
+ R(!1);
1589
1613
  }
1590
1614
  }
1591
- M();
1615
+ y();
1592
1616
  }, [
1593
- D,
1617
+ T,
1594
1618
  t,
1595
1619
  e,
1596
- A,
1620
+ b,
1597
1621
  i
1598
1622
  ]);
1599
- const P = B(
1600
- async (M) => {
1623
+ const x = O(
1624
+ async (y) => {
1601
1625
  try {
1602
- await O(M);
1603
- const b = await D(e), L = await A(
1604
- re(se.ME)
1626
+ await L(y);
1627
+ const S = await T(e), P = await b(
1628
+ se(ie.ME)
1605
1629
  );
1606
- t(K(b)), i(
1607
- K(
1608
- ue(L, e)
1630
+ t(J(S)), i(
1631
+ J(
1632
+ fe(P, e)
1609
1633
  )
1610
- ), s === M?.id && h();
1611
- } catch (b) {
1612
- console.error("Error deleting conversation", b);
1634
+ ), r === y?.id && p();
1635
+ } catch (S) {
1636
+ console.error("Error deleting conversation", S);
1613
1637
  }
1614
1638
  },
1615
1639
  [
1616
- O,
1617
- D,
1640
+ L,
1641
+ T,
1618
1642
  e,
1619
- A,
1643
+ b,
1620
1644
  t,
1621
1645
  i,
1622
- s,
1623
- h
1646
+ r,
1647
+ p
1624
1648
  ]
1625
- ), Y = B(
1626
- async (M, b) => {
1649
+ ), G = O(
1650
+ async (y, S) => {
1627
1651
  try {
1628
- v(!0), await _(M, b);
1629
- const L = await D(e), W = await A(
1630
- re(se.ME)
1652
+ R(!0), await H(y, S);
1653
+ const P = await T(e), F = await b(
1654
+ se(ie.ME)
1631
1655
  );
1632
- t(K(L)), i(
1633
- K(
1634
- ue(W, e)
1656
+ t(J(P)), i(
1657
+ J(
1658
+ fe(F, e)
1635
1659
  )
1636
1660
  );
1637
- } catch (L) {
1638
- console.error("Error renaming conversation", L);
1661
+ } catch (P) {
1662
+ console.error("Error renaming conversation", P);
1639
1663
  } finally {
1640
- v(!1);
1664
+ R(!1);
1641
1665
  }
1642
1666
  },
1643
1667
  [
1644
- D,
1668
+ T,
1645
1669
  e,
1646
- A,
1670
+ b,
1647
1671
  t,
1648
1672
  i,
1649
- _
1673
+ H
1650
1674
  ]
1651
- ), j = B(
1652
- (M) => {
1653
- C(M);
1675
+ ), V = O(
1676
+ (y) => {
1677
+ C(y);
1654
1678
  },
1655
1679
  [C]
1656
- ), $ = B(() => {
1657
- S((M) => !M), C("");
1658
- }, [S]);
1659
- return g ? /* @__PURE__ */ m(we, {}) : /* @__PURE__ */ y(q, { children: [
1660
- !c && /* @__PURE__ */ y(
1680
+ ), Y = O(() => {
1681
+ I((y) => !y), C("");
1682
+ }, [I]);
1683
+ return g ? /* @__PURE__ */ h(Re, {}) : /* @__PURE__ */ M(te, { children: [
1684
+ !d && /* @__PURE__ */ M(
1661
1685
  "div",
1662
1686
  {
1663
- className: k(
1687
+ className: B(
1664
1688
  "flex justify-between items-center",
1665
- R ? " pt-4 pb-0 sm:pt-10" : " pt-6 pb-2 sm:pt-10"
1689
+ v ? " pt-4 pb-0 sm:pt-10" : " pt-6 pb-2 sm:pt-10"
1666
1690
  ),
1667
1691
  children: [
1668
- !R && /* @__PURE__ */ m("h3", { className: "sm:body-2 text-neutrals-700", children: f?.titles?.allChats ?? "All Chats" }),
1669
- /* @__PURE__ */ m(
1670
- kt,
1692
+ !v && /* @__PURE__ */ h("h3", { className: "sm:body-2 text-neutrals-700", children: f?.titles?.allChats ?? "All Chats" }),
1693
+ /* @__PURE__ */ h(
1694
+ zt,
1671
1695
  {
1672
1696
  searchQuery: N,
1673
1697
  searchIcon: f.searchIcon,
1674
1698
  titles: f.titles,
1675
- isExpandedSearch: R,
1676
- onSearchConversations: j,
1677
- toggleSearchField: $
1699
+ isExpandedSearch: v,
1700
+ onSearchConversations: V,
1701
+ toggleSearchField: Y
1678
1702
  }
1679
1703
  )
1680
1704
  ]
1681
1705
  }
1682
1706
  ),
1683
- /* @__PURE__ */ m(
1707
+ /* @__PURE__ */ h(
1684
1708
  "div",
1685
1709
  {
1686
- className: k(
1710
+ className: B(
1687
1711
  "scroll-hidden-container flex flex-col mt-4 flex-1 min-h-0 pr-2",
1688
- H ? "gap-y-1" : "gap-y-6"
1712
+ Q ? "gap-y-1" : "gap-y-6"
1689
1713
  ),
1690
- children: c ? null : /* @__PURE__ */ m(q, { children: p?.length === 0 && n?.length === 0 ? /* @__PURE__ */ m(Ut, { titles: f.titles }) : H ? /* @__PURE__ */ m(
1691
- Ft,
1714
+ children: d ? null : /* @__PURE__ */ h(te, { children: m?.length === 0 && n?.length === 0 ? /* @__PURE__ */ h($t, { titles: f.titles }) : Q ? /* @__PURE__ */ h(
1715
+ _t,
1692
1716
  {
1693
1717
  locale: e,
1694
1718
  conversationStyles: f,
1695
- conversations: [...n, ...p],
1719
+ conversations: [...n, ...m],
1696
1720
  searchQuery: N,
1697
- selectedConversationId: s,
1721
+ selectedConversationId: r,
1698
1722
  handleConversationClick: o,
1699
- shareConversationProps: a,
1700
- isDisabled: d,
1723
+ shareConversationProps: l,
1724
+ isDisabled: c,
1701
1725
  actions: {
1702
- ...r,
1703
- deleteConversation: P
1726
+ ...s,
1727
+ deleteConversation: x
1704
1728
  }
1705
1729
  }
1706
1730
  ) : Object.entries(u).map(
1707
- ([M, b]) => b?.length > 0 && /* @__PURE__ */ m(
1708
- Bt,
1731
+ ([y, S]) => S?.length > 0 && /* @__PURE__ */ h(
1732
+ Ut,
1709
1733
  {
1710
1734
  locale: e,
1711
- isDisabled: d,
1712
- groupLabel: M,
1735
+ isDisabled: c,
1736
+ groupLabel: y,
1713
1737
  conversationStyles: f,
1714
- groupedConversations: b,
1738
+ groupedConversations: S,
1715
1739
  handleConversationClick: o,
1716
1740
  actions: {
1717
- ...r,
1718
- deleteConversation: P,
1719
- renameConversation: Y
1741
+ ...s,
1742
+ deleteConversation: x,
1743
+ renameConversation: G
1720
1744
  },
1721
- shareConversationProps: a,
1722
- selectedConversationId: s
1745
+ shareConversationProps: l,
1746
+ selectedConversationId: r
1723
1747
  },
1724
- M
1748
+ y
1725
1749
  )
1726
1750
  ) })
1727
1751
  }
1728
1752
  ),
1729
- l
1753
+ a
1730
1754
  ] });
1731
- }, zt = ({
1755
+ }, Ht = ({
1732
1756
  onCloseModal: o,
1733
- disableModalDividers: s,
1734
- signOut: r,
1735
- isSmallButton: l,
1736
- locale: c,
1737
- titles: d
1738
- }) => /* @__PURE__ */ y(
1739
- ae,
1757
+ disableModalDividers: r,
1758
+ signOut: s,
1759
+ isSmallButton: a,
1760
+ locale: d,
1761
+ titles: c
1762
+ }) => /* @__PURE__ */ M(
1763
+ le,
1740
1764
  {
1741
- heading: d?.popupTitle || "Log out?",
1765
+ heading: c?.popupTitle || "Log out?",
1742
1766
  portalId: "sign-out",
1743
1767
  containerClassName: "sign-out-popup",
1744
- size: le.SM,
1745
- dividers: !s,
1768
+ size: ce.SM,
1769
+ dividers: !r,
1746
1770
  onClose: o,
1747
1771
  closeButtonTitle: "Cancel",
1748
1772
  children: [
1749
- /* @__PURE__ */ m("div", { className: "px-6 py-4 sm:px-0", lang: c, children: d?.popupText }),
1750
- /* @__PURE__ */ y("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1751
- /* @__PURE__ */ m(
1752
- Q,
1773
+ /* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: d, children: c?.popupText }),
1774
+ /* @__PURE__ */ M("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
1775
+ /* @__PURE__ */ h(
1776
+ j,
1753
1777
  {
1754
1778
  buttonClassName: "cancel-button",
1755
- title: d?.popupCancel || "Cancel",
1756
- isSmallButton: l,
1779
+ title: c?.popupCancel || "Cancel",
1780
+ isSmallButton: a,
1757
1781
  onClick: (f) => {
1758
1782
  f.stopPropagation(), o();
1759
1783
  }
1760
1784
  }
1761
1785
  ),
1762
- /* @__PURE__ */ m(
1763
- Q,
1786
+ /* @__PURE__ */ h(
1787
+ j,
1764
1788
  {
1765
1789
  buttonClassName: "text-button-primary",
1766
- title: d?.popupApply || "Sign Out",
1767
- isSmallButton: l,
1790
+ title: c?.popupApply || "Sign Out",
1791
+ isSmallButton: a,
1768
1792
  onClick: (f) => {
1769
- f.stopPropagation(), r?.();
1793
+ f.stopPropagation(), s?.();
1770
1794
  }
1771
1795
  }
1772
1796
  )
1773
1797
  ] })
1774
1798
  ]
1775
1799
  }
1776
- ), Jt = ({
1800
+ ), tn = ({
1777
1801
  userInfo: o,
1778
- signOutAction: s,
1779
- styles: r,
1780
- locale: l,
1802
+ signOutAction: r,
1803
+ contactSupportUrl: s,
1804
+ styles: a,
1805
+ locale: d,
1781
1806
  titles: c
1782
1807
  }) => {
1783
- const d = (E) => E?.split(" ")?.map((g, v) => v < 2 ? g[0].toUpperCase() : "")?.join("") ?? "", f = J(
1784
- () => o?.name ? d(o?.name) : o?.email?.[0].toUpperCase() ?? "",
1808
+ const f = (R) => R?.split(" ")?.map((N, C) => C < 2 ? N[0].toUpperCase() : "")?.join("") ?? "", m = X(
1809
+ () => o?.name ? f(o?.name) : o?.email?.[0].toUpperCase() ?? "",
1785
1810
  [o]
1786
- ), [p, e] = T(!1), n = o?.name?.split(" "), t = n ? `${n?.[0] ?? ""} ${n?.[1]?.[0] ? n?.[1]?.[0] + "." : ""}` : o?.email ?? "", i = B(() => {
1787
- e(!0);
1788
- }, []), a = B(() => {
1789
- e(!1);
1790
- }, []), h = J(() => /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
1791
- /* @__PURE__ */ m(
1811
+ ), [e, n] = k(!1), t = o?.name?.split(" "), i = t ? `${t?.[0] ?? ""} ${t?.[1]?.[0] ? t?.[1]?.[0] + "." : ""}` : o?.email ?? "", l = O(() => {
1812
+ n(!0);
1813
+ }, []), p = O(() => {
1814
+ n(!1);
1815
+ }, []), u = O(() => {
1816
+ window.open(s || "#", "_blank", "noopener,noreferrer");
1817
+ }, [s]), E = X(() => /* @__PURE__ */ M("div", { className: "flex items-center gap-2", children: [
1818
+ /* @__PURE__ */ h(
1792
1819
  "div",
1793
1820
  {
1794
- className: k(
1821
+ className: B(
1795
1822
  "cursor-pointer flex items-center justify-center size-11 rounded-[100px] p-[10px] sm:h-[32px] sm:w-[32px] flex-shrink-0",
1796
- r?.initialStyles
1823
+ a?.initialStyles
1797
1824
  ),
1798
- children: f
1825
+ children: m
1799
1826
  }
1800
1827
  ),
1801
- /* @__PURE__ */ m(
1828
+ /* @__PURE__ */ h(
1802
1829
  "p",
1803
1830
  {
1804
- className: k(
1831
+ className: B(
1805
1832
  "h3 cursor-pointer overflow-hidden text-ellipsis",
1806
- r?.userNameStyles
1833
+ a?.userNameStyles
1807
1834
  ),
1808
- children: (r?.showShortName ? t : o?.name) ?? o?.email ?? ""
1835
+ children: (a?.showShortName ? i : o?.name) ?? o?.email ?? ""
1809
1836
  }
1810
1837
  )
1811
- ] }), [f, t, r, o]), u = J(() => /* @__PURE__ */ y("div", { className: k("py-1", r?.dropDownStyles), children: [
1812
- r?.settingsIcon && /* @__PURE__ */ y(
1838
+ ] }), [m, i, a, o]), g = X(() => /* @__PURE__ */ M("div", { className: B("py-1", a?.dropDownStyles), children: [
1839
+ a?.settingsIcon && /* @__PURE__ */ M(
1813
1840
  "button",
1814
1841
  {
1815
- className: k(
1816
- "p-2 items-center flex gap-1 text-primary fill-primary body-1",
1817
- r?.dropdownButtonStyles
1842
+ className: B(
1843
+ "p-2 items-center flex gap-1 text-primary fill-primary",
1844
+ a?.dropdownButtonTypographyStyles || "body-1",
1845
+ a?.dropdownButtonStyles
1818
1846
  ),
1819
1847
  title: c?.settings,
1820
1848
  children: [
1821
- r?.settingsIcon,
1822
- c?.settings || "Settings"
1849
+ /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.settingsIcon }),
1850
+ /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.settings || "Settings" })
1851
+ ]
1852
+ }
1853
+ ),
1854
+ a?.contactSupportIcon && /* @__PURE__ */ M(
1855
+ "button",
1856
+ {
1857
+ className: B(
1858
+ "p-2 items-center flex gap-1 text-primary fill-primary",
1859
+ a?.dropdownButtonTypographyStyles || "body-1",
1860
+ a?.dropdownButtonStyles
1861
+ ),
1862
+ title: c?.contactSupport,
1863
+ onClick: u,
1864
+ children: [
1865
+ /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.contactSupportIcon }),
1866
+ /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.contactSupport || "Contact support" })
1823
1867
  ]
1824
1868
  }
1825
1869
  ),
1826
- /* @__PURE__ */ m(
1870
+ /* @__PURE__ */ h(
1827
1871
  "div",
1828
1872
  {
1829
- className: k(
1873
+ className: B(
1830
1874
  "h-0 border-t border-neutrals-600 my-2",
1831
- r?.showSeparator ? "block" : "hidden"
1875
+ a?.showSeparator ? "block" : "hidden"
1832
1876
  )
1833
1877
  }
1834
1878
  ),
1835
- /* @__PURE__ */ y(
1879
+ /* @__PURE__ */ M(
1836
1880
  "button",
1837
1881
  {
1838
- className: k(
1839
- "p-2 items-center flex gap-1 text-primary fill-primary body-1",
1840
- r?.dropdownButtonStyles
1882
+ className: B(
1883
+ "p-2 items-center flex gap-1 text-primary fill-primary",
1884
+ a?.dropdownButtonTypographyStyles || "body-1",
1885
+ a?.dropdownButtonStyles
1841
1886
  ),
1842
1887
  title: c?.signOut,
1843
- onClick: i,
1888
+ onClick: l,
1844
1889
  children: [
1845
- r?.signOutIcon,
1846
- c?.signOut || "Sign out",
1847
- p && /* @__PURE__ */ m(
1848
- zt,
1890
+ /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.signOutIcon }),
1891
+ /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.signOut || "Sign out" }),
1892
+ e && /* @__PURE__ */ h(
1893
+ Ht,
1849
1894
  {
1850
- onCloseModal: a,
1851
- signOut: () => s?.(),
1852
- locale: l,
1853
- disableModalDividers: r?.disableModalDividers,
1895
+ onCloseModal: p,
1896
+ signOut: () => r?.(),
1897
+ locale: d,
1898
+ disableModalDividers: a?.disableModalDividers,
1854
1899
  titles: c
1855
1900
  }
1856
1901
  )
@@ -1858,33 +1903,34 @@ const bt = (o, s) => ({
1858
1903
  }
1859
1904
  )
1860
1905
  ] }), [
1861
- r,
1862
- c,
1863
- i,
1864
- p,
1865
1906
  a,
1907
+ c,
1866
1908
  l,
1867
- s
1909
+ u,
1910
+ e,
1911
+ p,
1912
+ d,
1913
+ r
1868
1914
  ]);
1869
1915
  if (o)
1870
- return /* @__PURE__ */ m(
1871
- Re,
1916
+ return /* @__PURE__ */ h(
1917
+ Me,
1872
1918
  {
1873
- containerClassName: k(
1919
+ containerClassName: B(
1874
1920
  "transition-opacity group-hover:opacity-100 shrink w-full",
1875
- r?.dropdownContainerClassName
1921
+ a?.dropdownContainerClassName
1876
1922
  ),
1877
- triggerButton: h,
1878
- content: u,
1923
+ triggerButton: E,
1924
+ content: g,
1879
1925
  openedClassName: "action-menu-opened"
1880
1926
  }
1881
1927
  );
1882
1928
  };
1883
1929
  export {
1884
- Tt as ActionMenu,
1885
- U as ActionMenuItem,
1886
- Zt as ConversationList,
1887
- Jt as User,
1888
- nt as getSharedConversationsGroup,
1889
- ue as transformSharedConversations
1930
+ Bt as ActionMenu,
1931
+ _ as ActionMenuItem,
1932
+ en as ConversationList,
1933
+ tn as User,
1934
+ st as getSharedConversationsGroup,
1935
+ fe as transformSharedConversations
1890
1936
  };