@plaisolutions/react 0.20.0 → 0.22.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/components/index.d.ts +38 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +790 -35
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +57 -57
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +789 -34
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpStatusError, OPEN_TOOL_CONFIRMATION_STATUSES, PlaiChat, isHiddenMessage, pendingActionIds, toolConfirmationAt } from "@plaisolutions/client";
|
|
1
|
+
import { HttpStatusError, OPEN_TOOL_CONFIRMATION_STATUSES, PlaiChat, ToolDecisionRejectedError, ToolSubmissionConflictError, isHiddenMessage, pendingActionIds, toolConfirmationAt } from "@plaisolutions/client";
|
|
2
2
|
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { ArrowUpRight, Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, ChevronUp, CircleAlert, CircleX, Clock, Copy, Database, Download, File, FileText, Globe, LoaderCircle, Mail, MessageSquare, Paperclip as Paperclip$1, Plug, RotateCcw, ThumbsDown, ThumbsUp, Video, Workflow, X as X$1, XCircle } from "lucide-react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -4359,7 +4359,35 @@ const ENGLISH = {
|
|
|
4359
4359
|
statusUnknown: "Outcome unknown: check before trying again",
|
|
4360
4360
|
statusNotFound: "Not available in this conversation",
|
|
4361
4361
|
toolUnavailable: "The tool for this action isn’t available right now",
|
|
4362
|
-
decisionError: "Your decision couldn’t be sent. Try again."
|
|
4362
|
+
decisionError: "Your decision couldn’t be sent. Try again.",
|
|
4363
|
+
edit: "Edit",
|
|
4364
|
+
saveAndSend: "Save and send",
|
|
4365
|
+
saveAndConfirm: "Save and confirm",
|
|
4366
|
+
discardEdit: "Discard changes",
|
|
4367
|
+
fieldBody: "Message",
|
|
4368
|
+
fieldStart: "Starts",
|
|
4369
|
+
fieldEnd: "Ends",
|
|
4370
|
+
addressesHint: "Separate addresses with commas",
|
|
4371
|
+
timeZoneNote: "Time zone: {{zone}}",
|
|
4372
|
+
errorRequired: "This field can’t be empty",
|
|
4373
|
+
errorNoRecipients: "Add at least one recipient",
|
|
4374
|
+
errorInvalidAddress: "Enter valid email addresses",
|
|
4375
|
+
errorInvalidDateTime: "Enter a valid date and time",
|
|
4376
|
+
errorAmbiguousTime: "This time doesn’t exist or happens twice in {{zone}}. Pick another time.",
|
|
4377
|
+
errorEndBeforeStart: "The end must be after the start",
|
|
4378
|
+
editNoLongerApplies: "Your changes no longer apply to this action. Review them and try again.",
|
|
4379
|
+
editedLabel: "Edited",
|
|
4380
|
+
seeNewerVersion: "See the newer version",
|
|
4381
|
+
invalidatedConfigurationChanged: "The tool, account or its settings changed after this was prepared. Ask again in the chat.",
|
|
4382
|
+
invalidatedNoSnapshot: "This action was prepared by an older version and can’t run. Ask again in the chat.",
|
|
4383
|
+
invalidatedResourceChanged: "The event changed after this was prepared, so nothing was modified. Ask again in the chat.",
|
|
4384
|
+
unknownOutcome: "The provider didn’t confirm whether it happened. Check your sent mail or calendar before trying again.",
|
|
4385
|
+
unknownInterrupted: "The action was interrupted and it isn’t known whether it happened. Check your account before trying again.",
|
|
4386
|
+
applyingNow: "This is already being applied…",
|
|
4387
|
+
errorPlainText: "Use plain text, without HTML",
|
|
4388
|
+
errorOffsetMismatch: "The UTC offset doesn’t match the time zone of the event",
|
|
4389
|
+
errorNotEditable: "This field can’t be edited",
|
|
4390
|
+
errorInvalidValue: "This value isn’t valid"
|
|
4363
4391
|
};
|
|
4364
4392
|
const COPY = {
|
|
4365
4393
|
en: {},
|
|
@@ -4433,7 +4461,35 @@ const COPY = {
|
|
|
4433
4461
|
statusUnknown: "Resultado desconocido: compruébalo antes de repetirlo",
|
|
4434
4462
|
statusNotFound: "No disponible en esta conversación",
|
|
4435
4463
|
toolUnavailable: "La herramienta de esta acción no está disponible ahora",
|
|
4436
|
-
decisionError: "No se pudo enviar tu decisión. Inténtalo de nuevo."
|
|
4464
|
+
decisionError: "No se pudo enviar tu decisión. Inténtalo de nuevo.",
|
|
4465
|
+
edit: "Editar",
|
|
4466
|
+
saveAndSend: "Guardar y enviar",
|
|
4467
|
+
saveAndConfirm: "Guardar y confirmar",
|
|
4468
|
+
discardEdit: "Descartar cambios",
|
|
4469
|
+
fieldBody: "Mensaje",
|
|
4470
|
+
fieldStart: "Empieza",
|
|
4471
|
+
fieldEnd: "Termina",
|
|
4472
|
+
addressesHint: "Separa las direcciones con comas",
|
|
4473
|
+
timeZoneNote: "Zona horaria: {{zone}}",
|
|
4474
|
+
errorRequired: "Este campo no puede estar vacío",
|
|
4475
|
+
errorNoRecipients: "Añade al menos un destinatario",
|
|
4476
|
+
errorInvalidAddress: "Introduce direcciones de correo válidas",
|
|
4477
|
+
errorInvalidDateTime: "Introduce una fecha y hora válidas",
|
|
4478
|
+
errorAmbiguousTime: "Esta hora no existe o se repite en {{zone}}. Elige otra hora.",
|
|
4479
|
+
errorEndBeforeStart: "El final debe ser posterior al inicio",
|
|
4480
|
+
editNoLongerApplies: "Tus cambios ya no se aplican a esta acción. Revísalos e inténtalo de nuevo.",
|
|
4481
|
+
editedLabel: "Editada",
|
|
4482
|
+
seeNewerVersion: "Ver la versión más reciente",
|
|
4483
|
+
invalidatedConfigurationChanged: "La herramienta, la cuenta o su configuración cambiaron después de preparar esto. Pídelo de nuevo en el chat.",
|
|
4484
|
+
invalidatedNoSnapshot: "Esta acción la preparó una versión anterior y no se puede ejecutar. Pídelo de nuevo en el chat.",
|
|
4485
|
+
invalidatedResourceChanged: "El evento cambió después de preparar esto, así que no se modificó nada. Pídelo de nuevo en el chat.",
|
|
4486
|
+
unknownOutcome: "El proveedor no confirmó si llegó a ocurrir. Comprueba tus enviados o tu calendario antes de intentarlo de nuevo.",
|
|
4487
|
+
unknownInterrupted: "La acción se interrumpió y no se sabe si llegó a ocurrir. Comprueba tu cuenta antes de intentarlo de nuevo.",
|
|
4488
|
+
applyingNow: "Ya se está aplicando…",
|
|
4489
|
+
errorPlainText: "Usa texto sin formato, sin HTML",
|
|
4490
|
+
errorOffsetMismatch: "El desfase UTC no coincide con la zona horaria del evento",
|
|
4491
|
+
errorNotEditable: "Este campo no se puede editar",
|
|
4492
|
+
errorInvalidValue: "Este valor no es válido"
|
|
4437
4493
|
},
|
|
4438
4494
|
ca: {
|
|
4439
4495
|
searchingMail: "Cercant a {{service}}",
|
|
@@ -4505,7 +4561,35 @@ const COPY = {
|
|
|
4505
4561
|
statusUnknown: "Resultat desconegut: comprova-ho abans de repetir-ho",
|
|
4506
4562
|
statusNotFound: "No disponible en aquesta conversa",
|
|
4507
4563
|
toolUnavailable: "L’eina d’aquesta acció no està disponible ara",
|
|
4508
|
-
decisionError: "No s’ha pogut enviar la teva decisió. Torna-ho a provar."
|
|
4564
|
+
decisionError: "No s’ha pogut enviar la teva decisió. Torna-ho a provar.",
|
|
4565
|
+
edit: "Edita",
|
|
4566
|
+
saveAndSend: "Desa i envia",
|
|
4567
|
+
saveAndConfirm: "Desa i confirma",
|
|
4568
|
+
discardEdit: "Descarta els canvis",
|
|
4569
|
+
fieldBody: "Missatge",
|
|
4570
|
+
fieldStart: "Comença",
|
|
4571
|
+
fieldEnd: "Acaba",
|
|
4572
|
+
addressesHint: "Separa les adreces amb comes",
|
|
4573
|
+
timeZoneNote: "Zona horària: {{zone}}",
|
|
4574
|
+
errorRequired: "Aquest camp no pot estar buit",
|
|
4575
|
+
errorNoRecipients: "Afegeix com a mínim un destinatari",
|
|
4576
|
+
errorInvalidAddress: "Introdueix adreces de correu vàlides",
|
|
4577
|
+
errorInvalidDateTime: "Introdueix una data i hora vàlides",
|
|
4578
|
+
errorAmbiguousTime: "Aquesta hora no existeix o es repeteix a {{zone}}. Tria una altra hora.",
|
|
4579
|
+
errorEndBeforeStart: "El final ha de ser posterior a l’inici",
|
|
4580
|
+
editNoLongerApplies: "Els teus canvis ja no s’apliquen a aquesta acció. Revisa’ls i torna-ho a provar.",
|
|
4581
|
+
editedLabel: "Editada",
|
|
4582
|
+
seeNewerVersion: "Mostra la versió més recent",
|
|
4583
|
+
invalidatedConfigurationChanged: "L’eina, el compte o la seva configuració han canviat després de preparar això. Torna-ho a demanar al xat.",
|
|
4584
|
+
invalidatedNoSnapshot: "Aquesta acció la va preparar una versió anterior i no es pot executar. Torna-ho a demanar al xat.",
|
|
4585
|
+
invalidatedResourceChanged: "L’esdeveniment ha canviat després de preparar això, així que no s’ha modificat res. Torna-ho a demanar al xat.",
|
|
4586
|
+
unknownOutcome: "El proveïdor no ha confirmat si va arribar a passar. Comprova els enviats o el calendari abans de tornar-ho a provar.",
|
|
4587
|
+
unknownInterrupted: "L’acció s’ha interromput i no se sap si va arribar a passar. Comprova el teu compte abans de tornar-ho a provar.",
|
|
4588
|
+
applyingNow: "Ja s’està aplicant…",
|
|
4589
|
+
errorPlainText: "Utilitza text sense format, sense HTML",
|
|
4590
|
+
errorOffsetMismatch: "El desfasament UTC no coincideix amb la zona horària de l’esdeveniment",
|
|
4591
|
+
errorNotEditable: "Aquest camp no es pot editar",
|
|
4592
|
+
errorInvalidValue: "Aquest valor no és vàlid"
|
|
4509
4593
|
},
|
|
4510
4594
|
fr: {
|
|
4511
4595
|
searchingMail: "Recherche dans {{service}}",
|
|
@@ -4577,7 +4661,35 @@ const COPY = {
|
|
|
4577
4661
|
statusUnknown: "Résultat inconnu : vérifiez avant de réessayer",
|
|
4578
4662
|
statusNotFound: "Indisponible dans cette conversation",
|
|
4579
4663
|
toolUnavailable: "L’outil de cette action n’est pas disponible pour le moment",
|
|
4580
|
-
decisionError: "Impossible d’envoyer votre décision. Réessayez."
|
|
4664
|
+
decisionError: "Impossible d’envoyer votre décision. Réessayez.",
|
|
4665
|
+
edit: "Modifier",
|
|
4666
|
+
saveAndSend: "Enregistrer et envoyer",
|
|
4667
|
+
saveAndConfirm: "Enregistrer et confirmer",
|
|
4668
|
+
discardEdit: "Annuler les modifications",
|
|
4669
|
+
fieldBody: "Message",
|
|
4670
|
+
fieldStart: "Début",
|
|
4671
|
+
fieldEnd: "Fin",
|
|
4672
|
+
addressesHint: "Séparez les adresses par des virgules",
|
|
4673
|
+
timeZoneNote: "Fuseau horaire : {{zone}}",
|
|
4674
|
+
errorRequired: "Ce champ ne peut pas être vide",
|
|
4675
|
+
errorNoRecipients: "Ajoutez au moins un destinataire",
|
|
4676
|
+
errorInvalidAddress: "Saisissez des adresses e-mail valides",
|
|
4677
|
+
errorInvalidDateTime: "Saisissez une date et une heure valides",
|
|
4678
|
+
errorAmbiguousTime: "Cette heure n’existe pas ou se répète en {{zone}}. Choisissez une autre heure.",
|
|
4679
|
+
errorEndBeforeStart: "La fin doit être postérieure au début",
|
|
4680
|
+
editNoLongerApplies: "Vos modifications ne s’appliquent plus à cette action. Vérifiez-les et réessayez.",
|
|
4681
|
+
editedLabel: "Modifiée",
|
|
4682
|
+
seeNewerVersion: "Voir la version la plus récente",
|
|
4683
|
+
invalidatedConfigurationChanged: "L’outil, le compte ou sa configuration ont changé après la préparation. Redemandez-le dans le chat.",
|
|
4684
|
+
invalidatedNoSnapshot: "Cette action a été préparée par une version antérieure et ne peut pas s’exécuter. Redemandez-la dans le chat.",
|
|
4685
|
+
invalidatedResourceChanged: "L’événement a changé après la préparation, donc rien n’a été modifié. Redemandez-le dans le chat.",
|
|
4686
|
+
unknownOutcome: "Le fournisseur n’a pas confirmé si cela a eu lieu. Vérifiez vos envois ou votre agenda avant de réessayer.",
|
|
4687
|
+
unknownInterrupted: "L’action a été interrompue et on ne sait pas si elle a eu lieu. Vérifiez votre compte avant de réessayer.",
|
|
4688
|
+
applyingNow: "Déjà en cours d’application…",
|
|
4689
|
+
errorPlainText: "Utilisez du texte brut, sans HTML",
|
|
4690
|
+
errorOffsetMismatch: "Le décalage UTC ne correspond pas au fuseau horaire de l’événement",
|
|
4691
|
+
errorNotEditable: "Ce champ ne peut pas être modifié",
|
|
4692
|
+
errorInvalidValue: "Cette valeur n’est pas valide"
|
|
4581
4693
|
},
|
|
4582
4694
|
it: {
|
|
4583
4695
|
searchingMail: "Ricerca in {{service}}",
|
|
@@ -4649,7 +4761,35 @@ const COPY = {
|
|
|
4649
4761
|
statusUnknown: "Esito sconosciuto: verifica prima di riprovare",
|
|
4650
4762
|
statusNotFound: "Non disponibile in questa conversazione",
|
|
4651
4763
|
toolUnavailable: "Lo strumento di questa azione non è disponibile ora",
|
|
4652
|
-
decisionError: "Impossibile inviare la tua decisione. Riprova."
|
|
4764
|
+
decisionError: "Impossibile inviare la tua decisione. Riprova.",
|
|
4765
|
+
edit: "Modifica",
|
|
4766
|
+
saveAndSend: "Salva e invia",
|
|
4767
|
+
saveAndConfirm: "Salva e conferma",
|
|
4768
|
+
discardEdit: "Annulla le modifiche",
|
|
4769
|
+
fieldBody: "Messaggio",
|
|
4770
|
+
fieldStart: "Inizio",
|
|
4771
|
+
fieldEnd: "Fine",
|
|
4772
|
+
addressesHint: "Separa gli indirizzi con virgole",
|
|
4773
|
+
timeZoneNote: "Fuso orario: {{zone}}",
|
|
4774
|
+
errorRequired: "Questo campo non può essere vuoto",
|
|
4775
|
+
errorNoRecipients: "Aggiungi almeno un destinatario",
|
|
4776
|
+
errorInvalidAddress: "Inserisci indirizzi e-mail validi",
|
|
4777
|
+
errorInvalidDateTime: "Inserisci una data e un’ora valide",
|
|
4778
|
+
errorAmbiguousTime: "Questo orario non esiste o si ripete in {{zone}}. Scegli un altro orario.",
|
|
4779
|
+
errorEndBeforeStart: "La fine deve essere successiva all’inizio",
|
|
4780
|
+
editNoLongerApplies: "Le tue modifiche non si applicano più a questa azione. Controllale e riprova.",
|
|
4781
|
+
editedLabel: "Modificata",
|
|
4782
|
+
seeNewerVersion: "Vedi la versione più recente",
|
|
4783
|
+
invalidatedConfigurationChanged: "Lo strumento, l’account o la sua configurazione sono cambiati dopo la preparazione. Chiedilo di nuovo nella chat.",
|
|
4784
|
+
invalidatedNoSnapshot: "Questa azione è stata preparata da una versione precedente e non può essere eseguita. Chiedilo di nuovo nella chat.",
|
|
4785
|
+
invalidatedResourceChanged: "L’evento è cambiato dopo la preparazione, quindi non è stato modificato nulla. Chiedilo di nuovo nella chat.",
|
|
4786
|
+
unknownOutcome: "Il provider non ha confermato se sia avvenuto. Controlla la posta inviata o il calendario prima di riprovare.",
|
|
4787
|
+
unknownInterrupted: "L’azione è stata interrotta e non si sa se sia avvenuta. Controlla il tuo account prima di riprovare.",
|
|
4788
|
+
applyingNow: "È già in corso di applicazione…",
|
|
4789
|
+
errorPlainText: "Usa testo semplice, senza HTML",
|
|
4790
|
+
errorOffsetMismatch: "Lo scostamento UTC non corrisponde al fuso orario dell’evento",
|
|
4791
|
+
errorNotEditable: "Questo campo non può essere modificato",
|
|
4792
|
+
errorInvalidValue: "Questo valore non è valido"
|
|
4653
4793
|
},
|
|
4654
4794
|
de: {
|
|
4655
4795
|
searchingMail: "Suche in {{service}}",
|
|
@@ -4721,7 +4861,35 @@ const COPY = {
|
|
|
4721
4861
|
statusUnknown: "Ergebnis unbekannt: vor dem Wiederholen prüfen",
|
|
4722
4862
|
statusNotFound: "In dieser Unterhaltung nicht verfügbar",
|
|
4723
4863
|
toolUnavailable: "Das Tool für diese Aktion ist gerade nicht verfügbar",
|
|
4724
|
-
decisionError: "Deine Entscheidung konnte nicht gesendet werden. Versuche es erneut."
|
|
4864
|
+
decisionError: "Deine Entscheidung konnte nicht gesendet werden. Versuche es erneut.",
|
|
4865
|
+
edit: "Bearbeiten",
|
|
4866
|
+
saveAndSend: "Speichern und senden",
|
|
4867
|
+
saveAndConfirm: "Speichern und bestätigen",
|
|
4868
|
+
discardEdit: "Änderungen verwerfen",
|
|
4869
|
+
fieldBody: "Nachricht",
|
|
4870
|
+
fieldStart: "Beginn",
|
|
4871
|
+
fieldEnd: "Ende",
|
|
4872
|
+
addressesHint: "Adressen durch Kommas trennen",
|
|
4873
|
+
timeZoneNote: "Zeitzone: {{zone}}",
|
|
4874
|
+
errorRequired: "Dieses Feld darf nicht leer sein",
|
|
4875
|
+
errorNoRecipients: "Füge mindestens einen Empfänger hinzu",
|
|
4876
|
+
errorInvalidAddress: "Gib gültige E-Mail-Adressen ein",
|
|
4877
|
+
errorInvalidDateTime: "Gib ein gültiges Datum und eine gültige Uhrzeit ein",
|
|
4878
|
+
errorAmbiguousTime: "Diese Uhrzeit existiert in {{zone}} nicht oder kommt doppelt vor. Wähle eine andere Uhrzeit.",
|
|
4879
|
+
errorEndBeforeStart: "Das Ende muss nach dem Beginn liegen",
|
|
4880
|
+
editNoLongerApplies: "Deine Änderungen gelten für diese Aktion nicht mehr. Prüfe sie und versuche es erneut.",
|
|
4881
|
+
editedLabel: "Bearbeitet",
|
|
4882
|
+
seeNewerVersion: "Neuere Version ansehen",
|
|
4883
|
+
invalidatedConfigurationChanged: "Das Tool, das Konto oder dessen Konfiguration haben sich nach der Vorbereitung geändert. Frag im Chat erneut an.",
|
|
4884
|
+
invalidatedNoSnapshot: "Diese Aktion wurde von einer älteren Version vorbereitet und kann nicht ausgeführt werden. Frag im Chat erneut an.",
|
|
4885
|
+
invalidatedResourceChanged: "Der Termin hat sich nach der Vorbereitung geändert, daher wurde nichts verändert. Frag im Chat erneut an.",
|
|
4886
|
+
unknownOutcome: "Der Anbieter hat nicht bestätigt, ob es passiert ist. Prüfe deine gesendeten Mails oder deinen Kalender, bevor du es erneut versuchst.",
|
|
4887
|
+
unknownInterrupted: "Die Aktion wurde unterbrochen und es ist nicht bekannt, ob sie ausgeführt wurde. Prüfe dein Konto, bevor du es erneut versuchst.",
|
|
4888
|
+
applyingNow: "Wird bereits angewendet…",
|
|
4889
|
+
errorPlainText: "Verwende reinen Text, ohne HTML",
|
|
4890
|
+
errorOffsetMismatch: "Der UTC-Versatz passt nicht zur Zeitzone des Termins",
|
|
4891
|
+
errorNotEditable: "Dieses Feld kann nicht bearbeitet werden",
|
|
4892
|
+
errorInvalidValue: "Dieser Wert ist ungültig"
|
|
4725
4893
|
},
|
|
4726
4894
|
da: {
|
|
4727
4895
|
searchingMail: "Søger i {{service}}",
|
|
@@ -4793,7 +4961,35 @@ const COPY = {
|
|
|
4793
4961
|
statusUnknown: "Ukendt resultat: tjek før du prøver igen",
|
|
4794
4962
|
statusNotFound: "Ikke tilgængelig i denne samtale",
|
|
4795
4963
|
toolUnavailable: "Værktøjet til denne handling er ikke tilgængeligt lige nu",
|
|
4796
|
-
decisionError: "Din beslutning kunne ikke sendes. Prøv igen."
|
|
4964
|
+
decisionError: "Din beslutning kunne ikke sendes. Prøv igen.",
|
|
4965
|
+
edit: "Rediger",
|
|
4966
|
+
saveAndSend: "Gem og send",
|
|
4967
|
+
saveAndConfirm: "Gem og bekræft",
|
|
4968
|
+
discardEdit: "Kassér ændringer",
|
|
4969
|
+
fieldBody: "Besked",
|
|
4970
|
+
fieldStart: "Starter",
|
|
4971
|
+
fieldEnd: "Slutter",
|
|
4972
|
+
addressesHint: "Adskil adresser med komma",
|
|
4973
|
+
timeZoneNote: "Tidszone: {{zone}}",
|
|
4974
|
+
errorRequired: "Feltet må ikke være tomt",
|
|
4975
|
+
errorNoRecipients: "Tilføj mindst én modtager",
|
|
4976
|
+
errorInvalidAddress: "Angiv gyldige mailadresser",
|
|
4977
|
+
errorInvalidDateTime: "Angiv en gyldig dato og tid",
|
|
4978
|
+
errorAmbiguousTime: "Dette tidspunkt findes ikke eller forekommer to gange i {{zone}}. Vælg et andet tidspunkt.",
|
|
4979
|
+
errorEndBeforeStart: "Slutningen skal være efter starten",
|
|
4980
|
+
editNoLongerApplies: "Dine ændringer gælder ikke længere for denne handling. Gennemgå dem og prøv igen.",
|
|
4981
|
+
editedLabel: "Redigeret",
|
|
4982
|
+
seeNewerVersion: "Se den nyere version",
|
|
4983
|
+
invalidatedConfigurationChanged: "Værktøjet, kontoen eller dens konfiguration er ændret, efter at dette blev forberedt. Spørg igen i chatten.",
|
|
4984
|
+
invalidatedNoSnapshot: "Denne handling blev forberedt af en ældre version og kan ikke udføres. Spørg igen i chatten.",
|
|
4985
|
+
invalidatedResourceChanged: "Begivenheden er ændret, efter at dette blev forberedt, så intet blev ændret. Spørg igen i chatten.",
|
|
4986
|
+
unknownOutcome: "Udbyderen bekræftede ikke, om det skete. Tjek dine sendte mails eller din kalender, før du prøver igen.",
|
|
4987
|
+
unknownInterrupted: "Handlingen blev afbrudt, og det vides ikke, om den skete. Tjek din konto, før du prøver igen.",
|
|
4988
|
+
applyingNow: "Bliver allerede anvendt…",
|
|
4989
|
+
errorPlainText: "Brug almindelig tekst uden HTML",
|
|
4990
|
+
errorOffsetMismatch: "UTC-forskydningen passer ikke til begivenhedens tidszone",
|
|
4991
|
+
errorNotEditable: "Dette felt kan ikke redigeres",
|
|
4992
|
+
errorInvalidValue: "Denne værdi er ugyldig"
|
|
4797
4993
|
},
|
|
4798
4994
|
sv: {
|
|
4799
4995
|
searchingMail: "Söker i {{service}}",
|
|
@@ -4865,7 +5061,35 @@ const COPY = {
|
|
|
4865
5061
|
statusUnknown: "Okänt resultat: kontrollera innan du försöker igen",
|
|
4866
5062
|
statusNotFound: "Inte tillgänglig i den här konversationen",
|
|
4867
5063
|
toolUnavailable: "Verktyget för den här åtgärden är inte tillgängligt just nu",
|
|
4868
|
-
decisionError: "Ditt beslut kunde inte skickas. Försök igen."
|
|
5064
|
+
decisionError: "Ditt beslut kunde inte skickas. Försök igen.",
|
|
5065
|
+
edit: "Redigera",
|
|
5066
|
+
saveAndSend: "Spara och skicka",
|
|
5067
|
+
saveAndConfirm: "Spara och bekräfta",
|
|
5068
|
+
discardEdit: "Ignorera ändringar",
|
|
5069
|
+
fieldBody: "Meddelande",
|
|
5070
|
+
fieldStart: "Börjar",
|
|
5071
|
+
fieldEnd: "Slutar",
|
|
5072
|
+
addressesHint: "Separera adresser med kommatecken",
|
|
5073
|
+
timeZoneNote: "Tidszon: {{zone}}",
|
|
5074
|
+
errorRequired: "Fältet får inte vara tomt",
|
|
5075
|
+
errorNoRecipients: "Lägg till minst en mottagare",
|
|
5076
|
+
errorInvalidAddress: "Ange giltiga e-postadresser",
|
|
5077
|
+
errorInvalidDateTime: "Ange ett giltigt datum och en giltig tid",
|
|
5078
|
+
errorAmbiguousTime: "Den här tiden finns inte eller inträffar två gånger i {{zone}}. Välj en annan tid.",
|
|
5079
|
+
errorEndBeforeStart: "Slutet måste vara efter starten",
|
|
5080
|
+
editNoLongerApplies: "Dina ändringar gäller inte längre för den här åtgärden. Granska dem och försök igen.",
|
|
5081
|
+
editedLabel: "Redigerad",
|
|
5082
|
+
seeNewerVersion: "Se den nyare versionen",
|
|
5083
|
+
invalidatedConfigurationChanged: "Verktyget, kontot eller dess inställningar ändrades efter att detta förbereddes. Fråga igen i chatten.",
|
|
5084
|
+
invalidatedNoSnapshot: "Den här åtgärden förbereddes av en äldre version och kan inte köras. Fråga igen i chatten.",
|
|
5085
|
+
invalidatedResourceChanged: "Händelsen ändrades efter att detta förbereddes, så inget ändrades. Fråga igen i chatten.",
|
|
5086
|
+
unknownOutcome: "Leverantören bekräftade inte om det hände. Kontrollera dina skickade mejl eller din kalender innan du försöker igen.",
|
|
5087
|
+
unknownInterrupted: "Åtgärden avbröts och det är inte känt om den hände. Kontrollera ditt konto innan du försöker igen.",
|
|
5088
|
+
applyingNow: "Tillämpas redan…",
|
|
5089
|
+
errorPlainText: "Använd vanlig text, utan HTML",
|
|
5090
|
+
errorOffsetMismatch: "UTC-förskjutningen stämmer inte med händelsens tidszon",
|
|
5091
|
+
errorNotEditable: "Det här fältet kan inte redigeras",
|
|
5092
|
+
errorInvalidValue: "Det här värdet är ogiltigt"
|
|
4869
5093
|
},
|
|
4870
5094
|
no: {
|
|
4871
5095
|
searchingMail: "Søker i {{service}}",
|
|
@@ -4937,7 +5161,35 @@ const COPY = {
|
|
|
4937
5161
|
statusUnknown: "Ukjent resultat: sjekk før du prøver igjen",
|
|
4938
5162
|
statusNotFound: "Ikke tilgjengelig i denne samtalen",
|
|
4939
5163
|
toolUnavailable: "Verktøyet for denne handlingen er ikke tilgjengelig nå",
|
|
4940
|
-
decisionError: "Beslutningen din kunne ikke sendes. Prøv igjen."
|
|
5164
|
+
decisionError: "Beslutningen din kunne ikke sendes. Prøv igjen.",
|
|
5165
|
+
edit: "Rediger",
|
|
5166
|
+
saveAndSend: "Lagre og send",
|
|
5167
|
+
saveAndConfirm: "Lagre og bekreft",
|
|
5168
|
+
discardEdit: "Forkast endringer",
|
|
5169
|
+
fieldBody: "Melding",
|
|
5170
|
+
fieldStart: "Starter",
|
|
5171
|
+
fieldEnd: "Slutter",
|
|
5172
|
+
addressesHint: "Skill adresser med komma",
|
|
5173
|
+
timeZoneNote: "Tidssone: {{zone}}",
|
|
5174
|
+
errorRequired: "Feltet kan ikke være tomt",
|
|
5175
|
+
errorNoRecipients: "Legg til minst én mottaker",
|
|
5176
|
+
errorInvalidAddress: "Skriv inn gyldige e-postadresser",
|
|
5177
|
+
errorInvalidDateTime: "Skriv inn en gyldig dato og tid",
|
|
5178
|
+
errorAmbiguousTime: "Dette tidspunktet finnes ikke eller forekommer to ganger i {{zone}}. Velg et annet tidspunkt.",
|
|
5179
|
+
errorEndBeforeStart: "Slutten må være etter starten",
|
|
5180
|
+
editNoLongerApplies: "Endringene dine gjelder ikke lenger for denne handlingen. Gå gjennom dem og prøv igjen.",
|
|
5181
|
+
editedLabel: "Redigert",
|
|
5182
|
+
seeNewerVersion: "Se den nyere versjonen",
|
|
5183
|
+
invalidatedConfigurationChanged: "Verktøyet, kontoen eller konfigurasjonen ble endret etter at dette ble forberedt. Spør igjen i chatten.",
|
|
5184
|
+
invalidatedNoSnapshot: "Denne handlingen ble forberedt av en eldre versjon og kan ikke kjøres. Spør igjen i chatten.",
|
|
5185
|
+
invalidatedResourceChanged: "Hendelsen ble endret etter at dette ble forberedt, så ingenting ble endret. Spør igjen i chatten.",
|
|
5186
|
+
unknownOutcome: "Leverandøren bekreftet ikke om det skjedde. Sjekk sendte e-poster eller kalenderen før du prøver igjen.",
|
|
5187
|
+
unknownInterrupted: "Handlingen ble avbrutt, og det er ikke kjent om den skjedde. Sjekk kontoen din før du prøver igjen.",
|
|
5188
|
+
applyingNow: "Blir allerede brukt…",
|
|
5189
|
+
errorPlainText: "Bruk vanlig tekst, uten HTML",
|
|
5190
|
+
errorOffsetMismatch: "UTC-forskyvningen stemmer ikke med hendelsens tidssone",
|
|
5191
|
+
errorNotEditable: "Dette feltet kan ikke redigeres",
|
|
5192
|
+
errorInvalidValue: "Denne verdien er ugyldig"
|
|
4941
5193
|
},
|
|
4942
5194
|
pt: {
|
|
4943
5195
|
searchingMail: "Pesquisando no {{service}}",
|
|
@@ -5009,7 +5261,35 @@ const COPY = {
|
|
|
5009
5261
|
statusUnknown: "Resultado desconhecido: verifique antes de tentar de novo",
|
|
5010
5262
|
statusNotFound: "Indisponível nesta conversa",
|
|
5011
5263
|
toolUnavailable: "A ferramenta desta ação não está disponível agora",
|
|
5012
|
-
decisionError: "Não foi possível enviar sua decisão. Tente novamente."
|
|
5264
|
+
decisionError: "Não foi possível enviar sua decisão. Tente novamente.",
|
|
5265
|
+
edit: "Editar",
|
|
5266
|
+
saveAndSend: "Salvar e enviar",
|
|
5267
|
+
saveAndConfirm: "Salvar e confirmar",
|
|
5268
|
+
discardEdit: "Descartar alterações",
|
|
5269
|
+
fieldBody: "Mensagem",
|
|
5270
|
+
fieldStart: "Início",
|
|
5271
|
+
fieldEnd: "Fim",
|
|
5272
|
+
addressesHint: "Separe os endereços com vírgulas",
|
|
5273
|
+
timeZoneNote: "Fuso horário: {{zone}}",
|
|
5274
|
+
errorRequired: "Este campo não pode ficar vazio",
|
|
5275
|
+
errorNoRecipients: "Adicione pelo menos um destinatário",
|
|
5276
|
+
errorInvalidAddress: "Informe endereços de e-mail válidos",
|
|
5277
|
+
errorInvalidDateTime: "Informe uma data e hora válidas",
|
|
5278
|
+
errorAmbiguousTime: "Este horário não existe ou se repete em {{zone}}. Escolha outro horário.",
|
|
5279
|
+
errorEndBeforeStart: "O fim deve ser posterior ao início",
|
|
5280
|
+
editNoLongerApplies: "Suas alterações não se aplicam mais a esta ação. Revise-as e tente novamente.",
|
|
5281
|
+
editedLabel: "Editada",
|
|
5282
|
+
seeNewerVersion: "Ver a versão mais recente",
|
|
5283
|
+
invalidatedConfigurationChanged: "A ferramenta, a conta ou a configuração mudaram depois de preparar isto. Peça de novo no chat.",
|
|
5284
|
+
invalidatedNoSnapshot: "Esta ação foi preparada por uma versão anterior e não pode ser executada. Peça de novo no chat.",
|
|
5285
|
+
invalidatedResourceChanged: "O evento mudou depois de preparar isto, então nada foi modificado. Peça de novo no chat.",
|
|
5286
|
+
unknownOutcome: "O provedor não confirmou se aconteceu. Verifique seus enviados ou sua agenda antes de tentar de novo.",
|
|
5287
|
+
unknownInterrupted: "A ação foi interrompida e não se sabe se aconteceu. Verifique sua conta antes de tentar de novo.",
|
|
5288
|
+
applyingNow: "Já está sendo aplicado…",
|
|
5289
|
+
errorPlainText: "Use texto simples, sem HTML",
|
|
5290
|
+
errorOffsetMismatch: "O deslocamento UTC não corresponde ao fuso horário do evento",
|
|
5291
|
+
errorNotEditable: "Este campo não pode ser editado",
|
|
5292
|
+
errorInvalidValue: "Este valor não é válido"
|
|
5013
5293
|
}
|
|
5014
5294
|
};
|
|
5015
5295
|
function getPersonalConnectorCopy(locale) {
|
|
@@ -5022,6 +5302,349 @@ function fillCopy(template, values) {
|
|
|
5022
5302
|
return template.replace(/\{\{(\w+)\}\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
5023
5303
|
}
|
|
5024
5304
|
|
|
5305
|
+
//#endregion
|
|
5306
|
+
//#region src/components/internal/tool-confirmation-edit.ts
|
|
5307
|
+
const FIELD_KINDS = {
|
|
5308
|
+
to: "addresses",
|
|
5309
|
+
cc: "addresses",
|
|
5310
|
+
attendees: "addresses",
|
|
5311
|
+
subject: "text",
|
|
5312
|
+
title: "text",
|
|
5313
|
+
location: "text",
|
|
5314
|
+
body: "textarea",
|
|
5315
|
+
start: "datetime",
|
|
5316
|
+
end: "datetime"
|
|
5317
|
+
};
|
|
5318
|
+
/** Editable fields in the order the form shows them. */
|
|
5319
|
+
const FIELD_ORDER = [
|
|
5320
|
+
"to",
|
|
5321
|
+
"cc",
|
|
5322
|
+
"subject",
|
|
5323
|
+
"body",
|
|
5324
|
+
"title",
|
|
5325
|
+
"start",
|
|
5326
|
+
"end",
|
|
5327
|
+
"location",
|
|
5328
|
+
"attendees"
|
|
5329
|
+
];
|
|
5330
|
+
/** Fields of this action the card can show a control for. */
|
|
5331
|
+
function editableFields(pending) {
|
|
5332
|
+
const allowed = new Set(pending.editable ?? []);
|
|
5333
|
+
return FIELD_ORDER.filter((field) => allowed.has(field));
|
|
5334
|
+
}
|
|
5335
|
+
/**
|
|
5336
|
+
* Copy of each stable code the server sends for a rejected edit. A code this client does
|
|
5337
|
+
* not know falls back to the server's English message instead of hiding the problem.
|
|
5338
|
+
*/
|
|
5339
|
+
const SERVER_ERROR_COPY = {
|
|
5340
|
+
needs_recipient: "errorNoRecipients",
|
|
5341
|
+
invalid_address: "errorInvalidAddress",
|
|
5342
|
+
must_be_address_list: "errorInvalidAddress",
|
|
5343
|
+
too_many_addresses: "errorInvalidAddress",
|
|
5344
|
+
cannot_be_empty: "errorRequired",
|
|
5345
|
+
cannot_be_null: "errorRequired",
|
|
5346
|
+
plain_text_only: "errorPlainText",
|
|
5347
|
+
invalid_datetime: "errorInvalidDateTime",
|
|
5348
|
+
ambiguous_time: "errorAmbiguousTime",
|
|
5349
|
+
end_before_start: "errorEndBeforeStart",
|
|
5350
|
+
offset_mismatch: "errorOffsetMismatch",
|
|
5351
|
+
not_editable: "errorNotEditable",
|
|
5352
|
+
cannot_change: "errorNotEditable",
|
|
5353
|
+
not_replaceable: "errorNotEditable",
|
|
5354
|
+
must_be_text: "errorInvalidValue",
|
|
5355
|
+
too_long: "errorInvalidValue"
|
|
5356
|
+
};
|
|
5357
|
+
const OFFSET_SUFFIX = /(Z|[+-]\d{2}:?\d{2})$/i;
|
|
5358
|
+
function parseOffsetMinutes(value) {
|
|
5359
|
+
const match = OFFSET_SUFFIX.exec(value.trim());
|
|
5360
|
+
if (!match) return null;
|
|
5361
|
+
const text$2 = match[1].toUpperCase();
|
|
5362
|
+
if (text$2 === "Z") return 0;
|
|
5363
|
+
const sign = text$2[0] === "-" ? -1 : 1;
|
|
5364
|
+
const digits = text$2.slice(1).replace(":", "");
|
|
5365
|
+
return sign * (Number(digits.slice(0, 2)) * 60 + Number(digits.slice(2, 4)));
|
|
5366
|
+
}
|
|
5367
|
+
function formatOffset(minutes) {
|
|
5368
|
+
const sign = minutes < 0 ? "-" : "+";
|
|
5369
|
+
const abs = Math.abs(minutes);
|
|
5370
|
+
return `${sign}${String(Math.floor(abs / 60)).padStart(2, "0")}:${String(abs % 60).padStart(2, "0")}`;
|
|
5371
|
+
}
|
|
5372
|
+
function isValidZone(name) {
|
|
5373
|
+
try {
|
|
5374
|
+
new Intl.DateTimeFormat("en-US", { timeZone: name });
|
|
5375
|
+
return true;
|
|
5376
|
+
} catch {
|
|
5377
|
+
return false;
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
/**
|
|
5381
|
+
* The zone of the action: its own `time_zone`, else the offset its dates were
|
|
5382
|
+
* prepared with, else UTC (how the server reads a date without offset).
|
|
5383
|
+
*/
|
|
5384
|
+
function actionZone(action) {
|
|
5385
|
+
const named = action.time_zone;
|
|
5386
|
+
if (typeof named === "string" && isValidZone(named)) return {
|
|
5387
|
+
kind: "iana",
|
|
5388
|
+
name: named
|
|
5389
|
+
};
|
|
5390
|
+
for (const field of ["start", "end"]) {
|
|
5391
|
+
const value = action[field];
|
|
5392
|
+
const minutes = typeof value === "string" ? parseOffsetMinutes(value) : null;
|
|
5393
|
+
if (minutes !== null) return {
|
|
5394
|
+
kind: "offset",
|
|
5395
|
+
minutes,
|
|
5396
|
+
label: `UTC${formatOffset(minutes)}`
|
|
5397
|
+
};
|
|
5398
|
+
}
|
|
5399
|
+
return {
|
|
5400
|
+
kind: "offset",
|
|
5401
|
+
minutes: 0,
|
|
5402
|
+
label: "UTC"
|
|
5403
|
+
};
|
|
5404
|
+
}
|
|
5405
|
+
function zoneLabel(zone) {
|
|
5406
|
+
return zone.kind === "iana" ? zone.name : zone.label;
|
|
5407
|
+
}
|
|
5408
|
+
const formatters = /* @__PURE__ */ new Map();
|
|
5409
|
+
/** Wall clock of an instant in `zone`, as if it were UTC (ms). */
|
|
5410
|
+
function wallClockMs(instant, name) {
|
|
5411
|
+
let formatter = formatters.get(name);
|
|
5412
|
+
if (!formatter) {
|
|
5413
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
5414
|
+
timeZone: name,
|
|
5415
|
+
hourCycle: "h23",
|
|
5416
|
+
year: "numeric",
|
|
5417
|
+
month: "2-digit",
|
|
5418
|
+
day: "2-digit",
|
|
5419
|
+
hour: "2-digit",
|
|
5420
|
+
minute: "2-digit",
|
|
5421
|
+
second: "2-digit"
|
|
5422
|
+
});
|
|
5423
|
+
formatters.set(name, formatter);
|
|
5424
|
+
}
|
|
5425
|
+
const parts = {};
|
|
5426
|
+
for (const part of formatter.formatToParts(new Date(instant))) if (part.type !== "literal") parts[part.type] = Number(part.value);
|
|
5427
|
+
return Date.UTC(parts.year, parts.month - 1, parts.day, parts.hour === 24 ? 0 : parts.hour, parts.minute, parts.second);
|
|
5428
|
+
}
|
|
5429
|
+
/** Offset of `name` at `instant`, in minutes east of UTC. */
|
|
5430
|
+
function offsetMinutesAt(instant, name) {
|
|
5431
|
+
return Math.round((wallClockMs(instant, name) - instant) / 6e4);
|
|
5432
|
+
}
|
|
5433
|
+
const LOCAL_INPUT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/;
|
|
5434
|
+
function pad(value) {
|
|
5435
|
+
return String(value).padStart(2, "0");
|
|
5436
|
+
}
|
|
5437
|
+
function toInputValue(wallMs) {
|
|
5438
|
+
const date = new Date(wallMs);
|
|
5439
|
+
return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}T${pad(date.getUTCHours())}:${pad(date.getUTCMinutes())}`;
|
|
5440
|
+
}
|
|
5441
|
+
/** `YYYY-MM-DDTHH:mm` (a `datetime-local` value) of an ISO date, in `zone`. */
|
|
5442
|
+
function isoToLocalInput(iso, zone) {
|
|
5443
|
+
const text$2 = iso.trim();
|
|
5444
|
+
if (!OFFSET_SUFFIX.test(text$2)) {
|
|
5445
|
+
const naive = LOCAL_INPUT.exec(text$2);
|
|
5446
|
+
return naive ? `${naive[1]}-${naive[2]}-${naive[3]}T${naive[4]}:${naive[5]}` : null;
|
|
5447
|
+
}
|
|
5448
|
+
const instant = Date.parse(text$2);
|
|
5449
|
+
if (Number.isNaN(instant)) return null;
|
|
5450
|
+
return toInputValue(zone.kind === "iana" ? wallClockMs(instant, zone.name) : instant + zone.minutes * 6e4);
|
|
5451
|
+
}
|
|
5452
|
+
/**
|
|
5453
|
+
* ISO 8601 with the UTC offset `zone` has at that wall clock time. A time that
|
|
5454
|
+
* happens twice (clocks go back) or never (clocks go forward) has no single
|
|
5455
|
+
* valid offset: it is rejected so the user picks another one.
|
|
5456
|
+
*/
|
|
5457
|
+
function localInputToIso(local, zone) {
|
|
5458
|
+
const match = LOCAL_INPUT.exec(local.trim());
|
|
5459
|
+
if (!match) return { error: "invalid" };
|
|
5460
|
+
const [, year, month, day, hour, minute] = match;
|
|
5461
|
+
const wall = Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute));
|
|
5462
|
+
if (Number.isNaN(wall) || toInputValue(wall) !== local.trim().slice(0, 16)) return { error: "invalid" };
|
|
5463
|
+
const stamp = `${year}-${month}-${day}T${hour}:${minute}:00`;
|
|
5464
|
+
if (zone.kind === "offset") return { iso: `${stamp}${formatOffset(zone.minutes)}` };
|
|
5465
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
5466
|
+
for (const probe of [wall - 864e5, wall + 864e5]) {
|
|
5467
|
+
const offset$1 = offsetMinutesAt(probe, zone.name);
|
|
5468
|
+
if (wallClockMs(wall - offset$1 * 6e4, zone.name) === wall) candidates.add(offset$1);
|
|
5469
|
+
}
|
|
5470
|
+
if (candidates.size !== 1) return { error: "ambiguous" };
|
|
5471
|
+
const [offset] = candidates;
|
|
5472
|
+
return { iso: `${stamp}${formatOffset(offset)}` };
|
|
5473
|
+
}
|
|
5474
|
+
const EMAIL = /^[^@\s<>,;]+@[^@\s<>,;]+\.[^@\s<>,;]+$/;
|
|
5475
|
+
function asString(value) {
|
|
5476
|
+
return typeof value === "string" ? value : "";
|
|
5477
|
+
}
|
|
5478
|
+
/** What each field shows when the form opens: the prepared values. */
|
|
5479
|
+
function initialDraft(pending) {
|
|
5480
|
+
const action = pending.action;
|
|
5481
|
+
const zone = actionZone(action);
|
|
5482
|
+
const draft = {};
|
|
5483
|
+
for (const field of editableFields(pending)) {
|
|
5484
|
+
const value = action[field];
|
|
5485
|
+
switch (FIELD_KINDS[field]) {
|
|
5486
|
+
case "addresses":
|
|
5487
|
+
draft[field] = Array.isArray(value) ? value.filter((item) => typeof item === "string").join(", ") : "";
|
|
5488
|
+
break;
|
|
5489
|
+
case "datetime":
|
|
5490
|
+
draft[field] = typeof value === "string" ? isoToLocalInput(value, zone) ?? "" : "";
|
|
5491
|
+
break;
|
|
5492
|
+
default: draft[field] = asString(value);
|
|
5493
|
+
}
|
|
5494
|
+
}
|
|
5495
|
+
return draft;
|
|
5496
|
+
}
|
|
5497
|
+
function splitAddresses(text$2) {
|
|
5498
|
+
return text$2.split(/[,;\n]/).map((address) => address.trim()).filter(Boolean);
|
|
5499
|
+
}
|
|
5500
|
+
/**
|
|
5501
|
+
* The patch for `draft` against the prepared values, or the field errors that
|
|
5502
|
+
* stop it. Unchanged fields are left out so the server keeps their exact value.
|
|
5503
|
+
*/
|
|
5504
|
+
function buildPatch(pending, draft, initial = initialDraft(pending)) {
|
|
5505
|
+
const action = pending.action;
|
|
5506
|
+
const zone = actionZone(action);
|
|
5507
|
+
const zoneName = zoneLabel(zone);
|
|
5508
|
+
const patch = {};
|
|
5509
|
+
const errors = {};
|
|
5510
|
+
for (const field of editableFields(pending)) {
|
|
5511
|
+
const value = draft[field] ?? "";
|
|
5512
|
+
if (value === (initial[field] ?? "")) continue;
|
|
5513
|
+
switch (FIELD_KINDS[field]) {
|
|
5514
|
+
case "addresses": {
|
|
5515
|
+
const addresses = splitAddresses(value);
|
|
5516
|
+
if (addresses.some((address) => !EMAIL.test(address))) errors[field] = { key: "invalidAddress" };
|
|
5517
|
+
else if (field === "to" && addresses.length === 0) errors[field] = { key: "noRecipients" };
|
|
5518
|
+
else patch[field] = addresses;
|
|
5519
|
+
break;
|
|
5520
|
+
}
|
|
5521
|
+
case "datetime": {
|
|
5522
|
+
const converted = localInputToIso(value, zone);
|
|
5523
|
+
if (converted.error === "ambiguous") errors[field] = {
|
|
5524
|
+
key: "ambiguousTime",
|
|
5525
|
+
zone: zoneName
|
|
5526
|
+
};
|
|
5527
|
+
else if (converted.error) errors[field] = { key: "invalidDateTime" };
|
|
5528
|
+
else patch[field] = converted.iso;
|
|
5529
|
+
break;
|
|
5530
|
+
}
|
|
5531
|
+
case "text":
|
|
5532
|
+
if (value.trim() === "") if (field === "location") patch[field] = null;
|
|
5533
|
+
else errors[field] = { key: "required" };
|
|
5534
|
+
else patch[field] = value;
|
|
5535
|
+
break;
|
|
5536
|
+
default: patch[field] = value;
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
const start = readInstant(patch.start, action.start);
|
|
5540
|
+
const end = readInstant(patch.end, action.end);
|
|
5541
|
+
if (!errors.end && !errors.start && (patch.start !== void 0 || patch.end !== void 0) && start !== null && end !== null && start >= end) errors.end = { key: "endBeforeStart" };
|
|
5542
|
+
return {
|
|
5543
|
+
patch,
|
|
5544
|
+
errors
|
|
5545
|
+
};
|
|
5546
|
+
}
|
|
5547
|
+
function readInstant(edited, original) {
|
|
5548
|
+
const value = typeof edited === "string" ? edited : original;
|
|
5549
|
+
if (typeof value !== "string") return null;
|
|
5550
|
+
const parsed = Date.parse(value);
|
|
5551
|
+
return Number.isNaN(parsed) ? null : parsed;
|
|
5552
|
+
}
|
|
5553
|
+
|
|
5554
|
+
//#endregion
|
|
5555
|
+
//#region src/components/tool-confirmation-edit-form.tsx
|
|
5556
|
+
const LABELS = {
|
|
5557
|
+
to: "to",
|
|
5558
|
+
cc: "cc",
|
|
5559
|
+
subject: "subject",
|
|
5560
|
+
body: "fieldBody",
|
|
5561
|
+
title: "title",
|
|
5562
|
+
start: "fieldStart",
|
|
5563
|
+
end: "fieldEnd",
|
|
5564
|
+
location: "location",
|
|
5565
|
+
attendees: "attendees"
|
|
5566
|
+
};
|
|
5567
|
+
const ERROR_COPY = {
|
|
5568
|
+
required: "errorRequired",
|
|
5569
|
+
noRecipients: "errorNoRecipients",
|
|
5570
|
+
invalidAddress: "errorInvalidAddress",
|
|
5571
|
+
invalidDateTime: "errorInvalidDateTime",
|
|
5572
|
+
ambiguousTime: "errorAmbiguousTime",
|
|
5573
|
+
endBeforeStart: "errorEndBeforeStart"
|
|
5574
|
+
};
|
|
5575
|
+
const INPUT_CLASS = "w-full rounded-md border border-border-strong bg-surface px-2 py-1.5 text-xs text-foreground disabled:opacity-50 aria-[invalid=true]:border-danger";
|
|
5576
|
+
/**
|
|
5577
|
+
* Inline form to change an action before confirming it. Only the fields the
|
|
5578
|
+
* server declared editable are shown. The draft lives in the parent, so it
|
|
5579
|
+
* survives validation errors and a busy thread.
|
|
5580
|
+
*/
|
|
5581
|
+
function ToolConfirmationEditForm({ pending, draft, onChange, errors, serverErrors, disabled, copy }) {
|
|
5582
|
+
const baseId = useId();
|
|
5583
|
+
const fields = editableFields(pending);
|
|
5584
|
+
const zone = zoneLabel(actionZone(pending.action));
|
|
5585
|
+
return /* @__PURE__ */ jsx("div", {
|
|
5586
|
+
className: "space-y-2 border-t border-border bg-surface px-3 py-3",
|
|
5587
|
+
"data-confirmation-edit": pending.action_id,
|
|
5588
|
+
children: fields.map((field) => {
|
|
5589
|
+
const kind = FIELD_KINDS[field];
|
|
5590
|
+
const id = `${baseId}-${field}`;
|
|
5591
|
+
const errorId = `${id}-error`;
|
|
5592
|
+
const clientError = errors[field];
|
|
5593
|
+
const serverError = serverErrors[field];
|
|
5594
|
+
const serverKey = serverError?.code ? SERVER_ERROR_COPY[serverError.code] : void 0;
|
|
5595
|
+
const message = clientError ? fillCopy(copy[ERROR_COPY[clientError.key]], { zone: clientError.zone ?? zone }) : serverKey ? fillCopy(copy[serverKey], { zone }) : serverError?.message;
|
|
5596
|
+
const common = {
|
|
5597
|
+
id,
|
|
5598
|
+
name: field,
|
|
5599
|
+
value: draft[field] ?? "",
|
|
5600
|
+
disabled,
|
|
5601
|
+
"aria-invalid": message ? true : void 0,
|
|
5602
|
+
"aria-describedby": message ? errorId : void 0,
|
|
5603
|
+
className: INPUT_CLASS
|
|
5604
|
+
};
|
|
5605
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5606
|
+
className: "space-y-1",
|
|
5607
|
+
children: [
|
|
5608
|
+
/* @__PURE__ */ jsx("label", {
|
|
5609
|
+
htmlFor: id,
|
|
5610
|
+
className: "block text-xs font-medium text-strong",
|
|
5611
|
+
children: copy[LABELS[field]]
|
|
5612
|
+
}),
|
|
5613
|
+
kind === "textarea" ? /* @__PURE__ */ jsx("textarea", {
|
|
5614
|
+
...common,
|
|
5615
|
+
rows: 5,
|
|
5616
|
+
onChange: (event) => onChange(field, event.target.value)
|
|
5617
|
+
}) : kind === "datetime" ? /* @__PURE__ */ jsx("input", {
|
|
5618
|
+
...common,
|
|
5619
|
+
type: "datetime-local",
|
|
5620
|
+
step: 60,
|
|
5621
|
+
onChange: (event) => onChange(field, event.target.value)
|
|
5622
|
+
}) : /* @__PURE__ */ jsx("input", {
|
|
5623
|
+
...common,
|
|
5624
|
+
type: "text",
|
|
5625
|
+
autoComplete: "off",
|
|
5626
|
+
onChange: (event) => onChange(field, event.target.value)
|
|
5627
|
+
}),
|
|
5628
|
+
kind === "addresses" ? /* @__PURE__ */ jsx("p", {
|
|
5629
|
+
className: "text-xs text-muted",
|
|
5630
|
+
children: copy.addressesHint
|
|
5631
|
+
}) : null,
|
|
5632
|
+
kind === "datetime" ? /* @__PURE__ */ jsx("p", {
|
|
5633
|
+
className: "text-xs text-muted",
|
|
5634
|
+
children: fillCopy(copy.timeZoneNote, { zone })
|
|
5635
|
+
}) : null,
|
|
5636
|
+
message ? /* @__PURE__ */ jsx("p", {
|
|
5637
|
+
id: errorId,
|
|
5638
|
+
role: "alert",
|
|
5639
|
+
className: joinClasses("text-xs text-danger-strong"),
|
|
5640
|
+
children: message
|
|
5641
|
+
}) : null
|
|
5642
|
+
]
|
|
5643
|
+
}, field);
|
|
5644
|
+
})
|
|
5645
|
+
});
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5025
5648
|
//#endregion
|
|
5026
5649
|
//#region src/components/tool-confirmation-controls.tsx
|
|
5027
5650
|
const MINUTE = 6e4;
|
|
@@ -5065,6 +5688,26 @@ function statusLabel(status, copy) {
|
|
|
5065
5688
|
const key = STATUS_COPY[status];
|
|
5066
5689
|
return key ? copy[key] : null;
|
|
5067
5690
|
}
|
|
5691
|
+
const REASON_COPY = {
|
|
5692
|
+
invalidated: {
|
|
5693
|
+
configuration_changed: "invalidatedConfigurationChanged",
|
|
5694
|
+
no_snapshot: "invalidatedNoSnapshot",
|
|
5695
|
+
resource_changed: "invalidatedResourceChanged"
|
|
5696
|
+
},
|
|
5697
|
+
unknown: {
|
|
5698
|
+
outcome_unknown: "unknownOutcome",
|
|
5699
|
+
interrupted: "unknownInterrupted"
|
|
5700
|
+
}
|
|
5701
|
+
};
|
|
5702
|
+
/**
|
|
5703
|
+
* Why an action ended as `invalidated` or `unknown`, from the safe reason code the
|
|
5704
|
+
* server stores. A code this client does not know shows nothing extra: the status
|
|
5705
|
+
* label still says what happened.
|
|
5706
|
+
*/
|
|
5707
|
+
function reasonLabel(status, reason, copy) {
|
|
5708
|
+
const key = reason ? REASON_COPY[status]?.[reason] : void 0;
|
|
5709
|
+
return key ? copy[key] : null;
|
|
5710
|
+
}
|
|
5068
5711
|
const BADGE_TONE = {
|
|
5069
5712
|
pending: "border-warning-border bg-warning-subtle text-warning-strong",
|
|
5070
5713
|
executing: "border-sky-200 bg-sky-50 text-sky-800",
|
|
@@ -5092,15 +5735,37 @@ function expiryText(state, serverOffsetMs, now, copy) {
|
|
|
5092
5735
|
if (Number.isNaN(left) || left <= 0) return null;
|
|
5093
5736
|
return left < MINUTE ? copy.expiresSoon : fillCopy(copy.expiresIn, { minutes: Math.floor(left / MINUTE) });
|
|
5094
5737
|
}
|
|
5738
|
+
/** Label of the button that saves an edit and runs the action in one step. */
|
|
5739
|
+
function saveLabel(operation, copy) {
|
|
5740
|
+
return operation === "send" ? copy.saveAndSend : copy.saveAndConfirm;
|
|
5741
|
+
}
|
|
5742
|
+
/** Scrolls to the card of another version of the same action, if it is on screen. */
|
|
5743
|
+
function showAction(actionId) {
|
|
5744
|
+
if (typeof document === "undefined") return;
|
|
5745
|
+
for (const element of document.querySelectorAll("[data-confirmation-action]")) if (element.getAttribute("data-confirmation-action") === actionId) {
|
|
5746
|
+
element.scrollIntoView?.({
|
|
5747
|
+
block: "center",
|
|
5748
|
+
behavior: "smooth"
|
|
5749
|
+
});
|
|
5750
|
+
return;
|
|
5751
|
+
}
|
|
5752
|
+
}
|
|
5095
5753
|
/**
|
|
5096
5754
|
* Footer of a held action. Without `toolConfirmation` it keeps the text hint
|
|
5097
|
-
* (reply "yes"); with it, buttons once the server state is known.
|
|
5755
|
+
* (reply "yes"); with it, buttons once the server state is known. When the
|
|
5756
|
+
* server lets the user edit the action, an inline form is offered and "Save
|
|
5757
|
+
* and send" confirms with the changes in a single step.
|
|
5098
5758
|
*/
|
|
5099
5759
|
function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
5100
5760
|
const state = useToolConfirmationState(pending, toolConfirmation);
|
|
5101
5761
|
const now = useNow(state?.status === "pending");
|
|
5102
5762
|
const [sending, setSending] = useState(null);
|
|
5103
5763
|
const [failed, setFailed] = useState(false);
|
|
5764
|
+
const [editing, setEditing] = useState(false);
|
|
5765
|
+
const [draft, setDraft] = useState({});
|
|
5766
|
+
const [fieldErrors, setFieldErrors] = useState({});
|
|
5767
|
+
const [serverErrors, setServerErrors] = useState({});
|
|
5768
|
+
const [applying, setApplying] = useState(false);
|
|
5104
5769
|
if (!toolConfirmation) return /* @__PURE__ */ jsx("p", {
|
|
5105
5770
|
className: "border-t border-border bg-warning-subtle/60 px-3 py-2 text-xs text-strong",
|
|
5106
5771
|
children: copy.confirmHint
|
|
@@ -5112,48 +5777,130 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
5112
5777
|
});
|
|
5113
5778
|
if (state.status !== "pending") {
|
|
5114
5779
|
const label = statusLabel(state.status, copy);
|
|
5780
|
+
const reason = reasonLabel(state.status, state.error, copy);
|
|
5115
5781
|
return label ? /* @__PURE__ */ jsxs("p", {
|
|
5116
|
-
className: "border-t border-divider bg-surface-muted px-3 py-2 text-xs text-strong",
|
|
5782
|
+
className: "flex flex-wrap items-center gap-2 border-t border-divider bg-surface-muted px-3 py-2 text-xs text-strong",
|
|
5117
5783
|
"aria-live": "polite",
|
|
5118
|
-
children: [
|
|
5784
|
+
children: [
|
|
5785
|
+
/* @__PURE__ */ jsxs("span", { children: [label, state.status === "failed" && state.error ? `: ${state.error}` : null] }),
|
|
5786
|
+
reason ? /* @__PURE__ */ jsx("span", {
|
|
5787
|
+
className: "basis-full text-muted",
|
|
5788
|
+
"data-confirmation-reason": true,
|
|
5789
|
+
children: reason
|
|
5790
|
+
}) : null,
|
|
5791
|
+
state.status === "superseded" && state.supersededBy ? /* @__PURE__ */ jsx("button", {
|
|
5792
|
+
type: "button",
|
|
5793
|
+
className: "underline underline-offset-2 hover:text-foreground",
|
|
5794
|
+
onClick: () => showAction(state.supersededBy),
|
|
5795
|
+
children: copy.seeNewerVersion
|
|
5796
|
+
}) : null,
|
|
5797
|
+
state.effectiveAction ? /* @__PURE__ */ jsx("span", {
|
|
5798
|
+
className: "rounded-full border border-border bg-surface px-2 py-0.5 text-muted",
|
|
5799
|
+
children: copy.editedLabel
|
|
5800
|
+
}) : null
|
|
5801
|
+
]
|
|
5119
5802
|
}) : null;
|
|
5120
5803
|
}
|
|
5121
|
-
const decide = async (
|
|
5122
|
-
setSending(decision);
|
|
5804
|
+
const decide = async (decisions) => {
|
|
5123
5805
|
setFailed(false);
|
|
5806
|
+
setApplying(false);
|
|
5124
5807
|
try {
|
|
5125
|
-
await toolConfirmation.decide(
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5808
|
+
await toolConfirmation.decide(decisions);
|
|
5809
|
+
} catch (error) {
|
|
5810
|
+
if (error instanceof ToolDecisionRejectedError && error.details.actionId === pending.action_id) setServerErrors(Object.fromEntries(error.details.errors.map(({ field, message, code }) => [field, {
|
|
5811
|
+
message,
|
|
5812
|
+
...code ? { code } : {}
|
|
5813
|
+
}])));
|
|
5814
|
+
else if (error instanceof ToolSubmissionConflictError && error.details.code === "decision_in_progress") setApplying(true);
|
|
5815
|
+
else setFailed(true);
|
|
5133
5816
|
}
|
|
5134
5817
|
};
|
|
5818
|
+
const send = async (decision) => {
|
|
5819
|
+
setSending(decision);
|
|
5820
|
+
await decide([{
|
|
5821
|
+
action_id: pending.action_id,
|
|
5822
|
+
decision
|
|
5823
|
+
}]);
|
|
5824
|
+
setSending(null);
|
|
5825
|
+
};
|
|
5826
|
+
const saveAndConfirm = async () => {
|
|
5827
|
+
const { patch, errors } = buildPatch(pending, draft);
|
|
5828
|
+
setFieldErrors(errors);
|
|
5829
|
+
setServerErrors({});
|
|
5830
|
+
if (Object.keys(errors).length > 0) return;
|
|
5831
|
+
setSending("confirm");
|
|
5832
|
+
await decide([{
|
|
5833
|
+
action_id: pending.action_id,
|
|
5834
|
+
decision: "confirm",
|
|
5835
|
+
...Object.keys(patch).length > 0 ? { arguments: patch } : {}
|
|
5836
|
+
}]);
|
|
5837
|
+
setSending(null);
|
|
5838
|
+
};
|
|
5839
|
+
const startEditing = () => {
|
|
5840
|
+
setDraft(initialDraft(pending));
|
|
5841
|
+
setFieldErrors({});
|
|
5842
|
+
setServerErrors({});
|
|
5843
|
+
setFailed(false);
|
|
5844
|
+
setEditing(true);
|
|
5845
|
+
};
|
|
5846
|
+
const stopEditing = () => {
|
|
5847
|
+
setEditing(false);
|
|
5848
|
+
setFieldErrors({});
|
|
5849
|
+
setServerErrors({});
|
|
5850
|
+
};
|
|
5135
5851
|
const disabled = Boolean(toolConfirmation.disabled) || sending !== null;
|
|
5136
5852
|
const destructive = pending.operation === "delete";
|
|
5853
|
+
const canEdit = state.canConfirm && editableFields(pending).length > 0;
|
|
5137
5854
|
const expiry = expiryText(state, toolConfirmation.states.serverOffsetMs, now, copy);
|
|
5138
5855
|
const unavailable = state.error === "tool_unavailable";
|
|
5139
|
-
|
|
5856
|
+
const editStale = state.error === "invalid_edit";
|
|
5857
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [editing && canEdit ? /* @__PURE__ */ jsx(ToolConfirmationEditForm, {
|
|
5858
|
+
pending,
|
|
5859
|
+
draft,
|
|
5860
|
+
onChange: (field, value) => {
|
|
5861
|
+
setDraft((current) => ({
|
|
5862
|
+
...current,
|
|
5863
|
+
[field]: value
|
|
5864
|
+
}));
|
|
5865
|
+
setFieldErrors(({ [field]: _removed,...rest }) => rest);
|
|
5866
|
+
setServerErrors(({ [field]: _removed,...rest }) => rest);
|
|
5867
|
+
},
|
|
5868
|
+
errors: fieldErrors,
|
|
5869
|
+
serverErrors,
|
|
5870
|
+
disabled,
|
|
5871
|
+
copy
|
|
5872
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
5140
5873
|
className: "flex flex-wrap items-center gap-2 border-t border-border bg-warning-subtle/60 px-3 py-2",
|
|
5141
5874
|
"data-confirmation-actions": pending.action_id,
|
|
5142
5875
|
children: [
|
|
5143
5876
|
state.canConfirm ? /* @__PURE__ */ jsxs("button", {
|
|
5144
5877
|
type: "button",
|
|
5145
5878
|
disabled,
|
|
5146
|
-
onClick: () => void
|
|
5879
|
+
onClick: () => void (editing && canEdit ? saveAndConfirm() : send("confirm")),
|
|
5147
5880
|
className: joinClasses("inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium text-inverse-foreground disabled:opacity-50", destructive ? "bg-danger hover:bg-danger-strong" : "bg-inverse hover:bg-inverse-hover"),
|
|
5148
5881
|
children: [sending === "confirm" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
5149
5882
|
className: "mr-2 size-3 animate-spin",
|
|
5150
5883
|
"aria-hidden": "true"
|
|
5151
|
-
}) : null, sending === "confirm" ? copy.confirming : verbFor(pending.operation, copy)]
|
|
5884
|
+
}) : null, sending === "confirm" ? copy.confirming : editing && canEdit ? saveLabel(pending.operation, copy) : verbFor(pending.operation, copy)]
|
|
5885
|
+
}) : null,
|
|
5886
|
+
canEdit && !editing ? /* @__PURE__ */ jsx("button", {
|
|
5887
|
+
type: "button",
|
|
5888
|
+
disabled,
|
|
5889
|
+
onClick: startEditing,
|
|
5890
|
+
className: "inline-flex items-center rounded-md border border-border-strong bg-surface px-3 py-1.5 text-xs font-medium text-strong hover:bg-surface-muted disabled:opacity-50",
|
|
5891
|
+
children: copy.edit
|
|
5892
|
+
}) : null,
|
|
5893
|
+
editing && canEdit ? /* @__PURE__ */ jsx("button", {
|
|
5894
|
+
type: "button",
|
|
5895
|
+
disabled,
|
|
5896
|
+
onClick: stopEditing,
|
|
5897
|
+
className: "inline-flex items-center rounded-md border border-border-strong bg-surface px-3 py-1.5 text-xs font-medium text-strong hover:bg-surface-muted disabled:opacity-50",
|
|
5898
|
+
children: copy.discardEdit
|
|
5152
5899
|
}) : null,
|
|
5153
5900
|
state.canReject ? /* @__PURE__ */ jsxs("button", {
|
|
5154
5901
|
type: "button",
|
|
5155
5902
|
disabled,
|
|
5156
|
-
onClick: () => void
|
|
5903
|
+
onClick: () => void send("reject"),
|
|
5157
5904
|
className: "inline-flex items-center rounded-md border border-border-strong bg-surface px-3 py-1.5 text-xs font-medium text-strong hover:bg-surface-muted disabled:opacity-50",
|
|
5158
5905
|
children: [sending === "reject" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
5159
5906
|
className: "mr-2 size-3 animate-spin",
|
|
@@ -5163,10 +5910,10 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
5163
5910
|
/* @__PURE__ */ jsx("span", {
|
|
5164
5911
|
className: "ml-auto text-xs text-secondary",
|
|
5165
5912
|
"aria-live": "polite",
|
|
5166
|
-
children: failed ? copy.decisionError : unavailable ? copy.toolUnavailable : expiry
|
|
5913
|
+
children: failed ? copy.decisionError : applying ? copy.applyingNow : unavailable ? copy.toolUnavailable : editStale ? copy.editNoLongerApplies : expiry
|
|
5167
5914
|
})
|
|
5168
5915
|
]
|
|
5169
|
-
});
|
|
5916
|
+
})] });
|
|
5170
5917
|
}
|
|
5171
5918
|
|
|
5172
5919
|
//#endregion
|
|
@@ -5773,20 +6520,28 @@ function headerCount(view, copy) {
|
|
|
5773
6520
|
return null;
|
|
5774
6521
|
}
|
|
5775
6522
|
function ToolResultPersonalConnectorCard({ part, locale, className, toolConfirmation }) {
|
|
5776
|
-
const
|
|
5777
|
-
const pending =
|
|
6523
|
+
const prepared = getView(part);
|
|
6524
|
+
const pending = prepared?.kind === "pending-mail" || prepared?.kind === "pending-event" ? prepared.pending : null;
|
|
5778
6525
|
const confirmationState = useToolConfirmationState(pending, toolConfirmation);
|
|
5779
|
-
if (!
|
|
6526
|
+
if (!prepared) return null;
|
|
6527
|
+
const view = (prepared.kind === "pending-mail" || prepared.kind === "pending-event") && confirmationState?.effectiveAction ? {
|
|
6528
|
+
...prepared,
|
|
6529
|
+
pending: {
|
|
6530
|
+
...prepared.pending,
|
|
6531
|
+
action: confirmationState.effectiveAction
|
|
6532
|
+
}
|
|
6533
|
+
} : prepared;
|
|
5780
6534
|
const copy = getPersonalConnectorCopy(locale);
|
|
5781
6535
|
const connector = getConnector(part);
|
|
5782
6536
|
const Icon = isCalendar(connector) ? CalendarDays : Mail;
|
|
5783
6537
|
const total = headerCount(view, copy);
|
|
5784
6538
|
const isPending = view.kind === "pending-mail" || view.kind === "pending-event";
|
|
5785
6539
|
return /* @__PURE__ */ jsxs("section", {
|
|
5786
|
-
className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
6540
|
+
className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-border bg-surface text-foreground", confirmationState?.status === "superseded" ? "opacity-60" : void 0, className),
|
|
5787
6541
|
"data-tool-call-id": part.id,
|
|
5788
6542
|
"data-tool-call-state": part.state,
|
|
5789
6543
|
"data-connector-action": view.kind,
|
|
6544
|
+
"data-confirmation-action": pending?.action_id,
|
|
5790
6545
|
children: [
|
|
5791
6546
|
/* @__PURE__ */ jsxs("header", {
|
|
5792
6547
|
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|