@maebgch/rcs-emulator 0.1.5 → 0.1.7

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,159 +1,111 @@
1
- import { jsx as n, jsxs as C } from "react/jsx-runtime";
2
- import Me, { useContext as je, createContext as Ee, useReducer as De, useRef as ue, useEffect as ie, useState as ne, useCallback as Be, memo as F } from "react";
3
- var fe = { exports: {} }, he = {};
4
- var ve;
5
- function We() {
6
- if (ve) return he;
7
- ve = 1;
8
- var c = Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
9
- return he.c = function(t) {
10
- return c.H.useMemoCache(t);
11
- }, he;
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { createContext as te, useContext as ne, useReducer as re, useRef as W, useEffect as S, useCallback as M, useState as z, memo as g, useMemo as V } from "react";
3
+ function q(r) {
4
+ return "reply" in r;
12
5
  }
13
- var ge = {};
14
- var we;
15
- function Ve() {
16
- return we || (we = 1, process.env.NODE_ENV !== "production" && (function() {
17
- var c = Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
18
- ge.c = function(t) {
19
- var e = c.H;
20
- return e === null && console.error(
21
- `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
22
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
23
- 2. You might be breaking the Rules of Hooks
24
- 3. You might have more than one copy of React in the same app
25
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
26
- ), e.useMemoCache(t);
27
- };
28
- })()), ge;
6
+ function $(r) {
7
+ return "action" in r;
29
8
  }
30
- var ke;
31
- function Ue() {
32
- return ke || (ke = 1, process.env.NODE_ENV === "production" ? fe.exports = We() : fe.exports = Ve()), fe.exports;
33
- }
34
- var D = Ue();
35
- function ze(c) {
36
- return "reply" in c;
37
- }
38
- function le(c) {
39
- return "action" in c;
40
- }
41
- function Bt(c) {
42
- if (!le(c)) return !1;
43
- const {
44
- urlAction: t
45
- } = c.action;
9
+ function Je(r) {
10
+ if (!$(r)) return !1;
11
+ const { urlAction: t } = r.action;
46
12
  return t?.openUrl?.application === "WEBVIEW";
47
13
  }
48
- function He(c) {
49
- const {
50
- urlAction: t
51
- } = c.action;
14
+ function oe(r) {
15
+ const { urlAction: t } = r.action;
52
16
  return t?.openUrl?.application === "WEBVIEW" ? t.openUrl : null;
53
17
  }
54
- const Oe = {
18
+ const se = {
55
19
  name: "Business",
56
20
  verified: !1
57
- }, Pe = {
21
+ }, ie = {
58
22
  currentMessageId: null,
59
23
  chatHistory: [],
60
24
  isTyping: !1,
61
25
  error: null
62
- }, Ie = Ee(null);
63
- function Ae(c) {
64
- const t = D.c(20), {
65
- children: e,
66
- theme: s,
67
- device: l,
68
- businessInfo: i,
69
- state: g,
70
- showSuggestions: r,
71
- isProfileOpen: o,
72
- toggleProfile: a,
73
- onReply: f,
74
- onAction: h,
75
- webView: d,
76
- openWebView: u,
77
- closeWebView: m
78
- } = c;
79
- let p;
80
- t[0] !== i ? (p = {
81
- ...Oe,
82
- ...i
83
- }, t[0] = i, t[1] = p) : p = t[1];
84
- let b;
85
- t[2] !== g ? (b = {
86
- ...Pe,
87
- ...g
88
- }, t[2] = g, t[3] = b) : b = t[3];
89
- let y;
90
- t[4] !== m || t[5] !== l || t[6] !== o || t[7] !== h || t[8] !== f || t[9] !== u || t[10] !== r || t[11] !== p || t[12] !== b || t[13] !== s || t[14] !== a || t[15] !== d ? (y = {
91
- theme: s,
92
- device: l,
93
- businessInfo: p,
94
- state: b,
95
- showSuggestions: r,
96
- isProfileOpen: o,
97
- toggleProfile: a,
98
- handleReply: f,
99
- handleAction: h,
100
- webView: d,
101
- openWebView: u,
102
- closeWebView: m
103
- }, t[4] = m, t[5] = l, t[6] = o, t[7] = h, t[8] = f, t[9] = u, t[10] = r, t[11] = p, t[12] = b, t[13] = s, t[14] = a, t[15] = d, t[16] = y) : y = t[16];
104
- const v = y;
105
- let x;
106
- return t[17] !== e || t[18] !== v ? (x = /* @__PURE__ */ n(Ie.Provider, { value: v, children: e }), t[17] = e, t[18] = v, t[19] = x) : x = t[19], x;
26
+ }, Q = te(null);
27
+ function X({
28
+ children: r,
29
+ theme: t,
30
+ device: n,
31
+ businessInfo: o,
32
+ state: s,
33
+ showSuggestions: a,
34
+ isProfileOpen: i,
35
+ toggleProfile: u,
36
+ onReply: c,
37
+ onAction: d,
38
+ webView: m,
39
+ openWebView: f,
40
+ closeWebView: v
41
+ }) {
42
+ const x = {
43
+ theme: t,
44
+ device: n,
45
+ businessInfo: { ...se, ...o },
46
+ state: { ...ie, ...s },
47
+ showSuggestions: a,
48
+ isProfileOpen: i,
49
+ toggleProfile: u,
50
+ handleReply: c,
51
+ handleAction: d,
52
+ webView: m,
53
+ openWebView: f,
54
+ closeWebView: v
55
+ };
56
+ return /* @__PURE__ */ e(Q.Provider, { value: x, children: r });
107
57
  }
108
- function K() {
109
- const c = je(Ie);
110
- if (!c)
58
+ function N() {
59
+ const r = ne(Q);
60
+ if (!r)
111
61
  throw new Error("useEmulator must be used within an EmulatorProvider");
112
- return c;
62
+ return r;
113
63
  }
114
- function Re(c) {
115
- const t = Object.values(c.messages);
116
- return t.find((e) => e.is_first) || t[0] || null;
64
+ function Z(r) {
65
+ const t = Object.values(r.messages);
66
+ return t.find((n) => n.is_first) || t[0] || null;
117
67
  }
118
- function me(c, t) {
119
- return c.messages[t] || null;
68
+ function R(r, t) {
69
+ return r.messages[t] || null;
120
70
  }
121
- function Ne(c, t) {
122
- const e = c.responses?.keyword?.keyword_response?.choices;
123
- return e && e[t]?.next_message || null;
71
+ function O(r, t) {
72
+ const n = r.responses?.keyword?.keyword_response?.choices;
73
+ return n && n[t]?.next_message || null;
124
74
  }
125
- function pe(c, t) {
126
- const e = c.parts, s = Ge(e), l = qe(e);
75
+ function H(r, t) {
76
+ const n = r.parts, o = ae(n), s = ce(n);
127
77
  return {
128
- id: `${c.id}-${t}-${Date.now()}`,
78
+ id: `${r.id}-${t}-${Date.now()}`,
129
79
  sender: "business",
130
- content: s,
80
+ content: o,
131
81
  timestamp: Date.now(),
132
- suggestions: l
82
+ suggestions: s
133
83
  };
134
84
  }
135
- function Ge(c) {
136
- for (const t of c) {
137
- const e = t.RCSMessage;
138
- if (e.textMessage)
85
+ function ae(r) {
86
+ for (const t of r) {
87
+ const n = t.RCSMessage;
88
+ if (n.textMessage)
139
89
  return {
140
90
  type: "text",
141
- text: e.textMessage
91
+ text: n.textMessage
142
92
  };
143
- const s = e.richcardMessage?.message?.generalPurposeCard;
144
- if (s)
93
+ const o = n.richcardMessage?.message?.generalPurposeCard;
94
+ if (o)
145
95
  return {
146
96
  type: "richcard",
147
- card: Ce(s.content, s.layout)
97
+ card: P(o.content, o.layout)
148
98
  };
149
- const l = e.richcardMessage?.message?.generalPurposeCardCarousel;
150
- if (l)
99
+ const s = n.richcardMessage?.message?.generalPurposeCardCarousel;
100
+ if (s)
151
101
  return {
152
102
  type: "carousel",
153
- cards: l.content.map((i) => Ce(i, {
154
- cardOrientation: "VERTICAL",
155
- cardWidth: l.layout.cardWidth
156
- }))
103
+ cards: s.content.map(
104
+ (a) => P(a, {
105
+ cardOrientation: "VERTICAL",
106
+ cardWidth: s.layout.cardWidth
107
+ })
108
+ )
157
109
  };
158
110
  }
159
111
  return {
@@ -161,27 +113,27 @@ function Ge(c) {
161
113
  text: "[Unsupported message type]"
162
114
  };
163
115
  }
164
- function Ce(c, t) {
165
- const e = () => {
166
- if (c.media) {
167
- if (c.media.mediaUrl) return c.media.mediaUrl;
168
- if (c.media.contentInfo?.fileUrl) return c.media.contentInfo.fileUrl;
116
+ function P(r, t) {
117
+ const n = () => {
118
+ if (r.media) {
119
+ if (r.media.mediaUrl) return r.media.mediaUrl;
120
+ if (r.media.contentInfo?.fileUrl) return r.media.contentInfo.fileUrl;
169
121
  }
170
- }, s = () => {
171
- if (c.media) {
172
- if (c.media.thumbnailUri) return c.media.thumbnailUri;
173
- if (c.media.contentInfo?.thumbnailUrl) return c.media.contentInfo.thumbnailUrl;
122
+ }, o = () => {
123
+ if (r.media) {
124
+ if (r.media.thumbnailUri) return r.media.thumbnailUri;
125
+ if (r.media.contentInfo?.thumbnailUrl) return r.media.contentInfo.thumbnailUrl;
174
126
  }
175
- }, l = e();
127
+ }, s = n();
176
128
  return {
177
- title: c.title,
178
- description: c.description,
179
- media: l ? {
180
- url: l,
181
- height: Fe(c.media?.height || "MEDIUM_HEIGHT"),
182
- thumbnailUrl: s()
129
+ title: r.title,
130
+ description: r.description,
131
+ media: s ? {
132
+ url: s,
133
+ height: le(r.media?.height || "MEDIUM_HEIGHT"),
134
+ thumbnailUrl: o()
183
135
  } : void 0,
184
- suggestions: c.suggestions,
136
+ suggestions: r.suggestions,
185
137
  layout: {
186
138
  orientation: t.cardOrientation === "HORIZONTAL" ? "horizontal" : "vertical",
187
139
  width: t.cardWidth === "SMALL_WIDTH" ? "small" : "medium",
@@ -189,8 +141,8 @@ function Ce(c, t) {
189
141
  }
190
142
  };
191
143
  }
192
- function Fe(c) {
193
- switch (c) {
144
+ function le(r) {
145
+ switch (r) {
194
146
  case "SHORT_HEIGHT":
195
147
  return "short";
196
148
  case "TALL_HEIGHT":
@@ -199,1886 +151,2311 @@ function Fe(c) {
199
151
  return "medium";
200
152
  }
201
153
  }
202
- function qe(c) {
154
+ function ce(r) {
203
155
  const t = [];
204
- for (const e of c) {
205
- const s = e.RCSMessage;
206
- s.suggestedChipList?.suggestions && t.push(...s.suggestedChipList.suggestions);
156
+ for (const n of r) {
157
+ const o = n.RCSMessage;
158
+ o.suggestedChipList?.suggestions && t.push(...o.suggestedChipList.suggestions);
207
159
  }
208
160
  return t;
209
161
  }
210
- function Ye(c) {
162
+ function de(r) {
211
163
  return {
212
164
  id: `user-${Date.now()}`,
213
165
  sender: "user",
214
166
  content: {
215
167
  type: "userReply",
216
- text: c
168
+ text: r
217
169
  },
218
170
  timestamp: Date.now()
219
171
  };
220
172
  }
221
- function Je(c) {
222
- if (!c || typeof c != "object") return !1;
223
- const t = c;
173
+ function ue(r) {
174
+ if (!r || typeof r != "object") return !1;
175
+ const t = r;
224
176
  if (typeof t.name != "string" || !t.messages || typeof t.messages != "object") return !1;
225
- const e = Object.values(t.messages);
226
- if (e.length === 0) return !1;
227
- for (const s of e) {
228
- if (!s || typeof s != "object") return !1;
229
- const l = s;
230
- if (typeof l.id != "string" || !Array.isArray(l.parts)) return !1;
177
+ const n = Object.values(t.messages);
178
+ if (n.length === 0) return !1;
179
+ for (const o of n) {
180
+ if (!o || typeof o != "object") return !1;
181
+ const s = o;
182
+ if (typeof s.id != "string" || !Array.isArray(s.parts)) return !1;
231
183
  }
232
184
  return !0;
233
185
  }
234
- function Qe(c) {
235
- const t = Re(c);
186
+ function he(r) {
187
+ const t = Z(r);
236
188
  if (!t || !t.parts.length) return "New message";
237
- const s = t.parts[0].RCSMessage;
238
- if (s.textMessage)
239
- return s.textMessage.slice(0, 50) + (s.textMessage.length > 50 ? "..." : "");
240
- const l = s.richcardMessage?.message?.generalPurposeCard;
241
- if (l?.content.title)
242
- return l.content.title;
243
- const i = s.richcardMessage?.message?.generalPurposeCardCarousel;
244
- return i?.content[0]?.title ? i.content[0].title : "New message";
189
+ const o = t.parts[0].RCSMessage;
190
+ if (o.textMessage)
191
+ return o.textMessage.slice(0, 50) + (o.textMessage.length > 50 ? "..." : "");
192
+ const s = o.richcardMessage?.message?.generalPurposeCard;
193
+ if (s?.content.title)
194
+ return s.content.title;
195
+ const a = o.richcardMessage?.message?.generalPurposeCardCarousel;
196
+ return a?.content[0]?.title ? a.content[0].title : "New message";
245
197
  }
246
- const Te = {
198
+ const K = {
247
199
  currentMessageId: null,
248
200
  chatHistory: [],
249
201
  isTyping: !1,
250
202
  error: null
251
203
  };
252
- function Xe(c, t) {
204
+ function me(r, t) {
253
205
  switch (t.type) {
254
206
  case "INIT":
255
207
  return {
256
- ...c,
208
+ ...r,
257
209
  currentMessageId: t.messageId,
258
210
  error: null
259
211
  };
260
212
  case "ADD_BUSINESS_MESSAGE":
261
213
  return {
262
- ...c,
263
- chatHistory: [...c.chatHistory, t.message],
214
+ ...r,
215
+ chatHistory: [...r.chatHistory, t.message],
264
216
  isTyping: !1
265
217
  };
266
218
  case "ADD_USER_REPLY": {
267
- const e = Ye(t.text), s = c.chatHistory.map((l, i) => i === c.chatHistory.length - 1 ? {
268
- ...l,
269
- suggestions: void 0
270
- } : l);
219
+ const n = de(t.text), o = r.chatHistory.map(
220
+ (s, a) => a === r.chatHistory.length - 1 ? { ...s, suggestions: void 0 } : s
221
+ );
271
222
  return {
272
- ...c,
273
- chatHistory: [...s, e]
223
+ ...r,
224
+ chatHistory: [...o, n]
274
225
  };
275
226
  }
276
227
  case "SET_TYPING":
277
228
  return {
278
- ...c,
229
+ ...r,
279
230
  isTyping: t.isTyping
280
231
  };
281
232
  case "NAVIGATE_TO":
282
233
  return {
283
- ...c,
234
+ ...r,
284
235
  currentMessageId: t.messageId
285
236
  };
286
237
  case "SET_ERROR":
287
238
  return {
288
- ...c,
239
+ ...r,
289
240
  error: t.error,
290
241
  isTyping: !1
291
242
  };
292
243
  case "RESET":
293
- return Te;
244
+ return K;
294
245
  default:
295
- return c;
246
+ return r;
296
247
  }
297
248
  }
298
- function Ze(c) {
299
- const t = D.c(18), {
300
- flow: e,
301
- onUserReply: s,
302
- typingDelay: l
303
- } = c, i = l === void 0 ? 800 : l, [g, r] = De(Xe, Te), o = ue(0), a = ue(!1);
304
- let f, h;
305
- t[0] !== e ? (f = () => {
306
- if (a.current)
307
- return;
308
- a.current = !0;
309
- const x = Re(e);
310
- if (!x) {
311
- r({
249
+ function fe({
250
+ flow: r,
251
+ onUserReply: t,
252
+ typingDelay: n = 800
253
+ }) {
254
+ const [o, s] = re(me, K), a = W(0), i = W(!1);
255
+ S(() => {
256
+ if (i.current) return;
257
+ i.current = !0;
258
+ const m = Z(r);
259
+ if (!m) {
260
+ s({
312
261
  type: "SET_ERROR",
313
262
  error: "No first message found in conversation flow"
314
263
  });
315
264
  return;
316
265
  }
317
- r({
318
- type: "INIT",
319
- messageId: x.id
320
- }), o.current = o.current + 1;
321
- const k = pe(x, o.current);
322
- r({
323
- type: "ADD_BUSINESS_MESSAGE",
324
- message: k
325
- });
326
- }, h = [e], t[0] = e, t[1] = f, t[2] = h) : (f = t[1], h = t[2]), ie(f, h);
327
- let d;
328
- t[3] !== e || t[4] !== s || t[5] !== g.currentMessageId || t[6] !== i ? (d = (x) => {
329
- if (!ze(x))
330
- return;
331
- const {
332
- displayText: k,
333
- postback: w
334
- } = x.reply, N = w.data;
335
- r({
336
- type: "ADD_USER_REPLY",
337
- text: k,
338
- postbackData: N
339
- });
340
- const _ = {
341
- type: "reply",
342
- postbackData: N,
343
- displayText: k,
344
- timestamp: Date.now()
345
- };
346
- s(_);
347
- const $ = g.currentMessageId ? me(e, g.currentMessageId) : null;
348
- if (!$) {
349
- r({
350
- type: "SET_ERROR",
351
- error: "Current message not found"
352
- });
353
- return;
354
- }
355
- const L = Ne($, N);
356
- if (!L)
357
- return;
358
- const A = me(e, L);
359
- if (!A) {
360
- r({
361
- type: "SET_ERROR",
362
- error: `Next message "${L}" not found`
363
- });
364
- return;
365
- }
366
- r({
367
- type: "SET_TYPING",
368
- isTyping: !0
369
- }), r({
370
- type: "NAVIGATE_TO",
371
- messageId: L
372
- }), setTimeout(() => {
373
- o.current = o.current + 1;
374
- const z = pe(A, o.current);
375
- r({
376
- type: "ADD_BUSINESS_MESSAGE",
377
- message: z
266
+ s({ type: "INIT", messageId: m.id });
267
+ const f = H(
268
+ m,
269
+ a.current++
270
+ );
271
+ s({ type: "ADD_BUSINESS_MESSAGE", message: f });
272
+ }, [r]);
273
+ const u = M(
274
+ (m) => {
275
+ if (!q(m)) return;
276
+ const { displayText: f, postback: v } = m.reply, x = v.data;
277
+ s({ type: "ADD_USER_REPLY", text: f, postbackData: x });
278
+ const L = {
279
+ type: "reply",
280
+ postbackData: x,
281
+ displayText: f,
282
+ timestamp: Date.now()
283
+ };
284
+ t(L);
285
+ const b = o.currentMessageId ? R(r, o.currentMessageId) : null;
286
+ if (!b) {
287
+ s({ type: "SET_ERROR", error: "Current message not found" });
288
+ return;
289
+ }
290
+ const p = O(b, x);
291
+ if (!p)
292
+ return;
293
+ const y = R(r, p);
294
+ if (!y) {
295
+ s({
296
+ type: "SET_ERROR",
297
+ error: `Next message "${p}" not found`
298
+ });
299
+ return;
300
+ }
301
+ s({ type: "SET_TYPING", isTyping: !0 }), s({ type: "NAVIGATE_TO", messageId: p }), setTimeout(() => {
302
+ const h = H(
303
+ y,
304
+ a.current++
305
+ );
306
+ s({ type: "ADD_BUSINESS_MESSAGE", message: h });
307
+ }, n);
308
+ },
309
+ [r, o.currentMessageId, t, n]
310
+ ), c = M(
311
+ (m) => {
312
+ if (!$(m)) return;
313
+ const {
314
+ displayText: f,
315
+ postback: v,
316
+ openUrlAction: x,
317
+ dialAction: L,
318
+ dialerAction: b,
319
+ mapAction: p,
320
+ viewLocationAction: y
321
+ } = m.action, h = v.data, w = L?.phoneNumber || b?.dialPhoneNumber?.phoneNumber, C = p?.showLocation?.location || y?.latLong;
322
+ let I;
323
+ x ? I = { type: "openUrl", url: x.url } : w ? I = { type: "dial", phoneNumber: w } : C && (I = {
324
+ type: "viewLocation",
325
+ latitude: C.latitude,
326
+ longitude: C.longitude,
327
+ query: y?.query
378
328
  });
379
- }, i);
380
- }, t[3] = e, t[4] = s, t[5] = g.currentMessageId, t[6] = i, t[7] = d) : d = t[7];
381
- const u = d;
382
- let m;
383
- t[8] !== e || t[9] !== s || t[10] !== g.currentMessageId || t[11] !== i ? (m = (x) => {
384
- if (!le(x))
385
- return;
386
- const {
387
- displayText: k,
388
- postback: w,
389
- openUrlAction: N,
390
- dialAction: _,
391
- dialerAction: $,
392
- mapAction: L,
393
- viewLocationAction: A
394
- } = x.action, z = w.data, S = _?.phoneNumber || $?.dialPhoneNumber?.phoneNumber, M = L?.showLocation?.location || A?.latLong;
395
- let I;
396
- N ? I = {
397
- type: "openUrl",
398
- url: N.url
399
- } : S ? I = {
400
- type: "dial",
401
- phoneNumber: S
402
- } : M && (I = {
403
- type: "viewLocation",
404
- latitude: M.latitude,
405
- longitude: M.longitude,
406
- query: A?.query
407
- });
408
- const R = {
409
- type: "action",
410
- postbackData: z,
411
- displayText: k,
412
- timestamp: Date.now(),
413
- actionData: I
414
- };
415
- if (s(R), N)
416
- window.open(N.url, "_blank", "noopener,noreferrer");
417
- else if (S)
418
- window.location.href = `tel:${S}`;
419
- else if (M) {
420
- const T = L?.showLocation?.location?.label || A?.label || "", O = `https://www.google.com/maps/search/?api=1&query=${M.latitude},${M.longitude}${T ? `&query_place_id=${encodeURIComponent(T)}` : ""}`;
421
- window.open(O, "_blank", "noopener,noreferrer");
422
- }
423
- const B = g.currentMessageId ? me(e, g.currentMessageId) : null;
424
- if (B) {
425
- const T = Ne(B, z);
426
- if (T) {
427
- const O = me(e, T);
428
- O && (r({
429
- type: "ADD_USER_REPLY",
430
- text: k,
431
- postbackData: z
432
- }), r({
433
- type: "SET_TYPING",
434
- isTyping: !0
435
- }), r({
436
- type: "NAVIGATE_TO",
437
- messageId: T
438
- }), setTimeout(() => {
439
- o.current = o.current + 1;
440
- const q = pe(O, o.current);
441
- r({
442
- type: "ADD_BUSINESS_MESSAGE",
443
- message: q
444
- });
445
- }, i));
329
+ const k = {
330
+ type: "action",
331
+ postbackData: h,
332
+ displayText: f,
333
+ timestamp: Date.now(),
334
+ actionData: I
335
+ };
336
+ if (t(k), x)
337
+ window.open(x.url, "_blank", "noopener,noreferrer");
338
+ else if (w)
339
+ window.location.href = `tel:${w}`;
340
+ else if (C) {
341
+ const T = p?.showLocation?.location?.label || y?.label || "", B = `https://www.google.com/maps/search/?api=1&query=${C.latitude},${C.longitude}${T ? `&query_place_id=${encodeURIComponent(T)}` : ""}`;
342
+ window.open(B, "_blank", "noopener,noreferrer");
446
343
  }
447
- }
448
- }, t[8] = e, t[9] = s, t[10] = g.currentMessageId, t[11] = i, t[12] = m) : m = t[12];
449
- const p = m;
450
- let b;
451
- t[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => {
452
- a.current = !1, o.current = 0, r({
453
- type: "RESET"
454
- });
455
- }, t[13] = b) : b = t[13];
456
- const y = b;
457
- let v;
458
- return t[14] !== p || t[15] !== u || t[16] !== g ? (v = {
459
- state: g,
344
+ const A = o.currentMessageId ? R(r, o.currentMessageId) : null;
345
+ if (A) {
346
+ const T = O(A, h);
347
+ if (T) {
348
+ const B = R(r, T);
349
+ B && (s({
350
+ type: "ADD_USER_REPLY",
351
+ text: f,
352
+ postbackData: h
353
+ }), s({ type: "SET_TYPING", isTyping: !0 }), s({ type: "NAVIGATE_TO", messageId: T }), setTimeout(() => {
354
+ const ee = H(
355
+ B,
356
+ a.current++
357
+ );
358
+ s({ type: "ADD_BUSINESS_MESSAGE", message: ee });
359
+ }, n));
360
+ }
361
+ }
362
+ },
363
+ [r, o.currentMessageId, t, n]
364
+ ), d = M(() => {
365
+ i.current = !1, a.current = 0, s({ type: "RESET" });
366
+ }, []);
367
+ return {
368
+ state: o,
460
369
  handleReply: u,
461
- handleAction: p,
462
- reset: y
463
- }, t[14] = p, t[15] = u, t[16] = g, t[17] = v) : v = t[17], v;
370
+ handleAction: c,
371
+ reset: d
372
+ };
464
373
  }
465
- function Ke(c) {
466
- const [t, e] = ne(null), [s, l] = ne(!1), [i, g] = ne(null), r = Be(async () => {
467
- if (!c) {
468
- e(null), g(null);
374
+ function ge(r) {
375
+ const [t, n] = z(null), [o, s] = z(!1), [a, i] = z(null), u = M(async () => {
376
+ if (!r) {
377
+ n(null), i(null);
469
378
  return;
470
379
  }
471
- l(!0), g(null);
380
+ s(!0), i(null);
472
381
  try {
473
- const o = await fetch(c, {
382
+ const c = await fetch(r, {
474
383
  method: "GET",
475
384
  headers: {
476
385
  Accept: "application/json"
477
386
  }
478
387
  });
479
- if (!o.ok)
480
- throw new Error(`HTTP ${o.status}: ${o.statusText}`);
481
- const a = await o.json();
482
- if (!a || typeof a != "object")
388
+ if (!c.ok)
389
+ throw new Error(`HTTP ${c.status}: ${c.statusText}`);
390
+ const d = await c.json();
391
+ if (!d || typeof d != "object")
483
392
  throw new Error("Invalid JSON: Expected an object");
484
- if (!a.messages || typeof a.messages != "object")
393
+ if (!d.messages || typeof d.messages != "object")
485
394
  throw new Error("Invalid RBM JSON: Missing 'messages' object");
486
- e(a);
487
- } catch (o) {
488
- const a = o instanceof Error ? o.message : "Failed to fetch JSON";
489
- g(a), e(null);
395
+ n(d);
396
+ } catch (c) {
397
+ const d = c instanceof Error ? c.message : "Failed to fetch JSON";
398
+ i(d), n(null);
490
399
  } finally {
491
- l(!1);
400
+ s(!1);
492
401
  }
493
- }, [c]);
494
- return ie(() => {
495
- r();
496
- }, [r]), {
402
+ }, [r]);
403
+ return S(() => {
404
+ u();
405
+ }, [u]), {
497
406
  data: t,
498
- isLoading: s,
499
- error: i,
500
- refetch: r
407
+ isLoading: o,
408
+ error: a,
409
+ refetch: u
501
410
  };
502
411
  }
503
- function et(c) {
504
- const t = D.c(3), e = ue(null);
505
- let s;
506
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
507
- e.current && e.current.scrollTo({
508
- top: e.current.scrollHeight,
412
+ function pe(r) {
413
+ const t = W(null);
414
+ return S(() => {
415
+ t.current && t.current.scrollTo({
416
+ top: t.current.scrollHeight,
509
417
  behavior: "smooth"
510
418
  });
511
- }, t[0] = s) : s = t[0];
512
- let l;
513
- return t[1] !== c ? (l = [c], t[1] = c, t[2] = l) : l = t[2], ie(s, l), e;
419
+ }, [r]), t;
514
420
  }
515
- const tt = F(function() {
516
- const t = D.c(34), {
517
- theme: e,
518
- businessInfo: s,
519
- toggleProfile: l
520
- } = K(), i = e === "dark", g = s.brandColor || "#0084ff", r = `
421
+ const xe = g(function() {
422
+ const { theme: t, businessInfo: n, toggleProfile: o } = N(), s = t === "dark", a = n.brandColor || "#0084ff";
423
+ return /* @__PURE__ */ l(
424
+ "header",
425
+ {
426
+ className: `
521
427
  flex items-center gap-3 px-3 py-2.5 border-b
522
- ${i ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-100"}
523
- `, o = `Chat with ${s.name}`, a = `
428
+ ${s ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-100"}
429
+ `,
430
+ role: "banner",
431
+ "aria-label": `Chat with ${n.name}`,
432
+ children: [
433
+ /* @__PURE__ */ e(
434
+ "button",
435
+ {
436
+ type: "button",
437
+ className: `
524
438
  p-1.5 -ml-1 rounded-full transition-colors
525
- ${i ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-700"}
526
- `;
527
- let f;
528
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), t[0] = f) : f = t[0];
529
- let h;
530
- t[1] !== a ? (h = /* @__PURE__ */ n("button", { type: "button", className: a, "aria-label": "Go back", children: f }), t[1] = a, t[2] = h) : h = t[2];
531
- const d = `
439
+ ${s ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-700"}
440
+ `,
441
+ "aria-label": "Go back",
442
+ children: /* @__PURE__ */ e("svg", { className: "w-5 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" }) })
443
+ }
444
+ ),
445
+ /* @__PURE__ */ l(
446
+ "button",
447
+ {
448
+ onClick: o,
449
+ className: "flex items-center gap-2.5 flex-1 min-w-0 text-left",
450
+ "aria-label": "View business info",
451
+ children: [
452
+ /* @__PURE__ */ e(
453
+ "div",
454
+ {
455
+ className: `
532
456
  relative w-9 h-9 rounded-full overflow-hidden flex-shrink-0
533
- ${i ? "bg-zinc-800" : "bg-gray-100"}
534
- `, u = s.logo ? void 0 : g;
535
- let m;
536
- t[3] !== u ? (m = {
537
- backgroundColor: u
538
- }, t[3] = u, t[4] = m) : m = t[4];
539
- let p;
540
- t[5] !== s.logo || t[6] !== s.name ? (p = s.logo ? /* @__PURE__ */ n("img", { src: s.logo, alt: `${s.name} logo`, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "w-full h-full flex items-center justify-center text-sm font-bold text-white", children: s.name.charAt(0).toUpperCase() }), t[5] = s.logo, t[6] = s.name, t[7] = p) : p = t[7];
541
- let b;
542
- t[8] !== d || t[9] !== m || t[10] !== p ? (b = /* @__PURE__ */ n("div", { className: d, style: m, children: p }), t[8] = d, t[9] = m, t[10] = p, t[11] = b) : b = t[11];
543
- const y = `
457
+ ${s ? "bg-zinc-800" : "bg-gray-100"}
458
+ `,
459
+ style: {
460
+ backgroundColor: n.logo ? void 0 : a
461
+ },
462
+ children: n.logo ? /* @__PURE__ */ e(
463
+ "img",
464
+ {
465
+ src: n.logo,
466
+ alt: `${n.name} logo`,
467
+ className: "w-full h-full object-cover"
468
+ }
469
+ ) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center text-sm font-bold text-white", children: n.name.charAt(0).toUpperCase() })
470
+ }
471
+ ),
472
+ /* @__PURE__ */ e(
473
+ "h1",
474
+ {
475
+ className: `
544
476
  text-base font-medium truncate
545
- ${i ? "text-white" : "text-gray-900"}
546
- `;
547
- let v;
548
- t[12] !== s.name || t[13] !== y ? (v = /* @__PURE__ */ n("h1", { className: y, children: s.name }), t[12] = s.name, t[13] = y, t[14] = v) : v = t[14];
549
- let x;
550
- t[15] !== v || t[16] !== b || t[17] !== l ? (x = /* @__PURE__ */ C("button", { onClick: l, className: "flex items-center gap-2.5 flex-1 min-w-0 text-left", "aria-label": "View business info", children: [
551
- b,
552
- v
553
- ] }), t[15] = v, t[16] = b, t[17] = l, t[18] = x) : x = t[18];
554
- let k;
555
- t[19] !== s.verified || t[20] !== i ? (k = s.verified && /* @__PURE__ */ n("button", { type: "button", className: `
477
+ ${s ? "text-white" : "text-gray-900"}
478
+ `,
479
+ children: n.name
480
+ }
481
+ )
482
+ ]
483
+ }
484
+ ),
485
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
486
+ n.verified && /* @__PURE__ */ e(
487
+ "button",
488
+ {
489
+ type: "button",
490
+ className: `
556
491
  p-2 rounded-full transition-colors
557
- ${i ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
558
- `, "aria-label": "Verified business", children: /* @__PURE__ */ C("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", children: [
559
- /* @__PURE__ */ n("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z", stroke: i ? "#9ca3af" : "#6b7280", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }),
560
- /* @__PURE__ */ n("path", { d: "M9 12l2 2 4-4", stroke: "#3b82f6", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })
561
- ] }) }), t[19] = s.verified, t[20] = i, t[21] = k) : k = t[21];
562
- const w = `
492
+ ${s ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
493
+ `,
494
+ "aria-label": "Verified business",
495
+ children: /* @__PURE__ */ l("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", children: [
496
+ /* @__PURE__ */ e(
497
+ "path",
498
+ {
499
+ d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",
500
+ stroke: s ? "#9ca3af" : "#6b7280",
501
+ strokeWidth: 2,
502
+ strokeLinecap: "round",
503
+ strokeLinejoin: "round"
504
+ }
505
+ ),
506
+ /* @__PURE__ */ e(
507
+ "path",
508
+ {
509
+ d: "M9 12l2 2 4-4",
510
+ stroke: "#3b82f6",
511
+ strokeWidth: 2,
512
+ strokeLinecap: "round",
513
+ strokeLinejoin: "round"
514
+ }
515
+ )
516
+ ] })
517
+ }
518
+ ),
519
+ /* @__PURE__ */ e(
520
+ "button",
521
+ {
522
+ type: "button",
523
+ className: `
563
524
  p-2 rounded-full transition-colors
564
- ${i ? "hover:bg-zinc-800 text-zinc-400" : "hover:bg-gray-100 text-gray-500"}
565
- `;
566
- let N;
567
- t[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("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" }) }), t[22] = N) : N = t[22];
568
- let _;
569
- t[23] !== w ? (_ = /* @__PURE__ */ n("button", { type: "button", className: w, "aria-label": "More options", children: N }), t[23] = w, t[24] = _) : _ = t[24];
570
- let $;
571
- t[25] !== k || t[26] !== _ ? ($ = /* @__PURE__ */ C("div", { className: "flex items-center gap-0.5", children: [
572
- k,
573
- _
574
- ] }), t[25] = k, t[26] = _, t[27] = $) : $ = t[27];
575
- let L;
576
- return t[28] !== r || t[29] !== o || t[30] !== x || t[31] !== $ || t[32] !== h ? (L = /* @__PURE__ */ C("header", { className: r, role: "banner", "aria-label": o, children: [
577
- h,
578
- x,
579
- $
580
- ] }), t[28] = r, t[29] = o, t[30] = x, t[31] = $, t[32] = h, t[33] = L) : L = t[33], L;
581
- }), nt = F(function() {
582
- const t = D.c(24), {
583
- theme: e,
584
- businessInfo: s
585
- } = K(), l = e === "dark", i = s.brandColor || "#0084ff", g = `
525
+ ${s ? "hover:bg-zinc-800 text-zinc-400" : "hover:bg-gray-100 text-gray-500"}
526
+ `,
527
+ "aria-label": "More options",
528
+ children: /* @__PURE__ */ e("svg", { className: "w-5 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" }) })
529
+ }
530
+ )
531
+ ] })
532
+ ]
533
+ }
534
+ );
535
+ }), be = g(function() {
536
+ const { theme: t, businessInfo: n } = N(), o = t === "dark", s = n.brandColor || "#0084ff";
537
+ return /* @__PURE__ */ l("div", { className: "flex flex-col items-center py-4 px-4", children: [
538
+ /* @__PURE__ */ l("div", { className: "relative mb-3", children: [
539
+ /* @__PURE__ */ e(
540
+ "div",
541
+ {
542
+ className: `
586
543
  w-16 h-16 rounded-full overflow-hidden
587
- ${l ? "bg-zinc-800" : "bg-gray-100"}
544
+ ${o ? "bg-zinc-800" : "bg-gray-100"}
588
545
  shadow-lg
589
- `, r = s.logo ? void 0 : i;
590
- let o;
591
- t[0] !== r ? (o = {
592
- backgroundColor: r
593
- }, t[0] = r, t[1] = o) : o = t[1];
594
- let a;
595
- t[2] !== s.logo || t[3] !== s.name ? (a = s.logo ? /* @__PURE__ */ n("img", { src: s.logo, alt: `${s.name} logo`, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white", children: s.name.charAt(0).toUpperCase() }), t[2] = s.logo, t[3] = s.name, t[4] = a) : a = t[4];
596
- let f;
597
- t[5] !== g || t[6] !== o || t[7] !== a ? (f = /* @__PURE__ */ n("div", { className: g, style: o, children: a }), t[5] = g, t[6] = o, t[7] = a, t[8] = f) : f = t[8];
598
- let h;
599
- t[9] !== s.verified ? (h = s.verified && /* @__PURE__ */ n("div", { className: "absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center border-2 border-white shadow-sm", children: /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-white", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ n("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) }) }), t[9] = s.verified, t[10] = h) : h = t[10];
600
- let d;
601
- t[11] !== f || t[12] !== h ? (d = /* @__PURE__ */ C("div", { className: "relative mb-3", children: [
602
- f,
603
- h
604
- ] }), t[11] = f, t[12] = h, t[13] = d) : d = t[13];
605
- const u = `
546
+ `,
547
+ style: {
548
+ backgroundColor: n.logo ? void 0 : s
549
+ },
550
+ children: n.logo ? /* @__PURE__ */ e(
551
+ "img",
552
+ {
553
+ src: n.logo,
554
+ alt: `${n.name} logo`,
555
+ className: "w-full h-full object-cover"
556
+ }
557
+ ) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white", children: n.name.charAt(0).toUpperCase() })
558
+ }
559
+ ),
560
+ n.verified && /* @__PURE__ */ e(
561
+ "div",
562
+ {
563
+ className: "absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center border-2 border-white shadow-sm",
564
+ children: /* @__PURE__ */ e(
565
+ "svg",
566
+ {
567
+ className: "w-3 h-3 text-white",
568
+ viewBox: "0 0 24 24",
569
+ fill: "currentColor",
570
+ children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" })
571
+ }
572
+ )
573
+ }
574
+ )
575
+ ] }),
576
+ /* @__PURE__ */ e(
577
+ "h1",
578
+ {
579
+ className: `
606
580
  text-lg font-semibold text-center
607
- ${l ? "text-white" : "text-gray-900"}
608
- `;
609
- let m;
610
- t[14] !== s.name || t[15] !== u ? (m = /* @__PURE__ */ n("h1", { className: u, children: s.name }), t[14] = s.name, t[15] = u, t[16] = m) : m = t[16];
611
- let p;
612
- t[17] !== s.description || t[18] !== l ? (p = s.description && /* @__PURE__ */ n("p", { className: `
581
+ ${o ? "text-white" : "text-gray-900"}
582
+ `,
583
+ children: n.name
584
+ }
585
+ ),
586
+ n.description && /* @__PURE__ */ e(
587
+ "p",
588
+ {
589
+ className: `
613
590
  text-sm text-center mt-0.5
614
- ${l ? "text-zinc-400" : "text-gray-500"}
615
- `, children: s.description }), t[17] = s.description, t[18] = l, t[19] = p) : p = t[19];
616
- let b;
617
- return t[20] !== d || t[21] !== m || t[22] !== p ? (b = /* @__PURE__ */ C("div", { className: "flex flex-col items-center py-4 px-4", children: [
618
- d,
619
- m,
620
- p
621
- ] }), t[20] = d, t[21] = m, t[22] = p, t[23] = b) : b = t[23], b;
622
- }), st = F(function(t) {
623
- const e = D.c(26), {
624
- text: s,
625
- sender: l,
626
- timestamp: i
627
- } = t, {
628
- theme: g,
629
- businessInfo: r
630
- } = K(), o = g === "dark", a = l === "business", f = r.brandColor || "#0084ff";
631
- let h;
632
- e[0] !== i ? (h = new Date(i).toLocaleTimeString([], {
591
+ ${o ? "text-zinc-400" : "text-gray-500"}
592
+ `,
593
+ children: n.description
594
+ }
595
+ )
596
+ ] });
597
+ }), ye = g(function({
598
+ text: t,
599
+ sender: n,
600
+ timestamp: o
601
+ }) {
602
+ const { theme: s, businessInfo: a } = N(), i = s === "dark", u = n === "business", c = a.brandColor || "#0084ff", d = new Date(o).toLocaleTimeString([], {
633
603
  hour: "2-digit",
634
604
  minute: "2-digit"
635
- }), e[0] = i, e[1] = h) : h = e[1];
636
- const d = h;
637
- if (a) {
638
- const k = `
605
+ });
606
+ return u ? /* @__PURE__ */ l("div", { className: "max-w-[90%]", children: [
607
+ /* @__PURE__ */ e(
608
+ "div",
609
+ {
610
+ className: `
639
611
  px-4 py-3 rounded-2xl text-sm leading-relaxed
640
- ${o ? "bg-zinc-800 text-white" : "bg-gray-100 text-gray-900"}
641
- `;
642
- let w;
643
- e[2] !== k || e[3] !== s ? (w = /* @__PURE__ */ n("div", { className: k, children: s }), e[2] = k, e[3] = s, e[4] = w) : w = e[4];
644
- let N;
645
- e[5] !== d ? (N = /* @__PURE__ */ n("span", { className: "sr-only", children: d }), e[5] = d, e[6] = N) : N = e[6];
646
- let _;
647
- return e[7] !== w || e[8] !== N ? (_ = /* @__PURE__ */ C("div", { className: "max-w-[90%]", children: [
648
- w,
649
- N
650
- ] }), e[7] = w, e[8] = N, e[9] = _) : _ = e[9], _;
651
- }
652
- let u;
653
- e[10] !== f ? (u = {
654
- backgroundColor: f
655
- }, e[10] = f, e[11] = u) : u = e[11];
656
- let m;
657
- e[12] !== u || e[13] !== s ? (m = /* @__PURE__ */ n("div", { className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed", style: u, children: s }), e[12] = u, e[13] = s, e[14] = m) : m = e[14];
658
- let p;
659
- e[15] !== f ? (p = {
660
- backgroundColor: f
661
- }, e[15] = f, e[16] = p) : p = e[16];
662
- let b;
663
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), e[17] = b) : b = e[17];
664
- let y;
665
- e[18] !== p ? (y = /* @__PURE__ */ n("div", { className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0", style: p, children: b }), e[18] = p, e[19] = y) : y = e[19];
666
- let v;
667
- e[20] !== d ? (v = /* @__PURE__ */ n("span", { className: "sr-only", children: d }), e[20] = d, e[21] = v) : v = e[21];
668
- let x;
669
- return e[22] !== m || e[23] !== y || e[24] !== v ? (x = /* @__PURE__ */ C("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
670
- m,
671
- y,
672
- v
673
- ] }), e[22] = m, e[23] = y, e[24] = v, e[25] = x) : x = e[25], x;
674
- }), lt = F(function(t) {
675
- const e = D.c(18), {
676
- text: s,
677
- timestamp: l
678
- } = t, {
679
- businessInfo: i
680
- } = K(), g = i.brandColor || "#0084ff";
681
- let r;
682
- e[0] !== l ? (r = new Date(l).toLocaleTimeString([], {
612
+ ${i ? "bg-zinc-800 text-white" : "bg-gray-100 text-gray-900"}
613
+ `,
614
+ children: t
615
+ }
616
+ ),
617
+ /* @__PURE__ */ e("span", { className: "sr-only", children: d })
618
+ ] }) : /* @__PURE__ */ l("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
619
+ /* @__PURE__ */ e(
620
+ "div",
621
+ {
622
+ className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed",
623
+ style: { backgroundColor: c },
624
+ children: t
625
+ }
626
+ ),
627
+ /* @__PURE__ */ e(
628
+ "div",
629
+ {
630
+ className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",
631
+ style: { backgroundColor: c },
632
+ children: /* @__PURE__ */ e(
633
+ "svg",
634
+ {
635
+ className: "w-3 h-3 text-white",
636
+ viewBox: "0 0 24 24",
637
+ fill: "none",
638
+ stroke: "currentColor",
639
+ strokeWidth: 3,
640
+ children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
641
+ }
642
+ )
643
+ }
644
+ ),
645
+ /* @__PURE__ */ e("span", { className: "sr-only", children: d })
646
+ ] });
647
+ }), we = g(function({
648
+ text: t,
649
+ timestamp: n
650
+ }) {
651
+ const { businessInfo: o } = N(), s = o.brandColor || "#0084ff", a = new Date(n).toLocaleTimeString([], {
683
652
  hour: "2-digit",
684
653
  minute: "2-digit"
685
- }), e[0] = l, e[1] = r) : r = e[1];
686
- const o = r;
687
- let a;
688
- e[2] !== g ? (a = {
689
- backgroundColor: g
690
- }, e[2] = g, e[3] = a) : a = e[3];
691
- let f;
692
- e[4] !== a || e[5] !== s ? (f = /* @__PURE__ */ n("div", { className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed shadow-sm", style: a, children: s }), e[4] = a, e[5] = s, e[6] = f) : f = e[6];
693
- let h;
694
- e[7] !== g ? (h = {
695
- backgroundColor: g
696
- }, e[7] = g, e[8] = h) : h = e[8];
697
- let d;
698
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), e[9] = d) : d = e[9];
699
- let u;
700
- e[10] !== h ? (u = /* @__PURE__ */ n("div", { className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0", style: h, children: d }), e[10] = h, e[11] = u) : u = e[11];
701
- let m;
702
- e[12] !== o ? (m = /* @__PURE__ */ n("span", { className: "sr-only", children: o }), e[12] = o, e[13] = m) : m = e[13];
703
- let p;
704
- return e[14] !== f || e[15] !== u || e[16] !== m ? (p = /* @__PURE__ */ C("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
705
- f,
706
- u,
707
- m
708
- ] }), e[14] = f, e[15] = u, e[16] = m, e[17] = p) : p = e[17], p;
709
- }), rt = F(function(t) {
710
- const e = D.c(32), {
711
- card: s,
712
- timestamp: l
713
- } = t, {
714
- theme: i,
715
- handleReply: g,
716
- handleAction: r
717
- } = K(), o = i === "dark";
718
- let a;
719
- e[0] !== l ? (a = new Date(l).toLocaleTimeString([], {
654
+ });
655
+ return /* @__PURE__ */ l("div", { className: "flex items-end gap-1.5 max-w-[85%] ml-auto", children: [
656
+ /* @__PURE__ */ e(
657
+ "div",
658
+ {
659
+ className: "px-4 py-2.5 rounded-full text-white text-sm leading-relaxed shadow-sm",
660
+ style: { backgroundColor: s },
661
+ children: t
662
+ }
663
+ ),
664
+ /* @__PURE__ */ e(
665
+ "div",
666
+ {
667
+ className: "w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",
668
+ style: { backgroundColor: s },
669
+ children: /* @__PURE__ */ e(
670
+ "svg",
671
+ {
672
+ className: "w-3 h-3 text-white",
673
+ viewBox: "0 0 24 24",
674
+ fill: "none",
675
+ stroke: "currentColor",
676
+ strokeWidth: 3,
677
+ children: /* @__PURE__ */ e(
678
+ "path",
679
+ {
680
+ strokeLinecap: "round",
681
+ strokeLinejoin: "round",
682
+ d: "M5 13l4 4L19 7"
683
+ }
684
+ )
685
+ }
686
+ )
687
+ }
688
+ ),
689
+ /* @__PURE__ */ e("span", { className: "sr-only", children: a })
690
+ ] });
691
+ }), ve = g(function({
692
+ card: t,
693
+ timestamp: n
694
+ }) {
695
+ const { theme: o, handleReply: s, handleAction: a } = N(), i = o === "dark", u = new Date(n).toLocaleTimeString([], {
720
696
  hour: "2-digit",
721
697
  minute: "2-digit"
722
- }), e[0] = l, e[1] = a) : a = e[1];
723
- const f = a;
724
- let h;
725
- e[2] !== r || e[3] !== g ? (h = (L) => {
726
- "reply" in L ? g(L) : r(L);
727
- }, e[2] = r, e[3] = g, e[4] = h) : h = e[4];
728
- const d = h;
729
- let u;
730
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
698
+ }), c = (f) => {
699
+ "reply" in f ? s(f) : a(f);
700
+ }, d = {
731
701
  short: "h-36",
732
702
  medium: "h-44",
733
703
  tall: "h-56"
734
- }, e[5] = u) : u = e[5];
735
- const m = u, b = `
704
+ };
705
+ return /* @__PURE__ */ l("div", { className: "w-full", children: [
706
+ /* @__PURE__ */ l(
707
+ "div",
708
+ {
709
+ className: `
736
710
  overflow-hidden rounded-2xl w-full shadow-sm
737
- ${o ? "bg-zinc-800" : "bg-[#e8f5e9]"}
738
- `;
739
- let y;
740
- e[6] !== s.media || e[7] !== s.title ? (y = s.media && /* @__PURE__ */ n("div", { className: `
711
+ ${i ? "bg-zinc-800" : "bg-[#e8f5e9]"}
712
+ `,
713
+ children: [
714
+ t.media && /* @__PURE__ */ e(
715
+ "div",
716
+ {
717
+ className: `
741
718
  w-full overflow-hidden
742
- ${m[s.media.height]}
743
- `, children: /* @__PURE__ */ n("img", { src: s.media.url, alt: s.title || "Rich card media", className: "w-full h-full object-cover", loading: "lazy" }) }), e[6] = s.media, e[7] = s.title, e[8] = y) : y = e[8];
744
- let v;
745
- e[9] !== s.title || e[10] !== o ? (v = s.title && /* @__PURE__ */ n("h3", { className: `
719
+ ${d[t.media.height]}
720
+ `,
721
+ children: /* @__PURE__ */ e(
722
+ "img",
723
+ {
724
+ src: t.media.url,
725
+ alt: t.title || "Rich card media",
726
+ className: "w-full h-full object-cover",
727
+ loading: "lazy"
728
+ }
729
+ )
730
+ }
731
+ ),
732
+ /* @__PURE__ */ l("div", { className: "p-4", children: [
733
+ t.title && /* @__PURE__ */ e(
734
+ "h3",
735
+ {
736
+ className: `
746
737
  text-base font-semibold leading-snug
747
- ${o ? "text-white" : "text-gray-900"}
748
- `, children: s.title }), e[9] = s.title, e[10] = o, e[11] = v) : v = e[11];
749
- let x;
750
- e[12] !== s.description || e[13] !== o ? (x = s.description && /* @__PURE__ */ n("p", { className: `
738
+ ${i ? "text-white" : "text-gray-900"}
739
+ `,
740
+ children: t.title
741
+ }
742
+ ),
743
+ t.description && /* @__PURE__ */ e(
744
+ "p",
745
+ {
746
+ className: `
751
747
  text-sm leading-relaxed mt-1.5
752
- ${o ? "text-zinc-300" : "text-gray-700"}
753
- `, children: s.description }), e[12] = s.description, e[13] = o, e[14] = x) : x = e[14];
754
- let k;
755
- e[15] !== s.suggestions || e[16] !== d || e[17] !== o ? (k = s.suggestions && s.suggestions.length > 0 && /* @__PURE__ */ n("div", { className: `
748
+ ${i ? "text-zinc-300" : "text-gray-700"}
749
+ `,
750
+ children: t.description
751
+ }
752
+ ),
753
+ t.suggestions && t.suggestions.length > 0 && /* @__PURE__ */ e(
754
+ "div",
755
+ {
756
+ className: `
756
757
  mt-4 rounded-xl overflow-hidden divide-y
757
- ${o ? "divide-zinc-700 bg-zinc-800" : "divide-gray-100 bg-white"}
758
- `, children: s.suggestions.map((L, A) => /* @__PURE__ */ n(dt, { suggestion: L, onClick: () => d(L), isDark: o }, A)) }), e[15] = s.suggestions, e[16] = d, e[17] = o, e[18] = k) : k = e[18];
759
- let w;
760
- e[19] !== v || e[20] !== x || e[21] !== k ? (w = /* @__PURE__ */ C("div", { className: "p-4", children: [
761
- v,
762
- x,
763
- k
764
- ] }), e[19] = v, e[20] = x, e[21] = k, e[22] = w) : w = e[22];
765
- let N;
766
- e[23] !== b || e[24] !== y || e[25] !== w ? (N = /* @__PURE__ */ C("div", { className: b, children: [
767
- y,
768
- w
769
- ] }), e[23] = b, e[24] = y, e[25] = w, e[26] = N) : N = e[26];
770
- let _;
771
- e[27] !== f ? (_ = /* @__PURE__ */ n("span", { className: "sr-only", children: f }), e[27] = f, e[28] = _) : _ = e[28];
772
- let $;
773
- return e[29] !== N || e[30] !== _ ? ($ = /* @__PURE__ */ C("div", { className: "w-full", children: [
774
- N,
775
- _
776
- ] }), e[29] = N, e[30] = _, e[31] = $) : $ = e[31], $;
777
- }), ae = "w-5 h-5 text-gray-400", ot = () => {
778
- const c = D.c(1);
779
- let t;
780
- return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
781
- }, it = () => {
782
- const c = D.c(1);
783
- let t;
784
- return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
785
- }, at = () => {
786
- const c = D.c(1);
787
- let t;
788
- return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ C("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
789
- /* @__PURE__ */ n("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" }),
790
- /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
791
- ] }), c[0] = t) : t = c[0], t;
792
- }, ct = () => {
793
- const c = D.c(1);
794
- let t;
795
- return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
796
- }, _e = () => {
797
- const c = D.c(1);
798
- let t;
799
- return c[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ n("svg", { className: ae, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }), c[0] = t) : t = c[0], t;
800
- }, dt = F(function(t) {
801
- const e = D.c(15), {
802
- suggestion: s,
803
- onClick: l,
804
- isDark: i
805
- } = t;
806
- let g;
807
- e[0] !== s ? (g = le(s), e[0] = s, e[1] = g) : g = e[1];
808
- const r = g, o = r ? s.action.displayText : s.reply.displayText;
809
- let a;
810
- e[2] !== r || e[3] !== s ? (a = () => {
811
- if (!r)
812
- return /* @__PURE__ */ n(_e, {});
813
- const {
814
- action: b
815
- } = s;
816
- return b.urlAction || b.openUrlAction ? /* @__PURE__ */ n(ot, {}) : b.dialerAction || b.dialAction ? /* @__PURE__ */ n(it, {}) : b.mapAction || b.viewLocationAction ? /* @__PURE__ */ n(at, {}) : b.calendarAction || b.createCalendarEventAction ? /* @__PURE__ */ n(ct, {}) : /* @__PURE__ */ n(_e, {});
817
- }, e[2] = r, e[3] = s, e[4] = a) : a = e[4];
818
- const f = a, h = `
758
+ ${i ? "divide-zinc-700 bg-zinc-800" : "divide-gray-100 bg-white"}
759
+ `,
760
+ children: t.suggestions.map((f, v) => /* @__PURE__ */ e(
761
+ Me,
762
+ {
763
+ suggestion: f,
764
+ onClick: () => c(f),
765
+ isDark: i
766
+ },
767
+ v
768
+ ))
769
+ }
770
+ )
771
+ ] })
772
+ ]
773
+ }
774
+ ),
775
+ /* @__PURE__ */ e("span", { className: "sr-only", children: u })
776
+ ] });
777
+ }), E = "w-5 h-5 text-gray-400", ke = () => /* @__PURE__ */ e("svg", { className: E, 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: E, 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" }) }), Le = () => /* @__PURE__ */ l("svg", { className: E, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
778
+ /* @__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" }),
779
+ /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
780
+ ] }), Ce = () => /* @__PURE__ */ e("svg", { className: E, 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: E, 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 = g(function({
781
+ suggestion: t,
782
+ onClick: n,
783
+ isDark: o
784
+ }) {
785
+ const s = $(t), a = s ? t.action.displayText : t.reply.displayText;
786
+ return /* @__PURE__ */ l(
787
+ "button",
788
+ {
789
+ onClick: n,
790
+ className: `
819
791
  w-full flex items-center gap-3 px-4 py-3 text-left transition-colors
820
- ${i ? "hover:bg-zinc-700" : "hover:bg-gray-50"}
821
- `;
822
- let d;
823
- e[5] !== f ? (d = /* @__PURE__ */ n("span", { className: "flex-shrink-0", children: f() }), e[5] = f, e[6] = d) : d = e[6];
824
- const u = `text-sm ${i ? "text-white" : "text-gray-900"}`;
825
- let m;
826
- e[7] !== o || e[8] !== u ? (m = /* @__PURE__ */ n("span", { className: u, children: o }), e[7] = o, e[8] = u, e[9] = m) : m = e[9];
827
- let p;
828
- return e[10] !== l || e[11] !== h || e[12] !== d || e[13] !== m ? (p = /* @__PURE__ */ C("button", { onClick: l, className: h, children: [
829
- d,
830
- m
831
- ] }), e[10] = l, e[11] = h, e[12] = d, e[13] = m, e[14] = p) : p = e[14], p;
832
- }), ft = F(function(t) {
833
- const e = D.c(32), {
834
- cards: s,
835
- timestamp: l
836
- } = t, {
837
- theme: i,
838
- handleReply: g,
839
- handleAction: r
840
- } = K(), o = ue(null), [a, f] = ne(!1), [h, d] = ne(s.length > 1), u = i === "dark";
841
- let m;
842
- e[0] !== l ? (m = new Date(l).toLocaleTimeString([], {
792
+ ${o ? "hover:bg-zinc-700" : "hover:bg-gray-50"}
793
+ `,
794
+ children: [
795
+ /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: (() => {
796
+ if (!s) return /* @__PURE__ */ e(G, {});
797
+ const { action: u } = t;
798
+ return u.urlAction || u.openUrlAction ? /* @__PURE__ */ e(ke, {}) : u.dialerAction || u.dialAction ? /* @__PURE__ */ e(Ne, {}) : u.mapAction || u.viewLocationAction ? /* @__PURE__ */ e(Le, {}) : u.calendarAction || u.createCalendarEventAction ? /* @__PURE__ */ e(Ce, {}) : /* @__PURE__ */ e(G, {});
799
+ })() }),
800
+ /* @__PURE__ */ e("span", { className: `text-sm ${o ? "text-white" : "text-gray-900"}`, children: a })
801
+ ]
802
+ }
803
+ );
804
+ }), ze = g(function({ cards: t, timestamp: n }) {
805
+ const { theme: o, handleReply: s, handleAction: a } = N(), i = W(null), [u, c] = z(!1), [d, m] = z(t.length > 1), f = o === "dark", v = new Date(n).toLocaleTimeString([], {
843
806
  hour: "2-digit",
844
807
  minute: "2-digit"
845
- }), e[0] = l, e[1] = m) : m = e[1];
846
- const p = m;
847
- let b;
848
- e[2] !== r || e[3] !== g ? (b = (I) => {
849
- "reply" in I ? g(I) : r(I);
850
- }, e[2] = r, e[3] = g, e[4] = b) : b = e[4];
851
- const y = b;
852
- let v;
853
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = () => {
854
- if (o.current) {
855
- const {
856
- scrollLeft: I,
857
- scrollWidth: R,
858
- clientWidth: B
859
- } = o.current;
860
- f(I > 0), d(I < R - B - 10);
808
+ }), x = (p) => {
809
+ "reply" in p ? s(p) : a(p);
810
+ }, L = M(() => {
811
+ if (i.current) {
812
+ const { scrollLeft: p, scrollWidth: y, clientWidth: h } = i.current;
813
+ c(p > 0), m(p < y - h - 10);
861
814
  }
862
- }, e[5] = v) : v = e[5];
863
- const x = v;
864
- let k;
865
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = (I) => {
866
- o.current && o.current.scrollBy({
867
- left: I === "left" ? -200 : 200,
815
+ }, []), b = (p) => {
816
+ i.current && i.current.scrollBy({
817
+ left: p === "left" ? -200 : 200,
868
818
  behavior: "smooth"
869
819
  });
870
- }, e[6] = k) : k = e[6];
871
- const w = k;
872
- let N;
873
- e[7] !== a || e[8] !== u ? (N = a && /* @__PURE__ */ n("button", { onClick: () => w("left"), className: `
820
+ };
821
+ return /* @__PURE__ */ l("div", { className: "w-full -mx-3", children: [
822
+ /* @__PURE__ */ l("div", { className: "relative", children: [
823
+ u && /* @__PURE__ */ e(
824
+ "button",
825
+ {
826
+ onClick: () => b("left"),
827
+ className: `
874
828
  absolute left-2 top-1/2 -translate-y-1/2 z-10
875
829
  w-8 h-8 rounded-full flex items-center justify-center
876
830
  shadow-lg transition-opacity
877
- ${u ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
878
- `, "aria-label": "Scroll left", children: /* @__PURE__ */ n("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), e[7] = a, e[8] = u, e[9] = N) : N = e[9];
879
- let _;
880
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
881
- scrollbarWidth: "none",
882
- msOverflowStyle: "none"
883
- }, e[10] = _) : _ = e[10];
884
- let $;
885
- if (e[11] !== s || e[12] !== y || e[13] !== u) {
886
- let I;
887
- e[15] !== y || e[16] !== u ? (I = (R, B) => /* @__PURE__ */ n(ut, { card: R, isDark: u, onSuggestionClick: y }, B), e[15] = y, e[16] = u, e[17] = I) : I = e[17], $ = s.map(I), e[11] = s, e[12] = y, e[13] = u, e[14] = $;
888
- } else
889
- $ = e[14];
890
- let L;
891
- e[18] !== $ ? (L = /* @__PURE__ */ n("div", { ref: o, onScroll: x, className: "flex gap-2.5 overflow-x-auto py-1 px-3 snap-x snap-mandatory", style: _, children: $ }), e[18] = $, e[19] = L) : L = e[19];
892
- let A;
893
- e[20] !== h || e[21] !== u ? (A = h && /* @__PURE__ */ n("button", { onClick: () => w("right"), className: `
831
+ ${f ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
832
+ `,
833
+ "aria-label": "Scroll left",
834
+ children: /* @__PURE__ */ e("svg", { className: "w-4 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" }) })
835
+ }
836
+ ),
837
+ /* @__PURE__ */ e(
838
+ "div",
839
+ {
840
+ ref: i,
841
+ onScroll: L,
842
+ className: "flex gap-2.5 overflow-x-auto py-1 px-3 snap-x snap-mandatory",
843
+ style: { scrollbarWidth: "none", msOverflowStyle: "none" },
844
+ children: t.map((p, y) => /* @__PURE__ */ e(
845
+ Ae,
846
+ {
847
+ card: p,
848
+ isDark: f,
849
+ onSuggestionClick: x
850
+ },
851
+ y
852
+ ))
853
+ }
854
+ ),
855
+ d && /* @__PURE__ */ e(
856
+ "button",
857
+ {
858
+ onClick: () => b("right"),
859
+ className: `
894
860
  absolute right-2 top-1/2 -translate-y-1/2 z-10
895
861
  w-8 h-8 rounded-full flex items-center justify-center
896
862
  shadow-lg transition-opacity
897
- ${u ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
898
- `, "aria-label": "Scroll right", children: /* @__PURE__ */ n("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) }), e[20] = h, e[21] = u, e[22] = A) : A = e[22];
899
- let z;
900
- e[23] !== N || e[24] !== L || e[25] !== A ? (z = /* @__PURE__ */ C("div", { className: "relative", children: [
901
- N,
902
- L,
903
- A
904
- ] }), e[23] = N, e[24] = L, e[25] = A, e[26] = z) : z = e[26];
905
- let S;
906
- e[27] !== p ? (S = /* @__PURE__ */ n("span", { className: "sr-only", children: p }), e[27] = p, e[28] = S) : S = e[28];
907
- let M;
908
- return e[29] !== z || e[30] !== S ? (M = /* @__PURE__ */ C("div", { className: "w-full -mx-3", children: [
909
- z,
910
- S
911
- ] }), e[29] = z, e[30] = S, e[31] = M) : M = e[31], M;
912
- }), oe = "w-4 h-4 text-gray-400", mt = (c) => {
913
- if (!le(c))
914
- return /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) });
915
- const {
916
- action: t
917
- } = c;
918
- return t.urlAction || t.openUrlAction ? /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }) : t.dialerAction || t.dialAction ? /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) }) : t.mapAction || t.viewLocationAction ? /* @__PURE__ */ C("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
919
- /* @__PURE__ */ n("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" }),
920
- /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
921
- ] }) : t.calendarAction || t.createCalendarEventAction ? /* @__PURE__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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__ */ n("svg", { className: oe, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ n("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" }) });
922
- }, ut = F(function(t) {
923
- const e = D.c(21), {
924
- card: s,
925
- isDark: l,
926
- onSuggestionClick: i
927
- } = t, r = `
863
+ ${f ? "bg-zinc-700 text-white" : "bg-white text-gray-700"}
864
+ `,
865
+ "aria-label": "Scroll right",
866
+ children: /* @__PURE__ */ e("svg", { className: "w-4 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" }) })
867
+ }
868
+ )
869
+ ] }),
870
+ /* @__PURE__ */ e("span", { className: "sr-only", children: v })
871
+ ] });
872
+ }), j = "w-4 h-4 text-gray-400", $e = (r) => {
873
+ if (!$(r))
874
+ 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" }) });
875
+ const { action: t } = r;
876
+ return t.urlAction || t.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" }) }) : t.dialerAction || t.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" }) }) : t.mapAction || t.viewLocationAction ? /* @__PURE__ */ l("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [
877
+ /* @__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" }),
878
+ /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
879
+ ] }) : t.calendarAction || t.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" }) });
880
+ }, Ae = g(function({
881
+ card: t,
882
+ isDark: n,
883
+ onSuggestionClick: o
884
+ }) {
885
+ const s = t.layout.width === "small" ? "w-44" : "w-52";
886
+ return /* @__PURE__ */ l(
887
+ "div",
888
+ {
889
+ className: `
928
890
  flex-shrink-0 snap-start rounded-2xl overflow-hidden shadow-sm
929
- ${s.layout.width === "small" ? "w-44" : "w-52"}
930
- ${l ? "bg-zinc-800" : "bg-[#e8f5e9]"}
931
- `;
932
- let o;
933
- e[0] !== s.media || e[1] !== s.title ? (o = s.media && /* @__PURE__ */ n("div", { className: "w-full h-32 bg-gray-200 overflow-hidden", children: /* @__PURE__ */ n("img", { src: s.media.url, alt: s.title || "Carousel card media", className: "w-full h-full object-cover", loading: "lazy" }) }), e[0] = s.media, e[1] = s.title, e[2] = o) : o = e[2];
934
- let a;
935
- e[3] !== s.title || e[4] !== l ? (a = s.title && /* @__PURE__ */ n("h4", { className: `
891
+ ${s}
892
+ ${n ? "bg-zinc-800" : "bg-[#e8f5e9]"}
893
+ `,
894
+ children: [
895
+ t.media && /* @__PURE__ */ e("div", { className: "w-full h-32 bg-gray-200 overflow-hidden", children: /* @__PURE__ */ e(
896
+ "img",
897
+ {
898
+ src: t.media.url,
899
+ alt: t.title || "Carousel card media",
900
+ className: "w-full h-full object-cover",
901
+ loading: "lazy"
902
+ }
903
+ ) }),
904
+ /* @__PURE__ */ l("div", { className: "p-3", children: [
905
+ t.title && /* @__PURE__ */ e(
906
+ "h4",
907
+ {
908
+ className: `
936
909
  text-sm font-semibold leading-tight mb-1 line-clamp-2
937
- ${l ? "text-white" : "text-gray-900"}
938
- `, children: s.title }), e[3] = s.title, e[4] = l, e[5] = a) : a = e[5];
939
- let f;
940
- e[6] !== s.description || e[7] !== l ? (f = s.description && /* @__PURE__ */ n("p", { className: `
910
+ ${n ? "text-white" : "text-gray-900"}
911
+ `,
912
+ children: t.title
913
+ }
914
+ ),
915
+ t.description && /* @__PURE__ */ e(
916
+ "p",
917
+ {
918
+ className: `
941
919
  text-xs leading-relaxed line-clamp-3
942
- ${l ? "text-zinc-400" : "text-gray-700"}
943
- `, children: s.description }), e[6] = s.description, e[7] = l, e[8] = f) : f = e[8];
944
- let h;
945
- e[9] !== s.suggestions || e[10] !== l || e[11] !== i ? (h = s.suggestions && s.suggestions.length > 0 && /* @__PURE__ */ n("div", { className: `
920
+ ${n ? "text-zinc-400" : "text-gray-700"}
921
+ `,
922
+ children: t.description
923
+ }
924
+ ),
925
+ t.suggestions && t.suggestions.length > 0 && /* @__PURE__ */ e(
926
+ "div",
927
+ {
928
+ className: `
946
929
  mt-3 rounded-lg overflow-hidden divide-y
947
- ${l ? "divide-zinc-600 bg-zinc-700" : "divide-gray-100 bg-white"}
948
- `, children: s.suggestions.map((m, p) => {
949
- const y = le(m) ? m.action.displayText : m.reply.displayText;
950
- return /* @__PURE__ */ C("button", { onClick: () => i(m), className: `
930
+ ${n ? "divide-zinc-600 bg-zinc-700" : "divide-gray-100 bg-white"}
931
+ `,
932
+ children: t.suggestions.map((a, i) => {
933
+ const c = $(a) ? a.action.displayText : a.reply.displayText;
934
+ return /* @__PURE__ */ l(
935
+ "button",
936
+ {
937
+ onClick: () => o(a),
938
+ className: `
951
939
  w-full flex items-center gap-2 px-3 py-2.5
952
940
  text-xs transition-colors text-left
953
- ${l ? "hover:bg-zinc-600 text-white" : "hover:bg-gray-50 text-gray-900"}
954
- `, children: [
955
- /* @__PURE__ */ n("span", { className: "flex-shrink-0", children: mt(m) }),
956
- /* @__PURE__ */ n("span", { className: "truncate", children: y })
957
- ] }, p);
958
- }) }), e[9] = s.suggestions, e[10] = l, e[11] = i, e[12] = h) : h = e[12];
959
- let d;
960
- e[13] !== a || e[14] !== f || e[15] !== h ? (d = /* @__PURE__ */ C("div", { className: "p-3", children: [
961
- a,
962
- f,
963
- h
964
- ] }), e[13] = a, e[14] = f, e[15] = h, e[16] = d) : d = e[16];
965
- let u;
966
- return e[17] !== r || e[18] !== o || e[19] !== d ? (u = /* @__PURE__ */ C("div", { className: r, children: [
967
- o,
968
- d
969
- ] }), e[17] = r, e[18] = o, e[19] = d, e[20] = u) : u = e[20], u;
970
- }), ht = {
971
- text: ({
972
- content: c,
973
- sender: t,
974
- timestamp: e
975
- }) => c.type !== "text" ? null : /* @__PURE__ */ n(st, { text: c.text, sender: t, timestamp: e }),
976
- userReply: ({
977
- content: c,
978
- timestamp: t
979
- }) => c.type !== "userReply" ? null : /* @__PURE__ */ n(lt, { text: c.text, timestamp: t }),
980
- richcard: ({
981
- content: c,
982
- timestamp: t
983
- }) => c.type !== "richcard" ? null : /* @__PURE__ */ n(rt, { card: c.card, timestamp: t }),
984
- carousel: ({
985
- content: c,
986
- timestamp: t
987
- }) => c.type !== "carousel" ? null : /* @__PURE__ */ n(ft, { cards: c.cards, timestamp: t })
988
- }, gt = F(function(t) {
989
- const e = D.c(7), {
990
- message: s,
991
- isLast: l
992
- } = t, {
993
- content: i,
994
- sender: g,
995
- timestamp: r
996
- } = s, o = ht[i.type];
997
- if (!o) {
998
- console.warn(`Unknown message type: ${i.type}`);
999
- let h;
1000
- return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ n("div", { className: "px-4 py-2 text-gray-500 text-sm italic", children: "[Unsupported message type]" }), e[0] = h) : h = e[0], h;
1001
- }
1002
- const a = l && g === "business";
1003
- let f;
1004
- return e[1] !== o || e[2] !== i || e[3] !== g || e[4] !== a || e[5] !== r ? (f = /* @__PURE__ */ n(o, { content: i, sender: g, timestamp: r, showSuggestions: a }), e[1] = o, e[2] = i, e[3] = g, e[4] = a, e[5] = r, e[6] = f) : f = e[6], f;
1005
- }), pt = F(function() {
1006
- const t = D.c(11), {
1007
- theme: e
1008
- } = K(), s = e === "dark", l = `
941
+ ${n ? "hover:bg-zinc-600 text-white" : "hover:bg-gray-50 text-gray-900"}
942
+ `,
943
+ children: [
944
+ /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: $e(a) }),
945
+ /* @__PURE__ */ e("span", { className: "truncate", children: c })
946
+ ]
947
+ },
948
+ i
949
+ );
950
+ })
951
+ }
952
+ )
953
+ ] })
954
+ ]
955
+ }
956
+ );
957
+ }), Ie = {
958
+ text: ({ content: r, sender: t, timestamp: n }) => r.type !== "text" ? null : /* @__PURE__ */ e(ye, { text: r.text, sender: t, timestamp: n }),
959
+ userReply: ({ content: r, timestamp: t }) => r.type !== "userReply" ? null : /* @__PURE__ */ e(we, { text: r.text, timestamp: t }),
960
+ richcard: ({ content: r, timestamp: t }) => r.type !== "richcard" ? null : /* @__PURE__ */ e(ve, { card: r.card, timestamp: t }),
961
+ carousel: ({ content: r, timestamp: t }) => r.type !== "carousel" ? null : /* @__PURE__ */ e(ze, { cards: r.cards, timestamp: t })
962
+ }, Te = g(function({
963
+ message: t,
964
+ isLast: n
965
+ }) {
966
+ const { content: o, sender: s, timestamp: a } = t, i = Ie[o.type];
967
+ return i ? /* @__PURE__ */ e(
968
+ i,
969
+ {
970
+ content: o,
971
+ sender: s,
972
+ timestamp: a,
973
+ showSuggestions: n && s === "business"
974
+ }
975
+ ) : (console.warn(`Unknown message type: ${o.type}`), /* @__PURE__ */ e("div", { className: "px-4 py-2 text-gray-500 text-sm italic", children: "[Unsupported message type]" }));
976
+ }), je = g(function() {
977
+ const { theme: t } = N(), n = t === "dark";
978
+ return /* @__PURE__ */ e(
979
+ "div",
980
+ {
981
+ className: "flex items-start gap-2 px-4 py-2",
982
+ role: "status",
983
+ "aria-label": "Business is typing",
984
+ children: /* @__PURE__ */ l(
985
+ "div",
986
+ {
987
+ className: `
1009
988
  inline-flex items-center gap-1 px-4 py-3 rounded-2xl rounded-bl-sm
1010
- ${s ? "bg-zinc-800" : "bg-gray-100"}
1011
- `, i = `
989
+ ${n ? "bg-zinc-800" : "bg-gray-100"}
990
+ `,
991
+ children: [
992
+ /* @__PURE__ */ e(
993
+ "span",
994
+ {
995
+ className: `
1012
996
  rcs-typing-dot w-2 h-2 rounded-full
1013
- ${s ? "bg-zinc-500" : "bg-gray-400"}
1014
- `;
1015
- let g;
1016
- t[0] !== i ? (g = /* @__PURE__ */ n("span", { className: i }), t[0] = i, t[1] = g) : g = t[1];
1017
- const r = `
997
+ ${n ? "bg-zinc-500" : "bg-gray-400"}
998
+ `
999
+ }
1000
+ ),
1001
+ /* @__PURE__ */ e(
1002
+ "span",
1003
+ {
1004
+ className: `
1018
1005
  rcs-typing-dot w-2 h-2 rounded-full
1019
- ${s ? "bg-zinc-500" : "bg-gray-400"}
1020
- `;
1021
- let o;
1022
- t[2] !== r ? (o = /* @__PURE__ */ n("span", { className: r }), t[2] = r, t[3] = o) : o = t[3];
1023
- const a = `
1006
+ ${n ? "bg-zinc-500" : "bg-gray-400"}
1007
+ `
1008
+ }
1009
+ ),
1010
+ /* @__PURE__ */ e(
1011
+ "span",
1012
+ {
1013
+ className: `
1024
1014
  rcs-typing-dot w-2 h-2 rounded-full
1025
- ${s ? "bg-zinc-500" : "bg-gray-400"}
1026
- `;
1027
- let f;
1028
- t[4] !== a ? (f = /* @__PURE__ */ n("span", { className: a }), t[4] = a, t[5] = f) : f = t[5];
1029
- let h;
1030
- return t[6] !== l || t[7] !== g || t[8] !== o || t[9] !== f ? (h = /* @__PURE__ */ n("div", { className: "flex items-start gap-2 px-4 py-2", role: "status", "aria-label": "Business is typing", children: /* @__PURE__ */ C("div", { className: l, children: [
1031
- g,
1032
- o,
1033
- f
1034
- ] }) }), t[6] = l, t[7] = g, t[8] = o, t[9] = f, t[10] = h) : h = t[10], h;
1035
- }), bt = F(function() {
1036
- const t = D.c(25), {
1037
- theme: e,
1038
- state: s
1039
- } = K(), {
1040
- chatHistory: l,
1041
- isTyping: i
1042
- } = s, g = e === "dark";
1043
- let r;
1044
- t[0] !== l.length || t[1] !== g ? (r = l.length > 0 && /* @__PURE__ */ n("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ n("span", { className: `
1015
+ ${n ? "bg-zinc-500" : "bg-gray-400"}
1016
+ `
1017
+ }
1018
+ )
1019
+ ]
1020
+ }
1021
+ )
1022
+ }
1023
+ );
1024
+ }), Se = g(function() {
1025
+ const { theme: t, state: n } = N(), { chatHistory: o, isTyping: s } = n, a = t === "dark";
1026
+ return /* @__PURE__ */ l(
1027
+ "div",
1028
+ {
1029
+ className: "px-3 pb-3 space-y-3",
1030
+ role: "log",
1031
+ "aria-label": "Chat messages",
1032
+ "aria-live": "polite",
1033
+ children: [
1034
+ o.length > 0 && /* @__PURE__ */ e("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ e(
1035
+ "span",
1036
+ {
1037
+ className: `
1045
1038
  text-xs font-medium px-3 py-1
1046
- ${g ? "text-zinc-500" : "text-gray-500"}
1047
- `, children: "Today" }) }), t[0] = l.length, t[1] = g, t[2] = r) : r = t[2];
1048
- const o = `
1039
+ ${a ? "text-zinc-500" : "text-gray-500"}
1040
+ `,
1041
+ children: "Today"
1042
+ }
1043
+ ) }),
1044
+ /* @__PURE__ */ l(
1045
+ "div",
1046
+ {
1047
+ className: `
1049
1048
  rounded-3xl overflow-hidden
1050
- ${g ? "bg-zinc-900" : "bg-gray-50"}
1051
- `;
1052
- let a;
1053
- t[3] !== l.length || t[4] !== g || t[5] !== i ? (a = l.length === 0 && !i && /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ n("p", { className: `text-sm ${g ? "text-zinc-500" : "text-gray-400"}`, children: "No messages yet" }) }), t[3] = l.length, t[4] = g, t[5] = i, t[6] = a) : a = t[6];
1054
- let f;
1055
- if (t[7] !== l || t[8] !== i) {
1056
- let p;
1057
- t[10] !== l.length || t[11] !== i ? (p = (b, y) => /* @__PURE__ */ n("div", { className: `
1058
- ${b.sender === "user" ? "flex justify-end" : "flex justify-start"}
1059
- `, children: /* @__PURE__ */ n(gt, { message: b, isLast: y === l.length - 1 && !i }) }, b.id), t[10] = l.length, t[11] = i, t[12] = p) : p = t[12], f = l.map(p), t[7] = l, t[8] = i, t[9] = f;
1060
- } else
1061
- f = t[9];
1062
- let h;
1063
- t[13] !== i ? (h = i && /* @__PURE__ */ n(pt, {}), t[13] = i, t[14] = h) : h = t[14];
1064
- let d;
1065
- t[15] !== f || t[16] !== h ? (d = /* @__PURE__ */ C("div", { className: "p-3 space-y-3", children: [
1066
- f,
1067
- h
1068
- ] }), t[15] = f, t[16] = h, t[17] = d) : d = t[17];
1069
- let u;
1070
- t[18] !== o || t[19] !== a || t[20] !== d ? (u = /* @__PURE__ */ C("div", { className: o, children: [
1071
- a,
1072
- d
1073
- ] }), t[18] = o, t[19] = a, t[20] = d, t[21] = u) : u = t[21];
1074
- let m;
1075
- return t[22] !== r || t[23] !== u ? (m = /* @__PURE__ */ C("div", { className: "px-3 pb-3 space-y-3", role: "log", "aria-label": "Chat messages", "aria-live": "polite", children: [
1076
- r,
1077
- u
1078
- ] }), t[22] = r, t[23] = u, t[24] = m) : m = t[24], m;
1079
- }), xt = F(function(t) {
1080
- const e = D.c(35), {
1081
- suggestion: s,
1082
- onClick: l,
1083
- variant: i
1084
- } = t, g = i === void 0 ? "bar" : i, {
1085
- theme: r,
1086
- businessInfo: o
1087
- } = K(), a = r === "dark";
1088
- let f;
1089
- e[0] !== s ? (f = le(s), e[0] = s, e[1] = f) : f = e[1];
1090
- const h = f, d = h ? s.action.displayText : s.reply.displayText;
1091
- let u;
1092
- e[2] !== h || e[3] !== s ? (u = h ? yt(s) : null, e[2] = h, e[3] = s, e[4] = u) : u = e[4];
1093
- const m = u, p = o.brandColor || "#0084ff";
1094
- if (g === "bar") {
1095
- const v = `
1049
+ ${a ? "bg-zinc-900" : "bg-gray-50"}
1050
+ `,
1051
+ children: [
1052
+ o.length === 0 && !s && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e("p", { className: `text-sm ${a ? "text-zinc-500" : "text-gray-400"}`, children: "No messages yet" }) }),
1053
+ /* @__PURE__ */ l("div", { className: "p-3 space-y-3", children: [
1054
+ o.map((i, u) => /* @__PURE__ */ e(
1055
+ "div",
1056
+ {
1057
+ className: `
1058
+ ${i.sender === "user" ? "flex justify-end" : "flex justify-start"}
1059
+ `,
1060
+ children: /* @__PURE__ */ e(
1061
+ Te,
1062
+ {
1063
+ message: i,
1064
+ isLast: u === o.length - 1 && !s
1065
+ }
1066
+ )
1067
+ },
1068
+ i.id
1069
+ )),
1070
+ s && /* @__PURE__ */ e(je, {})
1071
+ ] })
1072
+ ]
1073
+ }
1074
+ )
1075
+ ]
1076
+ }
1077
+ );
1078
+ }), Ee = g(function({
1079
+ suggestion: t,
1080
+ onClick: n,
1081
+ variant: o = "bar"
1082
+ }) {
1083
+ const { theme: s, businessInfo: a } = N(), i = s === "dark", u = $(t), c = u ? t.action.displayText : t.reply.displayText, d = u ? Be(t) : null, m = a.brandColor || "#0084ff";
1084
+ return o === "bar" ? /* @__PURE__ */ l(
1085
+ "button",
1086
+ {
1087
+ type: "button",
1088
+ onClick: n,
1089
+ className: `
1096
1090
  inline-flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium
1097
1091
  whitespace-nowrap transition-colors flex-shrink-0
1098
1092
  border
1099
- ${a ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700 text-white" : "bg-white border-gray-300 hover:bg-gray-50 text-gray-900"}
1100
- `;
1101
- let x;
1102
- e[5] !== d || e[6] !== h || e[7] !== s ? (x = h ? `${vt(s)}: ${d}` : d, e[5] = d, e[6] = h, e[7] = s, e[8] = x) : x = e[8];
1103
- let k;
1104
- e[9] !== m || e[10] !== p ? (k = m && /* @__PURE__ */ n("span", { style: {
1105
- color: p
1106
- }, children: /* @__PURE__ */ n(m, { className: "w-4 h-4" }) }), e[9] = m, e[10] = p, e[11] = k) : k = e[11];
1107
- let w;
1108
- e[12] !== d ? (w = /* @__PURE__ */ n("span", { children: d }), e[12] = d, e[13] = w) : w = e[13];
1109
- let N;
1110
- return e[14] !== l || e[15] !== v || e[16] !== x || e[17] !== k || e[18] !== w ? (N = /* @__PURE__ */ C("button", { type: "button", onClick: l, className: v, "aria-label": x, children: [
1111
- k,
1112
- w
1113
- ] }), e[14] = l, e[15] = v, e[16] = x, e[17] = k, e[18] = w, e[19] = N) : N = e[19], N;
1114
- }
1115
- if (g === "card") {
1116
- const v = `
1093
+ ${i ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700 text-white" : "bg-white border-gray-300 hover:bg-gray-50 text-gray-900"}
1094
+ `,
1095
+ "aria-label": u ? `${Re(t)}: ${c}` : c,
1096
+ children: [
1097
+ d && /* @__PURE__ */ e("span", { style: { color: m }, children: /* @__PURE__ */ e(d, { className: "w-4 h-4" }) }),
1098
+ /* @__PURE__ */ e("span", { children: c })
1099
+ ]
1100
+ }
1101
+ ) : o === "card" ? /* @__PURE__ */ l(
1102
+ "button",
1103
+ {
1104
+ type: "button",
1105
+ onClick: n,
1106
+ className: `
1117
1107
  w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors rounded-lg
1118
- ${a ? "hover:bg-zinc-700" : "hover:bg-gray-100"}
1119
- `;
1120
- let x;
1121
- e[20] !== m || e[21] !== p ? (x = m && /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0", style: {
1122
- backgroundColor: `${p}15`
1123
- }, children: /* @__PURE__ */ n(m, { className: "w-4 h-4", style: {
1124
- color: p
1125
- } }) }), e[20] = m, e[21] = p, e[22] = x) : x = e[22];
1126
- const k = `text-sm font-medium ${a ? "text-white" : "text-gray-900"}`;
1127
- let w;
1128
- e[23] !== d || e[24] !== k ? (w = /* @__PURE__ */ n("span", { className: k, children: d }), e[23] = d, e[24] = k, e[25] = w) : w = e[25];
1129
- let N;
1130
- return e[26] !== l || e[27] !== v || e[28] !== x || e[29] !== w ? (N = /* @__PURE__ */ C("button", { type: "button", onClick: l, className: v, children: [
1131
- x,
1132
- w
1133
- ] }), e[26] = l, e[27] = v, e[28] = x, e[29] = w, e[30] = N) : N = e[30], N;
1134
- }
1135
- const b = `
1108
+ ${i ? "hover:bg-zinc-700" : "hover:bg-gray-100"}
1109
+ `,
1110
+ children: [
1111
+ d && /* @__PURE__ */ e(
1112
+ "div",
1113
+ {
1114
+ className: "w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",
1115
+ style: { backgroundColor: `${m}15` },
1116
+ children: /* @__PURE__ */ e(d, { className: "w-4 h-4", style: { color: m } })
1117
+ }
1118
+ ),
1119
+ /* @__PURE__ */ e(
1120
+ "span",
1121
+ {
1122
+ className: `text-sm font-medium ${i ? "text-white" : "text-gray-900"}`,
1123
+ children: c
1124
+ }
1125
+ )
1126
+ ]
1127
+ }
1128
+ ) : /* @__PURE__ */ e(
1129
+ "button",
1130
+ {
1131
+ type: "button",
1132
+ onClick: n,
1133
+ className: `
1136
1134
  w-full px-3 py-2 rounded-lg text-xs font-medium text-center
1137
1135
  border transition-colors
1138
- ${a ? "border-zinc-600 hover:bg-zinc-700 text-white" : "border-gray-300 hover:bg-gray-50 text-gray-900"}
1139
- `;
1140
- let y;
1141
- return e[31] !== d || e[32] !== l || e[33] !== b ? (y = /* @__PURE__ */ n("button", { type: "button", onClick: l, className: b, children: d }), e[31] = d, e[32] = l, e[33] = b, e[34] = y) : y = e[34], y;
1136
+ ${i ? "border-zinc-600 hover:bg-zinc-700 text-white" : "border-gray-300 hover:bg-gray-50 text-gray-900"}
1137
+ `,
1138
+ children: c
1139
+ }
1140
+ );
1142
1141
  });
1143
- function yt(c) {
1144
- if (!le(c)) return null;
1145
- const {
1146
- action: t
1147
- } = c;
1148
- return t.openUrlAction ? ({
1149
- className: e,
1150
- style: s
1151
- }) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("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" }) }) : t.dialAction ? ({
1152
- className: e,
1153
- style: s
1154
- }) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("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" }) }) : t.shareLocationAction ? ({
1155
- className: e,
1156
- style: s
1157
- }) => /* @__PURE__ */ C("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1158
- /* @__PURE__ */ n("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" }),
1159
- /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1160
- ] }) : t.viewLocationAction ? ({
1161
- className: e,
1162
- style: s
1163
- }) => /* @__PURE__ */ C("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1164
- /* @__PURE__ */ n("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" }),
1165
- /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1166
- ] }) : t.createCalendarEventAction ? ({
1167
- className: e,
1168
- style: s
1169
- }) => /* @__PURE__ */ n("svg", { className: e, style: s, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("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" }) }) : null;
1142
+ function Be(r) {
1143
+ if (!$(r)) return null;
1144
+ const { action: t } = r;
1145
+ return t.openUrlAction ? ({ className: n, style: o }) => /* @__PURE__ */ e("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }) : t.dialAction ? ({ className: n, style: o }) => /* @__PURE__ */ e("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }) : t.shareLocationAction ? ({ className: n, style: o }) => /* @__PURE__ */ l("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1146
+ /* @__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" }),
1147
+ /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1148
+ ] }) : t.viewLocationAction ? ({ className: n, style: o }) => /* @__PURE__ */ l("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1149
+ /* @__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" }),
1150
+ /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" })
1151
+ ] }) : t.createCalendarEventAction ? ({ className: n, style: o }) => /* @__PURE__ */ e("svg", { className: n, style: o, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }) : null;
1170
1152
  }
1171
- function vt(c) {
1172
- if (!le(c)) return "Reply";
1173
- const {
1174
- action: t
1175
- } = c;
1153
+ function Re(r) {
1154
+ if (!$(r)) return "Reply";
1155
+ const { action: t } = r;
1176
1156
  return t.openUrlAction ? "Open link" : t.dialAction ? "Call" : t.shareLocationAction ? "Share location" : t.viewLocationAction ? "View location" : t.createCalendarEventAction ? "Add to calendar" : "Action";
1177
1157
  }
1178
- const wt = F(function(t) {
1179
- const e = D.c(14), {
1180
- suggestions: s
1181
- } = t, {
1182
- theme: l,
1183
- handleReply: i,
1184
- handleAction: g
1185
- } = K(), r = l === "dark";
1186
- if (!s || s.length === 0)
1158
+ const We = g(function({
1159
+ suggestions: t
1160
+ }) {
1161
+ const { theme: n, handleReply: o, handleAction: s } = N(), a = n === "dark";
1162
+ if (!t || t.length === 0)
1187
1163
  return null;
1188
- let o;
1189
- e[0] !== g || e[1] !== i ? (o = (p) => {
1190
- ze(p) ? i(p) : le(p) && g(p);
1191
- }, e[0] = g, e[1] = i, e[2] = o) : o = e[2];
1192
- const a = o, f = `
1164
+ const i = (u) => {
1165
+ q(u) ? o(u) : $(u) && s(u);
1166
+ };
1167
+ return /* @__PURE__ */ e(
1168
+ "div",
1169
+ {
1170
+ className: `
1193
1171
  px-3 py-2
1194
- ${r ? "bg-zinc-900" : "bg-white"}
1195
- `;
1196
- let h;
1197
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = {
1198
- scrollbarWidth: "none",
1199
- msOverflowStyle: "none"
1200
- }, e[3] = h) : h = e[3];
1201
- let d;
1202
- if (e[4] !== a || e[5] !== s) {
1203
- let p;
1204
- e[7] !== a ? (p = (b, y) => /* @__PURE__ */ n(xt, { suggestion: b, onClick: () => a(b), variant: "bar" }, y), e[7] = a, e[8] = p) : p = e[8], d = s.map(p), e[4] = a, e[5] = s, e[6] = d;
1205
- } else
1206
- d = e[6];
1207
- let u;
1208
- e[9] !== d ? (u = /* @__PURE__ */ n("div", { className: "flex gap-2 overflow-x-auto pb-1 -mx-1 px-1", style: h, children: d }), e[9] = d, e[10] = u) : u = e[10];
1209
- let m;
1210
- return e[11] !== f || e[12] !== u ? (m = /* @__PURE__ */ n("div", { className: f, role: "group", "aria-label": "Quick replies", children: u }), e[11] = f, e[12] = u, e[13] = m) : m = e[13], m;
1211
- }), kt = F(function() {
1212
- const t = D.c(39), {
1213
- theme: e,
1214
- state: s,
1215
- showSuggestions: l
1216
- } = K(), {
1217
- chatHistory: i,
1218
- isTyping: g,
1219
- error: r
1220
- } = s;
1221
- let o;
1222
- t[0] !== i.length || t[1] !== g ? (o = [i.length, g], t[0] = i.length, t[1] = g, t[2] = o) : o = t[2];
1223
- const a = et(o), f = e === "dark", h = i[i.length - 1], d = l && h?.sender === "business" && !g ? h.suggestions : void 0, u = `
1172
+ ${a ? "bg-zinc-900" : "bg-white"}
1173
+ `,
1174
+ role: "group",
1175
+ "aria-label": "Quick replies",
1176
+ children: /* @__PURE__ */ e(
1177
+ "div",
1178
+ {
1179
+ className: "flex gap-2 overflow-x-auto pb-1 -mx-1 px-1",
1180
+ style: { scrollbarWidth: "none", msOverflowStyle: "none" },
1181
+ children: t.map((u, c) => /* @__PURE__ */ e(
1182
+ Ee,
1183
+ {
1184
+ suggestion: u,
1185
+ onClick: () => i(u),
1186
+ variant: "bar"
1187
+ },
1188
+ c
1189
+ ))
1190
+ }
1191
+ )
1192
+ }
1193
+ );
1194
+ }), Ve = g(function() {
1195
+ const { theme: t, state: n, showSuggestions: o } = N(), { chatHistory: s, isTyping: a, error: i } = n, u = pe([
1196
+ s.length,
1197
+ a
1198
+ ]), c = t === "dark", d = s[s.length - 1], m = o && d?.sender === "business" && !a ? d.suggestions : void 0;
1199
+ return /* @__PURE__ */ l(
1200
+ "div",
1201
+ {
1202
+ className: `
1224
1203
  flex flex-col h-full w-full overflow-hidden
1225
- ${f ? "bg-zinc-950" : "bg-white"}
1226
- `;
1227
- let m;
1228
- t[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ n(tt, {}), t[3] = m) : m = t[3];
1229
- let p;
1230
- t[4] !== r ? (p = r && /* @__PURE__ */ n("div", { className: "px-4 py-2 bg-red-500/10 border-b border-red-500/20", role: "alert", children: /* @__PURE__ */ n("p", { className: "text-sm text-red-500", children: r }) }), t[4] = r, t[5] = p) : p = t[5];
1231
- let b, y;
1232
- t[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ n(nt, {}), y = /* @__PURE__ */ n(bt, {}), t[6] = b, t[7] = y) : (b = t[6], y = t[7]);
1233
- let v;
1234
- t[8] !== a ? (v = /* @__PURE__ */ C("div", { ref: a, className: "flex-1 overflow-y-auto rcs-scrollbar", children: [
1235
- b,
1236
- y
1237
- ] }), t[8] = a, t[9] = v) : v = t[9];
1238
- let x;
1239
- t[10] !== d ? (x = d && d.length > 0 && /* @__PURE__ */ n(wt, { suggestions: d }), t[10] = d, t[11] = x) : x = t[11];
1240
- const k = `
1204
+ ${c ? "bg-zinc-950" : "bg-white"}
1205
+ `,
1206
+ children: [
1207
+ /* @__PURE__ */ e(xe, {}),
1208
+ i && /* @__PURE__ */ e(
1209
+ "div",
1210
+ {
1211
+ className: "px-4 py-2 bg-red-500/10 border-b border-red-500/20",
1212
+ role: "alert",
1213
+ children: /* @__PURE__ */ e("p", { className: "text-sm text-red-500", children: i })
1214
+ }
1215
+ ),
1216
+ /* @__PURE__ */ l("div", { ref: u, className: "flex-1 overflow-y-auto rcs-scrollbar", children: [
1217
+ /* @__PURE__ */ e(be, {}),
1218
+ /* @__PURE__ */ e(Se, {})
1219
+ ] }),
1220
+ m && m.length > 0 && /* @__PURE__ */ e(We, { suggestions: m }),
1221
+ /* @__PURE__ */ l(
1222
+ "div",
1223
+ {
1224
+ className: `
1241
1225
  px-3 py-2 flex items-center gap-2
1242
- ${f ? "bg-zinc-900" : "bg-white"}
1243
- `, w = `
1226
+ ${c ? "bg-zinc-900" : "bg-white"}
1227
+ `,
1228
+ children: [
1229
+ /* @__PURE__ */ e(
1230
+ "button",
1231
+ {
1232
+ type: "button",
1233
+ className: `
1244
1234
  w-9 h-9 flex items-center justify-center rounded-full flex-shrink-0
1245
1235
  border transition-colors
1246
- ${f ? "border-zinc-700 text-zinc-400 hover:bg-zinc-800" : "border-gray-300 text-gray-500 hover:bg-gray-100"}
1247
- `;
1248
- let N;
1249
- t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t[12] = N) : N = t[12];
1250
- let _;
1251
- t[13] !== w ? (_ = /* @__PURE__ */ n("button", { type: "button", className: w, "aria-label": "Add attachment", children: N }), t[13] = w, t[14] = _) : _ = t[14];
1252
- const $ = `
1236
+ ${c ? "border-zinc-700 text-zinc-400 hover:bg-zinc-800" : "border-gray-300 text-gray-500 hover:bg-gray-100"}
1237
+ `,
1238
+ "aria-label": "Add attachment",
1239
+ children: /* @__PURE__ */ e(
1240
+ "svg",
1241
+ {
1242
+ className: "w-5 h-5",
1243
+ fill: "none",
1244
+ viewBox: "0 0 24 24",
1245
+ stroke: "currentColor",
1246
+ children: /* @__PURE__ */ e(
1247
+ "path",
1248
+ {
1249
+ strokeLinecap: "round",
1250
+ strokeLinejoin: "round",
1251
+ strokeWidth: 2,
1252
+ d: "M12 4v16m8-8H4"
1253
+ }
1254
+ )
1255
+ }
1256
+ )
1257
+ }
1258
+ ),
1259
+ /* @__PURE__ */ l(
1260
+ "div",
1261
+ {
1262
+ className: `
1253
1263
  flex-1 flex items-center gap-2 px-4 py-2 rounded-full
1254
- ${f ? "bg-zinc-800" : "bg-gray-100"}
1255
- `, L = `flex-1 text-sm ${f ? "text-zinc-500" : "text-gray-400"}`;
1256
- let A;
1257
- t[15] !== L ? (A = /* @__PURE__ */ n("span", { className: L, children: "RCS message" }), t[15] = L, t[16] = A) : A = t[16];
1258
- const z = `p-1 ${f ? "text-zinc-500" : "text-gray-400"}`;
1259
- let S;
1260
- t[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), t[17] = S) : S = t[17];
1261
- let M;
1262
- t[18] !== z ? (M = /* @__PURE__ */ n("button", { type: "button", className: z, "aria-label": "Emoji", children: S }), t[18] = z, t[19] = M) : M = t[19];
1263
- const I = `p-1 ${f ? "text-zinc-500" : "text-gray-400"}`;
1264
- let R;
1265
- t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t[20] = R) : R = t[20];
1266
- let B;
1267
- t[21] !== I ? (B = /* @__PURE__ */ n("button", { type: "button", className: I, "aria-label": "Attach image", children: R }), t[21] = I, t[22] = B) : B = t[22];
1268
- let T;
1269
- t[23] !== $ || t[24] !== A || t[25] !== M || t[26] !== B ? (T = /* @__PURE__ */ C("div", { className: $, children: [
1270
- A,
1271
- M,
1272
- B
1273
- ] }), t[23] = $, t[24] = A, t[25] = M, t[26] = B, t[27] = T) : T = t[27];
1274
- let O;
1275
- t[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ n("button", { type: "button", className: "w-10 h-10 flex items-center justify-center rounded-full bg-green-100 text-green-600 flex-shrink-0", "aria-label": "Voice message", children: /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { d: "M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1 1.93c-3.94-.49-7-3.85-7-7.93h2c0 3.31 2.69 6 6 6s6-2.69 6-6h2c0 4.08-3.06 7.44-7 7.93V20h4v2H8v-2h4v-4.07z" }) }) }), t[28] = O) : O = t[28];
1276
- let q;
1277
- t[29] !== _ || t[30] !== T || t[31] !== k ? (q = /* @__PURE__ */ C("div", { className: k, children: [
1278
- _,
1279
- T,
1280
- O
1281
- ] }), t[29] = _, t[30] = T, t[31] = k, t[32] = q) : q = t[32];
1282
- let V;
1283
- return t[33] !== u || t[34] !== q || t[35] !== p || t[36] !== v || t[37] !== x ? (V = /* @__PURE__ */ C("div", { className: u, children: [
1284
- m,
1285
- p,
1286
- v,
1287
- x,
1288
- q
1289
- ] }), t[33] = u, t[34] = q, t[35] = p, t[36] = v, t[37] = x, t[38] = V) : V = t[38], V;
1290
- }), Nt = F(function() {
1291
- const t = D.c(73), {
1292
- theme: e,
1293
- businessInfo: s,
1294
- toggleProfile: l
1295
- } = K(), [i, g] = ne("info"), r = e === "dark", o = s.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", a = s.brandColor || "#0084ff", f = `
1264
+ ${c ? "bg-zinc-800" : "bg-gray-100"}
1265
+ `,
1266
+ children: [
1267
+ /* @__PURE__ */ e(
1268
+ "span",
1269
+ {
1270
+ className: `flex-1 text-sm ${c ? "text-zinc-500" : "text-gray-400"}`,
1271
+ children: "RCS message"
1272
+ }
1273
+ ),
1274
+ /* @__PURE__ */ e(
1275
+ "button",
1276
+ {
1277
+ type: "button",
1278
+ className: `p-1 ${c ? "text-zinc-500" : "text-gray-400"}`,
1279
+ "aria-label": "Emoji",
1280
+ children: /* @__PURE__ */ e(
1281
+ "svg",
1282
+ {
1283
+ className: "w-5 h-5",
1284
+ fill: "none",
1285
+ viewBox: "0 0 24 24",
1286
+ stroke: "currentColor",
1287
+ children: /* @__PURE__ */ e(
1288
+ "path",
1289
+ {
1290
+ strokeLinecap: "round",
1291
+ strokeLinejoin: "round",
1292
+ strokeWidth: 2,
1293
+ d: "M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1294
+ }
1295
+ )
1296
+ }
1297
+ )
1298
+ }
1299
+ ),
1300
+ /* @__PURE__ */ e(
1301
+ "button",
1302
+ {
1303
+ type: "button",
1304
+ className: `p-1 ${c ? "text-zinc-500" : "text-gray-400"}`,
1305
+ "aria-label": "Attach image",
1306
+ children: /* @__PURE__ */ e(
1307
+ "svg",
1308
+ {
1309
+ className: "w-5 h-5",
1310
+ fill: "none",
1311
+ viewBox: "0 0 24 24",
1312
+ stroke: "currentColor",
1313
+ children: /* @__PURE__ */ e(
1314
+ "path",
1315
+ {
1316
+ strokeLinecap: "round",
1317
+ strokeLinejoin: "round",
1318
+ strokeWidth: 2,
1319
+ d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"
1320
+ }
1321
+ )
1322
+ }
1323
+ )
1324
+ }
1325
+ )
1326
+ ]
1327
+ }
1328
+ ),
1329
+ /* @__PURE__ */ e(
1330
+ "button",
1331
+ {
1332
+ type: "button",
1333
+ className: "w-10 h-10 flex items-center justify-center rounded-full bg-green-100 text-green-600 flex-shrink-0",
1334
+ "aria-label": "Voice message",
1335
+ children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { d: "M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1 1.93c-3.94-.49-7-3.85-7-7.93h2c0 3.31 2.69 6 6 6s6-2.69 6-6h2c0 4.08-3.06 7.44-7 7.93V20h4v2H8v-2h4v-4.07z" }) })
1336
+ }
1337
+ )
1338
+ ]
1339
+ }
1340
+ )
1341
+ ]
1342
+ }
1343
+ );
1344
+ }), He = g(function() {
1345
+ const { theme: t, businessInfo: n, toggleProfile: o } = N(), [s, a] = z("info"), i = t === "dark", u = n.bannerImage || "https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=800&q=80", c = n.brandColor || "#0084ff";
1346
+ return /* @__PURE__ */ l(
1347
+ "div",
1348
+ {
1349
+ className: `
1296
1350
  absolute inset-0 z-50 flex flex-col
1297
- ${r ? "bg-zinc-950" : "bg-white"}
1298
- `, h = `
1351
+ ${i ? "bg-zinc-950" : "bg-white"}
1352
+ `,
1353
+ children: [
1354
+ /* @__PURE__ */ l(
1355
+ "header",
1356
+ {
1357
+ className: `
1299
1358
  flex items-center gap-3 px-4 py-3 border-b
1300
- ${r ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
1301
- `, d = `
1359
+ ${i ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
1360
+ `,
1361
+ children: [
1362
+ /* @__PURE__ */ e(
1363
+ "button",
1364
+ {
1365
+ onClick: o,
1366
+ className: `
1302
1367
  p-1.5 -ml-1.5 rounded-full transition-colors
1303
- ${r ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-900"}
1304
- `;
1305
- let u;
1306
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ n("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), t[0] = u) : u = t[0];
1307
- let m;
1308
- t[1] !== d || t[2] !== l ? (m = /* @__PURE__ */ n("button", { onClick: l, className: d, "aria-label": "Go back", children: u }), t[1] = d, t[2] = l, t[3] = m) : m = t[3];
1309
- const p = `text-base font-medium ${r ? "text-white" : "text-gray-900"}`;
1310
- let b;
1311
- t[4] !== p ? (b = /* @__PURE__ */ n("span", { className: p, children: "Info & options" }), t[4] = p, t[5] = b) : b = t[5];
1312
- let y;
1313
- t[6] !== h || t[7] !== m || t[8] !== b ? (y = /* @__PURE__ */ C("header", { className: h, children: [
1314
- m,
1315
- b
1316
- ] }), t[6] = h, t[7] = m, t[8] = b, t[9] = y) : y = t[9];
1317
- let v;
1318
- t[10] !== o ? (v = /* @__PURE__ */ n("div", { className: "relative h-40 bg-gray-200", children: /* @__PURE__ */ n("img", { src: o, alt: "Business banner", className: "w-full h-full object-cover" }) }), t[10] = o, t[11] = v) : v = t[11];
1319
- const x = `
1368
+ ${i ? "hover:bg-zinc-800 text-white" : "hover:bg-gray-100 text-gray-900"}
1369
+ `,
1370
+ "aria-label": "Go back",
1371
+ children: /* @__PURE__ */ e(
1372
+ "svg",
1373
+ {
1374
+ className: "w-5 h-5",
1375
+ fill: "none",
1376
+ viewBox: "0 0 24 24",
1377
+ stroke: "currentColor",
1378
+ children: /* @__PURE__ */ e(
1379
+ "path",
1380
+ {
1381
+ strokeLinecap: "round",
1382
+ strokeLinejoin: "round",
1383
+ strokeWidth: 2,
1384
+ d: "M15 19l-7-7 7-7"
1385
+ }
1386
+ )
1387
+ }
1388
+ )
1389
+ }
1390
+ ),
1391
+ /* @__PURE__ */ e(
1392
+ "span",
1393
+ {
1394
+ className: `text-base font-medium ${i ? "text-white" : "text-gray-900"}`,
1395
+ children: "Info & options"
1396
+ }
1397
+ )
1398
+ ]
1399
+ }
1400
+ ),
1401
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto", children: [
1402
+ /* @__PURE__ */ e("div", { className: "relative h-40 bg-gray-200", children: /* @__PURE__ */ e(
1403
+ "img",
1404
+ {
1405
+ src: u,
1406
+ alt: "Business banner",
1407
+ className: "w-full h-full object-cover"
1408
+ }
1409
+ ) }),
1410
+ /* @__PURE__ */ e("div", { className: "relative px-4", children: /* @__PURE__ */ e(
1411
+ "div",
1412
+ {
1413
+ className: `
1320
1414
  absolute -top-10 left-1/2 -translate-x-1/2
1321
1415
  w-20 h-20 rounded-full overflow-hidden border-4
1322
- ${r ? "border-zinc-950 bg-zinc-800" : "border-white bg-gray-100"}
1416
+ ${i ? "border-zinc-950 bg-zinc-800" : "border-white bg-gray-100"}
1323
1417
  shadow-lg
1324
- `;
1325
- let k;
1326
- t[12] !== a || t[13] !== s.logo || t[14] !== s.name ? (k = s.logo ? /* @__PURE__ */ n("img", { src: s.logo, alt: `${s.name} logo`, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white", style: {
1327
- backgroundColor: a
1328
- }, children: s.name.charAt(0).toUpperCase() }), t[12] = a, t[13] = s.logo, t[14] = s.name, t[15] = k) : k = t[15];
1329
- let w;
1330
- t[16] !== k || t[17] !== x ? (w = /* @__PURE__ */ n("div", { className: "relative px-4", children: /* @__PURE__ */ n("div", { className: x, children: k }) }), t[16] = k, t[17] = x, t[18] = w) : w = t[18];
1331
- const N = `text-xl font-semibold ${r ? "text-white" : "text-gray-900"}`;
1332
- let _;
1333
- t[19] !== s.name || t[20] !== N ? (_ = /* @__PURE__ */ n("h1", { className: N, children: s.name }), t[19] = s.name, t[20] = N, t[21] = _) : _ = t[21];
1334
- let $;
1335
- t[22] !== s.description || t[23] !== r ? ($ = s.description && /* @__PURE__ */ n("p", { className: `text-sm mt-1 ${r ? "text-zinc-400" : "text-gray-500"}`, children: s.description }), t[22] = s.description, t[23] = r, t[24] = $) : $ = t[24];
1336
- let L;
1337
- t[25] !== _ || t[26] !== $ ? (L = /* @__PURE__ */ C("div", { className: "pt-12 pb-4 px-4 text-center", children: [
1338
- _,
1339
- $
1340
- ] }), t[25] = _, t[26] = $, t[27] = L) : L = t[27];
1341
- let A;
1342
- t[28] !== a || t[29] !== s.phoneNumbers || t[30] !== r ? (A = s.phoneNumbers && s.phoneNumbers.length > 0 && /* @__PURE__ */ n(be, { icon: "phone", label: "Call", isDark: r, brandColor: a, onClick: () => {
1343
- const j = s.phoneNumbers?.[0]?.number;
1344
- j && (window.location.href = `tel:${j}`);
1345
- } }), t[28] = a, t[29] = s.phoneNumbers, t[30] = r, t[31] = A) : A = t[31];
1346
- let z;
1347
- t[32] !== a || t[33] !== s.websites || t[34] !== r ? (z = s.websites && s.websites.length > 0 && /* @__PURE__ */ n(be, { icon: "globe", label: "Website", isDark: r, brandColor: a, onClick: () => {
1348
- const j = s.websites?.[0]?.url;
1349
- j && window.open(j, "_blank", "noopener,noreferrer");
1350
- } }), t[32] = a, t[33] = s.websites, t[34] = r, t[35] = z) : z = t[35];
1351
- let S;
1352
- t[36] !== a || t[37] !== s.emails || t[38] !== r ? (S = s.emails && s.emails.length > 0 && /* @__PURE__ */ n(be, { icon: "mail", label: "Contact", isDark: r, brandColor: a, onClick: () => {
1353
- const j = s.emails?.[0]?.email;
1354
- j && (window.location.href = `mailto:${j}`);
1355
- } }), t[36] = a, t[37] = s.emails, t[38] = r, t[39] = S) : S = t[39];
1356
- let M;
1357
- t[40] !== A || t[41] !== z || t[42] !== S ? (M = /* @__PURE__ */ C("div", { className: "flex justify-center gap-4 px-4 pb-4", children: [
1358
- A,
1359
- z,
1360
- S
1361
- ] }), t[40] = A, t[41] = z, t[42] = S, t[43] = M) : M = t[43];
1362
- const I = `
1418
+ `,
1419
+ children: n.logo ? /* @__PURE__ */ e(
1420
+ "img",
1421
+ {
1422
+ src: n.logo,
1423
+ alt: `${n.name} logo`,
1424
+ className: "w-full h-full object-cover"
1425
+ }
1426
+ ) : /* @__PURE__ */ e(
1427
+ "div",
1428
+ {
1429
+ className: "w-full h-full flex items-center justify-center text-2xl font-bold text-white",
1430
+ style: { backgroundColor: c },
1431
+ children: n.name.charAt(0).toUpperCase()
1432
+ }
1433
+ )
1434
+ }
1435
+ ) }),
1436
+ /* @__PURE__ */ l("div", { className: "pt-12 pb-4 px-4 text-center", children: [
1437
+ /* @__PURE__ */ e(
1438
+ "h1",
1439
+ {
1440
+ className: `text-xl font-semibold ${i ? "text-white" : "text-gray-900"}`,
1441
+ children: n.name
1442
+ }
1443
+ ),
1444
+ n.description && /* @__PURE__ */ e("p", { className: `text-sm mt-1 ${i ? "text-zinc-400" : "text-gray-500"}`, children: n.description })
1445
+ ] }),
1446
+ /* @__PURE__ */ l("div", { className: "flex justify-center gap-4 px-4 pb-4", children: [
1447
+ n.phoneNumbers && n.phoneNumbers.length > 0 && /* @__PURE__ */ e(
1448
+ _,
1449
+ {
1450
+ icon: "phone",
1451
+ label: "Call",
1452
+ isDark: i,
1453
+ brandColor: c,
1454
+ onClick: () => {
1455
+ const d = n.phoneNumbers?.[0]?.number;
1456
+ d && (window.location.href = `tel:${d}`);
1457
+ }
1458
+ }
1459
+ ),
1460
+ n.websites && n.websites.length > 0 && /* @__PURE__ */ e(
1461
+ _,
1462
+ {
1463
+ icon: "globe",
1464
+ label: "Website",
1465
+ isDark: i,
1466
+ brandColor: c,
1467
+ onClick: () => {
1468
+ const d = n.websites?.[0]?.url;
1469
+ d && window.open(d, "_blank", "noopener,noreferrer");
1470
+ }
1471
+ }
1472
+ ),
1473
+ n.emails && n.emails.length > 0 && /* @__PURE__ */ e(
1474
+ _,
1475
+ {
1476
+ icon: "mail",
1477
+ label: "Contact",
1478
+ isDark: i,
1479
+ brandColor: c,
1480
+ onClick: () => {
1481
+ const d = n.emails?.[0]?.email;
1482
+ d && (window.location.href = `mailto:${d}`);
1483
+ }
1484
+ }
1485
+ )
1486
+ ] }),
1487
+ /* @__PURE__ */ l(
1488
+ "div",
1489
+ {
1490
+ className: `
1363
1491
  flex mx-4 rounded-lg overflow-hidden border
1364
- ${r ? "border-zinc-700 bg-zinc-800" : "border-gray-200 bg-gray-100"}
1365
- `, R = i === "info";
1366
- let B;
1367
- t[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = () => g("info"), t[44] = B) : B = t[44];
1368
- let T;
1369
- t[45] !== a || t[46] !== r || t[47] !== R ? (T = /* @__PURE__ */ n(Le, { active: R, onClick: B, isDark: r, brandColor: a, children: "Info" }), t[45] = a, t[46] = r, t[47] = R, t[48] = T) : T = t[48];
1370
- const O = i === "options";
1371
- let q;
1372
- t[49] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (q = () => g("options"), t[49] = q) : q = t[49];
1373
- let V;
1374
- t[50] !== a || t[51] !== r || t[52] !== O ? (V = /* @__PURE__ */ n(Le, { active: O, onClick: q, isDark: r, brandColor: a, children: "Options" }), t[50] = a, t[51] = r, t[52] = O, t[53] = V) : V = t[53];
1375
- let Q;
1376
- t[54] !== I || t[55] !== T || t[56] !== V ? (Q = /* @__PURE__ */ C("div", { className: I, children: [
1377
- T,
1378
- V
1379
- ] }), t[54] = I, t[55] = T, t[56] = V, t[57] = Q) : Q = t[57];
1380
- let P;
1381
- t[58] !== i || t[59] !== a || t[60] !== r ? (P = /* @__PURE__ */ n("div", { className: "p-4", children: i === "info" ? /* @__PURE__ */ n(Ct, { isDark: r, brandColor: a }) : /* @__PURE__ */ n(_t, { isDark: r }) }), t[58] = i, t[59] = a, t[60] = r, t[61] = P) : P = t[61];
1382
- let Y;
1383
- t[62] !== w || t[63] !== L || t[64] !== M || t[65] !== Q || t[66] !== P || t[67] !== v ? (Y = /* @__PURE__ */ C("div", { className: "flex-1 overflow-y-auto", children: [
1384
- v,
1385
- w,
1386
- L,
1387
- M,
1388
- Q,
1389
- P
1390
- ] }), t[62] = w, t[63] = L, t[64] = M, t[65] = Q, t[66] = P, t[67] = v, t[68] = Y) : Y = t[68];
1391
- let ee;
1392
- return t[69] !== f || t[70] !== Y || t[71] !== y ? (ee = /* @__PURE__ */ C("div", { className: f, children: [
1393
- y,
1394
- Y
1395
- ] }), t[69] = f, t[70] = Y, t[71] = y, t[72] = ee) : ee = t[72], ee;
1396
- }), be = F(function(t) {
1397
- const e = D.c(12), {
1398
- icon: s,
1399
- label: l,
1400
- isDark: i,
1401
- brandColor: g,
1402
- onClick: r
1403
- } = t;
1404
- let o;
1405
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
1406
- phone: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }),
1407
- globe: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }),
1408
- mail: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" })
1409
- }, e[0] = o) : o = e[0];
1410
- const a = o, f = `
1492
+ ${i ? "border-zinc-700 bg-zinc-800" : "border-gray-200 bg-gray-100"}
1493
+ `,
1494
+ children: [
1495
+ /* @__PURE__ */ e(
1496
+ F,
1497
+ {
1498
+ active: s === "info",
1499
+ onClick: () => a("info"),
1500
+ isDark: i,
1501
+ brandColor: c,
1502
+ children: "Info"
1503
+ }
1504
+ ),
1505
+ /* @__PURE__ */ e(
1506
+ F,
1507
+ {
1508
+ active: s === "options",
1509
+ onClick: () => a("options"),
1510
+ isDark: i,
1511
+ brandColor: c,
1512
+ children: "Options"
1513
+ }
1514
+ )
1515
+ ]
1516
+ }
1517
+ ),
1518
+ /* @__PURE__ */ e("div", { className: "p-4", children: s === "info" ? /* @__PURE__ */ e(_e, { isDark: i, brandColor: c }) : /* @__PURE__ */ e(Ue, { isDark: i }) })
1519
+ ] })
1520
+ ]
1521
+ }
1522
+ );
1523
+ }), _ = g(function({
1524
+ icon: t,
1525
+ label: n,
1526
+ isDark: o,
1527
+ brandColor: s,
1528
+ onClick: a
1529
+ }) {
1530
+ return /* @__PURE__ */ l(
1531
+ "button",
1532
+ {
1533
+ onClick: a,
1534
+ className: `
1411
1535
  flex flex-col items-center gap-2 px-6 py-3 rounded-xl border transition-colors
1412
- ${i ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700" : "bg-white border-gray-200 hover:bg-gray-50"}
1413
- `, h = a[s];
1414
- let d;
1415
- e[1] !== g || e[2] !== h ? (d = /* @__PURE__ */ n("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: g, children: h }), e[1] = g, e[2] = h, e[3] = d) : d = e[3];
1416
- const u = `text-xs font-medium ${i ? "text-zinc-300" : "text-gray-600"}`;
1417
- let m;
1418
- e[4] !== l || e[5] !== u ? (m = /* @__PURE__ */ n("span", { className: u, children: l }), e[4] = l, e[5] = u, e[6] = m) : m = e[6];
1419
- let p;
1420
- return e[7] !== r || e[8] !== f || e[9] !== d || e[10] !== m ? (p = /* @__PURE__ */ C("button", { onClick: r, className: f, children: [
1421
- d,
1422
- m
1423
- ] }), e[7] = r, e[8] = f, e[9] = d, e[10] = m, e[11] = p) : p = e[11], p;
1424
- }), Le = F(function(t) {
1425
- const e = D.c(8), {
1426
- active: s,
1427
- onClick: l,
1428
- isDark: i,
1429
- brandColor: g,
1430
- children: r
1431
- } = t, o = `
1536
+ ${o ? "bg-zinc-800 border-zinc-700 hover:bg-zinc-700" : "bg-white border-gray-200 hover:bg-gray-50"}
1537
+ `,
1538
+ children: [
1539
+ /* @__PURE__ */ e(
1540
+ "svg",
1541
+ {
1542
+ className: "w-6 h-6",
1543
+ fill: "none",
1544
+ viewBox: "0 0 24 24",
1545
+ stroke: s,
1546
+ children: {
1547
+ phone: /* @__PURE__ */ e(
1548
+ "path",
1549
+ {
1550
+ strokeLinecap: "round",
1551
+ strokeLinejoin: "round",
1552
+ strokeWidth: 2,
1553
+ 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"
1554
+ }
1555
+ ),
1556
+ globe: /* @__PURE__ */ e(
1557
+ "path",
1558
+ {
1559
+ strokeLinecap: "round",
1560
+ strokeLinejoin: "round",
1561
+ strokeWidth: 2,
1562
+ 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"
1563
+ }
1564
+ ),
1565
+ mail: /* @__PURE__ */ e(
1566
+ "path",
1567
+ {
1568
+ strokeLinecap: "round",
1569
+ strokeLinejoin: "round",
1570
+ strokeWidth: 2,
1571
+ d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
1572
+ }
1573
+ )
1574
+ }[t]
1575
+ }
1576
+ ),
1577
+ /* @__PURE__ */ e(
1578
+ "span",
1579
+ {
1580
+ className: `text-xs font-medium ${o ? "text-zinc-300" : "text-gray-600"}`,
1581
+ children: n
1582
+ }
1583
+ )
1584
+ ]
1585
+ }
1586
+ );
1587
+ }), F = g(function({
1588
+ active: t,
1589
+ onClick: n,
1590
+ isDark: o,
1591
+ brandColor: s,
1592
+ children: a
1593
+ }) {
1594
+ return /* @__PURE__ */ e(
1595
+ "button",
1596
+ {
1597
+ onClick: n,
1598
+ className: `
1432
1599
  flex-1 py-2.5 text-sm font-medium transition-colors rounded-lg
1433
- ${s ? "text-white" : i ? "text-zinc-400 hover:text-zinc-200" : "text-gray-500 hover:text-gray-700"}
1434
- `;
1435
- let a;
1436
- e[0] !== s || e[1] !== g ? (a = s ? {
1437
- backgroundColor: g
1438
- } : void 0, e[0] = s, e[1] = g, e[2] = a) : a = e[2];
1439
- let f;
1440
- return e[3] !== r || e[4] !== l || e[5] !== o || e[6] !== a ? (f = /* @__PURE__ */ n("button", { onClick: l, className: o, style: a, children: r }), e[3] = r, e[4] = l, e[5] = o, e[6] = a, e[7] = f) : f = e[7], f;
1441
- }), Ct = F(function(t) {
1442
- const e = D.c(19), {
1443
- isDark: s,
1444
- brandColor: l
1445
- } = t, {
1446
- businessInfo: i
1447
- } = K();
1448
- if (!(i.phoneNumbers && i.phoneNumbers.length > 0 || i.websites && i.websites.length > 0 || i.emails && i.emails.length > 0)) {
1449
- const d = `text-center py-8 ${s ? "text-zinc-500" : "text-gray-400"}`;
1450
- let u;
1451
- return e[0] !== d ? (u = /* @__PURE__ */ n("div", { className: d, children: "No contact information available" }), e[0] = d, e[1] = u) : u = e[1], u;
1452
- }
1453
- const r = `
1600
+ ${t ? "text-white" : o ? "text-zinc-400 hover:text-zinc-200" : "text-gray-500 hover:text-gray-700"}
1601
+ `,
1602
+ style: t ? { backgroundColor: s } : void 0,
1603
+ children: a
1604
+ }
1605
+ );
1606
+ }), _e = g(function({ isDark: t, brandColor: n }) {
1607
+ const { businessInfo: o } = N();
1608
+ return o.phoneNumbers && o.phoneNumbers.length > 0 || o.websites && o.websites.length > 0 || o.emails && o.emails.length > 0 ? /* @__PURE__ */ l(
1609
+ "div",
1610
+ {
1611
+ className: `
1454
1612
  rounded-xl overflow-hidden border divide-y
1455
- ${s ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
1456
- `;
1457
- let o;
1458
- e[2] !== l || e[3] !== i.phoneNumbers || e[4] !== s ? (o = i.phoneNumbers?.map((d, u) => /* @__PURE__ */ n(xe, { icon: "phone", primary: d.number, secondary: d.label, isDark: s, brandColor: l, onClick: () => window.location.href = `tel:${d.number}` }, `phone-${u}`)), e[2] = l, e[3] = i.phoneNumbers, e[4] = s, e[5] = o) : o = e[5];
1459
- let a;
1460
- e[6] !== l || e[7] !== i.websites || e[8] !== s ? (a = i.websites?.map((d, u) => /* @__PURE__ */ n(xe, { icon: "globe", primary: d.url.replace(/^https?:\/\//, ""), secondary: d.label || "Website", isDark: s, brandColor: l, onClick: () => window.open(d.url, "_blank", "noopener,noreferrer") }, `web-${u}`)), e[6] = l, e[7] = i.websites, e[8] = s, e[9] = a) : a = e[9];
1461
- let f;
1462
- e[10] !== l || e[11] !== i.emails || e[12] !== s ? (f = i.emails?.map((d, u) => /* @__PURE__ */ n(xe, { icon: "mail", primary: d.email, secondary: d.label || "Email", isDark: s, brandColor: l, onClick: () => window.location.href = `mailto:${d.email}` }, `email-${u}`)), e[10] = l, e[11] = i.emails, e[12] = s, e[13] = f) : f = e[13];
1463
- let h;
1464
- return e[14] !== r || e[15] !== o || e[16] !== a || e[17] !== f ? (h = /* @__PURE__ */ C("div", { className: r, children: [
1465
- o,
1466
- a,
1467
- f
1468
- ] }), e[14] = r, e[15] = o, e[16] = a, e[17] = f, e[18] = h) : h = e[18], h;
1469
- }), xe = F(function(t) {
1470
- const e = D.c(20), {
1471
- icon: s,
1472
- primary: l,
1473
- secondary: i,
1474
- isDark: g,
1475
- onClick: r
1476
- } = t;
1477
- let o;
1478
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
1479
- phone: "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",
1480
- globe: "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",
1481
- mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
1482
- }, e[0] = o) : o = e[0];
1483
- const a = o, f = `
1613
+ ${t ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
1614
+ `,
1615
+ children: [
1616
+ o.phoneNumbers?.map((a, i) => /* @__PURE__ */ e(
1617
+ U,
1618
+ {
1619
+ icon: "phone",
1620
+ primary: a.number,
1621
+ secondary: a.label,
1622
+ isDark: t,
1623
+ brandColor: n,
1624
+ onClick: () => window.location.href = `tel:${a.number}`
1625
+ },
1626
+ `phone-${i}`
1627
+ )),
1628
+ o.websites?.map((a, i) => /* @__PURE__ */ e(
1629
+ U,
1630
+ {
1631
+ icon: "globe",
1632
+ primary: a.url.replace(/^https?:\/\//, ""),
1633
+ secondary: a.label || "Website",
1634
+ isDark: t,
1635
+ brandColor: n,
1636
+ onClick: () => window.open(a.url, "_blank", "noopener,noreferrer")
1637
+ },
1638
+ `web-${i}`
1639
+ )),
1640
+ o.emails?.map((a, i) => /* @__PURE__ */ e(
1641
+ U,
1642
+ {
1643
+ icon: "mail",
1644
+ primary: a.email,
1645
+ secondary: a.label || "Email",
1646
+ isDark: t,
1647
+ brandColor: n,
1648
+ onClick: () => window.location.href = `mailto:${a.email}`
1649
+ },
1650
+ `email-${i}`
1651
+ ))
1652
+ ]
1653
+ }
1654
+ ) : /* @__PURE__ */ e(
1655
+ "div",
1656
+ {
1657
+ className: `text-center py-8 ${t ? "text-zinc-500" : "text-gray-400"}`,
1658
+ children: "No contact information available"
1659
+ }
1660
+ );
1661
+ }), U = g(function({
1662
+ icon: t,
1663
+ primary: n,
1664
+ secondary: o,
1665
+ isDark: s,
1666
+ onClick: a
1667
+ }) {
1668
+ return /* @__PURE__ */ l(
1669
+ "button",
1670
+ {
1671
+ onClick: a,
1672
+ className: `
1484
1673
  w-full flex items-center gap-4 px-4 py-3.5 text-left transition-colors
1485
- ${g ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
1486
- `, h = `w-5 h-5 flex-shrink-0 ${g ? "text-zinc-500" : "text-gray-400"}`, d = a[s];
1487
- let u;
1488
- e[1] !== d ? (u = /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d }), e[1] = d, e[2] = u) : u = e[2];
1489
- let m;
1490
- e[3] !== h || e[4] !== u ? (m = /* @__PURE__ */ n("svg", { className: h, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: u }), e[3] = h, e[4] = u, e[5] = m) : m = e[5];
1491
- const p = `text-sm font-medium truncate ${g ? "text-white" : "text-gray-900"}`;
1492
- let b;
1493
- e[6] !== l || e[7] !== p ? (b = /* @__PURE__ */ n("p", { className: p, children: l }), e[6] = l, e[7] = p, e[8] = b) : b = e[8];
1494
- let y;
1495
- e[9] !== g || e[10] !== i ? (y = i && /* @__PURE__ */ n("p", { className: `text-xs truncate ${g ? "text-zinc-500" : "text-gray-500"}`, children: i }), e[9] = g, e[10] = i, e[11] = y) : y = e[11];
1496
- let v;
1497
- e[12] !== b || e[13] !== y ? (v = /* @__PURE__ */ C("div", { className: "flex-1 min-w-0", children: [
1498
- b,
1499
- y
1500
- ] }), e[12] = b, e[13] = y, e[14] = v) : v = e[14];
1501
- let x;
1502
- return e[15] !== r || e[16] !== v || e[17] !== f || e[18] !== m ? (x = /* @__PURE__ */ C("button", { onClick: r, className: f, children: [
1503
- m,
1504
- v
1505
- ] }), e[15] = r, e[16] = v, e[17] = f, e[18] = m, e[19] = x) : x = e[19], x;
1506
- }), _t = F(function(t) {
1507
- const e = D.c(9), {
1508
- isDark: s
1509
- } = t, l = `
1674
+ ${s ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
1675
+ `,
1676
+ children: [
1677
+ /* @__PURE__ */ e(
1678
+ "svg",
1679
+ {
1680
+ className: `w-5 h-5 flex-shrink-0 ${s ? "text-zinc-500" : "text-gray-400"}`,
1681
+ fill: "none",
1682
+ viewBox: "0 0 24 24",
1683
+ stroke: "currentColor",
1684
+ children: /* @__PURE__ */ e(
1685
+ "path",
1686
+ {
1687
+ strokeLinecap: "round",
1688
+ strokeLinejoin: "round",
1689
+ strokeWidth: 2,
1690
+ d: {
1691
+ phone: "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",
1692
+ globe: "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",
1693
+ mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
1694
+ }[t]
1695
+ }
1696
+ )
1697
+ }
1698
+ ),
1699
+ /* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: [
1700
+ /* @__PURE__ */ e(
1701
+ "p",
1702
+ {
1703
+ className: `text-sm font-medium truncate ${s ? "text-white" : "text-gray-900"}`,
1704
+ children: n
1705
+ }
1706
+ ),
1707
+ o && /* @__PURE__ */ e(
1708
+ "p",
1709
+ {
1710
+ className: `text-xs truncate ${s ? "text-zinc-500" : "text-gray-500"}`,
1711
+ children: o
1712
+ }
1713
+ )
1714
+ ] })
1715
+ ]
1716
+ }
1717
+ );
1718
+ }), Ue = g(function({ isDark: t }) {
1719
+ return /* @__PURE__ */ l(
1720
+ "div",
1721
+ {
1722
+ className: `
1510
1723
  rounded-xl overflow-hidden border divide-y
1511
- ${s ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
1512
- `;
1513
- let i, g, r;
1514
- e[0] !== s ? (i = /* @__PURE__ */ n(ye, { icon: "bell", label: "Notifications", isDark: s }), g = /* @__PURE__ */ n(ye, { icon: "block", label: "Block & report spam", isDark: s }), r = /* @__PURE__ */ n(ye, { icon: "info", label: "About RCS", isDark: s }), e[0] = s, e[1] = i, e[2] = g, e[3] = r) : (i = e[1], g = e[2], r = e[3]);
1515
- let o;
1516
- return e[4] !== l || e[5] !== i || e[6] !== g || e[7] !== r ? (o = /* @__PURE__ */ C("div", { className: l, children: [
1517
- i,
1518
- g,
1519
- r
1520
- ] }), e[4] = l, e[5] = i, e[6] = g, e[7] = r, e[8] = o) : o = e[8], o;
1521
- }), ye = F(function(t) {
1522
- const e = D.c(13), {
1523
- icon: s,
1524
- label: l,
1525
- isDark: i
1526
- } = t;
1527
- let g;
1528
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = {
1529
- bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
1530
- block: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",
1531
- info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1532
- }, e[0] = g) : g = e[0];
1533
- const r = g, o = `
1724
+ ${t ? "bg-zinc-900 border-zinc-800 divide-zinc-800" : "bg-gray-50 border-gray-200 divide-gray-200"}
1725
+ `,
1726
+ children: [
1727
+ /* @__PURE__ */ e(
1728
+ D,
1729
+ {
1730
+ icon: "bell",
1731
+ label: "Notifications",
1732
+ isDark: t
1733
+ }
1734
+ ),
1735
+ /* @__PURE__ */ e(
1736
+ D,
1737
+ {
1738
+ icon: "block",
1739
+ label: "Block & report spam",
1740
+ isDark: t
1741
+ }
1742
+ ),
1743
+ /* @__PURE__ */ e(
1744
+ D,
1745
+ {
1746
+ icon: "info",
1747
+ label: "About RCS",
1748
+ isDark: t
1749
+ }
1750
+ )
1751
+ ]
1752
+ }
1753
+ );
1754
+ }), D = g(function({
1755
+ icon: t,
1756
+ label: n,
1757
+ isDark: o
1758
+ }) {
1759
+ return /* @__PURE__ */ l(
1760
+ "button",
1761
+ {
1762
+ className: `
1534
1763
  w-full flex items-center gap-4 px-4 py-3.5 text-left transition-colors
1535
- ${i ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
1536
- `, a = `w-5 h-5 flex-shrink-0 ${i ? "text-zinc-500" : "text-gray-400"}`, f = r[s];
1537
- let h;
1538
- e[1] !== f ? (h = /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: f }), e[1] = f, e[2] = h) : h = e[2];
1539
- let d;
1540
- e[3] !== a || e[4] !== h ? (d = /* @__PURE__ */ n("svg", { className: a, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: h }), e[3] = a, e[4] = h, e[5] = d) : d = e[5];
1541
- const u = `text-sm font-medium ${i ? "text-white" : "text-gray-900"}`;
1542
- let m;
1543
- e[6] !== l || e[7] !== u ? (m = /* @__PURE__ */ n("span", { className: u, children: l }), e[6] = l, e[7] = u, e[8] = m) : m = e[8];
1544
- let p;
1545
- return e[9] !== o || e[10] !== d || e[11] !== m ? (p = /* @__PURE__ */ C("button", { className: o, children: [
1546
- d,
1547
- m
1548
- ] }), e[9] = o, e[10] = d, e[11] = m, e[12] = p) : p = e[12], p;
1549
- }), Se = {
1764
+ ${o ? "hover:bg-zinc-800" : "hover:bg-gray-100"}
1765
+ `,
1766
+ children: [
1767
+ /* @__PURE__ */ e(
1768
+ "svg",
1769
+ {
1770
+ className: `w-5 h-5 flex-shrink-0 ${o ? "text-zinc-500" : "text-gray-400"}`,
1771
+ fill: "none",
1772
+ viewBox: "0 0 24 24",
1773
+ stroke: "currentColor",
1774
+ children: /* @__PURE__ */ e(
1775
+ "path",
1776
+ {
1777
+ strokeLinecap: "round",
1778
+ strokeLinejoin: "round",
1779
+ strokeWidth: 2,
1780
+ d: {
1781
+ bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
1782
+ block: "M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",
1783
+ info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1784
+ }[t]
1785
+ }
1786
+ )
1787
+ }
1788
+ ),
1789
+ /* @__PURE__ */ e(
1790
+ "span",
1791
+ {
1792
+ className: `text-sm font-medium ${o ? "text-white" : "text-gray-900"}`,
1793
+ children: n
1794
+ }
1795
+ )
1796
+ ]
1797
+ }
1798
+ );
1799
+ }), J = {
1550
1800
  FULL: "h-full",
1551
1801
  TALL: "h-[80%]",
1552
1802
  HALF: "h-[50%]"
1553
- }, Lt = F(function() {
1554
- const t = D.c(65), {
1555
- theme: e,
1556
- businessInfo: s,
1557
- webView: l,
1558
- closeWebView: i
1559
- } = K(), [g, r] = ne(!0), [o, a] = ne(!1), f = e === "dark", h = s.brandColor || "#0084ff";
1560
- let d;
1561
- t[0] !== l?.url ? (d = () => {
1562
- l?.url && (r(!0), a(!1));
1563
- }, t[0] = l?.url, t[1] = d) : d = t[1];
1564
- const u = l?.url;
1565
- let m;
1566
- t[2] !== u ? (m = [u], t[2] = u, t[3] = m) : m = t[3], ie(d, m);
1567
- let p;
1568
- t[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => {
1569
- r(!1);
1570
- }, t[4] = p) : p = t[4];
1571
- const b = p;
1572
- let y;
1573
- t[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = () => {
1574
- r(!1), a(!0);
1575
- }, t[5] = y) : y = t[5];
1576
- const v = y, x = St;
1577
- if (!l || !l.isOpen)
1578
- return null;
1579
- const {
1580
- url: k,
1581
- viewMode: w,
1582
- title: N,
1583
- postbackData: _
1584
- } = l;
1585
- let $;
1586
- t[6] !== N || t[7] !== k ? ($ = N || x(k), t[6] = N, t[7] = k, t[8] = $) : $ = t[8];
1587
- const L = $, A = w === "FULL", z = w === "TALL" || w === "HALF", S = Se[w] || Se.TALL, M = `
1803
+ }, De = g(function() {
1804
+ const { theme: t, businessInfo: n, webView: o, closeWebView: s } = N(), [a, i] = z(!0), [u, c] = z(!1), d = t === "dark", m = n.brandColor || "#0084ff";
1805
+ S(() => {
1806
+ o?.url && (i(!0), c(!1));
1807
+ }, [o?.url]);
1808
+ const f = M(() => {
1809
+ i(!1);
1810
+ }, []), v = M(() => {
1811
+ i(!1), c(!0);
1812
+ }, []), x = (k) => {
1813
+ try {
1814
+ return new URL(k).hostname;
1815
+ } catch {
1816
+ return "Web Page";
1817
+ }
1818
+ };
1819
+ if (!o || !o.isOpen) return null;
1820
+ const { url: L, viewMode: b, title: p, postbackData: y } = o, h = p || x(L), w = b === "FULL", C = b === "TALL" || b === "HALF", I = J[b] || J.TALL;
1821
+ return /* @__PURE__ */ l(
1822
+ "div",
1823
+ {
1824
+ className: `
1588
1825
  rcs-webview-overlay absolute inset-0 z-50 flex flex-col
1589
- ${A ? "" : "justify-end"}
1590
- ${f ? "bg-black/60" : "bg-black/40"}
1591
- `, I = `WebView: ${L}`;
1592
- let R;
1593
- t[9] !== i || t[10] !== z ? (R = z && /* @__PURE__ */ n("button", { type: "button", className: "absolute inset-0 w-full h-full cursor-default", onClick: i, "aria-label": "Close WebView" }), t[9] = i, t[10] = z, t[11] = R) : R = t[11];
1594
- const B = `
1826
+ ${w ? "" : "justify-end"}
1827
+ ${d ? "bg-black/60" : "bg-black/40"}
1828
+ `,
1829
+ role: "dialog",
1830
+ "aria-modal": "true",
1831
+ "aria-label": `WebView: ${h}`,
1832
+ "data-postback": y,
1833
+ "data-view-mode": b,
1834
+ children: [
1835
+ C && /* @__PURE__ */ e(
1836
+ "button",
1837
+ {
1838
+ type: "button",
1839
+ className: "absolute inset-0 w-full h-full cursor-default",
1840
+ onClick: s,
1841
+ "aria-label": "Close WebView"
1842
+ }
1843
+ ),
1844
+ /* @__PURE__ */ l(
1845
+ "div",
1846
+ {
1847
+ className: `
1595
1848
  rcs-webview-container relative flex flex-col overflow-hidden
1596
- ${f ? "bg-zinc-900" : "bg-white"}
1597
- ${S} w-full
1598
- ${z ? "rounded-t-2xl shadow-2xl" : ""}
1599
- `;
1600
- let T;
1601
- t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = {
1602
- position: "relative",
1603
- zIndex: 1
1604
- }, t[12] = T) : T = t[12];
1605
- const O = `
1849
+ ${d ? "bg-zinc-900" : "bg-white"}
1850
+ ${I} w-full
1851
+ ${C ? "rounded-t-2xl shadow-2xl" : ""}
1852
+ `,
1853
+ style: {
1854
+ // Ensure container is above backdrop
1855
+ position: "relative",
1856
+ zIndex: 1
1857
+ },
1858
+ children: [
1859
+ /* @__PURE__ */ l(
1860
+ "header",
1861
+ {
1862
+ className: `
1606
1863
  rcs-webview-header flex items-center gap-3 px-2 py-2 flex-shrink-0
1607
1864
  border-b
1608
- ${f ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
1609
- `, q = `
1865
+ ${d ? "bg-zinc-900 border-zinc-800" : "bg-white border-gray-200"}
1866
+ `,
1867
+ children: [
1868
+ /* @__PURE__ */ e(
1869
+ "button",
1870
+ {
1871
+ type: "button",
1872
+ onClick: s,
1873
+ className: `
1610
1874
  rcs-webview-close w-10 h-10 rounded-full flex items-center justify-center
1611
1875
  transition-colors
1612
- ${f ? "text-white hover:bg-zinc-800" : "text-gray-700 hover:bg-gray-100"}
1613
- `;
1614
- let V;
1615
- t[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t[13] = V) : V = t[13];
1616
- let Q;
1617
- t[14] !== i || t[15] !== q ? (Q = /* @__PURE__ */ n("button", { type: "button", onClick: i, className: q, "aria-label": "Close WebView", children: V }), t[14] = i, t[15] = q, t[16] = Q) : Q = t[16];
1618
- const P = `
1876
+ ${d ? "text-white hover:bg-zinc-800" : "text-gray-700 hover:bg-gray-100"}
1877
+ `,
1878
+ "aria-label": "Close WebView",
1879
+ children: /* @__PURE__ */ e(
1880
+ "svg",
1881
+ {
1882
+ className: "w-6 h-6",
1883
+ fill: "none",
1884
+ viewBox: "0 0 24 24",
1885
+ stroke: "currentColor",
1886
+ strokeWidth: 2,
1887
+ children: /* @__PURE__ */ e(
1888
+ "path",
1889
+ {
1890
+ strokeLinecap: "round",
1891
+ strokeLinejoin: "round",
1892
+ d: "M15 19l-7-7 7-7"
1893
+ }
1894
+ )
1895
+ }
1896
+ )
1897
+ }
1898
+ ),
1899
+ /* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: [
1900
+ /* @__PURE__ */ e(
1901
+ "h2",
1902
+ {
1903
+ className: `
1619
1904
  rcs-webview-title text-base font-medium truncate
1620
- ${f ? "text-white" : "text-gray-900"}
1621
- `;
1622
- let Y;
1623
- t[17] !== L || t[18] !== P ? (Y = /* @__PURE__ */ n("h2", { className: P, children: L }), t[17] = L, t[18] = P, t[19] = Y) : Y = t[19];
1624
- const ee = `
1905
+ ${d ? "text-white" : "text-gray-900"}
1906
+ `,
1907
+ children: h
1908
+ }
1909
+ ),
1910
+ /* @__PURE__ */ e(
1911
+ "p",
1912
+ {
1913
+ className: `
1625
1914
  rcs-webview-url text-xs truncate
1626
- ${f ? "text-zinc-400" : "text-gray-500"}
1627
- `;
1628
- let j;
1629
- t[20] !== k ? (j = x(k), t[20] = k, t[21] = j) : j = t[21];
1630
- let G;
1631
- t[22] !== ee || t[23] !== j ? (G = /* @__PURE__ */ n("p", { className: ee, children: j }), t[22] = ee, t[23] = j, t[24] = G) : G = t[24];
1632
- let E;
1633
- t[25] !== Y || t[26] !== G ? (E = /* @__PURE__ */ C("div", { className: "flex-1 min-w-0", children: [
1634
- Y,
1635
- G
1636
- ] }), t[25] = Y, t[26] = G, t[27] = E) : E = t[27];
1637
- const J = `
1915
+ ${d ? "text-zinc-400" : "text-gray-500"}
1916
+ `,
1917
+ children: x(L)
1918
+ }
1919
+ )
1920
+ ] }),
1921
+ /* @__PURE__ */ e(
1922
+ "button",
1923
+ {
1924
+ type: "button",
1925
+ className: `
1638
1926
  w-10 h-10 rounded-full flex items-center justify-center
1639
- ${f ? "text-zinc-400 hover:bg-zinc-800" : "text-gray-500 hover:bg-gray-100"}
1640
- `;
1641
- let W;
1642
- t[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ C("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24", children: [
1643
- /* @__PURE__ */ n("circle", { cx: "12", cy: "5", r: "2" }),
1644
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
1645
- /* @__PURE__ */ n("circle", { cx: "12", cy: "19", r: "2" })
1646
- ] }), t[28] = W) : W = t[28];
1647
- let U;
1648
- t[29] !== J ? (U = /* @__PURE__ */ n("button", { type: "button", className: J, "aria-label": "More options", children: W }), t[29] = J, t[30] = U) : U = t[30];
1649
- let H;
1650
- t[31] !== O || t[32] !== Q || t[33] !== E || t[34] !== U ? (H = /* @__PURE__ */ C("header", { className: O, children: [
1651
- Q,
1652
- E,
1653
- U
1654
- ] }), t[31] = O, t[32] = Q, t[33] = E, t[34] = U, t[35] = H) : H = t[35];
1655
- let X;
1656
- t[36] !== h || t[37] !== g ? (X = g && /* @__PURE__ */ n("div", { className: "rcs-webview-loading absolute top-14 left-0 right-0 h-1 overflow-hidden", style: {
1657
- backgroundColor: `${h}20`
1658
- }, children: /* @__PURE__ */ n("div", { className: "h-full animate-pulse", style: {
1659
- backgroundColor: h,
1660
- animation: "webview-loading 1.5s ease-in-out infinite",
1661
- width: "30%"
1662
- } }) }), t[36] = h, t[37] = g, t[38] = X) : X = t[38];
1663
- let Z;
1664
- t[39] !== i || t[40] !== f || t[41] !== o ? (Z = o && /* @__PURE__ */ C("div", { className: `
1927
+ ${d ? "text-zinc-400 hover:bg-zinc-800" : "text-gray-500 hover:bg-gray-100"}
1928
+ `,
1929
+ "aria-label": "More options",
1930
+ children: /* @__PURE__ */ l(
1931
+ "svg",
1932
+ {
1933
+ className: "w-5 h-5",
1934
+ fill: "currentColor",
1935
+ viewBox: "0 0 24 24",
1936
+ children: [
1937
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "5", r: "2" }),
1938
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
1939
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "19", r: "2" })
1940
+ ]
1941
+ }
1942
+ )
1943
+ }
1944
+ )
1945
+ ]
1946
+ }
1947
+ ),
1948
+ a && /* @__PURE__ */ e(
1949
+ "div",
1950
+ {
1951
+ className: "rcs-webview-loading absolute top-14 left-0 right-0 h-1 overflow-hidden",
1952
+ style: { backgroundColor: `${m}20` },
1953
+ children: /* @__PURE__ */ e(
1954
+ "div",
1955
+ {
1956
+ className: "h-full animate-pulse",
1957
+ style: {
1958
+ backgroundColor: m,
1959
+ animation: "webview-loading 1.5s ease-in-out infinite",
1960
+ width: "30%"
1961
+ }
1962
+ }
1963
+ )
1964
+ }
1965
+ ),
1966
+ u && /* @__PURE__ */ l(
1967
+ "div",
1968
+ {
1969
+ className: `
1665
1970
  rcs-webview-error flex-1 flex flex-col items-center justify-center p-6 text-center
1666
- ${f ? "text-zinc-400" : "text-gray-500"}
1667
- `, children: [
1668
- /* @__PURE__ */ n("svg", { className: "w-16 h-16 mb-4 opacity-50", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
1669
- /* @__PURE__ */ n("p", { className: "text-sm font-medium mb-2", children: "Unable to load page" }),
1670
- /* @__PURE__ */ n("p", { className: "text-xs opacity-75 mb-4", children: "This content cannot be displayed in the emulator" }),
1671
- /* @__PURE__ */ n("button", { type: "button", onClick: i, className: `
1971
+ ${d ? "text-zinc-400" : "text-gray-500"}
1972
+ `,
1973
+ children: [
1974
+ /* @__PURE__ */ e(
1975
+ "svg",
1976
+ {
1977
+ className: "w-16 h-16 mb-4 opacity-50",
1978
+ fill: "none",
1979
+ viewBox: "0 0 24 24",
1980
+ stroke: "currentColor",
1981
+ children: /* @__PURE__ */ e(
1982
+ "path",
1983
+ {
1984
+ strokeLinecap: "round",
1985
+ strokeLinejoin: "round",
1986
+ strokeWidth: 1.5,
1987
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
1988
+ }
1989
+ )
1990
+ }
1991
+ ),
1992
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium mb-2", children: "Unable to load page" }),
1993
+ /* @__PURE__ */ e("p", { className: "text-xs opacity-75 mb-4", children: "This content cannot be displayed in the emulator" }),
1994
+ /* @__PURE__ */ e(
1995
+ "button",
1996
+ {
1997
+ type: "button",
1998
+ onClick: s,
1999
+ className: `
1672
2000
  px-4 py-2 rounded-full text-sm font-medium
1673
- ${f ? "bg-zinc-800 text-white hover:bg-zinc-700" : "bg-gray-100 text-gray-700 hover:bg-gray-200"}
1674
- `, children: "Go Back" })
1675
- ] }), t[39] = i, t[40] = f, t[41] = o, t[42] = Z) : Z = t[42];
1676
- let te;
1677
- t[43] !== L || t[44] !== o || t[45] !== k ? (te = !o && /* @__PURE__ */ n("div", { className: "rcs-webview-iframe-container flex-1 overflow-hidden", children: /* @__PURE__ */ n("iframe", { src: k, title: L, className: "w-full h-full border-0", onLoad: b, onError: v, sandbox: "allow-scripts allow-same-origin allow-forms allow-popups", referrerPolicy: "no-referrer-when-downgrade", loading: "lazy" }) }), t[43] = L, t[44] = o, t[45] = k, t[46] = te) : te = t[46];
1678
- let se;
1679
- t[47] !== z || t[48] !== f ? (se = z && /* @__PURE__ */ n("div", { className: `
2001
+ ${d ? "bg-zinc-800 text-white hover:bg-zinc-700" : "bg-gray-100 text-gray-700 hover:bg-gray-200"}
2002
+ `,
2003
+ children: "Go Back"
2004
+ }
2005
+ )
2006
+ ]
2007
+ }
2008
+ ),
2009
+ !u && /* @__PURE__ */ e("div", { className: "rcs-webview-iframe-container flex-1 overflow-hidden", children: /* @__PURE__ */ e(
2010
+ "iframe",
2011
+ {
2012
+ src: L,
2013
+ title: h,
2014
+ className: "w-full h-full border-0",
2015
+ onLoad: f,
2016
+ onError: v,
2017
+ sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
2018
+ referrerPolicy: "no-referrer-when-downgrade",
2019
+ loading: "lazy"
2020
+ }
2021
+ ) }),
2022
+ C && /* @__PURE__ */ e(
2023
+ "div",
2024
+ {
2025
+ className: `
1680
2026
  rcs-webview-safe-area h-2 flex-shrink-0
1681
- ${f ? "bg-zinc-900" : "bg-white"}
1682
- ` }), t[47] = z, t[48] = f, t[49] = se) : se = t[49];
1683
- let re;
1684
- t[50] !== H || t[51] !== X || t[52] !== Z || t[53] !== te || t[54] !== se || t[55] !== B ? (re = /* @__PURE__ */ C("div", { className: B, style: T, children: [
1685
- H,
1686
- X,
1687
- Z,
1688
- te,
1689
- se
1690
- ] }), t[50] = H, t[51] = X, t[52] = Z, t[53] = te, t[54] = se, t[55] = B, t[56] = re) : re = t[56];
1691
- let ce;
1692
- t[57] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = /* @__PURE__ */ n("style", { children: `
2027
+ ${d ? "bg-zinc-900" : "bg-white"}
2028
+ `
2029
+ }
2030
+ )
2031
+ ]
2032
+ }
2033
+ ),
2034
+ /* @__PURE__ */ e("style", { children: `
1693
2035
  @keyframes webview-loading {
1694
2036
  0% { transform: translateX(-100%); }
1695
2037
  50% { transform: translateX(200%); }
1696
2038
  100% { transform: translateX(-100%); }
1697
2039
  }
1698
- ` }), t[57] = ce) : ce = t[57];
1699
- let de;
1700
- return t[58] !== _ || t[59] !== re || t[60] !== M || t[61] !== I || t[62] !== R || t[63] !== w ? (de = /* @__PURE__ */ C("div", { className: M, role: "dialog", "aria-modal": "true", "aria-label": I, "data-postback": _, "data-view-mode": w, children: [
1701
- R,
1702
- re,
1703
- ce
1704
- ] }), t[58] = _, t[59] = re, t[60] = M, t[61] = I, t[62] = R, t[63] = w, t[64] = de) : de = t[64], de;
1705
- });
1706
- function St(c) {
1707
- try {
1708
- return new URL(c).hostname;
1709
- } catch {
1710
- return "Web Page";
1711
- }
1712
- }
1713
- const $t = F(function(t) {
1714
- const e = D.c(39), {
1715
- onUnlock: s,
1716
- messagePreview: l
1717
- } = t, i = l === void 0 ? "New message" : l, {
1718
- theme: g,
1719
- businessInfo: r
1720
- } = K();
1721
- let o;
1722
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ new Date(), e[0] = o) : o = e[0];
1723
- const [a, f] = ne(o), h = g === "dark";
1724
- let d, u;
1725
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = () => {
1726
- const q = setInterval(() => {
1727
- f(/* @__PURE__ */ new Date());
2040
+ ` })
2041
+ ]
2042
+ }
2043
+ );
2044
+ }), Oe = g(function({
2045
+ onUnlock: t,
2046
+ messagePreview: n = "New message"
2047
+ }) {
2048
+ const { theme: o, businessInfo: s } = N(), [a, i] = z(/* @__PURE__ */ new Date()), u = o === "dark";
2049
+ S(() => {
2050
+ const f = setInterval(() => {
2051
+ i(/* @__PURE__ */ new Date());
1728
2052
  }, 1e3);
1729
- return () => clearInterval(q);
1730
- }, u = [], e[1] = d, e[2] = u) : (d = e[1], u = e[2]), ie(d, u);
1731
- let m;
1732
- e[3] !== a ? (m = a.toLocaleTimeString([], {
2053
+ return () => clearInterval(f);
2054
+ }, []);
2055
+ const c = a.toLocaleTimeString([], {
1733
2056
  hour: "numeric",
1734
2057
  minute: "2-digit",
1735
2058
  hour12: !0
1736
- }), e[3] = a, e[4] = m) : m = e[4];
1737
- const p = m;
1738
- let b;
1739
- e[5] !== a ? (b = a.toLocaleDateString([], {
2059
+ }), d = a.toLocaleDateString([], {
1740
2060
  weekday: "short",
1741
2061
  month: "long",
1742
2062
  day: "numeric"
1743
- }), e[5] = a, e[6] = b) : b = e[6];
1744
- const y = b, v = `
2063
+ });
2064
+ return /* @__PURE__ */ l(
2065
+ "div",
2066
+ {
2067
+ className: `
1745
2068
  lock-screen flex flex-col h-full w-full select-none
1746
- ${h ? "bg-zinc-900" : "bg-zinc-800"}
1747
- `;
1748
- let x;
1749
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ n("div", { className: "h-6" }), e[7] = x) : x = e[7];
1750
- let k;
1751
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n("div", { className: "flex justify-center mt-4", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-zinc-700 flex items-center justify-center", children: /* @__PURE__ */ n("svg", { className: "w-4 h-4 text-zinc-400", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n("path", { fillRule: "evenodd", d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z", clipRule: "evenodd" }) }) }) }), e[8] = k) : k = e[8];
1752
- let w;
1753
- e[9] !== p ? (w = /* @__PURE__ */ n("div", { className: "mt-6 text-center", children: /* @__PURE__ */ n("h1", { className: "text-5xl font-light text-white tracking-tight", children: p }) }), e[9] = p, e[10] = w) : w = e[10];
1754
- let N;
1755
- e[11] !== y ? (N = /* @__PURE__ */ n("p", { className: "text-zinc-400 text-sm", children: y }), e[11] = y, e[12] = N) : N = e[12];
1756
- let _;
1757
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ C("div", { className: "flex items-center justify-center gap-1 mt-1 text-zinc-500 text-xs", children: [
1758
- /* @__PURE__ */ n("svg", { className: "w-3.5 h-3.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n("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" }) }),
1759
- /* @__PURE__ */ n("span", { children: "19°C" })
1760
- ] }), e[13] = _) : _ = e[13];
1761
- let $;
1762
- e[14] !== N ? ($ = /* @__PURE__ */ C("div", { className: "mt-2 text-center", children: [
1763
- N,
1764
- _
1765
- ] }), e[14] = N, e[15] = $) : $ = e[15];
1766
- let L;
1767
- e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ n("div", { className: "h-24" }), e[16] = L) : L = e[16];
1768
- let A;
1769
- e[17] !== r.logo || e[18] !== r.name ? (A = /* @__PURE__ */ n("div", { className: "w-12 h-12 rounded-xl bg-zinc-900 flex items-center justify-center flex-shrink-0 overflow-hidden", children: r.logo ? /* @__PURE__ */ n("img", { src: r.logo, alt: r.name, className: "w-full h-full object-cover" }) : /* @__PURE__ */ n("div", { className: "text-white", children: /* @__PURE__ */ C("svg", { className: "w-7 h-7", viewBox: "0 0 24 24", fill: "currentColor", children: [
1770
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "1.5" }),
1771
- /* @__PURE__ */ n("circle", { cx: "12", cy: "6", r: "1" }),
1772
- /* @__PURE__ */ n("circle", { cx: "12", cy: "18", r: "1" }),
1773
- /* @__PURE__ */ n("circle", { cx: "6", cy: "12", r: "1" }),
1774
- /* @__PURE__ */ n("circle", { cx: "18", cy: "12", r: "1" }),
1775
- /* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "0.8" }),
1776
- /* @__PURE__ */ n("circle", { cx: "16", cy: "8", r: "0.8" }),
1777
- /* @__PURE__ */ n("circle", { cx: "8", cy: "16", r: "0.8" }),
1778
- /* @__PURE__ */ n("circle", { cx: "16", cy: "16", r: "0.8" }),
1779
- /* @__PURE__ */ n("circle", { cx: "6", cy: "6", r: "0.5" }),
1780
- /* @__PURE__ */ n("circle", { cx: "18", cy: "6", r: "0.5" }),
1781
- /* @__PURE__ */ n("circle", { cx: "6", cy: "18", r: "0.5" }),
1782
- /* @__PURE__ */ n("circle", { cx: "18", cy: "18", r: "0.5" })
1783
- ] }) }) }), e[17] = r.logo, e[18] = r.name, e[19] = A) : A = e[19];
1784
- let z;
1785
- e[20] !== r.name ? (z = /* @__PURE__ */ n("p", { className: "text-sm font-semibold text-gray-900 truncate", children: r.name }), e[20] = r.name, e[21] = z) : z = e[21];
1786
- let S;
1787
- e[22] !== i ? (S = /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 truncate", children: i }), e[22] = i, e[23] = S) : S = e[23];
1788
- let M;
1789
- e[24] !== z || e[25] !== S ? (M = /* @__PURE__ */ C("div", { className: "flex-1 text-left min-w-0", children: [
1790
- z,
1791
- S
1792
- ] }), e[24] = z, e[25] = S, e[26] = M) : M = e[26];
1793
- let I;
1794
- e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 flex-shrink-0", children: "now" }), e[27] = I) : I = e[27];
1795
- let R;
1796
- e[28] !== s || e[29] !== A || e[30] !== M ? (R = /* @__PURE__ */ n("div", { className: "px-4 pb-8", children: /* @__PURE__ */ C("button", { onClick: s, className: `w-full bg-white rounded-2xl p-3 flex items-center gap-3 shadow-lg
1797
- transition-transform active:scale-[0.98] hover:shadow-xl`, children: [
1798
- A,
1799
- M,
1800
- I
1801
- ] }) }), e[28] = s, e[29] = A, e[30] = M, e[31] = R) : R = e[31];
1802
- let B;
1803
- e[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ n("div", { className: "flex-1" }), e[32] = B) : B = e[32];
1804
- let T;
1805
- e[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n("div", { className: "flex justify-center pb-2", children: /* @__PURE__ */ n("div", { className: "w-32 h-1 rounded-full bg-zinc-600" }) }), e[33] = T) : T = e[33];
1806
- let O;
1807
- return e[34] !== w || e[35] !== $ || e[36] !== R || e[37] !== v ? (O = /* @__PURE__ */ C("div", { className: v, children: [
1808
- x,
1809
- k,
1810
- w,
1811
- $,
1812
- L,
1813
- R,
1814
- B,
1815
- T
1816
- ] }), e[34] = w, e[35] = $, e[36] = R, e[37] = v, e[38] = O) : O = e[38], O;
1817
- }), $e = {
2069
+ ${u ? "bg-zinc-900" : "bg-zinc-800"}
2070
+ `,
2071
+ children: [
2072
+ /* @__PURE__ */ e("div", { className: "h-6" }),
2073
+ /* @__PURE__ */ e("div", { className: "flex justify-center mt-4", children: /* @__PURE__ */ e("div", { className: "w-8 h-8 rounded-full bg-zinc-700 flex items-center justify-center", children: /* @__PURE__ */ e(
2074
+ "svg",
2075
+ {
2076
+ className: "w-4 h-4 text-zinc-400",
2077
+ fill: "currentColor",
2078
+ viewBox: "0 0 20 20",
2079
+ children: /* @__PURE__ */ e(
2080
+ "path",
2081
+ {
2082
+ fillRule: "evenodd",
2083
+ d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
2084
+ clipRule: "evenodd"
2085
+ }
2086
+ )
2087
+ }
2088
+ ) }) }),
2089
+ /* @__PURE__ */ e("div", { className: "mt-6 text-center", children: /* @__PURE__ */ e("h1", { className: "text-5xl font-light text-white tracking-tight", children: c }) }),
2090
+ /* @__PURE__ */ l("div", { className: "mt-2 text-center", children: [
2091
+ /* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: d }),
2092
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-center gap-1 mt-1 text-zinc-500 text-xs", children: [
2093
+ /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", fill: "currentColor", viewBox: "0 0 20 20", 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" }) }),
2094
+ /* @__PURE__ */ e("span", { children: "19°C" })
2095
+ ] })
2096
+ ] }),
2097
+ /* @__PURE__ */ e("div", { className: "h-24" }),
2098
+ /* @__PURE__ */ e("div", { className: "px-4 pb-8", children: /* @__PURE__ */ l(
2099
+ "button",
2100
+ {
2101
+ onClick: t,
2102
+ className: `w-full bg-white rounded-2xl p-3 flex items-center gap-3 shadow-lg
2103
+ transition-transform active:scale-[0.98] hover:shadow-xl`,
2104
+ children: [
2105
+ /* @__PURE__ */ e("div", { className: "w-12 h-12 rounded-xl bg-zinc-900 flex items-center justify-center flex-shrink-0 overflow-hidden", children: s.logo ? /* @__PURE__ */ e(
2106
+ "img",
2107
+ {
2108
+ src: s.logo,
2109
+ alt: s.name,
2110
+ className: "w-full h-full object-cover"
2111
+ }
2112
+ ) : /* @__PURE__ */ e("div", { className: "text-white", children: /* @__PURE__ */ l(
2113
+ "svg",
2114
+ {
2115
+ className: "w-7 h-7",
2116
+ viewBox: "0 0 24 24",
2117
+ fill: "currentColor",
2118
+ children: [
2119
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "1.5" }),
2120
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "6", r: "1" }),
2121
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "18", r: "1" }),
2122
+ /* @__PURE__ */ e("circle", { cx: "6", cy: "12", r: "1" }),
2123
+ /* @__PURE__ */ e("circle", { cx: "18", cy: "12", r: "1" }),
2124
+ /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "0.8" }),
2125
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "8", r: "0.8" }),
2126
+ /* @__PURE__ */ e("circle", { cx: "8", cy: "16", r: "0.8" }),
2127
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "0.8" }),
2128
+ /* @__PURE__ */ e("circle", { cx: "6", cy: "6", r: "0.5" }),
2129
+ /* @__PURE__ */ e("circle", { cx: "18", cy: "6", r: "0.5" }),
2130
+ /* @__PURE__ */ e("circle", { cx: "6", cy: "18", r: "0.5" }),
2131
+ /* @__PURE__ */ e("circle", { cx: "18", cy: "18", r: "0.5" })
2132
+ ]
2133
+ }
2134
+ ) }) }),
2135
+ /* @__PURE__ */ l("div", { className: "flex-1 text-left min-w-0", children: [
2136
+ /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-gray-900 truncate", children: s.name }),
2137
+ /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 truncate", children: n })
2138
+ ] }),
2139
+ /* @__PURE__ */ e("span", { className: "text-xs text-gray-400 flex-shrink-0", children: "now" })
2140
+ ]
2141
+ }
2142
+ ) }),
2143
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
2144
+ /* @__PURE__ */ e("div", { className: "flex justify-center pb-2", children: /* @__PURE__ */ e("div", { className: "w-32 h-1 rounded-full bg-zinc-600" }) })
2145
+ ]
2146
+ }
2147
+ );
2148
+ }), Y = {
1818
2149
  name: "Business",
1819
2150
  verified: !1
1820
- }, Mt = F(function(t) {
1821
- const e = D.c(24), {
1822
- flow: s,
1823
- onUserReply: l,
1824
- theme: i,
1825
- device: g,
1826
- businessInfo: r,
1827
- showSuggestions: o
1828
- } = t;
1829
- let a;
1830
- e[0] !== s || e[1] !== l ? (a = {
1831
- flow: s,
1832
- onUserReply: l,
1833
- typingDelay: 800
1834
- }, e[0] = s, e[1] = l, e[2] = a) : a = e[2];
2151
+ }, Pe = g(function({
2152
+ flow: t,
2153
+ onUserReply: n,
2154
+ theme: o,
2155
+ device: s,
2156
+ businessInfo: a,
2157
+ showSuggestions: i
2158
+ }) {
1835
2159
  const {
1836
- state: f,
1837
- handleReply: h,
2160
+ state: u,
2161
+ handleReply: c,
1838
2162
  handleAction: d
1839
- } = Ze(a), [u, m] = ne(!1);
1840
- let p;
1841
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => {
1842
- m(zt);
1843
- }, e[3] = p) : p = e[3];
1844
- const b = p, [y, v] = ne(null);
1845
- let x;
1846
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = (M) => {
1847
- v({
1848
- ...M,
2163
+ } = fe({
2164
+ flow: t,
2165
+ onUserReply: n,
2166
+ typingDelay: 800
2167
+ }), [m, f] = z(!1), v = M(() => {
2168
+ f((h) => !h);
2169
+ }, []), [x, L] = z(null), b = M((h) => {
2170
+ L({
2171
+ ...h,
1849
2172
  isOpen: !0
1850
2173
  });
1851
- }, e[4] = x) : x = e[4];
1852
- const k = x;
1853
- let w;
1854
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = () => {
1855
- v(null);
1856
- }, e[5] = w) : w = e[5];
1857
- const N = w;
1858
- let _;
1859
- e[6] !== d || e[7] !== l ? (_ = (M) => {
1860
- if (!le(M))
1861
- return;
1862
- const I = He(M);
1863
- if (I) {
1864
- k({
1865
- url: I.url,
1866
- viewMode: I.webviewViewMode || "TALL",
1867
- title: I.description || "",
1868
- postbackData: M.action.postback.data
1869
- }), l({
1870
- type: "action",
1871
- postbackData: M.action.postback.data,
1872
- displayText: M.action.displayText,
1873
- timestamp: Date.now(),
1874
- actionData: {
1875
- type: "webview",
1876
- url: I.url,
1877
- viewMode: I.webviewViewMode || "TALL",
1878
- description: I.description
1879
- }
1880
- });
1881
- return;
2174
+ }, []), p = M(() => {
2175
+ L(null);
2176
+ }, []), y = M(
2177
+ (h) => {
2178
+ if (!$(h)) return;
2179
+ const w = oe(h);
2180
+ if (w) {
2181
+ b({
2182
+ url: w.url,
2183
+ viewMode: w.webviewViewMode || "TALL",
2184
+ title: w.description || "",
2185
+ postbackData: h.action.postback.data
2186
+ }), n({
2187
+ type: "action",
2188
+ postbackData: h.action.postback.data,
2189
+ displayText: h.action.displayText,
2190
+ timestamp: Date.now(),
2191
+ actionData: {
2192
+ type: "webview",
2193
+ url: w.url,
2194
+ viewMode: w.webviewViewMode || "TALL",
2195
+ description: w.description
2196
+ }
2197
+ });
2198
+ return;
2199
+ }
2200
+ d(h);
2201
+ },
2202
+ [d, b, n]
2203
+ );
2204
+ return /* @__PURE__ */ l(
2205
+ X,
2206
+ {
2207
+ theme: o,
2208
+ device: s,
2209
+ businessInfo: a,
2210
+ state: u,
2211
+ showSuggestions: i,
2212
+ isProfileOpen: m,
2213
+ toggleProfile: v,
2214
+ onReply: c,
2215
+ onAction: y,
2216
+ webView: x,
2217
+ openWebView: b,
2218
+ closeWebView: p,
2219
+ children: [
2220
+ /* @__PURE__ */ e(Ve, {}),
2221
+ m && /* @__PURE__ */ e(He, {}),
2222
+ /* @__PURE__ */ e(De, {})
2223
+ ]
1882
2224
  }
1883
- d(M);
1884
- }, e[6] = d, e[7] = l, e[8] = _) : _ = e[8];
1885
- const $ = _;
1886
- let L;
1887
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ n(kt, {}), e[9] = L) : L = e[9];
1888
- let A;
1889
- e[10] !== u ? (A = u && /* @__PURE__ */ n(Nt, {}), e[10] = u, e[11] = A) : A = e[11];
1890
- let z;
1891
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ n(Lt, {}), e[12] = z) : z = e[12];
1892
- let S;
1893
- return e[13] !== r || e[14] !== g || e[15] !== $ || e[16] !== h || e[17] !== u || e[18] !== o || e[19] !== f || e[20] !== A || e[21] !== i || e[22] !== y ? (S = /* @__PURE__ */ C(Ae, { theme: i, device: g, businessInfo: r, state: f, showSuggestions: o, isProfileOpen: u, toggleProfile: b, onReply: h, onAction: $, webView: y, openWebView: k, closeWebView: N, children: [
1894
- L,
1895
- A,
1896
- z
1897
- ] }), e[13] = r, e[14] = g, e[15] = $, e[16] = h, e[17] = u, e[18] = o, e[19] = f, e[20] = A, e[21] = i, e[22] = y, e[23] = S) : S = e[23], S;
1898
- }), Wt = F(function(t) {
1899
- const e = D.c(84), {
1900
- messages: s,
1901
- jsonUrl: l,
1902
- onUserReply: i,
1903
- theme: g,
1904
- device: r,
1905
- businessInfo: o,
1906
- className: a,
1907
- width: f,
1908
- height: h,
1909
- showSuggestions: d,
1910
- showLockScreen: u
1911
- } = t, m = g === void 0 ? "light" : g, p = r === void 0 ? "android" : r, b = a === void 0 ? "" : a, y = f === void 0 ? 375 : f, v = h === void 0 ? 667 : h, x = d === void 0 ? !0 : d, k = u === void 0 ? !1 : u, [w, N] = ne(k);
1912
- let _;
1913
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
1914
- N(!1);
1915
- }, e[0] = _) : _ = e[0];
1916
- const $ = _, {
1917
- data: L,
1918
- isLoading: A,
1919
- error: z
1920
- } = Ke(l), S = l ? L : s;
1921
- let M;
1922
- e[1] !== S ? (M = S ? Je(S) : !1, e[1] = S, e[2] = M) : M = e[2];
1923
- const I = M;
1924
- let R;
1925
- e[3] !== o || e[4] !== S?.name ? (R = () => ({
1926
- ...$e,
1927
- ...o,
1928
- name: o?.name || S?.name || $e.name
1929
- }), e[3] = o, e[4] = S?.name, e[5] = R) : R = e[5], S?.name;
1930
- let B;
1931
- e[6] !== R ? (B = R(), e[6] = R, e[7] = B) : B = e[7];
1932
- const T = B;
1933
- let O;
1934
- e[8] !== S || e[9] !== I ? (O = S && I ? Qe(S) : "New message", e[8] = S, e[9] = I, e[10] = O) : O = e[10];
1935
- const q = O, V = m === "dark";
1936
- let Q;
1937
- e[11] !== b || e[12] !== p || e[13] !== v || e[14] !== V || e[15] !== m || e[16] !== y ? (Q = (j) => {
1938
- const {
1939
- children: G
1940
- } = j;
1941
- return /* @__PURE__ */ n("div", { className: `
2225
+ );
2226
+ }), Ye = g(function({
2227
+ messages: t,
2228
+ jsonUrl: n,
2229
+ onUserReply: o,
2230
+ theme: s = "light",
2231
+ device: a = "android",
2232
+ businessInfo: i,
2233
+ className: u = "",
2234
+ width: c = 375,
2235
+ height: d = 667,
2236
+ showSuggestions: m = !0,
2237
+ showLockScreen: f = !1
2238
+ }) {
2239
+ const [v, x] = z(f), L = M(() => {
2240
+ x(!1);
2241
+ }, []), {
2242
+ data: b,
2243
+ isLoading: p,
2244
+ error: y
2245
+ } = ge(n), h = n ? b : t, w = V(
2246
+ () => h ? ue(h) : !1,
2247
+ [h]
2248
+ ), C = V(
2249
+ () => ({
2250
+ ...Y,
2251
+ ...i,
2252
+ // Extract name from flow if not provided
2253
+ name: i?.name || h?.name || Y.name
2254
+ }),
2255
+ [i, h?.name]
2256
+ ), I = V(
2257
+ () => h && w ? he(h) : "New message",
2258
+ [h, w]
2259
+ ), k = s === "dark", A = ({ children: T }) => /* @__PURE__ */ e(
2260
+ "div",
2261
+ {
2262
+ className: `
1942
2263
  rcs-emulator relative overflow-hidden
1943
2264
  rounded-2xl shadow-2xl
1944
- ${V ? "bg-zinc-950" : "bg-white"}
1945
- ${b}
1946
- `, style: {
1947
- width: y,
1948
- height: v
1949
- }, role: "application", "aria-label": "RCS Message Emulator", "data-theme": m, "data-device": p, children: G });
1950
- }, e[11] = b, e[12] = p, e[13] = v, e[14] = V, e[15] = m, e[16] = y, e[17] = Q) : Q = e[17];
1951
- const P = Q;
1952
- if (l && A) {
1953
- const j = `
2265
+ ${k ? "bg-zinc-950" : "bg-white"}
2266
+ ${u}
2267
+ `,
2268
+ style: { width: c, height: d },
2269
+ role: "application",
2270
+ "aria-label": "RCS Message Emulator",
2271
+ "data-theme": s,
2272
+ "data-device": a,
2273
+ children: T
2274
+ }
2275
+ );
2276
+ return n && p ? /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6", children: [
2277
+ /* @__PURE__ */ e(
2278
+ "div",
2279
+ {
2280
+ className: `
1954
2281
  w-10 h-10 border-3 border-t-transparent rounded-full animate-spin mb-4
1955
- ${V ? "border-zinc-600" : "border-gray-300"}
1956
- `;
1957
- let G;
1958
- e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = {
1959
- borderTopColor: "transparent"
1960
- }, e[18] = G) : G = e[18];
1961
- let E;
1962
- e[19] !== j ? (E = /* @__PURE__ */ n("div", { className: j, style: G }), e[19] = j, e[20] = E) : E = e[20];
1963
- const J = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
1964
- let W;
1965
- e[21] !== J ? (W = /* @__PURE__ */ n("p", { className: J, children: "Loading conversation..." }), e[21] = J, e[22] = W) : W = e[22];
1966
- let U;
1967
- e[23] !== E || e[24] !== W ? (U = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6", children: [
1968
- E,
1969
- W
1970
- ] }), e[23] = E, e[24] = W, e[25] = U) : U = e[25];
1971
- let H;
1972
- return e[26] !== P || e[27] !== U ? (H = /* @__PURE__ */ n(P, { children: U }), e[26] = P, e[27] = U, e[28] = H) : H = e[28], H;
1973
- }
1974
- if (l && z) {
1975
- let j;
1976
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n("svg", { className: "w-12 h-12 mx-auto mb-4 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), e[29] = j) : j = e[29];
1977
- const G = `text-lg font-medium mb-2 ${V ? "text-white" : "text-gray-900"}`;
1978
- let E;
1979
- e[30] !== G ? (E = /* @__PURE__ */ n("h3", { className: G, children: "Failed to Load" }), e[30] = G, e[31] = E) : E = e[31];
1980
- const J = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
1981
- let W;
1982
- e[32] !== z || e[33] !== J ? (W = /* @__PURE__ */ n("p", { className: J, children: z }), e[32] = z, e[33] = J, e[34] = W) : W = e[34];
1983
- const U = `text-xs mt-2 break-all max-w-full ${V ? "text-zinc-500" : "text-gray-400"}`;
1984
- let H;
1985
- e[35] !== l || e[36] !== U ? (H = /* @__PURE__ */ n("p", { className: U, children: l }), e[35] = l, e[36] = U, e[37] = H) : H = e[37];
1986
- let X;
1987
- e[38] !== E || e[39] !== W || e[40] !== H ? (X = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
1988
- j,
1989
- E,
1990
- W,
1991
- H
1992
- ] }), e[38] = E, e[39] = W, e[40] = H, e[41] = X) : X = e[41];
1993
- let Z;
1994
- return e[42] !== P || e[43] !== X ? (Z = /* @__PURE__ */ n(P, { children: X }), e[42] = P, e[43] = X, e[44] = Z) : Z = e[44], Z;
1995
- }
1996
- if (!S) {
1997
- const j = `w-12 h-12 mx-auto mb-4 ${V ? "text-zinc-600" : "text-gray-300"}`;
1998
- let G;
1999
- e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }), e[45] = G) : G = e[45];
2000
- let E;
2001
- e[46] !== j ? (E = /* @__PURE__ */ n("svg", { className: j, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: G }), e[46] = j, e[47] = E) : E = e[47];
2002
- const J = `text-lg font-medium mb-2 ${V ? "text-white" : "text-gray-900"}`;
2003
- let W;
2004
- e[48] !== J ? (W = /* @__PURE__ */ n("h3", { className: J, children: "No Conversation Data" }), e[48] = J, e[49] = W) : W = e[49];
2005
- const U = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
2006
- let H;
2007
- e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "messages" }), e[50] = H) : H = e[50];
2008
- let X;
2009
- e[51] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ n("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "jsonUrl" }), e[51] = X) : X = e[51];
2010
- let Z;
2011
- e[52] !== U ? (Z = /* @__PURE__ */ C("p", { className: U, children: [
2012
- "Provide either",
2013
- " ",
2014
- H,
2015
- " ",
2016
- "or",
2017
- " ",
2018
- X,
2019
- " ",
2020
- "prop"
2021
- ] }), e[52] = U, e[53] = Z) : Z = e[53];
2022
- let te;
2023
- e[54] !== E || e[55] !== W || e[56] !== Z ? (te = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2024
- E,
2025
- W,
2026
- Z
2027
- ] }), e[54] = E, e[55] = W, e[56] = Z, e[57] = te) : te = e[57];
2028
- let se;
2029
- return e[58] !== P || e[59] !== te ? (se = /* @__PURE__ */ n(P, { children: te }), e[58] = P, e[59] = te, e[60] = se) : se = e[60], se;
2030
- }
2031
- if (!I) {
2032
- let j;
2033
- e[61] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ n("svg", { className: "w-12 h-12 mx-auto mb-4 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }), e[61] = j) : j = e[61];
2034
- const G = `text-lg font-medium mb-2 ${V ? "text-white" : "text-gray-900"}`;
2035
- let E;
2036
- e[62] !== G ? (E = /* @__PURE__ */ n("h3", { className: G, children: "Invalid RBM JSON" }), e[62] = G, e[63] = E) : E = e[63];
2037
- const J = `text-sm ${V ? "text-zinc-400" : "text-gray-500"}`;
2038
- let W;
2039
- e[64] !== J ? (W = /* @__PURE__ */ n("p", { className: J, children: "The conversation flow structure is not valid" }), e[64] = J, e[65] = W) : W = e[65];
2040
- let U;
2041
- e[66] !== E || e[67] !== W ? (U = /* @__PURE__ */ C("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2042
- j,
2043
- E,
2044
- W
2045
- ] }), e[66] = E, e[67] = W, e[68] = U) : U = e[68];
2046
- let H;
2047
- return e[69] !== P || e[70] !== U ? (H = /* @__PURE__ */ n(P, { children: U }), e[69] = P, e[70] = U, e[71] = H) : H = e[71], H;
2048
- }
2049
- let Y;
2050
- e[72] !== p || e[73] !== S || e[74] !== w || e[75] !== T || e[76] !== q || e[77] !== i || e[78] !== x || e[79] !== m ? (Y = w ? /* @__PURE__ */ n(Ae, { theme: m, device: p, businessInfo: T, state: {
2051
- currentMessageId: null,
2052
- chatHistory: [],
2053
- isTyping: !1,
2054
- error: null
2055
- }, showSuggestions: !1, isProfileOpen: !1, toggleProfile: It, onReply: At, onAction: Rt, webView: null, openWebView: Tt, closeWebView: jt, children: /* @__PURE__ */ n($t, { onUnlock: $, messagePreview: q }) }) : /* @__PURE__ */ n(Mt, { flow: S, onUserReply: i, theme: m, device: p, businessInfo: T, showSuggestions: x }), e[72] = p, e[73] = S, e[74] = w, e[75] = T, e[76] = q, e[77] = i, e[78] = x, e[79] = m, e[80] = Y) : Y = e[80];
2056
- let ee;
2057
- return e[81] !== P || e[82] !== Y ? (ee = /* @__PURE__ */ n(P, { children: Y }), e[81] = P, e[82] = Y, e[83] = ee) : ee = e[83], ee;
2282
+ ${k ? "border-zinc-600" : "border-gray-300"}
2283
+ `,
2284
+ style: { borderTopColor: "transparent" }
2285
+ }
2286
+ ),
2287
+ /* @__PURE__ */ e(
2288
+ "p",
2289
+ {
2290
+ className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
2291
+ children: "Loading conversation..."
2292
+ }
2293
+ )
2294
+ ] }) }) : n && y ? /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2295
+ /* @__PURE__ */ e(
2296
+ "svg",
2297
+ {
2298
+ className: "w-12 h-12 mx-auto mb-4 text-red-500",
2299
+ fill: "none",
2300
+ viewBox: "0 0 24 24",
2301
+ stroke: "currentColor",
2302
+ children: /* @__PURE__ */ e(
2303
+ "path",
2304
+ {
2305
+ strokeLinecap: "round",
2306
+ strokeLinejoin: "round",
2307
+ strokeWidth: 2,
2308
+ d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
2309
+ }
2310
+ )
2311
+ }
2312
+ ),
2313
+ /* @__PURE__ */ e(
2314
+ "h3",
2315
+ {
2316
+ className: `text-lg font-medium mb-2 ${k ? "text-white" : "text-gray-900"}`,
2317
+ children: "Failed to Load"
2318
+ }
2319
+ ),
2320
+ /* @__PURE__ */ e(
2321
+ "p",
2322
+ {
2323
+ className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
2324
+ children: y
2325
+ }
2326
+ ),
2327
+ /* @__PURE__ */ e(
2328
+ "p",
2329
+ {
2330
+ className: `text-xs mt-2 break-all max-w-full ${k ? "text-zinc-500" : "text-gray-400"}`,
2331
+ children: n
2332
+ }
2333
+ )
2334
+ ] }) }) : h ? w ? /* @__PURE__ */ e(A, { children: v ? /* @__PURE__ */ e(
2335
+ X,
2336
+ {
2337
+ theme: s,
2338
+ device: a,
2339
+ businessInfo: C,
2340
+ state: {
2341
+ currentMessageId: null,
2342
+ chatHistory: [],
2343
+ isTyping: !1,
2344
+ error: null
2345
+ },
2346
+ showSuggestions: !1,
2347
+ isProfileOpen: !1,
2348
+ toggleProfile: () => {
2349
+ },
2350
+ onReply: () => {
2351
+ },
2352
+ onAction: () => {
2353
+ },
2354
+ webView: null,
2355
+ openWebView: () => {
2356
+ },
2357
+ closeWebView: () => {
2358
+ },
2359
+ children: /* @__PURE__ */ e(Oe, { onUnlock: L, messagePreview: I })
2360
+ }
2361
+ ) : /* @__PURE__ */ e(
2362
+ Pe,
2363
+ {
2364
+ flow: h,
2365
+ onUserReply: o,
2366
+ theme: s,
2367
+ device: a,
2368
+ businessInfo: C,
2369
+ showSuggestions: m
2370
+ }
2371
+ ) }) : /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2372
+ /* @__PURE__ */ e(
2373
+ "svg",
2374
+ {
2375
+ className: "w-12 h-12 mx-auto mb-4 text-amber-500",
2376
+ fill: "none",
2377
+ viewBox: "0 0 24 24",
2378
+ stroke: "currentColor",
2379
+ children: /* @__PURE__ */ e(
2380
+ "path",
2381
+ {
2382
+ strokeLinecap: "round",
2383
+ strokeLinejoin: "round",
2384
+ strokeWidth: 2,
2385
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
2386
+ }
2387
+ )
2388
+ }
2389
+ ),
2390
+ /* @__PURE__ */ e(
2391
+ "h3",
2392
+ {
2393
+ className: `text-lg font-medium mb-2 ${k ? "text-white" : "text-gray-900"}`,
2394
+ children: "Invalid RBM JSON"
2395
+ }
2396
+ ),
2397
+ /* @__PURE__ */ e(
2398
+ "p",
2399
+ {
2400
+ className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
2401
+ children: "The conversation flow structure is not valid"
2402
+ }
2403
+ )
2404
+ ] }) }) : /* @__PURE__ */ e(A, { children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full p-6 text-center", children: [
2405
+ /* @__PURE__ */ e(
2406
+ "svg",
2407
+ {
2408
+ className: `w-12 h-12 mx-auto mb-4 ${k ? "text-zinc-600" : "text-gray-300"}`,
2409
+ fill: "none",
2410
+ viewBox: "0 0 24 24",
2411
+ stroke: "currentColor",
2412
+ children: /* @__PURE__ */ e(
2413
+ "path",
2414
+ {
2415
+ strokeLinecap: "round",
2416
+ strokeLinejoin: "round",
2417
+ strokeWidth: 2,
2418
+ 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"
2419
+ }
2420
+ )
2421
+ }
2422
+ ),
2423
+ /* @__PURE__ */ e(
2424
+ "h3",
2425
+ {
2426
+ className: `text-lg font-medium mb-2 ${k ? "text-white" : "text-gray-900"}`,
2427
+ children: "No Conversation Data"
2428
+ }
2429
+ ),
2430
+ /* @__PURE__ */ l(
2431
+ "p",
2432
+ {
2433
+ className: `text-sm ${k ? "text-zinc-400" : "text-gray-500"}`,
2434
+ children: [
2435
+ "Provide either",
2436
+ " ",
2437
+ /* @__PURE__ */ e("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "messages" }),
2438
+ " ",
2439
+ "or",
2440
+ " ",
2441
+ /* @__PURE__ */ e("code", { className: "px-1 py-0.5 rounded bg-gray-100 dark:bg-zinc-800", children: "jsonUrl" }),
2442
+ " ",
2443
+ "prop"
2444
+ ]
2445
+ }
2446
+ )
2447
+ ] }) });
2058
2448
  });
2059
- function zt(c) {
2060
- return !c;
2061
- }
2062
- function It() {
2063
- }
2064
- function At() {
2065
- }
2066
- function Rt() {
2067
- }
2068
- function Tt() {
2069
- }
2070
- function jt() {
2071
- }
2072
2449
  export {
2073
- Wt as RcsEmulator,
2074
- Lt as WebViewRenderer,
2075
- Wt as default,
2076
- Qe as getFirstMessagePreview,
2077
- He as getWebViewConfig,
2078
- le as isSuggestedAction,
2079
- ze as isSuggestedReply,
2080
- Bt as isWebViewAction,
2081
- Ke as useJsonFetch,
2082
- Je as validateConversationFlow
2450
+ Ye as RcsEmulator,
2451
+ De as WebViewRenderer,
2452
+ Ye as default,
2453
+ he as getFirstMessagePreview,
2454
+ oe as getWebViewConfig,
2455
+ $ as isSuggestedAction,
2456
+ q as isSuggestedReply,
2457
+ Je as isWebViewAction,
2458
+ ge as useJsonFetch,
2459
+ ue as validateConversationFlow
2083
2460
  };
2084
2461
  //# sourceMappingURL=rcs-emulator.es.js.map