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