@paramms/chat-widget 1.0.44 → 1.0.45

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/dist/react.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsxs as _, jsx as e, Fragment as O } from "react/jsx-runtime";
2
- import { useState as k, useRef as B, useEffect as D } from "react";
3
- import { mount as H } from "./index.js";
4
- function G({ size: o = 26 }) {
1
+ import { jsxs as D, jsx as e, Fragment as Y } from "react/jsx-runtime";
2
+ import { useState as _, useRef as B, useEffect as W } from "react";
3
+ import { mount as G } from "./index.js";
4
+ function q({ size: o = 26 }) {
5
5
  return /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: o, height: o, fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ e(
6
6
  "path",
7
7
  {
@@ -14,10 +14,10 @@ function G({ size: o = 26 }) {
14
14
  }
15
15
  ) });
16
16
  }
17
- function Y({ size: o = 22 }) {
17
+ function K({ size: o = 22 }) {
18
18
  return /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: o, height: o, fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M18 6 6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) });
19
19
  }
20
- function Q({
20
+ function Z({
21
21
  url: o,
22
22
  apiUrl: r,
23
23
  profileId: s,
@@ -25,62 +25,68 @@ function Q({
25
25
  refreshToken: i,
26
26
  userId: l,
27
27
  userName: d,
28
- userEmail: u,
28
+ userEmail: p,
29
29
  userAvatar: v,
30
30
  contextTitle: m,
31
- contextSubtitle: p,
32
- contextStatus: h,
33
- subjectId: C,
34
- accent: R,
35
- launcher: b,
36
- position: t,
37
- launcherMessage: f,
38
- quickReplies: j,
39
- height: M = "100%",
40
- i18n: L,
41
- translateLang: S,
42
- inbox: a,
43
- inboxScope: $
31
+ contextSubtitle: u,
32
+ contextStatus: S,
33
+ subjectId: f,
34
+ accent: w,
35
+ accent2: R,
36
+ theme: z,
37
+ launcher: t,
38
+ position: h,
39
+ launcherMessage: M,
40
+ quickReplies: $,
41
+ height: j = "100%",
42
+ i18n: g,
43
+ features: L,
44
+ translateLang: b,
45
+ inbox: C,
46
+ inboxScope: x
44
47
  }) {
45
- const w = B(null), c = B(null), [x, g] = k(!1);
46
- return D(() => {
47
- var z;
48
- if (!x && w.current)
49
- return (z = c.current) == null || z.close(), c.current = H({
50
- el: w.current,
48
+ const y = B(null), a = B(null), [c, k] = _(!1);
49
+ return W(() => {
50
+ var A;
51
+ if (!c && y.current)
52
+ return (A = a.current) == null || A.close(), a.current = G({
53
+ el: y.current,
51
54
  url: o,
52
55
  ...r ? { apiUrl: r } : {},
53
56
  profileId: s,
54
- ...C ? { subjectId: C } : {},
57
+ ...f ? { subjectId: f } : {},
55
58
  ...n ? { token: n } : {},
56
59
  ...i ? { refreshToken: i } : {},
57
60
  ...l ? { userId: l } : {},
58
- ...l || d || u || v ? {
61
+ ...l || d || p || v ? {
59
62
  user: {
60
63
  ...d ? { name: d } : {},
61
- ...u ? { email: u } : {},
64
+ ...p ? { email: p } : {},
62
65
  ...v ? { avatar: v } : {}
63
66
  }
64
67
  } : {},
65
68
  ...m ? {
66
69
  subject: {
67
70
  title: m,
68
- ...p ? { subtitle: p } : {},
69
- ...h ? { status: h } : {}
71
+ ...u ? { subtitle: u } : {},
72
+ ...S ? { status: S } : {}
70
73
  }
71
74
  } : {},
72
- ...j ? { quickReplies: j } : {},
73
- ...R ? { accent: R } : {},
74
- ...S ? { translateLang: S } : {},
75
- ...L ? { i18n: L } : {},
76
- ...a && !b ? { onBack: () => g(!0) } : {},
77
- ...b ? { launcher: b, position: t ?? "bottom-right", ...f ? { launcherMessage: f } : {} } : {}
75
+ ...$ ? { quickReplies: $ } : {},
76
+ ...w ? { accent: w } : {},
77
+ ...R ? { accent2: R } : {},
78
+ ...z ? { theme: z } : {},
79
+ ...b ? { translateLang: b } : {},
80
+ ...g ? { i18n: g } : {},
81
+ ...L ? { features: L } : {},
82
+ ...C && !t ? { onBack: () => k(!0) } : {},
83
+ ...t ? { launcher: t, position: h ?? "bottom-right", ...M ? { launcherMessage: M } : {} } : {}
78
84
  }), () => {
79
- var y;
80
- (y = c.current) == null || y.close(), c.current = null;
85
+ var H;
86
+ (H = a.current) == null || H.close(), a.current = null;
81
87
  };
82
- }, [o, r, s, C, n, l, d, u, R, b, t, f, S, a, x]), a && !b && x ? /* @__PURE__ */ e(
83
- A,
88
+ }, [o, r, s, f, n, l, d, p, w, t, h, M, b, C, c]), C && !t && c ? /* @__PURE__ */ e(
89
+ F,
84
90
  {
85
91
  url: o,
86
92
  ...r ? { apiUrl: r } : {},
@@ -89,26 +95,26 @@ function Q({
89
95
  ...i ? { refreshToken: i } : {},
90
96
  ...l ? { userId: l } : {},
91
97
  ...d ? { userName: d } : {},
92
- ...u ? { userEmail: u } : {},
93
- ...R ? { accent: R } : {},
94
- scope: $ ?? "tenant",
95
- height: M,
96
- onClose: () => g(!1)
98
+ ...p ? { userEmail: p } : {},
99
+ ...w ? { accent: w } : {},
100
+ scope: x ?? "tenant",
101
+ height: j,
102
+ onClose: () => k(!1)
97
103
  }
98
104
  ) : /* @__PURE__ */ e(
99
105
  "div",
100
106
  {
101
- ref: w,
102
- style: b ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: M, minHeight: M === "100%" ? "480px" : void 0 }
107
+ ref: y,
108
+ style: t ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: j, minHeight: j === "100%" ? "480px" : void 0 }
103
109
  }
104
110
  );
105
111
  }
106
- const q = [
112
+ const J = [
107
113
  "Is this still available?",
108
114
  "Can I schedule a viewing?",
109
115
  "What is your best price?"
110
116
  ];
111
- function V({
117
+ function T({
112
118
  url: o,
113
119
  apiUrl: r,
114
120
  profileId: s,
@@ -116,102 +122,108 @@ function V({
116
122
  refreshToken: i,
117
123
  listingId: l,
118
124
  listingTitle: d,
119
- listingMeta: u,
125
+ listingMeta: p,
120
126
  listingPrice: v,
121
127
  listingStatus: m,
122
- userId: p,
123
- userName: h,
124
- userEmail: C,
125
- userAvatar: R,
126
- accent: b,
127
- launcher: t,
128
- position: f,
129
- launcherMessage: j,
130
- quickReplies: M,
131
- height: L = "100%",
132
- i18n: S,
133
- translateLang: a,
134
- inbox: $,
135
- inboxScope: w
128
+ userId: u,
129
+ userName: S,
130
+ userEmail: f,
131
+ userAvatar: w,
132
+ accent: R,
133
+ accent2: z,
134
+ theme: t,
135
+ launcher: h,
136
+ position: M,
137
+ launcherMessage: $,
138
+ quickReplies: j,
139
+ height: g = "100%",
140
+ i18n: L,
141
+ features: b,
142
+ translateLang: C,
143
+ inbox: x,
144
+ inboxScope: y
136
145
  }) {
137
- const c = B(null), x = B(null), [g, z] = k(!1);
138
- return D(() => {
139
- if (g || !c.current) return;
140
- let y = !1;
141
- const F = setTimeout(() => {
142
- var W;
143
- y || !c.current || ((W = x.current) == null || W.close(), x.current = H({
144
- el: c.current,
146
+ const a = B(null), c = B(null), [k, A] = _(!1);
147
+ return W(() => {
148
+ if (k || !a.current) return;
149
+ let H = !1;
150
+ const E = setTimeout(() => {
151
+ var O;
152
+ H || !a.current || ((O = c.current) == null || O.close(), c.current = G({
153
+ el: a.current,
145
154
  url: o,
146
155
  ...r ? { apiUrl: r } : {},
147
156
  profileId: s,
148
157
  ...l ? { subjectId: `listing_${l}` } : {},
149
158
  ...n ? { token: n } : {},
150
159
  ...i ? { refreshToken: i } : {},
151
- ...p ? { userId: p } : {},
152
- ...p || h || C || R ? {
160
+ ...u ? { userId: u } : {},
161
+ ...u || S || f || w ? {
153
162
  user: {
154
- ...h ? { name: h } : {},
155
- ...C ? { email: C } : {},
156
- ...R ? { avatar: R } : {},
163
+ ...S ? { name: S } : {},
164
+ ...f ? { email: f } : {},
165
+ ...w ? { avatar: w } : {},
157
166
  ...l ? { meta: { listingId: l } } : {}
158
167
  }
159
168
  } : {},
160
169
  ...d ? {
161
170
  subject: {
162
171
  title: d,
163
- ...u ? { subtitle: u } : {},
172
+ ...p ? { subtitle: p } : {},
164
173
  ...v ? { tags: [`$${v.toLocaleString()}`] } : {},
165
174
  ...m ? { status: m } : {}
166
175
  }
167
176
  } : {},
168
- quickReplies: M ?? q,
169
- ...b ? { accent: b } : {},
170
- ...a ? { translateLang: a } : {},
171
- ...S ? { i18n: S } : {},
172
- ...$ && !t ? { onBack: () => z(!0) } : {},
173
- ...t ? { launcher: t, position: f ?? "bottom-right", ...j ? { launcherMessage: j } : {} } : {}
177
+ quickReplies: j ?? J,
178
+ ...R ? { accent: R } : {},
179
+ ...z ? { accent2: z } : {},
180
+ ...t ? { theme: t } : {},
181
+ ...C ? { translateLang: C } : {},
182
+ ...L ? { i18n: L } : {},
183
+ ...b ? { features: b } : {},
184
+ ...x && !h ? { onBack: () => A(!0) } : {},
185
+ ...h ? { launcher: h, position: M ?? "bottom-right", ...$ ? { launcherMessage: $ } : {} } : {}
174
186
  }));
175
187
  }, 0);
176
188
  return () => {
177
- var W;
178
- y = !0, clearTimeout(F), (W = x.current) == null || W.close(), x.current = null;
189
+ var O;
190
+ H = !0, clearTimeout(E), (O = c.current) == null || O.close(), c.current = null;
179
191
  };
180
- }, [o, r, s, l, n, p, b, t, f, j, a, $, g]), $ && !t && g ? /* @__PURE__ */ e(
181
- A,
192
+ }, [o, r, s, l, n, u, R, h, M, $, C, x, k]), x && !h && k ? /* @__PURE__ */ e(
193
+ F,
182
194
  {
183
195
  url: o,
184
196
  ...r ? { apiUrl: r } : {},
185
197
  profileId: s,
186
198
  ...n ? { token: n } : {},
187
199
  ...i ? { refreshToken: i } : {},
188
- ...p ? { userId: p } : {},
189
- ...h ? { userName: h } : {},
190
- ...C ? { userEmail: C } : {},
191
- ...b ? { accent: b } : {},
192
- scope: w ?? "tenant",
193
- height: L,
194
- onClose: () => z(!1)
200
+ ...u ? { userId: u } : {},
201
+ ...S ? { userName: S } : {},
202
+ ...f ? { userEmail: f } : {},
203
+ ...R ? { accent: R } : {},
204
+ scope: y ?? "tenant",
205
+ height: g,
206
+ onClose: () => A(!1)
195
207
  }
196
208
  ) : /* @__PURE__ */ e(
197
209
  "div",
198
210
  {
199
- ref: c,
200
- style: t ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: L, minHeight: L === "100%" ? "480px" : void 0 }
211
+ ref: a,
212
+ style: h ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: g, minHeight: g === "100%" ? "480px" : void 0 }
201
213
  }
202
214
  );
203
215
  }
204
- function K(o) {
205
- const [r, s] = k(
216
+ function P(o) {
217
+ const [r, s] = _(
206
218
  typeof window < "u" && window.innerWidth <= o
207
219
  );
208
- return D(() => {
220
+ return W(() => {
209
221
  if (typeof window > "u" || !window.matchMedia) return;
210
222
  const n = window.matchMedia(`(max-width: ${o}px)`), i = (l) => s(l.matches);
211
223
  return s(n.matches), n.addEventListener("change", i), () => n.removeEventListener("change", i);
212
224
  }, [o]), r;
213
225
  }
214
- function A({
226
+ function F({
215
227
  url: o,
216
228
  apiUrl: r,
217
229
  profileId: s,
@@ -219,56 +231,58 @@ function A({
219
231
  token: i,
220
232
  refreshToken: l,
221
233
  userId: d,
222
- userName: u,
234
+ userName: p,
223
235
  userEmail: v,
224
236
  accent: m,
225
- height: p = "100%",
226
- i18n: h,
227
- onClose: C,
237
+ theme: u,
238
+ height: S = "100%",
239
+ i18n: f,
240
+ onClose: w,
228
241
  scope: R = "tenant"
229
242
  }) {
230
- const b = !s && !n, [t, f] = k(null), [j, M] = k(!1), L = B(null), S = B(null), a = B(null), $ = B(null);
231
- return D(() => {
232
- if (!L.current) return;
233
- let w = !1;
234
- return import("./chatlist.js").catch((c) => (console.error("[relay] could not load the conversation list module.", c), w || M(!0), null)).then((c) => {
235
- if (!c) return;
236
- const { mountChatList: x } = c;
237
- w || !L.current || (a.current = x({
238
- el: L.current,
243
+ const z = !s && !n, [t, h] = _(null), [M, $] = _(!1), j = B(null), g = B(null), L = B(null), b = B(null);
244
+ return W(() => {
245
+ if (!j.current) return;
246
+ let C = !1;
247
+ return import("./chatlist.js").catch((x) => (console.error("[relay] could not load the conversation list module.", x), C || $(!0), null)).then((x) => {
248
+ if (!x) return;
249
+ const { mountChatList: y } = x;
250
+ C || !j.current || (L.current = y({
251
+ el: j.current,
239
252
  url: o,
240
253
  ...r ? { apiUrl: r } : {},
241
254
  ...s ? { profileId: s } : {},
242
255
  ...n ? { tenantId: n } : {},
256
+ ...u ? { theme: u } : {},
243
257
  scope: R,
244
258
  // We overlay a ✕ at top-right when `onClose` is given — tell the list to
245
259
  // keep its header clear so the ✕ doesn't land on the ✎ compose button.
246
- ...C ? { reserveCloseSpace: !0 } : {},
247
- onSelect: (g) => f(g),
260
+ ...w ? { reserveCloseSpace: !0 } : {},
261
+ onSelect: (a) => h(a),
248
262
  // Compose (✎) opens the chatroom's general support thread — without
249
263
  // this a user with no conversations yet had an empty list and no way
250
264
  // to ever start one, which is what made ChatApp feel broken.
251
265
  // Compose target: the configured chatroom, else the tenant's default
252
266
  // (oldest chatroom, reported by the server on the first list fetch).
253
267
  onNewChat: () => {
254
- var z;
255
- const g = (z = a.current) == null ? void 0 : z.defaultProfileId();
256
- g && f({ id: "__new__", profileId: g, state: "open", updatedAt: Date.now() });
268
+ var c;
269
+ const a = (c = L.current) == null ? void 0 : c.defaultProfileId();
270
+ a && h({ id: "__new__", profileId: a, state: "open", updatedAt: Date.now() });
257
271
  },
258
272
  ...i ? { token: i } : {},
259
273
  ...d ? { userId: d } : {},
260
274
  ...m ? { accent: m } : {},
261
- ...h ? { i18n: h } : {}
275
+ ...f ? { i18n: f } : {}
262
276
  }));
263
277
  }), () => {
264
- var c;
265
- w = !0, (c = a.current) == null || c.close(), a.current = null;
278
+ var x;
279
+ C = !0, (x = L.current) == null || x.close(), L.current = null;
266
280
  };
267
- }, [o, r, s, n, i, d, R]), D(() => {
268
- var c;
269
- if (!S.current || !t) return;
270
- (c = $.current) == null || c.close(), $.current = H({
271
- el: S.current,
281
+ }, [o, r, s, n, i, d, R]), W(() => {
282
+ var x;
283
+ if (!g.current || !t) return;
284
+ (x = b.current) == null || x.close(), b.current = G({
285
+ el: g.current,
272
286
  url: o,
273
287
  ...r ? { apiUrl: r } : {},
274
288
  profileId: t.profileId ?? s,
@@ -280,9 +294,9 @@ function A({
280
294
  ...i ? { token: i } : {},
281
295
  ...l ? { refreshToken: l } : {},
282
296
  ...d ? { userId: d } : {},
283
- ...d || u || v ? {
297
+ ...d || p || v ? {
284
298
  user: {
285
- ...u ? { name: u } : {},
299
+ ...p ? { name: p } : {},
286
300
  ...v ? { email: v } : {}
287
301
  }
288
302
  } : {},
@@ -294,28 +308,28 @@ function A({
294
308
  } : {},
295
309
  ...m ? { accent: m } : {},
296
310
  // Stack navigation: the chatroom's back chevron returns to the list.
297
- onBack: () => f(null)
311
+ onBack: () => h(null)
298
312
  });
299
- const w = setInterval(() => {
300
- var x;
301
- return (x = a.current) == null ? void 0 : x.refresh();
313
+ const C = setInterval(() => {
314
+ var y;
315
+ return (y = L.current) == null ? void 0 : y.refresh();
302
316
  }, 2e4);
303
317
  return () => {
304
- var x, g;
305
- clearInterval(w), (x = $.current) == null || x.close(), $.current = null, (g = a.current) == null || g.refresh();
318
+ var y, a;
319
+ clearInterval(C), (y = b.current) == null || y.close(), b.current = null, (a = L.current) == null || a.refresh();
306
320
  };
307
- }, [t == null ? void 0 : t.id]), b ? /* @__PURE__ */ _("div", { style: { padding: 16, font: "13px system-ui", color: "#b91c1c", background: "#fef2f2", borderRadius: 8 }, children: [
321
+ }, [t == null ? void 0 : t.id]), z ? /* @__PURE__ */ D("div", { style: { padding: 16, font: "13px system-ui", color: "#b91c1c", background: "#fef2f2", borderRadius: 8 }, children: [
308
322
  "[relay] <ChatApp/> needs a ",
309
323
  /* @__PURE__ */ e("code", { children: "profileId" }),
310
324
  " or a ",
311
325
  /* @__PURE__ */ e("code", { children: "tenantId" }),
312
326
  "."
313
- ] }) : /* @__PURE__ */ _("div", { style: { position: "relative", width: "100%", height: p, minHeight: "400px", overflow: "hidden", background: "#fff" }, children: [
314
- C && !t && /* @__PURE__ */ e(
327
+ ] }) : /* @__PURE__ */ D("div", { style: { position: "relative", width: "100%", height: S, minHeight: "400px", overflow: "hidden", background: "#fff" }, children: [
328
+ w && !t && /* @__PURE__ */ e(
315
329
  "button",
316
330
  {
317
- onClick: C,
318
- "aria-label": (h == null ? void 0 : h.close) ?? "Close",
331
+ onClick: w,
332
+ "aria-label": (f == null ? void 0 : f.close) ?? "Close",
319
333
  style: {
320
334
  position: "absolute",
321
335
  top: 8,
@@ -334,7 +348,7 @@ function A({
334
348
  lineHeight: 1,
335
349
  cursor: "pointer"
336
350
  },
337
- children: /* @__PURE__ */ e(Y, { size: 18 })
351
+ children: /* @__PURE__ */ e(K, { size: 18 })
338
352
  }
339
353
  ),
340
354
  /* @__PURE__ */ e("div", { style: {
@@ -342,11 +356,11 @@ function A({
342
356
  inset: 0,
343
357
  display: t ? "none" : "flex",
344
358
  flexDirection: "column"
345
- }, children: j ? /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%", padding: 16, font: "13px system-ui", color: "#b91c1c", textAlign: "center" }, children: (h == null ? void 0 : h.error) ?? "Could not load conversations." }) : /* @__PURE__ */ e("div", { ref: L, style: { width: "100%", height: "100%" } }) }),
346
- t && /* @__PURE__ */ e("div", { style: { position: "absolute", inset: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e("div", { ref: S, style: { width: "100%", height: "100%" } }) })
359
+ }, children: M ? /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%", padding: 16, font: "13px system-ui", color: "#b91c1c", textAlign: "center" }, children: (f == null ? void 0 : f.error) ?? "Could not load conversations." }) : /* @__PURE__ */ e("div", { ref: j, style: { width: "100%", height: "100%" } }) }),
360
+ t && /* @__PURE__ */ e("div", { style: { position: "absolute", inset: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e("div", { ref: g, style: { width: "100%", height: "100%" } }) })
347
361
  ] });
348
362
  }
349
- function X({
363
+ function I({
350
364
  url: o,
351
365
  apiUrl: r,
352
366
  profileId: s,
@@ -354,35 +368,35 @@ function X({
354
368
  token: i,
355
369
  refreshToken: l,
356
370
  userId: d,
357
- userName: u,
371
+ userName: p,
358
372
  userEmail: v,
359
373
  scope: m,
360
- accent: p = "#4F63F5",
361
- floating: h = !0,
362
- position: C = "bottom-right",
363
- label: R,
364
- panelWidth: b,
365
- panelHeight: t = "600px"
374
+ accent: u = "#6c5ce7",
375
+ floating: S = !0,
376
+ position: f = "bottom-right",
377
+ label: w,
378
+ panelWidth: R,
379
+ panelHeight: z = "600px"
366
380
  }) {
367
- const [f, j] = k(!1), M = B(null), L = C === "bottom-right", S = R ?? (h ? void 0 : "Messages"), a = K(479);
368
- if (D(() => {
369
- const y = (F) => {
370
- F.key === "Escape" && j(!1);
381
+ const [t, h] = _(!1), M = B(null), $ = f === "bottom-right", j = w ?? (S ? void 0 : "Messages"), g = P(479);
382
+ if (W(() => {
383
+ const c = (k) => {
384
+ k.key === "Escape" && h(!1);
371
385
  };
372
- return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
373
- }, []), h)
374
- return /* @__PURE__ */ _("div", { style: {
386
+ return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
387
+ }, []), S)
388
+ return /* @__PURE__ */ D("div", { style: {
375
389
  position: "fixed",
376
- [L ? "right" : "left"]: "20px",
390
+ [$ ? "right" : "left"]: "20px",
377
391
  bottom: "20px",
378
392
  zIndex: 9999,
379
393
  display: "flex",
380
394
  flexDirection: "column",
381
- alignItems: L ? "flex-end" : "flex-start",
395
+ alignItems: $ ? "flex-end" : "flex-start",
382
396
  gap: "12px"
383
397
  }, children: [
384
398
  /* @__PURE__ */ e("div", { style: {
385
- ...a ? {
399
+ ...g ? {
386
400
  position: "fixed",
387
401
  inset: 0,
388
402
  width: "100%",
@@ -390,19 +404,19 @@ function X({
390
404
  borderRadius: "0",
391
405
  zIndex: 9998
392
406
  } : {
393
- width: `min(${b ?? "420px"}, calc(100vw - 40px))`,
394
- height: `min(${t}, calc(100dvh - 108px))`,
395
- borderRadius: "16px"
407
+ width: `min(${R ?? "420px"}, calc(100vw - 40px))`,
408
+ height: `min(${z}, calc(100dvh - 108px))`,
409
+ borderRadius: "28px"
396
410
  },
397
411
  overflow: "hidden",
398
- boxShadow: a ? "none" : "0 8px 40px rgba(0,0,0,.18)",
412
+ boxShadow: g ? "none" : "0 12px 32px rgba(108,92,231,.14)",
399
413
  background: "#fff",
400
- display: f ? "flex" : "none",
414
+ display: t ? "flex" : "none",
401
415
  flexDirection: "column",
402
- transformOrigin: `bottom ${L ? "right" : "left"}`,
403
- animation: f ? "ocl-pop-in .18s ease" : "none"
416
+ transformOrigin: `bottom ${$ ? "right" : "left"}`,
417
+ animation: t ? "ocl-pop-in .18s ease" : "none"
404
418
  }, children: /* @__PURE__ */ e(
405
- A,
419
+ F,
406
420
  {
407
421
  url: o,
408
422
  ...r ? { apiUrl: r } : {},
@@ -411,53 +425,53 @@ function X({
411
425
  ...i ? { token: i } : {},
412
426
  ...l ? { refreshToken: l } : {},
413
427
  ...d ? { userId: d } : {},
414
- ...u ? { userName: u } : {},
428
+ ...p ? { userName: p } : {},
415
429
  ...v ? { userEmail: v } : {},
416
430
  ...m ? { scope: m } : {},
417
- accent: p,
431
+ accent: u,
418
432
  height: "100%",
419
- onClose: () => j(!1)
433
+ onClose: () => h(!1)
420
434
  }
421
435
  ) }),
422
436
  /* @__PURE__ */ e(
423
437
  "button",
424
438
  {
425
439
  ref: M,
426
- onClick: () => j((y) => !y),
427
- "aria-label": f ? "Close chat" : typeof S == "string" ? S : "Open chat",
428
- "aria-expanded": f,
440
+ onClick: () => h((c) => !c),
441
+ "aria-label": t ? "Close chat" : typeof j == "string" ? j : "Open chat",
442
+ "aria-expanded": t,
429
443
  style: {
430
444
  width: "56px",
431
445
  height: "56px",
432
446
  borderRadius: "50%",
433
- background: p,
447
+ background: u,
434
448
  color: "#fff",
435
449
  border: "none",
436
450
  fontSize: "20px",
437
451
  cursor: "pointer",
438
452
  flexShrink: 0,
439
- boxShadow: "0 4px 16px rgba(0,0,0,.25)",
453
+ boxShadow: "0 12px 32px rgba(108,92,231,.14)",
440
454
  transition: "transform .15s",
441
455
  alignItems: "center",
442
456
  justifyContent: "center",
443
- display: f && a ? "none" : "flex"
457
+ display: t && g ? "none" : "flex"
444
458
  },
445
- onMouseEnter: (y) => {
446
- y.currentTarget.style.transform = "scale(1.08)";
459
+ onMouseEnter: (c) => {
460
+ c.currentTarget.style.transform = "scale(1.08)";
447
461
  },
448
- onMouseLeave: (y) => {
449
- y.currentTarget.style.transform = "scale(1)";
462
+ onMouseLeave: (c) => {
463
+ c.currentTarget.style.transform = "scale(1)";
450
464
  },
451
- children: f ? /* @__PURE__ */ e(Y, {}) : R ?? /* @__PURE__ */ e(G, {})
465
+ children: t ? /* @__PURE__ */ e(K, {}) : w ?? /* @__PURE__ */ e(q, {})
452
466
  }
453
467
  ),
454
468
  /* @__PURE__ */ e("style", { children: "@keyframes ocl-pop-in { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }" })
455
469
  ] });
456
- const $ = `min(${b ?? "420px"}, calc(100vw - 16px))`, [w, c] = k(null), x = () => {
457
- !f && M.current && c(M.current.getBoundingClientRect()), j((y) => !y);
458
- }, g = w ? w.bottom + 8 : 0, z = w ? Math.max(8, window.innerWidth - w.right) : 0;
459
- return /* @__PURE__ */ _(O, { children: [
460
- /* @__PURE__ */ _(
470
+ const L = `min(${R ?? "420px"}, calc(100vw - 16px))`, [b, C] = _(null), x = () => {
471
+ !t && M.current && C(M.current.getBoundingClientRect()), h((c) => !c);
472
+ }, y = b ? b.bottom + 8 : 0, a = b ? Math.max(8, window.innerWidth - b.right) : 0;
473
+ return /* @__PURE__ */ D(Y, { children: [
474
+ /* @__PURE__ */ D(
461
475
  "button",
462
476
  {
463
477
  ref: M,
@@ -468,50 +482,50 @@ function X({
468
482
  gap: "6px",
469
483
  padding: "8px 16px",
470
484
  borderRadius: "8px",
471
- background: f ? p : "transparent",
472
- color: f ? "#fff" : p,
473
- border: `2px solid ${p}`,
485
+ background: t ? u : "transparent",
486
+ color: t ? "#fff" : u,
487
+ border: `2px solid ${u}`,
474
488
  fontSize: "14px",
475
489
  fontWeight: 600,
476
490
  cursor: "pointer",
477
491
  transition: "background .15s, color .15s"
478
492
  },
479
493
  children: [
480
- /* @__PURE__ */ e(G, { size: 16 }),
494
+ /* @__PURE__ */ e(q, { size: 16 }),
481
495
  " ",
482
- S
496
+ j
483
497
  ]
484
498
  }
485
499
  ),
486
- f && w && /* @__PURE__ */ _(O, { children: [
500
+ t && b && /* @__PURE__ */ D(Y, { children: [
487
501
  /* @__PURE__ */ e(
488
502
  "div",
489
503
  {
490
- onClick: () => j(!1),
504
+ onClick: () => h(!1),
491
505
  style: { position: "fixed", inset: 0, zIndex: 9998 }
492
506
  }
493
507
  ),
494
508
  /* @__PURE__ */ e("div", { style: {
495
509
  position: "fixed",
496
- ...a ? {
510
+ ...g ? {
497
511
  inset: 0,
498
512
  width: "100%",
499
513
  height: "100dvh",
500
514
  borderRadius: "0"
501
515
  } : {
502
- top: g,
503
- right: z,
504
- width: $,
505
- height: `min(${t}, calc(100dvh - ${g}px - 12px))`,
506
- borderRadius: "16px"
516
+ top: y,
517
+ right: a,
518
+ width: L,
519
+ height: `min(${z}, calc(100dvh - ${y}px - 12px))`,
520
+ borderRadius: "28px"
507
521
  },
508
522
  overflow: "hidden",
509
- boxShadow: a ? "none" : "0 8px 40px rgba(0,0,0,.2)",
523
+ boxShadow: g ? "none" : "0 12px 32px rgba(108,92,231,.14)",
510
524
  background: "#fff",
511
525
  zIndex: 9999,
512
526
  animation: "ocl-slide-in .18s ease"
513
527
  }, children: /* @__PURE__ */ e(
514
- A,
528
+ F,
515
529
  {
516
530
  url: o,
517
531
  ...r ? { apiUrl: r } : {},
@@ -520,12 +534,12 @@ function X({
520
534
  ...i ? { token: i } : {},
521
535
  ...l ? { refreshToken: l } : {},
522
536
  ...d ? { userId: d } : {},
523
- ...u ? { userName: u } : {},
537
+ ...p ? { userName: p } : {},
524
538
  ...v ? { userEmail: v } : {},
525
539
  ...m ? { scope: m } : {},
526
- accent: p,
540
+ accent: u,
527
541
  height: "100%",
528
- onClose: () => j(!1)
542
+ onClose: () => h(!1)
529
543
  }
530
544
  ) }),
531
545
  /* @__PURE__ */ e("style", { children: "@keyframes ocl-slide-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }" })
@@ -533,9 +547,9 @@ function X({
533
547
  ] });
534
548
  }
535
549
  export {
536
- A as ChatApp,
537
- X as ChatAppLauncher,
538
- Q as ChatWidget,
539
- V as MarketplaceChat
550
+ F as ChatApp,
551
+ I as ChatAppLauncher,
552
+ Z as ChatWidget,
553
+ T as MarketplaceChat
540
554
  };
541
555
  //# sourceMappingURL=react.js.map