@plaisolutions/react 0.15.0 → 0.17.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.
@@ -1,7 +1,7 @@
1
- import { Bot, Brain, Check, CheckCircle2, ChevronDown, CircleAlert, CircleX, Copy, Database, File, FileText, Globe, LoaderCircle, MessageSquare, Minus, Plug, Plus, RotateCcw, ThumbsDown, ThumbsUp, Workflow, XCircle } from "lucide-react";
1
+ import { Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, CircleAlert, CircleX, Clock, Copy, Database, ExternalLink, File, FileText, Globe, LoaderCircle, Mail, MessageSquare, Minus, Plug, Plus, RotateCcw, ThumbsDown, ThumbsUp, Video, Workflow, XCircle } from "lucide-react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
4
- import { HttpStatusError } from "@plaisolutions/client";
4
+ import { HttpStatusError, isHiddenMessage, toolConfirmationAt } from "@plaisolutions/client";
5
5
 
6
6
  //#region src/components/internal/join-classes.ts
7
7
  function joinClasses(...classes) {
@@ -2327,7 +2327,7 @@ function SourceCard({ source, locale, variant = "card" }) {
2327
2327
  });
2328
2328
  }
2329
2329
  function getTotalSourceCount(cards) {
2330
- return cards.reduce((count, source) => count + (source.kind === "web" ? getWebSearchResults(source.part).length : 1), 0);
2330
+ return cards.reduce((count$1, source) => count$1 + (source.kind === "web" ? getWebSearchResults(source.part).length : 1), 0);
2331
2331
  }
2332
2332
  function AggregatedSourceResults({ parts, locale, maxVisible = 3, className, getResourceDownloadUrl }) {
2333
2333
  const cards = getAggregatedCards(parts, locale, getResourceDownloadUrl);
@@ -2379,7 +2379,7 @@ function AggregatedSourceResults({ parts, locale, maxVisible = 3, className, get
2379
2379
 
2380
2380
  //#endregion
2381
2381
  //#region src/components/memory-proposal-card.tsx
2382
- const COPY = {
2382
+ const COPY$1 = {
2383
2383
  en: {
2384
2384
  title: "Memory proposal",
2385
2385
  user: "Personal memory",
@@ -2603,7 +2603,7 @@ const COPY = {
2603
2603
  };
2604
2604
  const REDACTED = "[redacted]";
2605
2605
  function MemoryProposalCard({ proposal: initial, actions, activeAgentId, locale, className }) {
2606
- const copy = COPY[getSupportedToolLocale(locale)];
2606
+ const copy = COPY$1[getSupportedToolLocale(locale)];
2607
2607
  const [proposal, setProposal] = useState(initial);
2608
2608
  const [resolving, setResolving] = useState(false);
2609
2609
  const [error, setError] = useState(null);
@@ -2914,7 +2914,7 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
2914
2914
  children: copy.agent
2915
2915
  }),
2916
2916
  /* @__PURE__ */ jsx("span", {
2917
- className: "min-w-0 truncate text-neutral-600",
2917
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
2918
2918
  children: agentName
2919
2919
  }),
2920
2920
  /* @__PURE__ */ jsx("span", {
@@ -3042,9 +3042,7 @@ function ToolResultBrowserCard({ part, className, locale }) {
3042
3042
  const preview = getPreview(toOutput(part.result));
3043
3043
  const url = getUrl(part.input);
3044
3044
  const error = formatToolErrorDetails(part.errorDetails);
3045
- const scraperLabel = metadata?.scraper_type ? SCRAPER_LABELS[metadata.scraper_type] : null;
3046
- const credits = metadata?.scraper_api_tokens ?? metadata?.firecrawl_credits;
3047
- const subtitle = [scraperLabel, typeof credits === "number" ? `${credits} ${credits === 1 ? copy.credit : copy.credits}` : null].filter(Boolean).join(" · ");
3045
+ const subtitle = metadata?.scraper_type ? SCRAPER_LABELS[metadata.scraper_type] : null;
3048
3046
  const failed = part.state === "error";
3049
3047
  const pending = part.state === "pending";
3050
3048
  const canExpand = Boolean(preview || error || url);
@@ -3063,7 +3061,7 @@ function ToolResultBrowserCard({ part, className, locale }) {
3063
3061
  children: copy.browser
3064
3062
  }),
3065
3063
  subtitle ? /* @__PURE__ */ jsx("span", {
3066
- className: "min-w-0 truncate text-xs text-neutral-500",
3064
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
3067
3065
  children: subtitle
3068
3066
  }) : null,
3069
3067
  /* @__PURE__ */ jsxs("span", {
@@ -3201,7 +3199,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3201
3199
  }), /* @__PURE__ */ jsxs("div", {
3202
3200
  className: "flex items-center gap-2",
3203
3201
  children: [/* @__PURE__ */ jsx("span", {
3204
- className: joinClasses("rounded-full border px-2 py-0.5 text-xs font-medium", statusClass),
3202
+ className: joinClasses("rounded-full uppercase border px-2 py-0.5 text-xs", statusClass),
3205
3203
  children: getUiStatusLabel(part.state, copy)
3206
3204
  }), /* @__PURE__ */ jsx("button", {
3207
3205
  type: "button",
@@ -3210,28 +3208,31 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3210
3208
  "aria-controls": `tool-email-details-${part.id}`,
3211
3209
  className: "inline-flex h-6 w-6 items-center justify-center rounded border border-slate-300 bg-white text-xs text-slate-700 hover:bg-slate-100",
3212
3210
  onClick: () => setIsExpanded((previous) => !previous),
3213
- children: /* @__PURE__ */ jsx("span", {
3214
- className: "inline-block",
3215
- children: isExpanded ? "^" : "v"
3211
+ children: isExpanded ? /* @__PURE__ */ jsx(Minus, {
3212
+ className: "h-3 w-3",
3213
+ "aria-hidden": "true"
3214
+ }) : /* @__PURE__ */ jsx(Plus, {
3215
+ className: "h-3 w-3",
3216
+ "aria-hidden": "true"
3216
3217
  })
3217
3218
  })]
3218
3219
  })]
3219
3220
  }),
3220
3221
  emailInput.subject ? /* @__PURE__ */ jsxs("div", {
3221
- className: "space-y-1",
3222
- children: [/* @__PURE__ */ jsx("p", {
3222
+ className: "flex items-center gap-1",
3223
+ children: [/* @__PURE__ */ jsxs("p", {
3223
3224
  className: "text-xs font-semibold text-slate-600",
3224
- children: copy.subject
3225
+ children: [copy.subject, ":"]
3225
3226
  }), /* @__PURE__ */ jsx("p", {
3226
- className: "text-sm text-slate-900",
3227
+ className: "text-xs text-slate-900",
3227
3228
  children: emailInput.subject
3228
3229
  })]
3229
3230
  }) : null,
3230
3231
  /* @__PURE__ */ jsxs("div", {
3231
- className: "space-y-1",
3232
- children: [/* @__PURE__ */ jsx("p", {
3232
+ className: "flex items-center gap-1",
3233
+ children: [/* @__PURE__ */ jsxs("p", {
3233
3234
  className: "text-xs font-semibold text-slate-600",
3234
- children: copy.to
3235
+ children: [copy.to, ":"]
3235
3236
  }), emailInput.to.length > 0 ? /* @__PURE__ */ jsx("div", {
3236
3237
  className: "flex flex-wrap gap-2",
3237
3238
  children: emailInput.to.map((recipient) => /* @__PURE__ */ jsx("span", {
@@ -3239,7 +3240,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3239
3240
  children: recipient
3240
3241
  }, recipient))
3241
3242
  }) : /* @__PURE__ */ jsx("p", {
3242
- className: "text-sm text-slate-500",
3243
+ className: "text-xs text-slate-500",
3243
3244
  children: copy.noRecipientsProvided
3244
3245
  })]
3245
3246
  }),
@@ -3249,22 +3250,22 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3249
3250
  className: joinClasses(isExpanded ? "block space-y-4" : "hidden"),
3250
3251
  children: [emailInput.text ? /* @__PURE__ */ jsxs("div", {
3251
3252
  className: "space-y-1",
3252
- children: [/* @__PURE__ */ jsx("p", {
3253
+ children: [/* @__PURE__ */ jsxs("p", {
3253
3254
  className: "text-xs font-semibold text-slate-600",
3254
- children: copy.body
3255
+ children: [copy.body, ":"]
3255
3256
  }), /* @__PURE__ */ jsx("p", {
3256
- className: "whitespace-pre-wrap rounded border border-slate-200 bg-slate-50 p-2 text-sm text-slate-700",
3257
+ className: "whitespace-pre-wrap rounded border border-slate-200 bg-white p-2 text-sm text-slate-700",
3257
3258
  children: emailInput.text
3258
3259
  })]
3259
3260
  }) : null, part.result !== void 0 ? /* @__PURE__ */ jsxs("div", {
3260
- className: "space-y-2 rounded border border-slate-200 bg-white p-3",
3261
+ className: "space-y-2 rounded border border-slate-200 bg-slate-50 p-3",
3261
3262
  children: [
3262
3263
  /* @__PURE__ */ jsx("p", {
3263
3264
  className: "text-xs font-semibold uppercase tracking-wide text-slate-500",
3264
3265
  children: copy.delivery
3265
3266
  }),
3266
3267
  emailResult.status ? /* @__PURE__ */ jsxs("p", {
3267
- className: "text-sm text-slate-700",
3268
+ className: "text-xs text-slate-700",
3268
3269
  children: [
3269
3270
  /* @__PURE__ */ jsxs("span", {
3270
3271
  className: "font-semibold text-slate-900",
@@ -3275,7 +3276,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3275
3276
  ]
3276
3277
  }) : null,
3277
3278
  emailResult.recipientsCount !== null ? /* @__PURE__ */ jsxs("p", {
3278
- className: "text-sm text-slate-700",
3279
+ className: "text-xs text-slate-700",
3279
3280
  children: [
3280
3281
  /* @__PURE__ */ jsxs("span", {
3281
3282
  className: "font-semibold text-slate-900",
@@ -3286,7 +3287,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3286
3287
  ]
3287
3288
  }) : null,
3288
3289
  emailResult.receiptProvider ? /* @__PURE__ */ jsxs("p", {
3289
- className: "text-sm text-slate-700",
3290
+ className: "text-xs text-slate-700",
3290
3291
  children: [
3291
3292
  /* @__PURE__ */ jsxs("span", {
3292
3293
  className: "font-semibold text-slate-900",
@@ -3297,7 +3298,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3297
3298
  ]
3298
3299
  }) : null,
3299
3300
  emailResult.receiptMessageId ? /* @__PURE__ */ jsxs("p", {
3300
- className: "break-all text-sm text-slate-700",
3301
+ className: "break-all text-xs text-slate-700",
3301
3302
  children: [
3302
3303
  /* @__PURE__ */ jsxs("span", {
3303
3304
  className: "font-semibold text-slate-900",
@@ -3308,7 +3309,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3308
3309
  ]
3309
3310
  }) : null,
3310
3311
  emailResult.receiptRawStatus ? /* @__PURE__ */ jsxs("p", {
3311
- className: "text-sm text-slate-700",
3312
+ className: "text-xs text-slate-700",
3312
3313
  children: [
3313
3314
  /* @__PURE__ */ jsxs("span", {
3314
3315
  className: "font-semibold text-slate-900",
@@ -3319,7 +3320,7 @@ function ToolResultEmailSendCard({ part, className, locale }) {
3319
3320
  ]
3320
3321
  }) : null,
3321
3322
  emailResult.raw ? /* @__PURE__ */ jsx("p", {
3322
- className: "whitespace-pre-wrap text-sm text-slate-700",
3323
+ className: "whitespace-pre-wrap text-xs text-slate-700",
3323
3324
  children: emailResult.raw
3324
3325
  }) : null
3325
3326
  ]
@@ -3632,7 +3633,7 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
3632
3633
 
3633
3634
  //#endregion
3634
3635
  //#region src/components/tool-result-mcp-card.tsx
3635
- function text(value) {
3636
+ function text$1(value) {
3636
3637
  if (typeof value === "string") return value;
3637
3638
  if (value == null) return null;
3638
3639
  try {
@@ -3646,7 +3647,7 @@ function ToolResultMcpCard({ part, className, locale }) {
3646
3647
  const meta = part.metadata;
3647
3648
  const server = meta?.mcp_server_url ?? meta?.server_name;
3648
3649
  const tool = meta?.mcp_tool_name ?? meta?.tool_name ?? part.name;
3649
- const result = text(part.result);
3650
+ const result = text$1(part.result);
3650
3651
  const error = formatToolErrorDetails(part.errorDetails);
3651
3652
  const failed = part.state === "error";
3652
3653
  return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
@@ -3664,7 +3665,7 @@ function ToolResultMcpCard({ part, className, locale }) {
3664
3665
  children: "MCP"
3665
3666
  }),
3666
3667
  /* @__PURE__ */ jsx("span", {
3667
- className: "min-w-0 truncate text-neutral-600",
3668
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
3668
3669
  children: tool
3669
3670
  }),
3670
3671
  /* @__PURE__ */ jsx("span", {
@@ -3773,7 +3774,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
3773
3774
  children: copy.officeDocuments
3774
3775
  }),
3775
3776
  /* @__PURE__ */ jsx("span", {
3776
- className: "truncate text-xs text-neutral-500",
3777
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
3777
3778
  children: part.state === "pending" ? copy.pending : `${files.length} ${fileLabel}`
3778
3779
  }),
3779
3780
  /* @__PURE__ */ jsx("span", {
@@ -3848,6 +3849,1694 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
3848
3849
  })] });
3849
3850
  }
3850
3851
 
3852
+ //#endregion
3853
+ //#region src/components/internal/personal-connector-copy.ts
3854
+ const ENGLISH = {
3855
+ searchingMail: "Searching {{service}}",
3856
+ readingMail: "Reading an email in {{service}}",
3857
+ checkingCalendar: "Checking {{service}}",
3858
+ savingDraft: "Saving a draft in {{service}}",
3859
+ preparingMail: "Preparing an email in {{service}}",
3860
+ preparingEvent: "Preparing a change in {{service}}",
3861
+ runningConfirmed: "Running the confirmed actions",
3862
+ openIn: "Open in {{service}}",
3863
+ emailCountOne: "1 email",
3864
+ emailCountOther: "{{count}} emails",
3865
+ eventCountOne: "1 event",
3866
+ eventCountOther: "{{count}} events",
3867
+ noEmails: "No emails found",
3868
+ noEvents: "No events in this period",
3869
+ showAll: "Show all ({{count}})",
3870
+ showLess: "Show less",
3871
+ showMore: "Show more",
3872
+ allDay: "All day",
3873
+ to: "To",
3874
+ cc: "Cc",
3875
+ draftSaved: "Draft saved",
3876
+ openDraft: "Open draft",
3877
+ attendeesOne: "1 attendee",
3878
+ attendeesOther: "{{count}} attendees",
3879
+ noSubject: "(no subject)",
3880
+ unread: "Unread",
3881
+ joinMeeting: "Join",
3882
+ awaitingConfirmation: "Awaiting your confirmation",
3883
+ confirmHint: "Reply “yes” to confirm, or tell the agent what to change.",
3884
+ subject: "Subject",
3885
+ newEvent: "New event",
3886
+ eventChange: "Event change",
3887
+ deleteEvent: "Delete event",
3888
+ attendeesNotified: "Attendees will be notified.",
3889
+ title: "Title",
3890
+ when: "When",
3891
+ location: "Location",
3892
+ attendees: "Attendees",
3893
+ description: "Description",
3894
+ emailSent: "Email sent",
3895
+ eventCreated: "Event created",
3896
+ eventUpdated: "Event updated",
3897
+ eventDeleted: "Event deleted",
3898
+ actionDone: "{{tool}} done",
3899
+ actionFailed: "Failed",
3900
+ openEmail: "Open email",
3901
+ openEvent: "Open event",
3902
+ replyInThread: "Reply in the same thread",
3903
+ confirmSend: "Send",
3904
+ confirmCreate: "Create",
3905
+ confirmUpdate: "Save changes",
3906
+ confirmDelete: "Delete",
3907
+ confirmGeneric: "Confirm",
3908
+ cancel: "Cancel",
3909
+ confirming: "Confirming…",
3910
+ cancelling: "Cancelling…",
3911
+ verifying: "Checking status…",
3912
+ expiresIn: "Expires in {{minutes}} min",
3913
+ expiresSoon: "Expires in less than a minute",
3914
+ statusExecuting: "Running…",
3915
+ statusExecuted: "Done",
3916
+ statusRejected: "Cancelled",
3917
+ statusExpired: "Expired: ask again in the chat",
3918
+ statusSuperseded: "Replaced by a newer version",
3919
+ statusInvalidated: "Can no longer run: ask again",
3920
+ statusFailed: "Failed",
3921
+ statusUnknown: "Outcome unknown: check before trying again",
3922
+ statusNotFound: "Not available in this conversation",
3923
+ toolUnavailable: "The tool for this action isn’t available right now",
3924
+ decisionError: "Your decision couldn’t be sent. Try again."
3925
+ };
3926
+ const COPY = {
3927
+ en: {},
3928
+ es: {
3929
+ searchingMail: "Buscando en {{service}}",
3930
+ readingMail: "Leyendo un correo en {{service}}",
3931
+ checkingCalendar: "Consultando {{service}}",
3932
+ savingDraft: "Guardando un borrador en {{service}}",
3933
+ preparingMail: "Preparando un correo en {{service}}",
3934
+ preparingEvent: "Preparando un cambio en {{service}}",
3935
+ runningConfirmed: "Ejecutando las acciones confirmadas",
3936
+ openIn: "Abrir en {{service}}",
3937
+ emailCountOne: "1 correo",
3938
+ emailCountOther: "{{count}} correos",
3939
+ eventCountOne: "1 evento",
3940
+ eventCountOther: "{{count}} eventos",
3941
+ noEmails: "No se han encontrado correos",
3942
+ noEvents: "No hay eventos en este periodo",
3943
+ showAll: "Ver todos ({{count}})",
3944
+ showLess: "Ver menos",
3945
+ showMore: "Ver más",
3946
+ allDay: "Todo el día",
3947
+ to: "Para",
3948
+ cc: "CC",
3949
+ draftSaved: "Borrador guardado",
3950
+ openDraft: "Abrir borrador",
3951
+ attendeesOne: "1 asistente",
3952
+ attendeesOther: "{{count}} asistentes",
3953
+ noSubject: "(sin asunto)",
3954
+ unread: "No leído",
3955
+ joinMeeting: "Unirse",
3956
+ awaitingConfirmation: "Pendiente de tu confirmación",
3957
+ confirmHint: "Responde «sí» para confirmar, o dile al agente qué cambiar.",
3958
+ subject: "Asunto",
3959
+ newEvent: "Nuevo evento",
3960
+ eventChange: "Cambio en el evento",
3961
+ deleteEvent: "Borrar evento",
3962
+ attendeesNotified: "Se avisará a los asistentes.",
3963
+ title: "Título",
3964
+ when: "Cuándo",
3965
+ location: "Ubicación",
3966
+ attendees: "Asistentes",
3967
+ description: "Descripción",
3968
+ emailSent: "Correo enviado",
3969
+ eventCreated: "Evento creado",
3970
+ eventUpdated: "Evento actualizado",
3971
+ eventDeleted: "Evento borrado",
3972
+ actionDone: "{{tool}} hecho",
3973
+ actionFailed: "Error",
3974
+ openEmail: "Abrir correo",
3975
+ openEvent: "Abrir evento",
3976
+ replyInThread: "Respuesta en el mismo hilo",
3977
+ confirmSend: "Enviar",
3978
+ confirmCreate: "Crear",
3979
+ confirmUpdate: "Guardar cambios",
3980
+ confirmDelete: "Eliminar",
3981
+ confirmGeneric: "Confirmar",
3982
+ cancel: "Cancelar",
3983
+ confirming: "Confirmando…",
3984
+ cancelling: "Cancelando…",
3985
+ verifying: "Comprobando el estado…",
3986
+ expiresIn: "Caduca en {{minutes}} min",
3987
+ expiresSoon: "Caduca en menos de un minuto",
3988
+ statusExecuting: "Ejecutando…",
3989
+ statusExecuted: "Hecho",
3990
+ statusRejected: "Cancelada",
3991
+ statusExpired: "Caducada: pídelo de nuevo en el chat",
3992
+ statusSuperseded: "Sustituida por una versión más reciente",
3993
+ statusInvalidated: "Ya no se puede ejecutar: pídelo de nuevo",
3994
+ statusFailed: "No se pudo completar",
3995
+ statusUnknown: "Resultado desconocido: compruébalo antes de repetirlo",
3996
+ statusNotFound: "No disponible en esta conversación",
3997
+ toolUnavailable: "La herramienta de esta acción no está disponible ahora",
3998
+ decisionError: "No se pudo enviar tu decisión. Inténtalo de nuevo."
3999
+ },
4000
+ ca: {
4001
+ searchingMail: "Cercant a {{service}}",
4002
+ readingMail: "Llegint un correu a {{service}}",
4003
+ checkingCalendar: "Consultant {{service}}",
4004
+ savingDraft: "Desant un esborrany a {{service}}",
4005
+ preparingMail: "Preparant un correu a {{service}}",
4006
+ preparingEvent: "Preparant un canvi a {{service}}",
4007
+ runningConfirmed: "Executant les accions confirmades",
4008
+ openIn: "Obre a {{service}}",
4009
+ emailCountOne: "1 correu",
4010
+ emailCountOther: "{{count}} correus",
4011
+ eventCountOne: "1 esdeveniment",
4012
+ eventCountOther: "{{count}} esdeveniments",
4013
+ noEmails: "No s’han trobat correus",
4014
+ noEvents: "No hi ha esdeveniments en aquest període",
4015
+ showAll: "Mostra-ho tot ({{count}})",
4016
+ showLess: "Mostra’n menys",
4017
+ showMore: "Mostra’n més",
4018
+ allDay: "Tot el dia",
4019
+ to: "Per a",
4020
+ cc: "CC",
4021
+ draftSaved: "Esborrany desat",
4022
+ openDraft: "Obre l’esborrany",
4023
+ attendeesOne: "1 assistent",
4024
+ attendeesOther: "{{count}} assistents",
4025
+ noSubject: "(sense assumpte)",
4026
+ unread: "No llegit",
4027
+ joinMeeting: "Uneix-t’hi",
4028
+ awaitingConfirmation: "Pendent de la teva confirmació",
4029
+ confirmHint: "Respon «sí» per confirmar, o digues a l’agent què ha de canviar.",
4030
+ subject: "Assumpte",
4031
+ newEvent: "Nou esdeveniment",
4032
+ eventChange: "Canvi a l’esdeveniment",
4033
+ deleteEvent: "Esborrar esdeveniment",
4034
+ attendeesNotified: "S’avisarà els assistents.",
4035
+ title: "Títol",
4036
+ when: "Quan",
4037
+ location: "Ubicació",
4038
+ attendees: "Assistents",
4039
+ description: "Descripció",
4040
+ emailSent: "Correu enviat",
4041
+ eventCreated: "Esdeveniment creat",
4042
+ eventUpdated: "Esdeveniment actualitzat",
4043
+ eventDeleted: "Esdeveniment esborrat",
4044
+ actionDone: "{{tool}} fet",
4045
+ actionFailed: "Error",
4046
+ openEmail: "Obre el correu",
4047
+ openEvent: "Obre l’esdeveniment",
4048
+ replyInThread: "Resposta al mateix fil",
4049
+ confirmSend: "Envia",
4050
+ confirmCreate: "Crea",
4051
+ confirmUpdate: "Desa els canvis",
4052
+ confirmDelete: "Elimina",
4053
+ confirmGeneric: "Confirma",
4054
+ cancel: "Cancel·la",
4055
+ confirming: "Confirmant…",
4056
+ cancelling: "Cancel·lant…",
4057
+ verifying: "Comprovant l’estat…",
4058
+ expiresIn: "Caduca d’aquí a {{minutes}} min",
4059
+ expiresSoon: "Caduca en menys d’un minut",
4060
+ statusExecuting: "Executant…",
4061
+ statusExecuted: "Fet",
4062
+ statusRejected: "Cancel·lada",
4063
+ statusExpired: "Caducada: torna-ho a demanar al xat",
4064
+ statusSuperseded: "Substituïda per una versió més recent",
4065
+ statusInvalidated: "Ja no es pot executar: torna-ho a demanar",
4066
+ statusFailed: "No s’ha pogut completar",
4067
+ statusUnknown: "Resultat desconegut: comprova-ho abans de repetir-ho",
4068
+ statusNotFound: "No disponible en aquesta conversa",
4069
+ toolUnavailable: "L’eina d’aquesta acció no està disponible ara",
4070
+ decisionError: "No s’ha pogut enviar la teva decisió. Torna-ho a provar."
4071
+ },
4072
+ fr: {
4073
+ searchingMail: "Recherche dans {{service}}",
4074
+ readingMail: "Lecture d’un e-mail dans {{service}}",
4075
+ checkingCalendar: "Consultation de {{service}}",
4076
+ savingDraft: "Enregistrement d’un brouillon dans {{service}}",
4077
+ preparingMail: "Préparation d’un e-mail dans {{service}}",
4078
+ preparingEvent: "Préparation d’une modification dans {{service}}",
4079
+ runningConfirmed: "Exécution des actions confirmées",
4080
+ openIn: "Ouvrir dans {{service}}",
4081
+ emailCountOne: "1 e-mail",
4082
+ emailCountOther: "{{count}} e-mails",
4083
+ eventCountOne: "1 événement",
4084
+ eventCountOther: "{{count}} événements",
4085
+ noEmails: "Aucun e-mail trouvé",
4086
+ noEvents: "Aucun événement sur cette période",
4087
+ showAll: "Tout afficher ({{count}})",
4088
+ showLess: "Afficher moins",
4089
+ showMore: "Afficher plus",
4090
+ allDay: "Toute la journée",
4091
+ to: "À",
4092
+ cc: "Cc",
4093
+ draftSaved: "Brouillon enregistré",
4094
+ openDraft: "Ouvrir le brouillon",
4095
+ attendeesOne: "1 participant",
4096
+ attendeesOther: "{{count}} participants",
4097
+ noSubject: "(sans objet)",
4098
+ unread: "Non lu",
4099
+ joinMeeting: "Rejoindre",
4100
+ awaitingConfirmation: "En attente de votre confirmation",
4101
+ confirmHint: "Répondez « oui » pour confirmer, ou dites à l’agent quoi modifier.",
4102
+ subject: "Objet",
4103
+ newEvent: "Nouvel événement",
4104
+ eventChange: "Modification de l’événement",
4105
+ deleteEvent: "Supprimer l’événement",
4106
+ attendeesNotified: "Les participants seront prévenus.",
4107
+ title: "Titre",
4108
+ when: "Quand",
4109
+ location: "Lieu",
4110
+ attendees: "Participants",
4111
+ description: "Description",
4112
+ emailSent: "E-mail envoyé",
4113
+ eventCreated: "Événement créé",
4114
+ eventUpdated: "Événement mis à jour",
4115
+ eventDeleted: "Événement supprimé",
4116
+ actionDone: "{{tool}} terminé",
4117
+ actionFailed: "Échec",
4118
+ openEmail: "Ouvrir l’e-mail",
4119
+ openEvent: "Ouvrir l’événement",
4120
+ replyInThread: "Réponse dans le même fil",
4121
+ confirmSend: "Envoyer",
4122
+ confirmCreate: "Créer",
4123
+ confirmUpdate: "Enregistrer les modifications",
4124
+ confirmDelete: "Supprimer",
4125
+ confirmGeneric: "Confirmer",
4126
+ cancel: "Annuler",
4127
+ confirming: "Confirmation…",
4128
+ cancelling: "Annulation…",
4129
+ verifying: "Vérification de l’état…",
4130
+ expiresIn: "Expire dans {{minutes}} min",
4131
+ expiresSoon: "Expire dans moins d’une minute",
4132
+ statusExecuting: "En cours…",
4133
+ statusExecuted: "Terminé",
4134
+ statusRejected: "Annulée",
4135
+ statusExpired: "Expirée : redemandez-la dans le chat",
4136
+ statusSuperseded: "Remplacée par une version plus récente",
4137
+ statusInvalidated: "Ne peut plus être exécutée : redemandez-la",
4138
+ statusFailed: "Échec",
4139
+ statusUnknown: "Résultat inconnu : vérifiez avant de réessayer",
4140
+ statusNotFound: "Indisponible dans cette conversation",
4141
+ toolUnavailable: "L’outil de cette action n’est pas disponible pour le moment",
4142
+ decisionError: "Impossible d’envoyer votre décision. Réessayez."
4143
+ },
4144
+ it: {
4145
+ searchingMail: "Ricerca in {{service}}",
4146
+ readingMail: "Lettura di un’email in {{service}}",
4147
+ checkingCalendar: "Consultazione di {{service}}",
4148
+ savingDraft: "Salvataggio di una bozza in {{service}}",
4149
+ preparingMail: "Preparazione di un’email in {{service}}",
4150
+ preparingEvent: "Preparazione di una modifica in {{service}}",
4151
+ runningConfirmed: "Esecuzione delle azioni confermate",
4152
+ openIn: "Apri in {{service}}",
4153
+ emailCountOne: "1 email",
4154
+ emailCountOther: "{{count}} email",
4155
+ eventCountOne: "1 evento",
4156
+ eventCountOther: "{{count}} eventi",
4157
+ noEmails: "Nessuna email trovata",
4158
+ noEvents: "Nessun evento in questo periodo",
4159
+ showAll: "Mostra tutto ({{count}})",
4160
+ showLess: "Mostra meno",
4161
+ showMore: "Mostra di più",
4162
+ allDay: "Tutto il giorno",
4163
+ to: "A",
4164
+ cc: "Cc",
4165
+ draftSaved: "Bozza salvata",
4166
+ openDraft: "Apri bozza",
4167
+ attendeesOne: "1 partecipante",
4168
+ attendeesOther: "{{count}} partecipanti",
4169
+ noSubject: "(nessun oggetto)",
4170
+ unread: "Non letta",
4171
+ joinMeeting: "Partecipa",
4172
+ awaitingConfirmation: "In attesa della tua conferma",
4173
+ confirmHint: "Rispondi «sì» per confermare, o di’ all’agente cosa cambiare.",
4174
+ subject: "Oggetto",
4175
+ newEvent: "Nuovo evento",
4176
+ eventChange: "Modifica dell’evento",
4177
+ deleteEvent: "Elimina evento",
4178
+ attendeesNotified: "I partecipanti verranno avvisati.",
4179
+ title: "Titolo",
4180
+ when: "Quando",
4181
+ location: "Luogo",
4182
+ attendees: "Partecipanti",
4183
+ description: "Descrizione",
4184
+ emailSent: "Email inviata",
4185
+ eventCreated: "Evento creato",
4186
+ eventUpdated: "Evento aggiornato",
4187
+ eventDeleted: "Evento eliminato",
4188
+ actionDone: "{{tool}} completato",
4189
+ actionFailed: "Errore",
4190
+ openEmail: "Apri email",
4191
+ openEvent: "Apri evento",
4192
+ replyInThread: "Risposta nello stesso thread",
4193
+ confirmSend: "Invia",
4194
+ confirmCreate: "Crea",
4195
+ confirmUpdate: "Salva modifiche",
4196
+ confirmDelete: "Elimina",
4197
+ confirmGeneric: "Conferma",
4198
+ cancel: "Annulla",
4199
+ confirming: "Conferma in corso…",
4200
+ cancelling: "Annullamento in corso…",
4201
+ verifying: "Verifica dello stato…",
4202
+ expiresIn: "Scade tra {{minutes}} min",
4203
+ expiresSoon: "Scade tra meno di un minuto",
4204
+ statusExecuting: "In esecuzione…",
4205
+ statusExecuted: "Fatto",
4206
+ statusRejected: "Annullata",
4207
+ statusExpired: "Scaduta: richiedila di nuovo nella chat",
4208
+ statusSuperseded: "Sostituita da una versione più recente",
4209
+ statusInvalidated: "Non può più essere eseguita: richiedila di nuovo",
4210
+ statusFailed: "Non riuscita",
4211
+ statusUnknown: "Esito sconosciuto: verifica prima di riprovare",
4212
+ statusNotFound: "Non disponibile in questa conversazione",
4213
+ toolUnavailable: "Lo strumento di questa azione non è disponibile ora",
4214
+ decisionError: "Impossibile inviare la tua decisione. Riprova."
4215
+ },
4216
+ de: {
4217
+ searchingMail: "Suche in {{service}}",
4218
+ readingMail: "E-Mail in {{service}} wird gelesen",
4219
+ checkingCalendar: "{{service}} wird abgefragt",
4220
+ savingDraft: "Entwurf wird in {{service}} gespeichert",
4221
+ preparingMail: "E-Mail in {{service}} wird vorbereitet",
4222
+ preparingEvent: "Änderung in {{service}} wird vorbereitet",
4223
+ runningConfirmed: "Bestätigte Aktionen werden ausgeführt",
4224
+ openIn: "In {{service}} öffnen",
4225
+ emailCountOne: "1 E-Mail",
4226
+ emailCountOther: "{{count}} E-Mails",
4227
+ eventCountOne: "1 Termin",
4228
+ eventCountOther: "{{count}} Termine",
4229
+ noEmails: "Keine E-Mails gefunden",
4230
+ noEvents: "Keine Termine in diesem Zeitraum",
4231
+ showAll: "Alle anzeigen ({{count}})",
4232
+ showLess: "Weniger anzeigen",
4233
+ showMore: "Mehr anzeigen",
4234
+ allDay: "Ganztägig",
4235
+ to: "An",
4236
+ cc: "Cc",
4237
+ draftSaved: "Entwurf gespeichert",
4238
+ openDraft: "Entwurf öffnen",
4239
+ attendeesOne: "1 Teilnehmer",
4240
+ attendeesOther: "{{count}} Teilnehmer",
4241
+ noSubject: "(kein Betreff)",
4242
+ unread: "Ungelesen",
4243
+ joinMeeting: "Teilnehmen",
4244
+ awaitingConfirmation: "Wartet auf deine Bestätigung",
4245
+ confirmHint: "Antworte mit „ja“, um zu bestätigen, oder sag dem Agenten, was er ändern soll.",
4246
+ subject: "Betreff",
4247
+ newEvent: "Neuer Termin",
4248
+ eventChange: "Terminänderung",
4249
+ deleteEvent: "Termin löschen",
4250
+ attendeesNotified: "Die Teilnehmer werden benachrichtigt.",
4251
+ title: "Titel",
4252
+ when: "Wann",
4253
+ location: "Ort",
4254
+ attendees: "Teilnehmer",
4255
+ description: "Beschreibung",
4256
+ emailSent: "E-Mail gesendet",
4257
+ eventCreated: "Termin erstellt",
4258
+ eventUpdated: "Termin aktualisiert",
4259
+ eventDeleted: "Termin gelöscht",
4260
+ actionDone: "{{tool}} erledigt",
4261
+ actionFailed: "Fehlgeschlagen",
4262
+ openEmail: "E-Mail öffnen",
4263
+ openEvent: "Termin öffnen",
4264
+ replyInThread: "Antwort im selben Verlauf",
4265
+ confirmSend: "Senden",
4266
+ confirmCreate: "Erstellen",
4267
+ confirmUpdate: "Änderungen speichern",
4268
+ confirmDelete: "Löschen",
4269
+ confirmGeneric: "Bestätigen",
4270
+ cancel: "Abbrechen",
4271
+ confirming: "Wird bestätigt…",
4272
+ cancelling: "Wird abgebrochen…",
4273
+ verifying: "Status wird geprüft…",
4274
+ expiresIn: "Läuft in {{minutes}} Min. ab",
4275
+ expiresSoon: "Läuft in weniger als einer Minute ab",
4276
+ statusExecuting: "Wird ausgeführt…",
4277
+ statusExecuted: "Erledigt",
4278
+ statusRejected: "Abgebrochen",
4279
+ statusExpired: "Abgelaufen: bitte im Chat erneut anfragen",
4280
+ statusSuperseded: "Durch eine neuere Version ersetzt",
4281
+ statusInvalidated: "Kann nicht mehr ausgeführt werden: bitte erneut anfragen",
4282
+ statusFailed: "Fehlgeschlagen",
4283
+ statusUnknown: "Ergebnis unbekannt: vor dem Wiederholen prüfen",
4284
+ statusNotFound: "In dieser Unterhaltung nicht verfügbar",
4285
+ toolUnavailable: "Das Tool für diese Aktion ist gerade nicht verfügbar",
4286
+ decisionError: "Deine Entscheidung konnte nicht gesendet werden. Versuche es erneut."
4287
+ },
4288
+ da: {
4289
+ searchingMail: "Søger i {{service}}",
4290
+ readingMail: "Læser en e-mail i {{service}}",
4291
+ checkingCalendar: "Tjekker {{service}}",
4292
+ savingDraft: "Gemmer en kladde i {{service}}",
4293
+ preparingMail: "Forbereder en e-mail i {{service}}",
4294
+ preparingEvent: "Forbereder en ændring i {{service}}",
4295
+ runningConfirmed: "Udfører de bekræftede handlinger",
4296
+ openIn: "Åbn i {{service}}",
4297
+ emailCountOne: "1 e-mail",
4298
+ emailCountOther: "{{count}} e-mails",
4299
+ eventCountOne: "1 begivenhed",
4300
+ eventCountOther: "{{count}} begivenheder",
4301
+ noEmails: "Ingen e-mails fundet",
4302
+ noEvents: "Ingen begivenheder i denne periode",
4303
+ showAll: "Vis alle ({{count}})",
4304
+ showLess: "Vis mindre",
4305
+ showMore: "Vis mere",
4306
+ allDay: "Hele dagen",
4307
+ to: "Til",
4308
+ cc: "Cc",
4309
+ draftSaved: "Kladde gemt",
4310
+ openDraft: "Åbn kladde",
4311
+ attendeesOne: "1 deltager",
4312
+ attendeesOther: "{{count}} deltagere",
4313
+ noSubject: "(intet emne)",
4314
+ unread: "Ulæst",
4315
+ joinMeeting: "Deltag",
4316
+ awaitingConfirmation: "Afventer din bekræftelse",
4317
+ confirmHint: "Svar “ja” for at bekræfte, eller fortæl agenten, hvad der skal ændres.",
4318
+ subject: "Emne",
4319
+ newEvent: "Ny begivenhed",
4320
+ eventChange: "Ændring af begivenhed",
4321
+ deleteEvent: "Slet begivenhed",
4322
+ attendeesNotified: "Deltagerne får besked.",
4323
+ title: "Titel",
4324
+ when: "Hvornår",
4325
+ location: "Sted",
4326
+ attendees: "Deltagere",
4327
+ description: "Beskrivelse",
4328
+ emailSent: "E-mail sendt",
4329
+ eventCreated: "Begivenhed oprettet",
4330
+ eventUpdated: "Begivenhed opdateret",
4331
+ eventDeleted: "Begivenhed slettet",
4332
+ actionDone: "{{tool}} udført",
4333
+ actionFailed: "Mislykkedes",
4334
+ openEmail: "Åbn e-mail",
4335
+ openEvent: "Åbn begivenhed",
4336
+ replyInThread: "Svar i samme tråd",
4337
+ confirmSend: "Send",
4338
+ confirmCreate: "Opret",
4339
+ confirmUpdate: "Gem ændringer",
4340
+ confirmDelete: "Slet",
4341
+ confirmGeneric: "Bekræft",
4342
+ cancel: "Annuller",
4343
+ confirming: "Bekræfter…",
4344
+ cancelling: "Annullerer…",
4345
+ verifying: "Tjekker status…",
4346
+ expiresIn: "Udløber om {{minutes}} min.",
4347
+ expiresSoon: "Udløber om under et minut",
4348
+ statusExecuting: "Kører…",
4349
+ statusExecuted: "Udført",
4350
+ statusRejected: "Annulleret",
4351
+ statusExpired: "Udløbet: bed om det igen i chatten",
4352
+ statusSuperseded: "Erstattet af en nyere version",
4353
+ statusInvalidated: "Kan ikke længere udføres: bed om det igen",
4354
+ statusFailed: "Mislykkedes",
4355
+ statusUnknown: "Ukendt resultat: tjek før du prøver igen",
4356
+ statusNotFound: "Ikke tilgængelig i denne samtale",
4357
+ toolUnavailable: "Værktøjet til denne handling er ikke tilgængeligt lige nu",
4358
+ decisionError: "Din beslutning kunne ikke sendes. Prøv igen."
4359
+ },
4360
+ sv: {
4361
+ searchingMail: "Söker i {{service}}",
4362
+ readingMail: "Läser ett mejl i {{service}}",
4363
+ checkingCalendar: "Kollar {{service}}",
4364
+ savingDraft: "Sparar ett utkast i {{service}}",
4365
+ preparingMail: "Förbereder ett mejl i {{service}}",
4366
+ preparingEvent: "Förbereder en ändring i {{service}}",
4367
+ runningConfirmed: "Utför de bekräftade åtgärderna",
4368
+ openIn: "Öppna i {{service}}",
4369
+ emailCountOne: "1 mejl",
4370
+ emailCountOther: "{{count}} mejl",
4371
+ eventCountOne: "1 händelse",
4372
+ eventCountOther: "{{count}} händelser",
4373
+ noEmails: "Inga mejl hittades",
4374
+ noEvents: "Inga händelser under perioden",
4375
+ showAll: "Visa alla ({{count}})",
4376
+ showLess: "Visa mindre",
4377
+ showMore: "Visa mer",
4378
+ allDay: "Heldag",
4379
+ to: "Till",
4380
+ cc: "Kopia",
4381
+ draftSaved: "Utkast sparat",
4382
+ openDraft: "Öppna utkast",
4383
+ attendeesOne: "1 deltagare",
4384
+ attendeesOther: "{{count}} deltagare",
4385
+ noSubject: "(inget ämne)",
4386
+ unread: "Oläst",
4387
+ joinMeeting: "Anslut",
4388
+ awaitingConfirmation: "Väntar på din bekräftelse",
4389
+ confirmHint: "Svara ”ja” för att bekräfta, eller säg till agenten vad som ska ändras.",
4390
+ subject: "Ämne",
4391
+ newEvent: "Ny händelse",
4392
+ eventChange: "Ändring av händelse",
4393
+ deleteEvent: "Ta bort händelse",
4394
+ attendeesNotified: "Deltagarna meddelas.",
4395
+ title: "Titel",
4396
+ when: "När",
4397
+ location: "Plats",
4398
+ attendees: "Deltagare",
4399
+ description: "Beskrivning",
4400
+ emailSent: "Mejl skickat",
4401
+ eventCreated: "Händelse skapad",
4402
+ eventUpdated: "Händelse uppdaterad",
4403
+ eventDeleted: "Händelse borttagen",
4404
+ actionDone: "{{tool}} klar",
4405
+ actionFailed: "Misslyckades",
4406
+ openEmail: "Öppna mejl",
4407
+ openEvent: "Öppna händelse",
4408
+ replyInThread: "Svar i samma tråd",
4409
+ confirmSend: "Skicka",
4410
+ confirmCreate: "Skapa",
4411
+ confirmUpdate: "Spara ändringar",
4412
+ confirmDelete: "Ta bort",
4413
+ confirmGeneric: "Bekräfta",
4414
+ cancel: "Avbryt",
4415
+ confirming: "Bekräftar…",
4416
+ cancelling: "Avbryter…",
4417
+ verifying: "Kontrollerar status…",
4418
+ expiresIn: "Går ut om {{minutes}} min",
4419
+ expiresSoon: "Går ut om mindre än en minut",
4420
+ statusExecuting: "Körs…",
4421
+ statusExecuted: "Klart",
4422
+ statusRejected: "Avbruten",
4423
+ statusExpired: "Utgången: be om det igen i chatten",
4424
+ statusSuperseded: "Ersatt av en nyare version",
4425
+ statusInvalidated: "Kan inte längre köras: be om det igen",
4426
+ statusFailed: "Misslyckades",
4427
+ statusUnknown: "Okänt resultat: kontrollera innan du försöker igen",
4428
+ statusNotFound: "Inte tillgänglig i den här konversationen",
4429
+ toolUnavailable: "Verktyget för den här åtgärden är inte tillgängligt just nu",
4430
+ decisionError: "Ditt beslut kunde inte skickas. Försök igen."
4431
+ },
4432
+ no: {
4433
+ searchingMail: "Søker i {{service}}",
4434
+ readingMail: "Leser en e-post i {{service}}",
4435
+ checkingCalendar: "Sjekker {{service}}",
4436
+ savingDraft: "Lagrer et utkast i {{service}}",
4437
+ preparingMail: "Forbereder en e-post i {{service}}",
4438
+ preparingEvent: "Forbereder en endring i {{service}}",
4439
+ runningConfirmed: "Utfører de bekreftede handlingene",
4440
+ openIn: "Åpne i {{service}}",
4441
+ emailCountOne: "1 e-post",
4442
+ emailCountOther: "{{count}} e-poster",
4443
+ eventCountOne: "1 hendelse",
4444
+ eventCountOther: "{{count}} hendelser",
4445
+ noEmails: "Fant ingen e-poster",
4446
+ noEvents: "Ingen hendelser i denne perioden",
4447
+ showAll: "Vis alle ({{count}})",
4448
+ showLess: "Vis mindre",
4449
+ showMore: "Vis mer",
4450
+ allDay: "Hele dagen",
4451
+ to: "Til",
4452
+ cc: "Kopi",
4453
+ draftSaved: "Utkast lagret",
4454
+ openDraft: "Åpne utkast",
4455
+ attendeesOne: "1 deltaker",
4456
+ attendeesOther: "{{count}} deltakere",
4457
+ noSubject: "(intet emne)",
4458
+ unread: "Ulest",
4459
+ joinMeeting: "Bli med",
4460
+ awaitingConfirmation: "Venter på bekreftelsen din",
4461
+ confirmHint: "Svar «ja» for å bekrefte, eller si til agenten hva som skal endres.",
4462
+ subject: "Emne",
4463
+ newEvent: "Ny hendelse",
4464
+ eventChange: "Endring av hendelse",
4465
+ deleteEvent: "Slett hendelse",
4466
+ attendeesNotified: "Deltakerne blir varslet.",
4467
+ title: "Tittel",
4468
+ when: "Når",
4469
+ location: "Sted",
4470
+ attendees: "Deltakere",
4471
+ description: "Beskrivelse",
4472
+ emailSent: "E-post sendt",
4473
+ eventCreated: "Hendelse opprettet",
4474
+ eventUpdated: "Hendelse oppdatert",
4475
+ eventDeleted: "Hendelse slettet",
4476
+ actionDone: "{{tool}} fullført",
4477
+ actionFailed: "Mislyktes",
4478
+ openEmail: "Åpne e-post",
4479
+ openEvent: "Åpne hendelse",
4480
+ replyInThread: "Svar i samme tråd",
4481
+ confirmSend: "Send",
4482
+ confirmCreate: "Opprett",
4483
+ confirmUpdate: "Lagre endringer",
4484
+ confirmDelete: "Slett",
4485
+ confirmGeneric: "Bekreft",
4486
+ cancel: "Avbryt",
4487
+ confirming: "Bekrefter…",
4488
+ cancelling: "Avbryter…",
4489
+ verifying: "Sjekker status…",
4490
+ expiresIn: "Utløper om {{minutes}} min",
4491
+ expiresSoon: "Utløper om under ett minutt",
4492
+ statusExecuting: "Kjører…",
4493
+ statusExecuted: "Fullført",
4494
+ statusRejected: "Avbrutt",
4495
+ statusExpired: "Utløpt: be om det igjen i chatten",
4496
+ statusSuperseded: "Erstattet av en nyere versjon",
4497
+ statusInvalidated: "Kan ikke lenger utføres: be om det igjen",
4498
+ statusFailed: "Mislyktes",
4499
+ statusUnknown: "Ukjent resultat: sjekk før du prøver igjen",
4500
+ statusNotFound: "Ikke tilgjengelig i denne samtalen",
4501
+ toolUnavailable: "Verktøyet for denne handlingen er ikke tilgjengelig nå",
4502
+ decisionError: "Beslutningen din kunne ikke sendes. Prøv igjen."
4503
+ },
4504
+ pt: {
4505
+ searchingMail: "Pesquisando no {{service}}",
4506
+ readingMail: "Lendo um e-mail no {{service}}",
4507
+ checkingCalendar: "Consultando o {{service}}",
4508
+ savingDraft: "Salvando um rascunho no {{service}}",
4509
+ preparingMail: "Preparando um e-mail no {{service}}",
4510
+ preparingEvent: "Preparando uma alteração no {{service}}",
4511
+ runningConfirmed: "Executando as ações confirmadas",
4512
+ openIn: "Abrir no {{service}}",
4513
+ emailCountOne: "1 e-mail",
4514
+ emailCountOther: "{{count}} e-mails",
4515
+ eventCountOne: "1 evento",
4516
+ eventCountOther: "{{count}} eventos",
4517
+ noEmails: "Nenhum e-mail encontrado",
4518
+ noEvents: "Nenhum evento neste período",
4519
+ showAll: "Ver todos ({{count}})",
4520
+ showLess: "Ver menos",
4521
+ showMore: "Ver mais",
4522
+ allDay: "Dia inteiro",
4523
+ to: "Para",
4524
+ cc: "Cc",
4525
+ draftSaved: "Rascunho salvo",
4526
+ openDraft: "Abrir rascunho",
4527
+ attendeesOne: "1 participante",
4528
+ attendeesOther: "{{count}} participantes",
4529
+ noSubject: "(sem assunto)",
4530
+ unread: "Não lido",
4531
+ joinMeeting: "Entrar",
4532
+ awaitingConfirmation: "Aguardando sua confirmação",
4533
+ confirmHint: "Responda “sim” para confirmar, ou diga ao agente o que mudar.",
4534
+ subject: "Assunto",
4535
+ newEvent: "Novo evento",
4536
+ eventChange: "Alteração do evento",
4537
+ deleteEvent: "Excluir evento",
4538
+ attendeesNotified: "Os participantes serão avisados.",
4539
+ title: "Título",
4540
+ when: "Quando",
4541
+ location: "Local",
4542
+ attendees: "Participantes",
4543
+ description: "Descrição",
4544
+ emailSent: "E-mail enviado",
4545
+ eventCreated: "Evento criado",
4546
+ eventUpdated: "Evento atualizado",
4547
+ eventDeleted: "Evento excluído",
4548
+ actionDone: "{{tool}} concluído",
4549
+ actionFailed: "Falhou",
4550
+ openEmail: "Abrir e-mail",
4551
+ openEvent: "Abrir evento",
4552
+ replyInThread: "Resposta na mesma conversa",
4553
+ confirmSend: "Enviar",
4554
+ confirmCreate: "Criar",
4555
+ confirmUpdate: "Salvar alterações",
4556
+ confirmDelete: "Excluir",
4557
+ confirmGeneric: "Confirmar",
4558
+ cancel: "Cancelar",
4559
+ confirming: "Confirmando…",
4560
+ cancelling: "Cancelando…",
4561
+ verifying: "Verificando o status…",
4562
+ expiresIn: "Expira em {{minutes}} min",
4563
+ expiresSoon: "Expira em menos de um minuto",
4564
+ statusExecuting: "Executando…",
4565
+ statusExecuted: "Concluído",
4566
+ statusRejected: "Cancelada",
4567
+ statusExpired: "Expirada: peça novamente no chat",
4568
+ statusSuperseded: "Substituída por uma versão mais recente",
4569
+ statusInvalidated: "Não pode mais ser executada: peça novamente",
4570
+ statusFailed: "Falhou",
4571
+ statusUnknown: "Resultado desconhecido: verifique antes de tentar de novo",
4572
+ statusNotFound: "Indisponível nesta conversa",
4573
+ toolUnavailable: "A ferramenta desta ação não está disponível agora",
4574
+ decisionError: "Não foi possível enviar sua decisão. Tente novamente."
4575
+ }
4576
+ };
4577
+ function getPersonalConnectorCopy(locale) {
4578
+ return {
4579
+ ...ENGLISH,
4580
+ ...COPY[getSupportedToolLocale(locale)]
4581
+ };
4582
+ }
4583
+ function fillCopy(template, values) {
4584
+ return template.replace(/\{\{(\w+)\}\}/g, (match, key) => key in values ? String(values[key]) : match);
4585
+ }
4586
+
4587
+ //#endregion
4588
+ //#region src/components/tool-confirmation-controls.tsx
4589
+ const MINUTE = 6e4;
4590
+ /** Re-renders every `intervalMs` while `active`, for countdowns. */
4591
+ function useNow(active, intervalMs = 15e3) {
4592
+ const [now, setNow] = useState(() => Date.now());
4593
+ useEffect(() => {
4594
+ if (!active) return;
4595
+ setNow(Date.now());
4596
+ const timer = setInterval(() => setNow(Date.now()), intervalMs);
4597
+ return () => clearInterval(timer);
4598
+ }, [active, intervalMs]);
4599
+ return now;
4600
+ }
4601
+ /** Server state of a held action, with expiry kept current. */
4602
+ function useToolConfirmationState(pending, toolConfirmation) {
4603
+ const now = useNow((pending ? toolConfirmation?.states.items[pending.action_id] : void 0)?.status === "pending");
4604
+ return toolConfirmation && pending ? toolConfirmationAt(toolConfirmation.states, pending.action_id, now) : void 0;
4605
+ }
4606
+ function verbFor(operation, copy) {
4607
+ switch (operation) {
4608
+ case "send": return copy.confirmSend;
4609
+ case "create": return copy.confirmCreate;
4610
+ case "update": return copy.confirmUpdate;
4611
+ case "delete": return copy.confirmDelete;
4612
+ default: return copy.confirmGeneric;
4613
+ }
4614
+ }
4615
+ const STATUS_COPY = {
4616
+ executing: "statusExecuting",
4617
+ executed: "statusExecuted",
4618
+ rejected: "statusRejected",
4619
+ expired: "statusExpired",
4620
+ superseded: "statusSuperseded",
4621
+ invalidated: "statusInvalidated",
4622
+ failed: "statusFailed",
4623
+ unknown: "statusUnknown",
4624
+ not_found: "statusNotFound"
4625
+ };
4626
+ function statusLabel(status, copy) {
4627
+ const key = STATUS_COPY[status];
4628
+ return key ? copy[key] : null;
4629
+ }
4630
+ const BADGE_TONE = {
4631
+ pending: "border-amber-200 bg-amber-50 text-amber-800",
4632
+ executing: "border-sky-200 bg-sky-50 text-sky-800",
4633
+ executed: "border-emerald-200 bg-emerald-50 text-emerald-800",
4634
+ failed: "border-rose-200 bg-rose-50 text-rose-800",
4635
+ unknown: "border-amber-300 bg-amber-50 text-amber-900"
4636
+ };
4637
+ /** Header badge of a held action: "Awaiting your confirmation" or its outcome. */
4638
+ function ConfirmationBadge({ state, copy }) {
4639
+ const status = state?.status ?? "pending";
4640
+ const label = status === "pending" ? copy.awaitingConfirmation : statusLabel(status, copy);
4641
+ const Icon = status === "executed" ? CheckCircle2 : status === "failed" ? XCircle : status === "executing" ? LoaderCircle : Clock;
4642
+ return /* @__PURE__ */ jsxs("span", {
4643
+ className: joinClasses("ml-auto inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 font-medium", BADGE_TONE[status] ?? "border-neutral-200 bg-neutral-50 text-neutral-700"),
4644
+ "data-confirmation-status": status,
4645
+ children: [/* @__PURE__ */ jsx(Icon, {
4646
+ className: joinClasses("h-3 w-3", status === "executing" ? "animate-spin" : void 0),
4647
+ "aria-hidden": "true"
4648
+ }), label]
4649
+ });
4650
+ }
4651
+ function expiryText(state, serverOffsetMs, now, copy) {
4652
+ if (!state.expiresAt) return null;
4653
+ const left = Date.parse(state.expiresAt) - (now + serverOffsetMs);
4654
+ if (Number.isNaN(left) || left <= 0) return null;
4655
+ return left < MINUTE ? copy.expiresSoon : fillCopy(copy.expiresIn, { minutes: Math.floor(left / MINUTE) });
4656
+ }
4657
+ /**
4658
+ * Footer of a held action. Without `toolConfirmation` it keeps the text hint
4659
+ * (reply "yes"); with it, buttons once the server state is known.
4660
+ */
4661
+ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
4662
+ const state = useToolConfirmationState(pending, toolConfirmation);
4663
+ const now = useNow(state?.status === "pending");
4664
+ const [sending, setSending] = useState(null);
4665
+ const [failed, setFailed] = useState(false);
4666
+ if (!toolConfirmation) return /* @__PURE__ */ jsx("p", {
4667
+ className: "border-t border-amber-100 bg-amber-50/60 px-3 py-2 text-xs text-neutral-700",
4668
+ children: copy.confirmHint
4669
+ });
4670
+ if (!state) return /* @__PURE__ */ jsx("p", {
4671
+ className: "border-t border-neutral-100 bg-neutral-50 px-3 py-2 text-xs text-neutral-500",
4672
+ "aria-live": "polite",
4673
+ children: copy.verifying
4674
+ });
4675
+ if (state.status !== "pending") {
4676
+ const label = statusLabel(state.status, copy);
4677
+ return label ? /* @__PURE__ */ jsxs("p", {
4678
+ className: "border-t border-neutral-100 bg-neutral-50 px-3 py-2 text-xs text-neutral-700",
4679
+ "aria-live": "polite",
4680
+ children: [label, state.status === "failed" && state.error ? `: ${state.error}` : null]
4681
+ }) : null;
4682
+ }
4683
+ const decide = async (decision) => {
4684
+ setSending(decision);
4685
+ setFailed(false);
4686
+ try {
4687
+ await toolConfirmation.decide([{
4688
+ action_id: pending.action_id,
4689
+ decision
4690
+ }]);
4691
+ } catch {
4692
+ setFailed(true);
4693
+ } finally {
4694
+ setSending(null);
4695
+ }
4696
+ };
4697
+ const disabled = Boolean(toolConfirmation.disabled) || sending !== null;
4698
+ const destructive = pending.operation === "delete";
4699
+ const expiry = expiryText(state, toolConfirmation.states.serverOffsetMs, now, copy);
4700
+ const unavailable = state.error === "tool_unavailable";
4701
+ return /* @__PURE__ */ jsxs("div", {
4702
+ className: "flex flex-wrap items-center gap-2 border-t border-amber-100 bg-amber-50/60 px-3 py-2",
4703
+ "data-confirmation-actions": pending.action_id,
4704
+ children: [
4705
+ state.canConfirm ? /* @__PURE__ */ jsxs("button", {
4706
+ type: "button",
4707
+ disabled,
4708
+ onClick: () => void decide("confirm"),
4709
+ className: joinClasses("inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50", destructive ? "bg-rose-600 hover:bg-rose-700" : "bg-neutral-900 hover:bg-neutral-800"),
4710
+ children: [sending === "confirm" ? /* @__PURE__ */ jsx(LoaderCircle, {
4711
+ className: "mr-2 size-3 animate-spin",
4712
+ "aria-hidden": "true"
4713
+ }) : null, sending === "confirm" ? copy.confirming : verbFor(pending.operation, copy)]
4714
+ }) : null,
4715
+ state.canReject ? /* @__PURE__ */ jsxs("button", {
4716
+ type: "button",
4717
+ disabled,
4718
+ onClick: () => void decide("reject"),
4719
+ className: "inline-flex items-center rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-xs font-medium text-neutral-800 hover:bg-neutral-50 disabled:opacity-50",
4720
+ children: [sending === "reject" ? /* @__PURE__ */ jsx(LoaderCircle, {
4721
+ className: "mr-2 size-3 animate-spin",
4722
+ "aria-hidden": "true"
4723
+ }) : null, sending === "reject" ? copy.cancelling : copy.cancel]
4724
+ }) : null,
4725
+ /* @__PURE__ */ jsx("span", {
4726
+ className: "ml-auto text-xs text-neutral-600",
4727
+ "aria-live": "polite",
4728
+ children: failed ? copy.decisionError : unavailable ? copy.toolUnavailable : expiry
4729
+ })
4730
+ ]
4731
+ });
4732
+ }
4733
+
4734
+ //#endregion
4735
+ //#region src/components/tool-result-personal-connector-card.tsx
4736
+ const COLLAPSED_ITEMS = 5;
4737
+ const COLLAPSED_BODY_CHARS = 600;
4738
+ const EVENT_OPERATIONS = [
4739
+ "create_event",
4740
+ "update_event",
4741
+ "delete_event"
4742
+ ];
4743
+ function isEventOperation(value) {
4744
+ return EVENT_OPERATIONS.includes(value);
4745
+ }
4746
+ function asRecord(value) {
4747
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
4748
+ }
4749
+ function text(value) {
4750
+ return typeof value === "string" && value.trim().length > 0 ? value : null;
4751
+ }
4752
+ function hasId(value) {
4753
+ return typeof asRecord(value)?.id === "string";
4754
+ }
4755
+ function getView(part) {
4756
+ const metadata = asRecord(part.metadata);
4757
+ if (!metadata || metadata.error) return null;
4758
+ const result = metadata.result;
4759
+ const pending = asRecord(metadata.pending_confirmation);
4760
+ if (pending) {
4761
+ const confirmation = pending;
4762
+ if (!asRecord(confirmation.action)) return null;
4763
+ if (metadata.action === "send") return {
4764
+ kind: "pending-mail",
4765
+ pending: confirmation
4766
+ };
4767
+ return isEventOperation(metadata.action) ? {
4768
+ kind: "pending-event",
4769
+ operation: metadata.action,
4770
+ pending: confirmation
4771
+ } : null;
4772
+ }
4773
+ switch (metadata.action) {
4774
+ case "search": return Array.isArray(result) ? {
4775
+ kind: "mail-list",
4776
+ messages: result.filter(hasId)
4777
+ } : null;
4778
+ case "read": return hasId(result) ? {
4779
+ kind: "mail",
4780
+ message: result
4781
+ } : null;
4782
+ case "list_events": return Array.isArray(result) ? {
4783
+ kind: "events",
4784
+ events: result.filter(hasId)
4785
+ } : null;
4786
+ case "create_draft": {
4787
+ const input = asRecord(part.input);
4788
+ return {
4789
+ kind: "draft",
4790
+ link: text(asRecord(result)?.link),
4791
+ to: Array.isArray(input?.to) ? input.to.filter((item) => typeof item === "string") : [],
4792
+ subject: text(input?.subject),
4793
+ body: text(input?.body)
4794
+ };
4795
+ }
4796
+ default: return null;
4797
+ }
4798
+ }
4799
+ /** Whether the part has a dedicated view; otherwise the generic card renders it. */
4800
+ function hasPersonalConnectorView(part) {
4801
+ return part.state === "completed" && getView(part) !== null;
4802
+ }
4803
+ function getConnector(part) {
4804
+ const connector = asRecord(asRecord(part.metadata)?.connector);
4805
+ return connector && typeof connector.label === "string" ? connector : null;
4806
+ }
4807
+ function isCalendar(connector) {
4808
+ return connector?.capability.includes("calendar") ?? false;
4809
+ }
4810
+ function dateFormatter(locale, options) {
4811
+ try {
4812
+ return new Intl.DateTimeFormat(locale ?? void 0, options);
4813
+ } catch {
4814
+ return new Intl.DateTimeFormat(void 0, options);
4815
+ }
4816
+ }
4817
+ /** All-day values come as "YYYY-MM-DD": read them as local dates, not UTC. */
4818
+ function parseDate(value) {
4819
+ if (!value) return null;
4820
+ const dateOnly = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
4821
+ const date = dateOnly ? new Date(Number(dateOnly[1]), Number(dateOnly[2]) - 1, Number(dateOnly[3])) : new Date(value);
4822
+ return Number.isNaN(date.getTime()) ? null : date;
4823
+ }
4824
+ function isSameDay(a, b) {
4825
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
4826
+ }
4827
+ function formatMailDate(value, locale) {
4828
+ const date = parseDate(value);
4829
+ if (!date) return value ?? null;
4830
+ return isSameDay(date, /* @__PURE__ */ new Date()) ? dateFormatter(locale, {
4831
+ hour: "2-digit",
4832
+ minute: "2-digit"
4833
+ }).format(date) : dateFormatter(locale, {
4834
+ day: "numeric",
4835
+ month: "short"
4836
+ }).format(date);
4837
+ }
4838
+ function formatFullDate(value, locale) {
4839
+ const date = parseDate(value);
4840
+ if (!date) return value ?? null;
4841
+ return dateFormatter(locale, {
4842
+ dateStyle: "medium",
4843
+ timeStyle: "short"
4844
+ }).format(date);
4845
+ }
4846
+ /** "Ana Pérez <ana@acme.com>" → "Ana Pérez". */
4847
+ function displayName(address) {
4848
+ if (!address) return null;
4849
+ const match = /^\s*"?([^"<]+?)"?\s*<[^>]+>\s*$/.exec(address);
4850
+ return match ? match[1] : address;
4851
+ }
4852
+ function count(copy, n, one, other) {
4853
+ return n === 1 ? one : fillCopy(other, { count: n });
4854
+ }
4855
+ function ExternalAnchor({ href, className, children, label }) {
4856
+ return /* @__PURE__ */ jsx("a", {
4857
+ href,
4858
+ target: "_blank",
4859
+ rel: "noreferrer noopener",
4860
+ "aria-label": label,
4861
+ className: joinClasses("inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-950 hover:underline", className),
4862
+ children
4863
+ });
4864
+ }
4865
+ function ShowAllToggle({ total, expanded, onToggle, copy }) {
4866
+ if (total <= COLLAPSED_ITEMS) return null;
4867
+ return /* @__PURE__ */ jsx("button", {
4868
+ type: "button",
4869
+ onClick: onToggle,
4870
+ className: "w-full border-t border-neutral-200 px-3 py-2 text-left text-xs font-medium text-neutral-600 hover:bg-neutral-50 hover:text-neutral-950",
4871
+ children: expanded ? copy.showLess : fillCopy(copy.showAll, { count: total })
4872
+ });
4873
+ }
4874
+ function MailRow({ message, locale, copy }) {
4875
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
4876
+ /* @__PURE__ */ jsxs("div", {
4877
+ className: "flex items-baseline gap-2",
4878
+ children: [
4879
+ /* @__PURE__ */ jsx("span", {
4880
+ "aria-label": message.unread ? copy.unread : void 0,
4881
+ className: joinClasses("h-2 w-2 shrink-0 self-center rounded-full", message.unread ? "bg-blue-600" : "bg-transparent")
4882
+ }),
4883
+ /* @__PURE__ */ jsx("span", {
4884
+ className: joinClasses("min-w-0 flex-1 truncate text-sm", message.unread ? "font-semibold text-neutral-950" : "text-neutral-800"),
4885
+ children: displayName(message.from) ?? "—"
4886
+ }),
4887
+ /* @__PURE__ */ jsx("span", {
4888
+ className: "shrink-0 text-xs text-neutral-500",
4889
+ children: formatMailDate(message.date, locale)
4890
+ })
4891
+ ]
4892
+ }),
4893
+ /* @__PURE__ */ jsx("p", {
4894
+ className: joinClasses("truncate pl-4 text-sm", message.unread ? "font-medium text-neutral-950" : "text-neutral-700"),
4895
+ children: text(message.subject) ?? copy.noSubject
4896
+ }),
4897
+ text(message.snippet) ? /* @__PURE__ */ jsx("p", {
4898
+ className: "line-clamp-1 pl-4 text-xs text-neutral-500",
4899
+ children: message.snippet
4900
+ }) : null
4901
+ ] });
4902
+ const className = "block space-y-0.5 px-3 py-2";
4903
+ return message.link ? /* @__PURE__ */ jsx("a", {
4904
+ href: message.link,
4905
+ target: "_blank",
4906
+ rel: "noreferrer noopener",
4907
+ className: joinClasses(className, "hover:bg-neutral-50"),
4908
+ children: content
4909
+ }) : /* @__PURE__ */ jsx("div", {
4910
+ className,
4911
+ children: content
4912
+ });
4913
+ }
4914
+ function MailList({ messages, locale, copy }) {
4915
+ const [expanded, setExpanded] = useState(false);
4916
+ if (messages.length === 0) return /* @__PURE__ */ jsx("p", {
4917
+ className: "px-3 py-3 text-sm text-neutral-600",
4918
+ children: copy.noEmails
4919
+ });
4920
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("ul", {
4921
+ className: "divide-y divide-neutral-100",
4922
+ children: (expanded ? messages : messages.slice(0, COLLAPSED_ITEMS)).map((message) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(MailRow, {
4923
+ message,
4924
+ locale,
4925
+ copy
4926
+ }) }, message.id))
4927
+ }), /* @__PURE__ */ jsx(ShowAllToggle, {
4928
+ total: messages.length,
4929
+ expanded,
4930
+ onToggle: () => setExpanded((value) => !value),
4931
+ copy
4932
+ })] });
4933
+ }
4934
+ function MailMessageView({ message, connector, locale, copy }) {
4935
+ const [expanded, setExpanded] = useState(false);
4936
+ const body = text(message.body);
4937
+ const long = (body?.length ?? 0) > COLLAPSED_BODY_CHARS;
4938
+ const shownBody = body && long && !expanded ? `${body.slice(0, COLLAPSED_BODY_CHARS).trimEnd()}…` : body;
4939
+ return /* @__PURE__ */ jsxs("div", {
4940
+ className: "space-y-3 px-3 py-3",
4941
+ children: [
4942
+ /* @__PURE__ */ jsxs("div", {
4943
+ className: "space-y-1",
4944
+ children: [
4945
+ /* @__PURE__ */ jsx("h4", {
4946
+ className: "text-sm font-semibold text-neutral-950",
4947
+ children: text(message.subject) ?? copy.noSubject
4948
+ }),
4949
+ /* @__PURE__ */ jsxs("div", {
4950
+ className: "flex items-baseline gap-2 text-xs text-neutral-600",
4951
+ children: [/* @__PURE__ */ jsx("span", {
4952
+ className: "min-w-0 flex-1 truncate font-medium text-neutral-800",
4953
+ children: message.from ?? "—"
4954
+ }), /* @__PURE__ */ jsx("span", {
4955
+ className: "shrink-0",
4956
+ children: formatFullDate(message.date, locale)
4957
+ })]
4958
+ }),
4959
+ text(message.to) ? /* @__PURE__ */ jsxs("p", {
4960
+ className: "truncate text-xs text-neutral-500",
4961
+ children: [
4962
+ copy.to,
4963
+ ": ",
4964
+ message.to
4965
+ ]
4966
+ }) : null,
4967
+ text(message.cc) ? /* @__PURE__ */ jsxs("p", {
4968
+ className: "truncate text-xs text-neutral-500",
4969
+ children: [
4970
+ copy.cc,
4971
+ ": ",
4972
+ message.cc
4973
+ ]
4974
+ }) : null
4975
+ ]
4976
+ }),
4977
+ shownBody ? /* @__PURE__ */ jsx("p", {
4978
+ className: "whitespace-pre-wrap break-words text-sm leading-6 text-neutral-800",
4979
+ children: shownBody
4980
+ }) : null,
4981
+ /* @__PURE__ */ jsxs("div", {
4982
+ className: "flex items-center gap-4",
4983
+ children: [long ? /* @__PURE__ */ jsx("button", {
4984
+ type: "button",
4985
+ onClick: () => setExpanded((value) => !value),
4986
+ className: "text-xs font-medium text-neutral-600 hover:text-neutral-950",
4987
+ children: expanded ? copy.showLess : copy.showMore
4988
+ }) : null, message.link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
4989
+ href: message.link,
4990
+ children: [fillCopy(copy.openIn, { service: connector?.label ?? "" }), /* @__PURE__ */ jsx(ExternalLink, {
4991
+ className: "h-3 w-3",
4992
+ "aria-hidden": "true"
4993
+ })]
4994
+ }) : null]
4995
+ })
4996
+ ]
4997
+ });
4998
+ }
4999
+ function eventTime(event, locale, copy) {
5000
+ if (event.all_day) return copy.allDay;
5001
+ const start = parseDate(event.start);
5002
+ const end = parseDate(event.end);
5003
+ if (!start) return null;
5004
+ const time = dateFormatter(locale, {
5005
+ hour: "2-digit",
5006
+ minute: "2-digit"
5007
+ });
5008
+ return end ? `${time.format(start)} – ${time.format(end)}` : time.format(start);
5009
+ }
5010
+ function groupByDay(events) {
5011
+ const groups = [];
5012
+ for (const event of events) {
5013
+ const day = parseDate(event.start);
5014
+ const last = groups[groups.length - 1];
5015
+ if (last && (last.day && day && isSameDay(last.day, day) || !last.day && !day)) last.events.push(event);
5016
+ else groups.push({
5017
+ day,
5018
+ events: [event]
5019
+ });
5020
+ }
5021
+ return groups;
5022
+ }
5023
+ function EventRow({ event, locale, copy }) {
5024
+ const attendees = event.attendees?.length ?? 0;
5025
+ const details = [text(event.location), attendees > 0 ? count(copy, attendees, copy.attendeesOne, copy.attendeesOther) : null].filter(Boolean);
5026
+ return /* @__PURE__ */ jsxs("li", {
5027
+ className: "flex gap-3 px-3 py-2",
5028
+ children: [
5029
+ /* @__PURE__ */ jsx("span", {
5030
+ className: "w-24 shrink-0 pt-0.5 text-xs tabular-nums text-neutral-600",
5031
+ children: eventTime(event, locale, copy)
5032
+ }),
5033
+ /* @__PURE__ */ jsxs("div", {
5034
+ className: "min-w-0 flex-1 space-y-0.5",
5035
+ children: [event.link ? /* @__PURE__ */ jsx("a", {
5036
+ href: event.link,
5037
+ target: "_blank",
5038
+ rel: "noreferrer noopener",
5039
+ className: "block truncate text-sm font-medium text-neutral-950 hover:underline",
5040
+ children: text(event.title) ?? copy.noSubject
5041
+ }) : /* @__PURE__ */ jsx("p", {
5042
+ className: "truncate text-sm font-medium text-neutral-950",
5043
+ children: text(event.title) ?? copy.noSubject
5044
+ }), details.length > 0 ? /* @__PURE__ */ jsx("p", {
5045
+ className: "truncate text-xs text-neutral-500",
5046
+ children: details.join(" · ")
5047
+ }) : null]
5048
+ }),
5049
+ event.online_meeting_url ? /* @__PURE__ */ jsxs(ExternalAnchor, {
5050
+ href: event.online_meeting_url,
5051
+ className: "shrink-0 self-start",
5052
+ children: [/* @__PURE__ */ jsx(Video, {
5053
+ className: "h-3.5 w-3.5",
5054
+ "aria-hidden": "true"
5055
+ }), copy.joinMeeting]
5056
+ }) : null
5057
+ ]
5058
+ });
5059
+ }
5060
+ function Agenda({ events, locale, copy }) {
5061
+ const [expanded, setExpanded] = useState(false);
5062
+ if (events.length === 0) return /* @__PURE__ */ jsx("p", {
5063
+ className: "px-3 py-3 text-sm text-neutral-600",
5064
+ children: copy.noEvents
5065
+ });
5066
+ const visible = expanded ? events : events.slice(0, COLLAPSED_ITEMS);
5067
+ const dayFormat = dateFormatter(locale, {
5068
+ weekday: "long",
5069
+ day: "numeric",
5070
+ month: "long"
5071
+ });
5072
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
5073
+ className: "divide-y divide-neutral-100",
5074
+ children: groupByDay(visible).map((group, index) => /* @__PURE__ */ jsxs("section", { children: [group.day ? /* @__PURE__ */ jsx("h4", {
5075
+ className: "bg-neutral-50 px-3 py-1 text-xs font-medium capitalize text-neutral-600",
5076
+ children: dayFormat.format(group.day)
5077
+ }) : null, /* @__PURE__ */ jsx("ul", {
5078
+ className: "divide-y divide-neutral-100",
5079
+ children: group.events.map((event) => /* @__PURE__ */ jsx(EventRow, {
5080
+ event,
5081
+ locale,
5082
+ copy
5083
+ }, event.id))
5084
+ })] }, group.day?.toISOString() ?? `undated-${index}`))
5085
+ }), /* @__PURE__ */ jsx(ShowAllToggle, {
5086
+ total: events.length,
5087
+ expanded,
5088
+ onToggle: () => setExpanded((value) => !value),
5089
+ copy
5090
+ })] });
5091
+ }
5092
+ function CollapsibleBody({ body, copy }) {
5093
+ const [expanded, setExpanded] = useState(false);
5094
+ if (!body) return null;
5095
+ const long = body.length > COLLAPSED_BODY_CHARS;
5096
+ return /* @__PURE__ */ jsxs("div", {
5097
+ className: "space-y-1",
5098
+ children: [/* @__PURE__ */ jsx("p", {
5099
+ className: "whitespace-pre-wrap break-words text-sm leading-6 text-neutral-800",
5100
+ children: long && !expanded ? `${body.slice(0, COLLAPSED_BODY_CHARS).trimEnd()}…` : body
5101
+ }), long ? /* @__PURE__ */ jsx("button", {
5102
+ type: "button",
5103
+ onClick: () => setExpanded((value) => !value),
5104
+ className: "text-xs font-medium text-neutral-600 hover:text-neutral-950",
5105
+ children: expanded ? copy.showLess : copy.showMore
5106
+ }) : null]
5107
+ });
5108
+ }
5109
+ function DraftView({ view, copy }) {
5110
+ return /* @__PURE__ */ jsxs("div", {
5111
+ className: "space-y-2 px-3 py-3",
5112
+ children: [
5113
+ /* @__PURE__ */ jsxs("div", {
5114
+ className: "space-y-1",
5115
+ children: [
5116
+ /* @__PURE__ */ jsx("p", {
5117
+ className: "text-sm font-medium text-neutral-950",
5118
+ children: copy.draftSaved
5119
+ }),
5120
+ view.subject ? /* @__PURE__ */ jsx("p", {
5121
+ className: "truncate text-sm text-neutral-800",
5122
+ children: view.subject
5123
+ }) : null,
5124
+ view.to.length > 0 ? /* @__PURE__ */ jsxs("p", {
5125
+ className: "truncate text-xs text-neutral-500",
5126
+ children: [
5127
+ copy.to,
5128
+ ": ",
5129
+ view.to.join(", ")
5130
+ ]
5131
+ }) : null
5132
+ ]
5133
+ }),
5134
+ /* @__PURE__ */ jsx(CollapsibleBody, {
5135
+ body: view.body,
5136
+ copy
5137
+ }),
5138
+ view.link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
5139
+ href: view.link,
5140
+ children: [copy.openDraft, /* @__PURE__ */ jsx(ExternalLink, {
5141
+ className: "h-3 w-3",
5142
+ "aria-hidden": "true"
5143
+ })]
5144
+ }) : null
5145
+ ]
5146
+ });
5147
+ }
5148
+ function strings(value) {
5149
+ return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
5150
+ }
5151
+ function Field({ label, children }) {
5152
+ return /* @__PURE__ */ jsxs("div", {
5153
+ className: "flex gap-3 text-sm",
5154
+ children: [/* @__PURE__ */ jsx("dt", {
5155
+ className: "w-24 shrink-0 text-xs leading-5 text-neutral-500",
5156
+ children: label
5157
+ }), /* @__PURE__ */ jsx("dd", {
5158
+ className: "min-w-0 flex-1 break-words text-neutral-900",
5159
+ children
5160
+ })]
5161
+ });
5162
+ }
5163
+ function PendingMailView({ pending, copy }) {
5164
+ const mail = pending.action;
5165
+ const to = strings(mail.to);
5166
+ const cc = strings(mail.cc);
5167
+ return /* @__PURE__ */ jsxs("div", {
5168
+ className: "space-y-3 px-3 py-3",
5169
+ children: [
5170
+ /* @__PURE__ */ jsxs("dl", {
5171
+ className: "space-y-1.5",
5172
+ children: [
5173
+ /* @__PURE__ */ jsx(Field, {
5174
+ label: copy.to,
5175
+ children: to.join(", ") || "—"
5176
+ }),
5177
+ cc.length > 0 ? /* @__PURE__ */ jsx(Field, {
5178
+ label: copy.cc,
5179
+ children: cc.join(", ")
5180
+ }) : null,
5181
+ /* @__PURE__ */ jsx(Field, {
5182
+ label: copy.subject,
5183
+ children: /* @__PURE__ */ jsx("span", {
5184
+ className: "font-medium",
5185
+ children: text(mail.subject) ?? copy.noSubject
5186
+ })
5187
+ })
5188
+ ]
5189
+ }),
5190
+ text(mail.reply_to_message_id) ? /* @__PURE__ */ jsx("p", {
5191
+ className: "text-xs text-neutral-500",
5192
+ children: copy.replyInThread
5193
+ }) : null,
5194
+ /* @__PURE__ */ jsx("div", {
5195
+ className: "rounded-md border border-neutral-200 bg-neutral-50 px-3 py-2",
5196
+ children: /* @__PURE__ */ jsx(CollapsibleBody, {
5197
+ body: text(mail.body),
5198
+ copy
5199
+ })
5200
+ })
5201
+ ]
5202
+ });
5203
+ }
5204
+ function formatRange(start, end, allDay, locale, copy) {
5205
+ const from = parseDate(text(start));
5206
+ if (!from) return null;
5207
+ const day = dateFormatter(locale, {
5208
+ weekday: "short",
5209
+ day: "numeric",
5210
+ month: "short"
5211
+ }).format(from);
5212
+ if (allDay) return `${day} · ${copy.allDay}`;
5213
+ const time = dateFormatter(locale, {
5214
+ hour: "2-digit",
5215
+ minute: "2-digit"
5216
+ });
5217
+ const to = parseDate(text(end));
5218
+ return to ? `${day} · ${time.format(from)} – ${time.format(to)}` : `${day} · ${time.format(from)}`;
5219
+ }
5220
+ /** Old value struck through next to the new one; only the new one if unknown. */
5221
+ function Change({ before, after }) {
5222
+ if (before === null || before === void 0 || before === after) return /* @__PURE__ */ jsx(Fragment, { children: after });
5223
+ return /* @__PURE__ */ jsxs("span", {
5224
+ className: "flex flex-wrap items-baseline gap-x-2",
5225
+ children: [
5226
+ /* @__PURE__ */ jsx("span", {
5227
+ className: "text-neutral-500 line-through",
5228
+ children: before
5229
+ }),
5230
+ /* @__PURE__ */ jsx("span", {
5231
+ "aria-hidden": "true",
5232
+ children: "→"
5233
+ }),
5234
+ /* @__PURE__ */ jsx("span", { children: after })
5235
+ ]
5236
+ });
5237
+ }
5238
+ function PendingEventView({ operation, pending, locale, copy }) {
5239
+ const action = pending.action;
5240
+ const current = asRecord(pending.current);
5241
+ const has = (key) => action[key] !== void 0 && action[key] !== null;
5242
+ if (operation === "delete_event") return /* @__PURE__ */ jsxs("div", {
5243
+ className: "space-y-1 px-3 py-3",
5244
+ children: [
5245
+ /* @__PURE__ */ jsx("p", {
5246
+ className: "text-xs font-medium uppercase tracking-wide text-rose-700",
5247
+ children: copy.deleteEvent
5248
+ }),
5249
+ /* @__PURE__ */ jsx("p", {
5250
+ className: "text-sm font-medium text-neutral-900 line-through",
5251
+ children: text(current?.title) ?? text(action.event_id) ?? copy.noSubject
5252
+ }),
5253
+ current ? /* @__PURE__ */ jsx("p", {
5254
+ className: "text-xs text-neutral-500",
5255
+ children: formatRange(current.start, current.end, Boolean(current.all_day), locale, copy)
5256
+ }) : null,
5257
+ (current?.attendees?.length ?? 0) > 0 ? /* @__PURE__ */ jsx("p", {
5258
+ className: "pt-1 text-xs text-neutral-600",
5259
+ children: copy.attendeesNotified
5260
+ }) : null
5261
+ ]
5262
+ });
5263
+ const isUpdate = operation === "update_event";
5264
+ const before = (key) => isUpdate && current ? current[key] : null;
5265
+ const attendees = strings(action.attendees);
5266
+ const timesChanged = has("start") || has("end");
5267
+ const newWhen = formatRange(action.start ?? current?.start, action.end ?? current?.end, Boolean(current?.all_day) && !timesChanged, locale, copy);
5268
+ const oldWhen = isUpdate && current && timesChanged ? formatRange(current.start, current.end, Boolean(current.all_day), locale, copy) : null;
5269
+ return /* @__PURE__ */ jsxs("div", {
5270
+ className: "space-y-2 px-3 py-3",
5271
+ children: [
5272
+ /* @__PURE__ */ jsx("p", {
5273
+ className: "text-xs font-medium uppercase tracking-wide text-neutral-500",
5274
+ children: isUpdate ? copy.eventChange : copy.newEvent
5275
+ }),
5276
+ /* @__PURE__ */ jsxs("dl", {
5277
+ className: "space-y-1.5",
5278
+ children: [
5279
+ has("title") || !isUpdate ? /* @__PURE__ */ jsx(Field, {
5280
+ label: copy.title,
5281
+ children: /* @__PURE__ */ jsx("span", {
5282
+ className: "font-medium",
5283
+ children: /* @__PURE__ */ jsx(Change, {
5284
+ before: text(before("title")),
5285
+ after: text(action.title) ?? copy.noSubject
5286
+ })
5287
+ })
5288
+ }) : current ? /* @__PURE__ */ jsx(Field, {
5289
+ label: copy.title,
5290
+ children: /* @__PURE__ */ jsx("span", {
5291
+ className: "font-medium",
5292
+ children: text(current.title)
5293
+ })
5294
+ }) : null,
5295
+ newWhen && (timesChanged || !isUpdate) ? /* @__PURE__ */ jsx(Field, {
5296
+ label: copy.when,
5297
+ children: /* @__PURE__ */ jsx(Change, {
5298
+ before: oldWhen,
5299
+ after: newWhen
5300
+ })
5301
+ }) : null,
5302
+ has("location") ? /* @__PURE__ */ jsx(Field, {
5303
+ label: copy.location,
5304
+ children: /* @__PURE__ */ jsx(Change, {
5305
+ before: text(before("location")),
5306
+ after: text(action.location)
5307
+ })
5308
+ }) : null,
5309
+ has("attendees") ? /* @__PURE__ */ jsx(Field, {
5310
+ label: copy.attendees,
5311
+ children: /* @__PURE__ */ jsx(Change, {
5312
+ before: strings(before("attendees")).join(", ") || null,
5313
+ after: attendees.join(", ") || "—"
5314
+ })
5315
+ }) : null,
5316
+ has("description") ? /* @__PURE__ */ jsx(Field, {
5317
+ label: copy.description,
5318
+ children: /* @__PURE__ */ jsx("span", {
5319
+ className: "whitespace-pre-wrap",
5320
+ children: text(action.description)
5321
+ })
5322
+ }) : null
5323
+ ]
5324
+ }),
5325
+ attendees.length > 0 ? /* @__PURE__ */ jsx("p", {
5326
+ className: "text-xs text-neutral-600",
5327
+ children: copy.attendeesNotified
5328
+ }) : null
5329
+ ]
5330
+ });
5331
+ }
5332
+ function headerCount(view, copy) {
5333
+ if (view.kind === "mail-list") return count(copy, view.messages.length, copy.emailCountOne, copy.emailCountOther);
5334
+ if (view.kind === "events") return count(copy, view.events.length, copy.eventCountOne, copy.eventCountOther);
5335
+ return null;
5336
+ }
5337
+ function ToolResultPersonalConnectorCard({ part, locale, className, toolConfirmation }) {
5338
+ const view = getView(part);
5339
+ const pending = view?.kind === "pending-mail" || view?.kind === "pending-event" ? view.pending : null;
5340
+ const confirmationState = useToolConfirmationState(pending, toolConfirmation);
5341
+ if (!view) return null;
5342
+ const copy = getPersonalConnectorCopy(locale);
5343
+ const connector = getConnector(part);
5344
+ const Icon = isCalendar(connector) ? CalendarDays : Mail;
5345
+ const total = headerCount(view, copy);
5346
+ const isPending = view.kind === "pending-mail" || view.kind === "pending-event";
5347
+ return /* @__PURE__ */ jsxs("section", {
5348
+ className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-neutral-200 bg-white text-neutral-950", className),
5349
+ "data-tool-call-id": part.id,
5350
+ "data-tool-call-state": part.state,
5351
+ "data-connector-action": view.kind,
5352
+ children: [
5353
+ /* @__PURE__ */ jsxs("header", {
5354
+ className: "flex items-center gap-2 border-b border-neutral-200 px-3 py-2 text-xs text-neutral-600",
5355
+ children: [
5356
+ /* @__PURE__ */ jsx(Icon, {
5357
+ className: "h-4 w-4 shrink-0 text-neutral-700",
5358
+ "aria-hidden": "true"
5359
+ }),
5360
+ /* @__PURE__ */ jsx("span", {
5361
+ className: "shrink-0 font-medium text-neutral-900",
5362
+ children: connector?.label
5363
+ }),
5364
+ connector?.account_email ? /* @__PURE__ */ jsx("span", {
5365
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
5366
+ children: connector.account_email
5367
+ }) : null,
5368
+ isPending ? /* @__PURE__ */ jsx(ConfirmationBadge, {
5369
+ state: confirmationState,
5370
+ copy
5371
+ }) : total ? /* @__PURE__ */ jsx("span", {
5372
+ className: "ml-auto shrink-0",
5373
+ children: total
5374
+ }) : null
5375
+ ]
5376
+ }),
5377
+ view.kind === "mail-list" ? /* @__PURE__ */ jsx(MailList, {
5378
+ messages: view.messages,
5379
+ locale,
5380
+ copy
5381
+ }) : view.kind === "mail" ? /* @__PURE__ */ jsx(MailMessageView, {
5382
+ message: view.message,
5383
+ connector,
5384
+ locale,
5385
+ copy
5386
+ }) : view.kind === "events" ? /* @__PURE__ */ jsx(Agenda, {
5387
+ events: view.events,
5388
+ locale,
5389
+ copy
5390
+ }) : view.kind === "pending-mail" ? /* @__PURE__ */ jsx(PendingMailView, {
5391
+ pending: view.pending,
5392
+ copy
5393
+ }) : view.kind === "pending-event" ? /* @__PURE__ */ jsx(PendingEventView, {
5394
+ operation: view.operation,
5395
+ pending: view.pending,
5396
+ locale,
5397
+ copy
5398
+ }) : /* @__PURE__ */ jsx(DraftView, {
5399
+ view,
5400
+ copy
5401
+ }),
5402
+ pending ? /* @__PURE__ */ jsx(PendingConfirmationFooter, {
5403
+ pending,
5404
+ toolConfirmation,
5405
+ copy
5406
+ }) : null
5407
+ ]
5408
+ });
5409
+ }
5410
+ const DONE_LABELS = {
5411
+ send: "emailSent",
5412
+ create_event: "eventCreated",
5413
+ update_event: "eventUpdated",
5414
+ delete_event: "eventDeleted"
5415
+ };
5416
+ function getConfirmedActions(part) {
5417
+ const actions = asRecord(part.metadata)?.actions;
5418
+ return Array.isArray(actions) ? actions.filter((action) => typeof asRecord(action)?.action_id === "string") : [];
5419
+ }
5420
+ /** Whether the confirmation result can be shown as a list of outcomes. */
5421
+ function hasToolConfirmationView(part) {
5422
+ return part.state !== "pending" && getConfirmedActions(part).length > 0;
5423
+ }
5424
+ function ConfirmedActionRow({ action, copy }) {
5425
+ const metadata = asRecord(action.metadata);
5426
+ const connector = asRecord(metadata?.connector);
5427
+ const operation = typeof metadata?.action === "string" ? metadata.action : "";
5428
+ const doneKey = DONE_LABELS[operation];
5429
+ const failed = action.status === "failed";
5430
+ const executed = action.status === "executed";
5431
+ const label = doneKey ? copy[doneKey] : fillCopy(copy.actionDone, { tool: action.tool_name ?? "" });
5432
+ const link = text(asRecord(metadata?.result)?.link);
5433
+ const outcome = action.error === "tool_unavailable" ? copy.toolUnavailable : statusLabel(action.status, copy);
5434
+ const title = executed ? label : failed ? `${copy.actionFailed}: ${label}` : action.tool_name ? `${outcome}: ${action.tool_name}` : outcome;
5435
+ return /* @__PURE__ */ jsxs("li", {
5436
+ className: "flex items-start gap-2 px-3 py-2",
5437
+ "data-confirmation-status": action.status,
5438
+ children: [
5439
+ failed ? /* @__PURE__ */ jsx(XCircle, {
5440
+ className: "mt-0.5 h-4 w-4 shrink-0 text-rose-600",
5441
+ "aria-hidden": "true"
5442
+ }) : executed ? /* @__PURE__ */ jsx(CheckCircle2, {
5443
+ className: "mt-0.5 h-4 w-4 shrink-0 text-emerald-600",
5444
+ "aria-hidden": "true"
5445
+ }) : /* @__PURE__ */ jsx(Clock, {
5446
+ className: "mt-0.5 h-4 w-4 shrink-0 text-neutral-500",
5447
+ "aria-hidden": "true"
5448
+ }),
5449
+ /* @__PURE__ */ jsxs("div", {
5450
+ className: "min-w-0 flex-1 space-y-0.5",
5451
+ children: [
5452
+ /* @__PURE__ */ jsx("p", {
5453
+ className: "text-sm font-medium text-neutral-950",
5454
+ children: title
5455
+ }),
5456
+ connector ? /* @__PURE__ */ jsxs("div", {
5457
+ className: "flex items-center gap-2 truncate text-xs text-neutral-500",
5458
+ children: [connector.label, connector.account_email ? /* @__PURE__ */ jsx("span", {
5459
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
5460
+ children: connector.account_email
5461
+ }) : null]
5462
+ }) : null,
5463
+ failed && text(action.error) ? /* @__PURE__ */ jsx("p", {
5464
+ className: "line-clamp-2 text-xs text-rose-700",
5465
+ children: action.error
5466
+ }) : null
5467
+ ]
5468
+ }),
5469
+ executed && link ? /* @__PURE__ */ jsx(ExternalAnchor, {
5470
+ href: link,
5471
+ className: "shrink-0",
5472
+ children: operation === "send" ? copy.openEmail : copy.openEvent
5473
+ }) : null
5474
+ ]
5475
+ });
5476
+ }
5477
+ function ToolResultToolConfirmationCard({ part, locale, className }) {
5478
+ const actions = getConfirmedActions(part);
5479
+ if (actions.length === 0) return null;
5480
+ const copy = getPersonalConnectorCopy(locale);
5481
+ return /* @__PURE__ */ jsx("ul", {
5482
+ className: joinClasses("plai-tool-result-tool-confirmation-card divide-y divide-neutral-100 overflow-hidden rounded-lg border border-neutral-200 bg-white text-neutral-950", className),
5483
+ "data-tool-call-id": part.id,
5484
+ "data-tool-call-state": part.state,
5485
+ children: actions.map((action) => /* @__PURE__ */ jsx(ConfirmedActionRow, {
5486
+ action,
5487
+ copy
5488
+ }, action.action_id))
5489
+ });
5490
+ }
5491
+ function getPendingConfirmation(part) {
5492
+ const pending = asRecord(asRecord(part.metadata)?.pending_confirmation);
5493
+ return pending && asRecord(pending.action) ? pending : null;
5494
+ }
5495
+ function formatValue(value) {
5496
+ if (typeof value === "string") return value;
5497
+ return JSON.stringify(value, null, 2);
5498
+ }
5499
+ /** Generic preview of a held tool call: its name and the exact arguments. */
5500
+ function ToolResultPendingConfirmationCard({ part, locale, className, toolConfirmation }) {
5501
+ const pending = getPendingConfirmation(part);
5502
+ const confirmationState = useToolConfirmationState(pending, toolConfirmation);
5503
+ if (!pending) return null;
5504
+ const copy = getPersonalConnectorCopy(locale);
5505
+ const entries = Object.entries(pending.action).filter(([key, value]) => key !== "operation" && value !== null && value !== void 0);
5506
+ return /* @__PURE__ */ jsxs("section", {
5507
+ className: joinClasses("plai-tool-result-pending-confirmation-card overflow-hidden rounded-lg border border-neutral-200 bg-white text-neutral-950", className),
5508
+ "data-tool-call-id": part.id,
5509
+ "data-tool-call-state": part.state,
5510
+ children: [
5511
+ /* @__PURE__ */ jsxs("header", {
5512
+ className: "flex items-center gap-2 border-b border-neutral-200 px-3 py-2 text-xs text-neutral-600",
5513
+ children: [/* @__PURE__ */ jsx("span", {
5514
+ className: "truncate font-mono font-medium text-neutral-900",
5515
+ children: part.name
5516
+ }), /* @__PURE__ */ jsx(ConfirmationBadge, {
5517
+ state: confirmationState,
5518
+ copy
5519
+ })]
5520
+ }),
5521
+ entries.length > 0 ? /* @__PURE__ */ jsx("dl", {
5522
+ className: "space-y-1.5 px-3 py-3",
5523
+ children: entries.map(([key, value]) => /* @__PURE__ */ jsx(Field, {
5524
+ label: key,
5525
+ children: /* @__PURE__ */ jsx("span", {
5526
+ className: "whitespace-pre-wrap font-mono text-xs",
5527
+ children: formatValue(value)
5528
+ })
5529
+ }, key))
5530
+ }) : null,
5531
+ /* @__PURE__ */ jsx(PendingConfirmationFooter, {
5532
+ pending,
5533
+ toolConfirmation,
5534
+ copy
5535
+ })
5536
+ ]
5537
+ });
5538
+ }
5539
+
3851
5540
  //#endregion
3852
5541
  //#region src/components/tool-result-workflow-dispatch-card.tsx
3853
5542
  function parseResult(value) {
@@ -3898,7 +5587,7 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
3898
5587
  children: copy.workflow
3899
5588
  }),
3900
5589
  /* @__PURE__ */ jsx("span", {
3901
- className: "min-w-0 truncate text-neutral-600",
5590
+ className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
3902
5591
  children: workflowName
3903
5592
  }),
3904
5593
  /* @__PURE__ */ jsxs("span", {
@@ -3989,7 +5678,9 @@ const TOOL_USE_ACTIONS = {
3989
5678
  mcp_tool: "request",
3990
5679
  office_documents: "documents",
3991
5680
  perplexity: "web",
5681
+ personal_connector: "tool",
3992
5682
  structured_datasource: "query",
5683
+ tool_confirmation: "tool",
3993
5684
  workflow_dispatch: "workflow",
3994
5685
  unknown: "tool"
3995
5686
  };
@@ -4105,7 +5796,35 @@ const TOOL_USE_TRANSLATIONS = {
4105
5796
  workflow: "Executando o fluxo {{toolName}}"
4106
5797
  }
4107
5798
  };
5799
+ const PERSONAL_CONNECTOR_SERVICES = {
5800
+ gmail: "Gmail",
5801
+ google_calendar: "Google Calendar",
5802
+ outlook_mail: "Outlook Mail",
5803
+ outlook_calendar: "Outlook Calendar"
5804
+ };
5805
+ const PERSONAL_CONNECTOR_ACTIONS = {
5806
+ search: "searchingMail",
5807
+ read: "readingMail",
5808
+ list_events: "checkingCalendar",
5809
+ create_draft: "savingDraft",
5810
+ send: "preparingMail",
5811
+ create_event: "preparingEvent",
5812
+ update_event: "preparingEvent",
5813
+ delete_event: "preparingEvent"
5814
+ };
5815
+ const PERSONAL_CONNECTOR_TOOL_NAME = /^(gmail|google_calendar|outlook_mail|outlook_calendar)_(.+?)(?:_\d+)?$/;
5816
+ function getPersonalConnectorLabel(name, locale) {
5817
+ const match = PERSONAL_CONNECTOR_TOOL_NAME.exec(name);
5818
+ const key = match ? PERSONAL_CONNECTOR_ACTIONS[match[2]] : void 0;
5819
+ if (!match || !key) return null;
5820
+ return fillCopy(getPersonalConnectorCopy(locale)[key], { service: PERSONAL_CONNECTOR_SERVICES[match[1]] });
5821
+ }
4108
5822
  function getToolUseLabel(part, locale) {
5823
+ if (part.toolType === "personal_connector") {
5824
+ const label = getPersonalConnectorLabel(part.name, locale);
5825
+ if (label) return label;
5826
+ }
5827
+ if (part.toolType === "tool_confirmation") return getPersonalConnectorCopy(locale).runningConfirmed;
4109
5828
  const action = part.toolType ? TOOL_USE_ACTIONS[part.toolType] ?? "tool" : "tool";
4110
5829
  return TOOL_USE_TRANSLATIONS[getSupportedToolLocale(locale)][action].replaceAll("{{toolName}}", part.name);
4111
5830
  }
@@ -4141,7 +5860,7 @@ function getDatasourceResources$1(part) {
4141
5860
  const resources = part.metadata.resources;
4142
5861
  return Array.isArray(resources) ? resources.filter(isDatasourceResource) : [];
4143
5862
  }
4144
- function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAgentThread, getResourceDownloadUrl, memoryProposal }) {
5863
+ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAgentThread, getResourceDownloadUrl, memoryProposal, toolConfirmation }) {
4145
5864
  const copy = getUiCopy(locale);
4146
5865
  if (part.toolType === "memory_proposal") {
4147
5866
  const proposal = part.metadata?.proposal;
@@ -4159,11 +5878,22 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
4159
5878
  locale,
4160
5879
  className
4161
5880
  });
5881
+ if (part.toolType === "tool_confirmation" && hasToolConfirmationView(part)) return /* @__PURE__ */ jsx(ToolResultToolConfirmationCard, {
5882
+ part,
5883
+ locale,
5884
+ className
5885
+ });
4162
5886
  if (part.state === "error") return /* @__PURE__ */ jsx(ToolError, {
4163
5887
  part,
4164
5888
  locale,
4165
5889
  className
4166
5890
  });
5891
+ if (part.toolType !== "personal_connector" && getPendingConfirmation(part)) return /* @__PURE__ */ jsx(ToolResultPendingConfirmationCard, {
5892
+ part,
5893
+ locale,
5894
+ className,
5895
+ toolConfirmation
5896
+ });
4167
5897
  const officeMediaFiles = getOfficeDocumentMediaFiles(part);
4168
5898
  const datasourceResources = getDatasourceResources$1(part);
4169
5899
  if (part.toolType === "email_send") return /* @__PURE__ */ jsx(ToolResultEmailSendCard, {
@@ -4202,6 +5932,12 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
4202
5932
  locale,
4203
5933
  className
4204
5934
  });
5935
+ if (part.toolType === "personal_connector" && hasPersonalConnectorView(part)) return /* @__PURE__ */ jsx(ToolResultPersonalConnectorCard, {
5936
+ part,
5937
+ locale,
5938
+ className,
5939
+ toolConfirmation
5940
+ });
4205
5941
  if (part.toolType === "workflow_dispatch") return /* @__PURE__ */ jsx(ToolResultWorkflowDispatchCard, {
4206
5942
  part,
4207
5943
  locale,
@@ -4230,7 +5966,7 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
4230
5966
  className: "text-sm font-semibold text-slate-900",
4231
5967
  children: part.name
4232
5968
  }), /* @__PURE__ */ jsx("span", {
4233
- className: "rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-xs font-medium text-emerald-800",
5969
+ className: "rounded-full border uppercase border-emerald-200 bg-emerald-50 px-2 py-0.5 text-xs text-emerald-800",
4234
5970
  children: copy.completed
4235
5971
  })]
4236
5972
  }),
@@ -4425,7 +6161,7 @@ function getMessageTextClassName(role) {
4425
6161
  function getMessageTextAlignmentClassName(role) {
4426
6162
  return role === "user" ? "text-right" : "text-left";
4427
6163
  }
4428
- function renderPart(part, index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName) {
6164
+ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName, toolConfirmation) {
4429
6165
  const copy = getUiCopy(locale);
4430
6166
  if (part.type === "text") {
4431
6167
  if (renderText) return /* @__PURE__ */ jsx("div", { children: renderText(part, {
@@ -4484,7 +6220,8 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
4484
6220
  locale,
4485
6221
  onOpenAgentThread,
4486
6222
  getResourceDownloadUrl,
4487
- memoryProposal
6223
+ memoryProposal,
6224
+ toolConfirmation
4488
6225
  }, `tool-${part.id}-${index}`);
4489
6226
  }
4490
6227
  if (part.type === "thinking") {
@@ -4541,7 +6278,7 @@ function aggregateSourceToolParts(parts, position) {
4541
6278
  ...remainingParts.slice(insertionIndex)
4542
6279
  ];
4543
6280
  }
4544
- function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD, sourceToolResultsLayout = "aggregated", sourceToolResultsPosition, maxVisibleSourceCards = 3, datasourceToolResultsPosition, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, isStreaming = false, thinkingLabel, completedThinkingLabel, readMoreLabel, readLessLabel, className,...props }) {
6281
+ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD, sourceToolResultsLayout = "aggregated", sourceToolResultsPosition, maxVisibleSourceCards = 3, datasourceToolResultsPosition, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, toolConfirmation, renderText, renderToolCall, renderThinking, isStreaming = false, thinkingLabel, completedThinkingLabel, readMoreLabel, readLessLabel, className,...props }) {
4545
6282
  const copy = getUiCopy(locale);
4546
6283
  const [isExpanded, setIsExpanded] = useState(false);
4547
6284
  const textContent = useMemo(() => message.parts.filter((part) => part.type === "text").map((part) => part.text).join("\n"), [message.parts]);
@@ -4572,7 +6309,7 @@ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD,
4572
6309
  locale,
4573
6310
  maxVisible: maxVisibleSourceCards,
4574
6311
  getResourceDownloadUrl
4575
- }, `source-results-${item.index}`) : renderPart(item.part, item.index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName)), canCollapse ? /* @__PURE__ */ jsx("button", {
6312
+ }, `source-results-${item.index}`) : renderPart(item.part, item.index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName, toolConfirmation)), canCollapse ? /* @__PURE__ */ jsx("button", {
4576
6313
  type: "button",
4577
6314
  className: "text-xs font-medium text-slate-600 hover:text-slate-900",
4578
6315
  onClick: () => setIsExpanded((previous) => !previous),
@@ -4662,6 +6399,7 @@ function isRoutedMessageProps(props) {
4662
6399
  function Message(props) {
4663
6400
  if (!isRoutedMessageProps(props)) return /* @__PURE__ */ jsx(MessageRoot, { ...props });
4664
6401
  const { message, avatar, footer, messageClassName, contentClassName, partsClassName, toolResultsClassName, toolPartsClassName, messagePartsProps, getResourceDownloadUrl, className,...rootProps } = props;
6402
+ if (isHiddenMessage(message)) return null;
4665
6403
  const routedMessagePartsProps = getResourceDownloadUrl ? {
4666
6404
  ...messagePartsProps,
4667
6405
  getResourceDownloadUrl
@@ -4706,14 +6444,14 @@ function Message(props) {
4706
6444
 
4707
6445
  //#endregion
4708
6446
  //#region src/components/clipboard.tsx
4709
- async function writeTextToClipboard(text$1) {
6447
+ async function writeTextToClipboard(text$2) {
4710
6448
  if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
4711
- await navigator.clipboard.writeText(text$1);
6449
+ await navigator.clipboard.writeText(text$2);
4712
6450
  return;
4713
6451
  }
4714
6452
  if (typeof document === "undefined") throw new Error("Clipboard is not available in this environment.");
4715
6453
  const textarea = document.createElement("textarea");
4716
- textarea.value = text$1;
6454
+ textarea.value = text$2;
4717
6455
  textarea.setAttribute("readonly", "");
4718
6456
  textarea.style.position = "fixed";
4719
6457
  textarea.style.opacity = "0";
@@ -4725,7 +6463,7 @@ async function writeTextToClipboard(text$1) {
4725
6463
  textarea.remove();
4726
6464
  }
4727
6465
  }
4728
- function Clipboard({ text: text$1, onCopy, copiedDuration = 2e3, copyLabel, copiedLabel, locale, children, className, disabled, onClick, type = "button",...props }) {
6466
+ function Clipboard({ text: text$2, onCopy, copiedDuration = 2e3, copyLabel, copiedLabel, locale, children, className, disabled, onClick, type = "button",...props }) {
4729
6467
  const copy = getUiCopy(locale);
4730
6468
  const resolvedCopyLabel = copyLabel ?? copy.copy;
4731
6469
  const resolvedCopiedLabel = copiedLabel ?? copy.copied;
@@ -4740,12 +6478,12 @@ function Clipboard({ text: text$1, onCopy, copiedDuration = 2e3, copyLabel, copi
4740
6478
  if (event.defaultPrevented || disabled || isCopying) return;
4741
6479
  setIsCopying(true);
4742
6480
  try {
4743
- await writeTextToClipboard(text$1);
6481
+ await writeTextToClipboard(text$2);
4744
6482
  setIsCopied(true);
4745
6483
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4746
6484
  timeoutRef.current = setTimeout(() => setIsCopied(false), copiedDuration);
4747
6485
  try {
4748
- await onCopy?.(text$1);
6486
+ await onCopy?.(text$2);
4749
6487
  } catch {}
4750
6488
  } catch {
4751
6489
  setIsCopied(false);
@@ -4965,10 +6703,10 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
4965
6703
  if (!canSubmit) return;
4966
6704
  setIsSubmitting(true);
4967
6705
  try {
4968
- const text$1 = value.trim();
6706
+ const text$2 = value.trim();
4969
6707
  const selectedFiles = [...files];
4970
6708
  await onSubmit({
4971
- text: text$1,
6709
+ text: text$2,
4972
6710
  ...enabledTools ? { enabledTools } : {},
4973
6711
  files: selectedFiles
4974
6712
  });
@@ -5195,10 +6933,10 @@ function useSpeechToText({ transcribe, onTranscriptionComplete, onTranscriptionE
5195
6933
  if (operationIdRef.current !== operationId) return null;
5196
6934
  const transcription = await optionsRef.current.transcribe(audio, abortController.signal);
5197
6935
  if (operationIdRef.current !== operationId) return null;
5198
- const text$1 = transcription.trim();
5199
- if (!text$1) return null;
5200
- optionsRef.current.onTranscriptionComplete?.(text$1);
5201
- return text$1;
6936
+ const text$2 = transcription.trim();
6937
+ if (!text$2) return null;
6938
+ optionsRef.current.onTranscriptionComplete?.(text$2);
6939
+ return text$2;
5202
6940
  } catch (error) {
5203
6941
  if (operationIdRef.current !== operationId || abortController.signal.aborted || isAbortError(error)) return null;
5204
6942
  optionsRef.current.onTranscriptionError?.(normalizeError(error, "Transcription failed"));
@@ -5302,5 +7040,5 @@ async function dummyTranscribeAudio(_audio, signal) {
5302
7040
  }
5303
7041
 
5304
7042
  //#endregion
5305
- export { AggregatedSourceResults, ArrowUp, AssistantMessage, ChatError, Clipboard, DatasourceFolderCard, DatasourceToolResources, DatasourceToolResultCard, Loader, MemoryProposalCard, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageParts, MessageRoot, Microphone, PROMPT_FORM_FILE_ACCEPT, Paperclip, PromptForm, PromptFormAttachButton, PromptFormIconButton, Reload, ResourceCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SpeechToTextToggle, Stop, Thinking, ThumbDown, ThumbUp, ToolError, ToolResultAgentInvocationCard, ToolResultBrowserCard, ToolResultCard, ToolResultExternalDatasourceCard, ToolResultHttpRequestCard, ToolResultMcpCard, ToolResultOfficeDocumentsCard, ToolResultWebSearchCard, ToolResultWorkflowDispatchCard, ToolUseIndicator, UserMessage, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, getToolUseLabel, isAllowedPromptFormFile, partitionPromptFormFiles, useSpeechToText };
7043
+ export { AggregatedSourceResults, ArrowUp, AssistantMessage, ChatError, Clipboard, ConfirmationBadge, DatasourceFolderCard, DatasourceToolResources, DatasourceToolResultCard, Loader, MemoryProposalCard, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageParts, MessageRoot, Microphone, PROMPT_FORM_FILE_ACCEPT, Paperclip, PendingConfirmationFooter, PromptForm, PromptFormAttachButton, PromptFormIconButton, Reload, ResourceCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SpeechToTextToggle, Stop, Thinking, ThumbDown, ThumbUp, ToolError, ToolResultAgentInvocationCard, ToolResultBrowserCard, ToolResultCard, ToolResultExternalDatasourceCard, ToolResultHttpRequestCard, ToolResultMcpCard, ToolResultOfficeDocumentsCard, ToolResultPendingConfirmationCard, ToolResultPersonalConnectorCard, ToolResultToolConfirmationCard, ToolResultWebSearchCard, ToolResultWorkflowDispatchCard, ToolUseIndicator, UserMessage, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getPendingConfirmation, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, getToolUseLabel, hasPersonalConnectorView, hasToolConfirmationView, isAllowedPromptFormFile, partitionPromptFormFiles, useSpeechToText };
5306
7044
  //# sourceMappingURL=index.js.map