@helpai/elements 0.52.6 → 0.54.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/configurator.mjs +2 -2
- package/elements-web-component.esm.js +29 -29
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +28 -28
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +28 -28
- package/elements.esm.js.map +4 -4
- package/elements.js +27 -27
- package/elements.js.map +4 -4
- package/index.d.ts +4 -4
- package/index.mjs +326 -268
- package/package.json +1 -1
- package/schema.d.ts +1 -1
- package/schema.json +4 -4
- package/schema.mjs +2 -2
- package/web-component.mjs +326 -268
package/web-component.mjs
CHANGED
|
@@ -112,7 +112,7 @@ var STRINGS_EN = {
|
|
|
112
112
|
newsLoading: "Loading news\u2026",
|
|
113
113
|
newsBack: "Back to news",
|
|
114
114
|
newsPublishedAt: "Published {date}",
|
|
115
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
115
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
116
116
|
formSubmit: "Submit",
|
|
117
117
|
formSkip: "Maybe later",
|
|
118
118
|
formSubmitted: "Completed",
|
|
@@ -132,26 +132,15 @@ var STRINGS_EN = {
|
|
|
132
132
|
formChooseAtMost: "Choose at most {max}",
|
|
133
133
|
formOther: "Other",
|
|
134
134
|
formOtherPlaceholder: "Type your answer\u2026",
|
|
135
|
-
inputRequired: "
|
|
136
|
-
inputBadge: "
|
|
135
|
+
inputRequired: "Questions for you",
|
|
136
|
+
inputBadge: "Questions",
|
|
137
137
|
inputAnswered: "Answered",
|
|
138
138
|
inputSkipped: "Skipped",
|
|
139
|
-
|
|
140
|
-
inputYourAnswer: "Your answer",
|
|
141
|
-
inputSubmit: "Submit answer",
|
|
139
|
+
inputSubmit: "Submit answers",
|
|
142
140
|
inputSubmitHint: "Enter to send \xB7 Shift+Enter = new line",
|
|
143
|
-
inputAnswerPlaceholder: "Type your answer\u2026",
|
|
144
141
|
inputSkip: "Skip",
|
|
145
142
|
confirmYes: "Yes",
|
|
146
143
|
confirmNo: "No",
|
|
147
|
-
inputConfirmHint: "Choose yes or no.",
|
|
148
|
-
inputOptionalNote: "Optional note",
|
|
149
|
-
inputOptionalNotePlaceholder: "Optional comment\u2026",
|
|
150
|
-
inputSubmitted: "Answer submitted",
|
|
151
|
-
respFreeText: "Free Text",
|
|
152
|
-
respSingleChoice: "Single Choice",
|
|
153
|
-
respMultiChoice: "Multiple Choice",
|
|
154
|
-
respConfirmation: "Confirmation",
|
|
155
144
|
approvalRequired: "Approval required",
|
|
156
145
|
approve: "Approve",
|
|
157
146
|
reject: "Reject",
|
|
@@ -256,7 +245,7 @@ var STRINGS_FR = {
|
|
|
256
245
|
newsLoading: "Chargement des actualit\xE9s\u2026",
|
|
257
246
|
newsBack: "Retour aux actualit\xE9s",
|
|
258
247
|
newsPublishedAt: "Publi\xE9 le {date}",
|
|
259
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
248
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
260
249
|
formSubmit: "Envoyer",
|
|
261
250
|
formSkip: "Plus tard",
|
|
262
251
|
formSubmitted: "Termin\xE9",
|
|
@@ -276,26 +265,15 @@ var STRINGS_FR = {
|
|
|
276
265
|
formChooseAtMost: "Choisissez au plus {max}",
|
|
277
266
|
formOther: "Autre",
|
|
278
267
|
formOtherPlaceholder: "Saisissez votre r\xE9ponse\u2026",
|
|
279
|
-
inputRequired: "
|
|
280
|
-
inputBadge: "
|
|
268
|
+
inputRequired: "Questions pour vous",
|
|
269
|
+
inputBadge: "Questions",
|
|
281
270
|
inputAnswered: "R\xE9pondu",
|
|
282
271
|
inputSkipped: "Ignor\xE9",
|
|
283
|
-
|
|
284
|
-
inputYourAnswer: "Votre r\xE9ponse",
|
|
285
|
-
inputSubmit: "Envoyer la r\xE9ponse",
|
|
272
|
+
inputSubmit: "Envoyer les r\xE9ponses",
|
|
286
273
|
inputSubmitHint: "Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",
|
|
287
|
-
inputAnswerPlaceholder: "Saisissez votre r\xE9ponse\u2026",
|
|
288
274
|
inputSkip: "Ignorer",
|
|
289
275
|
confirmYes: "Oui",
|
|
290
276
|
confirmNo: "Non",
|
|
291
|
-
inputConfirmHint: "Choisissez oui ou non.",
|
|
292
|
-
inputOptionalNote: "Note facultative",
|
|
293
|
-
inputOptionalNotePlaceholder: "Commentaire facultatif\u2026",
|
|
294
|
-
inputSubmitted: "R\xE9ponse envoy\xE9e",
|
|
295
|
-
respFreeText: "Texte libre",
|
|
296
|
-
respSingleChoice: "Choix unique",
|
|
297
|
-
respMultiChoice: "Choix multiple",
|
|
298
|
-
respConfirmation: "Confirmation",
|
|
299
277
|
approvalRequired: "Approbation requise",
|
|
300
278
|
approve: "Approuver",
|
|
301
279
|
reject: "Refuser",
|
|
@@ -400,7 +378,7 @@ var STRINGS_AR = {
|
|
|
400
378
|
newsLoading: "\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",
|
|
401
379
|
newsBack: "\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",
|
|
402
380
|
newsPublishedAt: "\u0646\u064F\u0634\u0631 \u0641\u064A {date}",
|
|
403
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
381
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
404
382
|
formSubmit: "\u0625\u0631\u0633\u0627\u0644",
|
|
405
383
|
formSkip: "\u0644\u0627\u062D\u0642\u064B\u0627",
|
|
406
384
|
formSubmitted: "\u062A\u0645",
|
|
@@ -420,26 +398,15 @@ var STRINGS_AR = {
|
|
|
420
398
|
formChooseAtMost: "\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",
|
|
421
399
|
formOther: "\u0623\u062E\u0631\u0649",
|
|
422
400
|
formOtherPlaceholder: "\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",
|
|
423
|
-
inputRequired: "\
|
|
424
|
-
inputBadge: "\
|
|
401
|
+
inputRequired: "\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",
|
|
402
|
+
inputBadge: "\u0623\u0633\u0626\u0644\u0629",
|
|
425
403
|
inputAnswered: "\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
426
404
|
inputSkipped: "\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",
|
|
427
|
-
|
|
428
|
-
inputYourAnswer: "\u0625\u062C\u0627\u0628\u062A\u0643",
|
|
429
|
-
inputSubmit: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
405
|
+
inputSubmit: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",
|
|
430
406
|
inputSubmitHint: "Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",
|
|
431
|
-
inputAnswerPlaceholder: "\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",
|
|
432
407
|
inputSkip: "\u062A\u062E\u0637\u064D\u0651",
|
|
433
408
|
confirmYes: "\u0646\u0639\u0645",
|
|
434
409
|
confirmNo: "\u0644\u0627",
|
|
435
|
-
inputConfirmHint: "\u0627\u062E\u062A\u0631 \u0646\u0639\u0645 \u0623\u0648 \u0644\u0627.",
|
|
436
|
-
inputOptionalNote: "\u0645\u0644\u0627\u062D\u0638\u0629 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u0629",
|
|
437
|
-
inputOptionalNotePlaceholder: "\u062A\u0639\u0644\u064A\u0642 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u2026",
|
|
438
|
-
inputSubmitted: "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
439
|
-
respFreeText: "\u0646\u0635 \u062D\u0631",
|
|
440
|
-
respSingleChoice: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u0627\u062D\u062F",
|
|
441
|
-
respMultiChoice: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0645\u062A\u0639\u062F\u062F",
|
|
442
|
-
respConfirmation: "\u062A\u0623\u0643\u064A\u062F",
|
|
443
410
|
approvalRequired: "\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",
|
|
444
411
|
approve: "\u0645\u0648\u0627\u0641\u0642\u0629",
|
|
445
412
|
reject: "\u0631\u0641\u0636",
|
|
@@ -544,7 +511,7 @@ var STRINGS_ES = {
|
|
|
544
511
|
newsLoading: "Cargando novedades\u2026",
|
|
545
512
|
newsBack: "Volver a novedades",
|
|
546
513
|
newsPublishedAt: "Publicado el {date}",
|
|
547
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
514
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
548
515
|
formSubmit: "Enviar",
|
|
549
516
|
formSkip: "Quiz\xE1 m\xE1s tarde",
|
|
550
517
|
formSubmitted: "Completado",
|
|
@@ -564,26 +531,15 @@ var STRINGS_ES = {
|
|
|
564
531
|
formChooseAtMost: "Elige como m\xE1ximo {max}",
|
|
565
532
|
formOther: "Otro",
|
|
566
533
|
formOtherPlaceholder: "Escribe tu respuesta\u2026",
|
|
567
|
-
inputRequired: "
|
|
568
|
-
inputBadge: "
|
|
534
|
+
inputRequired: "Preguntas para ti",
|
|
535
|
+
inputBadge: "Preguntas",
|
|
569
536
|
inputAnswered: "Respondido",
|
|
570
537
|
inputSkipped: "Omitido",
|
|
571
|
-
|
|
572
|
-
inputYourAnswer: "Tu respuesta",
|
|
573
|
-
inputSubmit: "Enviar respuesta",
|
|
538
|
+
inputSubmit: "Enviar respuestas",
|
|
574
539
|
inputSubmitHint: "Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",
|
|
575
|
-
inputAnswerPlaceholder: "Escribe tu respuesta\u2026",
|
|
576
540
|
inputSkip: "Omitir",
|
|
577
541
|
confirmYes: "S\xED",
|
|
578
542
|
confirmNo: "No",
|
|
579
|
-
inputConfirmHint: "Elige s\xED o no.",
|
|
580
|
-
inputOptionalNote: "Nota opcional",
|
|
581
|
-
inputOptionalNotePlaceholder: "Comentario opcional\u2026",
|
|
582
|
-
inputSubmitted: "Respuesta enviada",
|
|
583
|
-
respFreeText: "Texto libre",
|
|
584
|
-
respSingleChoice: "Opci\xF3n \xFAnica",
|
|
585
|
-
respMultiChoice: "Opci\xF3n m\xFAltiple",
|
|
586
|
-
respConfirmation: "Confirmaci\xF3n",
|
|
587
543
|
approvalRequired: "Aprobaci\xF3n requerida",
|
|
588
544
|
approve: "Aprobar",
|
|
589
545
|
reject: "Rechazar",
|
|
@@ -605,11 +561,145 @@ var STRINGS_ES = {
|
|
|
605
561
|
statusError: "Error",
|
|
606
562
|
statusSuperseded: "Omitido"
|
|
607
563
|
};
|
|
564
|
+
var STRINGS_HE = {
|
|
565
|
+
attach: "\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",
|
|
566
|
+
attachmentMimeRejected: "\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",
|
|
567
|
+
attachmentTooLarge: "\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",
|
|
568
|
+
attachmentTooMany: "\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",
|
|
569
|
+
conversationClosed: "\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05E0\u05E1\u05D2\u05E8\u05D4",
|
|
570
|
+
conversationLoading: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D9\u05D7\u05D4\u2026",
|
|
571
|
+
close: "\u05E1\u05D2\u05D9\u05E8\u05D4",
|
|
572
|
+
collapse: "\u05DB\u05D9\u05D5\u05D5\u05E5",
|
|
573
|
+
collapseSidebar: "\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",
|
|
574
|
+
composerPlaceholder: "\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",
|
|
575
|
+
dateLastWeek: "7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",
|
|
576
|
+
dateOlder: "\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",
|
|
577
|
+
dateToday: "\u05D4\u05D9\u05D5\u05DD",
|
|
578
|
+
dateYesterday: "\u05D0\u05EA\u05DE\u05D5\u05DC",
|
|
579
|
+
dropZone: "\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",
|
|
580
|
+
errorGeneric: "\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",
|
|
581
|
+
errorRateLimited: "\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",
|
|
582
|
+
errorRetry: "\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",
|
|
583
|
+
expand: "\u05D4\u05E8\u05D7\u05D1\u05D4",
|
|
584
|
+
expandSidebar: "\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",
|
|
585
|
+
exitFullscreen: "\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",
|
|
586
|
+
fullscreen: "\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",
|
|
587
|
+
history: "\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",
|
|
588
|
+
historyBack: "\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E9\u05D9\u05D7\u05D4",
|
|
589
|
+
historyEmpty: "\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",
|
|
590
|
+
historyContinue: "\u05D4\u05DE\u05E9\u05DA \u05E9\u05D9\u05D7\u05D4",
|
|
591
|
+
historyLoading: "\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E9\u05D9\u05D7\u05D5\u05EA \u05E9\u05DC\u05DA\u2026",
|
|
592
|
+
historyTitle: "\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA",
|
|
593
|
+
language: "\u05E9\u05E4\u05D4",
|
|
594
|
+
launcherOpen: "\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",
|
|
595
|
+
launcherLabel: "\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",
|
|
596
|
+
micStart: "\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",
|
|
597
|
+
micStop: "\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",
|
|
598
|
+
micUnsupported: "\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",
|
|
599
|
+
moreActions: "\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",
|
|
600
|
+
newConversation: "\u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",
|
|
601
|
+
panelTitle: "\u05E9\u05D9\u05D7\u05D4",
|
|
602
|
+
resizeHandle: "\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",
|
|
603
|
+
scrollToBottom: "\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",
|
|
604
|
+
send: "\u05E9\u05DC\u05D9\u05D7\u05D4",
|
|
605
|
+
soundOff: "\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",
|
|
606
|
+
soundOn: "\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",
|
|
607
|
+
startNewConversation: "\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",
|
|
608
|
+
stop: "\u05E2\u05E6\u05D9\u05E8\u05D4",
|
|
609
|
+
theme: "\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",
|
|
610
|
+
themeAuto: "\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",
|
|
611
|
+
themeDark: "\u05DB\u05D4\u05D4",
|
|
612
|
+
themeLight: "\u05D1\u05D4\u05D9\u05E8",
|
|
613
|
+
textSize: "\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",
|
|
614
|
+
textSizeSmall: "\u05E7\u05D8\u05DF",
|
|
615
|
+
textSizeNormal: "\u05E8\u05D2\u05D9\u05DC",
|
|
616
|
+
textSizeLarge: "\u05D2\u05D3\u05D5\u05DC",
|
|
617
|
+
loading: "\u05D8\u05D5\u05E2\u05DF\u2026",
|
|
618
|
+
thinking: "\u05D7\u05D5\u05E9\u05D1\u2026",
|
|
619
|
+
thoughts: "\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",
|
|
620
|
+
usedTool: "\u05DB\u05DC\u05D9 \u05D1\u05E9\u05D9\u05DE\u05D5\u05E9",
|
|
621
|
+
toolResult: "\u05EA\u05D5\u05E6\u05D0\u05D4",
|
|
622
|
+
sources: "\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",
|
|
623
|
+
// ── Messenger modules ──────────────────────────────────────────
|
|
624
|
+
tabHome: "\u05D1\u05D9\u05EA",
|
|
625
|
+
tabConversations: "\u05E9\u05D9\u05D7\u05D5\u05EA",
|
|
626
|
+
tabHelp: "\u05E2\u05D6\u05E8\u05D4",
|
|
627
|
+
tabNews: "\u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
628
|
+
modulesEmpty: "\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",
|
|
629
|
+
moduleBack: "\u05D7\u05D6\u05E8\u05D4",
|
|
630
|
+
contentLoading: "\u05D8\u05D5\u05E2\u05DF\u2026",
|
|
631
|
+
homeGreeting: "\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",
|
|
632
|
+
homeGreetingNamed: "\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",
|
|
633
|
+
homeGreetingLead: "\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",
|
|
634
|
+
homeSearchPlaceholder: "\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",
|
|
635
|
+
homeContentTitle: "\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",
|
|
636
|
+
homeStatus: "\u05E1\u05D8\u05D8\u05D5\u05E1",
|
|
637
|
+
helpTitle: "\u05E2\u05D6\u05E8\u05D4",
|
|
638
|
+
helpSearchPlaceholder: "\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",
|
|
639
|
+
helpEmpty: "\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",
|
|
640
|
+
helpLoading: "\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",
|
|
641
|
+
helpSearchEmpty: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",
|
|
642
|
+
newsTitle: "\u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
643
|
+
newsEmpty: "\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
644
|
+
newsLoading: "\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",
|
|
645
|
+
newsBack: "\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
646
|
+
newsPublishedAt: "\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",
|
|
647
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
648
|
+
formSubmit: "\u05E9\u05DC\u05D9\u05D7\u05D4",
|
|
649
|
+
formSkip: "\u05D0\u05D7\u05E8 \u05DB\u05DA",
|
|
650
|
+
formSubmitted: "\u05E0\u05E9\u05DC\u05D7",
|
|
651
|
+
formSkipped: "\u05D3\u05D5\u05DC\u05D2",
|
|
652
|
+
formFillOut: "\u05DE\u05D9\u05DC\u05D5\u05D9",
|
|
653
|
+
formRequired: "\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",
|
|
654
|
+
formInvalidEmail: "\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",
|
|
655
|
+
formInvalidTel: "\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",
|
|
656
|
+
formInvalidUrl: "\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",
|
|
657
|
+
formInvalidNumber: "\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",
|
|
658
|
+
formTooShort: "\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",
|
|
659
|
+
formTooLong: "\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",
|
|
660
|
+
formNumberTooSmall: "\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",
|
|
661
|
+
formNumberTooLarge: "\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",
|
|
662
|
+
formPatternMismatch: "\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",
|
|
663
|
+
formChooseAtLeast: "\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",
|
|
664
|
+
formChooseAtMost: "\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",
|
|
665
|
+
formOther: "\u05D0\u05D7\u05E8",
|
|
666
|
+
formOtherPlaceholder: "\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",
|
|
667
|
+
inputRequired: "\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",
|
|
668
|
+
inputBadge: "\u05E9\u05D0\u05DC\u05D5\u05EA",
|
|
669
|
+
inputAnswered: "\u05E0\u05E2\u05E0\u05D4",
|
|
670
|
+
inputSkipped: "\u05D3\u05D5\u05DC\u05D2",
|
|
671
|
+
inputSubmit: "\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",
|
|
672
|
+
inputSubmitHint: "Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",
|
|
673
|
+
inputSkip: "\u05D3\u05D9\u05DC\u05D5\u05D2",
|
|
674
|
+
confirmYes: "\u05DB\u05DF",
|
|
675
|
+
confirmNo: "\u05DC\u05D0",
|
|
676
|
+
approvalRequired: "\u05E0\u05D3\u05E8\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8",
|
|
677
|
+
approve: "\u05D0\u05D9\u05E9\u05D5\u05E8",
|
|
678
|
+
reject: "\u05D3\u05D7\u05D9\u05D9\u05D4",
|
|
679
|
+
approved: "\u05D0\u05D5\u05E9\u05E8",
|
|
680
|
+
rejected: "\u05E0\u05D3\u05D7\u05D4",
|
|
681
|
+
approvalReason: "\u05D4\u05D5\u05E1\u05E3 \u05E1\u05D9\u05D1\u05D4 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)",
|
|
682
|
+
approvalPrompt: "\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",
|
|
683
|
+
approvalBody: "\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",
|
|
684
|
+
approvalYourResponse: "\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",
|
|
685
|
+
approvalEditHint: "\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",
|
|
686
|
+
approvalSubmitting: "\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",
|
|
687
|
+
edit: "\u05E2\u05E8\u05D9\u05DB\u05D4",
|
|
688
|
+
toolParameters: "\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",
|
|
689
|
+
statusAwaiting: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",
|
|
690
|
+
statusResponded: "\u05E0\u05E2\u05E0\u05D4",
|
|
691
|
+
statusRunning: "\u05E4\u05D5\u05E2\u05DC",
|
|
692
|
+
statusCompleted: "\u05D4\u05D5\u05E9\u05DC\u05DD",
|
|
693
|
+
statusDenied: "\u05E0\u05D3\u05D7\u05D4",
|
|
694
|
+
statusError: "\u05E9\u05D2\u05D9\u05D0\u05D4",
|
|
695
|
+
statusSuperseded: "\u05D3\u05D5\u05DC\u05D2"
|
|
696
|
+
};
|
|
608
697
|
var BUILTIN_STRINGS = {
|
|
609
698
|
en: STRINGS_EN,
|
|
610
699
|
fr: STRINGS_FR,
|
|
611
700
|
ar: STRINGS_AR,
|
|
612
|
-
es: STRINGS_ES
|
|
701
|
+
es: STRINGS_ES,
|
|
702
|
+
he: STRINGS_HE
|
|
613
703
|
};
|
|
614
704
|
function resolveStrings(locale, override) {
|
|
615
705
|
const tag = primaryTag(locale);
|
|
@@ -1705,7 +1795,7 @@ function applyHostAttributes(host, resolved) {
|
|
|
1705
1795
|
import { h, render as renderPreact } from "preact";
|
|
1706
1796
|
|
|
1707
1797
|
// src/ui/app.tsx
|
|
1708
|
-
import { useCallback as useCallback6, useEffect as useEffect16, useLayoutEffect as useLayoutEffect3, useMemo as useMemo3, useRef as useRef9, useState as
|
|
1798
|
+
import { useCallback as useCallback6, useEffect as useEffect16, useLayoutEffect as useLayoutEffect3, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "preact/hooks";
|
|
1709
1799
|
import { batch, useComputed as useComputed8, useSignal } from "@preact/signals";
|
|
1710
1800
|
|
|
1711
1801
|
// src/core/handshake-shape.ts
|
|
@@ -1790,7 +1880,7 @@ function createAuth(opts) {
|
|
|
1790
1880
|
}
|
|
1791
1881
|
|
|
1792
1882
|
// src/core/version.ts
|
|
1793
|
-
var ELEMENTS_VERSION = true ? "0.
|
|
1883
|
+
var ELEMENTS_VERSION = true ? "0.54.0" : "0.0.0-dev";
|
|
1794
1884
|
var ELEMENTS_VERSION_PARAM = "_ev";
|
|
1795
1885
|
|
|
1796
1886
|
// src/stream/types.ts
|
|
@@ -3633,7 +3723,7 @@ var TID = {
|
|
|
3633
3723
|
helpArticle: `${p2}-help-article`,
|
|
3634
3724
|
/** News list item — suffix `-{id}`. */
|
|
3635
3725
|
newsItem: `${p2}-news-item`,
|
|
3636
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
3726
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ─────
|
|
3637
3727
|
/** Form gate root — a timeline row that locks the chat while open. */
|
|
3638
3728
|
formGate: `${p2}-form-gate`,
|
|
3639
3729
|
/** "Form submitted / skipped" marker row (wire-reconstructed on resume). */
|
|
@@ -3650,11 +3740,11 @@ var TID = {
|
|
|
3650
3740
|
formSkip: `${p2}-form-skip`,
|
|
3651
3741
|
/** A single form field control — suffix `-{name}` at the JSX site. */
|
|
3652
3742
|
formField: `${p2}-form-field`,
|
|
3653
|
-
/** Ask-
|
|
3654
|
-
|
|
3655
|
-
/** Ask-
|
|
3743
|
+
/** Ask-questions tool root (inline form in a message bubble). */
|
|
3744
|
+
toolAskQuestions: `${p2}-tool-ask-questions`,
|
|
3745
|
+
/** Ask-questions submit button. */
|
|
3656
3746
|
toolInputSubmit: `${p2}-tool-input-submit`,
|
|
3657
|
-
/** Ask-
|
|
3747
|
+
/** Ask-questions skip/cancel button. */
|
|
3658
3748
|
toolInputSkip: `${p2}-tool-input-skip`,
|
|
3659
3749
|
/** Tool-approval root (approve/reject prompt). */
|
|
3660
3750
|
toolApproval: `${p2}-tool-approval`,
|
|
@@ -3861,7 +3951,7 @@ var KEEP_VISIBLE = 56;
|
|
|
3861
3951
|
function useDragMove(panelEl, enabled) {
|
|
3862
3952
|
useEffect3(() => {
|
|
3863
3953
|
if (!enabled || !panelEl) return;
|
|
3864
|
-
const
|
|
3954
|
+
const num = (v) => Number.parseFloat(v) || 0;
|
|
3865
3955
|
const clamp = (v, max) => Math.min(max, Math.max(-max, v));
|
|
3866
3956
|
let drag = null;
|
|
3867
3957
|
const onDown = (e) => {
|
|
@@ -3872,8 +3962,8 @@ function useDragMove(panelEl, enabled) {
|
|
|
3872
3962
|
id: e.pointerId,
|
|
3873
3963
|
x: e.clientX,
|
|
3874
3964
|
y: e.clientY,
|
|
3875
|
-
dx:
|
|
3876
|
-
dy:
|
|
3965
|
+
dx: num(panelEl.style.getPropertyValue(`--${p4}-modal-dx`)),
|
|
3966
|
+
dy: num(panelEl.style.getPropertyValue(`--${p4}-modal-dy`)),
|
|
3877
3967
|
// Centred origin: |offset| ≤ (viewport + panel)/2 − keepVisible keeps a
|
|
3878
3968
|
// strip of the dialog reachable so it can never be lost off-screen.
|
|
3879
3969
|
maxX: (window.innerWidth + rect.width) / 2 - KEEP_VISIBLE,
|
|
@@ -4806,7 +4896,7 @@ function HeaderActions({ panelProps, variant }) {
|
|
|
4806
4896
|
}
|
|
4807
4897
|
|
|
4808
4898
|
// src/ui/message-list.tsx
|
|
4809
|
-
import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as
|
|
4899
|
+
import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState6 } from "preact/hooks";
|
|
4810
4900
|
import { useComputed as useComputed6 } from "@preact/signals";
|
|
4811
4901
|
|
|
4812
4902
|
// src/ui/form/dynamic-form.tsx
|
|
@@ -5206,10 +5296,10 @@ function FormDoneMarker({
|
|
|
5206
5296
|
import { useComputed as useComputed5 } from "@preact/signals";
|
|
5207
5297
|
|
|
5208
5298
|
// src/stream/constants.ts
|
|
5209
|
-
function
|
|
5299
|
+
function isAskUserQuestionsTool(toolName2) {
|
|
5210
5300
|
if (!toolName2) return false;
|
|
5211
5301
|
const name = toolName2.startsWith("tool:") ? toolName2.slice(5) : toolName2;
|
|
5212
|
-
return name === "ask-user-
|
|
5302
|
+
return name === "ask-user-questions" || name === "ask_user_questions";
|
|
5213
5303
|
}
|
|
5214
5304
|
|
|
5215
5305
|
// src/ui/markdown.tsx
|
|
@@ -5476,107 +5566,103 @@ function ToolApproval({ part, strings, active, superseded = false, onDecision, o
|
|
|
5476
5566
|
] });
|
|
5477
5567
|
}
|
|
5478
5568
|
|
|
5479
|
-
// src/ui/tool-ask-
|
|
5569
|
+
// src/ui/tool-ask-questions.tsx
|
|
5480
5570
|
import { useComputed as useComputed3 } from "@preact/signals";
|
|
5481
|
-
import { useState as useState6 } from "preact/hooks";
|
|
5482
5571
|
|
|
5483
5572
|
// src/ui/form/field.ts
|
|
5484
|
-
|
|
5573
|
+
var QUESTION_TYPES = /* @__PURE__ */ new Set([
|
|
5574
|
+
"text",
|
|
5575
|
+
"email",
|
|
5576
|
+
"phone",
|
|
5577
|
+
"number",
|
|
5578
|
+
"date",
|
|
5579
|
+
"single-select",
|
|
5580
|
+
"multi-select",
|
|
5581
|
+
"boolean"
|
|
5582
|
+
]);
|
|
5583
|
+
function parseAskUserQuestions(input) {
|
|
5485
5584
|
const raw = input && typeof input === "object" ? input : {};
|
|
5486
|
-
const
|
|
5585
|
+
const rawQuestions = Array.isArray(raw.questions) ? raw.questions : [];
|
|
5586
|
+
const questions = rawQuestions.map(parseQuestion).filter((q) => q !== null);
|
|
5587
|
+
return { intro: str(raw.intro), questions };
|
|
5588
|
+
}
|
|
5589
|
+
function parseQuestion(value, index) {
|
|
5590
|
+
if (!value || typeof value !== "object") return null;
|
|
5591
|
+
const raw = value;
|
|
5592
|
+
const type = QUESTION_TYPES.has(raw.type) ? raw.type : "text";
|
|
5487
5593
|
return {
|
|
5488
|
-
|
|
5594
|
+
key: str(raw.key) ?? `q${index + 1}`,
|
|
5489
5595
|
question: str(raw.question) ?? "Please provide the missing information.",
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
allowOther: typeof raw.allowOther === "boolean" ? raw.allowOther : void 0,
|
|
5495
|
-
required: typeof raw.required === "boolean" ? raw.required : true,
|
|
5496
|
-
defaultValues: Array.isArray(raw.defaultValues) ? raw.defaultValues.filter((v) => typeof v === "string") : void 0,
|
|
5497
|
-
minSelections: num(raw.minSelections),
|
|
5498
|
-
maxSelections: num(raw.maxSelections),
|
|
5499
|
-
validationHint: str(raw.validationHint)
|
|
5596
|
+
type,
|
|
5597
|
+
options: Array.isArray(raw.options) ? raw.options.filter((o) => typeof o === "string" && o.trim().length > 0) : void 0,
|
|
5598
|
+
required: typeof raw.required === "boolean" ? raw.required : void 0,
|
|
5599
|
+
helpText: str(raw.helpText)
|
|
5500
5600
|
};
|
|
5501
5601
|
}
|
|
5502
|
-
function
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5602
|
+
function fieldTypeFor(type) {
|
|
5603
|
+
switch (type) {
|
|
5604
|
+
case "text":
|
|
5605
|
+
return "textarea";
|
|
5606
|
+
case "phone":
|
|
5607
|
+
return "tel";
|
|
5608
|
+
case "single-select":
|
|
5609
|
+
case "boolean":
|
|
5610
|
+
return "radio";
|
|
5611
|
+
case "multi-select":
|
|
5612
|
+
return "multiselect";
|
|
5613
|
+
default:
|
|
5614
|
+
return type;
|
|
5615
|
+
}
|
|
5616
|
+
}
|
|
5617
|
+
function askQuestionsToFields(req, yesLabel, noLabel) {
|
|
5618
|
+
return req.questions.map((q) => {
|
|
5619
|
+
const type = fieldTypeFor(q.type);
|
|
5620
|
+
const options = q.type === "boolean" ? [
|
|
5621
|
+
{ value: "yes", label: yesLabel },
|
|
5622
|
+
{ value: "no", label: noLabel }
|
|
5623
|
+
] : (q.options ?? []).map((o) => ({ value: o, label: o }));
|
|
5624
|
+
return {
|
|
5625
|
+
name: q.key,
|
|
5626
|
+
label: q.question,
|
|
5513
5627
|
type,
|
|
5514
|
-
|
|
5515
|
-
required: req.required ?? true,
|
|
5516
|
-
defaultValue,
|
|
5628
|
+
required: q.required ?? false,
|
|
5517
5629
|
options: options.length > 0 ? options : void 0,
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
}
|
|
5522
|
-
];
|
|
5523
|
-
}
|
|
5524
|
-
function normalizeChoice(c) {
|
|
5525
|
-
if (typeof c === "string") return c ? { value: c, label: c } : null;
|
|
5526
|
-
if (c && typeof c.value === "string" && c.value)
|
|
5527
|
-
return { value: c.value, label: c.label ?? c.value, description: c.description };
|
|
5528
|
-
return null;
|
|
5630
|
+
validationHint: q.helpText
|
|
5631
|
+
};
|
|
5632
|
+
});
|
|
5529
5633
|
}
|
|
5530
5634
|
function str(v) {
|
|
5531
5635
|
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
5532
5636
|
}
|
|
5533
|
-
function num(v) {
|
|
5534
|
-
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
5535
|
-
}
|
|
5536
5637
|
|
|
5537
|
-
// src/ui/tool-ask-
|
|
5638
|
+
// src/ui/tool-ask-questions.tsx
|
|
5538
5639
|
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
|
|
5539
5640
|
var p15 = BRAND.cssPrefix;
|
|
5540
|
-
function
|
|
5541
|
-
switch (req.responseType) {
|
|
5542
|
-
case "single-choice":
|
|
5543
|
-
return s.respSingleChoice;
|
|
5544
|
-
case "multi-choice":
|
|
5545
|
-
return s.respMultiChoice;
|
|
5546
|
-
case "confirmation":
|
|
5547
|
-
return s.respConfirmation;
|
|
5548
|
-
default:
|
|
5549
|
-
return s.respFreeText;
|
|
5550
|
-
}
|
|
5551
|
-
}
|
|
5552
|
-
function ToolAskInput({ part, strings, active, superseded = false, onSubmit, onDecision, onEdit }) {
|
|
5641
|
+
function ToolAskQuestions({ part, strings, active, superseded = false, onDecision, onEdit }) {
|
|
5553
5642
|
const state = useComputed3(() => part.stateSig.value);
|
|
5554
5643
|
const approval = useComputed3(() => part.approvalSig.value);
|
|
5555
|
-
const request = useComputed3(() =>
|
|
5644
|
+
const request = useComputed3(() => parseAskUserQuestions(part.inputSig.value));
|
|
5556
5645
|
const { terminal, responded, decided } = toolDecisionState(state.value, approval.value);
|
|
5557
|
-
const viaApproval = approval.value !== void 0;
|
|
5558
|
-
const resolve = (answer, accepted) => {
|
|
5559
|
-
if (viaApproval) onDecision(part.toolCallId, accepted, answer);
|
|
5560
|
-
else if (request.value.responseType === "confirmation") onSubmit(part.toolCallId, { confirmed: accepted });
|
|
5561
|
-
else onSubmit(part.toolCallId, accepted ? { answer } : {});
|
|
5562
|
-
};
|
|
5563
5646
|
const req = request.value;
|
|
5564
5647
|
if (decided) {
|
|
5565
5648
|
const editable = responded && active && !terminal;
|
|
5566
5649
|
return /* @__PURE__ */ jsx16(DecidedCard, { part, strings, req, editable, onEdit: () => onEdit(part.toolCallId) });
|
|
5567
5650
|
}
|
|
5568
5651
|
const stale = superseded;
|
|
5569
|
-
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui${stale ? ` ${p15}-toolui-stale` : ""}`, "data-testid": TID.
|
|
5652
|
+
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui${stale ? ` ${p15}-toolui-stale` : ""}`, "data-testid": TID.toolAskQuestions, children: [
|
|
5570
5653
|
/* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-head`, children: stale ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
5571
5654
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputBadge }),
|
|
5572
5655
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-muted`, children: strings.statusSuperseded })
|
|
5573
|
-
] }) : /* @__PURE__ */
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5656
|
+
] }) : /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputRequired }) }),
|
|
5657
|
+
req.intro ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-desc`, children: req.intro }) : null,
|
|
5658
|
+
stale ? null : /* @__PURE__ */ jsx16(
|
|
5659
|
+
AskBody,
|
|
5660
|
+
{
|
|
5661
|
+
req,
|
|
5662
|
+
strings,
|
|
5663
|
+
resolve: (reason, accepted) => onDecision(part.toolCallId, accepted, reason)
|
|
5664
|
+
}
|
|
5665
|
+
)
|
|
5580
5666
|
] });
|
|
5581
5667
|
}
|
|
5582
5668
|
function AskBody({
|
|
@@ -5584,72 +5670,32 @@ function AskBody({
|
|
|
5584
5670
|
strings,
|
|
5585
5671
|
resolve
|
|
5586
5672
|
}) {
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
}
|
|
5590
|
-
const fields = askInputToFields(req).map((f) => {
|
|
5591
|
-
f.label = strings.inputYourAnswer;
|
|
5592
|
-
f.placeholder = f.placeholder ?? strings.inputAnswerPlaceholder;
|
|
5593
|
-
return f;
|
|
5594
|
-
});
|
|
5673
|
+
const fields = askQuestionsToFields(req, strings.confirmYes, strings.confirmNo);
|
|
5674
|
+
const loneTextarea = req.questions.length === 1 && req.questions[0]?.type === "text";
|
|
5595
5675
|
return /* @__PURE__ */ jsx16(
|
|
5596
5676
|
DynamicForm,
|
|
5597
5677
|
{
|
|
5598
5678
|
fields,
|
|
5599
5679
|
strings,
|
|
5600
5680
|
submitLabel: strings.inputSubmit,
|
|
5601
|
-
footerHint:
|
|
5602
|
-
onSubmit: (values) => resolve(
|
|
5681
|
+
footerHint: loneTextarea ? strings.inputSubmitHint : void 0,
|
|
5682
|
+
onSubmit: (values) => resolve(buildAnswersReason(req.questions, values), true),
|
|
5603
5683
|
skipLabel: strings.inputSkip,
|
|
5604
5684
|
onSkip: () => resolve(void 0, false),
|
|
5605
|
-
submitOnEnter:
|
|
5685
|
+
submitOnEnter: loneTextarea,
|
|
5606
5686
|
submitTestId: TID.toolInputSubmit,
|
|
5607
5687
|
skipTestId: TID.toolInputSkip
|
|
5608
5688
|
}
|
|
5609
5689
|
);
|
|
5610
5690
|
}
|
|
5611
|
-
function
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
const no = () => resolve(void 0, false);
|
|
5620
|
-
const onKeyDown = (e) => {
|
|
5621
|
-
if (e.key !== "Enter" || e.shiftKey || e.isComposing) return;
|
|
5622
|
-
e.preventDefault();
|
|
5623
|
-
yes();
|
|
5624
|
-
};
|
|
5625
|
-
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
5626
|
-
supportsNote ? /* @__PURE__ */ jsxs13("label", { class: `${p15}-field`, children: [
|
|
5627
|
-
/* @__PURE__ */ jsx16("span", { class: `${p15}-field-label`, children: strings.inputOptionalNote }),
|
|
5628
|
-
/* @__PURE__ */ jsx16(
|
|
5629
|
-
"textarea",
|
|
5630
|
-
{
|
|
5631
|
-
class: `${p15}-field-input`,
|
|
5632
|
-
rows: 2,
|
|
5633
|
-
value: note,
|
|
5634
|
-
placeholder: req.placeholder ?? strings.inputOptionalNotePlaceholder,
|
|
5635
|
-
onInput: (e) => setNote(e.target.value),
|
|
5636
|
-
onKeyDown,
|
|
5637
|
-
"data-testid": `${TID.formField}-note`
|
|
5638
|
-
}
|
|
5639
|
-
)
|
|
5640
|
-
] }) : null,
|
|
5641
|
-
/* @__PURE__ */ jsxs13("div", { class: `${p15}-form-actions`, children: [
|
|
5642
|
-
/* @__PURE__ */ jsx16("span", { class: `${p15}-form-hint`, children: strings.inputConfirmHint }),
|
|
5643
|
-
/* @__PURE__ */ jsx16("button", { type: "button", class: `${p15}-form-skip`, onClick: no, "data-testid": TID.toolInputSkip, children: strings.confirmNo }),
|
|
5644
|
-
/* @__PURE__ */ jsx16("button", { type: "button", class: `${p15}-form-submit`, onClick: yes, "data-testid": TID.toolInputSubmit, children: strings.confirmYes })
|
|
5645
|
-
] })
|
|
5646
|
-
] });
|
|
5647
|
-
}
|
|
5648
|
-
function Section({ label, text }) {
|
|
5649
|
-
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-section`, children: [
|
|
5650
|
-
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-label`, children: label }),
|
|
5651
|
-
/* @__PURE__ */ jsx16("p", { class: `${p15}-toolui-text`, children: text })
|
|
5652
|
-
] });
|
|
5691
|
+
function buildAnswersReason(questions, values) {
|
|
5692
|
+
const answers = questions.flatMap((q) => {
|
|
5693
|
+
const flat = values[q.key];
|
|
5694
|
+
if (flat == null || flat.trim() === "") return [];
|
|
5695
|
+
const value = q.type === "multi-select" ? flat.split(",").map((s) => s.trim()).filter(Boolean) : flat;
|
|
5696
|
+
return [{ key: q.key, value }];
|
|
5697
|
+
});
|
|
5698
|
+
return JSON.stringify({ answers });
|
|
5653
5699
|
}
|
|
5654
5700
|
function DecidedCard({
|
|
5655
5701
|
part,
|
|
@@ -5658,31 +5704,44 @@ function DecidedCard({
|
|
|
5658
5704
|
editable,
|
|
5659
5705
|
onEdit
|
|
5660
5706
|
}) {
|
|
5661
|
-
const output = useComputed3(() => part.outputSig.value);
|
|
5662
5707
|
const approval = useComputed3(() => part.approvalSig.value);
|
|
5663
5708
|
const skipped = approval.value?.approved === false;
|
|
5664
|
-
const
|
|
5709
|
+
const answers = approval.value?.approved ? parseAnswers(approval.value.reason) : {};
|
|
5665
5710
|
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui`, "data-testid": TID.toolDecision, children: [
|
|
5666
5711
|
/* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-head`, children: [
|
|
5667
5712
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputBadge }),
|
|
5668
5713
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge`, children: skipped ? strings.inputSkipped : strings.inputAnswered })
|
|
5669
5714
|
] }),
|
|
5670
|
-
req.
|
|
5671
|
-
|
|
5672
|
-
|
|
5715
|
+
req.intro ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-desc`, children: req.intro }) : null,
|
|
5716
|
+
req.questions.map((q) => {
|
|
5717
|
+
const text = skipped ? "" : answers[q.key] ?? "";
|
|
5718
|
+
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-section`, children: [
|
|
5719
|
+
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-label`, children: q.question }),
|
|
5720
|
+
text ? /* @__PURE__ */ jsx16("p", { class: `${p15}-toolui-text`, children: text }) : null
|
|
5721
|
+
] }, q.key);
|
|
5722
|
+
}),
|
|
5673
5723
|
editable ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-actions`, children: /* @__PURE__ */ jsx16("button", { type: "button", class: `${p15}-form-skip`, onClick: onEdit, "data-testid": TID.toolEdit, children: strings.edit }) }) : null
|
|
5674
5724
|
] });
|
|
5675
5725
|
}
|
|
5676
|
-
function
|
|
5677
|
-
if (
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5726
|
+
function parseAnswers(reason) {
|
|
5727
|
+
if (!reason) return {};
|
|
5728
|
+
const parsed = (() => {
|
|
5729
|
+
try {
|
|
5730
|
+
return JSON.parse(reason);
|
|
5731
|
+
} catch {
|
|
5732
|
+
return void 0;
|
|
5733
|
+
}
|
|
5734
|
+
})();
|
|
5735
|
+
const list = parsed?.answers;
|
|
5736
|
+
if (!Array.isArray(list)) return {};
|
|
5737
|
+
const out = {};
|
|
5738
|
+
for (const entry of list) {
|
|
5739
|
+
if (!entry || typeof entry !== "object") continue;
|
|
5740
|
+
const { key, value } = entry;
|
|
5741
|
+
if (typeof key !== "string") continue;
|
|
5742
|
+
out[key] = Array.isArray(value) ? value.filter((v) => typeof v === "string").join(", ") : String(value ?? "");
|
|
5684
5743
|
}
|
|
5685
|
-
return
|
|
5744
|
+
return out;
|
|
5686
5745
|
}
|
|
5687
5746
|
|
|
5688
5747
|
// src/ui/tool-call.tsx
|
|
@@ -5832,15 +5891,14 @@ function ToolPartView({
|
|
|
5832
5891
|
}) {
|
|
5833
5892
|
const hasApproval = useComputed5(() => part.approvalSig.value !== void 0);
|
|
5834
5893
|
if (tool?.humanInLoop) {
|
|
5835
|
-
if (
|
|
5894
|
+
if (isAskUserQuestionsTool(part.toolName)) {
|
|
5836
5895
|
return /* @__PURE__ */ jsx18(
|
|
5837
|
-
|
|
5896
|
+
ToolAskQuestions,
|
|
5838
5897
|
{
|
|
5839
5898
|
part,
|
|
5840
5899
|
strings,
|
|
5841
5900
|
active: interactive,
|
|
5842
5901
|
superseded,
|
|
5843
|
-
onSubmit: tool.onResult,
|
|
5844
5902
|
onDecision: tool.onDecision,
|
|
5845
5903
|
onEdit: tool.onEdit
|
|
5846
5904
|
}
|
|
@@ -5922,7 +5980,7 @@ function MessageList({
|
|
|
5922
5980
|
}) {
|
|
5923
5981
|
const ref = useRef5(null);
|
|
5924
5982
|
const messages = useComputed6(() => messagesSig.value);
|
|
5925
|
-
const [showJump, setShowJump] =
|
|
5983
|
+
const [showJump, setShowJump] = useState6(false);
|
|
5926
5984
|
const hasHydratedRef = useRef5(false);
|
|
5927
5985
|
const detachedRef = useRef5(false);
|
|
5928
5986
|
const interactingRef = useRef5(false);
|
|
@@ -6209,7 +6267,7 @@ function dayLabel(createdAt, strings) {
|
|
|
6209
6267
|
}
|
|
6210
6268
|
|
|
6211
6269
|
// src/ui/conversation-list.tsx
|
|
6212
|
-
import { useEffect as useEffect8, useState as
|
|
6270
|
+
import { useEffect as useEffect8, useState as useState7 } from "preact/hooks";
|
|
6213
6271
|
|
|
6214
6272
|
// src/ui/history-groups.ts
|
|
6215
6273
|
var HISTORY_BUCKETS = ["today", "yesterday", "lastWeek", "older"];
|
|
@@ -6268,8 +6326,8 @@ function ConversationList({
|
|
|
6268
6326
|
}) {
|
|
6269
6327
|
const p36 = BRAND.cssPrefix;
|
|
6270
6328
|
const seed = transport.peekConversations({ visitorId });
|
|
6271
|
-
const [state, setState] =
|
|
6272
|
-
const [conversations, setChats] =
|
|
6329
|
+
const [state, setState] = useState7(seed ? "loaded" : "loading");
|
|
6330
|
+
const [conversations, setChats] = useState7(seed?.conversations ?? []);
|
|
6273
6331
|
useEffect8(() => {
|
|
6274
6332
|
let cancelled = false;
|
|
6275
6333
|
transport.listConversations({ visitorId }).then((res) => {
|
|
@@ -6875,7 +6933,7 @@ var chatLayout = {
|
|
|
6875
6933
|
};
|
|
6876
6934
|
|
|
6877
6935
|
// src/ui/modules/help.tsx
|
|
6878
|
-
import { useEffect as useEffect10, useMemo as useMemo2, useState as
|
|
6936
|
+
import { useEffect as useEffect10, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
|
|
6879
6937
|
|
|
6880
6938
|
// src/ui/back-header.tsx
|
|
6881
6939
|
import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
|
|
@@ -6992,11 +7050,11 @@ function ArticleRow({ article, nav }) {
|
|
|
6992
7050
|
}
|
|
6993
7051
|
function HelpRoot({ transport, strings, config, nav, bus, panelProps }) {
|
|
6994
7052
|
const tags = config.contentTags;
|
|
6995
|
-
const [state, setState] =
|
|
6996
|
-
const [errorMsg, setErrorMsg] =
|
|
6997
|
-
const [items, setItems] =
|
|
6998
|
-
const [query, setQuery] =
|
|
6999
|
-
const [reloadKey, setReloadKey] =
|
|
7053
|
+
const [state, setState] = useState8("loading");
|
|
7054
|
+
const [errorMsg, setErrorMsg] = useState8(strings.errorGeneric);
|
|
7055
|
+
const [items, setItems] = useState8([]);
|
|
7056
|
+
const [query, setQuery] = useState8("");
|
|
7057
|
+
const [reloadKey, setReloadKey] = useState8(0);
|
|
7000
7058
|
useEffect10(() => {
|
|
7001
7059
|
let cancelled = false;
|
|
7002
7060
|
setState("loading");
|
|
@@ -7050,7 +7108,7 @@ var helpLayout = {
|
|
|
7050
7108
|
};
|
|
7051
7109
|
|
|
7052
7110
|
// src/ui/modules/home.tsx
|
|
7053
|
-
import { useEffect as useEffect11, useState as
|
|
7111
|
+
import { useEffect as useEffect11, useState as useState9 } from "preact/hooks";
|
|
7054
7112
|
|
|
7055
7113
|
// src/ui/home-card.tsx
|
|
7056
7114
|
import { jsx as jsx30 } from "preact/jsx-runtime";
|
|
@@ -7078,8 +7136,8 @@ function resolveGreeting(props2) {
|
|
|
7078
7136
|
var openContent = (nav, item) => item.url ? nav.push({ kind: "iframe", url: item.url, title: item.title }) : nav.push({ kind: "content", id: item.id, title: item.title });
|
|
7079
7137
|
function HomeRoot(props2) {
|
|
7080
7138
|
const { transport, strings, config, nav, bus, panelProps } = props2;
|
|
7081
|
-
const [recent, setRecent] =
|
|
7082
|
-
const [content, setContent] =
|
|
7139
|
+
const [recent, setRecent] = useState9(null);
|
|
7140
|
+
const [content, setContent] = useState9([]);
|
|
7083
7141
|
const tagsKey = config.contentTags?.join(",");
|
|
7084
7142
|
useEffect11(() => {
|
|
7085
7143
|
if (!config.showRecentConversations) return;
|
|
@@ -7169,16 +7227,16 @@ var homeLayout = {
|
|
|
7169
7227
|
};
|
|
7170
7228
|
|
|
7171
7229
|
// src/ui/modules/news.tsx
|
|
7172
|
-
import { useEffect as useEffect12, useState as
|
|
7230
|
+
import { useEffect as useEffect12, useState as useState10 } from "preact/hooks";
|
|
7173
7231
|
import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
|
|
7174
7232
|
var p29 = BRAND.cssPrefix;
|
|
7175
7233
|
var log14 = logger.scope("news");
|
|
7176
7234
|
function NewsRoot({ transport, strings, config, nav, bus, panelProps }) {
|
|
7177
7235
|
const tags = config.contentTags;
|
|
7178
|
-
const [state, setState] =
|
|
7179
|
-
const [errorMsg, setErrorMsg] =
|
|
7180
|
-
const [items, setItems] =
|
|
7181
|
-
const [reloadKey, setReloadKey] =
|
|
7236
|
+
const [state, setState] = useState10("loading");
|
|
7237
|
+
const [errorMsg, setErrorMsg] = useState10(strings.errorGeneric);
|
|
7238
|
+
const [items, setItems] = useState10([]);
|
|
7239
|
+
const [reloadKey, setReloadKey] = useState10(0);
|
|
7182
7240
|
useEffect12(() => {
|
|
7183
7241
|
let cancelled = false;
|
|
7184
7242
|
setState("loading");
|
|
@@ -7301,15 +7359,15 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
7301
7359
|
}
|
|
7302
7360
|
|
|
7303
7361
|
// src/ui/content-view.tsx
|
|
7304
|
-
import { useCallback as useCallback3, useEffect as useEffect13, useState as
|
|
7362
|
+
import { useCallback as useCallback3, useEffect as useEffect13, useState as useState11 } from "preact/hooks";
|
|
7305
7363
|
import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
|
|
7306
7364
|
var p32 = BRAND.cssPrefix;
|
|
7307
7365
|
var log15 = logger.scope("content");
|
|
7308
7366
|
var READ_DWELL_MS = 5e3;
|
|
7309
7367
|
function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
|
|
7310
|
-
const [item, setItem] =
|
|
7311
|
-
const [failed, setFailed] =
|
|
7312
|
-
const [reloadKey, setReloadKey] =
|
|
7368
|
+
const [item, setItem] = useState11(null);
|
|
7369
|
+
const [failed, setFailed] = useState11(false);
|
|
7370
|
+
const [reloadKey, setReloadKey] = useState11(0);
|
|
7313
7371
|
const retry = useCallback3(() => {
|
|
7314
7372
|
setFailed(false);
|
|
7315
7373
|
setItem(null);
|
|
@@ -7553,11 +7611,11 @@ function ModulesEmpty({ strings, onClose }) {
|
|
|
7553
7611
|
}
|
|
7554
7612
|
|
|
7555
7613
|
// src/ui/use-launcher-callout.ts
|
|
7556
|
-
import { useCallback as useCallback5, useEffect as useEffect15, useState as
|
|
7614
|
+
import { useCallback as useCallback5, useEffect as useEffect15, useState as useState12 } from "preact/hooks";
|
|
7557
7615
|
function useLauncherCallout({ callout, persistence }) {
|
|
7558
7616
|
const textKey = callout?.text ?? "";
|
|
7559
7617
|
const persistent = callout?.persistent ?? true;
|
|
7560
|
-
const [dismissed, setDismissed] =
|
|
7618
|
+
const [dismissed, setDismissed] = useState12(() => persistent ? false : persistence.loadCalloutDismissed(textKey));
|
|
7561
7619
|
useEffect15(() => {
|
|
7562
7620
|
setDismissed(persistent ? false : persistence.loadCalloutDismissed(textKey));
|
|
7563
7621
|
}, [textKey, persistent, persistence]);
|
|
@@ -7586,21 +7644,21 @@ function isAbortError(error) {
|
|
|
7586
7644
|
return error instanceof DOMException ? error.name === "AbortError" : error?.name === "AbortError";
|
|
7587
7645
|
}
|
|
7588
7646
|
function App({ options, hostElement, bus }) {
|
|
7589
|
-
const [persistence] =
|
|
7647
|
+
const [persistence] = useState13(
|
|
7590
7648
|
() => createPersistence(options.widgetId, options.storage, options.aiAgentDeploymentId)
|
|
7591
7649
|
);
|
|
7592
|
-
const [visitorId, setVisitorId] =
|
|
7650
|
+
const [visitorId, setVisitorId] = useState13(() => persistence.getVisitorId());
|
|
7593
7651
|
const initialSettings = persistence.loadUserPrefs();
|
|
7594
|
-
const [activeLocale, setActiveLocale] =
|
|
7595
|
-
const [activeThemeMode, setActiveThemeMode] =
|
|
7652
|
+
const [activeLocale, setActiveLocale] = useState13(() => initialSettings.locale ?? options.locale);
|
|
7653
|
+
const [activeThemeMode, setActiveThemeMode] = useState13(
|
|
7596
7654
|
() => initialSettings.themeMode ?? options.themeMode
|
|
7597
7655
|
);
|
|
7598
|
-
const [activeTextSize, setActiveTextSize] =
|
|
7656
|
+
const [activeTextSize, setActiveTextSize] = useState13(() => initialSettings.textSize ?? options.textSize);
|
|
7599
7657
|
const conversationIdSig = useSignal(persistence.loadConversationId());
|
|
7600
7658
|
const messagesSig = useSignal([]);
|
|
7601
7659
|
const unreadCountSig = useSignal(0);
|
|
7602
|
-
const [loadingMessages, setLoadingMessages] =
|
|
7603
|
-
const [formMarkers, setFormMarkers] =
|
|
7660
|
+
const [loadingMessages, setLoadingMessages] = useState13(false);
|
|
7661
|
+
const [formMarkers, setFormMarkers] = useState13([]);
|
|
7604
7662
|
function landingTab() {
|
|
7605
7663
|
const list = options.modules.list;
|
|
7606
7664
|
const ids = new Set(list.map((m) => m.id));
|
|
@@ -7619,15 +7677,15 @@ function App({ options, hostElement, bus }) {
|
|
|
7619
7677
|
const homeNav = homeNavRef.current;
|
|
7620
7678
|
const chatTabIdRef = useRef9(void 0);
|
|
7621
7679
|
chatTabIdRef.current = chatTabId();
|
|
7622
|
-
const [conversationReady, setConversationReady] =
|
|
7623
|
-
const [remoteForms, setRemoteForms] =
|
|
7624
|
-
const [formsReady, setFormsReady] =
|
|
7680
|
+
const [conversationReady, setConversationReady] = useState13(false);
|
|
7681
|
+
const [remoteForms, setRemoteForms] = useState13(null);
|
|
7682
|
+
const [formsReady, setFormsReady] = useState13(false);
|
|
7625
7683
|
const isInlineLike = options.mode === "standalone" || options.mode === "inline";
|
|
7626
7684
|
const initialPanelRef = useRef9(
|
|
7627
7685
|
resolveInitialPanelState(options, currentViewportWidth(), persistence.loadPanelOpen(), persistence.loadPanelSize())
|
|
7628
7686
|
);
|
|
7629
|
-
const [isOpen, setIsOpen] =
|
|
7630
|
-
const [activated, setActivated] =
|
|
7687
|
+
const [isOpen, setIsOpen] = useState13(initialPanelRef.current.panelOpen);
|
|
7688
|
+
const [activated, setActivated] = useState13(initialPanelRef.current.panelOpen);
|
|
7631
7689
|
const activatedRef = useRef9(activated);
|
|
7632
7690
|
activatedRef.current = activated;
|
|
7633
7691
|
const pendingThreadRef = useRef9(false);
|
|
@@ -7636,7 +7694,7 @@ function App({ options, hostElement, bus }) {
|
|
|
7636
7694
|
if (isOpen) setActivated(true);
|
|
7637
7695
|
}, [isOpen]);
|
|
7638
7696
|
const initialPanelApplied = useRef9(false);
|
|
7639
|
-
const [launcherLeaving, setLauncherLeaving] =
|
|
7697
|
+
const [launcherLeaving, setLauncherLeaving] = useState13(false);
|
|
7640
7698
|
const { dismissed: calloutDismissed, dismissCallout: dismissCalloutRaw } = useLauncherCallout({
|
|
7641
7699
|
callout: options.launcher.callout,
|
|
7642
7700
|
persistence
|
|
@@ -7647,21 +7705,21 @@ function App({ options, hostElement, bus }) {
|
|
|
7647
7705
|
bus.emit("calloutDismiss", void 0);
|
|
7648
7706
|
dismissCalloutRaw();
|
|
7649
7707
|
}, [bus, dismissCalloutRaw]);
|
|
7650
|
-
const [panelSize, setPanelSize] =
|
|
7708
|
+
const [panelSize, setPanelSize] = useState13(initialPanelRef.current.panelSize);
|
|
7651
7709
|
const initialSizeApplied = useRef9(false);
|
|
7652
|
-
const [view, setView] =
|
|
7653
|
-
const [canSend, setCanSend] =
|
|
7654
|
-
const [streaming, setStreaming] =
|
|
7655
|
-
const [agent, setAgent] =
|
|
7656
|
-
const [suggestions, setSuggestions] =
|
|
7657
|
-
const [activeCancel, setActiveCancel] =
|
|
7658
|
-
const [activeDetach, setActiveDetach] =
|
|
7710
|
+
const [view, setView] = useState13("chat");
|
|
7711
|
+
const [canSend, setCanSend] = useState13(true);
|
|
7712
|
+
const [streaming, setStreaming] = useState13(false);
|
|
7713
|
+
const [agent, setAgent] = useState13(null);
|
|
7714
|
+
const [suggestions, setSuggestions] = useState13([]);
|
|
7715
|
+
const [activeCancel, setActiveCancel] = useState13(null);
|
|
7716
|
+
const [activeDetach, setActiveDetach] = useState13(null);
|
|
7659
7717
|
const stringsRef = useRef9(options.strings);
|
|
7660
|
-
const [parsedSite, setParsedSite] =
|
|
7661
|
-
const [parsedBlocks, setParsedBlocks] =
|
|
7662
|
-
const [sidebarCollapsed, setSidebarCollapsed] =
|
|
7663
|
-
const [formContext, setFormContext] =
|
|
7664
|
-
const [transport] =
|
|
7718
|
+
const [parsedSite, setParsedSite] = useState13(void 0);
|
|
7719
|
+
const [parsedBlocks, setParsedBlocks] = useState13(void 0);
|
|
7720
|
+
const [sidebarCollapsed, setSidebarCollapsed] = useState13(() => persistence.loadSidebarCollapsed() ?? false);
|
|
7721
|
+
const [formContext, setFormContext] = useState13({});
|
|
7722
|
+
const [transport] = useState13(
|
|
7665
7723
|
() => new AgentTransport({
|
|
7666
7724
|
agentApiBaseUrl: options.agentApiBaseUrl,
|
|
7667
7725
|
dataApiBaseUrl: options.dataApiBaseUrl,
|
|
@@ -7673,8 +7731,8 @@ function App({ options, hostElement, bus }) {
|
|
|
7673
7731
|
endpoints: options.endpoints
|
|
7674
7732
|
})
|
|
7675
7733
|
);
|
|
7676
|
-
const [reducer] =
|
|
7677
|
-
const [feedback] =
|
|
7734
|
+
const [reducer] = useState13(() => new StreamReducer(messagesSig));
|
|
7735
|
+
const [feedback] = useState13(() => new FeedbackBus(options.sound, options.haptics));
|
|
7678
7736
|
const patchAndSync = useCallback6(
|
|
7679
7737
|
(patch) => {
|
|
7680
7738
|
persistence.patchUserPrefs(patch);
|