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