@maebgch/rcs-emulator 0.1.12 → 0.1.14

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.
@@ -1,30 +1,30 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { createContext as re, useContext as te, useReducer as se, useRef as W, useEffect as E, useCallback as $, useState as A, memo as p, useMemo as V } from "react";
3
- function Y(s) {
2
+ import { createContext as ae, useContext as le, useReducer as ce, useRef as H, useEffect as B, useCallback as M, useState as A, memo as f, useMemo as O } from "react";
3
+ function ee(s) {
4
4
  return "reply" in s;
5
5
  }
6
- function z(s) {
6
+ function T(s) {
7
7
  return "action" in s;
8
8
  }
9
- function qe(s) {
10
- if (!z(s)) return !1;
9
+ function nr(s) {
10
+ if (!T(s)) return !1;
11
11
  const { urlAction: r } = s.action;
12
12
  return r?.openUrl?.application === "WEBVIEW";
13
13
  }
14
- function oe(s) {
14
+ function ne(s) {
15
15
  const { urlAction: r } = s.action;
16
16
  return r?.openUrl?.application === "WEBVIEW" ? r.openUrl : null;
17
17
  }
18
- const ae = {
18
+ const ie = {
19
19
  name: "Business",
20
20
  verified: !1
21
- }, le = {
21
+ }, ue = {
22
22
  currentMessageId: null,
23
23
  chatHistory: [],
24
24
  isTyping: !1,
25
25
  error: null
26
- }, Q = re(null);
27
- function Z({
26
+ }, re = ae(null);
27
+ function te({
28
28
  children: s,
29
29
  theme: r,
30
30
  device: t,
@@ -32,88 +32,94 @@ function Z({
32
32
  state: a,
33
33
  showSuggestions: l,
34
34
  isProfileOpen: c,
35
- toggleProfile: u,
35
+ toggleProfile: i,
36
36
  onReply: m,
37
- onAction: i,
38
- webView: h,
39
- openWebView: f,
40
- closeWebView: w
37
+ onAction: u,
38
+ webView: d,
39
+ openWebView: h,
40
+ closeWebView: v,
41
+ toast: y,
42
+ showToast: k,
43
+ onBack: w
41
44
  }) {
42
- const b = {
45
+ const g = {
43
46
  theme: r,
44
47
  device: t,
45
- businessInfo: { ...ae, ...o },
46
- state: { ...le, ...a },
48
+ businessInfo: { ...ie, ...o },
49
+ state: { ...ue, ...a },
47
50
  showSuggestions: l,
48
51
  isProfileOpen: c,
49
- toggleProfile: u,
52
+ toggleProfile: i,
50
53
  handleReply: m,
51
- handleAction: i,
52
- webView: h,
53
- openWebView: f,
54
- closeWebView: w
54
+ handleAction: u,
55
+ webView: d,
56
+ openWebView: h,
57
+ closeWebView: v,
58
+ toast: y,
59
+ showToast: k,
60
+ handleBack: w
55
61
  };
56
- return /* @__PURE__ */ e(Q.Provider, { value: b, children: s });
62
+ return /* @__PURE__ */ e(re.Provider, { value: g, children: s });
57
63
  }
58
- function k() {
59
- const s = te(Q);
64
+ function C() {
65
+ const s = le(re);
60
66
  if (!s)
61
67
  throw new Error("useEmulator must be used within an EmulatorProvider");
62
68
  return s;
63
69
  }
64
- function K(s) {
70
+ function se(s) {
65
71
  const r = Object.values(s.messages);
66
72
  return r.find((t) => t.is_first) || r[0] || null;
67
73
  }
68
- function R(s, r) {
74
+ function V(s, r) {
69
75
  return s.messages[r] || null;
70
76
  }
71
- function O(s, r) {
77
+ function Y(s, r) {
72
78
  const t = s.responses?.keyword?.keyword_response?.choices;
73
79
  return t && t[r]?.next_message || null;
74
80
  }
75
- function H(s, r) {
76
- const t = s.parts, o = ce(t), a = ie(t);
77
- return {
78
- id: `${s.id}-${r}-${Date.now()}`,
79
- sender: "business",
80
- content: o,
81
- timestamp: Date.now(),
82
- suggestions: a
83
- };
84
- }
85
- function ce(s) {
86
- for (const r of s) {
87
- const t = r.RCSMessage;
88
- if (t.textMessage)
89
- return {
90
- type: "text",
91
- text: t.textMessage
92
- };
93
- const o = t.richcardMessage?.message?.generalPurposeCard;
94
- if (o)
95
- return {
96
- type: "richcard",
97
- card: P(o.content, o.layout)
98
- };
99
- const a = t.richcardMessage?.message?.generalPurposeCardCarousel;
100
- if (a)
101
- return {
102
- type: "carousel",
103
- cards: a.content.map(
104
- (l) => P(l, {
105
- cardOrientation: "VERTICAL",
106
- cardWidth: a.layout.cardWidth
107
- })
108
- )
109
- };
81
+ function U(s, r) {
82
+ const t = s.parts, o = [], a = Date.now();
83
+ for (let l = 0; l < t.length; l++) {
84
+ const c = t[l], i = me(c), u = l === t.length - 1 ? he(t) : void 0;
85
+ o.push({
86
+ id: `${s.id}-${r}-${l}-${a + l}`,
87
+ sender: "business",
88
+ content: i,
89
+ timestamp: a + l,
90
+ suggestions: u
91
+ });
110
92
  }
111
- return {
93
+ return o;
94
+ }
95
+ function me(s) {
96
+ const r = s.RCSMessage;
97
+ if (r.textMessage)
98
+ return {
99
+ type: "text",
100
+ text: r.textMessage
101
+ };
102
+ const t = r.richcardMessage?.message?.generalPurposeCard;
103
+ if (t)
104
+ return {
105
+ type: "richcard",
106
+ card: q(t.content, t.layout)
107
+ };
108
+ const o = r.richcardMessage?.message?.generalPurposeCardCarousel;
109
+ return o ? {
110
+ type: "carousel",
111
+ cards: o.content.map(
112
+ (a) => q(a, {
113
+ cardOrientation: o.layout.cardOrientation || "VERTICAL",
114
+ cardWidth: o.layout.cardWidth
115
+ })
116
+ )
117
+ } : {
112
118
  type: "text",
113
119
  text: "[Unsupported message type]"
114
120
  };
115
121
  }
116
- function P(s, r) {
122
+ function q(s, r) {
117
123
  const t = () => {
118
124
  if (s.media) {
119
125
  if (s.media.mediaUrl) return s.media.mediaUrl;
@@ -130,7 +136,7 @@ function P(s, r) {
130
136
  description: s.description,
131
137
  media: a ? {
132
138
  url: a,
133
- height: ne(s.media?.height || "MEDIUM_HEIGHT"),
139
+ height: de(s.media?.height || "MEDIUM_HEIGHT"),
134
140
  thumbnailUrl: o()
135
141
  } : void 0,
136
142
  suggestions: s.suggestions,
@@ -141,7 +147,7 @@ function P(s, r) {
141
147
  }
142
148
  };
143
149
  }
144
- function ne(s) {
150
+ function de(s) {
145
151
  switch (s) {
146
152
  case "SHORT_HEIGHT":
147
153
  return "short";
@@ -151,7 +157,7 @@ function ne(s) {
151
157
  return "medium";
152
158
  }
153
159
  }
154
- function ie(s) {
160
+ function he(s) {
155
161
  const r = [];
156
162
  for (const t of s) {
157
163
  const o = t.RCSMessage;
@@ -159,7 +165,7 @@ function ie(s) {
159
165
  }
160
166
  return r;
161
167
  }
162
- function ue(s) {
168
+ function fe(s) {
163
169
  return {
164
170
  id: `user-${Date.now()}`,
165
171
  sender: "user",
@@ -170,7 +176,7 @@ function ue(s) {
170
176
  timestamp: Date.now()
171
177
  };
172
178
  }
173
- function me(s) {
179
+ function pe(s) {
174
180
  if (!s || typeof s != "object") return !1;
175
181
  const r = s;
176
182
  if (typeof r.name != "string" || !r.messages || typeof r.messages != "object") return !1;
@@ -183,8 +189,8 @@ function me(s) {
183
189
  }
184
190
  return !0;
185
191
  }
186
- function de(s) {
187
- const r = K(s);
192
+ function ge(s) {
193
+ const r = se(s);
188
194
  if (!r || !r.parts.length) return "New message";
189
195
  const o = r.parts[0].RCSMessage;
190
196
  if (o.textMessage)
@@ -195,13 +201,13 @@ function de(s) {
195
201
  const l = o.richcardMessage?.message?.generalPurposeCardCarousel;
196
202
  return l?.content[0]?.title ? l.content[0].title : "New message";
197
203
  }
198
- const X = {
204
+ const oe = {
199
205
  currentMessageId: null,
200
206
  chatHistory: [],
201
207
  isTyping: !1,
202
208
  error: null
203
209
  };
204
- function he(s, r) {
210
+ function xe(s, r) {
205
211
  switch (r.type) {
206
212
  case "INIT":
207
213
  return {
@@ -216,7 +222,7 @@ function he(s, r) {
216
222
  isTyping: !1
217
223
  };
218
224
  case "ADD_USER_REPLY": {
219
- const t = ue(r.text), o = s.chatHistory.map(
225
+ const t = fe(r.text), o = s.chatHistory.map(
220
226
  (a, l) => l === s.chatHistory.length - 1 ? { ...a, suggestions: void 0 } : a
221
227
  );
222
228
  return {
@@ -241,138 +247,120 @@ function he(s, r) {
241
247
  isTyping: !1
242
248
  };
243
249
  case "RESET":
244
- return X;
250
+ return oe;
245
251
  default:
246
252
  return s;
247
253
  }
248
254
  }
249
- function fe({
255
+ function be({
250
256
  flow: s,
251
257
  onUserReply: r,
252
258
  typingDelay: t = 800
253
259
  }) {
254
- const [o, a] = se(he, X), l = W(0), c = W(!1);
255
- E(() => {
260
+ const [o, a] = ce(xe, oe), l = H(0), c = H(!1);
261
+ B(() => {
256
262
  if (c.current) return;
257
263
  c.current = !0;
258
- const h = K(s);
259
- if (!h) {
264
+ const d = se(s);
265
+ if (!d) {
260
266
  a({
261
267
  type: "SET_ERROR",
262
268
  error: "No first message found in conversation flow"
263
269
  });
264
270
  return;
265
271
  }
266
- a({ type: "INIT", messageId: h.id });
267
- const f = H(
268
- h,
272
+ a({ type: "INIT", messageId: d.id }), U(
273
+ d,
269
274
  l.current++
270
- );
271
- a({ type: "ADD_BUSINESS_MESSAGE", message: f });
275
+ ).forEach((v) => {
276
+ a({ type: "ADD_BUSINESS_MESSAGE", message: v });
277
+ });
272
278
  }, [s]);
273
- const u = $(
274
- (h) => {
275
- if (!Y(h)) return;
276
- const { displayText: f, postback: w } = h.reply, b = w.data;
277
- a({ type: "ADD_USER_REPLY", text: f, postbackData: b });
278
- const N = {
279
+ const i = M(
280
+ (d) => {
281
+ if (!ee(d)) return;
282
+ const { displayText: h, postback: v } = d.reply, y = v.data;
283
+ a({ type: "ADD_USER_REPLY", text: h, postbackData: y });
284
+ const k = {
279
285
  type: "reply",
280
- postbackData: b,
281
- displayText: f,
286
+ postbackData: y,
287
+ displayText: h,
282
288
  timestamp: Date.now()
283
289
  };
284
- r(N);
285
- const v = o.currentMessageId ? R(s, o.currentMessageId) : null;
286
- if (!v) {
290
+ r(k);
291
+ const w = o.currentMessageId ? V(s, o.currentMessageId) : null;
292
+ if (!w) {
287
293
  a({ type: "SET_ERROR", error: "Current message not found" });
288
294
  return;
289
295
  }
290
- const y = O(v, b);
291
- if (!y)
296
+ const g = Y(w, y);
297
+ if (!g)
292
298
  return;
293
- const g = R(s, y);
294
- if (!g) {
299
+ const x = V(s, g);
300
+ if (!x) {
295
301
  a({
296
302
  type: "SET_ERROR",
297
- error: `Next message "${y}" not found`
303
+ error: `Next message "${g}" not found`
298
304
  });
299
305
  return;
300
306
  }
301
- a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: y }), setTimeout(() => {
302
- const d = H(
303
- g,
307
+ a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: g }), setTimeout(() => {
308
+ U(
309
+ x,
304
310
  l.current++
305
- );
306
- a({ type: "ADD_BUSINESS_MESSAGE", message: d });
311
+ ).forEach((b) => {
312
+ a({ type: "ADD_BUSINESS_MESSAGE", message: b });
313
+ });
307
314
  }, t);
308
315
  },
309
316
  [s, o.currentMessageId, r, t]
310
- ), m = $(
311
- (h) => {
312
- if (!z(h)) return;
313
- const {
314
- displayText: f,
315
- postback: w,
316
- openUrlAction: b,
317
- dialAction: N,
318
- dialerAction: v,
319
- mapAction: y,
320
- viewLocationAction: g
321
- } = h.action, d = w.data, x = N?.phoneNumber || v?.dialPhoneNumber?.phoneNumber, L = y?.showLocation?.location || g?.latLong;
322
- let I;
323
- b ? I = { type: "openUrl", url: b.url } : x ? I = { type: "dial", phoneNumber: x } : L && (I = {
324
- type: "viewLocation",
325
- latitude: L.latitude,
326
- longitude: L.longitude,
327
- query: g?.query
328
- });
329
- const C = {
330
- type: "action",
331
- postbackData: d,
332
- displayText: f,
333
- timestamp: Date.now(),
334
- actionData: I
335
- };
336
- if (r(C), b)
337
- window.open(b.url, "_blank", "noopener,noreferrer");
338
- else if (x)
339
- window.location.href = `tel:${x}`;
340
- else if (L) {
341
- const M = y?.showLocation?.location?.label || g?.label || "", S = `https://www.google.com/maps/search/?api=1&query=${L.latitude},${L.longitude}${M ? `&query_place_id=${encodeURIComponent(M)}` : ""}`;
342
- window.open(S, "_blank", "noopener,noreferrer");
317
+ ), m = M(
318
+ (d) => {
319
+ if (!T(d)) return;
320
+ const { displayText: h, postback: v, openUrlAction: y } = d.action, k = v.data;
321
+ if (y) {
322
+ const g = {
323
+ type: "action",
324
+ postbackData: k,
325
+ displayText: h,
326
+ timestamp: Date.now(),
327
+ actionData: { type: "openUrl", url: y.url }
328
+ };
329
+ r(g), window.open(y.url, "_blank", "noopener,noreferrer");
343
330
  }
344
- const T = o.currentMessageId ? R(s, o.currentMessageId) : null;
345
- if (T) {
346
- const M = O(T, d);
347
- if (M) {
348
- const S = R(s, M);
349
- S && (a({
331
+ const w = o.currentMessageId ? V(s, o.currentMessageId) : null;
332
+ if (w) {
333
+ const g = Y(w, k);
334
+ if (g) {
335
+ const x = V(s, g);
336
+ x && (a({
350
337
  type: "ADD_USER_REPLY",
351
- text: f,
352
- postbackData: d
353
- }), a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: M }), setTimeout(() => {
354
- const ee = H(
355
- S,
338
+ text: h,
339
+ postbackData: k
340
+ }), a({ type: "SET_TYPING", isTyping: !0 }), a({ type: "NAVIGATE_TO", messageId: g }), setTimeout(() => {
341
+ U(
342
+ x,
356
343
  l.current++
357
- );
358
- a({ type: "ADD_BUSINESS_MESSAGE", message: ee });
344
+ ).forEach((b) => {
345
+ a({ type: "ADD_BUSINESS_MESSAGE", message: b });
346
+ });
359
347
  }, t));
360
348
  }
361
349
  }
362
350
  },
363
351
  [s, o.currentMessageId, r, t]
364
- ), i = $(() => {
352
+ ), u = M(() => {
365
353
  c.current = !1, l.current = 0, a({ type: "RESET" });
366
354
  }, []);
367
355
  return {
368
356
  state: o,
369
- handleReply: u,
357
+ handleReply: i,
370
358
  handleAction: m,
371
- reset: i
359
+ reset: u
372
360
  };
373
361
  }
374
- function pe(s) {
375
- const [r, t] = A(null), [o, a] = A(!1), [l, c] = A(null), u = $(async () => {
362
+ function ve(s) {
363
+ const [r, t] = A(null), [o, a] = A(!1), [l, c] = A(null), i = M(async () => {
376
364
  if (!s) {
377
365
  t(null), c(null);
378
366
  return;
@@ -387,43 +375,43 @@ function pe(s) {
387
375
  });
388
376
  if (!m.ok)
389
377
  throw new Error(`HTTP ${m.status}: ${m.statusText}`);
390
- const i = await m.json();
391
- if (!i || typeof i != "object")
378
+ const u = await m.json();
379
+ if (!u || typeof u != "object")
392
380
  throw new Error("Invalid JSON: Expected an object");
393
- if (!i.messages || typeof i.messages != "object")
381
+ if (!u.messages || typeof u.messages != "object")
394
382
  throw new Error("Invalid RBM JSON: Missing 'messages' object");
395
- t(i);
383
+ t(u);
396
384
  } catch (m) {
397
- const i = m instanceof Error ? m.message : "Failed to fetch JSON";
398
- c(i), t(null);
385
+ const u = m instanceof Error ? m.message : "Failed to fetch JSON";
386
+ c(u), t(null);
399
387
  } finally {
400
388
  a(!1);
401
389
  }
402
390
  }, [s]);
403
- return E(() => {
404
- u();
405
- }, [u]), {
391
+ return B(() => {
392
+ i();
393
+ }, [i]), {
406
394
  data: r,
407
395
  isLoading: o,
408
396
  error: l,
409
- refetch: u
397
+ refetch: i
410
398
  };
411
399
  }
412
- function ge(s) {
413
- const r = W(null);
414
- return E(() => {
400
+ function we(s) {
401
+ const r = H(null);
402
+ return B(() => {
415
403
  r.current && r.current.scrollTo({
416
404
  top: r.current.scrollHeight,
417
405
  behavior: "smooth"
418
406
  });
419
407
  }, [s]), r;
420
408
  }
421
- const xe = p(function() {
422
- const { theme: r, businessInfo: t, toggleProfile: o } = k(), a = r === "dark", l = a ? "rcs-emulator-dark" : "rcs-emulator-light", c = t.brandColor || "#0084ff";
409
+ const ye = f(function() {
410
+ const { theme: r, businessInfo: t, toggleProfile: o, handleBack: a } = C(), l = r === "dark", c = l ? "rcs-emulator-dark" : "rcs-emulator-light", i = t.brandColor || "#1A73E8";
423
411
  return /* @__PURE__ */ n(
424
412
  "header",
425
413
  {
426
- className: `rcs-emulator-header ${l}`,
414
+ className: `rcs-emulator-header ${c}`,
427
415
  role: "banner",
428
416
  "aria-label": `Chat with ${t.name}`,
429
417
  children: [
@@ -431,24 +419,43 @@ const xe = p(function() {
431
419
  "button",
432
420
  {
433
421
  type: "button",
434
- className: `rcs-emulator-icon-btn rcs-emulator-p-1-5 rcs-emulator--ml-1 ${l} ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-700"}`,
422
+ onClick: a || void 0,
423
+ className: `rcs-emulator-icon-btn rcs-emulator-p-1-5 rcs-emulator--ml-1 ${c} ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-700"}`,
435
424
  "aria-label": "Go back",
436
- children: /* @__PURE__ */ e("svg", { className: "rcs-emulator-w-5 rcs-emulator-h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
425
+ children: /* @__PURE__ */ e(
426
+ "svg",
427
+ {
428
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
429
+ fill: "none",
430
+ viewBox: "0 0 24 24",
431
+ stroke: "currentColor",
432
+ children: /* @__PURE__ */ e(
433
+ "path",
434
+ {
435
+ strokeLinecap: "round",
436
+ strokeLinejoin: "round",
437
+ strokeWidth: 2,
438
+ d: "M15 19l-7-7 7-7"
439
+ }
440
+ )
441
+ }
442
+ )
437
443
  }
438
444
  ),
439
445
  /* @__PURE__ */ n(
440
446
  "button",
441
447
  {
442
448
  onClick: o,
443
- className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2-5 rcs-emulator-flex-1 rcs-emulator-min-w-0 rcs-emulator-text-left",
449
+ className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2-5 rcs-emulator-flex-1 rcs-emulator-min-w-0 rcs-emulator-text-left rcs-emulator-bg-transparent",
450
+ style: { background: "transparent" },
444
451
  "aria-label": "View business info",
445
452
  children: [
446
453
  /* @__PURE__ */ e(
447
454
  "div",
448
455
  {
449
- className: `rcs-emulator-logo-avatar rcs-emulator-w-9 rcs-emulator-h-9 ${l}`,
456
+ className: `rcs-emulator-logo-avatar rcs-emulator-w-9 rcs-emulator-h-9 ${c}`,
450
457
  style: {
451
- backgroundColor: t.logo ? void 0 : c
458
+ backgroundColor: t.logo ? void 0 : i
452
459
  },
453
460
  children: t.logo ? /* @__PURE__ */ e(
454
461
  "img",
@@ -463,7 +470,7 @@ const xe = p(function() {
463
470
  /* @__PURE__ */ e(
464
471
  "h1",
465
472
  {
466
- className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
473
+ className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${l ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
467
474
  children: t.name
468
475
  }
469
476
  )
@@ -475,47 +482,72 @@ const xe = p(function() {
475
482
  "button",
476
483
  {
477
484
  type: "button",
478
- className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${l}`,
485
+ className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${c}`,
479
486
  "aria-label": "Verified business",
480
- children: /* @__PURE__ */ n("svg", { className: "rcs-emulator-w-5 rcs-emulator-h-5", viewBox: "0 0 24 24", fill: "none", children: [
481
- /* @__PURE__ */ e(
482
- "path",
483
- {
484
- d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
485
- stroke: a ? "#9ca3af" : "#6b7280",
486
- strokeWidth: 2,
487
- strokeLinecap: "round",
488
- strokeLinejoin: "round"
489
- }
490
- ),
491
- /* @__PURE__ */ e(
492
- "path",
493
- {
494
- d: "M9 12l2 2 4-4",
495
- stroke: "#3b82f6",
496
- strokeWidth: 2,
497
- strokeLinecap: "round",
498
- strokeLinejoin: "round"
499
- }
500
- )
501
- ] })
487
+ children: /* @__PURE__ */ n(
488
+ "svg",
489
+ {
490
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
491
+ viewBox: "0 0 24 24",
492
+ fill: "none",
493
+ children: [
494
+ /* @__PURE__ */ e(
495
+ "path",
496
+ {
497
+ d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
498
+ stroke: l ? "#9ca3af" : "#6b7280",
499
+ strokeWidth: 2,
500
+ strokeLinecap: "round",
501
+ strokeLinejoin: "round"
502
+ }
503
+ ),
504
+ /* @__PURE__ */ e(
505
+ "path",
506
+ {
507
+ d: "M9 12l2 2 4-4",
508
+ stroke: "#3b82f6",
509
+ strokeWidth: 2,
510
+ strokeLinecap: "round",
511
+ strokeLinejoin: "round"
512
+ }
513
+ )
514
+ ]
515
+ }
516
+ )
502
517
  }
503
518
  ),
504
519
  /* @__PURE__ */ e(
505
520
  "button",
506
521
  {
507
522
  type: "button",
508
- className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${l} ${a ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
523
+ className: `rcs-emulator-icon-btn rcs-emulator-p-2 ${c} ${l ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
509
524
  "aria-label": "More options",
510
- children: /* @__PURE__ */ e("svg", { className: "rcs-emulator-w-5 rcs-emulator-h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" }) })
525
+ children: /* @__PURE__ */ e(
526
+ "svg",
527
+ {
528
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
529
+ fill: "none",
530
+ viewBox: "0 0 24 24",
531
+ stroke: "currentColor",
532
+ children: /* @__PURE__ */ e(
533
+ "path",
534
+ {
535
+ strokeLinecap: "round",
536
+ strokeLinejoin: "round",
537
+ strokeWidth: 2,
538
+ d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
539
+ }
540
+ )
541
+ }
542
+ )
511
543
  }
512
544
  )
513
545
  ] })
514
546
  ]
515
547
  }
516
548
  );
517
- }), be = p(function() {
518
- const { theme: r, businessInfo: t } = k(), o = r === "dark", a = o ? "rcs-emulator-dark" : "rcs-emulator-light", l = t.brandColor || "#0084ff";
549
+ }), ke = f(function() {
550
+ const { theme: r, businessInfo: t } = C(), o = r === "dark", a = o ? "rcs-emulator-dark" : "rcs-emulator-light", l = t.brandColor || "#0084ff";
519
551
  return /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-py-4 rcs-emulator-px-4", children: [
520
552
  /* @__PURE__ */ n("div", { className: "rcs-emulator-relative rcs-emulator-mb-3", children: [
521
553
  /* @__PURE__ */ e(
@@ -560,30 +592,30 @@ const xe = p(function() {
560
592
  }
561
593
  )
562
594
  ] });
563
- }), ve = p(function({
595
+ }), Ne = f(function({
564
596
  text: r,
565
597
  sender: t,
566
598
  timestamp: o
567
599
  }) {
568
- const { theme: a, businessInfo: l } = k(), u = a === "dark" ? "rcs-emulator-dark" : "rcs-emulator-light", m = t === "business", i = l.brandColor || "#0084ff", h = new Date(o).toLocaleTimeString([], {
600
+ const { theme: a, businessInfo: l } = C(), i = a === "dark" ? "rcs-emulator-dark" : "rcs-emulator-light", m = t === "business", u = l.brandColor || "#1A73E8", d = new Date(o).toLocaleTimeString([], {
569
601
  hour: "2-digit",
570
602
  minute: "2-digit"
571
603
  });
572
- return m ? /* @__PURE__ */ n("div", { className: "rcs-emulator-max-w-90", children: [
604
+ return m ? /* @__PURE__ */ n("div", { className: "rcs-emulator-max-w-90 rcs-emulator-flex rcs-emulator-flex-col", children: [
573
605
  /* @__PURE__ */ e(
574
606
  "div",
575
607
  {
576
- className: `rcs-emulator-message-bubble rcs-emulator-business ${u}`,
608
+ className: `rcs-emulator-message-bubble rcs-emulator-business ${i}`,
577
609
  children: r
578
610
  }
579
611
  ),
580
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: h })
612
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: d })
581
613
  ] }) : /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-items-end rcs-emulator-gap-1-5 rcs-emulator-max-w-85 rcs-emulator-ml-auto", children: [
582
614
  /* @__PURE__ */ e(
583
615
  "div",
584
616
  {
585
617
  className: "rcs-emulator-message-bubble rcs-emulator-user",
586
- style: { backgroundColor: i },
618
+ style: { backgroundColor: u },
587
619
  children: r
588
620
  }
589
621
  ),
@@ -591,7 +623,7 @@ const xe = p(function() {
591
623
  "div",
592
624
  {
593
625
  className: "rcs-emulator-delivery-status",
594
- style: { backgroundColor: i },
626
+ style: { backgroundColor: u },
595
627
  children: /* @__PURE__ */ e(
596
628
  "svg",
597
629
  {
@@ -605,13 +637,13 @@ const xe = p(function() {
605
637
  )
606
638
  }
607
639
  ),
608
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: h })
640
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: d })
609
641
  ] });
610
- }), we = p(function({
642
+ }), Ce = f(function({
611
643
  text: r,
612
644
  timestamp: t
613
645
  }) {
614
- const { businessInfo: o } = k(), a = o.brandColor || "#0084ff", l = new Date(t).toLocaleTimeString([], {
646
+ const { businessInfo: o } = C(), a = o.brandColor || "#1A73E8", l = new Date(t).toLocaleTimeString([], {
615
647
  hour: "2-digit",
616
648
  minute: "2-digit"
617
649
  });
@@ -620,7 +652,7 @@ const xe = p(function() {
620
652
  "div",
621
653
  {
622
654
  className: "rcs-emulator-message-bubble rcs-emulator-user rcs-emulator-shadow-sm",
623
- style: { backgroundColor: a },
655
+ style: { backgroundColor: a, color: "white" },
624
656
  children: r
625
657
  }
626
658
  ),
@@ -651,16 +683,16 @@ const xe = p(function() {
651
683
  ),
652
684
  /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: l })
653
685
  ] });
654
- }), ye = p(function({
686
+ }), Le = f(function({
655
687
  card: r,
656
688
  timestamp: t
657
689
  }) {
658
- const { theme: o, handleReply: a, handleAction: l } = k(), c = o === "dark", u = c ? "rcs-emulator-dark" : "rcs-emulator-light", m = new Date(t).toLocaleTimeString([], {
690
+ const { theme: o, handleReply: a, handleAction: l } = C(), c = o === "dark", i = c ? "rcs-emulator-dark" : "rcs-emulator-light", m = new Date(t).toLocaleTimeString([], {
659
691
  hour: "2-digit",
660
692
  minute: "2-digit"
661
- }), i = (f) => {
662
- "reply" in f ? a(f) : l(f);
663
- }, h = {
693
+ }), u = (h) => {
694
+ "reply" in h ? a(h) : l(h);
695
+ }, d = {
664
696
  short: "rcs-emulator-h-36",
665
697
  medium: "rcs-emulator-h-44",
666
698
  tall: "rcs-emulator-h-56"
@@ -669,19 +701,24 @@ const xe = p(function() {
669
701
  /* @__PURE__ */ n(
670
702
  "div",
671
703
  {
672
- className: `rcs-emulator-rich-card ${u}`,
704
+ className: `rcs-emulator-rich-card ${i}`,
673
705
  children: [
674
706
  r.media && /* @__PURE__ */ e(
675
707
  "div",
676
708
  {
677
- className: `rcs-emulator-w-full rcs-emulator-overflow-hidden ${h[r.media.height]}`,
709
+ className: `rcs-emulator-w-full rcs-emulator-overflow-hidden rcs-emulator-media-placeholder ${d[r.media.height]} ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
710
+ style: { borderRadius: "12px 12px 0 0" },
678
711
  children: /* @__PURE__ */ e(
679
712
  "img",
680
713
  {
681
714
  src: r.media.url,
682
715
  alt: r.title || "Rich card media",
683
716
  className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover",
684
- loading: "lazy"
717
+ loading: "lazy",
718
+ onError: (h) => {
719
+ const v = h.target;
720
+ v.style.display = "none";
721
+ }
685
722
  }
686
723
  )
687
724
  }
@@ -690,29 +727,29 @@ const xe = p(function() {
690
727
  r.title && /* @__PURE__ */ e(
691
728
  "h3",
692
729
  {
693
- className: `rcs-emulator-text-base rcs-emulator-font-semibold rcs-emulator-leading-snug ${c ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
730
+ className: `rcs-emulator-text-base rcs-emulator-font-semibold rcs-emulator-leading-snug rcs-emulator-card-title ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
694
731
  children: r.title
695
732
  }
696
733
  ),
697
734
  r.description && /* @__PURE__ */ e(
698
735
  "p",
699
736
  {
700
- className: `rcs-emulator-text-sm rcs-emulator-leading-relaxed rcs-emulator-mt-1-5 ${c ? "rcs-emulator-text-zinc-300" : "rcs-emulator-text-gray-700"}`,
737
+ className: `rcs-emulator-text-sm rcs-emulator-leading-relaxed rcs-emulator-mt-1-5 rcs-emulator-card-subtitle ${c ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
701
738
  children: r.description
702
739
  }
703
740
  ),
704
741
  r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
705
742
  "div",
706
743
  {
707
- className: `rcs-emulator-card-actions rcs-emulator-mt-4 rcs-emulator-divide-y ${c ? "rcs-emulator-divide-zinc-700" : "rcs-emulator-divide-gray-100"} ${u}`,
708
- children: r.suggestions.map((f, w) => /* @__PURE__ */ e(
709
- Me,
744
+ className: `rcs-emulator-card-actions rcs-emulator-mt-4 rcs-emulator-divide-y ${c ? "rcs-emulator-divide-zinc-700" : "rcs-emulator-divide-gray-100"} ${i}`,
745
+ children: r.suggestions.map((h, v) => /* @__PURE__ */ e(
746
+ ze,
710
747
  {
711
- suggestion: f,
712
- onClick: () => i(f),
748
+ suggestion: h,
749
+ onClick: () => u(h),
713
750
  isDark: c
714
751
  },
715
- w
752
+ v
716
753
  ))
717
754
  }
718
755
  )
@@ -722,15 +759,15 @@ const xe = p(function() {
722
759
  ),
723
760
  /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: m })
724
761
  ] });
725
- }), B = "rcs-emulator-w-5 rcs-emulator-h-5 rcs-emulator-text-gray-400", ke = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }), Ne = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), Ce = () => /* @__PURE__ */ n("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
762
+ }), W = "rcs-emulator-w-5 rcs-emulator-h-5 rcs-emulator-text-gray-400", Me = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }), $e = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), Ae = () => /* @__PURE__ */ n("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
726
763
  /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
727
764
  /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
728
- ] }), Le = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), G = () => /* @__PURE__ */ e("svg", { className: B, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), Me = p(function({
765
+ ] }), Ie = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), Q = () => /* @__PURE__ */ e("svg", { className: W, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), ze = f(function({
729
766
  suggestion: r,
730
767
  onClick: t,
731
768
  isDark: o
732
769
  }) {
733
- const a = z(r), l = a ? r.action.displayText : r.reply.displayText;
770
+ const a = T(r), l = a ? r.action.displayText : r.reply.displayText;
734
771
  return /* @__PURE__ */ n(
735
772
  "button",
736
773
  {
@@ -739,149 +776,289 @@ const xe = p(function() {
739
776
  style: { gap: "0.75rem", padding: "0.75rem 1rem" },
740
777
  children: [
741
778
  /* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: (() => {
742
- if (!a) return /* @__PURE__ */ e(G, {});
743
- const { action: u } = r;
744
- return u.urlAction || u.openUrlAction ? /* @__PURE__ */ e(ke, {}) : u.dialerAction || u.dialAction ? /* @__PURE__ */ e(Ne, {}) : u.mapAction || u.viewLocationAction ? /* @__PURE__ */ e(Ce, {}) : u.calendarAction || u.createCalendarEventAction ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(G, {});
779
+ if (!a) return /* @__PURE__ */ e(Q, {});
780
+ const { action: i } = r;
781
+ return i.urlAction || i.openUrlAction ? /* @__PURE__ */ e(Me, {}) : i.dialerAction || i.dialAction ? /* @__PURE__ */ e($e, {}) : i.mapAction || i.viewLocationAction ? /* @__PURE__ */ e(Ae, {}) : i.calendarAction || i.createCalendarEventAction ? /* @__PURE__ */ e(Ie, {}) : /* @__PURE__ */ e(Q, {});
745
782
  })() }),
746
783
  /* @__PURE__ */ e("span", { className: `rcs-emulator-text-sm ${o ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`, children: l })
747
784
  ]
748
785
  }
749
786
  );
750
- }), $e = p(function({ cards: r, timestamp: t }) {
751
- const { theme: o, handleReply: a, handleAction: l } = k(), c = W(null), [u, m] = A(!1), [i, h] = A(r.length > 1), f = o === "dark", w = f ? "rcs-emulator-dark" : "rcs-emulator-light", b = new Date(t).toLocaleTimeString([], {
787
+ }), Te = f(function({
788
+ cards: r,
789
+ timestamp: t
790
+ }) {
791
+ const { theme: o, handleReply: a, handleAction: l } = C(), c = H(null), [i, m] = A(!1), [u, d] = A(r.length > 1), h = o === "dark", v = h ? "rcs-emulator-dark" : "rcs-emulator-light", y = new Date(t).toLocaleTimeString([], {
752
792
  hour: "2-digit",
753
793
  minute: "2-digit"
754
- }), N = (g) => {
755
- "reply" in g ? a(g) : l(g);
756
- }, v = $(() => {
794
+ }), k = (x) => {
795
+ "reply" in x ? a(x) : l(x);
796
+ }, w = M(() => {
757
797
  if (c.current) {
758
- const { scrollLeft: g, scrollWidth: d, clientWidth: x } = c.current;
759
- m(g > 0), h(g < d - x - 10);
798
+ const { scrollLeft: x, scrollWidth: L, clientWidth: b } = c.current;
799
+ m(x > 0), d(x < L - b - 10);
760
800
  }
761
- }, []), y = (g) => {
801
+ }, []), g = (x) => {
762
802
  c.current && c.current.scrollBy({
763
- left: g === "left" ? -200 : 200,
803
+ left: x === "left" ? -200 : 200,
764
804
  behavior: "smooth"
765
805
  });
766
806
  };
767
807
  return /* @__PURE__ */ n("div", { className: "rcs-emulator-w-full rcs-emulator--mx-3", children: [
768
808
  /* @__PURE__ */ n("div", { className: "rcs-emulator-relative", children: [
769
- u && /* @__PURE__ */ e(
809
+ i && /* @__PURE__ */ e(
770
810
  "button",
771
811
  {
772
- onClick: () => y("left"),
773
- className: `rcs-emulator-carousel-arrow rcs-emulator-left ${w}`,
812
+ onClick: () => g("left"),
813
+ className: `rcs-emulator-carousel-arrow rcs-emulator-left ${v}`,
774
814
  "aria-label": "Scroll left",
775
- children: /* @__PURE__ */ e("svg", { className: "rcs-emulator-w-4 rcs-emulator-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
815
+ children: /* @__PURE__ */ e(
816
+ "svg",
817
+ {
818
+ className: "rcs-emulator-w-4 rcs-emulator-h-4",
819
+ fill: "none",
820
+ viewBox: "0 0 24 24",
821
+ stroke: "currentColor",
822
+ children: /* @__PURE__ */ e(
823
+ "path",
824
+ {
825
+ strokeLinecap: "round",
826
+ strokeLinejoin: "round",
827
+ strokeWidth: 2,
828
+ d: "M15 19l-7-7 7-7"
829
+ }
830
+ )
831
+ }
832
+ )
776
833
  }
777
834
  ),
778
835
  /* @__PURE__ */ e(
779
836
  "div",
780
837
  {
781
838
  ref: c,
782
- onScroll: v,
839
+ onScroll: w,
783
840
  className: "rcs-emulator-flex rcs-emulator-gap-2-5 rcs-emulator-overflow-x-auto rcs-emulator-py-1 rcs-emulator-px-3 rcs-emulator-snap-x rcs-emulator-scrollbar-hide",
784
- children: r.map((g, d) => /* @__PURE__ */ e(
785
- ze,
841
+ children: r.map((x, L) => /* @__PURE__ */ e(
842
+ Se,
786
843
  {
787
- card: g,
788
- isDark: f,
789
- onSuggestionClick: N
844
+ card: x,
845
+ isDark: h,
846
+ onSuggestionClick: k
790
847
  },
791
- d
848
+ L
792
849
  ))
793
850
  }
794
851
  ),
795
- i && /* @__PURE__ */ e(
852
+ u && /* @__PURE__ */ e(
796
853
  "button",
797
854
  {
798
- onClick: () => y("right"),
799
- className: `rcs-emulator-carousel-arrow rcs-emulator-right ${w}`,
855
+ onClick: () => g("right"),
856
+ className: `rcs-emulator-carousel-arrow rcs-emulator-right ${v}`,
800
857
  "aria-label": "Scroll right",
801
- children: /* @__PURE__ */ e("svg", { className: "rcs-emulator-w-4 rcs-emulator-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
858
+ children: /* @__PURE__ */ e(
859
+ "svg",
860
+ {
861
+ className: "rcs-emulator-w-4 rcs-emulator-h-4",
862
+ fill: "none",
863
+ viewBox: "0 0 24 24",
864
+ stroke: "currentColor",
865
+ children: /* @__PURE__ */ e(
866
+ "path",
867
+ {
868
+ strokeLinecap: "round",
869
+ strokeLinejoin: "round",
870
+ strokeWidth: 2,
871
+ d: "M9 5l7 7-7 7"
872
+ }
873
+ )
874
+ }
875
+ )
802
876
  }
803
877
  )
804
878
  ] }),
805
- /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: b })
879
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-sr-only", children: y })
806
880
  ] });
807
- }), j = "rcs-emulator-w-4 rcs-emulator-h-4 rcs-emulator-text-gray-400", Ae = (s) => {
808
- if (!z(s))
809
- return /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) });
881
+ }), j = "rcs-emulator-w-4 rcs-emulator-h-4 rcs-emulator-text-gray-400", Ee = (s) => {
882
+ if (!T(s))
883
+ return /* @__PURE__ */ e(
884
+ "svg",
885
+ {
886
+ className: j,
887
+ fill: "none",
888
+ viewBox: "0 0 24 24",
889
+ stroke: "currentColor",
890
+ strokeWidth: 1.5,
891
+ children: /* @__PURE__ */ e(
892
+ "path",
893
+ {
894
+ strokeLinecap: "round",
895
+ strokeLinejoin: "round",
896
+ d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
897
+ }
898
+ )
899
+ }
900
+ );
810
901
  const { action: r } = s;
811
- return r.urlAction || r.openUrlAction ? /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) }) : r.dialerAction || r.dialAction ? /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }) : r.mapAction || r.viewLocationAction ? /* @__PURE__ */ n("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
812
- /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }),
813
- /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
814
- ] }) : r.calendarAction || r.createCalendarEventAction ? /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) : /* @__PURE__ */ e("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) });
815
- }, ze = p(function({
816
- card: r,
817
- isDark: t,
818
- onSuggestionClick: o
819
- }) {
820
- const a = r.layout.width === "small" ? "rcs-emulator-w-44" : "rcs-emulator-w-52", l = t ? "rcs-emulator-dark" : "rcs-emulator-light";
821
- return /* @__PURE__ */ n(
822
- "div",
902
+ return r.urlAction || r.openUrlAction ? /* @__PURE__ */ e(
903
+ "svg",
904
+ {
905
+ className: j,
906
+ fill: "none",
907
+ viewBox: "0 0 24 24",
908
+ stroke: "currentColor",
909
+ strokeWidth: 1.5,
910
+ children: /* @__PURE__ */ e(
911
+ "path",
912
+ {
913
+ strokeLinecap: "round",
914
+ strokeLinejoin: "round",
915
+ d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"
916
+ }
917
+ )
918
+ }
919
+ ) : r.dialerAction || r.dialAction ? /* @__PURE__ */ e(
920
+ "svg",
823
921
  {
824
- className: `rcs-emulator-carousel-card ${a} ${l}`,
922
+ className: j,
923
+ fill: "none",
924
+ viewBox: "0 0 24 24",
925
+ stroke: "currentColor",
926
+ strokeWidth: 1.5,
927
+ children: /* @__PURE__ */ e(
928
+ "path",
929
+ {
930
+ strokeLinecap: "round",
931
+ strokeLinejoin: "round",
932
+ d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
933
+ }
934
+ )
935
+ }
936
+ ) : r.mapAction || r.viewLocationAction ? /* @__PURE__ */ n(
937
+ "svg",
938
+ {
939
+ className: j,
940
+ fill: "none",
941
+ viewBox: "0 0 24 24",
942
+ stroke: "currentColor",
943
+ strokeWidth: 1.5,
825
944
  children: [
826
- r.media && /* @__PURE__ */ e("div", { className: "rcs-emulator-w-full rcs-emulator-h-32 rcs-emulator-bg-gray-200 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
827
- "img",
945
+ /* @__PURE__ */ e(
946
+ "path",
828
947
  {
829
- src: r.media.url,
830
- alt: r.title || "Carousel card media",
831
- className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover",
832
- loading: "lazy"
948
+ strokeLinecap: "round",
949
+ strokeLinejoin: "round",
950
+ d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
833
951
  }
834
- ) }),
835
- /* @__PURE__ */ n("div", { className: "rcs-emulator-p-3", children: [
836
- r.title && /* @__PURE__ */ e(
837
- "h4",
838
- {
839
- className: `rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-leading-tight rcs-emulator-mb-1 rcs-emulator-line-clamp-2 ${t ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
840
- children: r.title
841
- }
842
- ),
843
- r.description && /* @__PURE__ */ e(
844
- "p",
845
- {
846
- className: `rcs-emulator-text-xs rcs-emulator-leading-relaxed rcs-emulator-line-clamp-3 ${t ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-700"}`,
847
- children: r.description
848
- }
849
- ),
850
- r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
851
- "div",
852
- {
853
- className: `rcs-emulator-carousel-actions rcs-emulator-mt-3 rcs-emulator-divide-y ${t ? "rcs-emulator-divide-zinc-600" : "rcs-emulator-divide-gray-100"} ${l}`,
854
- children: r.suggestions.map((c, u) => {
855
- const i = z(c) ? c.action.displayText : c.reply.displayText;
856
- return /* @__PURE__ */ n(
857
- "button",
858
- {
859
- onClick: () => o(c),
860
- className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-xs rcs-emulator-transition-colors rcs-emulator-text-left ${t ? "rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
861
- children: [
862
- /* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: Ae(c) }),
863
- /* @__PURE__ */ e("span", { className: "rcs-emulator-truncate", children: i })
864
- ]
865
- },
866
- u
867
- );
868
- })
869
- }
870
- )
871
- ] })
952
+ ),
953
+ /* @__PURE__ */ e(
954
+ "path",
955
+ {
956
+ strokeLinecap: "round",
957
+ strokeLinejoin: "round",
958
+ d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
959
+ }
960
+ )
872
961
  ]
873
962
  }
963
+ ) : r.calendarAction || r.createCalendarEventAction ? /* @__PURE__ */ e(
964
+ "svg",
965
+ {
966
+ className: j,
967
+ fill: "none",
968
+ viewBox: "0 0 24 24",
969
+ stroke: "currentColor",
970
+ strokeWidth: 1.5,
971
+ children: /* @__PURE__ */ e(
972
+ "path",
973
+ {
974
+ strokeLinecap: "round",
975
+ strokeLinejoin: "round",
976
+ d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
977
+ }
978
+ )
979
+ }
980
+ ) : /* @__PURE__ */ e(
981
+ "svg",
982
+ {
983
+ className: j,
984
+ fill: "none",
985
+ viewBox: "0 0 24 24",
986
+ stroke: "currentColor",
987
+ strokeWidth: 1.5,
988
+ children: /* @__PURE__ */ e(
989
+ "path",
990
+ {
991
+ strokeLinecap: "round",
992
+ strokeLinejoin: "round",
993
+ d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
994
+ }
995
+ )
996
+ }
874
997
  );
875
- }), Ie = {
876
- text: ({ content: s, sender: r, timestamp: t }) => s.type !== "text" ? null : /* @__PURE__ */ e(ve, { text: s.text, sender: r, timestamp: t }),
877
- userReply: ({ content: s, timestamp: r }) => s.type !== "userReply" ? null : /* @__PURE__ */ e(we, { text: s.text, timestamp: r }),
878
- richcard: ({ content: s, timestamp: r }) => s.type !== "richcard" ? null : /* @__PURE__ */ e(ye, { card: s.card, timestamp: r }),
879
- carousel: ({ content: s, timestamp: r }) => s.type !== "carousel" ? null : /* @__PURE__ */ e($e, { cards: s.cards, timestamp: r })
880
- }, Te = p(function({
998
+ }, Se = f(function({
999
+ card: r,
1000
+ isDark: t,
1001
+ onSuggestionClick: o
1002
+ }) {
1003
+ const a = r.layout.width === "small" ? "rcs-emulator-w-44" : "rcs-emulator-w-52", l = t ? "rcs-emulator-dark" : "rcs-emulator-light";
1004
+ return /* @__PURE__ */ n("div", { className: `rcs-emulator-carousel-card ${a} ${l}`, children: [
1005
+ r.media && /* @__PURE__ */ e("div", { className: "rcs-emulator-w-full rcs-emulator-h-32 rcs-emulator-bg-gray-200 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
1006
+ "img",
1007
+ {
1008
+ src: r.media.url,
1009
+ alt: r.title || "Carousel card media",
1010
+ className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover",
1011
+ loading: "lazy"
1012
+ }
1013
+ ) }),
1014
+ /* @__PURE__ */ n("div", { className: "rcs-emulator-p-3", children: [
1015
+ r.title && /* @__PURE__ */ e(
1016
+ "h4",
1017
+ {
1018
+ className: `rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-leading-tight rcs-emulator-mb-1 rcs-emulator-line-clamp-2 ${t ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1019
+ children: r.title
1020
+ }
1021
+ ),
1022
+ r.description && /* @__PURE__ */ e(
1023
+ "p",
1024
+ {
1025
+ className: `rcs-emulator-text-xs rcs-emulator-leading-relaxed rcs-emulator-line-clamp-3 ${t ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-700"}`,
1026
+ children: r.description
1027
+ }
1028
+ ),
1029
+ r.suggestions && r.suggestions.length > 0 && /* @__PURE__ */ e(
1030
+ "div",
1031
+ {
1032
+ className: `rcs-emulator-carousel-actions rcs-emulator-mt-3 rcs-emulator-divide-y ${t ? "rcs-emulator-divide-zinc-600" : "rcs-emulator-divide-gray-100"} ${l}`,
1033
+ children: r.suggestions.map((c, i) => {
1034
+ const u = T(c) ? c.action.displayText : c.reply.displayText;
1035
+ return /* @__PURE__ */ n(
1036
+ "button",
1037
+ {
1038
+ onClick: () => o(c),
1039
+ className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-xs rcs-emulator-transition-colors rcs-emulator-text-left rcs-emulator-border-none ${t ? "rcs-emulator-hover-bg-zinc-700 rcs-emulator-text-white" : "rcs-emulator-hover-bg-gray-50 rcs-emulator-text-gray-900"}`,
1040
+ children: [
1041
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-flex-shrink-0", children: Ee(c) }),
1042
+ /* @__PURE__ */ e("span", { className: "rcs-emulator-truncate", children: u })
1043
+ ]
1044
+ },
1045
+ i
1046
+ );
1047
+ })
1048
+ }
1049
+ )
1050
+ ] })
1051
+ ] });
1052
+ }), je = {
1053
+ text: ({ content: s, sender: r, timestamp: t }) => s.type !== "text" ? null : /* @__PURE__ */ e(Ne, { text: s.text, sender: r, timestamp: t }),
1054
+ userReply: ({ content: s, timestamp: r }) => s.type !== "userReply" ? null : /* @__PURE__ */ e(Ce, { text: s.text, timestamp: r }),
1055
+ richcard: ({ content: s, timestamp: r }) => s.type !== "richcard" ? null : /* @__PURE__ */ e(Le, { card: s.card, timestamp: r }),
1056
+ carousel: ({ content: s, timestamp: r }) => s.type !== "carousel" ? null : /* @__PURE__ */ e(Te, { cards: s.cards, timestamp: r })
1057
+ }, Be = f(function({
881
1058
  message: r,
882
1059
  isLast: t
883
1060
  }) {
884
- const { content: o, sender: a, timestamp: l } = r, c = Ie[o.type];
1061
+ const { content: o, sender: a, timestamp: l } = r, c = je[o.type];
885
1062
  return c ? /* @__PURE__ */ e(
886
1063
  c,
887
1064
  {
@@ -891,8 +1068,8 @@ const xe = p(function() {
891
1068
  showSuggestions: t && a === "business"
892
1069
  }
893
1070
  ) : (console.warn(`Unknown message type: ${o.type}`), /* @__PURE__ */ e("div", { className: "rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-text-gray-500 rcs-emulator-text-sm rcs-emulator-italic", children: "[Unsupported message type]" }));
894
- }), Se = p(function() {
895
- const { theme: r } = k(), t = r === "dark";
1071
+ }), We = f(function() {
1072
+ const { theme: r } = C(), t = r === "dark";
896
1073
  return /* @__PURE__ */ e(
897
1074
  "div",
898
1075
  {
@@ -927,8 +1104,8 @@ const xe = p(function() {
927
1104
  )
928
1105
  }
929
1106
  );
930
- }), je = p(function() {
931
- const { theme: r, state: t } = k(), { chatHistory: o, isTyping: a } = t, l = r === "dark", c = l ? "rcs-emulator-dark" : "rcs-emulator-light";
1107
+ }), Re = f(function() {
1108
+ const { theme: r, state: t } = C(), { chatHistory: o, isTyping: a } = t, l = r === "dark", c = l ? "rcs-emulator-dark" : "rcs-emulator-light";
932
1109
  return /* @__PURE__ */ n(
933
1110
  "div",
934
1111
  {
@@ -951,21 +1128,21 @@ const xe = p(function() {
951
1128
  children: [
952
1129
  o.length === 0 && !a && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-py-12", children: /* @__PURE__ */ e("p", { className: `rcs-emulator-text-sm ${l ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`, children: "No messages yet" }) }),
953
1130
  /* @__PURE__ */ n("div", { className: "rcs-emulator-p-3 rcs-emulator-space-y-3", children: [
954
- o.map((u, m) => /* @__PURE__ */ e(
1131
+ o.map((i, m) => /* @__PURE__ */ e(
955
1132
  "div",
956
1133
  {
957
- className: `rcs-emulator-flex ${u.sender === "user" ? "rcs-emulator-justify-end" : "rcs-emulator-justify-start"}`,
1134
+ className: `rcs-emulator-flex ${i.sender === "user" ? "rcs-emulator-justify-end" : "rcs-emulator-justify-start"}`,
958
1135
  children: /* @__PURE__ */ e(
959
- Te,
1136
+ Be,
960
1137
  {
961
- message: u,
1138
+ message: i,
962
1139
  isLast: m === o.length - 1 && !a
963
1140
  }
964
1141
  )
965
1142
  },
966
- u.id
1143
+ i.id
967
1144
  )),
968
- a && /* @__PURE__ */ e(Se, {})
1145
+ a && /* @__PURE__ */ e(We, {})
969
1146
  ] })
970
1147
  ]
971
1148
  }
@@ -973,21 +1150,21 @@ const xe = p(function() {
973
1150
  ]
974
1151
  }
975
1152
  );
976
- }), Ee = p(function({
1153
+ }), Ve = f(function({
977
1154
  suggestion: r,
978
1155
  onClick: t,
979
1156
  variant: o = "bar"
980
1157
  }) {
981
- const { theme: a, businessInfo: l } = k(), c = a === "dark", u = z(r), m = u ? r.action.displayText : r.reply.displayText, i = u ? Be(r) : null, h = l.brandColor || "#0084ff", f = c ? "rcs-emulator-dark" : "rcs-emulator-light";
1158
+ const { theme: a, businessInfo: l } = C(), c = a === "dark", i = T(r), m = i ? r.action.displayText : r.reply.displayText, u = i ? Oe(r) : null, d = l.brandColor || "#1A73E8", h = c ? "rcs-emulator-dark" : "rcs-emulator-light";
982
1159
  return o === "bar" ? /* @__PURE__ */ n(
983
1160
  "button",
984
1161
  {
985
1162
  type: "button",
986
1163
  onClick: t,
987
- className: `rcs-emulator-suggestion-chip rcs-emulator-inline-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium rcs-emulator-whitespace-nowrap rcs-emulator-transition-colors rcs-emulator-flex-shrink-0 rcs-emulator-border ${f}`,
988
- "aria-label": u ? `${Re(r)}: ${m}` : m,
1164
+ className: `rcs-emulator-suggestion-chip rcs-emulator-inline-flex rcs-emulator-items-center rcs-emulator-gap-2 rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium rcs-emulator-whitespace-nowrap rcs-emulator-transition-colors rcs-emulator-flex-shrink-0 rcs-emulator-border ${h}`,
1165
+ "aria-label": i ? `${Ue(r)}: ${m}` : m,
989
1166
  children: [
990
- i && /* @__PURE__ */ e("span", { style: { color: h }, children: /* @__PURE__ */ e(i, { className: "rcs-emulator-w-4 rcs-emulator-h-4" }) }),
1167
+ u && /* @__PURE__ */ e("span", { style: { color: d }, children: /* @__PURE__ */ e(u, { className: "rcs-emulator-w-4 rcs-emulator-h-4" }) }),
991
1168
  /* @__PURE__ */ e("span", { className: "rcs-emulator-text-sm rcs-emulator-font-medium", children: m })
992
1169
  ]
993
1170
  }
@@ -996,18 +1173,18 @@ const xe = p(function() {
996
1173
  {
997
1174
  type: "button",
998
1175
  onClick: t,
999
- className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-left rcs-emulator-transition-colors rcs-emulator-rounded-lg rcs-emulator-list-item ${f}`,
1176
+ className: `rcs-emulator-w-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-3 rcs-emulator-py-2-5 rcs-emulator-text-left rcs-emulator-transition-colors rcs-emulator-rounded-lg rcs-emulator-list-item rcs-emulator-border-none ${h}`,
1000
1177
  children: [
1001
- i && /* @__PURE__ */ e(
1178
+ u && /* @__PURE__ */ e(
1002
1179
  "div",
1003
1180
  {
1004
1181
  className: "rcs-emulator-w-8 rcs-emulator-h-8 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-flex-shrink-0",
1005
- style: { backgroundColor: `${h}15` },
1182
+ style: { backgroundColor: `${d}15` },
1006
1183
  children: /* @__PURE__ */ e(
1007
- i,
1184
+ u,
1008
1185
  {
1009
1186
  className: "rcs-emulator-w-4 rcs-emulator-h-4",
1010
- style: { color: h }
1187
+ style: { color: d }
1011
1188
  }
1012
1189
  )
1013
1190
  }
@@ -1030,135 +1207,107 @@ const xe = p(function() {
1030
1207
  children: m
1031
1208
  }
1032
1209
  );
1033
- });
1034
- function Be(s) {
1035
- if (!z(s)) return null;
1036
- const { action: r } = s;
1037
- return r.openUrlAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
1038
- "svg",
1039
- {
1040
- className: t,
1041
- style: o,
1042
- fill: "none",
1043
- viewBox: "0 0 24 24",
1044
- stroke: "currentColor",
1045
- strokeWidth: 2,
1046
- children: /* @__PURE__ */ e(
1047
- "path",
1048
- {
1049
- strokeLinecap: "round",
1050
- strokeLinejoin: "round",
1051
- d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"
1052
- }
1053
- )
1054
- }
1055
- ) : r.dialAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
1056
- "svg",
1057
- {
1058
- className: t,
1059
- style: o,
1060
- fill: "none",
1061
- viewBox: "0 0 24 24",
1062
- stroke: "currentColor",
1063
- strokeWidth: 2,
1064
- children: /* @__PURE__ */ e(
1210
+ }), He = ({ className: s, style: r }) => /* @__PURE__ */ e(
1211
+ "svg",
1212
+ {
1213
+ className: s,
1214
+ style: r,
1215
+ fill: "none",
1216
+ viewBox: "0 0 24 24",
1217
+ stroke: "currentColor",
1218
+ strokeWidth: 2,
1219
+ children: /* @__PURE__ */ e(
1220
+ "path",
1221
+ {
1222
+ strokeLinecap: "round",
1223
+ strokeLinejoin: "round",
1224
+ d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"
1225
+ }
1226
+ )
1227
+ }
1228
+ ), De = ({ className: s, style: r }) => /* @__PURE__ */ e(
1229
+ "svg",
1230
+ {
1231
+ className: s,
1232
+ style: r,
1233
+ fill: "none",
1234
+ viewBox: "0 0 24 24",
1235
+ stroke: "currentColor",
1236
+ strokeWidth: 2,
1237
+ children: /* @__PURE__ */ e(
1238
+ "path",
1239
+ {
1240
+ strokeLinecap: "round",
1241
+ strokeLinejoin: "round",
1242
+ d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
1243
+ }
1244
+ )
1245
+ }
1246
+ ), Pe = ({ className: s, style: r }) => /* @__PURE__ */ n(
1247
+ "svg",
1248
+ {
1249
+ className: s,
1250
+ style: r,
1251
+ fill: "none",
1252
+ viewBox: "0 0 24 24",
1253
+ stroke: "currentColor",
1254
+ strokeWidth: 2,
1255
+ children: [
1256
+ /* @__PURE__ */ e(
1065
1257
  "path",
1066
1258
  {
1067
1259
  strokeLinecap: "round",
1068
1260
  strokeLinejoin: "round",
1069
- d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
1261
+ d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
1070
1262
  }
1071
- )
1072
- }
1073
- ) : r.shareLocationAction ? ({ className: t, style: o }) => /* @__PURE__ */ n(
1074
- "svg",
1075
- {
1076
- className: t,
1077
- style: o,
1078
- fill: "none",
1079
- viewBox: "0 0 24 24",
1080
- stroke: "currentColor",
1081
- strokeWidth: 2,
1082
- children: [
1083
- /* @__PURE__ */ e(
1084
- "path",
1085
- {
1086
- strokeLinecap: "round",
1087
- strokeLinejoin: "round",
1088
- d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
1089
- }
1090
- ),
1091
- /* @__PURE__ */ e(
1092
- "path",
1093
- {
1094
- strokeLinecap: "round",
1095
- strokeLinejoin: "round",
1096
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
1097
- }
1098
- )
1099
- ]
1100
- }
1101
- ) : r.viewLocationAction ? ({ className: t, style: o }) => /* @__PURE__ */ n(
1102
- "svg",
1103
- {
1104
- className: t,
1105
- style: o,
1106
- fill: "none",
1107
- viewBox: "0 0 24 24",
1108
- stroke: "currentColor",
1109
- strokeWidth: 2,
1110
- children: [
1111
- /* @__PURE__ */ e(
1112
- "path",
1113
- {
1114
- strokeLinecap: "round",
1115
- strokeLinejoin: "round",
1116
- d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
1117
- }
1118
- ),
1119
- /* @__PURE__ */ e(
1120
- "path",
1121
- {
1122
- strokeLinecap: "round",
1123
- strokeLinejoin: "round",
1124
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
1125
- }
1126
- )
1127
- ]
1128
- }
1129
- ) : r.createCalendarEventAction ? ({ className: t, style: o }) => /* @__PURE__ */ e(
1130
- "svg",
1131
- {
1132
- className: t,
1133
- style: o,
1134
- fill: "none",
1135
- viewBox: "0 0 24 24",
1136
- stroke: "currentColor",
1137
- strokeWidth: 2,
1138
- children: /* @__PURE__ */ e(
1263
+ ),
1264
+ /* @__PURE__ */ e(
1139
1265
  "path",
1140
1266
  {
1141
1267
  strokeLinecap: "round",
1142
1268
  strokeLinejoin: "round",
1143
- d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
1269
+ d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
1144
1270
  }
1145
1271
  )
1146
- }
1147
- ) : null;
1272
+ ]
1273
+ }
1274
+ ), _e = ({ className: s, style: r }) => /* @__PURE__ */ e(
1275
+ "svg",
1276
+ {
1277
+ className: s,
1278
+ style: r,
1279
+ fill: "none",
1280
+ viewBox: "0 0 24 24",
1281
+ stroke: "currentColor",
1282
+ strokeWidth: 2,
1283
+ children: /* @__PURE__ */ e(
1284
+ "path",
1285
+ {
1286
+ strokeLinecap: "round",
1287
+ strokeLinejoin: "round",
1288
+ d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
1289
+ }
1290
+ )
1291
+ }
1292
+ );
1293
+ function Oe(s) {
1294
+ if (!T(s)) return null;
1295
+ const { action: r } = s;
1296
+ return r.openUrlAction || r.urlAction ? He : r.dialAction || r.dialerAction ? De : r.shareLocationAction || r.viewLocationAction || r.mapAction ? Pe : r.createCalendarEventAction || r.calendarAction ? _e : null;
1148
1297
  }
1149
- function Re(s) {
1150
- if (!z(s)) return "Reply";
1298
+ function Ue(s) {
1299
+ if (!T(s)) return "Reply";
1151
1300
  const { action: r } = s;
1152
- return r.openUrlAction ? "Open link" : r.dialAction ? "Call" : r.shareLocationAction ? "Share location" : r.viewLocationAction ? "View location" : r.createCalendarEventAction ? "Add to calendar" : "Action";
1301
+ return r.openUrlAction || r.urlAction ? "Open link" : r.dialAction || r.dialerAction ? "Call" : r.shareLocationAction ? "Share location" : r.viewLocationAction || r.mapAction ? "View location" : r.createCalendarEventAction || r.calendarAction ? "Add to calendar" : "Action";
1153
1302
  }
1154
- const We = p(function({
1303
+ const Ge = f(function({
1155
1304
  suggestions: r
1156
1305
  }) {
1157
- const { theme: t, handleReply: o, handleAction: a } = k(), l = t === "dark";
1306
+ const { theme: t, handleReply: o, handleAction: a } = C(), l = t === "dark";
1158
1307
  if (!r || r.length === 0)
1159
1308
  return null;
1160
- const c = (u) => {
1161
- Y(u) ? o(u) : z(u) && a(u);
1309
+ const c = (i) => {
1310
+ ee(i) ? o(i) : T(i) && a(i);
1162
1311
  };
1163
1312
  return /* @__PURE__ */ e(
1164
1313
  "div",
@@ -1170,11 +1319,11 @@ const We = p(function({
1170
1319
  "div",
1171
1320
  {
1172
1321
  className: "rcs-emulator-flex rcs-emulator-gap-2 rcs-emulator-overflow-x-auto rcs-emulator-pb-1 rcs-emulator--mx-1 rcs-emulator-px-1 rcs-emulator-scrollbar-hide",
1173
- children: r.map((u, m) => /* @__PURE__ */ e(
1174
- Ee,
1322
+ children: r.map((i, m) => /* @__PURE__ */ e(
1323
+ Ve,
1175
1324
  {
1176
- suggestion: u,
1177
- onClick: () => c(u),
1325
+ suggestion: i,
1326
+ onClick: () => c(i),
1178
1327
  variant: "bar"
1179
1328
  },
1180
1329
  m
@@ -1183,17 +1332,17 @@ const We = p(function({
1183
1332
  )
1184
1333
  }
1185
1334
  );
1186
- }), Ve = p(function() {
1187
- const { theme: r, state: t, showSuggestions: o } = k(), { chatHistory: a, isTyping: l, error: c } = t, u = ge([
1335
+ }), Fe = f(function() {
1336
+ const { theme: r, state: t, showSuggestions: o } = C(), { chatHistory: a, isTyping: l, error: c } = t, i = we([
1188
1337
  a.length,
1189
1338
  l
1190
- ]), m = r === "dark", i = m ? "rcs-emulator-dark" : "rcs-emulator-light", h = a[a.length - 1], f = o && h?.sender === "business" && !l ? h.suggestions : void 0;
1339
+ ]), m = r === "dark", u = m ? "rcs-emulator-dark" : "rcs-emulator-light", d = a[a.length - 1], h = o && d?.sender === "business" && !l ? d.suggestions : void 0;
1191
1340
  return /* @__PURE__ */ n(
1192
1341
  "div",
1193
1342
  {
1194
- className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-overflow-hidden ${m ? "rcs-emulator-bg-zinc-950" : "rcs-emulator-bg-white"}`,
1343
+ className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-overflow-hidden ${m ? "rcs-emulator-dark" : "rcs-emulator-light"}`,
1195
1344
  children: [
1196
- /* @__PURE__ */ e(xe, {}),
1345
+ /* @__PURE__ */ e(ye, {}),
1197
1346
  c && /* @__PURE__ */ e(
1198
1347
  "div",
1199
1348
  {
@@ -1202,21 +1351,21 @@ const We = p(function({
1202
1351
  children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-red-500", children: c })
1203
1352
  }
1204
1353
  ),
1205
- /* @__PURE__ */ n("div", { ref: u, className: "rcs-emulator-flex-1 rcs-emulator-overflow-y-auto rcs-emulator-scrollbar", children: [
1206
- /* @__PURE__ */ e(be, {}),
1207
- /* @__PURE__ */ e(je, {})
1354
+ /* @__PURE__ */ n("div", { ref: i, className: "rcs-emulator-flex-1 rcs-emulator-overflow-y-auto rcs-emulator-scrollbar", children: [
1355
+ /* @__PURE__ */ e(ke, {}),
1356
+ /* @__PURE__ */ e(Re, {})
1208
1357
  ] }),
1209
- f && f.length > 0 && /* @__PURE__ */ e(We, { suggestions: f }),
1358
+ h && h.length > 0 && /* @__PURE__ */ e(Ge, { suggestions: h }),
1210
1359
  /* @__PURE__ */ n(
1211
1360
  "div",
1212
1361
  {
1213
- className: `rcs-emulator-input-area ${i}`,
1362
+ className: `rcs-emulator-input-area ${u}`,
1214
1363
  children: [
1215
1364
  /* @__PURE__ */ e(
1216
1365
  "button",
1217
1366
  {
1218
1367
  type: "button",
1219
- className: `rcs-emulator-add-btn ${i}`,
1368
+ className: `rcs-emulator-add-btn ${u}`,
1220
1369
  "aria-label": "Add attachment",
1221
1370
  children: /* @__PURE__ */ e(
1222
1371
  "svg",
@@ -1241,7 +1390,7 @@ const We = p(function({
1241
1390
  /* @__PURE__ */ n(
1242
1391
  "div",
1243
1392
  {
1244
- className: `rcs-emulator-input-container ${i}`,
1393
+ className: `rcs-emulator-input-container ${u}`,
1245
1394
  children: [
1246
1395
  /* @__PURE__ */ e(
1247
1396
  "span",
@@ -1320,8 +1469,8 @@ const We = p(function({
1320
1469
  ]
1321
1470
  }
1322
1471
  );
1323
- }), He = p(function() {
1324
- const { theme: r, businessInfo: t, toggleProfile: o } = k(), [a, l] = A("info"), c = r === "dark", u = t.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", m = t.brandColor || "#0084ff";
1472
+ }), Je = f(function() {
1473
+ const { theme: r, businessInfo: t, toggleProfile: o } = C(), [a, l] = A("info"), c = r === "dark", i = t.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", m = t.brandColor || "#0084ff";
1325
1474
  return /* @__PURE__ */ n(
1326
1475
  "div",
1327
1476
  {
@@ -1372,7 +1521,7 @@ const We = p(function({
1372
1521
  /* @__PURE__ */ e("div", { className: "rcs-emulator-relative rcs-emulator-h-40 rcs-emulator-bg-gray-200", children: /* @__PURE__ */ e(
1373
1522
  "img",
1374
1523
  {
1375
- src: u,
1524
+ src: i,
1376
1525
  alt: "Business banner",
1377
1526
  className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-object-cover"
1378
1527
  }
@@ -1410,41 +1559,41 @@ const We = p(function({
1410
1559
  ] }),
1411
1560
  /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-gap-4 rcs-emulator-px-4 rcs-emulator-pb-4", children: [
1412
1561
  t.phoneNumbers && t.phoneNumbers.length > 0 && /* @__PURE__ */ e(
1413
- _,
1562
+ G,
1414
1563
  {
1415
1564
  icon: "phone",
1416
1565
  label: "Call",
1417
1566
  isDark: c,
1418
1567
  brandColor: m,
1419
1568
  onClick: () => {
1420
- const i = t.phoneNumbers?.[0]?.number;
1421
- i && (window.location.href = `tel:${i}`);
1569
+ const u = t.phoneNumbers?.[0]?.number;
1570
+ u && (window.location.href = `tel:${u}`);
1422
1571
  }
1423
1572
  }
1424
1573
  ),
1425
1574
  t.websites && t.websites.length > 0 && /* @__PURE__ */ e(
1426
- _,
1575
+ G,
1427
1576
  {
1428
1577
  icon: "globe",
1429
1578
  label: "Website",
1430
1579
  isDark: c,
1431
1580
  brandColor: m,
1432
1581
  onClick: () => {
1433
- const i = t.websites?.[0]?.url;
1434
- i && window.open(i, "_blank", "noopener,noreferrer");
1582
+ const u = t.websites?.[0]?.url;
1583
+ u && window.open(u, "_blank", "noopener,noreferrer");
1435
1584
  }
1436
1585
  }
1437
1586
  ),
1438
1587
  t.emails && t.emails.length > 0 && /* @__PURE__ */ e(
1439
- _,
1588
+ G,
1440
1589
  {
1441
1590
  icon: "mail",
1442
1591
  label: "Contact",
1443
1592
  isDark: c,
1444
1593
  brandColor: m,
1445
1594
  onClick: () => {
1446
- const i = t.emails?.[0]?.email;
1447
- i && (window.location.href = `mailto:${i}`);
1595
+ const u = t.emails?.[0]?.email;
1596
+ u && (window.location.href = `mailto:${u}`);
1448
1597
  }
1449
1598
  }
1450
1599
  )
@@ -1455,7 +1604,7 @@ const We = p(function({
1455
1604
  className: `rcs-emulator-tabs-container rcs-emulator-flex rcs-emulator-mx-4 rcs-emulator-rounded-lg rcs-emulator-overflow-hidden rcs-emulator-border ${c ? "rcs-emulator-border-zinc-700 rcs-emulator-bg-zinc-800" : "rcs-emulator-border-gray-200 rcs-emulator-bg-gray-100"}`,
1456
1605
  children: [
1457
1606
  /* @__PURE__ */ e(
1458
- F,
1607
+ Z,
1459
1608
  {
1460
1609
  active: a === "info",
1461
1610
  onClick: () => l("info"),
@@ -1465,7 +1614,7 @@ const We = p(function({
1465
1614
  }
1466
1615
  ),
1467
1616
  /* @__PURE__ */ e(
1468
- F,
1617
+ Z,
1469
1618
  {
1470
1619
  active: a === "options",
1471
1620
  onClick: () => l("options"),
@@ -1477,12 +1626,12 @@ const We = p(function({
1477
1626
  ]
1478
1627
  }
1479
1628
  ),
1480
- /* @__PURE__ */ e("div", { className: "rcs-emulator-p-4", children: a === "info" ? /* @__PURE__ */ e(_e, { isDark: c, brandColor: m }) : /* @__PURE__ */ e(Ue, { isDark: c }) })
1629
+ /* @__PURE__ */ e("div", { className: "rcs-emulator-p-4", children: a === "info" ? /* @__PURE__ */ e(Ye, { isDark: c, brandColor: m }) : /* @__PURE__ */ e(qe, { isDark: c }) })
1481
1630
  ] })
1482
1631
  ]
1483
1632
  }
1484
1633
  );
1485
- }), _ = p(function({
1634
+ }), G = f(function({
1486
1635
  icon: r,
1487
1636
  label: t,
1488
1637
  isDark: o,
@@ -1543,7 +1692,7 @@ const We = p(function({
1543
1692
  ]
1544
1693
  }
1545
1694
  );
1546
- }), F = p(function({
1695
+ }), Z = f(function({
1547
1696
  active: r,
1548
1697
  onClick: t,
1549
1698
  isDark: o,
@@ -1559,15 +1708,15 @@ const We = p(function({
1559
1708
  children: l
1560
1709
  }
1561
1710
  );
1562
- }), _e = p(function({ isDark: r, brandColor: t }) {
1563
- const { businessInfo: o } = k();
1711
+ }), Ye = f(function({ isDark: r, brandColor: t }) {
1712
+ const { businessInfo: o } = C();
1564
1713
  return o.phoneNumbers && o.phoneNumbers.length > 0 || o.websites && o.websites.length > 0 || o.emails && o.emails.length > 0 ? /* @__PURE__ */ n(
1565
1714
  "div",
1566
1715
  {
1567
1716
  className: `rcs-emulator-profile-section rcs-emulator-rounded-xl rcs-emulator-overflow-hidden rcs-emulator-border rcs-emulator-divide-y ${r ? "rcs-emulator-dark rcs-emulator-divide-zinc-800" : "rcs-emulator-light rcs-emulator-divide-gray-200"}`,
1568
1717
  children: [
1569
1718
  o.phoneNumbers?.map((l, c) => /* @__PURE__ */ e(
1570
- U,
1719
+ F,
1571
1720
  {
1572
1721
  icon: "phone",
1573
1722
  primary: l.number,
@@ -1579,7 +1728,7 @@ const We = p(function({
1579
1728
  `phone-${c}`
1580
1729
  )),
1581
1730
  o.websites?.map((l, c) => /* @__PURE__ */ e(
1582
- U,
1731
+ F,
1583
1732
  {
1584
1733
  icon: "globe",
1585
1734
  primary: l.url.replace(/^https?:\/\//, ""),
@@ -1591,7 +1740,7 @@ const We = p(function({
1591
1740
  `web-${c}`
1592
1741
  )),
1593
1742
  o.emails?.map((l, c) => /* @__PURE__ */ e(
1594
- U,
1743
+ F,
1595
1744
  {
1596
1745
  icon: "mail",
1597
1746
  primary: l.email,
@@ -1611,7 +1760,7 @@ const We = p(function({
1611
1760
  children: "No contact information available"
1612
1761
  }
1613
1762
  );
1614
- }), U = p(function({
1763
+ }), F = f(function({
1615
1764
  icon: r,
1616
1765
  primary: t,
1617
1766
  secondary: o,
@@ -1665,14 +1814,14 @@ const We = p(function({
1665
1814
  ]
1666
1815
  }
1667
1816
  );
1668
- }), Ue = p(function({ isDark: r }) {
1817
+ }), qe = f(function({ isDark: r }) {
1669
1818
  return /* @__PURE__ */ n(
1670
1819
  "div",
1671
1820
  {
1672
1821
  className: `rcs-emulator-profile-section rcs-emulator-rounded-xl rcs-emulator-overflow-hidden rcs-emulator-border rcs-emulator-divide-y ${r ? "rcs-emulator-dark rcs-emulator-divide-zinc-800" : "rcs-emulator-light rcs-emulator-divide-gray-200"}`,
1673
1822
  children: [
1674
1823
  /* @__PURE__ */ e(
1675
- D,
1824
+ J,
1676
1825
  {
1677
1826
  icon: "bell",
1678
1827
  label: "Notifications",
@@ -1680,7 +1829,7 @@ const We = p(function({
1680
1829
  }
1681
1830
  ),
1682
1831
  /* @__PURE__ */ e(
1683
- D,
1832
+ J,
1684
1833
  {
1685
1834
  icon: "block",
1686
1835
  label: "Block & report spam",
@@ -1688,7 +1837,7 @@ const We = p(function({
1688
1837
  }
1689
1838
  ),
1690
1839
  /* @__PURE__ */ e(
1691
- D,
1840
+ J,
1692
1841
  {
1693
1842
  icon: "info",
1694
1843
  label: "About RCS",
@@ -1698,7 +1847,7 @@ const We = p(function({
1698
1847
  ]
1699
1848
  }
1700
1849
  );
1701
- }), D = p(function({
1850
+ }), J = f(function({
1702
1851
  icon: r,
1703
1852
  label: t,
1704
1853
  isDark: o
@@ -1740,39 +1889,39 @@ const We = p(function({
1740
1889
  ]
1741
1890
  }
1742
1891
  );
1743
- }), q = {
1892
+ }), K = {
1744
1893
  FULL: "rcs-emulator-webview-full",
1745
1894
  TALL: "rcs-emulator-webview-tall",
1746
1895
  HALF: "rcs-emulator-webview-half"
1747
- }, De = p(function() {
1748
- const { theme: r, businessInfo: t, webView: o, closeWebView: a } = k(), [l, c] = A(!0), [u, m] = A(!1), i = r === "dark", h = t.brandColor || "#0084ff";
1749
- E(() => {
1896
+ }, Qe = f(function() {
1897
+ const { theme: r, businessInfo: t, webView: o, closeWebView: a } = C(), [l, c] = A(!0), [i, m] = A(!1), u = r === "dark", d = t.brandColor || "#0084ff";
1898
+ B(() => {
1750
1899
  o?.url && (c(!0), m(!1));
1751
1900
  }, [o?.url]);
1752
- const f = $(() => {
1901
+ const h = M(() => {
1753
1902
  c(!1);
1754
- }, []), w = $(() => {
1903
+ }, []), v = M(() => {
1755
1904
  c(!1), m(!0);
1756
- }, []), b = (C) => {
1905
+ }, []), y = (N) => {
1757
1906
  try {
1758
- return new URL(C).hostname;
1907
+ return new URL(N).hostname;
1759
1908
  } catch {
1760
1909
  return "Web Page";
1761
1910
  }
1762
1911
  };
1763
1912
  if (!o || !o.isOpen) return null;
1764
- const { url: N, viewMode: v, title: y, postbackData: g } = o, d = y || b(N), x = v === "FULL", L = v === "TALL" || v === "HALF", I = q[v] || q.TALL;
1913
+ const { url: k, viewMode: w, title: g, postbackData: x } = o, L = g || y(k), b = w === "FULL", $ = w === "TALL" || w === "HALF", S = K[w] || K.TALL;
1765
1914
  return /* @__PURE__ */ n(
1766
1915
  "div",
1767
1916
  {
1768
- className: `rcs-emulator-webview-overlay ${x ? "rcs-emulator-webview-full" : "rcs-emulator-webview-bottom-sheet"} rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${x ? "" : "rcs-emulator-justify-end"} ${i ? "rcs-emulator-bg-black-60" : "rcs-emulator-bg-black-40"}`,
1917
+ className: `rcs-emulator-webview-overlay ${b ? "rcs-emulator-webview-full" : "rcs-emulator-webview-bottom-sheet"} rcs-emulator-absolute rcs-emulator-inset-0 rcs-emulator-z-50 rcs-emulator-flex rcs-emulator-flex-col ${b ? "" : "rcs-emulator-justify-end"} ${u ? "rcs-emulator-bg-black-60" : "rcs-emulator-bg-black-40"}`,
1769
1918
  role: "dialog",
1770
1919
  "aria-modal": "true",
1771
- "aria-label": `WebView: ${d}`,
1772
- "data-postback": g,
1773
- "data-view-mode": v,
1920
+ "aria-label": `WebView: ${L}`,
1921
+ "data-postback": x,
1922
+ "data-view-mode": w,
1774
1923
  children: [
1775
- L && /* @__PURE__ */ e(
1924
+ $ && /* @__PURE__ */ e(
1776
1925
  "button",
1777
1926
  {
1778
1927
  type: "button",
@@ -1784,7 +1933,7 @@ const We = p(function({
1784
1933
  /* @__PURE__ */ n(
1785
1934
  "div",
1786
1935
  {
1787
- className: `rcs-emulator-relative rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-overflow-hidden ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"} ${I} rcs-emulator-w-full ${L ? "rcs-emulator-rounded-t-2xl rcs-emulator-shadow-2xl" : ""}`,
1936
+ className: `rcs-emulator-relative rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-overflow-hidden ${u ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"} ${S} rcs-emulator-w-full ${$ ? "rcs-emulator-rounded-t-2xl rcs-emulator-shadow-2xl" : ""}`,
1788
1937
  style: {
1789
1938
  // Ensure container is above backdrop
1790
1939
  position: "relative",
@@ -1794,14 +1943,14 @@ const We = p(function({
1794
1943
  /* @__PURE__ */ n(
1795
1944
  "header",
1796
1945
  {
1797
- className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-2 rcs-emulator-py-2 rcs-emulator-flex-shrink-0 rcs-emulator-border-b ${i ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
1946
+ className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-px-2 rcs-emulator-py-2 rcs-emulator-flex-shrink-0 rcs-emulator-border-b ${u ? "rcs-emulator-bg-zinc-900 rcs-emulator-border-zinc-800" : "rcs-emulator-bg-white rcs-emulator-border-gray-200"}`,
1798
1947
  children: [
1799
1948
  /* @__PURE__ */ e(
1800
1949
  "button",
1801
1950
  {
1802
1951
  type: "button",
1803
1952
  onClick: a,
1804
- className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-transition-colors ${i ? "rcs-emulator-text-white rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-100"}`,
1953
+ className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-transition-colors ${u ? "rcs-emulator-text-white rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-100"}`,
1805
1954
  "aria-label": "Close WebView",
1806
1955
  children: /* @__PURE__ */ e(
1807
1956
  "svg",
@@ -1827,15 +1976,15 @@ const We = p(function({
1827
1976
  /* @__PURE__ */ e(
1828
1977
  "h2",
1829
1978
  {
1830
- className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${i ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1831
- children: d
1979
+ className: `rcs-emulator-text-base rcs-emulator-font-medium rcs-emulator-truncate ${u ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
1980
+ children: L
1832
1981
  }
1833
1982
  ),
1834
1983
  /* @__PURE__ */ e(
1835
1984
  "p",
1836
1985
  {
1837
- className: `rcs-emulator-text-xs rcs-emulator-truncate ${i ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
1838
- children: b(N)
1986
+ className: `rcs-emulator-text-xs rcs-emulator-truncate ${u ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
1987
+ children: y(k)
1839
1988
  }
1840
1989
  )
1841
1990
  ] }),
@@ -1843,7 +1992,7 @@ const We = p(function({
1843
1992
  "button",
1844
1993
  {
1845
1994
  type: "button",
1846
- className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center ${i ? "rcs-emulator-text-zinc-400 rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-500 rcs-emulator-hover-bg-gray-100"}`,
1995
+ className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center ${u ? "rcs-emulator-text-zinc-400 rcs-emulator-hover-bg-zinc-800" : "rcs-emulator-text-gray-500 rcs-emulator-hover-bg-gray-100"}`,
1847
1996
  "aria-label": "More options",
1848
1997
  children: /* @__PURE__ */ n(
1849
1998
  "svg",
@@ -1867,23 +2016,23 @@ const We = p(function({
1867
2016
  "div",
1868
2017
  {
1869
2018
  className: "rcs-emulator-absolute rcs-emulator-top-14 rcs-emulator-left-0 rcs-emulator-right-0 rcs-emulator-h-1 rcs-emulator-overflow-hidden",
1870
- style: { backgroundColor: `${h}20` },
2019
+ style: { backgroundColor: `${d}20` },
1871
2020
  children: /* @__PURE__ */ e(
1872
2021
  "div",
1873
2022
  {
1874
2023
  className: "rcs-emulator-h-full rcs-emulator-animate-pulse rcs-emulator-webview-loading-bar",
1875
2024
  style: {
1876
- backgroundColor: h,
2025
+ backgroundColor: d,
1877
2026
  width: "30%"
1878
2027
  }
1879
2028
  }
1880
2029
  )
1881
2030
  }
1882
2031
  ),
1883
- u && /* @__PURE__ */ n(
2032
+ i && /* @__PURE__ */ n(
1884
2033
  "div",
1885
2034
  {
1886
- className: `rcs-emulator-flex-1 rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-p-6 rcs-emulator-text-center ${i ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2035
+ className: `rcs-emulator-flex-1 rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-p-6 rcs-emulator-text-center ${u ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
1887
2036
  children: [
1888
2037
  /* @__PURE__ */ e(
1889
2038
  "svg",
@@ -1910,30 +2059,30 @@ const We = p(function({
1910
2059
  {
1911
2060
  type: "button",
1912
2061
  onClick: a,
1913
- className: `rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium ${i ? "rcs-emulator-bg-zinc-800 rcs-emulator-text-white rcs-emulator-hover-bg-zinc-700" : "rcs-emulator-bg-gray-100 rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-200"}`,
2062
+ className: `rcs-emulator-px-4 rcs-emulator-py-2 rcs-emulator-rounded-full rcs-emulator-text-sm rcs-emulator-font-medium ${u ? "rcs-emulator-bg-zinc-800 rcs-emulator-text-white rcs-emulator-hover-bg-zinc-700" : "rcs-emulator-bg-gray-100 rcs-emulator-text-gray-700 rcs-emulator-hover-bg-gray-200"}`,
1914
2063
  children: "Go Back"
1915
2064
  }
1916
2065
  )
1917
2066
  ]
1918
2067
  }
1919
2068
  ),
1920
- !u && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex-1 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
2069
+ !i && /* @__PURE__ */ e("div", { className: "rcs-emulator-flex-1 rcs-emulator-overflow-hidden", children: /* @__PURE__ */ e(
1921
2070
  "iframe",
1922
2071
  {
1923
- src: N,
1924
- title: d,
2072
+ src: k,
2073
+ title: L,
1925
2074
  className: "rcs-emulator-w-full rcs-emulator-h-full rcs-emulator-border-0",
1926
- onLoad: f,
1927
- onError: w,
2075
+ onLoad: h,
2076
+ onError: v,
1928
2077
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
1929
2078
  referrerPolicy: "no-referrer-when-downgrade",
1930
2079
  loading: "lazy"
1931
2080
  }
1932
2081
  ) }),
1933
- L && /* @__PURE__ */ e(
2082
+ $ && /* @__PURE__ */ e(
1934
2083
  "div",
1935
2084
  {
1936
- className: `rcs-emulator-h-2 rcs-emulator-flex-shrink-0 ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"}`
2085
+ className: `rcs-emulator-h-2 rcs-emulator-flex-shrink-0 ${u ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-white"}`
1937
2086
  }
1938
2087
  )
1939
2088
  ]
@@ -1942,22 +2091,22 @@ const We = p(function({
1942
2091
  ]
1943
2092
  }
1944
2093
  );
1945
- }), Oe = p(function({
2094
+ }), Ze = f(function({
1946
2095
  onUnlock: r,
1947
2096
  messagePreview: t = "New message"
1948
2097
  }) {
1949
- const { theme: o, businessInfo: a } = k(), [l, c] = A(/* @__PURE__ */ new Date()), u = o === "dark";
1950
- E(() => {
1951
- const f = setInterval(() => {
2098
+ const { theme: o, businessInfo: a } = C(), [l, c] = A(/* @__PURE__ */ new Date()), i = o === "dark";
2099
+ B(() => {
2100
+ const d = setInterval(() => {
1952
2101
  c(/* @__PURE__ */ new Date());
1953
2102
  }, 1e3);
1954
- return () => clearInterval(f);
2103
+ return () => clearInterval(d);
1955
2104
  }, []);
1956
2105
  const m = l.toLocaleTimeString([], {
1957
2106
  hour: "numeric",
1958
2107
  minute: "2-digit",
1959
2108
  hour12: !0
1960
- }), i = l.toLocaleDateString([], {
2109
+ }), u = l.toLocaleDateString([], {
1961
2110
  weekday: "short",
1962
2111
  month: "long",
1963
2112
  day: "numeric"
@@ -1965,7 +2114,7 @@ const We = p(function({
1965
2114
  return /* @__PURE__ */ n(
1966
2115
  "div",
1967
2116
  {
1968
- className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-select-none ${u ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-zinc-800"}`,
2117
+ className: `rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-h-full rcs-emulator-w-full rcs-emulator-select-none ${i ? "rcs-emulator-bg-zinc-900" : "rcs-emulator-bg-zinc-800"}`,
1969
2118
  children: [
1970
2119
  /* @__PURE__ */ e("div", { className: "rcs-emulator-h-6" }),
1971
2120
  /* @__PURE__ */ e("div", { className: "rcs-emulator-flex rcs-emulator-justify-center rcs-emulator-mt-4", children: /* @__PURE__ */ e("div", { className: "rcs-emulator-w-8 rcs-emulator-h-8 rcs-emulator-rounded-full rcs-emulator-bg-zinc-700 rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center", children: /* @__PURE__ */ e(
@@ -1985,21 +2134,7 @@ const We = p(function({
1985
2134
  }
1986
2135
  ) }) }),
1987
2136
  /* @__PURE__ */ e("div", { className: "rcs-emulator-mt-6 rcs-emulator-text-center", children: /* @__PURE__ */ e("h1", { className: "rcs-emulator-text-5xl rcs-emulator-font-light rcs-emulator-text-white rcs-emulator-tracking-tight", children: m }) }),
1988
- /* @__PURE__ */ n("div", { className: "rcs-emulator-mt-2 rcs-emulator-text-center", children: [
1989
- /* @__PURE__ */ e("p", { className: "rcs-emulator-text-zinc-400 rcs-emulator-text-sm", children: i }),
1990
- /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-gap-1 rcs-emulator-mt-1 rcs-emulator-text-zinc-500 rcs-emulator-text-xs", children: [
1991
- /* @__PURE__ */ e(
1992
- "svg",
1993
- {
1994
- className: "rcs-emulator-w-3-5 rcs-emulator-h-3-5",
1995
- fill: "currentColor",
1996
- viewBox: "0 0 20 20",
1997
- children: /* @__PURE__ */ e("path", { d: "M5.5 16a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 16h-8z" })
1998
- }
1999
- ),
2000
- /* @__PURE__ */ e("span", { className: "rcs-emulator-text-zinc-500", children: "19°C" })
2001
- ] })
2002
- ] }),
2137
+ /* @__PURE__ */ e("div", { className: "rcs-emulator-mt-2 rcs-emulator-text-center", children: /* @__PURE__ */ e("p", { className: "rcs-emulator-text-zinc-400 rcs-emulator-text-sm", children: u }) }),
2003
2138
  /* @__PURE__ */ e("div", { className: "rcs-emulator-h-24" }),
2004
2139
  /* @__PURE__ */ e("div", { className: "rcs-emulator-px-4 rcs-emulator-pb-8", children: /* @__PURE__ */ n(
2005
2140
  "button",
@@ -2038,8 +2173,8 @@ const We = p(function({
2038
2173
  }
2039
2174
  ) }) }),
2040
2175
  /* @__PURE__ */ n("div", { className: "rcs-emulator-flex-1 rcs-emulator-text-left rcs-emulator-min-w-0", children: [
2041
- /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-text-gray-900 rcs-emulator-truncate", children: a.name }),
2042
- /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-gray-500 rcs-emulator-truncate", children: t })
2176
+ /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-font-semibold rcs-emulator-text-gray-900 rcs-emulator-truncate rcs-emulator-mb-1", children: a.name }),
2177
+ /* @__PURE__ */ e("p", { className: "rcs-emulator-text-sm rcs-emulator-text-gray-500 rcs-emulator-truncate rcs-emulator-line-clamp-2 rcs-emulator-mb-1", children: t })
2043
2178
  ] }),
2044
2179
  /* @__PURE__ */ e("span", { className: "rcs-emulator-text-xs rcs-emulator-text-gray-400 rcs-emulator-flex-shrink-0", children: "now" })
2045
2180
  ]
@@ -2050,144 +2185,374 @@ const We = p(function({
2050
2185
  ]
2051
2186
  }
2052
2187
  );
2053
- }), J = {
2188
+ }), Ke = () => /* @__PURE__ */ e(
2189
+ "svg",
2190
+ {
2191
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2192
+ fill: "none",
2193
+ viewBox: "0 0 24 24",
2194
+ stroke: "currentColor",
2195
+ strokeWidth: 2,
2196
+ children: /* @__PURE__ */ e(
2197
+ "path",
2198
+ {
2199
+ strokeLinecap: "round",
2200
+ strokeLinejoin: "round",
2201
+ d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
2202
+ }
2203
+ )
2204
+ }
2205
+ ), Xe = () => /* @__PURE__ */ e(
2206
+ "svg",
2207
+ {
2208
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2209
+ fill: "none",
2210
+ viewBox: "0 0 24 24",
2211
+ stroke: "currentColor",
2212
+ strokeWidth: 2,
2213
+ children: /* @__PURE__ */ e(
2214
+ "path",
2215
+ {
2216
+ strokeLinecap: "round",
2217
+ strokeLinejoin: "round",
2218
+ d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
2219
+ }
2220
+ )
2221
+ }
2222
+ ), er = () => /* @__PURE__ */ n(
2223
+ "svg",
2224
+ {
2225
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2226
+ fill: "none",
2227
+ viewBox: "0 0 24 24",
2228
+ stroke: "currentColor",
2229
+ strokeWidth: 2,
2230
+ children: [
2231
+ /* @__PURE__ */ e(
2232
+ "path",
2233
+ {
2234
+ strokeLinecap: "round",
2235
+ strokeLinejoin: "round",
2236
+ d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
2237
+ }
2238
+ ),
2239
+ /* @__PURE__ */ e(
2240
+ "path",
2241
+ {
2242
+ strokeLinecap: "round",
2243
+ strokeLinejoin: "round",
2244
+ d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
2245
+ }
2246
+ )
2247
+ ]
2248
+ }
2249
+ ), rr = () => /* @__PURE__ */ e(
2250
+ "svg",
2251
+ {
2252
+ className: "rcs-emulator-w-5 rcs-emulator-h-5",
2253
+ fill: "none",
2254
+ viewBox: "0 0 24 24",
2255
+ stroke: "currentColor",
2256
+ strokeWidth: 2,
2257
+ children: /* @__PURE__ */ e(
2258
+ "path",
2259
+ {
2260
+ strokeLinecap: "round",
2261
+ strokeLinejoin: "round",
2262
+ d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
2263
+ }
2264
+ )
2265
+ }
2266
+ ), tr = (s) => {
2267
+ switch (s) {
2268
+ case "dial":
2269
+ return /* @__PURE__ */ e(Ke, {});
2270
+ case "calendar":
2271
+ return /* @__PURE__ */ e(Xe, {});
2272
+ case "map":
2273
+ return /* @__PURE__ */ e(er, {});
2274
+ default:
2275
+ return /* @__PURE__ */ e(rr, {});
2276
+ }
2277
+ }, sr = (s) => {
2278
+ switch (s) {
2279
+ case "dial":
2280
+ return "#4CAF50";
2281
+ // Green for call
2282
+ case "calendar":
2283
+ return "#2196F3";
2284
+ // Blue for calendar
2285
+ case "map":
2286
+ return "#FF5722";
2287
+ // Orange for map
2288
+ default:
2289
+ return "#9E9E9E";
2290
+ }
2291
+ }, or = f(function() {
2292
+ const { theme: r, toast: t, showToast: o } = C();
2293
+ if (B(() => {
2294
+ if (t) {
2295
+ const l = setTimeout(() => {
2296
+ o(null);
2297
+ }, 3e3);
2298
+ return () => clearTimeout(l);
2299
+ }
2300
+ }, [t, o]), !t) return null;
2301
+ const a = r === "dark";
2302
+ return /* @__PURE__ */ e(
2303
+ "div",
2304
+ {
2305
+ className: "rcs-emulator-absolute rcs-emulator-bottom-20 rcs-emulator-left-4 rcs-emulator-right-4 rcs-emulator-z-50",
2306
+ role: "alert",
2307
+ "aria-live": "polite",
2308
+ children: /* @__PURE__ */ n(
2309
+ "div",
2310
+ {
2311
+ className: `rcs-emulator-flex rcs-emulator-items-center rcs-emulator-gap-3 rcs-emulator-p-4 rcs-emulator-rounded-2xl rcs-emulator-shadow-lg ${a ? "rcs-emulator-bg-zinc-800" : "rcs-emulator-bg-white"}`,
2312
+ style: {
2313
+ boxShadow: "0 4px 20px rgba(0, 0, 0, 0.15)",
2314
+ animation: "rcs-toast-slide-up 0.3s ease-out"
2315
+ },
2316
+ children: [
2317
+ /* @__PURE__ */ e(
2318
+ "div",
2319
+ {
2320
+ className: "rcs-emulator-flex rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-rounded-full rcs-emulator-flex-shrink-0 rcs-emulator-text-white",
2321
+ style: { backgroundColor: sr(t.type) },
2322
+ children: tr(t.type)
2323
+ }
2324
+ ),
2325
+ /* @__PURE__ */ n("div", { className: "rcs-emulator-flex-1 rcs-emulator-min-w-0", children: [
2326
+ /* @__PURE__ */ e(
2327
+ "p",
2328
+ {
2329
+ className: `rcs-emulator-text-sm rcs-emulator-font-medium ${a ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2330
+ children: t.message
2331
+ }
2332
+ ),
2333
+ t.details && /* @__PURE__ */ e(
2334
+ "p",
2335
+ {
2336
+ className: `rcs-emulator-text-xs rcs-emulator-mt-0.5 rcs-emulator-truncate ${a ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2337
+ children: t.details
2338
+ }
2339
+ )
2340
+ ] }),
2341
+ /* @__PURE__ */ e(
2342
+ "span",
2343
+ {
2344
+ className: `rcs-emulator-text-xs rcs-emulator-px-2 rcs-emulator-py-1 rcs-emulator-rounded-full rcs-emulator-flex-shrink-0 ${a ? "rcs-emulator-bg-zinc-700 rcs-emulator-text-zinc-300" : "rcs-emulator-bg-gray-100 rcs-emulator-text-gray-500"}`,
2345
+ children: "Simulation"
2346
+ }
2347
+ )
2348
+ ]
2349
+ }
2350
+ )
2351
+ }
2352
+ );
2353
+ }), X = {
2054
2354
  name: "Business",
2055
2355
  verified: !1
2056
- }, Pe = p(function({
2356
+ }, ar = f(function({
2057
2357
  flow: r,
2058
2358
  onUserReply: t,
2059
2359
  theme: o,
2060
2360
  device: a,
2061
2361
  businessInfo: l,
2062
- showSuggestions: c
2362
+ showSuggestions: c,
2363
+ onBack: i
2063
2364
  }) {
2064
2365
  const {
2065
- state: u,
2066
- handleReply: m,
2067
- handleAction: i
2068
- } = fe({
2366
+ state: m,
2367
+ handleReply: u,
2368
+ handleAction: d
2369
+ } = be({
2069
2370
  flow: r,
2070
2371
  onUserReply: t,
2071
2372
  typingDelay: 800
2072
- }), [h, f] = A(!1), w = $(() => {
2073
- f((d) => !d);
2074
- }, []), [b, N] = A(null), v = $((d) => {
2075
- N({
2076
- ...d,
2373
+ }), [h, v] = A(!1), y = M(() => {
2374
+ v((N) => !N);
2375
+ }, []), [k, w] = A(null), g = M((N) => {
2376
+ w({
2377
+ ...N,
2077
2378
  isOpen: !0
2078
2379
  });
2079
- }, []), y = $(() => {
2080
- N(null);
2081
- }, []), g = $(
2082
- (d) => {
2083
- if (!z(d)) return;
2084
- const x = oe(d);
2085
- if (x) {
2086
- v({
2087
- url: x.url,
2088
- viewMode: x.webviewViewMode || "TALL",
2089
- title: x.description || "",
2090
- postbackData: d.action.postback.data
2380
+ }, []), x = M(() => {
2381
+ w(null);
2382
+ }, []), [L, b] = A(null), $ = M((N) => {
2383
+ b(N);
2384
+ }, []), S = M(
2385
+ (N) => {
2386
+ if (!T(N)) return;
2387
+ const { action: p } = N, I = p.postback.data, z = p.displayText, E = ne(N);
2388
+ if (E) {
2389
+ g({
2390
+ url: E.url,
2391
+ viewMode: E.webviewViewMode || "TALL",
2392
+ title: E.description || "",
2393
+ postbackData: I
2091
2394
  }), t({
2092
2395
  type: "action",
2093
- postbackData: d.action.postback.data,
2094
- displayText: d.action.displayText,
2396
+ postbackData: I,
2397
+ displayText: z,
2095
2398
  timestamp: Date.now(),
2096
2399
  actionData: {
2097
2400
  type: "webview",
2098
- url: x.url,
2099
- viewMode: x.webviewViewMode || "TALL",
2100
- description: x.description
2401
+ url: E.url,
2402
+ viewMode: E.webviewViewMode || "TALL",
2403
+ description: E.description
2101
2404
  }
2102
2405
  });
2103
2406
  return;
2104
2407
  }
2105
- i(d);
2408
+ const D = p.dialAction?.phoneNumber || p.dialerAction?.dialPhoneNumber?.phoneNumber;
2409
+ if (D) {
2410
+ $({
2411
+ type: "dial",
2412
+ message: "Would call",
2413
+ details: D
2414
+ }), t({
2415
+ type: "action",
2416
+ postbackData: I,
2417
+ displayText: z,
2418
+ timestamp: Date.now(),
2419
+ actionData: { type: "dial", phoneNumber: D }
2420
+ }), d(N);
2421
+ return;
2422
+ }
2423
+ const P = p.calendarAction?.createCalendarEvent || p.createCalendarEventAction;
2424
+ if (P) {
2425
+ const R = P.title || "Event";
2426
+ $({
2427
+ type: "calendar",
2428
+ message: "Would add calendar event",
2429
+ details: R
2430
+ }), t({
2431
+ type: "action",
2432
+ postbackData: I,
2433
+ displayText: z,
2434
+ timestamp: Date.now(),
2435
+ actionData: {
2436
+ type: "createCalendarEvent",
2437
+ title: R,
2438
+ description: P.description
2439
+ }
2440
+ }), d(N);
2441
+ return;
2442
+ }
2443
+ const _ = p.mapAction?.showLocation?.location || p.viewLocationAction?.latLong;
2444
+ if (_ || p.viewLocationAction) {
2445
+ const R = p.mapAction?.showLocation?.location?.label || p.viewLocationAction?.label || "Location";
2446
+ $({
2447
+ type: "map",
2448
+ message: "Would open maps",
2449
+ details: R
2450
+ }), t({
2451
+ type: "action",
2452
+ postbackData: I,
2453
+ displayText: z,
2454
+ timestamp: Date.now(),
2455
+ actionData: {
2456
+ type: "viewLocation",
2457
+ latitude: _?.latitude,
2458
+ longitude: _?.longitude,
2459
+ query: p.viewLocationAction?.query
2460
+ }
2461
+ }), d(N);
2462
+ return;
2463
+ }
2464
+ d(N);
2106
2465
  },
2107
- [i, v, t]
2466
+ [d, g, t, $]
2108
2467
  );
2109
2468
  return /* @__PURE__ */ n(
2110
- Z,
2469
+ te,
2111
2470
  {
2112
2471
  theme: o,
2113
2472
  device: a,
2114
2473
  businessInfo: l,
2115
- state: u,
2474
+ state: m,
2116
2475
  showSuggestions: c,
2117
2476
  isProfileOpen: h,
2118
- toggleProfile: w,
2119
- onReply: m,
2120
- onAction: g,
2121
- webView: b,
2122
- openWebView: v,
2123
- closeWebView: y,
2477
+ toggleProfile: y,
2478
+ onReply: u,
2479
+ onAction: S,
2480
+ webView: k,
2481
+ openWebView: g,
2482
+ closeWebView: x,
2483
+ toast: L,
2484
+ showToast: $,
2485
+ onBack: i,
2124
2486
  children: [
2125
- /* @__PURE__ */ e(Ve, {}),
2126
- h && /* @__PURE__ */ e(He, {}),
2127
- /* @__PURE__ */ e(De, {})
2487
+ /* @__PURE__ */ e(Fe, {}),
2488
+ h && /* @__PURE__ */ e(Je, {}),
2489
+ /* @__PURE__ */ e(Qe, {}),
2490
+ /* @__PURE__ */ e(or, {})
2128
2491
  ]
2129
2492
  }
2130
2493
  );
2131
- }), Je = p(function({
2494
+ }), ir = f(function({
2132
2495
  messages: r,
2133
2496
  jsonUrl: t,
2134
2497
  onUserReply: o,
2135
2498
  theme: a = "light",
2136
2499
  device: l = "android",
2137
2500
  businessInfo: c,
2138
- className: u = "",
2501
+ className: i = "",
2139
2502
  width: m = 375,
2140
- height: i = 667,
2141
- showSuggestions: h = !0,
2142
- showLockScreen: f = !1
2503
+ height: u = 667,
2504
+ showSuggestions: d = !0,
2505
+ showLockScreen: h = !1
2143
2506
  }) {
2144
- const [w, b] = A(f), N = $(() => {
2145
- b(!1);
2507
+ const [v, y] = A(h), k = M(() => {
2508
+ y(!1);
2509
+ }, []), w = M(() => {
2510
+ y(!0);
2146
2511
  }, []), {
2147
- data: v,
2148
- isLoading: y,
2149
- error: g
2150
- } = pe(t), d = t ? v : r, x = V(
2151
- () => d ? me(d) : !1,
2152
- [d]
2153
- ), L = V(
2512
+ data: g,
2513
+ isLoading: x,
2514
+ error: L
2515
+ } = ve(t), b = t ? g : r, $ = O(
2516
+ () => b ? pe(b) : !1,
2517
+ [b]
2518
+ ), S = O(
2154
2519
  () => ({
2155
- ...J,
2520
+ ...X,
2156
2521
  ...c,
2157
2522
  // Extract name from flow if not provided
2158
- name: c?.name || d?.name || J.name
2523
+ name: c?.name || b?.name || X.name
2159
2524
  }),
2160
- [c, d?.name]
2161
- ), I = V(
2162
- () => d && x ? de(d) : "New message",
2163
- [d, x]
2164
- ), C = a === "dark", T = C ? "rcs-emulator-dark" : "rcs-emulator-light", M = ({ children: S }) => /* @__PURE__ */ e(
2525
+ [c, b?.name]
2526
+ ), N = O(
2527
+ () => b && $ ? ge(b) : "New message",
2528
+ [b, $]
2529
+ ), p = a === "dark", I = p ? "rcs-emulator-dark" : "rcs-emulator-light", z = ({ children: E }) => /* @__PURE__ */ e(
2165
2530
  "div",
2166
2531
  {
2167
- className: `rcs-emulator rcs-emulator-container ${T} ${u}`,
2168
- style: { width: m, height: i },
2532
+ className: `rcs-emulator rcs-emulator-container ${I} ${i}`,
2533
+ style: { width: m, height: u },
2169
2534
  role: "application",
2170
2535
  "aria-label": "RCS Message Emulator",
2171
2536
  "data-theme": a,
2172
2537
  "data-device": l,
2173
- children: S
2538
+ children: E
2174
2539
  }
2175
2540
  );
2176
- return t && y ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6", children: [
2541
+ return t && x ? /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6", children: [
2177
2542
  /* @__PURE__ */ e(
2178
2543
  "div",
2179
2544
  {
2180
- className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-spinner rcs-emulator-mb-4 ${T}`
2545
+ className: `rcs-emulator-w-10 rcs-emulator-h-10 rcs-emulator-spinner rcs-emulator-mb-4 ${I}`
2181
2546
  }
2182
2547
  ),
2183
2548
  /* @__PURE__ */ e(
2184
2549
  "p",
2185
2550
  {
2186
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2551
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2187
2552
  children: "Loading conversation..."
2188
2553
  }
2189
2554
  )
2190
- ] }) }) : t && g ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2555
+ ] }) }) : t && L ? /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2191
2556
  /* @__PURE__ */ e(
2192
2557
  "svg",
2193
2558
  {
@@ -2209,31 +2574,31 @@ const We = p(function({
2209
2574
  /* @__PURE__ */ e(
2210
2575
  "h3",
2211
2576
  {
2212
- className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${C ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2577
+ className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${p ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2213
2578
  children: "Failed to Load"
2214
2579
  }
2215
2580
  ),
2216
2581
  /* @__PURE__ */ e(
2217
2582
  "p",
2218
2583
  {
2219
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2220
- children: g
2584
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2585
+ children: L
2221
2586
  }
2222
2587
  ),
2223
2588
  /* @__PURE__ */ e(
2224
2589
  "p",
2225
2590
  {
2226
- className: `rcs-emulator-text-xs rcs-emulator-mt-2 rcs-emulator-max-w-full ${C ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`,
2591
+ className: `rcs-emulator-text-xs rcs-emulator-mt-2 rcs-emulator-max-w-full ${p ? "rcs-emulator-text-zinc-500" : "rcs-emulator-text-gray-400"}`,
2227
2592
  style: { wordBreak: "break-all" },
2228
2593
  children: t
2229
2594
  }
2230
2595
  )
2231
- ] }) }) : d ? x ? /* @__PURE__ */ e(M, { children: w ? /* @__PURE__ */ e(
2232
- Z,
2596
+ ] }) }) : b ? $ ? /* @__PURE__ */ e(z, { children: v ? /* @__PURE__ */ e(
2597
+ te,
2233
2598
  {
2234
2599
  theme: a,
2235
2600
  device: l,
2236
- businessInfo: L,
2601
+ businessInfo: S,
2237
2602
  state: {
2238
2603
  currentMessageId: null,
2239
2604
  chatHistory: [],
@@ -2253,19 +2618,24 @@ const We = p(function({
2253
2618
  },
2254
2619
  closeWebView: () => {
2255
2620
  },
2256
- children: /* @__PURE__ */ e(Oe, { onUnlock: N, messagePreview: I })
2621
+ toast: null,
2622
+ showToast: () => {
2623
+ },
2624
+ onBack: null,
2625
+ children: /* @__PURE__ */ e(Ze, { onUnlock: k, messagePreview: N })
2257
2626
  }
2258
2627
  ) : /* @__PURE__ */ e(
2259
- Pe,
2628
+ ar,
2260
2629
  {
2261
- flow: d,
2630
+ flow: b,
2262
2631
  onUserReply: o,
2263
2632
  theme: a,
2264
2633
  device: l,
2265
- businessInfo: L,
2266
- showSuggestions: h
2634
+ businessInfo: S,
2635
+ showSuggestions: d,
2636
+ onBack: h ? w : null
2267
2637
  }
2268
- ) }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2638
+ ) }) : /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2269
2639
  /* @__PURE__ */ e(
2270
2640
  "svg",
2271
2641
  {
@@ -2288,22 +2658,22 @@ const We = p(function({
2288
2658
  /* @__PURE__ */ e(
2289
2659
  "h3",
2290
2660
  {
2291
- className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${C ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2661
+ className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${p ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2292
2662
  children: "Invalid RBM JSON"
2293
2663
  }
2294
2664
  ),
2295
2665
  /* @__PURE__ */ e(
2296
2666
  "p",
2297
2667
  {
2298
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2668
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2299
2669
  children: "The conversation flow structure is not valid"
2300
2670
  }
2301
2671
  )
2302
- ] }) }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2672
+ ] }) }) : /* @__PURE__ */ e(z, { children: /* @__PURE__ */ n("div", { className: "rcs-emulator-flex rcs-emulator-flex-col rcs-emulator-items-center rcs-emulator-justify-center rcs-emulator-h-full rcs-emulator-p-6 rcs-emulator-text-center", children: [
2303
2673
  /* @__PURE__ */ e(
2304
2674
  "svg",
2305
2675
  {
2306
- className: `rcs-emulator-w-12 rcs-emulator-h-12 rcs-emulator-mb-4 ${C ? "rcs-emulator-text-zinc-600" : "rcs-emulator-text-gray-300"}`,
2676
+ className: `rcs-emulator-w-12 rcs-emulator-h-12 rcs-emulator-mb-4 ${p ? "rcs-emulator-text-zinc-600" : "rcs-emulator-text-gray-300"}`,
2307
2677
  fill: "none",
2308
2678
  viewBox: "0 0 24 24",
2309
2679
  stroke: "currentColor",
@@ -2321,22 +2691,22 @@ const We = p(function({
2321
2691
  /* @__PURE__ */ e(
2322
2692
  "h3",
2323
2693
  {
2324
- className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${C ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2694
+ className: `rcs-emulator-text-lg rcs-emulator-font-medium rcs-emulator-mb-2 ${p ? "rcs-emulator-text-white" : "rcs-emulator-text-gray-900"}`,
2325
2695
  children: "No Conversation Data"
2326
2696
  }
2327
2697
  ),
2328
2698
  /* @__PURE__ */ n(
2329
2699
  "p",
2330
2700
  {
2331
- className: `rcs-emulator-text-sm ${C ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2701
+ className: `rcs-emulator-text-sm ${p ? "rcs-emulator-text-zinc-400" : "rcs-emulator-text-gray-500"}`,
2332
2702
  children: [
2333
2703
  "Provide either",
2334
2704
  " ",
2335
- /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${T}`, children: "messages" }),
2705
+ /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${I}`, children: "messages" }),
2336
2706
  " ",
2337
2707
  "or",
2338
2708
  " ",
2339
- /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${T}`, children: "jsonUrl" }),
2709
+ /* @__PURE__ */ e("code", { className: `rcs-emulator-code-inline ${I}`, children: "jsonUrl" }),
2340
2710
  " ",
2341
2711
  "prop"
2342
2712
  ]
@@ -2345,15 +2715,15 @@ const We = p(function({
2345
2715
  ] }) });
2346
2716
  });
2347
2717
  export {
2348
- Je as RcsEmulator,
2349
- De as WebViewRenderer,
2350
- Je as default,
2351
- de as getFirstMessagePreview,
2352
- oe as getWebViewConfig,
2353
- z as isSuggestedAction,
2354
- Y as isSuggestedReply,
2355
- qe as isWebViewAction,
2356
- pe as useJsonFetch,
2357
- me as validateConversationFlow
2718
+ ir as RcsEmulator,
2719
+ Qe as WebViewRenderer,
2720
+ ir as default,
2721
+ ge as getFirstMessagePreview,
2722
+ ne as getWebViewConfig,
2723
+ T as isSuggestedAction,
2724
+ ee as isSuggestedReply,
2725
+ nr as isWebViewAction,
2726
+ ve as useJsonFetch,
2727
+ pe as validateConversationFlow
2358
2728
  };
2359
2729
  //# sourceMappingURL=rcs-emulator.es.js.map