@rqmii_immersive/agent-react-sdk 5.1.1 → 5.1.3

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.
Files changed (37) hide show
  1. package/dist/{RqmiiCloudAvatarPlayer-CXKmEFce.js → RqmiiCloudAvatarPlayer-BL7GVcr_.js} +2238 -2230
  2. package/dist/RqmiiCloudAvatarPlayer-BL7GVcr_.js.map +1 -0
  3. package/dist/{RqmiiCloudAvatarPlayer-C2bz7pkW.cjs → RqmiiCloudAvatarPlayer-Dc1h266_.cjs} +310 -310
  4. package/dist/RqmiiCloudAvatarPlayer-Dc1h266_.cjs.map +1 -0
  5. package/dist/core/managers/session.d.ts +2 -3
  6. package/dist/core/managers/session.d.ts.map +1 -1
  7. package/dist/core/utils/suppress-logs.d.ts.map +1 -1
  8. package/dist/embed.js +350 -350
  9. package/dist/embed.js.map +1 -1
  10. package/dist/hooks/use-rqmii-connection.d.ts +1 -1
  11. package/dist/hooks/use-rqmii-connection.d.ts.map +1 -1
  12. package/dist/hooks/use-rqmii-sdk.d.ts +0 -1
  13. package/dist/hooks/use-rqmii-sdk.d.ts.map +1 -1
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/provider/use-manager-lifecycle.d.ts +2 -3
  19. package/dist/provider/use-manager-lifecycle.d.ts.map +1 -1
  20. package/dist/types/index.d.ts +4 -8
  21. package/dist/types/index.d.ts.map +1 -1
  22. package/dist/ui/RqmiiAgentChat.d.ts +1 -1
  23. package/dist/ui/RqmiiAgentChat.d.ts.map +1 -1
  24. package/dist/ui/agent-data.d.ts +2 -8
  25. package/dist/ui/agent-data.d.ts.map +1 -1
  26. package/dist/ui.cjs +22 -22
  27. package/dist/ui.cjs.map +1 -1
  28. package/dist/ui.d.ts +1 -1
  29. package/dist/ui.d.ts.map +1 -1
  30. package/dist/ui.js +911 -939
  31. package/dist/ui.js.map +1 -1
  32. package/package.json +1 -1
  33. package/README.frameworks.md +0 -244
  34. package/README.md +0 -168
  35. package/README.simple.md +0 -114
  36. package/dist/RqmiiCloudAvatarPlayer-C2bz7pkW.cjs.map +0 -1
  37. package/dist/RqmiiCloudAvatarPlayer-CXKmEFce.js.map +0 -1
package/dist/ui.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as oe, u as ka, g as Ke, j as ue, h as me, i as aa, l as ta, k as na, R as fa, c as va } from "./RqmiiCloudAvatarPlayer-CXKmEFce.js";
2
- import { E as oi, d as ri } from "./RqmiiCloudAvatarPlayer-CXKmEFce.js";
3
- import { jsx as n, jsxs as f, Fragment as Le } from "react/jsx-runtime";
4
- import D, { useContext as ya, createContext as Fa, forwardRef as ia, createElement as Me, useState as y, useEffect as I, useRef as _, useLayoutEffect as Oe, useCallback as re, useMemo as te } from "react";
5
- const Ta = {
1
+ import { A as oe, u as ba, g as Ke, j as de, h as ue, i as aa, l as ta, k as na, R as ka, c as fa } from "./RqmiiCloudAvatarPlayer-BL7GVcr_.js";
2
+ import { E as ni, d as ii } from "./RqmiiCloudAvatarPlayer-BL7GVcr_.js";
3
+ import { jsx as n, jsxs as f, Fragment as Ae } from "react/jsx-runtime";
4
+ import I, { useContext as va, createContext as ya, forwardRef as ia, createElement as Pe, useState as v, useEffect as j, useRef as _, useLayoutEffect as Oe, useCallback as re, useMemo as ee } from "react";
5
+ const Fa = {
6
6
  sendMessage: "Stuur 'n boodskap",
7
7
  send: "Stuur",
8
8
  close: "Sluit",
@@ -45,7 +45,7 @@ const Ta = {
45
45
  leadFormEmail: "E-pos",
46
46
  leadFormPhone: "Foon",
47
47
  leadFormMessage: "Jou boodskap"
48
- }, Ea = {
48
+ }, Ta = {
49
49
  sendMessage: "Dërgo një mesazh",
50
50
  send: "Dërgo",
51
51
  close: "Mbyll",
@@ -131,7 +131,7 @@ const Ta = {
131
131
  leadFormEmail: "البريد الإلكتروني",
132
132
  leadFormPhone: "رقم الهاتف",
133
133
  leadFormMessage: "رسالتك"
134
- }, Sa = {
134
+ }, Ea = {
135
135
  sendMessage: "Mesaj göndər",
136
136
  send: "Göndər",
137
137
  close: "Bağla",
@@ -174,7 +174,7 @@ const Ta = {
174
174
  leadFormEmail: "E-poçt",
175
175
  leadFormPhone: "Telefon",
176
176
  leadFormMessage: "Mesajınız"
177
- }, xa = {
177
+ }, Sa = {
178
178
  sendMessage: "Bidali mezua",
179
179
  send: "Bidali",
180
180
  close: "Itxi",
@@ -217,7 +217,7 @@ const Ta = {
217
217
  leadFormEmail: "Helbide elektronikoa",
218
218
  leadFormPhone: "Telefonoa",
219
219
  leadFormMessage: "Zure mezua"
220
- }, Pa = {
220
+ }, xa = {
221
221
  sendMessage: "Адправіць паведамленне",
222
222
  send: "Адправіць",
223
223
  close: "Зачыніць",
@@ -260,7 +260,7 @@ const Ta = {
260
260
  leadFormEmail: "Электронная пошта",
261
261
  leadFormPhone: "Тэлефон",
262
262
  leadFormMessage: "Ваша паведамленне"
263
- }, Ma = {
263
+ }, Pa = {
264
264
  sendMessage: "একটি বার্তা পাঠান",
265
265
  send: "পাঠান",
266
266
  close: "বন্ধ করুন",
@@ -303,7 +303,7 @@ const Ta = {
303
303
  leadFormEmail: "ইমেইল",
304
304
  leadFormPhone: "ফোন",
305
305
  leadFormMessage: "আপনার বার্তা"
306
- }, Ca = {
306
+ }, Ma = {
307
307
  sendMessage: "Pošalji poruku",
308
308
  send: "Pošalji",
309
309
  close: "Zatvori",
@@ -346,7 +346,7 @@ const Ta = {
346
346
  leadFormEmail: "E-mail",
347
347
  leadFormPhone: "Telefon",
348
348
  leadFormMessage: "Vaša poruka"
349
- }, wa = {
349
+ }, Ca = {
350
350
  sendMessage: "Изпрати съобщение",
351
351
  send: "Изпрати",
352
352
  close: "Затвори",
@@ -389,7 +389,7 @@ const Ta = {
389
389
  leadFormEmail: "Имейл",
390
390
  leadFormPhone: "Телефон",
391
391
  leadFormMessage: "Вашето съобщение"
392
- }, Aa = {
392
+ }, wa = {
393
393
  sendMessage: "Enviar un missatge",
394
394
  send: "Enviar",
395
395
  close: "Tancar",
@@ -432,7 +432,7 @@ const Ta = {
432
432
  leadFormEmail: "Correu electrònic",
433
433
  leadFormPhone: "Telèfon",
434
434
  leadFormMessage: "El teu missatge"
435
- }, La = {
435
+ }, Aa = {
436
436
  sendMessage: "发送消息",
437
437
  send: "发送",
438
438
  close: "关闭",
@@ -475,7 +475,7 @@ const Ta = {
475
475
  leadFormEmail: "电子邮箱",
476
476
  leadFormPhone: "电话",
477
477
  leadFormMessage: "您的留言"
478
- }, ja = {
478
+ }, La = {
479
479
  sendMessage: "Pošalji poruku",
480
480
  send: "Pošalji",
481
481
  close: "Zatvori",
@@ -561,7 +561,7 @@ const Ta = {
561
561
  leadFormEmail: "E-mail",
562
562
  leadFormPhone: "Telefon",
563
563
  leadFormMessage: "Vaše zpráva"
564
- }, Ia = {
564
+ }, ja = {
565
565
  sendMessage: "Send en besked",
566
566
  send: "Send",
567
567
  close: "Luk",
@@ -604,7 +604,7 @@ const Ta = {
604
604
  leadFormEmail: "E-mail",
605
605
  leadFormPhone: "Telefon",
606
606
  leadFormMessage: "Din besked"
607
- }, Da = {
607
+ }, Ia = {
608
608
  sendMessage: "Stuur een bericht",
609
609
  send: "Verzenden",
610
610
  close: "Sluiten",
@@ -647,7 +647,7 @@ const Ta = {
647
647
  leadFormEmail: "E-mail",
648
648
  leadFormPhone: "Telefoon",
649
649
  leadFormMessage: "Uw bericht"
650
- }, qa = {
650
+ }, Da = {
651
651
  sendMessage: "Send a message",
652
652
  send: "Send",
653
653
  close: "Close",
@@ -690,7 +690,7 @@ const Ta = {
690
690
  leadFormEmail: "Email",
691
691
  leadFormPhone: "Phone",
692
692
  leadFormMessage: "Your message"
693
- }, Na = {
693
+ }, qa = {
694
694
  sendMessage: "Saada sõnum",
695
695
  send: "Saada",
696
696
  close: "Sulge",
@@ -733,7 +733,7 @@ const Ta = {
733
733
  leadFormEmail: "E-post",
734
734
  leadFormPhone: "Telefon",
735
735
  leadFormMessage: "Teie sõnum"
736
- }, _a = {
736
+ }, Na = {
737
737
  sendMessage: "Lähetä viesti",
738
738
  send: "Lähetä",
739
739
  close: "Sulje",
@@ -776,7 +776,7 @@ const Ta = {
776
776
  leadFormEmail: "Sähköposti",
777
777
  leadFormPhone: "Puhelin",
778
778
  leadFormMessage: "Viestisi"
779
- }, Ra = {
779
+ }, _a = {
780
780
  sendMessage: "Envoyer un message",
781
781
  send: "Envoyer",
782
782
  close: "Fermer",
@@ -819,7 +819,7 @@ const Ta = {
819
819
  leadFormEmail: "E-mail",
820
820
  leadFormPhone: "Téléphone",
821
821
  leadFormMessage: "Votre message"
822
- }, Ba = {
822
+ }, Ra = {
823
823
  sendMessage: "Enviar unha mensaxe",
824
824
  send: "Enviar",
825
825
  close: "Pechar",
@@ -862,7 +862,7 @@ const Ta = {
862
862
  leadFormEmail: "Correo electrónico",
863
863
  leadFormPhone: "Teléfono",
864
864
  leadFormMessage: "A túa mensaxe"
865
- }, Ga = {
865
+ }, Ba = {
866
866
  sendMessage: "Nachricht senden",
867
867
  send: "Senden",
868
868
  close: "Schließen",
@@ -905,7 +905,7 @@ const Ta = {
905
905
  leadFormEmail: "E-Mail",
906
906
  leadFormPhone: "Telefon",
907
907
  leadFormMessage: "Ihre Nachricht"
908
- }, Ua = {
908
+ }, Ga = {
909
909
  sendMessage: "Αποστολή μηνύματος",
910
910
  send: "Αποστολή",
911
911
  close: "Κλείσιμο",
@@ -948,7 +948,7 @@ const Ta = {
948
948
  leadFormEmail: "E-mail",
949
949
  leadFormPhone: "Τηλέφωνο",
950
950
  leadFormMessage: "Το μήνυμά σας"
951
- }, Ka = {
951
+ }, Ua = {
952
952
  sendMessage: "સંદેશ મોકલો",
953
953
  send: "મોકલો",
954
954
  close: "બંધ કરો",
@@ -991,7 +991,7 @@ const Ta = {
991
991
  leadFormEmail: "ઇમેઇલ",
992
992
  leadFormPhone: "ફોન",
993
993
  leadFormMessage: "તમારો સંદેશ"
994
- }, Oa = {
994
+ }, Ka = {
995
995
  sendMessage: "संदेश भेजें",
996
996
  send: "भेजें",
997
997
  close: "बंद करें",
@@ -1034,7 +1034,7 @@ const Ta = {
1034
1034
  leadFormEmail: "ईमेल",
1035
1035
  leadFormPhone: "फ़ोन",
1036
1036
  leadFormMessage: "आपका संदेश"
1037
- }, Ya = {
1037
+ }, Oa = {
1038
1038
  sendMessage: "Üzenet küldése",
1039
1039
  send: "Küldés",
1040
1040
  close: "Bezárás",
@@ -1077,7 +1077,7 @@ const Ta = {
1077
1077
  leadFormEmail: "E-mail",
1078
1078
  leadFormPhone: "Telefon",
1079
1079
  leadFormMessage: "Üzenete"
1080
- }, Qa = {
1080
+ }, Ya = {
1081
1081
  sendMessage: "Kirim pesan",
1082
1082
  send: "Kirim",
1083
1083
  close: "Tutup",
@@ -1120,7 +1120,7 @@ const Ta = {
1120
1120
  leadFormEmail: "Email",
1121
1121
  leadFormPhone: "Telepon",
1122
1122
  leadFormMessage: "Pesan Anda"
1123
- }, Ha = {
1123
+ }, Qa = {
1124
1124
  sendMessage: "Invia un messaggio",
1125
1125
  send: "Invia",
1126
1126
  close: "Chiudi",
@@ -1163,7 +1163,7 @@ const Ta = {
1163
1163
  leadFormEmail: "E-mail",
1164
1164
  leadFormPhone: "Telefono",
1165
1165
  leadFormMessage: "Il tuo messaggio"
1166
- }, Wa = {
1166
+ }, Ha = {
1167
1167
  sendMessage: "メッセージを送信",
1168
1168
  send: "送信",
1169
1169
  close: "閉じる",
@@ -1206,7 +1206,7 @@ const Ta = {
1206
1206
  leadFormEmail: "メールアドレス",
1207
1207
  leadFormPhone: "電話番号",
1208
1208
  leadFormMessage: "メッセージ"
1209
- }, $a = {
1209
+ }, Wa = {
1210
1210
  sendMessage: "ಸಂದೇಶ ಕಳುಹಿಸಿ",
1211
1211
  send: "ಕಳುಹಿಸಿ",
1212
1212
  close: "ಮುಚ್ಚಿ",
@@ -1292,7 +1292,7 @@ const Ta = {
1292
1292
  leadFormEmail: "Электрондық пошта",
1293
1293
  leadFormPhone: "Телефон",
1294
1294
  leadFormMessage: "Сіздің хабарламаңыз"
1295
- }, Ja = {
1295
+ }, $a = {
1296
1296
  sendMessage: "메시지 보내기",
1297
1297
  send: "보내기",
1298
1298
  close: "닫기",
@@ -1335,7 +1335,7 @@ const Ta = {
1335
1335
  leadFormEmail: "이메일",
1336
1336
  leadFormPhone: "전화번호",
1337
1337
  leadFormMessage: "메시지"
1338
- }, Xa = {
1338
+ }, Ja = {
1339
1339
  sendMessage: "Sūtīt ziņojumu",
1340
1340
  send: "Sūtīt",
1341
1341
  close: "Aizvērt",
@@ -1378,7 +1378,7 @@ const Ta = {
1378
1378
  leadFormEmail: "E-pasts",
1379
1379
  leadFormPhone: "Tālrunis",
1380
1380
  leadFormMessage: "Jūsu ziņojums"
1381
- }, et = {
1381
+ }, Xa = {
1382
1382
  sendMessage: "Siųsti žinutę",
1383
1383
  send: "Siųsti",
1384
1384
  close: "Uždaryti",
@@ -1421,7 +1421,7 @@ const Ta = {
1421
1421
  leadFormEmail: "El. paštas",
1422
1422
  leadFormPhone: "Telefonas",
1423
1423
  leadFormMessage: "Jūsų žinutė"
1424
- }, at = {
1424
+ }, et = {
1425
1425
  sendMessage: "Испрати порака",
1426
1426
  send: "Испрати",
1427
1427
  close: "Затвори",
@@ -1464,7 +1464,7 @@ const Ta = {
1464
1464
  leadFormEmail: "Е-пошта",
1465
1465
  leadFormPhone: "Телефон",
1466
1466
  leadFormMessage: "Вашата порака"
1467
- }, tt = {
1467
+ }, at = {
1468
1468
  sendMessage: "Hantar mesej",
1469
1469
  send: "Hantar",
1470
1470
  close: "Tutup",
@@ -1507,7 +1507,7 @@ const Ta = {
1507
1507
  leadFormEmail: "E-mel",
1508
1508
  leadFormPhone: "Telefon",
1509
1509
  leadFormMessage: "Mesej anda"
1510
- }, nt = {
1510
+ }, tt = {
1511
1511
  sendMessage: "ഒരു സന്ദേശം അയയ്‌ക്കുക",
1512
1512
  send: "അയയ്‌ക്കുക",
1513
1513
  close: "അടയ്‌ക്കുക",
@@ -1550,7 +1550,7 @@ const Ta = {
1550
1550
  leadFormEmail: "ഇമെയിൽ",
1551
1551
  leadFormPhone: "ഫോൺ",
1552
1552
  leadFormMessage: "നിങ്ങളുടെ സന്ദേശം"
1553
- }, it = {
1553
+ }, nt = {
1554
1554
  sendMessage: "संदेश पाठवा",
1555
1555
  send: "पाठवा",
1556
1556
  close: "बंद करा",
@@ -1593,7 +1593,7 @@ const Ta = {
1593
1593
  leadFormEmail: "ईमेल",
1594
1594
  leadFormPhone: "फोन",
1595
1595
  leadFormMessage: "तुमचा संदेश"
1596
- }, ot = {
1596
+ }, it = {
1597
1597
  sendMessage: "Send en melding",
1598
1598
  send: "Send",
1599
1599
  close: "Lukk",
@@ -1636,7 +1636,7 @@ const Ta = {
1636
1636
  leadFormEmail: "E-post",
1637
1637
  leadFormPhone: "Telefon",
1638
1638
  leadFormMessage: "Din melding"
1639
- }, rt = {
1639
+ }, ot = {
1640
1640
  sendMessage: "پیامی بنویسید",
1641
1641
  send: "ارسال",
1642
1642
  close: "بستن",
@@ -1679,7 +1679,7 @@ const Ta = {
1679
1679
  leadFormEmail: "ایمیل",
1680
1680
  leadFormPhone: "تلفن",
1681
1681
  leadFormMessage: "پیام شما"
1682
- }, st = {
1682
+ }, rt = {
1683
1683
  sendMessage: "Wyślij wiadomość",
1684
1684
  send: "Wyślij",
1685
1685
  close: "Zamknij",
@@ -1722,7 +1722,7 @@ const Ta = {
1722
1722
  leadFormEmail: "E-mail",
1723
1723
  leadFormPhone: "Telefon",
1724
1724
  leadFormMessage: "Twoja wiadomość"
1725
- }, lt = {
1725
+ }, st = {
1726
1726
  sendMessage: "Enviar mensagem",
1727
1727
  send: "Enviar",
1728
1728
  close: "Fechar",
@@ -1765,7 +1765,7 @@ const Ta = {
1765
1765
  leadFormEmail: "E-mail",
1766
1766
  leadFormPhone: "Telefone",
1767
1767
  leadFormMessage: "Sua mensagem"
1768
- }, ct = {
1768
+ }, lt = {
1769
1769
  sendMessage: "ਇੱਕ ਸੁਨੇਹਾ ਭੇਜੋ",
1770
1770
  send: "ਭੇਜੋ",
1771
1771
  close: "ਬੰਦ ਕਰੋ",
@@ -1808,7 +1808,7 @@ const Ta = {
1808
1808
  leadFormEmail: "ਈਮੇਲ",
1809
1809
  leadFormPhone: "ਫ਼ੋਨ",
1810
1810
  leadFormMessage: "ਤੁਹਾਡਾ ਸੁਨੇਹਾ"
1811
- }, dt = {
1811
+ }, ct = {
1812
1812
  sendMessage: "Trimite un mesaj",
1813
1813
  send: "Trimite",
1814
1814
  close: "Închide",
@@ -1851,7 +1851,7 @@ const Ta = {
1851
1851
  leadFormEmail: "E-mail",
1852
1852
  leadFormPhone: "Telefon",
1853
1853
  leadFormMessage: "Mesajul dumneavoastră"
1854
- }, ut = {
1854
+ }, dt = {
1855
1855
  sendMessage: "Отправить сообщение",
1856
1856
  send: "Отправить",
1857
1857
  close: "Закрыть",
@@ -1894,7 +1894,7 @@ const Ta = {
1894
1894
  leadFormEmail: "Электронная почта",
1895
1895
  leadFormPhone: "Телефон",
1896
1896
  leadFormMessage: "Ваше сообщение"
1897
- }, mt = {
1897
+ }, ut = {
1898
1898
  sendMessage: "Пошаљи поруку",
1899
1899
  send: "Пошаљи",
1900
1900
  close: "Затвори",
@@ -1937,7 +1937,7 @@ const Ta = {
1937
1937
  leadFormEmail: "Имејл",
1938
1938
  leadFormPhone: "Телефон",
1939
1939
  leadFormMessage: "Ваша порука"
1940
- }, ht = {
1940
+ }, mt = {
1941
1941
  sendMessage: "Poslať správu",
1942
1942
  send: "Odoslať",
1943
1943
  close: "Zavrieť",
@@ -1980,7 +1980,7 @@ const Ta = {
1980
1980
  leadFormEmail: "E-mail",
1981
1981
  leadFormPhone: "Telefón",
1982
1982
  leadFormMessage: "Vaša správa"
1983
- }, gt = {
1983
+ }, ht = {
1984
1984
  sendMessage: "Pošlji sporočilo",
1985
1985
  send: "Pošlji",
1986
1986
  close: "Zapri",
@@ -2023,7 +2023,7 @@ const Ta = {
2023
2023
  leadFormEmail: "E-pošta",
2024
2024
  leadFormPhone: "Telefon",
2025
2025
  leadFormMessage: "Vaše sporočilo"
2026
- }, pt = {
2026
+ }, gt = {
2027
2027
  sendMessage: "Enviar un mensaje",
2028
2028
  send: "Enviar",
2029
2029
  close: "Cerrar",
@@ -2066,7 +2066,7 @@ const Ta = {
2066
2066
  leadFormEmail: "Correo electrónico",
2067
2067
  leadFormPhone: "Teléfono",
2068
2068
  leadFormMessage: "Tu mensaje"
2069
- }, bt = {
2069
+ }, pt = {
2070
2070
  sendMessage: "Tuma ujumbe",
2071
2071
  send: "Tuma",
2072
2072
  close: "Funga",
@@ -2109,7 +2109,7 @@ const Ta = {
2109
2109
  leadFormEmail: "Barua pepe",
2110
2110
  leadFormPhone: "Simu",
2111
2111
  leadFormMessage: "Ujumbe wako"
2112
- }, kt = {
2112
+ }, bt = {
2113
2113
  sendMessage: "Skicka ett meddelande",
2114
2114
  send: "Skicka",
2115
2115
  close: "Stäng",
@@ -2152,7 +2152,7 @@ const Ta = {
2152
2152
  leadFormEmail: "E-post",
2153
2153
  leadFormPhone: "Telefon",
2154
2154
  leadFormMessage: "Ditt meddelande"
2155
- }, ft = {
2155
+ }, kt = {
2156
2156
  sendMessage: "Magpadala ng mensahe",
2157
2157
  send: "Ipadala",
2158
2158
  close: "Isara",
@@ -2195,7 +2195,7 @@ const Ta = {
2195
2195
  leadFormEmail: "Email",
2196
2196
  leadFormPhone: "Telepono",
2197
2197
  leadFormMessage: "Ang iyong mensahe"
2198
- }, vt = {
2198
+ }, ft = {
2199
2199
  sendMessage: "ஒரு செய்தி அனுப்பவும்",
2200
2200
  send: "அனுப்பு",
2201
2201
  close: "மூடு",
@@ -2238,7 +2238,7 @@ const Ta = {
2238
2238
  leadFormEmail: "மின்னஞ்சல்",
2239
2239
  leadFormPhone: "தொலைபேசி",
2240
2240
  leadFormMessage: "உங்கள் செய்தி"
2241
- }, yt = {
2241
+ }, vt = {
2242
2242
  sendMessage: "సందేశం పంపండి",
2243
2243
  send: "పంపు",
2244
2244
  close: "మూసివేయండి",
@@ -2281,7 +2281,7 @@ const Ta = {
2281
2281
  leadFormEmail: "ఇమెయిల్",
2282
2282
  leadFormPhone: "ఫోన్",
2283
2283
  leadFormMessage: "మీ సందేశం"
2284
- }, Ft = {
2284
+ }, yt = {
2285
2285
  sendMessage: "ส่งข้อความ",
2286
2286
  send: "ส่ง",
2287
2287
  close: "ปิด",
@@ -2324,7 +2324,7 @@ const Ta = {
2324
2324
  leadFormEmail: "อีเมล",
2325
2325
  leadFormPhone: "โทรศัพท์",
2326
2326
  leadFormMessage: "ข้อความของคุณ"
2327
- }, Tt = {
2327
+ }, Ft = {
2328
2328
  sendMessage: "Mesaj gönder",
2329
2329
  send: "Gönder",
2330
2330
  close: "Kapat",
@@ -2367,7 +2367,7 @@ const Ta = {
2367
2367
  leadFormEmail: "E-posta",
2368
2368
  leadFormPhone: "Telefon",
2369
2369
  leadFormMessage: "Mesajınız"
2370
- }, Et = {
2370
+ }, Tt = {
2371
2371
  sendMessage: "Надіслати повідомлення",
2372
2372
  send: "Надіслати",
2373
2373
  close: "Закрити",
@@ -2453,7 +2453,7 @@ const Ta = {
2453
2453
  leadFormEmail: "ای میل",
2454
2454
  leadFormPhone: "فون",
2455
2455
  leadFormMessage: "آپ کا پیغام"
2456
- }, St = {
2456
+ }, Et = {
2457
2457
  sendMessage: "Gửi tin nhắn",
2458
2458
  send: "Gửi",
2459
2459
  close: "Đóng",
@@ -2496,7 +2496,7 @@ const Ta = {
2496
2496
  leadFormEmail: "Email",
2497
2497
  leadFormPhone: "Điện thoại",
2498
2498
  leadFormMessage: "Tin nhắn của bạn"
2499
- }, xt = {
2499
+ }, St = {
2500
2500
  sendMessage: "Anfon neges",
2501
2501
  send: "Anfon",
2502
2502
  close: "Cau",
@@ -2540,66 +2540,66 @@ const Ta = {
2540
2540
  leadFormPhone: "Ffôn",
2541
2541
  leadFormMessage: "Eich neges"
2542
2542
  }, Ye = {
2543
- af: Ta,
2544
- sq: Ea,
2543
+ af: Fa,
2544
+ sq: Ta,
2545
2545
  ar: za,
2546
- az: Sa,
2547
- eu: xa,
2548
- be: Pa,
2549
- bn: Ma,
2550
- bs: Ca,
2551
- bg: wa,
2552
- ca: Aa,
2553
- zh: La,
2554
- hr: ja,
2546
+ az: Ea,
2547
+ eu: Sa,
2548
+ be: xa,
2549
+ bn: Pa,
2550
+ bs: Ma,
2551
+ bg: Ca,
2552
+ ca: wa,
2553
+ zh: Aa,
2554
+ hr: La,
2555
2555
  cs: Va,
2556
- da: Ia,
2557
- nl: Da,
2558
- en: qa,
2559
- et: Na,
2560
- fi: _a,
2561
- fr: Ra,
2562
- gl: Ba,
2563
- de: Ga,
2564
- el: Ua,
2565
- gu: Ka,
2566
- hi: Oa,
2567
- hu: Ya,
2568
- id: Qa,
2569
- it: Ha,
2570
- ja: Wa,
2571
- kn: $a,
2556
+ da: ja,
2557
+ nl: Ia,
2558
+ en: Da,
2559
+ et: qa,
2560
+ fi: Na,
2561
+ fr: _a,
2562
+ gl: Ra,
2563
+ de: Ba,
2564
+ el: Ga,
2565
+ gu: Ua,
2566
+ hi: Ka,
2567
+ hu: Oa,
2568
+ id: Ya,
2569
+ it: Qa,
2570
+ ja: Ha,
2571
+ kn: Wa,
2572
2572
  kk: Za,
2573
- ko: Ja,
2574
- lv: Xa,
2575
- lt: et,
2576
- mk: at,
2577
- ms: tt,
2578
- ml: nt,
2579
- mr: it,
2580
- no: ot,
2581
- fa: rt,
2582
- pl: st,
2583
- pt: lt,
2584
- pa: ct,
2585
- ro: dt,
2586
- ru: ut,
2587
- sr: mt,
2588
- sk: ht,
2589
- sl: gt,
2590
- es: pt,
2591
- sw: bt,
2592
- sv: kt,
2593
- tl: ft,
2594
- ta: vt,
2595
- te: yt,
2596
- th: Ft,
2597
- tr: Tt,
2598
- uk: Et,
2573
+ ko: $a,
2574
+ lv: Ja,
2575
+ lt: Xa,
2576
+ mk: et,
2577
+ ms: at,
2578
+ ml: tt,
2579
+ mr: nt,
2580
+ no: it,
2581
+ fa: ot,
2582
+ pl: rt,
2583
+ pt: st,
2584
+ pa: lt,
2585
+ ro: ct,
2586
+ ru: dt,
2587
+ sr: ut,
2588
+ sk: mt,
2589
+ sl: ht,
2590
+ es: gt,
2591
+ sw: pt,
2592
+ sv: bt,
2593
+ tl: kt,
2594
+ ta: ft,
2595
+ te: vt,
2596
+ th: yt,
2597
+ tr: Ft,
2598
+ uk: Tt,
2599
2599
  ur: zt,
2600
- vi: St,
2601
- cy: xt
2602
- }, Ce = [
2600
+ vi: Et,
2601
+ cy: St
2602
+ }, Me = [
2603
2603
  { value: "af", label: "Afrikaans", dir: "ltr" },
2604
2604
  { value: "sq", label: "Shqip", dir: "ltr" },
2605
2605
  { value: "ar", label: "العربية", dir: "rtl" },
@@ -2659,22 +2659,21 @@ const Ta = {
2659
2659
  { value: "ur", label: "اردو", dir: "rtl" },
2660
2660
  { value: "vi", label: "Tiếng Việt", dir: "ltr" },
2661
2661
  { value: "cy", label: "Cymraeg", dir: "ltr" }
2662
- ], Qe = Ce.map(
2662
+ ], Qe = Me.map(
2663
2663
  (e) => e.value
2664
2664
  );
2665
2665
  function He(e) {
2666
- return Ce.find((a) => a.value === e) || Ce.find((a) => a.value === "en");
2666
+ return Me.find((a) => a.value === e) || Me.find((a) => a.value === "en");
2667
2667
  }
2668
- function T(e, a) {
2668
+ function F(e, a) {
2669
2669
  return Ye[e]?.[a] || Ye.en[a] || a;
2670
2670
  }
2671
2671
  function be(e, a = "en") {
2672
- const t = Array.isArray(e) ? e.filter((o) => Qe.includes(o)) : [];
2672
+ const t = Array.isArray(e) ? e.filter((i) => Qe.includes(i)) : [];
2673
2673
  return !t.includes(a) && Qe.includes(a) && t.unshift(a), t.length ? [...new Set(t)] : ["ar"];
2674
2674
  }
2675
2675
  const We = {
2676
2676
  id: null,
2677
- publicChatId: null,
2678
2677
  name: "Agent",
2679
2678
  agentType: oe.TEXT,
2680
2679
  useText: !0,
@@ -2692,13 +2691,13 @@ const We = {
2692
2691
  behavior: { post_chat_rating_enabled: !1, welcome_bubble_enabled: !1, welcome_bubble_delay_seconds: 3, welcome_bubble_sound_enabled: !1, typing_indicator_enabled: !0 }
2693
2692
  }
2694
2693
  };
2695
- function de(e) {
2694
+ function pe(e) {
2696
2695
  if (!e) return We;
2697
- const a = e, t = a.agent_type || a.agentType || oe.TEXT, o = typeof a.use_text == "boolean" ? a.use_text : typeof a.useText == "boolean" ? a.useText : t !== oe.VOICE, r = typeof a.use_voice == "boolean" ? a.use_voice : typeof a.useVoice == "boolean" ? a.useVoice : t === oe.TEXT_AND_VOICE || t === oe.CLOUD_AVATAR || t === oe.DESKTOP_AVATAR, i = a.conversation || a.agent_customization?.conversation || {}, s = a.speech || a.agent_customization?.speech || {}, d = i.default_language || "en", c = be(i.languages, d), l = a.widget || a.agent_customization?.widget || null, m = l?.appearance, u = l?.behavior, h = l, F = typeof m?.hide_branding == "boolean" ? !m.hide_branding : typeof m?.show_branding == "boolean" ? m.show_branding : !0, k = h ? {
2696
+ const a = e, t = a.agent_type || a.agentType || oe.TEXT, i = typeof a.use_text == "boolean" ? a.use_text : typeof a.useText == "boolean" ? a.useText : t !== oe.VOICE, r = typeof a.use_voice == "boolean" ? a.use_voice : typeof a.useVoice == "boolean" ? a.useVoice : t === oe.TEXT_AND_VOICE || t === oe.CLOUD_AVATAR || t === oe.DESKTOP_AVATAR, o = a.conversation || a.agent_customization?.conversation || {}, s = a.speech || a.agent_customization?.speech || {}, c = o.default_language || "en", d = be(o.languages, c), l = a.widget || a.agent_customization?.widget || null, m = l?.appearance, u = l?.behavior, h = l, z = typeof m?.hide_branding == "boolean" ? !m.hide_branding : typeof m?.show_branding == "boolean" ? m.show_branding : !0, k = h ? {
2698
2697
  appearance: {
2699
2698
  brand_color: m?.brand_color,
2700
2699
  position: m?.position || "right",
2701
- show_branding: F,
2700
+ show_branding: z,
2702
2701
  footer_content: m?.footer_content || {}
2703
2702
  },
2704
2703
  behavior: {
@@ -2708,45 +2707,44 @@ function de(e) {
2708
2707
  welcome_bubble_sound_enabled: typeof u?.welcome_bubble_sound_enabled == "boolean" ? u.welcome_bubble_sound_enabled : !1,
2709
2708
  typing_indicator_enabled: typeof u?.typing_indicator_enabled == "boolean" ? u.typing_indicator_enabled : !0
2710
2709
  }
2711
- } : void 0, v = a.consent || a.consent_config || null, z = i.welcome_message || i.welcomeMessage || a.welcome_message || a.welcomeMessage || {}, E = Object.fromEntries(
2712
- Object.entries(z).filter(([, p]) => typeof p == "string").map(([p, x]) => [p, x.slice(0, 1e3)])
2710
+ } : void 0, y = a.consent || a.consent_config || null, E = o.welcome_message || o.welcomeMessage || a.welcome_message || a.welcomeMessage || {}, T = Object.fromEntries(
2711
+ Object.entries(E).filter(([, p]) => typeof p == "string").map(([p, S]) => [p, S.slice(0, 1e3)])
2713
2712
  ), g = typeof a.allow_interrupt == "boolean" ? a.allow_interrupt : typeof s.allow_interrupt == "boolean" ? s.allow_interrupt : !0, b = typeof a.allow_welcome_message_interrupt == "boolean" ? a.allow_welcome_message_interrupt : typeof s.allow_welcome_message_interrupt == "boolean" ? s.allow_welcome_message_interrupt : !1;
2714
2713
  return {
2715
2714
  id: a.id || null,
2716
- publicChatId: a.public_chat_id || a.publicChatId || null,
2717
2715
  name: a.name || We.name,
2718
2716
  agentType: t,
2719
- useText: o,
2717
+ useText: i,
2720
2718
  useVoice: r,
2721
2719
  faceIndex: typeof a.face_index == "number" ? a.face_index : typeof a.faceIndex == "number" ? a.faceIndex : 1,
2722
2720
  faceImageUrl: a.face_image_url || a.faceImageUrl || null,
2723
2721
  allowInterrupt: g,
2724
2722
  allowWelcomeMessageInterrupt: b,
2725
- welcomeMessages: E,
2726
- languages: c,
2727
- defaultLanguage: c.includes(d) ? d : c[0],
2723
+ welcomeMessages: T,
2724
+ languages: d,
2725
+ defaultLanguage: d.includes(c) ? c : d[0],
2728
2726
  conversation: {
2729
- default_language: d,
2730
- languages: c,
2731
- suggested_messages: i.suggested_messages || i.suggestedMessages || {}
2727
+ default_language: c,
2728
+ languages: d,
2729
+ suggested_messages: o.suggested_messages || o.suggestedMessages || {}
2732
2730
  },
2733
2731
  widget: k || void 0,
2734
- consent: v ? {
2735
- enabled: v.enabled ?? !1,
2736
- title: v.title || void 0,
2737
- body: v.body || void 0,
2738
- acceptLabel: v.accept_label || v.acceptLabel || void 0,
2739
- declineLabel: v.decline_label || v.declineLabel || void 0,
2740
- termsUrl: v.terms_url || v.termsUrl || void 0,
2741
- privacyUrl: v.privacy_url || v.privacyUrl || void 0
2732
+ consent: y ? {
2733
+ enabled: y.enabled ?? !1,
2734
+ title: y.title || void 0,
2735
+ body: y.body || void 0,
2736
+ acceptLabel: y.accept_label || y.acceptLabel || void 0,
2737
+ declineLabel: y.decline_label || y.declineLabel || void 0,
2738
+ termsUrl: y.terms_url || y.termsUrl || void 0,
2739
+ privacyUrl: y.privacy_url || y.privacyUrl || void 0
2742
2740
  } : void 0
2743
2741
  };
2744
2742
  }
2745
- async function Pt({
2743
+ async function xt({
2746
2744
  restUrl: e,
2747
2745
  identifier: a,
2748
2746
  withCredentials: t = !1,
2749
- signal: o
2747
+ signal: i
2750
2748
  }) {
2751
2749
  if (!e) throw new Error("Missing restUrl");
2752
2750
  if (!a) throw new Error("Missing agent identifier");
@@ -2755,85 +2753,62 @@ async function Pt({
2755
2753
  mode: "cors",
2756
2754
  credentials: t ? "include" : "omit",
2757
2755
  headers: { Accept: "application/json" },
2758
- signal: o
2756
+ signal: i
2759
2757
  });
2760
2758
  if (!r.ok) {
2761
2759
  let s = `HTTP ${r.status}`;
2762
2760
  try {
2763
- const c = await r.json();
2764
- s = c?.detail || c?.message || s;
2761
+ const d = await r.json();
2762
+ s = d?.detail || d?.message || s;
2765
2763
  } catch {
2766
2764
  }
2767
2765
  throw new Error(s);
2768
2766
  }
2769
- const i = await r.json();
2770
- return de({
2771
- id: i.id,
2772
- name: i.name,
2773
- company_name: i.company_name,
2774
- agent_type: i.agent_type,
2775
- use_voice: i.use_voice,
2776
- use_text: i.use_text,
2777
- face_index: i.face_index,
2778
- face_image_url: i.face_image_url,
2779
- conversation: i.conversation,
2780
- widget: i.widget,
2781
- allow_interrupt: i.allow_interrupt,
2782
- allow_welcome_message_interrupt: i.allow_welcome_message_interrupt,
2783
- welcome_message: i.welcome_message
2767
+ const o = await r.json();
2768
+ return pe({
2769
+ id: o.id,
2770
+ name: o.name,
2771
+ company_name: o.company_name,
2772
+ agent_type: o.agent_type,
2773
+ use_voice: o.use_voice,
2774
+ use_text: o.use_text,
2775
+ face_index: o.face_index,
2776
+ face_image_url: o.face_image_url,
2777
+ conversation: o.conversation,
2778
+ widget: o.widget,
2779
+ allow_interrupt: o.allow_interrupt,
2780
+ allow_welcome_message_interrupt: o.allow_welcome_message_interrupt,
2781
+ welcome_message: o.welcome_message
2784
2782
  });
2785
2783
  }
2786
- async function Jn({ restUrl: e, publicChatId: a, signal: t }) {
2784
+ async function $n({ restUrl: e, apiKey: a, agentId: t, signal: i }) {
2787
2785
  if (!e) throw new Error("Missing restUrl");
2788
- if (!a) throw new Error("Missing publicChatId");
2789
- const o = await fetch(`${e}/agent/${a}`, {
2786
+ const r = a || t;
2787
+ if (!r) throw new Error("Provide one of apiKey or agentId");
2788
+ const o = await fetch(`${e}/agent/${r}`, {
2790
2789
  method: "GET",
2791
2790
  mode: "cors",
2792
2791
  credentials: "omit",
2793
2792
  headers: {
2794
2793
  Accept: "application/json"
2795
2794
  },
2796
- signal: t
2795
+ signal: i
2797
2796
  });
2798
2797
  if (!o.ok) {
2799
- let r = `HTTP ${o.status}`;
2798
+ let s = `HTTP ${o.status}`;
2800
2799
  try {
2801
- const s = await o.json();
2802
- r = s?.detail || s?.message || r;
2800
+ const d = await o.json();
2801
+ s = d?.detail || d?.message || s;
2803
2802
  } catch {
2804
2803
  }
2805
- throw new Error(r);
2806
- }
2807
- return de(await o.json());
2808
- }
2809
- async function Xn({ restUrl: e, apiKey: a, publicChatId: t, agentId: o, signal: r }) {
2810
- if (!e) throw new Error("Missing restUrl");
2811
- const i = a || t || o;
2812
- if (!i) throw new Error("Provide one of apiKey, publicChatId, or agentId");
2813
- const s = await fetch(`${e}/agent/${i}`, {
2814
- method: "GET",
2815
- mode: "cors",
2816
- credentials: "omit",
2817
- headers: {
2818
- Accept: "application/json"
2819
- },
2820
- signal: r
2821
- });
2822
- if (!s.ok) {
2823
- let d = `HTTP ${s.status}`;
2824
- try {
2825
- const l = await s.json();
2826
- d = l?.detail || l?.message || d;
2827
- } catch {
2828
- }
2829
- throw new Error(d);
2804
+ throw new Error(s);
2830
2805
  }
2831
- return de(await s.json());
2806
+ return pe(await o.json());
2832
2807
  }
2833
- function Mt(e, a) {
2808
+ function Pt(e, a) {
2834
2809
  if (!a) return e;
2835
- let { useVoice: t, useText: o } = e;
2836
- return typeof a.use_voice == "boolean" && (t = a.use_voice), typeof a.use_text == "boolean" && (o = a.use_text), t === e.useVoice && o === e.useText ? e : { ...e, useVoice: t, useText: o };
2810
+ let { useVoice: t, useText: i } = e;
2811
+ return typeof a.use_voice == "boolean" && (t = a.use_voice), typeof a.use_text == "boolean" && (i = a.use_text), t === e.useVoice && i === e.useText ? e : { ...e, useVoice: t, useText: i };
2837
2812
  }
2838
2813
  function ve(e) {
2839
2814
  return e.agentType === oe.CLOUD_AVATAR || e.agentType === oe.DESKTOP_AVATAR ? "avatar" : e.useText && e.useVoice ? "text_and_voice" : e.useVoice ? "voice" : "text";
@@ -2844,23 +2819,23 @@ function ve(e) {
2844
2819
  * This source code is licensed under the ISC license.
2845
2820
  * See the LICENSE file in the root directory of this source tree.
2846
2821
  */
2847
- const oa = (...e) => e.filter((a, t, o) => !!a && a.trim() !== "" && o.indexOf(a) === t).join(" ").trim();
2822
+ const oa = (...e) => e.filter((a, t, i) => !!a && a.trim() !== "" && i.indexOf(a) === t).join(" ").trim();
2848
2823
  /**
2849
2824
  * @license lucide-react v1.24.0 - ISC
2850
2825
  *
2851
2826
  * This source code is licensed under the ISC license.
2852
2827
  * See the LICENSE file in the root directory of this source tree.
2853
2828
  */
2854
- const Ct = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2829
+ const Mt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2855
2830
  /**
2856
2831
  * @license lucide-react v1.24.0 - ISC
2857
2832
  *
2858
2833
  * This source code is licensed under the ISC license.
2859
2834
  * See the LICENSE file in the root directory of this source tree.
2860
2835
  */
2861
- const wt = (e) => e.replace(
2836
+ const Ct = (e) => e.replace(
2862
2837
  /^([A-Z])|[\s-_]+(\w)/g,
2863
- (a, t, o) => o ? o.toUpperCase() : t.toLowerCase()
2838
+ (a, t, i) => i ? i.toUpperCase() : t.toLowerCase()
2864
2839
  );
2865
2840
  /**
2866
2841
  * @license lucide-react v1.24.0 - ISC
@@ -2868,8 +2843,8 @@ const wt = (e) => e.replace(
2868
2843
  * This source code is licensed under the ISC license.
2869
2844
  * See the LICENSE file in the root directory of this source tree.
2870
2845
  */
2871
- const $e = (e) => {
2872
- const a = wt(e);
2846
+ const Ze = (e) => {
2847
+ const a = Ct(e);
2873
2848
  return a.charAt(0).toUpperCase() + a.slice(1);
2874
2849
  };
2875
2850
  /**
@@ -2878,7 +2853,7 @@ const $e = (e) => {
2878
2853
  * This source code is licensed under the ISC license.
2879
2854
  * See the LICENSE file in the root directory of this source tree.
2880
2855
  */
2881
- var Pe = {
2856
+ var xe = {
2882
2857
  xmlns: "http://www.w3.org/2000/svg",
2883
2858
  width: 24,
2884
2859
  height: 24,
@@ -2895,36 +2870,36 @@ var Pe = {
2895
2870
  * This source code is licensed under the ISC license.
2896
2871
  * See the LICENSE file in the root directory of this source tree.
2897
2872
  */
2898
- const At = (e) => {
2873
+ const wt = (e) => {
2899
2874
  for (const a in e)
2900
2875
  if (a.startsWith("aria-") || a === "role" || a === "title")
2901
2876
  return !0;
2902
2877
  return !1;
2903
- }, Lt = Fa({}), jt = () => ya(Lt), Vt = ia(
2904
- ({ color: e, size: a, strokeWidth: t, absoluteStrokeWidth: o, className: r = "", children: i, iconNode: s, ...d }, c) => {
2878
+ }, At = ya({}), Lt = () => va(At), Vt = ia(
2879
+ ({ color: e, size: a, strokeWidth: t, absoluteStrokeWidth: i, className: r = "", children: o, iconNode: s, ...c }, d) => {
2905
2880
  const {
2906
2881
  size: l = 24,
2907
2882
  strokeWidth: m = 2,
2908
2883
  absoluteStrokeWidth: u = !1,
2909
2884
  color: h = "currentColor",
2910
- className: F = ""
2911
- } = jt() ?? {}, k = o ?? u ? Number(t ?? m) * 24 / Number(a ?? l) : t ?? m;
2912
- return Me(
2885
+ className: z = ""
2886
+ } = Lt() ?? {}, k = i ?? u ? Number(t ?? m) * 24 / Number(a ?? l) : t ?? m;
2887
+ return Pe(
2913
2888
  "svg",
2914
2889
  {
2915
- ref: c,
2916
- ...Pe,
2917
- width: a ?? l ?? Pe.width,
2918
- height: a ?? l ?? Pe.height,
2890
+ ref: d,
2891
+ ...xe,
2892
+ width: a ?? l ?? xe.width,
2893
+ height: a ?? l ?? xe.height,
2919
2894
  stroke: e ?? h,
2920
2895
  strokeWidth: k,
2921
- className: oa("lucide", F, r),
2922
- ...!i && !At(d) && { "aria-hidden": "true" },
2923
- ...d
2896
+ className: oa("lucide", z, r),
2897
+ ...!o && !wt(c) && { "aria-hidden": "true" },
2898
+ ...c
2924
2899
  },
2925
2900
  [
2926
- ...s.map(([v, z]) => Me(v, z)),
2927
- ...Array.isArray(i) ? i : [i]
2901
+ ...s.map(([y, E]) => Pe(y, E)),
2902
+ ...Array.isArray(o) ? o : [o]
2928
2903
  ]
2929
2904
  );
2930
2905
  }
@@ -2937,18 +2912,18 @@ const At = (e) => {
2937
2912
  */
2938
2913
  const Y = (e, a) => {
2939
2914
  const t = ia(
2940
- ({ className: o, ...r }, i) => Me(Vt, {
2941
- ref: i,
2915
+ ({ className: i, ...r }, o) => Pe(Vt, {
2916
+ ref: o,
2942
2917
  iconNode: a,
2943
2918
  className: oa(
2944
- `lucide-${Ct($e(e))}`,
2919
+ `lucide-${Mt(Ze(e))}`,
2945
2920
  `lucide-${e}`,
2946
- o
2921
+ i
2947
2922
  ),
2948
2923
  ...r
2949
2924
  })
2950
2925
  );
2951
- return t.displayName = $e(e), t;
2926
+ return t.displayName = Ze(e), t;
2952
2927
  };
2953
2928
  /**
2954
2929
  * @license lucide-react v1.24.0 - ISC
@@ -2956,94 +2931,94 @@ const Y = (e, a) => {
2956
2931
  * This source code is licensed under the ISC license.
2957
2932
  * See the LICENSE file in the root directory of this source tree.
2958
2933
  */
2959
- const It = [
2934
+ const jt = [
2960
2935
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
2961
2936
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
2962
- ], Dt = Y("arrow-up", It);
2937
+ ], It = Y("arrow-up", jt);
2963
2938
  /**
2964
2939
  * @license lucide-react v1.24.0 - ISC
2965
2940
  *
2966
2941
  * This source code is licensed under the ISC license.
2967
2942
  * See the LICENSE file in the root directory of this source tree.
2968
2943
  */
2969
- const qt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Nt = Y("chevron-left", qt);
2944
+ const Dt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], qt = Y("chevron-left", Dt);
2970
2945
  /**
2971
2946
  * @license lucide-react v1.24.0 - ISC
2972
2947
  *
2973
2948
  * This source code is licensed under the ISC license.
2974
2949
  * See the LICENSE file in the root directory of this source tree.
2975
2950
  */
2976
- const _t = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ra = Y("chevron-down", _t);
2951
+ const Nt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ra = Y("chevron-down", Nt);
2977
2952
  /**
2978
2953
  * @license lucide-react v1.24.0 - ISC
2979
2954
  *
2980
2955
  * This source code is licensed under the ISC license.
2981
2956
  * See the LICENSE file in the root directory of this source tree.
2982
2957
  */
2983
- const Rt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Bt = Y("chevron-up", Rt);
2958
+ const _t = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Rt = Y("chevron-up", _t);
2984
2959
  /**
2985
2960
  * @license lucide-react v1.24.0 - ISC
2986
2961
  *
2987
2962
  * This source code is licensed under the ISC license.
2988
2963
  * See the LICENSE file in the root directory of this source tree.
2989
2964
  */
2990
- const Gt = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ye = Y("loader-circle", Gt);
2965
+ const Bt = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ye = Y("loader-circle", Bt);
2991
2966
  /**
2992
2967
  * @license lucide-react v1.24.0 - ISC
2993
2968
  *
2994
2969
  * This source code is licensed under the ISC license.
2995
2970
  * See the LICENSE file in the root directory of this source tree.
2996
2971
  */
2997
- const Ut = [
2972
+ const Gt = [
2998
2973
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
2999
2974
  ["path", { d: "m21 3-7 7", key: "1l2asr" }],
3000
2975
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
3001
2976
  ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
3002
- ], Kt = Y("maximize-2", Ut);
2977
+ ], Ut = Y("maximize-2", Gt);
3003
2978
  /**
3004
2979
  * @license lucide-react v1.24.0 - ISC
3005
2980
  *
3006
2981
  * This source code is licensed under the ISC license.
3007
2982
  * See the LICENSE file in the root directory of this source tree.
3008
2983
  */
3009
- const Ot = [
2984
+ const Kt = [
3010
2985
  ["path", { d: "M12 19v3", key: "npa21l" }],
3011
2986
  ["path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33", key: "1gzdoj" }],
3012
2987
  ["path", { d: "M16.95 16.95A7 7 0 0 1 5 12v-2", key: "cqa7eg" }],
3013
2988
  ["path", { d: "M18.89 13.23A7 7 0 0 0 19 12v-2", key: "16hl24" }],
3014
2989
  ["path", { d: "m2 2 20 20", key: "1ooewy" }],
3015
2990
  ["path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12", key: "r2i35w" }]
3016
- ], je = Y("mic-off", Ot);
2991
+ ], Le = Y("mic-off", Kt);
3017
2992
  /**
3018
2993
  * @license lucide-react v1.24.0 - ISC
3019
2994
  *
3020
2995
  * This source code is licensed under the ISC license.
3021
2996
  * See the LICENSE file in the root directory of this source tree.
3022
2997
  */
3023
- const Yt = [
2998
+ const Ot = [
3024
2999
  ["path", { d: "M12 19v3", key: "npa21l" }],
3025
3000
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
3026
3001
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
3027
- ], Fe = Y("mic", Yt);
3002
+ ], Fe = Y("mic", Ot);
3028
3003
  /**
3029
3004
  * @license lucide-react v1.24.0 - ISC
3030
3005
  *
3031
3006
  * This source code is licensed under the ISC license.
3032
3007
  * See the LICENSE file in the root directory of this source tree.
3033
3008
  */
3034
- const Qt = [
3009
+ const Yt = [
3035
3010
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
3036
3011
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
3037
3012
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
3038
3013
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
3039
- ], Te = Y("minimize-2", Qt);
3014
+ ], Te = Y("minimize-2", Yt);
3040
3015
  /**
3041
3016
  * @license lucide-react v1.24.0 - ISC
3042
3017
  *
3043
3018
  * This source code is licensed under the ISC license.
3044
3019
  * See the LICENSE file in the root directory of this source tree.
3045
3020
  */
3046
- const Ht = [
3021
+ const Qt = [
3047
3022
  [
3048
3023
  "path",
3049
3024
  {
@@ -3059,14 +3034,14 @@ const Ht = [
3059
3034
  key: "10hv5p"
3060
3035
  }
3061
3036
  ]
3062
- ], Ve = Y("phone-off", Ht);
3037
+ ], Ve = Y("phone-off", Qt);
3063
3038
  /**
3064
3039
  * @license lucide-react v1.24.0 - ISC
3065
3040
  *
3066
3041
  * This source code is licensed under the ISC license.
3067
3042
  * See the LICENSE file in the root directory of this source tree.
3068
3043
  */
3069
- const Wt = [
3044
+ const Ht = [
3070
3045
  [
3071
3046
  "path",
3072
3047
  {
@@ -3074,24 +3049,24 @@ const Wt = [
3074
3049
  key: "9njp5v"
3075
3050
  }
3076
3051
  ]
3077
- ], Ie = Y("phone", Wt);
3052
+ ], je = Y("phone", Ht);
3078
3053
  /**
3079
3054
  * @license lucide-react v1.24.0 - ISC
3080
3055
  *
3081
3056
  * This source code is licensed under the ISC license.
3082
3057
  * See the LICENSE file in the root directory of this source tree.
3083
3058
  */
3084
- const $t = [
3059
+ const Wt = [
3085
3060
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
3086
3061
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
3087
- ], Zt = Y("rotate-ccw", $t);
3062
+ ], Zt = Y("rotate-ccw", Wt);
3088
3063
  /**
3089
3064
  * @license lucide-react v1.24.0 - ISC
3090
3065
  *
3091
3066
  * This source code is licensed under the ISC license.
3092
3067
  * See the LICENSE file in the root directory of this source tree.
3093
3068
  */
3094
- const Jt = [
3069
+ const $t = [
3095
3070
  [
3096
3071
  "path",
3097
3072
  {
@@ -3099,17 +3074,17 @@ const Jt = [
3099
3074
  key: "r04s7s"
3100
3075
  }
3101
3076
  ]
3102
- ], Xt = Y("star", Jt);
3077
+ ], Jt = Y("star", $t);
3103
3078
  /**
3104
3079
  * @license lucide-react v1.24.0 - ISC
3105
3080
  *
3106
3081
  * This source code is licensed under the ISC license.
3107
3082
  * See the LICENSE file in the root directory of this source tree.
3108
3083
  */
3109
- const en = [
3084
+ const Xt = [
3110
3085
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
3111
3086
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
3112
- ], De = Y("x", en), Ze = [
3087
+ ], Ie = Y("x", Xt), $e = [
3113
3088
  () => import("./charachter1-D0qJg166.js").then((e) => e.default),
3114
3089
  () => import("./charachter2-B5ArG_dI.js").then((e) => e.default),
3115
3090
  () => import("./charachter3-DX1Okqyw.js").then((e) => e.default),
@@ -3119,19 +3094,19 @@ const en = [
3119
3094
  () => import("./charachter7-DWEpJWjS.js").then((e) => e.default),
3120
3095
  () => import("./charachter8-C3UF8oSz.js").then((e) => e.default)
3121
3096
  ];
3122
- function an(e = 1) {
3097
+ function en(e = 1) {
3123
3098
  const a = Math.max(0, Number(e || 1) - 1);
3124
- return (Ze[a] || Ze[0])();
3099
+ return ($e[a] || $e[0])();
3125
3100
  }
3126
- const ie = () => {
3127
- }, tn = 767;
3128
- function nn() {
3129
- return typeof window < "u" && window.innerWidth <= tn;
3101
+ const ne = () => {
3102
+ }, an = 767;
3103
+ function tn() {
3104
+ return typeof window < "u" && window.innerWidth <= an;
3130
3105
  }
3131
- function j(...e) {
3106
+ function V(...e) {
3132
3107
  return e.filter(Boolean).join(" ");
3133
3108
  }
3134
- function H(e) {
3109
+ function W(e) {
3135
3110
  return ["ar", "fa", "ur", "he"].includes(e) ? "rqmii-chat-font-ar" : "rqmii-chat-font-latin";
3136
3111
  }
3137
3112
  function Je(e) {
@@ -3140,156 +3115,156 @@ function Je(e) {
3140
3115
  function se(e) {
3141
3116
  return ["ar", "fa", "ur", "he"].includes(e) ? "rtl" : "ltr";
3142
3117
  }
3143
- function qe(e) {
3118
+ function De(e) {
3144
3119
  const a = Math.floor(e / 60).toString().padStart(2, "0"), t = (e % 60).toString().padStart(2, "0");
3145
3120
  return `${a}:${t}`;
3146
3121
  }
3147
- function on(e = !0) {
3148
- const [a, t] = y(0);
3149
- return I(() => {
3122
+ function nn(e = !0) {
3123
+ const [a, t] = v(0);
3124
+ return j(() => {
3150
3125
  if (!e) return;
3151
- const o = setInterval(() => t((r) => r + 1), 1e3);
3152
- return () => clearInterval(o);
3126
+ const i = setInterval(() => t((r) => r + 1), 1e3);
3127
+ return () => clearInterval(i);
3153
3128
  }, [e]), a;
3154
3129
  }
3155
- function rn() {
3156
- const [e, a] = y(null);
3157
- return I(() => {
3130
+ function on() {
3131
+ const [e, a] = v(null);
3132
+ return j(() => {
3158
3133
  const t = window.visualViewport;
3159
3134
  if (!t) return;
3160
- const o = () => a(t.height);
3161
- return o(), t.addEventListener("resize", o), t.addEventListener("scroll", o), () => {
3162
- t.removeEventListener("resize", o), t.removeEventListener("scroll", o);
3135
+ const i = () => a(t.height);
3136
+ return i(), t.addEventListener("resize", i), t.addEventListener("scroll", i), () => {
3137
+ t.removeEventListener("resize", i), t.removeEventListener("scroll", i);
3163
3138
  };
3164
3139
  }, []), e;
3165
3140
  }
3166
- function sn(e, a) {
3141
+ function rn(e, a) {
3167
3142
  const t = _([]);
3168
3143
  t.current = e.match(/\S+\s*/g) || [e];
3169
- const [o, r] = y(
3144
+ const [i, r] = v(
3170
3145
  () => a ? Math.min(1, t.current.length) : t.current.length
3171
3146
  );
3172
- return I(() => {
3147
+ return j(() => {
3173
3148
  if (!a || !e) {
3174
3149
  r(t.current.length);
3175
3150
  return;
3176
3151
  }
3177
3152
  if (r((s) => Math.max(1, s)), t.current.length <= 1) return;
3178
- const i = setInterval(() => {
3179
- r((s) => s >= t.current.length ? (clearInterval(i), s) : s + 1);
3153
+ const o = setInterval(() => {
3154
+ r((s) => s >= t.current.length ? (clearInterval(o), s) : s + 1);
3180
3155
  }, 50);
3181
- return () => clearInterval(i);
3182
- }, [e, a]), t.current.slice(0, o).join("");
3156
+ return () => clearInterval(o);
3157
+ }, [e, a]), t.current.slice(0, i).join("");
3183
3158
  }
3184
- const ln = D.lazy(() => import("./Orb-BLYExpBk.js").then((e) => ({ default: e.RqmiiOrb })));
3185
- function cn(e) {
3186
- return e?.faceIndex === 0 && e.faceImageUrl ? e.faceImageUrl : e?.faceIndex === 9 ? null : an(e?.faceIndex || 1);
3159
+ const sn = I.lazy(() => import("./Orb-BLYExpBk.js").then((e) => ({ default: e.RqmiiOrb })));
3160
+ function ln(e) {
3161
+ return e?.faceIndex === 0 && e.faceImageUrl ? e.faceImageUrl : e?.faceIndex === 9 ? null : en(e?.faceIndex || 1);
3187
3162
  }
3188
- const Ne = D.memo(function({ language: a, languages: t, onChange: o }) {
3189
- const [r, i] = y(!1), s = _(null), d = He(a), c = be(t, a).map((l) => He(l)).filter(Boolean);
3190
- return I(() => {
3163
+ const qe = I.memo(function({ language: a, languages: t, onChange: i }) {
3164
+ const [r, o] = v(!1), s = _(null), c = He(a), d = be(t, a).map((l) => He(l)).filter(Boolean);
3165
+ return j(() => {
3191
3166
  if (!r) return;
3192
3167
  const l = (m) => {
3193
- s.current?.contains(m.target) || i(!1);
3168
+ s.current?.contains(m.target) || o(!1);
3194
3169
  };
3195
3170
  return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
3196
3171
  }, [r]), /* @__PURE__ */ f("div", { className: "rqmii-chat-language", ref: s, children: [
3197
- /* @__PURE__ */ f("button", { type: "button", className: j("rqmii-chat-pill", Je(a)), onClick: () => i((l) => !l), children: [
3198
- /* @__PURE__ */ n("span", { children: d?.label || a }),
3172
+ /* @__PURE__ */ f("button", { type: "button", className: V("rqmii-chat-pill", Je(a)), onClick: () => o((l) => !l), children: [
3173
+ /* @__PURE__ */ n("span", { children: c?.label || a }),
3199
3174
  /* @__PURE__ */ n(ra, { size: 16 })
3200
3175
  ] }),
3201
- r && c.length > 1 && /* @__PURE__ */ n("div", { className: "rqmii-chat-language-menu", children: c.map((l) => /* @__PURE__ */ n(
3176
+ r && d.length > 1 && /* @__PURE__ */ n("div", { className: "rqmii-chat-language-menu", children: d.map((l) => /* @__PURE__ */ n(
3202
3177
  "button",
3203
3178
  {
3204
3179
  type: "button",
3205
- className: j("rqmii-chat-language-item", Je(l.value), l.value === a && "is-selected"),
3180
+ className: V("rqmii-chat-language-item", Je(l.value), l.value === a && "is-selected"),
3206
3181
  onClick: () => {
3207
- o(l.value), i(!1);
3182
+ i(l.value), o(!1);
3208
3183
  },
3209
3184
  children: l.label
3210
3185
  },
3211
3186
  l.value
3212
3187
  )) })
3213
3188
  ] });
3214
- }), le = D.memo(function({ language: a = "en", brand: t = "rqmii", agent: o }) {
3215
- const r = o?.widget?.appearance, i = r?.show_branding !== !1, s = r?.footer_content?.[a], d = !!s?.trim();
3216
- return !i && !d ? /* @__PURE__ */ n("div", { style: { padding: 11 } }) : /* @__PURE__ */ f("div", { className: "rqmii-chat-footer", children: [
3217
- i && /* @__PURE__ */ f("p", { children: [
3189
+ }), le = I.memo(function({ language: a = "en", brand: t = "rqmii", agent: i }) {
3190
+ const r = i?.widget?.appearance, o = r?.show_branding !== !1, s = r?.footer_content?.[a], c = !!s?.trim();
3191
+ return !o && !c ? /* @__PURE__ */ n("div", { style: { padding: 11 } }) : /* @__PURE__ */ f("div", { className: "rqmii-chat-footer", children: [
3192
+ o && /* @__PURE__ */ f("p", { children: [
3218
3193
  "Powered by ",
3219
3194
  /* @__PURE__ */ n("strong", { children: t })
3220
3195
  ] }),
3221
- d && /* @__PURE__ */ n("p", { children: s })
3196
+ c && /* @__PURE__ */ n("p", { children: s })
3222
3197
  ] });
3223
- }), J = D.memo(function({ agent: a, size: t = "large", active: o = !1, className: r = "" }) {
3224
- const i = a?.faceIndex === 9, [s, d] = y(null), [c, l] = y(!s);
3225
- return I(() => {
3198
+ }), J = I.memo(function({ agent: a, size: t = "large", active: i = !1, className: r = "" }) {
3199
+ const o = a?.faceIndex === 9, [s, c] = v(null), [d, l] = v(!s);
3200
+ return j(() => {
3226
3201
  let m = !1;
3227
- const u = cn(a);
3228
- return typeof u == "string" ? (d(u), l(!1)) : u instanceof Promise ? u.then((h) => {
3229
- m || (d(h), l(!1));
3230
- }) : d(null), () => {
3202
+ const u = ln(a);
3203
+ return typeof u == "string" ? (c(u), l(!1)) : u instanceof Promise ? u.then((h) => {
3204
+ m || (c(h), l(!1));
3205
+ }) : c(null), () => {
3231
3206
  m = !0;
3232
3207
  };
3233
- }, [a?.faceIndex, a?.faceImageUrl]), /* @__PURE__ */ n("div", { className: j("rqmii-agent-avatar", `rqmii-agent-avatar--${t}`, o && "is-active", i && "is-orb", r), children: i ? /* @__PURE__ */ n(D.Suspense, { fallback: null, children: /* @__PURE__ */ n(ln, { className: "rqmii-agent-avatar-orb" }) }) : s ? /* @__PURE__ */ n(
3208
+ }, [a?.faceIndex, a?.faceImageUrl]), /* @__PURE__ */ n("div", { className: V("rqmii-agent-avatar", `rqmii-agent-avatar--${t}`, i && "is-active", o && "is-orb", r), children: o ? /* @__PURE__ */ n(I.Suspense, { fallback: null, children: /* @__PURE__ */ n(sn, { className: "rqmii-agent-avatar-orb" }) }) : s ? /* @__PURE__ */ n(
3234
3209
  "img",
3235
3210
  {
3236
3211
  src: s,
3237
3212
  alt: a?.name || "Agent",
3238
- style: { opacity: c ? 1 : 0, transition: "opacity 200ms ease" },
3213
+ style: { opacity: d ? 1 : 0, transition: "opacity 200ms ease" },
3239
3214
  onLoad: () => l(!0)
3240
3215
  }
3241
3216
  ) : null });
3242
- }), sa = D.memo(function({ agent: a, onClick: t, className: o = "", position: r = "fixed", active: i = !1 }) {
3243
- return /* @__PURE__ */ n("button", { type: "button", className: j("rqmii-chat-open-button", r === "fixed" && "is-fixed", o), onClick: t, "aria-label": "Open chat", children: /* @__PURE__ */ n(J, { agent: a, size: "button", active: i }) });
3217
+ }), sa = I.memo(function({ agent: a, onClick: t, className: i = "", position: r = "fixed", active: o = !1 }) {
3218
+ return /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-open-button", r === "fixed" && "is-fixed", i), onClick: t, "aria-label": "Open chat", children: /* @__PURE__ */ n(J, { agent: a, size: "button", active: o }) });
3244
3219
  });
3245
- function dn() {
3220
+ function cn() {
3246
3221
  try {
3247
3222
  const e = window.AudioContext || window.webkitAudioContext;
3248
3223
  if (!e) return;
3249
- const a = new e(), t = a.currentTime, o = a.createOscillator(), r = a.createGain();
3250
- o.type = "sine", o.frequency.setValueAtTime(880, t), o.frequency.setValueAtTime(1180, t + 0.12), r.gain.setValueAtTime(1e-4, t), r.gain.exponentialRampToValueAtTime(0.18, t + 0.02), r.gain.exponentialRampToValueAtTime(1e-4, t + 0.32), o.connect(r), r.connect(a.destination), o.start(t), o.stop(t + 0.34), o.onended = () => {
3224
+ const a = new e(), t = a.currentTime, i = a.createOscillator(), r = a.createGain();
3225
+ i.type = "sine", i.frequency.setValueAtTime(880, t), i.frequency.setValueAtTime(1180, t + 0.12), r.gain.setValueAtTime(1e-4, t), r.gain.exponentialRampToValueAtTime(0.18, t + 0.02), r.gain.exponentialRampToValueAtTime(1e-4, t + 0.32), i.connect(r), r.connect(a.destination), i.start(t), i.stop(t + 0.34), i.onended = () => {
3251
3226
  a.close();
3252
3227
  };
3253
3228
  } catch {
3254
3229
  }
3255
3230
  }
3256
- const un = D.memo(function({ message: a, delaySeconds: t, soundEnabled: o, language: r, buttonPosition: i = "right", onClick: s }) {
3257
- const [d, c] = y(!1), l = a.trim();
3258
- return I(() => {
3231
+ const dn = I.memo(function({ message: a, delaySeconds: t, soundEnabled: i, language: r, buttonPosition: o = "right", onClick: s }) {
3232
+ const [c, d] = v(!1), l = a.trim();
3233
+ return j(() => {
3259
3234
  if (!l) return;
3260
3235
  const u = setTimeout(() => {
3261
- c(!0), o && dn();
3236
+ d(!0), i && cn();
3262
3237
  }, Math.max(0, t) * 1e3);
3263
3238
  return () => clearTimeout(u);
3264
- }, [l, t, o]), !d || !l ? null : /* @__PURE__ */ n(
3239
+ }, [l, t, i]), !c || !l ? null : /* @__PURE__ */ n(
3265
3240
  "button",
3266
3241
  {
3267
3242
  type: "button",
3268
- className: j("rqmii-chat-welcome-bubble", i === "right" ? "is-right" : "is-left", H(r)),
3243
+ className: V("rqmii-chat-welcome-bubble", o === "right" ? "is-right" : "is-left", W(r)),
3269
3244
  dir: se(r),
3270
3245
  onClick: s,
3271
3246
  "aria-label": l,
3272
3247
  children: l
3273
3248
  }
3274
3249
  );
3275
- }), Ee = D.memo(function({ language: a, placeholder: t, onSend: o, disabled: r = !1, variant: i = "text" }) {
3276
- const [s, d] = y(""), c = _(null), l = 168, m = () => {
3250
+ }), ze = I.memo(function({ language: a, placeholder: t, onSend: i, disabled: r = !1, variant: o = "text" }) {
3251
+ const [s, c] = v(""), d = _(null), l = 168, m = () => {
3277
3252
  const u = s.trim();
3278
- !u || r || (o(u), d(""), c.current && (c.current.style.height = "auto"));
3253
+ !u || r || (i(u), c(""), d.current && (d.current.style.height = "auto"));
3279
3254
  };
3280
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-input", H(a), i === "voice" && "is-voice"), children: [
3255
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-input", W(a), o === "voice" && "is-voice"), children: [
3281
3256
  /* @__PURE__ */ n(
3282
3257
  "textarea",
3283
3258
  {
3284
- ref: c,
3259
+ ref: d,
3285
3260
  value: s,
3286
3261
  disabled: r,
3287
- rows: i === "compact" ? 2 : 3,
3262
+ rows: o === "compact" ? 2 : 3,
3288
3263
  dir: se(a),
3289
- placeholder: t || T(a, "sendMessage"),
3264
+ placeholder: t || F(a, "sendMessage"),
3290
3265
  onChange: (u) => {
3291
- d(u.target.value);
3292
- const h = c.current;
3266
+ c(u.target.value);
3267
+ const h = d.current;
3293
3268
  h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight, l)}px`);
3294
3269
  },
3295
3270
  onKeyDown: (u) => {
@@ -3297,96 +3272,96 @@ const un = D.memo(function({ message: a, delaySeconds: t, soundEnabled: o, langu
3297
3272
  }
3298
3273
  }
3299
3274
  ),
3300
- /* @__PURE__ */ n("button", { type: "button", onClick: m, disabled: !s.trim() || r, "aria-label": T(a, "send"), children: /* @__PURE__ */ n(Dt, { size: 20 }) })
3275
+ /* @__PURE__ */ n("button", { type: "button", onClick: m, disabled: !s.trim() || r, "aria-label": F(a, "send"), children: /* @__PURE__ */ n(It, { size: 20 }) })
3301
3276
  ] });
3302
- }), mn = D.memo(function({ text: a, streaming: t }) {
3303
- const o = sn(a, t);
3304
- return /* @__PURE__ */ n(Le, { children: o });
3305
- }), we = 133, hn = we + 44, gn = 767, pe = 36, pn = 8, Xe = pe + pn;
3306
- function bn() {
3307
- return typeof window > "u" ? we : window.innerWidth <= gn ? hn : we;
3277
+ }), un = I.memo(function({ text: a, streaming: t }) {
3278
+ const i = rn(a, t);
3279
+ return /* @__PURE__ */ n(Ae, { children: i });
3280
+ }), Ce = 133, mn = Ce + 44, hn = 767, ge = 36, gn = 8, Xe = ge + gn;
3281
+ function pn() {
3282
+ return typeof window > "u" ? Ce : window.innerWidth <= hn ? mn : Ce;
3308
3283
  }
3309
- function kn(e) {
3284
+ function bn(e) {
3310
3285
  return e === "rtl" ? "right" : "left";
3311
3286
  }
3312
- function fn(e, a, t, o) {
3287
+ function kn(e, a, t, i) {
3313
3288
  if (!e.length) return null;
3314
- const r = Math.max(...e.map((s) => s.offsetTop)), i = e.filter((s) => s.offsetTop >= r - 0.5);
3315
- return t === "right" ? i.find((s) => s.offsetLeft + s.offsetWidth > a - o) || null : i.find((s) => s.offsetLeft < o) || null;
3289
+ const r = Math.max(...e.map((s) => s.offsetTop)), o = e.filter((s) => s.offsetTop >= r - 0.5);
3290
+ return t === "right" ? o.find((s) => s.offsetLeft + s.offsetWidth > a - i) || null : o.find((s) => s.offsetLeft < i) || null;
3316
3291
  }
3317
- function ea(e, a, t, o) {
3292
+ function ea(e, a, t, i) {
3318
3293
  for (let r = 0; r < 2; r++) {
3319
- const i = fn(e, a, t, o);
3320
- if (!i) break;
3321
- t === "right" ? i.style.marginRight = `${o}px` : i.style.marginLeft = `${o}px`, i.style.maxWidth = `calc(100% - ${o}px)`;
3294
+ const o = kn(e, a, t, i);
3295
+ if (!o) break;
3296
+ t === "right" ? o.style.marginRight = `${i}px` : o.style.marginLeft = `${i}px`, o.style.maxWidth = `calc(100% - ${i}px)`;
3322
3297
  }
3323
3298
  }
3324
- const vn = D.memo(function({ suggestions: a, language: t, onClick: o }) {
3325
- const [r, i] = y(!1), [s, d] = y(!1), [c, l] = y(null), [m, u] = y(null), h = _(null), F = _([]), k = se(t || "en"), v = kn(k), z = (E) => {
3326
- E.forEach((g) => {
3299
+ const fn = I.memo(function({ suggestions: a, language: t, onClick: i }) {
3300
+ const [r, o] = v(!1), [s, c] = v(!1), [d, l] = v(null), [m, u] = v(null), h = _(null), z = _([]), k = se(t || "en"), y = bn(k), E = (T) => {
3301
+ T.forEach((g) => {
3327
3302
  g && (g.style.maxWidth = "", g.style.marginRight = "", g.style.marginLeft = "");
3328
3303
  });
3329
3304
  };
3330
3305
  return Oe(() => {
3331
- const E = h.current;
3332
- if (!E || r) return;
3306
+ const T = h.current;
3307
+ if (!T || r) return;
3333
3308
  const g = () => {
3334
- const p = F.current;
3335
- z(p);
3336
- const x = E.clientWidth, S = bn(), M = () => {
3309
+ const p = z.current;
3310
+ E(p);
3311
+ const S = T.clientWidth, x = pn(), P = () => {
3337
3312
  for (let A = 0; A < p.length; A++) {
3338
- const L = p[A];
3339
- if (L && L.offsetTop + L.offsetHeight > S + 0.5)
3313
+ const w = p[A];
3314
+ if (w && w.offsetTop + w.offsetHeight > x + 0.5)
3340
3315
  return A;
3341
3316
  }
3342
3317
  return null;
3343
3318
  };
3344
- let P = M();
3345
- if (P !== null)
3319
+ let C = P();
3320
+ if (C !== null)
3346
3321
  for (let A = 0; A <= p.length; A++) {
3347
- z(p);
3348
- const L = p.slice(0, P).filter((V) => !!V);
3349
- ea(L, x, v, Xe);
3350
- const C = M();
3351
- if (C === null || C >= P) break;
3352
- P = C;
3322
+ E(p);
3323
+ const w = p.slice(0, C).filter((D) => !!D);
3324
+ ea(w, S, y, Xe);
3325
+ const M = P();
3326
+ if (M === null || M >= C) break;
3327
+ C = M;
3353
3328
  }
3354
- if (l(P), d(P !== null), P !== null) {
3355
- const A = p.slice(0, P).filter((C) => !!C), L = A.length ? Math.max(...A.map((C) => C.offsetTop + C.offsetHeight)) : pe;
3356
- u(L - pe);
3329
+ if (l(C), c(C !== null), C !== null) {
3330
+ const A = p.slice(0, C).filter((M) => !!M), w = A.length ? Math.max(...A.map((M) => M.offsetTop + M.offsetHeight)) : ge;
3331
+ u(w - ge);
3357
3332
  } else
3358
3333
  u(null);
3359
3334
  };
3360
3335
  g();
3361
3336
  const b = typeof ResizeObserver < "u" ? new ResizeObserver(g) : null;
3362
- return b?.observe(E), () => {
3363
- b?.disconnect(), z(F.current);
3337
+ return b?.observe(T), () => {
3338
+ b?.disconnect(), E(z.current);
3364
3339
  };
3365
- }, [a, r, v]), Oe(() => {
3366
- const E = h.current;
3367
- if (!E || !r) return;
3368
- const g = F.current.filter((p) => !!p);
3369
- z(F.current), ea(g, E.clientWidth, v, Xe);
3370
- const b = g.length ? Math.max(...g.map((p) => p.offsetTop + p.offsetHeight)) : pe;
3371
- return u(b - pe), () => {
3372
- z(F.current);
3340
+ }, [a, r, y]), Oe(() => {
3341
+ const T = h.current;
3342
+ if (!T || !r) return;
3343
+ const g = z.current.filter((p) => !!p);
3344
+ E(z.current), ea(g, T.clientWidth, y, Xe);
3345
+ const b = g.length ? Math.max(...g.map((p) => p.offsetTop + p.offsetHeight)) : ge;
3346
+ return u(b - ge), () => {
3347
+ E(z.current);
3373
3348
  };
3374
- }, [r, a, v]), a.length ? /* @__PURE__ */ n("div", { className: j("rqmii-suggested-messages", r && "is-expanded", s && "has-overflow"), dir: k, children: /* @__PURE__ */ f("div", { ref: h, className: j("rqmii-suggested-messages-inner", r ? "is-expanded" : "is-collapsed"), children: [
3375
- a.map((E, g) => {
3376
- const b = !r && c !== null && g >= c;
3349
+ }, [r, a, y]), a.length ? /* @__PURE__ */ n("div", { className: V("rqmii-suggested-messages", r && "is-expanded", s && "has-overflow"), dir: k, children: /* @__PURE__ */ f("div", { ref: h, className: V("rqmii-suggested-messages-inner", r ? "is-expanded" : "is-collapsed"), children: [
3350
+ a.map((T, g) => {
3351
+ const b = !r && d !== null && g >= d;
3377
3352
  return /* @__PURE__ */ n(
3378
3353
  "button",
3379
3354
  {
3380
3355
  ref: (p) => {
3381
- F.current[g] = p;
3356
+ z.current[g] = p;
3382
3357
  },
3383
3358
  type: "button",
3384
3359
  className: "rqmii-suggested-message",
3385
- onClick: () => o(E),
3360
+ onClick: () => i(T),
3386
3361
  style: b ? { visibility: "hidden" } : void 0,
3387
3362
  "aria-hidden": b || void 0,
3388
3363
  tabIndex: b ? -1 : void 0,
3389
- children: E
3364
+ children: T
3390
3365
  },
3391
3366
  g
3392
3367
  );
@@ -3395,16 +3370,16 @@ const vn = D.memo(function({ suggestions: a, language: t, onClick: o }) {
3395
3370
  "button",
3396
3371
  {
3397
3372
  type: "button",
3398
- className: j("rqmii-suggested-messages-toggle", v === "left" && "is-start-left"),
3373
+ className: V("rqmii-suggested-messages-toggle", y === "left" && "is-start-left"),
3399
3374
  style: m != null ? { top: m, bottom: "auto" } : void 0,
3400
- onClick: () => i((E) => (E && h.current && (h.current.scrollTop = 0), !E)),
3375
+ onClick: () => o((T) => (T && h.current && (h.current.scrollTop = 0), !T)),
3401
3376
  "aria-label": r ? "Show less" : "Show more",
3402
3377
  "aria-expanded": r,
3403
- children: r ? /* @__PURE__ */ n(Bt, { size: 14 }) : /* @__PURE__ */ n(ra, { size: 14 })
3378
+ children: r ? /* @__PURE__ */ n(Rt, { size: 14 }) : /* @__PURE__ */ n(ra, { size: 14 })
3404
3379
  }
3405
3380
  )
3406
3381
  ] }) }) : null;
3407
- }), yn = D.memo(function({ language: a }) {
3382
+ }), vn = I.memo(function({ language: a }) {
3408
3383
  const t = se(a || "en");
3409
3384
  return /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row", children: /* @__PURE__ */ f("div", { className: "rqmii-chat-message rqmii-chat-typing-indicator", dir: t, children: [
3410
3385
  /* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" }),
@@ -3412,55 +3387,55 @@ const vn = D.memo(function({ suggestions: a, language: t, onClick: o }) {
3412
3387
  /* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" })
3413
3388
  ] }) });
3414
3389
  });
3415
- function Fn(e) {
3390
+ function yn(e) {
3416
3391
  return e === "message";
3417
3392
  }
3418
- const Tn = {
3393
+ const Fn = {
3419
3394
  name: "leadFormName",
3420
3395
  email: "leadFormEmail",
3421
3396
  phone: "leadFormPhone",
3422
3397
  message: "leadFormMessage"
3423
- }, En = D.memo(function({ messageId: a, form: t, language: o, textDirection: r, formSubmitted: i }) {
3424
- const s = ka(), [d, c] = y({}), [l, m] = y(!1), [u, h] = y(!!i), [F, k] = y(null), v = t.title || T(o, "leadFormTitle"), z = (b) => {
3425
- const p = Tn[b.key];
3426
- return `${p ? T(o, p) : b.label}${b.required ? "*" : ""}`;
3427
- }, E = (b, p) => {
3428
- c((x) => ({ ...x, [b]: p })), F && k(null);
3398
+ }, Tn = I.memo(function({ messageId: a, form: t, language: i, textDirection: r, formSubmitted: o }) {
3399
+ const s = ba(), [c, d] = v({}), [l, m] = v(!1), [u, h] = v(!!o), [z, k] = v(null), y = t.title || F(i, "leadFormTitle"), E = (b) => {
3400
+ const p = Fn[b.key];
3401
+ return `${p ? F(i, p) : b.label}${b.required ? "*" : ""}`;
3402
+ }, T = (b, p) => {
3403
+ d((S) => ({ ...S, [b]: p })), z && k(null);
3429
3404
  }, g = async (b) => {
3430
3405
  if (b.preventDefault(), l || u) return;
3431
- if (t.fields.some((S) => S.required && !d[S.key]?.trim())) {
3432
- k(T(o, "leadFormRequiredError"));
3406
+ if (t.fields.some((x) => x.required && !c[x.key]?.trim())) {
3407
+ k(F(i, "leadFormRequiredError"));
3433
3408
  return;
3434
3409
  }
3435
- const x = {};
3436
- for (const S of t.fields) {
3437
- const M = d[S.key]?.trim();
3438
- M && (x[S.key] = M);
3410
+ const S = {};
3411
+ for (const x of t.fields) {
3412
+ const P = c[x.key]?.trim();
3413
+ P && (S[x.key] = P);
3439
3414
  }
3440
3415
  m(!0), k(null);
3441
3416
  try {
3442
- await s.submitLead({ agentId: t.agentId, collectedData: x }), h(!0), s.setMessages(
3417
+ await s.submitLead({ agentId: t.agentId, collectedData: S }), h(!0), s.setMessages(
3443
3418
  s.messages.map(
3444
- (S) => S.id === a ? { ...S, formSubmitted: !0 } : S
3419
+ (x) => x.id === a ? { ...x, formSubmitted: !0 } : x
3445
3420
  )
3446
3421
  );
3447
- } catch (S) {
3448
- k(S?.message || T(o, "leadFormGenericError"));
3422
+ } catch (x) {
3423
+ k(x?.message || F(i, "leadFormGenericError"));
3449
3424
  } finally {
3450
3425
  m(!1);
3451
3426
  }
3452
3427
  };
3453
- return u ? /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form rqmii-chat-lead-form--done", dir: r, children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-success", children: T(o, "leadFormSuccess") }) }) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ f("form", { className: "rqmii-chat-lead-form", dir: r, onSubmit: g, children: [
3454
- /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-title", children: v }),
3428
+ return u ? /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form rqmii-chat-lead-form--done", dir: r, children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-success", children: F(i, "leadFormSuccess") }) }) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ f("form", { className: "rqmii-chat-lead-form", dir: r, onSubmit: g, children: [
3429
+ /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-title", children: y }),
3455
3430
  t.fields.map((b) => {
3456
- const p = z(b), x = b.type === "email" ? "email" : b.type === "date" ? "date" : "text";
3457
- return Fn(b.key) ? /* @__PURE__ */ n(
3431
+ const p = E(b), S = b.type === "email" ? "email" : b.type === "date" ? "date" : "text";
3432
+ return yn(b.key) ? /* @__PURE__ */ n(
3458
3433
  "textarea",
3459
3434
  {
3460
3435
  className: "rqmii-chat-lead-form-input rqmii-chat-lead-form-textarea",
3461
3436
  placeholder: p,
3462
- value: d[b.key] || "",
3463
- onChange: (S) => E(b.key, S.target.value),
3437
+ value: c[b.key] || "",
3438
+ onChange: (x) => T(b.key, x.target.value),
3464
3439
  disabled: l,
3465
3440
  rows: 4
3466
3441
  },
@@ -3469,300 +3444,300 @@ const Tn = {
3469
3444
  "input",
3470
3445
  {
3471
3446
  className: "rqmii-chat-lead-form-input",
3472
- type: x,
3447
+ type: S,
3473
3448
  placeholder: p,
3474
- value: d[b.key] || "",
3475
- onChange: (S) => E(b.key, S.target.value),
3449
+ value: c[b.key] || "",
3450
+ onChange: (x) => T(b.key, x.target.value),
3476
3451
  disabled: l
3477
3452
  },
3478
3453
  b.key
3479
3454
  );
3480
3455
  }),
3481
- F && /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-error", children: F }),
3482
- /* @__PURE__ */ n("button", { type: "submit", className: "rqmii-chat-lead-form-submit", disabled: l, children: l ? T(o, "loading") : T(o, "submit") })
3456
+ z && /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-error", children: z }),
3457
+ /* @__PURE__ */ n("button", { type: "submit", className: "rqmii-chat-lead-form-submit", disabled: l, children: l ? F(i, "loading") : F(i, "submit") })
3483
3458
  ] }) });
3484
- }), zn = D.memo(function({ message: a, textDirection: t, language: o }) {
3459
+ }), zn = I.memo(function({ message: a, textDirection: t, language: i }) {
3485
3460
  if (a.role === "lead_form" && a.form)
3486
- return /* @__PURE__ */ n(En, { messageId: a.id, form: a.form, language: o, textDirection: t, formSubmitted: a.formSubmitted });
3461
+ return /* @__PURE__ */ n(Tn, { messageId: a.id, form: a.form, language: i, textDirection: t, formSubmitted: a.formSubmitted });
3487
3462
  const r = a.role === "user" || a.sender === "user";
3488
- return /* @__PURE__ */ n("div", { className: j("rqmii-chat-message-row", r && "is-user"), children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: t, children: /* @__PURE__ */ n(mn, { text: a.text, streaming: a.streaming }) }) });
3489
- }), _e = D.memo(function({ messages: a, partialTranscript: t, language: o, showTypingIndicator: r }) {
3490
- const i = _(null), s = se(o || "en"), d = _(a.length);
3491
- return I(() => {
3492
- if (!i.current) return;
3493
- const c = a.length !== d.current;
3494
- d.current = a.length, i.current.scrollIntoView({ behavior: c ? "smooth" : "instant", block: "end" });
3463
+ return /* @__PURE__ */ n("div", { className: V("rqmii-chat-message-row", r && "is-user"), children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: t, children: /* @__PURE__ */ n(un, { text: a.text, streaming: a.streaming }) }) });
3464
+ }), Ne = I.memo(function({ messages: a, partialTranscript: t, language: i, showTypingIndicator: r }) {
3465
+ const o = _(null), s = se(i || "en"), c = _(a.length);
3466
+ return j(() => {
3467
+ if (!o.current) return;
3468
+ const d = a.length !== c.current;
3469
+ c.current = a.length, o.current.scrollIntoView({ behavior: d ? "smooth" : "instant", block: "end" });
3495
3470
  }, [a, t]), /* @__PURE__ */ f("div", { className: "rqmii-chat-messages", children: [
3496
- a.map((c) => /* @__PURE__ */ n(zn, { message: c, textDirection: s, language: o || "en" }, c.id || `${c.role}-${c.text}`)),
3497
- r && /* @__PURE__ */ n(yn, { language: o }),
3471
+ a.map((d) => /* @__PURE__ */ n(zn, { message: d, textDirection: s, language: i || "en" }, d.id || `${d.role}-${d.text}`)),
3472
+ r && /* @__PURE__ */ n(vn, { language: i }),
3498
3473
  t && /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row is-user is-partial", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: s, children: t }) }),
3499
- /* @__PURE__ */ n("div", { ref: i })
3474
+ /* @__PURE__ */ n("div", { ref: o })
3500
3475
  ] });
3501
- }), la = D.memo(function({ message: a, onRetry: t, onClose: o, language: r = "en" }) {
3476
+ }), la = I.memo(function({ message: a, onRetry: t, onClose: i, language: r = "en" }) {
3502
3477
  return /* @__PURE__ */ f("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: [
3503
- o && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-error-close", onClick: o, children: "×" }),
3504
- /* @__PURE__ */ n("p", { children: a || T(r, "connectionFailed") }),
3478
+ i && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-error-close", onClick: i, children: "×" }),
3479
+ /* @__PURE__ */ n("p", { children: a || F(r, "connectionFailed") }),
3505
3480
  t && /* @__PURE__ */ f("button", { type: "button", className: "rqmii-chat-retry", onClick: t, children: [
3506
3481
  /* @__PURE__ */ n(Zt, { size: 16 }),
3507
- /* @__PURE__ */ n("span", { children: T(r, "retry") })
3482
+ /* @__PURE__ */ n("span", { children: F(r, "retry") })
3508
3483
  ] })
3509
3484
  ] });
3510
- }), Sn = 5;
3511
- function ca({ rating: e, onRate: a, readonly: t, size: o = 28 }) {
3512
- const [r, i] = y(0), s = r || e;
3513
- return /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-stars", role: "radiogroup", children: Array.from({ length: Sn }, (d, c) => {
3514
- const l = c + 1, m = l <= s;
3485
+ }), En = 5;
3486
+ function ca({ rating: e, onRate: a, readonly: t, size: i = 28 }) {
3487
+ const [r, o] = v(0), s = r || e;
3488
+ return /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-stars", role: "radiogroup", children: Array.from({ length: En }, (c, d) => {
3489
+ const l = d + 1, m = l <= s;
3515
3490
  return /* @__PURE__ */ n(
3516
3491
  "button",
3517
3492
  {
3518
3493
  type: "button",
3519
- className: j("rqmii-chat-star", m && "is-filled", t && "is-readonly"),
3494
+ className: V("rqmii-chat-star", m && "is-filled", t && "is-readonly"),
3520
3495
  disabled: t,
3521
3496
  "aria-label": `${l}`,
3522
3497
  "aria-checked": l === e,
3523
3498
  role: "radio",
3524
- onMouseEnter: () => !t && i(l),
3525
- onMouseLeave: () => !t && i(0),
3499
+ onMouseEnter: () => !t && o(l),
3500
+ onMouseLeave: () => !t && o(0),
3526
3501
  onClick: () => !t && a?.(l),
3527
- children: /* @__PURE__ */ n(Xt, { size: o, fill: m ? "currentColor" : "none" })
3502
+ children: /* @__PURE__ */ n(Jt, { size: i, fill: m ? "currentColor" : "none" })
3528
3503
  },
3529
3504
  l
3530
3505
  );
3531
3506
  }) });
3532
3507
  }
3533
- function xn({
3508
+ function Sn({
3534
3509
  language: e,
3535
3510
  rating: a,
3536
3511
  endedBy: t,
3537
- sessionId: o,
3512
+ sessionId: i,
3538
3513
  interactive: r,
3539
- showTellUsMore: i,
3514
+ showTellUsMore: o,
3540
3515
  onRate: s,
3541
- onTellUsMore: d
3516
+ onTellUsMore: c
3542
3517
  }) {
3543
- const c = a > 0 ? T(e, "ratingThankYou") : T(e, "ratingQuestion"), l = t === "user" ? T(e, "youEnded") : T(e, "agentEnded");
3544
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-rating", H(e)), dir: se(e), children: [
3545
- /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-header", children: c }),
3518
+ const d = a > 0 ? F(e, "ratingThankYou") : F(e, "ratingQuestion"), l = t === "user" ? F(e, "youEnded") : F(e, "agentEnded");
3519
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-rating", W(e)), dir: se(e), children: [
3520
+ /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-header", children: d }),
3546
3521
  /* @__PURE__ */ n(ca, { rating: a, onRate: s, readonly: !r }),
3547
- i && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-rating-more", onClick: d, children: T(e, "tellUsMore") }),
3522
+ o && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-rating-more", onClick: c, children: F(e, "tellUsMore") }),
3548
3523
  /* @__PURE__ */ f("div", { className: "rqmii-chat-rating-meta", children: [
3549
3524
  /* @__PURE__ */ n("div", { children: l }),
3550
- o && /* @__PURE__ */ f("div", { children: [
3551
- T(e, "sessionIdLabel"),
3525
+ i && /* @__PURE__ */ f("div", { children: [
3526
+ F(e, "sessionIdLabel"),
3552
3527
  " ",
3553
- /* @__PURE__ */ n("span", { className: "rqmii-chat-font-latin", children: o })
3528
+ /* @__PURE__ */ n("span", { className: "rqmii-chat-font-latin", children: i })
3554
3529
  ] })
3555
3530
  ] })
3556
3531
  ] });
3557
3532
  }
3558
- function Pn({
3533
+ function xn({
3559
3534
  agent: e,
3560
3535
  language: a,
3561
3536
  rating: t,
3562
- onBack: o,
3537
+ onBack: i,
3563
3538
  onMinimize: r,
3564
- onSubmit: i
3539
+ onSubmit: o
3565
3540
  }) {
3566
- const [s, d] = y(""), [c, l] = y(!1), m = s.trim().length > 0 && !c, u = async () => {
3541
+ const [s, c] = v(""), [d, l] = v(!1), m = s.trim().length > 0 && !d, u = async () => {
3567
3542
  if (m) {
3568
3543
  l(!0);
3569
3544
  try {
3570
- await i(s.trim());
3545
+ await o(s.trim());
3571
3546
  } finally {
3572
3547
  l(!1);
3573
3548
  }
3574
3549
  }
3575
3550
  };
3576
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--feedback", H(a)), dir: se(a), children: [
3551
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--feedback", W(a)), dir: se(a), children: [
3577
3552
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
3578
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, "aria-label": "Back", children: /* @__PURE__ */ n(Nt, { size: 20 }) }),
3579
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label": T(a, "minimize"), children: /* @__PURE__ */ n(Te, { size: 20 }) })
3553
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": "Back", children: /* @__PURE__ */ n(qt, { size: 20 }) }),
3554
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label": F(a, "minimize"), children: /* @__PURE__ */ n(Te, { size: 20 }) })
3580
3555
  ] }),
3581
3556
  /* @__PURE__ */ f("div", { className: "rqmii-chat-feedback-body", children: [
3582
3557
  /* @__PURE__ */ n(J, { agent: e, size: "hero" }),
3583
3558
  /* @__PURE__ */ n(ca, { rating: t, readonly: !0 }),
3584
- /* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-title", children: T(a, "ratingThankYou") }),
3585
- /* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-subtitle", children: T(a, "feedbackSubtitle") }),
3559
+ /* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-title", children: F(a, "ratingThankYou") }),
3560
+ /* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-subtitle", children: F(a, "feedbackSubtitle") }),
3586
3561
  /* @__PURE__ */ n(
3587
3562
  "textarea",
3588
3563
  {
3589
3564
  className: "rqmii-chat-feedback-input",
3590
3565
  value: s,
3591
3566
  dir: se(a),
3592
- placeholder: T(a, "feedbackPlaceholder"),
3593
- onChange: (h) => d(h.target.value)
3567
+ placeholder: F(a, "feedbackPlaceholder"),
3568
+ onChange: (h) => c(h.target.value)
3594
3569
  }
3595
3570
  ),
3596
- /* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-feedback-submit", onClick: u, disabled: !m, children: c ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 18 }) : T(a, "submit") }) })
3571
+ /* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-feedback-submit", onClick: u, disabled: !m, children: d ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 18 }) : F(a, "submit") }) })
3597
3572
  ] }),
3598
3573
  /* @__PURE__ */ n(le, { language: a, agent: e })
3599
3574
  ] });
3600
3575
  }
3601
- const Mn = D.lazy(() => import("./RqmiiCloudAvatarPlayer-CXKmEFce.js").then((e) => e.e).then((e) => ({ default: e.RqmiiCloudAvatarPlayer })));
3602
- function he(e) {
3576
+ const Pn = I.lazy(() => import("./RqmiiCloudAvatarPlayer-BL7GVcr_.js").then((e) => e.e).then((e) => ({ default: e.RqmiiCloudAvatarPlayer })));
3577
+ function me(e) {
3603
3578
  if (!(e == null || typeof window > "u" || window.innerWidth >= 768))
3604
3579
  return {
3605
3580
  top: `${window.innerHeight - e}px`,
3606
3581
  bottom: 0
3607
3582
  };
3608
3583
  }
3609
- const Cn = D.memo(function({ agent: a, language: t, languages: o, onLanguageChange: r, onClose: i, onSend: s, isVoiceEnabled: d = !1, isAudioPlaying: c = !1, isVoiceSetupLoading: l = !1, onStartVoice: m, visualViewportHeight: u, disabled: h = !1, error: F, suggestions: k, onSuggestionClick: v, compact: z = !1 }) {
3610
- const E = he(u), g = z ? "start" : "hero", b = k && k.length > 0;
3611
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--start", z && "rqmii-chat-panel--start-compact", H(t)), style: E, children: [
3584
+ const Mn = I.memo(function({ agent: a, language: t, languages: i, onLanguageChange: r, onClose: o, onSend: s, isVoiceEnabled: c = !1, isAudioPlaying: d = !1, isVoiceSetupLoading: l = !1, onStartVoice: m, visualViewportHeight: u, disabled: h = !1, error: z, suggestions: k, onSuggestionClick: y, compact: E = !1 }) {
3585
+ const T = me(u), g = E ? "start" : "hero", b = k && k.length > 0;
3586
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--start", E && "rqmii-chat-panel--start-compact", W(t)), style: T, children: [
3612
3587
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
3613
3588
  /* @__PURE__ */ n("span", {}),
3614
3589
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions", children: [
3615
- /* @__PURE__ */ n(Ne, { language: t, languages: o, onChange: r }),
3616
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, children: /* @__PURE__ */ n(De, { size: 20 }) })
3590
+ /* @__PURE__ */ n(qe, { language: t, languages: i, onChange: r }),
3591
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, children: /* @__PURE__ */ n(Ie, { size: 20 }) })
3617
3592
  ] })
3618
3593
  ] }),
3619
3594
  /* @__PURE__ */ f("div", { className: "rqmii-chat-start-body", children: [
3620
- d ? /* @__PURE__ */ f("div", { className: j("rqmii-chat-call-avatar-wrap", z && "is-compact"), children: [
3621
- /* @__PURE__ */ n(J, { agent: a, size: g, active: c }),
3622
- /* @__PURE__ */ n("button", { type: "button", className: j("rqmii-chat-call-button", z && "is-compact"), onClick: m, disabled: l, "aria-label": T(t, "startVoice"), children: l ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: z ? 18 : 24 }) : /* @__PURE__ */ n(Ie, { size: z ? 18 : 24 }) })
3595
+ c ? /* @__PURE__ */ f("div", { className: V("rqmii-chat-call-avatar-wrap", E && "is-compact"), children: [
3596
+ /* @__PURE__ */ n(J, { agent: a, size: g, active: d }),
3597
+ /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-call-button", E && "is-compact"), onClick: m, disabled: l, "aria-label": F(t, "startVoice"), children: l ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: E ? 18 : 24 }) : /* @__PURE__ */ n(je, { size: E ? 18 : 24 }) })
3623
3598
  ] }) : /* @__PURE__ */ n(J, { agent: a, size: g }),
3624
3599
  /* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: a.name }),
3625
- F && /* @__PURE__ */ n("div", { className: "rqmii-chat-error-text", children: F })
3600
+ z && /* @__PURE__ */ n("div", { className: "rqmii-chat-error-text", children: z })
3626
3601
  ] }),
3627
- b && /* @__PURE__ */ n("div", { className: "rqmii-chat-start-suggestions", children: /* @__PURE__ */ n(vn, { suggestions: k, language: t, onClick: (p) => v?.(p) }) }),
3628
- /* @__PURE__ */ n(Ee, { language: t, onSend: s, disabled: h }),
3602
+ b && /* @__PURE__ */ n("div", { className: "rqmii-chat-start-suggestions", children: /* @__PURE__ */ n(fn, { suggestions: k, language: t, onClick: (p) => y?.(p) }) }),
3603
+ /* @__PURE__ */ n(ze, { language: t, onSend: s, disabled: h }),
3629
3604
  /* @__PURE__ */ n(le, { language: t, agent: a })
3630
3605
  ] });
3631
- }), wn = D.memo(function({ agent: a, language: t, languages: o, onLanguageChange: r, onClose: i, onStartVoice: s, isVoiceSetupLoading: d = !1, isAudioPlaying: c, visualViewportHeight: l }) {
3632
- const m = he(l);
3633
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--voice-start", H(t)), style: m, children: [
3606
+ }), Cn = I.memo(function({ agent: a, language: t, languages: i, onLanguageChange: r, onClose: o, onStartVoice: s, isVoiceSetupLoading: c = !1, isAudioPlaying: d, visualViewportHeight: l }) {
3607
+ const m = me(l);
3608
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-start", W(t)), style: m, children: [
3634
3609
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
3635
3610
  /* @__PURE__ */ n("span", {}),
3636
3611
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions", children: [
3637
- /* @__PURE__ */ n(Ne, { language: t, languages: o, onChange: r }),
3638
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, children: /* @__PURE__ */ n(De, { size: 20 }) })
3612
+ /* @__PURE__ */ n(qe, { language: t, languages: i, onChange: r }),
3613
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, children: /* @__PURE__ */ n(Ie, { size: 20 }) })
3639
3614
  ] })
3640
3615
  ] }),
3641
3616
  /* @__PURE__ */ f("div", { className: "rqmii-chat-call-body", children: [
3642
3617
  /* @__PURE__ */ f("div", { className: "rqmii-chat-call-avatar-wrap", children: [
3643
- /* @__PURE__ */ n(J, { agent: a, size: "hero", active: c }),
3644
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-call-button", onClick: s, disabled: d, "aria-label": T(t, "startVoice"), children: d ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 24 }) : /* @__PURE__ */ n(Ie, { size: 24 }) })
3618
+ /* @__PURE__ */ n(J, { agent: a, size: "hero", active: d }),
3619
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-call-button", onClick: s, disabled: c, "aria-label": F(t, "startVoice"), children: c ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 24 }) : /* @__PURE__ */ n(je, { size: 24 }) })
3645
3620
  ] }),
3646
3621
  /* @__PURE__ */ f("div", { className: "rqmii-chat-agent-name", children: [
3647
- T(t, "call"),
3622
+ F(t, "call"),
3648
3623
  " ",
3649
3624
  a.name
3650
3625
  ] })
3651
3626
  ] }),
3652
3627
  /* @__PURE__ */ n(le, { language: t, agent: a })
3653
3628
  ] });
3654
- }), An = D.memo(function({ agent: a, language: t, onEndSession: o, onMinimize: r, messages: i, partialTranscript: s, onSend: d, isAudioPlaying: c, isVoiceEnabled: l, onToggleVoice: m, isListening: u, isSpeaking: h, isLoading: F, isAgentThinking: k, isAgentSpeaking: v, onStartVoice: z, elapsed: E, visualViewportHeight: g, waitingForResponse: b }) {
3655
- const p = da({ language: t, isListening: u, isLoading: F, isSpeaking: h, isAudioPlaying: c, isAgentThinking: k, isAgentSpeaking: v, persistentListening: !1 }), x = he(g);
3656
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--conversation", H(t)), style: x, children: [
3629
+ }), wn = I.memo(function({ agent: a, language: t, onEndSession: i, onMinimize: r, messages: o, partialTranscript: s, onSend: c, isAudioPlaying: d, isVoiceEnabled: l, onToggleVoice: m, isListening: u, isSpeaking: h, isLoading: z, isAgentThinking: k, isAgentSpeaking: y, onStartVoice: E, elapsed: T, visualViewportHeight: g, waitingForResponse: b }) {
3630
+ const p = da({ language: t, isListening: u, isLoading: z, isSpeaking: h, isAudioPlaying: d, isAgentThinking: k, isAgentSpeaking: y, persistentListening: !1 }), S = me(g);
3631
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--conversation", W(t)), style: S, children: [
3657
3632
  /* @__PURE__ */ f("div", { className: "rqmii-chat-header", children: [
3658
- /* @__PURE__ */ n(J, { agent: a, size: "header", active: c }),
3633
+ /* @__PURE__ */ n(J, { agent: a, size: "header", active: d }),
3659
3634
  l && p && /* @__PURE__ */ n("div", { className: "rqmii-chat-header-status", children: /* @__PURE__ */ n("span", { children: p }) }),
3660
3635
  /* @__PURE__ */ n("div", { className: "rqmii-chat-header-spacer" }),
3661
3636
  /* @__PURE__ */ f("div", { className: "rqmii-chat-header-actions", children: [
3662
- r && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label": T(t, "minimize"), children: /* @__PURE__ */ n(Te, { size: 20 }) }),
3663
- l && /* @__PURE__ */ n("button", { type: "button", className: j("rqmii-chat-circle-button", h && "is-active"), onClick: m, "aria-label": u ? T(t, "stopVoice") : T(t, "startVoice"), children: u ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(je, { size: 20 }) }),
3664
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: o, "aria-label": T(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
3637
+ r && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, "aria-label": F(t, "minimize"), children: /* @__PURE__ */ n(Te, { size: 20 }) }),
3638
+ l && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", h && "is-active"), onClick: m, "aria-label": u ? F(t, "stopVoice") : F(t, "startVoice"), children: u ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(Le, { size: 20 }) }),
3639
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label": F(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
3665
3640
  ] })
3666
3641
  ] }),
3667
- /* @__PURE__ */ n(_e, { messages: i, partialTranscript: s, language: t, showTypingIndicator: b }),
3668
- l && /* @__PURE__ */ n("div", { className: "rqmii-chat-session-counter", children: qe(E) }),
3669
- /* @__PURE__ */ n(Ee, { language: t, onSend: d }),
3642
+ /* @__PURE__ */ n(Ne, { messages: o, partialTranscript: s, language: t, showTypingIndicator: b }),
3643
+ l && /* @__PURE__ */ n("div", { className: "rqmii-chat-session-counter", children: De(T) }),
3644
+ /* @__PURE__ */ n(ze, { language: t, onSend: c }),
3670
3645
  /* @__PURE__ */ n(le, { language: t, agent: a })
3671
3646
  ] });
3672
- }), Ln = D.memo(function({ agent: a, language: t, onEndSession: o, onMinimize: r, isListening: i, isLoading: s, isSpeaking: d, isAudioPlaying: c, isAgentThinking: l, isAgentSpeaking: m, onToggleVoice: u, elapsed: h, visualViewportHeight: F }) {
3673
- const k = da({ language: t, isListening: i, isLoading: s, isSpeaking: d, isAudioPlaying: c, isAgentThinking: l, isAgentSpeaking: m, persistentListening: !0 }), v = he(F);
3674
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--voice-call", H(t)), style: v, children: [
3647
+ }), An = I.memo(function({ agent: a, language: t, onEndSession: i, onMinimize: r, isListening: o, isLoading: s, isSpeaking: c, isAudioPlaying: d, isAgentThinking: l, isAgentSpeaking: m, onToggleVoice: u, elapsed: h, visualViewportHeight: z }) {
3648
+ const k = da({ language: t, isListening: o, isLoading: s, isSpeaking: c, isAudioPlaying: d, isAgentThinking: l, isAgentSpeaking: m, persistentListening: !0 }), y = me(z);
3649
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-call", W(t)), style: y, children: [
3675
3650
  /* @__PURE__ */ f("div", { className: "rqmii-chat-call-status", children: [
3676
- /* @__PURE__ */ n("span", { className: j("rqmii-chat-live-dot", i && "is-live") }),
3677
- /* @__PURE__ */ n("span", { children: qe(h) }),
3651
+ /* @__PURE__ */ n("span", { className: V("rqmii-chat-live-dot", o && "is-live") }),
3652
+ /* @__PURE__ */ n("span", { children: De(h) }),
3678
3653
  /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: r, children: /* @__PURE__ */ n(Te, { size: 20 }) })
3679
3654
  ] }),
3680
3655
  /* @__PURE__ */ f("div", { className: "rqmii-chat-voice-frame", children: [
3681
- /* @__PURE__ */ n(J, { agent: a, size: "hero", active: c }),
3656
+ /* @__PURE__ */ n(J, { agent: a, size: "hero", active: d }),
3682
3657
  /* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: a.name }),
3683
- /* @__PURE__ */ n("div", { className: j("rqmii-chat-status-pill", !k && "is-empty"), children: k || T(t, "listening") }),
3658
+ /* @__PURE__ */ n("div", { className: V("rqmii-chat-status-pill", !k && "is-empty"), children: k || F(t, "listening") }),
3684
3659
  /* @__PURE__ */ f("div", { className: "rqmii-chat-voice-actions", children: [
3685
- /* @__PURE__ */ n("button", { type: "button", className: j("rqmii-chat-circle-button", d && "is-active"), onClick: u, children: i ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(je, { size: 20 }) }),
3686
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: o, "aria-label": T(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
3660
+ /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: u, children: o ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(Le, { size: 20 }) }),
3661
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label": F(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
3687
3662
  ] })
3688
3663
  ] }),
3689
3664
  /* @__PURE__ */ n(le, { language: t, agent: a })
3690
3665
  ] });
3691
3666
  });
3692
- function da({ language: e, isListening: a, isLoading: t, isSpeaking: o, isAudioPlaying: r, isAgentThinking: i, isAgentSpeaking: s, persistentListening: d = !1 }) {
3693
- return t ? T(e, "loading") : o ? T(e, "listening") : r || s ? T(e, "talkToInterrupt") : i ? T(e, "processing") : a && d ? T(e, "listening") : null;
3667
+ function da({ language: e, isListening: a, isLoading: t, isSpeaking: i, isAudioPlaying: r, isAgentThinking: o, isAgentSpeaking: s, persistentListening: c = !1 }) {
3668
+ return t ? F(e, "loading") : i ? F(e, "listening") : r || s ? F(e, "talkToInterrupt") : o ? F(e, "processing") : a && c ? F(e, "listening") : null;
3694
3669
  }
3695
- const jn = D.memo(function({ agent: a, language: t, onRestore: o, onClose: r, isListening: i, isAudioPlaying: s, isSpeaking: d, onToggleVoice: c, elapsed: l, visualViewportHeight: m, variant: u = "voice" }) {
3696
- const h = he(m), F = u === "text";
3697
- return /* @__PURE__ */ f("div", { className: j("rqmii-chat-minimized", H(t)), style: h, children: [
3670
+ const Ln = I.memo(function({ agent: a, language: t, onRestore: i, onClose: r, isListening: o, isAudioPlaying: s, isSpeaking: c, onToggleVoice: d, elapsed: l, visualViewportHeight: m, variant: u = "voice" }) {
3671
+ const h = me(m), z = u === "text";
3672
+ return /* @__PURE__ */ f("div", { className: V("rqmii-chat-minimized", W(t)), style: h, children: [
3698
3673
  /* @__PURE__ */ n(J, { agent: a, size: "minimized", active: s }),
3699
- !F && /* @__PURE__ */ n("span", { className: "rqmii-chat-minimized-time", children: qe(l) }),
3674
+ !z && /* @__PURE__ */ n("span", { className: "rqmii-chat-minimized-time", children: De(l) }),
3700
3675
  /* @__PURE__ */ f("div", { className: "rqmii-chat-minimized-actions", children: [
3701
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, "aria-label": T(t, "maximize"), children: /* @__PURE__ */ n(Kt, { size: 20 }) }),
3702
- !F && /* @__PURE__ */ n("button", { type: "button", className: j("rqmii-chat-circle-button", d && "is-active"), onClick: c, "aria-label": i ? T(t, "stopVoice") : T(t, "startVoice"), children: i ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(je, { size: 20 }) }),
3703
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: r, "aria-label": T(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
3676
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": F(t, "maximize"), children: /* @__PURE__ */ n(Ut, { size: 20 }) }),
3677
+ !z && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: d, "aria-label": o ? F(t, "stopVoice") : F(t, "startVoice"), children: o ? /* @__PURE__ */ n(Fe, { size: 20 }) : /* @__PURE__ */ n(Le, { size: 20 }) }),
3678
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: r, "aria-label": F(t, "endCall"), children: /* @__PURE__ */ n(Ve, { size: 20 }) })
3704
3679
  ] })
3705
3680
  ] });
3706
- }), Vn = D.memo(function({
3681
+ }), Vn = I.memo(function({
3707
3682
  agent: a,
3708
3683
  language: t,
3709
- languages: o,
3684
+ languages: i,
3710
3685
  chatKind: r,
3711
- messages: i,
3686
+ messages: o,
3712
3687
  onLanguageChange: s,
3713
- onMinimize: d,
3714
- onStartNewVoice: c,
3688
+ onMinimize: c,
3689
+ onStartNewVoice: d,
3715
3690
  onStartNewText: l,
3716
3691
  isVoiceSetupLoading: m = !1,
3717
3692
  visualViewportHeight: u,
3718
3693
  rating: h,
3719
- endedBy: F,
3694
+ endedBy: z,
3720
3695
  sessionId: k,
3721
- ratingInteractive: v,
3722
- showTellUsMore: z,
3723
- onRate: E,
3696
+ ratingInteractive: y,
3697
+ showTellUsMore: E,
3698
+ onRate: T,
3724
3699
  onTellUsMore: g
3725
3700
  }) {
3726
- const b = he(u), p = k && a.widget?.behavior?.post_chat_rating_enabled ? /* @__PURE__ */ n(
3727
- xn,
3701
+ const b = me(u), p = k && a.widget?.behavior?.post_chat_rating_enabled ? /* @__PURE__ */ n(
3702
+ Sn,
3728
3703
  {
3729
3704
  language: t,
3730
3705
  rating: h,
3731
- endedBy: F,
3706
+ endedBy: z,
3732
3707
  sessionId: k,
3733
- interactive: v,
3734
- showTellUsMore: z,
3735
- onRate: E,
3708
+ interactive: y,
3709
+ showTellUsMore: E,
3710
+ onRate: T,
3736
3711
  onTellUsMore: g
3737
3712
  }
3738
- ) : null, x = r === "voice" || r === "text_and_voice", S = r === "text" || r === "text_and_voice", M = /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions rqmii-chat-topbar-actions--ended", children: [
3739
- /* @__PURE__ */ n(Ne, { language: t, languages: o, onChange: s }),
3713
+ ) : null, S = r === "voice" || r === "text_and_voice", x = r === "text" || r === "text_and_voice", P = /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar-actions rqmii-chat-topbar-actions--ended", children: [
3714
+ /* @__PURE__ */ n(qe, { language: t, languages: i, onChange: s }),
3740
3715
  /* @__PURE__ */ n(
3741
3716
  "button",
3742
3717
  {
3743
3718
  type: "button",
3744
3719
  className: "rqmii-chat-circle-button",
3745
- onClick: d,
3746
- "aria-label": T(t, "minimize"),
3720
+ onClick: c,
3721
+ "aria-label": F(t, "minimize"),
3747
3722
  children: /* @__PURE__ */ n(Te, { size: 20 })
3748
3723
  }
3749
3724
  ),
3750
- x && /* @__PURE__ */ n(
3725
+ S && /* @__PURE__ */ n(
3751
3726
  "button",
3752
3727
  {
3753
3728
  type: "button",
3754
3729
  className: "rqmii-chat-circle-button rqmii-chat-circle-button--call-start",
3755
- onClick: c,
3730
+ onClick: d,
3756
3731
  disabled: m,
3757
- "aria-label": T(t, "startVoice"),
3758
- children: m ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 20 }) : /* @__PURE__ */ n(Ie, { size: 20 })
3732
+ "aria-label": F(t, "startVoice"),
3733
+ children: m ? /* @__PURE__ */ n(ye, { className: "rqmii-chat-spin", size: 20 }) : /* @__PURE__ */ n(je, { size: 20 })
3759
3734
  }
3760
3735
  )
3761
3736
  ] });
3762
- return r === "voice" ? /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--voice-call", H(t)), style: b, children: [
3737
+ return r === "voice" ? /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-call", W(t)), style: b, children: [
3763
3738
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
3764
3739
  /* @__PURE__ */ n("span", {}),
3765
- M
3740
+ P
3766
3741
  ] }),
3767
3742
  /* @__PURE__ */ f("div", { className: "rqmii-chat-voice-frame", children: [
3768
3743
  /* @__PURE__ */ n(J, { agent: a, size: "hero" }),
@@ -3770,53 +3745,53 @@ const jn = D.memo(function({ agent: a, language: t, onRestore: o, onClose: r, is
3770
3745
  p
3771
3746
  ] }),
3772
3747
  /* @__PURE__ */ n(le, { language: t, agent: a })
3773
- ] }) : /* @__PURE__ */ f("div", { className: j("rqmii-chat-panel rqmii-chat-panel--conversation", H(t)), style: b, children: [
3748
+ ] }) : /* @__PURE__ */ f("div", { className: V("rqmii-chat-panel rqmii-chat-panel--conversation", W(t)), style: b, children: [
3774
3749
  /* @__PURE__ */ f("div", { className: "rqmii-chat-topbar", children: [
3775
3750
  /* @__PURE__ */ n(J, { agent: a, size: "header" }),
3776
- M
3751
+ P
3777
3752
  ] }),
3778
- /* @__PURE__ */ n(_e, { messages: i, language: t }),
3753
+ /* @__PURE__ */ n(Ne, { messages: o, language: t }),
3779
3754
  p,
3780
- S && /* @__PURE__ */ n(Ee, { language: t, onSend: l }),
3755
+ x && /* @__PURE__ */ n(ze, { language: t, onSend: l }),
3781
3756
  /* @__PURE__ */ n(le, { language: t, agent: a })
3782
3757
  ] });
3783
- }), ua = D.memo(function({ agent: a, language: t, onClose: o }) {
3784
- const { streamingUrl: r, isCloudStreamConnected: i, cloudStreamError: s } = Ke(), { isAvatarSpeaking: d } = Ke(), { messages: c, sendTextMessage: l } = ue();
3785
- return /* @__PURE__ */ f("div", { className: j("rqmii-avatar-panel", H(t)), children: [
3758
+ }), ua = I.memo(function({ agent: a, language: t, onClose: i }) {
3759
+ const { streamingUrl: r, isCloudStreamConnected: o, cloudStreamError: s } = Ke(), { isAvatarSpeaking: c } = Ke(), { messages: d, sendTextMessage: l } = de();
3760
+ return /* @__PURE__ */ f("div", { className: V("rqmii-avatar-panel", W(t)), children: [
3786
3761
  /* @__PURE__ */ f("div", { className: "rqmii-avatar-stream", children: [
3787
- /* @__PURE__ */ n(D.Suspense, { fallback: /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: T(t, "loading") }), children: /* @__PURE__ */ n(Mn, { autoConnect: !0, muted: !1 }) }),
3788
- !r && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: T(t, "loading") }),
3789
- s && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: T(t, "connectionFailed") }),
3762
+ /* @__PURE__ */ n(I.Suspense, { fallback: /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: F(t, "loading") }), children: /* @__PURE__ */ n(Pn, { autoConnect: !0, muted: !1 }) }),
3763
+ !r && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: F(t, "loading") }),
3764
+ s && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: F(t, "connectionFailed") }),
3790
3765
  /* @__PURE__ */ f("div", { className: "rqmii-avatar-controls", children: [
3791
- /* @__PURE__ */ n(J, { agent: a, size: "header", active: d }),
3766
+ /* @__PURE__ */ n(J, { agent: a, size: "header", active: c }),
3792
3767
  /* @__PURE__ */ n("div", { className: "rqmii-chat-header-spacer" }),
3793
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", disabled: !i, children: /* @__PURE__ */ n(Fe, { size: 20 }) }),
3794
- /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: o, children: /* @__PURE__ */ n(De, { size: 20 }) })
3768
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", disabled: !o, children: /* @__PURE__ */ n(Fe, { size: 20 }) }),
3769
+ /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, children: /* @__PURE__ */ n(Ie, { size: 20 }) })
3795
3770
  ] })
3796
3771
  ] }),
3797
3772
  a.useText && /* @__PURE__ */ f("div", { className: "rqmii-avatar-sidebar", children: [
3798
- /* @__PURE__ */ n(_e, { messages: c, language: t }),
3799
- /* @__PURE__ */ n(Ee, { language: t, onSend: l, variant: "compact" }),
3773
+ /* @__PURE__ */ n(Ne, { messages: d, language: t }),
3774
+ /* @__PURE__ */ n(ze, { language: t, onSend: l, variant: "compact" }),
3800
3775
  /* @__PURE__ */ n(le, { language: t, agent: a })
3801
3776
  ] })
3802
3777
  ] });
3803
3778
  });
3804
- function In({ language: e, config: a, onAccept: t, onDecline: o }) {
3805
- const r = a?.title?.[e] || T(e, "consentTitle"), i = a?.body?.[e] || T(e, "consentBody"), s = a?.acceptLabel?.[e] || T(e, "consentAccept"), d = a?.declineLabel?.[e] || T(e, "consentDecline"), c = a?.termsUrl?.[e], l = a?.privacyUrl?.[e];
3779
+ function jn({ language: e, config: a, onAccept: t, onDecline: i }) {
3780
+ const r = a?.title?.[e] || F(e, "consentTitle"), o = a?.body?.[e] || F(e, "consentBody"), s = a?.acceptLabel?.[e] || F(e, "consentAccept"), c = a?.declineLabel?.[e] || F(e, "consentDecline"), d = a?.termsUrl?.[e], l = a?.privacyUrl?.[e];
3806
3781
  return /* @__PURE__ */ f("div", { className: "rqmii-chat-panel rqmii-chat-panel--start", style: { justifyContent: "space-between" }, children: [
3807
3782
  /* @__PURE__ */ f("div", { style: { flex: 1, display: "flex", flexDirection: "column", justifyContent: "center", padding: "24px", gap: "16px" }, children: [
3808
3783
  /* @__PURE__ */ n("div", { style: { fontSize: "16px", fontWeight: 600, color: "var(--rqmii-text)" }, children: r }),
3809
3784
  /* @__PURE__ */ f("div", { style: { fontSize: "13px", lineHeight: 1.5, color: "var(--rqmii-muted)" }, children: [
3810
- i,
3811
- (c || l) && /* @__PURE__ */ f("span", { children: [
3785
+ o,
3786
+ (d || l) && /* @__PURE__ */ f("span", { children: [
3812
3787
  " ",
3813
- c && /* @__PURE__ */ n("a", { href: c, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children: T(e, "consentTermsLink") }),
3814
- c && l && /* @__PURE__ */ f("span", { children: [
3788
+ d && /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children: F(e, "consentTermsLink") }),
3789
+ d && l && /* @__PURE__ */ f("span", { children: [
3815
3790
  " ",
3816
- T(e, "close")?.toLowerCase() === "close" ? "and" : "و",
3791
+ F(e, "close")?.toLowerCase() === "close" ? "and" : "و",
3817
3792
  " "
3818
3793
  ] }),
3819
- l && /* @__PURE__ */ n("a", { href: l, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children: T(e, "consentPrivacyLink") }),
3794
+ l && /* @__PURE__ */ n("a", { href: l, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--rqmii-action)", textDecoration: "underline" }, children: F(e, "consentPrivacyLink") }),
3820
3795
  "."
3821
3796
  ] })
3822
3797
  ] })
@@ -3827,9 +3802,9 @@ function In({ language: e, config: a, onAccept: t, onDecline: o }) {
3827
3802
  {
3828
3803
  type: "button",
3829
3804
  className: "rqmii-chat-pill",
3830
- onClick: o,
3805
+ onClick: i,
3831
3806
  style: { background: "transparent", border: "1px solid var(--rqmii-border)" },
3832
- children: d
3807
+ children: c
3833
3808
  }
3834
3809
  ),
3835
3810
  /* @__PURE__ */ n(
@@ -3845,175 +3820,175 @@ function In({ language: e, config: a, onAccept: t, onDecline: o }) {
3845
3820
  ] })
3846
3821
  ] });
3847
3822
  }
3848
- function Dn(e) {
3823
+ function In(e) {
3849
3824
  return e ? typeof e == "string" ? e : typeof e == "object" && typeof e.text == "string" ? e.text : "" : "";
3850
3825
  }
3851
- function qn(e) {
3826
+ function Dn(e) {
3852
3827
  return e === "text" || e === "voice" || e === "text_and_voice";
3853
3828
  }
3854
- const Re = D.memo(function({
3829
+ const _e = I.memo(function({
3855
3830
  agent: a,
3856
3831
  language: t,
3857
- languages: o,
3858
- onLanguageChange: r = ie,
3859
- onEndSession: i = ie,
3832
+ languages: i,
3833
+ onLanguageChange: r = ne,
3834
+ onEndSession: o = ne,
3860
3835
  onMinimize: s,
3861
- messages: d,
3862
- onSendMessage: c,
3836
+ messages: c,
3837
+ onSendMessage: d,
3863
3838
  isPreview: l = !1,
3864
3839
  chatKind: m,
3865
3840
  sdk: u,
3866
3841
  renderPanel: h,
3867
- messagesRef: F,
3842
+ messagesRef: z,
3868
3843
  initialText: k,
3869
- autoStartVoice: v
3844
+ autoStartVoice: y
3870
3845
  }) {
3871
- const [z, E] = y(!1), g = m || ve(a), [b, p] = y(() => g === "voice" && u.isSessionReady || g === "voice" && !!v), [x, S] = y(() => (g === "text" || g === "text_and_voice") && u.isSessionReady || !!k || g === "text_and_voice" && !!v), [M, P] = y(!1), [A, L] = y(!1), [C, V] = y(null), W = on(g === "voice" && b || g === "text_and_voice" && x), q = rn(), B = a.consent?.enabled && !z && !l, N = qn(g), { events: U } = me();
3872
- I(() => {
3846
+ const [E, T] = v(!1), g = m || ve(a), [b, p] = v(() => g === "voice" && u.isSessionReady || g === "voice" && !!y), [S, x] = v(() => (g === "text" || g === "text_and_voice") && u.isSessionReady || !!k || g === "text_and_voice" && !!y), [P, C] = v(!1), [A, w] = v(!1), [M, D] = v(null), Z = nn(g === "voice" && b || g === "text_and_voice" && S), q = on(), B = a.consent?.enabled && !E && !l, N = Dn(g), { events: U } = ue();
3847
+ j(() => {
3873
3848
  if (!U) return;
3874
- const K = () => {
3875
- N && nn() && P(!0);
3876
- }, Z = () => {
3877
- N && P(!1);
3849
+ const O = () => {
3850
+ N && tn() && C(!0);
3851
+ }, H = () => {
3852
+ N && C(!1);
3878
3853
  };
3879
- return U.on("minimize_chat", K), U.on("maximize_chat", Z), () => {
3880
- U.off("minimize_chat", K), U.off("maximize_chat", Z);
3854
+ return U.on("minimize_chat", O), U.on("maximize_chat", H), () => {
3855
+ U.off("minimize_chat", O), U.off("maximize_chat", H);
3881
3856
  };
3882
3857
  }, [U, N]);
3883
- const O = () => E(!0), Q = () => {
3884
- s ? s() : i();
3885
- }, X = (K) => {
3886
- r(K), l || u.changeSessionLanguage(K);
3887
- }, ne = re((K) => {
3888
- if (V(null), L(!0), c) {
3889
- c(K);
3858
+ const K = () => T(!0), $ = () => {
3859
+ s ? s() : o();
3860
+ }, ae = (O) => {
3861
+ r(O), l || u.changeSessionLanguage(O);
3862
+ }, te = re((O) => {
3863
+ if (D(null), w(!0), d) {
3864
+ d(O);
3890
3865
  return;
3891
3866
  }
3892
- u.sendTextMessage(K);
3893
- }, [c, u]);
3894
- I(() => {
3895
- F && (F.current = u.messages);
3867
+ u.sendTextMessage(O);
3868
+ }, [d, u]);
3869
+ j(() => {
3870
+ z && (z.current = u.messages);
3896
3871
  });
3897
- const ee = _(!1);
3898
- I(() => {
3899
- ee.current || (k ? (ee.current = !0, ne(k)) : v && (ee.current = !0, V(null), L(!0), u.isVoiceActive || u.startVoice()));
3900
- }, []), I(() => {
3901
- A && u.isSessionReady && (L(!1), g === "voice" ? p(!0) : S(!0));
3902
- }, [A, u.isSessionReady, g]), I(() => {
3903
- A && u.error && (L(!1), V(u.error));
3872
+ const Q = _(!1);
3873
+ j(() => {
3874
+ Q.current || (k ? (Q.current = !0, te(k)) : y && (Q.current = !0, D(null), w(!0), u.isVoiceActive || u.startVoice()));
3875
+ }, []), j(() => {
3876
+ A && u.isSessionReady && (w(!1), g === "voice" ? p(!0) : x(!0));
3877
+ }, [A, u.isSessionReady, g]), j(() => {
3878
+ A && u.error && (w(!1), D(u.error));
3904
3879
  }, [A, u.error]);
3905
- const $ = re(() => {
3906
- V(null), L(!0), u.isVoiceActive || u.startVoice();
3880
+ const ie = re(() => {
3881
+ D(null), w(!0), u.isVoiceActive || u.startVoice();
3907
3882
  }, [u]);
3908
- if (u.error && !l && (x || b)) return /* @__PURE__ */ n(la, { message: u.error, language: t, onClose: i });
3883
+ if (u.error && !l && (S || b)) return /* @__PURE__ */ n(la, { message: u.error, language: t, onClose: o });
3909
3884
  if (B)
3910
- return /* @__PURE__ */ n(In, { language: t, config: a.consent, onAccept: O, onDecline: Q });
3885
+ return /* @__PURE__ */ n(jn, { language: t, config: a.consent, onAccept: K, onDecline: $ });
3911
3886
  const R = {
3912
3887
  agent: a,
3913
3888
  language: t,
3914
- languages: o,
3889
+ languages: i,
3915
3890
  chatKind: g,
3916
3891
  sdk: u,
3917
3892
  isPreview: l,
3918
- onLanguageChange: X,
3919
- onClose: i,
3920
- onMinimize: N ? () => P(!0) : void 0,
3921
- onRestore: N ? () => P(!1) : void 0,
3922
- onSend: ne,
3893
+ onLanguageChange: ae,
3894
+ onClose: o,
3895
+ onMinimize: N ? () => C(!0) : void 0,
3896
+ onRestore: N ? () => C(!1) : void 0,
3897
+ onSend: te,
3923
3898
  voiceStarted: b,
3924
- conversationStarted: x,
3925
- isMinimized: M,
3926
- elapsed: W,
3899
+ conversationStarted: S,
3900
+ isMinimized: P,
3901
+ elapsed: Z,
3927
3902
  setVoiceStarted: p,
3928
- setConversationStarted: S
3903
+ setConversationStarted: x
3929
3904
  };
3930
- return h ? /* @__PURE__ */ n(Le, { children: h(R) }) : /* @__PURE__ */ n(Nn, { ...R, connecting: A, connectError: C, visualViewportHeight: q, onCloseWidget: s ?? i, initiateVoice: $, onSendSuggestion: (K) => {
3931
- V(null), L(!0), u.sendSuggestion?.(K);
3905
+ return h ? /* @__PURE__ */ n(Ae, { children: h(R) }) : /* @__PURE__ */ n(qn, { ...R, connecting: A, connectError: M, visualViewportHeight: q, onCloseWidget: s ?? o, initiateVoice: ie, onSendSuggestion: (O) => {
3906
+ D(null), w(!0), u.sendSuggestion?.(O);
3932
3907
  } });
3933
- }), Nn = D.memo(function({ agent: a, language: t, languages: o, chatKind: r, sdk: i, onLanguageChange: s, onClose: d, onMinimize: c, onRestore: l, onSend: m, voiceStarted: u, conversationStarted: h, isMinimized: F, elapsed: k, setVoiceStarted: v, setConversationStarted: z, visualViewportHeight: E, connecting: g = !1, connectError: b = null, onCloseWidget: p, initiateVoice: x, onSendSuggestion: S }) {
3934
- const M = a.widget?.behavior?.typing_indicator_enabled ?? !0, P = r === "text" ? i.waitingForResponse && M : !1, A = i.messages;
3935
- if (r === "avatar") return /* @__PURE__ */ n(ua, { agent: a, language: t, onClose: d });
3936
- if (F)
3937
- return /* @__PURE__ */ n(jn, { agent: a, language: t, onRestore: l, onClose: d, isListening: i.isVoiceActive, isAudioPlaying: i.isAudioPlaying, isSpeaking: i.vad.isSpeaking, onToggleVoice: i.toggleVoice, elapsed: k, visualViewportHeight: E, variant: r === "text" ? "text" : "voice" });
3908
+ }), qn = I.memo(function({ agent: a, language: t, languages: i, chatKind: r, sdk: o, onLanguageChange: s, onClose: c, onMinimize: d, onRestore: l, onSend: m, voiceStarted: u, conversationStarted: h, isMinimized: z, elapsed: k, setVoiceStarted: y, setConversationStarted: E, visualViewportHeight: T, connecting: g = !1, connectError: b = null, onCloseWidget: p, initiateVoice: S, onSendSuggestion: x }) {
3909
+ const P = a.widget?.behavior?.typing_indicator_enabled ?? !0, C = r === "text" ? o.waitingForResponse && P : !1, A = o.messages;
3910
+ if (r === "avatar") return /* @__PURE__ */ n(ua, { agent: a, language: t, onClose: c });
3911
+ if (z)
3912
+ return /* @__PURE__ */ n(Ln, { agent: a, language: t, onRestore: l, onClose: c, isListening: o.isVoiceActive, isAudioPlaying: o.isAudioPlaying, isSpeaking: o.vad.isSpeaking, onToggleVoice: o.toggleVoice, elapsed: k, visualViewportHeight: T, variant: r === "text" ? "text" : "voice" });
3938
3913
  if (r === "voice" && u)
3939
- return /* @__PURE__ */ n(Ln, { agent: a, language: t, onEndSession: d, onMinimize: c, isListening: i.isVoiceActive, isLoading: i.vad.isLoading, isSpeaking: i.vad.isSpeaking, isAudioPlaying: i.isAudioPlaying, isAgentThinking: i.isAgentThinking, isAgentSpeaking: i.isAgentSpeaking, onToggleVoice: i.toggleVoice, elapsed: k, visualViewportHeight: E });
3914
+ return /* @__PURE__ */ n(An, { agent: a, language: t, onEndSession: c, onMinimize: d, isListening: o.isVoiceActive, isLoading: o.vad.isLoading, isSpeaking: o.vad.isSpeaking, isAudioPlaying: o.isAudioPlaying, isAgentThinking: o.isAgentThinking, isAgentSpeaking: o.isAgentSpeaking, onToggleVoice: o.toggleVoice, elapsed: k, visualViewportHeight: T });
3940
3915
  if (r === "voice")
3941
- return /* @__PURE__ */ n(wn, { agent: a, language: t, languages: o, onLanguageChange: s, onClose: p, isAudioPlaying: i.isAudioPlaying, isVoiceSetupLoading: i.isVoiceSetupLoading || g, onStartVoice: x, visualViewportHeight: E });
3942
- if (!h && (i.messages.length === 0 || g)) {
3943
- const L = a.conversation?.suggested_messages?.[t]?.filter((G) => G.trim()) || void 0, C = (G) => {
3944
- i.sendSuggestion ? S(G) : m?.(G);
3945
- }, V = r === "text_and_voice" || ve(a) === "text_and_voice";
3946
- return /* @__PURE__ */ n(Cn, { agent: a, language: t, languages: o, onLanguageChange: s, onClose: p, onSend: m, isVoiceEnabled: V, isAudioPlaying: i.isAudioPlaying, isVoiceSetupLoading: i.isVoiceSetupLoading || g, onStartVoice: x, visualViewportHeight: E, disabled: g, error: b || void 0, suggestions: L, onSuggestionClick: C, compact: !!L });
3916
+ return /* @__PURE__ */ n(Cn, { agent: a, language: t, languages: i, onLanguageChange: s, onClose: p, isAudioPlaying: o.isAudioPlaying, isVoiceSetupLoading: o.isVoiceSetupLoading || g, onStartVoice: S, visualViewportHeight: T });
3917
+ if (!h && (o.messages.length === 0 || g)) {
3918
+ const w = a.conversation?.suggested_messages?.[t]?.filter((G) => G.trim()) || void 0, M = (G) => {
3919
+ o.sendSuggestion ? x(G) : m?.(G);
3920
+ }, D = r === "text_and_voice" || ve(a) === "text_and_voice";
3921
+ return /* @__PURE__ */ n(Mn, { agent: a, language: t, languages: i, onLanguageChange: s, onClose: p, onSend: m, isVoiceEnabled: D, isAudioPlaying: o.isAudioPlaying, isVoiceSetupLoading: o.isVoiceSetupLoading || g, onStartVoice: S, visualViewportHeight: T, disabled: g, error: b || void 0, suggestions: w, onSuggestionClick: M, compact: !!w });
3947
3922
  }
3948
- return /* @__PURE__ */ n(An, { agent: a, language: t, onEndSession: d, messages: A, partialTranscript: Dn(i.partialTranscript), onSend: m, isAudioPlaying: i.isAudioPlaying, isVoiceEnabled: r === "text_and_voice", isListening: i.isVoiceActive, isSpeaking: i.vad.isSpeaking, isLoading: i.vad.isLoading, isAgentThinking: i.isAgentThinking, isAgentSpeaking: i.isAgentSpeaking, onToggleVoice: i.toggleVoice, onStartVoice: i.startVoice, onMinimize: c, elapsed: k, visualViewportHeight: E, waitingForResponse: P });
3949
- }), _n = { isListening: !1, isLoading: !1, isSpeaking: !1, toggle: async () => !1 };
3923
+ return /* @__PURE__ */ n(wn, { agent: a, language: t, onEndSession: c, messages: A, partialTranscript: In(o.partialTranscript), onSend: m, isAudioPlaying: o.isAudioPlaying, isVoiceEnabled: r === "text_and_voice", isListening: o.isVoiceActive, isSpeaking: o.vad.isSpeaking, isLoading: o.vad.isLoading, isAgentThinking: o.isAgentThinking, isAgentSpeaking: o.isAgentSpeaking, onToggleVoice: o.toggleVoice, onStartVoice: o.startVoice, onMinimize: d, elapsed: k, visualViewportHeight: T, waitingForResponse: C });
3924
+ }), Nn = { isListening: !1, isLoading: !1, isSpeaking: !1, toggle: async () => !1 };
3950
3925
  function ma({ isSessionReady: e, sendTextMessage: a, messages: t }) {
3951
- const [o, r] = y(null), [i, s] = y(null), d = re(() => {
3952
- r((c) => (c && (e ? a(c) : s(c)), null));
3926
+ const [i, r] = v(null), [o, s] = v(null), c = re(() => {
3927
+ r((d) => (d && (e ? a(d) : s(d)), null));
3953
3928
  }, [e, a]);
3954
- return I(() => {
3955
- o && t.length !== 0 && d();
3956
- }, [t, o, d]), I(() => {
3957
- if (!o) return;
3958
- const c = setTimeout(d, 5e3);
3959
- return () => clearTimeout(c);
3960
- }, [o, d]), I(() => {
3961
- !i || !e || (a(i), s(null));
3962
- }, [e, i, a]), { pendingWelcomeText: o, pendingMessage: i, setPendingWelcomeText: r, setPendingMessage: s, sendPendingWelcomeText: d };
3929
+ return j(() => {
3930
+ i && t.length !== 0 && c();
3931
+ }, [t, i, c]), j(() => {
3932
+ if (!i) return;
3933
+ const d = setTimeout(c, 5e3);
3934
+ return () => clearTimeout(d);
3935
+ }, [i, c]), j(() => {
3936
+ !o || !e || (a(o), s(null));
3937
+ }, [e, o, a]), { pendingWelcomeText: i, pendingMessage: o, setPendingWelcomeText: r, setPendingMessage: s, sendPendingWelcomeText: c };
3963
3938
  }
3964
- function Be({ isSessionReady: e, signalClientReady: a }) {
3965
- const [t, o] = y(!1), [r, i] = y(void 0), s = _(!1);
3966
- return I(() => {
3967
- !e || s.current || !t || (s.current = !0, a(r), o(!1));
3968
- }, [e, t, r, a]), { emitClientReady: re((c) => {
3969
- e ? (s.current = !0, a(c)) : (i(c), o(!0));
3939
+ function Re({ isSessionReady: e, signalClientReady: a }) {
3940
+ const [t, i] = v(!1), [r, o] = v(void 0), s = _(!1);
3941
+ return j(() => {
3942
+ !e || s.current || !t || (s.current = !0, a(r), i(!1));
3943
+ }, [e, t, r, a]), { emitClientReady: re((d) => {
3944
+ e ? (s.current = !0, a(d)) : (o(d), i(!0));
3970
3945
  }, [e, a]) };
3971
3946
  }
3972
- const Rn = 300;
3973
- function Bn(e) {
3974
- const { isPreview: a = !1, ...t } = e, { messages: o, sendTextMessage: r, emitUserMessage: i, addLocalMessage: s, clearMessages: d } = ue(), { changeSessionLanguage: c, clearSessionHistory: l, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: F, isAgentSpeaking: k } = me(), v = _(!1), z = _(null), E = _(!1), [g, b] = y(!1), [p, x] = y(null), [S, M] = y(!1), P = _(o.length);
3975
- I(() => {
3976
- if (o.length > P.current) {
3977
- const q = o[o.length - 1];
3978
- q.role === "assistant" && q.streaming && M(!1);
3947
+ const _n = 300;
3948
+ function Rn(e) {
3949
+ const { isPreview: a = !1, ...t } = e, { messages: i, sendTextMessage: r, emitUserMessage: o, addLocalMessage: s, clearMessages: c } = de(), { changeSessionLanguage: d, clearSessionHistory: l, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: z, isAgentSpeaking: k } = ue(), y = _(!1), E = _(null), T = _(!1), [g, b] = v(!1), [p, S] = v(null), [x, P] = v(!1), C = _(i.length);
3950
+ j(() => {
3951
+ if (i.length > C.current) {
3952
+ const q = i[i.length - 1];
3953
+ q.role === "assistant" && q.streaming && P(!1);
3979
3954
  }
3980
- P.current = o.length;
3981
- }, [o]), aa("message_rate_limited", re(() => {
3982
- M(!1);
3983
- }, [])), I(() => {
3984
- if (!h || !g || E.current) return;
3985
- const q = z.current;
3955
+ C.current = i.length;
3956
+ }, [i]), aa("message_rate_limited", re(() => {
3957
+ P(!1);
3958
+ }, [])), j(() => {
3959
+ if (!h || !g || T.current) return;
3960
+ const q = E.current;
3986
3961
  if (q === null) return;
3987
- E.current = !0, z.current = null, s("user", q), x(null);
3962
+ T.current = !0, E.current = null, s("user", q), S(null);
3988
3963
  const B = e.agent.welcomeMessages?.[e.language];
3989
3964
  m(B ? { welcomeMessage: B } : void 0);
3990
3965
  const N = setTimeout(() => {
3991
- i(q), M(!0);
3992
- }, Rn);
3966
+ o(q), P(!0);
3967
+ }, _n);
3993
3968
  return () => clearTimeout(N);
3994
- }, [h, g, m, i, s]);
3995
- const A = te(() => p ? [{ id: "first-user", role: "user", text: p }, ...o] : o, [p, o]), L = re(() => {
3996
- x(null), d();
3997
- }, [d]), C = {
3969
+ }, [h, g, m, o, s]);
3970
+ const A = ee(() => p ? [{ id: "first-user", role: "user", text: p }, ...i] : i, [p, i]), w = re(() => {
3971
+ S(null), c();
3972
+ }, [c]), M = {
3998
3973
  emitClientReady: m,
3999
3974
  sendMessage: (q) => {
4000
3975
  r(q);
4001
3976
  },
4002
- queueForWelcome: ie,
4003
- enableVoice: ie,
4004
- disableVoice: ie,
3977
+ queueForWelcome: ne,
3978
+ enableVoice: ne,
3979
+ disableVoice: ne,
4005
3980
  language: e.language,
4006
3981
  isSessionReady: h,
4007
3982
  supportsVoice: !1,
4008
3983
  isVoiceActive: !1,
4009
3984
  chatKind: "text"
4010
- }, V = (q, B) => {
4011
- e.onSessionStart?.(), v.current ? (M(!0), B.sendMessage(q)) : (v.current = !0, x(q), z.current = q, b(!0), M(!0));
3985
+ }, D = (q, B) => {
3986
+ e.onSessionStart?.(), y.current ? (P(!0), B.sendMessage(q)) : (y.current = !0, S(q), E.current = q, b(!0), P(!0));
4012
3987
  }, G = (q) => {
4013
- e.onTextSend ? e.onTextSend(q, C) : V(q, C);
3988
+ e.onTextSend ? e.onTextSend(q, M) : D(q, M);
4014
3989
  };
4015
3990
  return /* @__PURE__ */ n(
4016
- Re,
3991
+ _e,
4017
3992
  {
4018
3993
  ...t,
4019
3994
  isPreview: a,
@@ -4021,305 +3996,305 @@ function Bn(e) {
4021
3996
  sdk: {
4022
3997
  messages: A,
4023
3998
  sendTextMessage: G,
4024
- clearMessages: L,
3999
+ clearMessages: w,
4025
4000
  clearSessionHistory: l,
4026
4001
  isAudioPlaying: !1,
4027
4002
  partialTranscript: null,
4028
- changeSessionLanguage: c,
4003
+ changeSessionLanguage: d,
4029
4004
  error: u,
4030
- isAgentThinking: F,
4005
+ isAgentThinking: z,
4031
4006
  isAgentSpeaking: k,
4032
4007
  isVoiceSetupLoading: !1,
4033
4008
  isVoiceActive: !1,
4034
4009
  isSessionReady: h,
4035
- vad: _n,
4036
- startVoice: ie,
4037
- prepareVoice: ie,
4038
- toggleVoice: ie,
4010
+ vad: Nn,
4011
+ startVoice: ne,
4012
+ prepareVoice: ne,
4013
+ toggleVoice: ne,
4039
4014
  signalClientReady: m,
4040
- waitingForResponse: S,
4015
+ waitingForResponse: x,
4041
4016
  sendSuggestion: G
4042
4017
  }
4043
4018
  }
4044
4019
  );
4045
4020
  }
4046
- function Gn(e) {
4047
- const { isPreview: a = !1, ...t } = e, { messages: o, sendTextMessage: r, clearMessages: i } = ue(), { isAudioPlaying: s, partialTranscript: d } = ta(), { changeSessionLanguage: c, clearSessionHistory: l, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: F, isAgentSpeaking: k } = me(), { setPendingWelcomeText: v, setPendingMessage: z } = ma({ isSessionReady: h, sendTextMessage: r, messages: o }), { emitClientReady: E } = Be({ isSessionReady: h, signalClientReady: m }), [g, b] = y(!1), p = na({
4021
+ function Bn(e) {
4022
+ const { isPreview: a = !1, ...t } = e, { messages: i, sendTextMessage: r, clearMessages: o } = de(), { isAudioPlaying: s, partialTranscript: c } = ta(), { changeSessionLanguage: d, clearSessionHistory: l, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: z, isAgentSpeaking: k } = ue(), { setPendingWelcomeText: y, setPendingMessage: E } = ma({ isSessionReady: h, sendTextMessage: r, messages: i }), { emitClientReady: T } = Re({ isSessionReady: h, signalClientReady: m }), [g, b] = v(!1), p = na({
4048
4023
  enabled: !0,
4049
4024
  preloadStream: !1
4050
- }), { isLoading: x, isListening: S, toggle: M } = p, P = x, A = S || g;
4051
- I(() => {
4052
- !g || !h || x || S || M();
4053
- }, [g, h, x, S, M]);
4054
- const L = () => {
4025
+ }), { isLoading: S, isListening: x, toggle: P } = p, C = S, A = x || g;
4026
+ j(() => {
4027
+ !g || !h || S || x || P();
4028
+ }, [g, h, S, x, P]);
4029
+ const w = () => {
4055
4030
  e.onSessionStart?.();
4056
- }, C = {
4057
- emitClientReady: E,
4031
+ }, M = {
4032
+ emitClientReady: T,
4058
4033
  sendMessage: (N) => {
4059
- h ? r(N) : z(N);
4034
+ h ? r(N) : E(N);
4060
4035
  },
4061
- queueForWelcome: (N) => v(N),
4036
+ queueForWelcome: (N) => y(N),
4062
4037
  enableVoice: () => b(!0),
4063
4038
  disableVoice: () => {
4064
- b(!1), S && M();
4039
+ b(!1), x && P();
4065
4040
  },
4066
4041
  language: e.language,
4067
4042
  isSessionReady: h,
4068
4043
  supportsVoice: !0,
4069
4044
  isVoiceActive: A,
4070
4045
  chatKind: "voice"
4071
- }, V = (N) => {
4072
- L(), N.enableVoice();
4046
+ }, D = (N) => {
4047
+ w(), N.enableVoice();
4073
4048
  const U = e.agent.welcomeMessages?.[e.language];
4074
4049
  N.emitClientReady(U ? { welcomeMessage: U } : void 0);
4075
4050
  }, G = (N) => {
4076
4051
  N.isVoiceActive ? N.disableVoice() : N.enableVoice();
4077
4052
  };
4078
4053
  return /* @__PURE__ */ n(
4079
- Re,
4054
+ _e,
4080
4055
  {
4081
4056
  ...t,
4082
4057
  isPreview: a,
4083
4058
  chatKind: "voice",
4084
4059
  sdk: {
4085
- messages: o,
4060
+ messages: i,
4086
4061
  sendTextMessage: () => {
4087
4062
  },
4088
- clearMessages: i,
4063
+ clearMessages: o,
4089
4064
  clearSessionHistory: l,
4090
4065
  isAudioPlaying: s,
4091
- partialTranscript: d,
4092
- changeSessionLanguage: c,
4066
+ partialTranscript: c,
4067
+ changeSessionLanguage: d,
4093
4068
  error: u,
4094
- isAgentThinking: F,
4069
+ isAgentThinking: z,
4095
4070
  isAgentSpeaking: k,
4096
- isVoiceSetupLoading: P,
4071
+ isVoiceSetupLoading: C,
4097
4072
  isVoiceActive: A,
4098
4073
  isSessionReady: h,
4099
4074
  vad: p,
4100
4075
  startVoice: () => {
4101
- e.onVoiceStart ? e.onVoiceStart(C) : V(C);
4076
+ e.onVoiceStart ? e.onVoiceStart(M) : D(M);
4102
4077
  },
4103
4078
  prepareVoice: () => {
4104
4079
  },
4105
4080
  toggleVoice: () => {
4106
- e.onVoiceToggle ? e.onVoiceToggle(C) : G(C);
4081
+ e.onVoiceToggle ? e.onVoiceToggle(M) : G(M);
4107
4082
  },
4108
4083
  signalClientReady: m
4109
4084
  }
4110
4085
  }
4111
4086
  );
4112
4087
  }
4113
- const Un = 300;
4114
- function Kn(e) {
4115
- const { isPreview: a = !1, ...t } = e, { messages: o, sendTextMessage: r, emitUserMessage: i, addLocalMessage: s, clearMessages: d } = ue(), { isAudioPlaying: c, partialTranscript: l } = ta(), { changeSessionLanguage: m, clearSessionHistory: u, signalClientReady: h, error: F, isSessionReady: k, isAgentThinking: v, isAgentSpeaking: z } = me(), { emitClientReady: E } = Be({ isSessionReady: k, signalClientReady: h }), [g, b] = y(!1), p = _(null), [x, S] = y(!1), M = _(null), [P, A] = y(!1), L = _(!1), C = _(!1), V = _(!1), [G, W] = y(null), [q, B] = y(!1), N = _(o.length);
4116
- I(() => {
4117
- if (o.length > N.current) {
4118
- const w = o[o.length - 1];
4119
- w.role === "assistant" && w.streaming && B(!1);
4088
+ const Gn = 300;
4089
+ function Un(e) {
4090
+ const { isPreview: a = !1, ...t } = e, { messages: i, sendTextMessage: r, emitUserMessage: o, addLocalMessage: s, clearMessages: c } = de(), { isAudioPlaying: d, partialTranscript: l } = ta(), { changeSessionLanguage: m, clearSessionHistory: u, signalClientReady: h, error: z, isSessionReady: k, isAgentThinking: y, isAgentSpeaking: E } = ue(), { emitClientReady: T } = Re({ isSessionReady: k, signalClientReady: h }), [g, b] = v(!1), p = _(null), [S, x] = v(!1), P = _(null), [C, A] = v(!1), w = _(!1), M = _(!1), D = _(!1), [G, Z] = v(null), [q, B] = v(!1), N = _(i.length);
4091
+ j(() => {
4092
+ if (i.length > N.current) {
4093
+ const L = i[i.length - 1];
4094
+ L.role === "assistant" && L.streaming && B(!1);
4120
4095
  }
4121
- N.current = o.length;
4122
- }, [o]), aa("message_rate_limited", re(() => {
4096
+ N.current = i.length;
4097
+ }, [i]), aa("message_rate_limited", re(() => {
4123
4098
  B(!1);
4124
4099
  }, []));
4125
4100
  const U = na({
4126
4101
  enabled: !0,
4127
4102
  preloadStream: !1
4128
- }), { isLoading: O, isListening: Q, toggle: X } = U, ne = O, ee = Q || g;
4129
- I(() => {
4130
- !g || !k || O || Q || X();
4131
- }, [g, k, O, Q, X]), I(() => {
4132
- if (!k || !x || V.current) return;
4133
- const w = p.current;
4134
- if (w === null) return;
4135
- V.current = !0, p.current = null, s("user", w), W(null);
4136
- const ae = e.agent.welcomeMessages?.[e.language];
4137
- h(ae ? { welcomeMessage: ae } : void 0);
4138
- const xe = setTimeout(() => {
4139
- i(w), B(!0);
4140
- }, Un);
4141
- return () => clearTimeout(xe);
4142
- }, [k, x, h, i, s]), I(() => {
4143
- if (!k || !P || L.current) return;
4144
- const w = M.current;
4145
- w !== null && (L.current = !0, M.current = null, s("user", w), i(w), B(!0), A(!1));
4146
- }, [k, P, i, s]);
4147
- const $ = te(() => G ? [{ id: "first-user", role: "user", text: G }, ...o] : o, [G, o]), R = re(() => {
4148
- W(null), C.current = !1, V.current = !1, d();
4149
- }, [d]), K = () => {
4103
+ }), { isLoading: K, isListening: $, toggle: ae } = U, te = K, Q = $ || g;
4104
+ j(() => {
4105
+ !g || !k || K || $ || ae();
4106
+ }, [g, k, K, $, ae]), j(() => {
4107
+ if (!k || !S || D.current) return;
4108
+ const L = p.current;
4109
+ if (L === null) return;
4110
+ D.current = !0, p.current = null, s("user", L), Z(null);
4111
+ const X = e.agent.welcomeMessages?.[e.language];
4112
+ h(X ? { welcomeMessage: X } : void 0);
4113
+ const Se = setTimeout(() => {
4114
+ o(L), B(!0);
4115
+ }, Gn);
4116
+ return () => clearTimeout(Se);
4117
+ }, [k, S, h, o, s]), j(() => {
4118
+ if (!k || !C || w.current) return;
4119
+ const L = P.current;
4120
+ L !== null && (w.current = !0, P.current = null, s("user", L), o(L), B(!0), A(!1));
4121
+ }, [k, C, o, s]);
4122
+ const ie = ee(() => G ? [{ id: "first-user", role: "user", text: G }, ...i] : i, [G, i]), R = re(() => {
4123
+ Z(null), M.current = !1, D.current = !1, c();
4124
+ }, [c]), O = () => {
4150
4125
  e.onSessionStart?.();
4151
- }, Z = {
4152
- emitClientReady: (w) => {
4153
- V.current = !0, C.current = !0, E(w);
4126
+ }, H = {
4127
+ emitClientReady: (L) => {
4128
+ D.current = !0, M.current = !0, T(L);
4154
4129
  },
4155
- sendMessage: (w) => {
4156
- r(w);
4130
+ sendMessage: (L) => {
4131
+ r(L);
4157
4132
  },
4158
4133
  queueForWelcome: () => {
4159
4134
  },
4160
4135
  enableVoice: () => b(!0),
4161
4136
  disableVoice: () => {
4162
- b(!1), Q && X();
4137
+ b(!1), $ && ae();
4163
4138
  },
4164
4139
  language: e.language,
4165
4140
  isSessionReady: k,
4166
4141
  supportsVoice: !0,
4167
- isVoiceActive: ee,
4142
+ isVoiceActive: Q,
4168
4143
  chatKind: "text_and_voice"
4169
- }, ke = (w, ae) => {
4170
- K(), !C.current && !V.current ? (C.current = !0, e.onStartText?.(), W(w), p.current = w, S(!0), B(!0)) : (C.current = !0, B(!0), ae.sendMessage(w));
4171
- }, ce = (w) => {
4172
- K(), C.current = !0, V.current = !0, e.onStartVoice?.(), w.enableVoice();
4173
- const ae = e.agent.welcomeMessages?.[e.language];
4174
- w.emitClientReady(ae ? { welcomeMessage: ae } : void 0);
4175
- }, fe = (w) => {
4176
- w.isVoiceActive ? w.disableVoice() : w.enableVoice();
4177
- }, Se = {
4178
- messages: $,
4179
- sendTextMessage: (w) => {
4180
- e.onTextSend ? e.onTextSend(w, Z) : ke(w, Z);
4144
+ }, ce = (L, X) => {
4145
+ O(), !M.current && !D.current ? (M.current = !0, e.onStartText?.(), Z(L), p.current = L, x(!0), B(!0)) : (M.current = !0, B(!0), X.sendMessage(L));
4146
+ }, ke = (L) => {
4147
+ O(), M.current = !0, D.current = !0, e.onStartVoice?.(), L.enableVoice();
4148
+ const X = e.agent.welcomeMessages?.[e.language];
4149
+ L.emitClientReady(X ? { welcomeMessage: X } : void 0);
4150
+ }, fe = (L) => {
4151
+ L.isVoiceActive ? L.disableVoice() : L.enableVoice();
4152
+ }, Ee = {
4153
+ messages: ie,
4154
+ sendTextMessage: (L) => {
4155
+ e.onTextSend ? e.onTextSend(L, H) : ce(L, H);
4181
4156
  },
4182
4157
  clearMessages: R,
4183
4158
  clearSessionHistory: u,
4184
- isAudioPlaying: c,
4159
+ isAudioPlaying: d,
4185
4160
  partialTranscript: l,
4186
4161
  changeSessionLanguage: m,
4187
- error: F,
4188
- isAgentThinking: v,
4189
- isAgentSpeaking: z,
4190
- isVoiceSetupLoading: ne,
4191
- isVoiceActive: ee,
4162
+ error: z,
4163
+ isAgentThinking: y,
4164
+ isAgentSpeaking: E,
4165
+ isVoiceSetupLoading: te,
4166
+ isVoiceActive: Q,
4192
4167
  isSessionReady: k,
4193
4168
  vad: U,
4194
4169
  startVoice: () => {
4195
- e.onVoiceStart ? e.onVoiceStart(Z) : ce(Z);
4170
+ e.onVoiceStart ? e.onVoiceStart(H) : ke(H);
4196
4171
  },
4197
4172
  prepareVoice: () => {
4198
4173
  },
4199
4174
  toggleVoice: () => {
4200
- e.onVoiceToggle ? e.onVoiceToggle(Z) : fe(Z);
4175
+ e.onVoiceToggle ? e.onVoiceToggle(H) : fe(H);
4201
4176
  },
4202
4177
  signalClientReady: h,
4203
4178
  waitingForResponse: q,
4204
- sendSuggestion: (w) => {
4205
- K(), C.current = !0, V.current = !0, e.onStartVoice?.(), b(!0), M.current = w, A(!0);
4179
+ sendSuggestion: (L) => {
4180
+ O(), M.current = !0, D.current = !0, e.onStartVoice?.(), b(!0), P.current = L, A(!0);
4206
4181
  }
4207
4182
  };
4208
4183
  return /* @__PURE__ */ n(
4209
- Re,
4184
+ _e,
4210
4185
  {
4211
4186
  ...t,
4212
4187
  isPreview: a,
4213
4188
  chatKind: e.textOnly ? "text" : "text_and_voice",
4214
- sdk: Se
4189
+ sdk: Ee
4215
4190
  }
4216
4191
  );
4217
4192
  }
4218
- function On(e) {
4219
- const { isPreview: a = !1, agent: t, language: o, languages: r, onLanguageChange: i, onEndSession: s, onMinimize: d, messages: c, onSendMessage: l } = e, m = s || d || ie, { messages: u, sendTextMessage: h, clearMessages: F } = ue(), { changeSessionLanguage: k, clearSessionHistory: v, signalClientReady: z, error: E, isSessionReady: g, isAgentThinking: b, isAgentSpeaking: p } = me();
4220
- return ma({ isSessionReady: g, sendTextMessage: h, messages: u }), Be({ isSessionReady: g, signalClientReady: z }), E && !a ? /* @__PURE__ */ n(la, { message: E, language: o, onClose: m }) : /* @__PURE__ */ n(ua, { agent: t, language: o, onClose: m });
4193
+ function Kn(e) {
4194
+ const { isPreview: a = !1, agent: t, language: i, languages: r, onLanguageChange: o, onEndSession: s, onMinimize: c, messages: d, onSendMessage: l } = e, m = s || c || ne, { messages: u, sendTextMessage: h, clearMessages: z } = de(), { changeSessionLanguage: k, clearSessionHistory: y, signalClientReady: E, error: T, isSessionReady: g, isAgentThinking: b, isAgentSpeaking: p } = ue();
4195
+ return ma({ isSessionReady: g, sendTextMessage: h, messages: u }), Re({ isSessionReady: g, signalClientReady: E }), T && !a ? /* @__PURE__ */ n(la, { message: T, language: i, onClose: m }) : /* @__PURE__ */ n(ua, { agent: t, language: i, onClose: m });
4221
4196
  }
4222
- function ei({ agent: e, defaultOpen: a = !1, className: t = "", preview: o = !1, ChatBoxComponent: r }) {
4223
- const [i, s] = D.useState(a), [d, c] = D.useState(e.defaultLanguage), l = te(() => be(e.languages, e.defaultLanguage), [e.defaultLanguage, e.languages]);
4224
- return D.useEffect(() => {
4225
- c(e.defaultLanguage);
4226
- }, [e.defaultLanguage]), /* @__PURE__ */ f("div", { className: j("rqmii-chat-surface", o && "is-preview", t), children: [
4227
- !i && /* @__PURE__ */ n(sa, { agent: e, onClick: () => s(!0), position: o ? "static" : "fixed" }),
4228
- i && /* @__PURE__ */ n(r, { agent: e, language: d, languages: l, onLanguageChange: c, onClose: () => s(!1), isPreview: o })
4197
+ function Jn({ agent: e, defaultOpen: a = !1, className: t = "", preview: i = !1, ChatBoxComponent: r }) {
4198
+ const [o, s] = I.useState(a), [c, d] = I.useState(e.defaultLanguage), l = ee(() => be(e.languages, e.defaultLanguage), [e.defaultLanguage, e.languages]);
4199
+ return I.useEffect(() => {
4200
+ d(e.defaultLanguage);
4201
+ }, [e.defaultLanguage]), /* @__PURE__ */ f("div", { className: V("rqmii-chat-surface", i && "is-preview", t), children: [
4202
+ !o && /* @__PURE__ */ n(sa, { agent: e, onClick: () => s(!0), position: i ? "static" : "fixed" }),
4203
+ o && /* @__PURE__ */ n(r, { agent: e, language: c, languages: l, onLanguageChange: d, onClose: () => s(!1), isPreview: i })
4229
4204
  ] });
4230
4205
  }
4231
- function Yn({ restUrl: e, identifier: a, fallbackAgent: t, withCredentials: o = !1, children: r, onError: i }) {
4232
- const [s, d] = y(() => t ? de(t) : null), [c, l] = y(null);
4233
- return I(() => {
4234
- t && (d(de(t)), l(null));
4235
- }, [t]), I(() => {
4206
+ function On({ restUrl: e, identifier: a, fallbackAgent: t, withCredentials: i = !1, children: r, onError: o }) {
4207
+ const [s, c] = v(() => t ? pe(t) : null), [d, l] = v(null);
4208
+ return j(() => {
4209
+ t && (c(pe(t)), l(null));
4210
+ }, [t]), j(() => {
4236
4211
  if (!a || t) return;
4237
4212
  const m = new AbortController();
4238
- return l(null), Pt({ restUrl: e, identifier: a, withCredentials: o, signal: m.signal }).then(d).catch((u) => {
4239
- m.signal.aborted || (l(u), i?.(u));
4213
+ return l(null), xt({ restUrl: e, identifier: a, withCredentials: i, signal: m.signal }).then(c).catch((u) => {
4214
+ m.signal.aborted || (l(u), o?.(u));
4240
4215
  }), () => m.abort();
4241
- }, [t, a, i, e, o]), c ? /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: c.message || "Could not load agent" }) : s ? /* @__PURE__ */ n(Le, { children: r(s) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: "Loading" });
4216
+ }, [t, a, o, e, i]), d ? /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: d.message || "Could not load agent" }) : s ? /* @__PURE__ */ n(Ae, { children: r(s) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: "Loading" });
4242
4217
  }
4243
- function Ae({ agent: e, language: a, languages: t, onLanguageChange: o, onEndSession: r, onMinimize: i, onStartText: s, onStartVoice: d, textOnly: c, messages: l, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: F, autoStartVoice: k }) {
4244
- const v = ve(e), z = { agent: e, language: a, languages: t, onLanguageChange: o, onEndSession: r, onMinimize: i, messages: l, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: F, autoStartVoice: k };
4245
- switch (v) {
4218
+ function we({ agent: e, language: a, languages: t, onLanguageChange: i, onEndSession: r, onMinimize: o, onStartText: s, onStartVoice: c, textOnly: d, messages: l, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: z, autoStartVoice: k }) {
4219
+ const y = ve(e), E = { agent: e, language: a, languages: t, onLanguageChange: i, onEndSession: r, onMinimize: o, messages: l, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: z, autoStartVoice: k };
4220
+ switch (y) {
4246
4221
  case "avatar":
4247
- return /* @__PURE__ */ n(On, { ...z });
4222
+ return /* @__PURE__ */ n(Kn, { ...E });
4248
4223
  case "voice":
4249
- return /* @__PURE__ */ n(Gn, { ...z });
4224
+ return /* @__PURE__ */ n(Bn, { ...E });
4250
4225
  case "text_and_voice":
4251
- return /* @__PURE__ */ n(Kn, { ...z, onStartText: s, onStartVoice: d, textOnly: c });
4226
+ return /* @__PURE__ */ n(Un, { ...E, onStartText: s, onStartVoice: c, textOnly: d });
4252
4227
  case "text":
4253
4228
  default:
4254
- return /* @__PURE__ */ n(Bn, { ...z });
4229
+ return /* @__PURE__ */ n(Rn, { ...E });
4255
4230
  }
4256
4231
  }
4257
- function Qn({
4232
+ function Yn({
4258
4233
  agent: e,
4259
4234
  language: a,
4260
4235
  languages: t,
4261
- startMode: o,
4236
+ startMode: i,
4262
4237
  directive: r,
4263
- open: i,
4238
+ open: o,
4264
4239
  onOpen: s,
4265
- onLanguageChange: d,
4266
- onMinimize: c,
4240
+ onLanguageChange: c,
4241
+ onMinimize: d,
4267
4242
  onStartNewSession: l,
4268
4243
  onSessionStart: m,
4269
4244
  onStartText: u,
4270
4245
  onStartVoice: h
4271
4246
  }) {
4272
- const { connectionState: F, isConnected: k, isSessionTerminated: v, creditExhausted: z, session: E, endSession: g, submitFeedback: b, interrupt: p } = me(), { messages: x } = ue(), S = _(!1), M = _(null), [P, A] = y(null), [L, C] = y(0), [V, G] = y(!1), [W, q] = y(!1), [B, N] = y(!1);
4273
- I(() => {
4274
- k && (S.current = !0);
4275
- }, [k]), I(() => {
4276
- if (P) return;
4247
+ const { connectionState: z, isConnected: k, isSessionTerminated: y, creditExhausted: E, session: T, endSession: g, submitFeedback: b, interrupt: p } = ue(), { messages: S } = de(), x = _(!1), P = _(null), [C, A] = v(null), [w, M] = v(0), [D, G] = v(!1), [Z, q] = v(!1), [B, N] = v(!1);
4248
+ j(() => {
4249
+ k && (x.current = !0);
4250
+ }, [k]), j(() => {
4251
+ if (C) return;
4277
4252
  let R = null;
4278
- v || F === "ended" ? R = M.current === "user" ? "user_ended" : "terminated" : F === "failed" ? z ? R = "credits_exhausted" : S.current ? R = "connection_lost" : R = "failed" : z && (R = "credits_exhausted"), R && A({
4279
- sessionId: E.sessionId,
4280
- endedBy: M.current ?? "agent",
4253
+ y || z === "ended" ? R = P.current === "user" ? "user_ended" : "terminated" : z === "failed" ? E ? R = "credits_exhausted" : x.current ? R = "connection_lost" : R = "failed" : E && (R = "credits_exhausted"), R && A({
4254
+ sessionId: T.sessionId,
4255
+ endedBy: P.current ?? "agent",
4281
4256
  reason: R
4282
4257
  });
4283
- }, [v, F, z, E.sessionId, P]);
4258
+ }, [y, z, E, T.sessionId, C]);
4284
4259
  const U = () => {
4285
- M.current = "user", p(), g();
4286
- }, O = P?.sessionId ?? null, Q = (R) => {
4287
- V || (C(R), O && b({ sessionId: O, rating: R, endedBy: P?.endedBy }).catch(() => {
4260
+ P.current = "user", p(), g();
4261
+ }, K = C?.sessionId ?? null, $ = (R) => {
4262
+ D || (M(R), K && b({ sessionId: K, rating: R, endedBy: C?.endedBy }).catch(() => {
4288
4263
  }), B || (N(!0), q(!0)));
4289
- }, X = async (R) => {
4290
- if (O)
4264
+ }, ae = async (R) => {
4265
+ if (K)
4291
4266
  try {
4292
- await b({ sessionId: O, feedback: R, endedBy: P?.endedBy });
4267
+ await b({ sessionId: K, feedback: R, endedBy: C?.endedBy });
4293
4268
  } catch {
4294
4269
  }
4295
4270
  G(!0), q(!1);
4296
4271
  };
4297
- if (!i)
4298
- return /* @__PURE__ */ n(sa, { agent: e, onClick: s, active: F === "connected" });
4299
- const ne = ve(e), ee = e.agentType === "cloud_avatar" || e.agentType === "desktop_avatar", $ = o === "text";
4300
- return ee ? /* @__PURE__ */ n(
4301
- Ae,
4272
+ if (!o)
4273
+ return /* @__PURE__ */ n(sa, { agent: e, onClick: s, active: z === "connected" });
4274
+ const te = ve(e), Q = e.agentType === "cloud_avatar" || e.agentType === "desktop_avatar", ie = i === "text";
4275
+ return Q ? /* @__PURE__ */ n(
4276
+ we,
4302
4277
  {
4303
4278
  agent: e,
4304
4279
  language: a,
4305
4280
  languages: t,
4306
- onLanguageChange: d,
4281
+ onLanguageChange: c,
4307
4282
  onEndSession: U,
4308
- onMinimize: c,
4283
+ onMinimize: d,
4309
4284
  onSessionStart: m,
4310
4285
  onStartText: u,
4311
4286
  onStartVoice: h,
4312
- textOnly: $
4287
+ textOnly: ie
4313
4288
  }
4314
- ) : P ? W && O ? /* @__PURE__ */ n(
4315
- Pn,
4289
+ ) : C ? Z && K ? /* @__PURE__ */ n(
4290
+ xn,
4316
4291
  {
4317
4292
  agent: e,
4318
4293
  language: a,
4319
- rating: L,
4294
+ rating: w,
4320
4295
  onBack: () => q(!1),
4321
- onMinimize: c,
4322
- onSubmit: X
4296
+ onMinimize: d,
4297
+ onSubmit: ae
4323
4298
  }
4324
4299
  ) : /* @__PURE__ */ n(
4325
4300
  Vn,
@@ -4327,156 +4302,154 @@ function Qn({
4327
4302
  agent: e,
4328
4303
  language: a,
4329
4304
  languages: t,
4330
- chatKind: ne === "avatar" ? "text" : ne,
4331
- messages: x,
4332
- onLanguageChange: d,
4333
- onMinimize: c,
4305
+ chatKind: te === "avatar" ? "text" : te,
4306
+ messages: S,
4307
+ onLanguageChange: c,
4308
+ onMinimize: d,
4334
4309
  onStartNewVoice: () => l("voice"),
4335
4310
  onStartNewText: (R) => l("text", R),
4336
- rating: L,
4337
- endedBy: P.endedBy,
4338
- sessionId: O,
4339
- ratingInteractive: !V,
4340
- showTellUsMore: B && !V,
4341
- onRate: Q,
4311
+ rating: w,
4312
+ endedBy: C.endedBy,
4313
+ sessionId: K,
4314
+ ratingInteractive: !D,
4315
+ showTellUsMore: B && !D,
4316
+ onRate: $,
4342
4317
  onTellUsMore: () => q(!0)
4343
4318
  }
4344
4319
  ) : /* @__PURE__ */ n(
4345
- Ae,
4320
+ we,
4346
4321
  {
4347
4322
  agent: e,
4348
4323
  language: a,
4349
4324
  languages: t,
4350
- onLanguageChange: d,
4325
+ onLanguageChange: c,
4351
4326
  onEndSession: U,
4352
- onMinimize: c,
4327
+ onMinimize: d,
4353
4328
  onSessionStart: m,
4354
4329
  onStartText: u,
4355
4330
  onStartVoice: h,
4356
- textOnly: $,
4331
+ textOnly: ie,
4357
4332
  initialText: r?.mode === "text" ? r.text : void 0,
4358
4333
  autoStartVoice: r?.mode === "voice"
4359
4334
  }
4360
4335
  );
4361
4336
  }
4362
- function ai({ wsUrl: e, restUrl: a, publicChatId: t, apiKey: o, agentId: r, agent: i, language: s, defaultOpen: d = !1, open: c, className: l = "", pcmOptions: m, debug: u = !1, withCredentials: h = !1, onError: F, onInitialized: k, config: v, clientTools: z, onMinimize: E, onOpen: g }) {
4363
- if ([!!t, !!o, !!r].filter(Boolean).length > 1)
4364
- throw new Error("RqmiiAgentChat: only one of publicChatId, apiKey, or agentId may be provided");
4365
- return /* @__PURE__ */ n(Yn, { restUrl: a, identifier: t || o || r, fallbackAgent: i, withCredentials: h, onError: F, children: (x) => /* @__PURE__ */ n(
4366
- Hn,
4337
+ function Xn({ wsUrl: e, restUrl: a, apiKey: t, agentId: i, agent: r, language: o, defaultOpen: s = !1, open: c, className: d = "", pcmOptions: l, debug: m = !1, withCredentials: u = !1, onError: h, onInitialized: z, config: k, clientTools: y, onMinimize: E, onOpen: T }) {
4338
+ if ([!!t, !!i].filter(Boolean).length > 1)
4339
+ throw new Error("RqmiiAgentChat: only one of apiKey, or agentId may be provided");
4340
+ return /* @__PURE__ */ n(On, { restUrl: a, identifier: t || i, fallbackAgent: r, withCredentials: u, onError: h, children: (p) => /* @__PURE__ */ n(
4341
+ Qn,
4367
4342
  {
4368
4343
  wsUrl: e,
4369
4344
  restUrl: a,
4370
- publicChatId: t,
4371
- apiKey: o,
4372
- agentId: r,
4373
- agent: x,
4374
- language: s,
4375
- defaultOpen: d,
4345
+ apiKey: t,
4346
+ agentId: i,
4347
+ agent: p,
4348
+ language: o,
4349
+ defaultOpen: s,
4376
4350
  open: c,
4377
- className: l,
4378
- pcmOptions: m,
4379
- debug: u,
4380
- withCredentials: h,
4381
- onError: F,
4382
- onInitialized: k,
4383
- config: v,
4384
- clientTools: z,
4351
+ className: d,
4352
+ pcmOptions: l,
4353
+ debug: m,
4354
+ withCredentials: u,
4355
+ onError: h,
4356
+ onInitialized: z,
4357
+ config: k,
4358
+ clientTools: y,
4385
4359
  onMinimize: E,
4386
- onOpen: g
4360
+ onOpen: T
4387
4361
  }
4388
4362
  ) });
4389
4363
  }
4390
- function Hn({ wsUrl: e, restUrl: a, publicChatId: t, apiKey: o, agentId: r, agent: i, language: s, defaultOpen: d, open: c, className: l, pcmOptions: m, debug: u, withCredentials: h, onError: F, onInitialized: k, config: v, clientTools: z, onMinimize: E, onOpen: g }) {
4391
- const [b, p] = y(d), x = c !== void 0 ? c : b, [S, M] = y(!1), [P, A] = y(s || i.defaultLanguage), [L, C] = y("idle"), [V, G] = y(0), [W, q] = y(null), [B, N] = y(!1), U = i.agentType === "cloud_avatar" || i.agentType === "desktop_avatar", O = U, Q = i.widget?.behavior, X = i.welcomeMessages?.[P] || "", ne = !x && !B && !O && !!Q?.welcome_bubble_enabled && !!X.trim(), ee = te(() => be(i.languages, i.defaultLanguage), [i.defaultLanguage, i.languages]), $ = te(() => L === "text" ? { ...v ?? {}, use_voice: !1, use_text: !0 } : v, [v, L]), R = te(
4392
- () => Mt(i, $),
4393
- [i, $]
4394
- ), K = !O && R.useVoice, Z = U ? x : S, ke = te(() => ({
4395
- ...t ? { publicChatId: t } : {},
4396
- ...o ? { apiKey: o } : {},
4397
- ...r ? { agentId: r } : {},
4364
+ function Qn({ wsUrl: e, restUrl: a, apiKey: t, agentId: i, agent: r, language: o, defaultOpen: s, open: c, className: d, pcmOptions: l, debug: m, withCredentials: u, onError: h, onInitialized: z, config: k, clientTools: y, onMinimize: E, onOpen: T }) {
4365
+ const [g, b] = v(s), p = c !== void 0 ? c : g, [S, x] = v(!1), [P, C] = v(o || r.defaultLanguage), [A, w] = v("idle"), [M, D] = v(0), [G, Z] = v(null), [q, B] = v(!1), N = r.agentType === "cloud_avatar" || r.agentType === "desktop_avatar", U = N, K = r.widget?.behavior, $ = r.welcomeMessages?.[P] || "", ae = !p && !q && !U && !!K?.welcome_bubble_enabled && !!$.trim(), te = ee(() => be(r.languages, r.defaultLanguage), [r.defaultLanguage, r.languages]), Q = ee(() => A === "text" ? { ...k ?? {}, use_voice: !1, use_text: !0 } : k, [k, A]), ie = ee(
4366
+ () => Pt(r, Q),
4367
+ [r, Q]
4368
+ ), R = !U && ie.useVoice, O = N ? p : S, H = ee(() => ({
4369
+ ...t ? { apiKey: t } : {},
4370
+ ...i ? { agentId: i } : {},
4398
4371
  language: P,
4399
- config: $
4400
- }), [r, o, t, P, $]), ce = _(null), fe = _(!1), ze = _(V), Ge = ze.current !== V;
4401
- ze.current = V, S && (!fe.current || Ge) && (ce.current = ke), fe.current = S, S || (ce.current = null);
4402
- const Ue = S && ce.current ? ce.current : ke;
4403
- I(() => {
4404
- A(s || i.defaultLanguage);
4405
- }, [i.defaultLanguage, s]);
4406
- const Se = te(() => F ? (ge) => {
4407
- C("idle"), F(ge);
4408
- } : (ge) => {
4409
- C("idle");
4410
- }, [F]), w = () => {
4411
- C("text"), M(!0);
4412
- }, ae = () => {
4413
- C("voice"), M(!0);
4414
- }, xe = () => {
4415
- c === void 0 && p(!1), E?.();
4416
- }, ha = () => {
4417
- c === void 0 && p(!0), N(!0), g?.();
4418
- }, ga = (ge, pa) => {
4419
- q(ge === "text" ? { mode: "text", text: pa ?? "" } : { mode: "voice" }), C(ge), M(!0), G((ba) => ba + 1);
4372
+ config: Q
4373
+ }), [i, t, P, Q]), ce = _(null), ke = _(!1), fe = _(M), Be = fe.current !== M;
4374
+ fe.current = M, S && (!ke.current || Be) && (ce.current = H), ke.current = S, S || (ce.current = null);
4375
+ const Ge = S && ce.current ? ce.current : H;
4376
+ j(() => {
4377
+ C(o || r.defaultLanguage);
4378
+ }, [r.defaultLanguage, o]);
4379
+ const Ue = ee(() => h ? (he) => {
4380
+ w("idle"), h(he);
4381
+ } : (he) => {
4382
+ w("idle");
4383
+ }, [h]), Ee = () => {
4384
+ w("text"), x(!0);
4385
+ }, L = () => {
4386
+ w("voice"), x(!0);
4387
+ }, X = () => {
4388
+ c === void 0 && b(!1), E?.();
4389
+ }, Se = () => {
4390
+ c === void 0 && b(!0), B(!0), T?.();
4391
+ }, ha = (he, ga) => {
4392
+ Z(he === "text" ? { mode: "text", text: ga ?? "" } : { mode: "voice" }), w(he), x(!0), D((pa) => pa + 1);
4420
4393
  };
4421
4394
  return /* @__PURE__ */ n(
4422
- va,
4395
+ fa,
4423
4396
  {
4424
4397
  wsUrl: e,
4425
4398
  restUrl: a,
4426
- session: Ue,
4427
- connect: Z,
4428
- enableAudio: K,
4429
- pcmOptions: m,
4430
- debug: u,
4431
- withCredentials: h,
4432
- onError: Se,
4433
- onInitialized: k,
4434
- clientTools: z,
4435
- children: /* @__PURE__ */ f("div", { className: j("rqmii-chat-surface", i.widget?.appearance?.position === "left" && "rqmii-position-left", l), dir: "ltr", children: [
4436
- ne && /* @__PURE__ */ n(
4437
- un,
4399
+ session: Ge,
4400
+ connect: O,
4401
+ enableAudio: R,
4402
+ pcmOptions: l,
4403
+ debug: m,
4404
+ withCredentials: u,
4405
+ onError: Ue,
4406
+ onInitialized: z,
4407
+ clientTools: y,
4408
+ children: /* @__PURE__ */ f("div", { className: V("rqmii-chat-surface", r.widget?.appearance?.position === "left" && "rqmii-position-left", d), dir: "ltr", children: [
4409
+ ae && /* @__PURE__ */ n(
4410
+ dn,
4438
4411
  {
4439
- message: X,
4440
- delaySeconds: Q?.welcome_bubble_delay_seconds ?? 3,
4441
- soundEnabled: !!Q?.welcome_bubble_sound_enabled,
4412
+ message: $,
4413
+ delaySeconds: K?.welcome_bubble_delay_seconds ?? 3,
4414
+ soundEnabled: !!K?.welcome_bubble_sound_enabled,
4442
4415
  language: P,
4443
- buttonPosition: i.widget?.appearance?.position === "left" ? "left" : "right",
4444
- onClick: () => N(!0)
4416
+ buttonPosition: r.widget?.appearance?.position === "left" ? "left" : "right",
4417
+ onClick: () => B(!0)
4445
4418
  }
4446
4419
  ),
4447
4420
  /* @__PURE__ */ n(
4448
- Qn,
4421
+ Yn,
4449
4422
  {
4450
- agent: i,
4423
+ agent: r,
4451
4424
  language: P,
4452
- languages: ee,
4453
- startMode: L,
4454
- directive: W,
4455
- open: x,
4456
- onOpen: ha,
4457
- onLanguageChange: A,
4458
- onMinimize: xe,
4459
- onStartNewSession: ga,
4460
- onSessionStart: () => M(!0),
4461
- onStartText: w,
4462
- onStartVoice: ae
4425
+ languages: te,
4426
+ startMode: A,
4427
+ directive: G,
4428
+ open: p,
4429
+ onOpen: Se,
4430
+ onLanguageChange: C,
4431
+ onMinimize: X,
4432
+ onStartNewSession: ha,
4433
+ onSessionStart: () => x(!0),
4434
+ onStartText: Ee,
4435
+ onStartVoice: L
4463
4436
  }
4464
4437
  )
4465
4438
  ] })
4466
4439
  },
4467
- V
4440
+ M
4468
4441
  );
4469
4442
  }
4470
- function ti({ agent: e, language: a, open: t = !0, className: o = "", messages: r, onSendMessage: i, onClose: s }) {
4471
- const d = te(() => de(e), [e]), [c, l] = y(t), [m, u] = y(a || d.defaultLanguage), h = te(() => be(d.languages, d.defaultLanguage), [d.defaultLanguage, d.languages]);
4472
- return I(() => {
4443
+ function ei({ agent: e, language: a, open: t = !0, className: i = "", messages: r, onSendMessage: o, onClose: s }) {
4444
+ const c = ee(() => pe(e), [e]), [d, l] = v(t), [m, u] = v(a || c.defaultLanguage), h = ee(() => be(c.languages, c.defaultLanguage), [c.defaultLanguage, c.languages]);
4445
+ return j(() => {
4473
4446
  a && u(a);
4474
- }, [a]), I(() => {
4447
+ }, [a]), j(() => {
4475
4448
  l(t);
4476
- }, [t]), /* @__PURE__ */ n(fa, { wsUrl: "", restUrl: "", enableAudio: !1, children: /* @__PURE__ */ n("div", { className: j("rqmii-chat-surface is-preview", o), dir: "ltr", children: c ? /* @__PURE__ */ n(
4477
- Ae,
4449
+ }, [t]), /* @__PURE__ */ n(ka, { wsUrl: "", restUrl: "", enableAudio: !1, children: /* @__PURE__ */ n("div", { className: V("rqmii-chat-surface is-preview", i), dir: "ltr", children: d ? /* @__PURE__ */ n(
4450
+ we,
4478
4451
  {
4479
- agent: d,
4452
+ agent: c,
4480
4453
  language: m,
4481
4454
  languages: h,
4482
4455
  onLanguageChange: u,
@@ -4487,40 +4460,39 @@ function ti({ agent: e, language: a, open: t = !0, className: o = "", messages:
4487
4460
  l(!1), s?.();
4488
4461
  },
4489
4462
  messages: r,
4490
- onSendMessage: i,
4463
+ onSendMessage: o,
4491
4464
  isPreview: !0
4492
4465
  }
4493
4466
  ) : null }) });
4494
4467
  }
4495
4468
  export {
4496
- In as ConsentDialog,
4469
+ jn as ConsentDialog,
4497
4470
  Vn as EndedChatPanel,
4498
- oi as EpicPixelStreamingPlayer,
4499
- Pn as FeedbackPanel,
4500
- Ze as RQMII_BUILTIN_FACES,
4501
- Ce as RQMII_CHAT_LANGUAGES,
4471
+ ni as EpicPixelStreamingPlayer,
4472
+ xn as FeedbackPanel,
4473
+ $e as RQMII_BUILTIN_FACES,
4474
+ Me as RQMII_CHAT_LANGUAGES,
4502
4475
  Qe as RQMII_CHAT_LANGUAGE_VALUES,
4503
- xn as RatingBar,
4476
+ Sn as RatingBar,
4504
4477
  J as RqmiiAgentAvatar,
4505
- ai as RqmiiAgentChat,
4506
- ti as RqmiiAgentChatPreview,
4507
- va as RqmiiAgentRoom,
4508
- On as RqmiiAvatarChatBox,
4478
+ Xn as RqmiiAgentChat,
4479
+ ei as RqmiiAgentChatPreview,
4480
+ fa as RqmiiAgentRoom,
4481
+ Kn as RqmiiAvatarChatBox,
4509
4482
  le as RqmiiChatFooter,
4510
4483
  sa as RqmiiChatOpenButton,
4511
- ei as RqmiiChatSurface,
4512
- ri as RqmiiCloudAvatarPlayer,
4513
- Kn as RqmiiTextAndVoiceChatBox,
4514
- Bn as RqmiiTextChatBox,
4515
- Gn as RqmiiVoiceChatBox,
4516
- Xn as fetchAgentConfig,
4517
- Pt as fetchAgentCustomization,
4518
- Jn as fetchPublicAgent,
4519
- an as getBuiltinFace,
4484
+ Jn as RqmiiChatSurface,
4485
+ ii as RqmiiCloudAvatarPlayer,
4486
+ Un as RqmiiTextAndVoiceChatBox,
4487
+ Rn as RqmiiTextChatBox,
4488
+ Bn as RqmiiVoiceChatBox,
4489
+ $n as fetchAgentConfig,
4490
+ xt as fetchAgentCustomization,
4491
+ en as getBuiltinFace,
4520
4492
  He as getChatLanguage,
4521
- T as getChatText,
4493
+ F as getChatText,
4522
4494
  be as normalizeChatLanguages,
4523
- de as normalizePublicAgent,
4495
+ pe as normalizePublicAgent,
4524
4496
  ve as resolveChatKind
4525
4497
  };
4526
4498
  //# sourceMappingURL=ui.js.map