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