@paramms/chat-widget 1.0.32 → 1.0.34
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/README.md +2 -2
- package/dist/chatlist.d.ts +13 -1
- package/dist/chatlist.js +64 -58
- package/dist/chatlist.js.map +1 -1
- package/dist/core.js +27 -26
- package/dist/core.js.map +1 -1
- package/dist/e2e.js +109 -1485
- package/dist/e2e.js.map +1 -1
- package/dist/embed.js +14 -3
- package/dist/embed.js.map +1 -1
- package/dist/hooks.d.ts +11 -1
- package/dist/hooks.js +58 -48
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +634 -502
- package/dist/index.js.map +1 -1
- package/dist/outbox.js +1383 -0
- package/dist/outbox.js.map +1 -0
- package/dist/protocol/frames.d.ts +10 -0
- package/dist/react.d.ts +35 -8
- package/dist/react.js +297 -252
- package/dist/react.js.map +1 -1
- package/dist/renderer.d.ts +24 -0
- package/dist/store.d.ts +1 -0
- package/package.json +4 -3
package/dist/react.js
CHANGED
|
@@ -1,314 +1,352 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { mount as
|
|
4
|
-
function
|
|
5
|
-
url:
|
|
6
|
-
apiUrl:
|
|
7
|
-
profileId:
|
|
8
|
-
token:
|
|
9
|
-
refreshToken:
|
|
10
|
-
userId:
|
|
1
|
+
import { jsxs as L, jsx as u, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { useState as D, useRef as $, useEffect as _ } from "react";
|
|
3
|
+
import { mount as W } from "./index.js";
|
|
4
|
+
function J({
|
|
5
|
+
url: a,
|
|
6
|
+
apiUrl: n,
|
|
7
|
+
profileId: r,
|
|
8
|
+
token: t,
|
|
9
|
+
refreshToken: l,
|
|
10
|
+
userId: o,
|
|
11
11
|
userName: c,
|
|
12
|
-
userEmail:
|
|
13
|
-
userAvatar:
|
|
14
|
-
contextTitle:
|
|
15
|
-
contextSubtitle:
|
|
12
|
+
userEmail: p,
|
|
13
|
+
userAvatar: b,
|
|
14
|
+
contextTitle: m,
|
|
15
|
+
contextSubtitle: x,
|
|
16
16
|
contextStatus: C,
|
|
17
|
-
subjectId:
|
|
18
|
-
accent:
|
|
19
|
-
launcher:
|
|
20
|
-
position:
|
|
21
|
-
quickReplies:
|
|
22
|
-
height:
|
|
23
|
-
i18n:
|
|
24
|
-
translateLang:
|
|
17
|
+
subjectId: M,
|
|
18
|
+
accent: j,
|
|
19
|
+
launcher: e,
|
|
20
|
+
position: y,
|
|
21
|
+
quickReplies: d,
|
|
22
|
+
height: v = "100%",
|
|
23
|
+
i18n: f,
|
|
24
|
+
translateLang: g
|
|
25
25
|
}) {
|
|
26
|
-
const
|
|
26
|
+
const w = $(null), h = $(null);
|
|
27
27
|
return _(() => {
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
return (
|
|
31
|
-
el:
|
|
32
|
-
url:
|
|
33
|
-
...
|
|
34
|
-
profileId:
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
28
|
+
var i;
|
|
29
|
+
if (w.current)
|
|
30
|
+
return (i = h.current) == null || i.close(), h.current = W({
|
|
31
|
+
el: w.current,
|
|
32
|
+
url: a,
|
|
33
|
+
...n ? { apiUrl: n } : {},
|
|
34
|
+
profileId: r,
|
|
35
|
+
...M ? { subjectId: M } : {},
|
|
36
|
+
...t ? { token: t } : {},
|
|
37
|
+
...l ? { refreshToken: l } : {},
|
|
38
|
+
...o ? { userId: o } : {},
|
|
39
|
+
...o || c || p || b ? {
|
|
40
40
|
user: {
|
|
41
41
|
...c ? { name: c } : {},
|
|
42
|
-
...
|
|
43
|
-
...
|
|
42
|
+
...p ? { email: p } : {},
|
|
43
|
+
...b ? { avatar: b } : {}
|
|
44
44
|
}
|
|
45
45
|
} : {},
|
|
46
|
-
...
|
|
46
|
+
...m ? {
|
|
47
47
|
subject: {
|
|
48
|
-
title:
|
|
49
|
-
...
|
|
48
|
+
title: m,
|
|
49
|
+
...x ? { subtitle: x } : {},
|
|
50
50
|
...C ? { status: C } : {}
|
|
51
51
|
}
|
|
52
52
|
} : {},
|
|
53
|
-
...
|
|
54
|
-
...
|
|
55
|
-
...
|
|
56
|
-
...
|
|
57
|
-
...
|
|
53
|
+
...d ? { quickReplies: d } : {},
|
|
54
|
+
...j ? { accent: j } : {},
|
|
55
|
+
...g ? { translateLang: g } : {},
|
|
56
|
+
...f ? { i18n: f } : {},
|
|
57
|
+
...e ? { launcher: e, position: y ?? "bottom-right" } : {}
|
|
58
58
|
}), () => {
|
|
59
|
-
var
|
|
60
|
-
(
|
|
59
|
+
var s;
|
|
60
|
+
(s = h.current) == null || s.close(), h.current = null;
|
|
61
61
|
};
|
|
62
|
-
}, [
|
|
62
|
+
}, [a, n, r, M, t, o, c, p, j, e, y, g]), /* @__PURE__ */ u(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
ref:
|
|
66
|
-
style:
|
|
65
|
+
ref: w,
|
|
66
|
+
style: e ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: v, minHeight: v === "100%" ? "480px" : void 0 }
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const Y = [
|
|
71
71
|
"Is this still available?",
|
|
72
72
|
"Can I schedule a viewing?",
|
|
73
73
|
"What is your best price?"
|
|
74
74
|
];
|
|
75
|
-
function
|
|
76
|
-
url:
|
|
77
|
-
apiUrl:
|
|
78
|
-
profileId:
|
|
79
|
-
token:
|
|
80
|
-
refreshToken:
|
|
81
|
-
listingId:
|
|
75
|
+
function P({
|
|
76
|
+
url: a,
|
|
77
|
+
apiUrl: n,
|
|
78
|
+
profileId: r,
|
|
79
|
+
token: t,
|
|
80
|
+
refreshToken: l,
|
|
81
|
+
listingId: o,
|
|
82
82
|
listingTitle: c,
|
|
83
|
-
listingMeta:
|
|
84
|
-
listingPrice:
|
|
85
|
-
listingStatus:
|
|
86
|
-
userId:
|
|
83
|
+
listingMeta: p,
|
|
84
|
+
listingPrice: b,
|
|
85
|
+
listingStatus: m,
|
|
86
|
+
userId: x,
|
|
87
87
|
userName: C,
|
|
88
|
-
userEmail:
|
|
89
|
-
userAvatar:
|
|
90
|
-
accent:
|
|
91
|
-
launcher:
|
|
92
|
-
position:
|
|
93
|
-
quickReplies:
|
|
94
|
-
height:
|
|
95
|
-
i18n:
|
|
96
|
-
translateLang:
|
|
88
|
+
userEmail: M,
|
|
89
|
+
userAvatar: j,
|
|
90
|
+
accent: e,
|
|
91
|
+
launcher: y,
|
|
92
|
+
position: d,
|
|
93
|
+
quickReplies: v,
|
|
94
|
+
height: f = "100%",
|
|
95
|
+
i18n: g,
|
|
96
|
+
translateLang: w
|
|
97
97
|
}) {
|
|
98
|
-
const
|
|
98
|
+
const h = $(null), i = $(null);
|
|
99
99
|
return _(() => {
|
|
100
|
-
if (!
|
|
101
|
-
let
|
|
102
|
-
const
|
|
100
|
+
if (!h.current) return;
|
|
101
|
+
let s = !1;
|
|
102
|
+
const R = setTimeout(() => {
|
|
103
103
|
var z;
|
|
104
|
-
|
|
105
|
-
el:
|
|
106
|
-
url:
|
|
107
|
-
...
|
|
108
|
-
profileId:
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
...
|
|
112
|
-
...
|
|
113
|
-
...
|
|
104
|
+
s || !h.current || ((z = i.current) == null || z.close(), i.current = W({
|
|
105
|
+
el: h.current,
|
|
106
|
+
url: a,
|
|
107
|
+
...n ? { apiUrl: n } : {},
|
|
108
|
+
profileId: r,
|
|
109
|
+
...o ? { subjectId: `listing_${o}` } : {},
|
|
110
|
+
...t ? { token: t } : {},
|
|
111
|
+
...l ? { refreshToken: l } : {},
|
|
112
|
+
...x ? { userId: x } : {},
|
|
113
|
+
...x || C || M || j ? {
|
|
114
114
|
user: {
|
|
115
115
|
...C ? { name: C } : {},
|
|
116
|
-
...
|
|
117
|
-
...
|
|
118
|
-
...
|
|
116
|
+
...M ? { email: M } : {},
|
|
117
|
+
...j ? { avatar: j } : {},
|
|
118
|
+
...o ? { meta: { listingId: o } } : {}
|
|
119
119
|
}
|
|
120
120
|
} : {},
|
|
121
121
|
...c ? {
|
|
122
122
|
subject: {
|
|
123
123
|
title: c,
|
|
124
|
-
...
|
|
125
|
-
...
|
|
126
|
-
...
|
|
124
|
+
...p ? { subtitle: p } : {},
|
|
125
|
+
...b ? { tags: [`$${b.toLocaleString()}`] } : {},
|
|
126
|
+
...m ? { status: m } : {}
|
|
127
127
|
}
|
|
128
128
|
} : {},
|
|
129
|
-
quickReplies:
|
|
130
|
-
...
|
|
131
|
-
...
|
|
132
|
-
...
|
|
133
|
-
...
|
|
129
|
+
quickReplies: v ?? Y,
|
|
130
|
+
...e ? { accent: e } : {},
|
|
131
|
+
...w ? { translateLang: w } : {},
|
|
132
|
+
...g ? { i18n: g } : {},
|
|
133
|
+
...y ? { launcher: y, position: d ?? "bottom-right" } : {}
|
|
134
134
|
}));
|
|
135
135
|
}, 0);
|
|
136
136
|
return () => {
|
|
137
137
|
var z;
|
|
138
|
-
|
|
138
|
+
s = !0, clearTimeout(R), (z = i.current) == null || z.close(), i.current = null;
|
|
139
139
|
};
|
|
140
|
-
}, [
|
|
140
|
+
}, [a, n, r, o, t, x, e, y, d, w]), /* @__PURE__ */ u(
|
|
141
141
|
"div",
|
|
142
142
|
{
|
|
143
|
-
ref:
|
|
144
|
-
style:
|
|
143
|
+
ref: h,
|
|
144
|
+
style: y ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: f, minHeight: f === "100%" ? "480px" : void 0 }
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
+
function B(a) {
|
|
149
|
+
const [n, r] = D(
|
|
150
|
+
typeof window < "u" && window.innerWidth <= a
|
|
151
|
+
);
|
|
152
|
+
return _(() => {
|
|
153
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
154
|
+
const t = window.matchMedia(`(max-width: ${a}px)`), l = (o) => r(o.matches);
|
|
155
|
+
return r(t.matches), t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
156
|
+
}, [a]), n;
|
|
157
|
+
}
|
|
148
158
|
function A({
|
|
149
|
-
url:
|
|
150
|
-
apiUrl:
|
|
151
|
-
profileId:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
url: a,
|
|
160
|
+
apiUrl: n,
|
|
161
|
+
profileId: r,
|
|
162
|
+
tenantId: t,
|
|
163
|
+
token: l,
|
|
164
|
+
refreshToken: o,
|
|
165
|
+
userId: c,
|
|
166
|
+
userName: p,
|
|
167
|
+
userEmail: b,
|
|
168
|
+
accent: m,
|
|
158
169
|
height: x = "100%",
|
|
159
|
-
i18n:
|
|
160
|
-
scope:
|
|
170
|
+
i18n: C,
|
|
171
|
+
scope: M = "tenant"
|
|
161
172
|
}) {
|
|
162
|
-
const
|
|
173
|
+
const j = !r && !t, [e, y] = D(null), d = $(null), v = $(null), f = $(null), g = $(null);
|
|
163
174
|
_(() => {
|
|
164
|
-
if (!
|
|
165
|
-
let
|
|
166
|
-
return import("./chatlist.js").then(({ mountChatList:
|
|
167
|
-
|
|
168
|
-
el:
|
|
169
|
-
url:
|
|
170
|
-
...
|
|
171
|
-
profileId:
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
if (!d.current) return;
|
|
176
|
+
let h = !1;
|
|
177
|
+
return import("./chatlist.js").then(({ mountChatList: i }) => {
|
|
178
|
+
h || !d.current || (f.current = i({
|
|
179
|
+
el: d.current,
|
|
180
|
+
url: a,
|
|
181
|
+
...n ? { apiUrl: n } : {},
|
|
182
|
+
...r ? { profileId: r } : {},
|
|
183
|
+
...t ? { tenantId: t } : {},
|
|
184
|
+
scope: M,
|
|
185
|
+
onSelect: (s) => y(s),
|
|
174
186
|
// Compose (✎) opens the chatroom's general support thread — without
|
|
175
187
|
// this a user with no conversations yet had an empty list and no way
|
|
176
188
|
// to ever start one, which is what made ChatApp feel broken.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
189
|
+
// Compose target: the configured chatroom, else the tenant's default
|
|
190
|
+
// (oldest chatroom, reported by the server on the first list fetch).
|
|
191
|
+
onNewChat: () => {
|
|
192
|
+
var R;
|
|
193
|
+
const s = (R = f.current) == null ? void 0 : R.defaultProfileId();
|
|
194
|
+
s && y({ id: "__new__", profileId: s, state: "open", updatedAt: Date.now() });
|
|
195
|
+
},
|
|
196
|
+
...l ? { token: l } : {},
|
|
197
|
+
...c ? { userId: c } : {},
|
|
198
|
+
...m ? { accent: m } : {},
|
|
199
|
+
...C ? { i18n: C } : {}
|
|
182
200
|
}));
|
|
183
201
|
}), () => {
|
|
184
|
-
var
|
|
185
|
-
|
|
202
|
+
var i;
|
|
203
|
+
h = !0, (i = f.current) == null || i.close(), f.current = null;
|
|
186
204
|
};
|
|
187
|
-
}, [
|
|
188
|
-
var
|
|
189
|
-
if (!
|
|
190
|
-
(
|
|
191
|
-
el:
|
|
192
|
-
url:
|
|
193
|
-
...
|
|
194
|
-
profileId:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
...e
|
|
205
|
+
}, [a, n, r, t, l, c, M]), _(() => {
|
|
206
|
+
var i;
|
|
207
|
+
if (!v.current || !e) return;
|
|
208
|
+
(i = g.current) == null || i.close(), g.current = W({
|
|
209
|
+
el: v.current,
|
|
210
|
+
url: a,
|
|
211
|
+
...n ? { apiUrl: n } : {},
|
|
212
|
+
profileId: e.profileId ?? r,
|
|
213
|
+
// rows always carry theirs; compose sets one explicitly
|
|
214
|
+
// DM rows open as direct conversations (kind + peer). Opening them via
|
|
215
|
+
// their dm:… subjectId only works for the participant that OWNS the
|
|
216
|
+
// thread key — the other side would silently fork a duplicate.
|
|
217
|
+
...e.kind === "direct" && e.peerId ? { kind: "direct", peerId: e.peerId } : e.subjectId ? { subjectId: e.subjectId } : {},
|
|
218
|
+
...l ? { token: l } : {},
|
|
219
|
+
...o ? { refreshToken: o } : {},
|
|
220
|
+
...c ? { userId: c } : {},
|
|
221
|
+
...c || p || b ? {
|
|
200
222
|
user: {
|
|
201
|
-
...
|
|
202
|
-
...
|
|
223
|
+
...p ? { name: p } : {},
|
|
224
|
+
...b ? { email: b } : {}
|
|
203
225
|
}
|
|
204
226
|
} : {},
|
|
205
|
-
...
|
|
227
|
+
...e.subjectTitle ? {
|
|
206
228
|
subject: {
|
|
207
|
-
title:
|
|
208
|
-
...
|
|
229
|
+
title: e.subjectTitle,
|
|
230
|
+
...e.subjectMeta ? { subtitle: e.subjectMeta } : {}
|
|
209
231
|
}
|
|
210
232
|
} : {},
|
|
211
|
-
...
|
|
233
|
+
...m ? { accent: m } : {}
|
|
212
234
|
});
|
|
213
|
-
const
|
|
214
|
-
var
|
|
215
|
-
return (
|
|
235
|
+
const h = setInterval(() => {
|
|
236
|
+
var s;
|
|
237
|
+
return (s = f.current) == null ? void 0 : s.refresh();
|
|
216
238
|
}, 2e4);
|
|
217
239
|
return () => {
|
|
218
|
-
var
|
|
219
|
-
clearInterval(
|
|
240
|
+
var s, R;
|
|
241
|
+
clearInterval(h), (s = g.current) == null || s.close(), g.current = null, (R = f.current) == null || R.refresh();
|
|
220
242
|
};
|
|
221
|
-
}, [
|
|
222
|
-
const
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
243
|
+
}, [e == null ? void 0 : e.id]);
|
|
244
|
+
const w = B(767);
|
|
245
|
+
return j ? /* @__PURE__ */ L("div", { style: { padding: 16, font: "13px system-ui", color: "#b91c1c", background: "#fef2f2", borderRadius: 8 }, children: [
|
|
246
|
+
"[relay] <ChatApp/> needs a ",
|
|
247
|
+
/* @__PURE__ */ u("code", { children: "profileId" }),
|
|
248
|
+
" or a ",
|
|
249
|
+
/* @__PURE__ */ u("code", { children: "tenantId" }),
|
|
250
|
+
"."
|
|
251
|
+
] }) : /* @__PURE__ */ L("div", { style: { display: "flex", width: "100%", height: x, minHeight: "400px", overflow: "hidden" }, children: [
|
|
252
|
+
/* @__PURE__ */ u("div", { style: {
|
|
253
|
+
width: w ? "100%" : "360px",
|
|
254
|
+
flex: w && e ? "none" : void 0,
|
|
255
|
+
display: w && e ? "none" : "flex",
|
|
228
256
|
flexDirection: "column",
|
|
229
|
-
borderRight:
|
|
257
|
+
borderRight: w ? "none" : "1px solid #e8eaed",
|
|
230
258
|
minWidth: 0
|
|
231
|
-
}, children: /* @__PURE__ */
|
|
232
|
-
|
|
233
|
-
|
|
259
|
+
}, children: /* @__PURE__ */ u("div", { ref: d, style: { width: "100%", height: "100%" } }) }),
|
|
260
|
+
e ? /* @__PURE__ */ L("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
261
|
+
w && /* @__PURE__ */ u(
|
|
234
262
|
"button",
|
|
235
263
|
{
|
|
236
|
-
onClick: () =>
|
|
264
|
+
onClick: () => y(null),
|
|
237
265
|
style: { position: "absolute", top: 12, left: 12, zIndex: 10, background: "none", border: "none", fontSize: 22, cursor: "pointer", color: "#1c1b1a" },
|
|
238
266
|
children: "←"
|
|
239
267
|
}
|
|
240
268
|
),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
] }) : /* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ u("div", { ref: v, style: { width: "100%", height: "100%" } })
|
|
270
|
+
] }) : /* @__PURE__ */ u("div", { style: { flex: 1, display: w ? "none" : "flex", alignItems: "center", justifyContent: "center", color: "#9b9690", fontSize: 14 }, children: "Select a conversation" })
|
|
243
271
|
] });
|
|
244
272
|
}
|
|
245
|
-
function
|
|
246
|
-
url:
|
|
247
|
-
apiUrl:
|
|
248
|
-
profileId:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
273
|
+
function Q({
|
|
274
|
+
url: a,
|
|
275
|
+
apiUrl: n,
|
|
276
|
+
profileId: r,
|
|
277
|
+
tenantId: t,
|
|
278
|
+
token: l,
|
|
279
|
+
refreshToken: o,
|
|
280
|
+
userId: c,
|
|
281
|
+
userName: p,
|
|
282
|
+
userEmail: b,
|
|
283
|
+
scope: m,
|
|
255
284
|
accent: x = "#4F63F5",
|
|
256
|
-
floating:
|
|
257
|
-
position:
|
|
258
|
-
label:
|
|
259
|
-
panelWidth:
|
|
260
|
-
panelHeight:
|
|
285
|
+
floating: C = !0,
|
|
286
|
+
position: M = "bottom-right",
|
|
287
|
+
label: j,
|
|
288
|
+
panelWidth: e,
|
|
289
|
+
panelHeight: y = "600px"
|
|
261
290
|
}) {
|
|
262
|
-
const [
|
|
291
|
+
const [d, v] = D(!1), f = $(null), g = M === "bottom-right", h = j ?? (C ? "💬" : "Messages"), i = B(479);
|
|
263
292
|
if (_(() => {
|
|
264
|
-
const S = (
|
|
265
|
-
|
|
293
|
+
const S = (O) => {
|
|
294
|
+
O.key === "Escape" && v(!1);
|
|
266
295
|
};
|
|
267
296
|
return document.addEventListener("keydown", S), () => document.removeEventListener("keydown", S);
|
|
268
|
-
}, []),
|
|
269
|
-
|
|
270
|
-
return /* @__PURE__ */ M("div", { style: {
|
|
297
|
+
}, []), C)
|
|
298
|
+
return /* @__PURE__ */ L("div", { style: {
|
|
271
299
|
position: "fixed",
|
|
272
|
-
[
|
|
300
|
+
[g ? "right" : "left"]: "20px",
|
|
273
301
|
bottom: "20px",
|
|
274
302
|
zIndex: 9999,
|
|
275
303
|
display: "flex",
|
|
276
304
|
flexDirection: "column",
|
|
277
|
-
alignItems:
|
|
305
|
+
alignItems: g ? "flex-end" : "flex-start",
|
|
278
306
|
gap: "12px"
|
|
279
307
|
}, children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
308
|
+
/* @__PURE__ */ u("div", { style: {
|
|
309
|
+
...i ? {
|
|
310
|
+
position: "fixed",
|
|
311
|
+
inset: 0,
|
|
312
|
+
width: "100%",
|
|
313
|
+
height: "100dvh",
|
|
314
|
+
borderRadius: "0",
|
|
315
|
+
zIndex: 9998
|
|
316
|
+
} : {
|
|
317
|
+
width: `min(${e ?? "420px"}, calc(100vw - 40px))`,
|
|
318
|
+
height: `min(${y}, calc(100dvh - 108px))`,
|
|
319
|
+
borderRadius: "16px"
|
|
320
|
+
},
|
|
284
321
|
overflow: "hidden",
|
|
285
|
-
boxShadow: "0 8px 40px rgba(0,0,0,.18)",
|
|
322
|
+
boxShadow: i ? "none" : "0 8px 40px rgba(0,0,0,.18)",
|
|
286
323
|
background: "#fff",
|
|
287
|
-
display:
|
|
324
|
+
display: d ? "flex" : "none",
|
|
288
325
|
flexDirection: "column",
|
|
289
|
-
transformOrigin: `bottom ${
|
|
290
|
-
animation:
|
|
291
|
-
}, children: /* @__PURE__ */
|
|
326
|
+
transformOrigin: `bottom ${g ? "right" : "left"}`,
|
|
327
|
+
animation: d ? "ocl-pop-in .18s ease" : "none"
|
|
328
|
+
}, children: /* @__PURE__ */ u(
|
|
292
329
|
A,
|
|
293
330
|
{
|
|
294
|
-
url:
|
|
295
|
-
...
|
|
296
|
-
profileId:
|
|
297
|
-
...
|
|
298
|
-
...
|
|
299
|
-
...
|
|
300
|
-
...c ? {
|
|
301
|
-
...
|
|
302
|
-
...
|
|
331
|
+
url: a,
|
|
332
|
+
...n ? { apiUrl: n } : {},
|
|
333
|
+
...r ? { profileId: r } : {},
|
|
334
|
+
...t ? { tenantId: t } : {},
|
|
335
|
+
...l ? { token: l } : {},
|
|
336
|
+
...o ? { refreshToken: o } : {},
|
|
337
|
+
...c ? { userId: c } : {},
|
|
338
|
+
...p ? { userName: p } : {},
|
|
339
|
+
...b ? { userEmail: b } : {},
|
|
340
|
+
...m ? { scope: m } : {},
|
|
303
341
|
accent: x,
|
|
304
342
|
height: "100%"
|
|
305
343
|
}
|
|
306
344
|
) }),
|
|
307
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ u(
|
|
308
346
|
"button",
|
|
309
347
|
{
|
|
310
|
-
ref:
|
|
311
|
-
onClick: () =>
|
|
348
|
+
ref: f,
|
|
349
|
+
onClick: () => v((S) => !S),
|
|
312
350
|
style: {
|
|
313
351
|
width: "56px",
|
|
314
352
|
height: "56px",
|
|
@@ -322,35 +360,34 @@ function J({
|
|
|
322
360
|
boxShadow: "0 4px 16px rgba(0,0,0,.25)",
|
|
323
361
|
transition: "transform .15s"
|
|
324
362
|
},
|
|
325
|
-
onMouseEnter: (
|
|
326
|
-
|
|
363
|
+
onMouseEnter: (S) => {
|
|
364
|
+
S.target.style.transform = "scale(1.08)";
|
|
327
365
|
},
|
|
328
|
-
onMouseLeave: (
|
|
329
|
-
|
|
366
|
+
onMouseLeave: (S) => {
|
|
367
|
+
S.target.style.transform = "scale(1)";
|
|
330
368
|
},
|
|
331
|
-
children:
|
|
369
|
+
children: d ? "✕" : h
|
|
332
370
|
}
|
|
333
371
|
),
|
|
334
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ u("style", { children: "@keyframes ocl-pop-in { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }" })
|
|
335
373
|
] });
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
/* @__PURE__ */ M(
|
|
374
|
+
const s = `min(${e ?? "420px"}, calc(100vw - 16px))`, [R, z] = D(null), H = () => {
|
|
375
|
+
!d && f.current && z(f.current.getBoundingClientRect()), v((S) => !S);
|
|
376
|
+
}, k = R ? R.bottom + 8 : 0, E = R ? Math.max(8, window.innerWidth - R.right) : 0;
|
|
377
|
+
return /* @__PURE__ */ L(F, { children: [
|
|
378
|
+
/* @__PURE__ */ L(
|
|
342
379
|
"button",
|
|
343
380
|
{
|
|
344
|
-
ref:
|
|
345
|
-
onClick:
|
|
381
|
+
ref: f,
|
|
382
|
+
onClick: H,
|
|
346
383
|
style: {
|
|
347
384
|
display: "inline-flex",
|
|
348
385
|
alignItems: "center",
|
|
349
386
|
gap: "6px",
|
|
350
387
|
padding: "8px 16px",
|
|
351
388
|
borderRadius: "8px",
|
|
352
|
-
background:
|
|
353
|
-
color:
|
|
389
|
+
background: d ? x : "transparent",
|
|
390
|
+
color: d ? "#fff" : x,
|
|
354
391
|
border: `2px solid ${x}`,
|
|
355
392
|
fontSize: "14px",
|
|
356
393
|
fontWeight: 600,
|
|
@@ -359,54 +396,62 @@ function J({
|
|
|
359
396
|
},
|
|
360
397
|
children: [
|
|
361
398
|
"💬 ",
|
|
362
|
-
|
|
399
|
+
h
|
|
363
400
|
]
|
|
364
401
|
}
|
|
365
402
|
),
|
|
366
|
-
|
|
367
|
-
/* @__PURE__ */
|
|
403
|
+
d && R && /* @__PURE__ */ L(F, { children: [
|
|
404
|
+
/* @__PURE__ */ u(
|
|
368
405
|
"div",
|
|
369
406
|
{
|
|
370
|
-
onClick: () =>
|
|
407
|
+
onClick: () => v(!1),
|
|
371
408
|
style: { position: "fixed", inset: 0, zIndex: 9998 }
|
|
372
409
|
}
|
|
373
410
|
),
|
|
374
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ u("div", { style: {
|
|
375
412
|
position: "fixed",
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
413
|
+
...i ? {
|
|
414
|
+
inset: 0,
|
|
415
|
+
width: "100%",
|
|
416
|
+
height: "100dvh",
|
|
417
|
+
borderRadius: "0"
|
|
418
|
+
} : {
|
|
419
|
+
top: k,
|
|
420
|
+
right: E,
|
|
421
|
+
width: s,
|
|
422
|
+
height: `min(${y}, calc(100dvh - ${k}px - 12px))`,
|
|
423
|
+
borderRadius: "16px"
|
|
424
|
+
},
|
|
381
425
|
overflow: "hidden",
|
|
382
|
-
boxShadow: "0 8px 40px rgba(0,0,0,.2)",
|
|
426
|
+
boxShadow: i ? "none" : "0 8px 40px rgba(0,0,0,.2)",
|
|
383
427
|
background: "#fff",
|
|
384
428
|
zIndex: 9999,
|
|
385
429
|
animation: "ocl-slide-in .18s ease"
|
|
386
|
-
}, children: /* @__PURE__ */
|
|
430
|
+
}, children: /* @__PURE__ */ u(
|
|
387
431
|
A,
|
|
388
432
|
{
|
|
389
|
-
url:
|
|
390
|
-
...
|
|
391
|
-
profileId:
|
|
392
|
-
...
|
|
393
|
-
...
|
|
394
|
-
...
|
|
395
|
-
...c ? {
|
|
396
|
-
...
|
|
397
|
-
...
|
|
433
|
+
url: a,
|
|
434
|
+
...n ? { apiUrl: n } : {},
|
|
435
|
+
...r ? { profileId: r } : {},
|
|
436
|
+
...t ? { tenantId: t } : {},
|
|
437
|
+
...l ? { token: l } : {},
|
|
438
|
+
...o ? { refreshToken: o } : {},
|
|
439
|
+
...c ? { userId: c } : {},
|
|
440
|
+
...p ? { userName: p } : {},
|
|
441
|
+
...b ? { userEmail: b } : {},
|
|
442
|
+
...m ? { scope: m } : {},
|
|
398
443
|
accent: x,
|
|
399
444
|
height: "100%"
|
|
400
445
|
}
|
|
401
446
|
) }),
|
|
402
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ u("style", { children: "@keyframes ocl-slide-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }" })
|
|
403
448
|
] })
|
|
404
449
|
] });
|
|
405
450
|
}
|
|
406
451
|
export {
|
|
407
452
|
A as ChatApp,
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
453
|
+
Q as ChatAppLauncher,
|
|
454
|
+
J as ChatWidget,
|
|
455
|
+
P as MarketplaceChat
|
|
411
456
|
};
|
|
412
457
|
//# sourceMappingURL=react.js.map
|